@softpak/components 0.0.0-beta.5 → 0.0.0-beta.51
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-alert/spx-alert.component.mjs +9 -4
- package/esm2022/spx-button/spx-button.component.mjs +8 -2
- 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 +118 -0
- package/esm2022/spx-channel-selection/src/spx-channel-selection.component.mjs +5 -4
- package/esm2022/spx-channel-selection/src/spx-company-selection.component.mjs +5 -4
- package/esm2022/spx-check-digit/spx-check-digit.component.mjs +6 -4
- package/esm2022/spx-form-section/spx-form-section.component.mjs +7 -7
- 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-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 +163 -0
- package/esm2022/spx-inputs/public-api.mjs +2 -1
- package/esm2022/spx-inputs/spx-input-box.component.mjs +9 -6
- package/esm2022/spx-inputs/spx-input-text.component.mjs +8 -5
- package/esm2022/spx-inputs/spx-input-type.enum.mjs +14 -0
- package/esm2022/spx-inputs/spx-input.component.mjs +12 -6
- package/esm2022/spx-navigation/spx-home-tile.component.mjs +24 -8
- package/esm2022/spx-navigation/spx-home-tiles.component.mjs +3 -5
- package/esm2022/spx-navigation/spx-navigation-item.interface.mjs +1 -1
- package/esm2022/spx-navigation/spx-navigation.component.mjs +3 -3
- package/esm2022/spx-number-check/public-api.mjs +2 -0
- package/esm2022/spx-number-check/softpak-components-spx-number-check.mjs +5 -0
- package/esm2022/spx-number-check/spx-number-check.component.mjs +262 -0
- package/esm2022/spx-progress-bar/spx-progress-bar.component.mjs +3 -3
- package/esm2022/spx-spinner/spx-spinner.component.mjs +5 -5
- package/esm2022/spx-suggestion/spx-suggestion.component.mjs +3 -3
- package/esm2022/spx-toaster/src/spx-toaster.component.mjs +33 -21
- package/fesm2022/softpak-components-spx-alert.mjs +8 -3
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +7 -1
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +125 -0
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-channel-selection.mjs +7 -5
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +5 -3
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +6 -6
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +170 -0
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-inputs.mjs +40 -15
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +27 -14
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +269 -0
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-progress-bar.mjs +2 -2
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +4 -4
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +2 -2
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +32 -20
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/package.json +46 -28
- 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 +40 -0
- package/spx-channel-selection/src/spx-channel-selection.component.d.ts +2 -1
- package/spx-channel-selection/src/spx-company-selection.component.d.ts +2 -1
- package/spx-check-digit/spx-check-digit.component.d.ts +3 -0
- package/spx-form-view/index.d.ts +5 -0
- package/spx-form-view/public-api.d.ts +3 -0
- package/spx-form-view/spx-form-field.interface.d.ts +16 -0
- package/spx-form-view/spx-form-section.interface.d.ts +9 -0
- package/spx-form-view/spx-form-view.component.d.ts +27 -0
- package/spx-inputs/public-api.d.ts +1 -0
- package/spx-inputs/spx-input-box.component.d.ts +2 -2
- package/spx-inputs/spx-input-type.enum.d.ts +12 -0
- package/spx-inputs/spx-input.component.d.ts +3 -2
- package/spx-navigation/spx-home-tile.component.d.ts +2 -1
- package/spx-navigation/spx-navigation-item.interface.d.ts +1 -0
- package/spx-number-check/index.d.ts +5 -0
- package/spx-number-check/public-api.d.ts +1 -0
- package/spx-number-check/spx-number-check.component.d.ts +48 -0
- package/spx-toaster/src/spx-toaster.component.d.ts +1 -1
- package/tailwind.css +1 -1
|
@@ -8,7 +8,7 @@ import { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spx
|
|
|
8
8
|
import { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';
|
|
9
9
|
import * as i2 from '@angular/common';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
|
-
import { SpxInputComponent } from '@softpak/components/spx-inputs';
|
|
11
|
+
import { SpxInputTypeEnum, SpxInputComponent } from '@softpak/components/spx-inputs';
|
|
12
12
|
|
|
13
13
|
const ctrlCheckDigit = 'checkDigit';
|
|
14
14
|
const ctrlContainerNumber = 'containerNumber';
|
|
@@ -19,6 +19,8 @@ class SpxCheckDigitComponent {
|
|
|
19
19
|
get ctrlContainerPrefix() { return this.formGroup.get(ctrlPrefix); }
|
|
20
20
|
constructor(formBuilder) {
|
|
21
21
|
this.formBuilder = formBuilder;
|
|
22
|
+
this.inputTypeOverlayNumber = SpxInputTypeEnum.overlayNumber;
|
|
23
|
+
this.inputTypeText = SpxInputTypeEnum.text;
|
|
22
24
|
this.formGroup = this.formBuilder.group({
|
|
23
25
|
[ctrlCheckDigit]: [null, []],
|
|
24
26
|
[ctrlContainerNumber]: [null, [
|
|
@@ -65,7 +67,7 @@ class SpxCheckDigitComponent {
|
|
|
65
67
|
return formControl._rawValidators;
|
|
66
68
|
}
|
|
67
69
|
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 }); }
|
|
68
|
-
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-
|
|
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-3\">\n <spx-input\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: "ngmodule", type: SpxValidationModule }, { kind: "component", type: i3.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", "spxCompact", "spxShowClear", "spxShowSearch", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "value", "spxCapitalize", "spxFocused"], outputs: ["spxBlur", "spxClear", "spxChange", "spxFocus", "spxEdit", "spxHelp", "spxSearch"] }] }); }
|
|
69
71
|
}
|
|
70
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxCheckDigitComponent, decorators: [{
|
|
71
73
|
type: Component,
|
|
@@ -75,7 +77,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
75
77
|
ReactiveFormsModule,
|
|
76
78
|
SpxValidationModule,
|
|
77
79
|
SpxInputComponent,
|
|
78
|
-
], template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-
|
|
80
|
+
], template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\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>" }]
|
|
79
81
|
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { txtCheckDigit: [{
|
|
80
82
|
type: Input
|
|
81
83
|
}], txtContainer: [{
|
|
@@ -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, SpxValidationModule } from '@softpak/components/spx-validation';\nimport { calcCheckDigit, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { CommonModule } from '@angular/common';\nimport { SpxInputComponent } 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 SpxValidationModule,\n SpxInputComponent,\n ]\n})\nexport class SpxCheckDigitComponent {\n @Input() txtCheckDigit!: string;\n @Input() txtContainer!: string;\n @Input() txtPrefix!: string;\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 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-
|
|
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, SpxValidationModule } 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 SpxValidationModule,\n SpxInputComponent,\n ]\n})\nexport class SpxCheckDigitComponent {\n @Input() txtCheckDigit!: string;\n @Input() txtContainer!: string;\n @Input() txtPrefix!: string;\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 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 [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;AAQjC,IAAA,IAAI,cAAc,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAgB,CAAC,EAAE;AAC/F,IAAA,IAAI,mBAAmB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAgB,CAAC,EAAE;AACzG,IAAA,IAAI,mBAAmB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAgB,CAAC,EAAE;AAIhG,IAAA,WAAA,CACmB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAa;AAX3C,QAAA,IAAA,CAAA,sBAAsB,GAAG,gBAAgB,CAAC,aAAa,CAAC;AACxD,QAAA,IAAA,CAAA,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAYpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AACtC,YAAA,CAAC,cAAc,GAAG,CAAC,IAAI,EA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,EAAA,gBAAA,EAAA,cAAA,EAAA,aAAA,EAAA,aAAA,EAAA,YAAA,EAAA,cAAA,EAAA,eAAA,EAAA,2BAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,eAAA,EAAA,OAAA,EAAA,eAAA,EAAA,YAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,WAAA,EAAA,UAAA,EAAA,SAAA,EAAA,SAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGR,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAZlC,SAAS;+BACE,iBAAiB,EAAA,UAAA,EAEf,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,mBAAmB;wBACnB,iBAAiB;AAClB,qBAAA,EAAA,QAAA,EAAA,mzCAAA,EAAA,CAAA;gFAGQ,aAAa,EAAA,CAAA;sBAArB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACG,SAAS,EAAA,CAAA;sBAAjB,KAAK;;;AE3BR;;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">
|
|
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">
|
|
11
11
|
<div class="spx-form-section__title-index">{{this.spxIndex}}<ng-container *ngIf="this.spxIndexSecondary">{{ this.spxIndexSecondary }}</ng-container></div>
|
|
12
12
|
<div class="spx-form-section__title-content">{{this.spxTitle}}</div>
|
|
13
13
|
</div>
|
|
14
|
-
<div class="spx-form-section__content">
|
|
14
|
+
<div class="spx-form-section__content 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, #000000);color:var(--spx-form-section--index--color, #FFFFFF);display:inline-block;font-size:14px;font-weight:700;height:30px;width:30px;line-height:30px;text-align:center;margin-right:12px;vertical-align:middle}.spx-form-section__title-content{color:var(--spx-form-section--title--color, grey);display:inline-block;font-size:var(--spx-form-section--title--font-size, 16px);font-weight:var(--spx-form-section--title--font-weight, bold);vertical-align:middle}\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">
|
|
22
|
+
], template: `<div *ngIf="this.spxShowTitle" class="spx-form-section__title mb-2">
|
|
23
23
|
<div class="spx-form-section__title-index">{{this.spxIndex}}<ng-container *ngIf="this.spxIndexSecondary">{{ this.spxIndexSecondary }}</ng-container></div>
|
|
24
24
|
<div class="spx-form-section__title-content">{{this.spxTitle}}</div>
|
|
25
25
|
</div>
|
|
26
|
-
<div class="spx-form-section__content">
|
|
26
|
+
<div class="spx-form-section__content 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, #000000);color:var(--spx-form-section--index--color, #FFFFFF);display:inline-block;font-size:14px;font-weight:700;height:30px;width:30px;line-height:30px;text-align:center;margin-right:12px;vertical-align:middle}.spx-form-section__title-content{color:var(--spx-form-section--title--color, grey);display:inline-block;font-size:var(--spx-form-section--title--font-size, 16px);font-weight:var(--spx-form-section--title--font-weight, bold);vertical-align:middle}\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-section__title-content\">{{this.spxTitle}}</div>\n </div>\n <div class=\"spx-form-section__content\">\n <ng-content></ng-content>\n </div>`,\n styles: `\n :host {\n display: block;\n
|
|
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\">\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-section__title-content\">{{this.spxTitle}}</div>\n </div>\n <div class=\"spx-form-section__content 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, #000000);\n color: var(--spx-form-section--index--color, #FFFFFF);\n display: inline-block;\n font-size: 14px;\n font-weight: bold;\n height: 30px;\n width: 30px;\n line-height: 30px;\n text-align: center;\n margin-right: 12px;\n vertical-align: middle;\n }\n \n .spx-form-section__title-content {\n color: var(--spx-form-section--title--color, grey);\n display: inline-block;\n font-size: var(--spx-form-section--title--font-size, 16px);\n font-weight: var(--spx-form-section--title--font-weight, bold);\n vertical-align: middle;\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":";;;;MA4Ca,uBAAuB,CAAA;AAzCpC,IAAA,WAAA,GAAA;QA6CW,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,EAnCxB,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,mkBAAA,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;;2FAqCK,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAzCnC,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAChB,IAAI,EACP,OAAA,EAAA;wBACP,IAAI;qBACL,EACS,QAAA,EAAA,CAAA;;;;;;AAMH,QAAA,CAAA,EAAA,MAAA,EAAA,CAAA,mkBAAA,CAAA,EAAA,CAAA;8BA8BE,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,iBAAiB,EAAA,CAAA;sBAAzB,KAAK;gBACG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;;;AChDR;;AAEG;;;;"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { NgIf, NgFor, JsonPipe } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Component, Input } 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
|
+
|
|
10
|
+
class SpxFormViewComponent {
|
|
11
|
+
onBlur(field) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
getRawValidators(formControl) {
|
|
15
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
16
|
+
return formControl._rawValidators;
|
|
17
|
+
}
|
|
18
|
+
hasRequiredField(abstractControl) {
|
|
19
|
+
if (abstractControl.validator) {
|
|
20
|
+
const validator = abstractControl.validator({});
|
|
21
|
+
if (validator && validator['required']) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (abstractControl['controls']) {
|
|
26
|
+
for (const controlName in abstractControl['controls']) {
|
|
27
|
+
if (abstractControl['controls'][controlName]) {
|
|
28
|
+
if (this.hasRequiredField(abstractControl['controls'][controlName])) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
static initialFormValue(sections) {
|
|
37
|
+
const formObject = {};
|
|
38
|
+
sections.forEach(section => {
|
|
39
|
+
section.fields.forEach(field => {
|
|
40
|
+
formObject[field.key] = [field.defaultValue ? field.defaultValue() : null, field.validators ? [...field.validators()] : []];
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
return formObject;
|
|
44
|
+
}
|
|
45
|
+
static createForm(formBuilder, sections) {
|
|
46
|
+
return formBuilder.group(this.initialFormValue(sections));
|
|
47
|
+
}
|
|
48
|
+
constructor(formBuilder) {
|
|
49
|
+
this.formBuilder = formBuilder;
|
|
50
|
+
this.typeAutocomplete = SpxInputTypeEnum.autocomplete;
|
|
51
|
+
this.typeFloat = SpxInputTypeEnum.float;
|
|
52
|
+
this.typeNumber = SpxInputTypeEnum.number;
|
|
53
|
+
this.typeRadio = SpxInputTypeEnum.radio;
|
|
54
|
+
this.typeText = SpxInputTypeEnum.text;
|
|
55
|
+
this.typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;
|
|
56
|
+
this.typeOverlay = SpxInputTypeEnum.overlay;
|
|
57
|
+
this.typeOverlayNumber = SpxInputTypeEnum.overlayNumber;
|
|
58
|
+
}
|
|
59
|
+
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 }); }
|
|
60
|
+
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" }, ngImport: i0, template: `<spx-form-section
|
|
61
|
+
*ngFor="let spxSection of spxSections; let spxSectionIndex = index;"
|
|
62
|
+
[spxShowTitle]="!spxSection.showTitle || spxSection.showTitle()"
|
|
63
|
+
[spxIndex]="spxSectionIndex + 1"
|
|
64
|
+
[spxTitle]="spxSection.title ? spxSection.title() : undefined">
|
|
65
|
+
<ng-container *ngFor="let spxField of spxSection.fields; let spxFieldIndex = index;">
|
|
66
|
+
<ng-container *ngIf="spxField.show === undefined || spxField.show()">
|
|
67
|
+
<spx-input
|
|
68
|
+
*ngIf="spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard"
|
|
69
|
+
[formControl]="$any(this.spxFormGroup.get(spxField.key))"
|
|
70
|
+
[spxAutofocus]="spxField.autofocus ? spxField.autofocus() : false"
|
|
71
|
+
[spxCapitalize]="spxField.capitalize ? spxField.capitalize() : false"
|
|
72
|
+
[spxLabel]="(spxField.label ? spxField.label() : spxField.key) | capitalize"
|
|
73
|
+
[spxPattern]="spxField.type() === typeNumericKeyboard ? '\\d*' : undefined"
|
|
74
|
+
[spxReadonly]="spxField.readonly ? spxField.readonly() : false"
|
|
75
|
+
[spxRequired]="hasRequiredField(this.spxFormGroup.get(spxField.key)!)"
|
|
76
|
+
[spxShowHelp]="false"
|
|
77
|
+
[spxShowValidationMessages]="this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched"
|
|
78
|
+
[spxStep]="spxField.step ? spxField.step() : undefined"
|
|
79
|
+
[spxType]="spxField.type()"
|
|
80
|
+
[spxValidators]="getRawValidators(this.spxFormGroup.get(spxField.key)!)"
|
|
81
|
+
[spxSuggestions]="spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]"
|
|
82
|
+
(spxBlur)="onBlur(spxField)">
|
|
83
|
+
</spx-input>
|
|
84
|
+
|
|
85
|
+
<spx-input
|
|
86
|
+
*ngIf="spxField.type() === typeRadio"
|
|
87
|
+
[formControl]="$any(this.spxFormGroup.get(spxField.key))"
|
|
88
|
+
[spxLabel]="(spxField.label ? spxField.label() : spxField.key) | capitalize"
|
|
89
|
+
[spxReadonly]="spxField.readonly ? spxField.readonly() : false"
|
|
90
|
+
[spxRequired]="hasRequiredField(this.spxFormGroup.get(spxField.key)!)"
|
|
91
|
+
[spxShowHelp]="false"
|
|
92
|
+
[spxShowValidationMessages]="this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched"
|
|
93
|
+
[spxSuggestions]="spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]"
|
|
94
|
+
[spxType]="typeRadio"
|
|
95
|
+
[spxValidators]="getRawValidators(this.spxFormGroup.get(spxField.key)!)">
|
|
96
|
+
</spx-input>
|
|
97
|
+
</ng-container>
|
|
98
|
+
</ng-container>
|
|
99
|
+
</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: "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", "spxCompact", "spxShowClear", "spxShowSearch", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "value", "spxCapitalize", "spxFocused"], outputs: ["spxBlur", "spxClear", "spxChange", "spxFocus", "spxEdit", "spxHelp", "spxSearch"] }] }); }
|
|
100
|
+
}
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxFormViewComponent, decorators: [{
|
|
102
|
+
type: Component,
|
|
103
|
+
args: [{
|
|
104
|
+
selector: 'spx-form-view',
|
|
105
|
+
standalone: true,
|
|
106
|
+
imports: [
|
|
107
|
+
FormsModule,
|
|
108
|
+
ReactiveFormsModule,
|
|
109
|
+
JsonPipe,
|
|
110
|
+
NgIf,
|
|
111
|
+
NgFor,
|
|
112
|
+
SpxCapitalizePipe,
|
|
113
|
+
SpxFormSectionComponent,
|
|
114
|
+
SpxInputComponent,
|
|
115
|
+
],
|
|
116
|
+
template: `<spx-form-section
|
|
117
|
+
*ngFor="let spxSection of spxSections; let spxSectionIndex = index;"
|
|
118
|
+
[spxShowTitle]="!spxSection.showTitle || spxSection.showTitle()"
|
|
119
|
+
[spxIndex]="spxSectionIndex + 1"
|
|
120
|
+
[spxTitle]="spxSection.title ? spxSection.title() : undefined">
|
|
121
|
+
<ng-container *ngFor="let spxField of spxSection.fields; let spxFieldIndex = index;">
|
|
122
|
+
<ng-container *ngIf="spxField.show === undefined || spxField.show()">
|
|
123
|
+
<spx-input
|
|
124
|
+
*ngIf="spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard"
|
|
125
|
+
[formControl]="$any(this.spxFormGroup.get(spxField.key))"
|
|
126
|
+
[spxAutofocus]="spxField.autofocus ? spxField.autofocus() : false"
|
|
127
|
+
[spxCapitalize]="spxField.capitalize ? spxField.capitalize() : false"
|
|
128
|
+
[spxLabel]="(spxField.label ? spxField.label() : spxField.key) | capitalize"
|
|
129
|
+
[spxPattern]="spxField.type() === typeNumericKeyboard ? '\\d*' : undefined"
|
|
130
|
+
[spxReadonly]="spxField.readonly ? spxField.readonly() : false"
|
|
131
|
+
[spxRequired]="hasRequiredField(this.spxFormGroup.get(spxField.key)!)"
|
|
132
|
+
[spxShowHelp]="false"
|
|
133
|
+
[spxShowValidationMessages]="this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched"
|
|
134
|
+
[spxStep]="spxField.step ? spxField.step() : undefined"
|
|
135
|
+
[spxType]="spxField.type()"
|
|
136
|
+
[spxValidators]="getRawValidators(this.spxFormGroup.get(spxField.key)!)"
|
|
137
|
+
[spxSuggestions]="spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]"
|
|
138
|
+
(spxBlur)="onBlur(spxField)">
|
|
139
|
+
</spx-input>
|
|
140
|
+
|
|
141
|
+
<spx-input
|
|
142
|
+
*ngIf="spxField.type() === typeRadio"
|
|
143
|
+
[formControl]="$any(this.spxFormGroup.get(spxField.key))"
|
|
144
|
+
[spxLabel]="(spxField.label ? spxField.label() : spxField.key) | capitalize"
|
|
145
|
+
[spxReadonly]="spxField.readonly ? spxField.readonly() : false"
|
|
146
|
+
[spxRequired]="hasRequiredField(this.spxFormGroup.get(spxField.key)!)"
|
|
147
|
+
[spxShowHelp]="false"
|
|
148
|
+
[spxShowValidationMessages]="this.spxFormGroup.get(spxField.key)! && this.spxFormGroup.get(spxField.key)!.errors && this.spxFormGroup.get(spxField.key)!.touched"
|
|
149
|
+
[spxSuggestions]="spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions[spxField.key]"
|
|
150
|
+
[spxType]="typeRadio"
|
|
151
|
+
[spxValidators]="getRawValidators(this.spxFormGroup.get(spxField.key)!)">
|
|
152
|
+
</spx-input>
|
|
153
|
+
</ng-container>
|
|
154
|
+
</ng-container>
|
|
155
|
+
</spx-form-section>`,
|
|
156
|
+
}]
|
|
157
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { spxFormGroup: [{
|
|
158
|
+
type: Input
|
|
159
|
+
}], spxSections: [{
|
|
160
|
+
type: Input
|
|
161
|
+
}], spxSuggestions: [{
|
|
162
|
+
type: Input
|
|
163
|
+
}] } });
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Generated bundle index. Do not edit.
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
export { SpxFormViewComponent };
|
|
170
|
+
//# sourceMappingURL=softpak-components-spx-form-view.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-form-view.mjs","sources":["../../../../projects/softpak/components/spx-form-view/spx-form-view.component.ts","../../../../projects/softpak/components/spx-form-view/softpak-components-spx-form-view.ts"],"sourcesContent":["import { JsonPipe, NgFor, NgIf } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxFormFieldI } from './spx-form-field.interface';\n\n@Component({\n selector: 'spx-form-view',\n standalone: true,\n imports: [\n FormsModule,\n ReactiveFormsModule,\n JsonPipe,\n NgIf,\n NgFor,\n SpxCapitalizePipe,\n SpxFormSectionComponent,\n SpxInputComponent,\n ],\n template: `<spx-form-section\n *ngFor=\"let spxSection of spxSections; let spxSectionIndex = index;\"\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? spxSection.title() : undefined\">\n <ng-container *ngFor=\"let spxField of spxSection.fields; let spxFieldIndex = index;\">\n <ng-container *ngIf=\"spxField.show === undefined || spxField.show()\">\n <spx-input\n *ngIf=\"spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard\"\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) | capitalize\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"hasRequiredField(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 [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.spxSuggestions[spxField.key]\"\n (spxBlur)=\"onBlur(spxField)\">\n </spx-input>\n\n <spx-input\n *ngIf=\"spxField.type() === typeRadio\"\n [formControl]=\"$any(this.spxFormGroup.get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | capitalize\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"hasRequiredField(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.spxSuggestions[spxField.key]\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup.get(spxField.key)!)\">\n </spx-input>\n </ng-container>\n </ng-container>\n </spx-form-section>`,\n})\nexport class SpxFormViewComponent {\n @Input() spxFormGroup!: FormGroup;\n @Input() spxSections!: SpxFormSectionI[];\n @Input() spxSuggestions!: any;\n\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\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 onBlur(field: SpxFormFieldI) {\n return;\n }\n\n getRawValidators(formControl: AbstractControl) {\n // eslint-disable-next-line no-underscore-dangle\n return (formControl as any)._rawValidators;\n }\n\n hasRequiredField(abstractControl: AbstractControl): boolean {\n if (abstractControl.validator) {\n const validator = abstractControl.validator({} as AbstractControl);\n if (validator && validator['required']) {\n return true;\n }\n }\n if ((abstractControl as any)['controls']) {\n for (const controlName in (abstractControl as any)['controls']) {\n if ((abstractControl as any)['controls'][controlName]) {\n if (this.hasRequiredField((abstractControl as any)['controls'][controlName])) {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n static initialFormValue(sections: SpxFormSectionI[]) {\n const formObject: any = {};\n sections.forEach(section => {\n section.fields.forEach(field => {\n formObject[field.key] = [field.defaultValue ? field.defaultValue() : null, field.validators ? [...field.validators()] : []];\n });\n });\n return formObject;\n }\n\n static createForm(formBuilder: FormBuilder, sections: SpxFormSectionI[]): FormGroup {\n return formBuilder.group(this.initialFormValue(sections));\n }\n\n constructor(readonly formBuilder: FormBuilder) {\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA+Da,oBAAoB,CAAA;AAc/B,IAAA,MAAM,CAAC,KAAoB,EAAA;QACzB,OAAO;KACR;AAED,IAAA,gBAAgB,CAAC,WAA4B,EAAA;;QAE3C,OAAQ,WAAmB,CAAC,cAAc,CAAC;KAC5C;AAED,IAAA,gBAAgB,CAAC,eAAgC,EAAA;AAC/C,QAAA,IAAI,eAAe,CAAC,SAAS,EAAE;YAC7B,MAAM,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,EAAqB,CAAC,CAAC;AACnE,YAAA,IAAI,SAAS,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE;AACtC,gBAAA,OAAO,IAAI,CAAC;aACb;SACF;AACD,QAAA,IAAK,eAAuB,CAAC,UAAU,CAAC,EAAE;YACxC,KAAK,MAAM,WAAW,IAAK,eAAuB,CAAC,UAAU,CAAC,EAAE;gBAC9D,IAAK,eAAuB,CAAC,UAAU,CAAC,CA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,EAAE,eAAe;AACzB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE;wBACP,WAAW;wBACX,mBAAmB;wBACnB,QAAQ;wBACR,IAAI;wBACJ,KAAK;wBACL,iBAAiB;wBACjB,uBAAuB;wBACvB,iBAAiB;AAClB,qBAAA;AACD,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCU,qBAAA,CAAA;AACrB,iBAAA,CAAA;gFAEU,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBACG,cAAc,EAAA,CAAA;sBAAtB,KAAK;;;AClER;;AAEG;;;;"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { NgIf, NgFor } from '@angular/common';
|
|
1
|
+
import { NgIf, NgFor, JsonPipe } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { EventEmitter, Component, Input, Output, HostListener } from '@angular/core';
|
|
4
4
|
import { SpxButtonComponent } from '@softpak/components/spx-button';
|
|
5
5
|
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
6
6
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
7
|
-
import { faEdit
|
|
7
|
+
import { faEdit } from '@fortawesome/free-solid-svg-icons/faEdit';
|
|
8
|
+
import { faQuestion } from '@fortawesome/free-solid-svg-icons/faQuestion';
|
|
9
|
+
import { faSearch } from '@fortawesome/free-solid-svg-icons/faSearch';
|
|
10
|
+
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
|
|
8
11
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
12
|
import { SpxSuggestionComponent } from '@softpak/components/spx-suggestion';
|
|
10
13
|
import { DateTime } from 'luxon';
|
|
@@ -18,7 +21,7 @@ class SpxInputBoxComponent {
|
|
|
18
21
|
this.spxReadonly = false;
|
|
19
22
|
this.spxShowClear = true;
|
|
20
23
|
this.spxClear = new EventEmitter();
|
|
21
|
-
this.
|
|
24
|
+
this.spxSearch = new EventEmitter();
|
|
22
25
|
this.spxFocus = new EventEmitter();
|
|
23
26
|
this.spxFocusOut = new EventEmitter();
|
|
24
27
|
this.spxEdit = new EventEmitter();
|
|
@@ -48,7 +51,7 @@ class SpxInputBoxComponent {
|
|
|
48
51
|
this.spxClear.emit();
|
|
49
52
|
}
|
|
50
53
|
onSearch() {
|
|
51
|
-
this.
|
|
54
|
+
this.spxSearch.emit();
|
|
52
55
|
}
|
|
53
56
|
onEdit() {
|
|
54
57
|
this.spxEdit.emit();
|
|
@@ -57,7 +60,7 @@ class SpxInputBoxComponent {
|
|
|
57
60
|
this.spxHelp.emit();
|
|
58
61
|
}
|
|
59
62
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
60
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputBoxComponent, isStandalone: true, selector: "spx-input-box", inputs: { spxLabel: "spxLabel", spxRequired: "spxRequired", spxReadonly: "spxReadonly", spxShowHelp: "spxShowHelp", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowEdit: "spxShowEdit", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxValue: "spxValue", spxFocused: "spxFocused" }, outputs: { spxClear: "spxClear",
|
|
63
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputBoxComponent, isStandalone: true, selector: "spx-input-box", inputs: { spxLabel: "spxLabel", spxRequired: "spxRequired", spxReadonly: "spxReadonly", spxShowHelp: "spxShowHelp", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowEdit: "spxShowEdit", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxValue: "spxValue", spxFocused: "spxFocused" }, outputs: { spxClear: "spxClear", spxSearch: "spxSearch", spxFocus: "spxFocus", spxFocusOut: "spxFocusOut", spxEdit: "spxEdit", spxHelp: "spxHelp" }, ngImport: i0, template: `<div class="flex rounded w-full gap-3"
|
|
61
64
|
[class.rounded-none]="this.spxShowValidationMessages"
|
|
62
65
|
[class.rounded-t]="this.spxShowValidationMessages"
|
|
63
66
|
[class.outline-none]="this.spxFocused && !this.spxReadonly"
|
|
@@ -219,7 +222,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
219
222
|
type: Input
|
|
220
223
|
}], spxClear: [{
|
|
221
224
|
type: Output
|
|
222
|
-
}],
|
|
225
|
+
}], spxSearch: [{
|
|
223
226
|
type: Output
|
|
224
227
|
}], spxFocus: [{
|
|
225
228
|
type: Output
|
|
@@ -280,6 +283,7 @@ class SpxInputTextComponent {
|
|
|
280
283
|
}
|
|
281
284
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
282
285
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputTextComponent, isStandalone: true, selector: "spx-input-text", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxSuggestions: "spxSuggestions", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused", spxType: "spxType", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxBlurFromChild: "spxBlurFromChild", spxChange: "spxChange", spxFocus: "spxFocus" }, ngImport: i0, template: `<div class="relative text-black">
|
|
286
|
+
{{ value | json }}
|
|
283
287
|
<input
|
|
284
288
|
class="font-bold text-lg w-full outline-none"
|
|
285
289
|
[class.bg-white]="!this.spxReadonly"
|
|
@@ -292,7 +296,7 @@ class SpxInputTextComponent {
|
|
|
292
296
|
[attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
|
|
293
297
|
[attr.name]="this.spxName"
|
|
294
298
|
[attr.type]="this.spxType"
|
|
295
|
-
[
|
|
299
|
+
[value]="this.value?.description ? this.value?.description : this.value?.value"
|
|
296
300
|
(blur)="this.handleBlur()"
|
|
297
301
|
(keyUp)="this.handleKeyUp()"
|
|
298
302
|
(focus)="this.handleFocus()"
|
|
@@ -312,7 +316,7 @@ class SpxInputTextComponent {
|
|
|
312
316
|
<spx-button spxType="button">Select</spx-button>
|
|
313
317
|
</div>
|
|
314
318
|
</div>
|
|
315
|
-
</div>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }] }); }
|
|
319
|
+
</div>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "pipe", type: JsonPipe, name: "json" }] }); }
|
|
316
320
|
}
|
|
317
321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, decorators: [{
|
|
318
322
|
type: Component,
|
|
@@ -323,8 +327,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
323
327
|
NgIf,
|
|
324
328
|
NgFor,
|
|
325
329
|
SpxButtonComponent,
|
|
330
|
+
JsonPipe,
|
|
326
331
|
],
|
|
327
332
|
template: `<div class="relative text-black">
|
|
333
|
+
{{ value | json }}
|
|
328
334
|
<input
|
|
329
335
|
class="font-bold text-lg w-full outline-none"
|
|
330
336
|
[class.bg-white]="!this.spxReadonly"
|
|
@@ -337,7 +343,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
337
343
|
[attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
|
|
338
344
|
[attr.name]="this.spxName"
|
|
339
345
|
[attr.type]="this.spxType"
|
|
340
|
-
[
|
|
346
|
+
[value]="this.value?.description ? this.value?.description : this.value?.value"
|
|
341
347
|
(blur)="this.handleBlur()"
|
|
342
348
|
(keyUp)="this.handleKeyUp()"
|
|
343
349
|
(focus)="this.handleFocus()"
|
|
@@ -968,6 +974,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
968
974
|
type: Output
|
|
969
975
|
}] } });
|
|
970
976
|
|
|
977
|
+
var SpxInputTypeEnum;
|
|
978
|
+
(function (SpxInputTypeEnum) {
|
|
979
|
+
SpxInputTypeEnum["autocomplete"] = "autocomplete";
|
|
980
|
+
SpxInputTypeEnum["date"] = "date";
|
|
981
|
+
SpxInputTypeEnum["float"] = "float";
|
|
982
|
+
SpxInputTypeEnum["overlay"] = "overlay";
|
|
983
|
+
SpxInputTypeEnum["overlayNumber"] = "overlaynumber";
|
|
984
|
+
SpxInputTypeEnum["radio"] = "radio";
|
|
985
|
+
SpxInputTypeEnum["number"] = "number";
|
|
986
|
+
SpxInputTypeEnum["password"] = "password";
|
|
987
|
+
SpxInputTypeEnum["text"] = "text";
|
|
988
|
+
SpxInputTypeEnum["textNumericKeyboard"] = "textNumericKeyboard";
|
|
989
|
+
})(SpxInputTypeEnum || (SpxInputTypeEnum = {}));
|
|
990
|
+
|
|
971
991
|
class SpxInputComponent {
|
|
972
992
|
constructor() {
|
|
973
993
|
this.spxLabel = 'label';
|
|
@@ -983,7 +1003,7 @@ class SpxInputComponent {
|
|
|
983
1003
|
this.spxShowSearch = false;
|
|
984
1004
|
this.spxShowValidationMessages = false;
|
|
985
1005
|
this.spxSuggestions = [];
|
|
986
|
-
this.spxType =
|
|
1006
|
+
this.spxType = SpxInputTypeEnum.text;
|
|
987
1007
|
this.spxCapitalize = false;
|
|
988
1008
|
this.spxBlur = new EventEmitter();
|
|
989
1009
|
this.spxClear = new EventEmitter();
|
|
@@ -996,7 +1016,7 @@ class SpxInputComponent {
|
|
|
996
1016
|
this.onChange = () => { };
|
|
997
1017
|
this.onTouched = () => { };
|
|
998
1018
|
}
|
|
999
|
-
|
|
1019
|
+
spxSetFocus() {
|
|
1000
1020
|
this.passFocusToControl();
|
|
1001
1021
|
}
|
|
1002
1022
|
handleBlur() {
|
|
@@ -1007,6 +1027,7 @@ class SpxInputComponent {
|
|
|
1007
1027
|
this.spxChange.emit(this.value);
|
|
1008
1028
|
}
|
|
1009
1029
|
handleClear() {
|
|
1030
|
+
this.spxClear.emit();
|
|
1010
1031
|
this.spxFocused = true;
|
|
1011
1032
|
this.passFocusToControl();
|
|
1012
1033
|
this.value = {
|
|
@@ -1016,6 +1037,7 @@ class SpxInputComponent {
|
|
|
1016
1037
|
this.spxChange.emit(this.value);
|
|
1017
1038
|
}
|
|
1018
1039
|
handleFocus() {
|
|
1040
|
+
this.spxFocus.emit();
|
|
1019
1041
|
this.spxFocused = true;
|
|
1020
1042
|
// this.elBox.spxSetFocus();
|
|
1021
1043
|
}
|
|
@@ -1030,14 +1052,17 @@ class SpxInputComponent {
|
|
|
1030
1052
|
this.spxFocused = false;
|
|
1031
1053
|
}
|
|
1032
1054
|
handleEdit() {
|
|
1055
|
+
this.spxEdit.emit();
|
|
1033
1056
|
this.spxFocused = true;
|
|
1034
1057
|
}
|
|
1035
1058
|
handleHelp() {
|
|
1059
|
+
this.spxHelp.emit();
|
|
1036
1060
|
this.spxFocused = true;
|
|
1037
1061
|
}
|
|
1038
1062
|
passFocusToControl() {
|
|
1039
1063
|
}
|
|
1040
1064
|
writeValue(value) {
|
|
1065
|
+
console.log('write value: set value', this.lastValue = value == null ? '' : value);
|
|
1041
1066
|
this.value = this.lastValue = value == null ? '' : value;
|
|
1042
1067
|
}
|
|
1043
1068
|
handleChangeEvent(value) {
|
|
@@ -1078,7 +1103,7 @@ class SpxInputComponent {
|
|
|
1078
1103
|
(spxHelp)="this.handleHelp()"
|
|
1079
1104
|
(spxFocus)="this.setFocus()"
|
|
1080
1105
|
(spxFocusOut)="this.setFocusOut()"
|
|
1081
|
-
(
|
|
1106
|
+
(spxSearch)="this.handleSearch()">
|
|
1082
1107
|
<div controls>
|
|
1083
1108
|
<spx-input-text
|
|
1084
1109
|
*ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
|
|
@@ -1151,7 +1176,7 @@ class SpxInputComponent {
|
|
|
1151
1176
|
<div validation-messages>
|
|
1152
1177
|
<ng-content></ng-content>
|
|
1153
1178
|
</div>
|
|
1154
|
-
</spx-input-box>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxInputBoxComponent, selector: "spx-input-box", inputs: ["spxLabel", "spxRequired", "spxReadonly", "spxShowHelp", "spxCompact", "spxShowClear", "spxShowEdit", "spxShowSearch", "spxShowValidationMessages", "spxValue", "spxFocused"], outputs: ["spxClear", "
|
|
1179
|
+
</spx-input-box>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxInputBoxComponent, selector: "spx-input-box", inputs: ["spxLabel", "spxRequired", "spxReadonly", "spxShowHelp", "spxCompact", "spxShowClear", "spxShowEdit", "spxShowSearch", "spxShowValidationMessages", "spxValue", "spxFocused"], outputs: ["spxClear", "spxSearch", "spxFocus", "spxFocusOut", "spxEdit", "spxHelp"] }, { kind: "component", type: SpxInputDateComponent, selector: "spx-input-date", inputs: ["spxMax", "spxMin", "spxName", "spxReadonly", "spxValidators", "spxFocused", "spxSelectMonth", "spxSelectDay", "value", "spxLastKeyPressed", "spxSelectStep", "spxInternalValue", "spxSuggestions", "spxWasInternalUpdate"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputFloatComponent, selector: "spx-input-float", inputs: ["spxName", "spxAutofocus", "spxReadonly", "spxValidators", "spxFocused", "spxStep", "value", "spxWasInternalUpdate", "tick"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputNumberComponent, selector: "spx-input-number", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxReadonly", "spxValidators", "spxFocused", "spxStep", "value"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputRadioComponent, selector: "spx-input-radio", inputs: ["spxName", "spxValidators", "spxFocused", "spxReadonly", "spxSuggestions", "value"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputTextComponent, selector: "spx-input-text", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxPattern", "spxSuggestions", "spxReadonly", "spxValidators", "spxCapitalize", "spxFocused", "spxType", "value", "spxWasInternalUpdate"], outputs: ["spxBlurFromChild", "spxChange", "spxFocus"] }] }); }
|
|
1155
1180
|
}
|
|
1156
1181
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
|
|
1157
1182
|
type: Component,
|
|
@@ -1193,7 +1218,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1193
1218
|
(spxHelp)="this.handleHelp()"
|
|
1194
1219
|
(spxFocus)="this.setFocus()"
|
|
1195
1220
|
(spxFocusOut)="this.setFocusOut()"
|
|
1196
|
-
(
|
|
1221
|
+
(spxSearch)="this.handleSearch()">
|
|
1197
1222
|
<div controls>
|
|
1198
1223
|
<spx-input-text
|
|
1199
1224
|
*ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
|
|
@@ -1339,5 +1364,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1339
1364
|
* Generated bundle index. Do not edit.
|
|
1340
1365
|
*/
|
|
1341
1366
|
|
|
1342
|
-
export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
|
|
1367
|
+
export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent, SpxInputTypeEnum };
|
|
1343
1368
|
//# sourceMappingURL=softpak-components-spx-inputs.mjs.map
|