@softpak/components 21.3.2 → 21.3.4

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.
@@ -144,6 +144,9 @@ class SpxFormViewComponent {
144
144
  this.typeOverlay = SpxInputTypeEnum.overlay;
145
145
  this.typeOverlayNumber = SpxInputTypeEnum.overlayNumber;
146
146
  }
147
+ getSuggestionsForKey(key) {
148
+ return this.spxSuggestions()?.[key] ?? [];
149
+ }
147
150
  setAutofocus(key) {
148
151
  const field = this.spxInputs().find(input => input.nativeElement.spxName() === key);
149
152
  if (field) {
@@ -200,7 +203,7 @@ class SpxFormViewComponent {
200
203
  return new FormGroup(controls);
201
204
  }
202
205
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxFormViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
203
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxFormViewComponent, isStandalone: true, selector: "spx-form-view", inputs: { spxFormGroup: { classPropertyName: "spxFormGroup", publicName: "spxFormGroup", isSignal: true, isRequired: true, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: true, transformFunction: null }, spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxBlur: "spxBlur", spxClick: "spxClick", spxSearch: "spxSearch" }, viewQueries: [{ propertyName: "spxInputs", predicate: (ElementRef), descendants: true, isSignal: true }], ngImport: i0, template: "@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.spxSuggestions()[autoCompleteField()!.key]\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: SpxAutocompleteSearchComponent, selector: "spx-autocomplete-search", inputs: ["spxSuggestions", "spxField", "txtOptions", "txtQuery", "txtSubmit", "spxValuePair"], outputs: ["spxCancel", "spxSearch", "spxSubmit"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType", "spxName"], outputs: ["spxClick"] }, { kind: "component", type: SpxFormSectionComponent, selector: "spx-form-section", inputs: ["spxIndex", "spxIndexSecondary", "spxTitle", "spxShowTitle"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxSpeedDial", "spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize", "spxCycleConfig"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried", "errors", "touched"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
206
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxFormViewComponent, isStandalone: true, selector: "spx-form-view", inputs: { spxFormGroup: { classPropertyName: "spxFormGroup", publicName: "spxFormGroup", isSignal: true, isRequired: true, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: true, transformFunction: null }, spxSuggestions: { classPropertyName: "spxSuggestions", publicName: "spxSuggestions", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxBlur: "spxBlur", spxClick: "spxClick", spxSearch: "spxSearch" }, viewQueries: [{ propertyName: "spxInputs", predicate: (ElementRef), descendants: true, isSignal: true }], ngImport: i0, template: "@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: SpxAutocompleteSearchComponent, selector: "spx-autocomplete-search", inputs: ["spxSuggestions", "spxField", "txtOptions", "txtQuery", "txtSubmit", "spxValuePair"], outputs: ["spxCancel", "spxSearch", "spxSubmit"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType", "spxName"], outputs: ["spxClick"] }, { kind: "component", type: SpxFormSectionComponent, selector: "spx-form-section", inputs: ["spxIndex", "spxIndexSecondary", "spxTitle", "spxShowTitle"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxSpeedDial", "spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize", "spxCycleConfig"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried", "errors", "touched"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
204
207
  }
205
208
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxFormViewComponent, decorators: [{
206
209
  type: Component,
@@ -214,7 +217,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
214
217
  SpxInputComponent,
215
218
  SpxValidateControlComponent,
216
219
  TranslateModule
217
- ], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.spxSuggestions()[autoCompleteField()!.key]\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>" }]
220
+ ], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n" }]
218
221
  }], propDecorators: { spxFormGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxFormGroup", required: true }] }], spxForm: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxForm", required: true }] }], spxSuggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxSuggestions", required: true }] }], spxBlur: [{ type: i0.Output, args: ["spxBlur"] }], spxClick: [{ type: i0.Output, args: ["spxClick"] }], spxSearch: [{ type: i0.Output, args: ["spxSearch"] }], spxInputs: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => ElementRef), { isSignal: true }] }] } });
