feat(select-widget): add min/max validation (#3171)

This commit is contained in:
Shawn Erquhart
2020-01-30 17:53:46 -08:00
committed by GitHub
parent 67e5fd2aaf
commit fd9e2c89f2
4 changed files with 148 additions and 3 deletions

View File

@ -16,6 +16,8 @@ The select widget allows you to pick a string value from a dropdown menu.
- string values: the label displayed in the dropdown is the value saved in the file
- object with `label` and `value` fields: the label displays in the dropdown; the value is saved in the file
- `multiple`: accepts a boolean; defaults to `false`
- `min`: minimum number of items; ignored if **multiple** is not `true`
- `max`: maximum number of items; ignored if **multiple** is not `true`
- **Example** (options as strings):
```yaml
- label: "Align Content"
@ -42,4 +44,14 @@ The select widget allows you to pick a string value from a dropdown menu.
options: ["Design", "UX", "Dev"]
default: ["Design"]
```
- **Example** (min/max):
```yaml
- label: "Tags"
name: "tags"
widget: "select"
multiple: true
min: 1
max: 3
options: ["Design", "UX", "Dev"]
default: ["Design"]
```