|
|
@@ -2,52 +2,28 @@ import { NextPage } from 'next'; |
|
|
|
import * as Option from '@tesseract-design/web-option-react'; |
|
|
|
import * as SelectControlBase from '@tesseract-design/web-base-selectcontrol'; |
|
|
|
import { DefaultLayout } from '@/components/DefaultLayout'; |
|
|
|
import {ReactNode} from 'react'; |
|
|
|
|
|
|
|
type Props = { |
|
|
|
options: SelectControlBase.SelectOption[], |
|
|
|
options: ReactNode, |
|
|
|
} |
|
|
|
|
|
|
|
const OptionPage: NextPage<Props> = ({ |
|
|
|
options = [ |
|
|
|
{ |
|
|
|
label: 'Fruits', |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
label: 'Mango', |
|
|
|
value: 'mango', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Strawberry', |
|
|
|
value: 'strawberry', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Avocado', |
|
|
|
value: 'avocado', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Grapes', |
|
|
|
value: 'grapes', |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Non-fruits', |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
label: 'Chocolate', |
|
|
|
value: 'chocolate', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Milk', |
|
|
|
value: 'milk', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Coffee', |
|
|
|
value: 'coffee', |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
], |
|
|
|
options = ( |
|
|
|
<> |
|
|
|
<optgroup label="Fruits"> |
|
|
|
<option value="mango">Mango</option> |
|
|
|
<option value="strawberry">Strawberry</option> |
|
|
|
<option value="avocado">Avocado</option> |
|
|
|
<option value="grapes">Grapes</option> |
|
|
|
</optgroup> |
|
|
|
<optgroup label="Non-fruits"> |
|
|
|
<option value="chocolate">Chocolate</option> |
|
|
|
<option value="milk">Milk</option> |
|
|
|
<option value="coffee">Coffee</option> |
|
|
|
</optgroup> |
|
|
|
</> |
|
|
|
) |
|
|
|
}) => { |
|
|
|
return ( |
|
|
|
<DefaultLayout |
|
|
@@ -73,9 +49,7 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
> |
|
|
|
<option> |
|
|
|
Hello |
|
|
|
</option> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
@@ -85,16 +59,18 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -102,8 +78,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -111,8 +88,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -121,8 +99,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -130,8 +109,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -140,8 +120,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<form> |
|
|
@@ -222,8 +203,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -233,8 +215,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -242,8 +225,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -252,8 +236,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -262,8 +247,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -273,8 +259,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
size="large" |
|
|
|
label="Select" |
|
|
|
hint="Type anything here…" |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -283,8 +270,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.DropdownSelect |
|
|
@@ -294,8 +282,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.DropdownSelect> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -322,8 +311,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -333,8 +323,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -342,8 +333,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -352,8 +344,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -362,8 +355,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -373,8 +367,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -383,8 +378,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -394,8 +390,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -412,8 +409,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -424,8 +422,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -434,8 +433,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -445,8 +445,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -456,8 +457,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -468,8 +470,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
label="MultilineTextInput" |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -479,8 +482,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -491,8 +495,9 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -510,9 +515,10 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
multiple |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -522,9 +528,10 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
multiple |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -532,9 +539,10 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
multiple |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -543,9 +551,10 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
multiple |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -554,9 +563,10 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
multiple |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -566,9 +576,10 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
hint="Type anything here…" |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
options={options} |
|
|
|
multiple |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -577,9 +588,10 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
multiple |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Option.MenuSelect |
|
|
@@ -589,9 +601,10 @@ const OptionPage: NextPage<Props> = ({ |
|
|
|
indicator="A" |
|
|
|
block |
|
|
|
disabled |
|
|
|
options={options} |
|
|
|
multiple |
|
|
|
/> |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Option.MenuSelect> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|