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 ButtonInFormBlock
- func (b *ButtonInFormBlock) Confirm(title, text string) *ButtonInFormBlock
- func (b *ButtonInFormBlock) Danger() *ButtonInFormBlock
- func (b *ButtonInFormBlock) Default() *ButtonInFormBlock
- func (b *ButtonInFormBlock) FormReset() *ButtonInFormBlock
- func (b *ButtonInFormBlock) FormSubmit() *ButtonInFormBlock
- func (b *ButtonInFormBlock) Link() *ButtonInFormBlock
- func (b *ButtonInFormBlock) Multi() *ButtonInFormBlock
- func (b *ButtonInFormBlock) MultiURL(u *URLBlock) *ButtonInFormBlock
- func (b *ButtonInFormBlock) Primary() *ButtonInFormBlock
- func (b *ButtonInFormBlock) Render() Renderer
- func (b *ButtonInFormBlock) Request() *ButtonInFormBlock
- func (b *ButtonInFormBlock) URL(u string) *ButtonInFormBlock
- func (b *ButtonInFormBlock) Value(v map[string]interface{}) *ButtonInFormBlock
- 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 FormBlock
- type HrBlock
- type IconBlock
- 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
- func (m *MarkdownBlock) AlignCenter() *MarkdownBlock
- func (m *MarkdownBlock) AlignLeft() *MarkdownBlock
- func (m *MarkdownBlock) AlignRight() *MarkdownBlock
- func (m *MarkdownBlock) Href(name string, url *URLBlock) *MarkdownBlock
- func (m *MarkdownBlock) Render() Renderer
- func (m *MarkdownBlock) SetTextSizeHeading() *MarkdownBlock
- func (m *MarkdownBlock) SetTextSizeNormal() *MarkdownBlock
- func (m *MarkdownBlock) SetTextSizeNotation() *MarkdownBlock
- type NoteBlock
- type OptionBlock
- type OverflowBlock
- type PickerBlock
- type Renderer
- type SelectBlock
- func (s *SelectBlock) Render() Renderer
- func (s *SelectBlock) SetDisabled() *SelectBlock
- func (s *SelectBlock) SetName(name string) *SelectBlock
- func (s *SelectBlock) SetOptions(ops []*SelectOptionBlock) *SelectBlock
- func (s *SelectBlock) SetPlaceholder(text string) *SelectBlock
- func (s *SelectBlock) SetSelectedValues(vals []string) *SelectBlock
- func (s *SelectBlock) SetTypeText() *SelectBlock
- func (s *SelectBlock) SetWidthFill() *SelectBlock
- 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 SelectOptionBlock
- 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 ButtonInFormBlock ¶
type ButtonInFormBlock struct {
// contains filtered or unexported fields
}
ButtonInFormBlock 表单中按钮元素
func ButtonInForm ¶
func ButtonInForm(text *TextBlock, name string) *ButtonInFormBlock
ButtonInForm 按钮交互元素
func (*ButtonInFormBlock) Confirm ¶
func (b *ButtonInFormBlock) Confirm(title, text string) *ButtonInFormBlock
Confirm 点击后二次确认的弹框
func (*ButtonInFormBlock) Danger ¶
func (b *ButtonInFormBlock) Danger() *ButtonInFormBlock
Danger 设置按钮样式(警示按钮)
func (*ButtonInFormBlock) Default ¶
func (b *ButtonInFormBlock) Default() *ButtonInFormBlock
Default 设置按钮样式(次要按钮)
func (*ButtonInFormBlock) FormReset ¶
func (b *ButtonInFormBlock) FormReset() *ButtonInFormBlock
FormReset 触发表单容器的取消提交事件,重置所有表单组件的输入值为初始值
func (*ButtonInFormBlock) FormSubmit ¶
func (b *ButtonInFormBlock) FormSubmit() *ButtonInFormBlock
FormSubmit 触发表单容器的提交事件,异步提交表单容器中所有用户填写的表单内容
func (*ButtonInFormBlock) Multi ¶
func (b *ButtonInFormBlock) Multi() *ButtonInFormBlock
Multi 链接跳转+回传交互同时生效
func (*ButtonInFormBlock) MultiURL ¶
func (b *ButtonInFormBlock) MultiURL(u *URLBlock) *ButtonInFormBlock
MultiURL 按钮的多端差异跳转链接
func (*ButtonInFormBlock) Primary ¶
func (b *ButtonInFormBlock) Primary() *ButtonInFormBlock
Primary 设置按钮样式(主要按钮)
func (*ButtonInFormBlock) Render ¶
func (b *ButtonInFormBlock) Render() Renderer
Render 渲染为 Renderer
func (*ButtonInFormBlock) Request ¶
func (b *ButtonInFormBlock) Request() *ButtonInFormBlock
Request 仅回传交互
func (*ButtonInFormBlock) URL ¶
func (b *ButtonInFormBlock) URL(u string) *ButtonInFormBlock
URL 按钮的跳转链接
func (*ButtonInFormBlock) Value ¶
func (b *ButtonInFormBlock) Value(v map[string]interface{}) *ButtonInFormBlock
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 FormBlock ¶
type FormBlock struct {
// contains filtered or unexported fields
}
FormBlock 表单容器
func (*FormBlock) AddElements ¶
AddElements 添加元素
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 模块中可用
func (*MarkdownBlock) SetTextSizeHeading ¶
func (m *MarkdownBlock) SetTextSizeHeading() *MarkdownBlock
func (*MarkdownBlock) SetTextSizeNormal ¶
func (m *MarkdownBlock) SetTextSizeNormal() *MarkdownBlock
func (*MarkdownBlock) SetTextSizeNotation ¶
func (m *MarkdownBlock) SetTextSizeNotation() *MarkdownBlock
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 SelectBlock ¶
type SelectBlock struct {
// contains filtered or unexported fields
}
func MultiSelectStatic ¶
func MultiSelectStatic(name string) *SelectBlock
func (*SelectBlock) SetDisabled ¶
func (s *SelectBlock) SetDisabled() *SelectBlock
func (*SelectBlock) SetName ¶
func (s *SelectBlock) SetName(name string) *SelectBlock
func (*SelectBlock) SetOptions ¶
func (s *SelectBlock) SetOptions(ops []*SelectOptionBlock) *SelectBlock
func (*SelectBlock) SetPlaceholder ¶
func (s *SelectBlock) SetPlaceholder(text string) *SelectBlock
func (*SelectBlock) SetSelectedValues ¶
func (s *SelectBlock) SetSelectedValues(vals []string) *SelectBlock
func (*SelectBlock) SetTypeText ¶
func (s *SelectBlock) SetTypeText() *SelectBlock
func (*SelectBlock) SetWidthFill ¶
func (s *SelectBlock) SetWidthFill() *SelectBlock
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 SelectOptionBlock ¶
type SelectOptionBlock struct {
// contains filtered or unexported fields
}
func SelectOption ¶
func SelectOption(block *TextBlock, val string) *SelectOptionBlock
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 设置选择器的默认时间