-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
26 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,49 @@ | ||
import { DocSectionCode } from '@/components/doc/common/docsectioncode'; | ||
import { DocSectionText } from '@/components/doc/common/docsectiontext'; | ||
import { MultiSelect } from '@/components/lib/multiselect/MultiSelect'; | ||
import { useState } from 'react'; | ||
|
||
export function LoadingDoc(props) { | ||
const code = { | ||
basic: ` | ||
<MultiSelect value={selectedCities} onChange={(e) => setSelectedCities(e.value)} options={cities} optionLabel="name" | ||
placeholder="Select Cities" maxSelectedLabels={3} className="w-full md:w-20rem" /> | ||
const code = { | ||
basic: ` | ||
<MultiSelect loading placeholder="Loading..." className="w-full md:w-20rem" /> | ||
`, | ||
javascript: ` | ||
import React, { useState } from "react"; | ||
javascript: ` | ||
import React from "react"; | ||
import { MultiSelect } from 'primereact/multiselect'; | ||
export default function BasicDemo() { | ||
const [selectedCities, setSelectedCities] = useState(null); | ||
const cities = [ | ||
{ name: 'New York', code: 'NY' }, | ||
{ name: 'Rome', code: 'RM' }, | ||
{ name: 'London', code: 'LDN' }, | ||
{ name: 'Istanbul', code: 'IST' }, | ||
{ name: 'Paris', code: 'PRS' } | ||
]; | ||
export default function LoadingDemo() { | ||
return ( | ||
<div className="card flex justify-content-center"> | ||
<MultiSelect value={selectedCities} onChange={(e) => setSelectedCities(e.value)} options={cities} optionLabel="name" | ||
placeholder="Select Cities" maxSelectedLabels={3} className="w-full md:w-20rem" /> | ||
<MultiSelect loading placeholder="Loading..." className="w-full md:w-20rem" /> | ||
</div> | ||
); | ||
} | ||
`, | ||
typescript: ` | ||
import React, { useState } from "react"; | ||
import { MultiSelect, MultiSelectChangeEvent } from 'primereact/multiselect'; | ||
interface City { | ||
name: string; | ||
code: string; | ||
} | ||
export default function BasicDemo() { | ||
const [selectedCities, setSelectedCities] = useState<City | null>(null); | ||
const cities: City[] = [ | ||
{ name: 'New York', code: 'NY' }, | ||
{ name: 'Rome', code: 'RM' }, | ||
{ name: 'London', code: 'LDN' }, | ||
{ name: 'Istanbul', code: 'IST' }, | ||
{ name: 'Paris', code: 'PRS' } | ||
]; | ||
typescript: ` | ||
import React from "react"; | ||
import { MultiSelect } from 'primereact/multiselect'; | ||
export default function LoadingDemo() { | ||
return ( | ||
<div className="card flex justify-content-center"> | ||
<MultiSelect value={selectedCities} onChange={(e: MultiSelectChangeEvent) => setSelectedCities(e.value)} options={cities} optionLabel="name" | ||
placeholder="Select Cities" maxSelectedLabels={3} className="w-full md:w-20rem" /> | ||
<MultiSelect loading placeholder="Loading..." className="w-full md:w-20rem" /> | ||
</div> | ||
); | ||
} | ||
` | ||
}; | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
Loading state can be used <i>loading</i> property. | ||
</p> | ||
</DocSectionText> | ||
<div className="card flex justify-content-center"> | ||
<MultiSelect loading placeholder="Loading..." className="w-full md:w-20rem" /> | ||
</div> | ||
<DocSectionCode code={code} /> | ||
</> | ||
); | ||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
Loading state can be used <i>loading</i> property. | ||
</p> | ||
</DocSectionText> | ||
<div className="card flex justify-content-center"> | ||
<MultiSelect loading placeholder="Loading..." className="w-full md:w-20rem" /> | ||
</div> | ||
<DocSectionCode code={code} /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.