Skip to content

Commit

Permalink
Merge pull request #1 from gucal/matching-demo
Browse files Browse the repository at this point in the history
Matching demo
  • Loading branch information
gucal authored Apr 3, 2024
2 parents 0a5071c + c6506bb commit 58c4c81
Show file tree
Hide file tree
Showing 218 changed files with 4,568 additions and 14,527 deletions.
71 changes: 71 additions & 0 deletions components/doc/autocomplete/filleddoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import { AutoComplete } from '@/components/lib/autocomplete/AutoComplete';
import { useState } from 'react';

export function FilledDoc(props) {
const [value, setValue] = useState('');
const [items, setItems] = useState([]);

const search = (event) => {
setItems([...Array(10).keys()].map((item) => event.query + '-' + item));
};

const code = {
basic: `
<AutoComplete value={value} suggestions={items} completeMethod={search} onChange={(e) => setValue(e.value)} variant="filled" />
`,
javascript: `
import React, { useState } from "react";
import { AutoComplete } from "primereact/autocomplete";
export default function FilledDemo() {
const [value, setValue] = useState('');
const [items, setItems] = useState([]);
const search = (event) => {
setItems([...Array(10).keys()].map(item => event.query + '-' + item));
}
return (
<div className="card flex justify-content-center">
<AutoComplete value={value} suggestions={items} completeMethod={search} onChange={(e) => setValue(e.value)} variant="filled" />
</div>
)
}
`,
typescript: `
import React, { useState } from "react";
import { AutoComplete, AutoCompleteCompleteEvent } from "primereact/autocomplete";
export default function FilledDemo() {
const [value, setValue] = useState<string>('');
const [items, setItems] = useState<string[]>([]);
const search = (event: AutoCompleteCompleteEvent) => {
setItems([...Array(10).keys()].map(item => event.query + '-' + item));
}
return (
<div className="card flex justify-content-center">
<AutoComplete value={value} suggestions={items} completeMethod={search} onChange={(e) => setValue(e.value)} variant="filled" />
</div>
)
}
`
};

return (
<>
<DocSectionText {...props}>
<p>
Specify the <i>variant</i> property as <i>filled</i> to display the component with a higher visual emphasis than the default <i>outlined</i> style.
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<AutoComplete value={value} suggestions={items} completeMethod={search} onChange={(e) => setValue(e.value)} variant="filled" />
</div>
<DocSectionCode code={code} />
</>
);
}
234 changes: 0 additions & 234 deletions components/doc/autocomplete/form/formikdoc.js

This file was deleted.

Loading

0 comments on commit 58c4c81

Please sign in to comment.