Browse Source
Merge pull request #13013 from abpframework/issues/13012
Add DisabledFn on ExtensibleFormPropComponent
pull/13080/head
Muhammed Altuğ
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
2 deletions
-
npm/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-form/extensible-form-prop.component.ts
|
|
|
@ -62,7 +62,11 @@ export class ExtensibleFormPropComponent implements OnChanges, AfterViewInit { |
|
|
|
|
|
|
|
readonly!: boolean; |
|
|
|
|
|
|
|
disabled!: boolean; |
|
|
|
disabledFn = (data:PropData) => false; |
|
|
|
|
|
|
|
get disabled() { |
|
|
|
return this.disabledFn(this.data) |
|
|
|
} |
|
|
|
|
|
|
|
private readonly form: FormGroup; |
|
|
|
|
|
|
|
@ -175,7 +179,10 @@ export class ExtensibleFormPropComponent implements OnChanges, AfterViewInit { |
|
|
|
|
|
|
|
if (options) this.options$ = options(this.data); |
|
|
|
if (readonly) this.readonly = readonly(this.data); |
|
|
|
if (disabled) this.disabled = disabled(this.data); |
|
|
|
|
|
|
|
if (disabled) { |
|
|
|
this.disabledFn = disabled; |
|
|
|
} |
|
|
|
if (validators) { |
|
|
|
this.validators = validators(this.data); |
|
|
|
this.setAsterisk(); |
|
|
|
|