@vadem/ui 0.0.3 → 0.2.0

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":"vadem-ui-field.mjs","names":[],"sources":["../../../projects/ui/field/src/choice.ts","../../../projects/ui/field/src/field-control.ts","../../../projects/ui/field/src/field.ts","../../../projects/ui/field/src/fieldset.ts","../../../projects/ui/field/src/ng-control-state.ts","../../../projects/ui/field/src/field-control-base.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n/**\n * Label that wraps a checkbox, switch or radio and its text. The whole label is the hit area;\n * the text is the control's accessible name. Spec: specs/checkbox.md\n */\n@Directive({\n selector: 'label[vdChoice]',\n host: { class: 'vd-choice' },\n})\nexport class VdChoice {}\n","import { InjectionToken, Signal } from '@angular/core';\n\n/** What a form control exposes to its surrounding `vd-field`. */\nexport interface VdFieldControl {\n readonly id: Signal<string>;\n readonly invalid: Signal<boolean>;\n readonly required: Signal<boolean>;\n readonly disabled: Signal<boolean>;\n}\n\n/** What `vd-field` exposes to the control inside it. */\nexport interface VdFieldContext {\n /** Space-separated ids for `aria-describedby` (hint or error), or null. */\n readonly describedBy: Signal<string | null>;\n register(control: VdFieldControl): void;\n unregister(control: VdFieldControl): void;\n}\n\nexport const VD_FIELD = new InjectionToken<VdFieldContext>('VD_FIELD');\n\nlet nextId = 0;\n/** Deterministic per-app id. Same creation order on server and client keeps hydration stable. */\nexport function vdUniqueId(prefix: string): string {\n return `${prefix}-${nextId++}`;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n signal,\n} from '@angular/core';\nimport { VdIcon } from '@vadem/ui/icon';\nimport { VD_FIELD, VdFieldContext, VdFieldControl, vdUniqueId } from './field-control';\n\n/**\n * Label, hint and error around one form control. Wires `for`, `aria-describedby`,\n * and the required marker automatically. Spec: specs/field.md\n */\n@Component({\n selector: 'vd-field',\n imports: [VdIcon],\n template: `\n @if (label()) {\n <label class=\"vd-field__label\" [attr.for]=\"control()?.id()\">\n {{ label() }}\n @if (control()?.required()) {\n <span class=\"vd-field__required\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n <ng-content />\n @if (showError()) {\n <p class=\"vd-field__error\" [id]=\"errorId\">\n <vd-icon name=\"alert-circle\" />\n <span>{{ error() }}</span>\n </p>\n } @else if (hint()) {\n <p class=\"vd-field__hint\" [id]=\"hintId\">{{ hint() }}</p>\n }\n `,\n host: {\n class: 'vd-field',\n '[attr.data-invalid]': 'showError() ? \"\" : null',\n '[attr.data-disabled]': 'control()?.disabled() ? \"\" : null',\n },\n providers: [{ provide: VD_FIELD, useExisting: VdField }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class VdField implements VdFieldContext {\n readonly label = input<string>();\n readonly hint = input<string>();\n /** Additional descriptive IDs, e.g. a character counter; retained beside hint/error. */\n readonly descriptionIds = input<string>();\n /** Message shown while the control is invalid. Replaces the hint. */\n readonly error = input<string>();\n\n protected readonly control = signal<VdFieldControl | null>(null);\n protected readonly hintId = vdUniqueId('vd-field-hint');\n protected readonly errorId = vdUniqueId('vd-field-error');\n\n protected readonly showError = computed(() => !!this.error() && !!this.control()?.invalid());\n\n readonly describedBy = computed(() => {\n const primary = this.showError() ? this.errorId : this.hint() ? this.hintId : '';\n const ids = [primary, this.descriptionIds() ?? ''].join(' ').split(/\\s+/).filter(Boolean);\n return [...new Set(ids)].join(' ') || null;\n });\n\n register(control: VdFieldControl): void {\n this.control.set(control);\n }\n\n unregister(control: VdFieldControl): void {\n if (this.control() === control) this.control.set(null);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n signal,\n} from '@angular/core';\nimport { VdIcon } from '@vadem/ui/icon';\nimport { VD_FIELD, VdFieldContext, VdFieldControl, vdUniqueId } from './field-control';\n\nexport type VdFieldsetOrientation = 'vertical' | 'horizontal';\n\n/**\n * Legend, hint and error around a group of choices (radios, checkboxes). The group is named by\n * the legend; hint and error describe the fieldset itself, so they are announced once when the\n * group is entered, not on every option. Spec: specs/field.md\n */\n@Component({\n // Attribute selector: the native fieldset keeps its group semantics.\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'fieldset[vdFieldset]',\n imports: [VdIcon],\n template: `\n @if (legend()) {\n <legend class=\"vd-fieldset__legend\">\n {{ legend() }}\n @if (required()) {\n <span class=\"vd-field__required\" aria-hidden=\"true\">*</span>\n }\n </legend>\n }\n @if (hint()) {\n <p class=\"vd-field__hint\" [id]=\"hintId\">{{ hint() }}</p>\n }\n @if (showError()) {\n <p class=\"vd-field__error\" [id]=\"errorId\">\n <vd-icon name=\"alert-circle\" />\n <span>{{ error() }}</span>\n </p>\n }\n <div class=\"vd-fieldset__options\"><ng-content /></div>\n `,\n host: {\n class: 'vd-fieldset',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-invalid]': 'showError() ? \"\" : null',\n '[attr.aria-describedby]': 'groupDescribedBy()',\n },\n providers: [{ provide: VD_FIELD, useExisting: VdFieldset }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class VdFieldset implements VdFieldContext {\n readonly legend = input<string>();\n readonly hint = input<string>();\n /** Shown while any control in the group is displayed invalid. */\n readonly error = input<string>();\n readonly orientation = input<VdFieldsetOrientation>('vertical');\n\n protected readonly controls = signal<readonly VdFieldControl[]>([]);\n protected readonly hintId = vdUniqueId('vd-fieldset-hint');\n protected readonly errorId = vdUniqueId('vd-fieldset-error');\n\n protected readonly required = computed(() => this.controls().some((c) => c.required()));\n protected readonly showError = computed(\n () => !!this.error() && this.controls().some((c) => c.invalid()),\n );\n protected readonly groupDescribedBy = computed(\n () =>\n [this.hint() ? this.hintId : null, this.showError() ? this.errorId : null]\n .filter(Boolean)\n .join(' ') || null,\n );\n\n /** Controls aren't described individually: the fieldset carries the description. */\n readonly describedBy = signal<string | null>(null).asReadonly();\n\n register(control: VdFieldControl): void {\n this.controls.update((list) => [...list, control]);\n }\n\n unregister(control: VdFieldControl): void {\n this.controls.update((list) => list.filter((c) => c !== control));\n }\n}\n","import { DestroyRef, Signal, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgControl, Validators } from '@angular/forms';\n\nexport interface VdNgControlState {\n invalid: boolean;\n touched: boolean;\n disabled: boolean;\n required: boolean;\n}\n\nconst EMPTY: VdNgControlState = {\n invalid: false,\n touched: false,\n disabled: false,\n required: false,\n};\n\n/**\n * Mirrors a Reactive/Template forms control into a signal (NgControl isn't signal-based).\n * Call once the control is resolved (ngOnInit or later). Returns a static empty state when\n * there's no control or it's a Signal Forms shim without `events`.\n */\nexport function vdNgControlState(\n ngControl: NgControl | null,\n destroyRef: DestroyRef,\n): Signal<VdNgControlState> {\n const control = ngControl?.control;\n const state = signal(EMPTY);\n if (!control?.events) return state;\n const sync = () =>\n state.set({\n invalid: control.invalid,\n touched: control.touched,\n disabled: control.disabled,\n required:\n control.hasValidator(Validators.required) || control.hasValidator(Validators.requiredTrue),\n });\n sync();\n control.events.pipe(takeUntilDestroyed(destroyRef)).subscribe(sync);\n return state;\n}\n","import {\n DestroyRef,\n Directive,\n OnInit,\n Signal,\n booleanAttribute,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { FormField } from '@angular/forms/signals';\nimport { VD_FIELD, VdFieldControl, vdUniqueId } from './field-control';\nimport { VdNgControlState, vdNgControlState } from './ng-control-state';\n\n/**\n * Shared behavior for controls on native form elements (input, checkbox, switch):\n * displayed validity from Reactive/Template forms or Signal Forms, `vd-field` registration,\n * and the ARIA/data attributes that go with it. Not part of the styling contract.\n */\n@Directive({\n host: {\n '[id]': 'id()',\n '[attr.data-invalid]': 'showInvalid() ? \"\" : null',\n '[attr.aria-invalid]': 'showInvalid() ? \"true\" : null',\n '[attr.aria-describedby]': 'field?.describedBy() ?? null',\n '[attr.required]': 'required() ? \"\" : null',\n },\n})\nexport abstract class VdFieldControlBase implements OnInit {\n /** Invalid state (e.g. a server error). Reactive/Template form validity is detected on its own. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /**\n * Optional gate for `invalid`: when explicitly false the error isn't shown yet. Signal Forms\n * binds `invalid`, `touched` and `required` here automatically (FormUiControl contract).\n */\n readonly touched = input<boolean | undefined>(undefined);\n readonly required = input(false, { transform: booleanAttribute });\n readonly id = input(vdUniqueId('vd-control'));\n\n protected readonly field = inject(VD_FIELD, { optional: true });\n private readonly ngControl = inject(NgControl, { self: true, optional: true });\n private readonly formField = inject(FormField, { self: true, optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n /** Mirrored Reactive/Template forms state; set once the control is resolved (ngOnInit). */\n private readonly ngSource = signal<Signal<VdNgControlState> | null>(null);\n private readonly ngState = computed(\n () =>\n this.ngSource()?.() ?? { invalid: false, touched: false, disabled: false, required: false },\n );\n\n /** Invalid as displayed: forced, or form-invalid after the user has touched the control. */\n readonly showInvalid = computed(() => {\n if (this.invalid() && this.touched() !== false) return true;\n const ng = this.ngState();\n return ng.invalid && ng.touched;\n });\n\n private readonly fieldControl: VdFieldControl = {\n id: this.id,\n invalid: this.showInvalid,\n required: computed(\n () => this.required() || this.ngState().required || !!this.formField?.state().required(),\n ),\n disabled: computed(() => this.ngState().disabled || !!this.formField?.state().disabled()),\n };\n\n constructor() {\n this.field?.register(this.fieldControl);\n this.destroyRef.onDestroy(() => this.field?.unregister(this.fieldControl));\n }\n\n ngOnInit(): void {\n // NgControl resolves its control only after init. Signal Forms provides an NgControl shim\n // too; its state arrives through the inputs instead.\n if (!this.formField) this.ngSource.set(vdNgControlState(this.ngControl, this.destroyRef));\n }\n}\n"],"mappings":";;;;;;AAUA,IAAa,WAAb,MAAa,SAAQ;CAAR,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,G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A"}
1
+ {"version":3,"file":"vadem-ui-field.mjs","names":[],"sources":["../../../projects/ui/field/src/choice.ts","../../../projects/ui/field/src/field-control.ts","../../../projects/ui/field/src/field.ts","../../../projects/ui/field/src/fieldset.ts","../../../projects/ui/field/src/ng-control-state.ts","../../../projects/ui/field/src/field-control-base.ts"],"sourcesContent":["import { Directive } from '@angular/core';\n\n/**\n * Label that wraps a checkbox, switch or radio and its text. The whole label is the hit area;\n * the text is the control's accessible name. Spec: specs/checkbox.md\n */\n@Directive({\n selector: 'label[vdChoice]',\n host: { class: 'vd-choice' },\n})\nexport class VdChoice {}\n","import { InjectionToken, Signal } from '@angular/core';\n\n/** What a form control exposes to its surrounding `vd-field`. */\nexport interface VdFieldControl {\n readonly id: Signal<string>;\n readonly invalid: Signal<boolean>;\n readonly required: Signal<boolean>;\n readonly disabled: Signal<boolean>;\n}\n\n/** What `vd-field` exposes to the control inside it. */\nexport interface VdFieldContext {\n /** Space-separated ids for `aria-describedby` (hint or error), or null. */\n readonly describedBy: Signal<string | null>;\n register(control: VdFieldControl): void;\n unregister(control: VdFieldControl): void;\n}\n\nexport const VD_FIELD = new InjectionToken<VdFieldContext>('VD_FIELD');\n\nlet nextId = 0;\n/** Deterministic per-app id. Same creation order on server and client keeps hydration stable. */\nexport function vdUniqueId(prefix: string): string {\n return `${prefix}-${nextId++}`;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n signal,\n} from '@angular/core';\nimport { VdIcon } from '@vadem/ui/icon';\nimport { VD_FIELD, VdFieldContext, VdFieldControl, vdUniqueId } from './field-control';\n\n/**\n * Label, hint and error around one form control. Wires `for`, `aria-describedby`,\n * and the required marker automatically. Spec: specs/field.md\n */\n@Component({\n selector: 'vd-field',\n imports: [VdIcon],\n template: `\n @if (label()) {\n <label class=\"vd-field__label\" [attr.for]=\"control()?.id()\">\n {{ label() }}\n @if (control()?.required()) {\n <span class=\"vd-field__required\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n <ng-content />\n @if (showError()) {\n <p class=\"vd-field__error\" [id]=\"errorId\">\n <vd-icon name=\"alert-circle\" />\n <span>{{ error() }}</span>\n </p>\n } @else if (hint()) {\n <p class=\"vd-field__hint\" [id]=\"hintId\">{{ hint() }}</p>\n }\n `,\n host: {\n class: 'vd-field',\n '[attr.data-invalid]': 'showError() ? \"\" : null',\n '[attr.data-disabled]': 'control()?.disabled() ? \"\" : null',\n },\n providers: [{ provide: VD_FIELD, useExisting: VdField }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class VdField implements VdFieldContext {\n readonly label = input<string>();\n readonly hint = input<string>();\n /** Additional descriptive IDs, e.g. a character counter; retained beside hint/error. */\n readonly descriptionIds = input<string>();\n /** Message shown while the control is invalid. Replaces the hint. */\n readonly error = input<string>();\n\n protected readonly control = signal<VdFieldControl | null>(null);\n protected readonly hintId = vdUniqueId('vd-field-hint');\n protected readonly errorId = vdUniqueId('vd-field-error');\n\n protected readonly showError = computed(() => !!this.error() && !!this.control()?.invalid());\n\n readonly describedBy = computed(() => {\n const primary = this.showError() ? this.errorId : this.hint() ? this.hintId : '';\n const ids = [primary, this.descriptionIds() ?? ''].join(' ').split(/\\s+/).filter(Boolean);\n return [...new Set(ids)].join(' ') || null;\n });\n\n register(control: VdFieldControl): void {\n this.control.set(control);\n }\n\n unregister(control: VdFieldControl): void {\n if (this.control() === control) this.control.set(null);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n signal,\n} from '@angular/core';\nimport { VdIcon } from '@vadem/ui/icon';\nimport { VD_FIELD, VdFieldContext, VdFieldControl, vdUniqueId } from './field-control';\n\nexport type VdFieldsetOrientation = 'vertical' | 'horizontal';\n\n/**\n * Legend, hint and error around a group of choices (radios, checkboxes). The group is named by\n * the legend; hint and error describe the fieldset itself, so they are announced once when the\n * group is entered, not on every option. Spec: specs/field.md\n */\n@Component({\n // Attribute selector: the native fieldset keeps its group semantics.\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'fieldset[vdFieldset]',\n imports: [VdIcon],\n template: `\n @if (legend()) {\n <legend class=\"vd-fieldset__legend\">\n {{ legend() }}\n @if (required()) {\n <span class=\"vd-field__required\" aria-hidden=\"true\">*</span>\n }\n </legend>\n }\n @if (hint()) {\n <p class=\"vd-field__hint\" [id]=\"hintId\">{{ hint() }}</p>\n }\n @if (showError()) {\n <p class=\"vd-field__error\" [id]=\"errorId\">\n <vd-icon name=\"alert-circle\" />\n <span>{{ error() }}</span>\n </p>\n }\n <div class=\"vd-fieldset__options\"><ng-content /></div>\n `,\n host: {\n class: 'vd-fieldset',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-invalid]': 'showError() ? \"\" : null',\n '[attr.aria-describedby]': 'groupDescribedBy()',\n },\n providers: [{ provide: VD_FIELD, useExisting: VdFieldset }],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class VdFieldset implements VdFieldContext {\n readonly legend = input<string>();\n readonly hint = input<string>();\n /** Shown while any control in the group is displayed invalid. */\n readonly error = input<string>();\n readonly orientation = input<VdFieldsetOrientation>('vertical');\n\n protected readonly controls = signal<readonly VdFieldControl[]>([]);\n protected readonly hintId = vdUniqueId('vd-fieldset-hint');\n protected readonly errorId = vdUniqueId('vd-fieldset-error');\n\n protected readonly required = computed(() => this.controls().some((c) => c.required()));\n protected readonly showError = computed(\n () => !!this.error() && this.controls().some((c) => c.invalid()),\n );\n protected readonly groupDescribedBy = computed(\n () =>\n [this.hint() ? this.hintId : null, this.showError() ? this.errorId : null]\n .filter(Boolean)\n .join(' ') || null,\n );\n\n /** Controls aren't described individually: the fieldset carries the description. */\n readonly describedBy = signal<string | null>(null).asReadonly();\n\n register(control: VdFieldControl): void {\n this.controls.update((list) => [...list, control]);\n }\n\n unregister(control: VdFieldControl): void {\n this.controls.update((list) => list.filter((c) => c !== control));\n }\n}\n","import { DestroyRef, Signal, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgControl, Validators } from '@angular/forms';\n\nexport interface VdNgControlState {\n invalid: boolean;\n touched: boolean;\n disabled: boolean;\n required: boolean;\n}\n\nconst EMPTY: VdNgControlState = {\n invalid: false,\n touched: false,\n disabled: false,\n required: false,\n};\n\n/**\n * Mirrors a Reactive/Template forms control into a signal (NgControl isn't signal-based).\n * Call once the control is resolved (ngOnInit or later). Returns a static empty state when\n * there's no control or it's a Signal Forms shim without `events`.\n */\nexport function vdNgControlState(\n ngControl: NgControl | null,\n destroyRef: DestroyRef,\n): Signal<VdNgControlState> {\n const control = ngControl?.control;\n const state = signal(EMPTY);\n if (!control?.events) return state;\n const sync = () =>\n state.set({\n invalid: control.invalid,\n touched: control.touched,\n disabled: control.disabled,\n required:\n control.hasValidator(Validators.required) || control.hasValidator(Validators.requiredTrue),\n });\n sync();\n control.events.pipe(takeUntilDestroyed(destroyRef)).subscribe(sync);\n return state;\n}\n","import {\n DestroyRef,\n Directive,\n ElementRef,\n OnInit,\n Signal,\n booleanAttribute,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { FormField } from '@angular/forms/signals';\nimport { VD_FIELD, VdFieldControl, vdUniqueId } from './field-control';\nimport { VdNgControlState, vdNgControlState } from './ng-control-state';\n\n/**\n * Shared behavior for controls on native form elements (input, checkbox, switch):\n * displayed validity from Reactive/Template forms or Signal Forms, `vd-field` registration,\n * and the ARIA/data attributes that go with it. Not part of the styling contract.\n */\n@Directive({\n host: {\n '[id]': 'id()',\n '[attr.data-invalid]': 'showInvalid() ? \"\" : null',\n '[attr.aria-invalid]': 'showInvalid() ? \"true\" : null',\n '[attr.aria-describedby]': 'field?.describedBy() ?? null',\n '[attr.required]': 'required() || (requiredByValidator() && isRadio) ? \"\" : null',\n // Reactive/Template validators don't add the native attribute. Announce them with\n // aria-required (not supported on role=radio, which gets the native attribute instead).\n '[attr.aria-required]': 'requiredByValidator() && !isRadio ? \"true\" : null',\n },\n})\nexport abstract class VdFieldControlBase implements OnInit {\n /** Invalid state (e.g. a server error). Reactive/Template form validity is detected on its own. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /**\n * Optional gate for `invalid`: when explicitly false the error isn't shown yet. Signal Forms\n * binds `invalid`, `touched` and `required` here automatically (FormUiControl contract).\n */\n readonly touched = input<boolean | undefined>(undefined);\n readonly required = input(false, { transform: booleanAttribute });\n readonly id = input(vdUniqueId('vd-control'));\n\n protected readonly field = inject(VD_FIELD, { optional: true });\n private readonly ngControl = inject(NgControl, { self: true, optional: true });\n private readonly formField = inject(FormField, { self: true, optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n /** Mirrored Reactive/Template forms state; set once the control is resolved (ngOnInit). */\n private readonly ngSource = signal<Signal<VdNgControlState> | null>(null);\n private readonly ngState = computed(\n () =>\n this.ngSource()?.() ?? { invalid: false, touched: false, disabled: false, required: false },\n );\n\n protected readonly isRadio =\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement.getAttribute('type') === 'radio';\n /** Required by a Reactive/Template validator while the `required` input is unset. */\n protected readonly requiredByValidator = computed(\n () => !this.required() && this.ngState().required,\n );\n\n /** Invalid as displayed: forced, or form-invalid after the user has touched the control. */\n readonly showInvalid = computed(() => {\n if (this.invalid() && this.touched() !== false) return true;\n const ng = this.ngState();\n return ng.invalid && ng.touched;\n });\n\n private readonly fieldControl: VdFieldControl = {\n id: this.id,\n invalid: this.showInvalid,\n required: computed(\n () => this.required() || this.ngState().required || !!this.formField?.state().required(),\n ),\n disabled: computed(() => this.ngState().disabled || !!this.formField?.state().disabled()),\n };\n\n constructor() {\n this.field?.register(this.fieldControl);\n this.destroyRef.onDestroy(() => this.field?.unregister(this.fieldControl));\n }\n\n ngOnInit(): void {\n // NgControl resolves its control only after init. Signal Forms provides an NgControl shim\n // too; its state arrives through the inputs instead.\n if (!this.formField) this.ngSource.set(vdNgControlState(this.ngControl, this.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