diff --git a/components/doc/accordion/pt/ptdoc.js b/components/doc/accordion/pt/ptdoc.js deleted file mode 100644 index b3d7f826a8..0000000000 --- a/components/doc/accordion/pt/ptdoc.js +++ /dev/null @@ -1,144 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Accordion, AccordionTab } from '@/components/lib/accordion/Accordion'; - -export function PTDoc(props) { - const tabs = [ - { title: 'Header 1', content: 'Tab 1 Content' }, - { title: 'Header 2', content: 'Tab 2 Content' }, - { title: 'Header 3', content: 'Tab 3 Content' } - ]; - - const panelClassName = (parent, index) => { - if (parent.state.activeIndex === index) { - return 'bg-primary'; - } - }; - - const code = { - basic: ` - - {tabs.map((tab, i) => { - return ( - ({ - className: panelClassName(parent, i) - }) - }} - header={tab.title}> -

- {tab.content} -

-
- ) - })} -
- `, - javascript: ` -import React from 'react'; -import { Accordion, AccordionTab } from 'primereact/accordion'; - -export default function PTDemo() { - const tabs = [ - { title: 'Header 1', content: 'Tab 1 Content' }, - { title: 'Header 2', content: 'Tab 2 Content' }, - { title: 'Header 3', content: 'Tab 3 Content' } - ]; - - const panelClassName = (parent, index) => { - if (parent.state.activeIndex === index) return 'bg-primary'; - }; - - return ( -
- - {tabs.map((tab, i) => { - return ( - ({ - className: panelClassName(parent, i) - }) - }} - header={tab.title}> -

- {tab.content} -

-
- ) - })} -
-
- ) -} - `, - typescript: ` -import React from 'react'; -import { Accordion, AccordionTab } from 'primereact/accordion'; - -export default function PTDemo() { - const tabs = [ - { title: 'Header 1', content: 'Tab 1 Content' }, - { title: 'Header 2', content: 'Tab 2 Content' }, - { title: 'Header 3', content: 'Tab 3 Content' } - ]; - - const panelClassName = (parent, index) => { - if (parent.state.activeIndex === index) return 'bg-primary'; - }; - - return ( -
- - {tabs.map((tab, i) => { - return ( - ({ - className: panelClassName(parent, i) - }) - }} - header={tab.title}> -

- {tab.content} -

-
- ) - })} -
-
- ) -} - ` - }; - - return ( - <> - -
- - {tabs.map((tab, i) => { - return ( - ({ - className: panelClassName(parent, i) - }) - }} - header={tab.title} - > -

{tab.content}

-
- ); - })} -
-
- - - ); -} diff --git a/components/doc/autocomplete/filleddoc.js b/components/doc/autocomplete/filleddoc.js new file mode 100644 index 0000000000..6de79a0a22 --- /dev/null +++ b/components/doc/autocomplete/filleddoc.js @@ -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: ` + 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 ( +
+ setValue(e.value)} variant="filled" /> +
+ ) +} + `, + typescript: ` +import React, { useState } from "react"; +import { AutoComplete, AutoCompleteCompleteEvent } from "primereact/autocomplete"; + +export default function FilledDemo() { + const [value, setValue] = useState(''); + const [items, setItems] = useState([]); + + const search = (event: AutoCompleteCompleteEvent) => { + setItems([...Array(10).keys()].map(item => event.query + '-' + item)); + } + + return ( +
+ setValue(e.value)} variant="filled" /> +
+ ) +} + ` + }; + + return ( + <> + +

+ Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style. +

+
+
+ setValue(e.value)} variant="filled" /> +
+ + + ); +} diff --git a/components/doc/autocomplete/form/formikdoc.js b/components/doc/autocomplete/form/formikdoc.js deleted file mode 100644 index c06936b3bc..0000000000 --- a/components/doc/autocomplete/form/formikdoc.js +++ /dev/null @@ -1,234 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { AutoComplete } from '@/components/lib/autocomplete/AutoComplete'; -import { Button } from '@/components/lib/button/Button'; -import { Toast } from '@/components/lib/toast/Toast'; -import { classNames } from '@/components/lib/utils/Utils'; -import { useFormik } from 'formik'; -import { useRef, useState } from 'react'; - -export function FormikDoc(props) { - const toast = useRef(null); - const [items, setItems] = useState([]); - - const show = () => { - toast.current.show({ severity: 'success', summary: 'Form Submitted', detail: formik.values.item }); - }; - - const search = (event) => { - setItems([...Array(10).keys()].map((item) => event.query + '-' + item)); - }; - - const formik = useFormik({ - initialValues: { - item: '' - }, - validate: (data) => { - let errors = {}; - - if (!data.item) { - errors.item = 'Value is required.'; - } - - return errors; - }, - onSubmit: (data) => { - data.item && show(data); - formik.resetForm(); - } - }); - - const isFormFieldInvalid = (name) => !!(formik.touched[name] && formik.errors[name]); - - const getFormErrorMessage = (name) => { - return isFormFieldInvalid(name) ? {formik.errors[name]} :  ; - }; - - const code = { - basic: ` -
-
Value
- - { - formik.setFieldValue('item', e.value); - }} - /> - {getFormErrorMessage('item')} - - - - -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

-
- - ) -} - `, - typescript: ` -import React, { useState } from 'react'; -import { BlockUI } from 'primereact/blockui'; -import { Button } from 'primereact/button'; - -export default function PTDemo() { - const [blocked, setBlocked] = useState(false); - - return ( -
-
- - -
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

-
-
- ) -} - ` - }; - - return ( - <> - -
-
-
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

-
-
- - - ); -} diff --git a/components/doc/breadcrumb/pt/ptdoc.js b/components/doc/breadcrumb/pt/ptdoc.js deleted file mode 100644 index 905c6202e4..0000000000 --- a/components/doc/breadcrumb/pt/ptdoc.js +++ /dev/null @@ -1,91 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { BreadCrumb } from '@/components/lib/breadcrumb/BreadCrumb'; - -export function PTDoc(props) { - const items = [{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }]; - const home = { icon: 'pi pi-home', url: 'https://primereact.org' }; - - const code = { - basic: ` - ({ - className: props.index === items.length - 1 ? 'font-italic' : undefined - }) - }} -/> - `, - javascript: ` -import React from 'react'; -import { BreadCrumb } from 'primereact/breadcrumb'; - -export default function PTDemo() { - const items = [{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }]; - const home = { icon: 'pi pi-home', url: 'https://primereact.org' } - - return ( -
- ({ - className: props.index === items.length - 1 ? 'font-italic' : undefined - }) - }} - model={items} - home={home} - /> -
- ) -} - `, - typescript: ` -import React from 'react'; -import { BreadCrumb } from 'primereact/breadcrumb'; -import { MenuItem } from 'primereact/menuitem'; - -export default function PTDemo() { - const items: MenuItem[] = [{ label: 'Computer' }, { label: 'Notebook' }, { label: 'Accessories' }, { label: 'Backpacks' }, { label: 'Item' }]; - const home: MenuItem = { icon: 'pi pi-home', url: 'https://primereact.org' } - - return ( -
- ({ - className: props.index === items.length - 1 ? 'font-italic' : undefined - }) - }} - model={items} - home={home} - /> -
- ) -} - ` - }; - - return ( - <> - -
- ({ - className: props.index === items.length - 1 ? 'font-italic' : undefined - }) - }} - model={items} - home={home} - /> -
- - - ); -} diff --git a/components/doc/button/pt/ptdoc.js b/components/doc/button/pt/ptdoc.js deleted file mode 100644 index 2245eed621..0000000000 --- a/components/doc/button/pt/ptdoc.js +++ /dev/null @@ -1,67 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Button } from '@/components/lib/button/Button'; - -export function PTDoc(props) { - const code = { - basic: ` - - - - - - - ); - }; - - return ( -
- -
- ) -} - `, - typescript: ` -import React, { useState, useEffect } from 'react'; -import { ProductService } from './service/ProductService'; -import { Button } from 'primereact/button'; -import { DataScroller } from 'primereact/datascroller'; -import { Rating } from 'primereact/rating'; -import { Tag } from 'primereact/tag'; - -interface Product { - id: string; - code: string; - name: string; - description: string; - image: string; - price: number; - category: string; - quantity: number; - inventoryStatus: string; - rating: number; -} - -export default function BasicDemo() { - const [products, setProducts] = useState([]); - - useEffect(() => { - ProductService.getProducts().then((data) => setProducts(data)); - }, []); // eslint-disable-line react-hooks/exhaustive-deps - - const getSeverity = (product: Product) => { - switch (product.inventoryStatus) { - case 'INSTOCK': - return 'success'; - - case 'LOWSTOCK': - return 'warning'; - - case 'OUTOFSTOCK': - return 'danger'; - - default: - return null; - } - }; - - const itemTemplate = (data: Product) => { - return ( -
-
- {data.name} -
-
-
-
{data.name}
-
{data.description}
-
-
- - - - {data.category} - -
-
-
- \${data.price} - - -
-
-
-
- ); - }; - - return ( -
- -
- ) -} - ` - }; - - return ( - <> - -
- -
- - - ); -} diff --git a/components/doc/datatable/pt/ptdoc.js b/components/doc/datatable/pt/ptdoc.js deleted file mode 100644 index 120f5a8eb7..0000000000 --- a/components/doc/datatable/pt/ptdoc.js +++ /dev/null @@ -1,270 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Column } from '@/components/lib/column/Column'; -import { DataTable } from '@/components/lib/datatable/DataTable'; -import { useState } from 'react'; -import { ProductService } from '../../../../service/ProductService'; -import DeferredDemo from '@/components/demo/DeferredDemo'; - -export function PTDoc(props) { - const [products, setProducts] = useState([]); - - const loadDemoData = () => { - ProductService.getProductsMini().then((data) => setProducts(data)); - }; - - const code = { - basic: ` - - - - - - - `, - javascript: ` -import React, { useState, useEffect } from 'react'; -import { DataTable } from 'primereact/datatable'; -import { Column } from 'primereact/column'; -import { ProductService } from './service/ProductService'; - -export default function PTDemo() { - const [products, setProducts] = useState([]); - - useEffect(() => { - ProductService.getProductsMini().then(data => setProducts(data)); - }, []); - - return ( - - - - - - - - ); -} - `, - typescript: ` -import React, { useState, useEffect } from 'react'; -import { DataTable } from 'primereact/datatable'; -import { Column } from 'primereact/column'; -import { ProductService } from './service/ProductService'; - -interface Product { - id: string; - code: string; - name: string; - description: string; - image: string; - price: number; - category: string; - quantity: number; - inventoryStatus: string; - rating: number; -} - -export default function PTDemo() { - const [products, setProducts] = useState([]); - - useEffect(() => { - ProductService.getProductsMini().then(data => setProducts(data)); - }, []); - - return ( - - - - - - - ); -} - `, - data: ` -{ - id: '1000', - code: 'f230fh0g3', - name: 'Bamboo Watch', - description: 'Product Description', - image: 'bamboo-watch.jpg', - price: 65, - category: 'Accessories', - quantity: 24, - inventoryStatus: 'INSTOCK', - rating: 5 -}, -... - ` - }; - - return ( - <> - - -
- - - - - - -
-
- - - ); -} diff --git a/components/doc/dataview/pt/ptdoc.js b/components/doc/dataview/pt/ptdoc.js deleted file mode 100644 index d78908c210..0000000000 --- a/components/doc/dataview/pt/ptdoc.js +++ /dev/null @@ -1,419 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Button } from '@/components/lib/button/Button'; -import { DataView, DataViewLayoutOptions } from '@/components/lib/dataview/DataView'; -import { Rating } from '@/components/lib/rating/Rating'; -import { Tag } from '@/components/lib/tag/Tag'; -import { useEffect, useState } from 'react'; -import { ProductService } from '../../../../service/ProductService'; - -export function PTDoc(props) { - const [products, setProducts] = useState([]); - const [layout, setLayout] = useState('grid'); - - useEffect(() => { - ProductService.getProducts().then((data) => setProducts(data.slice(0, 6))); - }, []); // eslint-disable-line react-hooks/exhaustive-deps - - const getSeverity = (product) => { - switch (product.inventoryStatus) { - case 'INSTOCK': - return 'success'; - - case 'LOWSTOCK': - return 'warning'; - - case 'OUTOFSTOCK': - return 'danger'; - - default: - return null; - } - }; - - const listItem = (product) => { - return ( -
-
- {product.name} -
-
-
{product.name}
- -
- - - {product.category} - - -
-
-
- ${product.price} -
-
-
-
- ); - }; - - const gridItem = (product) => { - return ( -
-
-
-
- - {product.category} -
- -
-
- {product.name} -
{product.name}
- -
-
- ${product.price} -
-
-
- ); - }; - - const itemTemplate = (product, layout) => { - if (!product) { - return; - } - - if (layout === 'list') { - return listItem(product); - } else if (layout === 'grid') { - return gridItem(product); - } - }; - - const header = () => { - return ( -
- setLayout(e.value)} - pt={{ - listButton: ({ props }) => ({ className: props.layout === 'list' ? 'bg-teal-400 border-teal-400' : 'undefined' }), - gridButton: ({ props }) => ({ className: props.layout === 'grid' ? 'bg-teal-400 border-teal-400' : 'undefined' }) - }} - /> -
- ); - }; - - const code = { - basic: ` - - `, - javascript: ` -import React, { useState, useEffect } from 'react'; -import { ProductService } from './service/ProductService'; -import { Button } from 'primereact/button'; -import { DataView, DataViewLayoutOptions } from 'primereact/dataview'; -import { Rating } from 'primereact/rating'; -import { Tag } from 'primereact/tag'; - -export default function BasicDemo() { - const [products, setProducts] = useState([]); - const [layout, setLayout] = useState('grid'); - - useEffect(() => { - ProductService.getProducts().then((data) => setProducts(data.slice(0, 12))); - }, []); - - const getSeverity = (product) => { - switch (product.inventoryStatus) { - case 'INSTOCK': - return 'success'; - - case 'LOWSTOCK': - return 'warning'; - - case 'OUTOFSTOCK': - return 'danger'; - - default: - return null; - } - }; - - const listItem = (product) => { - return ( -
-
- {product.name} -
-
-
{product.name}
- -
- - - {product.category} - - -
-
-
- \${product.price} - -
-
-
-
- ); - }; - - const gridItem = (product) => { - return ( -
-
-
-
- - {product.category} -
- -
-
- {product.name} -
{product.name}
- -
-
- \${product.price} - -
-
-
- ); - }; - - const itemTemplate = (product, layout) => { - if (!product) { - return; - } - - if (layout === 'list') return listItem(product); - else if (layout === 'grid') return gridItem(product); - }; - - const header = () => { - return ( -
- setLayout(e.value)} - pt={{ - listButton: ({ props }) => ({ className: props.layout === 'list' ? 'bg-teal-400 border-teal-400' : 'undefined' }), - gridButton: ({ props }) => ({ className: props.layout === 'grid' ? 'bg-teal-400 border-teal-400' : 'undefined' }) - }} - /> -
- ); - }; - - return ( -
- -
- ) -} - `, - typescript: ` -import React, { useState, useEffect } from 'react'; -import { ProductService } from './service/ProductService'; -import { Button } from 'primereact/button'; -import { DataView, DataViewLayoutOptions } from 'primereact/dataview'; -import { Rating } from 'primereact/rating'; -import { Tag } from 'primereact/tag'; - -interface Product { - id: string; - code: string; - name: string; - description: string; - image: string; - price: number; - category: string; - quantity: number; - inventoryStatus: string; - rating: number; -} - -export default function BasicDemo() { - const [products, setProducts] = useState([]); - const [layout, setLayout] = useState('grid'); - - useEffect(() => { - ProductService.getProducts().then((data) => setProducts(data.slice(0, 12))); - }, []); - - const getSeverity = (product) => { - switch (product.inventoryStatus) { - case 'INSTOCK': - return 'success'; - - case 'LOWSTOCK': - return 'warning'; - - case 'OUTOFSTOCK': - return 'danger'; - - default: - return null; - } - }; - - const listItem = (product: Product) => { - return ( -
-
- {product.name} -
-
-
{product.name}
- -
- - - {product.category} - - -
-
-
- \${product.price} - -
-
-
-
- ); - }; - - const gridItem = (product: Product) => { - return ( -
-
-
-
- - {product.category} -
- -
-
- {product.name} -
{product.name}
- -
-
- \${product.price} - -
-
-
- ); - }; - - const itemTemplate = (product: Product, layout: string) => { - if (!product) { - return; - } - - if (layout === 'list') return listItem(product); - else if (layout === 'grid') return gridItem(product); - }; - - const header = () => { - return ( -
- setLayout(e.value)} - pt={{ - listButton: ({ props }) => ({ className: props.layout === 'list' ? 'bg-teal-400 border-teal-400' : 'undefined' }), - gridButton: ({ props }) => ({ className: props.layout === 'grid' ? 'bg-teal-400 border-teal-400' : 'undefined' }) - }} - /> -
- ); - }; - - return ( -
- -
- ) -} - `, - data: ` -/* ProductService */ -{ - id: '1000', - code: 'f230fh0g3', - name: 'Bamboo Watch', - description: 'Product Description', - image: 'bamboo-watch.jpg', - price: 65, - category: 'Accessories', - quantity: 24, - inventoryStatus: 'INSTOCK', - rating: 5 -}, -... - ` - }; - - return ( - <> - -
- -
- - - ); -} diff --git a/components/doc/dialog/pt/ptdoc.js b/components/doc/dialog/pt/ptdoc.js deleted file mode 100644 index 941f7a701c..0000000000 --- a/components/doc/dialog/pt/ptdoc.js +++ /dev/null @@ -1,109 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Button } from '@/components/lib/button/Button'; -import { Dialog } from '@/components/lib/dialog/Dialog'; -import { useState } from 'react'; - -export function PTDoc(props) { - const [visible, setVisible] = useState(false); - - const code = { - basic: ` - setVisible(false)} - pt={{ - root: { className: 'w-12 sm:w-9 md:w-6' } - }} -> - - `, - javascript: ` -import React, { useState } from 'react'; -import { Dialog } from 'primereact/dialog'; -import { Button } from 'primereact/button'; - -export default function PTDemo() { - const [visible, setVisible] = useState(false); - - return ( -
-
- ) -} - `, - typescript: ` -import React, { useState } from 'react'; -import { Dialog } from 'primereact/dialog'; -import { Button } from 'primereact/button'; - -export default function PTDemo() { - const [visible, setVisible] = useState(false); - - return ( -
-
- ) -} - ` - }; - - return ( - <> - -
-
- - - ); -} diff --git a/components/doc/divider/pt/ptdoc.js b/components/doc/divider/pt/ptdoc.js deleted file mode 100644 index 5199fdcbcc..0000000000 --- a/components/doc/divider/pt/ptdoc.js +++ /dev/null @@ -1,83 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Divider } from '@/components/lib/divider/Divider'; - -export function PTDoc(props) { - const code = { - basic: ` -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrudexercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum doloreeu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpaqui officia deserunt mollit anim id est laborum. -

- - Center - -

- Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremquelaudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasiarchitecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequunturmagni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit,sed quia non numquam eius modi. -

- `, - javascript: ` -import React from 'react'; -import { Divider } from 'primereact/divider'; - -export default function PTDemo() { - return ( -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

- - Center - -

- Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim - ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi. -

-
- ) -} - `, - typescript: ` -import React from 'react'; -import { Divider } from 'primereact/divider'; - -export default function PTDemo() { - return ( -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

- - Center - -

- Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim - ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi. -

-
- ) -} - ` - }; - - return ( - <> - -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

- - Center - -

- Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim - ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Consectetur, adipisci velit, sed quia non numquam eius modi. -

-
- - - ); -} diff --git a/components/doc/dock/pt/ptdoc.js b/components/doc/dock/pt/ptdoc.js deleted file mode 100644 index b90c3babb8..0000000000 --- a/components/doc/dock/pt/ptdoc.js +++ /dev/null @@ -1,182 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Dock } from '@/components/lib/dock/Dock'; - -export function PTDoc(props) { - const items = [ - { - label: 'Finder', - icon: () => Finder - }, - { - label: 'App Store', - icon: () => App Store - }, - { - label: 'Photos', - icon: () => Photos - }, - { - label: 'Trash', - icon: () => trash - } - ]; - - const positions = [ - { - label: 'Bottom', - value: 'bottom' - }, - { - label: 'Top', - value: 'top' - }, - { - label: 'Left', - value: 'left' - }, - { - label: 'Right', - value: 'right' - } - ]; - - const code = { - basic: ` - -`, - javascript: ` -import React from 'react'; -import { Dock } from 'primereact/dock'; -import './DockDemo.css'; - -export default function PTDemo() { - const items = [ - { - label: 'Finder', - icon: () => Finder, - }, - { - label: 'App Store', - icon: () => App Store, - }, - { - label: 'Photos', - icon: () => Photos, - }, - { - label: 'Trash', - icon: () => trash, - } - ]; - - return ( -
-
- -
-
- ) -} - `, - typescript: ` -import React from 'react'; -import { Dock } from 'primereact/dock'; -import { MenuItem } from 'primereact/menuitem'; -import './DockDemo.css'; - -export default function PTDemo() { - const items: MenuItem[] = [ - { - label: 'Finder', - icon: () => Finder, - }, - { - label: 'App Store', - icon: () => App Store, - }, - { - label: 'Photos', - icon: () => Photos, - }, - { - label: 'Trash', - icon: () => trash, - } - ]; - - return ( -
-
- -
-
- ) -} - `, - extFiles: { - 'DockDemo.css': ` -/* DockDemo.css */ -.dock-demo .dock-window { - width: 100%; - height: 450px; - position: relative; - background-image: url('https://primefaces.org/cdn/primereact/images/dock/window.jpg'); - background-repeat: no-repeat; - background-size: cover; -} -.dock-demo .p-dock { - z-index: 1000; -} - ` - } - }; - - return ( - <> - -

- Menu requires a collection of menuitems as its model. Default location is bottom and other sides are also available when defined with the position property. -

-
-
-
- -
-
- - - ); -} diff --git a/components/doc/dropdown/filleddoc.js b/components/doc/dropdown/filleddoc.js new file mode 100644 index 0000000000..39f787dbd7 --- /dev/null +++ b/components/doc/dropdown/filleddoc.js @@ -0,0 +1,85 @@ +import { DocSectionCode } from '@/components/doc/common/docsectioncode'; +import { DocSectionText } from '@/components/doc/common/docsectiontext'; +import { Dropdown } from '@/components/lib/dropdown/Dropdown'; +import { useState } from 'react'; + +export function FilledDoc(props) { + const [selectedCity, setSelectedCity] = 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' } + ]; + + const code = { + basic: ` + setSelectedCity(e.value)} options={cities} optionLabel="name" + placeholder="Select a City" className="w-full md:w-14rem" /> + `, + javascript: ` +import React, { useState } from "react"; +import { Dropdown } from 'primereact/dropdown'; + +export default function FilledDemo() { + const [selectedCity, setSelectedCity] = 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' } + ]; + + return ( +
+ setSelectedCity(e.value)} options={cities} optionLabel="name" + placeholder="Select a City" className="w-full md:w-14rem" /> +
+ ) +} + `, + typescript: ` +import React, { useState } from "react"; +import { Dropdown, DropdownChangeEvent } from 'primereact/dropdown'; + +interface City { + name: string; + code: string; +} + +export default function FilledDemo() { + const [selectedCity, setSelectedCity] = useState(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' } + ]; + + return ( +
+ setSelectedCity(e.value)} options={cities} optionLabel="name" + placeholder="Select a City" className="w-full md:w-14rem" /> +
+ ) +} + ` + }; + + return ( + <> + +

+ Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style. +

+
+
+ setSelectedCity(e.value)} options={cities} optionLabel="name" placeholder="Select a City" className="w-full md:w-14rem" /> +
+ + + ); +} diff --git a/components/doc/dropdown/floatlabeldoc.js b/components/doc/dropdown/floatlabeldoc.js index f4e0025c78..7477afe488 100644 --- a/components/doc/dropdown/floatlabeldoc.js +++ b/components/doc/dropdown/floatlabeldoc.js @@ -1,6 +1,7 @@ import { DocSectionCode } from '@/components/doc/common/docsectioncode'; import { DocSectionText } from '@/components/doc/common/docsectiontext'; import { Dropdown } from '@/components/lib/dropdown/Dropdown'; +import { FloatLabel } from '@/components/lib/floatlabel/FloatLabel'; import { useState } from 'react'; export function FloatLabelDoc(props) { @@ -15,14 +16,15 @@ export function FloatLabelDoc(props) { const code = { basic: ` - + setSelectedCity(e.value)} options={cities} optionLabel="name" className="w-full" /> - + `, javascript: ` import React, { useState } from "react"; import { Dropdown } from 'primereact/dropdown'; +import { FloatLabel } from 'primereact/floatlabel'; export default function FloatLabelDemo() { const [selectedCity, setSelectedCity] = useState(null); @@ -36,10 +38,10 @@ export default function FloatLabelDemo() { return (
- + setSelectedCity(e.value)} options={cities} optionLabel="name" className="w-full" /> - +
) } @@ -47,6 +49,7 @@ export default function FloatLabelDemo() { typescript: ` import React, { useState } from "react"; import { Dropdown, DropdownChangeEvent } from 'primereact/dropdown'; +import { FloatLabel } from 'primereact/floatlabel'; interface City { name: string; @@ -65,10 +68,10 @@ export default function FloatLabelDemo() { return (
- + setSelectedCity(e.value)} options={cities} optionLabel="name" className="w-full" /> - +
) } @@ -81,10 +84,10 @@ export default function FloatLabelDemo() {

A floating label appears on top of the input field when focused.

- + setSelectedCity(e.value)} options={cities} optionLabel="name" className="w-full" /> - +
diff --git a/components/doc/dropdown/form/formikdoc.js b/components/doc/dropdown/form/formikdoc.js deleted file mode 100644 index 3d3c664e06..0000000000 --- a/components/doc/dropdown/form/formikdoc.js +++ /dev/null @@ -1,242 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Button } from '@/components/lib/button/Button'; -import { Dropdown } from '@/components/lib/dropdown/Dropdown'; -import { Toast } from '@/components/lib/toast/Toast'; -import { classNames } from '@/components/lib/utils/Utils'; -import { useFormik } from 'formik'; -import { useRef } from 'react'; - -export function FormikDoc(props) { - const toast = useRef(null); - const cities = [ - { name: 'New York', code: 'NY' }, - { name: 'Rome', code: 'RM' }, - { name: 'London', code: 'LDN' }, - { name: 'Istanbul', code: 'IST' }, - { name: 'Paris', code: 'PRS' } - ]; - - const show = (data) => { - toast.current.show({ severity: 'success', summary: 'Form Submitted', detail: `${data.city.name}` }); - }; - - const formik = useFormik({ - initialValues: { - city: '' - }, - validate: (data) => { - let errors = {}; - - if (!data.city) { - errors.city = 'City is required.'; - } - - return errors; - }, - onSubmit: (data) => { - data.city && show(data); - formik.resetForm(); - } - }); - - const isFormFieldInvalid = (name) => !!(formik.touched[name] && formik.errors[name]); - - const getFormErrorMessage = (name) => { - return isFormFieldInvalid(name) ? {formik.errors[name]} :  ; - }; - - const code = { - basic: ` - - { - formik.setFieldValue('city', e.value); - }} -/> -{getFormErrorMessage('city')} - - - - - ); - }; - - const header = renderHeader(); - - const formik = useFormik({ - initialValues: { - blog: '' - }, - validate: (data) => { - let errors = {}; - - if (!data.blog || data.blog === \`n\`) { - - errors.blog = 'Content is required.'; - } - - return errors; - }, - onSubmit: (data) => { - data.blog && show(); - formik.resetForm(); - } - }); - - const isFormFieldInvalid = (name) => !!(formik.touched[name] && formik.errors[name]); - - const getFormErrorMessage = (name) => { - return isFormFieldInvalid(name) ? {formik.errors[name]} :  ; - }; - - return ( -
-
- - { - formik.setFieldValue('blog', e.textValue); - }} - style={{ height: '320px' }} - /> -
- {getFormErrorMessage('blog')} -
- -
- ) -} - `, - typescript: ` -import React, { useRef } from "react"; -import { useFormik } from 'formik'; -import { Editor, EditorTextChangeEvent } from 'primereact/editor'; -import { Button } from 'primereact/button'; -import { Toast } from 'primereact/toast'; - -export default function FormikDoc() { - const toast = useRef(null); - - const show = () => { - toast.current.show({ severity: 'success', summary: 'Blog Submitted', detail: 'The blog is uploaded' }); - }; - - const renderHeader = () => { - return ( - - - - - - ); - }; - - const header = renderHeader(); - - const formik = useFormik({ - initialValues: { - blog: '' - }, - validate: (data) => { - let errors = {}; - - if (!data.blog || data.blog === \`n\`) { - - errors.blog = 'Content is required.'; - } - - return errors; - }, - onSubmit: (data) => { - data.blog && show(); - formik.resetForm(); - } - }); - - const isFormFieldInvalid = (name) => !!(formik.touched[name] && formik.errors[name]); - - const getFormErrorMessage = (name) => { - return isFormFieldInvalid(name) ? {formik.errors[name]} :  ; - }; - - return ( -
-
- - { - formik.setFieldValue('blog', e.textValue); - }} - style={{ height: '320px' }} - /> -
- {getFormErrorMessage('blog')} -
- -
- ) -} - ` - }; - - return ( - <> - -

- Formik is a popular library for handling forms in React. -

-
-
-
- - { - formik.setFieldValue('blog', e.textValue); - }} - style={{ height: '320px' }} - /> -
- {getFormErrorMessage('blog')} -
- -
- - - ); -} diff --git a/components/doc/editor/form/hookformdoc.js b/components/doc/editor/form/hookformdoc.js deleted file mode 100644 index 00cc88f458..0000000000 --- a/components/doc/editor/form/hookformdoc.js +++ /dev/null @@ -1,220 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Button } from '@/components/lib/button/Button'; -import { Editor } from '@/components/lib/editor/Editor'; -import { Toast } from '@/components/lib/toast/Toast'; -import { useRef } from 'react'; -import { Controller, useForm } from 'react-hook-form'; - -export function HookFormDoc(props) { - const toast = useRef(null); - - const show = () => { - toast.current.show({ severity: 'success', summary: 'Submission Received', detail: 'The blog is uploaded' }); - }; - - const renderHeader = () => { - return ( - - - - - - ); - }; - - const header = renderHeader(); - - const defaultValues = { - blog: '' - }; - - const { - control, - formState: { errors }, - handleSubmit, - reset - } = useForm({ defaultValues }); - - const onSubmit = (data) => { - data.blog && show(); - - reset(); - }; - - const getFormErrorMessage = (name) => { - return errors[name] ? {errors[name].message} :  ; - }; - - return ( -
-
- - field.onChange(e.textValue)} style={{ height: '320px' }} />} - /> -
- {getFormErrorMessage('blog')} -
- -
- ) -} - `, - typescript: ` -import React, { useRef } from "react"; -import { useForm, Controller } from 'react-hook-form'; -import { Editor, EditorTextChangeEvent } from 'primereact/editor'; -import { Button } from 'primereact/button'; -import { Toast } from 'primereact/toast'; - -export default function HookFormDoc() { - const toast = useRef(null); - - const show = () => { - toast.current.show({ severity: 'success', summary: 'Submission Received', detail: 'The blog is uploaded' }); - }; - - const renderHeader = () => { - return ( - - - - - - ); - }; - - const header = renderHeader(); - - const defaultValues = { - blog: '' - }; - - const { - control, - formState: { errors }, - handleSubmit, - reset - } = useForm({ defaultValues }); - - const onSubmit = (data) => { - data.blog && show(); - - reset(); - }; - - const getFormErrorMessage = (name) => { - return errors[name] ? {errors[name].message} :  ; - }; - - return ( -
-
- - field.onChange(e.textValue)} style={{ height: '320px' }} />} - /> -
- {getFormErrorMessage('blog')} -
- -
- ) -} - ` - }; - - return ( - <> - -

- React Hook Form is another popular React library to handle forms. -

-
-
-
- - field.onChange(e.textValue)} style={{ height: '320px' }} />} - /> -
- {getFormErrorMessage('blog')} -
- -
- - - ); -} diff --git a/components/doc/editor/pt/ptdoc.js b/components/doc/editor/pt/ptdoc.js deleted file mode 100644 index 4a5536977e..0000000000 --- a/components/doc/editor/pt/ptdoc.js +++ /dev/null @@ -1,80 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Editor } from '@/components/lib/editor/Editor'; -import { useState } from 'react'; - -export function PTDoc(props) { - const [text, setText] = useState(''); - - const code = { - basic: ` - setText(e.htmlValue)} - pt={{ - content: { style: { height: '320px' } }, - toolbar: { className: 'surface-ground' } - }} -/> - `, - javascript: ` -import React, { useState } from "react"; -import { Editor } from "primereact/editor"; - -export default function PTDemo() { - const [text, setText] = useState(''); - - return ( -
- setText(e.htmlValue)} - pt={{ - content: { style: { height: '320px' } }, - toolbar: { className: 'surface-ground' } - }} - /> -
- ) -} - `, - typescript: ` -import React, { useState } from "react"; -import { Editor, EditorTextChangeEvent } from "primereact/editor"; - -export default function PTDemo() { - const [text, setText] = useState(''); - - return ( -
- setText(e.htmlValue)} - pt={{ - content: { style: { height: '320px' } }, - toolbar: { className: 'surface-ground' } - }} - /> -
- ) -} - ` - }; - - return ( - <> - -
- setText(e.htmlValue)} - pt={{ - content: { style: { height: '320px' } }, - toolbar: { className: 'surface-ground' } - }} - /> -
- - - ); -} diff --git a/components/doc/fieldset/pt/ptdoc.js b/components/doc/fieldset/pt/ptdoc.js deleted file mode 100644 index f7d64e559e..0000000000 --- a/components/doc/fieldset/pt/ptdoc.js +++ /dev/null @@ -1,96 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Fieldset } from '@/components/lib/fieldset/Fieldset'; - -export function PTDoc(props) { - const code = { - basic: ` -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temporincididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrudexercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillumdolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, suntin culpa qui officia deserunt mollit anim id est laborum. -

