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

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 (36) hide show
  1. package/esm2022/spx-change-details/spx-change-details.component.mjs +92 -85
  2. package/esm2022/spx-channel-selection/src/spx-welcome.component.mjs +42 -42
  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 +29 -7
  7. package/esm2022/spx-form-view/spx-form.interface.mjs +2 -0
  8. package/esm2022/spx-pagination/public-api.mjs +2 -0
  9. package/esm2022/spx-pagination/softpak-components-spx-pagination.mjs +5 -0
  10. package/esm2022/spx-pagination/spx-pagination.component.mjs +33 -0
  11. package/esm2022/spx-stock-info/public-api.mjs +2 -1
  12. package/esm2022/spx-stock-info/spx-stock-info.component.mjs +111 -104
  13. package/fesm2022/softpak-components-spx-change-details.mjs +91 -84
  14. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
  15. package/fesm2022/softpak-components-spx-channel-selection.mjs +41 -41
  16. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  17. package/fesm2022/softpak-components-spx-form-view.mjs +35 -7
  18. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
  19. package/fesm2022/softpak-components-spx-pagination.mjs +40 -0
  20. package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -0
  21. package/fesm2022/softpak-components-spx-stock-info.mjs +110 -103
  22. package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
  23. package/package.json +18 -12
  24. package/spx-change-details/spx-change-details.component.d.ts +12 -16
  25. package/spx-channel-selection/src/spx-welcome.component.d.ts +6 -7
  26. package/spx-form-view/public-api.d.ts +3 -0
  27. package/spx-form-view/spx-form-button-type.enum.d.ts +4 -0
  28. package/spx-form-view/spx-form-button.interface.d.ts +8 -0
  29. package/spx-form-view/spx-form-view.component.d.ts +3 -2
  30. package/spx-form-view/spx-form.interface.d.ts +6 -0
  31. package/spx-pagination/index.d.ts +5 -0
  32. package/spx-pagination/public-api.d.ts +1 -0
  33. package/spx-pagination/spx-pagination.component.d.ts +13 -0
  34. package/spx-stock-info/public-api.d.ts +1 -0
  35. package/spx-stock-info/spx-stock-info.component.d.ts +5 -9
  36. package/tailwind.css +1 -1
@@ -5,7 +5,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
5
5
  import { spxValidatorRequired, SpxValidateControlComponent } from '@softpak/components/spx-validation';
6
6
  import { CommonModule } from '@angular/common';
7
7
  import { SpxInputTypeEnum, SpxInputComponent } from '@softpak/components/spx-inputs';
8
- import { SpxFormViewComponent } from '@softpak/components/spx-form-view';
8
+ import { SpxFormButtonTypeEnum, SpxFormViewComponent } from '@softpak/components/spx-form-view';
9
9
  import { SpxButtonComponent } from '@softpak/components/spx-button';
10
10
  import { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';
11
11
 
@@ -35,82 +35,87 @@ class SpxChangeDetailsComponent {
35
35
  this.spxSearchContainerType = new EventEmitter();
36
36
  this.spxSearchTonsTested = new EventEmitter();
37
37
  this.submit = new EventEmitter();
38
- this.inputTypeAutocomplete = SpxInputTypeEnum.autocomplete;
39
- this.inputTypeRadio = SpxInputTypeEnum.radio;
40
- this.inputTypeText = SpxInputTypeEnum.text;
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
- ];
38
+ this.form = {
39
+ buttons: [
40
+ {
41
+ severity: SpxSeverityEnum.success,
42
+ type: SpxFormButtonTypeEnum.submit,
43
+ label: () => this.textSave,
44
+ }
45
+ ],
46
+ sections: [
47
+ {
48
+ key: sectionChangeDetails,
49
+ showTitle: () => false,
50
+ fields: [
51
+ {
52
+ key: ctrlContainerNumber,
53
+ type: () => SpxInputTypeEnum.text,
54
+ label: () => this.textContainerNumber,
55
+ readonly: () => true,
56
+ validators: () => [spxValidatorRequired()],
57
+ },
58
+ {
59
+ key: ctrlContainerPrefix,
60
+ type: () => SpxInputTypeEnum.text,
61
+ label: () => this.textContainerPrefix,
62
+ capitalize: () => true,
63
+ readonly: () => true,
64
+ validators: () => [spxValidatorRequired()],
65
+ },
66
+ {
67
+ key: ctrlContainerSeqNr,
68
+ type: () => SpxInputTypeEnum.hidden,
69
+ validators: () => [spxValidatorRequired()],
70
+ },
71
+ {
72
+ key: ctrlCustomer,
73
+ type: () => SpxInputTypeEnum.text,
74
+ capitalize: () => true,
75
+ readonly: () => true,
76
+ label: () => this.textCustomer,
77
+ validators: () => [spxValidatorRequired()],
78
+ },
79
+ {
80
+ key: ctrlContainerType,
81
+ type: () => SpxInputTypeEnum.autocomplete,
82
+ label: () => this.textContainerType,
83
+ capitalize: () => true,
84
+ validators: () => [spxValidatorRequired()],
85
+ },
86
+ {
87
+ key: ctrlTonsTested,
88
+ type: () => SpxInputTypeEnum.radio,
89
+ label: () => this.textTonsTested,
90
+ show: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0,
91
+ validators: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0 ? [spxValidatorRequired()] : [],
92
+ },
93
+ {
94
+ key: ctrlLicensePlate,
95
+ type: () => SpxInputTypeEnum.text,
96
+ label: () => this.textLicensePlate,
97
+ capitalize: () => true,
98
+ },
99
+ {
100
+ key: ctrlUseCategories,
101
+ type: () => SpxInputTypeEnum.hidden,
102
+ capitalize: () => true,
103
+ },
104
+ {
105
+ key: ctrlCategory,
106
+ type: () => SpxInputTypeEnum.autocomplete,
107
+ label: () => this.textCategory,
108
+ capitalize: () => true,
109
+ show: () => valuePairToValue(this.ctrlUseCategories?.value),
110
+ validators: () => valuePairToValue(this.ctrlUseCategories?.value) ? [spxValidatorRequired()] : [],
111
+ }
112
+ ]
113
+ }
114
+ ]
115
+ };
111
116
  }
