@softpak/components 21.3.16 → 21.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/softpak-components-spx-check-digit.mjs +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +3 -3
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +19 -12
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +4 -3
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-welcome.mjs +19 -3
- package/fesm2022/softpak-components-spx-welcome.mjs.map +1 -1
- package/package.json +1 -1
- package/types/softpak-components-spx-form-view.d.ts +4 -0
- package/types/softpak-components-spx-inputs.d.ts +10 -4
- package/types/softpak-components-spx-suggestion.d.ts +2 -1
- package/types/softpak-components-spx-welcome.d.ts +4 -2
|
@@ -11,6 +11,7 @@ class SpxSuggestionComponent {
|
|
|
11
11
|
this.spxSelected = input(...(ngDevMode ? [undefined, { debugName: "spxSelected" }] : []));
|
|
12
12
|
this.spxTabbable = input(...(ngDevMode ? [undefined, { debugName: "spxTabbable" }] : []));
|
|
13
13
|
this.spxIcon = input(...(ngDevMode ? [undefined, { debugName: "spxIcon" }] : []));
|
|
14
|
+
this.spxIconClass = input(...(ngDevMode ? [undefined, { debugName: "spxIconClass" }] : []));
|
|
14
15
|
this.spxBgClass = input(...(ngDevMode ? [undefined, { debugName: "spxBgClass" }] : []));
|
|
15
16
|
this.suggestionRef = viewChild('suggestionRef', ...(ngDevMode ? [{ debugName: "suggestionRef" }] : []));
|
|
16
17
|
this.spxHaptics = new SpxHaptics();
|
|
@@ -34,12 +35,12 @@ class SpxSuggestionComponent {
|
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxSuggestionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxSuggestionComponent, isStandalone: true, selector: "spx-suggestion", inputs: { spxDisabled: { classPropertyName: "spxDisabled", publicName: "spxDisabled", isSignal: true, isRequired: false, transformFunction: null }, spxFocused: { classPropertyName: "spxFocused", publicName: "spxFocused", isSignal: true, isRequired: false, transformFunction: null }, spxSelected: { classPropertyName: "spxSelected", publicName: "spxSelected", isSignal: true, isRequired: false, transformFunction: null }, spxTabbable: { classPropertyName: "spxTabbable", publicName: "spxTabbable", isSignal: true, isRequired: false, transformFunction: null }, spxIcon: { classPropertyName: "spxIcon", publicName: "spxIcon", isSignal: true, isRequired: false, transformFunction: null }, spxBgClass: { classPropertyName: "spxBgClass", publicName: "spxBgClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:pointerup": "onDocumentPointerUp($event)" } }, viewQueries: [{ propertyName: "suggestionRef", first: true, predicate: ["suggestionRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none relative overflow-hidden\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled() && !this.spxBgClass()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [ngClass]=\"(!this.spxSelected() && !this.spxDisabled() && this.spxBgClass()) ? this.spxBgClass()! : ''\"\n (pointerdown)=\"this.handlePress()\">\n @if (this.spxIcon()) {\n <fa-icon [icon]=\"this.spxIcon()!\" class=\"absolute right-2 top-1/2 -translate-y-1/2 text-lg opacity-30\"></fa-icon>\n }\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>", styles: [""], dependencies: [{ kind: "component", type: 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: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxSuggestionComponent, isStandalone: true, selector: "spx-suggestion", inputs: { spxDisabled: { classPropertyName: "spxDisabled", publicName: "spxDisabled", isSignal: true, isRequired: false, transformFunction: null }, spxFocused: { classPropertyName: "spxFocused", publicName: "spxFocused", isSignal: true, isRequired: false, transformFunction: null }, spxSelected: { classPropertyName: "spxSelected", publicName: "spxSelected", isSignal: true, isRequired: false, transformFunction: null }, spxTabbable: { classPropertyName: "spxTabbable", publicName: "spxTabbable", isSignal: true, isRequired: false, transformFunction: null }, spxIcon: { classPropertyName: "spxIcon", publicName: "spxIcon", isSignal: true, isRequired: false, transformFunction: null }, spxIconClass: { classPropertyName: "spxIconClass", publicName: "spxIconClass", isSignal: true, isRequired: false, transformFunction: null }, spxBgClass: { classPropertyName: "spxBgClass", publicName: "spxBgClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:pointerup": "onDocumentPointerUp($event)" } }, viewQueries: [{ propertyName: "suggestionRef", first: true, predicate: ["suggestionRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none relative overflow-hidden\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled() && !this.spxBgClass()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [ngClass]=\"(!this.spxSelected() && !this.spxDisabled() && this.spxBgClass()) ? this.spxBgClass()! : ''\"\n (pointerdown)=\"this.handlePress()\">\n @if (this.spxIcon()) {\n <fa-icon [icon]=\"this.spxIcon()!\" class=\"absolute right-2 top-1/2 -translate-y-1/2 text-lg opacity-30\" [ngClass]=\"this.spxIconClass() ?? ''\"></fa-icon>\n }\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>", styles: [""], dependencies: [{ kind: "component", type: 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: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
39
|
}
|
|
39
40
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxSuggestionComponent, decorators: [{
|
|
40
41
|
type: Component,
|
|
41
|
-
args: [{ selector: 'spx-suggestion', standalone: true, imports: [FaIconComponent, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none relative overflow-hidden\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled() && !this.spxBgClass()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [ngClass]=\"(!this.spxSelected() && !this.spxDisabled() && this.spxBgClass()) ? this.spxBgClass()! : ''\"\n (pointerdown)=\"this.handlePress()\">\n @if (this.spxIcon()) {\n <fa-icon [icon]=\"this.spxIcon()!\" class=\"absolute right-2 top-1/2 -translate-y-1/2 text-lg opacity-30\"></fa-icon>\n }\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>" }]
|
|
42
|
-
}], propDecorators: { spxDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxDisabled", required: false }] }], spxFocused: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxFocused", required: false }] }], spxSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxSelected", required: false }] }], spxTabbable: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxTabbable", required: false }] }], spxIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxIcon", required: false }] }], spxBgClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxBgClass", required: false }] }], suggestionRef: [{ type: i0.ViewChild, args: ['suggestionRef', { isSignal: true }] }], onDocumentPointerUp: [{
|
|
42
|
+
args: [{ selector: 'spx-suggestion', standalone: true, imports: [FaIconComponent, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none relative overflow-hidden\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled() && !this.spxBgClass()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [ngClass]=\"(!this.spxSelected() && !this.spxDisabled() && this.spxBgClass()) ? this.spxBgClass()! : ''\"\n (pointerdown)=\"this.handlePress()\">\n @if (this.spxIcon()) {\n <fa-icon [icon]=\"this.spxIcon()!\" class=\"absolute right-2 top-1/2 -translate-y-1/2 text-lg opacity-30\" [ngClass]=\"this.spxIconClass() ?? ''\"></fa-icon>\n }\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>" }]
|
|
43
|
+
}], propDecorators: { spxDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxDisabled", required: false }] }], spxFocused: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxFocused", required: false }] }], spxSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxSelected", required: false }] }], spxTabbable: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxTabbable", required: false }] }], spxIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxIcon", required: false }] }], spxIconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxIconClass", required: false }] }], spxBgClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxBgClass", required: false }] }], suggestionRef: [{ type: i0.ViewChild, args: ['suggestionRef', { isSignal: true }] }], onDocumentPointerUp: [{
|
|
43
44
|
type: HostListener,
|
|
44
45
|
args: ['document:pointerup', ['$event']]
|
|
45
46
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-suggestion.mjs","sources":["../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.ts","../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.html","../../../../projects/softpak/components/spx-suggestion/softpak-components-spx-suggestion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, HostListener, input, viewChild } from '@angular/core';\nimport { NgClass } from '@angular/common';\n\nimport { FaIconComponent, IconDefinition } from '@fortawesome/angular-fontawesome';\nimport { SpxHaptics } from '@softpak/components/spx-haptics';\n\n@Component({\n selector: 'spx-suggestion',\n standalone: true,\n imports: [FaIconComponent, NgClass],\n templateUrl: './spx-suggestion.component.html',\n styleUrl: './spx-suggestion.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SpxSuggestionComponent {\n spxDisabled = input<boolean>();\n spxFocused = input<boolean>();\n spxSelected = input<boolean>();\n spxTabbable = input<boolean>();\n spxIcon = input<IconDefinition>();\n spxBgClass = input<string>();\n suggestionRef = viewChild<ElementRef<HTMLButtonElement>>('suggestionRef');\n private spxHaptics: SpxHaptics = new SpxHaptics();\n\n // For haptics\n handlePress = async () => {\n if (this.spxDisabled()) {\n return;\n }\n this.spxHaptics.pressDown();\n };\n\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (this.spxDisabled()) {\n return;\n }\n\n const btn = this.suggestionRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const wasInsideElement = btn.contains(event.target as Node);\n this.spxHaptics.pointerUp(wasInsideElement);\n };\n // End haptics\n}\n","<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none relative overflow-hidden\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled() && !this.spxBgClass()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [ngClass]=\"(!this.spxSelected() && !this.spxDisabled() && this.spxBgClass()) ? this.spxBgClass()! : ''\"\n (pointerdown)=\"this.handlePress()\">\n @if (this.spxIcon()) {\n <fa-icon [icon]=\"this.spxIcon()!\" class=\"absolute right-2 top-1/2 -translate-y-1/2 text-lg opacity-30\"></fa-icon>\n }\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAca,sBAAsB,CAAA;AARnC,IAAA,WAAA,GAAA;QASE,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC7B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAkB;QACjC,IAAA,CAAA,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC5B,QAAA,IAAA,CAAA,aAAa,GAAG,SAAS,CAAgC,eAAe,yDAAC;AACjE,QAAA,IAAA,CAAA,UAAU,GAAe,IAAI,UAAU,EAAE;;QAGjD,IAAA,CAAA,WAAW,GAAG,YAAW;AACvB,YAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;gBACtB;YACF;AACA,YAAA,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE;AAC7B,QAAA,CAAC;AAGD,QAAA,IAAA,CAAA,mBAAmB,GAAG,OAAO,KAAmB,KAAI;AAClD,YAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;gBACtB;YACF;YAEA,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,aAAa;YAC/C,IAAI,CAAC,GAAG,EAAE;gBACR;YACF;YAEA,MAAM,gBAAgB,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC;AAC3D,YAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC;AAC7C,QAAA,CAAC;AAEF,IAAA;
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-suggestion.mjs","sources":["../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.ts","../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.html","../../../../projects/softpak/components/spx-suggestion/softpak-components-spx-suggestion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, HostListener, input, viewChild } from '@angular/core';\nimport { NgClass } from '@angular/common';\n\nimport { FaIconComponent, IconDefinition } from '@fortawesome/angular-fontawesome';\nimport { SpxHaptics } from '@softpak/components/spx-haptics';\n\n@Component({\n selector: 'spx-suggestion',\n standalone: true,\n imports: [FaIconComponent, NgClass],\n templateUrl: './spx-suggestion.component.html',\n styleUrl: './spx-suggestion.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SpxSuggestionComponent {\n spxDisabled = input<boolean>();\n spxFocused = input<boolean>();\n spxSelected = input<boolean>();\n spxTabbable = input<boolean>();\n spxIcon = input<IconDefinition>();\n spxIconClass = input<string>();\n spxBgClass = input<string>();\n suggestionRef = viewChild<ElementRef<HTMLButtonElement>>('suggestionRef');\n private spxHaptics: SpxHaptics = new SpxHaptics();\n\n // For haptics\n handlePress = async () => {\n if (this.spxDisabled()) {\n return;\n }\n this.spxHaptics.pressDown();\n };\n\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (this.spxDisabled()) {\n return;\n }\n\n const btn = this.suggestionRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const wasInsideElement = btn.contains(event.target as Node);\n this.spxHaptics.pointerUp(wasInsideElement);\n };\n // End haptics\n}\n","<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none relative overflow-hidden\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled() && !this.spxBgClass()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [ngClass]=\"(!this.spxSelected() && !this.spxDisabled() && this.spxBgClass()) ? this.spxBgClass()! : ''\"\n (pointerdown)=\"this.handlePress()\">\n @if (this.spxIcon()) {\n <fa-icon [icon]=\"this.spxIcon()!\" class=\"absolute right-2 top-1/2 -translate-y-1/2 text-lg opacity-30\" [ngClass]=\"this.spxIconClass() ?? ''\"></fa-icon>\n }\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAca,sBAAsB,CAAA;AARnC,IAAA,WAAA,GAAA;QASE,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC7B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAkB;QACjC,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,UAAU,GAAG,KAAK,CAAA,IA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AAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDjBC,eAAe,ybAAE,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKvB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBARlC,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,eAAe,EAAE,OAAO,CAAC,EAAA,eAAA,EAGlB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,4yDAAA,EAAA;2wBAUU,eAAe,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,CAAA;sBAWvE,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AEjChD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/forms';
|
|
4
4
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';
|
|
@@ -28,13 +28,24 @@ class SpxWelcomeComponent {
|
|
|
28
28
|
this.store = store;
|
|
29
29
|
this.formBuilder = formBuilder;
|
|
30
30
|
this.allChannels = toSignal(this.store.select(spxChannelReducer.default.selectChannels));
|
|
31
|
+
this.favouritesVersion = signal(0, ...(ngDevMode ? [{ debugName: "favouritesVersion" }] : []));
|
|
31
32
|
this.allBrands = computed(() => {
|
|
33
|
+
this.favouritesVersion();
|
|
32
34
|
const favourites = this.getFavourites();
|
|
33
|
-
|
|
35
|
+
const brands = this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({
|
|
34
36
|
description: c.brand,
|
|
35
37
|
value: c.brand,
|
|
36
|
-
...(favourites.includes(c.brand) ? { icon: faHeart, bgClass: 'bg-red-100' } : {})
|
|
38
|
+
...(favourites.includes(c.brand) ? { icon: faHeart, iconClass: 'text-red-800', bgClass: 'bg-red-100' } : {})
|
|
37
39
|
}));
|
|
40
|
+
return brands?.sort((a, b) => {
|
|
41
|
+
const aFav = favourites.includes(a.value);
|
|
42
|
+
const bFav = favourites.includes(b.value);
|
|
43
|
+
if (aFav && !bFav)
|
|
44
|
+
return -1;
|
|
45
|
+
if (!aFav && bFav)
|
|
46
|
+
return 1;
|
|
47
|
+
return a.value.localeCompare(b.value);
|
|
48
|
+
});
|
|
38
49
|
}, ...(ngDevMode ? [{ debugName: "allBrands" }] : []));
|
|
39
50
|
this.inputBrand = signal(null, ...(ngDevMode ? [{ debugName: "inputBrand" }] : []));
|
|
40
51
|
this.inputChannelType = signal(null, ...(ngDevMode ? [{ debugName: "inputChannelType" }] : []));
|
|
@@ -91,6 +102,9 @@ class SpxWelcomeComponent {
|
|
|
91
102
|
type: () => SpxInputTypeEnum.checkbox,
|
|
92
103
|
label: () => this.textDoYouComeHereOften,
|
|
93
104
|
checkboxText: () => this.textFavorite,
|
|
105
|
+
checkboxIcon: () => faHeart,
|
|
106
|
+
checkboxIconClass: () => 'text-red-800',
|
|
107
|
+
checkboxBgClass: () => 'bg-red-100',
|
|
94
108
|
show: () => valuePairToValue(this.ctrlChannel().value),
|
|
95
109
|
defaultValue: () => ({ value: false }),
|
|
96
110
|
},
|
|
@@ -128,6 +142,8 @@ class SpxWelcomeComponent {
|
|
|
128
142
|
? [...new Set([...favourites, brand])]
|
|
129
143
|
: favourites.filter(f => f !== brand);
|
|
130
144
|
SpxStorage.setSetting(SpxStorageKeyEnum.channelFavourites, JSON.stringify(updated));
|
|
145
|
+
this.favouritesVersion.update(v => v + 1);
|
|
146
|
+
this.suggestions()[spxCtrlChannel] = this.allBrands();
|
|
131
147
|
});
|
|
132
148
|
this.subscriptions.channelType = this.ctrlChannelType().valueChanges.subscribe(valuePair => {
|
|
133
149
|
this.inputChannelType.set(valuePairToValue(this.ctrlChannelType().value));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-welcome.mjs","sources":["../../../../projects/softpak/components/spx-welcome/spx-welcome.component.ts","../../../../projects/softpak/components/spx-welcome/spx-welcome.component.html","../../../../projects/softpak/components/spx-welcome/softpak-components-spx-welcome.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, signal } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { IonButtons, IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\nimport { spxChannelActions, spxChannelReducer } from '@softpak/components/spx-channel-selection';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxTextChannel, spxTextCompany, spxTextDoYouComeHereOften, spxTextFavorite, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\n\nimport { Capacitor } from '@capacitor/core';\nimport { faHeart } from '@fortawesome/free-solid-svg-icons';\nimport { SpxAppChannelTypeEnum, } from '@softpak/components/spx-app-configuration';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nexport const spxSectionWelcome = 'welcome';\nexport const spxCtrlChannel = 'channel';\nexport const spxCtrlChannelType = 'channelType';\nexport const spxCtrlFavorite = 'favorite';\n\n@Component({\n selector: 'spx-welcome',\n templateUrl: './spx-welcome.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxFormViewComponent,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonButtons,\n IonContent,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\n allChannels = toSignal(this.store.select(spxChannelReducer.default.selectChannels));\n allBrands = computed(() => {\n const favourites = this.getFavourites();\n return this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({\n description: c.brand,\n value: c.brand,\n ...(favourites.includes(c.brand) ? { icon: faHeart, bgClass: 'bg-red-100' } : {})\n }));\n });\n inputBrand = signal<string | null>(null);\n inputChannelType = signal<SpxAppChannelTypeEnum | null>(null);\n selectedBrand = computed(() => this.allChannels()?.find(c => c.brand === this.inputBrand()));\n channelTypeSuggestions = computed(() => this.selectedBrand()?.channelTypes?.filter(channelType => Capacitor.getPlatform() === 'web' ? channelType.webUrl !== undefined : channelType.webUrl === undefined)?.map(channelType => ({\n description: channelType.name,\n value: channelType.name\n })));\n\n protected readonly formGroup = signal<FormGroup | undefined>(undefined);\n protected readonly suggestions = signal<{\n [spxCtrlChannelType]?: SpxValuePair<string>[];\n [spxCtrlChannel]?: SpxValuePair<string>[];\n }>({\n [spxCtrlChannelType]: [],\n [spxCtrlChannel]: [],\n });\n\n textChannel = spxTextChannel;\n textCompany = spxTextCompany;\n textSelect = spxTextSelect;\n textSelectYourCompany = spxTextSelectYourCompany;\n textDoYouComeHereOften = spxTextDoYouComeHereOften;\n textFavorite = spxTextFavorite;\n\n protected readonly formSection = computed(() => this.formGroup()?.get(spxSectionWelcome) as FormGroup);\n private readonly ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel) as FormControl);\n private readonly ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType) as FormControl);\n private readonly ctrlFavorite = computed(() => this.formSection()?.get(spxCtrlFavorite) as FormControl);\n private subscriptions: {\n channel?: Subscription;\n channelType?: Subscription;\n favorite?: Subscription;\n } = {};\n\n protected readonly form = signal<SpxFormI>({\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSelect,\n }\n ],\n sections: [\n {\n key: spxSectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel().value),\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlFavorite,\n type: () => SpxInputTypeEnum.checkbox,\n label: () => this.textDoYouComeHereOften,\n checkboxText: () => this.textFavorite,\n show: () => valuePairToValue(this.ctrlChannel().value),\n defaultValue: () => ({ value: false }),\n },\n ]\n }\n ]\n });\n\n constructor(\n private readonly store: Store,\n private readonly formBuilder: FormBuilder\n ) {\n this.formGroup.set(this.formBuilder.group({\n [spxSectionWelcome]: SpxFormViewComponent.createForm(this.form())\n }));\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n ngOnInit(): void {\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n\n this.subscriptions.channel = this.ctrlChannel().valueChanges.subscribe(valuePair => {\n const brand = valuePairToValue(valuePair) as string | null;\n this.inputBrand.set(brand);\n this.suggestions()[spxCtrlChannelType] = this.channelTypeSuggestions();\n this.ctrlChannelType().setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n\n const favourites = this.getFavourites();\n const isFavourite = brand ? favourites.includes(brand) : false;\n this.ctrlFavorite().setValue({ value: isFavourite }, { emitEvent: false });\n });\n\n this.subscriptions.favorite = this.ctrlFavorite().valueChanges.subscribe(valuePair => {\n const brand = this.inputBrand();\n if (!brand) return;\n const favourites = this.getFavourites();\n const isFavourite = valuePairToValue(valuePair) as boolean;\n const updated = isFavourite\n ? [...new Set([...favourites, brand])]\n : favourites.filter(f => f !== brand);\n SpxStorage.setSetting(SpxStorageKeyEnum.channelFavourites, JSON.stringify(updated));\n });\n\n this.subscriptions.channelType = this.ctrlChannelType().valueChanges.subscribe(valuePair => {\n this.inputChannelType.set(valuePairToValue(this.ctrlChannelType().value));\n });\n }\n\n private getFavourites(): string[] {\n const raw = SpxStorage.getSetting(SpxStorageKeyEnum.channelFavourites);\n if (!raw) return [];\n try { return JSON.parse(raw) as string[]; } catch { return []; }\n }\n\n protected onSubmit(): void {\n if (!this.selectedBrand() || !this.inputChannelType()) {\n this.store.dispatch(spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: 'Please select a company',\n }))\n } else {\n this.store.dispatch(spxChannelActions.choose({\n channel: this.selectedBrand()!,\n channelType: this.inputChannelType()!,\n }));\n }\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ textSelectYourCompany | translate | capitalize }}\n </ion-title>\n <ion-buttons slot=\"end\">\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content class=\"ion-padding\">\n <form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxForm]=\"form()\"\n [spxFormGroup]=\"formSection()\"\n [spxSuggestions]=\"suggestions()\">\n </spx-form-view>\n </form>\n</ion-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,iBAAiB,GAAG;AAC1B,MA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UAAU;wBACV,aAAa;AACd,qBAAA,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,4hBAAA,EAAA;;;AE1ClB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-welcome.mjs","sources":["../../../../projects/softpak/components/spx-welcome/spx-welcome.component.ts","../../../../projects/softpak/components/spx-welcome/spx-welcome.component.html","../../../../projects/softpak/components/spx-welcome/softpak-components-spx-welcome.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, signal } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { IonButtons, IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxInputTypeEnum, SpxSuggestionValuePair, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\nimport { spxChannelActions, spxChannelReducer } from '@softpak/components/spx-channel-selection';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxTextChannel, spxTextCompany, spxTextDoYouComeHereOften, spxTextFavorite, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\n\nimport { Capacitor } from '@capacitor/core';\nimport { faHeart } from '@fortawesome/free-solid-svg-icons';\nimport { SpxAppChannelTypeEnum, } from '@softpak/components/spx-app-configuration';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nexport const spxSectionWelcome = 'welcome';\nexport const spxCtrlChannel = 'channel';\nexport const spxCtrlChannelType = 'channelType';\nexport const spxCtrlFavorite = 'favorite';\n\n@Component({\n selector: 'spx-welcome',\n templateUrl: './spx-welcome.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxFormViewComponent,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonButtons,\n IonContent,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\n allChannels = toSignal(this.store.select(spxChannelReducer.default.selectChannels));\n private favouritesVersion = signal(0);\n allBrands = computed(() => {\n this.favouritesVersion();\n const favourites = this.getFavourites();\n const brands = this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({\n description: c.brand,\n value: c.brand,\n ...(favourites.includes(c.brand) ? { icon: faHeart, iconClass: 'text-red-800', bgClass: 'bg-red-100' } : {})\n }));\n return brands?.sort((a, b) => {\n const aFav = favourites.includes(a.value);\n const bFav = favourites.includes(b.value);\n if (aFav && !bFav) return -1;\n if (!aFav && bFav) return 1;\n return a.value.localeCompare(b.value);\n });\n });\n inputBrand = signal<string | null>(null);\n inputChannelType = signal<SpxAppChannelTypeEnum | null>(null);\n selectedBrand = computed(() => this.allChannels()?.find(c => c.brand === this.inputBrand()));\n channelTypeSuggestions = computed(() => this.selectedBrand()?.channelTypes?.filter(channelType => Capacitor.getPlatform() === 'web' ? channelType.webUrl !== undefined : channelType.webUrl === undefined)?.map(channelType => ({\n description: channelType.name,\n value: channelType.name\n })));\n\n protected readonly formGroup = signal<FormGroup | undefined>(undefined);\n protected readonly suggestions = signal<{\n [spxCtrlChannelType]?: SpxValuePair<string>[];\n [spxCtrlChannel]?: SpxSuggestionValuePair<string>[];\n }>({\n [spxCtrlChannelType]: [],\n [spxCtrlChannel]: [],\n });\n\n textChannel = spxTextChannel;\n textCompany = spxTextCompany;\n textSelect = spxTextSelect;\n textSelectYourCompany = spxTextSelectYourCompany;\n textDoYouComeHereOften = spxTextDoYouComeHereOften;\n textFavorite = spxTextFavorite;\n\n protected readonly formSection = computed(() => this.formGroup()?.get(spxSectionWelcome) as FormGroup);\n private readonly ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel) as FormControl);\n private readonly ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType) as FormControl);\n private readonly ctrlFavorite = computed(() => this.formSection()?.get(spxCtrlFavorite) as FormControl);\n private subscriptions: {\n channel?: Subscription;\n channelType?: Subscription;\n favorite?: Subscription;\n } = {};\n\n protected readonly form = signal<SpxFormI>({\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSelect,\n }\n ],\n sections: [\n {\n key: spxSectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel().value),\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlFavorite,\n type: () => SpxInputTypeEnum.checkbox,\n label: () => this.textDoYouComeHereOften,\n checkboxText: () => this.textFavorite,\n checkboxIcon: () => faHeart,\n checkboxIconClass: () => 'text-red-800',\n checkboxBgClass: () => 'bg-red-100',\n show: () => valuePairToValue(this.ctrlChannel().value),\n defaultValue: () => ({ value: false }),\n },\n ]\n }\n ]\n });\n\n constructor(\n private readonly store: Store,\n private readonly formBuilder: FormBuilder\n ) {\n this.formGroup.set(this.formBuilder.group({\n [spxSectionWelcome]: SpxFormViewComponent.createForm(this.form())\n }));\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n ngOnInit(): void {\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n\n this.subscriptions.channel = this.ctrlChannel().valueChanges.subscribe(valuePair => {\n const brand = valuePairToValue(valuePair) as string | null;\n this.inputBrand.set(brand);\n this.suggestions()[spxCtrlChannelType] = this.channelTypeSuggestions();\n this.ctrlChannelType().setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n\n const favourites = this.getFavourites();\n const isFavourite = brand ? favourites.includes(brand) : false;\n this.ctrlFavorite().setValue({ value: isFavourite }, { emitEvent: false });\n });\n\n this.subscriptions.favorite = this.ctrlFavorite().valueChanges.subscribe(valuePair => {\n const brand = this.inputBrand();\n if (!brand) return;\n const favourites = this.getFavourites();\n const isFavourite = valuePairToValue(valuePair) as boolean;\n const updated = isFavourite\n ? [...new Set([...favourites, brand])]\n : favourites.filter(f => f !== brand);\n SpxStorage.setSetting(SpxStorageKeyEnum.channelFavourites, JSON.stringify(updated));\n this.favouritesVersion.update(v => v + 1);\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n });\n\n this.subscriptions.channelType = this.ctrlChannelType().valueChanges.subscribe(valuePair => {\n this.inputChannelType.set(valuePairToValue(this.ctrlChannelType().value));\n });\n }\n\n private getFavourites(): string[] {\n const raw = SpxStorage.getSetting(SpxStorageKeyEnum.channelFavourites);\n if (!raw) return [];\n try { return JSON.parse(raw) as string[]; } catch { return []; }\n }\n\n protected onSubmit(): void {\n if (!this.selectedBrand() || !this.inputChannelType()) {\n this.store.dispatch(spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: 'Please select a company',\n }))\n } else {\n this.store.dispatch(spxChannelActions.choose({\n channel: this.selectedBrand()!,\n channelType: this.inputChannelType()!,\n }));\n }\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ textSelectYourCompany | translate | capitalize }}\n </ion-title>\n <ion-buttons slot=\"end\">\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content class=\"ion-padding\">\n <form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxForm]=\"form()\"\n [spxFormGroup]=\"formSection()\"\n [spxSuggestions]=\"suggestions()\">\n </spx-form-view>\n </form>\n</ion-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,cAAc,GAAG;AACvB,MAAM,kBAAkB,GAAG;AAC3B,MAAM,eAAe,GAAG;MAoBlB,mBAAmB,CAAA;IAgG9B,WAAA,CACmB,KAAY,EACZ,WAAwB,EAAA;QADxB,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,WAAW,GAAX,WAAW;AAjG9B,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAC3E,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,CAAC,6DAAC;AACrC,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAK;YACxB,IAAI,CAAC,iBAAiB,EAAE;AACxB,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE;AACvC,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK;gBACrJ,WAAW,EAAE,CAAC,CAAC,KAAK;gBACpB,KAAK,EAAE,CAAC,CAAC,KAAK;AACd,gBAAA,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAA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,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,4hBAAA,EAAA;;;AE1ClB;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
2
2
|
import { ValidatorFn, AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { IconDefinition } from '@fortawesome/angular-fontawesome';
|
|
3
4
|
import { SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';
|
|
4
5
|
import * as _angular_core from '@angular/core';
|
|
5
6
|
import { ElementRef } from '@angular/core';
|
|
@@ -33,6 +34,9 @@ interface SpxFormFieldI {
|
|
|
33
34
|
defaultValidators?: () => ValidatorFn[];
|
|
34
35
|
defaultValue?: () => SpxValuePair<string | number | boolean> | null;
|
|
35
36
|
checkboxText?: () => string;
|
|
37
|
+
checkboxIcon?: () => IconDefinition;
|
|
38
|
+
checkboxIconClass?: () => string;
|
|
39
|
+
checkboxBgClass?: () => string;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
interface SpxFormSectionI {
|
|
@@ -9,7 +9,10 @@ import { ModalController } from '@ionic/angular/standalone';
|
|
|
9
9
|
interface SpxValuePair<A> {
|
|
10
10
|
description?: string | null;
|
|
11
11
|
value: A;
|
|
12
|
+
}
|
|
13
|
+
interface SpxSuggestionValuePair<A> extends SpxValuePair<A> {
|
|
12
14
|
icon?: IconDefinition;
|
|
15
|
+
iconClass?: string;
|
|
13
16
|
bgClass?: string;
|
|
14
17
|
}
|
|
15
18
|
|
|
@@ -316,13 +319,13 @@ declare class SpxInputNumberComponent {
|
|
|
316
319
|
}
|
|
317
320
|
|
|
318
321
|
declare class SpxInputRadioComponent {
|
|
319
|
-
readonly cachedSuggestions: _angular_core.WritableSignal<
|
|
322
|
+
readonly cachedSuggestions: _angular_core.WritableSignal<SpxSuggestionValuePair<any>[]>;
|
|
320
323
|
readonly focusPosition: _angular_core.WritableSignal<number>;
|
|
321
324
|
readonly spxName: _angular_core.InputSignal<string | undefined>;
|
|
322
325
|
readonly spxValidators: _angular_core.InputSignal<any[] | undefined>;
|
|
323
326
|
readonly spxShowLabel: _angular_core.InputSignal<boolean>;
|
|
324
327
|
readonly spxReadonly: _angular_core.InputSignal<true | undefined>;
|
|
325
|
-
readonly spxSuggestions: _angular_core.InputSignal<
|
|
328
|
+
readonly spxSuggestions: _angular_core.InputSignal<SpxSuggestionValuePair<any>[]>;
|
|
326
329
|
readonly value: _angular_core.ModelSignal<SpxValuePair<any> | undefined>;
|
|
327
330
|
readonly selectedInputService: SelectedInputService;
|
|
328
331
|
readonly spxElementId: _angular_core.InputSignal<number | undefined>;
|
|
@@ -404,6 +407,9 @@ declare class SpxInputComponent {
|
|
|
404
407
|
readonly spxCapitalize: _angular_core.InputSignal<boolean>;
|
|
405
408
|
readonly spxCycleConfig: _angular_core.InputSignal<SpxCycleConfig | undefined>;
|
|
406
409
|
readonly spxCheckboxText: _angular_core.InputSignal<string | undefined>;
|
|
410
|
+
readonly spxCheckboxIcon: _angular_core.InputSignal<IconDefinition | undefined>;
|
|
411
|
+
readonly spxCheckboxIconClass: _angular_core.InputSignal<string | undefined>;
|
|
412
|
+
readonly spxCheckboxBgClass: _angular_core.InputSignal<string | undefined>;
|
|
407
413
|
value: _angular_core.WritableSignal<SpxValuePair<any>>;
|
|
408
414
|
spxClear: _angular_core.OutputEmitterRef<void>;
|
|
409
415
|
spxEdit: _angular_core.OutputEmitterRef<void>;
|
|
@@ -461,8 +467,8 @@ declare class SpxInputComponent {
|
|
|
461
467
|
registerOnChange(fn: (value: any) => void): void;
|
|
462
468
|
registerOnTouched(fn: () => void): void;
|
|
463
469
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpxInputComponent, never>;
|
|
464
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxInputComponent, "spx-input", never, { "spxSpeedDial": { "alias": "spxSpeedDial"; "required": false; "isSignal": true; }; "spxLabel": { "alias": "spxLabel"; "required": false; "isSignal": true; }; "spxMax": { "alias": "spxMax"; "required": false; "isSignal": true; }; "spxMin": { "alias": "spxMin"; "required": false; "isSignal": true; }; "spxName": { "alias": "spxName"; "required": false; "isSignal": true; }; "spxReadonly": { "alias": "spxReadonly"; "required": false; "isSignal": true; }; "spxAutocomplete": { "alias": "spxAutocomplete"; "required": false; "isSignal": true; }; "spxAutofocus": { "alias": "spxAutofocus"; "required": false; "isSignal": true; }; "spxInputMode": { "alias": "spxInputMode"; "required": false; "isSignal": true; }; "spxPattern": { "alias": "spxPattern"; "required": false; "isSignal": true; }; "spxRequired": { "alias": "spxRequired"; "required": false; "isSignal": true; }; "spxSelectMonth": { "alias": "spxSelectMonth"; "required": false; "isSignal": true; }; "spxSelectDay": { "alias": "spxSelectDay"; "required": false; "isSignal": true; }; "spxShowEdit": { "alias": "spxShowEdit"; "required": false; "isSignal": true; }; "spxShowHelp": { "alias": "spxShowHelp"; "required": false; "isSignal": true; }; "spxLeftIcon": { "alias": "spxLeftIcon"; "required": false; "isSignal": true; }; "spxShowLabel": { "alias": "spxShowLabel"; "required": false; "isSignal": true; }; "spxCompact": { "alias": "spxCompact"; "required": false; "isSignal": true; }; "spxShowClear": { "alias": "spxShowClear"; "required": false; "isSignal": true; }; "spxShowSearch": { "alias": "spxShowSearch"; "required": false; "isSignal": true; }; "spxAlert": { "alias": "spxAlert"; "required": false; "isSignal": true; }; "spxShowValidationMessages": { "alias": "spxShowValidationMessages"; "required": false; "isSignal": true; }; "spxStep": { "alias": "spxStep"; "required": false; "isSignal": true; }; "spxSuggestions": { "alias": "spxSuggestions"; "required": false; "isSignal": true; }; "spxType": { "alias": "spxType"; "required": false; "isSignal": true; }; "spxValidators": { "alias": "spxValidators"; "required": false; "isSignal": true; }; "spxCapitalize": { "alias": "spxCapitalize"; "required": false; "isSignal": true; }; "spxCycleConfig": { "alias": "spxCycleConfig"; "required": false; "isSignal": true; }; "spxCheckboxText": { "alias": "spxCheckboxText"; "required": false; "isSignal": true; }; }, { "spxClear": "spxClear"; "spxEdit": "spxEdit"; "spxHelp": "spxHelp"; "spxSearch": "spxSearch"; "spxBlur": "spxBlur"; }, never, ["[spxInputLeftIcon]", "*"], true, never>;
|
|
470
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxInputComponent, "spx-input", never, { "spxSpeedDial": { "alias": "spxSpeedDial"; "required": false; "isSignal": true; }; "spxLabel": { "alias": "spxLabel"; "required": false; "isSignal": true; }; "spxMax": { "alias": "spxMax"; "required": false; "isSignal": true; }; "spxMin": { "alias": "spxMin"; "required": false; "isSignal": true; }; "spxName": { "alias": "spxName"; "required": false; "isSignal": true; }; "spxReadonly": { "alias": "spxReadonly"; "required": false; "isSignal": true; }; "spxAutocomplete": { "alias": "spxAutocomplete"; "required": false; "isSignal": true; }; "spxAutofocus": { "alias": "spxAutofocus"; "required": false; "isSignal": true; }; "spxInputMode": { "alias": "spxInputMode"; "required": false; "isSignal": true; }; "spxPattern": { "alias": "spxPattern"; "required": false; "isSignal": true; }; "spxRequired": { "alias": "spxRequired"; "required": false; "isSignal": true; }; "spxSelectMonth": { "alias": "spxSelectMonth"; "required": false; "isSignal": true; }; "spxSelectDay": { "alias": "spxSelectDay"; "required": false; "isSignal": true; }; "spxShowEdit": { "alias": "spxShowEdit"; "required": false; "isSignal": true; }; "spxShowHelp": { "alias": "spxShowHelp"; "required": false; "isSignal": true; }; "spxLeftIcon": { "alias": "spxLeftIcon"; "required": false; "isSignal": true; }; "spxShowLabel": { "alias": "spxShowLabel"; "required": false; "isSignal": true; }; "spxCompact": { "alias": "spxCompact"; "required": false; "isSignal": true; }; "spxShowClear": { "alias": "spxShowClear"; "required": false; "isSignal": true; }; "spxShowSearch": { "alias": "spxShowSearch"; "required": false; "isSignal": true; }; "spxAlert": { "alias": "spxAlert"; "required": false; "isSignal": true; }; "spxShowValidationMessages": { "alias": "spxShowValidationMessages"; "required": false; "isSignal": true; }; "spxStep": { "alias": "spxStep"; "required": false; "isSignal": true; }; "spxSuggestions": { "alias": "spxSuggestions"; "required": false; "isSignal": true; }; "spxType": { "alias": "spxType"; "required": false; "isSignal": true; }; "spxValidators": { "alias": "spxValidators"; "required": false; "isSignal": true; }; "spxCapitalize": { "alias": "spxCapitalize"; "required": false; "isSignal": true; }; "spxCycleConfig": { "alias": "spxCycleConfig"; "required": false; "isSignal": true; }; "spxCheckboxText": { "alias": "spxCheckboxText"; "required": false; "isSignal": true; }; "spxCheckboxIcon": { "alias": "spxCheckboxIcon"; "required": false; "isSignal": true; }; "spxCheckboxIconClass": { "alias": "spxCheckboxIconClass"; "required": false; "isSignal": true; }; "spxCheckboxBgClass": { "alias": "spxCheckboxBgClass"; "required": false; "isSignal": true; }; }, { "spxClear": "spxClear"; "spxEdit": "spxEdit"; "spxHelp": "spxHelp"; "spxSearch": "spxSearch"; "spxBlur": "spxBlur"; }, never, ["[spxInputLeftIcon]", "*"], true, never>;
|
|
465
471
|
}
|
|
466
472
|
|
|
467
473
|
export { SpxInputBoxComponent, SpxInputComponent, SpxInputLeftIconDirective, SpxInputTextComponent, SpxInputTypeEnum };
|
|
468
|
-
export type { SpxCycleConfig, SpxInputAlertI, SpxInputLeftIcon, SpxSpeedDial, SpxValuePair };
|
|
474
|
+
export type { SpxCycleConfig, SpxInputAlertI, SpxInputLeftIcon, SpxSpeedDial, SpxSuggestionValuePair, SpxValuePair };
|
|
@@ -8,13 +8,14 @@ declare class SpxSuggestionComponent {
|
|
|
8
8
|
spxSelected: _angular_core.InputSignal<boolean | undefined>;
|
|
9
9
|
spxTabbable: _angular_core.InputSignal<boolean | undefined>;
|
|
10
10
|
spxIcon: _angular_core.InputSignal<IconDefinition | undefined>;
|
|
11
|
+
spxIconClass: _angular_core.InputSignal<string | undefined>;
|
|
11
12
|
spxBgClass: _angular_core.InputSignal<string | undefined>;
|
|
12
13
|
suggestionRef: _angular_core.Signal<ElementRef<HTMLButtonElement> | undefined>;
|
|
13
14
|
private spxHaptics;
|
|
14
15
|
handlePress: () => Promise<void>;
|
|
15
16
|
onDocumentPointerUp: (event: PointerEvent) => Promise<void>;
|
|
16
17
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpxSuggestionComponent, never>;
|
|
17
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxSuggestionComponent, "spx-suggestion", never, { "spxDisabled": { "alias": "spxDisabled"; "required": false; "isSignal": true; }; "spxFocused": { "alias": "spxFocused"; "required": false; "isSignal": true; }; "spxSelected": { "alias": "spxSelected"; "required": false; "isSignal": true; }; "spxTabbable": { "alias": "spxTabbable"; "required": false; "isSignal": true; }; "spxIcon": { "alias": "spxIcon"; "required": false; "isSignal": true; }; "spxBgClass": { "alias": "spxBgClass"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
18
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxSuggestionComponent, "spx-suggestion", never, { "spxDisabled": { "alias": "spxDisabled"; "required": false; "isSignal": true; }; "spxFocused": { "alias": "spxFocused"; "required": false; "isSignal": true; }; "spxSelected": { "alias": "spxSelected"; "required": false; "isSignal": true; }; "spxTabbable": { "alias": "spxTabbable"; "required": false; "isSignal": true; }; "spxIcon": { "alias": "spxIcon"; "required": false; "isSignal": true; }; "spxIconClass": { "alias": "spxIconClass"; "required": false; "isSignal": true; }; "spxBgClass": { "alias": "spxBgClass"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export { SpxSuggestionComponent };
|
|
@@ -5,7 +5,7 @@ import * as _softpak_components_spx_app_configuration from '@softpak/components/
|
|
|
5
5
|
import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
|
|
6
6
|
import { FormGroup, FormBuilder } from '@angular/forms';
|
|
7
7
|
import { SpxFormI } from '@softpak/components/spx-form-view';
|
|
8
|
-
import { SpxValuePair } from '@softpak/components/spx-inputs';
|
|
8
|
+
import { SpxValuePair, SpxSuggestionValuePair } from '@softpak/components/spx-inputs';
|
|
9
9
|
import { Store } from '@ngrx/store';
|
|
10
10
|
|
|
11
11
|
declare const spxSectionWelcome = "welcome";
|
|
@@ -16,8 +16,10 @@ declare class SpxWelcomeComponent implements OnInit, OnDestroy {
|
|
|
16
16
|
private readonly store;
|
|
17
17
|
private readonly formBuilder;
|
|
18
18
|
allChannels: _angular_core.Signal<_softpak_components_spx_app_configuration.SpxAppChannelI[] | undefined>;
|
|
19
|
+
private favouritesVersion;
|
|
19
20
|
allBrands: _angular_core.Signal<{
|
|
20
21
|
icon?: _fortawesome_fontawesome_common_types.IconDefinition | undefined;
|
|
22
|
+
iconClass?: string | undefined;
|
|
21
23
|
bgClass?: string | undefined;
|
|
22
24
|
description: string;
|
|
23
25
|
value: string;
|
|
@@ -32,7 +34,7 @@ declare class SpxWelcomeComponent implements OnInit, OnDestroy {
|
|
|
32
34
|
protected readonly formGroup: _angular_core.WritableSignal<FormGroup<any> | undefined>;
|
|
33
35
|
protected readonly suggestions: _angular_core.WritableSignal<{
|
|
34
36
|
channelType?: SpxValuePair<string>[];
|
|
35
|
-
channel?:
|
|
37
|
+
channel?: SpxSuggestionValuePair<string>[];
|
|
36
38
|
}>;
|
|
37
39
|
textChannel: string;
|
|
38
40
|
textCompany: string;
|