Skip to content

Commit

Permalink
Fix #6379: Showcase examples use IconField (#6386)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Apr 15, 2024
1 parent 3fb2bf1 commit 4e5ea9b
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 86 deletions.
28 changes: 17 additions & 11 deletions components/doc/datatable/filter/advanceddoc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import DeferredDemo from '@/components/demo/DeferredDemo';
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import { FilterMatchMode, FilterOperator } from '@/components/lib/api/Api';
Expand All @@ -6,6 +7,8 @@ import { Calendar } from '@/components/lib/calendar/Calendar';
import { Column } from '@/components/lib/column/Column';
import { DataTable } from '@/components/lib/datatable/DataTable';
import { Dropdown } from '@/components/lib/dropdown/Dropdown';
import { IconField } from '@/components/lib/iconfield/IconField';
import { InputIcon } from '@/components/lib/inputicon/InputIcon';
import { InputNumber } from '@/components/lib/inputnumber/InputNumber';
import { InputText } from '@/components/lib/inputtext/InputText';
import { MultiSelect } from '@/components/lib/multiselect/MultiSelect';
Expand All @@ -14,9 +17,8 @@ import { Slider } from '@/components/lib/slider/Slider';
import { Tag } from '@/components/lib/tag/Tag';
import { TriStateCheckbox } from '@/components/lib/tristatecheckbox/TriStateCheckbox';
import { classNames } from '@/components/lib/utils/Utils';
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { CustomerService } from '../../../../service/CustomerService';
import DeferredDemo from '@/components/demo/DeferredDemo';

