@ng-simplicity/forms-core 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-simplicity-forms-core.mjs","sources":["../../../../libs/forms-core/src/classes/base/subscriber.class.ts","../../../../libs/forms-core/src/misc/injection-tokens.constants.ts","../../../../libs/forms-core/src/misc/defaults.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component.class.ts","../../../../libs/forms-core/src/services/form-component-registry/form-component-registry.service.ts","../../../../libs/forms-core/src/services/forms/forms.service.ts","../../../../libs/forms-core/src/services/internal/internal-forms.service.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-item-with-visible-and-validators-base.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-items-container.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input-with-options-base.class.ts","../../../../libs/forms-core/src/controllers/form-item/form-item.controller.ts","../../../../libs/forms-core/src/components/core/form-item/form-item.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.html","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.ts","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.html","../../../../libs/forms-core/src/models/item-config-bases/form-item-config-base.model.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/service/form-array-internal.service.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.ts","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.html","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.ts","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.html","../../../../libs/forms-core/src/components/shared-form-components/section/section-config.interface.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.html","../../../../libs/forms-core/src/forms-core.module.ts","../../../../libs/forms-core/src/ng-simplicity-forms-core.ts"],"sourcesContent":["import { Observable, Subject, Subscription, takeUntil } from 'rxjs';\nimport { Directive } from '@angular/core';\n\n@Directive() // No-op, just for Angular compiler\nexport abstract class NgsSubscriber {\n protected readonly destroy$ = new Subject<void>();\n\n protected subscriptions: Subscription[] = [];\n\n subscribe<T>(subscribeTo: Observable<T>, nextObserver: (value: T) => void): void {\n subscribeTo.pipe(takeUntil(this.destroy$)).subscribe(nextObserver);\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.subscriptions.forEach((subscriber) => subscriber.unsubscribe());\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';\n\nexport const NGS_FORMS_ITEM_DATA = new InjectionToken('ngs-forms-item-data');\nexport const NGS_FORMS_CONTROL_ADD_REMOVE_FN = new InjectionToken('ngs-form-control-remove-fn');\nexport const NGS_FORMS_ITEM_INDEX = new InjectionToken('ngs-forms-item-index');\n\ntype FormControlAddRemoveFn = (control: AbstractControl, controlName: string) => void;\n\nexport interface INgsFormsFormControlAddRemove {\n add: FormControlAddRemoveFn;\n remove: FormControlAddRemoveFn;\n}\ninterface IControlAddRemoveFunctionsBuilder {\n formGroup: (formGroup: UntypedFormGroup) => INgsFormsFormControlAddRemove;\n formArray: (formArray: UntypedFormArray) => INgsFormsFormControlAddRemove;\n}\nexport const NgsFormsFormControlAddRemoveFunctions: IControlAddRemoveFunctionsBuilder = {\n formGroup: (formGroup) => ({\n add: (control, controlName) => formGroup.addControl(controlName, control),\n remove: (control, controlName) => formGroup.removeControl(controlName),\n }),\n formArray: (formArray: UntypedFormArray) => ({\n add: (control, controlName) => formArray.controls.push(control),\n remove: (control, controlName) => {\n const index = formArray.controls.indexOf(control);\n formArray.controls.splice(index, 1);\n },\n }),\n};\n","/**\n * Simple alternative to lodash.defaults.\n * Returns a new object with properties from source assigned to target\n * if the properties are undefined or missing on target.\n */\nexport function ngsDefaults<T extends object, U extends object>(target: T, source: U): T & U;\nexport function ngsDefaults(target: any, ...sources: any[]): any {\n const result = target ? { ...target } : {};\n for (const source of sources) {\n if (!source) continue;\n for (const key of Object.keys(source)) {\n if (result[key] === undefined) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n","import { Directive, inject, Injector } from '@angular/core';\nimport { v4 as uuidv4 } from 'uuid';\nimport { NgsSubscriber } from '../base/subscriber.class';\nimport { NGS_FORMS_ITEM_DATA } from '../../misc';\nimport { NgsFormsFormItem, NgsFormsFormItemConfigBase } from '../../models';\n\n@Directive({})\nexport abstract class NgsFormsBaseClassFormComponent<T extends NgsFormsFormItemConfigBase> extends NgsSubscriber {\n static key: string;\n id = uuidv4();\n protected config: T;\n protected readonly itemData: NgsFormsFormItem<T>;\n constructor() {\n super();\n this.itemData = inject<NgsFormsFormItem<T>>(NGS_FORMS_ITEM_DATA);\n this.config = this.itemData.config;\n }\n}\n","import { Injectable, Type } from '@angular/core';\n\n@Injectable({ providedIn: 'platform' })\nexport class NgsFormsComponentRegistryService {\n private readonly itemComponentRegistry: TItemComponentRegistry = {};\n getComponentTypeForKey(key: string): Type<unknown> | undefined {\n return this.itemComponentRegistry[key];\n }\n register(key: string, component: Type<unknown>): void {\n this.itemComponentRegistry[key] = component;\n }\n}\n\ntype TItemComponentRegistry = { [key: string]: Type<unknown> };\n","import { UntypedFormGroup } from '@angular/forms';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { NgsFormsFormConfig } from '../../models';\nimport { NgsFormsInternalService } from '../internal/internal-forms.service';\nimport { Injectable, OnDestroy } from '@angular/core';\n\n@Injectable()\nexport class NgsFormsService implements OnDestroy {\n attempt = 0;\n formValue$ = new BehaviorSubject<any>({});\n formValue: any = {};\n private internalFormService: NgsFormsInternalService | undefined;\n private formGroupSubscriptions: Array<Subscription> = [];\n private formGroup = new UntypedFormGroup({});\n\n get dirty(): boolean {\n return this.formGroup?.dirty ?? false;\n }\n get isValid(): boolean {\n if (!this.internalServiceIsSet) return false;\n return this.internalFormService!.checkIsValid();\n }\n get internalServiceIsSet(): boolean {\n return !!this.internalFormService;\n }\n\n setFormConfig(formConfig: NgsFormsFormConfig): void {\n if (!this.internalServiceIsSet) {\n if (this.attempt > 20) {\n console.error('Internal form service is unavailable. Is the ngs-form root tag added to the page?');\n return;\n }\n this.attempt++;\n setTimeout(() => this.setFormConfig(formConfig), 25);\n return;\n }\n this.internalFormService!.setFormData(formConfig);\n }\n\n setInternalService(internalFormsService: NgsFormsInternalService): void {\n this.internalFormService = internalFormsService;\n this.bindFormGroup();\n }\n\n setIsSubmitted(isSubmitted: boolean): void {\n if (!this.internalServiceIsSet) return;\n this.internalFormService!.setIsSubmitted(isSubmitted);\n }\n\n private bindFormGroup(): void {\n this.internalFormService!.formGroup$.subscribe((fg) => {\n this.formGroup = fg;\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n\n this.formGroupSubscriptions.push(\n this.formGroup.valueChanges.subscribe((v) => {\n this.formValue = v;\n this.formValue$.next(v);\n })\n );\n });\n }\n updateComponentState(componentKey: string, state: any): void {\n this.internalFormService?.updateComponentState(componentKey, state);\n }\n updateGlobalState(state: any): void {\n this.internalFormService?.updateGlobalState(state);\n }\n ngOnDestroy() {\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n }\n\n patchValue(entityData: any) {\n this.formGroup.patchValue(entityData);\n }\n}\n","import { BehaviorSubject, filter, map } from 'rxjs';\nimport { FormGroup, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormsFormConfig } from '../../models';\nimport { Injectable } from '@angular/core';\nimport { NgsFormsGlobalFormState } from '../../models/global-state.interface';\nimport { ngsDefaults } from '../../misc/defaults';\n\n@Injectable()\nexport class NgsFormsInternalService {\n formGroup$ = new BehaviorSubject<FormGroup>(new UntypedFormGroup({}));\n formConfig$ = new BehaviorSubject<NgsFormsFormConfig | undefined>(undefined);\n isSubmitted$ = new BehaviorSubject<boolean>(false);\n state = new BehaviorSubject<{ [key: string]: any }>({});\n setIsSubmitted(isSubmitted: boolean): void {\n this.isSubmitted$.next(isSubmitted);\n }\n\n checkIsValid(): boolean {\n if (!this.formGroup$.value) return false;\n return this.formGroup$.value.valid;\n }\n\n setFormData(formConfig: NgsFormsFormConfig) {\n this.formGroup$.next(new UntypedFormGroup({}));\n this.formConfig$.next(formConfig);\n this.isSubmitted$.next(false);\n }\n private mergeState(key: string, update: any): void {\n const obj = this.state.value[key] || {};\n const updated = ngsDefaults(update, obj);\n this.state.value[key] = updated;\n this.state.next(this.state.value);\n }\n updateGlobalState(state: NgsFormsGlobalFormState) {\n this.mergeState('global', state);\n }\n updateComponentState(componentKey: string, state: any) {\n this.mergeState(componentKey, state);\n }\n\n subscribeToState(uuid: string, name?: string) {\n let last = '';\n return this.state.pipe(\n map((allState) => {\n const stateByUuid = allState[uuid] || {};\n const stateByName = name ? (allState[name] || {}) : {};\n const globalState = allState['global'] || {};\n return ngsDefaults(stateByUuid, ngsDefaults(stateByName, globalState));\n }),\n filter((currentState) => {\n const stringifiedState = JSON.stringify(currentState);\n const isUpdated = stringifiedState !== last;\n last = stringifiedState;\n return isUpdated;\n })\n );\n }\n}\n","import { Directive, inject, OnDestroy, OnInit, Signal, ChangeDetectorRef } from '@angular/core';\nimport { FormControl, UntypedFormControl, ValidatorFn } from '@angular/forms';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN } from '../../misc';\nimport { NgsFormsInternalService } from '../../services';\nimport { NgsFormsFormItemConfigBaseItemWithNameAndValidators } from '../../models/item-config-bases/';\nimport { NgsFormsBaseClassFormComponent } from '../../classes/index';\nimport { merge } from 'rxjs';\n\n@Directive({})\nexport class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFormItemConfigBaseItemWithNameAndValidators> extends NgsFormsBaseClassFormComponent<T> implements OnInit, OnDestroy {\n control: UntypedFormControl | undefined;\n errorMessage = '';\n private formAddRemoveFns = inject<INgsFormsFormControlAddRemove>(NGS_FORMS_CONTROL_ADD_REMOVE_FN);\n private privateService = inject<NgsFormsInternalService>(NgsFormsInternalService);\n private changeDetectorRef = inject(ChangeDetectorRef);\n readonly submitted: Signal<boolean> = toSignal(this.privateService.isSubmitted$, { initialValue: false });\n\n ngOnInit() {\n if (!this.control) {\n this.control = new FormControl(undefined, { validators: [] });\n }\n //this.bindVisible();\n this.bindValidators();\n //this.bindControlValidityChange();\n this.formAddRemoveFns.add(this.control, this.config.name);\n\n // Listen to changes and update error message dynamically\n this.subscribe(\n merge(\n this.control.valueChanges,\n this.control.statusChanges,\n this.privateService.isSubmitted$\n ),\n () => {\n this.updateErrorMessage();\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n private updateErrorMessage() {\n if (!this.control) {\n this.errorMessage = '';\n return;\n }\n const showErrors = this.control.invalid && (this.control.touched || this.control.dirty || this.submitted());\n if (!showErrors) {\n this.errorMessage = '';\n return;\n }\n const errors = this.control.errors;\n if (!errors) {\n this.errorMessage = '';\n return;\n }\n const firstErrorKey = Object.keys(errors)[0];\n const map = this.config.errorMessageMap;\n this.errorMessage = map?.[firstErrorKey] || `Field is invalid: ${firstErrorKey}`;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.formAddRemoveFns.remove(this.control!, this.config.name);\n }\n\n private bindValidators() {\n if (!this.config.validators && !this.config.validators$) return;\n if (this.config.validators) {\n this.control!.setValidators(this.config.validators);\n return;\n }\n if (this.config.validators$) {\n this.subscribe(this.config.validators$!, (validators: Array<ValidatorFn>) => this.control!.setValidators(validators));\n }\n }\n\n /*\n private bindVisible() {\n this.subscribe(this.parentVisibility$, (isVisible) => {\n if (this.isVisible === isVisible) return;\n this.isVisible = isVisible;\n if (isVisible) {\n this.formGroup.addControl(this.config.name, this.control);\n return;\n }\n this.formGroup.removeControl(this.config.name);\n });\n }\n */\n}\n\n","import { NgsFormsCommonComponentState, NgsFormsFormItemConfigBaseInput } from '../../models';\nimport { Directive, inject, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from './form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsInternalService, NgsFormsService } from '../../services';\n\n@Directive({}) // for compiler\nexport abstract class NgsFormsBaseClassFormInputComponent<T extends NgsFormsFormItemConfigBaseInput> extends NgsFormsFormItemWithVisibleAndValidatorsBase<T> {\n readonly myFormService = inject(NgsFormsService);\n private readonly internalService = inject(NgsFormsInternalService);\n\n readonly commonState: Signal<NgsFormsCommonComponentState> = toSignal(\n this.internalService.subscribeToState(this.itemData.uuid || '', this.config.name),\n { initialValue: {} as NgsFormsCommonComponentState }\n );\n\n toggleDisplayMode(setTo: 'summary' | 'input'){\n\n }\n}\n\n","import { NgsFormsFormItemContainerConfigBase } from '../../models';\n\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { Directive, OnDestroy } from '@angular/core';\n\n@Directive({}) // no op for compiler\nexport class NgsFormsBaseClassItemsContainerBase<T extends NgsFormsFormItemContainerConfigBase> extends NgsFormsBaseClassFormComponent<T> implements OnDestroy {}\n","import { Directive, Signal } from '@angular/core';\nimport { NgsFormsBaseClassFormInputComponent } from './form-component-input.class';\nimport { NgsFormsFormInputOption, NgsFormsFormItemConfigBaseInputWithOptions } from '../../models';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { of } from 'rxjs';\n\n@Directive()\nexport class NgsFormsBaseClassFormItemInputWithOptionsComponent<T extends NgsFormsFormItemConfigBaseInputWithOptions> extends NgsFormsBaseClassFormInputComponent<T> {\n options: Signal<Array<NgsFormsFormInputOption>> = toSignal(\n this.config.options$ ?? of(this.config.options ?? []),\n { initialValue: this.config.options ?? [] }\n );\n}\n\n","import { ChangeDetectorRef, ComponentRef, Injector, Provider, ViewContainerRef } from '@angular/core';\nimport { NgsFormsFormItem } from '../../models';\nimport { NgsSubscriber } from '../../classes/base/subscriber.class';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN, NGS_FORMS_ITEM_DATA, NGS_FORMS_ITEM_INDEX } from '../../misc';\nimport { BehaviorSubject } from 'rxjs';\nimport { NgsFormsComponentRegistryService } from '../../services/form-component-registry/form-component-registry.service';\n\nexport class NgsFormItemController extends NgsSubscriber {\n private componentRef: ComponentRef<unknown> | undefined;\n private parentVisibility = new BehaviorSubject<boolean>(false);\n private lastVisible: boolean | undefined;\n\n constructor(\n private readonly injector: Injector,\n private readonly viewContainerRef: ViewContainerRef,\n private readonly itemData: NgsFormsFormItem<any>,\n private readonly addRemoveControlFn?: INgsFormsFormControlAddRemove,\n private readonly index?: number,\n private readonly changeDetectorRef?: ChangeDetectorRef\n ) {\n super();\n this.bindVisibility();\n }\n\n destroy() {\n this.detach();\n super.ngOnDestroy();\n }\n\n private bindVisibility() {\n if (!this.itemData.config.visible$) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.subscribe(this.itemData.config.visible$, (visible: any) => {\n if (this.lastVisible === visible) return;\n\n this.lastVisible = visible;\n if (visible) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.detach();\n });\n }\n\n private create() {\n const providers: Provider[] = [{ provide: NGS_FORMS_ITEM_DATA, useValue: this.itemData }];\n if (this.index !== undefined) {\n providers.push({ provide: NGS_FORMS_ITEM_INDEX, useValue: this.index });\n }\n if (this.addRemoveControlFn) {\n providers.push({ provide: NGS_FORMS_CONTROL_ADD_REMOVE_FN, useValue: this.addRemoveControlFn });\n }\n const myInjector = Injector.create({\n parent: this.injector,\n providers,\n });\n const componentType = this.injector.get(NgsFormsComponentRegistryService).getComponentTypeForKey(this.itemData.type);\n if (!componentType) {\n console.error(`Ngs form component type ${this.itemData.type} not registered.`);\n return;\n }\n this.componentRef = this.viewContainerRef.createComponent(componentType, { injector: myInjector });\n this.componentRef.changeDetectorRef?.detectChanges();\n this.changeDetectorRef?.markForCheck();\n this.parentVisibility.next(true);\n }\n\n private detach() {\n this.parentVisibility.next(false);\n this.componentRef?.destroy();\n this.changeDetectorRef?.markForCheck();\n }\n}\n","import { ChangeDetectorRef, Directive, inject, Injector, Input, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemController } from '../../../controllers';\nimport { INgsFormsFormControlAddRemove, NgsFormsFormControlAddRemoveFunctions } from '../../../misc';\nimport { NgsFormsComponentRegistryService } from '../../../services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormItem } from '../../../models';\n\n@Directive({\n selector: '[ngs-form-item]',\n //templateUrl: \"./form-item.component.html\",\n})\n\nexport class NgsFormsFormItemDirective implements OnInit, OnDestroy {\n @Input('ngs-form-item')\n itemData: NgsFormsFormItem<any> | undefined = undefined;\n\n @Input('ngs-form-group')\n formGroup?: UntypedFormGroup;\n\n @Input('ngs-form-array')\n formArray?: UntypedFormArray;\n\n @Input('ngs-form-index')\n index?: number;\n\n controller: NgsFormItemController | undefined;\n\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n private readonly formComponentRegistryService = inject(NgsFormsComponentRegistryService);\n\n ngOnInit(): void {\n if (!this.itemData) {\n return console.error('Form item without form data');\n }\n let addRemoveFn: INgsFormsFormControlAddRemove | undefined = undefined;\n if (this.formArray) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formArray(this.formArray);\n }\n if (this.formGroup) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formGroup(this.formGroup);\n }\n this.controller = new NgsFormItemController(\n this.injector,\n this.viewContainerRef,\n this.itemData,\n addRemoveFn,\n this.index,\n this.changeDetectorRef\n );\n }\n\n ngOnDestroy() {\n this.controller?.destroy();\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NgsFormsService } from '../../../services/forms/forms.service';\nimport { NgsFormsInternalService } from '../../../services/internal/internal-forms.service';\nimport { NgsFormsFormItemDirective } from '../form-item/form-item.component';\n\n@Component({\n selector: 'ngs-form',\n templateUrl: './form.component.html',\n providers: [NgsFormsInternalService],\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormComponent {\n private readonly ngsInternalFormsService = inject(NgsFormsInternalService);\n readonly ngsFormsService = inject(NgsFormsService);\n\n readonly formGroup = toSignal(this.ngsInternalFormsService.formGroup$);\n readonly formConfig = toSignal(this.ngsInternalFormsService.formConfig$);\n\n constructor() {\n this.ngsFormsService.setInternalService(this.ngsInternalFormsService);\n }\n}\n\n","@if (formConfig()?.root && formGroup()) {\n <ng-container [ngs-form-group]=\"formGroup()!\" [ngs-form-item]=\"formConfig()!.root\"></ng-container>\n}\n\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormItem, NgsFormsFormItemContainerConfigBase } from '../../../models';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\n\n@Component({\n selector: 'ngs-form-component-column',\n templateUrl: './form-column.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsColumnComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormItemContainerConfigBase> {\n static override key = 'column';\n\n static create(config: NgsFormsFormItemContainerConfigBase): NgsFormsFormItem<NgsFormsFormItemContainerConfigBase> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsColumnComponent.key,\n config,\n };\n }\n}\n","@for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n}\n","// eslint-disable-next-line @typescript-eslint/no-empty-interface\nimport { NgsFormsFormErrorKeyValueMap } from '../errors';\nimport { Observable } from 'rxjs';\nimport { ValidatorFn } from '@angular/forms';\nimport { NgsFormsFormInputOption } from './form-item-option.model';\nimport { NgsFormsFormItem } from '../form-config';\n\nexport interface NgsFormsFormItemConfigBase {\n uuid?: string;\n visible?: boolean;\n visible$?: Observable<boolean>;\n initialState?: any;\n}\n\nexport interface NgsFormsFormItemContainerConfigBase extends NgsFormsFormItemConfigBase {\n items: Array<NgsFormsFormItem<any>>\n}\n\nexport interface NgsFormsFormGroupConfig extends NgsFormsFormItemConfigBaseItemWithNameAndValidators, NgsFormsFormItemContainerConfigBase {}\n\nexport interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFormItemConfigBase{\n name: string;\n errorMessageMap?: NgsFormsFormErrorKeyValueMap;\n disabled?: boolean;\n disabled$?: Observable<boolean>;\n validators?: Array<ValidatorFn>;\n validators$? :Observable<Array<ValidatorFn>>;\n}\n\n// ---\n\nexport interface NgsFormsFormItemConfigBaseInput extends NgsFormsFormItemConfigBaseItemWithNameAndValidators {\n id?: string;\n label: string;\n value?: unknown;\n}\n\n// ---\n\nexport interface NgsFormsFormItemConfigBaseTextInput extends NgsFormsFormItemConfigBaseInput {\n placeholder?: string;\n type?: 'text' | 'email' | 'password'\n}\n\n\nexport interface NgsFormsFormItemConfigBaseInputWithOptions extends NgsFormsFormItemConfigBaseInput {\n options?: Array<NgsFormsFormInputOption>;\n options$?: Observable<Array<NgsFormsFormInputOption>>;\n}\n// --\n","import { Component, Injector, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormItemRowConfig } from './form-row-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective, NgsFormsBaseClassFormComponent } from '../../../internal';\n\n@Component({\n selector: 'ngs-forms-row-component',\n templateUrl: './form-row.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class NgsFormsRowComponent extends NgsFormsBaseClassFormComponent<NgsFormItemRowConfig> {\n static override key = 'form-row';\n constructor(\n ) {\n super();\n }\n getIndividualRowDivClass(index: number) {\n if (this.config.columnClass) {\n return this.config.columnClass;\n }\n if (!this.config.columnClasses?.length) {\n return '';\n }\n return this.config.columnClasses[index];\n }\n static create(config: NgsFormItemRowConfig): NgsFormsFormItem<NgsFormItemRowConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsRowComponent.key,\n config: config,\n };\n }\n}\n","<div class=\"{{config.containerClass}}\">\n @for(item of config.items; track item; let i = $index){\n <div class=\"{{getIndividualRowDivClass(i)}}\">\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n </div>\n }\n</div>\n","import { Component, ChangeDetectionStrategy, inject, Injector, OnInit, ViewContainerRef } from '@angular/core';\nimport {\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { v4 } from 'uuid';\n\nimport { NgsFormsFormItem, NgsFormsFormGroupConfig } from '../../../models';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\n\nimport { NgsFormsFormItemDirective } from '../../core';\n\n\n@Component({\n selector: 'ngs-forms-form-group',\n templateUrl: './form-group.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormGroupComponent\n extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormsFormGroupConfig>\n implements OnInit\n{\n static override key = 'form-group';\n\n static create(\n config: NgsFormsFormGroupConfig\n ): NgsFormsFormItem<NgsFormsFormGroupConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormGroupComponent.key,\n config,\n };\n }\n\n get formGroupControl(): UntypedFormGroup {\n return this.control as unknown as UntypedFormGroup;\n }\n\n constructor() {\n super();\n this.control = new UntypedFormGroup({}) as unknown as UntypedFormControl;\n }\n}\n\n","@if (config.items) {\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"formGroupControl\"></ng-container>\n }\n}\n","import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemArrayConfig } from '../container';\nimport { NGS_FORMS_ITEM_DATA } from '../../../../misc';\nimport { NgsFormsFormItem } from '../../../../models/index';\nimport { Subject } from 'rxjs';\n\n@Injectable()\nexport class NgsFormsFormArrayInternalService implements OnDestroy {\n config = inject<NgsFormsFormItem<NgsFormItemArrayConfig>>(NGS_FORMS_ITEM_DATA).config;\n\n readonly formArray = new UntypedFormArray([]);\n readonly itemsChanged = new Subject<void>();\n\n constructor() {\n if (this.config.initialItemCount) {\n for (let i = 0; i < this.config.initialItemCount; i++) {\n this.addItem();\n }\n }\n }\n\n ngOnDestroy() {\n }\n\n removeAt(index: number) {\n if (this.config?.minItems && this.formArray.controls.length <= this.config!.minItems!) {\n return;\n }\n if (!this.formArray.controls.length) {\n return;\n }\n this.formArray.removeAt(index);\n this.itemsChanged.next();\n }\n addItem() {\n if (this.config?.maxItems && this.formArray.controls.length >= this.config!.maxItems) {\n return;\n }\n this.formArray.push(new UntypedFormGroup({}));\n this.itemsChanged.next();\n }\n}\n","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayAddItemConfig } from './form-array-add-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array-add-item',\n templateUrl: './form-array-add-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayAddItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayAddItemConfig> {\n static override key = 'form-array-add-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n\n static create(config: NgsFormItemArrayAddItemConfig): NgsFormsFormItem<NgsFormItemArrayAddItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayAddItemComponent.key,\n config: config,\n };\n }\n\n addItem() {\n this.internalArrayService.addItem();\n }\n}\n","<button\n (click)=\"addItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-primary'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Add Item' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { UntypedFormControl } from '@angular/forms';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormsFormItemDirective } from '../../../core/index';\nimport { NgsFormItemArrayConfig } from './form-array-config.model';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array',\n imports: [NgsFormsFormItemDirective],\n templateUrl: './form-array.component.html',\n providers: [NgsFormsFormArrayInternalService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormItemArrayConfig> {\n static override key = 'form-array';\n\n constructor(private formArrayService: NgsFormsFormArrayInternalService) {\n super();\n this.control = this.formArrayService.formArray as unknown as UntypedFormControl;\n }\n\n static create(\n config: NgsFormItemArrayConfig\n ): NgsFormsFormItem<NgsFormItemArrayConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayContainerComponent.key,\n config: config,\n };\n }\n}\n","<div [class]=\"config.containerClass || ''\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n</div>\n","import { Component, inject, ChangeDetectionStrategy, ChangeDetectorRef, OnInit } from '@angular/core';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { AbstractControl, FormArray, UntypedFormGroup } from '@angular/forms';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormArrayListConfig } from './form-array-list.config';\nimport { NgsFormsFormItemDirective, NgsFormsBaseClassFormComponent, NgsFormsFormItem } from '../../../../internal';\n\n@Component({\n selector: 'ngs-forms-form-array-list',\n templateUrl: './form-array-list.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent<NgsFormsFormArrayListConfig> implements OnInit {\n static override key = 'form-array-list';\n public internalArrayService = inject<NgsFormsFormArrayInternalService>(\n NgsFormsFormArrayInternalService\n );\n public myFormArray: FormArray<any> = this.internalArrayService.formArray;\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n ngOnInit() {\n this.subscribe(this.internalArrayService.itemsChanged, () => {\n this.changeDetectorRef.markForCheck();\n });\n }\n\n static create(\n config: NgsFormsFormArrayListConfig\n ): NgsFormsFormItem<NgsFormsFormArrayListConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayListComponent.key,\n config: config,\n };\n }\n\n castToFormGroup(control: AbstractControl): UntypedFormGroup {\n return control as UntypedFormGroup;\n }\n}\n","@for (formGroup of myFormArray.controls; track formGroup; let i = $index) {\n <div [attr.data-index]=\"$index\" [class]=\"config.containerClass || ''\">\n <ng-container [ngs-form-group]=\"castToFormGroup(formGroup)\" [ngs-form-index]=\"i\"\n [ngs-form-item]=\"config.templateItem\"></ng-container>\n </div>\n}\n","import { Component, inject, ChangeDetectionStrategy, ElementRef } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayRemoveItemConfig } from './form-array-remove-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { NGS_FORMS_ITEM_INDEX } from '../../../../misc';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-forms-form-array-remove-item',\n templateUrl: './form-array-remove-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayRemoveItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayRemoveItemConfig> {\n static override key = 'form-array-remove-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n private elementRef = inject(ElementRef);\n private indexFromDi = inject<number>(NGS_FORMS_ITEM_INDEX, { optional: true });\n\n get myIndex(): number {\n if (this.indexFromDi !== null && this.indexFromDi !== undefined) {\n return this.indexFromDi;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n const container = el.closest('[data-index]');\n if (container) {\n const idxAttr = container.getAttribute('data-index');\n if (idxAttr !== null) {\n return parseInt(idxAttr, 10);\n }\n }\n return 0;\n }\n\n constructor() {\n super();\n }\n\n static create(config: NgsFormItemArrayRemoveItemConfig): NgsFormsFormItem<NgsFormItemArrayRemoveItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayRemoveItemComponent.key,\n config,\n };\n }\n\n removeItem() {\n this.internalArrayService.removeAt(this.myIndex);\n }\n}\n","<button\n (click)=\"removeItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-danger btn-sm'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Remove' }}\n index:{{ myIndex }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormsTextDivConfig } from './text-div-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-form-component-text-div',\n imports: [],\n templateUrl: './text-div.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsTextDivComponent extends NgsFormsBaseClassFormComponent<NgsFormsTextDivConfig> {\n static override key = 'text-div';\n\n static create(\n config: NgsFormsTextDivConfig\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsTextDivComponent.key,\n config: config,\n };\n }\n static title(\n title: string,\n divClass = 'h2'\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return NgsFormsTextDivComponent.create({\n text: title,\n classes: divClass,\n });\n }\n}\n","<div class=\"{{config.classes\">{{ config.text }}</div>\n","import { Component, ChangeDetectionStrategy, inject, Sanitizer, SecurityContext } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormItemHtmlContentConfig } from './html-content-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n@Component({\n selector: 'ngs-form-component-html-content',\n imports: [],\n templateUrl: './html-content.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsHtmlContentComponent extends NgsFormsBaseClassFormComponent<NgsFormItemHtmlContentConfig> {\n static override key = 'content-html';\n contentConfig = this.config as NgsFormItemHtmlContentConfig;\n html: string;\n\n constructor() {\n super();\n const sanitizer = inject(Sanitizer);\n this.html =\n sanitizer.sanitize(SecurityContext.HTML, this.contentConfig.html) ||\n '';\n }\n\n static create(\n config: NgsFormItemHtmlContentConfig\n ): NgsFormsFormItem<NgsFormItemHtmlContentConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsHtmlContentComponent.key,\n config,\n };\n }\n}\n","<div [innerHTML]=\"html\"></div>\n","import { NgsFormsFormItemContainerConfigBase } from '../../../models/index';\n\nexport interface NgsFormsFormSectionConfig extends NgsFormsFormItemContainerConfigBase {\n title: string;\n titleClass?: string;\n subtitle?: string;\n subtitleClass?: string;\n}\n\nexport const sectionConfigDefaults: Partial<NgsFormsFormSectionConfig> = {\n titleClass: 'h3',\n subtitleClass: 'lead',\n};\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormSectionConfig, sectionConfigDefaults } from './section-config.interface';\nimport { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { ngsDefaults } from '../../../misc/defaults';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsFormItem } from '../../../models';\n\n@Component({\n selector: 'ngs-forms-form-section',\n templateUrl: './section.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormSectionComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormSectionConfig> implements OnInit {\n static override key = 'section';\n\n static create(config: NgsFormsFormSectionConfig): NgsFormsFormItem<NgsFormsFormSectionConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormSectionComponent.key,\n config: config,\n };\n }\n\n ngOnInit() {\n this.config = ngsDefaults(this.config, sectionConfigDefaults);\n }\n}\n","<div class=\"form-section\">\n <div class=\"form-section-title {{config.titleClass}}\">{{ config.title }}</div>\n @if (config.subtitle) {\n <div class=\"form-section-subtitle {{config.subtitleClass}}\">{{ config.subtitle }}</div>\n }\n @if (config.items.length) {\n <div class=\"form-section-items\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n </div>\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { NgsFormsColumnComponent } from './components/shared-form-components/column';\nimport { NgsFormsComponentRegistryService } from './services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormArrayAddItemComponent } from './components/shared-form-components/form-array/add-item';\nimport { NgsFormsFormArrayContainerComponent } from './components/shared-form-components/form-array/container';\nimport { NgsFormsFormArrayListComponent } from './components/shared-form-components/form-array/list';\nimport { NgsFormsFormArrayRemoveItemComponent } from './components/shared-form-components/form-array/remove-item';\nimport { NgsFormsFormSectionComponent } from './components/shared-form-components/section/section.component';\nimport { NgsFormsRowComponent } from './components/shared-form-components/row';\nimport { NgsFormsTextDivComponent } from './components/shared-form-components/text-div';\nimport { NgsFormsFormGroupComponent } from './components/shared-form-components/form-group';\n\n\n@NgModule({\n imports: [CommonModule, FormsModule, ReactiveFormsModule],\n})\nexport class NgsFormsCoreModule {\n static registerCoreNgsFormComponents(\n registryService: NgsFormsComponentRegistryService\n ) {\n registryService.register(NgsFormsFormGroupComponent.key, NgsFormsFormGroupComponent);\n registryService.register(NgsFormsRowComponent.key, NgsFormsRowComponent);\n registryService.register(\n NgsFormsColumnComponent.key,\n NgsFormsColumnComponent\n );\n registryService.register(\n NgsFormsFormArrayContainerComponent.key,\n NgsFormsFormArrayContainerComponent\n );\n registryService.register(\n NgsFormsFormArrayAddItemComponent.key,\n NgsFormsFormArrayAddItemComponent\n );\n registryService.register(\n NgsFormsFormArrayRemoveItemComponent.key,\n NgsFormsFormArrayRemoveItemComponent\n );\n registryService.register(\n NgsFormsFormArrayListComponent.key,\n NgsFormsFormArrayListComponent\n );\n registryService.register(\n NgsFormsTextDivComponent.key,\n NgsFormsTextDivComponent\n );\n //registryService.register('content-html', NgsFormsHtmlContentComponent);\n registryService.register(\n NgsFormsFormSectionComponent.key,\n NgsFormsFormSectionComponent\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["uuidv4","i1.NgsFormsFormArrayInternalService"],"mappings":";;;;;;;;MAIsB,aAAa,CAAA;AACd,IAAA,QAAQ,GAAG,IAAI,OAAO,EAAQ;IAEvC,aAAa,GAAmB,EAAE;IAE5C,SAAS,CAAI,WAA0B,EAAE,YAAgC,EAAA;AACvE,QAAA,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;IACpE;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;AACxB,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,WAAW,EAAE,CAAC;IACtE;wGAboB,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBADlC;;;MCAY,mBAAmB,GAAG,IAAI,cAAc,CAAC,qBAAqB;MAC9D,+BAA+B,GAAG,IAAI,cAAc,CAAC,4BAA4B;MACjF,oBAAoB,GAAG,IAAI,cAAc,CAAC,sBAAsB;AAYtE,MAAM,qCAAqC,GAAsC;AACtF,IAAA,SAAS,EAAE,CAAC,SAAS,MAAM;AACzB,QAAA,GAAG,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC;AACzE,QAAA,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAA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ACtB,iCAAiC,CAAC,GAAG,EACrC,iCAAiC,CAClC;QACD,eAAe,CAAC,QAAQ,CACtB,oCAAoC,CAAC,GAAG,EACxC,oCAAoC,CACrC;QACD,eAAe,CAAC,QAAQ,CACtB,8BAA8B,CAAC,GAAG,EAClC,8BAA8B,CAC/B;QACD,eAAe,CAAC,QAAQ,CACtB,wBAAwB,CAAC,GAAG,EAC5B,wBAAwB,CACzB;;QAED,eAAe,CAAC,QAAQ,CACtB,4BAA4B,CAAC,GAAG,EAChC,4BAA4B,CAC7B;IACH;wGAnCW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;AAE7C,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;;4FAE7C,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAC;AAC1D,iBAAA;;;ACjBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-simplicity-forms-core.mjs","sources":["../../../../libs/forms-core/src/classes/base/subscriber.class.ts","../../../../libs/forms-core/src/misc/injection-tokens.constants.ts","../../../../libs/forms-core/src/misc/defaults.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component.class.ts","../../../../libs/forms-core/src/services/form-component-registry/form-component-registry.service.ts","../../../../libs/forms-core/src/services/forms/forms.service.ts","../../../../libs/forms-core/src/services/internal/internal-forms.service.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-item-with-visible-and-validators-base.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-items-container.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input-with-options-base.class.ts","../../../../libs/forms-core/src/controllers/form-item/form-item.controller.ts","../../../../libs/forms-core/src/components/core/form-item/form-item.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.html","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.ts","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.html","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/service/form-array-internal.service.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.ts","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.html","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.ts","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.html","../../../../libs/forms-core/src/components/shared-form-components/section/section-config.interface.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.html","../../../../libs/forms-core/src/models/item-config-bases/form-item-config-base.model.ts","../../../../libs/forms-core/src/forms-core.module.ts","../../../../libs/forms-core/src/ng-simplicity-forms-core.ts"],"sourcesContent":["import { Observable, Subject, Subscription, takeUntil } from 'rxjs';\nimport { Directive } from '@angular/core';\n\n/** Base class that ties RxJS subscriptions to the component's lifetime. */\n@Directive() // No-op, just for Angular compiler\nexport abstract class NgsSubscriber {\n protected readonly destroy$ = new Subject<void>();\n\n protected subscriptions: Subscription[] = [];\n\n /** Subscribes to `subscribeTo` until the component is destroyed. */\n subscribe<T>(subscribeTo: Observable<T>, nextObserver: (value: T) => void): void {\n subscribeTo.pipe(takeUntil(this.destroy$)).subscribe(nextObserver);\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.subscriptions.forEach((subscriber) => subscriber.unsubscribe());\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';\n\n/** Injection token for the `NgsFormsFormItem` a component is rendering. */\nexport const NGS_FORMS_ITEM_DATA = new InjectionToken('ngs-forms-item-data');\n/**\n * @internal\n */\nexport const NGS_FORMS_CONTROL_ADD_REMOVE_FN = new InjectionToken('ngs-form-control-remove-fn');\n/** Injection token for the row index when a component is rendered inside a form array list. */\nexport const NGS_FORMS_ITEM_INDEX = new InjectionToken('ngs-forms-item-index');\n\ntype FormControlAddRemoveFn = (control: AbstractControl, controlName: string) => void;\n\n/**\n * @internal\n */\nexport interface INgsFormsFormControlAddRemove {\n add: FormControlAddRemoveFn;\n remove: FormControlAddRemoveFn;\n}\ninterface IControlAddRemoveFunctionsBuilder {\n formGroup: (formGroup: UntypedFormGroup) => INgsFormsFormControlAddRemove;\n formArray: (formArray: UntypedFormArray) => INgsFormsFormControlAddRemove;\n}\n/**\n * @internal\n */\nexport const NgsFormsFormControlAddRemoveFunctions: IControlAddRemoveFunctionsBuilder = {\n formGroup: (formGroup) => ({\n add: (control, controlName) => formGroup.addControl(controlName, control),\n remove: (control, controlName) => formGroup.removeControl(controlName),\n }),\n formArray: (formArray: UntypedFormArray) => ({\n add: (control, controlName) => formArray.controls.push(control),\n remove: (control, controlName) => {\n const index = formArray.controls.indexOf(control);\n formArray.controls.splice(index, 1);\n },\n }),\n};\n","/**\n * Simple alternative to lodash.defaults.\n * Returns a new object with properties from source assigned to target\n * if the properties are undefined or missing on target.\n */\n/**\n * Returns a copy of `target` with any `undefined` properties filled in from `source`. A dependency free\n * alternative to lodash `defaults`, handy for applying default config values in custom components.\n */\nexport function ngsDefaults<T extends object, U extends object>(target: T, source: U): T & U;\nexport function ngsDefaults(target: any, ...sources: any[]): any {\n const result = target ? { ...target } : {};\n for (const source of sources) {\n if (!source) continue;\n for (const key of Object.keys(source)) {\n if (result[key] === undefined) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n","import { Directive, inject, Injector } from '@angular/core';\nimport { v4 as uuidv4 } from 'uuid';\nimport { NgsSubscriber } from '../base/subscriber.class';\nimport { NGS_FORMS_ITEM_DATA } from '../../misc';\nimport { NgsFormsFormItem, NgsFormsFormItemConfigBase } from '../../models';\n\n/**\n * Root base class for every form item component. Reads the item's configuration from `NGS_FORMS_ITEM_DATA`.\n *\n * @remarks Extend it for components that do not own a form control, such as static content or buttons. Declare a\n * `static key` and a `static create(config)` factory so the component can be registered and used in configs.\n */\n@Directive({})\nexport abstract class NgsFormsBaseClassFormComponent<T extends NgsFormsFormItemConfigBase> extends NgsSubscriber {\n /** Registry key the component is registered under. */\n static key: string;\n /** Unique id for this component instance, handy for `id` and `for` attributes. */\n id = uuidv4();\n /** The item's configuration. */\n protected config: T;\n /** The full form item: `uuid`, `type` and `config`. */\n protected readonly itemData: NgsFormsFormItem<T>;\n constructor() {\n super();\n this.itemData = inject<NgsFormsFormItem<T>>(NGS_FORMS_ITEM_DATA);\n this.config = this.itemData.config;\n }\n}\n","import { Injectable, Type } from '@angular/core';\n\n/**\n * Maps registry keys (the `type` of an `NgsFormsFormItem`) to the Angular components that render them.\n *\n * @remarks The service is provided in the `platform` injector, so there is one registry per page. Registering a\n * key again replaces the previous component, which is how a theme package or your own component can override a\n * built-in one. Register components before the form renders, typically in the constructor of the component that\n * hosts `<ngs-form>`.\n * @example\n * ```ts\n * constructor(registry: NgsFormsComponentRegistryService) {\n * NgsFormsBootstrapModule.registerAllBootStrapComponents(registry);\n * registry.register(MyRatingComponent.key, MyRatingComponent);\n * }\n * ```\n */\n@Injectable({ providedIn: 'platform' })\nexport class NgsFormsComponentRegistryService {\n private readonly itemComponentRegistry: TItemComponentRegistry = {};\n /** Returns the component registered for `key`, or `undefined` when nothing is registered. */\n getComponentTypeForKey(key: string): Type<unknown> | undefined {\n return this.itemComponentRegistry[key];\n }\n /** Registers `component` under `key`, replacing any component already registered for it. */\n register(key: string, component: Type<unknown>): void {\n this.itemComponentRegistry[key] = component;\n }\n}\n\ntype TItemComponentRegistry = { [key: string]: Type<unknown> };\n","import { UntypedFormGroup } from '@angular/forms';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { NgsFormsFormConfig } from '../../models';\nimport { NgsFormsInternalService } from '../internal/internal-forms.service';\nimport { Injectable, OnDestroy } from '@angular/core';\n\n/**\n * The public API of a form. Provide it on the component that hosts `<ngs-form>` so each form gets its own instance.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'app-profile',\n * imports: [NgsFormComponent],\n * providers: [NgsFormsService],\n * template: `<ngs-form />`,\n * })\n * export class ProfileComponent {\n * private readonly forms = inject(NgsFormsService);\n * readonly value = toSignal(this.forms.formValue$);\n * }\n * ```\n */\n@Injectable()\nexport class NgsFormsService implements OnDestroy {\n /**\n * @internal\n */\n attempt = 0;\n /**\n * Emits the root form group's value every time it changes. Combine with `toSignal()` to read it in a template.\n *\n * @remarks The value is keyed by the root group's `name`, for example `{ profile: { firstName: 'Ada' } }`.\n */\n formValue$ = new BehaviorSubject<any>({});\n /** The latest value emitted by `formValue$`. */\n formValue: any = {};\n private internalFormService: NgsFormsInternalService | undefined;\n private formGroupSubscriptions: Array<Subscription> = [];\n private formGroup = new UntypedFormGroup({});\n\n /** `true` once the user has changed any control in the form. */\n get dirty(): boolean {\n return this.formGroup?.dirty ?? false;\n }\n /** `true` when every rendered control passes its validators. Hidden items are not validated. */\n get isValid(): boolean {\n if (!this.internalServiceIsSet) return false;\n return this.internalFormService!.checkIsValid();\n }\n /** `true` once `<ngs-form>` has connected to this service. */\n get internalServiceIsSet(): boolean {\n return !!this.internalFormService;\n }\n\n /**\n * Renders a form from `formConfig`, replacing any form that is already shown and resetting the submitted state.\n *\n * @remarks It is safe to call before `<ngs-form>` has initialised (for example in `ngOnInit`): the call is retried\n * every 25 ms for about half a second until the form component is available.\n */\n setFormConfig(formConfig: NgsFormsFormConfig): void {\n if (!this.internalServiceIsSet) {\n if (this.attempt > 20) {\n console.error('Internal form service is unavailable. Is the ngs-form root tag added to the page?');\n return;\n }\n this.attempt++;\n setTimeout(() => this.setFormConfig(formConfig), 25);\n return;\n }\n this.internalFormService!.setFormData(formConfig);\n }\n\n /**\n * @internal\n */\n setInternalService(internalFormsService: NgsFormsInternalService): void {\n this.internalFormService = internalFormsService;\n this.bindFormGroup();\n }\n\n /**\n * Marks the form as submitted (or not). While submitted, every invalid control shows its error message even if\n * the user never touched it.\n */\n setIsSubmitted(isSubmitted: boolean): void {\n if (!this.internalServiceIsSet) return;\n this.internalFormService!.setIsSubmitted(isSubmitted);\n }\n\n private bindFormGroup(): void {\n this.internalFormService!.formGroup$.subscribe((fg) => {\n this.formGroup = fg;\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n\n this.formGroupSubscriptions.push(\n this.formGroup.valueChanges.subscribe((v) => {\n this.formValue = v;\n this.formValue$.next(v);\n })\n );\n });\n }\n /**\n * Merges `state` into the state of one component, identified by its `uuid` or control `name`.\n * Components read the merged result through `commonState`.\n */\n updateComponentState(componentKey: string, state: any): void {\n this.internalFormService?.updateComponentState(componentKey, state);\n }\n /** Merges `state` into the state shared by every component in the form. */\n updateGlobalState(state: any): void {\n this.internalFormService?.updateGlobalState(state);\n }\n ngOnDestroy() {\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n }\n\n /**\n * Patches values into the form, using the same shape as `formValue$` (including the root group name).\n *\n * @remarks Only controls that are currently rendered receive values. Patch again after a conditional item becomes\n * visible, and make sure a form array has enough rows (see `initialItemCount`) before patching array values.\n */\n patchValue(entityData: any) {\n this.formGroup.patchValue(entityData);\n }\n}\n","import { BehaviorSubject, filter, map } from 'rxjs';\nimport { FormGroup, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormsFormConfig } from '../../models';\nimport { Injectable } from '@angular/core';\nimport { NgsFormsGlobalFormState } from '../../models/global-state.interface';\nimport { ngsDefaults } from '../../misc/defaults';\n\n/**\n * Per form state holder that connects `<ngs-form>`, its items and `NgsFormsService`.\n *\n * @remarks Provided by `NgsFormComponent`. Application code should use `NgsFormsService` instead; this service is\n * exported for authors of custom components and may change between minor versions.\n */\n@Injectable()\nexport class NgsFormsInternalService {\n formGroup$ = new BehaviorSubject<FormGroup>(new UntypedFormGroup({}));\n formConfig$ = new BehaviorSubject<NgsFormsFormConfig | undefined>(undefined);\n isSubmitted$ = new BehaviorSubject<boolean>(false);\n state = new BehaviorSubject<{ [key: string]: any }>({});\n setIsSubmitted(isSubmitted: boolean): void {\n this.isSubmitted$.next(isSubmitted);\n }\n\n checkIsValid(): boolean {\n if (!this.formGroup$.value) return false;\n return this.formGroup$.value.valid;\n }\n\n setFormData(formConfig: NgsFormsFormConfig) {\n this.formGroup$.next(new UntypedFormGroup({}));\n this.formConfig$.next(formConfig);\n this.isSubmitted$.next(false);\n }\n private mergeState(key: string, update: any): void {\n const obj = this.state.value[key] || {};\n const updated = ngsDefaults(update, obj);\n this.state.value[key] = updated;\n this.state.next(this.state.value);\n }\n updateGlobalState(state: NgsFormsGlobalFormState) {\n this.mergeState('global', state);\n }\n updateComponentState(componentKey: string, state: any) {\n this.mergeState(componentKey, state);\n }\n\n subscribeToState(uuid: string, name?: string) {\n let last = '';\n return this.state.pipe(\n map((allState) => {\n const stateByUuid = allState[uuid] || {};\n const stateByName = name ? (allState[name] || {}) : {};\n const globalState = allState['global'] || {};\n return ngsDefaults(stateByUuid, ngsDefaults(stateByName, globalState));\n }),\n filter((currentState) => {\n const stringifiedState = JSON.stringify(currentState);\n const isUpdated = stringifiedState !== last;\n last = stringifiedState;\n return isUpdated;\n })\n );\n }\n}\n","import { Directive, inject, OnDestroy, OnInit, Signal, ChangeDetectorRef } from '@angular/core';\nimport { FormControl, UntypedFormControl, ValidatorFn } from '@angular/forms';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN } from '../../misc';\nimport { NgsFormsInternalService } from '../../services';\nimport { NgsFormsFormItemConfigBaseItemWithNameAndValidators } from '../../models/item-config-bases/';\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { merge } from 'rxjs';\n\n/**\n * Base class for items that own a form control. Creates the control, applies `validators` / `validators$`,\n * registers it with the parent group under `config.name` and keeps `errorMessage` up to date.\n */\n@Directive({})\nexport class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFormItemConfigBaseItemWithNameAndValidators> extends NgsFormsBaseClassFormComponent<T> implements OnInit, OnDestroy {\n /** The item's form control. Bind it with `[formControl]`. */\n control: UntypedFormControl | undefined;\n /**\n * Message for the control's first error, taken from `errorMessageMap`. Empty while the control is valid, or\n * before it is touched, dirty or submitted.\n */\n errorMessage = '';\n private formAddRemoveFns = inject<INgsFormsFormControlAddRemove>(NGS_FORMS_CONTROL_ADD_REMOVE_FN);\n private privateService = inject<NgsFormsInternalService>(NgsFormsInternalService);\n private changeDetectorRef = inject(ChangeDetectorRef);\n /** Whether the form has been marked as submitted with `NgsFormsService.setIsSubmitted()`. */\n readonly submitted: Signal<boolean> = toSignal(this.privateService.isSubmitted$, { initialValue: false });\n\n ngOnInit() {\n if (!this.control) {\n this.control = new FormControl(undefined, { validators: [] });\n }\n //this.bindVisible();\n this.bindValidators();\n //this.bindControlValidityChange();\n this.formAddRemoveFns.add(this.control, this.config.name);\n\n // Listen to changes and update error message dynamically\n this.subscribe(\n merge(\n this.control.valueChanges,\n this.control.statusChanges,\n this.privateService.isSubmitted$\n ),\n () => {\n this.updateErrorMessage();\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n private updateErrorMessage() {\n if (!this.control) {\n this.errorMessage = '';\n return;\n }\n const showErrors = this.control.invalid && (this.control.touched || this.control.dirty || this.submitted());\n if (!showErrors) {\n this.errorMessage = '';\n return;\n }\n const errors = this.control.errors;\n if (!errors) {\n this.errorMessage = '';\n return;\n }\n const firstErrorKey = Object.keys(errors)[0];\n const map = this.config.errorMessageMap;\n this.errorMessage = map?.[firstErrorKey] || `Field is invalid: ${firstErrorKey}`;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.formAddRemoveFns.remove(this.control!, this.config.name);\n }\n\n private bindValidators() {\n if (!this.config.validators && !this.config.validators$) return;\n if (this.config.validators) {\n this.control!.setValidators(this.config.validators);\n return;\n }\n if (this.config.validators$) {\n this.subscribe(this.config.validators$!, (validators: Array<ValidatorFn>) => this.control!.setValidators(validators));\n }\n }\n\n /*\n private bindVisible() {\n this.subscribe(this.parentVisibility$, (isVisible) => {\n if (this.isVisible === isVisible) return;\n this.isVisible = isVisible;\n if (isVisible) {\n this.formGroup.addControl(this.config.name, this.control);\n return;\n }\n this.formGroup.removeControl(this.config.name);\n });\n }\n */\n}\n\n","import { NgsFormsCommonComponentState, NgsFormsFormItemConfigBaseInput } from '../../models';\nimport { Directive, inject, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from './form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsInternalService, NgsFormsService } from '../../services';\n\n/**\n * Base class for input components. Adds access to the form's `NgsFormsService` and the merged component state.\n *\n * @remarks This is the class to extend when you build your own input. See the Custom components guide.\n */\n@Directive({}) // for compiler\nexport abstract class NgsFormsBaseClassFormInputComponent<T extends NgsFormsFormItemConfigBaseInput> extends NgsFormsFormItemWithVisibleAndValidatorsBase<T> {\n /** The `NgsFormsService` of the form this input belongs to. */\n readonly myFormService = inject(NgsFormsService);\n private readonly internalService = inject(NgsFormsInternalService);\n\n /** Merged state for this component: its own state, then state by name, then global state. */\n readonly commonState: Signal<NgsFormsCommonComponentState> = toSignal(\n this.internalService.subscribeToState(this.itemData.uuid || '', this.config.name),\n { initialValue: {} as NgsFormsCommonComponentState }\n );\n\n /**\n * Switches between input and summary display.\n *\n * @notImplemented\n */\n toggleDisplayMode(setTo: 'summary' | 'input'){\n\n }\n}\n\n","import { NgsFormsFormItemContainerConfigBase } from '../../models';\n\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { Directive, OnDestroy } from '@angular/core';\n\n/** Base class for container items that render `config.items` without owning a form control. */\n@Directive({}) // no op for compiler\nexport class NgsFormsBaseClassItemsContainerBase<T extends NgsFormsFormItemContainerConfigBase> extends NgsFormsBaseClassFormComponent<T> implements OnDestroy {}\n","import { Directive, Signal } from '@angular/core';\nimport { NgsFormsBaseClassFormInputComponent } from './form-component-input.class';\nimport { NgsFormsFormInputOption, NgsFormsFormItemConfigBaseInputWithOptions } from '../../models';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { of } from 'rxjs';\n\n/**\n * Base class for inputs with options. Exposes `options` as a signal that follows `options$` when given and falls\n * back to the static `options`.\n */\n@Directive()\nexport class NgsFormsBaseClassFormItemInputWithOptionsComponent<T extends NgsFormsFormItemConfigBaseInputWithOptions> extends NgsFormsBaseClassFormInputComponent<T> {\n /** The current options. */\n options: Signal<Array<NgsFormsFormInputOption>> = toSignal(\n this.config.options$ ?? of(this.config.options ?? []),\n { initialValue: this.config.options ?? [] }\n );\n}\n\n","import { ChangeDetectorRef, ComponentRef, Injector, Provider, ViewContainerRef } from '@angular/core';\nimport { NgsFormsFormItem } from '../../models';\nimport { NgsSubscriber } from '../../classes/base/subscriber.class';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN, NGS_FORMS_ITEM_DATA, NGS_FORMS_ITEM_INDEX } from '../../misc';\nimport { BehaviorSubject } from 'rxjs';\nimport { NgsFormsComponentRegistryService } from '../../services/form-component-registry/form-component-registry.service';\n\nexport class NgsFormItemController extends NgsSubscriber {\n private componentRef: ComponentRef<unknown> | undefined;\n private parentVisibility = new BehaviorSubject<boolean>(false);\n private lastVisible: boolean | undefined;\n\n constructor(\n private readonly injector: Injector,\n private readonly viewContainerRef: ViewContainerRef,\n private readonly itemData: NgsFormsFormItem<any>,\n private readonly addRemoveControlFn?: INgsFormsFormControlAddRemove,\n private readonly index?: number,\n private readonly changeDetectorRef?: ChangeDetectorRef\n ) {\n super();\n this.bindVisibility();\n }\n\n destroy() {\n this.detach();\n super.ngOnDestroy();\n }\n\n private bindVisibility() {\n if (!this.itemData.config.visible$) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.subscribe(this.itemData.config.visible$, (visible: any) => {\n if (this.lastVisible === visible) return;\n\n this.lastVisible = visible;\n if (visible) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.detach();\n });\n }\n\n private create() {\n const providers: Provider[] = [{ provide: NGS_FORMS_ITEM_DATA, useValue: this.itemData }];\n if (this.index !== undefined) {\n providers.push({ provide: NGS_FORMS_ITEM_INDEX, useValue: this.index });\n }\n if (this.addRemoveControlFn) {\n providers.push({ provide: NGS_FORMS_CONTROL_ADD_REMOVE_FN, useValue: this.addRemoveControlFn });\n }\n const myInjector = Injector.create({\n parent: this.injector,\n providers,\n });\n const componentType = this.injector.get(NgsFormsComponentRegistryService).getComponentTypeForKey(this.itemData.type);\n if (!componentType) {\n console.error(`Ngs form component type ${this.itemData.type} not registered.`);\n return;\n }\n this.componentRef = this.viewContainerRef.createComponent(componentType, { injector: myInjector });\n this.componentRef.changeDetectorRef?.detectChanges();\n this.changeDetectorRef?.markForCheck();\n this.parentVisibility.next(true);\n }\n\n private detach() {\n this.parentVisibility.next(false);\n this.componentRef?.destroy();\n this.changeDetectorRef?.markForCheck();\n }\n}\n","import { ChangeDetectorRef, Directive, inject, Injector, Input, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemController } from '../../../controllers';\nimport { INgsFormsFormControlAddRemove, NgsFormsFormControlAddRemoveFunctions } from '../../../misc';\nimport { NgsFormsComponentRegistryService } from '../../../services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormItem } from '../../../models';\n\n/**\n * Structural building block that looks up a form item's component in the registry and renders it.\n *\n * @remarks Use it inside custom container components to render child items:\n * `<ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"group\"></ng-container>`.\n */\n@Directive({\n selector: '[ngs-form-item]',\n //templateUrl: \"./form-item.component.html\",\n})\n\nexport class NgsFormsFormItemDirective implements OnInit, OnDestroy {\n /** The item to render. */\n @Input('ngs-form-item')\n itemData: NgsFormsFormItem<any> | undefined = undefined;\n\n /** Form group that the item's control is added to. */\n @Input('ngs-form-group')\n formGroup?: UntypedFormGroup;\n\n /** Form array that the item's control is added to. */\n @Input('ngs-form-array')\n formArray?: UntypedFormArray;\n\n /**\n * Index of the item inside a form array row, provided to children as `NGS_FORMS_ITEM_INDEX`.\n */\n @Input('ngs-form-index')\n index?: number;\n\n controller: NgsFormItemController | undefined;\n\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n private readonly formComponentRegistryService = inject(NgsFormsComponentRegistryService);\n\n ngOnInit(): void {\n if (!this.itemData) {\n return console.error('Form item without form data');\n }\n let addRemoveFn: INgsFormsFormControlAddRemove | undefined = undefined;\n if (this.formArray) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formArray(this.formArray);\n }\n if (this.formGroup) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formGroup(this.formGroup);\n }\n this.controller = new NgsFormItemController(\n this.injector,\n this.viewContainerRef,\n this.itemData,\n addRemoveFn,\n this.index,\n this.changeDetectorRef\n );\n }\n\n ngOnDestroy() {\n this.controller?.destroy();\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NgsFormsService } from '../../../services/forms/forms.service';\nimport { NgsFormsInternalService } from '../../../services/internal/internal-forms.service';\nimport { NgsFormsFormItemDirective } from '../form-item/form-item.component';\n\n/**\n * Renders the form described by the `NgsFormsFormConfig` given to the nearest `NgsFormsService`.\n *\n * @remarks Place it in the template of the component that provides `NgsFormsService`. It takes no inputs.\n * @example\n * ```html\n * <ngs-form></ngs-form>\n * ```\n */\n@Component({\n selector: 'ngs-form',\n templateUrl: './form.component.html',\n providers: [NgsFormsInternalService],\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormComponent {\n private readonly ngsInternalFormsService = inject(NgsFormsInternalService);\n readonly ngsFormsService = inject(NgsFormsService);\n\n readonly formGroup = toSignal(this.ngsInternalFormsService.formGroup$);\n readonly formConfig = toSignal(this.ngsInternalFormsService.formConfig$);\n\n /** The root item to render with the form group it belongs to (empty until a config is set). */\n readonly rendered = computed(() => {\n const group = this.formGroup();\n const root = this.formConfig()?.root;\n return group && root ? [{ group, root }] : [];\n });\n\n constructor() {\n this.ngsFormsService.setInternalService(this.ngsInternalFormsService);\n }\n}\n\n","<!-- Tracking by form group re-creates the tree whenever setFormConfig() is called again, since each call creates a new group. -->\n@for (entry of rendered(); track entry.group) {\n <ng-container [ngs-form-group]=\"entry.group\" [ngs-form-item]=\"entry.root\"></ng-container>\n}\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormItem, NgsFormsFormItemContainerConfigBase } from '../../../models';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\n\n/**\n * Renders its items one after another without any wrapper markup. Useful as a grouping node inside a row.\n *\n * @remarks Registry key: `column`. Does not create a form control.\n */\n@Component({\n selector: 'ngs-form-component-column',\n templateUrl: './form-column.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsColumnComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormItemContainerConfigBase> {\n static override key = 'column';\n\n /** Creates a `column` item. */\n static create(config: NgsFormsFormItemContainerConfigBase): NgsFormsFormItem<NgsFormsFormItemContainerConfigBase> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsColumnComponent.key,\n config,\n };\n }\n}\n","@for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n}\n","import { Component, Injector, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormItemRowConfig } from './form-row-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\n\n/**\n * Lays out items side by side. Each item is wrapped in a div whose class comes from `columnClass` (same for every\n * item) or `columnClasses` (one per item), so it works with any CSS grid system.\n *\n * @remarks Registry key: `form-row`. Does not create a form control.\n * @example\n * ```ts\n * NgsFormsRowComponent.create({\n * containerClass: 'row g-3',\n * columnClasses: ['col-md-6', 'col-md-6'],\n * items: [firstName, lastName],\n * })\n * ```\n */\n@Component({\n selector: 'ngs-forms-row-component',\n templateUrl: './form-row.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class NgsFormsRowComponent extends NgsFormsBaseClassFormComponent<NgsFormItemRowConfig> {\n static override key = 'form-row';\n constructor(\n ) {\n super();\n }\n getIndividualRowDivClass(index: number) {\n if (this.config.columnClass) {\n return this.config.columnClass;\n }\n if (!this.config.columnClasses?.length) {\n return '';\n }\n return this.config.columnClasses[index];\n }\n /** Creates a `form-row` item. */\n static create(config: NgsFormItemRowConfig): NgsFormsFormItem<NgsFormItemRowConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsRowComponent.key,\n config: config,\n };\n }\n}\n","<div class=\"{{config.containerClass}}\">\n @for(item of config.items; track item; let i = $index){\n <div class=\"{{getIndividualRowDivClass(i)}}\">\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n </div>\n }\n</div>\n","import { Component, ChangeDetectionStrategy, inject, Injector, OnInit, ViewContainerRef } from '@angular/core';\nimport {\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { v4 } from 'uuid';\n\nimport { NgsFormsFormItem, NgsFormsFormGroupConfig } from '../../../models';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\n\nimport { NgsFormsFormItemDirective } from '../../core';\n\n\n/**\n * A named group of items backed by an `UntypedFormGroup`. Its value is nested under `name` in the form value.\n *\n * @remarks Registry key: `form-group`. Usually the `root` of a form, and also useful for nesting related fields\n * (an address, for example) or for hiding a whole group with `visible$`.\n * @example\n * ```ts\n * NgsFormsFormGroupComponent.create({\n * name: 'address',\n * items: [addressLine1, city, postcode],\n * })\n * ```\n */\n@Component({\n selector: 'ngs-forms-form-group',\n templateUrl: './form-group.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormGroupComponent\n extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormsFormGroupConfig>\n implements OnInit\n{\n static override key = 'form-group';\n\n /** Creates a `form-group` item. */\n static create(\n config: NgsFormsFormGroupConfig\n ): NgsFormsFormItem<NgsFormsFormGroupConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormGroupComponent.key,\n config,\n };\n }\n\n get formGroupControl(): UntypedFormGroup {\n return this.control as unknown as UntypedFormGroup;\n }\n\n constructor() {\n super();\n this.control = new UntypedFormGroup({}) as unknown as UntypedFormControl;\n }\n}\n\n","@if (config.items) {\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"formGroupControl\"></ng-container>\n }\n}\n","import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemArrayConfig } from '../container';\nimport { NGS_FORMS_ITEM_DATA } from '../../../../misc';\nimport { NgsFormsFormItem } from '../../../../models/index';\nimport { Subject } from 'rxjs';\n\n/**\n * Holds the `UntypedFormArray` of one `NgsFormsFormArrayContainerComponent` and is shared with its list and buttons.\n *\n * @remarks Inject it in a custom component placed inside a form array to add or remove rows programmatically.\n */\n@Injectable()\nexport class NgsFormsFormArrayInternalService implements OnDestroy {\n config = inject<NgsFormsFormItem<NgsFormItemArrayConfig>>(NGS_FORMS_ITEM_DATA).config;\n\n readonly formArray = new UntypedFormArray([]);\n /** Emits after a row is added or removed. */\n readonly itemsChanged = new Subject<void>();\n\n constructor() {\n if (this.config.initialItemCount) {\n for (let i = 0; i < this.config.initialItemCount; i++) {\n this.addItem();\n }\n }\n }\n\n ngOnDestroy() {\n }\n\n /** Removes the row at `index`, unless that would go below `minItems`. */\n removeAt(index: number) {\n if (this.config?.minItems && this.formArray.controls.length <= this.config!.minItems!) {\n return;\n }\n if (!this.formArray.controls.length) {\n return;\n }\n this.formArray.removeAt(index);\n this.itemsChanged.next();\n }\n /** Appends an empty row, unless the array already has `maxItems` rows. */\n addItem() {\n if (this.config?.maxItems && this.formArray.controls.length >= this.config!.maxItems) {\n return;\n }\n this.formArray.push(new UntypedFormGroup({}));\n this.itemsChanged.next();\n }\n}\n","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayAddItemConfig } from './form-array-add-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n/**\n * A button that appends a row to the enclosing form array, up to `maxItems`.\n *\n * @remarks Registry key: `form-array-add-item`. Must be placed inside an `NgsFormsFormArrayContainerComponent`.\n */\n@Component({\n selector: 'ngs-forms-form-array-add-item',\n templateUrl: './form-array-add-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayAddItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayAddItemConfig> {\n static override key = 'form-array-add-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n\n /** Creates a `form-array-add-item` item. */\n static create(config: NgsFormItemArrayAddItemConfig): NgsFormsFormItem<NgsFormItemArrayAddItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayAddItemComponent.key,\n config: config,\n };\n }\n\n addItem() {\n this.internalArrayService.addItem();\n }\n}\n","<button\n (click)=\"addItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-primary'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Add Item' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { UntypedFormControl } from '@angular/forms';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormsFormItemDirective } from '../../../core/index';\nimport { NgsFormItemArrayConfig } from './form-array-config.model';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n/**\n * A repeatable list of rows backed by an `UntypedFormArray`. Its value is an array under `name`.\n *\n * @remarks Registry key: `form-array`. Put an `NgsFormsFormArrayListComponent` inside `items` to render the rows,\n * and `NgsFormsFormArrayAddItemComponent` / `NgsFormsFormArrayRemoveItemComponent` to let users change them.\n */\n@Component({\n selector: 'ngs-forms-form-array',\n imports: [NgsFormsFormItemDirective],\n templateUrl: './form-array.component.html',\n providers: [NgsFormsFormArrayInternalService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormItemArrayConfig> {\n static override key = 'form-array';\n\n constructor(private formArrayService: NgsFormsFormArrayInternalService) {\n super();\n this.control = this.formArrayService.formArray as unknown as UntypedFormControl;\n }\n\n /** Creates a `form-array` item. */\n static create(\n config: NgsFormItemArrayConfig\n ): NgsFormsFormItem<NgsFormItemArrayConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayContainerComponent.key,\n config: config,\n };\n }\n}\n","<div [class]=\"config.containerClass || ''\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n</div>\n","import { Component, inject, ChangeDetectionStrategy, ChangeDetectorRef, OnInit } from '@angular/core';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { AbstractControl, FormArray, UntypedFormGroup } from '@angular/forms';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormArrayListConfig } from './form-array-list.config';\nimport { NgsFormsFormItemDirective } from '../../../core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\n\n/**\n * Renders one copy of `templateItem` for every row of the enclosing form array. Each row gets its own form group,\n * so the controls in the template become the properties of each array entry.\n *\n * @remarks Registry key: `form-array-list`. Must be placed inside an `NgsFormsFormArrayContainerComponent`.\n */\n@Component({\n selector: 'ngs-forms-form-array-list',\n templateUrl: './form-array-list.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent<NgsFormsFormArrayListConfig> implements OnInit {\n static override key = 'form-array-list';\n public internalArrayService = inject<NgsFormsFormArrayInternalService>(\n NgsFormsFormArrayInternalService\n );\n public myFormArray: FormArray<any> = this.internalArrayService.formArray;\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n ngOnInit() {\n this.subscribe(this.internalArrayService.itemsChanged, () => {\n this.changeDetectorRef.markForCheck();\n });\n }\n\n /** Creates a `form-array-list` item. */\n static create(\n config: NgsFormsFormArrayListConfig\n ): NgsFormsFormItem<NgsFormsFormArrayListConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayListComponent.key,\n config: config,\n };\n }\n\n castToFormGroup(control: AbstractControl): UntypedFormGroup {\n return control as UntypedFormGroup;\n }\n}\n","@for (formGroup of myFormArray.controls; track formGroup; let i = $index) {\n <div [attr.data-index]=\"$index\" [class]=\"config.containerClass || ''\">\n <ng-container [ngs-form-group]=\"castToFormGroup(formGroup)\" [ngs-form-index]=\"i\"\n [ngs-form-item]=\"config.templateItem\"></ng-container>\n </div>\n}\n","import { Component, inject, ChangeDetectionStrategy, ElementRef } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayRemoveItemConfig } from './form-array-remove-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { NGS_FORMS_ITEM_INDEX } from '../../../../misc';\nimport { v4 } from 'uuid';\n\n/**\n * A button that removes its own row from the enclosing form array, down to `minItems`.\n *\n * @remarks Registry key: `form-array-remove-item`. Place it inside the `templateItem` of an\n * `NgsFormsFormArrayListComponent` so each row gets one.\n */\n@Component({\n selector: 'ngs-forms-form-array-remove-item',\n templateUrl: './form-array-remove-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayRemoveItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayRemoveItemConfig> {\n static override key = 'form-array-remove-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n private elementRef = inject(ElementRef);\n private indexFromDi = inject<number>(NGS_FORMS_ITEM_INDEX, { optional: true });\n\n /** Index of the row this button belongs to. */\n get myIndex(): number {\n if (this.indexFromDi !== null && this.indexFromDi !== undefined) {\n return this.indexFromDi;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n const container = el.closest('[data-index]');\n if (container) {\n const idxAttr = container.getAttribute('data-index');\n if (idxAttr !== null) {\n return parseInt(idxAttr, 10);\n }\n }\n return 0;\n }\n\n constructor() {\n super();\n }\n\n /** Creates a `form-array-remove-item` item. */\n static create(config: NgsFormItemArrayRemoveItemConfig): NgsFormsFormItem<NgsFormItemArrayRemoveItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayRemoveItemComponent.key,\n config,\n };\n }\n\n removeItem() {\n this.internalArrayService.removeAt(this.myIndex);\n }\n}\n","<button\n (click)=\"removeItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-danger btn-sm'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Remove' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormsTextDivConfig } from './text-div-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n/**\n * Renders a line of static text, such as a heading or a hint, inside the form.\n *\n * @remarks Registry key: `text-div`. Config: `text` and optional `classes`.\n */\n@Component({\n selector: 'ngs-form-component-text-div',\n imports: [],\n templateUrl: './text-div.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsTextDivComponent extends NgsFormsBaseClassFormComponent<NgsFormsTextDivConfig> {\n static override key = 'text-div';\n\n /** Creates a `text-div` item. */\n static create(\n config: NgsFormsTextDivConfig\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsTextDivComponent.key,\n config: config,\n };\n }\n /**\n * Shortcut for a heading: creates a `text-div` with `text` and the given class (default `h2`).\n */\n static title(\n title: string,\n divClass = 'h2'\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return NgsFormsTextDivComponent.create({\n text: title,\n classes: divClass,\n });\n }\n}\n","<div class=\"{{ config.classes }}\">{{ config.text }}</div>\n","import { Component, ChangeDetectionStrategy, inject, Sanitizer, SecurityContext } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormItemHtmlContentConfig } from './html-content-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n/**\n * Renders an HTML string inside the form. The HTML is passed through Angular's sanitizer.\n *\n * @remarks Registry key: `content-html`. Registered by `registerCoreNgsFormComponents()`, which the theme packages'\n * `registerAll…` helpers call for you.\n */\n@Component({\n selector: 'ngs-form-component-html-content',\n imports: [],\n templateUrl: './html-content.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsHtmlContentComponent extends NgsFormsBaseClassFormComponent<NgsFormItemHtmlContentConfig> {\n static override key = 'content-html';\n contentConfig = this.config as NgsFormItemHtmlContentConfig;\n html: string;\n\n constructor() {\n super();\n const sanitizer = inject(Sanitizer);\n this.html =\n sanitizer.sanitize(SecurityContext.HTML, this.contentConfig.html) ||\n '';\n }\n\n /** Creates a `content-html` item. */\n static create(\n config: NgsFormItemHtmlContentConfig\n ): NgsFormsFormItem<NgsFormItemHtmlContentConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsHtmlContentComponent.key,\n config,\n };\n }\n}\n","<div [innerHTML]=\"html\"></div>\n","import { NgsFormsFormItemContainerConfigBase } from '../../../models/index';\n\nexport interface NgsFormsFormSectionConfig extends NgsFormsFormItemContainerConfigBase {\n title: string;\n titleClass?: string;\n subtitle?: string;\n subtitleClass?: string;\n}\n\nexport const sectionConfigDefaults: Partial<NgsFormsFormSectionConfig> = {\n titleClass: 'h3',\n subtitleClass: 'lead',\n};\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormSectionConfig, sectionConfigDefaults } from './section-config.interface';\nimport { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { ngsDefaults } from '../../../misc/defaults';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsFormItem } from '../../../models';\n\n/**\n * Groups items under a title and optional subtitle. Does not create a form control, so child values stay in the\n * parent group.\n *\n * @remarks Registry key: `section`. Config: `title`, `subtitle`, `titleClass` (default `h3`),\n * `subtitleClass` (default `lead`) and `items`.\n */\n@Component({\n selector: 'ngs-forms-form-section',\n templateUrl: './section.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormSectionComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormSectionConfig> implements OnInit {\n static override key = 'section';\n\n /** Creates a `section` item. */\n static create(config: NgsFormsFormSectionConfig): NgsFormsFormItem<NgsFormsFormSectionConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormSectionComponent.key,\n config: config,\n };\n }\n\n ngOnInit() {\n this.config = ngsDefaults(this.config, sectionConfigDefaults);\n }\n}\n","<div class=\"form-section\">\n <div class=\"form-section-title {{config.titleClass}}\">{{ config.title }}</div>\n @if (config.subtitle) {\n <div class=\"form-section-subtitle {{config.subtitleClass}}\">{{ config.subtitle }}</div>\n }\n @if (config.items.length) {\n <div class=\"form-section-items\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n </div>\n }\n</div>\n","// eslint-disable-next-line @typescript-eslint/no-empty-interface\nimport { NgsFormsFormErrorKeyValueMap } from '../errors';\nimport { Observable } from 'rxjs';\nimport { ValidatorFn } from '@angular/forms';\nimport { NgsFormsFormInputOption } from './form-item-option.model';\nimport { NgsFormsFormItem } from '../form-config';\n\n/** Base configuration shared by every form item (inputs, containers and content items). */\nexport interface NgsFormsFormItemConfigBase {\n /**\n * Stable identifier for the item. Generated with `uuid` by the `create()` factories when omitted.\n * Component state set with `NgsFormsService.updateComponentState()` can be keyed by this value.\n */\n uuid?: string;\n /**\n * Static visibility flag.\n *\n * @notImplemented\n * @remarks Reserved for future use: the renderer currently ignores it. Use `visible$` to show or hide an item.\n */\n visible?: boolean;\n /**\n * Stream that controls whether the item is rendered.\n *\n * @remarks When the stream emits `false` the item's component is destroyed and its control is removed from the\n * parent form group, so hidden fields are excluded from the form value and from validation. When it emits `true`\n * the component is created again with a fresh control. Items without `visible$` are always rendered.\n * @example\n * ```ts\n * visible$: this.forms.formValue$.pipe(map((v) => v?.profile?.contactMethod === 'email'))\n * ```\n */\n visible$?: Observable<boolean>;\n /**\n * Initial component state for this item.\n *\n * @notImplemented\n * @remarks Reserved for future use.\n */\n initialState?: any;\n}\n\n/**\n * Configuration for items that render a list of child items without creating a form control of their own\n * (for example sections and columns).\n */\nexport interface NgsFormsFormItemContainerConfigBase extends NgsFormsFormItemConfigBase {\n /** The child items to render, in order. */\n items: Array<NgsFormsFormItem<any>>\n}\n\n/**\n * Configuration for `NgsFormsFormGroupComponent`: a named group of child items backed by an `UntypedFormGroup`.\n */\nexport interface NgsFormsFormGroupConfig extends NgsFormsFormItemConfigBaseItemWithNameAndValidators, NgsFormsFormItemContainerConfigBase {}\n\n/** Base configuration for items that own a form control (inputs, groups and arrays). */\nexport interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFormItemConfigBase{\n /**\n * Control name inside the parent form group. Becomes the key of this item's value in `NgsFormsService.formValue$`.\n */\n name: string;\n /**\n * Maps validator error keys (for example `required`, `minlength`, `email`) to the message shown to the user.\n *\n * @remarks Only the first error on the control is displayed. Errors without an entry fall back to\n * `Field is invalid: <errorKey>`. Messages appear once the control is touched or dirty, or after\n * `NgsFormsService.setIsSubmitted(true)`.\n */\n errorMessageMap?: NgsFormsFormErrorKeyValueMap;\n /**\n * Static disabled flag.\n *\n * @notImplemented\n * @remarks Reserved for future use: the built-in components do not read it yet.\n */\n disabled?: boolean;\n /**\n * Stream that controls the disabled state.\n *\n * @notImplemented\n * @remarks Reserved for future use: the built-in components do not read it yet.\n */\n disabled$?: Observable<boolean>;\n /**\n * Angular validators applied to the item's control. Takes precedence over `validators$` when both are set.\n */\n validators?: Array<ValidatorFn>;\n /**\n * Stream of validator arrays. Each emission replaces the control's validators, which lets rules depend on other\n * values in the form. Ignored when `validators` is also set.\n *\n * @remarks The control's validity is recalculated on its next value change, so call `updateValueAndValidity()`\n * yourself if you need the new rules to apply immediately.\n */\n validators$? :Observable<Array<ValidatorFn>>;\n}\n\n// ---\n\n/** Base configuration for a labelled input control. */\nexport interface NgsFormsFormItemConfigBaseInput extends NgsFormsFormItemConfigBaseItemWithNameAndValidators {\n /**\n * Optional element id.\n *\n * @notImplemented\n * @remarks Reserved for future use: the built-in components generate their own ids.\n */\n id?: string;\n /** Label text shown next to or above the control. */\n label: string;\n /**\n * Initial value.\n *\n * @notImplemented\n * @remarks Reserved for future use. Set initial values with `NgsFormsService.patchValue()` after the form renders.\n */\n value?: unknown;\n}\n\n// ---\n\n/** Base configuration for single line text inputs. */\nexport interface NgsFormsFormItemConfigBaseTextInput extends NgsFormsFormItemConfigBaseInput {\n /** Placeholder text shown while the input is empty. */\n placeholder?: string;\n /**\n * The HTML input type.\n * @defaultValue 'text'\n */\n type?: 'text' | 'email' | 'password'\n}\n\n\n/**\n * Base configuration for inputs that choose from a list of options (radio groups and selects).\n */\nexport interface NgsFormsFormItemConfigBaseInputWithOptions extends NgsFormsFormItemConfigBaseInput {\n /** Static list of options. Used as the initial value when `options$` is also set. */\n options?: Array<NgsFormsFormInputOption>;\n /**\n * Stream of options. Each emission replaces the rendered options, which makes cascading selects and\n * server-loaded option lists possible.\n */\n options$?: Observable<Array<NgsFormsFormInputOption>>;\n}\n// --\n","import { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { NgsFormsColumnComponent } from './components/shared-form-components/column';\nimport { NgsFormsComponentRegistryService } from './services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormArrayAddItemComponent } from './components/shared-form-components/form-array/add-item';\nimport { NgsFormsFormArrayContainerComponent } from './components/shared-form-components/form-array/container';\nimport { NgsFormsFormArrayListComponent } from './components/shared-form-components/form-array/list';\nimport { NgsFormsFormArrayRemoveItemComponent } from './components/shared-form-components/form-array/remove-item';\nimport { NgsFormsFormSectionComponent } from './components/shared-form-components/section/section.component';\nimport { NgsFormsRowComponent } from './components/shared-form-components/row';\nimport { NgsFormsTextDivComponent } from './components/shared-form-components/text-div';\nimport { NgsFormsFormGroupComponent } from './components/shared-form-components/form-group';\nimport { NgsFormsHtmlContentComponent } from './components/shared-form-components/html-content/html-content.component';\n\n\n/** Registration helpers for the structural components in `@ng-simplicity/forms-core`. */\n@NgModule({\n imports: [CommonModule, FormsModule, ReactiveFormsModule],\n})\nexport class NgsFormsCoreModule {\n /**\n * Registers the structural components: `form-group`, `form-row`, `column`, `form-array`, `form-array-list`,\n * `form-array-add-item`, `form-array-remove-item`, `text-div`, `content-html` and `section`.\n *\n * @remarks The theme packages call this for you from their own `registerAll…` helpers.\n */\n static registerCoreNgsFormComponents(\n registryService: NgsFormsComponentRegistryService\n ) {\n registryService.register(NgsFormsFormGroupComponent.key, NgsFormsFormGroupComponent);\n registryService.register(NgsFormsRowComponent.key, NgsFormsRowComponent);\n registryService.register(\n NgsFormsColumnComponent.key,\n NgsFormsColumnComponent\n );\n registryService.register(\n NgsFormsFormArrayContainerComponent.key,\n NgsFormsFormArrayContainerComponent\n );\n registryService.register(\n NgsFormsFormArrayAddItemComponent.key,\n NgsFormsFormArrayAddItemComponent\n );\n registryService.register(\n NgsFormsFormArrayRemoveItemComponent.key,\n NgsFormsFormArrayRemoveItemComponent\n );\n registryService.register(\n NgsFormsFormArrayListComponent.key,\n NgsFormsFormArrayListComponent\n );\n registryService.register(\n NgsFormsTextDivComponent.key,\n NgsFormsTextDivComponent\n );\n registryService.register(\n NgsFormsHtmlContentComponent.key,\n NgsFormsHtmlContentComponent\n );\n registryService.register(\n NgsFormsFormSectionComponent.key,\n NgsFormsFormSectionComponent\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["uuidv4","i1.NgsFormsFormArrayInternalService"],"mappings":";;;;;;;;AAGA;MAEsB,aAAa,CAAA;AACd,IAAA,QAAQ,GAAG,IAAI,OAAO,EAAQ;IAEvC,aAAa,GAAmB,EAAE;;IAG5C,SAAS,CAAI,WAA0B,EAAE,YAAgC,EAAA;AACvE,QAAA,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;IACpE;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;AACxB,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,WAAW,EAAE,CAAC;IACtE;wGAdoB,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAb,aAAa,EAAA,YAAA,EAAA,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