@softpak/components 0.1.8-beta.1 → 0.1.8-beta.2

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.
Files changed (25) hide show
  1. package/esm2022/spx-change-details/spx-change-details.component.mjs +84 -73
  2. package/esm2022/spx-channel-selection/src/spx-welcome.component.mjs +39 -28
  3. package/esm2022/spx-form-view/public-api.mjs +4 -1
  4. package/esm2022/spx-form-view/spx-form-button-type.enum.mjs +6 -0
  5. package/esm2022/spx-form-view/spx-form-button.interface.mjs +2 -0
  6. package/esm2022/spx-form-view/spx-form-view.component.mjs +17 -7
  7. package/esm2022/spx-form-view/spx-form.interface.mjs +2 -0
  8. package/esm2022/spx-stock-info/spx-stock-info.component.mjs +110 -99
  9. package/fesm2022/softpak-components-spx-change-details.mjs +83 -72
  10. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
  11. package/fesm2022/softpak-components-spx-channel-selection.mjs +38 -27
  12. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  13. package/fesm2022/softpak-components-spx-form-view.mjs +23 -7
  14. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
  15. package/fesm2022/softpak-components-spx-stock-info.mjs +109 -98
  16. package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
  17. package/package.json +13 -13
  18. package/spx-change-details/spx-change-details.component.d.ts +4 -3
  19. package/spx-channel-selection/src/spx-welcome.component.d.ts +4 -3
  20. package/spx-form-view/public-api.d.ts +3 -0
  21. package/spx-form-view/spx-form-button-type.enum.d.ts +4 -0
  22. package/spx-form-view/spx-form-button.interface.d.ts +8 -0
  23. package/spx-form-view/spx-form-view.component.d.ts +3 -2
  24. package/spx-form-view/spx-form.interface.d.ts +6 -0
  25. package/spx-stock-info/spx-stock-info.component.d.ts +4 -3
@@ -39,78 +39,87 @@ class SpxChangeDetailsComponent {
39
39
  this.inputTypeRadio = SpxInputTypeEnum.radio;
40
40
  this.inputTypeText = SpxInputTypeEnum.text;
41
41
  this.severitySuccess = SpxSeverityEnum.success;
42
- this.sections = [
43
- {
44
- key: sectionChangeDetails,
45
- showTitle: () => false,
46
- fields: [
47
- {
48
- key: ctrlContainerNumber,
49
- type: () => SpxInputTypeEnum.text,
50
- label: () => this.txtContainerNumber,
51
- readonly: () => true,
52
- validators: () => [spxValidatorRequired()],
53
- },
54
- {
55
- key: ctrlContainerPrefix,
56
- type: () => SpxInputTypeEnum.text,
57
- label: () => this.txtContainerPrefix,
58
- capitalize: () => true,
59
- readonly: () => true,
60
- validators: () => [spxValidatorRequired()],
61
- },
62
- {
63
- key: ctrlContainerSeqNr,
64
- type: () => SpxInputTypeEnum.hidden,
65
- validators: () => [spxValidatorRequired()],
66
- },
67
- {
68
- key: ctrlCustomer,
69
- type: () => SpxInputTypeEnum.text,
70
- capitalize: () => true,
71
- readonly: () => true,
72
- label: () => this.txtCustomer,
73
- validators: () => [spxValidatorRequired()],
74
- },
75
- {
76
- key: ctrlContainerType,
77
- type: () => SpxInputTypeEnum.autocomplete,
78
- label: () => this.txtContainerType,
79
- capitalize: () => true,
80
- validators: () => [spxValidatorRequired()],
81
- },
82
- {
83
- key: ctrlTonsTested,
84
- type: () => SpxInputTypeEnum.radio,
85
- label: () => this.txtTonsTested,
86
- show: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0,
87
- validators: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0 ? [spxValidatorRequired()] : [],
88
- },
89
- {
90
- key: ctrlLicensePlate,
91
- type: () => SpxInputTypeEnum.text,
92
- label: () => this.txtLicensePlate,
93
- capitalize: () => true,
94
- },
95
- {
96
- key: ctrlUseCategories,
97
- type: () => SpxInputTypeEnum.hidden,
98
- capitalize: () => true,
99
- },
100
- {
101
- key: ctrlCategory,
102
- type: () => SpxInputTypeEnum.autocomplete,
103
- label: () => this.txtCategory,
104
- capitalize: () => true,
105
- show: () => valuePairToValue(this.ctrlUseCategories?.value),
106
- validators: () => valuePairToValue(this.ctrlUseCategories?.value) ? [spxValidatorRequired()] : [],
107
- }
108
- ]
109
- }
110
- ];
42
+ this.form = {
43
+ buttons: [
44
+ // {
45
+ // severity: SpxSeverityEnum.success,
46
+ // type: SpxFormButtonTypeEnum.submit,
47
+ // label: this.txtSearch,
48
+ // }
49
+ ],
50
+ sections: [
51
+ {
52
+ key: sectionChangeDetails,
53
+ showTitle: () => false,
54
+ fields: [
55
+ {
56
+ key: ctrlContainerNumber,
57
+ type: () => SpxInputTypeEnum.text,
58
+ label: () => this.txtContainerNumber,
59
+ readonly: () => true,
60
+ validators: () => [spxValidatorRequired()],
61
+ },
62
+ {
63
+ key: ctrlContainerPrefix,
64
+ type: () => SpxInputTypeEnum.text,
65
+ label: () => this.txtContainerPrefix,
66
+ capitalize: () => true,
67
+ readonly: () => true,
68
+ validators: () => [spxValidatorRequired()],
69
+ },
70
+ {
71
+ key: ctrlContainerSeqNr,
72
+ type: () => SpxInputTypeEnum.hidden,
73
+ validators: () => [spxValidatorRequired()],
74
+ },
75
+ {
76
+ key: ctrlCustomer,
77
+ type: () => SpxInputTypeEnum.text,
78
+ capitalize: () => true,
79
+ readonly: () => true,
80
+ label: () => this.txtCustomer,
81
+ validators: () => [spxValidatorRequired()],
82
+ },
83
+ {
84
+ key: ctrlContainerType,
85
+ type: () => SpxInputTypeEnum.autocomplete,
86
+ label: () => this.txtContainerType,
87
+ capitalize: () => true,
88
+ validators: () => [spxValidatorRequired()],
89
+ },
90
+ {
91
+ key: ctrlTonsTested,
92
+ type: () => SpxInputTypeEnum.radio,
93
+ label: () => this.txtTonsTested,
94
+ show: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0,
95
+ validators: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0 ? [spxValidatorRequired()] : [],
96
+ },
97
+ {
98
+ key: ctrlLicensePlate,
99
+ type: () => SpxInputTypeEnum.text,
100
+ label: () => this.txtLicensePlate,
101
+ capitalize: () => true,
102
+ },
103
+ {
104
+ key: ctrlUseCategories,
105
+ type: () => SpxInputTypeEnum.hidden,
106
+ capitalize: () => true,
107
+ },
108
+ {
109
+ key: ctrlCategory,
110
+ type: () => SpxInputTypeEnum.autocomplete,
111
+ label: () => this.txtCategory,
112
+ capitalize: () => true,
113
+ show: () => valuePairToValue(this.ctrlUseCategories?.value),
114
+ validators: () => valuePairToValue(this.ctrlUseCategories?.value) ? [spxValidatorRequired()] : [],
115
+ }
116
+ ]
117
+ }
118
+ ]
119
+ };
111
120
  }
