|
1064 | 1064 | -record(alert, {?ACTION_BASE(action_alert), |
1065 | 1065 | text="" :: text() |
1066 | 1066 | }). |
1067 | | --record(confirm, {?ACTION_BASE(action_confirm), |
1068 | | - text="" :: text(), |
1069 | | - postback :: term(), |
1070 | | - vessel :: id() | text(), |
1071 | | - delegate :: module() |
1072 | | - }). |
1073 | 1067 | -record(modal, {?ACTION_BASE(action_modal), |
1074 | 1068 | id :: undefined | id(), |
1075 | 1069 | text="" :: text() | undefined, |
|
1079 | 1073 | buttons=[] :: body() | undefined | |
1080 | 1074 | [#button{} | |
1081 | 1075 | {text(), Postback :: any()} | |
1082 | | - {text(), Delegate :: module(), Postback :: any()}], |
| 1076 | + {text(), Postback :: any(), Delegate :: module()}], |
1083 | 1077 |
|
1084 | 1078 | close_text :: text() | undefined, |
1085 | 1079 | close_body :: body() | undefined, |
1086 | 1080 | show_close_button=true :: boolean(), |
1087 | 1081 | options=[] :: term() |
1088 | 1082 | }). |
| 1083 | +%% create #confirm{} from #modal{} |
| 1084 | +?WF_EXTEND(modal, confirm, action_confirm, [ |
| 1085 | + {postback, undefined, "term()"}, |
| 1086 | + {vessel, undefined, "id() | text()"}, |
| 1087 | + {delegate, undefined, "module()"}, |
| 1088 | + {basic, false, "boolean()"} |
| 1089 | +]). |
| 1090 | + |
| 1091 | +%% Create #prompt{} from #modal{} |
| 1092 | +?WF_EXTEND(modal, prompt, action_prompt, [ |
| 1093 | + %% `tag` used instead of `postback` because `postback` implies a call to |
| 1094 | + %% event/1, while `tag` implies a call to a different function |
| 1095 | + {tag, undefined, "term()"}, |
| 1096 | + {vessel, undefined, "id() | text()"}, |
| 1097 | + {delegate, undefined, "module()"}, |
| 1098 | + {basic, false, "boolean()"}, |
| 1099 | + {fields, [], "list()"}, |
| 1100 | + {default, "", "text()"} |
| 1101 | +]). |
1089 | 1102 | -record(close_modal, {?ACTION_BASE(action_modal), |
1090 | 1103 | id :: undefined | id(), |
1091 | 1104 | options=[] :: term() |
|
0 commit comments