From 937e2033addf3e856e2eb17fe1c87bff615424c3 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Dec 2022 09:58:53 +0800 Subject: [PATCH] [change] componet action --- widgets/component/types.go | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/widgets/component/types.go b/widgets/component/types.go index 36f7265f..88d062bd 100644 --- a/widgets/component/types.go +++ b/widgets/component/types.go @@ -33,17 +33,25 @@ type aliasActionDSL ActionDSL // ActionDSL the component action DSL type ActionDSL struct { - ID string `json:"id,omitempty"` - Title string `json:"title,omitempty"` - Width int `json:"width,omitempty"` - Icon string `json:"icon,omitempty"` - Style string `json:"style,omitempty"` - Xpath string `json:"xpath,omitempty"` - DivideLine bool `json:"divideLine,omitempty"` - ShowWhenAddAndView bool `json:"showWhenAddAndView,omitempty"` - Props PropsDSL `json:"props,omitempty"` - Confirm *ConfirmActionDSL `json:"confirm,omitempty"` - Action ActionNodes `json:"action,omitempty"` + ID string `json:"id,omitempty"` + Title string `json:"title,omitempty"` + Width int `json:"width,omitempty"` + Icon string `json:"icon,omitempty"` + Style string `json:"style,omitempty"` + Xpath string `json:"xpath,omitempty"` + DivideLine bool `json:"divideLine,omitempty"` + ShowWhenAdd bool `json:"showWhenAdd,omitempty"` + ShowWhenView bool `json:"showWhenView,omitempty"` + Props PropsDSL `json:"props,omitempty"` + Confirm *ConfirmActionDSL `json:"confirm,omitempty"` + Action ActionNodes `json:"action,omitempty"` + Disabled *DisabledDSL `json:"disabled,omitempty"` +} + +// DisabledDSL the action disabled +type DisabledDSL struct { + Bind string `json:"bind,omitempty"` + Value interface{} `json:"value,omitempty"` // string | array } type aliasActionNodes []ActionNode