112
121
  createForm() {
113
- return SpxFormViewComponent.createForm(this.formBuilder, this.sections);
122
+ return SpxFormViewComponent.createForm(this.formBuilder, this.form.sections);
114
123
  }
115
124
  ngOnInit() {
116
125
  this.listenToContainerType();
@@ -157,7 +166,7 @@ class SpxChangeDetailsComponent {
157
166
  });
158
167
  }
159
168
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxChangeDetailsComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
160
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.1", type: SpxChangeDetailsComponent, isStandalone: true, selector: "spx-change-details", inputs: { formGroup: "formGroup", suggestions: "suggestions", txtCategory: "txtCategory", txtContainerNumber: "txtContainerNumber", txtContainerPrefix: "txtContainerPrefix", txtContainerType: "txtContainerType", txtCustomer: "txtCustomer", txtLicensePlate: "txtLicensePlate", txtTonsTested: "txtTonsTested" }, outputs: { spxBlurCategory: "spxBlurCategory", spxBlurContainerType: "spxBlurContainerType", spxSearchCategory: "spxSearchCategory", spxSearchContainerType: "spxSearchContainerType", spxSearchTonsTested: "spxSearchTonsTested", submit: "submit" }, ngImport: i0, template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup\"\n [spxSections]=\"sections\"\n [spxSuggestions]=\"suggestions\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n</form>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxSections", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }] }); }
169
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.1", type: SpxChangeDetailsComponent, isStandalone: true, selector: "spx-change-details", inputs: { formGroup: "formGroup", suggestions: "suggestions", txtCategory: "txtCategory", txtContainerNumber: "txtContainerNumber", txtContainerPrefix: "txtContainerPrefix", txtContainerType: "txtContainerType", txtCustomer: "txtCustomer", txtLicensePlate: "txtLicensePlate", txtSearch: "txtSearch", txtTonsTested: "txtTonsTested" }, outputs: { spxBlurCategory: "spxBlurCategory", spxBlurContainerType: "spxBlurContainerType", spxSearchCategory: "spxSearchCategory", spxSearchContainerType: "spxSearchContainerType", spxSearchTonsTested: "spxSearchTonsTested", submit: "submit" }, ngImport: i0, template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup\"\n [spxForm]=\"form\"\n [spxSuggestions]=\"suggestions\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n</form>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxForm", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }] }); }
161
170
  }
