diff options
author | Wim <wim@42.be> | 2019-09-07 22:46:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-07 22:46:58 +0200 |
commit | a3bee01e0af3394c19360b98fd2db1b647f49299 (patch) | |
tree | ffc5778361d55d592a718354a37c9251e75fc7f6 /vendor/github.com/nlopes/slack/dialog_text.go | |
parent | 1dc93ec4f001edd01daccbe408767d4878be25a3 (diff) | |
download | matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.tar.gz matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.tar.bz2 matterbridge-msglm-a3bee01e0af3394c19360b98fd2db1b647f49299.zip |
Update dependencies (#886)
Diffstat (limited to 'vendor/github.com/nlopes/slack/dialog_text.go')
-rw-r--r-- | vendor/github.com/nlopes/slack/dialog_text.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vendor/github.com/nlopes/slack/dialog_text.go b/vendor/github.com/nlopes/slack/dialog_text.go index bf9602cc..da06bd6d 100644 --- a/vendor/github.com/nlopes/slack/dialog_text.go +++ b/vendor/github.com/nlopes/slack/dialog_text.go @@ -3,6 +3,9 @@ package slack // TextInputSubtype Accepts email, number, tel, or url. In some form factors, optimized input is provided for this subtype. type TextInputSubtype string +// TextInputOption handle to extra inputs options. +type TextInputOption func(*TextInputElement) + const ( // InputSubtypeEmail email keyboard InputSubtypeEmail TextInputSubtype = "email" @@ -26,8 +29,8 @@ type TextInputElement struct { } // NewTextInput constructor for a `text` input -func NewTextInput(name, label, text string) *TextInputElement { - return &TextInputElement{ +func NewTextInput(name, label, text string, options ...TextInputOption) *TextInputElement { + t := &TextInputElement{ DialogInput: DialogInput{ Type: InputTypeText, Name: name, @@ -35,6 +38,12 @@ func NewTextInput(name, label, text string) *TextInputElement { }, Value: text, } + + for _, opt := range options { + opt(t) + } + + return t } // NewTextAreaInput constructor for a `textarea` input |