@softpak/components 21.3.12 → 21.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/softpak-components-spx-check-digit.mjs +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +4 -3
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +41 -5
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-storage.mjs +9 -8
- package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-translate.mjs +7 -1
- package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-welcome.mjs +43 -4
- package/fesm2022/softpak-components-spx-welcome.mjs.map +1 -1
- package/package.json +1 -1
- package/tailwind.css +1 -1
- package/types/softpak-components-spx-channel-selection.d.ts +3 -3
- package/types/softpak-components-spx-form-view.d.ts +2 -0
- package/types/softpak-components-spx-inputs.d.ts +5 -1
- package/types/softpak-components-spx-storage.d.ts +10 -9
- package/types/softpak-components-spx-translate.d.ts +5 -1
- package/types/softpak-components-spx-welcome.d.ts +6 -1
|
@@ -89,7 +89,7 @@ class SpxCheckDigitComponent {
|
|
|
89
89
|
return formControl._rawValidators;
|
|
90
90
|
}
|
|
91
91
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxCheckDigitComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
92
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", 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],[formArray],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", "spxLeftIcon", "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"] }] }); }
|
|
92
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", 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],[formArray],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", "spxLeftIcon", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize", "spxCycleConfig", "spxCheckboxText"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried", "errors", "touched"] }] }); }
|
|
93
93
|
}
|
|
94
94
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxCheckDigitComponent, decorators: [{
|
|
95
95
|
type: Component,
|
|
@@ -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 { 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: 0,\n fieldPattern: '[0-9]*',\n focusOrder: [0, 1, 2, 3, 4, 5],\n length: 6,\n requiredPositions: [true, true, 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":";;;;;;;;;AAOA,MAAM,cAAc,GAAG,YAAY;AACnC,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,UAAU,GAAG,QAAQ;MAYd,sBAAsB,CAAA;AA8BjC,IAAA,WAAA,CACmB,WAAwB,EAAA;QAAxB,IAAA,CAAA,WAAW,GAAX,WAAW;AA9BrB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,wDA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ACjB,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,4pDAAA,EAAA;2cAMkC,iBAAiB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzBtD;;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: 0,\n fieldPattern: '[0-9]*',\n focusOrder: [0, 1, 2, 3, 4, 5],\n length: 6,\n requiredPositions: [true, true, 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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AAA,EAAA,WAAA,EAAA,IAAA,EACjB,2BAA2B,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,EAAA,aAAA,EAAA,QAAA,EAAA,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;2cAMkC,iBAAiB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzBtD;;AAEG;;;;"}
|
|
@@ -97,7 +97,7 @@ class SpxAutocompleteSearchComponent {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxAutocompleteSearchComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
100
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxAutocompleteSearchComponent, isStandalone: true, selector: "spx-autocomplete-search", inputs: { spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: false, transformFunction: null }, spxField: { classPropertyName: "spxField", publicName: "spxField", isSignal: true, isRequired: true, transformFunction: null }, txtOptions: { classPropertyName: "txtOptions", publicName: "txtOptions", isSignal: true, isRequired: true, transformFunction: null }, txtQuery: { classPropertyName: "txtQuery", publicName: "txtQuery", isSignal: true, isRequired: true, transformFunction: null }, txtSubmit: { classPropertyName: "txtSubmit", publicName: "txtSubmit", isSignal: true, isRequired: true, transformFunction: null }, spxValuePair: { classPropertyName: "spxValuePair", publicName: "spxValuePair", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxCancel: "spxCancel", spxSearch: "spxSearch", spxSubmit: "spxSubmit" }, ngImport: i0, template: "@if(formGroup()) {\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\n </form>\n}\n", 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],[formArray],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: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType", "spxName"], outputs: ["spxClick"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxSpeedDial", "spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxLeftIcon", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize", "spxCycleConfig"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
100
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxAutocompleteSearchComponent, isStandalone: true, selector: "spx-autocomplete-search", inputs: { spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: false, transformFunction: null }, spxField: { classPropertyName: "spxField", publicName: "spxField", isSignal: true, isRequired: true, transformFunction: null }, txtOptions: { classPropertyName: "txtOptions", publicName: "txtOptions", isSignal: true, isRequired: true, transformFunction: null }, txtQuery: { classPropertyName: "txtQuery", publicName: "txtQuery", isSignal: true, isRequired: true, transformFunction: null }, txtSubmit: { classPropertyName: "txtSubmit", publicName: "txtSubmit", isSignal: true, isRequired: true, transformFunction: null }, spxValuePair: { classPropertyName: "spxValuePair", publicName: "spxValuePair", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxCancel: "spxCancel", spxSearch: "spxSearch", spxSubmit: "spxSubmit" }, ngImport: i0, template: "@if(formGroup()) {\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\n </form>\n}\n", 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],[formArray],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: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType", "spxName"], outputs: ["spxClick"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxSpeedDial", "spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxLeftIcon", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize", "spxCycleConfig", "spxCheckboxText"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
101
101
|
}
|
|
102
102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxAutocompleteSearchComponent, decorators: [{
|
|
103
103
|
type: Component,
|
|
@@ -143,6 +143,7 @@ class SpxFormViewComponent {
|
|
|
143
143
|
this.typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;
|
|
144
144
|
this.typeOverlay = SpxInputTypeEnum.overlay;
|
|
145
145
|
this.typeOverlayNumber = SpxInputTypeEnum.overlayNumber;
|
|
146
|
+
this.typeCheckbox = SpxInputTypeEnum.checkbox;
|
|
146
147
|
}
|
|
147
148
|
getSuggestionsForKey(key) {
|
|
148
149
|
return this.spxSuggestions()?.[key] ?? [];
|
|
@@ -203,7 +204,7 @@ class SpxFormViewComponent {
|
|
|
203
204
|
return new FormGroup(controls);
|
|
204
205
|
}
|
|
205
206
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxFormViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
206
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxFormViewComponent, isStandalone: true, selector: "spx-form-view", inputs: { spxFormGroup: { classPropertyName: "spxFormGroup", publicName: "spxFormGroup", isSignal: true, isRequired: true, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: true, transformFunction: null }, spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxBlur: "spxBlur", spxClick: "spxClick", spxSearch: "spxSearch" }, viewQueries: [{ propertyName: "spxInputs", predicate: (ElementRef), descendants: true, isSignal: true }], ngImport: i0, template: "@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: SpxAutocompleteSearchComponent, selector: "spx-autocomplete-search", inputs: ["spxSuggestions", "spxField", "txtOptions", "txtQuery", "txtSubmit", "spxValuePair"], outputs: ["spxCancel", "spxSearch", "spxSubmit"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType", "spxName"], outputs: ["spxClick"] }, { kind: "component", type: SpxFormSectionComponent, selector: "spx-form-section", inputs: ["spxIndex", "spxIndexSecondary", "spxTitle", "spxShowTitle"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxSpeedDial", "spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxLeftIcon", "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"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
207
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxFormViewComponent, isStandalone: true, selector: "spx-form-view", inputs: { spxFormGroup: { classPropertyName: "spxFormGroup", publicName: "spxFormGroup", isSignal: true, isRequired: true, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: true, transformFunction: null }, spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxBlur: "spxBlur", spxClick: "spxClick", spxSearch: "spxSearch" }, viewQueries: [{ propertyName: "spxInputs", predicate: (ElementRef), descendants: true, isSignal: true }], ngImport: i0, template: "@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeCheckbox) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxType]=\"typeCheckbox\"\n [spxCheckboxText]=\"spxField.checkboxText ? (spxField.checkboxText() | translate | capitalize) : undefined\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: SpxAutocompleteSearchComponent, selector: "spx-autocomplete-search", inputs: ["spxSuggestions", "spxField", "txtOptions", "txtQuery", "txtSubmit", "spxValuePair"], outputs: ["spxCancel", "spxSearch", "spxSubmit"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType", "spxName"], outputs: ["spxClick"] }, { kind: "component", type: SpxFormSectionComponent, selector: "spx-form-section", inputs: ["spxIndex", "spxIndexSecondary", "spxTitle", "spxShowTitle"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxSpeedDial", "spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxLeftIcon", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize", "spxCycleConfig", "spxCheckboxText"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried", "errors", "touched"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
207
208
|
}
|
|
208
209
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxFormViewComponent, decorators: [{
|
|
209
210
|
type: Component,
|
|
@@ -217,7 +218,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
217
218
|
SpxInputComponent,
|
|
218
219
|
SpxValidateControlComponent,
|
|
219
220
|
TranslateModule
|
|
220
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n" }]
|
|
221
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeCheckbox) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxType]=\"typeCheckbox\"\n [spxCheckboxText]=\"spxField.checkboxText ? (spxField.checkboxText() | translate | capitalize) : undefined\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n" }]
|
|
221
222
|
}], propDecorators: { spxFormGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxFormGroup", required: true }] }], spxForm: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxForm", required: true }] }], spxSuggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxSuggestions", required: true }] }], spxBlur: [{ type: i0.Output, args: ["spxBlur"] }], spxClick: [{ type: i0.Output, args: ["spxClick"] }], spxSearch: [{ type: i0.Output, args: ["spxSearch"] }], spxInputs: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => ElementRef), { isSignal: true }] }] } });
|
|
222
223
|
|
|
223
224
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-form-view.mjs","sources":["../../../../projects/softpak/components/spx-form-view/spx-form-button-type.enum.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.html","../../../../projects/softpak/components/spx-form-view/spx-check-required.const.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.html","../../../../projects/softpak/components/spx-form-view/softpak-components-spx-form-view.ts"],"sourcesContent":["export enum SpxFormButtonTypeEnum {\n button = 'button',\n submit = 'submit',\n}\n","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, input, output, signal } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, debounceTime } from 'rxjs';\n\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\n\nexport const sectionAutocompleteSearch = 'autocompleteSearch';\nexport const ctrlQuery = 'query';\nexport const ctrlOptions = 'options';\n\n@Component({\n selector: 'spx-autocomplete-search',\n templateUrl: './spx-autocomplete-search.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxInputComponent,\n ],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxAutocompleteSearchComponent implements OnInit, OnDestroy {\n formGroup = signal<FormGroup | null>(null);\n readonly spxSuggestions = input<SpxValuePair<any>[]>([]);\n readonly spxField = input.required<SpxFormFieldI>();\n readonly txtOptions = input.required<string>();\n readonly txtQuery = input.required<string>();\n readonly txtSubmit = input.required<string>();\n readonly spxValuePair = input.required<SpxValuePair<any>>();\n spxCancel = output();\n spxSearch = output<SpxValuePair<any>>();\n spxSubmit = output<SpxValuePair<any>>();\n inputTypeRadio = SpxInputTypeEnum.radio;\n inputTypeText = SpxInputTypeEnum.text;\n SpxSeverity = SpxSeverityEnum;\n \n sections: SpxFormSectionI[] = [\n {\n key: sectionAutocompleteSearch,\n showTitle: () => false,\n fields: [\n {\n key: ctrlQuery,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtQuery(),\n capitalize: () => true,\n },\n {\n key: ctrlOptions,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtOptions(),\n },\n ]\n }\n ];\n\n readonly ctrlQuery = computed(() => this.formGroup()?.get(ctrlQuery) as FormControl);\n readonly ctrlOptions = computed(() => this.formGroup()?.get(ctrlOptions) as FormControl);\n\n private subscriptions: {\n subSelection?: Subscription;\n subQuery?: Subscription;\n } = {};\n\n constructor(readonly formBuilder: FormBuilder) {\n this.createForm();\n }\n\n ngOnInit(): void {\n this.listenToSelection();\n this.listenToQuery();\n const spxValuePair = this.spxValuePair();\n this.ctrlQuery().setValue(spxValuePair, { emitEvent: false });\n this.spxSearch.emit(spxValuePair);\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n private createForm(): void {\n this.formGroup.set(this.formBuilder.group({\n [ctrlQuery]: [null],\n [ctrlOptions]: [null],\n }));\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onCancel(): void {\n this.spxCancel.emit();\n }\n \n onSubmit(): void {\n this.spxSubmit.emit(this.ctrlQuery().value);\n }\n\n private listenToQuery(): void {\n this.subscriptions.subQuery = this.ctrlQuery().valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {\n this.spxSearch.emit(valuePair);\n });\n }\n\n private listenToSelection(): void {\n this.subscriptions.subSelection = this.ctrlOptions().valueChanges.subscribe(valuePair => {\n this.ctrlQuery().setValue(valuePair);\n });\n }\n}\n","@if(formGroup()) {\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\n </form>\n}\n","import { AbstractControl, FormArray, FormGroup, ValidationErrors } from \"@angular/forms\";\n\nexport const checkRequired = (control: AbstractControl): boolean => {\n // Check of deze control zelf 'required' is\n const errors: ValidationErrors | null = control.validator?.({} as AbstractControl) ?? null;\n if (errors?.['required']) {\n return true;\n }\n\n // Als het een FormGroup of FormArray is, check alle children\n if (control instanceof FormGroup || control instanceof FormArray) {\n return Object.values(control.controls).some(child => checkRequired(child));\n }\n return false;\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, inject, input, output, signal, viewChildren } from '@angular/core';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, ValidationErrors } from '@angular/forms';\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxAutocompleteSearchComponent } from './spx-autocomplete-search.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { SpxFormI } from './spx-form.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent } from '@softpak/components/spx-validation';\nimport { checkRequired } from './spx-check-required.const';\n\n@Component({\n selector: 'spx-form-view',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxAutocompleteSearchComponent,\n SpxButtonComponent,\n SpxCapitalizePipe,\n SpxFormSectionComponent,\n SpxInputComponent,\n SpxValidateControlComponent,\n TranslateModule\n ],\n templateUrl: './spx-form-view.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxFormViewComponent {\n readonly checkRequired = checkRequired;\n readonly formBuilder = inject(FormBuilder);\n readonly spxFormGroup = input.required<FormGroup>();\n readonly spxForm = input.required<SpxFormI>();\n readonly spxSuggestions = input.required<any>();\n spxBlur = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxClick = output<{ field: SpxFormFieldI }>();\n spxSearch = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxInputs = viewChildren(ElementRef<SpxInputComponent>);\n autoCompleteField = signal<SpxFormFieldI | null>(null);\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\n typeButton = SpxInputTypeEnum.button;\n typeFloat = SpxInputTypeEnum.float;\n typeNumber = SpxInputTypeEnum.number;\n typeRadio = SpxInputTypeEnum.radio;\n typeText = SpxInputTypeEnum.text;\n typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;\n typeOverlay = SpxInputTypeEnum.overlay;\n typeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n\n getSuggestionsForKey(key: string): SpxValuePair<any>[] {\n return this.spxSuggestions()?.[key] ?? [];\n }\n\n setAutofocus(key: string): void {\n const field = this.spxInputs().find(input => input.nativeElement.spxName() === key);\n if (field) {\n field.nativeElement.setFocusIn();\n }\n }\n\n onBlur(field: SpxFormFieldI) {\n this.spxBlur.emit({\n field,\n valuePair: this.spxFormGroup().get(field.key)!.value,\n });\n }\n\n onClick(field: SpxFormFieldI) {\n this.spxClick.emit({\n field,\n });\n }\n\n onAutocompleteCancel(): void {\n this.autoCompleteField.set(null);\n }\n\n onAutocompleteSearch(valuePair: SpxValuePair<any>): void {\n if (this.autoCompleteField()) {\n this.spxSearch.emit({\n field: this.autoCompleteField()!,\n valuePair,\n });\n }\n }\n\n onAutocompleteSave(valuePair: SpxValuePair<any>) {\n this.spxFormGroup().get(this.autoCompleteField()!.key)?.setValue(valuePair);\n this.autoCompleteField.set(null);\n }\n\n onSearch(field: SpxFormFieldI) {\n this.autoCompleteField.set(field);\n }\n\n getRawValidators(formControl: AbstractControl) {\n // eslint-disable-next-line no-underscore-dangle\n return (formControl as any)._rawValidators;\n }\n\n static createForm(form: SpxFormI): FormGroup {\n const controls = form.sections.flatMap(section => section.fields).reduce((acc, field) => {\n const control = new FormControl(\n field.defaultValue?.() as any ?? null,\n field.defaultValidators?.() ?? []\n );\n\n // Koppel automatisch afterValueChange als die bestaat\n if (field.afterValueChange) {\n console.log('avc 1');\n control.valueChanges.subscribe((valuePair) => {\n field.afterValueChange!(valuePair as SpxValuePair<boolean | string | number> | null);\n console.log('avc 2', valuePair);\n });\n }\n\n acc[field.key] = control;\n return acc;\n }, {} as { [key: string]: FormControl });\n return new FormGroup(controls);\n }\n}\n","@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACrB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAAA,EAAA,CAAA,CAAA;;ACU1B,MAAM,yBAAyB,GAAG,oBAAoB;AACtD,MAAM,SAAS,GAAG,OAAO;AACzB,MAAM,WAAW,GAAG,SAAS;MAcvB,8BAA8B,CAAA;AA2CzC,IAAA,WAAA,CAAqB,WAAwB,EAAA;QAAxB,IAAA,CAAA,WAAW,GAAX,WAAW;AA1ChC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAmB,IAAI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X,mBAAmB;wBACnB,8BAA8B;wBAC9B,kBAAkB;wBAClB,iBAAiB;wBACjB,uBAAuB;wBACvB,iBAAiB;wBACjB,2BAA2B;wBAC3B;AACD,qBAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,oxKAAA,EAAA;4iBAWS,UAA6B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExCxD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-form-view.mjs","sources":["../../../../projects/softpak/components/spx-form-view/spx-form-button-type.enum.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.html","../../../../projects/softpak/components/spx-form-view/spx-check-required.const.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.html","../../../../projects/softpak/components/spx-form-view/softpak-components-spx-form-view.ts"],"sourcesContent":["export enum SpxFormButtonTypeEnum {\n button = 'button',\n submit = 'submit',\n}\n","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, input, output, signal } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, debounceTime } from 'rxjs';\n\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\n\nexport const sectionAutocompleteSearch = 'autocompleteSearch';\nexport const ctrlQuery = 'query';\nexport const ctrlOptions = 'options';\n\n@Component({\n selector: 'spx-autocomplete-search',\n templateUrl: './spx-autocomplete-search.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxInputComponent,\n ],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxAutocompleteSearchComponent implements OnInit, OnDestroy {\n formGroup = signal<FormGroup | null>(null);\n readonly spxSuggestions = input<SpxValuePair<any>[]>([]);\n readonly spxField = input.required<SpxFormFieldI>();\n readonly txtOptions = input.required<string>();\n readonly txtQuery = input.required<string>();\n readonly txtSubmit = input.required<string>();\n readonly spxValuePair = input.required<SpxValuePair<any>>();\n spxCancel = output();\n spxSearch = output<SpxValuePair<any>>();\n spxSubmit = output<SpxValuePair<any>>();\n inputTypeRadio = SpxInputTypeEnum.radio;\n inputTypeText = SpxInputTypeEnum.text;\n SpxSeverity = SpxSeverityEnum;\n \n sections: SpxFormSectionI[] = [\n {\n key: sectionAutocompleteSearch,\n showTitle: () => false,\n fields: [\n {\n key: ctrlQuery,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtQuery(),\n capitalize: () => true,\n },\n {\n key: ctrlOptions,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtOptions(),\n },\n ]\n }\n ];\n\n readonly ctrlQuery = computed(() => this.formGroup()?.get(ctrlQuery) as FormControl);\n readonly ctrlOptions = computed(() => this.formGroup()?.get(ctrlOptions) as FormControl);\n\n private subscriptions: {\n subSelection?: Subscription;\n subQuery?: Subscription;\n } = {};\n\n constructor(readonly formBuilder: FormBuilder) {\n this.createForm();\n }\n\n ngOnInit(): void {\n this.listenToSelection();\n this.listenToQuery();\n const spxValuePair = this.spxValuePair();\n this.ctrlQuery().setValue(spxValuePair, { emitEvent: false });\n this.spxSearch.emit(spxValuePair);\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n private createForm(): void {\n this.formGroup.set(this.formBuilder.group({\n [ctrlQuery]: [null],\n [ctrlOptions]: [null],\n }));\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onCancel(): void {\n this.spxCancel.emit();\n }\n \n onSubmit(): void {\n this.spxSubmit.emit(this.ctrlQuery().value);\n }\n\n private listenToQuery(): void {\n this.subscriptions.subQuery = this.ctrlQuery().valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {\n this.spxSearch.emit(valuePair);\n });\n }\n\n private listenToSelection(): void {\n this.subscriptions.subSelection = this.ctrlOptions().valueChanges.subscribe(valuePair => {\n this.ctrlQuery().setValue(valuePair);\n });\n }\n}\n","@if(formGroup()) {\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\n </form>\n}\n","import { AbstractControl, FormArray, FormGroup, ValidationErrors } from \"@angular/forms\";\n\nexport const checkRequired = (control: AbstractControl): boolean => {\n // Check of deze control zelf 'required' is\n const errors: ValidationErrors | null = control.validator?.({} as AbstractControl) ?? null;\n if (errors?.['required']) {\n return true;\n }\n\n // Als het een FormGroup of FormArray is, check alle children\n if (control instanceof FormGroup || control instanceof FormArray) {\n return Object.values(control.controls).some(child => checkRequired(child));\n }\n return false;\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, inject, input, output, signal, viewChildren } from '@angular/core';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, ValidationErrors } from '@angular/forms';\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxAutocompleteSearchComponent } from './spx-autocomplete-search.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { SpxFormI } from './spx-form.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent } from '@softpak/components/spx-validation';\nimport { checkRequired } from './spx-check-required.const';\n\n@Component({\n selector: 'spx-form-view',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxAutocompleteSearchComponent,\n SpxButtonComponent,\n SpxCapitalizePipe,\n SpxFormSectionComponent,\n SpxInputComponent,\n SpxValidateControlComponent,\n TranslateModule\n ],\n templateUrl: './spx-form-view.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxFormViewComponent {\n readonly checkRequired = checkRequired;\n readonly formBuilder = inject(FormBuilder);\n readonly spxFormGroup = input.required<FormGroup>();\n readonly spxForm = input.required<SpxFormI>();\n readonly spxSuggestions = input.required<any>();\n spxBlur = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxClick = output<{ field: SpxFormFieldI }>();\n spxSearch = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxInputs = viewChildren(ElementRef<SpxInputComponent>);\n autoCompleteField = signal<SpxFormFieldI | null>(null);\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\n typeButton = SpxInputTypeEnum.button;\n typeFloat = SpxInputTypeEnum.float;\n typeNumber = SpxInputTypeEnum.number;\n typeRadio = SpxInputTypeEnum.radio;\n typeText = SpxInputTypeEnum.text;\n typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;\n typeOverlay = SpxInputTypeEnum.overlay;\n typeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n typeCheckbox = SpxInputTypeEnum.checkbox;\n\n getSuggestionsForKey(key: string): SpxValuePair<any>[] {\n return this.spxSuggestions()?.[key] ?? [];\n }\n\n setAutofocus(key: string): void {\n const field = this.spxInputs().find(input => input.nativeElement.spxName() === key);\n if (field) {\n field.nativeElement.setFocusIn();\n }\n }\n\n onBlur(field: SpxFormFieldI) {\n this.spxBlur.emit({\n field,\n valuePair: this.spxFormGroup().get(field.key)!.value,\n });\n }\n\n onClick(field: SpxFormFieldI) {\n this.spxClick.emit({\n field,\n });\n }\n\n onAutocompleteCancel(): void {\n this.autoCompleteField.set(null);\n }\n\n onAutocompleteSearch(valuePair: SpxValuePair<any>): void {\n if (this.autoCompleteField()) {\n this.spxSearch.emit({\n field: this.autoCompleteField()!,\n valuePair,\n });\n }\n }\n\n onAutocompleteSave(valuePair: SpxValuePair<any>) {\n this.spxFormGroup().get(this.autoCompleteField()!.key)?.setValue(valuePair);\n this.autoCompleteField.set(null);\n }\n\n onSearch(field: SpxFormFieldI) {\n this.autoCompleteField.set(field);\n }\n\n getRawValidators(formControl: AbstractControl) {\n // eslint-disable-next-line no-underscore-dangle\n return (formControl as any)._rawValidators;\n }\n\n static createForm(form: SpxFormI): FormGroup {\n const controls = form.sections.flatMap(section => section.fields).reduce((acc, field) => {\n const control = new FormControl(\n field.defaultValue?.() as any ?? null,\n field.defaultValidators?.() ?? []\n );\n\n // Koppel automatisch afterValueChange als die bestaat\n if (field.afterValueChange) {\n console.log('avc 1');\n control.valueChanges.subscribe((valuePair) => {\n field.afterValueChange!(valuePair as SpxValuePair<boolean | string | number> | null);\n console.log('avc 2', valuePair);\n });\n }\n\n acc[field.key] = control;\n return acc;\n }, {} as { [key: string]: FormControl });\n return new FormGroup(controls);\n }\n}\n","@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeCheckbox) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxType]=\"typeCheckbox\"\n [spxCheckboxText]=\"spxField.checkboxText ? (spxField.checkboxText() | translate | capitalize) : undefined\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,QAA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