-
Notifications
You must be signed in to change notification settings - Fork 5
/
item-group.go
107 lines (85 loc) · 2.47 KB
/
item-group.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package vuetify
import (
"context"
"fmt"
h "github.com/theplant/htmlgo"
)
type VItemGroupBuilder struct {
tag *h.HTMLTagBuilder
}
func VItemGroup(children ...h.HTMLComponent) (r *VItemGroupBuilder) {
r = &VItemGroupBuilder{
tag: h.Tag("v-item-group").Children(children...),
}
return
}
func (b *VItemGroupBuilder) ModelValue(v interface{}) (r *VItemGroupBuilder) {
b.tag.Attr(":model-value", h.JSONString(v))
return b
}
func (b *VItemGroupBuilder) Multiple(v bool) (r *VItemGroupBuilder) {
b.tag.Attr(":multiple", fmt.Sprint(v))
return b
}
func (b *VItemGroupBuilder) Max(v int) (r *VItemGroupBuilder) {
b.tag.Attr(":max", fmt.Sprint(v))
return b
}
func (b *VItemGroupBuilder) SelectedClass(v string) (r *VItemGroupBuilder) {
b.tag.Attr("selected-class", v)
return b
}
func (b *VItemGroupBuilder) Disabled(v bool) (r *VItemGroupBuilder) {
b.tag.Attr(":disabled", fmt.Sprint(v))
return b
}
func (b *VItemGroupBuilder) Mandatory(v interface{}) (r *VItemGroupBuilder) {
b.tag.Attr(":mandatory", h.JSONString(v))
return b
}
func (b *VItemGroupBuilder) Tag(v string) (r *VItemGroupBuilder) {
b.tag.Attr("tag", v)
return b
}
func (b *VItemGroupBuilder) Theme(v string) (r *VItemGroupBuilder) {
b.tag.Attr("theme", v)
return b
}
func (b *VItemGroupBuilder) SetAttr(k string, v interface{}) {
b.tag.SetAttr(k, v)
}
func (b *VItemGroupBuilder) Attr(vs ...interface{}) (r *VItemGroupBuilder) {
b.tag.Attr(vs...)
return b
}
func (b *VItemGroupBuilder) Children(children ...h.HTMLComponent) (r *VItemGroupBuilder) {
b.tag.Children(children...)
return b
}
func (b *VItemGroupBuilder) AppendChildren(children ...h.HTMLComponent) (r *VItemGroupBuilder) {
b.tag.AppendChildren(children...)
return b
}
func (b *VItemGroupBuilder) PrependChildren(children ...h.HTMLComponent) (r *VItemGroupBuilder) {
b.tag.PrependChildren(children...)
return b
}
func (b *VItemGroupBuilder) Class(names ...string) (r *VItemGroupBuilder) {
b.tag.Class(names...)
return b
}
func (b *VItemGroupBuilder) ClassIf(name string, add bool) (r *VItemGroupBuilder) {
b.tag.ClassIf(name, add)
return b
}
func (b *VItemGroupBuilder) On(name string, value string) (r *VItemGroupBuilder) {
b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
return b
}
func (b *VItemGroupBuilder) Bind(name string, value string) (r *VItemGroupBuilder) {
b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
return b
}
func (b *VItemGroupBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
return b.tag.MarshalHTML(ctx)
}