66 lines
3.3 KiB
Plaintext
Raw Normal View History

2017-06-19 18:59:02 +00:00
component InputText(id string, value string, label string, placeholder string)
2017-10-09 13:47:40 +00:00
.widget-section
2017-06-19 18:59:02 +00:00
label(for=id)= label + ":"
2017-10-09 13:47:40 +00:00
input.widget-ui-element.action(id=id, data-field=id, type="text", value=value, placeholder=placeholder, title=placeholder, data-action="save", data-trigger="change")
2017-06-19 18:59:02 +00:00
2018-03-15 20:08:30 +00:00
component InputBool(id string, value bool, label string, title string)
.widget-section
label(for=id)= label + ":"
if value
button.action(id=id, data-action="disable", data-trigger="click", data-field=id, title=title)
Icon("toggle-on")
span ON
else
button.action(id=id, data-action="enable", data-trigger="click", data-field=id, title=title)
Icon("toggle-off")
span OFF
//- input.widget-ui-element.action(id=id, data-field=id, type="checkbox", value=value, checked=value, data-action="save", data-trigger="change")
2017-06-19 18:59:02 +00:00
component InputTextArea(id string, value string, label string, placeholder string)
2017-10-09 13:47:40 +00:00
.widget-section
2017-06-19 18:59:02 +00:00
label(for=id)= label + ":"
2017-10-09 13:47:40 +00:00
textarea.widget-ui-element.action(id=id, data-field=id, placeholder=placeholder, title=placeholder, data-action="save", data-trigger="change")= value
2017-06-19 18:59:02 +00:00
2017-06-26 09:43:47 +00:00
component InputNumber(id string, value float64, label string, placeholder string, min string, max string, step string)
2017-10-09 13:47:40 +00:00
.widget-section
2017-06-19 18:59:02 +00:00
label(for=id)= label + ":"
2017-10-09 13:47:40 +00:00
input.widget-ui-element.action(id=id, data-field=id, type="number", value=value, min=min, max=max, step=step, placeholder=placeholder, title=placeholder, data-action="save", data-trigger="change")
2017-06-24 17:52:10 +00:00
2017-11-16 21:37:18 +00:00
component InputNumberWithButtons(id string, value float64, label string, placeholder string, min string, max string, step string)
.widget-section
label(for=id)= label + ":"
.number-input-container
input.widget-ui-element.action(id=id, data-field=id, type="number", value=value, min=min, max=max, step=step, placeholder=placeholder, title=placeholder, data-action="save", data-trigger="change")
2018-04-18 18:40:45 +00:00
button.action.tip(data-action="addNumber", data-trigger="click", data-id=id, data-add="1", aria-label="Increase by 1")
2017-11-16 21:37:18 +00:00
RawIcon("plus")
2018-04-18 18:40:45 +00:00
button.action.tip(data-action="addNumber", data-trigger="click", data-id=id, data-add="-1", aria-label="Decrease by 1")
2017-11-16 21:37:18 +00:00
RawIcon("minus")
2017-10-21 22:17:35 +00:00
component InputSelection(id string, value string, label string, placeholder string, options []*arn.Option)
2017-10-09 13:47:40 +00:00
.widget-section
2017-06-24 17:52:10 +00:00
label(for=id)= label + ":"
2017-10-09 13:47:40 +00:00
select.widget-ui-element.action(id=id, data-field=id, value=value, title=placeholder, data-action="save", data-trigger="change")
2017-10-21 22:17:35 +00:00
each option in options
option(value=option.Value)= option.Label
2017-10-09 13:47:40 +00:00
2018-04-14 22:20:53 +00:00
component InputFileUpload(id string, label string, uploadType string, endpoint string)
2018-03-02 16:18:29 +00:00
.widget-section
label(for=id)= label + ":"
2018-04-14 22:20:53 +00:00
button.action(id=id, data-action="selectFile", data-trigger="click", data-endpoint=endpoint, data-type=uploadType)
2018-03-02 16:18:29 +00:00
Icon("upload")
span Select file
2017-10-15 18:19:45 +00:00
component InputTags(id string, value []string, label string, tooltip string)
2017-10-09 13:47:40 +00:00
.widget-section
label(for=id)= label + ":"
.tags(id=id)
2017-10-12 10:07:17 +00:00
for index, tag := range value
2018-03-24 20:20:03 +00:00
.tag.tag-edit.action(contenteditable="true", data-action="save", data-trigger="focusout", data-field=id + "[" + strconv.Itoa(index) + "]")= tag
2017-10-12 15:52:46 +00:00
button.tag-remove.action(data-action="arrayRemove", data-trigger="click", data-field=id, data-index=index)
RawIcon("trash")
2017-10-09 13:47:40 +00:00
2018-03-24 20:20:03 +00:00
button.tag-add.action(data-action="arrayAppend", data-trigger="click", data-field=id, title="Add more")
2017-10-09 13:47:40 +00:00
RawIcon("plus")
2017-10-15 18:19:45 +00:00
p!= tooltip
2017-10-09 13:47:40 +00:00