add Int64Component
This commit is contained in:
@@ -52,13 +52,20 @@ type TextComponentInstance struct {
|
||||
value string
|
||||
}
|
||||
|
||||
func (t *TextComponentInstance) Value() interface{} {
|
||||
return t.value
|
||||
}
|
||||
|
||||
func (t *TextComponentInstance) FromJSON(component block.Component, data json.RawMessage) error {
|
||||
var s string
|
||||
err := json.Unmarshal(data, &s)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
if data != nil {
|
||||
err := json.Unmarshal(data, &s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t.value = s
|
||||
}
|
||||
t.value = s
|
||||
|
||||
for _, v := range component.Validators() {
|
||||
if err := v(s); err != nil {
|
||||
@@ -81,5 +88,4 @@ type TextValidator func(value any) error
|
||||
type TextComponentConfig struct {
|
||||
Validators []TextValidator
|
||||
}
|
||||
|
||||
type TextComponentOption func(*TextComponentConfig)
|
||||
|
||||
Reference in New Issue
Block a user