File tree Expand file tree Collapse file tree 4 files changed +81
-0
lines changed
Expand file tree Collapse file tree 4 files changed +81
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import "./index.css";
55import Root from "./routes/Root.tsx" ;
66import BadgePage from "./routes/BadgePage.tsx" ;
77import CheckboxPage from "./routes/CheckboxPage.tsx" ;
8+ import MultiSelectPage from "./routes/MultiSelectPage.tsx" ;
89import RadioPage from "./routes/RadioPage.tsx" ;
910import SingleSelectPage from "./routes/SingleSelectPage.tsx" ;
1011import SplitLayoutPage from "./routes/SplitLayout.tsx" ;
@@ -29,6 +30,10 @@ const router = createBrowserRouter([
2930 path : "/checkbox" ,
3031 element : < CheckboxPage /> ,
3132 } ,
33+ {
34+ path : "/multi-select" ,
35+ element : < MultiSelectPage /> ,
36+ } ,
3237 {
3338 path : "/radio" ,
3439 element : < RadioPage /> ,
Original file line number Diff line number Diff line change 1+ import {
2+ VscodeOption ,
3+ VscodeMultiSelect ,
4+ } from "@vscode-elements/react-elements" ;
5+
6+ function logEvents ( ev : unknown ) {
7+ console . log ( ev ) ;
8+ }
9+
10+ export default function MultiSelectPage ( ) {
11+ return (
12+ < div >
13+ < h1 > Multi Select</ h1 >
14+ < h2 > Listen "change" and "click" events</ h2 >
15+ < p >
16+ < VscodeMultiSelect
17+ onChange = { logEvents }
18+ onClick = { logEvents }
19+ >
20+ < VscodeOption > Lorem</ VscodeOption >
21+ < VscodeOption > Ipsum</ VscodeOption >
22+ < VscodeOption > Dolor</ VscodeOption >
23+ </ VscodeMultiSelect >
24+ </ p >
25+ < h2 > Listen "invalid" event</ h2 >
26+ < form action = "#" >
27+ < p >
28+ < VscodeMultiSelect
29+ onInvalid = { logEvents }
30+ required
31+ name = "select-2"
32+ >
33+ < VscodeOption > </ VscodeOption >
34+ < VscodeOption > Lorem</ VscodeOption >
35+ < VscodeOption > Ipsum</ VscodeOption >
36+ < VscodeOption > Dolor</ VscodeOption >
37+ </ VscodeMultiSelect >
38+ </ p >
39+ < button > Submit</ button >
40+ </ form >
41+ < h2 > Creatable</ h2 >
42+ < form action = "#" >
43+ < p >
44+ < VscodeMultiSelect
45+ onVscMultiSelectCreateOption = { logEvents }
46+ name = "select-3"
47+ combobox
48+ creatable
49+ >
50+ < VscodeOption > Lorem</ VscodeOption >
51+ < VscodeOption > Ipsum</ VscodeOption >
52+ < VscodeOption > Dolor</ VscodeOption >
53+ </ VscodeMultiSelect >
54+ </ p >
55+ < button > Submit</ button >
56+ </ form >
57+ </ div >
58+ ) ;
59+ }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export default function Root() {
88 < ul >
99 < li > < a href = "/badge" > Badge</ a > </ li >
1010 < li > < a href = "/checkbox" > Checkbox</ a > </ li >
11+ < li > < a href = "/multi-select" > Multi Select</ a > </ li >
1112 < li > < a href = "/radio" > Radio</ a > </ li >
1213 < li > < a href = "/single-select" > Single Select</ a > </ li >
1314 < li > < a href = "/split-layout" > Split Layout</ a > </ li >
Original file line number Diff line number Diff line change @@ -38,6 +38,22 @@ export default function SingleSelectPage() {
3838 </ p >
3939 < button > Submit</ button >
4040 </ form >
41+ < h2 > Creatable</ h2 >
42+ < form action = "#" >
43+ < p >
44+ < VscodeSingleSelect
45+ onVscSingleSelectCreateOption = { logEvents }
46+ name = "select-3"
47+ combobox
48+ creatable
49+ >
50+ < VscodeOption > Lorem</ VscodeOption >
51+ < VscodeOption > Ipsum</ VscodeOption >
52+ < VscodeOption > Dolor</ VscodeOption >
53+ </ VscodeSingleSelect >
54+ </ p >
55+ < button > Submit</ button >
56+ </ form >
4157 </ div >
4258 ) ;
4359}
You can’t perform that action at this time.
0 commit comments