@spartan-ng/brain 1.0.1 → 1.0.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.
- package/fesm2022/spartan-ng-brain-calendar.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-combobox.mjs +4 -3
- package/fesm2022/spartan-ng-brain-combobox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-field.mjs +35 -15
- package/fesm2022/spartan-ng-brain-field.mjs.map +1 -1
- package/package.json +1 -1
- package/types/spartan-ng-brain-calendar.d.ts +1 -1
- package/types/spartan-ng-brain-combobox.d.ts +2 -1
- package/types/spartan-ng-brain-field.d.ts +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, computed, Injectable, input, booleanAttribute, Directive, InjectionToken, inject, Injector, DestroyRef
|
|
2
|
+
import { signal, computed, Injectable, input, booleanAttribute, Directive, InjectionToken, inject, Injector, DestroyRef } from '@angular/core';
|
|
3
3
|
import { NgForm, FormGroupDirective, NgControl } from '@angular/forms';
|
|
4
4
|
import { ErrorStateMatcher, createStateTracker } from '@spartan-ng/brain/forms';
|
|
5
5
|
|
|
@@ -58,15 +58,30 @@ class BrnField {
|
|
|
58
58
|
_touched = computed(() => {
|
|
59
59
|
return this._brnFieldControl()?.controlState()?.touched ?? null;
|
|
60
60
|
}, ...(ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []));
|
|
61
|
-
labelableId = computed(() => this.
|
|
61
|
+
labelableId = computed(() => this._labelable()?.labelableId(), ...(ngDevMode ? [{ debugName: "labelableId" }] : /* istanbul ignore next */ []));
|
|
62
|
+
brnFieldControl = this._brnFieldControl.asReadonly();
|
|
62
63
|
errors = computed(() => this._brnFieldControl()?.errors() ?? null, ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
63
64
|
controlState = computed(() => this._brnFieldControl()?.controlState() ?? null, ...(ngDevMode ? [{ debugName: "controlState" }] : /* istanbul ignore next */ []));
|
|
64
65
|
registerFieldControl(fieldControl) {
|
|
66
|
+
if (this._brnFieldControl())
|
|
67
|
+
return;
|
|
65
68
|
this._brnFieldControl.set(fieldControl);
|
|
66
69
|
}
|
|
67
70
|
registerLabelable(labelable) {
|
|
71
|
+
if (this._labelable())
|
|
72
|
+
return;
|
|
68
73
|
this._labelable.set(labelable);
|
|
69
74
|
}
|
|
75
|
+
unregisterFieldControl(fieldControl) {
|
|
76
|
+
if (this._brnFieldControl() !== fieldControl)
|
|
77
|
+
return;
|
|
78
|
+
this._brnFieldControl.set(null);
|
|
79
|
+
}
|
|
80
|
+
unregisterLabelable(labelable) {
|
|
81
|
+
if (this._labelable() !== labelable)
|
|
82
|
+
return;
|
|
83
|
+
this._labelable.set(null);
|
|
84
|
+
}
|
|
70
85
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnField, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
71
86
|
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnField, isStandalone: true, selector: "[brnField],brn-field", inputs: { dataInvalid: { classPropertyName: "dataInvalid", publicName: "data-invalid", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-invalid": "_invalid() ? \"true\" : null", "attr.data-matches-spartan-invalid": "_spartanInvalid() ? \"true\" : null", "attr.data-touched": "_touched() ? \"true\" : null", "attr.data-dirty": "_dirty() ? \"true\" : null" } }, providers: [BrnFieldA11yService], ngImport: i0 });
|
|
72
87
|
}
|
|
@@ -99,13 +114,13 @@ class BrnFieldControl {
|
|
|
99
114
|
_parentFormGroup = inject(FormGroupDirective, { optional: true });
|
|
100
115
|
_field = inject(BrnField, { optional: true });
|
|
101
116
|
_destroyRef = inject(DestroyRef);
|
|
102
|
-
|
|
117
|
+
_labelable = null;
|
|
118
|
+
_parentFieldControl = null;
|
|
103
119
|
_stateTracker = signal(null, ...(ngDevMode ? [{ debugName: "_stateTracker" }] : /* istanbul ignore next */ []));
|
|
104
120
|
/** Sentinel value to differentiate "never checked" from "control is null". */
|
|
105
121
|
_lastControl = null;
|
|
106
122
|
/** Gets the AbstractControlDirective for this control. */
|
|
107
123
|
ngControl = null;
|
|
108
|
-
id = signal(undefined, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
109
124
|
controlState = computed(() => this._stateTracker()?.controlState() ?? null, ...(ngDevMode ? [{ debugName: "controlState" }] : /* istanbul ignore next */ []));
|
|
110
125
|
errors = computed(() => this._stateTracker()?.errors() ?? null, ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
111
126
|
dirty = computed(() => this._stateTracker()?.dirty() ?? null, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
|
|
@@ -114,15 +129,16 @@ class BrnFieldControl {
|
|
|
114
129
|
touched = computed(() => this._stateTracker()?.touched() ?? null, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
115
130
|
constructor() {
|
|
116
131
|
this._destroyRef.onDestroy(() => {
|
|
117
|
-
this.
|
|
132
|
+
this._field?.unregisterFieldControl(this);
|
|
133
|
+
if (this._labelable) {
|
|
134
|
+
this._field?.unregisterLabelable(this._labelable);
|
|
135
|
+
}
|
|
118
136
|
this._stateTracker()?.destroy();
|
|
119
137
|
});
|
|
120
138
|
}
|
|
121
139
|
ngOnInit() {
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
-
// Only register with BrnField when this control has its own NgControl, otherwise descendant
|
|
125
|
-
// field controls rendered in portals (e.g. calendar selects) overwrite the real control's registration.
|
|
140
|
+
this.ngControl = this._injector.get(NgControl, null);
|
|
141
|
+
this._parentFieldControl = this._injector.get(BrnFieldControl, null, { skipSelf: true });
|
|
126
142
|
if (this.ngControl) {
|
|
127
143
|
this._field?.registerFieldControl(this);
|
|
128
144
|
}
|
|
@@ -136,11 +152,9 @@ class BrnFieldControl {
|
|
|
136
152
|
this._syncTracker();
|
|
137
153
|
});
|
|
138
154
|
}
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
this.
|
|
142
|
-
this.id.set(labelable.labelableId());
|
|
143
|
-
}, { ...(ngDevMode ? { debugName: "_idEffectRef" } : /* istanbul ignore next */ {}), injector: this._injector });
|
|
155
|
+
this._labelable = this._injector.get(BrnLabelable, null);
|
|
156
|
+
if (this._labelable) {
|
|
157
|
+
this._field?.registerLabelable(this._labelable);
|
|
144
158
|
}
|
|
145
159
|
}
|
|
146
160
|
// Re-evaluate the control reference on every change detection cycle because
|
|
@@ -151,7 +165,7 @@ class BrnFieldControl {
|
|
|
151
165
|
}
|
|
152
166
|
/** @returns true if the control reference changed */
|
|
153
167
|
_syncTracker() {
|
|
154
|
-
if (!this.ngControl)
|
|
168
|
+
if (!this.ngControl || this._hasFieldControlParent())
|
|
155
169
|
return;
|
|
156
170
|
const currentControl = this.ngControl.control ?? null;
|
|
157
171
|
if (currentControl === this._lastControl)
|
|
@@ -162,6 +176,12 @@ class BrnFieldControl {
|
|
|
162
176
|
? createStateTracker(this.ngControl, this._errorStateMatcher, this._parentFormGroup, this._parentForm)
|
|
163
177
|
: null);
|
|
164
178
|
}
|
|
179
|
+
_hasFieldControlParent() {
|
|
180
|
+
if (this._field) {
|
|
181
|
+
return this._field.brnFieldControl() !== this;
|
|
182
|
+
}
|
|
183
|
+
return !!this._parentFieldControl?.ngControl && this._parentFieldControl.ngControl === this.ngControl;
|
|
184
|
+
}
|
|
165
185
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
166
186
|
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnFieldControl, isStandalone: true, ngImport: i0 });
|
|
167
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-field.mjs","sources":["../../../../libs/brain/field/src/lib/brn-field-aria.service.ts","../../../../libs/brain/field/src/lib/brn-field.ts","../../../../libs/brain/field/src/lib/brn-labelable.ts","../../../../libs/brain/field/src/lib/brn-field-control.ts","../../../../libs/brain/field/src/lib/brn-field-control-described-by.ts","../../../../libs/brain/field/src/index.ts","../../../../libs/brain/field/src/spartan-ng-brain-field.ts"],"sourcesContent":["import { computed, Injectable, signal } from '@angular/core';\n\n@Injectable()\nexport class BrnFieldA11yService {\n\tprivate readonly _descriptions = signal<string[]>([]);\n\tprivate readonly _errors = signal<string[]>([]);\n\n\tpublic readonly describedBy = computed(() => {\n\t\tconst ids = [...this._descriptions(), ...this._errors()].filter(Boolean);\n\t\tconst uniqueIds = [...new Set(ids)];\n\t\treturn uniqueIds.length ? uniqueIds.join(' ') : null;\n\t});\n\n\tpublic registerDescription(id: string) {\n\t\tthis._descriptions.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic unregisterDescription(id: string) {\n\t\tthis._descriptions.update((ids) => ids.filter((value) => value !== id));\n\t}\n\n\tpublic registerError(id: string) {\n\t\tthis._errors.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic unregisterError(id: string) {\n\t\tthis._errors.update((ids) => ids.filter((value) => value !== id));\n\t}\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, signal } from '@angular/core';\nimport { BrnFieldA11yService } from './brn-field-aria.service';\nimport { BrnFieldControl } from './brn-field-control';\nimport { BrnLabelable } from './brn-labelable';\n\n@Directive({\n\tselector: '[brnField],brn-field',\n\tproviders: [BrnFieldA11yService],\n\thost: {\n\t\t'[attr.data-invalid]': '_invalid() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_touched() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty() ? \"true\" : null',\n\t},\n})\nexport class BrnField {\n\tprivate readonly _brnFieldControl = signal<BrnFieldControl | null>(null);\n\tprivate readonly _labelable = signal<BrnLabelable | null>(null);\n\n\t/** Whether the field is invalid. Overrides the `data-invalid` attribute. */\n\tpublic readonly dataInvalid = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t\talias: 'data-invalid',\n\t});\n\n\t/**\n\t * Whether to force the field into an invalid state, regardless of the form control's state.\n\t * Overrides both the `data-invalid` and `data-matches-spartan-invalid` attributes.\n\t */\n\tpublic readonly forceInvalid = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\tprotected readonly _invalid = computed(() => {\n\t\tif (this.forceInvalid() || this.dataInvalid()) return true;\n\n\t\tconst control = this._brnFieldControl();\n\t\tif (!control || !control.ngControl) return false;\n\n\t\treturn control.controlState()?.invalid;\n\t});\n\n\tprotected readonly _spartanInvalid = computed(() => {\n\t\treturn this.forceInvalid() || (this._brnFieldControl()?.controlState()?.spartanInvalid ?? null);\n\t});\n\n\tprotected readonly _dirty = computed(() => {\n\t\treturn this._brnFieldControl()?.controlState()?.dirty ?? null;\n\t});\n\n\tprotected readonly _touched = computed(() => {\n\t\treturn this._brnFieldControl()?.controlState()?.touched ?? null;\n\t});\n\n\tpublic readonly labelableId = computed(() => this._brnFieldControl()?.id?.() ?? this._labelable()?.labelableId());\n\n\tpublic readonly errors = computed(() => this._brnFieldControl()?.errors() ?? null);\n\tpublic readonly controlState = computed(() => this._brnFieldControl()?.controlState() ?? null);\n\n\tpublic registerFieldControl(fieldControl: BrnFieldControl) {\n\t\tthis._brnFieldControl.set(fieldControl);\n\t}\n\n\tpublic registerLabelable(labelable: BrnLabelable) {\n\t\tthis._labelable.set(labelable);\n\t}\n}\n","import { type ExistingProvider, inject, InjectionToken, type Signal, type Type } from '@angular/core';\n\nexport interface BrnLabelable {\n\tlabelableId: Signal<string | null | undefined>;\n}\n\nexport const BrnLabelable = new InjectionToken<BrnLabelable>('BrnLabelable');\n\nexport function provideBrnLabelable(labelable: Type<BrnLabelable>): ExistingProvider {\n\treturn { provide: BrnLabelable, useExisting: labelable };\n}\n\nexport function injectBrnLabelable(): BrnLabelable | null {\n\treturn inject(BrnLabelable, { optional: true });\n}\n","import { computed, DestroyRef, Directive, DoCheck, effect, inject, Injector, OnInit, signal } from '@angular/core';\nimport { type AbstractControl, FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport { createStateTracker, ErrorStateMatcher, type StateTracker } from '@spartan-ng/brain/forms';\nimport { BrnField } from './brn-field';\nimport { BrnLabelable } from './brn-labelable';\n\n@Directive()\nexport class BrnFieldControl implements OnInit, DoCheck {\n\tprivate readonly _injector = inject(Injector);\n\tprivate readonly _errorStateMatcher = inject(ErrorStateMatcher);\n\tprivate readonly _parentForm = inject(NgForm, { optional: true });\n\tprivate readonly _parentFormGroup = inject(FormGroupDirective, { optional: true });\n\tprivate readonly _field = inject(BrnField, { optional: true });\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\n\tprivate _idEffectRef?: ReturnType<typeof effect>;\n\tprivate readonly _stateTracker = signal<StateTracker | null>(null);\n\t/** Sentinel value to differentiate \"never checked\" from \"control is null\". */\n\tprivate _lastControl: AbstractControl | null = null;\n\n\t/** Gets the AbstractControlDirective for this control. */\n\tpublic ngControl: NgControl | null = null;\n\n\tpublic readonly id = signal<string | null | undefined>(undefined);\n\n\tpublic readonly controlState = computed(() => this._stateTracker()?.controlState() ?? null);\n\tpublic readonly errors = computed(() => this._stateTracker()?.errors() ?? null);\n\tpublic readonly dirty = computed(() => this._stateTracker()?.dirty() ?? null);\n\tpublic readonly invalid = computed(() => this._stateTracker()?.invalid() ?? null);\n\tpublic readonly spartanInvalid = computed(() => this._stateTracker()?.spartanInvalid() ?? null);\n\tpublic readonly touched = computed(() => this._stateTracker()?.touched() ?? null);\n\n\tconstructor() {\n\t\tthis._destroyRef.onDestroy(() => {\n\t\t\tthis._idEffectRef?.destroy();\n\t\t\tthis._stateTracker()?.destroy();\n\t\t});\n\t}\n\n\tngOnInit(): void {\n\t\t// `self` prevents descendants (e.g. calendar selects) from inheriting an ancestor's NgControl.\n\t\tthis.ngControl = this._injector.get(NgControl, null, { optional: true, self: true });\n\n\t\t// Only register with BrnField when this control has its own NgControl, otherwise descendant\n\t\t// field controls rendered in portals (e.g. calendar selects) overwrite the real control's registration.\n\t\tif (this.ngControl) {\n\t\t\tthis._field?.registerFieldControl(this);\n\t\t}\n\n\t\t// Try to sync the tracker eagerly.\n\t\tthis._syncTracker();\n\n\t\t// For template-driven forms and FormControlName, the control is often resolved\n\t\t// asynchronously by Angular's directives after our ngOnInit/ngDoCheck.\n\t\t// Schedule a one-time microtask to catch the initial resolution.\n\t\tif (this.ngControl) {\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tthis._syncTracker();\n\t\t\t});\n\t\t}\n\n\t\tconst labelable = this._injector.get(BrnLabelable, null);\n\t\tif (labelable) {\n\t\t\tthis._idEffectRef = effect(\n\t\t\t\t() => {\n\t\t\t\t\tthis.id.set(labelable.labelableId());\n\t\t\t\t},\n\t\t\t\t{ injector: this._injector },\n\t\t\t);\n\t\t}\n\t}\n\n\t// Re-evaluate the control reference on every change detection cycle because\n\t// the underlying AbstractControl may change when [formControl] rebinds to a new instance.\n\t// When the instance changes we tear down the old tracker and create a fresh one.\n\tngDoCheck(): void {\n\t\tthis._syncTracker();\n\t}\n\n\t/** @returns true if the control reference changed */\n\tprivate _syncTracker(): void {\n\t\tif (!this.ngControl) return;\n\t\tconst currentControl = this.ngControl.control ?? null;\n\t\tif (currentControl === this._lastControl) return;\n\t\tthis._lastControl = currentControl;\n\t\tthis._stateTracker()?.destroy();\n\t\tthis._stateTracker.set(\n\t\t\tcurrentControl\n\t\t\t\t? createStateTracker(this.ngControl, this._errorStateMatcher, this._parentFormGroup, this._parentForm)\n\t\t\t\t: null,\n\t\t);\n\t}\n}\n","import { computed, Directive, inject, input } from '@angular/core';\nimport { BrnFieldA11yService } from './brn-field-aria.service';\n\n@Directive({\n\tselector: '[brnFieldControlDescribedBy]',\n\thost: {\n\t\t'[attr.aria-describedby]': '_computedDescribedBy()',\n\t},\n})\nexport class BrnFieldControlDescribedBy {\n\tpublic readonly describedBy = input<string | null>(null, { alias: 'aria-describedby' });\n\tprivate readonly _a11y = inject(BrnFieldA11yService, { optional: true });\n\n\tprotected readonly _computedDescribedBy = computed(() => {\n\t\tconst manual = this.describedBy();\n\t\tconst manualList = manual ? manual.split(/\\s+/).filter(Boolean) : [];\n\t\tconst fieldIds = this._a11y?.describedBy() ?? null;\n\t\tconst fieldList = fieldIds ? fieldIds.split(/\\s+/).filter(Boolean) : [];\n\n\t\tconst combined = [...new Set([...manualList, ...fieldList])];\n\t\treturn combined.length ? combined.join(' ') : null;\n\t});\n}\n","import { BrnField } from './lib/brn-field';\nimport { BrnFieldControl } from './lib/brn-field-control';\nimport { BrnFieldControlDescribedBy } from './lib/brn-field-control-described-by';\n\nexport * from './lib/brn-field';\nexport * from './lib/brn-field-aria.service';\nexport * from './lib/brn-field-control';\nexport * from './lib/brn-field-control-described-by';\nexport * from './lib/brn-labelable';\n\nexport const BrnFieldImports = [BrnField, BrnFieldControl, BrnFieldControlDescribedBy] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAGa,mBAAmB,CAAA;AACd,IAAA,aAAa,GAAG,MAAM,CAAW,EAAE,oFAAC;AACpC,IAAA,OAAO,GAAG,MAAM,CAAW,EAAE,8EAAC;AAE/B,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;QAC3C,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAA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AA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBANtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,IAAI,EAAE;AACL,wBAAA,yBAAyB,EAAE,wBAAwB;AACnD,qBAAA;AACD,iBAAA;;;ACEM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAE,0BAA0B;;ACVrF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-field.mjs","sources":["../../../../libs/brain/field/src/lib/brn-field-aria.service.ts","../../../../libs/brain/field/src/lib/brn-field.ts","../../../../libs/brain/field/src/lib/brn-labelable.ts","../../../../libs/brain/field/src/lib/brn-field-control.ts","../../../../libs/brain/field/src/lib/brn-field-control-described-by.ts","../../../../libs/brain/field/src/index.ts","../../../../libs/brain/field/src/spartan-ng-brain-field.ts"],"sourcesContent":["import { computed, Injectable, signal } from '@angular/core';\n\n@Injectable()\nexport class BrnFieldA11yService {\n\tprivate readonly _descriptions = signal<string[]>([]);\n\tprivate readonly _errors = signal<string[]>([]);\n\n\tpublic readonly describedBy = computed(() => {\n\t\tconst ids = [...this._descriptions(), ...this._errors()].filter(Boolean);\n\t\tconst uniqueIds = [...new Set(ids)];\n\t\treturn uniqueIds.length ? uniqueIds.join(' ') : null;\n\t});\n\n\tpublic registerDescription(id: string) {\n\t\tthis._descriptions.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic unregisterDescription(id: string) {\n\t\tthis._descriptions.update((ids) => ids.filter((value) => value !== id));\n\t}\n\n\tpublic registerError(id: string) {\n\t\tthis._errors.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic unregisterError(id: string) {\n\t\tthis._errors.update((ids) => ids.filter((value) => value !== id));\n\t}\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, input, signal } from '@angular/core';\nimport { BrnFieldA11yService } from './brn-field-aria.service';\nimport { BrnFieldControl } from './brn-field-control';\nimport { BrnLabelable } from './brn-labelable';\n\n@Directive({\n\tselector: '[brnField],brn-field',\n\tproviders: [BrnFieldA11yService],\n\thost: {\n\t\t'[attr.data-invalid]': '_invalid() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_touched() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty() ? \"true\" : null',\n\t},\n})\nexport class BrnField {\n\tprivate readonly _brnFieldControl = signal<BrnFieldControl | null>(null);\n\tprivate readonly _labelable = signal<BrnLabelable | null>(null);\n\n\t/** Whether the field is invalid. Overrides the `data-invalid` attribute. */\n\tpublic readonly dataInvalid = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t\talias: 'data-invalid',\n\t});\n\n\t/**\n\t * Whether to force the field into an invalid state, regardless of the form control's state.\n\t * Overrides both the `data-invalid` and `data-matches-spartan-invalid` attributes.\n\t */\n\tpublic readonly forceInvalid = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\tprotected readonly _invalid = computed(() => {\n\t\tif (this.forceInvalid() || this.dataInvalid()) return true;\n\n\t\tconst control = this._brnFieldControl();\n\t\tif (!control || !control.ngControl) return false;\n\n\t\treturn control.controlState()?.invalid;\n\t});\n\n\tprotected readonly _spartanInvalid = computed(() => {\n\t\treturn this.forceInvalid() || (this._brnFieldControl()?.controlState()?.spartanInvalid ?? null);\n\t});\n\n\tprotected readonly _dirty = computed(() => {\n\t\treturn this._brnFieldControl()?.controlState()?.dirty ?? null;\n\t});\n\n\tprotected readonly _touched = computed(() => {\n\t\treturn this._brnFieldControl()?.controlState()?.touched ?? null;\n\t});\n\n\tpublic readonly labelableId = computed(() => this._labelable()?.labelableId());\n\n\tpublic readonly brnFieldControl = this._brnFieldControl.asReadonly();\n\tpublic readonly errors = computed(() => this._brnFieldControl()?.errors() ?? null);\n\tpublic readonly controlState = computed(() => this._brnFieldControl()?.controlState() ?? null);\n\n\tpublic registerFieldControl(fieldControl: BrnFieldControl) {\n\t\tif (this._brnFieldControl()) return;\n\t\tthis._brnFieldControl.set(fieldControl);\n\t}\n\n\tpublic registerLabelable(labelable: BrnLabelable) {\n\t\tif (this._labelable()) return;\n\t\tthis._labelable.set(labelable);\n\t}\n\n\tpublic unregisterFieldControl(fieldControl: BrnFieldControl) {\n\t\tif (this._brnFieldControl() !== fieldControl) return;\n\t\tthis._brnFieldControl.set(null);\n\t}\n\n\tpublic unregisterLabelable(labelable: BrnLabelable) {\n\t\tif (this._labelable() !== labelable) return;\n\t\tthis._labelable.set(null);\n\t}\n}\n","import { type ExistingProvider, inject, InjectionToken, type Signal, type Type } from '@angular/core';\n\nexport interface BrnLabelable {\n\tlabelableId: Signal<string | null | undefined>;\n}\n\nexport const BrnLabelable = new InjectionToken<BrnLabelable>('BrnLabelable');\n\nexport function provideBrnLabelable(labelable: Type<BrnLabelable>): ExistingProvider {\n\treturn { provide: BrnLabelable, useExisting: labelable };\n}\n\nexport function injectBrnLabelable(): BrnLabelable | null {\n\treturn inject(BrnLabelable, { optional: true });\n}\n","import { computed, DestroyRef, Directive, DoCheck, inject, Injector, OnInit, signal } from '@angular/core';\nimport { type AbstractControl, FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport { createStateTracker, ErrorStateMatcher, type StateTracker } from '@spartan-ng/brain/forms';\nimport { BrnField } from './brn-field';\nimport { BrnLabelable } from './brn-labelable';\n\n@Directive()\nexport class BrnFieldControl implements OnInit, DoCheck {\n\tprivate readonly _injector = inject(Injector);\n\tprivate readonly _errorStateMatcher = inject(ErrorStateMatcher);\n\tprivate readonly _parentForm = inject(NgForm, { optional: true });\n\tprivate readonly _parentFormGroup = inject(FormGroupDirective, { optional: true });\n\tprivate readonly _field = inject(BrnField, { optional: true });\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\n\tprivate _labelable: BrnLabelable | null = null;\n\tprivate _parentFieldControl: BrnFieldControl | null = null;\n\n\tprivate readonly _stateTracker = signal<StateTracker | null>(null);\n\t/** Sentinel value to differentiate \"never checked\" from \"control is null\". */\n\tprivate _lastControl: AbstractControl | null = null;\n\n\t/** Gets the AbstractControlDirective for this control. */\n\tpublic ngControl: NgControl | null = null;\n\n\tpublic readonly controlState = computed(() => this._stateTracker()?.controlState() ?? null);\n\tpublic readonly errors = computed(() => this._stateTracker()?.errors() ?? null);\n\tpublic readonly dirty = computed(() => this._stateTracker()?.dirty() ?? null);\n\tpublic readonly invalid = computed(() => this._stateTracker()?.invalid() ?? null);\n\tpublic readonly spartanInvalid = computed(() => this._stateTracker()?.spartanInvalid() ?? null);\n\tpublic readonly touched = computed(() => this._stateTracker()?.touched() ?? null);\n\n\tconstructor() {\n\t\tthis._destroyRef.onDestroy(() => {\n\t\t\tthis._field?.unregisterFieldControl(this);\n\t\t\tif (this._labelable) {\n\t\t\t\tthis._field?.unregisterLabelable(this._labelable);\n\t\t\t}\n\t\t\tthis._stateTracker()?.destroy();\n\t\t});\n\t}\n\n\tngOnInit(): void {\n\t\tthis.ngControl = this._injector.get(NgControl, null);\n\t\tthis._parentFieldControl = this._injector.get(BrnFieldControl, null, { skipSelf: true });\n\n\t\tif (this.ngControl) {\n\t\t\tthis._field?.registerFieldControl(this);\n\t\t}\n\n\t\t// Try to sync the tracker eagerly.\n\t\tthis._syncTracker();\n\n\t\t// For template-driven forms and FormControlName, the control is often resolved\n\t\t// asynchronously by Angular's directives after our ngOnInit/ngDoCheck.\n\t\t// Schedule a one-time microtask to catch the initial resolution.\n\t\tif (this.ngControl) {\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tthis._syncTracker();\n\t\t\t});\n\t\t}\n\n\t\tthis._labelable = this._injector.get(BrnLabelable, null);\n\t\tif (this._labelable) {\n\t\t\tthis._field?.registerLabelable(this._labelable);\n\t\t}\n\t}\n\n\t// Re-evaluate the control reference on every change detection cycle because\n\t// the underlying AbstractControl may change when [formControl] rebinds to a new instance.\n\t// When the instance changes we tear down the old tracker and create a fresh one.\n\tngDoCheck(): void {\n\t\tthis._syncTracker();\n\t}\n\n\t/** @returns true if the control reference changed */\n\tprivate _syncTracker(): void {\n\t\tif (!this.ngControl || this._hasFieldControlParent()) return;\n\t\tconst currentControl = this.ngControl.control ?? null;\n\t\tif (currentControl === this._lastControl) return;\n\t\tthis._lastControl = currentControl;\n\t\tthis._stateTracker()?.destroy();\n\t\tthis._stateTracker.set(\n\t\t\tcurrentControl\n\t\t\t\t? createStateTracker(this.ngControl, this._errorStateMatcher, this._parentFormGroup, this._parentForm)\n\t\t\t\t: null,\n\t\t);\n\t}\n\n\tprivate _hasFieldControlParent() {\n\t\tif (this._field) {\n\t\t\treturn this._field.brnFieldControl() !== this;\n\t\t}\n\n\t\treturn !!this._parentFieldControl?.ngControl && this._parentFieldControl.ngControl === this.ngControl;\n\t}\n}\n","import { computed, Directive, inject, input } from '@angular/core';\nimport { BrnFieldA11yService } from './brn-field-aria.service';\n\n@Directive({\n\tselector: '[brnFieldControlDescribedBy]',\n\thost: {\n\t\t'[attr.aria-describedby]': '_computedDescribedBy()',\n\t},\n})\nexport class BrnFieldControlDescribedBy {\n\tpublic readonly describedBy = input<string | null>(null, { alias: 'aria-describedby' });\n\tprivate readonly _a11y = inject(BrnFieldA11yService, { optional: true });\n\n\tprotected readonly _computedDescribedBy = computed(() => {\n\t\tconst manual = this.describedBy();\n\t\tconst manualList = manual ? manual.split(/\\s+/).filter(Boolean) : [];\n\t\tconst fieldIds = this._a11y?.describedBy() ?? null;\n\t\tconst fieldList = fieldIds ? fieldIds.split(/\\s+/).filter(Boolean) : [];\n\n\t\tconst combined = [...new Set([...manualList, ...fieldList])];\n\t\treturn combined.length ? combined.join(' ') : null;\n\t});\n}\n","import { BrnField } from './lib/brn-field';\nimport { BrnFieldControl } from './lib/brn-field-control';\nimport { BrnFieldControlDescribedBy } from './lib/brn-field-control-described-by';\n\nexport * from './lib/brn-field';\nexport * from './lib/brn-field-aria.service';\nexport * from './lib/brn-field-control';\nexport * from './lib/brn-field-control-described-by';\nexport * from './lib/brn-labelable';\n\nexport const BrnFieldImports = [BrnField, BrnFieldControl, BrnFieldControlDescribedBy] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAGa,mBAAmB,CAAA;AACd,IAAA,aAAa,GAAG,MAAM,CAAW,EAAE,oFAAC;AACpC,IAAA,OAAO,GAAG,MAAM,CAAW,EAAE,8EAAC;AAE/B,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;QAC3C,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;QACxE,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;AACnC,QAAA,OAAO,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI;AACrD,IAAA,CAAC,kFAAC;AAEK,IAAA,mBAAmB,CAAC,EAAU,EAAA;AACpC,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5E;AAEO,IAAA,qBAAqB,CAAC,EAAU,EAAA;QACtC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,EAAE,CAAC,CAAC;IACxE;AAEO,IAAA,aAAa,CAAC,EAAU,EAAA;AAC9B,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,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AA,uBAAA,EAAA,wBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBANtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,IAAI,EAAE;AACL,wBAAA,yBAAyB,EAAE,wBAAwB;AACnD,qBAAA;AACD,iBAAA;;;ACEM,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAE,0BAA0B;;ACVrF;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -131,7 +131,7 @@ declare const BrnCalendarI18nToken: InjectionToken<BrnCalendarI18nService>;
|
|
|
131
131
|
/**
|
|
132
132
|
* Provide the calendar i18n configuration.
|
|
133
133
|
*/
|
|
134
|
-
declare function provideBrnCalendarI18n(configuration?: BrnCalendarI18n): Provider;
|
|
134
|
+
declare function provideBrnCalendarI18n(configuration?: Partial<BrnCalendarI18n>): Provider;
|
|
135
135
|
/**
|
|
136
136
|
* Inject the calendar i18n configuration.
|
|
137
137
|
*/
|
|
@@ -429,10 +429,11 @@ declare class BrnComboboxTrigger<T> {
|
|
|
429
429
|
protected readonly _dirty: _angular_core.Signal<boolean | undefined>;
|
|
430
430
|
protected readonly _touched: _angular_core.Signal<boolean | undefined>;
|
|
431
431
|
protected readonly _spartanInvalid: _angular_core.Signal<boolean | undefined>;
|
|
432
|
+
readonly forceInvalid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
432
433
|
/** Listen for keydown events */
|
|
433
434
|
protected onKeyDown(event: KeyboardEvent): void;
|
|
434
435
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnComboboxTrigger<any>, never>;
|
|
435
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxTrigger<any>, "button[brnComboboxTrigger]", never, {}, {}, never, never, true, never>;
|
|
436
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxTrigger<any>, "button[brnComboboxTrigger]", never, { "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
436
437
|
}
|
|
437
438
|
|
|
438
439
|
declare class BrnComboboxValue<T> {
|
|
@@ -12,13 +12,13 @@ declare class BrnFieldControl implements OnInit, DoCheck {
|
|
|
12
12
|
private readonly _parentFormGroup;
|
|
13
13
|
private readonly _field;
|
|
14
14
|
private readonly _destroyRef;
|
|
15
|
-
private
|
|
15
|
+
private _labelable;
|
|
16
|
+
private _parentFieldControl;
|
|
16
17
|
private readonly _stateTracker;
|
|
17
18
|
/** Sentinel value to differentiate "never checked" from "control is null". */
|
|
18
19
|
private _lastControl;
|
|
19
20
|
/** Gets the AbstractControlDirective for this control. */
|
|
20
21
|
ngControl: NgControl | null;
|
|
21
|
-
readonly id: _angular_core.WritableSignal<string | null | undefined>;
|
|
22
22
|
readonly controlState: _angular_core.Signal<_spartan_ng_brain_forms.ControlState | null>;
|
|
23
23
|
readonly errors: _angular_core.Signal<_angular_forms.ValidationErrors | null>;
|
|
24
24
|
readonly dirty: _angular_core.Signal<boolean | null>;
|
|
@@ -30,6 +30,7 @@ declare class BrnFieldControl implements OnInit, DoCheck {
|
|
|
30
30
|
ngDoCheck(): void;
|
|
31
31
|
/** @returns true if the control reference changed */
|
|
32
32
|
private _syncTracker;
|
|
33
|
+
private _hasFieldControlParent;
|
|
33
34
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnFieldControl, never>;
|
|
34
35
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnFieldControl, never, never, {}, {}, never, never, true, never>;
|
|
35
36
|
}
|
|
@@ -56,10 +57,13 @@ declare class BrnField {
|
|
|
56
57
|
protected readonly _dirty: _angular_core.Signal<boolean | null>;
|
|
57
58
|
protected readonly _touched: _angular_core.Signal<boolean | null>;
|
|
58
59
|
readonly labelableId: _angular_core.Signal<string | null | undefined>;
|
|
60
|
+
readonly brnFieldControl: _angular_core.Signal<BrnFieldControl | null>;
|
|
59
61
|
readonly errors: _angular_core.Signal<_angular_forms.ValidationErrors | null>;
|
|
60
62
|
readonly controlState: _angular_core.Signal<_spartan_ng_brain_forms.ControlState | null>;
|
|
61
63
|
registerFieldControl(fieldControl: BrnFieldControl): void;
|
|
62
64
|
registerLabelable(labelable: BrnLabelable): void;
|
|
65
|
+
unregisterFieldControl(fieldControl: BrnFieldControl): void;
|
|
66
|
+
unregisterLabelable(labelable: BrnLabelable): void;
|
|
63
67
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnField, never>;
|
|
64
68
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnField, "[brnField],brn-field", never, { "dataInvalid": { "alias": "data-invalid"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
65
69
|
}
|