@softpak/components 19.19.0 → 19.21.0-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/fesm2022/softpak-components-spx-alert.mjs +7 -6
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-expiry.mjs +23 -91
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +8 -22
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-card.mjs +17 -88
- package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +59 -104
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +24 -28
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +8 -33
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +39 -53
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +15 -6
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +34 -89
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +91 -198
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pagination.mjs +12 -21
- package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +8 -39
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-progress-bar.mjs +8 -22
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +15 -160
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +71 -128
- package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +35 -162
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +3 -3
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation.mjs +56 -55
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/package.json +23 -23
- package/spx-alert/spx-alert.component.d.ts +1 -1
- package/spx-app-expiry/spx-app-expiry.component.d.ts +14 -14
- package/spx-button/spx-button.component.d.ts +0 -3
- package/spx-card/spx-card-item/spx-card-item.component.d.ts +0 -1
- package/spx-card/spx-card.component.d.ts +8 -9
- package/spx-change-details/spx-change-details.component.d.ts +23 -25
- package/spx-check-digit/spx-check-digit.component.d.ts +9 -9
- package/spx-form-section/spx-form-section.component.d.ts +5 -5
- package/spx-form-view/spx-autocomplete-search.component.d.ts +15 -16
- package/spx-form-view/spx-form-view.component.d.ts +1 -1
- package/spx-inputs/spx-input-text/spx-input-text.component.d.ts +4 -1
- package/spx-inputs/spx-input.component.d.ts +1 -0
- package/spx-navigation/public-api.d.ts +2 -2
- package/spx-navigation/spx-home-tile/spx-home-tile.component.d.ts +11 -0
- package/spx-navigation/{spx-home-tiles.component.d.ts → spx-home-tile/spx-home-tiles.component.d.ts} +2 -2
- package/spx-navigation/spx-navigation.component.d.ts +11 -8
- package/spx-number-check/spx-number-check.component.d.ts +26 -32
- package/spx-pagination/spx-pagination.component.d.ts +9 -10
- package/spx-patch/spx-patch.component.d.ts +4 -4
- package/spx-progress-bar/spx-progress-bar.component.d.ts +3 -3
- package/spx-spinner/spx-spinner.component.d.ts +3 -3
- package/spx-stock-info/spx-stock-info.component.d.ts +48 -49
- package/spx-toaster/src/spx-toaster-message.interface.d.ts +5 -1
- package/spx-toaster/src/spx-toaster.component.d.ts +6 -14
- package/spx-validation/spx-validate-control.component.d.ts +22 -20
- package/tailwind.css +1 -1
- package/spx-navigation/spx-home-tile.component.d.ts +0 -11
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { NgClass } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { input, output, Component, ChangeDetectionStrategy, model, computed } from '@angular/core';
|
|
4
3
|
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
5
4
|
import { FaIconComponent, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
6
5
|
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
@@ -8,11 +7,13 @@ import { IsSeverityPipe } from '@softpak/components/spx-pipes';
|
|
|
8
7
|
|
|
9
8
|
class SpxCardComponent {
|
|
10
9
|
constructor() {
|
|
11
|
-
this.clickable = true;
|
|
12
|
-
this.hasContent = true;
|
|
13
|
-
this.onDetailPage = false;
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
10
|
+
this.clickable = input(true);
|
|
11
|
+
this.hasContent = input(true);
|
|
12
|
+
this.onDetailPage = input(false);
|
|
13
|
+
this.text = input();
|
|
14
|
+
this.unit = input();
|
|
15
|
+
this.tableView = input(false);
|
|
16
|
+
this.clicked = output();
|
|
16
17
|
}
|
|
17
18
|
displayValue(val) {
|
|
18
19
|
return val || (val === 0) ? val : '—';
|
|
@@ -21,86 +22,15 @@ class SpxCardComponent {
|
|
|
21
22
|
this.clicked.emit();
|
|
22
23
|
}
|
|
23
24
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxCardComponent, isStandalone: true, selector: "spx-card", inputs: { clickable: "clickable", hasContent: "hasContent", onDetailPage: "onDetailPage", text: "text", unit: "unit", tableView: "tableView" }, outputs: { clicked: "clicked" }, ngImport: i0, template:
|
|
25
|
-
<button type="button"
|
|
26
|
-
class="block w-full text-left rounded font-body items-stretch"
|
|
27
|
-
[class.flex]="tableView"
|
|
28
|
-
[class.cursor-pointer]="clickable"
|
|
29
|
-
[class.cursor-not-allowed]="!clickable"
|
|
30
|
-
[class.focus:ring-2]="clickable"
|
|
31
|
-
[class.focus:ring-offset-2]="clickable"
|
|
32
|
-
[class.focus:ring-blue-500]="clickable"
|
|
33
|
-
(click)="onClick()"
|
|
34
|
-
[tabIndex]="clickable ? 0 : -1">
|
|
35
|
-
<div class="text-gray-900 opacity-90" [class.w-96]="tableView">
|
|
36
|
-
<ng-content select="[card-header]"></ng-content>
|
|
37
|
-
</div>
|
|
38
|
-
<ng-content select="[card-content-top]"></ng-content>
|
|
39
|
-
@if (hasContent) {
|
|
40
|
-
<div class="bg-white dark:bg-gray-600 p-3">
|
|
41
|
-
<ng-content select="[card-content]"></ng-content>
|
|
42
|
-
</div>
|
|
43
|
-
}
|
|
44
|
-
<ng-content select="[card-content-bottom]"></ng-content>
|
|
45
|
-
<div class="bg-gray-50 dark:bg-gray-700 p-3 grow" [class.rounded-b-lg]="!onDetailPage && !tableView" [class.rounded-r-lg]="!onDetailPage && tableView">
|
|
46
|
-
<ng-content select="[card-lines]"></ng-content>
|
|
47
|
-
</div>
|
|
48
|
-
</button>
|
|
49
|
-
`, isInline: true }); }
|
|
25
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", 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 }); }
|
|
50
26
|
}
|
|
51
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCardComponent, decorators: [{
|
|
52
28
|
type: Component,
|
|
53
|
-
args: [{
|
|
54
|
-
|
|
55
|
-
imports: [
|
|
56
|
-
NgClass
|
|
57
|
-
],
|
|
58
|
-
template: `
|
|
59
|
-
<button type="button"
|
|
60
|
-
class="block w-full text-left rounded font-body items-stretch"
|
|
61
|
-
[class.flex]="tableView"
|
|
62
|
-
[class.cursor-pointer]="clickable"
|
|
63
|
-
[class.cursor-not-allowed]="!clickable"
|
|
64
|
-
[class.focus:ring-2]="clickable"
|
|
65
|
-
[class.focus:ring-offset-2]="clickable"
|
|
66
|
-
[class.focus:ring-blue-500]="clickable"
|
|
67
|
-
(click)="onClick()"
|
|
68
|
-
[tabIndex]="clickable ? 0 : -1">
|
|
69
|
-
<div class="text-gray-900 opacity-90" [class.w-96]="tableView">
|
|
70
|
-
<ng-content select="[card-header]"></ng-content>
|
|
71
|
-
</div>
|
|
72
|
-
<ng-content select="[card-content-top]"></ng-content>
|
|
73
|
-
@if (hasContent) {
|
|
74
|
-
<div class="bg-white dark:bg-gray-600 p-3">
|
|
75
|
-
<ng-content select="[card-content]"></ng-content>
|
|
76
|
-
</div>
|
|
77
|
-
}
|
|
78
|
-
<ng-content select="[card-content-bottom]"></ng-content>
|
|
79
|
-
<div class="bg-gray-50 dark:bg-gray-700 p-3 grow" [class.rounded-b-lg]="!onDetailPage && !tableView" [class.rounded-r-lg]="!onDetailPage && tableView">
|
|
80
|
-
<ng-content select="[card-lines]"></ng-content>
|
|
81
|
-
</div>
|
|
82
|
-
</button>
|
|
83
|
-
`
|
|
84
|
-
}]
|
|
85
|
-
}], ctorParameters: () => [], propDecorators: { clickable: [{
|
|
86
|
-
type: Input
|
|
87
|
-
}], hasContent: [{
|
|
88
|
-
type: Input
|
|
89
|
-
}], onDetailPage: [{
|
|
90
|
-
type: Input
|
|
91
|
-
}], text: [{
|
|
92
|
-
type: Input
|
|
93
|
-
}], unit: [{
|
|
94
|
-
type: Input
|
|
95
|
-
}], tableView: [{
|
|
96
|
-
type: Input
|
|
97
|
-
}], clicked: [{
|
|
98
|
-
type: Output
|
|
99
|
-
}] } });
|
|
29
|
+
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>" }]
|
|
30
|
+
}], ctorParameters: () => [] });
|
|
100
31
|
|
|
101
32
|
class SpxCardItemComponent {
|
|
102
33
|
constructor() {
|
|
103
|
-
this.hFull = true;
|
|
104
34
|
this.icon = input();
|
|
105
35
|
this.iconOnly = input(false);
|
|
106
36
|
this.spxLabel = input.required();
|
|
@@ -110,18 +40,17 @@ class SpxCardItemComponent {
|
|
|
110
40
|
this.SpxSeverityEnum = SpxSeverityEnum;
|
|
111
41
|
}
|
|
112
42
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCardItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
113
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", 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": "
|
|
43
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", 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"] }, { kind: "pipe", type: IsSeverityPipe, name: "isSeverity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
114
44
|
}
|
|
115
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCardItemComponent, decorators: [{
|
|
116
46
|
type: Component,
|
|
117
47
|
args: [{ selector: 'spx-card-item', imports: [
|
|
118
48
|
FaIconComponent,
|
|
119
49
|
IsSeverityPipe
|
|
120
|
-
], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}] } });
|
|
50
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
51
|
+
'[class.h-full]': 'true',
|
|
52
|
+
}, 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>" }]
|
|
53
|
+
}] });
|
|
125
54
|
|
|
126
55
|
class SpxCardGridComponent {
|
|
127
56
|
constructor() {
|
|
@@ -155,7 +84,7 @@ class SpxCardLineComponent {
|
|
|
155
84
|
}
|
|
156
85
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCardLineComponent, decorators: [{
|
|
157
86
|
type: Component,
|
|
158
|
-
args: [{ selector: 'spx-card-line', imports: [FontAwesomeModule], changeDetection: ChangeDetectionStrategy.OnPush, 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
|
+
args: [{ selector: 'spx-card-line', imports: [FontAwesomeModule], 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>" }]
|
|
159
88
|
}] });
|
|
160
89
|
|
|
161
90
|
/**
|
|
@@ -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-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 { NgClass } from '@angular/common';\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\n\n@Component({\n selector: 'spx-card',\n imports: [\n NgClass\n ],\n template: `\n <button type=\"button\"\n class=\"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>\n `\n})\nexport class SpxCardComponent {\n @Input() clickable = true;\n @Input() hasContent = true;\n @Input() onDetailPage = false;\n @Input() text!: string;\n @Input() unit?: string;\n @Input() tableView = false;\n @Output() clicked: EventEmitter<void> = new EventEmitter<void>();\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","\nimport { ChangeDetectionStrategy, Component, HostBinding, input } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { IconProp } from '@fortawesome/angular-fontawesome/types';\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})\nexport class SpxCardItemComponent {\n @HostBinding('class.h-full') hFull = true;\n readonly icon = input<IconProp>();\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 { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { IconProp } from '@fortawesome/angular-fontawesome/types';\n\n@Component({\n selector: 'spx-card-line',\n imports: [FontAwesomeModule],\n templateUrl: './spx-card-line.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\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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IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECVjC,ohDAoCM,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED9BQ,iBAAiB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,WAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,SAAA,EAAA,QAAA,EAAA,QAAA,EAAA,YAAA,EAAA,WAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAIlB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,WAChB,CAAC,iBAAiB,CAAC,EAEX,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ohDAAA,EAAA;;;AERnD;;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 } from '@fortawesome/angular-fontawesome';\nimport { IconProp } from '@fortawesome/angular-fontawesome/types';\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<IconProp>();\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 { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { IconProp } from '@fortawesome/angular-fontawesome/types';\n\n@Component({\n selector: 'spx-card-line',\n imports: [FontAwesomeModule],\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,igCAuBS,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDfI,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAA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AA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,KAAA,EAAA,aAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECXjC,ohDAoCM,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED9BQ,iBAAiB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,WAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,SAAA,EAAA,QAAA,EAAA,QAAA,EAAA,YAAA,EAAA,WAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKlB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;+BACI,eAAe,EAAA,OAAA,EAChB,CAAC,iBAAiB,CAAC,mBAEX,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,ohDAAA,EAAA;;;AETpB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, computed, output, effect, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { SpxFormButtonTypeEnum, SpxFormViewComponent } from '@softpak/components/spx-form-view';
|
|
@@ -17,56 +17,33 @@ const ctrlLicensePlate = 'licensePlate';
|
|
|
17
17
|
const ctrlCategory = 'category';
|
|
18
18
|
const ctrlUseCategories = 'useCategories';
|
|
19
19
|
class SpxChangeDetailsComponent {
|
|
20
|
-
get suggestions() {
|
|
21
|
-
return this._suggestions;
|
|
22
|
-
}
|
|
23
|
-
set suggestions(value) {
|
|
24
|
-
this._suggestions = value;
|
|
25
|
-
if (this.suggestions?.[ctrlTonsTested] &&
|
|
26
|
-
this.suggestions?.[ctrlTonsTested].length &&
|
|
27
|
-
this.suggestions?.[ctrlTonsTested].length > 0) {
|
|
28
|
-
this.ctrlTonsTested.addValidators([spxValidatorRequired()]);
|
|
29
|
-
this.ctrlTonsTested.updateValueAndValidity();
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this.ctrlTonsTested.clearValidators();
|
|
33
|
-
this.ctrlTonsTested.updateValueAndValidity();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
get ctrlCategory() {
|
|
37
|
-
return this.formGroup.get(ctrlCategory);
|
|
38
|
-
}
|
|
39
|
-
get ctrlCustomer() {
|
|
40
|
-
return this.formGroup.get(ctrlCustomer);
|
|
41
|
-
}
|
|
42
|
-
get ctrlContainerType() {
|
|
43
|
-
return this.formGroup.get(ctrlContainerType);
|
|
44
|
-
}
|
|
45
|
-
get ctrlLicensePlate() {
|
|
46
|
-
return this.formGroup.get(ctrlLicensePlate);
|
|
47
|
-
}
|
|
48
|
-
get ctrlTonsTested() {
|
|
49
|
-
return this.formGroup?.get(ctrlTonsTested);
|
|
50
|
-
}
|
|
51
|
-
get ctrlUseCategories() {
|
|
52
|
-
return this.formGroup?.get(ctrlUseCategories);
|
|
53
|
-
}
|
|
54
20
|
constructor(formBuilder) {
|
|
55
21
|
this.formBuilder = formBuilder;
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
22
|
+
this.formGroup = input.required();
|
|
23
|
+
this.suggestions = input.required();
|
|
24
|
+
this.showTonsTested = computed(() => this.suggestions()?.[ctrlTonsTested] &&
|
|
25
|
+
this.suggestions()?.[ctrlTonsTested].length &&
|
|
26
|
+
this.suggestions()?.[ctrlTonsTested].length > 0);
|
|
27
|
+
this.textCategory = input.required();
|
|
28
|
+
this.textContainerNumber = input.required();
|
|
29
|
+
this.textContainerType = input.required();
|
|
30
|
+
this.textCustomer = input.required();
|
|
31
|
+
this.textLicensePlate = input.required();
|
|
32
|
+
this.textSave = input.required();
|
|
33
|
+
this.textTonsTested = input.required();
|
|
34
|
+
this.spxBlurCategory = output();
|
|
35
|
+
this.spxBlurContainerType = output();
|
|
36
|
+
this.spxSearchCategory = output();
|
|
37
|
+
this.spxSearchContainerType = output();
|
|
38
|
+
this.spxSearchTonsTested = output();
|
|
39
|
+
this.submit = output();
|
|
63
40
|
this.form = {
|
|
64
41
|
buttons: [
|
|
65
42
|
{
|
|
66
43
|
severity: SpxSeverityEnum.success,
|
|
67
44
|
type: SpxFormButtonTypeEnum.submit,
|
|
68
|
-
label: () => this.textSave,
|
|
69
|
-
}
|
|
45
|
+
label: () => this.textSave(),
|
|
46
|
+
}
|
|
70
47
|
],
|
|
71
48
|
sections: [
|
|
72
49
|
{
|
|
@@ -81,7 +58,7 @@ class SpxChangeDetailsComponent {
|
|
|
81
58
|
{
|
|
82
59
|
key: ctrlContainerNumber,
|
|
83
60
|
type: () => SpxInputTypeEnum.text,
|
|
84
|
-
label: () => this.textContainerNumber,
|
|
61
|
+
label: () => this.textContainerNumber(),
|
|
85
62
|
readonly: () => true,
|
|
86
63
|
validators: () => [spxValidatorRequired()],
|
|
87
64
|
},
|
|
@@ -90,28 +67,26 @@ class SpxChangeDetailsComponent {
|
|
|
90
67
|
type: () => SpxInputTypeEnum.text,
|
|
91
68
|
capitalize: () => true,
|
|
92
69
|
readonly: () => true,
|
|
93
|
-
label: () => this.textCustomer,
|
|
70
|
+
label: () => this.textCustomer(),
|
|
94
71
|
validators: () => [spxValidatorRequired()],
|
|
95
72
|
},
|
|
96
73
|
{
|
|
97
74
|
key: ctrlContainerType,
|
|
98
75
|
type: () => SpxInputTypeEnum.autocomplete,
|
|
99
|
-
label: () => this.textContainerType,
|
|
76
|
+
label: () => this.textContainerType(),
|
|
100
77
|
capitalize: () => true,
|
|
101
78
|
validators: () => [spxValidatorRequired()],
|
|
102
79
|
},
|
|
103
80
|
{
|
|
104
81
|
key: ctrlTonsTested,
|
|
105
82
|
type: () => SpxInputTypeEnum.radio,
|
|
106
|
-
label: () => this.textTonsTested,
|
|
107
|
-
show: () => this.
|
|
108
|
-
this.suggestions?.[ctrlTonsTested].length &&
|
|
109
|
-
this.suggestions?.[ctrlTonsTested].length > 0,
|
|
83
|
+
label: () => this.textTonsTested(),
|
|
84
|
+
show: () => this.showTonsTested(),
|
|
110
85
|
},
|
|
111
86
|
{
|
|
112
87
|
key: ctrlLicensePlate,
|
|
113
88
|
type: () => SpxInputTypeEnum.text,
|
|
114
|
-
label: () => this.textLicensePlate,
|
|
89
|
+
label: () => this.textLicensePlate(),
|
|
115
90
|
capitalize: () => true,
|
|
116
91
|
},
|
|
117
92
|
{
|
|
@@ -122,17 +97,31 @@ class SpxChangeDetailsComponent {
|
|
|
122
97
|
{
|
|
123
98
|
key: ctrlCategory,
|
|
124
99
|
type: () => SpxInputTypeEnum.autocomplete,
|
|
125
|
-
label: () => this.textCategory,
|
|
100
|
+
label: () => this.textCategory(),
|
|
126
101
|
capitalize: () => true,
|
|
127
|
-
show: () => valuePairToValue(this.ctrlUseCategories?.value),
|
|
128
|
-
validators: () => valuePairToValue(this.ctrlUseCategories?.value)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
],
|
|
102
|
+
show: () => valuePairToValue(this.ctrlUseCategories()?.value),
|
|
103
|
+
validators: () => valuePairToValue(this.ctrlUseCategories()?.value) ? [spxValidatorRequired()] : [],
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
]
|
|
135
108
|
};
|
|
109
|
+
this.ctrlCategory = computed(() => this.formGroup().get(ctrlCategory));
|
|
110
|
+
this.ctrlCustomer = computed(() => this.formGroup().get(ctrlCustomer));
|
|
111
|
+
this.ctrlContainerType = computed(() => this.formGroup().get(ctrlContainerType));
|
|
112
|
+
this.ctrlLicensePlate = computed(() => this.formGroup().get(ctrlLicensePlate));
|
|
113
|
+
this.ctrlTonsTested = computed(() => this.formGroup()?.get(ctrlTonsTested));
|
|
114
|
+
this.ctrlUseCategories = computed(() => this.formGroup()?.get(ctrlUseCategories));
|
|
115
|
+
effect(() => {
|
|
116
|
+
if (this.showTonsTested()) {
|
|
117
|
+
this.ctrlTonsTested().addValidators([spxValidatorRequired()]);
|
|
118
|
+
this.ctrlTonsTested().updateValueAndValidity();
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.ctrlTonsTested().clearValidators();
|
|
122
|
+
this.ctrlTonsTested().updateValueAndValidity();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
136
125
|
}
|
|
137
126
|
createForm() {
|
|
138
127
|
return SpxFormViewComponent.createForm(this.formBuilder, this.form.sections);
|
|
@@ -169,22 +158,20 @@ class SpxChangeDetailsComponent {
|
|
|
169
158
|
}
|
|
170
159
|
onSubmit() {
|
|
171
160
|
this.submit.emit({
|
|
172
|
-
category: valuePairToValue(this.ctrlUseCategories.value)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
licensePlate: this.ctrlLicensePlate.value,
|
|
177
|
-
tonsTested: this.ctrlTonsTested.value,
|
|
161
|
+
category: valuePairToValue(this.ctrlUseCategories().value) ? this.ctrlCategory().value : null,
|
|
162
|
+
containerType: this.ctrlContainerType().value,
|
|
163
|
+
licensePlate: this.ctrlLicensePlate().value,
|
|
164
|
+
tonsTested: this.ctrlTonsTested().value,
|
|
178
165
|
});
|
|
179
166
|
}
|
|
180
167
|
listenToContainerType() {
|
|
181
|
-
this.subContainerType = this.ctrlContainerType.valueChanges.subscribe(
|
|
182
|
-
this.ctrlTonsTested.setValue({ value: null });
|
|
168
|
+
this.subContainerType = this.ctrlContainerType().valueChanges.subscribe(valuePair => {
|
|
169
|
+
this.ctrlTonsTested().setValue({ value: null });
|
|
183
170
|
this.spxSearchTonsTested.emit(valuePair);
|
|
184
171
|
});
|
|
185
172
|
}
|
|
186
173
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxChangeDetailsComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
187
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
174
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: SpxChangeDetailsComponent, isStandalone: true, selector: "spx-change-details", inputs: { formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: true, transformFunction: null }, textCategory: { classPropertyName: "textCategory", publicName: "textCategory", isSignal: true, isRequired: true, transformFunction: null }, textContainerNumber: { classPropertyName: "textContainerNumber", publicName: "textContainerNumber", isSignal: true, isRequired: true, transformFunction: null }, textContainerType: { classPropertyName: "textContainerType", publicName: "textContainerType", isSignal: true, isRequired: true, transformFunction: null }, textCustomer: { classPropertyName: "textCustomer", publicName: "textCustomer", isSignal: true, isRequired: true, transformFunction: null }, textLicensePlate: { classPropertyName: "textLicensePlate", publicName: "textLicensePlate", isSignal: true, isRequired: true, transformFunction: null }, textSave: { classPropertyName: "textSave", publicName: "textSave", isSignal: true, isRequired: true, transformFunction: null }, textTonsTested: { classPropertyName: "textTonsTested", publicName: "textTonsTested", isSignal: true, isRequired: true, 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 }); }
|
|
188
175
|
}
|
|
189
176
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxChangeDetailsComponent, decorators: [{
|
|
190
177
|
type: Component,
|
|
@@ -192,40 +179,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
192
179
|
FormsModule,
|
|
193
180
|
ReactiveFormsModule,
|
|
194
181
|
SpxFormViewComponent,
|
|
195
|
-
], 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>" }]
|
|
196
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }]
|
|
197
|
-
type: Input
|
|
198
|
-
}], _suggestions: [{
|
|
199
|
-
type: Input
|
|
200
|
-
}], suggestions: [{
|
|
201
|
-
type: Input
|
|
202
|
-
}], textCategory: [{
|
|
203
|
-
type: Input
|
|
204
|
-
}], textContainerNumber: [{
|
|
205
|
-
type: Input
|
|
206
|
-
}], textContainerType: [{
|
|
207
|
-
type: Input
|
|
208
|
-
}], textCustomer: [{
|
|
209
|
-
type: Input
|
|
210
|
-
}], textLicensePlate: [{
|
|
211
|
-
type: Input
|
|
212
|
-
}], textSave: [{
|
|
213
|
-
type: Input
|
|
214
|
-
}], textTonsTested: [{
|
|
215
|
-
type: Input
|
|
216
|
-
}], spxBlurCategory: [{
|
|
217
|
-
type: Output
|
|
218
|
-
}], spxBlurContainerType: [{
|
|
219
|
-
type: Output
|
|
220
|
-
}], spxSearchCategory: [{
|
|
221
|
-
type: Output
|
|
222
|
-
}], spxSearchContainerType: [{
|
|
223
|
-
type: Output
|
|
224
|
-
}], spxSearchTonsTested: [{
|
|
225
|
-
type: Output
|
|
226
|
-
}], submit: [{
|
|
227
|
-
type: Output
|
|
228
|
-
}] } });
|
|
182
|
+
], 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>" }]
|
|
183
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }] });
|
|
229
184
|
|
|
230
185
|
/**
|
|
231
186
|
* Generated bundle index. Do not edit.
|
|
@@ -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 { Component, EventEmitter, Input, Output } 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 sectionChangeDetails = 'changeDetails';\nexport const ctrlContainerNumber = 'containerNumber';\nexport const ctrlContainerSeqNr = 'containerSeqNr';\nexport const ctrlContainerType = 'containerType';\nexport const ctrlCustomer = 'customer';\nexport const ctrlTonsTested = 'tonsTested';\nexport const ctrlLicensePlate = 'licensePlate';\nexport const ctrlCategory = 'category';\nexport const ctrlUseCategories = '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})\nexport class SpxChangeDetailsComponent {\n @Input() formGroup!: FormGroup;\n @Input()\n private _suggestions: any = {};\n public get suggestions(): any {\n return this._suggestions;\n }\n @Input() set suggestions(value: any) {\n this._suggestions = value;\n if (\n this.suggestions?.[ctrlTonsTested] &&\n this.suggestions?.[ctrlTonsTested].length &&\n this.suggestions?.[ctrlTonsTested].length > 0\n ) {\n this.ctrlTonsTested.addValidators([spxValidatorRequired()]);\n this.ctrlTonsTested.updateValueAndValidity();\n } else {\n this.ctrlTonsTested.clearValidators();\n this.ctrlTonsTested.updateValueAndValidity();\n }\n }\n @Input() textCategory!: string;\n @Input() textContainerNumber!: string;\n @Input() textContainerType!: string;\n @Input() textCustomer!: string;\n @Input() textLicensePlate!: string;\n @Input() textSave!: string;\n @Input() textTonsTested!: string;\n @Output() spxBlurCategory: EventEmitter<SpxValuePair<string>> =\n new EventEmitter<SpxValuePair<string>>();\n @Output() spxBlurContainerType: EventEmitter<SpxValuePair<string>> =\n new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchCategory: EventEmitter<SpxValuePair<string>> =\n new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchContainerType: EventEmitter<SpxValuePair<string>> =\n new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchTonsTested: EventEmitter<SpxValuePair<string>> =\n new EventEmitter<SpxValuePair<string>>();\n @Output() submit: EventEmitter<SpxChangeDetailsValueI> =\n new EventEmitter<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: sectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: ctrlContainerSeqNr,\n type: () => SpxInputTypeEnum.hidden,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textContainerNumber,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlCustomer,\n type: () => SpxInputTypeEnum.text,\n capitalize: () => true,\n readonly: () => true,\n label: () => this.textCustomer,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textContainerType,\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textTonsTested,\n show: () =>\n this.suggestions?.[ctrlTonsTested] &&\n this.suggestions?.[ctrlTonsTested].length &&\n this.suggestions?.[ctrlTonsTested].length > 0,\n },\n {\n key: ctrlLicensePlate,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textLicensePlate,\n capitalize: () => true,\n },\n {\n key: ctrlUseCategories,\n type: () => SpxInputTypeEnum.hidden,\n capitalize: () => true,\n },\n {\n key: ctrlCategory,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textCategory,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlUseCategories?.value),\n validators: () =>\n valuePairToValue(this.ctrlUseCategories?.value)\n ? [spxValidatorRequired()]\n : [],\n },\n ],\n },\n ],\n };\n\n get ctrlCategory(): FormControl {\n return this.formGroup.get(ctrlCategory) as FormControl;\n }\n get ctrlCustomer(): FormControl {\n return this.formGroup.get(ctrlCustomer) as FormControl;\n }\n get ctrlContainerType(): FormControl {\n return this.formGroup.get(ctrlContainerType) as FormControl;\n }\n get ctrlLicensePlate(): FormControl {\n return this.formGroup.get(ctrlLicensePlate) as FormControl;\n }\n get ctrlTonsTested(): FormControl {\n return this.formGroup?.get(ctrlTonsTested) as FormControl;\n }\n get ctrlUseCategories(): FormControl {\n return this.formGroup?.get(ctrlUseCategories) as FormControl;\n }\n\n private subContainerType?: Subscription;\n\n constructor(readonly formBuilder: FormBuilder) {}\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 if (data.field.key === ctrlCategory) {\n this.spxBlurCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxBlurContainerType.emit(data.valuePair);\n }\n }\n\n onSearch(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\n if (data.field.key === ctrlCategory) {\n this.spxSearchCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxSearchContainerType.emit(data.valuePair);\n }\n if (data.field.key === ctrlTonsTested) {\n this.spxSearchTonsTested.emit(data.valuePair);\n }\n }\n\n onSubmit(): void {\n this.submit.emit({\n category: valuePairToValue(this.ctrlUseCategories.value)\n ? this.ctrlCategory.value\n : 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(\n (valuePair) => {\n this.ctrlTonsTested.setValue({ value: null });\n this.spxSearchTonsTested.emit(valuePair);\n }\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":";;;;;;;;;AAeO,MAAM,oBAAoB,GAAG;AAC7B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,iBAAiB,GAAG;AAC1B,MAAM,YAAY,GAAG;AACrB,MAAM,cAAc,GAAG;AACvB,MAAM,gBAAgB,GAAG;AACzB,MAAM,YAAY,GAAG;AACrB,MAAM,iBAAiB,GAAG;MAWpB,yBAAyB,CAAA;AAIpC,IAAA,IAAW,WAAW,GAAA;QACpB,OAAO,IAAI,CAAC,YAAY;;IAE1B,IAAa,WAAW,CAAC,KAAU,EAAA;AACjC,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK;AACzB,QAAA,IACE,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC;AAClC,YAAA,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC,CAAC,MAAM;YACzC,IAAI,CAAC,WAAW,GAAG,cAAc,CAAC,CAAC,M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AAA,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,CAAA,CAAA;;2FAGf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBATrC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAErB,OAAA,EAAA;wBACL,WAAW;wBACX,mBAAmB;wBACnB,oBAAoB;AACvB,qBAAA,EAAA,QAAA,EAAA,mUAAA,EAAA;gFAGM,SAAS,EAAA,CAAA;sBAAjB;gBAEO,YAAY,EAAA,CAAA;sBADnB;gBAKY,WAAW,EAAA,CAAA;sBAAvB;gBAcQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,mBAAmB,EAAA,CAAA;sBAA3B;gBACQ,iBAAiB,EAAA,CAAA;sBAAzB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACS,eAAe,EAAA,CAAA;sBAAxB;gBAES,oBAAoB,EAAA,CAAA;sBAA7B;gBAES,iBAAiB,EAAA,CAAA;sBAA1B;gBAES,sBAAsB,EAAA,CAAA;sBAA/B;gBAES,mBAAmB,EAAA,CAAA;sBAA5B;gBAES,MAAM,EAAA,CAAA;sBAAf;;;AExEH;;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, EventEmitter, Input, Output } 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 sectionChangeDetails = 'changeDetails';\nexport const ctrlContainerNumber = 'containerNumber';\nexport const ctrlContainerSeqNr = 'containerSeqNr';\nexport const ctrlContainerType = 'containerType';\nexport const ctrlCustomer = 'customer';\nexport const ctrlTonsTested = 'tonsTested';\nexport const ctrlLicensePlate = 'licensePlate';\nexport const ctrlCategory = 'category';\nexport const ctrlUseCategories = '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.required<FormGroup>();\n readonly suggestions = input.required<any>();\n private readonly showTonsTested = computed(() =>\n this.suggestions()?.[ctrlTonsTested] &&\n this.suggestions()?.[ctrlTonsTested].length &&\n this.suggestions()?.[ctrlTonsTested].length > 0\n );\n readonly textCategory = input.required<string>();\n readonly textContainerNumber = input.required<string>();\n readonly textContainerType = input.required<string>();\n readonly textCustomer = input.required<string>();\n readonly textLicensePlate = input.required<string>();\n readonly textSave = input.required<string>();\n readonly textTonsTested = input.required<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: sectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: ctrlContainerSeqNr,\n type: () => SpxInputTypeEnum.hidden,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textContainerNumber(),\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlCustomer,\n type: () => SpxInputTypeEnum.text,\n capitalize: () => true,\n readonly: () => true,\n label: () => this.textCustomer(),\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textContainerType(),\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textTonsTested(),\n show: () => this.showTonsTested(),\n },\n {\n key: ctrlLicensePlate,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textLicensePlate(),\n capitalize: () => true,\n },\n {\n key: ctrlUseCategories,\n type: () => SpxInputTypeEnum.hidden,\n capitalize: () => true,\n },\n {\n key: ctrlCategory,\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(ctrlCategory) as FormControl);\n readonly ctrlCustomer = computed(() => this.formGroup().get(ctrlCustomer) as FormControl);\n readonly ctrlContainerType = computed(() => this.formGroup().get(ctrlContainerType) as FormControl);\n readonly ctrlLicensePlate = computed(() => this.formGroup().get(ctrlLicensePlate) as FormControl);\n readonly ctrlTonsTested = computed(() => this.formGroup()?.get(ctrlTonsTested) as FormControl);\n readonly ctrlUseCategories = computed(() => this.formGroup()?.get(ctrlUseCategories) 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 if (data.field.key === ctrlCategory) {\n this.spxBlurCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxBlurContainerType.emit(data.valuePair);\n }\n }\n\n onSearch(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\n if (data.field.key === ctrlCategory) {\n this.spxSearchCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxSearchContainerType.emit(data.valuePair);\n }\n if (data.field.key === ctrlTonsTested) {\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,oBAAoB,GAAG;AAC7B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,iBAAiB,GAAG;AAC1B,MAAM,YAAY,GAAG;AACrB,MAAM,cAAc,GAAG;AACvB,MAAM,gBAAgB,GAAG;AACzB,MAAM,YAAY,GAAG;AACrB,MAAM,iBAAiB,GAAG;MAapB,yBAAyB,CAAA;AAqGpC,IAAA,WAAA,CAAqB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;AApGvB,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAa;AACvC,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAO;AAC3B,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MACzC,IAAI,CAAC,WAAW,EAAE,GAAG,cAAc,CAAC;YACpC,IAAI,CAAC,WAAW,EAAE,GAAG,cAAc,CAAC,CAAC,MAAM;AAC3C,YAAA,IAAI,CAAC,WAAW,EAAE,GAAG,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,CAChD;AACQ,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAU;AACvC,QAAA,IAAA,CAAA,mBAAmB,GAAG,KAAK,CAAC,QAAQ,EAAU;AAC9C,QAAA,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAC,QAAQ,EAAU;AAC5C,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC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