219
222
 
220
223
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-form-view.mjs","sources":["../../../../projects/softpak/components/spx-form-view/spx-form-button-type.enum.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.html","../../../../projects/softpak/components/spx-form-view/spx-check-required.const.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.html","../../../../projects/softpak/components/spx-form-view/softpak-components-spx-form-view.ts"],"sourcesContent":["export enum SpxFormButtonTypeEnum {\n button = 'button',\n submit = 'submit',\n}\n","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, input, output, signal } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, debounceTime } from 'rxjs';\n\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\n\nexport const sectionAutocompleteSearch = 'autocompleteSearch';\nexport const ctrlQuery = 'query';\nexport const ctrlOptions = 'options';\n\n@Component({\n selector: 'spx-autocomplete-search',\n templateUrl: './spx-autocomplete-search.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxInputComponent,\n ],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxAutocompleteSearchComponent implements OnInit, OnDestroy {\n formGroup = signal<FormGroup | null>(null);\n readonly spxSuggestions = input<SpxValuePair<any>[]>([]);\n readonly spxField = input.required<SpxFormFieldI>();\n readonly txtOptions = input.required<string>();\n readonly txtQuery = input.required<string>();\n readonly txtSubmit = input.required<string>();\n readonly spxValuePair = input.required<SpxValuePair<any>>();\n spxCancel = output();\n spxSearch = output<SpxValuePair<any>>();\n spxSubmit = output<SpxValuePair<any>>();\n inputTypeRadio = SpxInputTypeEnum.radio;\n inputTypeText = SpxInputTypeEnum.text;\n SpxSeverity = SpxSeverityEnum;\n \n sections: SpxFormSectionI[] = [\n {\n key: sectionAutocompleteSearch,\n showTitle: () => false,\n fields: [\n {\n key: ctrlQuery,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtQuery(),\n capitalize: () => true,\n },\n {\n key: ctrlOptions,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtOptions(),\n },\n ]\n }\n ];\n\n readonly ctrlQuery = computed(() => this.formGroup()?.get(ctrlQuery) as FormControl);\n readonly ctrlOptions = computed(() => this.formGroup()?.get(ctrlOptions) as FormControl);\n\n private subscriptions: {\n subSelection?: Subscription;\n subQuery?: Subscription;\n } = {};\n\n constructor(readonly formBuilder: FormBuilder) {\n this.createForm();\n }\n\n ngOnInit(): void {\n this.listenToSelection();\n this.listenToQuery();\n const spxValuePair = this.spxValuePair();\n this.ctrlQuery().setValue(spxValuePair, { emitEvent: false });\n this.spxSearch.emit(spxValuePair);\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n private createForm(): void {\n this.formGroup.set(this.formBuilder.group({\n [ctrlQuery]: [null],\n [ctrlOptions]: [null],\n }));\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onCancel(): void {\n this.spxCancel.emit();\n }\n \n onSubmit(): void {\n this.spxSubmit.emit(this.ctrlQuery().value);\n }\n\n private listenToQuery(): void {\n this.subscriptions.subQuery = this.ctrlQuery().valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {\n this.spxSearch.emit(valuePair);\n });\n }\n\n private listenToSelection(): void {\n this.subscriptions.subSelection = this.ctrlOptions().valueChanges.subscribe(valuePair => {\n this.ctrlQuery().setValue(valuePair);\n });\n }\n}\n","@if(formGroup()) {\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\n </form>\n}\n","import { AbstractControl, FormArray, FormGroup, ValidationErrors } from \"@angular/forms\";\n\nexport const checkRequired = (control: AbstractControl): boolean => {\n // Check of deze control zelf 'required' is\n const errors: ValidationErrors | null = control.validator?.({} as AbstractControl) ?? null;\n if (errors?.['required']) {\n return true;\n }\n\n // Als het een FormGroup of FormArray is, check alle children\n if (control instanceof FormGroup || control instanceof FormArray) {\n return Object.values(control.controls).some(child => checkRequired(child));\n }\n return false;\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, inject, input, output, signal, viewChildren } from '@angular/core';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, ValidationErrors } from '@angular/forms';\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxAutocompleteSearchComponent } from './spx-autocomplete-search.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { SpxFormI } from './spx-form.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent } from '@softpak/components/spx-validation';\nimport { checkRequired } from './spx-check-required.const';\n\n@Component({\n selector: 'spx-form-view',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxAutocompleteSearchComponent,\n SpxButtonComponent,\n SpxCapitalizePipe,\n SpxFormSectionComponent,\n SpxInputComponent,\n SpxValidateControlComponent,\n TranslateModule\n ],\n templateUrl: './spx-form-view.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxFormViewComponent {\n readonly checkRequired = checkRequired;\n readonly formBuilder = inject(FormBuilder);\n readonly spxFormGroup = input.required<FormGroup>();\n readonly spxForm = input.required<SpxFormI>();\n readonly spxSuggestions = input.required<any>();\n spxBlur = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxClick = output<{ field: SpxFormFieldI }>();\n spxSearch = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxInputs = viewChildren(ElementRef<SpxInputComponent>);\n autoCompleteField = signal<SpxFormFieldI | null>(null);\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\n typeButton = SpxInputTypeEnum.button;\n typeFloat = SpxInputTypeEnum.float;\n typeNumber = SpxInputTypeEnum.number;\n typeRadio = SpxInputTypeEnum.radio;\n typeText = SpxInputTypeEnum.text;\n typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;\n typeOverlay = SpxInputTypeEnum.overlay;\n typeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n\n setAutofocus(key: string): void {\n const field = this.spxInputs().find(input => input.nativeElement.spxName() === key);\n if (field) {\n field.nativeElement.setFocusIn();\n }\n }\n\n onBlur(field: SpxFormFieldI) {\n this.spxBlur.emit({\n field,\n valuePair: this.spxFormGroup().get(field.key)!.value,\n });\n }\n\n onClick(field: SpxFormFieldI) {\n this.spxClick.emit({\n field,\n });\n }\n\n onAutocompleteCancel(): void {\n this.autoCompleteField.set(null);\n }\n\n onAutocompleteSearch(valuePair: SpxValuePair<any>): void {\n if (this.autoCompleteField()) {\n this.spxSearch.emit({\n field: this.autoCompleteField()!,\n valuePair,\n });\n }\n }\n\n onAutocompleteSave(valuePair: SpxValuePair<any>) {\n this.spxFormGroup().get(this.autoCompleteField()!.key)?.setValue(valuePair);\n this.autoCompleteField.set(null);\n }\n\n onSearch(field: SpxFormFieldI) {\n this.autoCompleteField.set(field);\n }\n\n getRawValidators(formControl: AbstractControl) {\n // eslint-disable-next-line no-underscore-dangle\n return (formControl as any)._rawValidators;\n }\n\n static createForm(form: SpxFormI): FormGroup {\n const controls = form.sections.flatMap(section => section.fields).reduce((acc, field) => {\n const control = new FormControl(\n field.defaultValue?.() as any ?? null,\n field.defaultValidators?.() ?? []\n );\n\n // Koppel automatisch afterValueChange als die bestaat\n if (field.afterValueChange) {\n console.log('avc 1');\n control.valueChanges.subscribe((valuePair) => {\n field.afterValueChange!(valuePair as SpxValuePair<boolean | string | number> | null);\n console.log('avc 2', valuePair);\n });\n }\n\n acc[field.key] = control;\n return acc;\n }, {} as { [key: string]: FormControl });\n return new FormGroup(controls);\n }\n}\n","@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.spxSuggestions()[autoCompleteField()!.key]\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.spxSuggestions()[spxField.key]\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,qBAAqB,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AA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAUR,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAjBhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAChB;wBACP,WAAW;wBACX,mBAAmB;wBACnB,8BAA8B;wBAC9B,kBAAkB;wBAClB,iBAAiB;wBACjB,uBAAuB;wBACvB,iBAAiB;wBACjB,2BAA2B;wBAC3B;AACD,qBAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,swKAAA,EAAA;4iBAWS,UAA6B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExCxD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-form-view.mjs","sources":["../../../../projects/softpak/components/spx-form-view/spx-form-button-type.enum.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.ts","../../../../projects/softpak/components/spx-form-view/spx-autocomplete-search.component.html","../../../../projects/softpak/components/spx-form-view/spx-check-required.const.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.ts","../../../../projects/softpak/components/spx-form-view/spx-form-view.component.html","../../../../projects/softpak/components/spx-form-view/softpak-components-spx-form-view.ts"],"sourcesContent":["export enum SpxFormButtonTypeEnum {\n button = 'button',\n submit = 'submit',\n}\n","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, input, output, signal } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, debounceTime } from 'rxjs';\n\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\n\nexport const sectionAutocompleteSearch = 'autocompleteSearch';\nexport const ctrlQuery = 'query';\nexport const ctrlOptions = 'options';\n\n@Component({\n selector: 'spx-autocomplete-search',\n templateUrl: './spx-autocomplete-search.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxButtonComponent,\n SpxInputComponent,\n ],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxAutocompleteSearchComponent implements OnInit, OnDestroy {\n formGroup = signal<FormGroup | null>(null);\n readonly spxSuggestions = input<SpxValuePair<any>[]>([]);\n readonly spxField = input.required<SpxFormFieldI>();\n readonly txtOptions = input.required<string>();\n readonly txtQuery = input.required<string>();\n readonly txtSubmit = input.required<string>();\n readonly spxValuePair = input.required<SpxValuePair<any>>();\n spxCancel = output();\n spxSearch = output<SpxValuePair<any>>();\n spxSubmit = output<SpxValuePair<any>>();\n inputTypeRadio = SpxInputTypeEnum.radio;\n inputTypeText = SpxInputTypeEnum.text;\n SpxSeverity = SpxSeverityEnum;\n \n sections: SpxFormSectionI[] = [\n {\n key: sectionAutocompleteSearch,\n showTitle: () => false,\n fields: [\n {\n key: ctrlQuery,\n type: () => SpxInputTypeEnum.text,\n label: () => this.txtQuery(),\n capitalize: () => true,\n },\n {\n key: ctrlOptions,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.txtOptions(),\n },\n ]\n }\n ];\n\n readonly ctrlQuery = computed(() => this.formGroup()?.get(ctrlQuery) as FormControl);\n readonly ctrlOptions = computed(() => this.formGroup()?.get(ctrlOptions) as FormControl);\n\n private subscriptions: {\n subSelection?: Subscription;\n subQuery?: Subscription;\n } = {};\n\n constructor(readonly formBuilder: FormBuilder) {\n this.createForm();\n }\n\n ngOnInit(): void {\n this.listenToSelection();\n this.listenToQuery();\n const spxValuePair = this.spxValuePair();\n this.ctrlQuery().setValue(spxValuePair, { emitEvent: false });\n this.spxSearch.emit(spxValuePair);\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n private createForm(): void {\n this.formGroup.set(this.formBuilder.group({\n [ctrlQuery]: [null],\n [ctrlOptions]: [null],\n }));\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onCancel(): void {\n this.spxCancel.emit();\n }\n \n onSubmit(): void {\n this.spxSubmit.emit(this.ctrlQuery().value);\n }\n\n private listenToQuery(): void {\n this.subscriptions.subQuery = this.ctrlQuery().valueChanges.pipe(debounceTime(500)).subscribe(valuePair => {\n this.spxSearch.emit(valuePair);\n });\n }\n\n private listenToSelection(): void {\n this.subscriptions.subSelection = this.ctrlOptions().valueChanges.subscribe(valuePair => {\n this.ctrlQuery().setValue(valuePair);\n });\n }\n}\n","@if(formGroup()) {\n <form class=\"bg-black fixed pt-16 z-50 top-0 left-0 right-0 bottom-0\" [formGroup]=\"formGroup()!\" (ngSubmit)=\"onSubmit()\">\n <div class=\"h-full w-full px-3 flex flex-col gap-3\">\n <div class=\"grow flex flex-col gap-3 overflow-y-auto\">\n <spx-input [formControl]=\"ctrlQuery()\" [spxLabel]=\"txtQuery()\" [spxType]=\"inputTypeText\">\n </spx-input>\n <spx-input [formControl]=\"ctrlOptions()\" [spxLabel]=\"txtOptions()\" [spxSuggestions]=\"spxSuggestions()\"\n [spxType]=\"inputTypeRadio\">\n </spx-input>\n </div>\n <div class=\"py-3 flex flex-col gap-3\">\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.success\">\n Save\n </spx-button>\n <spx-button [spxFullWidth]=\"true\" [spxSeverity]=\"SpxSeverity.error\" [spxType]=\"'button'\" (spxClick)=\"onCancel()\">\n Cancel\n </spx-button>\n </div>\n </div>\n </form>\n}\n","import { AbstractControl, FormArray, FormGroup, ValidationErrors } from \"@angular/forms\";\n\nexport const checkRequired = (control: AbstractControl): boolean => {\n // Check of deze control zelf 'required' is\n const errors: ValidationErrors | null = control.validator?.({} as AbstractControl) ?? null;\n if (errors?.['required']) {\n return true;\n }\n\n // Als het een FormGroup of FormArray is, check alle children\n if (control instanceof FormGroup || control instanceof FormArray) {\n return Object.values(control.controls).some(child => checkRequired(child));\n }\n return false;\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, inject, input, output, signal, viewChildren } from '@angular/core';\nimport { SpxFormSectionI } from './spx-form-section.interface';\nimport { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, ValidationErrors } from '@angular/forms';\nimport { SpxFormFieldI } from './spx-form-field.interface';\nimport { SpxAutocompleteSearchComponent } from './spx-autocomplete-search.component';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { SpxFormI } from './spx-form.interface';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxFormSectionComponent } from '@softpak/components/spx-form-section';\nimport { SpxInputComponent, SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent } from '@softpak/components/spx-validation';\nimport { checkRequired } from './spx-check-required.const';\n\n@Component({\n selector: 'spx-form-view',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxAutocompleteSearchComponent,\n SpxButtonComponent,\n SpxCapitalizePipe,\n SpxFormSectionComponent,\n SpxInputComponent,\n SpxValidateControlComponent,\n TranslateModule\n ],\n templateUrl: './spx-form-view.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxFormViewComponent {\n readonly checkRequired = checkRequired;\n readonly formBuilder = inject(FormBuilder);\n readonly spxFormGroup = input.required<FormGroup>();\n readonly spxForm = input.required<SpxFormI>();\n readonly spxSuggestions = input.required<any>();\n spxBlur = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxClick = output<{ field: SpxFormFieldI }>();\n spxSearch = output<{ field: SpxFormFieldI, valuePair: SpxValuePair<any> }>();\n spxInputs = viewChildren(ElementRef<SpxInputComponent>);\n autoCompleteField = signal<SpxFormFieldI | null>(null);\n typeAutocomplete = SpxInputTypeEnum.autocomplete;\n typeButton = SpxInputTypeEnum.button;\n typeFloat = SpxInputTypeEnum.float;\n typeNumber = SpxInputTypeEnum.number;\n typeRadio = SpxInputTypeEnum.radio;\n typeText = SpxInputTypeEnum.text;\n typeNumericKeyboard = SpxInputTypeEnum.textNumericKeyboard;\n typeOverlay = SpxInputTypeEnum.overlay;\n typeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n\n getSuggestionsForKey(key: string): SpxValuePair<any>[] {\n return this.spxSuggestions()?.[key] ?? [];\n }\n\n setAutofocus(key: string): void {\n const field = this.spxInputs().find(input => input.nativeElement.spxName() === key);\n if (field) {\n field.nativeElement.setFocusIn();\n }\n }\n\n onBlur(field: SpxFormFieldI) {\n this.spxBlur.emit({\n field,\n valuePair: this.spxFormGroup().get(field.key)!.value,\n });\n }\n\n onClick(field: SpxFormFieldI) {\n this.spxClick.emit({\n field,\n });\n }\n\n onAutocompleteCancel(): void {\n this.autoCompleteField.set(null);\n }\n\n onAutocompleteSearch(valuePair: SpxValuePair<any>): void {\n if (this.autoCompleteField()) {\n this.spxSearch.emit({\n field: this.autoCompleteField()!,\n valuePair,\n });\n }\n }\n\n onAutocompleteSave(valuePair: SpxValuePair<any>) {\n this.spxFormGroup().get(this.autoCompleteField()!.key)?.setValue(valuePair);\n this.autoCompleteField.set(null);\n }\n\n onSearch(field: SpxFormFieldI) {\n this.autoCompleteField.set(field);\n }\n\n getRawValidators(formControl: AbstractControl) {\n // eslint-disable-next-line no-underscore-dangle\n return (formControl as any)._rawValidators;\n }\n\n static createForm(form: SpxFormI): FormGroup {\n const controls = form.sections.flatMap(section => section.fields).reduce((acc, field) => {\n const control = new FormControl(\n field.defaultValue?.() as any ?? null,\n field.defaultValidators?.() ?? []\n );\n\n // Koppel automatisch afterValueChange als die bestaat\n if (field.afterValueChange) {\n console.log('avc 1');\n control.valueChanges.subscribe((valuePair) => {\n field.afterValueChange!(valuePair as SpxValuePair<boolean | string | number> | null);\n console.log('avc 2', valuePair);\n });\n }\n\n acc[field.key] = control;\n return acc;\n }, {} as { [key: string]: FormControl });\n return new FormGroup(controls);\n }\n}\n","@if (autoCompleteField()) {\n <spx-autocomplete-search\n [spxField]=\"autoCompleteField()!\"\n [spxSuggestions]=\"this.getSuggestionsForKey(autoCompleteField()!.key)\"\n [spxValuePair]=\"$any(this.spxFormGroup().get(autoCompleteField()!.key)).value\"\n [txtOptions]=\"'Options'\"\n [txtQuery]=\"'Query'\"\n [txtSubmit]=\"'Save'\"\n (spxCancel)=\"onAutocompleteCancel()\"\n (spxSearch)=\"onAutocompleteSearch($event)\"\n (spxSubmit)=\"onAutocompleteSave($event)\">\n </spx-autocomplete-search>\n}\n<div class=\"flex flex-col gap-3\">\n @for (spxSection of spxForm().sections; track spxSection; let spxSectionIndex = $index) {\n <spx-form-section\n [spxShowTitle]=\"!spxSection.showTitle || spxSection.showTitle()\"\n [spxIndex]=\"spxSectionIndex + 1\"\n [spxTitle]=\"spxSection.title ? (spxSection.title() | translate | capitalize) : undefined\">\n @for (spxField of spxSection.fields; track spxField; let spxFieldIndex = $index) {\n @if (spxField.show === undefined || spxField.show()) {\n @if (spxField.type() === typeButton) {\n <spx-button\n [spxDisabled]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxField.severity ? spxField.severity() : undefined\"\n [spxType]=\"'button'\"\n (spxClick)=\"onClick(spxField)\"\n >{{ (spxField.label ? spxField.label() : spxField.key) | translate | capitalize }}</spx-button>\n }\n @if (spxField.type() === typeOverlay || spxField.type() === typeOverlayNumber || spxField.type() === typeFloat || spxField.type() === typeNumber || spxField.type() === typeText || spxField.type() === typeAutocomplete || spxField.type() === typeNumericKeyboard) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxAutofocus]=\"spxField.autofocus ? spxField.autofocus() : false\"\n [spxCapitalize]=\"spxField.capitalize ? spxField.capitalize() : false\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxPattern]=\"spxField.type() === typeNumericKeyboard ? '\\\\d*' : undefined\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowSearch]=\"spxField.type() === typeAutocomplete\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxStep]=\"spxField.step ? spxField.step() : undefined\"\n [spxType]=\"spxField.type()\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n (spxBlur)=\"onBlur(spxField)\"\n (spxSearch)=\"onSearch(spxField)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key)| translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n @if (spxField.type() === typeRadio) {\n <spx-input\n [formControl]=\"$any(this.spxFormGroup().get(spxField.key))\"\n [spxLabel]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"\n [spxName]=\"spxField.key\"\n [spxReadonly]=\"spxField.readonly ? spxField.readonly() : false\"\n [spxRequired]=\"checkRequired(this.spxFormGroup().get(spxField.key)!)\"\n [spxShowHelp]=\"false\"\n [spxShowValidationMessages]=\"this.spxFormGroup().get(spxField.key)! && this.spxFormGroup().get(spxField.key)!.errors && this.spxFormGroup().get(spxField.key)!.touched\"\n [spxSuggestions]=\"spxField.suggestionsFixed ? spxField.suggestionsFixed() : this.getSuggestionsForKey(spxField.key)\"\n [spxType]=\"typeRadio\"\n [spxValidators]=\"getRawValidators(this.spxFormGroup().get(spxField.key)!)\">\n <spx-validate-control [errors]=\"$any(this.spxFormGroup().get(spxField.key)).errors\" [touched]=\"$any(this.spxFormGroup().get(spxField.key)).touched\" [control]=\"$any(this.spxFormGroup().get(spxField.key))\" [label]=\"(spxField.label ? spxField.label() : spxField.key) | translate | capitalize\"></spx-validate-control>\n </spx-input>\n }\n }\n \n }\n </spx-form-section>\n }\n\n @for (spxButton of spxForm().buttons; track spxButton) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxButton.severity\"\n [spxType]=\"spxButton.type\"\n (spxClick)=\"spxButton.onClick ? spxButton.onClick() : undefined\">\n {{ ((spxButton && spxButton.label) ? spxButton.label() : '') | translate | capitalize }}\n </spx-button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACrB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,GAAA,EAAA,CAAA,CAAA;;ACU1B,MAAM,yBAAyB,GAAG,oBAAoB;AACtD,MAAM,SAAS,GAAG,OAAO;AACzB,MAAM,WAAW,GAAG,SAAS;MAcvB,8BAA8B,CAAA;AA2CzC,IAAA,WAAA,CAAqB,WAAwB,EAAA;QAAxB,IAAA,CAAA,WAAW,GAAX,WAAW;AA1ChC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAmB,IAAI,qDAAC;AACjC,QAAA,IAAA,CAAA,cAAc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iBAAiB;wBACjB,uBAAuB;wBACvB,iBAAiB;wBACjB,2BAA2B;wBAC3B;AACD,qBAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,oxKAAA,EAAA;4iBAWS,UAA6B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExCxD;;AAEG;;;;"}
@@ -136,6 +136,9 @@ class SpxDropdownComponent {
136
136
  this.spxSuggestions = input([], ...(ngDevMode ? [{ debugName: "spxSuggestions" }] : []));
137
137
  this.spxSelect = output();
138
138
  }
139
+ getSuggestions() {
140
+ return this.spxSuggestions() ?? [];
141
+ }
139
142
  ngOnInit() {
140
143
  this.listenToKeyUp();
141
144
  }
@@ -150,16 +153,17 @@ class SpxDropdownComponent {
150
153
  }
151
154
  listenToKeyUp() {
152
155
  this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
156
+ const suggestions = this.getSuggestions();
153
157
  if (event.key === 'ArrowUp' && this.focusPosition() > 0) {
154
158
  this.focusPosition.update((oldValue) => oldValue - 1);
155
159
  event.preventDefault();
156
160
  }
157
- if (event.key === 'ArrowDown' && this.focusPosition() < this.spxSuggestions().length - 1) {
161
+ if (event.key === 'ArrowDown' && this.focusPosition() < suggestions.length - 1) {
158
162
  this.focusPosition.update((oldValue) => oldValue + 1);
159
163
  event.preventDefault();
160
164
  }
161
- if (event.key === 'Enter' && this.spxSuggestions().length > 0) {
162
- this.select(this.spxSuggestions().at(this.focusPosition()));
165
+ if (event.key === 'Enter' && suggestions.length > 0) {
166
+ this.select(suggestions.at(this.focusPosition()));
163
167
  event.preventDefault();
164
168
  }
165
169
  });
@@ -1031,6 +1035,9 @@ class SpxInputRadioComponent {
1031
1035
  this.spxElementId = input(...(ngDevMode ? [undefined, { debugName: "spxElementId" }] : []));
1032
1036
  this.spxIsFocused = signal(false, ...(ngDevMode ? [{ debugName: "spxIsFocused" }] : []));
1033
1037
  }
1038
+ getSuggestions() {
1039
+ return this.spxSuggestions() ?? [];
1040
+ }
1034
1041
  ngOnInit() {
1035
1042
  this.selectedInputService.focusedElement$
1036
1043
  .subscribe((focusedId) => {
@@ -1060,7 +1067,7 @@ class SpxInputRadioComponent {
1060
1067
  this.determineFocusPosition();
1061
1068
  }
1062
1069
  determineFocusPosition() {
1063
- const spxSuggestions = this.spxSuggestions();
1070
+ const spxSuggestions = this.getSuggestions();
1064
1071
  if (this.value() && spxSuggestions?.length) {
1065
1072
  const index = spxSuggestions.findIndex(valuePair => valuePairToValue(valuePair) === valuePairToValue(this.value()));
1066
1073
  this.focusPosition.set(index >= 0 ? index : 0);
@@ -1074,14 +1081,15 @@ class SpxInputRadioComponent {
1074
1081
  }
1075
1082
  listenToKeys() {
1076
1083
  this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
1084
+ const suggestions = this.getSuggestions();
1077
1085
  if ((event.key === 'ArrowUp' || event.key === 'ArrowLeft') && this.focusPosition() > 0) {
1078
1086
  this.focusPosition.update((position) => position - 1);
1079
- this.select(this.spxSuggestions().at(this.focusPosition()));
1087
+ this.select(suggestions.at(this.focusPosition()));
1080
1088
  event.preventDefault();
1081
1089
  }
1082
- if ((event.key === 'ArrowDown' || event.key === 'ArrowRight') && this.focusPosition() < this.spxSuggestions().length - 1) {
1090
+ if ((event.key === 'ArrowDown' || event.key === 'ArrowRight') && this.focusPosition() < suggestions.length - 1) {
1083
1091
  this.focusPosition.update((position) => position + 1);
1084
- this.select(this.spxSuggestions().at(this.focusPosition()));
1092
+ this.select(suggestions.at(this.focusPosition()));
1085
1093
  event.preventDefault();
1086
1094
  }
1087
1095
  });