Skip to content

Commit

Permalink
Added type altarnative to IAction properties
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 committed Jan 9, 2024
1 parent 9e712b4 commit 6aeb790
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/actions/action.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ILocalizableOwner, LocalizableString } from "../localizablestring";
import { Base } from "../base";
import { Base, ComputedUpdater } from "../base";
import { surveyLocalization } from "../surveyStrings";
import { property } from "../jsonobject";
import { IListModel, ListModel } from "../list";
Expand Down Expand Up @@ -28,7 +28,7 @@ export interface IAction {
* @see enabled
* @see active
*/
visible?: boolean;
visible?: boolean | ComputedUpdater<boolean>;
/**
* The action item's title.
*
Expand All @@ -49,7 +49,7 @@ export interface IAction {
* @see active
* @see visible
*/
enabled?: boolean;
enabled?: boolean | ComputedUpdater<boolean>;
enabledIf?: () => boolean;
/**
* Specifies the visibility of the action item's title.
Expand Down Expand Up @@ -448,7 +448,7 @@ export class Action extends BaseAction implements IAction, ILocalizableOwner {
this._enabled = val;
}
public getEnabled(): boolean {
if(this.enabledIf) return this.enabledIf();
if (this.enabledIf) return this.enabledIf();
return this._enabled;
}
public setComponent(val: string): void {
Expand Down

0 comments on commit 6aeb790

Please sign in to comment.