162
171
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxChangeDetailsComponent, decorators: [{
163
172
  type: Component,
@@ -169,7 +178,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
169
178
  SpxFormViewComponent,
170
179
  SpxInputComponent,
171
180
  SpxValidateControlComponent,
172
- ], template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup\"\n [spxSections]=\"sections\"\n [spxSuggestions]=\"suggestions\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n</form>" }]
181
+ ], template: "<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup\"\n [spxForm]=\"form\"\n [spxSuggestions]=\"suggestions\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n</form>" }]
173
182
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { formGroup: [{
174
183
  type: Input
175
184
  }], suggestions: [{
@@ -186,6 +195,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
186
195
  type: Input
187
196
  }], txtLicensePlate: [{
188
197
  type: Input
198
+ }], txtSearch: [{
199
+ type: Input
189
200
  }], txtTonsTested: [{
190
201
  type: Input
191
202
  }], spxBlurCategory: [{
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-change-details.mjs","sources":["../../../../projects/softpak/components/spx-change-details/spx-change-details.component.ts","../../../../projects/softpak/components/spx-change-details/spx-change-details.component.html","../../../../projects/softpak/components/spx-change-details/softpak-components-spx-change-details.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { spxValidatorRequired, SpxValidateControlComponent } from '@softpak/components/spx-validation';\nimport { CommonModule } from '@angular/common';\nimport { SpxInputComponent, SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { SpxFormFieldI, SpxFormSectionI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxChangeDetailsValueI } from './spx-change-details-value.interface';\n\nexport const sectionChangeDetails = 'changeDetails';\nexport const ctrlContainerNumber = 'containerNumber';\nexport const ctrlContainerPrefix = 'containerPrefix';\nexport const ctrlContainerSeqNr = 'containerSeqNr';\nexport const ctrlContainerType = 'containerType';\nexport const ctrlCustomer = 'customer';\nexport const ctrlTonsTested = 'tonsTested';\nexport const ctrlLicensePlate = 'licensePlate';\nexport const ctrlCategory = 'category';\nexport const ctrlUseCategories = 'useCategories';\n\n@Component({\n selector: 'spx-change-details',\n templateUrl: './spx-change-details.component.html',\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxFormViewComponent,\n SpxInputComponent,\n SpxValidateControlComponent,\n ]\n})\nexport class SpxChangeDetailsComponent {\n @Input() formGroup!: FormGroup;\n @Input() suggestions: any = {};\n @Input() txtCategory!: string;\n @Input() txtContainerNumber!: string;\n @Input() txtContainerPrefix!: string;\n @Input() txtContainerType!: string;\n @Input() txtCustomer!: string;\n @Input() txtLicensePlate!: string;\n @Input() txtTonsTested!: string;\n @Output() spxBlurCategory: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() spxBlurContainerType: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchCategory: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchContainerType: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchTonsTested: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() submit: EventEmitter<SpxChangeDetailsValueI> = new EventEmitter<SpxChangeDetailsValueI>();\n\n inputTypeAutocomplete = SpxInputTypeEnum.autocomplete;\n inputTypeRadio = SpxInputTypeEnum.radio;\n inputTypeText = SpxInputTypeEnum.text;\n severitySuccess = SpxSeverityEnum.success;\n \n sections: SpxFormSectionI[] = [\n {\n key: sectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: ctrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtContainerNumber,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerPrefix,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtContainerPrefix,\n capitalize: () => true,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerSeqNr,\n type: () => SpxInputTypeEnum.hidden,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlCustomer,\n type: () => SpxInputTypeEnum.text,\n capitalize: () => true,\n readonly: () => true,\n label: () => this.txtCustomer,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.txtContainerType,\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtTonsTested,\n show: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0,\n validators: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0 ? [spxValidatorRequired()] : [],\n },\n {\n key: ctrlLicensePlate,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtLicensePlate,\n capitalize: () => true,\n },\n {\n key: ctrlUseCategories,\n type: () => SpxInputTypeEnum.hidden,\n capitalize: () => true,\n },\n {\n key: ctrlCategory,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.txtCategory,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlUseCategories?.value),\n validators: () => valuePairToValue(this.ctrlUseCategories?.value) ? [spxValidatorRequired()] : [],\n }\n ]\n }\n ];\n\n get ctrlCategory(): FormControl { return this.formGroup.get(ctrlCategory) as FormControl; }\n get ctrlCustomer(): FormControl { return this.formGroup.get(ctrlCustomer) as FormControl; }\n get ctrlContainerType(): FormControl { return this.formGroup.get(ctrlContainerType) as FormControl; }\n get ctrlLicensePlate(): FormControl { return this.formGroup.get(ctrlLicensePlate) as FormControl; }\n get ctrlTonsTested(): FormControl { return this.formGroup.get(ctrlTonsTested) as FormControl; }\n get ctrlUseCategories(): FormControl { return this.formGroup?.get(ctrlUseCategories) as FormControl; }\n\n private subContainerType?: Subscription;\n\n constructor(readonly formBuilder: FormBuilder) {\n }\n\n createForm(): FormGroup {\n return SpxFormViewComponent.createForm(this.formBuilder, this.sections);\n }\n\n ngOnInit(): void {\n this.listenToContainerType();\n }\n\n ngOnDestroy(): void {\n if (this.subContainerType) {\n this.subContainerType.unsubscribe();\n }\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onBlur(data: { field: SpxFormFieldI, valuePair: SpxValuePair<any> }) {\n if (data.field.key === ctrlCategory) {\n this.spxBlurCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxBlurContainerType.emit(data.valuePair);\n }\n }\n \n onSearch(data: { field: SpxFormFieldI, valuePair: SpxValuePair<any> }) {\n if (data.field.key === ctrlCategory) {\n this.spxSearchCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxSearchContainerType.emit(data.valuePair);\n }\n if (data.field.key === ctrlTonsTested) {\n this.spxSearchTonsTested.emit(data.valuePair);\n }\n }\n\n onSubmit(): void {\n this.submit.emit({\n category: valuePairToValue(this.ctrlUseCategories.value) ? this.ctrlCategory.value : null,\n containerType: this.ctrlContainerType.value,\n licensePlate: this.ctrlLicensePlate.value,\n tonsTested: this.ctrlTonsTested.value,\n })\n }\n\n private listenToContainerType(): void {\n this.subContainerType = this.ctrlContainerType.valueChanges.subscribe(valuePair => {\n this.ctrlTonsTested.setValue({ value: null });\n this.spxSearchTonsTested.emit(valuePair);\n });\n }\n}\n","<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup\"\n [spxSections]=\"sections\"\n [spxSuggestions]=\"suggestions\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAWO,MAAM,oBAAoB,GAAG,gBAAgB;AAC7C,MAAM,mBAAmB,GAAG,kBAAkB;AAC9C,MAAM,mBAAmB,GAAG,kBAAkB;AAC9C,MAAM,kBAAkB,GAAG,iBAAiB;AAC5C,MAAM,iBAAiB,GAAG,gBAAgB;AAC1C,MAAM,YAAY,GAAG,WAAW;AAChC,MAAM,cAAc,GAAG,aAAa;AACpC,MAAM,gBAAgB,GAAG,eAAe;AACxC,MAAM,YAAY,GAAG,WAAW;AAChC,MAAM,iBAAiB,GAAG,gBAAgB;MAgBpC,yBAAyB,CAAA;AA4FpC,IAAA,IAAI,YAAY,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAgB,CAAC,EAAE;AAC3F,IAAA,IAAI,YAAY,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAgB,CAAC,EAAE;AAC3F,IAAA,IAAI,iBAAiB,GAAA,EAAkB,OAAO,IAAI,C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IAAA,EAAA,WAAA,EAAA,IAAA,EAClB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,aAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAKX,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAdrC,SAAS;+BACE,oBAAoB,EAAA,UAAA,EAElB,IAAI,EACP,OAAA,EAAA;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,kBAAkB;wBAClB,oBAAoB;wBACpB,iBAAiB;wBACjB,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,0bAAA,EAAA,CAAA;gFAGQ,SAAS,EAAA,CAAA;sBAAjB,KAAK;gBACG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBACG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBACG,kBAAkB,EAAA,CAAA;sBAA1B,KAAK;gBACG,kBAAkB,EAAA,CAAA;sBAA1B,KAAK;gBACG,gBAAgB,EAAA,CAAA;sBAAxB,KAAK;gBACG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBACG,eAAe,EAAA,CAAA;sBAAvB,KAAK;gBACG,aAAa,EAAA,CAAA;sBAArB,KAAK;gBACI,eAAe,EAAA,CAAA;sBAAxB,MAAM;gBACG,oBAAoB,EAAA,CAAA;sBAA7B,MAAM;gBACG,iBAAiB,EAAA,CAAA;sBAA1B,MAAM;gBACG,sBAAsB,EAAA,CAAA;sBAA/B,MAAM;gBACG,mBAAmB,EAAA,CAAA;sBAA5B,MAAM;gBACG,MAAM,EAAA,CAAA;sBAAf,MAAM;;;AEnDT;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-change-details.mjs","sources":["../../../../projects/softpak/components/spx-change-details/spx-change-details.component.ts","../../../../projects/softpak/components/spx-change-details/spx-change-details.component.html","../../../../projects/softpak/components/spx-change-details/softpak-components-spx-change-details.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { spxValidatorRequired, SpxValidateControlComponent } from '@softpak/components/spx-validation';\nimport { CommonModule } from '@angular/common';\nimport { SpxInputComponent, SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { SpxFormFieldI, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxChangeDetailsValueI } from './spx-change-details-value.interface';\n\nexport const sectionChangeDetails = 'changeDetails';\nexport const ctrlContainerNumber = 'containerNumber';\nexport const ctrlContainerPrefix = 'containerPrefix';\nexport const ctrlContainerSeqNr = 'containerSeqNr';\nexport const ctrlContainerType = 'containerType';\nexport const ctrlCustomer = 'customer';\nexport const ctrlTonsTested = 'tonsTested';\nexport const ctrlLicensePlate = 'licensePlate';\nexport const ctrlCategory = 'category';\nexport const ctrlUseCategories = 'useCategories';\n\n@Component({\n selector: 'spx-change-details',\n templateUrl: './spx-change-details.component.html',\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxFormViewComponent,\n SpxInputComponent,\n SpxValidateControlComponent,\n ]\n})\nexport class SpxChangeDetailsComponent {\n @Input() formGroup!: FormGroup;\n @Input() suggestions: any = {};\n @Input() txtCategory!: string;\n @Input() txtContainerNumber!: string;\n @Input() txtContainerPrefix!: string;\n @Input() txtContainerType!: string;\n @Input() txtCustomer!: string;\n @Input() txtLicensePlate!: string;\n @Input() txtSearch!: string;\n @Input() txtTonsTested!: string;\n @Output() spxBlurCategory: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() spxBlurContainerType: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchCategory: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchContainerType: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() spxSearchTonsTested: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\n @Output() submit: EventEmitter<SpxChangeDetailsValueI> = new EventEmitter<SpxChangeDetailsValueI>();\n\n inputTypeAutocomplete = SpxInputTypeEnum.autocomplete;\n inputTypeRadio = SpxInputTypeEnum.radio;\n inputTypeText = SpxInputTypeEnum.text;\n severitySuccess = SpxSeverityEnum.success;\n\n form: SpxFormI = {\n buttons: [\n // {\n // severity: SpxSeverityEnum.success,\n // type: SpxFormButtonTypeEnum.submit,\n // label: this.txtSearch,\n // }\n ],\n sections: [\n {\n key: sectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: ctrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtContainerNumber,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerPrefix,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtContainerPrefix,\n capitalize: () => true,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerSeqNr,\n type: () => SpxInputTypeEnum.hidden,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlCustomer,\n type: () => SpxInputTypeEnum.text,\n capitalize: () => true,\n readonly: () => true,\n label: () => this.txtCustomer,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.txtContainerType,\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtTonsTested,\n show: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0,\n validators: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0 ? [spxValidatorRequired()] : [],\n },\n {\n key: ctrlLicensePlate,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtLicensePlate,\n capitalize: () => true,\n },\n {\n key: ctrlUseCategories,\n type: () => SpxInputTypeEnum.hidden,\n capitalize: () => true,\n },\n {\n key: ctrlCategory,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.txtCategory,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlUseCategories?.value),\n validators: () => valuePairToValue(this.ctrlUseCategories?.value) ? [spxValidatorRequired()] : [],\n }\n ]\n }\n ]\n };\n\n get ctrlCategory(): FormControl { return this.formGroup.get(ctrlCategory) as FormControl; }\n get ctrlCustomer(): FormControl { return this.formGroup.get(ctrlCustomer) as FormControl; }\n get ctrlContainerType(): FormControl { return this.formGroup.get(ctrlContainerType) as FormControl; }\n get ctrlLicensePlate(): FormControl { return this.formGroup.get(ctrlLicensePlate) as FormControl; }\n get ctrlTonsTested(): FormControl { return this.formGroup.get(ctrlTonsTested) as FormControl; }\n get ctrlUseCategories(): FormControl { return this.formGroup?.get(ctrlUseCategories) as FormControl; }\n\n private subContainerType?: Subscription;\n\n constructor(readonly formBuilder: FormBuilder) {\n }\n\n createForm(): FormGroup {\n return SpxFormViewComponent.createForm(this.formBuilder, this.form.sections);\n }\n\n ngOnInit(): void {\n this.listenToContainerType();\n }\n\n ngOnDestroy(): void {\n if (this.subContainerType) {\n this.subContainerType.unsubscribe();\n }\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onBlur(data: { field: SpxFormFieldI, valuePair: SpxValuePair<any> }) {\n if (data.field.key === ctrlCategory) {\n this.spxBlurCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxBlurContainerType.emit(data.valuePair);\n }\n }\n\n onSearch(data: { field: SpxFormFieldI, valuePair: SpxValuePair<any> }) {\n if (data.field.key === ctrlCategory) {\n this.spxSearchCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxSearchContainerType.emit(data.valuePair);\n }\n if (data.field.key === ctrlTonsTested) {\n this.spxSearchTonsTested.emit(data.valuePair);\n }\n }\n\n onSubmit(): void {\n this.submit.emit({\n category: valuePairToValue(this.ctrlUseCategories.value) ? this.ctrlCategory.value : null,\n containerType: this.ctrlContainerType.value,\n licensePlate: this.ctrlLicensePlate.value,\n tonsTested: this.ctrlTonsTested.value,\n })\n }\n\n private listenToContainerType(): void {\n this.subContainerType = this.ctrlContainerType.valueChanges.subscribe(valuePair => {\n this.ctrlTonsTested.setValue({ value: null });\n this.spxSearchTonsTested.emit(valuePair);\n });\n }\n}\n","<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup\"\n [spxForm]=\"form\"\n [spxSuggestions]=\"suggestions\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAWO,MAAM,oBAAoB,GAAG,gBAAgB;AAC7C,MAAM,mBAAmB,GAAG,kBAAkB;AAC9C,MAAM,mBAAmB,GAAG,kBAAkB;AAC9C,MAAM,kBAAkB,GAAG,iBAAiB;AAC5C,MAAM,iBAAiB,GAAG,gBAAgB;AAC1C,MAAM,YAAY,GAAG,WAAW;AAChC,MAAM,cAAc,GAAG,aAAa;AACpC,MAAM,gBAAgB,GAAG,eAAe;AACxC,MAAM,YAAY,GAAG,WAAW;AAChC,MAAM,iBAAiB,GAAG,gBAAgB;MAgBpC,yBA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K;gBACG,aAAa,EAAA,CAAA;sBAArB,KAAK;gBACI,eAAe,EAAA,CAAA;sBAAxB,MAAM;gBACG,oBAAoB,EAAA,CAAA;sBAA7B,MAAM;gBACG,iBAAiB,EAAA,CAAA;sBAA1B,MAAM;gBACG,sBAAsB,EAAA,CAAA;sBAA/B,MAAM;gBACG,mBAAmB,EAAA,CAAA;sBAA5B,MAAM;gBACG,MAAM,EAAA,CAAA;sBAAf,MAAM;;;AEpDT;;AAEG;;;;"}
@@ -71,28 +71,37 @@ class SpxWelcomeComponent {
71
71
  [ctrlChannel]: [],
72
72
  };
73
73
  this.subscriptions = {};
74
- this.sections = [
75
- {
76
- key: sectionWelcome,
77
- showTitle: () => false,
78
- fields: [
79
- {
80
- key: ctrlChannel,
81
- type: () => SpxInputTypeEnum.radio,
82
- label: () => this.txtCompany,
83
- validators: () => [spxValidatorRequired()],
84
- },
85
- {
86
- key: ctrlChannelType,
87
- type: () => SpxInputTypeEnum.radio,
88
- label: () => this.txtChannel,
89
- capitalize: () => true,
90
- show: () => valuePairToValue(this.ctrlChannel.value),
91
- validators: () => [spxValidatorRequired()],
92
- },
93
- ]
94
- }
95
- ];
74
+ this.form = {
75
+ buttons: [
76
+ // {
77
+ // severity: SpxSeverityEnum.success,
78
+ // type: SpxFormButtonTypeEnum.submit,
79
+ // label: this.txtSelect,
80
+ // }
81
+ ],
82
+ sections: [
83
+ {
84
+ key: sectionWelcome,
85
+ showTitle: () => false,
86
+ fields: [
87
+ {
88
+ key: ctrlChannel,
89
+ type: () => SpxInputTypeEnum.radio,
90
+ label: () => this.txtCompany,
91
+ validators: () => [spxValidatorRequired()],
92
+ },
93
+ {
94
+ key: ctrlChannelType,
95
+ type: () => SpxInputTypeEnum.radio,
96
+ label: () => this.txtChannel,
97
+ capitalize: () => true,
98
+ show: () => valuePairToValue(this.ctrlChannel.value),
99
+ validators: () => [spxValidatorRequired()],
100
+ },
101
+ ]
102
+ }
103
+ ]
104
+ };
96
105
  }
