summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/nlopes/slack/dialog_text.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/nlopes/slack/dialog_text.go')
-rw-r--r--vendor/github.com/nlopes/slack/dialog_text.go13
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