diff --git a/src/components/v-checkbox/v-checkbox.vue b/src/components/v-checkbox/v-checkbox.vue index b232485802..3461929326 100644 --- a/src/components/v-checkbox/v-checkbox.vue +++ b/src/components/v-checkbox/v-checkbox.vue @@ -1,5 +1,6 @@ + + diff --git a/src/interfaces/checkboxes/index.ts b/src/interfaces/checkboxes/index.ts new file mode 100644 index 0000000000..17a48ba8d9 --- /dev/null +++ b/src/interfaces/checkboxes/index.ts @@ -0,0 +1,46 @@ +import { defineInterface } from '@/interfaces/define'; +import InterfaceCheckboxes from './checkboxes.vue'; + +export default defineInterface(({ i18n }) => ({ + id: 'checkboxes', + name: i18n.t('checkboxes'), + icon: 'radio_button_checked', + component: InterfaceCheckboxes, + options: [ + { + field: 'choices', + name: i18n.t('choices'), + note: i18n.t('use_double_colon_for_key'), + width: 'full', + interface: 'textarea', + }, + { + field: 'allowOther', + name: i18n.t('allow_other'), + width: 'half', + interface: 'toggle', + default_value: false, + }, + { + field: 'iconOff', + name: i18n.t('icon_off'), + width: 'half', + interface: 'icon', + default_value: 'check_box_outline_blank', + }, + { + field: 'iconOn', + name: i18n.t('icon_on'), + width: 'half', + interface: 'icon', + default_value: 'check_box', + }, + { + field: 'color', + name: i18n.t('color'), + width: 'half', + interface: 'color', + default_value: 'var(--primary)', + }, + ], +})); diff --git a/src/interfaces/checkboxes/readme.md b/src/interfaces/checkboxes/readme.md new file mode 100644 index 0000000000..b74d7dce53 --- /dev/null +++ b/src/interfaces/checkboxes/readme.md @@ -0,0 +1,11 @@ +# Checkboxes + +## Options + +| Option | Description | Default | +|---------------|-----------------------------------------------------|--------------------------| +| `choices` | What choices to render as radios | `null` | +| `allow-other` | Allow the user to enter a custom value | `false` | +| `icon-on` | What icon to show when the radio is checked | `radio_button_checked` | +| `icon-off` | What icon to show when the radio is unchecked | `radio_button_unchecked` | +| `color` | What color to use for the active state of the radio | `var(--primary)` | diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts index 81130286fc..06d246c01a 100644 --- a/src/interfaces/index.ts +++ b/src/interfaces/index.ts @@ -8,6 +8,7 @@ import InterfaceWYSIWYG from './wysiwyg/'; import InterfaceDropdown from './dropdown/'; import InterfaceDropdownMultiselect from './dropdown-multiselect/'; import InterfaceRadioButtons from './radio-buttons'; +import InterfaceCheckboxes from './checkboxes'; export const interfaces = [ InterfaceTextInput, @@ -20,6 +21,7 @@ export const interfaces = [ InterfaceDropdown, InterfaceDropdownMultiselect, InterfaceRadioButtons, + InterfaceCheckboxes, ]; export default interfaces; diff --git a/src/lang/en-US/index.json b/src/lang/en-US/index.json index 763700c513..73ac6a7aaa 100644 --- a/src/lang/en-US/index.json +++ b/src/lang/en-US/index.json @@ -120,6 +120,7 @@ "all_items": "All Items", "radio_buttons": "Radio Buttons", + "checkboxes": "Checkboxes", "users": "Users", "files": "Files",