@softpak/components 21.2.0-capwesome.1 → 21.2.0-capwesome.10
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/softpak-components-spx-app-expiry.mjs +5 -5
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +6 -38
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-channel-selection.mjs +65 -16
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-confirm.mjs +17 -25
- package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-haptics.mjs +54 -0
- package/fesm2022/softpak-components-spx-haptics.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-helpers.mjs +9 -1
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +14 -21
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +12 -18
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-storage.mjs +1 -0
- package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +9 -23
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-tabs.mjs +8 -11
- package/fesm2022/softpak-components-spx-tabs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +22 -39
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-translate.mjs +41 -2
- package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +109 -69
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-welcome.mjs +2 -2
- package/fesm2022/softpak-components-spx-welcome.mjs.map +1 -1
- package/package.json +5 -1
- package/tailwind.css +1 -1
- package/types/softpak-components-spx-button.d.ts +1 -4
- package/types/softpak-components-spx-channel-selection.d.ts +38 -7
- package/types/softpak-components-spx-confirm.d.ts +21 -33
- package/types/softpak-components-spx-haptics.d.ts +13 -0
- package/types/softpak-components-spx-helpers.d.ts +3 -1
- package/types/softpak-components-spx-navigation.d.ts +20 -36
- package/types/softpak-components-spx-spinner.d.ts +14 -27
- package/types/softpak-components-spx-storage.d.ts +2 -1
- package/types/softpak-components-spx-suggestion.d.ts +1 -1
- package/types/softpak-components-spx-tabs.d.ts +8 -17
- package/types/softpak-components-spx-toaster.d.ts +55 -91
- package/types/softpak-components-spx-translate.d.ts +27 -1
- package/types/softpak-components-spx-update.d.ts +46 -27
|
@@ -2,10 +2,6 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { DateTime } from 'luxon';
|
|
4
4
|
|
|
5
|
-
const spxCheckExpiryWarning = (appStoreVersion, spxAppExpiry) => {
|
|
6
|
-
return spxAppExpiry !== undefined && appStoreVersion.substring(0, 3) !== spxAppExpiry.requiredVersion.substring(0, 3) && DateTime.now() > spxAppExpiry.warning;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
5
|
const spxCheckExpiryFinalWarning = (appStoreVersion, spxAppExpiry) => {
|
|
10
6
|
return spxAppExpiry !== undefined && appStoreVersion.substring(0, 3) !== spxAppExpiry.requiredVersion.substring(0, 3) && DateTime.now() > spxAppExpiry.finalWarning;
|
|
11
7
|
};
|
|
@@ -14,6 +10,10 @@ const spxCheckExpiryHappened = (appStoreVersion, spxAppExpiry) => {
|
|
|
14
10
|
return spxAppExpiry !== undefined && appStoreVersion.substring(0, 3) !== spxAppExpiry.requiredVersion.substring(0, 3) && DateTime.now() > spxAppExpiry.expiry;
|
|
15
11
|
};
|
|
16
12
|
|
|
13
|
+
const spxCheckExpiryWarning = (appStoreVersion, spxAppExpiry) => {
|
|
14
|
+
return spxAppExpiry !== undefined && appStoreVersion.substring(0, 3) !== spxAppExpiry.requiredVersion.substring(0, 3) && DateTime.now() > spxAppExpiry.warning;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
17
|
class SpxAppExpiryComponent {
|
|
18
18
|
constructor() {
|
|
19
19
|
this.txtContactHelpdeskOrSoftpak = input.required(...(ngDevMode ? [{ debugName: "txtContactHelpdeskOrSoftpak" }] : []));
|
|
@@ -36,7 +36,7 @@ class SpxAppExpiryComponent {
|
|
|
36
36
|
if (spxExpiry && spxVersion) {
|
|
37
37
|
this.expired.set(spxCheckExpiryHappened(spxVersion, spxExpiry));
|
|
38
38
|
this.finalWarning.set(spxCheckExpiryFinalWarning(spxVersion, spxExpiry) && !this.expired());
|
|
39
|
-
this.warning.set(spxCheckExpiryWarning(spxVersion, spxExpiry) && !this.finalWarning && !this.expired());
|
|
39
|
+
this.warning.set(spxCheckExpiryWarning(spxVersion, spxExpiry) && !this.finalWarning() && !this.expired());
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxAppExpiryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-app-expiry.mjs","sources":["../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-warning.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-app-expiry.mjs","sources":["../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-final-warning.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-happened.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-warning.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-app-expiry.component.ts","../../../../projects/softpak/components/spx-app-expiry/spx-app-expiry.component.html","../../../../projects/softpak/components/spx-app-expiry/softpak-components-spx-app-expiry.ts"],"sourcesContent":["import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryFinalWarning = (appStoreVersion: string, spxAppExpiry?: SpxAppExpiryI) => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.finalWarning;\n}","import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryHappened = (appStoreVersion: string, spxAppExpiry: SpxAppExpiryI): boolean => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.expiry;\n}","import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryWarning = (appStoreVersion: string, spxAppExpiry?: SpxAppExpiryI): boolean => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.warning;\n}","import { ChangeDetectionStrategy, Component, OnChanges, input, signal } from '@angular/core';\n\nimport { SpxAppExpiryI } from './spx-app-expiry.interface';\nimport { spxCheckExpiryFinalWarning } from './spx-check-expiry-final-warning.interface';\nimport { spxCheckExpiryHappened } from './spx-check-expiry-happened.interface';\nimport { spxCheckExpiryWarning } from './spx-check-expiry-warning.interface';\n\n@Component({\n selector: 'spx-app-expiry',\n imports: [],\n templateUrl: './spx-app-expiry.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush, \n standalone: true,\n})\nexport class SpxAppExpiryComponent implements OnChanges {\n readonly txtContactHelpdeskOrSoftpak = input.required<string>();\n readonly txtExpired = input.required<string>();\n readonly txtLastReminder = input.required<string>();\n readonly txtPleaseOpenTheAppStore = input.required<string>();\n readonly txtPleaseUpdate = input.required<string>();\n readonly txtThisVersionWillExpireSoon = input.required<string>();\n readonly txtUpdateAvailable = input.required<string>();\n readonly txtUpdateTheAppToTheLatestVersion = input.required<string>();\n readonly spxExpiry = input.required<SpxAppExpiryI>();\n readonly spxVersion = input.required<string>();\n warning = signal<boolean>(false);\n finalWarning = signal<boolean>(false);\n expired = signal<boolean>(false);\n ngOnChanges(): void {\n const spxExpiry = this.spxExpiry();\n const spxVersion = this.spxVersion();\n if (spxExpiry && spxVersion) {\n this.expired.set(spxCheckExpiryHappened(spxVersion, spxExpiry));\n this.finalWarning.set(spxCheckExpiryFinalWarning(spxVersion, spxExpiry) && !this.expired());\n this.warning.set(spxCheckExpiryWarning(spxVersion, spxExpiry) && !this.finalWarning() && !this.expired());\n }\n }\n}\n","@if (warning() || finalWarning() || expired()) {\n <div class=\"m-3\">\n <div\n class=\"p-3 font-bold text-white rounded-t text-xl\"\n [class.bg-lime-600]=\"warning()\"\n [class.bg-red-600]=\"expired()\"\n [class.bg-amber-600]=\"finalWarning()\">\n @if (warning()) {\n {{ txtUpdateAvailable() }}\n }\n @if (finalWarning()) {\n {{ txtLastReminder() }}\n }\n @if (expired()) {\n {{ txtExpired() }}\n }\n </div>\n <div\n class=\"bg-amber-50 p-3 text-black rounded-b mb-3\">\n <div>{{ txtPleaseOpenTheAppStore() }}.</div>\n <div>{{ txtUpdateTheAppToTheLatestVersion() }}.</div>\n <div>{{ txtContactHelpdeskOrSoftpak() }}.</div>\n @if (finalWarning()) {\n <div>{{ txtThisVersionWillExpireSoon() }}.</div>\n }\n </div>\n </div>\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAGa,0BAA0B,GAAG,CAAC,eAAuB,EAAE,YAA4B,KAAI;AAClG,IAAA,OAAO,YAAY,KAAK,SAAS,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,KAAK,YAAY,CAAC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A,UAAA,EAAA,CAAA;kBAPjC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,WACjB,EAAE,EAAA,eAAA,EAEM,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,g1BAAA,EAAA;;;AEZpB;;AAEG;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, output, viewChild, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { ImpactStyle } from '@capacitor/haptics';
|
|
4
3
|
import { IsSeverityPipe } from '@softpak/components/spx-pipes';
|
|
5
4
|
import { NgClass } from '@angular/common';
|
|
5
|
+
import { SpxHaptics } from '@softpak/components/spx-haptics';
|
|
6
6
|
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
7
7
|
|
|
8
8
|
class SpxButtonComponent {
|
|
@@ -22,11 +22,7 @@ class SpxButtonComponent {
|
|
|
22
22
|
this.spxClick = output();
|
|
23
23
|
this.buttonRef = viewChild('buttonRef', ...(ngDevMode ? [{ debugName: "buttonRef" }] : []));
|
|
24
24
|
this.SpxSeverity = SpxSeverityEnum;
|
|
25
|
-
|
|
26
|
-
this.isPressing = false;
|
|
27
|
-
this.lastHaptic = 0;
|
|
28
|
-
this.hapticCooldown = 120;
|
|
29
|
-
//
|
|
25
|
+
this.spxHaptics = new SpxHaptics();
|
|
30
26
|
this.hasShadowDom = (el) => {
|
|
31
27
|
return !!el.shadowRoot && !!el.attachShadow;
|
|
32
28
|
};
|
|
@@ -40,51 +36,23 @@ class SpxButtonComponent {
|
|
|
40
36
|
if (this.spxDisabled()) {
|
|
41
37
|
return;
|
|
42
38
|
}
|
|
43
|
-
this.
|
|
44
|
-
await this.safeHaptic(ImpactStyle.Medium);
|
|
39
|
+
this.spxHaptics.pressDown();
|
|
45
40
|
};
|
|
46
|
-
// global pointerup: check of de release binnen of buiten de knop is
|
|
47
41
|
this.onDocumentPointerUp = async (event) => {
|
|
48
|
-
if (
|
|
42
|
+
if (this.spxDisabled()) {
|
|
49
43
|
return;
|
|
50
44
|
}
|
|
51
|
-
this.isPressing = false;
|
|
52
45
|
const btn = this.buttonRef()?.nativeElement;
|
|
53
46
|
if (!btn) {
|
|
54
47
|
return;
|
|
55
48
|
}
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
if (inside) {
|
|
59
|
-
// OK haptic
|
|
60
|
-
await this.safeHaptic(ImpactStyle.Heavy);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
// Cancel haptic
|
|
64
|
-
await this.safeHaptic(ImpactStyle.Light);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
// Silence if no haptics
|
|
69
|
-
}
|
|
49
|
+
const wasInsideElement = btn.contains(event.target);
|
|
50
|
+
this.spxHaptics.pointerUp(wasInsideElement);
|
|
70
51
|
};
|
|
71
52
|
}
|
|
72
53
|
spxSetFocus() {
|
|
73
54
|
this.buttonRef()?.nativeElement?.focus();
|
|
74
55
|
}
|
|
75
|
-
async safeHaptic(style) {
|
|
76
|
-
const now = performance.now();
|
|
77
|
-
if (now - this.lastHaptic < this.hapticCooldown) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
this.lastHaptic = now;
|
|
81
|
-
try {
|
|
82
|
-
// await Haptics.impact({ style });
|
|
83
|
-
}
|
|
84
|
-
catch {
|
|
85
|
-
// Silence if no haptics
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
56
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
89
57
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.0", type: SpxButtonComponent, isStandalone: true, selector: "spx-button", inputs: { spxDisabled: { classPropertyName: "spxDisabled", publicName: "spxDisabled", isSignal: true, isRequired: false, transformFunction: null }, spxClass: { classPropertyName: "spxClass", publicName: "spxClass", isSignal: true, isRequired: false, transformFunction: null }, spxClassObject: { classPropertyName: "spxClassObject", publicName: "spxClassObject", isSignal: true, isRequired: false, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: false, transformFunction: null }, spxFullHeight: { classPropertyName: "spxFullHeight", publicName: "spxFullHeight", isSignal: true, isRequired: false, transformFunction: null }, spxFullWidth: { classPropertyName: "spxFullWidth", publicName: "spxFullWidth", isSignal: true, isRequired: false, transformFunction: null }, spxSeverity: { classPropertyName: "spxSeverity", publicName: "spxSeverity", isSignal: true, isRequired: false, transformFunction: null }, spxSize: { classPropertyName: "spxSize", publicName: "spxSize", isSignal: true, isRequired: false, transformFunction: null }, spxTabIndex: { classPropertyName: "spxTabIndex", publicName: "spxTabIndex", isSignal: true, isRequired: false, transformFunction: null }, spxType: { classPropertyName: "spxType", publicName: "spxType", isSignal: true, isRequired: false, transformFunction: null }, spxName: { classPropertyName: "spxName", publicName: "spxName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { spxClick: "spxClick" }, host: { listeners: { "document:pointerup": "onDocumentPointerUp($event)" }, properties: { "class.block": "spxFullWidth()", "class.h-full": "spxFullHeight()", "class.w-full": "spxFullWidth()" } }, viewQueries: [{ propertyName: "buttonRef", first: true, predicate: ["buttonRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #buttonRef\n class=\"border border-transparent font-bold px-4 relative rounded text-center text-white focus:outline-none focus:ring-2 focus:ring-offset-2 bg-gradient-to-r\"\n [class.h-full]=\"this.spxFullHeight()\"\n [class.w-full]=\"this.spxFullWidth()\"\n [class.bg-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.from-red-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.to-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.focus:ring-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.from-lime-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.to-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.focus:ring-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.from-amber-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.to-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.py-2]=\"!this.spxSize() || this.spxSize() === 'lg'\"\n [class.py-4]=\"!this.spxSize() || this.spxSize() === 'xl'\"\n [class.text-xl]=\"this.spxSize() === 'xl'\"\n [class.text-lg]=\"this.spxSize() === 'lg'\"\n [class.cursor-pointer]=\"!this.spxDisabled()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-50]=\"this.spxDisabled()\"\n [class.focus:ring-0]=\"this.spxDisabled()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\"\n [attr.disabled]=\"this.spxDisabled() ? this.spxDisabled() : undefined\"\n [attr.form]=\"this.spxForm() ? this.spxForm() : undefined\"\n [attr.name]=\"this.mappedName()\"\n [attr.tabindex]=\"this.spxTabIndex() ? this.spxTabIndex() : undefined\"\n [attr.type]=\"this.spxType() ? this.spxType() : undefined\"\n (pointerdown)=\"this.handlePress()\"\n (click)=\"this.handleClick()\"\n part=\"button\">\n <ng-content></ng-content>\n </button>", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: IsSeverityPipe, name: "isSeverity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
90
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-button.mjs","sources":["../../../../projects/softpak/components/spx-button/spx-button.component.ts","../../../../projects/softpak/components/spx-button/spx-button.component.html","../../../../projects/softpak/components/spx-button/softpak-components-spx-button.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n computed,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { Haptics, ImpactStyle } from '@capacitor/haptics';\n\nimport { IsSeverityPipe } from '@softpak/components/spx-pipes';\nimport { NgClass } from '@angular/common';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-button',\n imports: [NgClass, IsSeverityPipe],\n templateUrl: './spx-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.block]': 'spxFullWidth()',\n '[class.h-full]': 'spxFullHeight()',\n '[class.w-full]': 'spxFullWidth()',\n },\n standalone: true,\n})\nexport class SpxButtonComponent {\n readonly spxDisabled = input(false);\n readonly spxClass = input<string>();\n readonly spxClassObject = input<object>();\n readonly spxForm = input<string>();\n readonly spxFullHeight = input<boolean>();\n readonly spxFullWidth = input<boolean>();\n readonly spxSeverity = input<SpxSeverityEnum | undefined>(SpxSeverityEnum.info);\n readonly spxSize = input<'lg' | 'xl'>('lg');\n readonly spxTabIndex = input<number>();\n readonly spxType = input<'button' | 'submit'>('submit');\n protected mappedName = computed(() => this.spxName() ?? undefined);\n readonly spxName = input<string>();\n spxClick = output();\n buttonRef = viewChild<ElementRef<HTMLInputElement>>('buttonRef');\n SpxSeverity = SpxSeverityEnum;\n\n // For haptics\n private isPressing = false;\n private lastHaptic = 0;\n private hapticCooldown = 120;\n //\n\n hasShadowDom = (el: HTMLElement) => {\n return !!el.shadowRoot && !!(el as any).attachShadow;\n };\n handleClick = () => {\n if (!this.spxDisabled()) {\n this.spxClick.emit();\n }\n };\n\n spxSetFocus(): void {\n this.buttonRef()?.nativeElement?.focus();\n }\n\n // For haptics\n handlePress = async () => {\n if (this.spxDisabled()) {\n return;\n }\n this.isPressing = true;\n await this.safeHaptic(ImpactStyle.Medium);\n };\n\n // global pointerup: check of de release binnen of buiten de knop is\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (!this.isPressing || this.spxDisabled()) {\n return;\n }\n this.isPressing = false;\n\n const btn = this.buttonRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const inside = btn.contains(event.target as Node);\n\n try {\n if (inside) {\n // OK haptic\n await this.safeHaptic(ImpactStyle.Heavy);\n } else {\n // Cancel haptic\n await this.safeHaptic(ImpactStyle.Light);\n }\n } catch {\n // Silence if no haptics\n }\n };\n\n private async safeHaptic(style: ImpactStyle) {\n const now = performance.now();\n if (now - this.lastHaptic < this.hapticCooldown) {\n return;\n }\n this.lastHaptic = now;\n\n try {\n // await Haptics.impact({ style });\n } catch {\n // Silence if no haptics\n }\n }\n // End haptics\n}\n","<button\n #buttonRef\n class=\"border border-transparent font-bold px-4 relative rounded text-center text-white focus:outline-none focus:ring-2 focus:ring-offset-2 bg-gradient-to-r\"\n [class.h-full]=\"this.spxFullHeight()\"\n [class.w-full]=\"this.spxFullWidth()\"\n [class.bg-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.from-red-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.to-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.focus:ring-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.from-lime-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.to-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.focus:ring-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.from-amber-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.to-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.py-2]=\"!this.spxSize() || this.spxSize() === 'lg'\"\n [class.py-4]=\"!this.spxSize() || this.spxSize() === 'xl'\"\n [class.text-xl]=\"this.spxSize() === 'xl'\"\n [class.text-lg]=\"this.spxSize() === 'lg'\"\n [class.cursor-pointer]=\"!this.spxDisabled()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-50]=\"this.spxDisabled()\"\n [class.focus:ring-0]=\"this.spxDisabled()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\"\n [attr.disabled]=\"this.spxDisabled() ? this.spxDisabled() : undefined\"\n [attr.form]=\"this.spxForm() ? this.spxForm() : undefined\"\n [attr.name]=\"this.mappedName()\"\n [attr.tabindex]=\"this.spxTabIndex() ? this.spxTabIndex() : undefined\"\n [attr.type]=\"this.spxType() ? this.spxType() : undefined\"\n (pointerdown)=\"this.handlePress()\"\n (click)=\"this.handleClick()\"\n part=\"button\">\n <ng-content></ng-content>\n </button>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MA4Ba,kBAAkB,CAAA;AAZ/B,IAAA,WAAA,GAAA;AAaW,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,KAAK,uDAAC;QAC1B,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAC1B,IAAA,CAAA,cAAc,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAChC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EA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CAAA,WAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5B/B,4qEAkCW,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDhBC,OAAO,+EAAE,cAAc,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAUtB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,SAAS;+BACE,YAAY,EAAA,OAAA,EACb,CAAC,OAAO,EAAE,cAAc,CAAC,EAAA,eAAA,EAEjB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,eAAe,EAAE,gBAAgB;AACjC,wBAAA,gBAAgB,EAAE,iBAAiB;AACnC,wBAAA,gBAAgB,EAAE,gBAAgB;AACnC,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,4qEAAA,EAAA;osCAgBoC,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,CAAA;sBAgC9D,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AE1EhD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-button.mjs","sources":["../../../../projects/softpak/components/spx-button/spx-button.component.ts","../../../../projects/softpak/components/spx-button/spx-button.component.html","../../../../projects/softpak/components/spx-button/softpak-components-spx-button.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n computed,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { Haptics, ImpactStyle } from '@capacitor/haptics';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\n\nimport { IsSeverityPipe } from '@softpak/components/spx-pipes';\nimport { NgClass } from '@angular/common';\nimport { SpxHaptics } from '@softpak/components/spx-haptics';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-button',\n imports: [NgClass, IsSeverityPipe],\n templateUrl: './spx-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.block]': 'spxFullWidth()',\n '[class.h-full]': 'spxFullHeight()',\n '[class.w-full]': 'spxFullWidth()',\n },\n standalone: true,\n})\nexport class SpxButtonComponent {\n readonly spxDisabled = input(false);\n readonly spxClass = input<string>();\n readonly spxClassObject = input<object>();\n readonly spxForm = input<string>();\n readonly spxFullHeight = input<boolean>();\n readonly spxFullWidth = input<boolean>();\n readonly spxSeverity = input<SpxSeverityEnum | undefined>(SpxSeverityEnum.info);\n readonly spxSize = input<'lg' | 'xl'>('lg');\n readonly spxTabIndex = input<number>();\n readonly spxType = input<'button' | 'submit'>('submit');\n protected mappedName = computed(() => this.spxName() ?? undefined);\n readonly spxName = input<string>();\n spxClick = output();\n buttonRef = viewChild<ElementRef<HTMLInputElement>>('buttonRef');\n SpxSeverity = SpxSeverityEnum;\n private spxHaptics: SpxHaptics = new SpxHaptics();\n\n hasShadowDom = (el: HTMLElement) => {\n return !!el.shadowRoot && !!(el as any).attachShadow;\n };\n handleClick = () => {\n if (!this.spxDisabled()) {\n this.spxClick.emit();\n }\n };\n\n spxSetFocus(): void {\n this.buttonRef()?.nativeElement?.focus();\n }\n\n // For haptics\n handlePress = async () => {\n if (this.spxDisabled()) {\n return;\n }\n this.spxHaptics.pressDown();\n };\n\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (this.spxDisabled()) {\n return;\n }\n\n const btn = this.buttonRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const wasInsideElement = btn.contains(event.target as Node);\n this.spxHaptics.pointerUp(wasInsideElement);\n };\n // End haptics\n}\n","<button\n #buttonRef\n class=\"border border-transparent font-bold px-4 relative rounded text-center text-white focus:outline-none focus:ring-2 focus:ring-offset-2 bg-gradient-to-r\"\n [class.h-full]=\"this.spxFullHeight()\"\n [class.w-full]=\"this.spxFullWidth()\"\n [class.bg-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.from-red-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.to-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.focus:ring-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.from-lime-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.to-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.focus:ring-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.from-amber-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.to-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.py-2]=\"!this.spxSize() || this.spxSize() === 'lg'\"\n [class.py-4]=\"!this.spxSize() || this.spxSize() === 'xl'\"\n [class.text-xl]=\"this.spxSize() === 'xl'\"\n [class.text-lg]=\"this.spxSize() === 'lg'\"\n [class.cursor-pointer]=\"!this.spxDisabled()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-50]=\"this.spxDisabled()\"\n [class.focus:ring-0]=\"this.spxDisabled()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\"\n [attr.disabled]=\"this.spxDisabled() ? this.spxDisabled() : undefined\"\n [attr.form]=\"this.spxForm() ? this.spxForm() : undefined\"\n [attr.name]=\"this.mappedName()\"\n [attr.tabindex]=\"this.spxTabIndex() ? this.spxTabIndex() : undefined\"\n [attr.type]=\"this.spxType() ? this.spxType() : undefined\"\n (pointerdown)=\"this.handlePress()\"\n (click)=\"this.handleClick()\"\n part=\"button\">\n <ng-content></ng-content>\n </button>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MA8Ba,kBAAkB,CAAA;AAZ/B,IAAA,WAAA,GAAA;AAaW,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,KAAK,uDAAC;QAC1B,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAC1B,IAAA,CAAA,cAAc,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAChC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QACzB,IAAA,CAAA,aAAa,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,eAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAChC,IAAA,CAAA,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;AAC/B,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAA8B,eAAe,CAAC,IAAI,uDAAC;AACtE,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAc,IAAI,mDAAC;QAClC,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC7B,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A,CAAA,WAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC9B/B,4qEAkCW,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDdC,OAAO,+EAAE,cAAc,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAUtB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,SAAS;+BACE,YAAY,EAAA,OAAA,EACb,CAAC,OAAO,EAAE,cAAc,CAAC,EAAA,eAAA,EAEjB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,eAAe,EAAE,gBAAgB;AACjC,wBAAA,gBAAgB,EAAE,iBAAiB;AACnC,wBAAA,gBAAgB,EAAE,gBAAgB;AACnC,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,4qEAAA,EAAA;osCAgBoC,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,CAAA;sBAyB9D,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AErEhD;;AAEG;;;;"}
|
|
@@ -6,21 +6,27 @@ import { Capacitor } from '@capacitor/core';
|
|
|
6
6
|
import { NavController } from '@ionic/angular/standalone';
|
|
7
7
|
import { SpxButtonComponent } from '@softpak/components/spx-button';
|
|
8
8
|
import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
|
|
9
|
-
import { createActionGroup, props, createFeature, createReducer, on, Store } from '@ngrx/store';
|
|
10
|
-
import { TranslatePipe } from '@ngx-translate/core';
|
|
11
|
-
import { map } from 'rxjs';
|
|
9
|
+
import { createActionGroup, props, createFeature, createReducer, on, createSelector, Store } from '@ngrx/store';
|
|
10
|
+
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
|
|
11
|
+
import { map, of, from } from 'rxjs';
|
|
12
12
|
import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
|
|
13
|
-
import { spxTextChange } from '@softpak/components/spx-translate';
|
|
13
|
+
import { spxTextChange, spxTextLiveUpdateChannelSetFailed } from '@softpak/components/spx-translate';
|
|
14
14
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
15
15
|
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
|
16
16
|
import { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';
|
|
17
|
+
import { App } from '@capacitor/app';
|
|
18
|
+
import { LiveUpdate } from '@capawesome/capacitor-live-update';
|
|
19
|
+
import { captureMessage } from '@sentry/angular';
|
|
20
|
+
import { getBinaryVersionGroup } from '@softpak/components/spx-helpers';
|
|
17
21
|
import { spxUpdateUrl } from '@softpak/components/spx-update';
|
|
18
|
-
import { switchMap } from 'rxjs/operators';
|
|
22
|
+
import { switchMap, mergeMap, catchError, tap } from 'rxjs/operators';
|
|
19
23
|
|
|
20
|
-
const
|
|
24
|
+
const spxChannelActions = createActionGroup({
|
|
21
25
|
source: 'SpxChannel',
|
|
22
26
|
events: {
|
|
23
27
|
Choose: props(),
|
|
28
|
+
ChooseFailed: props(),
|
|
29
|
+
ChooseSucceeded: props(),
|
|
24
30
|
Initialize: props(),
|
|
25
31
|
},
|
|
26
32
|
});
|
|
@@ -58,15 +64,19 @@ const determineActiveChannel = (channels) => {
|
|
|
58
64
|
};
|
|
59
65
|
var spxChannelReducer$1 = createFeature({
|
|
60
66
|
name: 'spxChannel',
|
|
61
|
-
|
|
67
|
+
extraSelectors: ({ selectChannel }) => ({
|
|
68
|
+
selectCompanyName: createSelector(selectChannel, (channel) => channel?.brand),
|
|
69
|
+
}),
|
|
70
|
+
reducer: createReducer(initialState, on(spxChannelActions.chooseSucceeded, (state, { channel, channelType }) => {
|
|
62
71
|
SpxStorage.setSetting(SpxStorageKeyEnum.brand, channel?.brand);
|
|
63
72
|
SpxStorage.setSetting(SpxStorageKeyEnum.channelType, channelType);
|
|
64
73
|
return {
|
|
65
74
|
...state,
|
|
66
75
|
previousChannel: state.channel,
|
|
67
76
|
channel,
|
|
77
|
+
channelType: { name: channelType },
|
|
68
78
|
};
|
|
69
|
-
}), on(
|
|
79
|
+
}), on(spxChannelActions.initialize, (state, { channels }) => {
|
|
70
80
|
let channelType = null;
|
|
71
81
|
if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {
|
|
72
82
|
channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) };
|
|
@@ -142,7 +152,8 @@ class Effects {
|
|
|
142
152
|
constructor() {
|
|
143
153
|
this.actions$ = inject(Actions);
|
|
144
154
|
this.router = inject(Router);
|
|
145
|
-
this.
|
|
155
|
+
this.translateService = inject(TranslateService);
|
|
156
|
+
this.onChoose$ = createEffect(() => this.actions$.pipe(ofType(spxChannelActions.choose), switchMap((action) => {
|
|
146
157
|
if (Capacitor.getPlatform() === 'web') {
|
|
147
158
|
const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType);
|
|
148
159
|
if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl, '').replace(channelType.oldWebUrl, '').split('/').at(0) !== '') {
|
|
@@ -151,15 +162,53 @@ class Effects {
|
|
|
151
162
|
else {
|
|
152
163
|
this.router.navigate(['tabs/hme']);
|
|
153
164
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return [spxToasterActions.createSuccess({
|
|
165
|
+
return of(spxChannelActions.chooseSucceeded({
|
|
166
|
+
channel: action.channel,
|
|
167
|
+
channelType: action.channelType,
|
|
168
|
+
}), spxToasterActions.createSuccess({
|
|
159
169
|
autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
|
|
160
170
|
messageText: action.channel?.brand,
|
|
161
|
-
})
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
return from(App.getInfo()).pipe(switchMap((binaryInfo) => {
|
|
174
|
+
const liveUpdateChannel = `${action.channelType}-${getBinaryVersionGroup(binaryInfo.version)}.x`;
|
|
175
|
+
return from(LiveUpdate.setChannel({
|
|
176
|
+
channel: liveUpdateChannel
|
|
177
|
+
})).pipe(mergeMap(() => {
|
|
178
|
+
SpxStorage.setSetting(SpxStorageKeyEnum.liveUpdateChannel, liveUpdateChannel);
|
|
179
|
+
return of(spxChannelActions.chooseSucceeded({
|
|
180
|
+
channel: action.channel,
|
|
181
|
+
channelType: action.channelType,
|
|
182
|
+
}), spxToasterActions.createSuccess({
|
|
183
|
+
autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
|
|
184
|
+
messageText: action.channel?.brand,
|
|
185
|
+
}));
|
|
186
|
+
}), catchError((err) => {
|
|
187
|
+
captureMessage(`SPX Channel setChannel Error: ${JSON.stringify(err)}`);
|
|
188
|
+
return of(spxChannelActions.chooseFailed({
|
|
189
|
+
channel: action.channel,
|
|
190
|
+
channelType: action.channelType,
|
|
191
|
+
}), spxToasterActions.createWarning({
|
|
192
|
+
autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
|
|
193
|
+
messageText: this.translateService.instant(spxTextLiveUpdateChannelSetFailed),
|
|
194
|
+
}));
|
|
195
|
+
}));
|
|
196
|
+
}), catchError((err) => {
|
|
197
|
+
captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);
|
|
198
|
+
return of(spxChannelActions.chooseFailed({
|
|
199
|
+
channel: action.channel,
|
|
200
|
+
channelType: action.channelType,
|
|
201
|
+
}), spxToasterActions.createWarning({
|
|
202
|
+
autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
|
|
203
|
+
messageText: this.translateService.instant(spxTextLiveUpdateChannelSetFailed),
|
|
204
|
+
}));
|
|
205
|
+
}));
|
|
162
206
|
})), { dispatch: true });
|
|
207
|
+
this.onChooseSucceededNavigate$ = createEffect(() => this.actions$.pipe(ofType(spxChannelActions.chooseSucceeded), tap(() => {
|
|
208
|
+
if (Capacitor.getPlatform() !== 'web') {
|
|
209
|
+
this.router.navigate([spxUpdateUrl]);
|
|
210
|
+
}
|
|
211
|
+
})), { dispatch: false });
|
|
163
212
|
}
|
|
164
213
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Effects, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
165
214
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Effects }); }
|
|
@@ -177,5 +226,5 @@ var spxChannel_effects = /*#__PURE__*/Object.freeze({
|
|
|
177
226
|
* Generated bundle index. Do not edit.
|
|
178
227
|
*/
|
|
179
228
|
|
|
180
|
-
export {
|
|
229
|
+
export { SpxChannelGuard, SpxChannelIndicatorComponent, spxChannelActions, spxChannel_effects as spxChannelEffects, spxChannel_reducer as spxChannelReducer, spxChannelSelectionUrl };
|
|
181
230
|
//# sourceMappingURL=softpak-components-spx-channel-selection.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.html","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { createActionGroup, props } from '@ngrx/store';\n\nexport const SpxChannelActions = createActionGroup({\n source: 'SpxChannel',\n events: {\n Choose: props<{\n channel: SpxAppChannelI;\n channelType: SpxAppChannelTypeEnum;\n }>(),\n Initialize: props<{\n channels: SpxAppChannelI[];\n }>(),\n },\n});\n","import { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { Capacitor } from '@capacitor/core';\nimport { SpxChannelActions } from './spx-channel.actions';\n\nexport const initialState: StateI = {\n previousChannel: null,\n channel: null,\n channelType: null,\n channels: [],\n};\n\nexport interface StateI {\n previousChannel: SpxAppChannelI | null;\n channel: SpxAppChannelI | null;\n channels: SpxAppChannelI[];\n channelType: SpxChannelTypeI | null;\n}\n\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.some((e: SpxChannelTypeI) => e.name === SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\n if (channelResult) {\n return channelResult;\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n } else {\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\n return null;\n }\n }\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n }\n return null;\n }\n}\n\nexport default createFeature({\n name: 'spxChannel',\n reducer: createReducer(\n initialState,\n on(SpxChannelActions.choose, (state, { channel, channelType }): StateI => {\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\n return {\n ...state,\n previousChannel: state.channel,\n channel,\n };\n }),\n on(SpxChannelActions.initialize, (state, { channels }): StateI => {\n\n let channelType: SpxChannelTypeI | null = null;\n\n if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\n }\n else {\n channelType = { name: Capacitor.getPlatform() === 'web' ? SpxAppChannelTypeEnum.webLive : SpxAppChannelTypeEnum.production }; // Default to production if no type is set\n }\n\n return {\n ...state,\n channel: determineActiveChannel(channels),\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\n channelType: channelType,\n }\n }),\n ),\n});\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\n\nimport { Capacitor } from '@capacitor/core';\nimport { NavController } from '@ionic/angular/standalone';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { Store } from '@ngrx/store';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { map } from 'rxjs';\nimport spxChannelReducer from '../../store/spx-channel.reducer';\nimport { spxTextChange } from '@softpak/components/spx-translate';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nexport const spxChannelSelectionUrl = 'wlc';\n\n@Component({\n selector: 'spx-channel-indicator',\n templateUrl: './spx-channel-indicator.component.html',\n imports: [\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxChannelIndicatorComponent {\n private readonly navController = inject(NavController);\n private readonly store = inject(Store);\n protected readonly channel = this.store.selectSignal(spxChannelReducer.selectChannel);\n protected readonly channelType = toSignal(this.store.select(spxChannelReducer.selectChannelType).pipe(\n map(channelType => channelType?.name)\n ));\n protected readonly spxTextChange = spxTextChange;\n\n protected onChange() {\n this.navController.navigateRoot([spxChannelSelectionUrl]);\n }\n\n protected canShowChannelType() {\n return Capacitor.getPlatform() !== 'web';\n }\n}\n","<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\n @if (canShowChannelType() && channelType() !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n</div>","import { Router } from '@angular/router';\nimport { inject, Injectable } from '@angular/core';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxChannelSelectionUrl } from './spx-channel-indicator/spx-channel-indicator.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SpxChannelGuard {\n\n private readonly router = inject(Router);\n\n canActivate(): boolean {\n if (\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\n ) {\n this.router.navigate([spxChannelSelectionUrl]);\n return false;\n }\n return true;\n }\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Injectable, inject } from '@angular/core';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\n\nimport { Capacitor } from '@capacitor/core';\nimport { Router } from '@angular/router';\nimport { SpxChannelActions } from './spx-channel.actions';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { switchMap } from 'rxjs/operators';\n\n@Injectable()\nexport class Effects {\n private readonly actions$ = inject(Actions);\n private readonly router = inject(Router);\n\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(SpxChannelActions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType)!;\n if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl!, '').replace(channelType.oldWebUrl!, '').split('/').at(0) !== '') {\n window.location.href = channelType.webUrl!;\n } else {\n this.router.navigate(['tabs/hme']);\n }\n } else {\n this.router.navigate([spxUpdateUrl]);\n }\n return [spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })];\n }),\n ), { dispatch: true });\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxChannelReducer"],"mappings":";;;;;;;;;;;;;;;;;;;AAGO,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAC/C,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE;QACJ,MAAM,EAAE,KAAK,EAGT;QACJ,UAAU,EAAE,KAAK,EAEb;AACP,KAAA;AACJ,CAAA;;ACPM,MAAM,YAAY,GAAW;AAClC,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,EAAE;CACb;AASD,MAAM,sBAAsB,GAAG,CAAC,QAA0B,KAA2B;AACnF,IAAA,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE;QAC1G,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,KAAK,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAkB,KAAK,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAA0B,CAAC,CAAC;QAC/P,IAAI,aAAa,EAAE;AACjB,YAAA,OAAO,aAAa;QACtB;aAAO;AACL,YAAA,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;YACpE,I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,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;oBAC/L,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC,MAAO;gBAC9C;qBAAO;oBACH,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC;gBACtC;YACJ;iBAAO;gBACH,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;YACxC;AACA,YAAA,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC;oBACpC,SAAS,EAAE,4BAA4B,CAAC,OAAO;AAC/C,oBAAA,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK;AACrC,iBAAA,CAAC,CAAC;QACP,CAAC,CAAC,CACL,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjC,IAAA;8GAzBY,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAP,OAAO,EAAA,CAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;;;;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.html","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { createActionGroup, props } from '@ngrx/store';\n\nexport const spxChannelActions = createActionGroup({\n source: 'SpxChannel',\n events: {\n Choose: props<{ channel: SpxAppChannelI; channelType: SpxAppChannelTypeEnum; }>(),\n ChooseFailed: props<{ channel: SpxAppChannelI; channelType: SpxAppChannelTypeEnum; }>(),\n ChooseSucceeded: props<{ channel: SpxAppChannelI; channelType: SpxAppChannelTypeEnum; }>(),\n Initialize: props<{ channels: SpxAppChannelI[]; }>(),\n },\n});\n","import { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { createFeature, createReducer, createSelector, on } from '@ngrx/store';\n\nimport { Capacitor } from '@capacitor/core';\nimport { spxChannelActions } from './spx-channel.actions';\n\nexport const initialState: StateI = {\n previousChannel: null,\n channel: null,\n channelType: null,\n channels: [],\n};\n\nexport interface StateI {\n previousChannel: SpxAppChannelI | null;\n channel: SpxAppChannelI | null;\n channels: SpxAppChannelI[];\n channelType: SpxChannelTypeI | null;\n}\n\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.some((e: SpxChannelTypeI) => e.name === SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\n if (channelResult) {\n return channelResult;\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n } else {\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\n return null;\n }\n }\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n }\n return null;\n }\n}\n\nexport default createFeature({\n name: 'spxChannel',\n extraSelectors: ({ selectChannel }) => ({\n selectCompanyName: createSelector(selectChannel, (channel) => channel?.brand),\n }),\n reducer: createReducer(\n initialState,\n on(spxChannelActions.chooseSucceeded, (state, { channel, channelType }): StateI => {\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\n return {\n ...state,\n previousChannel: state.channel,\n channel,\n channelType: { name: channelType },\n };\n }),\n on(spxChannelActions.initialize, (state, { channels }): StateI => {\n\n let channelType: SpxChannelTypeI | null = null;\n\n if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\n }\n else {\n channelType = { name: Capacitor.getPlatform() === 'web' ? SpxAppChannelTypeEnum.webLive : SpxAppChannelTypeEnum.production }; // Default to production if no type is set\n }\n\n return {\n ...state,\n channel: determineActiveChannel(channels),\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\n channelType: channelType,\n }\n }),\n ),\n});\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\n\nimport { Capacitor } from '@capacitor/core';\nimport { NavController } from '@ionic/angular/standalone';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { Store } from '@ngrx/store';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { map } from 'rxjs';\nimport spxChannelReducer from '../../store/spx-channel.reducer';\nimport { spxTextChange } from '@softpak/components/spx-translate';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nexport const spxChannelSelectionUrl = 'wlc';\n\n@Component({\n selector: 'spx-channel-indicator',\n templateUrl: './spx-channel-indicator.component.html',\n imports: [\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxChannelIndicatorComponent {\n private readonly navController = inject(NavController);\n private readonly store = inject(Store);\n protected readonly channel = this.store.selectSignal(spxChannelReducer.selectChannel);\n protected readonly channelType = toSignal(this.store.select(spxChannelReducer.selectChannelType).pipe(\n map(channelType => channelType?.name)\n ));\n protected readonly spxTextChange = spxTextChange;\n\n protected onChange() {\n this.navController.navigateRoot([spxChannelSelectionUrl]);\n }\n\n protected canShowChannelType() {\n return Capacitor.getPlatform() !== 'web';\n }\n}\n","<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\n @if (canShowChannelType() && channelType() !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n</div>","import { Router } from '@angular/router';\nimport { inject, Injectable } from '@angular/core';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxChannelSelectionUrl } from './spx-channel-indicator/spx-channel-indicator.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SpxChannelGuard {\n\n private readonly router = inject(Router);\n\n canActivate(): boolean {\n if (\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\n ) {\n this.router.navigate([spxChannelSelectionUrl]);\n return false;\n }\n return true;\n }\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Injectable, inject } from '@angular/core';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\n\nimport { App } from '@capacitor/app';\nimport { Capacitor } from '@capacitor/core';\nimport { LiveUpdate } from \"@capawesome/capacitor-live-update\";\nimport { Router } from '@angular/router';\nimport { captureMessage } from '@sentry/angular';\nimport { getBinaryVersionGroup } from '@softpak/components/spx-helpers';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxChannelActions } from './spx-channel.actions';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { TranslateService } from '@ngx-translate/core';\nimport { spxTextLiveUpdateChannelSetFailed } from '@softpak/components/spx-translate';\nimport { from, of } from 'rxjs';\nimport { catchError, mergeMap, switchMap, tap } from 'rxjs/operators';\n\n@Injectable()\nexport class Effects {\n private readonly actions$ = inject(Actions);\n private readonly router = inject(Router);\n private readonly translateService = inject(TranslateService);\n\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(spxChannelActions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType)!;\n if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl!, '').replace(channelType.oldWebUrl!, '').split('/').at(0) !== '') {\n window.location.href = channelType.webUrl!;\n } else {\n this.router.navigate(['tabs/hme']);\n }\n return of(\n spxChannelActions.chooseSucceeded({\n channel: action.channel,\n channelType: action.channelType,\n }),\n spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n }),\n );\n }\n return from(App.getInfo()).pipe(\n switchMap((binaryInfo) => {\n const liveUpdateChannel = `${action.channelType}-${getBinaryVersionGroup(binaryInfo.version)}.x`;\n return from(LiveUpdate.setChannel({\n channel: liveUpdateChannel\n })).pipe(\n mergeMap(() => {\n SpxStorage.setSetting(SpxStorageKeyEnum.liveUpdateChannel, liveUpdateChannel);\n return of(\n spxChannelActions.chooseSucceeded({\n channel: action.channel,\n channelType: action.channelType,\n }),\n spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n }),\n );\n }),\n catchError((err) => {\n captureMessage(`SPX Channel setChannel Error: ${JSON.stringify(err)}`);\n return of(\n spxChannelActions.chooseFailed({\n channel: action.channel,\n channelType: action.channelType,\n }),\n spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: this.translateService.instant(spxTextLiveUpdateChannelSetFailed),\n }),\n );\n }),\n );\n }),\n catchError((err) => {\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\n return of(\n spxChannelActions.chooseFailed({\n channel: action.channel,\n channelType: action.channelType,\n }),\n spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: this.translateService.instant(spxTextLiveUpdateChannelSetFailed),\n }),\n );\n }),\n );\n }),\n ), { dispatch: true });\n\n onChooseSucceededNavigate$ = createEffect(() =>\n this.actions$.pipe(\n ofType(spxChannelActions.chooseSucceeded),\n tap(() => {\n if (Capacitor.getPlatform() !== 'web') {\n this.router.navigate([spxUpdateUrl]);\n }\n }),\n ), { dispatch: false });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxChannelReducer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AACjD,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE;QACN,MAAM,EAAE,KAAK,EAAoE;QACjF,YAAY,EAAE,KAAK,EAAoE;QACvF,eAAe,EAAE,KAAK,EAAoE;QAC1F,UAAU,EAAE,KAAK,EAAmC;AACrD,KAAA;AACF,CAAA;;ACJM,MAAM,YAAY,GAAW;AAClC,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,EAAE;CACb;AASD,MAAM,sBAAsB,GAAG,CAAC,QAA0B,KAA2B;AACnF,IAAA,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE;QAC1G,MAAM,aAAa,GAAG,QAAQ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
|
|
6
6
|
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
7
7
|
import * as i1 from '@ngrx/store';
|
|
8
|
-
import {
|
|
8
|
+
import { createActionGroup, props, emptyProps, createFeature, createReducer, on } from '@ngrx/store';
|
|
9
9
|
import * as i1$1 from '@ngrx/effects';
|
|
10
10
|
import { createEffect, ofType } from '@ngrx/effects';
|
|
11
11
|
import { withLatestFrom, mergeMap } from 'rxjs/operators';
|
|
@@ -55,13 +55,13 @@ class SpxConfirmDisplayerComponent {
|
|
|
55
55
|
this.subscriptions?.confirmState?.unsubscribe();
|
|
56
56
|
}
|
|
57
57
|
onCancel(id) {
|
|
58
|
-
this.appStore.dispatch(answer({
|
|
58
|
+
this.appStore.dispatch(spxConfirmActions.answer({
|
|
59
59
|
cancel: true,
|
|
60
60
|
id
|
|
61
61
|
}));
|
|
62
62
|
}
|
|
63
63
|
onConfirm(id) {
|
|
64
|
-
this.appStore.dispatch(answer({
|
|
64
|
+
this.appStore.dispatch(spxConfirmActions.answer({
|
|
65
65
|
confirm: true,
|
|
66
66
|
id
|
|
67
67
|
}));
|
|
@@ -74,22 +74,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
74
74
|
args: [{ selector: 'spx-confirm-displayer', imports: [SpxConfirmComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}" }]
|
|
75
75
|
}], ctorParameters: () => [{ type: i1.Store }] });
|
|
76
76
|
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
var spxConfirm_actions = /*#__PURE__*/Object.freeze({
|
|
88
|
-
__proto__: null,
|
|
89
|
-
answer: answer,
|
|
90
|
-
answerConfirm: answerConfirm,
|
|
91
|
-
reset: reset,
|
|
92
|
-
show: show
|
|
77
|
+
const spxConfirmActions = createActionGroup({
|
|
78
|
+
source: 'SpxConfirm',
|
|
79
|
+
events: {
|
|
80
|
+
Answer: props(),
|
|
81
|
+
AnswerConfirm: props(),
|
|
82
|
+
Reset: emptyProps(),
|
|
83
|
+
Show: props(),
|
|
84
|
+
},
|
|
93
85
|
});
|
|
94
86
|
|
|
95
87
|
const initialState = {
|
|
@@ -97,9 +89,9 @@ const initialState = {
|
|
|
97
89
|
};
|
|
98
90
|
var spxConfirmReducer$1 = createFeature({
|
|
99
91
|
name: 'spxConfirm',
|
|
100
|
-
reducer: createReducer(initialState, on(reset, (state, {}) => ({
|
|
92
|
+
reducer: createReducer(initialState, on(spxConfirmActions.reset, (state, {}) => ({
|
|
101
93
|
...state,
|
|
102
|
-
})), on(show, (state, { content, id, title, noYesButton, onCancel, onOK }) => {
|
|
94
|
+
})), on(spxConfirmActions.show, (state, { content, id, title, noYesButton, onCancel, onOK }) => {
|
|
103
95
|
const confirms = state.confirms.filter((c) => c.id).length > 0
|
|
104
96
|
? state.confirms
|
|
105
97
|
: [
|
|
@@ -117,7 +109,7 @@ var spxConfirmReducer$1 = createFeature({
|
|
|
117
109
|
...state,
|
|
118
110
|
confirms,
|
|
119
111
|
};
|
|
120
|
-
}), on(answerConfirm, (state, { id }) => ({
|
|
112
|
+
}), on(spxConfirmActions.answerConfirm, (state, { id }) => ({
|
|
121
113
|
...state,
|
|
122
114
|
confirms: [
|
|
123
115
|
...state.confirms.filter((c) => c.id !== id),
|
|
@@ -134,7 +126,7 @@ class SpxConfirmEffects {
|
|
|
134
126
|
constructor(actions$, appStore) {
|
|
135
127
|
this.actions$ = actions$;
|
|
136
128
|
this.appStore = appStore;
|
|
137
|
-
this.onAnswer$ = createEffect(() => this.actions$.pipe(ofType(answer), withLatestFrom(this.appStore.select(spxConfirmReducer$1.selectConfirms)), mergeMap(([action, confirms]) => {
|
|
129
|
+
this.onAnswer$ = createEffect(() => this.actions$.pipe(ofType(spxConfirmActions.answer), withLatestFrom(this.appStore.select(spxConfirmReducer$1.selectConfirms)), mergeMap(([action, confirms]) => {
|
|
138
130
|
if (action.confirm) {
|
|
139
131
|
confirms.find((c) => c.id === action.id)?.onOK?.();
|
|
140
132
|
}
|
|
@@ -142,7 +134,7 @@ class SpxConfirmEffects {
|
|
|
142
134
|
confirms.find((c) => c.id === action.id)?.onCancel?.();
|
|
143
135
|
}
|
|
144
136
|
return [
|
|
145
|
-
answerConfirm({ id: action.id }),
|
|
137
|
+
spxConfirmActions.answerConfirm({ id: action.id }),
|
|
146
138
|
spxSpinnerActions.hide({
|
|
147
139
|
action: action.id,
|
|
148
140
|
})
|
|
@@ -165,5 +157,5 @@ var spxConfirm_effects = /*#__PURE__*/Object.freeze({
|
|
|
165
157
|
* Generated bundle index. Do not edit.
|
|
166
158
|
*/
|
|
167
159
|
|
|
168
|
-
export { SpxConfirmComponent, SpxConfirmDisplayerComponent,
|
|
160
|
+
export { SpxConfirmComponent, SpxConfirmDisplayerComponent, spxConfirmActions, spxConfirm_effects as spxConfirmEffects, spxConfirm_reducer as spxConfirmReducer };
|
|
169
161
|
//# sourceMappingURL=softpak-components-spx-confirm.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createAction, props, union } from '@ngrx/store';\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const answer = createAction('[Confirm] Answer', props<{\n cancel?: boolean;\n confirm?: boolean;\n id: string;\n}>());\nexport const reset = createAction('[Confirm] Reset', props<Record<string, unknown>>());\nexport const show = createAction('[Confirm] Show', props<SpxConfirmI>());\n\nexport const answerConfirm = createAction('[Confirm] Answer Confirm', props<{\n id: string;\n}>());\n\nconst all = union({\n reset,\n show,\n answerConfirm,\n});\nexport type Actions = typeof all;\n","import * as actions from './spx-confirm.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n actions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n actions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n actions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import * as actions from './spx-confirm.actions';\n\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\n\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Store } from '@ngrx/store';\nimport spxConfirmReducer from './spx-confirm.reducer';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(actions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n actions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({\n action: action.id,\n })\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmActions.answer","actions.reset","actions.show","actions.answerConfirm","actions.answer","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,6CAAU;QAC7B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAU;QAC5B,IAAA,CAAA,UAAU,GAAG,MAAM,EAAU;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAAe,CAAC,OAAO;IAEzB;IAEhB,Q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"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createActionGroup, emptyProps, props } from '@ngrx/store';\n\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const spxConfirmActions = createActionGroup({\n source: 'SpxConfirm',\n events: {\n Answer: props<{ cancel?: boolean; confirm?: boolean; id: string; }>(),\n AnswerConfirm: props<{ id: string; }>(),\n Reset: emptyProps(),\n Show: props<SpxConfirmI>(),\n },\n});\n","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { spxConfirmActions } from './spx-confirm.actions';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n spxConfirmActions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n spxConfirmActions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n spxConfirmActions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\n\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Store } from '@ngrx/store';\nimport { spxConfirmActions } from './spx-confirm.actions';\nimport spxConfirmReducer from './spx-confirm.reducer';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(spxConfirmActions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n spxConfirmActions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({\n action: action.id,\n })\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,6CAAU;QAC7B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAU;QAC5B,IAAA,CAAA,UAAU,GAAG,MAAM,EAAU;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAA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