Documentation ¶
Overview ¶
Package card provides declarative card builder
Index ¶
- type ActionBlock
- type Block
- func (b *Block) Blue() *Block
- func (b *Block) Carmine() *Block
- func (b *Block) Green() *Block
- func (b *Block) Grey() *Block
- func (b *Block) Indigo() *Block
- func (b *Block) Link(href *URLBlock) *Block
- func (b *Block) MarshalJSON() ([]byte, error)
- func (b *Block) NoForward() *Block
- func (b *Block) Orange() *Block
- func (b *Block) Purple() *Block
- func (b *Block) Red() *Block
- func (b *Block) Render() Renderer
- func (b *Block) String() string
- func (b *Block) Title(title string) *Block
- func (b *Block) Turquoise() *Block
- func (b *Block) UpdateMulti(updateMulti bool) *Block
- func (b *Block) Violet() *Block
- func (b *Block) Wathet() *Block
- func (b *Block) Yellow() *Block
- type ButtonBlock
- func (b *ButtonBlock) Confirm(title, text string) *ButtonBlock
- func (b *ButtonBlock) Danger() *ButtonBlock
- func (b *ButtonBlock) Default() *ButtonBlock
- func (b *ButtonBlock) MultiURL(u *URLBlock) *ButtonBlock
- func (b *ButtonBlock) Primary() *ButtonBlock
- func (b *ButtonBlock) Render() Renderer
- func (b *ButtonBlock) URL(u string) *ButtonBlock
- func (b *ButtonBlock) Value(v map[string]interface{}) *ButtonBlock
- type ColumnBlock
- type ColumnSetActionBlock
- type ColumnSetBlock
- func (c *ColumnSetBlock) Action(action *ColumnSetActionBlock) *ColumnSetBlock
- func (c *ColumnSetBlock) BackgroundStyle(style string) *ColumnSetBlock
- func (c *ColumnSetBlock) FlexMode(mode string) *ColumnSetBlock
- func (c *ColumnSetBlock) HorizontalSpacing(hs string) *ColumnSetBlock
- func (c *ColumnSetBlock) Render() Renderer
- type ConfirmBlock
- type DatePickerBlock
- type DatetimePickerBlock
- type DivBlock
- type Element
- type ElementTag
- type FieldBlock
- type HrBlock
- type ImgBlock
- func (i *ImgBlock) Alt(s string) *ImgBlock
- func (i *ImgBlock) Compact() *ImgBlock
- func (i *ImgBlock) CropCenter() *ImgBlock
- func (i *ImgBlock) FitHorizontal() *ImgBlock
- func (i *ImgBlock) NoPreview() *ImgBlock
- func (i *ImgBlock) Render() Renderer
- func (i *ImgBlock) Title(t *TextBlock) *ImgBlock
- func (i *ImgBlock) TitleString(t string) *ImgBlock
- func (i *ImgBlock) Width(w int) *ImgBlock
- type MarkdownBlock
- type NoteBlock
- type OptionBlock
- type OverflowBlock
- type PickerBlock
- type Renderer
- type SelectMenuBlock
- func (s *SelectMenuBlock) Confirm(title, text string) *SelectMenuBlock
- func (s *SelectMenuBlock) InitialOption(o string) *SelectMenuBlock
- func (s *SelectMenuBlock) Placeholder(p string) *SelectMenuBlock
- func (s *SelectMenuBlock) Render() Renderer
- func (s *SelectMenuBlock) SelectPerson() *SelectMenuBlock
- func (s *SelectMenuBlock) Value(v map[string]interface{}) *SelectMenuBlock
- type TextBlock
- type TimePickerBlock
- type URLBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionBlock ¶
type ActionBlock struct {
// contains filtered or unexported fields
}
ActionBlock 交互元素
func Action ¶
func Action(actions ...Element) *ActionBlock
Action 交互元素,可添加 Button, SelectMenu, Overflow, DatePicker, TimePicker, DatetimePicker
func (*ActionBlock) BisectedLayout ¶
func (a *ActionBlock) BisectedLayout() *ActionBlock
BisectedLayout 二等分布局排列
func (*ActionBlock) TrisectionLayout ¶
func (a *ActionBlock) TrisectionLayout() *ActionBlock
TrisectionLayout 三等分布局排列
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block 卡片元素
func (*Block) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Block) UpdateMulti ¶
UpdateMulti set card can be updated
type ButtonBlock ¶
type ButtonBlock struct {
// contains filtered or unexported fields
}
ButtonBlock 按钮元素
func (*ButtonBlock) Confirm ¶
func (b *ButtonBlock) Confirm(title, text string) *ButtonBlock
Confirm 点击后二次确认的弹框
func (*ButtonBlock) MultiURL ¶
func (b *ButtonBlock) MultiURL(u *URLBlock) *ButtonBlock
MultiURL 按钮的多端差异跳转链接
func (*ButtonBlock) Value ¶
func (b *ButtonBlock) Value(v map[string]interface{}) *ButtonBlock
Value 点击后发送给业务方的数据
type ColumnBlock ¶
type ColumnBlock struct {
// contains filtered or unexported fields
}
ColumnBlock column element
func (*ColumnBlock) VerticalAlign ¶
func (c *ColumnBlock) VerticalAlign(align string) *ColumnBlock
VerticalAlign .
type ColumnSetActionBlock ¶
type ColumnSetActionBlock struct {
// contains filtered or unexported fields
}
ColumnSetActionBlock column action element
type ColumnSetBlock ¶
type ColumnSetBlock struct {
// contains filtered or unexported fields
}
ColumnSetBlock column set element
func (*ColumnSetBlock) Action ¶
func (c *ColumnSetBlock) Action(action *ColumnSetActionBlock) *ColumnSetBlock
Action add column set action
func (*ColumnSetBlock) BackgroundStyle ¶
func (c *ColumnSetBlock) BackgroundStyle(style string) *ColumnSetBlock
BackgroundStyle set background style
func (*ColumnSetBlock) FlexMode ¶
func (c *ColumnSetBlock) FlexMode(mode string) *ColumnSetBlock
FlexMode set flex mode
func (*ColumnSetBlock) HorizontalSpacing ¶
func (c *ColumnSetBlock) HorizontalSpacing(hs string) *ColumnSetBlock
HorizontalSpacing set horizontal spacing
type ConfirmBlock ¶
type ConfirmBlock struct {
// contains filtered or unexported fields
}
ConfirmBlock 确认模块
type DatePickerBlock ¶
type DatePickerBlock struct {
*PickerBlock
}
DatePickerBlock 日期选择器元素
func (*DatePickerBlock) InitialDate ¶
func (d *DatePickerBlock) InitialDate(t time.Time) *DatePickerBlock
InitialDate 设置选择器的默认日期
func (*DatePickerBlock) InitialDateString ¶
func (d *DatePickerBlock) InitialDateString(date string) *DatePickerBlock
InitialDateString 设置选择器的默认日期
type DatetimePickerBlock ¶
type DatetimePickerBlock struct {
*PickerBlock
}
DatetimePickerBlock 日期时间选择器元素
func (*DatetimePickerBlock) InitialDatetime ¶
func (d *DatetimePickerBlock) InitialDatetime(t time.Time) *DatetimePickerBlock
InitialDatetime 设置选择器的默认日期时间
func (*DatetimePickerBlock) InitialDatetimeString ¶
func (d *DatetimePickerBlock) InitialDatetimeString(date string) *DatetimePickerBlock
InitialDatetimeString 设置选择器的默认日期时间
type DivBlock ¶
type DivBlock struct {
// contains filtered or unexported fields
}
DivBlock 内容元素
type FieldBlock ¶
type FieldBlock struct {
// contains filtered or unexported fields
}
FieldBlock 排版模块元素
type ImgBlock ¶
type ImgBlock struct {
// contains filtered or unexported fields
}
ImgBlock 图片元素
type MarkdownBlock ¶
type MarkdownBlock struct {
// contains filtered or unexported fields
}
MarkdownBlock Markdown文本元素
func (*MarkdownBlock) AlignCenter ¶
func (m *MarkdownBlock) AlignCenter() *MarkdownBlock
AlignCenter .
func (*MarkdownBlock) Href ¶
func (m *MarkdownBlock) Href(name string, url *URLBlock) *MarkdownBlock
Href 设置文本中 []($urlVal) 格式的链接值,仅在 LarkMd 和 Markdown 模块中可用
type OptionBlock ¶
type OptionBlock struct {
// contains filtered or unexported fields
}
OptionBlock 选项元素
func (*OptionBlock) MultiURL ¶
func (o *OptionBlock) MultiURL(u *URLBlock) *OptionBlock
MultiURL 选项多端跳转链接
type OverflowBlock ¶
type OverflowBlock struct {
// contains filtered or unexported fields
}
OverflowBlock 折叠菜单元素
func (*OverflowBlock) Confirm ¶
func (o *OverflowBlock) Confirm(title, text string) *OverflowBlock
Confirm 选定后二次确认的弹框
func (*OverflowBlock) Value ¶
func (o *OverflowBlock) Value(v map[string]interface{}) *OverflowBlock
Value 选定后发送给业务方的数据
type PickerBlock ¶
type PickerBlock struct {
// contains filtered or unexported fields
}
PickerBlock 选择器基础元素
func (*PickerBlock) Confirm ¶
func (p *PickerBlock) Confirm(title, text string) *PickerBlock
Confirm 选中后二次确认的弹框
func (*PickerBlock) Placeholder ¶
func (p *PickerBlock) Placeholder(s string) *PickerBlock
Placeholder 未选中值时展示的内容,无默认值时必填
func (*PickerBlock) Value ¶
func (p *PickerBlock) Value(m map[string]interface{}) *PickerBlock
Value 选定后发送给业务方的数据
type SelectMenuBlock ¶
type SelectMenuBlock struct {
// contains filtered or unexported fields
}
SelectMenuBlock 菜单元素
func (*SelectMenuBlock) Confirm ¶
func (s *SelectMenuBlock) Confirm(title, text string) *SelectMenuBlock
Confirm 选中后二次确认的弹框
func (*SelectMenuBlock) InitialOption ¶
func (s *SelectMenuBlock) InitialOption(o string) *SelectMenuBlock
InitialOption 默认选项的 value 字段值
func (*SelectMenuBlock) Placeholder ¶
func (s *SelectMenuBlock) Placeholder(p string) *SelectMenuBlock
Placeholder 未选中时展示的内容,无默认选项时必须设置
func (*SelectMenuBlock) SelectPerson ¶
func (s *SelectMenuBlock) SelectPerson() *SelectMenuBlock
SelectPerson 选人模式,value应设置为人员的open_id,options 为空则候选人员为当前群组
func (*SelectMenuBlock) Value ¶
func (s *SelectMenuBlock) Value(v map[string]interface{}) *SelectMenuBlock
Value 选中后发送给业务方的数据
type TextBlock ¶
type TextBlock struct {
// contains filtered or unexported fields
}
TextBlock 文本元素
type TimePickerBlock ¶
type TimePickerBlock struct {
*PickerBlock
}
TimePickerBlock 时间选择器元素
func (*TimePickerBlock) InitialTime ¶
func (d *TimePickerBlock) InitialTime(t time.Time) *TimePickerBlock
InitialTime 设置选择器的默认时间
func (*TimePickerBlock) InitialTimeString ¶
func (d *TimePickerBlock) InitialTimeString(date string) *TimePickerBlock
InitialTimeString 设置选择器的默认时间