14 def section_block(block, block_id=None):
22 block['block_id'] = block_id
26 def actions_block(*elements):
29 "elements": list(elements)
32 def checkbox_block(label, text, name, checked=False):
49 element["initial_options"] = [{
68 def button_block(label, name, extra=None):
81 block['action_id'] = extra
85 def accessory_block(main, accessory):
93 def input_block(label, name, placeholder, initial_value=None, optional=False):
96 "type": "plain_text_input",
105 element["initial_value"] = initial_value
110 "optional": optional,
113 "type": "plain_text",
118 def multi_select_block(label, name, placeholder, options,
119 initial_options=None):
123 "type": "multi_static_select",
125 "type": "plain_text",
131 "type": "plain_text",
135 } for option in options
140 multi_select["initial_options"] = [
143 "type": "plain_text",
147 } for option in initial_options
150 return accessory_block(
151 section_block(text_block("*{}*".format(label)), block_id=name),