@softpak/components 0.0.0-beta.22 → 0.0.0-beta.221
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/esm2022/spx-button/spx-button.component.mjs +18 -5
- package/esm2022/spx-change-details/public-api.mjs +2 -0
- package/esm2022/spx-change-details/softpak-components-spx-change-details.mjs +5 -0
- package/esm2022/spx-change-details/spx-change-details-value.interface.mjs +2 -0
- package/esm2022/spx-change-details/spx-change-details.component.mjs +199 -0
- package/esm2022/spx-channel-selection/src/spx-channel-selection.component.mjs +1 -1
- package/esm2022/spx-channel-selection/src/spx-company-selection.component.mjs +2 -2
- package/esm2022/spx-channel-selection/src/spx-welcome.component.mjs +112 -19
- package/esm2022/spx-check-digit/spx-check-digit.component.mjs +14 -7
- package/esm2022/spx-form-section/spx-form-section.component.mjs +11 -11
- package/esm2022/spx-form-view/public-api.mjs +4 -0
- package/esm2022/spx-form-view/softpak-components-spx-form-view.mjs +5 -0
- package/esm2022/spx-form-view/spx-autocomplete-search.component.mjs +119 -0
- package/esm2022/spx-form-view/spx-form-field.interface.mjs +2 -0
- package/esm2022/spx-form-view/spx-form-section.interface.mjs +2 -0
- package/esm2022/spx-form-view/spx-form-view.component.mjs +268 -0
- package/esm2022/spx-inputs/spx-dropdown.component.mjs +94 -0
- package/esm2022/spx-inputs/spx-input-box.component.mjs +70 -46
- package/esm2022/spx-inputs/spx-input-date.component.mjs +1 -1
- package/esm2022/spx-inputs/spx-input-float.component.mjs +10 -5
- package/esm2022/spx-inputs/spx-input-number.component.mjs +10 -5
- package/esm2022/spx-inputs/spx-input-radio.component.mjs +93 -27
- package/esm2022/spx-inputs/spx-input-text.component.mjs +25 -32
- package/esm2022/spx-inputs/spx-input-type.enum.mjs +4 -1
- package/esm2022/spx-inputs/spx-input.component.mjs +48 -13
- package/esm2022/spx-navigation/spx-home-tile.component.mjs +31 -12
- package/esm2022/spx-navigation/spx-home-tiles.component.mjs +14 -5
- package/esm2022/spx-navigation/spx-navigation-item.interface.mjs +1 -1
- package/esm2022/spx-navigation/spx-navigation.component.mjs +14 -5
- package/esm2022/spx-number-check/spx-number-check.component.mjs +87 -20
- package/esm2022/spx-suggestion/spx-suggestion.component.mjs +28 -10
- package/esm2022/spx-update/src/spx-update-info.component.mjs +1 -1
- package/esm2022/spx-validation/public-api.mjs +1 -2
- package/esm2022/spx-validation/spx-validate-control.component.mjs +8 -3
- package/fesm2022/softpak-components-spx-button.mjs +17 -4
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +206 -0
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-channel-selection.mjs +110 -21
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +13 -6
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +10 -10
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +385 -0
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-inputs.mjs +337 -118
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +54 -17
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +86 -19
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +27 -9
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +1 -1
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation.mjs +8 -28
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/package.json +23 -10
- package/spx-button/spx-button.component.d.ts +4 -2
- package/spx-change-details/index.d.ts +5 -0
- package/spx-change-details/public-api.d.ts +1 -0
- package/spx-change-details/spx-change-details-value.interface.d.ts +7 -0
- package/spx-change-details/spx-change-details.component.d.ts +63 -0
- package/spx-channel-selection/src/spx-welcome.component.d.ts +37 -8
- package/spx-check-digit/spx-check-digit.component.d.ts +3 -1
- package/spx-form-view/index.d.ts +5 -0
- package/spx-form-view/public-api.d.ts +3 -0
- package/spx-form-view/spx-autocomplete-search.component.d.ts +43 -0
- package/spx-form-view/spx-form-field.interface.d.ts +18 -0
- package/spx-form-view/spx-form-section.interface.d.ts +9 -0
- package/spx-form-view/spx-form-view.component.d.ts +48 -0
- package/spx-inputs/spx-dropdown.component.d.ts +18 -0
- package/spx-inputs/spx-input-box.component.d.ts +14 -7
- package/spx-inputs/spx-input-float.component.d.ts +3 -2
- package/spx-inputs/spx-input-number.component.d.ts +3 -2
- package/spx-inputs/spx-input-radio.component.d.ts +13 -5
- package/spx-inputs/spx-input-text.component.d.ts +3 -2
- package/spx-inputs/spx-input-type.enum.d.ts +4 -1
- package/spx-inputs/spx-input.component.d.ts +11 -3
- package/spx-navigation/spx-home-tile.component.d.ts +5 -1
- package/spx-navigation/spx-home-tiles.component.d.ts +2 -1
- package/spx-navigation/spx-navigation-item.interface.d.ts +1 -0
- package/spx-navigation/spx-navigation.component.d.ts +6 -2
- package/spx-number-check/spx-number-check.component.d.ts +15 -3
- package/spx-suggestion/spx-suggestion.component.d.ts +3 -1
- package/spx-validation/public-api.d.ts +0 -1
- package/spx-validation/spx-validate-control.component.d.ts +1 -1
- package/tailwind.css +1 -1
- package/esm2022/spx-validation/spx-validation.module.mjs +0 -28
- package/spx-validation/spx-validation.module.d.ts +0 -9
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { Component, Input, ViewChild } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { combineLatest, startWith, map } from 'rxjs';
|
|
6
|
-
import
|
|
7
|
-
import { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, SpxValidationModule } from '@softpak/components/spx-validation';
|
|
6
|
+
import { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, SpxValidateControlComponent } from '@softpak/components/spx-validation';
|
|
8
7
|
import { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';
|
|
9
8
|
import * as i2 from '@angular/common';
|
|
10
9
|
import { CommonModule } from '@angular/common';
|
|
@@ -58,6 +57,11 @@ class SpxCheckDigitComponent {
|
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
59
|
}
|
|
60
|
+
ngAfterViewInit() {
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
this.ctrlContainerNumberRef?.setFocusIn();
|
|
63
|
+
}, 250);
|
|
64
|
+
}
|
|
61
65
|
ngOnDestroy() {
|
|
62
66
|
if (this.inputChanges) {
|
|
63
67
|
this.inputChanges.unsubscribe();
|
|
@@ -67,7 +71,7 @@ class SpxCheckDigitComponent {
|
|
|
67
71
|
return formControl._rawValidators;
|
|
68
72
|
}
|
|
69
73
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxCheckDigitComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
70
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxCheckDigitComponent, isStandalone: true, selector: "spx-check-digit", inputs: { txtCheckDigit: "txtCheckDigit", txtContainer: "txtContainer", txtPrefix: "txtPrefix" }, ngImport: i0, template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-
|
|
74
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxCheckDigitComponent, isStandalone: true, selector: "spx-check-digit", inputs: { txtCheckDigit: "txtCheckDigit", txtContainer: "txtContainer", txtPrefix: "txtPrefix" }, viewQueries: [{ propertyName: "ctrlContainerNumberRef", first: true, predicate: ["ctrlContainerNumberRef"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber && ctrlContainerNumber.errors && ctrlContainerNumber.touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber)\">\n <spx-validate-control [control]=\"ctrlContainerNumber\" [label]=\"txtContainer\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix && ctrlContainerPrefix.errors && ctrlContainerPrefix.touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix)\">\n <spx-validate-control [control]=\"ctrlContainerPrefix\" [label]=\"txtPrefix\"></spx-validate-control>\n </spx-input>\n <spx-input\n *ngIf=\"ctrlCheckDigit.value\"\n [formControl]=\"ctrlCheckDigit\"\n [spxLabel]=\"txtCheckDigit\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n</form>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "value", "spxCapitalize", "spxFocused"], outputs: ["spxBlur", "spxClear", "spxChange", "spxFocus", "spxEdit", "spxHelp", "spxSearch"] }] }); }
|
|
71
75
|
}
|
|
72
76
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxCheckDigitComponent, decorators: [{
|
|
73
77
|
type: Component,
|
|
@@ -75,15 +79,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
75
79
|
CommonModule,
|
|
76
80
|
FormsModule,
|
|
77
81
|
ReactiveFormsModule,
|
|
78
|
-
|
|
82
|
+
SpxValidateControlComponent,
|
|
79
83
|
SpxInputComponent,
|
|
80
|
-
], template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-
|
|
84
|
+
], template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber && ctrlContainerNumber.errors && ctrlContainerNumber.touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber)\">\n <spx-validate-control [control]=\"ctrlContainerNumber\" [label]=\"txtContainer\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix && ctrlContainerPrefix.errors && ctrlContainerPrefix.touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix)\">\n <spx-validate-control [control]=\"ctrlContainerPrefix\" [label]=\"txtPrefix\"></spx-validate-control>\n </spx-input>\n <spx-input\n *ngIf=\"ctrlCheckDigit.value\"\n [formControl]=\"ctrlCheckDigit\"\n [spxLabel]=\"txtCheckDigit\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n</form>" }]
|
|
81
85
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { txtCheckDigit: [{
|
|
82
86
|
type: Input
|
|
83
87
|
}], txtContainer: [{
|
|
84
88
|
type: Input
|
|
85
89
|
}], txtPrefix: [{
|
|
86
90
|
type: Input
|
|
91
|
+
}], ctrlContainerNumberRef: [{
|
|
92
|
+
type: ViewChild,
|
|
93
|
+
args: ['ctrlContainerNumberRef']
|
|
87
94
|
}] } });
|
|
88
95
|
|
|
89
96
|
/**
|
|
@@ -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, Input } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\nimport { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern,
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-check-digit.mjs","sources":["../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.ts","../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.html","../../../../projects/softpak/components/spx-check-digit/softpak-components-spx-check-digit.ts"],"sourcesContent":["import { Component, Input, ViewChild } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\nimport { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, SpxValidateControlComponent } from '@softpak/components/spx-validation';\nimport { calcCheckDigit, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { CommonModule } from '@angular/common';\nimport { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\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 standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SpxValidateControlComponent,\n SpxInputComponent,\n ]\n})\nexport class SpxCheckDigitComponent {\n @Input() txtCheckDigit!: string;\n @Input() txtContainer!: string;\n @Input() txtPrefix!: string;\n @ViewChild('ctrlContainerNumberRef') ctrlContainerNumberRef?: SpxInputComponent;\n inputTypeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n inputTypeText = SpxInputTypeEnum.text;\n formGroup: FormGroup;\n\n get ctrlCheckDigit(): FormControl { return this.formGroup.get(ctrlCheckDigit) as FormControl; }\n get ctrlContainerNumber(): FormControl { return this.formGroup.get(ctrlContainerNumber) as FormControl; }\n get ctrlContainerPrefix(): FormControl { return this.formGroup.get(ctrlPrefix) as FormControl; }\n\n private inputChanges?: Subscription;\n\n constructor(\n private readonly formBuilder: FormBuilder,\n ) {\n this.formGroup = this.formBuilder.group({\n [ctrlCheckDigit]: [null, []],\n [ctrlContainerNumber]: [null, [\n spxValidatorRequired(),\n spxValidatorMaxLength(6),\n spxValidatorMinLength(6),\n spxValidatorPattern(/[0-9]{6}/),\n ]],\n [ctrlPrefix]: [null, [\n spxValidatorRequired(),\n spxValidatorMaxLength(4),\n spxValidatorMinLength(4),\n spxValidatorPattern(/[a-zA-Z]{4}/),\n ]],\n })\n }\n\n ngOnInit(): void {\n this.inputChanges = combineLatest([\n this.ctrlContainerNumber.valueChanges.pipe(startWith(this.ctrlContainerNumber.value)),\n this.ctrlContainerPrefix.valueChanges.pipe(startWith(this.ctrlContainerPrefix.value)),\n ])\n .pipe(map(([containerNumber$, prefix$]) => ({\n containerNumber: containerNumber$,\n prefix: prefix$\n })))\n .subscribe((v) => {\n if (this.ctrlContainerNumber.invalid || this.ctrlContainerPrefix.invalid) {\n this.ctrlCheckDigit.setValue(null, { emitEvent: false });\n } else {\n const prefix = valuePairToValue(this.ctrlContainerPrefix.value);\n const containerNumber = valuePairToValue(this.ctrlContainerNumber.value);\n const checkDigit = calcCheckDigit(`${prefix}${containerNumber}`);\n this.ctrlCheckDigit.setValue({ value: checkDigit }, { emitEvent: false });\n }\n });\n }\n\n ngAfterViewInit(): void {\n setTimeout(() => {\n this.ctrlContainerNumberRef?.setFocusIn(); \n }, 250);\n }\n\n ngOnDestroy(): void {\n if (this.inputChanges) {\n this.inputChanges.unsubscribe();\n }\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n}\n","<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber && ctrlContainerNumber.errors && ctrlContainerNumber.touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber)\">\n <spx-validate-control [control]=\"ctrlContainerNumber\" [label]=\"txtContainer\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix && ctrlContainerPrefix.errors && ctrlContainerPrefix.touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix)\">\n <spx-validate-control [control]=\"ctrlContainerPrefix\" [label]=\"txtPrefix\"></spx-validate-control>\n </spx-input>\n <spx-input\n *ngIf=\"ctrlCheckDigit.value\"\n [formControl]=\"ctrlCheckDigit\"\n [spxLabel]=\"txtCheckDigit\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAQA,MAAM,cAAc,GAAG,YAAY,CAAC;AACpC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAC9C,MAAM,UAAU,GAAG,QAAQ,CAAC;MAcf,sBAAsB,CAAA;AASjC,IAAA,IAAI,cAAc,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAgB,CAAC,EAAE;AAC/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BAAmB;wBACnB,2BAA2B;wBAC3B,iBAAiB;AAClB,qBAAA,EAAA,QAAA,EAAA,g1CAAA,EAAA,CAAA;gFAGQ,aAAa,EAAA,CAAA;sBAArB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACG,SAAS,EAAA,CAAA;sBAAjB,KAAK;gBAC+B,sBAAsB,EAAA,CAAA;sBAA1D,SAAS;uBAAC,wBAAwB,CAAA;;;AE5BrC;;AAEG;;;;"}
|
|
@@ -7,25 +7,25 @@ class SpxFormSectionComponent {
|
|
|
7
7
|
this.spxShowTitle = true;
|
|
8
8
|
}
|
|
9
9
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxFormSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxFormSectionComponent, isStandalone: true, selector: "spx-form-section", inputs: { spxIndex: "spxIndex", spxIndexSecondary: "spxIndexSecondary", spxTitle: "spxTitle", spxShowTitle: "spxShowTitle" }, ngImport: i0, template: `<div *ngIf="this.spxShowTitle" class="spx-form-section__title">
|
|
11
|
-
<div class="spx-form-section__title-index">{{this.spxIndex}}<ng-container *ngIf="this.spxIndexSecondary">{{ this.spxIndexSecondary }}</ng-container></div>
|
|
12
|
-
<div class="spx-form-
|
|
10
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxFormSectionComponent, isStandalone: true, selector: "spx-form-section", inputs: { spxIndex: "spxIndex", spxIndexSecondary: "spxIndexSecondary", spxTitle: "spxTitle", spxShowTitle: "spxShowTitle" }, ngImport: i0, template: `<div *ngIf="this.spxShowTitle" class="spx-form-section__title mb-2 flex gap-3 items-center">
|
|
11
|
+
<div class="spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold">{{this.spxIndex}}<ng-container *ngIf="this.spxIndexSecondary">{{ this.spxIndexSecondary }}</ng-container></div>
|
|
12
|
+
<div class="spx-form-section__content font-bold grow text-black dark:text-white">{{this.spxTitle}}</div>
|
|
13
13
|
</div>
|
|
14
|
-
<div class="
|
|
14
|
+
<div class="flex flex-col gap-3">
|
|
15
15
|
<ng-content></ng-content>
|
|
16
|
-
</div>`, isInline: true, styles: [":host{display:block
|
|
16
|
+
</div>`, isInline: true, styles: [":host{display:block}.spx-form-section__title-index{background-color:var(--spx-form-section--index--background-color);color:var(--spx-form-section--index--color, #FFFFFF);display:inline-block;vertical-align:middle}.spx-form-section__content{color:var(--spx-form-section--index--background-color, #000000)}@media (prefers-color-scheme: dark){.spx-form-section__content{color:var(--spx-form-section--index--background-color, #FFFFFF)}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
17
17
|
}
|
|
18
18
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxFormSectionComponent, decorators: [{
|
|
19
19
|
type: Component,
|
|
20
20
|
args: [{ selector: 'spx-form-section', standalone: true, imports: [
|
|
21
21
|
NgIf,
|
|
22
|
-
], template: `<div *ngIf="this.spxShowTitle" class="spx-form-section__title">
|
|
23
|
-
<div class="spx-form-section__title-index">{{this.spxIndex}}<ng-container *ngIf="this.spxIndexSecondary">{{ this.spxIndexSecondary }}</ng-container></div>
|
|
24
|
-
<div class="spx-form-
|
|
22
|
+
], template: `<div *ngIf="this.spxShowTitle" class="spx-form-section__title mb-2 flex gap-3 items-center">
|
|
23
|
+
<div class="spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold">{{this.spxIndex}}<ng-container *ngIf="this.spxIndexSecondary">{{ this.spxIndexSecondary }}</ng-container></div>
|
|
24
|
+
<div class="spx-form-section__content font-bold grow text-black dark:text-white">{{this.spxTitle}}</div>
|
|
25
25
|
</div>
|
|
26
|
-
<div class="
|
|
26
|
+
<div class="flex flex-col gap-3">
|
|
27
27
|
<ng-content></ng-content>
|
|
28
|
-
</div>`, styles: [":host{display:block
|
|
28
|
+
</div>`, styles: [":host{display:block}.spx-form-section__title-index{background-color:var(--spx-form-section--index--background-color);color:var(--spx-form-section--index--color, #FFFFFF);display:inline-block;vertical-align:middle}.spx-form-section__content{color:var(--spx-form-section--index--background-color, #000000)}@media (prefers-color-scheme: dark){.spx-form-section__content{color:var(--spx-form-section--index--background-color, #FFFFFF)}}\n"] }]
|
|
29
29
|
}], propDecorators: { spxIndex: [{
|
|
30
30
|
type: Input
|
|
31
31
|
}], spxIndexSecondary: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-form-section.mjs","sources":["../../../../projects/softpak/components/spx-form-section/spx-form-section.component.ts","../../../../projects/softpak/components/spx-form-section/softpak-components-spx-form-section.ts"],"sourcesContent":["import { NgIf } from '@angular/common';\nimport { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'spx-form-section',\n standalone: true,\n imports: [\n NgIf,\n ],\n template: `<div *ngIf=\"this.spxShowTitle\" class=\"spx-form-section__title\">\n <div class=\"spx-form-section__title-index\">{{this.spxIndex}}<ng-container *ngIf=\"this.spxIndexSecondary\">{{ this.spxIndexSecondary }}</ng-container></div>\n <div class=\"spx-form-
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-form-section.mjs","sources":["../../../../projects/softpak/components/spx-form-section/spx-form-section.component.ts","../../../../projects/softpak/components/spx-form-section/softpak-components-spx-form-section.ts"],"sourcesContent":["import { NgIf } from '@angular/common';\nimport { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'spx-form-section',\n standalone: true,\n imports: [\n NgIf,\n ],\n template: `<div *ngIf=\"this.spxShowTitle\" class=\"spx-form-section__title mb-2 flex gap-3 items-center\">\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold\">{{this.spxIndex}}<ng-container *ngIf=\"this.spxIndexSecondary\">{{ this.spxIndexSecondary }}</ng-container></div>\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle}}</div>\n </div>\n <div class=\"flex flex-col gap-3\">\n <ng-content></ng-content>\n </div>`,\n styles: `\n :host {\n display: block;\n }\n \n .spx-form-section__title-index {\n background-color: var(--spx-form-section--index--background-color);\n color: var(--spx-form-section--index--color, #FFFFFF);\n display: inline-block;\n vertical-align: middle;\n }\n\n .spx-form-section__content {\n color: var(--spx-form-section--index--background-color, #000000);\n }\n\n @media (prefers-color-scheme: dark) {\n .spx-form-section__content {\n color: var(--spx-form-section--index--background-color, #FFFFFF);\n }\n}\n `,\n})\nexport class SpxFormSectionComponent {\n @Input() spxIndex?: number;\n @Input() spxIndexSecondary?: number;\n @Input() spxTitle?: string;\n @Input() spxShowTitle = true;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAuCa,uBAAuB,CAAA;AApCpC,IAAA,WAAA,GAAA;QAwCW,IAAY,CAAA,YAAA,GAAG,IAAI,CAAC;AAC9B,KAAA;8GALY,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,EA9BxB,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;AAMH,QAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,obAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EARL,IAAI,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAgCK,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBApCnC,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAChB,IAAI,EACP,OAAA,EAAA;wBACP,IAAI;qBACL,EACS,QAAA,EAAA,CAAA;;;;;;AAMH,QAAA,CAAA,EAAA,MAAA,EAAA,CAAA,obAAA,CAAA,EAAA,CAAA;8BAyBE,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,iBAAiB,EAAA,CAAA;sBAAzB,KAAK;gBACG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;;;AC3CR;;AAEG;;;;"}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { CommonModule, NgIf, NgFor, JsonPipe } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { EventEmitter, Component, Input, Output, ViewChildren } from '@angular/core';
|
|
4
|
+
import { SpxFormSectionComponent } from '@softpak/components/spx-form-section';
|
|
5
|
+
import { SpxInputTypeEnum, SpxInputComponent } from '@softpak/components/spx-inputs';
|
|
6
|
+
import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
|
|
7
|
+
import * as i1 from '@angular/forms';
|
|
8
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import { debounceTime } from 'rxjs';
|
|
10
|
+
import { SpxButtonComponent } from '@softpak/components/spx-button';
|
|
11
|
+
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
12
|
+
import { SpxValidateControlComponent } from '@softpak/components/spx-validation';
|
|
13
|
+
import * as i2 from '@ngx-translate/core';
|
|
14
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
15
|
+
|
|
16
|
+
const sectionAutocompleteSearch = 'autocompleteSearch';
|
|
17
|
+
const ctrlQuery = 'query';
|
|
18
|
+
const ctrlOptions = 'options';
|
|
19
|
+
class SpxAutocompleteSearchComponent {
|
|
20
|
+
get ctrlQuery() { return this.formGroup.get(ctrlQuery); }
|
|
21
|
+
get ctrlOptions() { return this.formGroup.get(ctrlOptions); }
|
|
22
|
+
constructor(formBuilder) {
|
|
23
|
+
this.formBuilder = formBuilder;
|
|
24
|
+
this.spxSuggestions = [];
|
|
25
|
+
this.spxCancel = new EventEmitter();
|
|
26
|
+
this.spxSearch = new EventEmitter();
|
|
27
|
+
this.spxSubmit = new EventEmitter();
|
|
28
|
+
this.inputTypeRadio = SpxInputTypeEnum.radio;
|
|
29
|
+
this.inputTypeText = SpxInputTypeEnum.text;
|
|
30
|
+
this.severityError = SpxSeverityEnum.error;
|
|
31
|
+
this.severitySuccess = SpxSeverityEnum.success;
|
|
32
|
+
this.sections = [
|
|
33
|
+
{
|
|
34
|
+
key: sectionAutocompleteSearch,
|
|
35
|
+
showTitle: () => false,
|
|
36
|
+
fields: [
|
|
37
|
+
{
|
|
38
|
+
key: ctrlQuery,
|
|
39
|
+
type: () => SpxInputTypeEnum.text,
|
|
40
|
+
label: () => this.txtQuery,
|
|
41
|
+
capitalize: () => true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: ctrlOptions,
|
|
45
|
+
type: () => SpxInputTypeEnum.radio,
|
|
46
|
+
label: () => this.txtOptions,
|
|
47
|
+
},
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
this.createForm();
|
|
52
|
+
}
|
|
53
|
+
ngOnInit() {
|
|
54
|
+
this.listenToSelection();
|
|
55
|
+
this.listenToQuery();
|
|
56
|
+
this.ctrlQuery.setValue(this.spxValuePair, { emitEvent: false });
|
|
57
|
+
this.spxSearch.emit(this.spxValuePair);
|
|
58
|
+
}
|
|
59
|
+
ngOnDestroy() {
|
|
60
|
+
if (this.subSelection) {
|
|
61
|
+
this.subSelection.unsubscribe();
|
|
62
|
+
}
|
|
63
|
+
if (this.subQuery) {
|
|
64
|
+
this.subQuery.unsubscribe();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
createForm() {
|
|
68
|
+
this.formGroup = this.formBuilder.group({
|
|
69
|
+
[ctrlQuery]: [null],
|
|
70
|
+
[ctrlOptions]: [null],
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
getRawValidators(formControl) {
|
|
74
|
+
return formControl._rawValidators;
|
|
75
|
+
}
|
|
76
|
+
onCancel() {
|
|
77
|
+
this.spxCancel.emit();
|
|
78
|
+
}
|
|
79
|
+
onSubmit() {
|
|
80
|
+
this.spxSubmit.emit(this.ctrlQuery.value);
|
|
81
|
+
}
|
|
82
|
+
listenToQuery() {
|
|
83
|
+
this.subQuery = this.ctrlQuery.valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {
|
|
84
|
+
this.spxSearch.emit(valuePair);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
listenToSelection() {
|
|
88
|
+
this.subSelection = this.ctrlOptions.valueChanges.subscribe(valuePair => {
|
|
89
|
+
this.ctrlQuery.setValue(valuePair);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxAutocompleteSearchComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
93
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxAutocompleteSearchComponent, isStandalone: true, selector: "spx-autocomplete-search", inputs: { spxSuggestions: "spxSuggestions", spxField: "spxField", txtOptions: "txtOptions", txtQuery: "txtQuery", txtSubmit: "txtSubmit", spxValuePair: "spxValuePair" }, outputs: { spxCancel: "spxCancel", spxSearch: "spxSearch", spxSubmit: "spxSubmit" }, ngImport: i0, template: "<div class=\"bg-black fixed top-0 left-0 right-0 bottom-0 px-3 pt-16 z-50 overflow-auto\">\n <form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-input\n [formControl]=\"ctrlQuery\"\n [spxLabel]=\"txtQuery\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input\n [formControl]=\"ctrlOptions\"\n [spxLabel]=\"txtOptions\"\n [spxSuggestions]=\"spxSuggestions\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severityError\"\n [spxType]=\"'button'\"\n (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </form>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "value", "spxCapitalize", "spxFocused"], outputs: ["spxBlur", "spxClear", "spxChange", "spxFocus", "spxEdit", "spxHelp", "spxSearch"] }] }); }
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxAutocompleteSearchComponent, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{ selector: 'spx-autocomplete-search', standalone: true, imports: [
|
|
98
|
+
CommonModule,
|
|
99
|
+
FormsModule,
|
|
100
|
+
ReactiveFormsModule,
|
|
101
|
+
SpxButtonComponent,
|
|
102
|
+
SpxInputComponent,
|
|
103
|
+
SpxValidateControlComponent,
|
|
104
|
+
], template: "<div class=\"bg-black fixed top-0 left-0 right-0 bottom-0 px-3 pt-16 z-50 overflow-auto\">\n <form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-input\n [formControl]=\"ctrlQuery\"\n [spxLabel]=\"txtQuery\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input\n [formControl]=\"ctrlOptions\"\n [spxLabel]=\"txtOptions\"\n [spxSuggestions]=\"spxSuggestions\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severityError\"\n [spxType]=\"'button'\"\n (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </form>\n</div>\n" }]
|
|
105
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { spxSuggestions: [{
|
|
106
|
+
type: Input
|
|
107
|
+
}], spxField: [{
|
|
108
|
+
type: Input
|
|
109
|
+
}], txtOptions: [{
|
|
110
|
+
type: Input
|
|
111
|
+
}], txtQuery: [{
|
|
112
|
+
type: Input
|
|
113
|
+
}], txtSubmit: [{
|
|
114
|
+
type: Input
|
|
115
|
+
}], spxValuePair: [{
|
|
116
|
+
type: Input
|
|
117
|
+
}], spxCancel: [{
|
|
118
|
+
type: Output
|
|
119
|
+
}], spxSearch: [{
|
|
120
|
+
type: Output
|
|
121
|
+
}], spxSubmit: [{
|
|
122
|
+
type: Output
|
|
123
|
+
}] } });
|
|
124
|
+
|
|
125
|
+
class SpxFormViewComponent {
|
|
126
|
+
setAutofocus(key) {
|
|
127
|
+
const field = this.spxInputs.find(input => input.spxName === key);
|
|
128
|
+
if (field) {
|
|
129
|
+
field.setFocusIn();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
onBlur(field) {
|
|
133
|
+
this.spxBlur.emit({
|
|
134
|
+
field,
|
|
135
|
+
valuePair: this.spxFormGroup.get(field.key).value,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
onClick(field) {
|
|
139
|
+
this.spxClick.emit({
|
|
140
|
+
field,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
onAutocompleteCancel() {
|
|
144
|
+
this.autocompleteField = undefined;
|
|
145
|
+
}
|
|
146
|
+
onAutocompleteSearch(valuePair) {
|
|
147
|
+
console.log('spxFormView - onAutocompleteSearch: ', valuePair, this.autocompleteField);
|
|
148
|
+
if (this.autocompleteField) {
|
|
149
|
+
this.spxSearch.emit({
|
|
150
|
+
field: this.autocompleteField,
|
|
151
|
+
valuePair,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
onAutocompleteSave(valuePair) {
|
|
156
|
+
this.spxFormGroup.get(this.autocompleteField.key)?.setValue(valuePair);
|
|
157
|
+
this.autocompleteField = undefined;
|
|
158
|
+
}
|
|
159
|
+
onSearch(field) {
|
|
160
|
+
this.autocompleteField = field;
|
|
161
|
+
}
|
|
162
|
+
getRawValidators(formControl) {
|
|
163
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
164
|
+
return formControl._rawValidators;
|
|
165
|
+
}
|
|
166
|
+
hasRequiredField(abstractControl) {
|
|
167
|
+
if (abstractControl.validator) {
|
|
168
|
+
const validator = abstractControl.validator({});
|
|
169
|
+
if (validator && validator['required']) {
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (abstractControl['controls']) {
|
|
174
|
+
for (const controlName in abstractControl['controls']) {
|
|
175
|
+
if (abstractControl['controls'][controlName]) {
|
|
176
|
+
if (this.hasRequiredField(abstractControl['controls'][controlName])) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
static initialFormValue(sections) {
|
|
185
|
+
const formObject = {};
|
|
186
|
+
sections.forEach(section => {
|
|
187
|
+
section.fields.forEach(field => {
|
|
188
|
+
formObject[field.key] = [field.defaultValue ? field.defaultValue() : null, field.validators ? [...field.validators()] : []];
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
return formObject;
|
|
192
|
+
}
|
|
193
|
+
static createForm(formBuilder, sections) {
|
|
194
|
+
return formBuilder.group(this.initialFormValue(sections));
|
|
195
|
+
}
|
|
196
|
+
constructor(formBuilder) {
|
|
197
|
+
this.formBuilder = formBuilder;
|
|
198
|
+
this.spxBlur = new EventEmitter();
|
|
199
|
+
this.spxClick = new EventEmitter();
|
|
200
|
+
this.spxSearch = new EventEmitter();
|
|
201
|
+
this.typeAutocomplete = SpxInputTypeEnum.autocomplete;
|
|
202
|
+
this.typeButton = SpxInputTypeEnum.button;
|
|
203
|
+
this.typeFloat = SpxInputTypeEnum.float;
|
|
204
|
+
this.typeNumber = SpxInputTypeEnum.number;
|
|
205
|
+
this.typeRadio = SpxInputTypeEnum.radio;
|
|
206
|
+
this.typeText = SpxInputTypeEnum.text;
|
|
207
|
+
this.typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;
|
|
208
|
+
this.typeOverlay = SpxInputTypeEnum.overlay;
|
|
209
|
+
this.typeOverlayNumber = SpxInputTypeEnum.overlayNumber;
|
|
210
|
+
}
|
|
211
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxFormViewComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
212
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxFormViewComponent, isStandalone: true, selector: "spx-form-view", inputs: { spxFormGroup: "spxFormGroup", spxSections: "spxSections", spxSuggestions: "spxSuggestions" }, outputs: { spxBlur: "spxBlur", spxClick: "spxClick", spxSearch: "spxSearch" }, viewQueries: [{ propertyName: "spxInputs", predicate: SpxInputComponent, descendants: true }], ngImport: i0, template: `<spx-autocomplete-search
|
|
213
|
+
*ngIf="autocompleteField"
|
|
214
|
+
[spxField]="autocompleteField"
|
|
215
|
+
[spxSuggestions]="this.spxSuggestions[autocompleteField.key]"
|
|
216
|
+
[spxValuePair]="$any(this.spxFormGroup.get(autocompleteField.key)).value"
|
|
217
|
+
[txtOptions]="'Options'"
|
|
218
|
+
[txtQuery]="'Query'"
|
|
219
|
+
[txtSubmit]="'Save'"
|
|
220
|
+
(spxCancel)="onAutocompleteCancel()"
|
|
221
|
+
(spxSearch)="onAutocompleteSearch($event)"
|
|
222
|
+
(spxSubmit)="onAutocompleteSave($event)">
|
|
223
|
+
</spx-autocomplete-search>
|
|
224
|
+
<spx-form-section
|
|
225
|
+
*ngFor="let spxSection of spxSections; let spxSectionIndex = index;"
|
|
226
|
+
[spxShowTitle]="!spxSection.showTitle || spxSection.showTitle()"
|
|
227
|
+
[spxIndex]="spxSectionIndex + 1"
|
|
228
|
+
[spxTitle]="spxSection.title ? (spxSection.title() | translate | capitalize) : undefined">
|
|
229
|
+
<ng-container *ngFor="let spxField of spxSection.fields; let spxFieldIndex = index;">
|
|
230
|
+
<ng-container *ngIf="spxField.show === undefined || spxField.show()">
|
|
231
|
+
<spx-button *ngIf="spxField.type() === typeButton"
|
|
232
|
+
[spxFullWidth]="true"
|
|
233
|
+
[spxSeverity]="spxField.severity ? spxField.severity() : undefined"
|
|
234
|
+
[spxType]="'button'"
|
|
235
|
+
(spxClick)="onClick(spxField)"
|
|
236
|
+
>{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>
|
|
237
|
+
|
|
238
|
+
<spx-input
|
|
239
|
+
*ngIf="spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard"
|
|
240
|
+
[formControl]="$any(this.spxFormGroup.get(spxField.key))"
|
|
241
|
+
[spxAutofocus]="spxField.autofocus ? spxField.autofocus() : false"
|
|
242
|
+
[spxCapitalize]="spxField.capitalize ? spxField.capitalize() : false"
|
|
243
|
+
[spxLabel]="(spxField.label ? spxField.label() : spxField.key) | translate | capitalize"
|
|
244
|
+
[spxName]="spxField.key"
|
|
245
|
+
[spxPattern]="spxField.type() === typeNumericKeyboard ? '\\d*' : undefined"
|
|
246
|
+
[spxReadonly]="spxField.readonly ? spxField.readonly() : false"
|
|
247
|
+
[spxRequired]="hasRequiredField(this.spxFormGroup.get(spxField.key)!)"
|
|
248
|
+
[spxShowSearch]="spxField.type() === typeAutocomplete"
|
|
249
|
+
[spxShowHelp]="false"
|
|
250
|
+
[spxShowValidationMessages]="this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched"
|
|
251
|
+
[spxStep]="spxField.step ? spxField.step() : undefined"
|
|
252
|
+
[spxType]="spxField.type()"
|
|
253
|
+
[spxValidators]="getRawValidators(this.spxFormGroup.get(spxField.key)!)"
|
|
254
|
+
[spxSuggestions]="spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]"
|
|
255
|
+
(spxBlur)="onBlur(spxField)"
|
|
256
|
+
(spxSearch)="onSearch(spxField)">
|
|
257
|
+
<spx-validate-control [control]="$any(this.spxFormGroup.get(spxField.key))" [label]="(spxField.label ? spxField.label() : spxField.key)| translate | capitalize"></spx-validate-control>
|
|
258
|
+
</spx-input>
|
|
259
|
+
|
|
260
|
+
<spx-input
|
|
261
|
+
*ngIf="spxField.type() === typeRadio"
|
|
262
|
+
[formControl]="$any(this.spxFormGroup.get(spxField.key))"
|
|
263
|
+
[spxLabel]="(spxField.label ? spxField.label() : spxField.key) | translate | capitalize"
|
|
264
|
+
[spxName]="spxField.key"
|
|
265
|
+
[spxReadonly]="spxField.readonly ? spxField.readonly() : false"
|
|
266
|
+
[spxRequired]="hasRequiredField(this.spxFormGroup.get(spxField.key)!)"
|
|
267
|
+
[spxShowHelp]="false"
|
|
268
|
+
[spxShowValidationMessages]="this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched"
|
|
269
|
+
[spxSuggestions]="spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]"
|
|
270
|
+
[spxType]="typeRadio"
|
|
271
|
+
[spxValidators]="getRawValidators(this.spxFormGroup.get(spxField.key)!)">
|
|
272
|
+
<spx-validate-control [control]="$any(this.spxFormGroup.get(spxField.key))" [label]="(spxField.label ? spxField.label() : spxField.key) | translate | capitalize"></spx-validate-control>
|
|
273
|
+
</spx-input>
|
|
274
|
+
</ng-container>
|
|
275
|
+
</ng-container>
|
|
276
|
+
</spx-form-section>`, isInline: true, 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: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "component", type: SpxFormSectionComponent, selector: "spx-form-section", inputs: ["spxIndex", "spxIndexSecondary", "spxTitle", "spxShowTitle"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "value", "spxCapitalize", "spxFocused"], outputs: ["spxBlur", "spxClear", "spxChange", "spxFocus", "spxEdit", "spxHelp", "spxSearch"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
277
|
+
}
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxFormViewComponent, decorators: [{
|
|
279
|
+
type: Component,
|
|
280
|
+
args: [{
|
|
281
|
+
selector: 'spx-form-view',
|
|
282
|
+
standalone: true,
|
|
283
|
+
imports: [
|
|
284
|
+
FormsModule,
|
|
285
|
+
ReactiveFormsModule,
|
|
286
|
+
JsonPipe,
|
|
287
|
+
NgIf,
|
|
288
|
+
NgFor,
|
|
289
|
+
SpxAutocompleteSearchComponent,
|
|
290
|
+
SpxButtonComponent,
|
|
291
|
+
SpxCapitalizePipe,
|
|
292
|
+
SpxFormSectionComponent,
|
|
293
|
+
SpxInputComponent,
|
|
294
|
+
SpxValidateControlComponent,
|
|
295
|
+
TranslateModule,
|
|
296
|
+
],
|
|
297
|
+
template: `<spx-autocomplete-search
|
|
298
|
+
*ngIf="autocompleteField"
|
|
299
|
+
[spxField]="autocompleteField"
|
|
300
|
+
[spxSuggestions]="this.spxSuggestions[autocompleteField.key]"
|
|
301
|
+
[spxValuePair]="$any(this.spxFormGroup.get(autocompleteField.key)).value"
|
|
302
|
+
[txtOptions]="'Options'"
|
|
303
|
+
[txtQuery]="'Query'"
|
|
304
|
+
[txtSubmit]="'Save'"
|
|
305
|
+
(spxCancel)="onAutocompleteCancel()"
|
|
306
|
+
(spxSearch)="onAutocompleteSearch($event)"
|
|
307
|
+
(spxSubmit)="onAutocompleteSave($event)">
|
|
308
|
+
</spx-autocomplete-search>
|
|
309
|
+
<spx-form-section
|
|
310
|
+
*ngFor="let spxSection of spxSections; let spxSectionIndex = index;"
|
|
311
|
+
[spxShowTitle]="!spxSection.showTitle || spxSection.showTitle()"
|
|
312
|
+
[spxIndex]="spxSectionIndex + 1"
|
|
313
|
+
[spxTitle]="spxSection.title ? (spxSection.title() | translate | capitalize) : undefined">
|
|
314
|
+
<ng-container *ngFor="let spxField of spxSection.fields; let spxFieldIndex = index;">
|
|
315
|
+
<ng-container *ngIf="spxField.show === undefined || spxField.show()">
|
|
316
|
+
<spx-button *ngIf="spxField.type() === typeButton"
|
|
317
|
+
[spxFullWidth]="true"
|
|
318
|
+
[spxSeverity]="spxField.severity ? spxField.severity() : undefined"
|
|
319
|
+
[spxType]="'button'"
|
|
320
|
+
(spxClick)="onClick(spxField)"
|
|
321
|
+
>{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>
|
|
322
|
+
|
|
323
|
+
<spx-input
|
|
324
|
+
*ngIf="spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard"
|
|
325
|
+
[formControl]="$any(this.spxFormGroup.get(spxField.key))"
|
|
326
|
+
[spxAutofocus]="spxField.autofocus ? spxField.autofocus() : false"
|
|
327
|
+
[spxCapitalize]="spxField.capitalize ? spxField.capitalize() : false"
|
|
328
|
+
[spxLabel]="(spxField.label ? spxField.label() : spxField.key) | translate | capitalize"
|
|
329
|
+
[spxName]="spxField.key"
|
|
330
|
+
[spxPattern]="spxField.type() === typeNumericKeyboard ? '\\d*' : undefined"
|
|
331
|
+
[spxReadonly]="spxField.readonly ? spxField.readonly() : false"
|
|
332
|
+
[spxRequired]="hasRequiredField(this.spxFormGroup.get(spxField.key)!)"
|
|
333
|
+
[spxShowSearch]="spxField.type() === typeAutocomplete"
|
|
334
|
+
[spxShowHelp]="false"
|
|
335
|
+
[spxShowValidationMessages]="this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched"
|
|
336
|
+
[spxStep]="spxField.step ? spxField.step() : undefined"
|
|
337
|
+
[spxType]="spxField.type()"
|
|
338
|
+
[spxValidators]="getRawValidators(this.spxFormGroup.get(spxField.key)!)"
|
|
339
|
+
[spxSuggestions]="spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]"
|
|
340
|
+
(spxBlur)="onBlur(spxField)"
|
|
341
|
+
(spxSearch)="onSearch(spxField)">
|
|
342
|
+
<spx-validate-control [control]="$any(this.spxFormGroup.get(spxField.key))" [label]="(spxField.label ? spxField.label() : spxField.key)| translate | capitalize"></spx-validate-control>
|
|
343
|
+
</spx-input>
|
|
344
|
+
|
|
345
|
+
<spx-input
|
|
346
|
+
*ngIf="spxField.type() === typeRadio"
|
|
347
|
+
[formControl]="$any(this.spxFormGroup.get(spxField.key))"
|
|
348
|
+
[spxLabel]="(spxField.label ? spxField.label() : spxField.key) | translate | capitalize"
|
|
349
|
+
[spxName]="spxField.key"
|
|
350
|
+
[spxReadonly]="spxField.readonly ? spxField.readonly() : false"
|
|
351
|
+
[spxRequired]="hasRequiredField(this.spxFormGroup.get(spxField.key)!)"
|
|
352
|
+
[spxShowHelp]="false"
|
|
353
|
+
[spxShowValidationMessages]="this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched"
|
|
354
|
+
[spxSuggestions]="spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]"
|
|
355
|
+
[spxType]="typeRadio"
|
|
356
|
+
[spxValidators]="getRawValidators(this.spxFormGroup.get(spxField.key)!)">
|
|
357
|
+
<spx-validate-control [control]="$any(this.spxFormGroup.get(spxField.key))" [label]="(spxField.label ? spxField.label() : spxField.key) | translate | capitalize"></spx-validate-control>
|
|
358
|
+
</spx-input>
|
|
359
|
+
</ng-container>
|
|
360
|
+
</ng-container>
|
|
361
|
+
</spx-form-section>`,
|
|
362
|
+
}]
|
|
363
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { spxFormGroup: [{
|
|
364
|
+
type: Input
|
|
365
|
+
}], spxSections: [{
|
|
366
|
+
type: Input
|
|
367
|
+
}], spxSuggestions: [{
|
|
368
|
+
type: Input
|
|
369
|
+
}], spxBlur: [{
|
|
370
|
+
type: Output
|
|
371
|
+
}], spxClick: [{
|
|
372
|
+
type: Output
|
|
373
|
+
}], spxSearch: [{
|
|
374
|
+
type: Output
|
|
375
|
+
}], spxInputs: [{
|
|
376
|
+
type: ViewChildren,
|
|
377
|
+
args: [SpxInputComponent]
|
|
378
|
+
}] } });
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Generated bundle index. Do not edit.
|
|
382
|
+
*/
|
|
383
|
+
|
|
384
|
+
export { SpxFormViewComponent };
|
|
385
|
+
//# sourceMappingURL=softpak-components-spx-form-view.mjs.map
|