Skip to content

Commit

Permalink
added Search and Tabs input
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-76 committed Oct 13, 2024
1 parent 7d5267f commit 5749998
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 33 deletions.
126 changes: 94 additions & 32 deletions docs/docs/extensions/syntax-for-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ The `accordion` field can be used to group any number of other fields.
attributes:
label: My Accordion
fields:
- type: boolean
id: random
attributes:
label: Random
description: This is a description
value: true
- type: input
id: text
attributes:
label: Text
description: This is a description
value: Hello World
type: text
validations:
required: true
- ...
- type: boolean
id: random
attributes:
label: Random
description: This is a description
value: true
- type: input
id: text
attributes:
label: Text
description: This is a description
value: Hello World
type: text
validations:
required: true
- ...
```

The field does not store any values.
Expand Down Expand Up @@ -262,13 +262,15 @@ Resulting `values`:
}
```

<!--
### Divider

The `divider` field displays a horizontal line and provides no other functionaliy.
```yaml
- type: divider
id: divider
```
-->


### Dropdown Field
Expand Down Expand Up @@ -394,22 +396,22 @@ The `group` field can be used to visually combine other fields into a group.
attributes:
label: My Group
fields:
- type: boolean
id: random
attributes:
label: Random
description: This is a description
value: true
- type: input
id: text
attributes:
label: Text
description: This is a description
value: Hello World
type: text
validations:
required: true
- ...
- type: boolean
id: random
attributes:
label: Random
description: This is a description
value: true
- type: input
id: text
attributes:
label: Text
description: This is a description
value: Hello World
type: text
validations:
required: true
- ...
```

The field does not store any values.
Expand Down Expand Up @@ -536,6 +538,34 @@ Resulting `values`:
}
```

### Search Field
The `search` field can be used to group any number of other fields and search through them and all of their ancestors.
Searched ancestor fields: `label`, `description`, `title`, `value`

```yaml
- type: search
id: my-search
fields:
- type: boolean
id: random
attributes:
label: Random
description: This is a description
value: true
- type: input
id: text
attributes:
label: Text
description: This is a description
value: Hello World
type: text
validations:
required: true
- ...
```

The field does not store any values.

### Slider Field

The `slider` field provides a beautiful slider that can be used to select a value. The `min`, `max` & `step` values are
Expand All @@ -562,6 +592,38 @@ Resulting `values`:
}
```

### Tabs Field
The `tabs` field provides a tab bar with defined tabs to structure and group other fields. Recommended to be used as the top level field.
the optional `templates` field in a tab specified the pre-selected tab when the user selects templates in the configuration menu.

```yaml
- type: tabs
id: my-tabs
tabs:
- label: Tab1
fields:
- type: boolean
id: random
attributes:
label: Random
description: This is a description
value: true
- ...
- label: Tab2
templates: true
fields:
- type: input
id: text
attributes:
label: Text
description: This is a description
value: Hello World
type: text
validations:
required: true
- ...
```

### Tags Field

The `tags` field allow you to freely type in a list of words. This field is useful for adding a list of users, for
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"docs:dev": "set NODE_OPTIONS=\"--openssl-legacy-provider\" && vuepress dev docs",
"docs:build": "set NODE_OPTIONS=\"--openssl-legacy-provider\" && vuepress build docs"
},
"dependencies": {}
"dependencies": {},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

0 comments on commit 5749998

Please sign in to comment.