97
106
  ngOnChanges(changes) {
98
107
  this.suggestions[ctrlChannel] = this.filteredCompanies;
@@ -119,13 +128,13 @@ class SpxWelcomeComponent {
119
128
  });
120
129
  }
121
130
  createForm() {
122
- return SpxFormViewComponent.createForm(this.formBuilder, this.sections);
131
+ return SpxFormViewComponent.createForm(this.formBuilder, this.form.sections);
123
132
  }
124
133
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxWelcomeComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
125
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.1", type: SpxWelcomeComponent, isStandalone: true, selector: "spx-welcome", inputs: { channels: "channels", channelTypes: "channelTypes", formGroup: "formGroup", txtChannel: "txtChannel", txtCompany: "txtCompany" }, outputs: { spxSelect: "spxSelect" }, usesOnChanges: true, ngImport: i0, template: `<form [formGroup]="formGroup" class="max-w-lg mx-auto flex flex-col gap-3" (ngSubmit)="onSubmit()">
134
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.1", type: SpxWelcomeComponent, isStandalone: true, selector: "spx-welcome", inputs: { channels: "channels", channelTypes: "channelTypes", formGroup: "formGroup", txtChannel: "txtChannel", txtCompany: "txtCompany", txtSelect: "txtSelect" }, outputs: { spxSelect: "spxSelect" }, usesOnChanges: true, ngImport: i0, template: `<form [formGroup]="formGroup" class="max-w-lg mx-auto flex flex-col gap-3" (ngSubmit)="onSubmit()">
126
135
  <spx-form-view
