@softpak/components 19.17.0-beta.3 → 19.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/softpak-components-spx-alert.mjs +6 -7
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-expiry.mjs +91 -23
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +22 -8
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-card.mjs +88 -17
- package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +64 -48
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +27 -23
- 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 +33 -8
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +53 -39
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +6 -15
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +89 -34
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +198 -91
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pagination.mjs +21 -12
- package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +39 -8
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-progress-bar.mjs +22 -8
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +160 -15
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +128 -71
- package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +162 -35
- 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 +54 -68
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/package.json +9 -9
- 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 +3 -0
- package/spx-card/spx-card-item/spx-card-item.component.d.ts +1 -0
- package/spx-card/spx-card.component.d.ts +9 -8
- package/spx-change-details/spx-change-details.component.d.ts +23 -22
- 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 +16 -15
- package/spx-form-view/spx-form-view.component.d.ts +1 -1
- package/spx-inputs/spx-input-text/spx-input-text.component.d.ts +1 -4
- package/spx-inputs/spx-input.component.d.ts +0 -1
- package/spx-navigation/public-api.d.ts +2 -2
- package/spx-navigation/spx-home-tile.component.d.ts +11 -0
- package/spx-navigation/{spx-home-tile/spx-home-tiles.component.d.ts → spx-home-tiles.component.d.ts} +2 -2
- package/spx-navigation/spx-navigation.component.d.ts +8 -11
- package/spx-navigation/store/spx-navigation/spx-navigation.actions.d.ts +3 -3
- package/spx-number-check/spx-number-check.component.d.ts +32 -26
- package/spx-pagination/spx-pagination.component.d.ts +10 -9
- 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 +49 -48
- package/spx-toaster/src/spx-toaster-message.interface.d.ts +1 -5
- package/spx-toaster/src/spx-toaster.component.d.ts +14 -6
- package/spx-validation/spx-validate-control.component.d.ts +19 -19
- package/tailwind.css +1 -1
- package/spx-navigation/spx-home-tile/spx-home-tile.component.d.ts +0 -11
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Component, Input, ViewChild } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { combineLatest, startWith, map } from 'rxjs';
|
|
6
6
|
import { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';
|
|
7
|
-
import {
|
|
7
|
+
import { SpxInputTypeEnum, SpxInputComponent } from '@softpak/components/spx-inputs';
|
|
8
8
|
import { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, SpxValidateControlComponent } from '@softpak/components/spx-validation';
|
|
9
9
|
|
|
10
10
|
const ctrlCheckDigit = 'checkDigit';
|
|
11
11
|
const ctrlContainerNumber = 'containerNumber';
|
|
12
12
|
const ctrlPrefix = 'prefix';
|
|
13
13
|
class SpxCheckDigitComponent {
|
|
14
|
+
get ctrlCheckDigit() { return this.formGroup.get(ctrlCheckDigit); }
|
|
15
|
+
get ctrlContainerNumber() { return this.formGroup.get(ctrlContainerNumber); }
|
|
16
|
+
get ctrlContainerPrefix() { return this.formGroup.get(ctrlPrefix); }
|
|
14
17
|
constructor(formBuilder) {
|
|
15
18
|
this.formBuilder = formBuilder;
|
|
16
|
-
this.txtCheckDigit = input.required();
|
|
17
|
-
this.txtContainer = input.required();
|
|
18
|
-
this.txtPrefix = input.required();
|
|
19
|
-
this.ctrlContainerNumberRef = viewChild(SpxInputComponent);
|
|
20
19
|
this.inputTypeOverlayNumber = SpxInputTypeEnum.overlayNumber;
|
|
21
20
|
this.inputTypeText = SpxInputTypeEnum.text;
|
|
22
|
-
this.formGroup =
|
|
23
|
-
this.ctrlCheckDigit = computed(() => this.formGroup()?.get(ctrlCheckDigit));
|
|
24
|
-
this.ctrlContainerNumber = computed(() => this.formGroup()?.get(ctrlContainerNumber));
|
|
25
|
-
this.ctrlContainerPrefix = computed(() => this.formGroup()?.get(ctrlPrefix));
|
|
26
|
-
this.formGroup.set(this.formBuilder.group({
|
|
21
|
+
this.formGroup = this.formBuilder.group({
|
|
27
22
|
[ctrlCheckDigit]: [null, []],
|
|
28
23
|
[ctrlContainerNumber]: [null, [
|
|
29
24
|
spxValidatorRequired(),
|
|
@@ -37,32 +32,32 @@ class SpxCheckDigitComponent {
|
|
|
37
32
|
spxValidatorMinLength(4),
|
|
38
33
|
spxValidatorPattern(/[a-zA-Z]{4}/),
|
|
39
34
|
]],
|
|
40
|
-
})
|
|
35
|
+
});
|
|
41
36
|
}
|
|
42
37
|
ngOnInit() {
|
|
43
38
|
this.inputChanges = combineLatest([
|
|
44
|
-
this.ctrlContainerNumber
|
|
45
|
-
this.ctrlContainerPrefix
|
|
39
|
+
this.ctrlContainerNumber.valueChanges.pipe(startWith(this.ctrlContainerNumber.value)),
|
|
40
|
+
this.ctrlContainerPrefix.valueChanges.pipe(startWith(this.ctrlContainerPrefix.value)),
|
|
46
41
|
])
|
|
47
42
|
.pipe(map(([containerNumber$, prefix$]) => ({
|
|
48
43
|
containerNumber: containerNumber$,
|
|
49
44
|
prefix: prefix$
|
|
50
45
|
})))
|
|
51
46
|
.subscribe((v) => {
|
|
52
|
-
if (this.ctrlContainerNumber
|
|
53
|
-
this.ctrlCheckDigit
|
|
47
|
+
if (this.ctrlContainerNumber.invalid || this.ctrlContainerPrefix.invalid) {
|
|
48
|
+
this.ctrlCheckDigit.setValue(null, { emitEvent: false });
|
|
54
49
|
}
|
|
55
50
|
else {
|
|
56
|
-
const prefix = valuePairToValue(this.ctrlContainerPrefix
|
|
57
|
-
const containerNumber = valuePairToValue(this.ctrlContainerNumber
|
|
51
|
+
const prefix = valuePairToValue(this.ctrlContainerPrefix.value);
|
|
52
|
+
const containerNumber = valuePairToValue(this.ctrlContainerNumber.value);
|
|
58
53
|
const checkDigit = calcCheckDigit(`${prefix}${containerNumber}`);
|
|
59
|
-
this.ctrlCheckDigit
|
|
54
|
+
this.ctrlCheckDigit.setValue({ value: checkDigit }, { emitEvent: false });
|
|
60
55
|
}
|
|
61
56
|
});
|
|
62
57
|
}
|
|
63
58
|
ngAfterViewInit() {
|
|
64
59
|
setTimeout(() => {
|
|
65
|
-
this.ctrlContainerNumberRef
|
|
60
|
+
this.ctrlContainerNumberRef?.setFocusIn();
|
|
66
61
|
}, 250);
|
|
67
62
|
}
|
|
68
63
|
ngOnDestroy() {
|
|
@@ -74,7 +69,7 @@ class SpxCheckDigitComponent {
|
|
|
74
69
|
return formControl._rawValidators;
|
|
75
70
|
}
|
|
76
71
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCheckDigitComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
77
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxCheckDigitComponent, isStandalone: true, selector: "spx-check-digit", inputs: { txtCheckDigit:
|
|
72
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxCheckDigitComponent, isStandalone: true, selector: "spx-check-digit", inputs: { txtCheckDigit: "txtCheckDigit", txtContainer: "txtContainer", txtPrefix: "txtPrefix" }, viewQueries: [{ propertyName: "ctrlContainerNumberRef", first: true, predicate: ["ctrlContainerNumberRef"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber && ctrlContainerNumber.errors && ctrlContainerNumber.touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber)\">\n <spx-validate-control [control]=\"ctrlContainerNumber\" [label]=\"txtContainer\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix && ctrlContainerPrefix.errors && ctrlContainerPrefix.touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix)\">\n <spx-validate-control [control]=\"ctrlContainerPrefix\" [label]=\"txtPrefix\"></spx-validate-control>\n </spx-input>\n @if (ctrlCheckDigit.value) {\n <spx-input\n [formControl]=\"ctrlCheckDigit\"\n [spxLabel]=\"txtCheckDigit\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n }\n</form>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }] }); }
|
|
78
73
|
}
|
|
79
74
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCheckDigitComponent, decorators: [{
|
|
80
75
|
type: Component,
|
|
@@ -83,8 +78,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
83
78
|
ReactiveFormsModule,
|
|
84
79
|
SpxValidateControlComponent,
|
|
85
80
|
SpxInputComponent
|
|
86
|
-
], template: "<form [formGroup]=\"formGroup
|
|
87
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }]
|
|
81
|
+
], template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber && ctrlContainerNumber.errors && ctrlContainerNumber.touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber)\">\n <spx-validate-control [control]=\"ctrlContainerNumber\" [label]=\"txtContainer\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix && ctrlContainerPrefix.errors && ctrlContainerPrefix.touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix)\">\n <spx-validate-control [control]=\"ctrlContainerPrefix\" [label]=\"txtPrefix\"></spx-validate-control>\n </spx-input>\n @if (ctrlCheckDigit.value) {\n <spx-input\n [formControl]=\"ctrlCheckDigit\"\n [spxLabel]=\"txtCheckDigit\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n }\n</form>" }]
|
|
82
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { txtCheckDigit: [{
|
|
83
|
+
type: Input
|
|
84
|
+
}], txtContainer: [{
|
|
85
|
+
type: Input
|
|
86
|
+
}], txtPrefix: [{
|
|
87
|
+
type: Input
|
|
88
|
+
}], ctrlContainerNumberRef: [{
|
|
89
|
+
type: ViewChild,
|
|
90
|
+
args: ['ctrlContainerNumberRef']
|
|
91
|
+
}] } });
|
|
88
92
|
|
|
89
93
|
/**
|
|
90
94
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-check-digit.mjs","sources":["../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.ts","../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.html","../../../../projects/softpak/components/spx-check-digit/softpak-components-spx-check-digit.ts"],"sourcesContent":["import { Component, computed, input, signal, viewChild } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\nimport { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent, spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern } from '@softpak/components/spx-validation';\n\nconst ctrlCheckDigit = 'checkDigit';\nconst ctrlContainerNumber = 'containerNumber';\nconst ctrlPrefix = 'prefix';\n\n@Component({\n selector: 'spx-check-digit',\n templateUrl: './spx-check-digit.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxValidateControlComponent,\n SpxInputComponent\n ]\n})\nexport class SpxCheckDigitComponent {\n readonly txtCheckDigit = input.required<string>();\n readonly txtContainer = input.required<string>();\n readonly txtPrefix = input.required<string>();\n ctrlContainerNumberRef = viewChild(SpxInputComponent);\n inputTypeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n inputTypeText = SpxInputTypeEnum.text;\n formGroup = signal<FormGroup | null>(null);\n ctrlCheckDigit = computed(() => this.formGroup()?.get(ctrlCheckDigit) as FormControl);\n ctrlContainerNumber = computed(() => this.formGroup()?.get(ctrlContainerNumber) as FormControl);\n ctrlContainerPrefix = computed(() => this.formGroup()?.get(ctrlPrefix) as FormControl);\n\n private inputChanges?: Subscription;\n\n constructor(\n private readonly formBuilder: FormBuilder,\n ) {\n this.formGroup.set(this.formBuilder.group({\n [ctrlCheckDigit]: [null, []],\n [ctrlContainerNumber]: [null, [\n spxValidatorRequired(),\n spxValidatorMaxLength(6),\n spxValidatorMinLength(6),\n spxValidatorPattern(/[0-9]{6}/),\n ]],\n [ctrlPrefix]: [null, [\n spxValidatorRequired(),\n spxValidatorMaxLength(4),\n spxValidatorMinLength(4),\n spxValidatorPattern(/[a-zA-Z]{4}/),\n ]],\n }));\n }\n\n ngOnInit(): void {\n this.inputChanges = combineLatest([\n this.ctrlContainerNumber().valueChanges.pipe(startWith(this.ctrlContainerNumber().value)),\n this.ctrlContainerPrefix().valueChanges.pipe(startWith(this.ctrlContainerPrefix().value)),\n ])\n .pipe(map(([containerNumber$, prefix$]) => ({\n containerNumber: containerNumber$,\n prefix: prefix$\n })))\n .subscribe((v) => {\n if (this.ctrlContainerNumber().invalid || this.ctrlContainerPrefix().invalid) {\n this.ctrlCheckDigit().setValue(null, { emitEvent: false });\n } else {\n const prefix = valuePairToValue(this.ctrlContainerPrefix().value);\n const containerNumber = valuePairToValue(this.ctrlContainerNumber().value);\n const checkDigit = calcCheckDigit(`${prefix}${containerNumber}`);\n this.ctrlCheckDigit().setValue({ value: checkDigit }, { emitEvent: false });\n }\n });\n }\n\n ngAfterViewInit(): void {\n setTimeout(() => {\n this.ctrlContainerNumberRef()?.setFocusIn(); \n }, 250);\n }\n\n ngOnDestroy(): void {\n if (this.inputChanges) {\n this.inputChanges.unsubscribe();\n }\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n}\n","<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber()\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer()\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber() && ctrlContainerNumber().errors && ctrlContainerNumber().touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber())\">\n <spx-validate-control [control]=\"ctrlContainerNumber()\" [label]=\"txtContainer()\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix()\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix()\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix() && ctrlContainerPrefix().errors && ctrlContainerPrefix().touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix())\">\n <spx-validate-control [control]=\"ctrlContainerPrefix()\" [label]=\"txtPrefix()\"></spx-validate-control>\n </spx-input>\n @if (ctrlCheckDigit().value) {\n <spx-input\n [formControl]=\"ctrlCheckDigit()\"\n [spxLabel]=\"txtCheckDigit()\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n }\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,cAAc,GAAG,YAAY;AACnC,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,UAAU,GAAG,QAAQ;MAYd,sBAAsB,CAAA;AAcjC,IAAA,WAAA,CACmB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;AAdrB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAU;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAU;AACvC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAU;AAC7C,QAAA,IAAA,CAAA,sBAAsB,GAAG,SAAS,CAAC,iBAAiB,CAAC;AACrD,QAAA,IAAA,CAAA,sBAAsB,GAAG,gBAAgB,CAAC,aAAa;AACvD,QAAA,IAAA,CAAA,aAAa,GAAG,gBAAgB,CAAC,IAAI;AACrC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAmB,IAAI,CAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,cAAc,CAAgB,CAAC;AACrF,QAAA,IAAA,CAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,mBAAmB,CAAgB,CAAC;AAC/F,QAAA,IAAA,CAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,UAAU,CAAgB,CAAC;QAOpF,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AACxC,YAAA,CAAC,cAAc,GAA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IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,2BAA2B,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC3B,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,SAAA,EAAA,aAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,cAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,aAAA,EAAA,aAAA,EAAA,cAAA,EAAA,YAAA,EAAA,cAAA,EAAA,eAAA,EAAA,UAAA,EAAA,2BAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,eAAA,EAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,SAAA,EAAA,SAAA,EAAA,WAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGZ,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAVlC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAElB,OAAA,EAAA;wBACL,WAAW;wBACX,mBAAmB;wBACnB,2BAA2B;wBAC3B;AACH,qBAAA,EAAA,QAAA,EAAA,s4CAAA,EAAA;;;AEnBL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-check-digit.mjs","sources":["../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.ts","../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.html","../../../../projects/softpak/components/spx-check-digit/softpak-components-spx-check-digit.ts"],"sourcesContent":["import { Component, Input, ViewChild } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\nimport { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent, spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern } from '@softpak/components/spx-validation';\n\nconst ctrlCheckDigit = 'checkDigit';\nconst ctrlContainerNumber = 'containerNumber';\nconst ctrlPrefix = 'prefix';\n\n@Component({\n selector: 'spx-check-digit',\n templateUrl: './spx-check-digit.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxValidateControlComponent,\n SpxInputComponent\n ]\n})\nexport class SpxCheckDigitComponent {\n @Input() txtCheckDigit!: string;\n @Input() txtContainer!: string;\n @Input() txtPrefix!: string;\n @ViewChild('ctrlContainerNumberRef') ctrlContainerNumberRef?: SpxInputComponent;\n inputTypeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n inputTypeText = SpxInputTypeEnum.text;\n formGroup: FormGroup;\n\n get ctrlCheckDigit(): FormControl { return this.formGroup.get(ctrlCheckDigit) as FormControl; }\n get ctrlContainerNumber(): FormControl { return this.formGroup.get(ctrlContainerNumber) as FormControl; }\n get ctrlContainerPrefix(): FormControl { return this.formGroup.get(ctrlPrefix) as FormControl; }\n\n private inputChanges?: Subscription;\n\n constructor(\n private readonly formBuilder: FormBuilder,\n ) {\n this.formGroup = this.formBuilder.group({\n [ctrlCheckDigit]: [null, []],\n [ctrlContainerNumber]: [null, [\n spxValidatorRequired(),\n spxValidatorMaxLength(6),\n spxValidatorMinLength(6),\n spxValidatorPattern(/[0-9]{6}/),\n ]],\n [ctrlPrefix]: [null, [\n spxValidatorRequired(),\n spxValidatorMaxLength(4),\n spxValidatorMinLength(4),\n spxValidatorPattern(/[a-zA-Z]{4}/),\n ]],\n })\n }\n\n ngOnInit(): void {\n this.inputChanges = combineLatest([\n this.ctrlContainerNumber.valueChanges.pipe(startWith(this.ctrlContainerNumber.value)),\n this.ctrlContainerPrefix.valueChanges.pipe(startWith(this.ctrlContainerPrefix.value)),\n ])\n .pipe(map(([containerNumber$, prefix$]) => ({\n containerNumber: containerNumber$,\n prefix: prefix$\n })))\n .subscribe((v) => {\n if (this.ctrlContainerNumber.invalid || this.ctrlContainerPrefix.invalid) {\n this.ctrlCheckDigit.setValue(null, { emitEvent: false });\n } else {\n const prefix = valuePairToValue(this.ctrlContainerPrefix.value);\n const containerNumber = valuePairToValue(this.ctrlContainerNumber.value);\n const checkDigit = calcCheckDigit(`${prefix}${containerNumber}`);\n this.ctrlCheckDigit.setValue({ value: checkDigit }, { emitEvent: false });\n }\n });\n }\n\n ngAfterViewInit(): void {\n setTimeout(() => {\n this.ctrlContainerNumberRef?.setFocusIn(); \n }, 250);\n }\n\n ngOnDestroy(): void {\n if (this.inputChanges) {\n this.inputChanges.unsubscribe();\n }\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n}\n","<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber && ctrlContainerNumber.errors && ctrlContainerNumber.touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber)\">\n <spx-validate-control [control]=\"ctrlContainerNumber\" [label]=\"txtContainer\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix && ctrlContainerPrefix.errors && ctrlContainerPrefix.touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix)\">\n <spx-validate-control [control]=\"ctrlContainerPrefix\" [label]=\"txtPrefix\"></spx-validate-control>\n </spx-input>\n @if (ctrlCheckDigit.value) {\n <spx-input\n [formControl]=\"ctrlCheckDigit\"\n [spxLabel]=\"txtCheckDigit\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n }\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,cAAc,GAAG,YAAY;AACnC,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,UAAU,GAAG,QAAQ;MAYd,sBAAsB,CAAA;AASjC,IAAA,IAAI,cAAc,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAgB,CAAC;AAC7F,IAAA,IAAI,mBAAmB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAgB,CAAC;AACvG,IAAA,IAAI,mBAAmB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAgB,CAAC;AAI9F,IAAA,WAAA,CACmB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;AAX9B,QAAA,IAAA,CAAA,sBAAsB,GAAG,gBAAgB,CAAC,aAAa;AACvD,QAAA,IAAA,CAAA,aAAa,GAAG,gBAAgB,CAAC,IAAI;QAYnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AACtC,YAAA,CAAC,cAAc,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;AAC5B,YAAA,CAAC,mBAAmB,GAAG,CAAC,IAAI,EAAE;AAC5B,oBAAA,oBAAoB,EAAE;oBACtB,qBAAqB,CAAC,CAAC,CAAC;oBACxB,qBAAqB,CAAC,CAAC,CAAC;oBACxB,mBAAmB,CAAC,UAAU,CAAC;iBAChC,CAAC;AACF,YAAA,CAAC,UAAU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EzBrC;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black dark:text-white\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createAction, props, union } from '@ngrx/store';\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const answer = createAction('[Confirm] Answer', props<{\n cancel?: boolean;\n confirm?: boolean;\n id: string;\n}>());\nexport const reset = createAction('[Confirm] Reset', props<Record<string, unknown>>());\nexport const show = createAction('[Confirm] Show', props<SpxConfirmI>());\n\nexport const answerConfirm = createAction('[Confirm] Answer Confirm', props<{\n id: string;\n}>());\n\nconst all = union({\n reset,\n show,\n answerConfirm,\n});\nexport type Actions = typeof all;\n","import * as actions from './spx-confirm.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n actions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n actions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n actions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Observable } from 'rxjs';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\nimport { Injectable } from '@angular/core';\nimport * as actions from './spx-confirm.actions';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\nimport { Store } from '@ngrx/store';\nimport spxConfirmReducer from './spx-confirm.reducer';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(actions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n actions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({})\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmActions.answer","actions.reset","actions.show","actions.answerConfirm","actions.answer","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAU;QAC7B,IAAS,CAAA,SAAA,GAAG,MAAM,EAAU;QAC5B,IAAU,CAAA,UAAA,GAAG,MAAM,EAAU;QAC7B,IAAO,CAAA,OAAA,GAAG,OAAO;AACjB,QAAA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AAQ;AAtB3B,QAAA,IAAA,CAAA,SAAS,GAAoB,YAAY,CAAC,MACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAChB,MAAM,CAACC,MAAc,CAAC,EACtB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAACC,mBAAiB,CAAC,cAAc,CAAC,CAAC,EACtE,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAI;AAE9B,YAAA,IAAI,MAAM,CAAC,OAAO,EAAE;gBAClB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI;;AAEpD,YAAA,IAAI,MAAM,CAAC,MAAM,EAAE;gBACjB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,QAAQ,IAAI;;YAExD,OAAO;gBACLF,aAAqB,CAAC,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAC,CAAC;AACtC,gBAAA,iBAAiB,CAAC,IAAI,CAAC,EAAE;aAC1B;SACF,CAAC,CACH,CACF;;8GAnBU,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAG,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,EAAA,CAAA,KAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;;;;;;ACTD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black dark:text-white\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store, select } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createAction, props, union } from '@ngrx/store';\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const answer = createAction('[Confirm] Answer', props<{\n cancel?: boolean;\n confirm?: boolean;\n id: string;\n}>());\nexport const reset = createAction('[Confirm] Reset', props<Record<string, unknown>>());\nexport const show = createAction('[Confirm] Show', props<SpxConfirmI>());\n\nexport const answerConfirm = createAction('[Confirm] Answer Confirm', props<{\n id: string;\n}>());\n\nconst all = union({\n reset,\n show,\n answerConfirm,\n});\nexport type Actions = typeof all;\n","import * as actions from './spx-confirm.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n actions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n actions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n actions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Observable } from 'rxjs';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\nimport { Injectable } from '@angular/core';\nimport * as actions from './spx-confirm.actions';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\nimport { Store } from '@ngrx/store';\nimport spxConfirmReducer from './spx-confirm.reducer';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(actions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n actions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({})\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmActions.answer","actions.reset","actions.show","actions.answerConfirm","actions.answer","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAU;QAC7B,IAAS,CAAA,SAAA,GAAG,MAAM,EAAU;QAC5B,IAAU,CAAA,UAAA,GAAG,MAAM,EAAU;QAC7B,IAAO,CAAA,OAAA,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAAe,CAAC,OAAO;;IAIzC,QAAQ,GAAA;QACN,IAAI,CAAC,SAAS,CA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c,CAAC,CAAC,EACtE,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAI;AAE9B,YAAA,IAAI,MAAM,CAAC,OAAO,EAAE;gBAClB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI;;AAEpD,YAAA,IAAI,MAAM,CAAC,MAAM,EAAE;gBACjB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,QAAQ,IAAI;;YAExD,OAAO;gBACLF,aAAqB,CAAC,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAC,CAAC;AACtC,gBAAA,iBAAiB,CAAC,IAAI,CAAC,EAAE;aAC1B;SACF,CAAC,CACH,CACF;;8GAnBU,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAG,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,EAAA,CAAA,KAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;;;;;;ACTD;;AAEG;;;;"}
|
|
@@ -1,20 +1,45 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class SpxFormSectionComponent {
|
|
5
5
|
constructor() {
|
|
6
|
-
this.
|
|
7
|
-
this.spxIndexSecondary = input();
|
|
8
|
-
this.spxTitle = input();
|
|
9
|
-
this.spxShowTitle = input(true);
|
|
6
|
+
this.spxShowTitle = true;
|
|
10
7
|
}
|
|
11
8
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxFormSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxFormSectionComponent, isStandalone: true, selector: "spx-form-section", inputs: { spxIndex:
|
|
9
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxFormSectionComponent, isStandalone: true, selector: "spx-form-section", inputs: { spxIndex: "spxIndex", spxIndexSecondary: "spxIndexSecondary", spxTitle: "spxTitle", spxShowTitle: "spxShowTitle" }, ngImport: i0, template: `@if (this.spxShowTitle) {
|
|
10
|
+
<div class="spx-form-section__title mb-3 flex gap-3 items-center">
|
|
11
|
+
<div class="spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded">{{this.spxIndex}}@if (this.spxIndexSecondary) {
|
|
12
|
+
{{ this.spxIndexSecondary }}
|
|
13
|
+
}</div>
|
|
14
|
+
<div class="spx-form-section__content font-bold grow text-black dark:text-white">{{this.spxTitle}}</div>
|
|
15
|
+
</div>
|
|
16
|
+
}
|
|
17
|
+
<div class="flex flex-col gap-3">
|
|
18
|
+
<ng-content></ng-content>
|
|
19
|
+
</div>`, isInline: true, styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13
20
|
}
|
|
14
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxFormSectionComponent, decorators: [{
|
|
15
22
|
type: Component,
|
|
16
|
-
args: [{ selector: 'spx-form-section', imports: [], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
17
|
-
|
|
23
|
+
args: [{ selector: 'spx-form-section', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: `@if (this.spxShowTitle) {
|
|
24
|
+
<div class="spx-form-section__title mb-3 flex gap-3 items-center">
|
|
25
|
+
<div class="spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded">{{this.spxIndex}}@if (this.spxIndexSecondary) {
|
|
26
|
+
{{ this.spxIndexSecondary }}
|
|
27
|
+
}</div>
|
|
28
|
+
<div class="spx-form-section__content font-bold grow text-black dark:text-white">{{this.spxTitle}}</div>
|
|
29
|
+
</div>
|
|
30
|
+
}
|
|
31
|
+
<div class="flex flex-col gap-3">
|
|
32
|
+
<ng-content></ng-content>
|
|
33
|
+
</div>`, styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"] }]
|
|
34
|
+
}], propDecorators: { spxIndex: [{
|
|
35
|
+
type: Input
|
|
36
|
+
}], spxIndexSecondary: [{
|
|
37
|
+
type: Input
|
|
38
|
+
}], spxTitle: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}], spxShowTitle: [{
|
|
41
|
+
type: Input
|
|
42
|
+
}] } });
|
|
18
43
|
|
|
19
44
|
/**
|
|
20
45
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-form-section.mjs","sources":["../../../../projects/softpak/components/spx-form-section/spx-form-section.component.ts","../../../../projects/softpak/components/spx-form-section/
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-form-section.mjs","sources":["../../../../projects/softpak/components/spx-form-section/spx-form-section.component.ts","../../../../projects/softpak/components/spx-form-section/softpak-components-spx-form-section.ts"],"sourcesContent":["\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\n@Component({\n selector: 'spx-form-section',\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `@if (this.spxShowTitle) {\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex}}@if (this.spxIndexSecondary) {\n {{ this.spxIndexSecondary }}\n }</div>\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle}}</div>\n </div>\n}\n<div class=\"flex flex-col gap-3\">\n <ng-content></ng-content>\n</div>`,\n styles: `\n :host {\n display: block;\n }\n \n .spx-form-section__title-index {\n background-color: #000000;\n display: inline-block;\n vertical-align: middle;\n }\n\n .spx-form-section__title {\n color: var(--spx-form-section--color, #FFFFFF);\n }\n\n .spx-form-section__content {\n color: #000000;\n }\n\n @media (prefers-color-scheme: dark) {\n .spx-form-section__title-index {\n background-color: var(--spx-form-section--color, #FFFFFF);\n color: #000000;\n }\n \n .spx-form-section__content {\n color: var(--spx-form-section--color, #FFFFFF);\n }\n}\n `\n})\nexport class SpxFormSectionComponent {\n @Input() spxIndex?: number;\n @Input() spxIndexSecondary?: number;\n @Input() spxTitle?: string;\n @Input() spxShowTitle = true;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAiDa,uBAAuB,CAAA;AA9CpC,IAAA,WAAA,GAAA;QAkDW,IAAY,CAAA,YAAA,GAAG,IAAI;AAC7B;8GALY,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UA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