-
- `, - javascript: ` -import React from 'react'; -import { Fieldset } from 'primereact/fieldset'; - -export default function PTDemo() { - return ( -
-
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

-
-
- ) -} - `, - typescript: ` -import React from 'react'; -import { Fieldset } from 'primereact/fieldset'; - -export default function PTDemo() { - return ( -
-
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

-
-
- ) -} - ` - }; - - return ( - <> - -
-
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

-
-
- - - ); -} diff --git a/components/doc/fileupload/pt/ptdoc.js b/components/doc/fileupload/pt/ptdoc.js deleted file mode 100644 index 5389c59d5e..0000000000 --- a/components/doc/fileupload/pt/ptdoc.js +++ /dev/null @@ -1,108 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { FileUpload } from '@/components/lib/fileupload/FileUpload'; - -export function PTDoc(props) { - const code = { - basic: ` -Drag and drop files to here to upload.

} -/> - `, - javascript: ` -import React from 'react'; -import { FileUpload } from 'primereact/fileupload'; - -export default function PTDemo() { - - return ( -
- Drag and drop files to here to upload.

} - /> -
- ) -} - `, - typescript: ` -import React from 'react'; -import { Toast } from 'primereact/toast'; -import { FileUpload } from 'primereact/fileupload'; - -export default function PTDemo() { - - return ( -
- Drag and drop files to here to upload.

} - /> -
- ) -} - ` - }; - - return ( - <> - -
- Drag and drop files to here to upload.

} - /> -
- - - ); -} diff --git a/components/doc/galleria/pt/ptdoc.js b/components/doc/galleria/pt/ptdoc.js deleted file mode 100644 index 4569135141..0000000000 --- a/components/doc/galleria/pt/ptdoc.js +++ /dev/null @@ -1,184 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Galleria } from '@/components/lib/galleria/Galleria'; -import { useEffect, useState } from 'react'; -import { PhotoService } from '../../../../service/PhotoService'; - -export function PTDoc(props) { - const [images, setImages] = useState(null); - - const responsiveOptions = [ - { - breakpoint: '991px', - numVisible: 4 - }, - { - breakpoint: '767px', - numVisible: 3 - }, - { - breakpoint: '575px', - numVisible: 1 - } - ]; - - useEffect(() => { - PhotoService.getImages().then((data) => setImages(data)); - }, []); // eslint-disable-line react-hooks/exhaustive-deps - - const itemTemplate = (item) => { - return {item.alt}; - }; - - const thumbnailTemplate = (item) => { - return {item.alt}; - }; - - const code = { - basic: ` - - `, - javascript: ` -import React, { useState, useEffect } from 'react'; -import { Galleria } from 'primereact/galleria'; -import { PhotoService } from './service/PhotoService'; - -export default function PTDemo() { - const [images, setImages] = useState(null); - const responsiveOptions = [ - { - breakpoint: '991px', - numVisible: 4 - }, - { - breakpoint: '767px', - numVisible: 3 - }, - { - breakpoint: '575px', - numVisible: 1 - } - ]; - - useEffect(() => { - PhotoService.getImages().then(data => setImages(data)); - }, []) - - const itemTemplate = (item) => { - return {item.alt} - } - - const thumbnailTemplate = (item) => { - return {item.alt} - } - - return ( -
- -
- ) -} - `, - typescript: ` -import React, { useState, useEffect } from 'react'; -import { Galleria, GalleriaResponsiveOptions } from 'primereact/galleria'; -import { PhotoService } from './service/PhotoService'; - -export default function PTDemo() { - const [images, setImages] = useState(null); - const responsiveOptions: GalleriaResponsiveOptions[] = [ - { - breakpoint: '991px', - numVisible: 4 - }, - { - breakpoint: '767px', - numVisible: 3 - }, - { - breakpoint: '575px', - numVisible: 1 - } - ]; - - useEffect(() => { - PhotoService.getImages().then(data => setImages(data)); - }, []); - - const itemTemplate = (item: any) => { - return {item.alt} - } - - const thumbnailTemplate = (item: any) => { - return {item.alt} - } - - return ( -
- -
- ) -} - `, - data: ` -/* PhotoService */ -{ - itemImageSrc: 'https://primefaces.org/cdn/primereact/images/galleria/galleria1.jpg', - thumbnailImageSrc: 'https://primefaces.org/cdn/primereact/images/galleria/galleria1s.jpg', - alt: 'Description for Image 1', - title: 'Title 1' -}, -... - ` - }; - - return ( - <> - -
- -
- - - ); -} diff --git a/components/doc/iconfield/pt/ptdoc.js b/components/doc/iconfield/pt/ptdoc.js deleted file mode 100644 index 781271232a..0000000000 --- a/components/doc/iconfield/pt/ptdoc.js +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { InputText } from '@/components/lib/inputtext/InputText'; - -export function PTDoc(props) { - return ( - <> - -

- InputText is used as a controlled input with value and onChange properties. -

-
-
- setValue(e.target.value)} - pt={{ - root: { className: 'border-primary-400' } - }} - /> -
- - - ); -} diff --git a/components/doc/image/pt/ptdoc.js b/components/doc/image/pt/ptdoc.js deleted file mode 100644 index 958e41c63a..0000000000 --- a/components/doc/image/pt/ptdoc.js +++ /dev/null @@ -1,77 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Image } from '@/components/lib/image/Image'; - -export function PTDoc(props) { - const code = { - basic: ` -Image - `, - javascript: ` -import React from 'react'; -import { Image } from 'primereact/image'; - -export default function PTDemo() { - return ( -
- Image -
- ) -} - `, - typescript: ` -import React from 'react'; -import { Image } from 'primereact/image'; - -export default function PTDemo() { - return ( -
- Image -
- ) -} - ` - }; - - return ( - <> - -
- Image -
- - - ); -} diff --git a/components/doc/inplace/pt/ptdoc.js b/components/doc/inplace/pt/ptdoc.js deleted file mode 100644 index 6f7e45121a..0000000000 --- a/components/doc/inplace/pt/ptdoc.js +++ /dev/null @@ -1,93 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Inplace, InplaceContent, InplaceDisplay } from '@/components/lib/inplace/Inplace'; - -export function PTDoc(props) { - const code = { - basic: ` - - View Content - -

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-
-
- `, - javascript: ` -import React from 'react'; -import { Inplace } from 'primereact/inplace'; - -export default function PTDemo() { - return ( -
- - View Content - -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est - laborum. -

-
-
-
- ) -} - `, - typescript: ` -import React from 'react'; -import { Inplace } from 'primereact/inplace'; - -export default function PTDemo() { - return ( -
- - View Content - -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est - laborum. -

-
-
-
- ) -} - ` - }; - - return ( - <> - -
- - View Content - -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est - laborum. -

-
-
-
- - - ); -} diff --git a/components/doc/inputmask/filleddoc.js b/components/doc/inputmask/filleddoc.js new file mode 100644 index 0000000000..0312504a88 --- /dev/null +++ b/components/doc/inputmask/filleddoc.js @@ -0,0 +1,56 @@ +import { DocSectionCode } from '@/components/doc/common/docsectioncode'; +import { DocSectionText } from '@/components/doc/common/docsectiontext'; +import { InputMask } from '@/components/lib/inputmask/InputMask'; +import { useState } from 'react'; + +export function FilledDoc(props) { + const [value, setValue] = useState(); + + const code = { + basic: ` + setValue(e.target.value)} mask="99-999999" placeholder="99-999999" /> + `, + javascript: ` +import React, { useState } from "react"; +import { InputMask } from "primereact/inputmask"; + +export default function FilledDemo() { + const [value, setValue] = useState(); + + return ( +
+ setValue(e.target.value)} mask="99-999999" placeholder="99-999999"/> +
+ ) +} + `, + typescript: ` +import React, { useState } from "react"; +import { InputMask, InputMaskChangeEvent } from "primereact/inputmask"; + +export default function FilledDemo() { + const [value, setValue] = useState(); + + return ( +
+ setValue(e.target.value)} mask="99-999999" placeholder="99-999999"/> +
+ ) +} + ` + }; + + return ( + <> + +

+ Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style. +

+
+
+ setValue(e.target.value)} mask="99-999999" placeholder="99-999999" /> +
+ + + ); +} diff --git a/components/doc/inputmask/floatlabeldoc.js b/components/doc/inputmask/floatlabeldoc.js index 9130433dab..a3a81208f9 100644 --- a/components/doc/inputmask/floatlabeldoc.js +++ b/components/doc/inputmask/floatlabeldoc.js @@ -1,6 +1,8 @@ import { DocSectionCode } from '@/components/doc/common/docsectioncode'; import { DocSectionText } from '@/components/doc/common/docsectiontext'; +import { FloatLabel } from '@/components/lib/floatlabel/FloatLabel'; import { InputMask } from '@/components/lib/inputmask/InputMask'; +import Link from 'next/link'; import { useState } from 'react'; export function FloatLabelDoc(props) { @@ -8,24 +10,25 @@ export function FloatLabelDoc(props) { const code = { basic: ` - + setValue(e.target.value)} mask="999-99-9999" /> - + `, javascript: ` import React, { useState } from "react"; import { InputMask } from "primereact/inputmask"; +import { FloatLabel } from "primereact/floatlabel"; export default function FloatLabelDemo() { const [value, setValue] = useState(); return (
- + setValue(e.target.value)} mask="999-99-9999" /> - +
) } @@ -33,16 +36,17 @@ export default function FloatLabelDemo() { typescript: ` import React, { useState } from "react"; import { InputMask, InputMaskChangeEvent } from "primereact/inputmask"; +import { FloatLabel } from "primereact/floatlabel"; export default function FloatLabelDemo() { const [value, setValue] = useState(); return (
- + setValue(e.target.value)} mask="999-99-9999" /> - +
) } @@ -52,13 +56,15 @@ export default function FloatLabelDemo() { return ( <> -

A floating label appears on top of the input field when focused.

+

+ A floating label appears on top of the input field when focused. Visit FloatLabel documentation for more information. +

- + setValue(e.target.value)} mask="999-99-9999" /> - +
diff --git a/components/doc/inputmask/form/formikdoc.js b/components/doc/inputmask/form/formikdoc.js deleted file mode 100644 index c99f9ec3b5..0000000000 --- a/components/doc/inputmask/form/formikdoc.js +++ /dev/null @@ -1,212 +0,0 @@ -import { DocSectionCode } from '@/components/doc/common/docsectioncode'; -import { DocSectionText } from '@/components/doc/common/docsectiontext'; -import { Button } from '@/components/lib/button/Button'; -import { InputMask } from '@/components/lib/inputmask/InputMask'; -import { Toast } from '@/components/lib/toast/Toast'; -import { classNames } from '@/components/lib/utils/Utils'; -import { useFormik } from 'formik'; -import { useRef } from 'react'; - -export function FormikDoc(props) { - const toast = useRef(null); - - const show = () => { - toast.current.show({ severity: 'success', summary: 'Form Submitted', detail: formik.values.value }); - }; - - const formik = useFormik({ - initialValues: { - value: '' - }, - validate: (data) => { - let errors = {}; - - if (!data.value) { - errors.value = 'Phone is required.'; - } - - return errors; - }, - onSubmit: (data) => { - data && show(data); - formik.resetForm(); - } - }); - - const isFormFieldInvalid = (name) => !!(formik.touched[name] && formik.errors[name]); - - const getFormErrorMessage = (name) => { - return isFormFieldInvalid(name) ? {formik.errors[name]} :  ; - }; - - const code = { - basic: ` - - { - formik.setFieldValue('value', e.target.value); - }} - mask="99-999999" - placeholder="99-999999" - className={classNames({ 'p-invalid': isFormFieldInvalid('value') })} -/> -{getFormErrorMessage('value')} -