@softpak/components 20.6.2 → 20.6.3
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.
|
@@ -2,10 +2,10 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, viewChild, signal, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { combineLatest, startWith, map } from 'rxjs';
|
|
6
|
-
import { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';
|
|
7
5
|
import { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';
|
|
8
6
|
import { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, SpxValidateControlComponent } from '@softpak/components/spx-validation';
|
|
7
|
+
import { combineLatest, startWith, map } from 'rxjs';
|
|
8
|
+
import { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';
|
|
9
9
|
|
|
10
10
|
const ctrlCheckDigit = 'checkDigit';
|
|
11
11
|
const ctrlContainerNumber = 'containerNumber';
|
|
@@ -17,12 +17,27 @@ class SpxCheckDigitComponent {
|
|
|
17
17
|
this.txtContainer = input.required(...(ngDevMode ? [{ debugName: "txtContainer" }] : []));
|
|
18
18
|
this.txtPrefix = input.required(...(ngDevMode ? [{ debugName: "txtPrefix" }] : []));
|
|
19
19
|
this.ctrlContainerNumberRef = viewChild(SpxInputComponent, ...(ngDevMode ? [{ debugName: "ctrlContainerNumberRef" }] : []));
|
|
20
|
-
this.
|
|
20
|
+
this.inputTypeCycleNumeric = SpxInputTypeEnum.cycleNumeric;
|
|
21
|
+
this.inputTypeCycle = SpxInputTypeEnum.cycle;
|
|
21
22
|
this.inputTypeText = SpxInputTypeEnum.text;
|
|
22
23
|
this.formGroup = signal(null, ...(ngDevMode ? [{ debugName: "formGroup" }] : []));
|
|
23
24
|
this.ctrlCheckDigit = computed(() => this.formGroup()?.get(ctrlCheckDigit), ...(ngDevMode ? [{ debugName: "ctrlCheckDigit" }] : []));
|
|
24
25
|
this.ctrlContainerNumber = computed(() => this.formGroup()?.get(ctrlContainerNumber), ...(ngDevMode ? [{ debugName: "ctrlContainerNumber" }] : []));
|
|
25
26
|
this.ctrlContainerPrefix = computed(() => this.formGroup()?.get(ctrlPrefix), ...(ngDevMode ? [{ debugName: "ctrlContainerPrefix" }] : []));
|
|
27
|
+
this.containerNumberCycleConfig = {
|
|
28
|
+
defaultFocusPosition: 3,
|
|
29
|
+
fieldPattern: '[0-9]*',
|
|
30
|
+
focusOrder: [3, 4, 5, 6, 0, 1, 2],
|
|
31
|
+
length: 7,
|
|
32
|
+
requiredPositions: [false, false, false, true, true, true, true]
|
|
33
|
+
};
|
|
34
|
+
this.containerPrefixCycleConfig = {
|
|
35
|
+
defaultFocusPosition: 0,
|
|
36
|
+
fieldPattern: '[a-zA-Z]*',
|
|
37
|
+
focusOrder: [0, 1, 2, 3],
|
|
38
|
+
length: 4,
|
|
39
|
+
requiredPositions: [true, true, true, true]
|
|
40
|
+
};
|
|
26
41
|
this.formGroup.set(this.formBuilder.group({
|
|
27
42
|
[ctrlCheckDigit]: [null, []],
|
|
28
43
|
[ctrlContainerNumber]: [null, [
|
|
@@ -74,7 +89,7 @@ class SpxCheckDigitComponent {
|
|
|
74
89
|
return formControl._rawValidators;
|
|
75
90
|
}
|
|
76
91
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxCheckDigitComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
77
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: SpxCheckDigitComponent, isStandalone: true, selector: "spx-check-digit", inputs: { txtCheckDigit: { classPropertyName: "txtCheckDigit", publicName: "txtCheckDigit", isSignal: true, isRequired: true, transformFunction: null }, txtContainer: { classPropertyName: "txtContainer", publicName: "txtContainer", isSignal: true, isRequired: true, transformFunction: null }, txtPrefix: { classPropertyName: "txtPrefix", publicName: "txtPrefix", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "ctrlContainerNumberRef", first: true, predicate: SpxInputComponent, descendants: true, isSignal: 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]=\"
|
|
92
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: SpxCheckDigitComponent, isStandalone: true, selector: "spx-check-digit", inputs: { txtCheckDigit: { classPropertyName: "txtCheckDigit", publicName: "txtCheckDigit", isSignal: true, isRequired: true, transformFunction: null }, txtContainer: { classPropertyName: "txtContainer", publicName: "txtContainer", isSignal: true, isRequired: true, transformFunction: null }, txtPrefix: { classPropertyName: "txtPrefix", publicName: "txtPrefix", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "ctrlContainerNumberRef", first: true, predicate: SpxInputComponent, descendants: true, isSignal: 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]=\"inputTypeCycleNumeric\"\n [spxCycleConfig]=\"containerNumberCycleConfig\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber())\">\n <spx-validate-control [errors]=\"ctrlContainerNumber().errors\" [touched]=\"ctrlContainerNumber().touched\" [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]=\"inputTypeCycle\"\n [spxCycleConfig]=\"containerPrefixCycleConfig\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix())\">\n <spx-validate-control [errors]=\"ctrlContainerPrefix().errors\" [touched]=\"ctrlContainerPrefix().touched\" [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: SpxInputComponent, selector: "spx-input", inputs: ["spxSpeedDial", "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", "spxCycleConfig"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried", "errors", "touched"] }] }); }
|
|
78
93
|
}
|
|
79
94
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxCheckDigitComponent, decorators: [{
|
|
80
95
|
type: Component,
|
|
@@ -83,7 +98,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
|
|
|
83
98
|
ReactiveFormsModule,
|
|
84
99
|
SpxInputComponent,
|
|
85
100
|
SpxValidateControlComponent,
|
|
86
|
-
], 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]=\"
|
|
101
|
+
], 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]=\"inputTypeCycleNumeric\"\n [spxCycleConfig]=\"containerNumberCycleConfig\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber())\">\n <spx-validate-control [errors]=\"ctrlContainerNumber().errors\" [touched]=\"ctrlContainerNumber().touched\" [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]=\"inputTypeCycle\"\n [spxCycleConfig]=\"containerPrefixCycleConfig\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix())\">\n <spx-validate-control [errors]=\"ctrlContainerPrefix().errors\" [touched]=\"ctrlContainerPrefix().touched\" [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>" }]
|
|
87
102
|
}], ctorParameters: () => [{ type: i1.FormBuilder }] });
|
|
88
103
|
|
|
89
104
|
/**
|
|
@@ -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 { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, SpxValidateControlComponent } 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 SpxInputComponent,\n SpxValidateControlComponent,\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 [errors]=\"ctrlContainerNumber().errors\" [touched]=\"ctrlContainerNumber().touched\" [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 [errors]=\"ctrlContainerPrefix().errors\" [touched]=\"ctrlContainerPrefix().touched\" [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,IAAA,CAAA,WAAW,GAAX,WAAW;AAdrB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,wDAAU;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,uDAAU;AACvC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,oDAAU;AAC7C,QAAA,IAAA,CAAA,sBAAsB,GAAG,SAAS,CAAC,iBAAiB,kEAAC;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,qDAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,cAAc,CAAgB,0DAAC;AACrF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jB,2BAA2B;AAC9B,qBAAA,EAAA,QAAA,EAAA,kjDAAA,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, computed, input, signal, viewChild } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxCycleConfig, SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\nimport { calcCheckDigit, valuePairToValue } from '@softpak/components/spx-helpers';\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 SpxInputComponent,\n SpxValidateControlComponent,\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 protected readonly inputTypeCycleNumeric = SpxInputTypeEnum.cycleNumeric;\n protected readonly inputTypeCycle = SpxInputTypeEnum.cycle;\n protected readonly 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 protected readonly containerNumberCycleConfig: SpxCycleConfig = {\n defaultFocusPosition: 3,\n fieldPattern: '[0-9]*',\n focusOrder: [3, 4, 5, 6, 0, 1, 2],\n length: 7,\n requiredPositions: [false, false, false, true, true, true, true]\n };\n protected readonly containerPrefixCycleConfig: SpxCycleConfig = {\n defaultFocusPosition: 0,\n fieldPattern: '[a-zA-Z]*',\n focusOrder: [0, 1, 2, 3],\n length: 4,\n requiredPositions: [true, true, true, true]\n };\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]=\"inputTypeCycleNumeric\"\n [spxCycleConfig]=\"containerNumberCycleConfig\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber())\">\n <spx-validate-control [errors]=\"ctrlContainerNumber().errors\" [touched]=\"ctrlContainerNumber().touched\" [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]=\"inputTypeCycle\"\n [spxCycleConfig]=\"containerPrefixCycleConfig\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix())\">\n <spx-validate-control [errors]=\"ctrlContainerPrefix().errors\" [touched]=\"ctrlContainerPrefix().touched\" [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":";;;;;;;;;AA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A,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGlB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAVlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,OAAA,EAElB;wBACP,WAAW;wBACX,mBAAmB;wBACnB,iBAAiB;wBACjB,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,4pDAAA,EAAA;;;AEnBH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softpak/components",
|
|
3
|
-
"version": "20.6.
|
|
3
|
+
"version": "20.6.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "20.x.x",
|
|
@@ -36,14 +36,6 @@
|
|
|
36
36
|
"types": "./spx-404-page/index.d.ts",
|
|
37
37
|
"default": "./fesm2022/softpak-components-spx-404-page.mjs"
|
|
38
38
|
},
|
|
39
|
-
"./spx-app-configuration": {
|
|
40
|
-
"types": "./spx-app-configuration/index.d.ts",
|
|
41
|
-
"default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
|
|
42
|
-
},
|
|
43
|
-
"./spx-app-expiry": {
|
|
44
|
-
"types": "./spx-app-expiry/index.d.ts",
|
|
45
|
-
"default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
|
|
46
|
-
},
|
|
47
39
|
"./spx-alert": {
|
|
48
40
|
"types": "./spx-alert/index.d.ts",
|
|
49
41
|
"default": "./fesm2022/softpak-components-spx-alert.mjs"
|
|
@@ -56,30 +48,34 @@
|
|
|
56
48
|
"types": "./spx-capitalize/index.d.ts",
|
|
57
49
|
"default": "./fesm2022/softpak-components-spx-capitalize.mjs"
|
|
58
50
|
},
|
|
51
|
+
"./spx-card": {
|
|
52
|
+
"types": "./spx-card/index.d.ts",
|
|
53
|
+
"default": "./fesm2022/softpak-components-spx-card.mjs"
|
|
54
|
+
},
|
|
59
55
|
"./spx-change-details": {
|
|
60
56
|
"types": "./spx-change-details/index.d.ts",
|
|
61
57
|
"default": "./fesm2022/softpak-components-spx-change-details.mjs"
|
|
62
58
|
},
|
|
63
|
-
"./spx-
|
|
64
|
-
"types": "./spx-
|
|
65
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
59
|
+
"./spx-app-configuration": {
|
|
60
|
+
"types": "./spx-app-configuration/index.d.ts",
|
|
61
|
+
"default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
|
|
62
|
+
},
|
|
63
|
+
"./spx-app-expiry": {
|
|
64
|
+
"types": "./spx-app-expiry/index.d.ts",
|
|
65
|
+
"default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
|
|
66
66
|
},
|
|
67
67
|
"./spx-channel-selection": {
|
|
68
68
|
"types": "./spx-channel-selection/index.d.ts",
|
|
69
69
|
"default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
|
|
70
70
|
},
|
|
71
|
-
"./spx-
|
|
72
|
-
"types": "./spx-
|
|
73
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
71
|
+
"./spx-check-digit": {
|
|
72
|
+
"types": "./spx-check-digit/index.d.ts",
|
|
73
|
+
"default": "./fesm2022/softpak-components-spx-check-digit.mjs"
|
|
74
74
|
},
|
|
75
75
|
"./spx-confirm": {
|
|
76
76
|
"types": "./spx-confirm/index.d.ts",
|
|
77
77
|
"default": "./fesm2022/softpak-components-spx-confirm.mjs"
|
|
78
78
|
},
|
|
79
|
-
"./spx-helpers": {
|
|
80
|
-
"types": "./spx-helpers/index.d.ts",
|
|
81
|
-
"default": "./fesm2022/softpak-components-spx-helpers.mjs"
|
|
82
|
-
},
|
|
83
79
|
"./spx-form-section": {
|
|
84
80
|
"types": "./spx-form-section/index.d.ts",
|
|
85
81
|
"default": "./fesm2022/softpak-components-spx-form-section.mjs"
|
|
@@ -88,6 +84,14 @@
|
|
|
88
84
|
"types": "./spx-form-view/index.d.ts",
|
|
89
85
|
"default": "./fesm2022/softpak-components-spx-form-view.mjs"
|
|
90
86
|
},
|
|
87
|
+
"./spx-helpers": {
|
|
88
|
+
"types": "./spx-helpers/index.d.ts",
|
|
89
|
+
"default": "./fesm2022/softpak-components-spx-helpers.mjs"
|
|
90
|
+
},
|
|
91
|
+
"./spx-inputs": {
|
|
92
|
+
"types": "./spx-inputs/index.d.ts",
|
|
93
|
+
"default": "./fesm2022/softpak-components-spx-inputs.mjs"
|
|
94
|
+
},
|
|
91
95
|
"./spx-navigation": {
|
|
92
96
|
"types": "./spx-navigation/index.d.ts",
|
|
93
97
|
"default": "./fesm2022/softpak-components-spx-navigation.mjs"
|
|
@@ -100,26 +104,22 @@
|
|
|
100
104
|
"types": "./spx-pagination/index.d.ts",
|
|
101
105
|
"default": "./fesm2022/softpak-components-spx-pagination.mjs"
|
|
102
106
|
},
|
|
103
|
-
"./spx-
|
|
104
|
-
"types": "./spx-
|
|
105
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
107
|
+
"./spx-pipes": {
|
|
108
|
+
"types": "./spx-pipes/index.d.ts",
|
|
109
|
+
"default": "./fesm2022/softpak-components-spx-pipes.mjs"
|
|
106
110
|
},
|
|
107
111
|
"./spx-patch": {
|
|
108
112
|
"types": "./spx-patch/index.d.ts",
|
|
109
113
|
"default": "./fesm2022/softpak-components-spx-patch.mjs"
|
|
110
114
|
},
|
|
111
|
-
"./spx-
|
|
112
|
-
"types": "./spx-
|
|
113
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
115
|
+
"./spx-progress-bar": {
|
|
116
|
+
"types": "./spx-progress-bar/index.d.ts",
|
|
117
|
+
"default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
|
|
114
118
|
},
|
|
115
119
|
"./spx-spinner": {
|
|
116
120
|
"types": "./spx-spinner/index.d.ts",
|
|
117
121
|
"default": "./fesm2022/softpak-components-spx-spinner.mjs"
|
|
118
122
|
},
|
|
119
|
-
"./spx-progress-bar": {
|
|
120
|
-
"types": "./spx-progress-bar/index.d.ts",
|
|
121
|
-
"default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
|
|
122
|
-
},
|
|
123
123
|
"./spx-stock-info": {
|
|
124
124
|
"types": "./spx-stock-info/index.d.ts",
|
|
125
125
|
"default": "./fesm2022/softpak-components-spx-stock-info.mjs"
|
|
@@ -128,14 +128,14 @@
|
|
|
128
128
|
"types": "./spx-storage/index.d.ts",
|
|
129
129
|
"default": "./fesm2022/softpak-components-spx-storage.mjs"
|
|
130
130
|
},
|
|
131
|
-
"./spx-suggestion": {
|
|
132
|
-
"types": "./spx-suggestion/index.d.ts",
|
|
133
|
-
"default": "./fesm2022/softpak-components-spx-suggestion.mjs"
|
|
134
|
-
},
|
|
135
131
|
"./spx-tabs": {
|
|
136
132
|
"types": "./spx-tabs/index.d.ts",
|
|
137
133
|
"default": "./fesm2022/softpak-components-spx-tabs.mjs"
|
|
138
134
|
},
|
|
135
|
+
"./spx-suggestion": {
|
|
136
|
+
"types": "./spx-suggestion/index.d.ts",
|
|
137
|
+
"default": "./fesm2022/softpak-components-spx-suggestion.mjs"
|
|
138
|
+
},
|
|
139
139
|
"./spx-toaster": {
|
|
140
140
|
"types": "./spx-toaster/index.d.ts",
|
|
141
141
|
"default": "./fesm2022/softpak-components-spx-toaster.mjs"
|
|
@@ -152,14 +152,14 @@
|
|
|
152
152
|
"types": "./spx-update/index.d.ts",
|
|
153
153
|
"default": "./fesm2022/softpak-components-spx-update.mjs"
|
|
154
154
|
},
|
|
155
|
-
"./spx-validation-messages": {
|
|
156
|
-
"types": "./spx-validation-messages/index.d.ts",
|
|
157
|
-
"default": "./fesm2022/softpak-components-spx-validation-messages.mjs"
|
|
158
|
-
},
|
|
159
155
|
"./spx-validation": {
|
|
160
156
|
"types": "./spx-validation/index.d.ts",
|
|
161
157
|
"default": "./fesm2022/softpak-components-spx-validation.mjs"
|
|
162
158
|
},
|
|
159
|
+
"./spx-validation-messages": {
|
|
160
|
+
"types": "./spx-validation-messages/index.d.ts",
|
|
161
|
+
"default": "./fesm2022/softpak-components-spx-validation-messages.mjs"
|
|
162
|
+
},
|
|
163
163
|
"./spx-welcome": {
|
|
164
164
|
"types": "./spx-welcome/index.d.ts",
|
|
165
165
|
"default": "./fesm2022/softpak-components-spx-welcome.mjs"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
|
|
3
|
-
import { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';
|
|
3
|
+
import { SpxInputComponent, SpxInputTypeEnum, SpxCycleConfig } from '@softpak/components/spx-inputs';
|
|
4
4
|
|
|
5
5
|
declare class SpxCheckDigitComponent {
|
|
6
6
|
private readonly formBuilder;
|
|
@@ -8,12 +8,15 @@ declare class SpxCheckDigitComponent {
|
|
|
8
8
|
readonly txtContainer: _angular_core.InputSignal<string>;
|
|
9
9
|
readonly txtPrefix: _angular_core.InputSignal<string>;
|
|
10
10
|
ctrlContainerNumberRef: _angular_core.Signal<SpxInputComponent | undefined>;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
protected readonly inputTypeCycleNumeric = SpxInputTypeEnum.cycleNumeric;
|
|
12
|
+
protected readonly inputTypeCycle = SpxInputTypeEnum.cycle;
|
|
13
|
+
protected readonly inputTypeText = SpxInputTypeEnum.text;
|
|
13
14
|
formGroup: _angular_core.WritableSignal<FormGroup<any> | null>;
|
|
14
15
|
ctrlCheckDigit: _angular_core.Signal<FormControl<any>>;
|
|
15
16
|
ctrlContainerNumber: _angular_core.Signal<FormControl<any>>;
|
|
16
17
|
ctrlContainerPrefix: _angular_core.Signal<FormControl<any>>;
|
|
18
|
+
protected readonly containerNumberCycleConfig: SpxCycleConfig;
|
|
19
|
+
protected readonly containerPrefixCycleConfig: SpxCycleConfig;
|
|
17
20
|
private inputChanges?;
|
|
18
21
|
constructor(formBuilder: FormBuilder);
|
|
19
22
|
ngOnInit(): void;
|