Update dependencies (#1951)

This commit is contained in:
Wim
2023-01-28 22:57:53 +01:00
committed by GitHub
parent eac2a8c8dc
commit 880586bac4
325 changed files with 151452 additions and 141118 deletions

View File

@@ -11,6 +11,9 @@ const (
METTimepicker MessageElementType = "timepicker"
METPlainTextInput MessageElementType = "plain_text_input"
METRadioButtons MessageElementType = "radio_buttons"
METEmailTextInput MessageElementType = "email_text_input"
METURLTextInput MessageElementType = "url_text_input"
METNumber MessageElementType = "number_input"
MixedElementImage MixedElementType = "mixed_image"
MixedElementText MixedElementType = "mixed_text"
@@ -389,6 +392,64 @@ func NewTimePickerBlockElement(actionID string) *TimePickerBlockElement {
}
}
// EmailTextInputBlockElement creates a field where a user can enter email
// data.
// email-text-input elements are currently only available in modals.
//
// More Information: https://api.slack.com/reference/block-kit/block-elements#email
type EmailTextInputBlockElement struct {
Type MessageElementType `json:"type"`
ActionID string `json:"action_id,omitempty"`
Placeholder *TextBlockObject `json:"placeholder,omitempty"`
InitialValue string `json:"initial_value,omitempty"`
DispatchActionConfig *DispatchActionConfig `json:"dispatch_action_config,omitempty"`
FocusOnLoad bool `json:"focus_on_load,omitempty"`
}
// ElementType returns the type of the Element
func (s EmailTextInputBlockElement) ElementType() MessageElementType {
return s.Type
}
// NewEmailTextInputBlockElement returns an instance of a plain-text input
// element
func NewEmailTextInputBlockElement(placeholder *TextBlockObject, actionID string) *EmailTextInputBlockElement {
return &EmailTextInputBlockElement{
Type: METEmailTextInput,
ActionID: actionID,
Placeholder: placeholder,
}
}
// URLTextInputBlockElement creates a field where a user can enter url data.
//
// url-text-input elements are currently only available in modals.
//
// More Information: https://api.slack.com/reference/block-kit/block-elements#url
type URLTextInputBlockElement struct {
Type MessageElementType `json:"type"`
ActionID string `json:"action_id,omitempty"`
Placeholder *TextBlockObject `json:"placeholder,omitempty"`
InitialValue string `json:"initial_value,omitempty"`
DispatchActionConfig *DispatchActionConfig `json:"dispatch_action_config,omitempty"`
FocusOnLoad bool `json:"focus_on_load,omitempty"`
}
// ElementType returns the type of the Element
func (s URLTextInputBlockElement) ElementType() MessageElementType {
return s.Type
}
// NewURLTextInputBlockElement returns an instance of a plain-text input
// element
func NewURLTextInputBlockElement(placeholder *TextBlockObject, actionID string) *URLTextInputBlockElement {
return &URLTextInputBlockElement{
Type: METURLTextInput,
ActionID: actionID,
Placeholder: placeholder,
}
}
// PlainTextInputBlockElement creates a field where a user can enter freeform
// data.
// Plain-text input elements are currently only available in modals.
@@ -475,3 +536,34 @@ func NewRadioButtonsBlockElement(actionID string, options ...*OptionBlockObject)
Options: options,
}
}
// NumberInputBlockElement creates a field where a user can enter number
// data.
// Number input elements are currently only available in modals.
//
// More Information: https://api.slack.com/reference/block-kit/block-elements#number
type NumberInputBlockElement struct {
Type MessageElementType `json:"type"`
IsDecimalAllowed bool `json:"is_decimal_allowed"`
ActionID string `json:"action_id,omitempty"`
Placeholder *TextBlockObject `json:"placeholder,omitempty"`
InitialValue string `json:"initial_value,omitempty"`
MinValue string `json:"min_value,omitempty"`
MaxValue string `json:"max_value,omitempty"`
DispatchActionConfig *DispatchActionConfig `json:"dispatch_action_config,omitempty"`
}
// ElementType returns the type of the Element
func (s NumberInputBlockElement) ElementType() MessageElementType {
return s.Type
}
// NewNumberInputBlockElement returns an instance of a number input element
func NewNumberInputBlockElement(placeholder *TextBlockObject, actionID string, isDecimalAllowed bool) *NumberInputBlockElement {
return &NumberInputBlockElement{
Type: METNumber,
ActionID: actionID,
Placeholder: placeholder,
IsDecimalAllowed: isDecimalAllowed,
}
}