@softpak/components 21.1.0-beta.5 → 21.1.0-beta.6

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.
Files changed (32) hide show
  1. package/fesm2022/softpak-components-spx-alert.mjs +4 -3
  2. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  3. package/fesm2022/softpak-components-spx-app-expiry.mjs +5 -5
  4. package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
  5. package/fesm2022/softpak-components-spx-channel-selection.mjs +18 -20
  6. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  7. package/fesm2022/softpak-components-spx-confirm.mjs +17 -25
  8. package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
  9. package/fesm2022/softpak-components-spx-navigation.mjs +14 -21
  10. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  11. package/fesm2022/softpak-components-spx-patch.mjs +1 -1
  12. package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
  13. package/fesm2022/softpak-components-spx-spinner.mjs +12 -18
  14. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  15. package/fesm2022/softpak-components-spx-stock-info.mjs +1 -1
  16. package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
  17. package/fesm2022/softpak-components-spx-tabs.mjs +8 -11
  18. package/fesm2022/softpak-components-spx-tabs.mjs.map +1 -1
  19. package/fesm2022/softpak-components-spx-toaster.mjs +27 -42
  20. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  21. package/fesm2022/softpak-components-spx-update.mjs +36 -46
  22. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/tailwind.css +1 -1
  25. package/types/softpak-components-spx-alert.d.ts +3 -1
  26. package/types/softpak-components-spx-channel-selection.d.ts +23 -35
  27. package/types/softpak-components-spx-confirm.d.ts +21 -33
  28. package/types/softpak-components-spx-navigation.d.ts +20 -36
  29. package/types/softpak-components-spx-spinner.d.ts +14 -27
  30. package/types/softpak-components-spx-tabs.d.ts +8 -17
  31. package/types/softpak-components-spx-toaster.d.ts +57 -91
  32. package/types/softpak-components-spx-update.d.ts +29 -40
