mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
947 B
30 lines
947 B
class _ErrorStateTracker {
|
|
_defaultMatcher;
|
|
ngControl;
|
|
_parentFormGroup;
|
|
_parentForm;
|
|
_stateChanges;
|
|
errorState = false;
|
|
matcher;
|
|
constructor(_defaultMatcher, ngControl, _parentFormGroup, _parentForm, _stateChanges) {
|
|
this._defaultMatcher = _defaultMatcher;
|
|
this.ngControl = ngControl;
|
|
this._parentFormGroup = _parentFormGroup;
|
|
this._parentForm = _parentForm;
|
|
this._stateChanges = _stateChanges;
|
|
}
|
|
updateErrorState() {
|
|
const oldState = this.errorState;
|
|
const parent = this._parentFormGroup || this._parentForm;
|
|
const matcher = this.matcher || this._defaultMatcher;
|
|
const control = this.ngControl ? this.ngControl.control : null;
|
|
const newState = matcher?.isErrorState(control, parent) ?? false;
|
|
if (newState !== oldState) {
|
|
this.errorState = newState;
|
|
this._stateChanges.next();
|
|
}
|
|
}
|
|
}
|
|
|
|
export { _ErrorStateTracker };
|
|
//# sourceMappingURL=_error-state-chunk.mjs.map
|
|
|