136
+ [spxForm]="form"
127
137
  [spxFormGroup]="formGroup"
128
- [spxSections]="sections"
129
138
  [spxSuggestions]="suggestions">
130
139
  </spx-form-view>
131
140
  <spx-button
@@ -133,7 +142,7 @@ class SpxWelcomeComponent {
133
142
  [spxSeverity]="severitySuccess">
134
143
  Save
135
144
  </spx-button>
136
- </form>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxSections", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }] }); }
145
+ </form>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { 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: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxForm", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }] }); }
137
146
  }
138
147
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxWelcomeComponent, decorators: [{
139
148
  type: Component,
@@ -141,8 +150,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
141
150
  selector: 'spx-welcome',
142
151
  template: `<form [formGroup]="formGroup" class="max-w-lg mx-auto flex flex-col gap-3" (ngSubmit)="onSubmit()">
143
152
  <spx-form-view
153
+ [spxForm]="form"
144
154
  [spxFormGroup]="formGroup"
145
- [spxSections]="sections"
146
155
  [spxSuggestions]="suggestions">
147
156
  </spx-form-view>
148
157
  <spx-button
@@ -173,6 +182,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
173
182
  type: Input
174
183
  }], txtCompany: [{
175
184
  type: Input
185
+ }], txtSelect: [{
186
+ type: Input
176
187
  }], spxSelect: [{
177
188
  type: Output
178
189
  }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-welcome.component.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\n\n@Component({\n selector: 'spx-channel-indicator',\n template: `<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel?.brand }}</div>\n <div class=\"text-base text-gray-600\">{{ channelType }}</div>\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ txtChange }}</spx-button>\n </div>`,\n standalone: true,\n imports: [\n SpxButtonComponent,\n ],\n})\nexport class SpxChannelIndicatorComponent {\n @Input() channel?: SpxAppChannelI;\n @Input() channelType?: SpxAppChannelTypeEnum;\n @Input() txtChange!: string;\n @Output() spxChange: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(\n ) { }\n\n onChange() {\n this.spxChange.emit();\n }\n}\n","import { CommonModule, NgIf } from '@angular/common';\nimport { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges, OnInit, OnDestroy } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxFormSectionI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { Subscription } from 'rxjs';\n\nexport const sectionWelcome = 'welcome';\nexport const ctrlChannel = 'channel';\nexport const ctrlChannelType = 'channelType';\nexport interface SpxWelcomeValueI {\n [ctrlChannel]?: SpxAppChannelI;\n [ctrlChannelType]: SpxAppChannelTypeEnum;\n}\n\n@Component({\n selector: 'spx-welcome',\n template: `<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup\"\n [spxSections]=\"sections\"\n [spxSuggestions]=\"suggestions\">\n </spx-form-view>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n </form>`,\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxFormSectionComponent,\n SpxFormViewComponent,\n SpxInputComponent,\n NgIf,\n ]\n})\nexport class SpxWelcomeComponent implements OnChanges, OnInit, OnDestroy {\n @Input() channels?: SpxAppChannelI[] = [];\n @Input() channelTypes?: SpxAppChannelTypeEnum[] = [];\n @Input() formGroup!: FormGroup;\n @Input() txtChannel!: string;\n @Input() txtCompany!: string;\n @Output() spxSelect: EventEmitter<SpxWelcomeValueI> = new EventEmitter<SpxWelcomeValueI>();\n severitySuccess = SpxSeverityEnum.success;\n suggestions: {\n [ctrlChannelType]?: SpxValuePair<string>[];\n [ctrlChannel]?: SpxValuePair<string>[];\n } = {\n [ctrlChannelType]: [],\n [ctrlChannel]: [],\n };\n \n get ctrlChannel(): FormControl { return this.formGroup.get(ctrlChannel) as FormControl; }\n get ctrlChannelType(): FormControl { return this.formGroup.get(ctrlChannelType) as FormControl; }\n private subscriptions: {\n channel?: Subscription\n } = {};\n\n sections: SpxFormSectionI[] = [\n {\n key: sectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: ctrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel.value),\n validators: () => [spxValidatorRequired()],\n },\n ]\n }\n ];\n \n get filteredCompanies(): SpxValuePair<string>[] { return (this.channels ?? [])?.filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })); }\n\n constructor(readonly formBuilder: FormBuilder) {\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.suggestions[ctrlChannel] = this.filteredCompanies;\n }\n\n ngOnDestroy(): void {\n \n }\n\n ngOnInit(): void {\n this.subscriptions.channel = this.ctrlChannel.valueChanges.subscribe(valuePair => {\n const channel = this.channels?.find(c => c.brand === valuePairToValue(valuePair));\n this.suggestions[ctrlChannelType] = !channel ? [] : channel?.channelTypes?.map(ct => ({\n description: ct,\n value: ct\n }));\n this.ctrlChannelType.setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n });\n }\n\n onSubmit(): void {\n console.log('spxSelect emitting...');\n this.spxSelect.emit({\n channel: this.channels?.find(c => c.brand === valuePairToValue(this.ctrlChannel.value)),\n channelType: valuePairToValue(this.ctrlChannelType.value),\n });\n }\n\n createForm(): FormGroup {\n return SpxFormViewComponent.createForm(this.formBuilder, this.sections);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAkBa,4BAA4B,CAAA;AAMvC,IAAA,WAAA,GAAA;AAFU,QAAA,IAAA,CAAA,SAAS,GAAuB,IAAI,YAAY,EAAQ,CAAC;KAG9D;IAEL,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;8GAXU,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4BAA4B,EAZ7B,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,WAAA,EAAA,aAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,OAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;AAMH,QAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAGL,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,eAAA,EAAA,cAAA,EAAA,aAAA,EAAA,SAAA,EAAA,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,CAAA,cAAA,EAAA,aAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAKX,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBA1B/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;AAWF,SAAA,CAAA;AACR,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,kBAAkB;wBAClB,uBAAuB;wBACvB,oBAAoB;wBACpB,iBAAiB;wBACjB,IAAI;AACL,qBAAA;AACF,iBAAA,CAAA;gFAEU,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACG,SAAS,EAAA,CAAA;sBAAjB,KAAK;gBACG,UAAU,EAAA,CAAA;sBAAlB,KAAK;gBACG,UAAU,EAAA,CAAA;sBAAlB,KAAK;gBACI,SAAS,EAAA,CAAA;sBAAlB,MAAM;;;ACpDT;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-welcome.component.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\n\n@Component({\n selector: 'spx-channel-indicator',\n template: `<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel?.brand }}</div>\n <div class=\"text-base text-gray-600\">{{ channelType }}</div>\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ txtChange }}</spx-button>\n </div>`,\n standalone: true,\n imports: [\n SpxButtonComponent,\n ],\n})\nexport class SpxChannelIndicatorComponent {\n @Input() channel?: SpxAppChannelI;\n @Input() channelType?: SpxAppChannelTypeEnum;\n @Input() txtChange!: string;\n @Output() spxChange: EventEmitter<void> = new EventEmitter<void>();\n\n constructor(\n ) { }\n\n onChange() {\n this.spxChange.emit();\n }\n}\n","import { CommonModule, NgIf } from '@angular/common';\nimport { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges, OnInit, OnDestroy } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxFormI, SpxFormSectionI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { Subscription } from 'rxjs';\n\nexport const sectionWelcome = 'welcome';\nexport const ctrlChannel = 'channel';\nexport const ctrlChannelType = 'channelType';\nexport interface SpxWelcomeValueI {\n [ctrlChannel]?: SpxAppChannelI;\n [ctrlChannelType]: SpxAppChannelTypeEnum;\n}\n\n@Component({\n selector: 'spx-welcome',\n template: `<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxForm]=\"form\"\n [spxFormGroup]=\"formGroup\"\n [spxSuggestions]=\"suggestions\">\n </spx-form-view>\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"severitySuccess\">\n Save\n </spx-button>\n </form>`,\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxFormSectionComponent,\n SpxFormViewComponent,\n SpxInputComponent,\n NgIf,\n ]\n})\nexport class SpxWelcomeComponent implements OnChanges, OnInit, OnDestroy {\n @Input() channels?: SpxAppChannelI[] = [];\n @Input() channelTypes?: SpxAppChannelTypeEnum[] = [];\n @Input() formGroup!: FormGroup;\n @Input() txtChannel!: string;\n @Input() txtCompany!: string;\n @Input() txtSelect!: string;\n @Output() spxSelect: EventEmitter<SpxWelcomeValueI> = new EventEmitter<SpxWelcomeValueI>();\n severitySuccess = SpxSeverityEnum.success;\n suggestions: {\n [ctrlChannelType]?: SpxValuePair<string>[];\n [ctrlChannel]?: SpxValuePair<string>[];\n } = {\n [ctrlChannelType]: [],\n [ctrlChannel]: [],\n };\n\n get ctrlChannel(): FormControl { return this.formGroup.get(ctrlChannel) as FormControl; }\n get ctrlChannelType(): FormControl { return this.formGroup.get(ctrlChannelType) as FormControl; }\n private subscriptions: {\n channel?: Subscription\n } = {};\n\n form: SpxFormI = {\n buttons: [\n // {\n // severity: SpxSeverityEnum.success,\n // type: SpxFormButtonTypeEnum.submit,\n // label: this.txtSelect,\n // }\n ],\n sections: [\n {\n key: sectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: ctrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel.value),\n validators: () => [spxValidatorRequired()],\n },\n ]\n }\n ]\n };\n\n get filteredCompanies(): SpxValuePair<string>[] { return (this.channels ?? [])?.filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })); }\n\n constructor(readonly formBuilder: FormBuilder) {\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.suggestions[ctrlChannel] = this.filteredCompanies;\n }\n\n ngOnDestroy(): void {\n\n }\n\n ngOnInit(): void {\n this.subscriptions.channel = this.ctrlChannel.valueChanges.subscribe(valuePair => {\n const channel = this.channels?.find(c => c.brand === valuePairToValue(valuePair));\n this.suggestions[ctrlChannelType] = !channel ? [] : channel?.channelTypes?.map(ct => ({\n description: ct,\n value: ct\n }));\n this.ctrlChannelType.setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n });\n }\n\n onSubmit(): void {\n console.log('spxSelect emitting...');\n this.spxSelect.emit({\n channel: this.channels?.find(c => c.brand === valuePairToValue(this.ctrlChannel.value)),\n channelType: valuePairToValue(this.ctrlChannelType.value),\n });\n }\n\n createForm(): FormGroup {\n return SpxFormViewComponent.createForm(this.formBuilder, this.form.sections);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;MAkBa,4BAA4B,CAAA;AAMvC,IAAA,WAAA,GAAA;AAFU,QAAA,IAAA,CAAA,SAAS,GAAuB,IAAI,YAAY,EAAQ,CAAC;KAG9D;IAEL,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;8GAXU,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAA5B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4BAA4B,EAZ7B,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,WAAA,EAAA,aAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,OAAA,EAAA,EAA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BAAlB,MAAM;;;ACrDT;;AAEG;;;;"}
