Context object.
Configuration for the dialog
The choices and button that was pressed
const {coreServices, extraServices, button} = await showMultipleChoice(ctx, {
title: 'Enable services',
description: 'Enable services for the new employee',
text: 'Select which new services should be enabled for the new employee.',
initialValue: {
coreServices: ['workstation', 'intranet'],
extraServices: [],
},
choices: [
{
name: 'coreServices',
label: 'Enable core services',
options: [
{value: 'workstation', label: 'Workstation access'},
{value: 'intranet', label: 'Intranet access'},
{value: 'vpn', label: 'Remote VPN'},
],
validation: [{type: 'required', params: ['This field is required']}],
},
{
name: 'extraServices',
label: 'Enable extra services',
options: [
{value: 'servers', label: 'Servers and infrastructure'},
{value: 'ci', label: 'Continuous Integration'},
],
validation: ['required'],
},
],
buttons: [
{text: 'Close', value: 'cancel'},
{text: 'Proceed', value: 'ok'},
],
});
Generated using TypeDoc
Renders a form dialog with one or more sets of multiple optional choices.
It displays a bubble with a text, one or more groups of checkboxes, header and navigation buttons, and waits until the user clicks one of the buttons.
Common uses for this dialog are:
The
text
of the message is parsed as Markdown, but it's also possible to pass ReactNodes.Any number of buttons can be specified, of which the "main" action should be the last. By default, the dialog presents a single
Submit
button with valueok
.Resolves when the user clicks one of the buttons, with the
value
of the button that was clicked.