@softpak/components 21.2.0-capwesome.7 → 21.2.0
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-alert.mjs +4 -3
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-channel-selection.mjs +45 -24
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +22 -4
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +6 -4
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +102 -17
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/package.json +1 -1
- package/tailwind.css +1 -1
- package/types/softpak-components-spx-alert.d.ts +3 -1
- package/types/softpak-components-spx-channel-selection.d.ts +24 -0
- package/types/softpak-components-spx-navigation.d.ts +8 -4
- package/types/softpak-components-spx-toaster.d.ts +2 -0
- package/types/softpak-components-spx-update.d.ts +10 -2
|
@@ -11,6 +11,7 @@ class SpxAlertComponent {
|
|
|
11
11
|
this._autoCloseTimeout = signal(null, ...(ngDevMode ? [{ debugName: "_autoCloseTimeout" }] : []));
|
|
12
12
|
this.spxClose = output();
|
|
13
13
|
this.spxAutoclose = input(...(ngDevMode ? [undefined, { debugName: "spxAutoclose" }] : []));
|
|
14
|
+
this.spxCompanyName = input(...(ngDevMode ? [undefined, { debugName: "spxCompanyName" }] : []));
|
|
14
15
|
this.spxCloseable = input(false, ...(ngDevMode ? [{ debugName: "spxCloseable" }] : []));
|
|
15
16
|
this.spxHideTitle = input(false, ...(ngDevMode ? [{ debugName: "spxHideTitle" }] : []));
|
|
16
17
|
this.spxTitle = model(...(ngDevMode ? [undefined, { debugName: "spxTitle" }] : []));
|
|
@@ -58,15 +59,15 @@ class SpxAlertComponent {
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
61
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxAlertComponent, isStandalone: true, selector: "spx-alert", inputs: { spxAutoclose: { classPropertyName: "spxAutoclose", publicName: "spxAutoclose", isSignal: true, isRequired: false, transformFunction: null }, spxCloseable: { classPropertyName: "spxCloseable", publicName: "spxCloseable", isSignal: true, isRequired: false, transformFunction: null }, spxHideTitle: { classPropertyName: "spxHideTitle", publicName: "spxHideTitle", isSignal: true, isRequired: false, transformFunction: null }, spxTitle: { classPropertyName: "spxTitle", publicName: "spxTitle", isSignal: true, isRequired: false, transformFunction: null }, spxMarginTop: { classPropertyName: "spxMarginTop", publicName: "spxMarginTop", isSignal: true, isRequired: false, transformFunction: null }, spxSeverity: { classPropertyName: "spxSeverity", publicName: "spxSeverity", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { spxClose: "spxClose", spxTitle: "spxTitleChange" }, ngImport: i0, template: "<div class=\"flex items-center gap-3 border-t-4 rounded px-4 py-3 shadow-md\"\n [class.cursor-pointer]=\"this.spxCloseable()\"\n [class.bg-red-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.border-red-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.text-red-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.bg-cyan-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.border-cyan-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.text-cyan-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.bg-lime-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.border-lime-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.text-lime-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.bg-amber-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.border-amber-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.text-amber-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.hover:bg-red-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.over:border-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.focus:ring-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.hover:bg-cyan-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.over:border-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.hover:bg-lime-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.over:border-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.focus:ring-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.hover:bg-amber-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.over:border-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n (click)=\"onClose()\">\n @if ((this.spxSeverity() | isSeverity: SpxSeverity.info)) {\n <fa-icon\n [icon]=\"faCircleInfo\" class=\"block text-xl text-cyan-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.error) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-red-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.success) {\n <fa-icon\n [icon]=\"faCheck\" class=\"block text-xl text-lime-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.warning) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-amber-600\"></fa-icon>\n }\n <div class=\"grow\">\n @if (this.spxTitle() && !this.spxHideTitle()) {\n <p class=\"font-bold\">{{this.spxTitle()}}</p>\n }\n <p class=\"text-sm\">\n <ng-content></ng-content>\n </p>\n </div>\n @if (this.spxCloseable()) {\n <fa-icon\n [icon]=\"faTimes\" class=\"block text-xl\"></fa-icon>\n }\n </div
|
|
62
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxAlertComponent, isStandalone: true, selector: "spx-alert", inputs: { spxAutoclose: { classPropertyName: "spxAutoclose", publicName: "spxAutoclose", isSignal: true, isRequired: false, transformFunction: null }, spxCompanyName: { classPropertyName: "spxCompanyName", publicName: "spxCompanyName", isSignal: true, isRequired: false, transformFunction: null }, spxCloseable: { classPropertyName: "spxCloseable", publicName: "spxCloseable", isSignal: true, isRequired: false, transformFunction: null }, spxHideTitle: { classPropertyName: "spxHideTitle", publicName: "spxHideTitle", isSignal: true, isRequired: false, transformFunction: null }, spxTitle: { classPropertyName: "spxTitle", publicName: "spxTitle", isSignal: true, isRequired: false, transformFunction: null }, spxMarginTop: { classPropertyName: "spxMarginTop", publicName: "spxMarginTop", isSignal: true, isRequired: false, transformFunction: null }, spxSeverity: { classPropertyName: "spxSeverity", publicName: "spxSeverity", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { spxClose: "spxClose", spxTitle: "spxTitleChange" }, ngImport: i0, template: "<div class=\"flex items-center gap-3 border-t-4 rounded px-4 py-3 shadow-md\"\n [class.cursor-pointer]=\"this.spxCloseable()\"\n [class.bg-red-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.border-red-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.text-red-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.bg-cyan-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.border-cyan-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.text-cyan-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.bg-lime-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.border-lime-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.text-lime-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.bg-amber-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.border-amber-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.text-amber-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.hover:bg-red-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.over:border-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.focus:ring-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.hover:bg-cyan-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.over:border-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.hover:bg-lime-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.over:border-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.focus:ring-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.hover:bg-amber-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.over:border-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n (click)=\"onClose()\">\n @if ((this.spxSeverity() | isSeverity: SpxSeverity.info)) {\n <fa-icon\n [icon]=\"faCircleInfo\" class=\"block text-xl text-cyan-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.error) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-red-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.success) {\n <fa-icon\n [icon]=\"faCheck\" class=\"block text-xl text-lime-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.warning) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-amber-600\"></fa-icon>\n }\n <div class=\"grow\">\n @if (this.spxTitle() && !this.spxHideTitle()) {\n <p class=\"font-bold\">{{this.spxTitle()}}</p>\n }\n <p class=\"text-sm\">\n <ng-content></ng-content>\n </p>\n @if (this.spxCompanyName()) {\n <p class=\"text-xs text-gray-500 mt-1\">\n {{ this.spxCompanyName() }}\n </p>\n }\n </div>\n @if (this.spxCloseable()) {\n <fa-icon\n [icon]=\"faTimes\" class=\"block text-xl\"></fa-icon>\n }\n </div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }, { kind: "pipe", type: IsSeverityPipe, name: "isSeverity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
62
63
|
}
|
|
63
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxAlertComponent, decorators: [{
|
|
64
65
|
type: Component,
|
|
65
66
|
args: [{ selector: 'spx-alert', imports: [
|
|
66
67
|
FontAwesomeModule,
|
|
67
68
|
IsSeverityPipe
|
|
68
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"flex items-center gap-3 border-t-4 rounded px-4 py-3 shadow-md\"\n [class.cursor-pointer]=\"this.spxCloseable()\"\n [class.bg-red-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.border-red-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.text-red-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.bg-cyan-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.border-cyan-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.text-cyan-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.bg-lime-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.border-lime-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.text-lime-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.bg-amber-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.border-amber-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.text-amber-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.hover:bg-red-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.over:border-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.focus:ring-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.hover:bg-cyan-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.over:border-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.hover:bg-lime-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.over:border-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.focus:ring-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.hover:bg-amber-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.over:border-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n (click)=\"onClose()\">\n @if ((this.spxSeverity() | isSeverity: SpxSeverity.info)) {\n <fa-icon\n [icon]=\"faCircleInfo\" class=\"block text-xl text-cyan-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.error) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-red-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.success) {\n <fa-icon\n [icon]=\"faCheck\" class=\"block text-xl text-lime-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.warning) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-amber-600\"></fa-icon>\n }\n <div class=\"grow\">\n @if (this.spxTitle() && !this.spxHideTitle()) {\n <p class=\"font-bold\">{{this.spxTitle()}}</p>\n }\n <p class=\"text-sm\">\n <ng-content></ng-content>\n </p>\n </div>\n @if (this.spxCloseable()) {\n <fa-icon\n [icon]=\"faTimes\" class=\"block text-xl\"></fa-icon>\n }\n </div
|
|
69
|
-
}], propDecorators: { spxClose: [{ type: i0.Output, args: ["spxClose"] }], spxAutoclose: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxAutoclose", required: false }] }], spxCloseable: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxCloseable", required: false }] }], spxHideTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxHideTitle", required: false }] }], spxTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxTitle", required: false }] }, { type: i0.Output, args: ["spxTitleChange"] }], spxMarginTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxMarginTop", required: false }] }], spxSeverity: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxSeverity", required: false }] }] } });
|
|
69
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"flex items-center gap-3 border-t-4 rounded px-4 py-3 shadow-md\"\n [class.cursor-pointer]=\"this.spxCloseable()\"\n [class.bg-red-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.border-red-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.text-red-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.bg-cyan-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.border-cyan-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.text-cyan-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.bg-lime-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.border-lime-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.text-lime-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.bg-amber-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.border-amber-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.text-amber-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.hover:bg-red-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.over:border-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.focus:ring-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.hover:bg-cyan-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.over:border-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.hover:bg-lime-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.over:border-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.focus:ring-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.hover:bg-amber-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.over:border-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n (click)=\"onClose()\">\n @if ((this.spxSeverity() | isSeverity: SpxSeverity.info)) {\n <fa-icon\n [icon]=\"faCircleInfo\" class=\"block text-xl text-cyan-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.error) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-red-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.success) {\n <fa-icon\n [icon]=\"faCheck\" class=\"block text-xl text-lime-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.warning) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-amber-600\"></fa-icon>\n }\n <div class=\"grow\">\n @if (this.spxTitle() && !this.spxHideTitle()) {\n <p class=\"font-bold\">{{this.spxTitle()}}</p>\n }\n <p class=\"text-sm\">\n <ng-content></ng-content>\n </p>\n @if (this.spxCompanyName()) {\n <p class=\"text-xs text-gray-500 mt-1\">\n {{ this.spxCompanyName() }}\n </p>\n }\n </div>\n @if (this.spxCloseable()) {\n <fa-icon\n [icon]=\"faTimes\" class=\"block text-xl\"></fa-icon>\n }\n </div>\n", styles: [":host{display:block}\n"] }]
|
|
70
|
+
}], propDecorators: { spxClose: [{ type: i0.Output, args: ["spxClose"] }], spxAutoclose: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxAutoclose", required: false }] }], spxCompanyName: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxCompanyName", required: false }] }], spxCloseable: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxCloseable", required: false }] }], spxHideTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxHideTitle", required: false }] }], spxTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxTitle", required: false }] }, { type: i0.Output, args: ["spxTitleChange"] }], spxMarginTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxMarginTop", required: false }] }], spxSeverity: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxSeverity", required: false }] }] } });
|
|
70
71
|
|
|
71
72
|
class SpxAlertI {
|
|
72
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-alert.mjs","sources":["../../../../projects/softpak/components/spx-alert/spx-alert.component.ts","../../../../projects/softpak/components/spx-alert/spx-alert.component.html","../../../../projects/softpak/components/spx-alert/spx-alert.interface.ts","../../../../projects/softpak/components/spx-alert/softpak-components-spx-alert.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, model, output, signal } from '@angular/core';\nimport { faCheck, faCircleInfo, faTimes, faTriangleExclamation } from '@fortawesome/free-solid-svg-icons';\n\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { IsSeverityPipe } from \"@softpak/components/spx-pipes\";\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-alert',\n imports: [\n FontAwesomeModule,\n IsSeverityPipe\n],\n templateUrl: './spx-alert.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n styleUrl: './spx-alert.component.scss',\n})\nexport class SpxAlertComponent {\n _autoCloseTimeout = signal<NodeJS.Timeout | null>(null);\n spxClose = output();\n readonly spxAutoclose = input<number>();\n readonly spxCloseable = input<boolean | undefined>(false);\n readonly spxHideTitle = input(false);\n readonly spxTitle = model<string>();\n readonly spxMarginTop = input(false);\n readonly spxSeverity = input<SpxSeverityEnum>();\n SpxSeverity = SpxSeverityEnum;\n faCheck = faCheck;\n faCircleInfo = faCircleInfo;\n faTriangleExclamation = faTriangleExclamation;\n faTimes = faTimes;\n\n componentDidLoad() {\n if (this.spxAutoclose()) {\n this.prepareAutoClose();\n }\n if (!this.spxTitle()) {\n this._assignDefaultTitle();\n }\n }\n\n private prepareAutoClose(): void {\n this._autoCloseTimeout.set(setTimeout(() => {\n this.onClose();\n this._autoCloseTimeout.set(null);\n }, this.spxAutoclose()));\n }\n\n private _assignDefaultTitle(): void {\n switch (this.spxSeverity()) {\n case SpxSeverityEnum.error:\n this.spxTitle.set('Error');\n break;\n case SpxSeverityEnum.info:\n this.spxTitle.set('Info');\n break;\n case SpxSeverityEnum.success:\n this.spxTitle.set('Notification');\n break;\n case SpxSeverityEnum.warning:\n this.spxTitle.set('Warning');\n break;\n }\n }\n\n onClose() {\n if (this.spxCloseable()) {\n this.spxClose.emit();\n }\n }\n}\n","<div class=\"flex items-center gap-3 border-t-4 rounded px-4 py-3 shadow-md\"\n [class.cursor-pointer]=\"this.spxCloseable()\"\n [class.bg-red-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.border-red-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.text-red-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.bg-cyan-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.border-cyan-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.text-cyan-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.bg-lime-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.border-lime-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.text-lime-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.bg-amber-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.border-amber-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.text-amber-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.hover:bg-red-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.over:border-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.focus:ring-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.hover:bg-cyan-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.over:border-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.hover:bg-lime-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.over:border-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.focus:ring-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.hover:bg-amber-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.over:border-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n (click)=\"onClose()\">\n @if ((this.spxSeverity() | isSeverity: SpxSeverity.info)) {\n <fa-icon\n [icon]=\"faCircleInfo\" class=\"block text-xl text-cyan-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.error) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-red-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.success) {\n <fa-icon\n [icon]=\"faCheck\" class=\"block text-xl text-lime-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.warning) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-amber-600\"></fa-icon>\n }\n <div class=\"grow\">\n @if (this.spxTitle() && !this.spxHideTitle()) {\n <p class=\"font-bold\">{{this.spxTitle()}}</p>\n }\n <p class=\"text-sm\">\n <ng-content></ng-content>\n </p>\n </div>\n @if (this.spxCloseable()) {\n <fa-icon\n [icon]=\"faTimes\" class=\"block text-xl\"></fa-icon>\n }\n </div>","import { SpxSeverityEnum } from \"@softpak/components/spx-helpers\";\n\nexport class SpxAlertI {\n closeable?: boolean;\n id?: number;\n message?: string;\n severity?: SpxSeverityEnum;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAkBa,iBAAiB,CAAA;AAX9B,IAAA,WAAA,GAAA;AAYE,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAwB,IAAI,6DAAC;QACvD,IAAA,CAAA,QAAQ,GAAG,MAAM,EAAE;QACV,IAAA,C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A;;;MEbP,SAAS,CAAA;AAKrB;;ACPD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-alert.mjs","sources":["../../../../projects/softpak/components/spx-alert/spx-alert.component.ts","../../../../projects/softpak/components/spx-alert/spx-alert.component.html","../../../../projects/softpak/components/spx-alert/spx-alert.interface.ts","../../../../projects/softpak/components/spx-alert/softpak-components-spx-alert.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, model, output, signal } from '@angular/core';\nimport { faCheck, faCircleInfo, faTimes, faTriangleExclamation } from '@fortawesome/free-solid-svg-icons';\n\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { IsSeverityPipe } from \"@softpak/components/spx-pipes\";\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-alert',\n imports: [\n FontAwesomeModule,\n IsSeverityPipe\n],\n templateUrl: './spx-alert.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n styleUrl: './spx-alert.component.scss',\n})\nexport class SpxAlertComponent {\n _autoCloseTimeout = signal<NodeJS.Timeout | null>(null);\n spxClose = output();\n readonly spxAutoclose = input<number>();\n readonly spxCompanyName = input<string>();\n readonly spxCloseable = input<boolean | undefined>(false);\n readonly spxHideTitle = input(false);\n readonly spxTitle = model<string>();\n readonly spxMarginTop = input(false);\n readonly spxSeverity = input<SpxSeverityEnum>();\n SpxSeverity = SpxSeverityEnum;\n faCheck = faCheck;\n faCircleInfo = faCircleInfo;\n faTriangleExclamation = faTriangleExclamation;\n faTimes = faTimes;\n\n componentDidLoad() {\n if (this.spxAutoclose()) {\n this.prepareAutoClose();\n }\n if (!this.spxTitle()) {\n this._assignDefaultTitle();\n }\n }\n\n private prepareAutoClose(): void {\n this._autoCloseTimeout.set(setTimeout(() => {\n this.onClose();\n this._autoCloseTimeout.set(null);\n }, this.spxAutoclose()));\n }\n\n private _assignDefaultTitle(): void {\n switch (this.spxSeverity()) {\n case SpxSeverityEnum.error:\n this.spxTitle.set('Error');\n break;\n case SpxSeverityEnum.info:\n this.spxTitle.set('Info');\n break;\n case SpxSeverityEnum.success:\n this.spxTitle.set('Notification');\n break;\n case SpxSeverityEnum.warning:\n this.spxTitle.set('Warning');\n break;\n }\n }\n\n onClose() {\n if (this.spxCloseable()) {\n this.spxClose.emit();\n }\n }\n}\n","<div class=\"flex items-center gap-3 border-t-4 rounded px-4 py-3 shadow-md\"\n [class.cursor-pointer]=\"this.spxCloseable()\"\n [class.bg-red-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.border-red-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.text-red-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.bg-cyan-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.border-cyan-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.text-cyan-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.info\"\n [class.bg-lime-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.border-lime-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.text-lime-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.bg-amber-100]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.border-amber-500]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.text-amber-900]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.hover:bg-red-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.over:border-red-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.error)\"\n [class.focus:ring-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.hover:bg-cyan-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.over:border-cyan-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.hover:bg-lime-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.over:border-lime-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.success)\"\n [class.focus:ring-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.hover:bg-amber-200]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n [class.over:border-amber-600]=\"this.spxCloseable() && (this.spxSeverity() | isSeverity: SpxSeverity.warning)\"\n (click)=\"onClose()\">\n @if ((this.spxSeverity() | isSeverity: SpxSeverity.info)) {\n <fa-icon\n [icon]=\"faCircleInfo\" class=\"block text-xl text-cyan-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.error) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-red-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.success) {\n <fa-icon\n [icon]=\"faCheck\" class=\"block text-xl text-lime-600\"></fa-icon>\n }\n @if (this.spxSeverity() | isSeverity: SpxSeverity.warning) {\n <fa-icon\n [icon]=\"faTriangleExclamation\" class=\"block text-xl text-amber-600\"></fa-icon>\n }\n <div class=\"grow\">\n @if (this.spxTitle() && !this.spxHideTitle()) {\n <p class=\"font-bold\">{{this.spxTitle()}}</p>\n }\n <p class=\"text-sm\">\n <ng-content></ng-content>\n </p>\n @if (this.spxCompanyName()) {\n <p class=\"text-xs text-gray-500 mt-1\">\n {{ this.spxCompanyName() }}\n </p>\n }\n </div>\n @if (this.spxCloseable()) {\n <fa-icon\n [icon]=\"faTimes\" class=\"block text-xl\"></fa-icon>\n }\n </div>\n","import { SpxSeverityEnum } from \"@softpak/components/spx-helpers\";\n\nexport class SpxAlertI {\n companyName?: string;\n closeable?: boolean;\n id?: number;\n message?: string;\n severity?: SpxSeverityEnum;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAkBa,iBAAiB,CAAA;AAX9B,IAAA,WAAA,GAAA;AAYE,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAwB,IAAI,6DAAC;QACvD,IAAA,CAAA,QAAQ,GAAG,MAAM,EAAE;QACV,IAAA,CAAA,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAC9B,IAAA,CAAA,cAAc,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAChC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAsB,KAAK,wDAAC;AAChD,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK,wDAAC;QAC3B,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC1B,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK,wDAAC;QAC3B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAmB;QAC/C,IAAA,CAAA,WAAW,GAAG,eAAe;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;QACjB,IAAA,CAAA,YAAY,GAAG,YAAY;QAC3B,IAAA,CAAA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A,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClB9B,+nHA6DA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDnDI,iBAAiB,qeACjB,cAAc,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAOL,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAX7B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,OAAA,EACZ;wBACT,iBAAiB;wBACjB;AACH,qBAAA,EAAA,eAAA,EAEoB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,+nHAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;MEbP,SAAS,CAAA;AAMrB;;ACRD;;AAEG;;;;"}
|
|
@@ -19,12 +19,14 @@ import { LiveUpdate } from '@capawesome/capacitor-live-update';
|
|
|
19
19
|
import { captureMessage } from '@sentry/angular';
|
|
20
20
|
import { getBinaryVersionGroup } from '@softpak/components/spx-helpers';
|
|
21
21
|
import { spxUpdateUrl } from '@softpak/components/spx-update';
|
|
22
|
-
import { switchMap,
|
|
22
|
+
import { switchMap, mergeMap, catchError, tap } from 'rxjs/operators';
|
|
23
23
|
|
|
24
24
|
const spxChannelActions = createActionGroup({
|
|
25
25
|
source: 'SpxChannel',
|
|
26
26
|
events: {
|
|
27
27
|
Choose: props(),
|
|
28
|
+
ChooseFailed: props(),
|
|
29
|
+
ChooseSucceeded: props(),
|
|
28
30
|
Initialize: props(),
|
|
29
31
|
},
|
|
30
32
|
});
|
|
@@ -65,13 +67,14 @@ var spxChannelReducer$1 = createFeature({
|
|
|
65
67
|
extraSelectors: ({ selectChannel }) => ({
|
|
66
68
|
selectCompanyName: createSelector(selectChannel, (channel) => channel?.brand),
|
|
67
69
|
}),
|
|
68
|
-
reducer: createReducer(initialState, on(spxChannelActions.
|
|
70
|
+
reducer: createReducer(initialState, on(spxChannelActions.chooseSucceeded, (state, { channel, channelType }) => {
|
|
69
71
|
SpxStorage.setSetting(SpxStorageKeyEnum.brand, channel?.brand);
|
|
70
72
|
SpxStorage.setSetting(SpxStorageKeyEnum.channelType, channelType);
|
|
71
73
|
return {
|
|
72
74
|
...state,
|
|
73
75
|
previousChannel: state.channel,
|
|
74
76
|
channel,
|
|
77
|
+
channelType: { name: channelType },
|
|
75
78
|
};
|
|
76
79
|
}), on(spxChannelActions.initialize, (state, { channels }) => {
|
|
77
80
|
let channelType = null;
|
|
@@ -159,34 +162,47 @@ class Effects {
|
|
|
159
162
|
else {
|
|
160
163
|
this.router.navigate(['tabs/hme']);
|
|
161
164
|
}
|
|
162
|
-
return of(
|
|
165
|
+
return of(spxChannelActions.chooseSucceeded({
|
|
166
|
+
channel: action.channel,
|
|
167
|
+
channelType: action.channelType,
|
|
168
|
+
}), spxToasterActions.createSuccess({
|
|
163
169
|
autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
|
|
164
170
|
messageText: action.channel?.brand,
|
|
165
171
|
}));
|
|
166
172
|
}
|
|
167
|
-
return from(App.getInfo()).pipe(switchMap((binaryInfo) =>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
:
|
|
185
|
-
|
|
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
|
+
const errorReason = this.getReadableErrorReason(err);
|
|
188
|
+
captureMessage(`SPX Channel setChannel Error: ${errorReason}`);
|
|
189
|
+
return of(spxChannelActions.chooseFailed({
|
|
190
|
+
channel: action.channel,
|
|
191
|
+
channelType: action.channelType,
|
|
192
|
+
}), spxToasterActions.createError({
|
|
193
|
+
autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
|
|
194
|
+
messageText: errorReason
|
|
195
|
+
? this.translateService.instant(spxTextLiveUpdateChannelSetFailedWithReason, { reason: errorReason })
|
|
196
|
+
: this.translateService.instant(spxTextLiveUpdateChannelSetFailed),
|
|
197
|
+
}));
|
|
198
|
+
}));
|
|
199
|
+
}), catchError((err) => {
|
|
186
200
|
const errorReason = this.getReadableErrorReason(err);
|
|
187
201
|
captureMessage(`SPX Channel Error: ${errorReason}`);
|
|
188
|
-
|
|
189
|
-
|
|
202
|
+
return of(spxChannelActions.chooseFailed({
|
|
203
|
+
channel: action.channel,
|
|
204
|
+
channelType: action.channelType,
|
|
205
|
+
}), spxToasterActions.createError({
|
|
190
206
|
autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
|
|
191
207
|
messageText: errorReason
|
|
192
208
|
? this.translateService.instant(spxTextLiveUpdateChannelSetFailedWithReason, { reason: errorReason })
|
|
@@ -194,6 +210,11 @@ class Effects {
|
|
|
194
210
|
}));
|
|
195
211
|
}));
|
|
196
212
|
})), { dispatch: true });
|
|
213
|
+
this.onChooseSucceededNavigate$ = createEffect(() => this.actions$.pipe(ofType(spxChannelActions.chooseSucceeded), tap(() => {
|
|
214
|
+
if (Capacitor.getPlatform() !== 'web') {
|
|
215
|
+
this.router.navigate([spxUpdateUrl]);
|
|
216
|
+
}
|
|
217
|
+
})), { dispatch: false });
|
|
197
218
|
}
|
|
198
219
|
getReadableErrorReason(err) {
|
|
199
220
|
if (err instanceof Error && err.message?.trim()) {
|
|
@@ -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<{ 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.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 { 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 { spxChannelActions } from './spx-channel.actions';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { TranslateService } from '@ngx-translate/core';\nimport { spxTextLiveUpdateChannelSetFailed, spxTextLiveUpdateChannelSetFailedWithReason } from '@softpak/components/spx-translate';\nimport { from, of } from 'rxjs';\nimport { catchError, map, 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(spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n }));\n }\n return from(App.getInfo()).pipe(\n switchMap((binaryInfo) => from(LiveUpdate.setChannel({\n channel: `${action.channelType}-${getBinaryVersionGroup(binaryInfo.version)}.x`\n })).pipe(\n map((): { errorReason?: string; setChannelSucceeded: boolean } => ({ setChannelSucceeded: true })),\n catchError((err) => {\n const errorReason = this.getReadableErrorReason(err);\n captureMessage(`SPX Channel setChannel Error: ${errorReason}`);\n return of<{ errorReason?: string; setChannelSucceeded: boolean }>({ errorReason, setChannelSucceeded: false });\n }),\n )),\n tap(() => {\n this.router.navigate([spxUpdateUrl]);\n }),\n map((result) => result.setChannelSucceeded\n ? spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })\n : spxToasterActions.createError({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: result.errorReason\n ? this.translateService.instant(spxTextLiveUpdateChannelSetFailedWithReason, { reason: result.errorReason })\n : this.translateService.instant(spxTextLiveUpdateChannelSetFailed),\n })),\n catchError((err) => {\n const errorReason = this.getReadableErrorReason(err);\n captureMessage(`SPX Channel Error: ${errorReason}`);\n this.router.navigate([spxUpdateUrl]);\n return of(spxToasterActions.createError({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: errorReason\n ? this.translateService.instant(spxTextLiveUpdateChannelSetFailedWithReason, { reason: errorReason })\n : this.translateService.instant(spxTextLiveUpdateChannelSetFailed),\n }));\n }),\n );\n }),\n ), { dispatch: true });\n\n private getReadableErrorReason(err: unknown): string {\n if (err instanceof Error && err.message?.trim()) {\n return err.message.trim();\n }\n if (typeof err === 'string' && err.trim()) {\n return err.trim();\n }\n if (err && typeof err === 'object') {\n const withMessage = err as { message?: unknown };\n if (typeof withMessage.message === 'string' && withMessage.message.trim()) {\n return withMessage.message.trim();\n }\n try {\n const serialized = JSON.stringify(err);\n if (serialized && serialized !== '{}') {\n return serialized.length > 180 ? `${serialized.slice(0, 177)}...` : serialized;\n }\n } catch {\n // ignore serialization errors\n }\n }\n return '';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxChannelReducer","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AACjD,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE;QACN,MAAM,EAAE,KAAK,EAAoE;QACjF,UAAU,EAAE,KAAK,EAAmC;AACrD,KAAA;AACF,CAAA;;ACFM,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,IAAI,kBAAkB,EAA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,CAAC;AAyBjC,IAAA;AAvBW,IAAA,sBAAsB,CAAC,GAAY,EAAA;QACvC,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;AAC7C,YAAA,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;QAC7B;QACA,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE;AACvC,YAAA,OAAO,GAAG,CAAC,IAAI,EAAE;QACrB;AACA,QAAA,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAChC,MAAM,WAAW,GAAG,GAA4B;AAChD,YAAA,IAAI,OAAO,WAAW,CAAC,OAAO,KAAK,QAAQ,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE;AACvE,gBAAA,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE;YACrC;AACA,YAAA,IAAI;gBACA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AACtC,gBAAA,IAAI,UAAU,IAAI,UAAU,KAAK,IAAI,EAAE;oBACnC,OAAO,UAAU,CAAC,MAAM,GAAG,GAAG,GAAG,CAAA,EAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,GAAG,UAAU;gBAClF;YACJ;AAAE,YAAA,MAAM;;YAER;QACJ;AACA,QAAA,OAAO,EAAE;IACb;8GApFS,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;;;;;;;;ACjBD;;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, spxTextLiveUpdateChannelSetFailedWithReason } 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 const errorReason = this.getReadableErrorReason(err);\n captureMessage(`SPX Channel setChannel Error: ${errorReason}`);\n return of(\n spxChannelActions.chooseFailed({\n channel: action.channel,\n channelType: action.channelType,\n }),\n spxToasterActions.createError({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: errorReason\n ? this.translateService.instant(spxTextLiveUpdateChannelSetFailedWithReason, { reason: errorReason })\n : this.translateService.instant(spxTextLiveUpdateChannelSetFailed),\n }),\n );\n }),\n );\n }),\n catchError((err) => {\n const errorReason = this.getReadableErrorReason(err);\n captureMessage(`SPX Channel Error: ${errorReason}`);\n return of(\n spxChannelActions.chooseFailed({\n channel: action.channel,\n channelType: action.channelType,\n }),\n spxToasterActions.createError({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: errorReason\n ? this.translateService.instant(spxTextLiveUpdateChannelSetFailedWithReason, { reason: errorReason })\n : 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 private getReadableErrorReason(err: unknown): string {\n if (err instanceof Error && err.message?.trim()) {\n return err.message.trim();\n }\n if (typeof err === 'string' && err.trim()) {\n return err.trim();\n }\n if (err && typeof err === 'object') {\n const withMessage = err as { message?: unknown };\n if (typeof withMessage.message === 'string' && withMessage.message.trim()) {\n return withMessage.message.trim();\n }\n try {\n const serialized = JSON.stringify(err);\n if (serialized && serialized !== '{}') {\n return serialized.length > 180 ? `${serialized.slice(0, 177)}...` : serialized;\n }\n } catch {\n // ignore serialization errors\n }\n }\n return '';\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;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,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,kBAAk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EAAE;YAChC,MAAM,WAAW,GAAG,GAA4B;AAChD,YAAA,IAAI,OAAO,WAAW,CAAC,OAAO,KAAK,QAAQ,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE;AACvE,gBAAA,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE;YACrC;AACA,YAAA,IAAI;gBACA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AACtC,gBAAA,IAAI,UAAU,IAAI,UAAU,KAAK,IAAI,EAAE;oBACnC,OAAO,UAAU,CAAC,MAAM,GAAG,GAAG,GAAG,CAAA,EAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,GAAG,UAAU;gBAClF;YACJ;AAAE,YAAA,MAAM;;YAER;QACJ;AACA,QAAA,OAAO,EAAE;IACb;8GArHS,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;;;;;;;;AClBD;;AAEG;;;;"}
|
|
@@ -74,16 +74,34 @@ var spxNavigationReducer$1 = createFeature({
|
|
|
74
74
|
})), on(spxNavigationActions.update, (state, { accessList, signedIn }) => ({
|
|
75
75
|
...state,
|
|
76
76
|
accessList,
|
|
77
|
-
menuItems:
|
|
77
|
+
menuItems: menuItems(signedIn, accessList, state.navigationItems),
|
|
78
78
|
signedIn,
|
|
79
|
-
tabs:
|
|
79
|
+
tabs: tabs(signedIn, accessList, state.navigationItems),
|
|
80
80
|
})), on(spxNavigationActions.addPages, (state, { navigationItems }) => ({
|
|
81
81
|
...state,
|
|
82
82
|
navigationItems: [...state.navigationItems.slice(), ...navigationItems],
|
|
83
|
-
menuItems: [...state.menuItems.slice(), ...
|
|
84
|
-
tabs: [...state.tabs.slice(), ...
|
|
83
|
+
menuItems: [...state.menuItems.slice(), ...menuItems(state.signedIn, state.accessList, navigationItems)],
|
|
84
|
+
tabs: [...state.tabs.slice(), ...tabs(state.signedIn, state.accessList, navigationItems)],
|
|
85
85
|
}))),
|
|
86
86
|
});
|
|
87
|
+
const hasAccess = (signedIn, accessList, item) => {
|
|
88
|
+
if (item.signInRequired && !signedIn) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
if (item.accessKey !== undefined) {
|
|
92
|
+
if (!accessList.includes(item.accessKey)) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (item.accessKeyEither !== undefined && item.accessKeyEither.length > 0) {
|
|
97
|
+
if (item.accessKeyEither.filter(accessKeyObject => accessList.includes(accessKeyObject.accessKey)).length === 0) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
};
|
|
103
|
+
const menuItems = (signedIn, accessList, navigationItems) => navigationItems.filter(item => hasAccess(signedIn, accessList, item) && item.hasTile !== false);
|
|
104
|
+
const tabs = (signedIn, accessList, navigationItems) => navigationItems.filter(item => hasAccess(signedIn, accessList, item) && item.hasTab);
|
|
87
105
|
|
|
88
106
|
var spxNavigation_reducer = /*#__PURE__*/Object.freeze({
|
|
89
107
|
__proto__: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-navigation.mjs","sources":["../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tiles.component.ts","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tiles.component.html","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tile.component.ts","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tile.component.html","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.initial.ts","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.actions.ts","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.reducer.ts","../../../../projects/softpak/components/spx-navigation/spx-navigation.component.ts","../../../../projects/softpak/components/spx-navigation/spx-navigation.component.html","../../../../projects/softpak/components/spx-navigation/softpak-components-spx-navigation.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-home-tiles',\n standalone: true,\n templateUrl: './spx-home-tiles.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxHomeTilesComponent {\n readonly spxCols = input<1 | 2>(2);\n}\n","<div class=\"mx-auto max-w-lg grid gap-3\"\n [class.grid-cols-1]=\"this.spxCols() === 1\"\n [class.grid-cols-2]=\"this.spxCols() === 2\"><ng-content></ng-content></div>","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, input, viewChild } from '@angular/core';\n\n@Component({\n selector: 'spx-home-tile',\n imports: [\n NgClass\n ],\n templateUrl: './spx-home-tile.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxHomeTileComponent {\n readonly spxAutofocus = input<boolean>();\n readonly spxClass = input<string>();\n readonly spxSubtitle = input<string>();\n readonly spxTitle = input<string>();\n private buttonRef = viewChild<ElementRef<HTMLButtonElement>>('button');\n\n setFocus(): void {\n this.buttonRef()?.nativeElement.focus();\n }\n}\n","<button #button\n class=\"border border-transparent flex flex-col w-full px-4 py-2 relative rounded text-center focus:outline-none focus:ring-2 focus:ring-offset-2\"\n type=\"button\"\n part=\"button\"\n [attr.autofocus]=\"this.spxAutofocus() ? this.spxAutofocus() : undefined\"\n [class.bg-blue-600]=\"!this.spxClass()\"\n [class.focus:ring-blue-500]=\"!this.spxClass()\"\n [class.hover:bg-blue-800]=\"!this.spxClass()\"\n [class.text-white]=\"!this.spxClass()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\">\n <div class=\"flex gap-5 items-center\">\n <div class=\"fal my-2 self-center text-xl w-5\"><ng-content></ng-content></div>\n <div class=\"grow flex flex-col text-left\">\n <div class=\"text-lg font-bold text-ellipsis overflow-hidden\">{{ this.spxTitle() }}</div>\n @if (this.spxSubtitle()) {\n <div class=\"text-sm opacity-70 text-ellipsis overflow-hidden\">{{ this.spxSubtitle() }}</div>\n }\n </div>\n </div>\n </button>","import { StateI } from \"./spx-navigation.state\";\n\nexport const initialState: StateI = {\n accessList: [],\n navigationItems: [],\n menuItems: [],\n signedIn: false,\n tabs: [],\n};\n","import { createActionGroup, props } from '@ngrx/store';\n\nimport { SpxNavigationItemI } from '../../spx-navigation-item.interface';\n\nexport const spxNavigationActions = createActionGroup({\n source: 'SpxNavigation',\n events: {\n AddPages: props<{ navigationItems: SpxNavigationItemI[]; }>(),\n Initialize: props<{ navigationItems: SpxNavigationItemI[]; }>(),\n Update: props<{ accessList: string[]; signedIn: boolean; }>(),\n },\n});","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { StateI } from './spx-navigation.state';\nimport { initialState } from './spx-navigation.initial';\nimport { spxNavigationActions } from './spx-navigation.actions';\n\nexport default createFeature({\n name: 'spxNavigation',\n reducer: createReducer(\n initialState,\n on(spxNavigationActions.initialize, (state: StateI, { navigationItems }): StateI => ({\n ...state,\n navigationItems: navigationItems,\n menuItems: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && (navigationItem.hasTile === undefined || navigationItem.hasTile)),\n tabs: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && navigationItem.hasTab),\n })),\n on(spxNavigationActions.update, (state: StateI, { accessList, signedIn }): StateI => ({\n ...state,\n accessList,\n menuItems: state.navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || signedIn) && navigationItem?.hasTile !== false).filter(item => item.accessKey === undefined || accessList.includes(item.accessKey)),\n signedIn,\n tabs: state.navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || signedIn) && navigationItem.hasTab).filter(item => item.accessKey === undefined || accessList.includes(item.accessKey)),\n })),\n on(spxNavigationActions.addPages, (state: StateI, { navigationItems }): StateI => ({\n ...state,\n navigationItems: [...state.navigationItems.slice(), ...navigationItems],\n menuItems: [...state.menuItems.slice(), ...navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || state.signedIn) && navigationItem?.hasTile !== false).filter(item => item.accessKey === undefined || state.accessList.includes(item.accessKey))],\n tabs: [...state.tabs.slice(), ...navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || state.signedIn) && navigationItem.hasTab).filter(item => item.accessKey === undefined || state.accessList.includes(item.accessKey))],\n })),\n ),\n});\n","import { Component, input, OnDestroy, OnInit, output, signal, viewChildren } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxHomeTilesComponent } from './spx-home-tile/spx-home-tiles.component';\nimport { SpxHomeTileComponent } from './spx-home-tile/spx-home-tile.component';\nimport { Store } from '@ngrx/store';\nimport spxNavigationReducer from './store/spx-navigation/spx-navigation.reducer';\nimport { AsyncPipe } from '@angular/common';\nimport { SpxNavigationItemI } from './spx-navigation-item.interface';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'spx-navigation',\n templateUrl: './spx-navigation.component.html',\n imports: [\n TranslateModule,\n FontAwesomeModule,\n SpxCapitalizePipe,\n SpxHomeTilesComponent,\n SpxHomeTileComponent\n ]\n})\nexport class SpxNavigationComponent implements OnInit, OnDestroy {\n readonly spxOverwriteNavItems = input<SpxNavigationItemI[]>();\n tiles = viewChildren<SpxHomeTileComponent>(\"tiles\");\n spxClick = output<string>();\n navItems = signal<SpxNavigationItemI[]>([]);\n menuItemsSubscription: Subscription | null = null;\n \n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.menuItemsSubscription = this.appStore.select(spxNavigationReducer.selectMenuItems).subscribe((items) => {\n this.navItems.set(items);\n });\n }\n\n ngOnDestroy() {\n this.menuItemsSubscription?.unsubscribe();\n }\n\n setFocus(): void {\n this.tiles()[0]?.setFocus();\n }\n\n onNavigate(link: string) {\n this.spxClick.emit(link);\n }\n}\n","<spx-home-tiles [spxCols]=\"1\">\n @if (spxOverwriteNavItems() && spxOverwriteNavItems()?.length) {\n @for (item of spxOverwriteNavItems(); track item; let i = $index) {\n <spx-home-tile #tiles (click)=\"item.onClick ? item.onClick() : (item.routerLink ? onNavigate(item.routerLink) : null)\"\n [spxAutofocus]=\"i === 0\"\n [spxClass]=\"item.tileClasses ? item.tileClasses : undefined\"\n [spxTitle]=\"item.title | translate | capitalize\"\n [spxSubtitle]=\"item.subtite ? (item.subtite | translate | capitalize) : undefined\">\n <fa-icon [icon]=\"item.icon\"></fa-icon>\n </spx-home-tile>\n }\n }\n @else {\n @for (item of navItems(); track item; let i = $index) {\n <spx-home-tile #tiles (click)=\"item.onClick ? item.onClick() : (item.routerLink ? onNavigate(item.routerLink) : null)\"\n [spxAutofocus]=\"i === 0\"\n [spxClass]=\"item.tileClasses ? item.tileClasses : undefined\"\n [spxTitle]=\"item.title | translate | capitalize\"\n [spxSubtitle]=\"item.subtite ? (item.subtite | translate | capitalize) : undefined\">\n <fa-icon [icon]=\"item.icon\"></fa-icon>\n </spx-home-tile>\n }\n }\n</spx-home-tiles>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxNavigationReducer"],"mappings":";;;;;;;;;;;MAQa,qBAAqB,CAAA;AANlC,IAAA,WAAA,GAAA;AAOW,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAQ,CAAC,mDAAC;AACnC,IAAA;8GAFY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,oNCRlC,gLAE8E,EAAA,eAA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,YAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,EAAA,cAAA,EAAA,eAAA,EAAA,cAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,iBAAA,EAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAEjB,qBAAqB,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACrB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,UAAA,EAAA,aAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAFpB,iBAAiB,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKR,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EAEjB;wBACP,eAAe;wBACf,iBAAiB;wBACjB,iBAAiB;wBACjB,qBAAqB;wBACrB;AACD,qBAAA,EAAA,QAAA,EAAA,ssCAAA,EAAA;0OAI0C,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;;;AEzBpD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-navigation.mjs","sources":["../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tiles.component.ts","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tiles.component.html","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tile.component.ts","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tile.component.html","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.initial.ts","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.actions.ts","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.reducer.ts","../../../../projects/softpak/components/spx-navigation/spx-navigation.component.ts","../../../../projects/softpak/components/spx-navigation/spx-navigation.component.html","../../../../projects/softpak/components/spx-navigation/softpak-components-spx-navigation.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-home-tiles',\n standalone: true,\n templateUrl: './spx-home-tiles.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxHomeTilesComponent {\n readonly spxCols = input<1 | 2>(2);\n}\n","<div class=\"mx-auto max-w-lg grid gap-3\"\n [class.grid-cols-1]=\"this.spxCols() === 1\"\n [class.grid-cols-2]=\"this.spxCols() === 2\"><ng-content></ng-content></div>","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, input, viewChild } from '@angular/core';\n\n@Component({\n selector: 'spx-home-tile',\n imports: [\n NgClass\n ],\n templateUrl: './spx-home-tile.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxHomeTileComponent {\n readonly spxAutofocus = input<boolean>();\n readonly spxClass = input<string>();\n readonly spxSubtitle = input<string>();\n readonly spxTitle = input<string>();\n private buttonRef = viewChild<ElementRef<HTMLButtonElement>>('button');\n\n setFocus(): void {\n this.buttonRef()?.nativeElement.focus();\n }\n}\n","<button #button\n class=\"border border-transparent flex flex-col w-full px-4 py-2 relative rounded text-center focus:outline-none focus:ring-2 focus:ring-offset-2\"\n type=\"button\"\n part=\"button\"\n [attr.autofocus]=\"this.spxAutofocus() ? this.spxAutofocus() : undefined\"\n [class.bg-blue-600]=\"!this.spxClass()\"\n [class.focus:ring-blue-500]=\"!this.spxClass()\"\n [class.hover:bg-blue-800]=\"!this.spxClass()\"\n [class.text-white]=\"!this.spxClass()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\">\n <div class=\"flex gap-5 items-center\">\n <div class=\"fal my-2 self-center text-xl w-5\"><ng-content></ng-content></div>\n <div class=\"grow flex flex-col text-left\">\n <div class=\"text-lg font-bold text-ellipsis overflow-hidden\">{{ this.spxTitle() }}</div>\n @if (this.spxSubtitle()) {\n <div class=\"text-sm opacity-70 text-ellipsis overflow-hidden\">{{ this.spxSubtitle() }}</div>\n }\n </div>\n </div>\n </button>","import { StateI } from \"./spx-navigation.state\";\n\nexport const initialState: StateI = {\n accessList: [],\n navigationItems: [],\n menuItems: [],\n signedIn: false,\n tabs: [],\n};\n","import { createActionGroup, props } from '@ngrx/store';\nimport { SpxNavigationItemI } from '../../spx-navigation-item.interface';\n\nexport const spxNavigationActions = createActionGroup({\n source: 'SpxNavigation',\n events: {\n AddPages: props<{ navigationItems: SpxNavigationItemI[]; }>(),\n Initialize: props<{ navigationItems: SpxNavigationItemI[]; }>(),\n Update: props<{ accessList: string[]; signedIn: boolean; }>(),\n },\n});","import { createFeature, createReducer, on } from '@ngrx/store';\nimport { SpxNavigationItemI } from '../../spx-navigation-item.interface';\nimport { StateI } from './spx-navigation.state';\nimport { initialState } from './spx-navigation.initial';\nimport { spxNavigationActions } from './spx-navigation.actions';\n\nexport default createFeature({\n name: 'spxNavigation',\n reducer: createReducer(\n initialState,\n on(spxNavigationActions.initialize, (state: StateI, { navigationItems }): StateI => ({\n ...state,\n navigationItems: navigationItems,\n menuItems: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && (navigationItem.hasTile === undefined || navigationItem.hasTile)),\n tabs: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && navigationItem.hasTab),\n })),\n on(spxNavigationActions.update, (state: StateI, { accessList, signedIn }): StateI => ({\n ...state,\n accessList,\n menuItems: menuItems(signedIn, accessList, state.navigationItems),\n signedIn,\n tabs: tabs(signedIn, accessList, state.navigationItems),\n })),\n on(spxNavigationActions.addPages, (state: StateI, { navigationItems }): StateI => ({\n ...state,\n navigationItems: [...state.navigationItems.slice(), ...navigationItems],\n menuItems: [...state.menuItems.slice(), ...menuItems(state.signedIn, state.accessList, navigationItems)],\n tabs: [...state.tabs.slice(), ...tabs(state.signedIn, state.accessList, navigationItems)],\n })),\n ),\n});\n\nconst hasAccess = (signedIn: boolean, accessList: string[], item: SpxNavigationItemI): boolean => {\n if (item.signInRequired && !signedIn) {\n return false;\n }\n\n if (item.accessKey !== undefined) {\n if (!accessList.includes(item.accessKey)) {\n return false;\n }\n }\n\n if (item.accessKeyEither !== undefined && item.accessKeyEither.length > 0) {\n if (item.accessKeyEither.filter(accessKeyObject => accessList.includes(accessKeyObject.accessKey)).length === 0) {\n return false;\n }\n }\n\n return true;\n};\n\nconst menuItems = (signedIn: boolean, accessList: string[], navigationItems: SpxNavigationItemI[]) => navigationItems.filter(\n item => hasAccess(signedIn, accessList, item) && item.hasTile !== false\n);\n\nconst tabs = (signedIn: boolean, accessList: string[], navigationItems: SpxNavigationItemI[]) => navigationItems.filter(\n item => hasAccess(signedIn, accessList, item) && item.hasTab\n);\n","import { Component, input, OnDestroy, OnInit, output, signal, viewChildren } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxHomeTilesComponent } from './spx-home-tile/spx-home-tiles.component';\nimport { SpxHomeTileComponent } from './spx-home-tile/spx-home-tile.component';\nimport { Store } from '@ngrx/store';\nimport spxNavigationReducer from './store/spx-navigation/spx-navigation.reducer';\nimport { AsyncPipe } from '@angular/common';\nimport { SpxNavigationItemI } from './spx-navigation-item.interface';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'spx-navigation',\n templateUrl: './spx-navigation.component.html',\n imports: [\n TranslateModule,\n FontAwesomeModule,\n SpxCapitalizePipe,\n SpxHomeTilesComponent,\n SpxHomeTileComponent\n ]\n})\nexport class SpxNavigationComponent implements OnInit, OnDestroy {\n readonly spxOverwriteNavItems = input<SpxNavigationItemI[]>();\n tiles = viewChildren<SpxHomeTileComponent>(\"tiles\");\n spxClick = output<string>();\n navItems = signal<SpxNavigationItemI[]>([]);\n menuItemsSubscription: Subscription | null = null;\n \n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.menuItemsSubscription = this.appStore.select(spxNavigationReducer.selectMenuItems).subscribe((items) => {\n this.navItems.set(items);\n });\n }\n\n ngOnDestroy() {\n this.menuItemsSubscription?.unsubscribe();\n }\n\n setFocus(): void {\n this.tiles()[0]?.setFocus();\n }\n\n onNavigate(link: string) {\n this.spxClick.emit(link);\n }\n}\n","<spx-home-tiles [spxCols]=\"1\">\n @if (spxOverwriteNavItems() && spxOverwriteNavItems()?.length) {\n @for (item of spxOverwriteNavItems(); track item; let i = $index) {\n <spx-home-tile #tiles (click)=\"item.onClick ? item.onClick() : (item.routerLink ? onNavigate(item.routerLink) : null)\"\n [spxAutofocus]=\"i === 0\"\n [spxClass]=\"item.tileClasses ? item.tileClasses : undefined\"\n [spxTitle]=\"item.title | translate | capitalize\"\n [spxSubtitle]=\"item.subtite ? (item.subtite | translate | capitalize) : undefined\">\n <fa-icon [icon]=\"item.icon\"></fa-icon>\n </spx-home-tile>\n }\n }\n @else {\n @for (item of navItems(); track item; let i = $index) {\n <spx-home-tile #tiles (click)=\"item.onClick ? item.onClick() : (item.routerLink ? onNavigate(item.routerLink) : null)\"\n [spxAutofocus]=\"i === 0\"\n [spxClass]=\"item.tileClasses ? item.tileClasses : undefined\"\n [spxTitle]=\"item.title | translate | capitalize\"\n [spxSubtitle]=\"item.subtite ? (item.subtite | translate | capitalize) : undefined\">\n <fa-icon [icon]=\"item.icon\"></fa-icon>\n </spx-home-tile>\n }\n }\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AA,MAAA,EAAA,IAAA,EAFpB,iBAAiB,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKR,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EAEjB;wBACP,eAAe;wBACf,iBAAiB;wBACjB,iBAAiB;wBACjB,qBAAqB;wBACrB;AACD,qBAAA,EAAA,QAAA,EAAA,ssCAAA,EAAA;0OAI0C,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;;;AEzBpD;;AAEG;;;;"}
|
|
@@ -34,7 +34,7 @@ class SpxPatchComponent {
|
|
|
34
34
|
this.severityWarning = SpxSeverityEnum.warning;
|
|
35
35
|
}
|
|
36
36
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxPatchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxPatchComponent, isStandalone: true, selector: "spx-patch", inputs: { spxText: { classPropertyName: "spxText", publicName: "spxText", isSignal: true, isRequired: true, transformFunction: null }, patchCheck: { classPropertyName: "patchCheck", publicName: "patchCheck", isSignal: true, isRequired: true, transformFunction: null }, releaseCheck: { classPropertyName: "releaseCheck", publicName: "releaseCheck", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n @if (releaseCheck()) {\n <spx-alert [spxTitle]=\"'Requires new release'\" [spxSeverity]=\"severityError\">\n {{ spxText() ? spxText() : 'This new functionality' }} requires release {{releaseCheck()}}.\n </spx-alert>\n }\n \n @if (patchCheck()) {\n <spx-alert [spxTitle]=\"'Softpak patch'\" [spxSeverity]=\"severityWarning\">\n {{ spxText() ? spxText() : 'This new functionality' }} requires patch #{{patchCheck()}} to be installed.\n </spx-alert>\n }\n </div>", dependencies: [{ kind: "component", type: SpxAlertComponent, selector: "spx-alert", inputs: ["spxAutoclose", "spxCloseable", "spxHideTitle", "spxTitle", "spxMarginTop", "spxSeverity"], outputs: ["spxClose", "spxTitleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
37
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxPatchComponent, isStandalone: true, selector: "spx-patch", inputs: { spxText: { classPropertyName: "spxText", publicName: "spxText", isSignal: true, isRequired: true, transformFunction: null }, patchCheck: { classPropertyName: "patchCheck", publicName: "patchCheck", isSignal: true, isRequired: true, transformFunction: null }, releaseCheck: { classPropertyName: "releaseCheck", publicName: "releaseCheck", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n @if (releaseCheck()) {\n <spx-alert [spxTitle]=\"'Requires new release'\" [spxSeverity]=\"severityError\">\n {{ spxText() ? spxText() : 'This new functionality' }} requires release {{releaseCheck()}}.\n </spx-alert>\n }\n \n @if (patchCheck()) {\n <spx-alert [spxTitle]=\"'Softpak patch'\" [spxSeverity]=\"severityWarning\">\n {{ spxText() ? spxText() : 'This new functionality' }} requires patch #{{patchCheck()}} to be installed.\n </spx-alert>\n }\n </div>", dependencies: [{ kind: "component", type: SpxAlertComponent, selector: "spx-alert", inputs: ["spxAutoclose", "spxCompanyName", "spxCloseable", "spxHideTitle", "spxTitle", "spxMarginTop", "spxSeverity"], outputs: ["spxClose", "spxTitleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
38
|
}
|
|
39
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxPatchComponent, decorators: [{
|
|
40
40
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-patch.mjs","sources":["../../../../projects/softpak/components/spx-patch/patch-check.function.ts","../../../../projects/softpak/components/spx-patch/release-check.function.ts","../../../../projects/softpak/components/spx-patch/spx-patch.component.ts","../../../../projects/softpak/components/spx-patch/spx-patch.component.html","../../../../projects/softpak/components/spx-patch/softpak-components-spx-patch.ts"],"sourcesContent":["import { SpxStorage, SpxStorageKeyEnum } from \"@softpak/components/spx-storage\";\n\nexport const patchCheck = (pair: { release: string; patchAtLeast: number; }[]) => {\n const release = pair.find(p => p.release === SpxStorage.getSetting(SpxStorageKeyEnum.release));\n if (!release || (parseInt(SpxStorage.getSetting(SpxStorageKeyEnum.patch) ?? '0', 10) >= release.patchAtLeast)) {\n return null;\n }\n return release.patchAtLeast;\n};\n\n","import { SpxStorage, SpxStorageKeyEnum } from \"@softpak/components/spx-storage\";\n\nexport const releaseCheck = (releaseAtLeast: string, orInReleaseList?: string[]) => {\n const currentRelease = (SpxStorage.getSetting(SpxStorageKeyEnum.release) ?? '00.00').split('.').map((v: string) => parseInt(v, 10));\n const requiredRelease = releaseAtLeast.split('.').map((v: string) => parseInt(v, 10));\n \n if (orInReleaseList && orInReleaseList.find(release => release === (SpxStorage.getSetting(SpxStorageKeyEnum.release) ?? '00.00'))) {\n return null;\n }\n\n if (requiredRelease[0] < currentRelease[0] ||\n requiredRelease[0] === currentRelease[0] && requiredRelease[1] <= currentRelease[1]\n ) {\n return null;\n }\n return releaseAtLeast;\n};\n\n","\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { SpxAlertComponent } from '@softpak/components/spx-alert';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-patch',\n imports: [\n SpxAlertComponent\n ],\n templateUrl: './spx-patch.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxPatchComponent {\n readonly spxText = input.required<string>();\n readonly patchCheck = input.required<number | null>();\n readonly releaseCheck = input.required<string | null>();\n severityError = SpxSeverityEnum.error;\n severityWarning = SpxSeverityEnum.warning;\n}\n","<div class=\"flex flex-col gap-2\">\n @if (releaseCheck()) {\n <spx-alert [spxTitle]=\"'Requires new release'\" [spxSeverity]=\"severityError\">\n {{ spxText() ? spxText() : 'This new functionality' }} requires release {{releaseCheck()}}.\n </spx-alert>\n }\n \n @if (patchCheck()) {\n <spx-alert [spxTitle]=\"'Softpak patch'\" [spxSeverity]=\"severityWarning\">\n {{ spxText() ? spxText() : 'This new functionality' }} requires patch #{{patchCheck()}} to be installed.\n </spx-alert>\n }\n </div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEO,MAAM,UAAU,GAAG,CAAC,IAAkD,KAAI;IAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,EAAE;AAC3G,QAAA,OAAO,IAAI;IACf;IACA,OAAO,OAAO,CAAC,YAAY;AAC/B;;MCNa,YAAY,GAAG,CAAC,cAAsB,EAAE,eAA0B,KAAI;AAC/E,IAAA,MAAM,cAAc,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAS,KAAK,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnI,MAAM,eAAe,GAAG,cAAc,CAAC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AAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,YAAA,EAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECd9B,miBAYQ,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDJA,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,cAAA,EAAA,cAAA,EAAA,UAAA,EAAA,cAAA,EAAA,aAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAMZ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAT7B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,EAAA,OAAA,EACZ;wBACL;AACH,qBAAA,EAAA,UAAA,EAEW,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,miBAAA,EAAA;;;AEZnD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-patch.mjs","sources":["../../../../projects/softpak/components/spx-patch/patch-check.function.ts","../../../../projects/softpak/components/spx-patch/release-check.function.ts","../../../../projects/softpak/components/spx-patch/spx-patch.component.ts","../../../../projects/softpak/components/spx-patch/spx-patch.component.html","../../../../projects/softpak/components/spx-patch/softpak-components-spx-patch.ts"],"sourcesContent":["import { SpxStorage, SpxStorageKeyEnum } from \"@softpak/components/spx-storage\";\n\nexport const patchCheck = (pair: { release: string; patchAtLeast: number; }[]) => {\n const release = pair.find(p => p.release === SpxStorage.getSetting(SpxStorageKeyEnum.release));\n if (!release || (parseInt(SpxStorage.getSetting(SpxStorageKeyEnum.patch) ?? '0', 10) >= release.patchAtLeast)) {\n return null;\n }\n return release.patchAtLeast;\n};\n\n","import { SpxStorage, SpxStorageKeyEnum } from \"@softpak/components/spx-storage\";\n\nexport const releaseCheck = (releaseAtLeast: string, orInReleaseList?: string[]) => {\n const currentRelease = (SpxStorage.getSetting(SpxStorageKeyEnum.release) ?? '00.00').split('.').map((v: string) => parseInt(v, 10));\n const requiredRelease = releaseAtLeast.split('.').map((v: string) => parseInt(v, 10));\n \n if (orInReleaseList && orInReleaseList.find(release => release === (SpxStorage.getSetting(SpxStorageKeyEnum.release) ?? '00.00'))) {\n return null;\n }\n\n if (requiredRelease[0] < currentRelease[0] ||\n requiredRelease[0] === currentRelease[0] && requiredRelease[1] <= currentRelease[1]\n ) {\n return null;\n }\n return releaseAtLeast;\n};\n\n","\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { SpxAlertComponent } from '@softpak/components/spx-alert';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-patch',\n imports: [\n SpxAlertComponent\n ],\n templateUrl: './spx-patch.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxPatchComponent {\n readonly spxText = input.required<string>();\n readonly patchCheck = input.required<number | null>();\n readonly releaseCheck = input.required<string | null>();\n severityError = SpxSeverityEnum.error;\n severityWarning = SpxSeverityEnum.warning;\n}\n","<div class=\"flex flex-col gap-2\">\n @if (releaseCheck()) {\n <spx-alert [spxTitle]=\"'Requires new release'\" [spxSeverity]=\"severityError\">\n {{ spxText() ? spxText() : 'This new functionality' }} requires release {{releaseCheck()}}.\n </spx-alert>\n }\n \n @if (patchCheck()) {\n <spx-alert [spxTitle]=\"'Softpak patch'\" [spxSeverity]=\"severityWarning\">\n {{ spxText() ? spxText() : 'This new functionality' }} requires patch #{{patchCheck()}} to be installed.\n </spx-alert>\n }\n </div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEO,MAAM,UAAU,GAAG,CAAC,IAAkD,KAAI;IAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC9F,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,EAAE;AAC3G,QAAA,OAAO,IAAI;IACf;IACA,OAAO,OAAO,CAAC,YAAY;AAC/B;;MCNa,YAAY,GAAG,CAAC,cAAsB,EAAE,eAA0B,KAAI;AAC/E,IAAA,MAAM,cAAc,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAS,KAAK,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnI,MAAM,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAS,KAAK,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAErF,IAAI,eAAe,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,MAAM,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE;AAC/H,QAAA,OAAO,IAAI;IACf;IAEA,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC;AACtC,QAAA,eAAe,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