@@ -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.0.8", ngImport: i0, type: SpxAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
61
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", 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>", 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
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", 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.0.8", 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>", styles: [":host{display:block}\n"] }]
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,CAAA,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC9B,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,GAA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A,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClB9B,w+GAuDQ,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED7CJ,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,w+GAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;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,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AAA,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;;;;"}
@@ -2,10 +2,6 @@ import * as i0 from '@angular/core';
2
2
  import { input, signal, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { DateTime } from 'luxon';
4
4
 
5
- const spxCheckExpiryWarning = (appStoreVersion, spxAppExpiry) => {
6
- return spxAppExpiry !== undefined && appStoreVersion.substring(0, 3) !== spxAppExpiry.requiredVersion.substring(0, 3) && DateTime.now() > spxAppExpiry.warning;
7
- };
8
-
9
5
  const spxCheckExpiryFinalWarning = (appStoreVersion, spxAppExpiry) => {
10
6
  return spxAppExpiry !== undefined && appStoreVersion.substring(0, 3) !== spxAppExpiry.requiredVersion.substring(0, 3) && DateTime.now() > spxAppExpiry.finalWarning;
11
7
  };
@@ -14,6 +10,10 @@ const spxCheckExpiryHappened = (appStoreVersion, spxAppExpiry) => {
14
10
  return spxAppExpiry !== undefined && appStoreVersion.substring(0, 3) !== spxAppExpiry.requiredVersion.substring(0, 3) && DateTime.now() > spxAppExpiry.expiry;
15
11
  };
16
12
 
13
+ const spxCheckExpiryWarning = (appStoreVersion, spxAppExpiry) => {
14
+ return spxAppExpiry !== undefined && appStoreVersion.substring(0, 3) !== spxAppExpiry.requiredVersion.substring(0, 3) && DateTime.now() > spxAppExpiry.warning;
15
+ };
16
+
17
17
  class SpxAppExpiryComponent {
18
18
  constructor() {
19
19
  this.txtContactHelpdeskOrSoftpak = input.required(...(ngDevMode ? [{ debugName: "txtContactHelpdeskOrSoftpak" }] : []));
@@ -36,7 +36,7 @@ class SpxAppExpiryComponent {
36
36
  if (spxExpiry && spxVersion) {
37
37
  this.expired.set(spxCheckExpiryHappened(spxVersion, spxExpiry));
38
38
  this.finalWarning.set(spxCheckExpiryFinalWarning(spxVersion, spxExpiry) && !this.expired());
39
- this.warning.set(spxCheckExpiryWarning(spxVersion, spxExpiry) && !this.finalWarning && !this.expired());
39
+ this.warning.set(spxCheckExpiryWarning(spxVersion, spxExpiry) && !this.finalWarning() && !this.expired());
40
40
  }
41
41
  }
42
42
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SpxAppExpiryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-app-expiry.mjs","sources":["../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-warning.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-final-warning.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-happened.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-app-expiry.component.ts","../../../../projects/softpak/components/spx-app-expiry/spx-app-expiry.component.html","../../../../projects/softpak/components/spx-app-expiry/softpak-components-spx-app-expiry.ts"],"sourcesContent":["import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryWarning = (appStoreVersion: string, spxAppExpiry?: SpxAppExpiryI): boolean => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.warning;\n}","import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryFinalWarning = (appStoreVersion: string, spxAppExpiry?: SpxAppExpiryI) => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.finalWarning;\n}","import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryHappened = (appStoreVersion: string, spxAppExpiry: SpxAppExpiryI): boolean => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.expiry;\n}","\nimport { ChangeDetectionStrategy, Component, OnChanges, input, signal } from '@angular/core';\nimport { SpxAppExpiryI } from './spx-app-expiry.interface';\nimport { spxCheckExpiryWarning } from './spx-check-expiry-warning.interface';\nimport { spxCheckExpiryFinalWarning } from './spx-check-expiry-final-warning.interface';\nimport { spxCheckExpiryHappened } from './spx-check-expiry-happened.interface';\n\n@Component({\n selector: 'spx-app-expiry',\n imports: [],\n templateUrl: './spx-app-expiry.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush, \n standalone: true,\n})\nexport class SpxAppExpiryComponent implements OnChanges {\n readonly txtContactHelpdeskOrSoftpak = input.required<string>();\n readonly txtExpired = input.required<string>();\n readonly txtLastReminder = input.required<string>();\n readonly txtPleaseOpenTheAppStore = input.required<string>();\n readonly txtPleaseUpdate = input.required<string>();\n readonly txtThisVersionWillExpireSoon = input.required<string>();\n readonly txtUpdateAvailable = input.required<string>();\n readonly txtUpdateTheAppToTheLatestVersion = input.required<string>();\n readonly spxExpiry = input.required<SpxAppExpiryI>();\n readonly spxVersion = input.required<string>();\n warning = signal<boolean>(false);\n finalWarning = signal<boolean>(false);\n expired = signal<boolean>(false);\n ngOnChanges(): void {\n const spxExpiry = this.spxExpiry();\n const spxVersion = this.spxVersion();\n if (spxExpiry && spxVersion) {\n this.expired.set(spxCheckExpiryHappened(spxVersion, spxExpiry));\n this.finalWarning.set(spxCheckExpiryFinalWarning(spxVersion, spxExpiry) && !this.expired());\n this.warning.set(spxCheckExpiryWarning(spxVersion, spxExpiry) && !this.finalWarning && !this.expired());\n }\n }\n}\n","@if (warning() || finalWarning() || expired()) {\n <div class=\"m-3\">\n <div\n class=\"p-3 font-bold text-white rounded-t text-xl\"\n [class.bg-lime-600]=\"warning()\"\n [class.bg-red-600]=\"expired()\"\n [class.bg-amber-600]=\"finalWarning()\">\n @if (warning()) {\n {{ txtUpdateAvailable() }}\n }\n @if (finalWarning()) {\n {{ txtLastReminder() }}\n }\n @if (expired()) {\n {{ txtExpired() }}\n }\n </div>\n <div\n class=\"bg-amber-50 p-3 text-black rounded-b mb-3\">\n <div>{{ txtPleaseOpenTheAppStore() }}.</div>\n <div>{{ txtUpdateTheAppToTheLatestVersion() }}.</div>\n <div>{{ txtContactHelpdeskOrSoftpak() }}.</div>\n @if (finalWarning()) {\n <div>{{ txtThisVersionWillExpireSoon() }}.</div>\n }\n </div>\n </div>\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAGa,qBAAqB,GAAG,CAAC,eAAuB,EAAE,YAA4B,KAAa;AACtG,IAAA,OAAO,YAAY,KAAK,SAAS,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,KAAK,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,OAAO;AAC9J;;MCFa,0BAA0B,GAAG,CAAC,eAAuB,EAAE,YAA4B,KAAI;AAClG,IAAA,OAAO,YAAY,KAAK,SAAS,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,KAAK,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,IAAK,QAAQ,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,YAAY;AACpK;;MCFa,sBAAsB,GAAG,CAAC,eAAuB,EAAE,YAA2B,KAAa;AACtG,IAAA,OAAO,YAAY,KAAK,SAAS,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,KAAK,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,MAAM;AAC7J;;MCSa,qBAAqB,CAAA;AA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CAAC,OAAO,EAAE,CAAC;YAC3F,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACzG;IACF;8GAtBW,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,krDCdlC,g1BA2BC,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDbY,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,WACjB,EAAE,EAAA,eAAA,EAEM,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,g1BAAA,EAAA;;;AEZpB;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-app-expiry.mjs","sources":["../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-final-warning.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-happened.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-check-expiry-warning.interface.ts","../../../../projects/softpak/components/spx-app-expiry/spx-app-expiry.component.ts","../../../../projects/softpak/components/spx-app-expiry/spx-app-expiry.component.html","../../../../projects/softpak/components/spx-app-expiry/softpak-components-spx-app-expiry.ts"],"sourcesContent":["import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryFinalWarning = (appStoreVersion: string, spxAppExpiry?: SpxAppExpiryI) => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.finalWarning;\n}","import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryHappened = (appStoreVersion: string, spxAppExpiry: SpxAppExpiryI): boolean => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.expiry;\n}","import { DateTime } from \"luxon\";\nimport { SpxAppExpiryI } from \"./spx-app-expiry.interface\";\n\nexport const spxCheckExpiryWarning = (appStoreVersion: string, spxAppExpiry?: SpxAppExpiryI): boolean => {\n return spxAppExpiry !== undefined && appStoreVersion.substring(0,3) !== spxAppExpiry.requiredVersion.substring(0,3) && DateTime.now() > spxAppExpiry.warning;\n}","import { ChangeDetectionStrategy, Component, OnChanges, input, signal } from '@angular/core';\n\nimport { SpxAppExpiryI } from './spx-app-expiry.interface';\nimport { spxCheckExpiryFinalWarning } from './spx-check-expiry-final-warning.interface';\nimport { spxCheckExpiryHappened } from './spx-check-expiry-happened.interface';\nimport { spxCheckExpiryWarning } from './spx-check-expiry-warning.interface';\n\n@Component({\n selector: 'spx-app-expiry',\n imports: [],\n templateUrl: './spx-app-expiry.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush, \n standalone: true,\n})\nexport class SpxAppExpiryComponent implements OnChanges {\n readonly txtContactHelpdeskOrSoftpak = input.required<string>();\n readonly txtExpired = input.required<string>();\n readonly txtLastReminder = input.required<string>();\n readonly txtPleaseOpenTheAppStore = input.required<string>();\n readonly txtPleaseUpdate = input.required<string>();\n readonly txtThisVersionWillExpireSoon = input.required<string>();\n readonly txtUpdateAvailable = input.required<string>();\n readonly txtUpdateTheAppToTheLatestVersion = input.required<string>();\n readonly spxExpiry = input.required<SpxAppExpiryI>();\n readonly spxVersion = input.required<string>();\n warning = signal<boolean>(false);\n finalWarning = signal<boolean>(false);\n expired = signal<boolean>(false);\n ngOnChanges(): void {\n const spxExpiry = this.spxExpiry();\n const spxVersion = this.spxVersion();\n if (spxExpiry && spxVersion) {\n this.expired.set(spxCheckExpiryHappened(spxVersion, spxExpiry));\n this.finalWarning.set(spxCheckExpiryFinalWarning(spxVersion, spxExpiry) && !this.expired());\n this.warning.set(spxCheckExpiryWarning(spxVersion, spxExpiry) && !this.finalWarning() && !this.expired());\n }\n }\n}\n","@if (warning() || finalWarning() || expired()) {\n <div class=\"m-3\">\n <div\n class=\"p-3 font-bold text-white rounded-t text-xl\"\n [class.bg-lime-600]=\"warning()\"\n [class.bg-red-600]=\"expired()\"\n [class.bg-amber-600]=\"finalWarning()\">\n @if (warning()) {\n {{ txtUpdateAvailable() }}\n }\n @if (finalWarning()) {\n {{ txtLastReminder() }}\n }\n @if (expired()) {\n {{ txtExpired() }}\n }\n </div>\n <div\n class=\"bg-amber-50 p-3 text-black rounded-b mb-3\">\n <div>{{ txtPleaseOpenTheAppStore() }}.</div>\n <div>{{ txtUpdateTheAppToTheLatestVersion() }}.</div>\n <div>{{ txtContactHelpdeskOrSoftpak() }}.</div>\n @if (finalWarning()) {\n <div>{{ txtThisVersionWillExpireSoon() }}.</div>\n }\n </div>\n </div>\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAGa,0BAA0B,GAAG,CAAC,eAAuB,EAAE,YAA4B,KAAI;AAClG,IAAA,OAAO,YAAY,KAAK,SAAS,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,KAAK,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,IAAK,QAAQ,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,YAAY;AACpK;;MCFa,sBAAsB,GAAG,CAAC,eAAuB,EAAE,YAA2B,KAAa;AACtG,IAAA,OAAO,YAAY,KAAK,SAAS,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC,E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from '@capacitor/core';
7
7
  import { NavController } from '@ionic/angular/standalone';
8
8
  import { SpxButtonComponent } from '@softpak/components/spx-button';
9
9
  import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
10
- import { createAction, props, union, createFeature, createReducer, on, Store } from '@ngrx/store';
10
+ import { createActionGroup, props, createFeature, createReducer, on, createSelector, Store } from '@ngrx/store';
11
11
  import { TranslatePipe } from '@ngx-translate/core';
12
12
  import { map } from 'rxjs';
13
13
  import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
@@ -15,24 +15,19 @@ import { spxTextChange } from '@softpak/components/spx-translate';
15
15
  import { toSignal } from '@angular/core/rxjs-interop';
16
16
  import * as i1 from '@ngrx/effects';
17
17
  import { createEffect, ofType } from '@ngrx/effects';
18
- import { switchMap } from 'rxjs/operators';
19
- import { setConfig } from '@capacitor/live-updates';
20
- import { spxUpdateUrl } from '@softpak/components/spx-update';
21
18
  import { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';
22
- import { captureMessage } from '@sentry/angular';
23
19
  import { App } from '@capacitor/app';
20
+ import { captureMessage } from '@sentry/angular';
21
+ import { setConfig } from '@capacitor/live-updates';
22
+ import { spxUpdateUrl } from '@softpak/components/spx-update';
23
+ import { switchMap } from 'rxjs/operators';
24
24
 
25
- const choose = createAction('[SPX / Channel] Select', props());
26
- const initialize = createAction('[SPX / Channel] Initialize', props());
27
- const all = union({
28
- choose,
29
- initialize,
30
- });
31
-
32
- var spxChannel_actions = /*#__PURE__*/Object.freeze({
33
- __proto__: null,
34
- choose: choose,
35
- initialize: initialize
25
+ const spxChannelActions = createActionGroup({
26
+ source: 'SpxChannel',
27
+ events: {
28
+ Choose: props(),
29
+ Initialize: props(),
30
+ },
36
31
  });
37
32
 
38
33
  const initialState = {
@@ -68,7 +63,10 @@ const determineActiveChannel = (channels) => {
68
63
  };
69
64
  var spxChannelReducer$1 = createFeature({
70
65
  name: 'spxChannel',
71
- reducer: createReducer(initialState, on(choose, (state, { channel, channelType }) => {
66
+ extraSelectors: ({ selectChannel }) => ({
67
+ selectCompanyName: createSelector(selectChannel, (channel) => channel?.brand),
68
+ }),
69
+ reducer: createReducer(initialState, on(spxChannelActions.choose, (state, { channel, channelType }) => {
72
70
  SpxStorage.setSetting(SpxStorageKeyEnum.brand, channel?.brand);
73
71
  SpxStorage.setSetting(SpxStorageKeyEnum.channelType, channelType);
74
72
  return {
@@ -76,7 +74,7 @@ var spxChannelReducer$1 = createFeature({
76
74
  previousChannel: state.channel,
77
75
  channel,
78
76
  };
79
- }), on(initialize, (state, { channels }) => {
77
+ }), on(spxChannelActions.initialize, (state, { channels }) => {
80
78
  let channelType = null;
81
79
  if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {
82
80
  channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) };
@@ -153,7 +151,7 @@ class Effects {
153
151
  this.actions$ = actions$;
154
152
  this.router = router;
155
153
  this.store = inject(Store);
156
- this.onChoose$ = createEffect(() => this.actions$.pipe(ofType(choose), switchMap((action) => {
154
+ this.onChoose$ = createEffect(() => this.actions$.pipe(ofType(spxChannelActions.choose), switchMap((action) => {
157
155
  if (Capacitor.getPlatform() === 'web') {
158
156
  const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType);
159
157
  if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl, '').replace(channelType.oldWebUrl, '').split('/').at(0) !== '') {
@@ -197,5 +195,5 @@ var spxChannel_effects = /*#__PURE__*/Object.freeze({
197
195
  * Generated bundle index. Do not edit.
198
196
  */
199
197
 
200
- export { SpxChannelGuard, SpxChannelIndicatorComponent, spxChannel_actions as spxChannelActions, spxChannel_effects as spxChannelEffects, spxChannel_reducer as spxChannelReducer, spxChannelSelectionUrl };
198
+ export { SpxChannelGuard, SpxChannelIndicatorComponent, spxChannelActions, spxChannel_effects as spxChannelEffects, spxChannel_reducer as spxChannelReducer, spxChannelSelectionUrl };
201
199
  //# sourceMappingURL=softpak-components-spx-channel-selection.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.html","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { createAction, props, union } from '@ngrx/store';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\n\nexport const choose = createAction('[SPX / Channel] Select', props<{\n channel: SpxAppChannelI;\n channelType: SpxAppChannelTypeEnum;\n}>());\nexport const initialize = createAction('[SPX / Channel] Initialize', props<{\n channels: SpxAppChannelI[];\n}>());\n\nconst all = union({\n choose,\n initialize,\n});\n\nexport type Actions = typeof all;\n","\nimport * as actions from './spx-channel.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\nimport { Capacitor } from '@capacitor/core';\n\nexport const initialState: StateI = {\n previousChannel: null,\n channel: null,\n channelType: null,\n channels: [],\n};\n\nexport interface StateI {\n previousChannel: SpxAppChannelI | null;\n channel: SpxAppChannelI | null;\n channels: SpxAppChannelI[];\n channelType: SpxChannelTypeI | null;\n}\n\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.some((e: SpxChannelTypeI) => e.name === SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\n if (channelResult) {\n return channelResult;\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n } else {\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\n return null;\n }\n }\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n }\n return null;\n }\n}\n\nexport default createFeature({\n name: 'spxChannel',\n reducer: createReducer(\n initialState,\n on(actions.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(actions.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 = toSignal(this.store.select(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 { switchMap, withLatestFrom } from 'rxjs/operators';\nimport { inject, Injectable } from '@angular/core';\nimport * as actions from './spx-channel.actions';\nimport { setConfig } from '@capacitor/live-updates';\nimport { Capacitor } from '@capacitor/core';\nimport { Router } from '@angular/router';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\nimport { captureMessage } from '@sentry/angular';\nimport { App } from '@capacitor/app';\nimport { Store } from '@ngrx/store';\n\n@Injectable()\nexport class Effects {\n store = inject(Store);\n\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(actions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType)!;\n if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl!,'').replace(channelType.oldWebUrl!,'').split('/').at(0) !== '') {\n window.location.href = channelType.webUrl!;\n } else {\n this.router.navigate(['tabs/hme']);\n }\n } else {\n App.getInfo().then((binaryInfo) => {\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\n setConfig({\n channel: `${action.channelType}-${binaryVersionGroup}.x`\n });\n this.router.navigate([spxUpdateUrl]);\n }).catch((err) => {\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\n this.router.navigate([spxUpdateUrl]);\n });\n }\n\n return [spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })];\n }),\n ), { dispatch: true });\n\n constructor(\n private readonly actions$: Actions,\n private readonly router: Router,\n ) { }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.choose","actions.initialize","spxChannelReducer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,MAAM,GAAG,YAAY,CAAC,wBAAwB,E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,CAAC,UAAU,KAAI;AAC9B,oBAAA,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AAC7D,oBAAA,SAAS,CAAC;AACN,wBAAA,OAAO,EAAE,CAAA,EAAG,MAAM,CAAC,WAAW,CAAA,CAAA,EAAI,kBAAkB,CAAA,EAAA;AACvD,qBAAA,CAAC;oBACF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;AACxC,gBAAA,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAI;oBACb,cAAc,CAAC,CAAA,mBAAA,EAAsB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA,CAAE,CAAC;oBAC3D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;AACxC,gBAAA,CAAC,CAAC;YACN;AAEA,YAAA,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC;oBACpC,SAAS,EAAE,4BAA4B,CAAC,OAAO;AAC/C,oBAAA,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK;AACrC,iBAAA,CAAC,CAAC;QACP,CAAC,CAAC,CACL,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAK1B;8GAtCK,OAAO,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAP,OAAO,EAAA,CAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;;;;;;ACbD;;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 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 = toSignal(this.store.select(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 { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport { captureMessage } from '@sentry/angular';\nimport { setConfig } from '@capacitor/live-updates';\nimport { spxChannelActions } from './spx-channel.actions';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { switchMap } from 'rxjs/operators';\n\n@Injectable()\nexport class Effects {\n store = inject(Store);\n\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(spxChannelActions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType)!;\n if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl!,'').replace(channelType.oldWebUrl!,'').split('/').at(0) !== '') {\n window.location.href = channelType.webUrl!;\n } else {\n this.router.navigate(['tabs/hme']);\n }\n } else {\n App.getInfo().then((binaryInfo) => {\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\n setConfig({\n channel: `${action.channelType}-${binaryVersionGroup}.x`\n });\n this.router.navigate([spxUpdateUrl]);\n }).catch((err) => {\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\n this.router.navigate([spxUpdateUrl]);\n });\n }\n\n return [spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })];\n }),\n ), { dispatch: true });\n\n constructor(\n private readonly actions$: Actions,\n private readonly router: Router,\n ) { }\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,UAAU,EAAE,KAAK,EAAmC;AACrD,KAAA;AAC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ak/components/spx-button';
6
6
  import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
7
7
  import * as i1 from '@ngrx/store';
8
- import { createAction, props, union, createFeature, createReducer, on } from '@ngrx/store';
8
+ import { createActionGroup, props, emptyProps, createFeature, createReducer, on } from '@ngrx/store';
9
9
  import * as i1$1 from '@ngrx/effects';
10
10
  import { createEffect, ofType } from '@ngrx/effects';
11
11
  import { withLatestFrom, mergeMap } from 'rxjs/operators';
@@ -55,13 +55,13 @@ class SpxConfirmDisplayerComponent {
55
55
  this.subscriptions?.confirmState?.unsubscribe();
56
56
  }
57
57
  onCancel(id) {
58
- this.appStore.dispatch(answer({
58
+ this.appStore.dispatch(spxConfirmActions.answer({
59
59
  cancel: true,
60
60
  id
61
61
  }));
62
62
  }
63
63
  onConfirm(id) {
64
- this.appStore.dispatch(answer({
64
+ this.appStore.dispatch(spxConfirmActions.answer({
65
65
  confirm: true,
66
66
  id
67
67
  }));
@@ -74,22 +74,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
74
74
  args: [{ selector: 'spx-confirm-displayer', imports: [SpxConfirmComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}" }]
75
75
  }], ctorParameters: () => [{ type: i1.Store }] });
76
76
 
77
- const answer = createAction('[Confirm] Answer', props());
78
- const reset = createAction('[Confirm] Reset', props());
79
- const show = createAction('[Confirm] Show', props());
80
- const answerConfirm = createAction('[Confirm] Answer Confirm', props());
81
- const all = union({
82
- reset,
83
- show,
84
- answerConfirm,
85
- });
86
-
87
- var spxConfirm_actions = /*#__PURE__*/Object.freeze({
88
- __proto__: null,
89
- answer: answer,
90
- answerConfirm: answerConfirm,
91
- reset: reset,
92
- show: show
77
+ const spxConfirmActions = createActionGroup({
78
+ source: 'SpxConfirm',
79
+ events: {
80
+ Answer: props(),
81
+ AnswerConfirm: props(),
82
+ Reset: emptyProps(),
83
+ Show: props(),
84
+ },
93
85
  });
94
86
 
95
87
  const initialState = {
@@ -97,9 +89,9 @@ const initialState = {
97
89
  };
98
90
  var spxConfirmReducer$1 = createFeature({
99
91
  name: 'spxConfirm',
100
- reducer: createReducer(initialState, on(reset, (state, {}) => ({
92
+ reducer: createReducer(initialState, on(spxConfirmActions.reset, (state, {}) => ({
101
93
  ...state,
102
- })), on(show, (state, { content, id, title, noYesButton, onCancel, onOK }) => {
94
+ })), on(spxConfirmActions.show, (state, { content, id, title, noYesButton, onCancel, onOK }) => {
103
95
  const confirms = state.confirms.filter((c) => c.id).length > 0
104
96
  ? state.confirms
105
97
  : [
@@ -117,7 +109,7 @@ var spxConfirmReducer$1 = createFeature({
117
109
  ...state,
118
110
  confirms,
119
111
  };
120
- }), on(answerConfirm, (state, { id }) => ({
112
+ }), on(spxConfirmActions.answerConfirm, (state, { id }) => ({
121
113
  ...state,
122
114
  confirms: [
123
115
  ...state.confirms.filter((c) => c.id !== id),
@@ -134,7 +126,7 @@ class SpxConfirmEffects {
134
126
  constructor(actions$, appStore) {
135
127
  this.actions$ = actions$;
136
128
  this.appStore = appStore;
137
- this.onAnswer$ = createEffect(() => this.actions$.pipe(ofType(answer), withLatestFrom(this.appStore.select(spxConfirmReducer$1.selectConfirms)), mergeMap(([action, confirms]) => {
129
+ this.onAnswer$ = createEffect(() => this.actions$.pipe(ofType(spxConfirmActions.answer), withLatestFrom(this.appStore.select(spxConfirmReducer$1.selectConfirms)), mergeMap(([action, confirms]) => {
138
130
  if (action.confirm) {
139
131
  confirms.find((c) => c.id === action.id)?.onOK?.();
140
132
  }
@@ -142,7 +134,7 @@ class SpxConfirmEffects {
142
134
  confirms.find((c) => c.id === action.id)?.onCancel?.();
143
135
  }
144
136
  return [
145
- answerConfirm({ id: action.id }),
137
+ spxConfirmActions.answerConfirm({ id: action.id }),
146
138
  spxSpinnerActions.hide({
147
139
  action: action.id,
148
140
  })
@@ -165,5 +157,5 @@ var spxConfirm_effects = /*#__PURE__*/Object.freeze({
165
157
  * Generated bundle index. Do not edit.
166
158
  */
167
159
 
168
- export { SpxConfirmComponent, SpxConfirmDisplayerComponent, spxConfirm_actions as spxConfirmActions, spxConfirm_effects as spxConfirmEffects, spxConfirm_reducer as spxConfirmReducer };
160
+ export { SpxConfirmComponent, SpxConfirmDisplayerComponent, spxConfirmActions, spxConfirm_effects as spxConfirmEffects, spxConfirm_reducer as spxConfirmReducer };
169
161
  //# sourceMappingURL=softpak-components-spx-confirm.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createAction, props, union } from '@ngrx/store';\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const answer = createAction('[Confirm] Answer', props<{\n cancel?: boolean;\n confirm?: boolean;\n id: string;\n}>());\nexport const reset = createAction('[Confirm] Reset', props<Record<string, unknown>>());\nexport const show = createAction('[Confirm] Show', props<SpxConfirmI>());\n\nexport const answerConfirm = createAction('[Confirm] Answer Confirm', props<{\n id: string;\n}>());\n\nconst all = union({\n reset,\n show,\n answerConfirm,\n});\nexport type Actions = typeof all;\n","import * as actions from './spx-confirm.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n actions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n actions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n actions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import * as actions from './spx-confirm.actions';\n\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\n\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Store } from '@ngrx/store';\nimport spxConfirmReducer from './spx-confirm.reducer';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(actions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n actions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({\n action: action.id,\n })\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmActions.answer","actions.reset","actions.show","actions.answerConfirm","actions.answer","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,6CAAU;QAC7B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAU;QAC5B,IAAA,CAAA,UAAU,GAAG,MAAM,EAAU;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAAe,CAAC,OAAO;IAEzB;IAEhB,QAAQ,GAAA;QACN,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IAChC;IAEA,SAAS,GAAA;AACP,QAAA,IAAG,IAAI,CAAC,EAAE,EAAE,EAAE,EAAC;QACf,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IACjC;8GAlBW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAA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AC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI;YACpD;AACA,YAAA,IAAI,MAAM,CAAC,MAAM,EAAE;gBACjB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,QAAQ,IAAI;YACxD;YACA,OAAO;gBACLF,aAAqB,CAAC,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAC,CAAC;gBACtC,iBAAiB,CAAC,IAAI,CAAC;oBACrB,MAAM,EAAE,MAAM,CAAC,EAAE;iBAClB;aACF;QACH,CAAC,CAAC,CACH,CACF;IAKE;8GA1BQ,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAG,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,EAAA,CAAA,KAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;;;;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createActionGroup, emptyProps, props } from '@ngrx/store';\n\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const spxConfirmActions = createActionGroup({\n source: 'SpxConfirm',\n events: {\n Answer: props<{ cancel?: boolean; confirm?: boolean; id: string; }>(),\n AnswerConfirm: props<{ id: string; }>(),\n Reset: emptyProps(),\n Show: props<SpxConfirmI>(),\n },\n});\n","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { spxConfirmActions } from './spx-confirm.actions';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n spxConfirmActions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n spxConfirmActions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n spxConfirmActions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\n\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Store } from '@ngrx/store';\nimport { spxConfirmActions } from './spx-confirm.actions';\nimport spxConfirmReducer from './spx-confirm.reducer';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(spxConfirmActions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n spxConfirmActions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({\n action: action.id,\n })\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,6CAAU;QAC7B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAU;QAC5B,IAAA,CAAA,UAAU,GAAG,MAAM,EAAU;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAAe,CAAC,OAAO;IAEzB;IAEhB,QAAQ,GAAA;QACN,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IAChC;IAEA,SAAS,GAAA;AACP,QAAA,IAAG,IAAI,CAAC,EAAE,EAAE,EAAE,EAAC;QACf,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IACjC;8GAlBW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA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