@@ -13,6 +13,12 @@ import { SpxValidateControlComponent } from '@softpak/components/spx-validation'
13
13
  import * as i2 from '@ngx-translate/core';
14
14
  import { TranslateModule } from '@ngx-translate/core';
15
15
 
16
+ var SpxFormButtonTypeEnum;
17
+ (function (SpxFormButtonTypeEnum) {
18
+ SpxFormButtonTypeEnum["button"] = "button";
19
+ SpxFormButtonTypeEnum["submit"] = "submit";
20
+ })(SpxFormButtonTypeEnum || (SpxFormButtonTypeEnum = {}));
21
+
16
22
  const sectionAutocompleteSearch = 'autocompleteSearch';
17
23
  const ctrlQuery = 'query';
18
24
  const ctrlOptions = 'options';
@@ -209,7 +215,7 @@ class SpxFormViewComponent {
209
215
  this.typeOverlayNumber = SpxInputTypeEnum.overlayNumber;
210
216
  }
211
217
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxFormViewComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
212
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.1", 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
218
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.1", type: SpxFormViewComponent, isStandalone: true, selector: "spx-form-view", inputs: { spxFormGroup: "spxFormGroup", spxForm: "spxForm", spxSuggestions: "spxSuggestions" }, outputs: { spxBlur: "spxBlur", spxClick: "spxClick", spxSearch: "spxSearch" }, viewQueries: [{ propertyName: "spxInputs", predicate: SpxInputComponent, descendants: true }], ngImport: i0, template: `<spx-autocomplete-search
213
219
  *ngIf="autocompleteField"