export function AdvancedFilterDoc(props) {
const [customers, setCustomers] = useState(null);
Expand Down Expand Up @@ -117,10 +119,10 @@ export function AdvancedFilterDoc(props) {
return (
<div className="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined onClick={clearFilter} />
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down Expand Up @@ -256,6 +258,8 @@ import { FilterMatchMode, FilterOperator } from 'primereact/api';
import { DataTable } from 'primereact/datatable';
import { Column } from 'primereact/column';
import { InputText } from 'primereact/inputtext';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { Dropdown } from 'primereact/dropdown';
import { InputNumber } from 'primereact/inputnumber';
import { Button } from 'primereact/button';
Expand Down Expand Up @@ -366,10 +370,10 @@ export default function AdvancedFilterDemo() {
return (
<div className="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined onClick={clearFilter} />
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down Expand Up @@ -508,6 +512,8 @@ import { FilterMatchMode, FilterOperator } from 'primereact/api';
import { DataTable, DataTableFilterMeta } from 'primereact/datatable';
import { Column, ColumnFilterElementTemplateOptions } from 'primereact/column';
import { InputText } from 'primereact/inputtext';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { Dropdown, DropdownChangeEvent } from 'primereact/dropdown';
import { InputNumber, InputNumberChangeEvent } from 'primereact/inputnumber';
import { Button } from 'primereact/button';
Expand Down Expand Up @@ -660,10 +666,10 @@ export default function AdvancedFilterDemo() {
return (
<div className="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined onClick={clearFilter} />
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down
28 changes: 17 additions & 11 deletions components/doc/datatable/filter/basicdoc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import DeferredDemo from '@/components/demo/DeferredDemo';
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import { FilterMatchMode } from '@/components/lib/api/Api';
import { Column } from '@/components/lib/column/Column';
import { DataTable } from '@/components/lib/datatable/DataTable';
import { Dropdown } from '@/components/lib/dropdown/Dropdown';
import { IconField } from '@/components/lib/iconfield/IconField';
import { InputIcon } from '@/components/lib/inputicon/InputIcon';
import { InputText } from '@/components/lib/inputtext/InputText';
import { MultiSelect } from '@/components/lib/multiselect/MultiSelect';
import { Tag } from '@/components/lib/tag/Tag';
import { TriStateCheckbox } from '@/components/lib/tristatecheckbox/TriStateCheckbox';
import { classNames } from '@/components/lib/utils/Utils';
import { useEffect, useState } from 'react';
import { useState } from 'react';
import { CustomerService } from '../../../../service/CustomerService';
import DeferredDemo from '@/components/demo/DeferredDemo';

export function BasicFilterDoc(props) {
const [customers, setCustomers] = useState(null);
Expand Down Expand Up @@ -86,10 +88,10 @@ export function BasicFilterDoc(props) {
const renderHeader = () => {
return (
<div className="flex justify-content-end">
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down Expand Up @@ -182,6 +184,8 @@ import { FilterMatchMode, FilterOperator } from 'primereact/api';
import { DataTable } from 'primereact/datatable';
import { Column } from 'primereact/column';
import { InputText } from 'primereact/inputtext';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { Dropdown } from 'primereact/dropdown';
import { MultiSelect } from 'primereact/multiselect';
import { Tag } from 'primereact/tag';
Expand Down Expand Up @@ -261,10 +265,10 @@ export default function BasicFilterDemo() {
const renderHeader = () => {
return (
<div className="flex justify-content-end">
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down Expand Up @@ -360,6 +364,8 @@ import { FilterMatchMode } from 'primereact/api';
import { DataTable, DataTableFilterMeta } from 'primereact/datatable';
import { Column, ColumnFilterElementTemplateOptions } from 'primereact/column';
import { InputText } from 'primereact/inputtext';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { Dropdown, DropdownChangeEvent } from 'primereact/dropdown';
import { MultiSelect, MultiSelectChangeEvent } from 'primereact/multiselect';
import { Tag } from 'primereact/tag';
Expand Down Expand Up @@ -464,10 +470,10 @@ export default function BasicFilterDemo() {
const renderHeader = () => {
return (
<div className="flex justify-content-end">
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down
24 changes: 15 additions & 9 deletions components/doc/datatable/filter/customdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { FilterMatchMode, FilterService } from '@/components/lib/api/Api';
import { Column } from '@/components/lib/column/Column';
import { DataTable } from '@/components/lib/datatable/DataTable';
import { Dropdown } from '@/components/lib/dropdown/Dropdown';
import { IconField } from '@/components/lib/iconfield/IconField';
import { InputIcon } from '@/components/lib/inputicon/InputIcon';
import { InputNumber } from '@/components/lib/inputnumber/InputNumber';
import { InputText } from '@/components/lib/inputtext/InputText';
import { MultiSelect } from '@/components/lib/multiselect/MultiSelect';
Expand Down Expand Up @@ -108,10 +110,10 @@ export function CustomFilterDoc(props) {
const renderHeader = () => {
return (
<div className="flex justify-content-end">
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down Expand Up @@ -225,6 +227,8 @@ import { FilterMatchMode, FilterService } from 'primereact/api';
import { DataTable, DataTableFilterMeta } from 'primereact/datatable';
import { Column, ColumnFilterElementTemplateOptions } from 'primereact/column';
import { InputText } from 'primereact/inputtext';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { Dropdown, DropdownChangeEvent } from 'primereact/dropdown';
import { MultiSelect, MultiSelectChangeEvent } from 'primereact/multiselect';
import { Tag } from 'primereact/tag';
Expand Down Expand Up @@ -316,10 +320,10 @@ export default function CustomFilterDemo() {
const renderHeader = () => {
return (
<div className="flex justify-content-end">
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down Expand Up @@ -426,6 +430,8 @@ import { FilterMatchMode, FilterService } from 'primereact/api';
import { DataTable, DataTableFilterMeta } from 'primereact/datatable';
import { Column, ColumnFilterElementTemplateOptions } from 'primereact/column';
import { InputText } from 'primereact/inputtext';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { Dropdown, DropdownChangeEvent } from 'primereact/dropdown';
import { MultiSelect, MultiSelectChangeEvent } from 'primereact/multiselect';
import { Tag } from 'primereact/tag';
Expand Down Expand Up @@ -542,10 +548,10 @@ export default function CustomFilterDemo() {
const renderHeader = () => {
return (
<div className="flex justify-content-end">
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down
28 changes: 17 additions & 11 deletions components/doc/datatable/samples/customersdoc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import DeferredDemo from '@/components/demo/DeferredDemo';
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import { FilterMatchMode, FilterOperator } from '@/components/lib/api/Api';
Expand All @@ -6,15 +7,16 @@ import { Calendar } from '@/components/lib/calendar/Calendar';
import { Column } from '@/components/lib/column/Column';
import { DataTable } from '@/components/lib/datatable/DataTable';
import { Dropdown } from '@/components/lib/dropdown/Dropdown';
import { IconField } from '@/components/lib/iconfield/IconField';
import { InputIcon } from '@/components/lib/inputicon/InputIcon';
import { InputNumber } from '@/components/lib/inputnumber/InputNumber';
import { InputText } from '@/components/lib/inputtext/InputText';
import { MultiSelect } from '@/components/lib/multiselect/MultiSelect';
import { ProgressBar } from '@/components/lib/progressbar/ProgressBar';
import { Slider } from '@/components/lib/slider/Slider';
import { Tag } from '@/components/lib/tag/Tag';
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { CustomerService } from '../../../../service/CustomerService';
import DeferredDemo from '@/components/demo/DeferredDemo';

export const CustomersDoc = (props) => {
const [customers, setCustomers] = useState([]);
Expand Down Expand Up @@ -101,10 +103,10 @@ export const CustomersDoc = (props) => {
return (
<div className="flex flex-wrap gap-2 justify-content-between align-items-center">
<h4 className="m-0">Customers</h4>
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down Expand Up @@ -222,6 +224,8 @@ import { FilterMatchMode, FilterOperator } from 'primereact/api';
import { DataTable } from 'primereact/datatable';
import { Column } from 'primereact/column';
import { InputText } from 'primereact/inputtext';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { Dropdown } from 'primereact/dropdown';
import { InputNumber } from 'primereact/inputnumber';
import { Button } from 'primereact/button';
Expand Down Expand Up @@ -317,10 +321,10 @@ export default function CustomersDemo() {
return (
<div className="flex flex-wrap gap-2 justify-content-between align-items-center">
<h4 className="m-0">Customers</h4>
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down Expand Up @@ -441,6 +445,8 @@ import { FilterMatchMode, FilterOperator } from 'primereact/api';
import { DataTable, DataTableFilterMeta } from 'primereact/datatable';
import { Column, ColumnFilterElementTemplateOptions } from 'primereact/column';
import { InputText } from 'primereact/inputtext';
import { IconField } from 'primereact/iconfield';
import { InputIcon } from 'primereact/inputicon';
import { Dropdown, DropdownChangeEvent } from 'primereact/dropdown';
import { InputNumber, InputNumberValueChangeEvent } from 'primereact/inputnumber';
import { Button } from 'primereact/button';
Expand Down Expand Up @@ -559,10 +565,10 @@ export default function CustomersDemo() {
return (
<div className="flex flex-wrap gap-2 justify-content-between align-items-center">
<h4 className="m-0">Customers</h4>
<span className="p-input-icon-left">
<i className="pi pi-search" />
<IconField iconPosition="left">
<InputIcon className="pi pi-search" />
<InputText value={globalFilterValue} onChange={onGlobalFilterChange} placeholder="Keyword Search" />
</span>
</IconField>
</div>
);
};
Expand Down
Loading

0 comments on commit 4e5ea9b

Please sign in to comment.