@softpak/components 20.2.0 → 20.2.2-beta.1
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/README.md +24 -24
- package/fesm2022/softpak-components-spx-404-page.mjs +4 -4
- package/fesm2022/softpak-components-spx-404-page.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-alert.mjs +4 -4
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-configuration.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-expiry.mjs +4 -4
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +4 -4
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-capitalize.mjs +3 -3
- package/fesm2022/softpak-components-spx-capitalize.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-card.mjs +16 -16
- package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +4 -4
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-channel-selection.mjs +30 -31
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +4 -4
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-confirm.mjs +11 -11
- package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +4 -4
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +8 -8
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +44 -44
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +12 -12
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +4 -4
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pagination.mjs +4 -4
- package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +4 -4
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pipes.mjs +3 -3
- package/fesm2022/softpak-components-spx-pipes.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-progress-bar.mjs +4 -4
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +4 -4
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +4 -4
- package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +4 -4
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-tabs.mjs +4 -4
- package/fesm2022/softpak-components-spx-tabs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +4 -4
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toggle.mjs +4 -4
- package/fesm2022/softpak-components-spx-toggle.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +14 -14
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation-messages.mjs +4 -4
- package/fesm2022/softpak-components-spx-validation-messages.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation.mjs +4 -4
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-welcome.mjs +12 -15
- package/fesm2022/softpak-components-spx-welcome.mjs.map +1 -1
- package/package.json +34 -34
- package/spx-welcome/index.d.ts +6 -1
|
@@ -20,12 +20,12 @@ class SpxCardComponent {
|
|
|
20
20
|
onClick() {
|
|
21
21
|
this.clicked.emit();
|
|
22
22
|
}
|
|
23
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
24
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
23
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.1", type: SpxCardComponent, isStandalone: true, selector: "spx-card", inputs: { clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, hasContent: { classPropertyName: "hasContent", publicName: "hasContent", isSignal: true, isRequired: false, transformFunction: null }, onDetailPage: { classPropertyName: "onDetailPage", publicName: "onDetailPage", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, tableView: { classPropertyName: "tableView", publicName: "tableView", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button type=\"button\"\nclass=\"block w-full text-left rounded font-body items-stretch\"\n[class.flex]=\"tableView()\"\n[class.cursor-pointer]=\"clickable()\"\n[class.cursor-not-allowed]=\"!clickable()\"\n[class.focus:ring-2]=\"clickable()\"\n[class.focus:ring-offset-2]=\"clickable()\"\n[class.focus:ring-blue-500]=\"clickable()\"\n(click)=\"onClick()\"\n[tabIndex]=\"clickable() ? 0 : -1\">\n<div class=\"text-gray-900 opacity-90\" [class.w-96]=\"tableView()\">\n <ng-content select=\"[card-header]\"></ng-content>\n</div>\n<ng-content select=\"[card-content-top]\"></ng-content>\n@if (hasContent()) {\n <div class=\"bg-white dark:bg-gray-600 p-3\">\n <ng-content select=\"[card-content]\"></ng-content>\n </div>\n}\n<ng-content select=\"[card-content-bottom]\"></ng-content>\n<div class=\"bg-gray-50 dark:bg-gray-700 p-3 grow\" [class.rounded-b-lg]=\"!onDetailPage() && !tableView()\" [class.rounded-r-lg]=\"!onDetailPage() && tableView()\">\n <ng-content select=\"[card-lines]\"></ng-content>\n</div>\n</button>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxCardComponent, decorators: [{
|
|
27
27
|
type: Component,
|
|
28
|
-
args: [{ selector: 'spx-card', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button type=\"button\"\
|
|
28
|
+
args: [{ selector: 'spx-card', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button type=\"button\"\nclass=\"block w-full text-left rounded font-body items-stretch\"\n[class.flex]=\"tableView()\"\n[class.cursor-pointer]=\"clickable()\"\n[class.cursor-not-allowed]=\"!clickable()\"\n[class.focus:ring-2]=\"clickable()\"\n[class.focus:ring-offset-2]=\"clickable()\"\n[class.focus:ring-blue-500]=\"clickable()\"\n(click)=\"onClick()\"\n[tabIndex]=\"clickable() ? 0 : -1\">\n<div class=\"text-gray-900 opacity-90\" [class.w-96]=\"tableView()\">\n <ng-content select=\"[card-header]\"></ng-content>\n</div>\n<ng-content select=\"[card-content-top]\"></ng-content>\n@if (hasContent()) {\n <div class=\"bg-white dark:bg-gray-600 p-3\">\n <ng-content select=\"[card-content]\"></ng-content>\n </div>\n}\n<ng-content select=\"[card-content-bottom]\"></ng-content>\n<div class=\"bg-gray-50 dark:bg-gray-700 p-3 grow\" [class.rounded-b-lg]=\"!onDetailPage() && !tableView()\" [class.rounded-r-lg]=\"!onDetailPage() && tableView()\">\n <ng-content select=\"[card-lines]\"></ng-content>\n</div>\n</button>" }]
|
|
29
29
|
}], ctorParameters: () => [] });
|
|
30
30
|
|
|
31
31
|
class SpxCardItemComponent {
|
|
@@ -38,29 +38,29 @@ class SpxCardItemComponent {
|
|
|
38
38
|
this.spxIconSeverity = input();
|
|
39
39
|
this.SpxSeverityEnum = SpxSeverityEnum;
|
|
40
40
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
42
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxCardItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.1", type: SpxCardItemComponent, isStandalone: true, selector: "spx-card-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null }, spxLabel: { classPropertyName: "spxLabel", publicName: "spxLabel", isSignal: true, isRequired: true, transformFunction: null }, spxValue: { classPropertyName: "spxValue", publicName: "spxValue", isSignal: true, isRequired: false, transformFunction: null }, spxSeverity: { classPropertyName: "spxSeverity", publicName: "spxSeverity", isSignal: true, isRequired: false, transformFunction: null }, spxIconSeverity: { classPropertyName: "spxIconSeverity", publicName: "spxIconSeverity", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.h-full": "true" } }, ngImport: i0, template: "<div class='py-2 px-3 rounded h-full'\n [class.bg-slate-100]=\"!spxSeverity()\"\n [class.dark:bg-slate-600]=\"!spxSeverity()\"\n [class.text-black]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\"\n [class.text-white]=\"this.spxSeverity() | isSeverity: [SpxSeverityEnum.error, SpxSeverityEnum.success, SpxSeverityEnum.unknown, SpxSeverityEnum.info]\"\n [class.bg-red-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.error\"\n [class.bg-green-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.success\"\n [class.bg-blue-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.info\"\n [class.bg-gray-400]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.unknown\"\n [class.bg-amber-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\">\n <div class=\"font-small leading-normal\">{{ spxLabel() }}</div>\n <div class=\"flex gap-4 text-lg leading-normal py-1\">\n @if (icon()) {\n <div class=\"font-bold text-center leading-normal max-w-12 min-w-12\" [class.grow]=\"iconOnly()\">\n <div\n class=\"px-3 py-1 text-white rounded\"\n [class.bg-black]=\"!spxIconSeverity()\"\n [class.bg-red-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.error\"\n [class.bg-green-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.success\"\n [class.bg-blue-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.info\"\n [class.bg-gray-400]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.unknown\"\n [class.bg-amber-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\">\n <fa-icon [icon]=\"icon()!\"></fa-icon>\n </div>\n </div>\n }\n <div class=\"grow font-bold\">\n @if (!iconOnly()) {\n <ng-content></ng-content><div [innerHTML]=\"spxValue()\"></div>\n }\n </div>\n </div>\n </div>", 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: "pipe", type: IsSeverityPipe, name: "isSeverity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
43
43
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxCardItemComponent, decorators: [{
|
|
45
45
|
type: Component,
|
|
46
46
|
args: [{ selector: 'spx-card-item', imports: [
|
|
47
47
|
FaIconComponent,
|
|
48
48
|
IsSeverityPipe
|
|
49
49
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
50
50
|
'[class.h-full]': 'true',
|
|
51
|
-
}, template: "<div class='py-2 px-3 rounded h-full'\
|
|
51
|
+
}, template: "<div class='py-2 px-3 rounded h-full'\n [class.bg-slate-100]=\"!spxSeverity()\"\n [class.dark:bg-slate-600]=\"!spxSeverity()\"\n [class.text-black]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\"\n [class.text-white]=\"this.spxSeverity() | isSeverity: [SpxSeverityEnum.error, SpxSeverityEnum.success, SpxSeverityEnum.unknown, SpxSeverityEnum.info]\"\n [class.bg-red-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.error\"\n [class.bg-green-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.success\"\n [class.bg-blue-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.info\"\n [class.bg-gray-400]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.unknown\"\n [class.bg-amber-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\">\n <div class=\"font-small leading-normal\">{{ spxLabel() }}</div>\n <div class=\"flex gap-4 text-lg leading-normal py-1\">\n @if (icon()) {\n <div class=\"font-bold text-center leading-normal max-w-12 min-w-12\" [class.grow]=\"iconOnly()\">\n <div\n class=\"px-3 py-1 text-white rounded\"\n [class.bg-black]=\"!spxIconSeverity()\"\n [class.bg-red-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.error\"\n [class.bg-green-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.success\"\n [class.bg-blue-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.info\"\n [class.bg-gray-400]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.unknown\"\n [class.bg-amber-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\">\n <fa-icon [icon]=\"icon()!\"></fa-icon>\n </div>\n </div>\n }\n <div class=\"grow font-bold\">\n @if (!iconOnly()) {\n <ng-content></ng-content><div [innerHTML]=\"spxValue()\"></div>\n }\n </div>\n </div>\n </div>" }]
|
|
52
52
|
}] });
|
|
53
53
|
|
|
54
54
|
class SpxCardGridComponent {
|
|
55
55
|
constructor() {
|
|
56
56
|
this.minWidth2Columns = input(460);
|
|
57
57
|
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
59
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.
|
|
58
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxCardGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
59
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.1", type: SpxCardGridComponent, isStandalone: true, selector: "spx-card-grid", inputs: { minWidth2Columns: { classPropertyName: "minWidth2Columns", publicName: "minWidth2Columns", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class='grid gap-3 items-stretch'\n [class.min-[300px]:grid-cols-2]=\"minWidth2Columns() == 300\"\n [class.min-[320px]:grid-cols-2]=\"minWidth2Columns() == 320\"\n [class.min-[340px]:grid-cols-2]=\"minWidth2Columns() == 340\"\n [class.min-[360px]:grid-cols-2]=\"minWidth2Columns() == 360\"\n [class.min-[380px]:grid-cols-2]=\"minWidth2Columns() == 380\"\n [class.min-[400px]:grid-cols-2]=\"minWidth2Columns() == 400\"\n [class.min-[420px]:grid-cols-2]=\"minWidth2Columns() == 420\"\n [class.min-[440px]:grid-cols-2]=\"minWidth2Columns() == 440\"\n [class.min-[460px]:grid-cols-2]=\"minWidth2Columns() == 460\">\n <ng-content></ng-content>\n </div>", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
60
60
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxCardGridComponent, decorators: [{
|
|
62
62
|
type: Component,
|
|
63
|
-
args: [{ selector: 'spx-card-grid', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class='grid gap-3 items-stretch'\
|
|
63
|
+
args: [{ selector: 'spx-card-grid', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class='grid gap-3 items-stretch'\n [class.min-[300px]:grid-cols-2]=\"minWidth2Columns() == 300\"\n [class.min-[320px]:grid-cols-2]=\"minWidth2Columns() == 320\"\n [class.min-[340px]:grid-cols-2]=\"minWidth2Columns() == 340\"\n [class.min-[360px]:grid-cols-2]=\"minWidth2Columns() == 360\"\n [class.min-[380px]:grid-cols-2]=\"minWidth2Columns() == 380\"\n [class.min-[400px]:grid-cols-2]=\"minWidth2Columns() == 400\"\n [class.min-[420px]:grid-cols-2]=\"minWidth2Columns() == 420\"\n [class.min-[440px]:grid-cols-2]=\"minWidth2Columns() == 440\"\n [class.min-[460px]:grid-cols-2]=\"minWidth2Columns() == 460\">\n <ng-content></ng-content>\n </div>" }]
|
|
64
64
|
}] });
|
|
65
65
|
|
|
66
66
|
class SpxCardLineComponent {
|
|
@@ -78,12 +78,12 @@ class SpxCardLineComponent {
|
|
|
78
78
|
displayValue(val) {
|
|
79
79
|
return val || val === 0 ? val : '—';
|
|
80
80
|
}
|
|
81
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
82
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
81
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxCardLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
82
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.1", type: SpxCardLineComponent, isStandalone: true, selector: "spx-card-line", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, showPositiveOrNegative: { classPropertyName: "showPositiveOrNegative", publicName: "showPositiveOrNegative", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, secondValue: { classPropertyName: "secondValue", publicName: "secondValue", isSignal: true, isRequired: false, transformFunction: null }, showProgress: { classPropertyName: "showProgress", publicName: "showProgress", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, newOrderScreen: { classPropertyName: "newOrderScreen", publicName: "newOrderScreen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<div class=\"items-center\" [class.flex]=\"!newOrderScreen()\">\n <div class=\"block w-24 text-gray-600 dark:text-gray-200 text-xs mb-1\" [class.pt-1]=\"!newOrderScreen()\" [innerHTML]=\"text()\"></div>\n <div class=\"flex\">\n @if (icon()) {\n <fa-icon [icon]=\"icon()!\" class=\"text-lg mr-3 w-6 text-center\"></fa-icon>\n }\n @if (showPositiveOrNegative() && numericValue() < 0) {\n <div class=\"rounded-full w-4 h-4 mr-2 bg-sky-600\"> </div>\n }\n @if (!showProgress()) {\n <span class=\"block font-medium grow whitespace-pre-line leading-5\">\n <span [innerHTML]=\"displayValue(value())\"></span>\n <ng-content></ng-content>\n @if (unit()) {\n <span> {{ unit() }}</span>\n }\n @if (!unit() && secondValue() !== null && secondValue() !== undefined) {\n / {{ displayValue(secondValue()) }}\n }\n </span>\n }\n </div>\n @if (showProgress()) {\n <div class=\"block font-medium grow whitespace-pre-line text-gray-600 dark:text-gray-200\">\n <div class=\"flex\">\n <div class=\"flex grow gap-2\">\n <div class=\"bg-gray-200 my-0.5 h-5 w-full rounded\">\n <div class=\"bg-teal-600 h-5 rounded\" [style.width]=\"((+value()) / (secondValue() ? +secondValue()! : 0)) * 100 + '%'\"></div>\n </div>\n </div>\n <div class=\"flex text-left pl-3 gap-2\">\n <div class=\"block w-16 text-right\">{{ value() }} / {{ secondValue() }}</div>\n </div>\n </div>\n </div>\n }\n</div>", 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
83
83
|
}
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxCardLineComponent, decorators: [{
|
|
85
85
|
type: Component,
|
|
86
|
-
args: [{ selector: 'spx-card-line', imports: [FaIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"items-center\" [class.flex]=\"!newOrderScreen()\">\
|
|
86
|
+
args: [{ selector: 'spx-card-line', imports: [FaIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"items-center\" [class.flex]=\"!newOrderScreen()\">\n <div class=\"block w-24 text-gray-600 dark:text-gray-200 text-xs mb-1\" [class.pt-1]=\"!newOrderScreen()\" [innerHTML]=\"text()\"></div>\n <div class=\"flex\">\n @if (icon()) {\n <fa-icon [icon]=\"icon()!\" class=\"text-lg mr-3 w-6 text-center\"></fa-icon>\n }\n @if (showPositiveOrNegative() && numericValue() < 0) {\n <div class=\"rounded-full w-4 h-4 mr-2 bg-sky-600\"> </div>\n }\n @if (!showProgress()) {\n <span class=\"block font-medium grow whitespace-pre-line leading-5\">\n <span [innerHTML]=\"displayValue(value())\"></span>\n <ng-content></ng-content>\n @if (unit()) {\n <span> {{ unit() }}</span>\n }\n @if (!unit() && secondValue() !== null && secondValue() !== undefined) {\n / {{ displayValue(secondValue()) }}\n }\n </span>\n }\n </div>\n @if (showProgress()) {\n <div class=\"block font-medium grow whitespace-pre-line text-gray-600 dark:text-gray-200\">\n <div class=\"flex\">\n <div class=\"flex grow gap-2\">\n <div class=\"bg-gray-200 my-0.5 h-5 w-full rounded\">\n <div class=\"bg-teal-600 h-5 rounded\" [style.width]=\"((+value()) / (secondValue() ? +secondValue()! : 0)) * 100 + '%'\"></div>\n </div>\n </div>\n <div class=\"flex text-left pl-3 gap-2\">\n <div class=\"block w-16 text-right\">{{ value() }} / {{ secondValue() }}</div>\n </div>\n </div>\n </div>\n }\n</div>" }]
|
|
87
87
|
}] });
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-card.mjs","sources":["../../../../projects/softpak/components/spx-card/spx-card.component.ts","../../../../projects/softpak/components/spx-card/spx-card.component.html","../../../../projects/softpak/components/spx-card/spx-card-item/spx-card-item.component.ts","../../../../projects/softpak/components/spx-card/spx-card-item/spx-card-item.component.html","../../../../projects/softpak/components/spx-card/spx-card-grid/spx-card-grid.component.ts","../../../../projects/softpak/components/spx-card/spx-card-grid/spx-card-grid.component.html","../../../../projects/softpak/components/spx-card/spx-card-line/spx-card-line.component.ts","../../../../projects/softpak/components/spx-card/spx-card-line/spx-card-line.component.html","../../../../projects/softpak/components/spx-card/softpak-components-spx-card.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'spx-card',\r\n templateUrl: './spx-card.component.html',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SpxCardComponent {\r\n readonly clickable = input(true);\r\n readonly hasContent = input(true);\r\n readonly onDetailPage = input(false);\r\n readonly text = input<string>();\r\n readonly unit = input<string>();\r\n readonly tableView = input(false);\r\n clicked = output();\r\n\r\n constructor() { }\r\n\r\n displayValue(val: string | number): string | number {\r\n return val || (val === 0) ? val : '—';\r\n }\r\n\r\n onClick(): void {\r\n this.clicked.emit();\r\n }\r\n}\r\n","<button type=\"button\"\r\nclass=\"block w-full text-left rounded font-body items-stretch\"\r\n[class.flex]=\"tableView()\"\r\n[class.cursor-pointer]=\"clickable()\"\r\n[class.cursor-not-allowed]=\"!clickable()\"\r\n[class.focus:ring-2]=\"clickable()\"\r\n[class.focus:ring-offset-2]=\"clickable()\"\r\n[class.focus:ring-blue-500]=\"clickable()\"\r\n(click)=\"onClick()\"\r\n[tabIndex]=\"clickable() ? 0 : -1\">\r\n<div class=\"text-gray-900 opacity-90\" [class.w-96]=\"tableView()\">\r\n <ng-content select=\"[card-header]\"></ng-content>\r\n</div>\r\n<ng-content select=\"[card-content-top]\"></ng-content>\r\n@if (hasContent()) {\r\n <div class=\"bg-white dark:bg-gray-600 p-3\">\r\n <ng-content select=\"[card-content]\"></ng-content>\r\n </div>\r\n}\r\n<ng-content select=\"[card-content-bottom]\"></ng-content>\r\n<div class=\"bg-gray-50 dark:bg-gray-700 p-3 grow\" [class.rounded-b-lg]=\"!onDetailPage() && !tableView()\" [class.rounded-r-lg]=\"!onDetailPage() && tableView()\">\r\n <ng-content select=\"[card-lines]\"></ng-content>\r\n</div>\r\n</button>","\r\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { FaIconComponent, IconDefinition } from '@fortawesome/angular-fontawesome';\r\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\r\nimport { IsSeverityPipe } from '@softpak/components/spx-pipes';\r\n\r\n@Component({\r\n selector: 'spx-card-item',\r\n imports: [\r\n FaIconComponent,\r\n IsSeverityPipe\r\n ],\r\n templateUrl: './spx-card-item.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[class.h-full]': 'true',\r\n },\r\n})\r\nexport class SpxCardItemComponent {\r\n readonly icon = input<IconDefinition>();\r\n readonly iconOnly = input(false);\r\n readonly spxLabel = input.required<string>();\r\n readonly spxValue = input<string>();\r\n readonly spxSeverity = input<SpxSeverityEnum>();\r\n readonly spxIconSeverity = input<SpxSeverityEnum>();\r\n SpxSeverityEnum = SpxSeverityEnum;\r\n}\r\n","<div class='py-2 px-3 rounded h-full'\r\n [class.bg-slate-100]=\"!spxSeverity()\"\r\n [class.dark:bg-slate-600]=\"!spxSeverity()\"\r\n [class.text-black]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\"\r\n [class.text-white]=\"this.spxSeverity() | isSeverity: [SpxSeverityEnum.error, SpxSeverityEnum.success, SpxSeverityEnum.unknown, SpxSeverityEnum.info]\"\r\n [class.bg-red-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.error\"\r\n [class.bg-green-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.success\"\r\n [class.bg-blue-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.info\"\r\n [class.bg-gray-400]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.unknown\"\r\n [class.bg-amber-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\">\r\n <div class=\"font-small leading-normal\">{{ spxLabel() }}</div>\r\n <div class=\"flex gap-4 text-lg leading-normal py-1\">\r\n @if (icon()) {\r\n <div class=\"font-bold text-center leading-normal max-w-12 min-w-12\" [class.grow]=\"iconOnly()\">\r\n <div\r\n class=\"px-3 py-1 text-white rounded\"\r\n [class.bg-black]=\"!spxIconSeverity()\"\r\n [class.bg-red-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.error\"\r\n [class.bg-green-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.success\"\r\n [class.bg-blue-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.info\"\r\n [class.bg-gray-400]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.unknown\"\r\n [class.bg-amber-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\">\r\n <fa-icon [icon]=\"icon()!\"></fa-icon>\r\n </div>\r\n </div>\r\n }\r\n <div class=\"grow font-bold\">\r\n @if (!iconOnly()) {\r\n <ng-content></ng-content><div [innerHTML]=\"spxValue()\"></div>\r\n }\r\n </div>\r\n </div>\r\n </div>","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'spx-card-grid',\r\n standalone: true,\r\n templateUrl: './spx-card-grid.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SpxCardGridComponent {\r\n readonly minWidth2Columns = input<(300 | 320 | 340 | 360 | 380 | 400 | 420 | 440 | 460) | undefined>(460);\r\n}\r\n","<div class='grid gap-3 items-stretch'\r\n [class.min-[300px]:grid-cols-2]=\"minWidth2Columns() == 300\"\r\n [class.min-[320px]:grid-cols-2]=\"minWidth2Columns() == 320\"\r\n [class.min-[340px]:grid-cols-2]=\"minWidth2Columns() == 340\"\r\n [class.min-[360px]:grid-cols-2]=\"minWidth2Columns() == 360\"\r\n [class.min-[380px]:grid-cols-2]=\"minWidth2Columns() == 380\"\r\n [class.min-[400px]:grid-cols-2]=\"minWidth2Columns() == 400\"\r\n [class.min-[420px]:grid-cols-2]=\"minWidth2Columns() == 420\"\r\n [class.min-[440px]:grid-cols-2]=\"minWidth2Columns() == 440\"\r\n [class.min-[460px]:grid-cols-2]=\"minWidth2Columns() == 460\">\r\n <ng-content></ng-content>\r\n </div>","import { ChangeDetectionStrategy, Component, computed, input, model } from '@angular/core';\r\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\r\nimport { IconProp } from '@fortawesome/fontawesome-svg-core';\r\n\r\n@Component({\r\n selector: 'spx-card-line',\r\n imports: [FaIconComponent],\r\n templateUrl: './spx-card-line.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n})\r\nexport class SpxCardLineComponent {\r\n readonly icon = input<IconProp>();\r\n readonly showPositiveOrNegative = input(false);\r\n readonly text = input<string | unknown>();\r\n readonly value = model.required<string | number>();\r\n readonly secondValue = input<string | number>();\r\n readonly showProgress = input<boolean>();\r\n readonly unit = input<string>();\r\n readonly newOrderScreen = input(false);\r\n\r\n numericValue = computed(() => {return this.value() as number});\r\n\r\n public displayValue(val: string | number | unknown): string | number | unknown {\r\n return val || val === 0 ? val : '—';\r\n }\r\n}\r\n","<div class=\"items-center\" [class.flex]=\"!newOrderScreen()\">\r\n <div class=\"block w-24 text-gray-600 dark:text-gray-200 text-xs mb-1\" [class.pt-1]=\"!newOrderScreen()\" [innerHTML]=\"text()\"></div>\r\n <div class=\"flex\">\r\n @if (icon()) {\r\n <fa-icon [icon]=\"icon()!\" class=\"text-lg mr-3 w-6 text-center\"></fa-icon>\r\n }\r\n @if (showPositiveOrNegative() && numericValue() < 0) {\r\n <div class=\"rounded-full w-4 h-4 mr-2 bg-sky-600\"> </div>\r\n }\r\n @if (!showProgress()) {\r\n <span class=\"block font-medium grow whitespace-pre-line leading-5\">\r\n <span [innerHTML]=\"displayValue(value())\"></span>\r\n <ng-content></ng-content>\r\n @if (unit()) {\r\n <span> {{ unit() }}</span>\r\n }\r\n @if (!unit() && secondValue() !== null && secondValue() !== undefined) {\r\n / {{ displayValue(secondValue()) }}\r\n }\r\n </span>\r\n }\r\n </div>\r\n @if (showProgress()) {\r\n <div class=\"block font-medium grow whitespace-pre-line text-gray-600 dark:text-gray-200\">\r\n <div class=\"flex\">\r\n <div class=\"flex grow gap-2\">\r\n <div class=\"bg-gray-200 my-0.5 h-5 w-full rounded\">\r\n <div class=\"bg-teal-600 h-5 rounded\" [style.width]=\"((+value()) / (secondValue() ? +secondValue()! : 0)) * 100 + '%'\"></div>\r\n </div>\r\n </div>\r\n <div class=\"flex text-left pl-3 gap-2\">\r\n <div class=\"block w-16 text-right\">{{ value() }} / {{ secondValue() }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,gBAAgB,CAAA;AAS3B,IAAA,WAAA,GAAA;AARS,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;AACvB,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;AACxB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAA,IAAA,GAAG,KAAK,EAAU;QACtB,IAAI,CAAA,IAAA,GAAG,KAAK,EAAU;AACtB,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;QACjC,IAAO,CAAA,OAAA,GAAG,MAAM,EAAE;;AAIlB,IAAA,YAAY,CAAC,GAAoB,EAAA;AAC/B,QAAA,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG;;IAGvC,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;;8GAhBV,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAA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C,mBAET,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,4lDAAA,EAAA;;;AETpB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-card.mjs","sources":["../../../../projects/softpak/components/spx-card/spx-card.component.ts","../../../../projects/softpak/components/spx-card/spx-card.component.html","../../../../projects/softpak/components/spx-card/spx-card-item/spx-card-item.component.ts","../../../../projects/softpak/components/spx-card/spx-card-item/spx-card-item.component.html","../../../../projects/softpak/components/spx-card/spx-card-grid/spx-card-grid.component.ts","../../../../projects/softpak/components/spx-card/spx-card-grid/spx-card-grid.component.html","../../../../projects/softpak/components/spx-card/spx-card-line/spx-card-line.component.ts","../../../../projects/softpak/components/spx-card/spx-card-line/spx-card-line.component.html","../../../../projects/softpak/components/spx-card/softpak-components-spx-card.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\n\n@Component({\n selector: 'spx-card',\n templateUrl: './spx-card.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxCardComponent {\n readonly clickable = input(true);\n readonly hasContent = input(true);\n readonly onDetailPage = input(false);\n readonly text = input<string>();\n readonly unit = input<string>();\n readonly tableView = input(false);\n clicked = output();\n\n constructor() { }\n\n displayValue(val: string | number): string | number {\n return val || (val === 0) ? val : '—';\n }\n\n onClick(): void {\n this.clicked.emit();\n }\n}\n","<button type=\"button\"\nclass=\"block w-full text-left rounded font-body items-stretch\"\n[class.flex]=\"tableView()\"\n[class.cursor-pointer]=\"clickable()\"\n[class.cursor-not-allowed]=\"!clickable()\"\n[class.focus:ring-2]=\"clickable()\"\n[class.focus:ring-offset-2]=\"clickable()\"\n[class.focus:ring-blue-500]=\"clickable()\"\n(click)=\"onClick()\"\n[tabIndex]=\"clickable() ? 0 : -1\">\n<div class=\"text-gray-900 opacity-90\" [class.w-96]=\"tableView()\">\n <ng-content select=\"[card-header]\"></ng-content>\n</div>\n<ng-content select=\"[card-content-top]\"></ng-content>\n@if (hasContent()) {\n <div class=\"bg-white dark:bg-gray-600 p-3\">\n <ng-content select=\"[card-content]\"></ng-content>\n </div>\n}\n<ng-content select=\"[card-content-bottom]\"></ng-content>\n<div class=\"bg-gray-50 dark:bg-gray-700 p-3 grow\" [class.rounded-b-lg]=\"!onDetailPage() && !tableView()\" [class.rounded-r-lg]=\"!onDetailPage() && tableView()\">\n <ng-content select=\"[card-lines]\"></ng-content>\n</div>\n</button>","\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FaIconComponent, IconDefinition } from '@fortawesome/angular-fontawesome';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\nimport { IsSeverityPipe } from '@softpak/components/spx-pipes';\n\n@Component({\n selector: 'spx-card-item',\n imports: [\n FaIconComponent,\n IsSeverityPipe\n ],\n templateUrl: './spx-card-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.h-full]': 'true',\n },\n})\nexport class SpxCardItemComponent {\n readonly icon = input<IconDefinition>();\n readonly iconOnly = input(false);\n readonly spxLabel = input.required<string>();\n readonly spxValue = input<string>();\n readonly spxSeverity = input<SpxSeverityEnum>();\n readonly spxIconSeverity = input<SpxSeverityEnum>();\n SpxSeverityEnum = SpxSeverityEnum;\n}\n","<div class='py-2 px-3 rounded h-full'\n [class.bg-slate-100]=\"!spxSeverity()\"\n [class.dark:bg-slate-600]=\"!spxSeverity()\"\n [class.text-black]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\"\n [class.text-white]=\"this.spxSeverity() | isSeverity: [SpxSeverityEnum.error, SpxSeverityEnum.success, SpxSeverityEnum.unknown, SpxSeverityEnum.info]\"\n [class.bg-red-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.error\"\n [class.bg-green-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.success\"\n [class.bg-blue-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.info\"\n [class.bg-gray-400]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.unknown\"\n [class.bg-amber-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\">\n <div class=\"font-small leading-normal\">{{ spxLabel() }}</div>\n <div class=\"flex gap-4 text-lg leading-normal py-1\">\n @if (icon()) {\n <div class=\"font-bold text-center leading-normal max-w-12 min-w-12\" [class.grow]=\"iconOnly()\">\n <div\n class=\"px-3 py-1 text-white rounded\"\n [class.bg-black]=\"!spxIconSeverity()\"\n [class.bg-red-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.error\"\n [class.bg-green-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.success\"\n [class.bg-blue-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.info\"\n [class.bg-gray-400]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.unknown\"\n [class.bg-amber-700]=\"this.spxSeverity() | isSeverity: SpxSeverityEnum.warning\">\n <fa-icon [icon]=\"icon()!\"></fa-icon>\n </div>\n </div>\n }\n <div class=\"grow font-bold\">\n @if (!iconOnly()) {\n <ng-content></ng-content><div [innerHTML]=\"spxValue()\"></div>\n }\n </div>\n </div>\n </div>","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-card-grid',\n standalone: true,\n templateUrl: './spx-card-grid.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SpxCardGridComponent {\n readonly minWidth2Columns = input<(300 | 320 | 340 | 360 | 380 | 400 | 420 | 440 | 460) | undefined>(460);\n}\n","<div class='grid gap-3 items-stretch'\n [class.min-[300px]:grid-cols-2]=\"minWidth2Columns() == 300\"\n [class.min-[320px]:grid-cols-2]=\"minWidth2Columns() == 320\"\n [class.min-[340px]:grid-cols-2]=\"minWidth2Columns() == 340\"\n [class.min-[360px]:grid-cols-2]=\"minWidth2Columns() == 360\"\n [class.min-[380px]:grid-cols-2]=\"minWidth2Columns() == 380\"\n [class.min-[400px]:grid-cols-2]=\"minWidth2Columns() == 400\"\n [class.min-[420px]:grid-cols-2]=\"minWidth2Columns() == 420\"\n [class.min-[440px]:grid-cols-2]=\"minWidth2Columns() == 440\"\n [class.min-[460px]:grid-cols-2]=\"minWidth2Columns() == 460\">\n <ng-content></ng-content>\n </div>","import { ChangeDetectionStrategy, Component, computed, input, model } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { IconProp } from '@fortawesome/fontawesome-svg-core';\n\n@Component({\n selector: 'spx-card-line',\n imports: [FaIconComponent],\n templateUrl: './spx-card-line.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxCardLineComponent {\n readonly icon = input<IconProp>();\n readonly showPositiveOrNegative = input(false);\n readonly text = input<string | unknown>();\n readonly value = model.required<string | number>();\n readonly secondValue = input<string | number>();\n readonly showProgress = input<boolean>();\n readonly unit = input<string>();\n readonly newOrderScreen = input(false);\n\n numericValue = computed(() => {return this.value() as number});\n\n public displayValue(val: string | number | unknown): string | number | unknown {\n return val || val === 0 ? val : '—';\n }\n}\n","<div class=\"items-center\" [class.flex]=\"!newOrderScreen()\">\n <div class=\"block w-24 text-gray-600 dark:text-gray-200 text-xs mb-1\" [class.pt-1]=\"!newOrderScreen()\" [innerHTML]=\"text()\"></div>\n <div class=\"flex\">\n @if (icon()) {\n <fa-icon [icon]=\"icon()!\" class=\"text-lg mr-3 w-6 text-center\"></fa-icon>\n }\n @if (showPositiveOrNegative() && numericValue() < 0) {\n <div class=\"rounded-full w-4 h-4 mr-2 bg-sky-600\"> </div>\n }\n @if (!showProgress()) {\n <span class=\"block font-medium grow whitespace-pre-line leading-5\">\n <span [innerHTML]=\"displayValue(value())\"></span>\n <ng-content></ng-content>\n @if (unit()) {\n <span> {{ unit() }}</span>\n }\n @if (!unit() && secondValue() !== null && secondValue() !== undefined) {\n / {{ displayValue(secondValue()) }}\n }\n </span>\n }\n </div>\n @if (showProgress()) {\n <div class=\"block font-medium grow whitespace-pre-line text-gray-600 dark:text-gray-200\">\n <div class=\"flex\">\n <div class=\"flex grow gap-2\">\n <div class=\"bg-gray-200 my-0.5 h-5 w-full rounded\">\n <div class=\"bg-teal-600 h-5 rounded\" [style.width]=\"((+value()) / (secondValue() ? +secondValue()! : 0)) * 100 + '%'\"></div>\n </div>\n </div>\n <div class=\"flex text-left pl-3 gap-2\">\n <div class=\"block w-16 text-right\">{{ value() }} / {{ secondValue() }}</div>\n </div>\n </div>\n </div>\n }\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,gBAAgB,CAAA;AAS3B,IAAA,WAAA,GAAA;AARS,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;AACvB,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;AACxB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAA,IAAA,GAAG,KAAK,EAAU;QACtB,IAAI,CAAA,IAAA,GAAG,KAAK,EAAU;AACtB,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;QACjC,IAAO,CAAA,OAAA,GAAG,MAAM,EAAE;;AAIlB,IAAA,YAAY,CAAC,GAAoB,EAAA;AAC/B,QAAA,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG;;IAGvC,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;;8GAhBV,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,u3BCR7B,igCAu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
|
175
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
176
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.
|
|
175
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxChangeDetailsComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
176
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.1", type: SpxChangeDetailsComponent, isStandalone: true, selector: "spx-change-details", inputs: { formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: false, transformFunction: null }, suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: false, transformFunction: null }, textCategory: { classPropertyName: "textCategory", publicName: "textCategory", isSignal: true, isRequired: false, transformFunction: null }, textContainerNumber: { classPropertyName: "textContainerNumber", publicName: "textContainerNumber", isSignal: true, isRequired: false, transformFunction: null }, textContainerType: { classPropertyName: "textContainerType", publicName: "textContainerType", isSignal: true, isRequired: false, transformFunction: null }, textCustomer: { classPropertyName: "textCustomer", publicName: "textCustomer", isSignal: true, isRequired: false, transformFunction: null }, textLicensePlate: { classPropertyName: "textLicensePlate", publicName: "textLicensePlate", isSignal: true, isRequired: false, transformFunction: null }, textSave: { classPropertyName: "textSave", publicName: "textSave", isSignal: true, isRequired: false, transformFunction: null }, textTonsTested: { classPropertyName: "textTonsTested", publicName: "textTonsTested", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { spxBlurCategory: "spxBlurCategory", spxBlurContainerType: "spxBlurContainerType", spxSearchCategory: "spxSearchCategory", spxSearchContainerType: "spxSearchContainerType", spxSearchTonsTested: "spxSearchTonsTested", submit: "submit" }, ngImport: i0, template: "<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup()!\"\n [spxForm]=\"form\"\n [spxSuggestions]=\"suggestions()\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n</form>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxForm", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
177
177
|
}
|
|
178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxChangeDetailsComponent, decorators: [{
|
|
179
179
|
type: Component,
|
|
180
180
|
args: [{ selector: 'spx-change-details', imports: [
|
|
181
181
|
FormsModule,
|
|
182
182
|
ReactiveFormsModule,
|
|
183
183
|
SpxFormViewComponent,
|
|
184
|
-
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\
|
|
184
|
+
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup()!\"\n [spxForm]=\"form\"\n [spxSuggestions]=\"suggestions()\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n</form>" }]
|
|
185
185
|
}], ctorParameters: () => [{ type: i1.FormBuilder }] });
|
|
186
186
|
|
|
187
187
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-change-details.mjs","sources":["../../../../projects/softpak/components/spx-change-details/spx-change-details.component.ts","../../../../projects/softpak/components/spx-change-details/spx-change-details.component.html","../../../../projects/softpak/components/spx-change-details/softpak-components-spx-change-details.ts"],"sourcesContent":["import { ChangeDetectionStrategy, computed, effect, input, output } from '@angular/core';\r\nimport { Component } from '@angular/core';\r\nimport {\r\n FormBuilder,\r\n FormControl,\r\n FormGroup,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n} from '@angular/forms';\r\nimport { Subscription } from 'rxjs';\r\nimport { SpxChangeDetailsValueI } from './spx-change-details-value.interface';\r\nimport { SpxFormViewComponent, SpxFormI, SpxFormButtonTypeEnum, SpxFormFieldI } from '@softpak/components/spx-form-view';\r\nimport { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';\r\nimport { SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\r\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\r\n\r\nexport const spxSectionChangeDetails = 'changeDetails';\r\nexport const spxCtrlContainerNumber = 'containerNumber';\r\nexport const spxCtrlContainerSeqNr = 'containerSeqNr';\r\nexport const spxCtrlContainerType = 'containerType';\r\nexport const spxCtrlCustomer = 'customer';\r\nexport const spxCtrlTonsTested = 'tonsTested';\r\nexport const spxCtrlLicensePlate = 'licensePlate';\r\nexport const spxCtrlCategory = 'category';\r\nexport const spxCtrlUseCategories = 'useCategories';\r\n\r\n@Component({\r\n selector: 'spx-change-details',\r\n templateUrl: './spx-change-details.component.html',\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxFormViewComponent,\r\n ],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SpxChangeDetailsComponent {\r\n readonly formGroup = input<FormGroup>();\r\n readonly suggestions = input<any>();\r\n private readonly showTonsTested = computed(() =>\r\n this.suggestions()?.[spxCtrlTonsTested] &&\r\n this.suggestions()?.[spxCtrlTonsTested].length &&\r\n this.suggestions()?.[spxCtrlTonsTested].length > 0\r\n );\r\n readonly textCategory = input<string>();\r\n readonly textContainerNumber = input<string>();\r\n readonly textContainerType = input<string>();\r\n readonly textCustomer = input<string>();\r\n readonly textLicensePlate = input<string>();\r\n readonly textSave = input<string>();\r\n readonly textTonsTested = input<string>();\r\n spxBlurCategory = output<SpxValuePair<string>>();\r\n spxBlurContainerType = output<SpxValuePair<string>>();\r\n spxSearchCategory = output<SpxValuePair<string>>();\r\n spxSearchContainerType = output<SpxValuePair<string>>();\r\n spxSearchTonsTested = output<SpxValuePair<string>>();\r\n submit = output<SpxChangeDetailsValueI>();\r\n\r\n form: SpxFormI = {\r\n buttons: [\r\n {\r\n severity: SpxSeverityEnum.success,\r\n type: SpxFormButtonTypeEnum.submit,\r\n label: () => this.textSave()!,\r\n }\r\n ],\r\n sections: [\r\n {\r\n key: spxSectionChangeDetails,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: spxCtrlContainerSeqNr,\r\n type: () => SpxInputTypeEnum.hidden,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: spxCtrlContainerNumber,\r\n type: () => SpxInputTypeEnum.text,\r\n label: () => this.textContainerNumber()!,\r\n readonly: () => true,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: spxCtrlCustomer,\r\n type: () => SpxInputTypeEnum.text,\r\n capitalize: () => true,\r\n readonly: () => true,\r\n label: () => this.textCustomer()!,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: spxCtrlContainerType,\r\n type: () => SpxInputTypeEnum.autocomplete,\r\n label: () => this.textContainerType()!,\r\n capitalize: () => true,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: spxCtrlTonsTested,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textTonsTested()!,\r\n show: () => this.showTonsTested(),\r\n },\r\n {\r\n key: spxCtrlLicensePlate,\r\n type: () => SpxInputTypeEnum.text,\r\n label: () => this.textLicensePlate()!,\r\n capitalize: () => true,\r\n },\r\n {\r\n key: spxCtrlUseCategories,\r\n type: () => SpxInputTypeEnum.hidden,\r\n capitalize: () => true,\r\n },\r\n {\r\n key: spxCtrlCategory,\r\n type: () => SpxInputTypeEnum.autocomplete,\r\n label: () => this.textCategory()!,\r\n capitalize: () => true,\r\n show: () => valuePairToValue(this.ctrlUseCategories()?.value),\r\n validators: () => valuePairToValue(this.ctrlUseCategories()?.value) ? [spxValidatorRequired()] : [],\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n\r\n readonly ctrlCategory = computed(() => this.formGroup()?.get(spxCtrlCategory) as FormControl);\r\n readonly ctrlCustomer = computed(() => this.formGroup()?.get(spxCtrlCustomer) as FormControl);\r\n readonly ctrlContainerType = computed(() => this.formGroup()?.get(spxCtrlContainerType) as FormControl);\r\n readonly ctrlLicensePlate = computed(() => this.formGroup()?.get(spxCtrlLicensePlate) as FormControl);\r\n readonly ctrlTonsTested = computed(() => this.formGroup()?.get(spxCtrlTonsTested) as FormControl);\r\n readonly ctrlUseCategories = computed(() => this.formGroup()?.get(spxCtrlUseCategories) as FormControl);\r\n\r\n private subContainerType?: Subscription;\r\n\r\n constructor(readonly formBuilder: FormBuilder) {\r\n effect(() => {\r\n if (\r\n this.showTonsTested()\r\n ) {\r\n this.ctrlTonsTested()?.addValidators([spxValidatorRequired()]);\r\n this.ctrlTonsTested()?.updateValueAndValidity();\r\n } else {\r\n this.ctrlTonsTested()?.clearValidators();\r\n this.ctrlTonsTested()?.updateValueAndValidity();\r\n }\r\n });\r\n }\r\n\r\n createForm(): FormGroup {\r\n return SpxFormViewComponent.createForm(\r\n this.formBuilder,\r\n this.form.sections\r\n );\r\n }\r\n\r\n ngOnInit(): void {\r\n this.listenToContainerType();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.subContainerType) {\r\n this.subContainerType.unsubscribe();\r\n }\r\n }\r\n\r\n getRawValidators(formControl: FormControl) {\r\n return (formControl as any)._rawValidators;\r\n }\r\n\r\n onBlur(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\r\n setTimeout(() => {\r\n if (data.field.key === spxCtrlCategory && valuePairToValue(this.formGroup()!.get(spxCtrlCategory)!.value) !== null) {\r\n this.spxBlurCategory.emit(data.valuePair);\r\n }\r\n if (data.field.key === spxCtrlContainerType && valuePairToValue(this.formGroup()!.get(spxCtrlContainerType)!.value) !== null) {\r\n this.spxBlurContainerType.emit(data.valuePair);\r\n }\r\n }, 300);\r\n }\r\n\r\n onSearch(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\r\n if (data.field.key === spxCtrlCategory) {\r\n this.spxSearchCategory.emit(data.valuePair);\r\n }\r\n if (data.field.key === spxCtrlContainerType) {\r\n this.spxSearchContainerType.emit(data.valuePair);\r\n }\r\n if (data.field.key === spxCtrlTonsTested) {\r\n this.spxSearchTonsTested.emit(data.valuePair);\r\n }\r\n }\r\n\r\n onSubmit(): void {\r\n this.submit.emit({\r\n category: valuePairToValue(this.ctrlUseCategories().value) ? this.ctrlCategory().value : null,\r\n containerType: this.ctrlContainerType().value,\r\n licensePlate: this.ctrlLicensePlate().value,\r\n tonsTested: this.ctrlTonsTested().value,\r\n })\r\n }\r\n\r\n private listenToContainerType(): void {\r\n this.subContainerType = this.ctrlContainerType().valueChanges.subscribe(valuePair => {\r\n this.ctrlTonsTested().setValue({ value: null });\r\n this.spxSearchTonsTested.emit(valuePair);\r\n });\r\n }\r\n}\r\n","<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\r\n <spx-form-view\r\n [spxFormGroup]=\"formGroup()!\"\r\n [spxForm]=\"form\"\r\n [spxSuggestions]=\"suggestions()\"\r\n (spxBlur)=\"onBlur($event)\"\r\n (spxSearch)=\"onSearch($event)\">\r\n </spx-form-view>\r\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAgBO,MAAM,uBAAuB,GAAG;AAChC,MAAM,sBAAsB,GAAG;AAC/B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,oBAAoB,GAAG;AAC7B,MAAM,eAAe,GAAG;AACxB,MAAM,iBAAiB,GAAG;AAC1B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,eAAe,GAAG;AACxB,MAAM,oBAAoB,GAAG;MAavB,yBAAyB,CAAA;AAqGpC,IAAA,WAAA,CAAqB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;QApGvB,IAAS,CAAA,SAAA,GAAG,KAAK,EAAa;QAC9B,IAAW,CAAA,WAAA,GAAG,KAAK,EAAO;AAClB,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MACzC,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC;YACvC,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC,MAAM;AAC9C,YAAA,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC,MAAM,GAAG,CAAC,CACnD;QACQ,IAAY,CAAA,YAAA,GAAG,KAAK,EAAU;QAC9B,IAAmB,CAAA,mBAAA,GAAG,KAAK,EAAU;QACrC,IAAiB,CAAA,iBAAA,GAAG,KAAK,EAAU;QACnC,IAAY,CAAA,YAAA,GAAG,KAAK,EAAU;QAC9B,IAAgB,CAAA,gBAAA,GAAG,KAAK,EAAU;QAClC,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAU;QAC1B,IAAc,CAAA,cAAA,GAAG,KAAK,EAAU;QACzC,IAAe,CAAA,eAAA,GAAG,MAAM,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WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,8CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,0FAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,mBAAmB,gLACnB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKX,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAXrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAErB,OAAA,EAAA;wBACP,WAAW;wBACX,mBAAmB;wBACnB,oBAAoB;AACrB,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2VAAA,EAAA;;;AEnCjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-change-details.mjs","sources":["../../../../projects/softpak/components/spx-change-details/spx-change-details.component.ts","../../../../projects/softpak/components/spx-change-details/spx-change-details.component.html","../../../../projects/softpak/components/spx-change-details/softpak-components-spx-change-details.ts"],"sourcesContent":["import { ChangeDetectionStrategy, computed, effect, input, output } from '@angular/core';\nimport { Component } from '@angular/core';\nimport {\n FormBuilder,\n FormControl,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { SpxChangeDetailsValueI } from './spx-change-details-value.interface';\nimport { SpxFormViewComponent, SpxFormI, SpxFormButtonTypeEnum, SpxFormFieldI } from '@softpak/components/spx-form-view';\nimport { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\n\nexport const spxSectionChangeDetails = 'changeDetails';\nexport const spxCtrlContainerNumber = 'containerNumber';\nexport const spxCtrlContainerSeqNr = 'containerSeqNr';\nexport const spxCtrlContainerType = 'containerType';\nexport const spxCtrlCustomer = 'customer';\nexport const spxCtrlTonsTested = 'tonsTested';\nexport const spxCtrlLicensePlate = 'licensePlate';\nexport const spxCtrlCategory = 'category';\nexport const spxCtrlUseCategories = 'useCategories';\n\n@Component({\n selector: 'spx-change-details',\n templateUrl: './spx-change-details.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxFormViewComponent,\n ],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxChangeDetailsComponent {\n readonly formGroup = input<FormGroup>();\n readonly suggestions = input<any>();\n private readonly showTonsTested = computed(() =>\n this.suggestions()?.[spxCtrlTonsTested] &&\n this.suggestions()?.[spxCtrlTonsTested].length &&\n this.suggestions()?.[spxCtrlTonsTested].length > 0\n );\n readonly textCategory = input<string>();\n readonly textContainerNumber = input<string>();\n readonly textContainerType = input<string>();\n readonly textCustomer = input<string>();\n readonly textLicensePlate = input<string>();\n readonly textSave = input<string>();\n readonly textTonsTested = input<string>();\n spxBlurCategory = output<SpxValuePair<string>>();\n spxBlurContainerType = output<SpxValuePair<string>>();\n spxSearchCategory = output<SpxValuePair<string>>();\n spxSearchContainerType = output<SpxValuePair<string>>();\n spxSearchTonsTested = output<SpxValuePair<string>>();\n submit = output<SpxChangeDetailsValueI>();\n\n form: SpxFormI = {\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSave()!,\n }\n ],\n sections: [\n {\n key: spxSectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlContainerSeqNr,\n type: () => SpxInputTypeEnum.hidden,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textContainerNumber()!,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlCustomer,\n type: () => SpxInputTypeEnum.text,\n capitalize: () => true,\n readonly: () => true,\n label: () => this.textCustomer()!,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textContainerType()!,\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textTonsTested()!,\n show: () => this.showTonsTested(),\n },\n {\n key: spxCtrlLicensePlate,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textLicensePlate()!,\n capitalize: () => true,\n },\n {\n key: spxCtrlUseCategories,\n type: () => SpxInputTypeEnum.hidden,\n capitalize: () => true,\n },\n {\n key: spxCtrlCategory,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textCategory()!,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlUseCategories()?.value),\n validators: () => valuePairToValue(this.ctrlUseCategories()?.value) ? [spxValidatorRequired()] : [],\n }\n ]\n }\n ]\n };\n\n readonly ctrlCategory = computed(() => this.formGroup()?.get(spxCtrlCategory) as FormControl);\n readonly ctrlCustomer = computed(() => this.formGroup()?.get(spxCtrlCustomer) as FormControl);\n readonly ctrlContainerType = computed(() => this.formGroup()?.get(spxCtrlContainerType) as FormControl);\n readonly ctrlLicensePlate = computed(() => this.formGroup()?.get(spxCtrlLicensePlate) as FormControl);\n readonly ctrlTonsTested = computed(() => this.formGroup()?.get(spxCtrlTonsTested) as FormControl);\n readonly ctrlUseCategories = computed(() => this.formGroup()?.get(spxCtrlUseCategories) as FormControl);\n\n private subContainerType?: Subscription;\n\n constructor(readonly formBuilder: FormBuilder) {\n effect(() => {\n if (\n this.showTonsTested()\n ) {\n this.ctrlTonsTested()?.addValidators([spxValidatorRequired()]);\n this.ctrlTonsTested()?.updateValueAndValidity();\n } else {\n this.ctrlTonsTested()?.clearValidators();\n this.ctrlTonsTested()?.updateValueAndValidity();\n }\n });\n }\n\n createForm(): FormGroup {\n return SpxFormViewComponent.createForm(\n this.formBuilder,\n this.form.sections\n );\n }\n\n ngOnInit(): void {\n this.listenToContainerType();\n }\n\n ngOnDestroy(): void {\n if (this.subContainerType) {\n this.subContainerType.unsubscribe();\n }\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onBlur(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\n setTimeout(() => {\n if (data.field.key === spxCtrlCategory && valuePairToValue(this.formGroup()!.get(spxCtrlCategory)!.value) !== null) {\n this.spxBlurCategory.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlContainerType && valuePairToValue(this.formGroup()!.get(spxCtrlContainerType)!.value) !== null) {\n this.spxBlurContainerType.emit(data.valuePair);\n }\n }, 300);\n }\n\n onSearch(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\n if (data.field.key === spxCtrlCategory) {\n this.spxSearchCategory.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlContainerType) {\n this.spxSearchContainerType.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlTonsTested) {\n this.spxSearchTonsTested.emit(data.valuePair);\n }\n }\n\n onSubmit(): void {\n this.submit.emit({\n category: valuePairToValue(this.ctrlUseCategories().value) ? this.ctrlCategory().value : null,\n containerType: this.ctrlContainerType().value,\n licensePlate: this.ctrlLicensePlate().value,\n tonsTested: this.ctrlTonsTested().value,\n })\n }\n\n private listenToContainerType(): void {\n this.subContainerType = this.ctrlContainerType().valueChanges.subscribe(valuePair => {\n this.ctrlTonsTested().setValue({ value: null });\n this.spxSearchTonsTested.emit(valuePair);\n });\n }\n}\n","<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup()!\"\n [spxForm]=\"form\"\n [spxSuggestions]=\"suggestions()\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAgBO,MAAM,uBAAuB,GAAG;AAChC,MAAM,sBAAsB,GAAG;AAC/B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,oBAAoB,GAAG;AAC7B,MAAM,eAAe,GAAG;AACxB,MAAM,iBAAiB,GAAG;AAC1B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,eAAe,GAAG;AACxB,MAAM,oBAAoB,GAAG;MAavB,yBAAyB,CAAA;AAqGpC,IAAA,WAAA,CAAqB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;QApGvB,IAAS,CAAA,SAAA,GAAG,KAAK,EAAa;QAC9B,IAAW,CAAA,WAAA,GAAG,KAAK,EAAO;AAClB,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MACzC,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC;YACvC,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC,MAAM;AAC9C,YAAA,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC,MAAM,GAAG,CAAC,CACnD;QACQ,IAAY,CAAA,YAAA,GAAG,KAAK,EAAU;QAC9B,IAAmB,CAAA,mBAAA,GAAG,KAAK,EAAU;QACrC,IAAiB,CAAA,iBAAA,GAAG,KAAK,EAAU;QACnC,IAAY,CAAA,YAAA,GAAG,KAAK,EAAU;QAC9B,IAAgB,CAAA,gBAAA,GAAG,KAAK,EAAU;QAClC,IAAQ,CAAA,QAAA,GAAG,KAAK,EAAU;QAC1B,IAAc,CAAA,cAAA,GAAG,KAAK,E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DsBH,WAAW,EACX,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,8CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,0FAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,mBAAmB,gLACnB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKX,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAXrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAErB,OAAA,EAAA;wBACP,WAAW;wBACX,mBAAmB;wBACnB,oBAAoB;AACrB,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2UAAA,EAAA;;;AEnCjD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i2 from '@angular/router';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject,
|
|
4
|
+
import { inject, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
|
|
5
5
|
import { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';
|
|
6
6
|
import { createAction, props, union, createFeature, createReducer, on, Store } from '@ngrx/store';
|
|
7
7
|
import { SpxButtonComponent } from '@softpak/components/spx-button';
|
|
@@ -22,29 +22,6 @@ import { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/compon
|
|
|
22
22
|
import { captureMessage } from '@sentry/angular';
|
|
23
23
|
import { App } from '@capacitor/app';
|
|
24
24
|
|
|
25
|
-
// import { spxChannelSelectionUrl } from '../../src/app.const';
|
|
26
|
-
class SpxChannelGuard {
|
|
27
|
-
constructor() {
|
|
28
|
-
this.router = inject(Router);
|
|
29
|
-
}
|
|
30
|
-
canActivate() {
|
|
31
|
-
if (!SpxStorage.getSetting(SpxStorageKeyEnum.brand) ||
|
|
32
|
-
!SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {
|
|
33
|
-
this.router.navigate(['wlc']);
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
39
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelGuard, providedIn: 'root' }); }
|
|
40
|
-
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelGuard, decorators: [{
|
|
42
|
-
type: Injectable,
|
|
43
|
-
args: [{
|
|
44
|
-
providedIn: 'root'
|
|
45
|
-
}]
|
|
46
|
-
}] });
|
|
47
|
-
|
|
48
25
|
const choose = createAction('[SPX / Channel] Select', props());
|
|
49
26
|
const initialize = createAction('[SPX / Channel] Initialize', props());
|
|
50
27
|
const all = union({
|
|
@@ -139,16 +116,38 @@ class SpxChannelIndicatorComponent {
|
|
|
139
116
|
onChange() {
|
|
140
117
|
this.navController.navigateRoot([spxChannelSelectionUrl]);
|
|
141
118
|
}
|
|
142
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
143
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxChannelIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
120
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.1", type: SpxChannelIndicatorComponent, isStandalone: true, selector: "spx-channel-indicator", ngImport: i0, template: "<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 (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>", dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
144
121
|
}
|
|
145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxChannelIndicatorComponent, decorators: [{
|
|
146
123
|
type: Component,
|
|
147
124
|
args: [{ selector: 'spx-channel-indicator', imports: [
|
|
148
125
|
SpxButtonComponent,
|
|
149
126
|
SpxCapitalizePipe,
|
|
150
127
|
TranslatePipe,
|
|
151
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\
|
|
128
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<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 (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>" }]
|
|
129
|
+
}] });
|
|
130
|
+
|
|
131
|
+
class SpxChannelGuard {
|
|
132
|
+
constructor() {
|
|
133
|
+
this.router = inject(Router);
|
|
134
|
+
}
|
|
135
|
+
canActivate() {
|
|
136
|
+
if (!SpxStorage.getSetting(SpxStorageKeyEnum.brand) ||
|
|
137
|
+
!SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {
|
|
138
|
+
this.router.navigate([spxChannelSelectionUrl]);
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxChannelGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
144
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxChannelGuard, providedIn: 'root' }); }
|
|
145
|
+
}
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SpxChannelGuard, decorators: [{
|
|
147
|
+
type: Injectable,
|
|
148
|
+
args: [{
|
|
149
|
+
providedIn: 'root'
|
|
150
|
+
}]
|
|
152
151
|
}] });
|
|
153
152
|
|
|
154
153
|
class Effects {
|
|
@@ -182,10 +181,10 @@ class Effects {
|
|
|
182
181
|
})];
|
|
183
182
|
})), { dispatch: true });
|
|
184
183
|
}
|
|
185
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
186
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.
|
|
184
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: Effects, deps: [{ token: i1.Actions }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
185
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: Effects }); }
|
|
187
186
|
}
|
|
188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: Effects, decorators: [{
|
|
189
188
|
type: Injectable
|
|
190
189
|
}], ctorParameters: () => [{ type: i1.Actions }, { type: i2.Router }] });
|
|
191
190
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../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/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { Router } from '@angular/router';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\r\n// import { spxChannelSelectionUrl } from '../../src/app.const';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SpxChannelGuard {\r\n\r\n private readonly router = inject(Router);\r\n\r\n canActivate(): boolean {\r\n if (\r\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\r\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\r\n ) {\r\n this.router.navigate(['wlc']);\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n","import { createAction, props, union } from '@ngrx/store';\r\nimport { SpxAppChannelI, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\r\n\r\nexport const choose = createAction('[SPX / Channel] Select', props<{\r\n channel: SpxAppChannelI;\r\n channelType: SpxChannelTypeI;\r\n}>());\r\nexport const initialize = createAction('[SPX / Channel] Initialize', props<{\r\n channels: SpxAppChannelI[];\r\n}>());\r\n\r\nconst all = union({\r\n choose,\r\n initialize,\r\n});\r\n\r\nexport type Actions = typeof all;\r\n","\r\nimport * as actions from './spx-channel.actions';\r\nimport { createFeature, createReducer, on } from '@ngrx/store';\r\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\r\nimport { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\r\n\r\nexport const initialState: StateI = {\r\n previousChannel: null,\r\n channel: null,\r\n channelType: null,\r\n channels: [],\r\n};\r\n\r\nexport interface StateI {\r\n previousChannel: SpxAppChannelI | null;\r\n channel: SpxAppChannelI | null;\r\n channels: SpxAppChannelI[];\r\n channelType: SpxChannelTypeI | null;\r\n}\r\n\r\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\r\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\r\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));\r\n if (channelResult) {\r\n return channelResult;\r\n } else {\r\n const defaultBrandResult = channels.find(channel => channel.default);\r\n if (defaultBrandResult) {\r\n return defaultBrandResult;\r\n } else {\r\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\r\n return null;\r\n }\r\n }\r\n } else {\r\n const defaultBrandResult = channels.find(channel => channel.default);\r\n if (defaultBrandResult) {\r\n return defaultBrandResult;\r\n }\r\n return null;\r\n }\r\n}\r\n\r\nexport default createFeature({\r\n name: 'spxChannel',\r\n reducer: createReducer(\r\n initialState,\r\n on(actions.choose, (state, { channel, channelType }): StateI => {\r\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\r\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType.name);\r\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelTypeWithWebUrl, JSON.stringify(channelType));\r\n return {\r\n ...state,\r\n previousChannel: state.channel,\r\n channel,\r\n channelType,\r\n };\r\n }),\r\n on(actions.initialize, (state, { channels }): StateI => {\r\n \r\n let channelType: SpxChannelTypeI | null = null;\r\n \r\n if(SpxStorage.getSetting(SpxStorageKeyEnum.channelTypeWithWebUrl)) {\r\n channelType = JSON.parse(SpxStorage.getSetting(SpxStorageKeyEnum.channelTypeWithWebUrl) as string);\r\n }\r\n else if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\r\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\r\n }\r\n else {\r\n channelType = { name: SpxAppChannelTypeEnum.production }; // Default to production if no type is set\r\n }\r\n\r\n return {\r\n ...state,\r\n channel: determineActiveChannel(channels),\r\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\r\n channelType: channelType,\r\n }\r\n }),\r\n ),\r\n});\r\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\r\nimport { Store } from '@ngrx/store';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport spxChannelReducer from '../../store/spx-channel.reducer';\r\nimport { TranslatePipe } from '@ngx-translate/core';\r\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\r\nimport { spxTextChange } from '@softpak/components/spx-translate';\r\nimport { NavController } from '@ionic/angular';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { map } from 'rxjs';\r\nexport const spxChannelSelectionUrl = 'wlc';\r\n\r\n@Component({\r\n selector: 'spx-channel-indicator',\r\n templateUrl: './spx-channel-indicator.component.html',\r\n imports: [\r\n SpxButtonComponent,\r\n SpxCapitalizePipe,\r\n TranslatePipe,\r\n ],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n})\r\nexport class SpxChannelIndicatorComponent {\r\n private readonly navController = inject(NavController);\r\n private readonly store = inject(Store);\r\n protected readonly channel = toSignal(this.store.select(spxChannelReducer.selectChannel));\r\n protected readonly channelType = toSignal(this.store.select(spxChannelReducer.selectChannelType).pipe(\r\n map(channelType => channelType?.name)\r\n ));\r\n protected readonly spxTextChange = spxTextChange;\r\n\r\n protected onChange() {\r\n this.navController.navigateRoot([spxChannelSelectionUrl]);\r\n }\r\n}\r\n","<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\r\n <div class=\"grow\">\r\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\r\n @if (channelType() !== 'Production') {\r\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\r\n }\r\n </div>\r\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\r\n</div>","import { Actions, createEffect, ofType } from '@ngrx/effects';\r\nimport { switchMap } from 'rxjs/operators';\r\nimport { Injectable } from '@angular/core';\r\nimport * as actions from './spx-channel.actions';\r\nimport { setConfig } from '@capacitor/live-updates';\r\nimport { Capacitor } from '@capacitor/core';\r\nimport { Router } from '@angular/router';\r\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\r\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\r\nimport { captureMessage } from '@sentry/angular';\r\nimport { App } from '@capacitor/app';\r\n\r\n@Injectable()\r\nexport class Effects {\r\n onChoose$ =\r\n createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(actions.choose),\r\n switchMap((action) => {\r\n if (Capacitor.getPlatform() === 'web') {\r\n if(action.channelType.webUrl) {\r\n window.location.href = action.channelType.webUrl;\r\n }\r\n else {\r\n this.router.navigate(['tabs/hme']);\r\n }\r\n } else {\r\n App.getInfo().then((binaryInfo) => {\r\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\r\n setConfig({\r\n channel: `${action.channelType}-${binaryVersionGroup}.x`\r\n });\r\n this.router.navigate([spxUpdateUrl]);\r\n }).catch((err) => {\r\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\r\n this.router.navigate([spxUpdateUrl]);\r\n });\r\n }\r\n\r\n return [spxToasterActions.createSuccess({\r\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\r\n messageText: action.channel?.brand,\r\n })];\r\n }),\r\n ), { dispatch: true });\r\n\r\n constructor(\r\n private readonly actions$: Actions,\r\n private readonly router: Router,\r\n ) { }\r\n}\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.choose","actions.initialize","spxChannelReducer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA;MAKa,eAAe,CAAA;AAH5B,IAAA,WAAA,GAAA;AAKmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAYzC;IAVC,WAAW,GAAA;QACT,IACE,CAAC,UAAU,CAAC,UAAU,CAAoB,iBAAiB,CAAC,KAAK,CAAC;YAClE,CAAC,UAAU,CAAC,UAAU,CAAoB,iBAAiB,CAAC,WAAW,CAAC,EACxE;YACA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AAC7B,YAAA,OAAO,KAAK;;A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BAAA,CAAC,CAAC;SACN,CAAC,CACL,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8GA/BrB,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;;;;;;;;ACZD;;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 { createAction, props, union } from '@ngrx/store';\nimport { SpxAppChannelI, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\n\nexport const choose = createAction('[SPX / Channel] Select', props<{\n channel: SpxAppChannelI;\n channelType: SpxChannelTypeI;\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';\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.name);\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelTypeWithWebUrl, JSON.stringify(channelType));\n return {\n ...state,\n previousChannel: state.channel,\n channel,\n channelType,\n };\n }),\n on(actions.initialize, (state, { channels }): StateI => {\n \n let channelType: SpxChannelTypeI | null = null;\n \n if(SpxStorage.getSetting(SpxStorageKeyEnum.channelTypeWithWebUrl)) {\n channelType = JSON.parse(SpxStorage.getSetting(SpxStorageKeyEnum.channelTypeWithWebUrl) as string);\n }\n else if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\n }\n else {\n channelType = { name: 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';\nimport { Store } from '@ngrx/store';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport spxChannelReducer from '../../store/spx-channel.reducer';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { spxTextChange } from '@softpak/components/spx-translate';\nimport { NavController } from '@ionic/angular';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { map } from 'rxjs';\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","<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 (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 } from 'rxjs/operators';\nimport { 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';\n\n@Injectable()\nexport class Effects {\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(actions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n if(action.channelType.webUrl) {\n window.location.href = action.channelType.webUrl;\n }\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,EAAE,KAAK,EAG9D,CAAC;AACE,MAAM,UAAU,GAAG,YAAY,CAAC,4BAA4B,EAAE,KAAK,EAEtE,CAAC;AAEL,MAAM,GAAG,GAAG,KAAK,CAAC;IACd,MAAM;IACN,UAAU;AACb,CAAA,CAAC;;;;;;;;ACRK,MAAM,YAAY,GAAW;AAClC,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,EAAE;CACb;AASD,MAAM,sBAAsB,GAAG,CAAC,QAA0B,KAA2B;AACjF,IAAA,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE;QACxG,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,KAAK,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAkB,KAAK,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAA0B,CAAC,CAAC;QAC/P,IAAI,aAAa,EAAE;AACf,YAAA,OAAO,aAAa;;aACjB;AACH,YAAA,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;YACpE,IAAI,kBAAkB,EAAE;AACpB,gBAAA,OAAO,kBAAkB;;iBACtB;AACH,gBAAA,UAAU,CAAC,YAAY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