214
220
  [spxField]="autocompleteField"
215
221
  [spxSuggestions]="this.spxSuggestions[autocompleteField.key]"
@@ -222,7 +228,7 @@ class SpxFormViewComponent {
222
228
  (spxSubmit)="onAutocompleteSave($event)">
223
229
  </spx-autocomplete-search>
224
230
  <spx-form-section
225
- *ngFor="let spxSection of spxSections; let spxSectionIndex = index;"
231
+ *ngFor="let spxSection of spxForm.sections; let spxSectionIndex = index;"
226
232
  [spxShowTitle]="!spxSection.showTitle || spxSection.showTitle()"
227
233
  [spxIndex]="spxSectionIndex + 1"
228
234
  [spxTitle]="spxSection.title ? (spxSection.title() | translate | capitalize) : undefined">
@@ -273,7 +279,12 @@ class SpxFormViewComponent {
273
279
  </spx-input>
274
280
  </ng-container>
275
281
  </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" }] }); }
282
+ </spx-form-section>
283
+
284
+ <spx-button *ngFor="let spxButton of spxForm.buttons" [spxSeverity]="spxButton.severity" [spxType]="spxButton.type" (spxClick)="spxButton.onClick ? spxButton.onClick() : undefined">
285
+ {{ spxButton.label | translate | capitalize }}
286
+ </spx-button>
287
+ `, 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
288
  }
278
289
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxFormViewComponent, decorators: [{
279
290
  type: Component,
@@ -307,7 +318,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
307
318
  (spxSubmit)="onAutocompleteSave($event)">
308
319
  </spx-autocomplete-search>
309
320
  <spx-form-section
310
- *ngFor="let spxSection of spxSections; let spxSectionIndex = index;"
321
+ *ngFor="let spxSection of spxForm.sections; let spxSectionIndex = index;"
311
322
  [spxShowTitle]="!spxSection.showTitle || spxSection.showTitle()"
312
323
  [spxIndex]="spxSectionIndex + 1"
313
324
  [spxTitle]="spxSection.title ? (spxSection.title() | translate | capitalize) : undefined">
@@ -358,11 +369,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
358
369
  </spx-input>
359
370
  </ng-container>
360
371
  </ng-container>
361
- </spx-form-section>`,
372
+ </spx-form-section>
373
+
374
+ <spx-button *ngFor="let spxButton of spxForm.buttons" [spxSeverity]="spxButton.severity" [spxType]="spxButton.type" (spxClick)="spxButton.onClick ? spxButton.onClick() : undefined">
375
+ {{ spxButton.label | translate | capitalize }}
376
+ </spx-button>
377
+ `,
362
378
  }]
363
379
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { spxFormGroup: [{
364
380
  type: Input
365
- }], spxSections: [{
381
+ }], spxForm: [{
366
382
  type: Input
367
383
  }], spxSuggestions: [{
368
384
  type: Input
@@ -381,5 +397,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
381
397
  * Generated bundle index. Do not edit.
382
398
  */
383
399
 
384
- export { SpxFormViewComponent };
400
+ export { SpxFormButtonTypeEnum, SpxFormViewComponent };
385
401
  //# sourceMappingURL=softpak-components-spx-form-view.mjs.map