-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
cyclicalNav
prop in choose
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,10 +52,10 @@ import { <components you want to import> } from "vanjs-ui" | |
Alternatively, you can import **VanUI** from CDN via a `<script type="text/javascript">` tag: | ||
|
||
```html | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].4/dist/van-ui.nomodule.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].5/dist/van-ui.nomodule.min.js"></script> | ||
``` | ||
|
||
`https://cdn.jsdelivr.net/npm/[email protected].4/dist/van-ui.nomodule.js` can be used for the non-minified version. | ||
`https://cdn.jsdelivr.net/npm/[email protected].5/dist/van-ui.nomodule.js` can be used for the non-minified version. | ||
|
||
Note that: **VanJS** needs to be imported via a `<script type="text/javascript">` tag for **VanUI** to work properly. | ||
|
||
|
@@ -795,21 +795,22 @@ choice && van.add(document.body, div("You chose: ", b(choice))) | |
Example 2: | ||
|
||
```ts | ||
const choice = await choose({ | ||
label: "Choose a South American country:", | ||
options: [ | ||
"🇦🇷 Argentina", "🇧🇴 Bolivia", "🇧🇷 Brazil", "🇨🇱 Chile", "🇨🇴 Colombia", "🇪🇨 Ecuador", | ||
"🇬🇾 Guyana", "🇵🇾 Paraguay", "🇵🇪 Peru", "🇸🇷 Suriname", "🇺🇾 Uruguay", "🇻🇪 Venezuela", | ||
], | ||
showTextFilter: true, | ||
customModalProps: { | ||
blurBackground: true, | ||
modalStyleOverrides: {height: "300px"}, | ||
}, | ||
selectedColor: "blue", | ||
selectedStyleOverrides: {color: "white"}, | ||
}) | ||
choice && van.add(document.body, div("You chose: ", b(choice))) | ||
const choice = await choose({ | ||
label: "Choose a South American country:", | ||
options: [ | ||
"🇦🇷 Argentina", "🇧🇴 Bolivia", "🇧🇷 Brazil", "🇨🇱 Chile", "🇨🇴 Colombia", "🇪🇨 Ecuador", | ||
"🇬🇾 Guyana", "🇵🇾 Paraguay", "🇵🇪 Peru", "🇸🇷 Suriname", "🇺🇾 Uruguay", "🇻🇪 Venezuela", | ||
], | ||
showTextFilter: true, | ||
selectedColor: "blue", | ||
cyclicalNav: true, | ||
customModalProps: { | ||
blurBackground: true, | ||
modalStyleOverrides: {height: "300px"}, | ||
}, | ||
selectedStyleOverrides: {color: "white"}, | ||
}) | ||
choice && van.add(document.body, div("You chose: ", b(choice))) | ||
``` | ||
|
||
#### Property Reference | ||
|
@@ -818,6 +819,7 @@ choice && van.add(document.body, div("You chose: ", b(choice))) | |
* `options`: Type `string[]`. Required. The options of the choice. | ||
* `showTextFilter`: Type `boolean`. Default `false`. Optional. Whether to show a text filter for the options. | ||
* `selectedColor`: Type `string`. Default `"#f5f5f5"`. Optional. The background color of the currently selected option. | ||
* `cyclicalNav`: Type `boolean`. Default `false`. Optional. Whether to navigate through the options via arrow keys in a cyclical manner. That is, if `cyclicalNav` is on, when you reach the end of the list, pressing the down arrow key will take you back to the beginning, and vice versa for going up the list with the up arrow key. | ||
* `customModalProps`: Type: property bags for the [`Modal`](#modal) component (except the `closed` field). Default `{}`. Optional. The custom properties for the `Modal` component you want to specify. | ||
* `textFilterClass`: Type `string`. Default `""`. Optional. The `class` attribute of the text filter. You can specify multiple CSS classes separated by `" "`. | ||
* `textFilterStyleOverrides`: Type `Record<string, string | number>`. Default `{}`. Optional. A [property bag](#property-bag-for-style-overrides) for the styles you want to override for the text filter. | ||
|
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
}, | ||
"dependencies": { | ||
"vanjs-core": "^1.5.2", | ||
"vanjs-ui": "^0.11.4" | ||
"vanjs-ui": "^0.11.5" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
}, | ||
"dependencies": { | ||
"vanjs-core": "^1.5.2", | ||
"vanjs-ui": "^0.11.4" | ||
"vanjs-ui": "^0.11.5" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
}, | ||
"dependencies": { | ||
"vanjs-core": "^1.5.2", | ||
"vanjs-ui": "^0.11.4" | ||
"vanjs-ui": "^0.11.5" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
}, | ||
"dependencies": { | ||
"vanjs-core": "^1.5.2", | ||
"vanjs-ui": "^0.11.4" | ||
"vanjs-ui": "^0.11.5" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
}, | ||
"dependencies": { | ||
"vanjs-core": "^1.5.2", | ||
"vanjs-ui": "^0.11.4" | ||
"vanjs-ui": "^0.11.5" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
}, | ||
"dependencies": { | ||
"vanjs-core": "^1.5.2", | ||
"vanjs-ui": "^0.11.4" | ||
"vanjs-ui": "^0.11.5" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
}, | ||
"dependencies": { | ||
"vanjs-core": "^1.5.2", | ||
"vanjs-ui": "^0.11.4" | ||
"vanjs-ui": "^0.11.5" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
}, | ||
"dependencies": { | ||
"vanjs-core": "^1.5.2", | ||
"vanjs-ui": "^0.11.4" | ||
"vanjs-ui": "^0.11.5" | ||
} | ||
} |