112
117
  createForm() {
113
- return SpxFormViewComponent.createForm(this.formBuilder, this.sections);
118
+ return SpxFormViewComponent.createForm(this.formBuilder, this.form.sections);
114
119
  }
115
120
  ngOnInit() {
116
121
  this.listenToContainerType();
@@ -157,7 +162,7 @@ class SpxChangeDetailsComponent {
157
162
  });
158
163
  }
159
164
  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"] }] }); }
165
+ 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", textCategory: "textCategory", textContainerNumber: "textContainerNumber", textContainerPrefix: "textContainerPrefix", textContainerType: "textContainerType", textCustomer: "textCustomer", textLicensePlate: "textLicensePlate", textSave: "textSave", textTonsTested: "textTonsTested" }, 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</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: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxForm", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }] }); }
161
166
  }
162
167
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxChangeDetailsComponent, decorators: [{
163
168
  type: Component,
@@ -169,24 +174,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
169
174
  SpxFormViewComponent,
170
175
  SpxInputComponent,
171
176
  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>" }]
177
+ ], 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</form>" }]
173
178
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { formGroup: [{
174
179
  type: Input
175
180
  }], suggestions: [{
176
181
  type: Input
177
- }], txtCategory: [{
182
+ }], textCategory: [{
178
183
  type: Input
179
- }], txtContainerNumber: [{
184
+ }], textContainerNumber: [{
180
185
  type: Input
181
- }], txtContainerPrefix: [{
186
+ }], textContainerPrefix: [{
182
187
  type: Input
183
- }], txtContainerType: [{
188
+ }], textContainerType: [{
184
189
  type: Input
185
- }], txtCustomer: [{
190
+ }], textCustomer: [{
186
191
  type: Input
187
- }], txtLicensePlate: [{
192
+ }], textLicensePlate: [{
188
193
  type: Input
189
- }], txtTonsTested: [{
194
+ }], textSave: [{
195
+ type: Input
196
+ }], textTonsTested: [{
190
197
  type: Input
191
198
  }], spxBlurCategory: [{
192
199
  type: Output
@@ -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,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAgB,CAAC,EAAE;AACrG,IAAA,IAAI,gBAAgB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAgB,CAAC,EAAE;AACnG,IAAA,IAAI,cAAc,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAgB,CAAC,EAAE;AAC/F,IAAA,IAAI,iBAAiB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,iBAAiB,CAAgB,CAAC,EAAE;AAItG,IAAA,WAAA,CAAqB,WAAwB,EAAA;QAAxB,IAAW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BAA2B;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 { SpxFormButtonTypeEnum, 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() textCategory!: string;\n @Input() textContainerNumber!: string;\n @Input() textContainerPrefix!: string;\n @Input() textContainerType!: string;\n @Input() textCustomer!: string;\n @Input() textLicensePlate!: string;\n @Input() textSave!: string;\n @Input() textTonsTested!: 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 form: SpxFormI = {\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSave,\n }\n ],\n sections: [\n {\n key: sectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: ctrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textContainerNumber,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerPrefix,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textContainerPrefix,\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.textCustomer,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textContainerType,\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textTonsTested,\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.textLicensePlate,\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.textCategory,\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</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;AAiGpC,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,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAgB,CAAC,EAAE;AACrG,IAAA,IAAI,gBAAgB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAgB,CAAC,EAAE;AACnG,IAAA,IAAI,cAAc,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAgB,CAAC,EAAE;AAC/F,IAAA,IAAI,iBAAiB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,iB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B,EAAA,CAAA;sBAA3B,KAAK;gBACG,iBAAiB,EAAA,CAAA;sBAAzB,KAAK;gBACG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACG,gBAAgB,EAAA,CAAA;sBAAxB,KAAK;gBACG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBACG,cAAc,EAAA,CAAA;sBAAtB,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;;;;"}
@@ -6,7 +6,7 @@ import * as i1 from '@angular/forms';
6
6
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
7
7
  import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
8
8
  import { SpxFormSectionComponent } from '@softpak/components/spx-form-section';
9
- import { SpxFormViewComponent } from '@softpak/components/spx-form-view';
9
+ import { SpxFormButtonTypeEnum, SpxFormViewComponent } from '@softpak/components/spx-form-view';
10
10
  import { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';
11
11
  import { SpxInputTypeEnum, SpxInputComponent } from '@softpak/components/spx-inputs';
12
12
  import { spxValidatorRequired } from '@softpak/components/spx-validation';
@@ -65,34 +65,42 @@ class SpxWelcomeComponent {
65
65
  this.channels = [];
66
66
  this.channelTypes = [];
67
67
  this.spxSelect = new EventEmitter();
68
- this.severitySuccess = SpxSeverityEnum.success;
69
68
  this.suggestions = {
70
69
  [ctrlChannelType]: [],
71
70
  [ctrlChannel]: [],
72
71
  };
73
72
  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
- ];
73
+ this.form = {
74
+ buttons: [
75
+ {
76
+ severity: SpxSeverityEnum.success,
77
+ type: SpxFormButtonTypeEnum.submit,
78
+ label: () => this.textSelect,
79
+ }
80
+ ],
81
+ sections: [
82
+ {
83
+ key: sectionWelcome,
84
+ showTitle: () => false,
85
+ fields: [
86
+ {
87
+ key: ctrlChannel,
88
+ type: () => SpxInputTypeEnum.radio,
89
+ label: () => this.textCompany,
90
+ validators: () => [spxValidatorRequired()],
91
+ },
92
+ {
93
+ key: ctrlChannelType,
94
+ type: () => SpxInputTypeEnum.radio,
95
+ label: () => this.textChannel,
96
+ capitalize: () => true,
97
+ show: () => valuePairToValue(this.ctrlChannel.value),
98
+ validators: () => [spxValidatorRequired()],
99
+ },
100
+ ]
101
+ }
102
+ ]
103
+ };
96
104
  }
97
105
  ngOnChanges(changes) {
98
106
  this.suggestions[ctrlChannel] = this.filteredCompanies;
@@ -119,21 +127,16 @@ class SpxWelcomeComponent {
119
127
  });
120
128
  }
121
129
  createForm() {
122
- return SpxFormViewComponent.createForm(this.formBuilder, this.sections);
130
+ return SpxFormViewComponent.createForm(this.formBuilder, this.form.sections);
123
131
  }
124
132
  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()">
133
+ 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", textChannel: "textChannel", textCompany: "textCompany", textSelect: "textSelect" }, 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
134
  <spx-form-view
135
+ [spxForm]="form"
127
136
  [spxFormGroup]="formGroup"
128
- [spxSections]="sections"
129
137
  [spxSuggestions]="suggestions">
130
138
  </spx-form-view>
131
- <spx-button
132
- [spxFullWidth]="true"
133
- [spxSeverity]="severitySuccess">
134
- Save
135
- </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"] }] }); }
139
+ </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: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxForm", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }] }); }
137
140
  }
138
141
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxWelcomeComponent, decorators: [{
139
142
  type: Component,
@@ -141,15 +144,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
141
144
  selector: 'spx-welcome',
142
145
  template: `<form [formGroup]="formGroup" class="max-w-lg mx-auto flex flex-col gap-3" (ngSubmit)="onSubmit()">
143
146
  <spx-form-view
147
+ [spxForm]="form"
144
148
  [spxFormGroup]="formGroup"
145
- [spxSections]="sections"
146
149
  [spxSuggestions]="suggestions">
147
150
  </spx-form-view>
148
- <spx-button
149
- [spxFullWidth]="true"
150
- [spxSeverity]="severitySuccess">
151
- Save
152
- </spx-button>
153
151
  </form>`,
154
152
  standalone: true,
155
153
  imports: [
@@ -169,9 +167,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
169
167
  type: Input
170
168
  }], formGroup: [{
171
169
  type: Input
172
- }], txtChannel: [{
170
+ }], textChannel: [{
171
+ type: Input
172
+ }], textCompany: [{
173
173
  type: Input
174
- }], txtCompany: [{
174
+ }], textSelect: [{
175
175
  type: Input
176
176
  }], spxSelect: [{
177
177
  type: Output
@@ -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,EAA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,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 { SpxFormButtonTypeEnum, SpxFormI, 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 </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() textChannel!: string;\n @Input() textCompany!: string;\n @Input() textSelect!: string;\n @Output() spxSelect: EventEmitter<SpxWelcomeValueI> = new EventEmitter<SpxWelcomeValueI>();\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.textSelect,\n }\n ],\n sections: [\n {\n key: sectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: ctrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textChannel,\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":";;;;;;;;;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CAAA;;;;;;AAMF,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,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBACG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBACG,UAAU,EAAA,CAAA;sBAAlB,KAAK;gBACI,SAAS,EAAA,CAAA;sBAAlB,MAAM;;;AChDT;;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]"
@@ -221,8 +227,9 @@ class SpxFormViewComponent {
221
227
  (spxSearch)="onAutocompleteSearch($event)"
222
228
  (spxSubmit)="onAutocompleteSave($event)">
223
229
  </spx-autocomplete-search>
230
+ <div class="flex flex-col gap-3">
224
231
  <spx-form-section
225
- *ngFor="let spxSection of spxSections; let spxSectionIndex = index;"
232
+ *ngFor="let spxSection of spxForm.sections; let spxSectionIndex = index;"
226
233
  [spxShowTitle]="!spxSection.showTitle || spxSection.showTitle()"
227
234
  [spxIndex]="spxSectionIndex + 1"
228
235
  [spxTitle]="spxSection.title ? (spxSection.title() | translate | capitalize) : undefined">
@@ -273,7 +280,17 @@ class SpxFormViewComponent {
273
280
  </spx-input>
274
281
  </ng-container>
275
282
  </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" }] }); }
283
+ </spx-form-section>
284
+
285
+ <spx-button *ngFor="let spxButton of spxForm.buttons"
286
+ [spxFullWidth]="true"
287
+ [spxSeverity]="spxButton.severity"
288
+ [spxType]="spxButton.type"
289
+ (spxClick)="spxButton.onClick ? spxButton.onClick() : undefined">
290
+ {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}
291
+ </spx-button>
292
+ </div>
293
+ `, 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
294
  }
278
295
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: SpxFormViewComponent, decorators: [{
279
296
  type: Component,
@@ -306,8 +323,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
306
323
  (spxSearch)="onAutocompleteSearch($event)"
307
324
  (spxSubmit)="onAutocompleteSave($event)">
308
325
  </spx-autocomplete-search>
326
+ <div class="flex flex-col gap-3">
309
327
  <spx-form-section
310
- *ngFor="let spxSection of spxSections; let spxSectionIndex = index;"
328
+ *ngFor="let spxSection of spxForm.sections; let spxSectionIndex = index;"
311
329
  [spxShowTitle]="!spxSection.showTitle || spxSection.showTitle()"
312
330
  [spxIndex]="spxSectionIndex + 1"
313
331
  [spxTitle]="spxSection.title ? (spxSection.title() | translate | capitalize) : undefined">
@@ -358,11 +376,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
358
376
  </spx-input>
359
377
  </ng-container>
360
378
  </ng-container>
361
- </spx-form-section>`,
379
+ </spx-form-section>
380
+
381
+ <spx-button *ngFor="let spxButton of spxForm.buttons"
382
+ [spxFullWidth]="true"
383
+ [spxSeverity]="spxButton.severity"
384
+ [spxType]="spxButton.type"
385
+ (spxClick)="spxButton.onClick ? spxButton.onClick() : undefined">
386
+ {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}
387
+ </spx-button>
388
+ </div>
389
+ `,
362
390
  }]
363
391
  }], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { spxFormGroup: [{
364
392
  type: Input
365
- }], spxSections: [{
393
+ }], spxForm: [{
366
394
  type: Input
367
395
  }], spxSuggestions: [{
368
396
  type: Input
@@ -381,5 +409,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImpor
381
409
  * Generated bundle index. Do not edit.
382
410
  */
383
411
 
384
- export { SpxFormViewComponent };
412
+ export { SpxFormButtonTypeEnum, SpxFormViewComponent };
385
413
  //# sourceMappingURL=softpak-components-spx-form-view.mjs.map