@primereact/mcp 11.1.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/llms/headless/components/accordion/api.json +9 -9
- package/data/llms/headless/components/animateonscroll/api.json +2 -2
- package/data/llms/headless/components/autocomplete/api.json +33 -33
- package/data/llms/headless/components/avatar/api.json +1 -1
- package/data/llms/headless/components/carousel/api.json +15 -15
- package/data/llms/headless/components/checkbox/api.json +18 -18
- package/data/llms/headless/components/collapsible/api.json +14 -14
- package/data/llms/headless/components/compare/api.json +3 -3
- package/data/llms/headless/components/contextmenu/api.json +2 -2
- package/data/llms/headless/components/datatable/api.json +19 -19
- package/data/llms/headless/components/dataview/api.json +3 -3
- package/data/llms/headless/components/datepicker/api.json +43 -43
- package/data/llms/headless/components/dialog/api.json +19 -19
- package/data/llms/headless/components/divider/api.json +3 -3
- package/data/llms/headless/components/drawer/api.json +13 -13
- package/data/llms/headless/components/fieldset/api.json +9 -9
- package/data/llms/headless/components/fileupload/api.json +5 -5
- package/data/llms/headless/components/focustrap/api.json +4 -4
- package/data/llms/headless/components/gallery/api.json +23 -23
- package/data/llms/headless/components/inplace/api.json +3 -3
- package/data/llms/headless/components/inputcolor/api.json +6 -6
- package/data/llms/headless/components/inputcolor.md +0 -1
- package/data/llms/headless/components/inputnumber/api.json +8 -8
- package/data/llms/headless/components/inputotp/api.json +7 -7
- package/data/llms/headless/components/inputpassword/api.json +4 -4
- package/data/llms/headless/components/inputpassword.md +3 -3
- package/data/llms/headless/components/inputtags/api.json +8 -8
- package/data/llms/headless/components/inputtext/api.json +1 -1
- package/data/llms/headless/components/knob/api.json +18 -18
- package/data/llms/headless/components/listbox/api.json +27 -27
- package/data/llms/headless/components/menu/api.json +10 -10
- package/data/llms/headless/components/message/api.json +1 -1
- package/data/llms/headless/components/metergroup/api.json +3 -3
- package/data/llms/headless/components/motion/api.json +1 -1
- package/data/llms/headless/components/navigationmenu/api.json +5 -5
- package/data/llms/headless/components/orderlist/api.json +5 -5
- package/data/llms/headless/components/organizationchart/api.json +6 -6
- package/data/llms/headless/components/paginator/api.json +5 -5
- package/data/llms/headless/components/panel/api.json +9 -9
- package/data/llms/headless/components/picklist/api.json +5 -5
- package/data/llms/headless/components/popover/api.json +16 -16
- package/data/llms/headless/components/positioner/api.json +7 -7
- package/data/llms/headless/components/progressbar/api.json +3 -3
- package/data/llms/headless/components/progressspinner/api.json +3 -3
- package/data/llms/headless/components/radiobutton/api.json +16 -16
- package/data/llms/headless/components/rating/api.json +5 -5
- package/data/llms/headless/components/scrollarea/api.json +6 -6
- package/data/llms/headless/components/select/api.json +34 -34
- package/data/llms/headless/components/sidebar/api.json +60 -60
- package/data/llms/headless/components/sidebar.md +4 -2
- package/data/llms/headless/components/slider/api.json +3 -3
- package/data/llms/headless/components/speeddial/api.json +4 -4
- package/data/llms/headless/components/splitter/api.json +5 -5
- package/data/llms/headless/components/stepper/api.json +13 -13
- package/data/llms/headless/components/styleclass/api.json +1 -1
- package/data/llms/headless/components/tabs/api.json +17 -17
- package/data/llms/headless/components/terminal/api.json +1 -1
- package/data/llms/headless/components/toast/api.json +4 -4
- package/data/llms/headless/components/togglebutton/api.json +27 -3
- package/data/llms/headless/components/toggleswitch/api.json +3 -3
- package/data/llms/headless/components/tooltip/api.json +17 -17
- package/data/llms/headless/components/tree/api.json +20 -20
- package/data/llms/headless/components/tree.md +1 -0
- package/data/llms/headless/components/treetable/api.json +19 -19
- package/data/llms/hooks/use-filter.md +2 -2
- package/data/llms/hooks/use-tree-filter.md +3 -1
- package/data/llms/llms-full.txt +485 -229
- package/data/llms/primitive/components/accordion/api.json +39 -39
- package/data/llms/primitive/components/animateonscroll/api.json +5 -5
- package/data/llms/primitive/components/autocomplete/api.json +105 -105
- package/data/llms/primitive/components/avatar/api.json +14 -14
- package/data/llms/primitive/components/badge/api.json +6 -6
- package/data/llms/primitive/components/breadcrumb/api.json +27 -27
- package/data/llms/primitive/components/button/api.json +8 -8
- package/data/llms/primitive/components/buttongroup/api.json +3 -3
- package/data/llms/primitive/components/card/api.json +24 -24
- package/data/llms/primitive/components/carousel/api.json +28 -28
- package/data/llms/primitive/components/checkbox/api.json +14 -14
- package/data/llms/primitive/components/checkboxgroup/api.json +5 -5
- package/data/llms/primitive/components/chip/api.json +19 -19
- package/data/llms/primitive/components/collapsible/api.json +18 -18
- package/data/llms/primitive/components/compare/api.json +18 -18
- package/data/llms/primitive/components/contextmenu/api.json +150 -1141
- package/data/llms/primitive/components/datatable/api.json +215 -164
- package/data/llms/primitive/components/dataview/api.json +17 -17
- package/data/llms/primitive/components/datepicker/api.json +230 -230
- package/data/llms/primitive/components/dialog/api.json +63 -63
- package/data/llms/primitive/components/divider/api.json +3 -3
- package/data/llms/primitive/components/drawer/api.json +47 -47
- package/data/llms/primitive/components/fieldset/api.json +31 -31
- package/data/llms/primitive/components/fileupload/api.json +53 -53
- package/data/llms/primitive/components/floatlabel/api.json +3 -3
- package/data/llms/primitive/components/focustrap/api.json +7 -7
- package/data/llms/primitive/components/gallery/api.json +91 -91
- package/data/llms/primitive/components/iconfield/api.json +7 -7
- package/data/llms/primitive/components/iftalabel/api.json +3 -3
- package/data/llms/primitive/components/inplace/api.json +18 -18
- package/data/llms/primitive/components/inputcolor/api.json +51 -51
- package/data/llms/primitive/components/inputnumber/api.json +10 -10
- package/data/llms/primitive/components/inputotp/api.json +12 -12
- package/data/llms/primitive/components/inputpassword/api.json +7 -7
- package/data/llms/primitive/components/inputtags/api.json +6 -6
- package/data/llms/primitive/components/inputtext/api.json +4 -4
- package/data/llms/primitive/components/knob/api.json +19 -19
- package/data/llms/primitive/components/label/api.json +3 -3
- package/data/llms/primitive/components/listbox/api.json +57 -57
- package/data/llms/primitive/components/menu/api.json +87 -279
- package/data/llms/primitive/components/message/api.json +22 -22
- package/data/llms/primitive/components/metergroup/api.json +27 -27
- package/data/llms/primitive/components/navigationmenu/api.json +8 -8
- package/data/llms/primitive/components/paginator/api.json +43 -43
- package/data/llms/primitive/components/panel/api.json +34 -34
- package/data/llms/primitive/components/popover/api.json +67 -67
- package/data/llms/primitive/components/portal/api.json +4 -4
- package/data/llms/primitive/components/progressbar/api.json +22 -22
- package/data/llms/primitive/components/progressspinner/api.json +18 -18
- package/data/llms/primitive/components/radiobutton/api.json +16 -16
- package/data/llms/primitive/components/rating/api.json +20 -20
- package/data/llms/primitive/components/scrollarea/api.json +23 -23
- package/data/llms/primitive/components/select/api.json +95 -95
- package/data/llms/primitive/components/sidebar/api.json +88 -88
- package/data/llms/primitive/components/sidebar.md +2 -1
- package/data/llms/primitive/components/skeleton/api.json +3 -3
- package/data/llms/primitive/components/slider/api.json +22 -22
- package/data/llms/primitive/components/speeddial/api.json +22 -22
- package/data/llms/primitive/components/splitter/api.json +18 -18
- package/data/llms/primitive/components/stepper/api.json +64 -64
- package/data/llms/primitive/components/tabs/api.json +51 -51
- package/data/llms/primitive/components/tag/api.json +3 -3
- package/data/llms/primitive/components/terminal/api.json +44 -44
- package/data/llms/primitive/components/textarea/api.json +4 -4
- package/data/llms/primitive/components/timeline/api.json +27 -27
- package/data/llms/primitive/components/toast/api.json +48 -48
- package/data/llms/primitive/components/togglebutton/api.json +10 -10
- package/data/llms/primitive/components/togglebuttongroup/api.json +5 -5
- package/data/llms/primitive/components/toggleswitch/api.json +12 -12
- package/data/llms/primitive/components/toolbar/api.json +15 -15
- package/data/llms/primitive/components/tooltip/api.json +52 -52
- package/data/llms/primitive/components/tree/api.json +73 -73
- package/data/llms/primitive/components/visuallyhidden/api.json +3 -3
- package/data/llms/primitive/guides/migration/updating-to-v11.md +2 -2
- package/data/llms/styled/add-ons/designer/ci.md +7 -7
- package/data/llms/styled/add-ons/uikit/guide/v3.md +1 -0
- package/data/llms/styled/components/button/api.json +8 -8
- package/data/llms/styled/components/carousel.md +65 -0
- package/data/llms/styled/components/datatable.md +94 -84
- package/data/llms/styled/components/floatlabel/api.json +3 -3
- package/data/llms/styled/components/fluid/api.json +3 -3
- package/data/llms/styled/components/iconfield/api.json +7 -7
- package/data/llms/styled/components/iftalabel/api.json +3 -3
- package/data/llms/styled/components/inputcolor.md +3 -0
- package/data/llms/styled/components/inputgroup/api.json +7 -7
- package/data/llms/styled/components/label/api.json +3 -3
- package/data/llms/styled/components/organizationchart/api.json +33 -33
- package/data/llms/styled/components/rating/api.json +11 -11
- package/data/llms/styled/components/select.md +6 -0
- package/data/llms/styled/components/sidebar.md +12 -8
- package/data/llms/styled/components/tree.md +5 -0
- package/data/llms/styled/components/treetable.md +171 -62
- package/data/llms/styled/guides/configuration.md +25 -0
- package/data/llms/styled/guides/migration/updating-to-v11.md +2 -2
- package/data/llms/styled/guides/theming/tailwind.md +25 -0
- package/data/llms/tailwind/components/button/api.json +8 -8
- package/data/llms/tailwind/components/datatable.md +33 -42
- package/data/llms/tailwind/components/inputgroup.md +0 -1
- package/data/llms/tailwind/components/select.md +3 -0
- package/data/llms/tailwind/components/sidebar.md +16 -11
- package/data/manifest.json +773 -778
- package/data/mcp-data.json +5 -29
- package/dist/index.d.ts +7 -2
- package/dist/index.js +1 -1
- package/package.json +9 -8
- package/data/llms/headless/guides/misc/locale.md +0 -280
- package/data/llms/primitive/guides/misc/locale.md +0 -280
- package/data/llms/styled/guides/installation/configuration.md +0 -135
- package/data/llms/styled/guides/misc/locale.md +0 -280
- package/data/llms/tailwind/guides/misc/locale.md +0 -280
- package/data/llms/tailwind/guides/theming/guide.md +0 -179
package/data/llms/llms-full.txt
CHANGED
|
@@ -4975,7 +4975,6 @@ function ChannelSlider({
|
|
|
4975
4975
|
const { style, ...sliderOptions } = getSliderProps({ channel });
|
|
4976
4976
|
const slider = useSlider(sliderOptions);
|
|
4977
4977
|
const values = slider.range() ? (slider.state.value as number[]) : [slider.state.value as number];
|
|
4978
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4979
4978
|
const { style: _trackStyle, ...trackRest } = slider.trackProps;
|
|
4980
4979
|
const { style: rootStyle, ...rootRest } = slider.rootProps;
|
|
4981
4980
|
|
|
@@ -5620,16 +5619,16 @@ const { rootProps, toggleMask, state } = useInputPassword();
|
|
|
5620
5619
|
|
|
5621
5620
|
## Styling with data attributes
|
|
5622
5621
|
|
|
5623
|
-
The root input includes `data-scope="
|
|
5622
|
+
The root input includes `data-scope="inputpassword"` and `data-part="root"` for styling.
|
|
5624
5623
|
|
|
5625
5624
|
```css
|
|
5626
|
-
[data-scope='
|
|
5625
|
+
[data-scope='inputpassword'][data-part='root'] {
|
|
5627
5626
|
padding: 0.5rem;
|
|
5628
5627
|
border: 1px solid #ccc;
|
|
5629
5628
|
border-radius: 0.25rem;
|
|
5630
5629
|
}
|
|
5631
5630
|
|
|
5632
|
-
[data-scope='
|
|
5631
|
+
[data-scope='inputpassword'][data-part='root']:focus {
|
|
5633
5632
|
border-color: var(--p-primary-color);
|
|
5634
5633
|
outline: none;
|
|
5635
5634
|
}
|
|
@@ -10115,8 +10114,10 @@ Headless hooks for managing sidebar state, collapse behavior, layout coordinatio
|
|
|
10115
10114
|
'use client';
|
|
10116
10115
|
import { Bell, ChartBar, ChevronDown, Folder, Home, Inbox, Search, Users } from '@primeicons/react';
|
|
10117
10116
|
import { useSidebar, useSidebarLayout, useSidebarMenuItem } from '@primereact/headless/sidebar';
|
|
10117
|
+
import type { UseSidebarLayoutExposes } from '@primereact/headless/sidebar';
|
|
10118
10118
|
import * as React from 'react';
|
|
10119
10119
|
import styles from './basic-demo.module.css';
|
|
10120
|
+
import type { IconProps } from '@primeicons/react/core';
|
|
10120
10121
|
|
|
10121
10122
|
const navItems = [
|
|
10122
10123
|
{ icon: Home, label: 'Home', isActive: true },
|
|
@@ -10137,7 +10138,7 @@ function CollapsibleMenuItem({
|
|
|
10137
10138
|
subItems,
|
|
10138
10139
|
isOpen
|
|
10139
10140
|
}: {
|
|
10140
|
-
icon: React.FC<
|
|
10141
|
+
icon: React.FC<IconProps>;
|
|
10141
10142
|
label: string;
|
|
10142
10143
|
subItems: { label: string; isActive?: boolean }[];
|
|
10143
10144
|
isOpen: boolean;
|
|
@@ -10166,7 +10167,7 @@ function CollapsibleMenuItem({
|
|
|
10166
10167
|
);
|
|
10167
10168
|
}
|
|
10168
10169
|
|
|
10169
|
-
function SidebarContent({ layout }: { layout:
|
|
10170
|
+
function SidebarContent({ layout }: { layout: UseSidebarLayoutExposes }) {
|
|
10170
10171
|
const { rootProps, state, toggle } = useSidebar({ id: 'main', layout, defaultOpen: true, collapsible: 'icon' });
|
|
10171
10172
|
|
|
10172
10173
|
return (
|
|
@@ -12994,6 +12995,7 @@ export default function BasicDemo() {
|
|
|
12994
12995
|
<ul {...getNodesProps()} className="m-0 p-0 list-none">
|
|
12995
12996
|
{visibleKeys.map((key) => {
|
|
12996
12997
|
const node = findNodeByKey(key);
|
|
12998
|
+
|
|
12997
12999
|
if (!node) return null;
|
|
12998
13000
|
|
|
12999
13001
|
const info = findNodeInfo(key);
|
|
@@ -24169,9 +24171,10 @@ An unstyled layout component for building application navigation with collapsibl
|
|
|
24169
24171
|
'use client';
|
|
24170
24172
|
import { Bell, Calendar, ChartBar, CreditCard, EllipsisV, Folder, Home, Inbox, Search, ShoppingCart, Star, Users } from '@primeicons/react';
|
|
24171
24173
|
import { Sidebar } from 'primereact/sidebar';
|
|
24174
|
+
import type { IconProps } from '@primeicons/react/core';
|
|
24172
24175
|
|
|
24173
24176
|
type NavItem = {
|
|
24174
|
-
icon: React.FC<
|
|
24177
|
+
icon: React.FC<IconProps>;
|
|
24175
24178
|
label: string;
|
|
24176
24179
|
isActive?: boolean;
|
|
24177
24180
|
badge?: string;
|
|
@@ -33632,6 +33635,71 @@ function GalleryDemo() {
|
|
|
33632
33635
|
export default GalleryDemo;
|
|
33633
33636
|
```
|
|
33634
33637
|
|
|
33638
|
+
### Dynamic
|
|
33639
|
+
|
|
33640
|
+
Items can be added or removed at runtime. The carousel observes its content and recalculates the snap points, keeping the indicators and navigation in sync.
|
|
33641
|
+
|
|
33642
|
+
```tsx
|
|
33643
|
+
'use client';
|
|
33644
|
+
import { ChevronLeft } from '@primeicons/react/chevron-left';
|
|
33645
|
+
import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
33646
|
+
import { Minus } from '@primeicons/react/minus';
|
|
33647
|
+
import { Plus } from '@primeicons/react/plus';
|
|
33648
|
+
import { Button } from '@primereact/ui/button';
|
|
33649
|
+
import { Carousel } from '@primereact/ui/carousel';
|
|
33650
|
+
import * as React from 'react';
|
|
33651
|
+
|
|
33652
|
+
function DynamicDemo() {
|
|
33653
|
+
const [items, setItems] = React.useState(() => [1, 2, 3]);
|
|
33654
|
+
|
|
33655
|
+
const addItem = () => {
|
|
33656
|
+
setItems((prev) => [...prev, (prev[prev.length - 1] ?? 0) + 1]);
|
|
33657
|
+
};
|
|
33658
|
+
|
|
33659
|
+
const removeItem = () => {
|
|
33660
|
+
setItems((prev) => prev.slice(0, -1));
|
|
33661
|
+
};
|
|
33662
|
+
|
|
33663
|
+
return (
|
|
33664
|
+
<div className="mt-8 mb-16">
|
|
33665
|
+
<div className="flex items-center justify-center gap-2 mb-6">
|
|
33666
|
+
<Button size="small" severity="secondary" onClick={removeItem} disabled={items.length === 0} aria-label="Remove last item">
|
|
33667
|
+
<Minus />
|
|
33668
|
+
</Button>
|
|
33669
|
+
<span className="w-24 text-center text-sm text-muted-color">{items.length} items</span>
|
|
33670
|
+
<Button size="small" severity="secondary" onClick={addItem} aria-label="Add item">
|
|
33671
|
+
<Plus />
|
|
33672
|
+
</Button>
|
|
33673
|
+
</div>
|
|
33674
|
+
<Carousel.Root className="max-w-xl mx-auto" align="center" slidesPerPage={2.25} spacing={16}>
|
|
33675
|
+
<Carousel.Content className="h-50">
|
|
33676
|
+
{items.map((item) => (
|
|
33677
|
+
<Carousel.Item key={item}>
|
|
33678
|
+
<div className="h-full text-4xl font-semibold bg-surface-50 dark:bg-surface-950 text-surface-950 dark:text-surface-0 flex items-center justify-center rounded-xl border border-surface">
|
|
33679
|
+
<span>{item}</span>
|
|
33680
|
+
</div>
|
|
33681
|
+
</Carousel.Item>
|
|
33682
|
+
))}
|
|
33683
|
+
</Carousel.Content>
|
|
33684
|
+
<div className="flex mt-4 gap-4">
|
|
33685
|
+
<Carousel.Indicators />
|
|
33686
|
+
<div className="flex items-center justify-end gap-2 flex-1">
|
|
33687
|
+
<Carousel.Prev as={Button} size="small" severity="secondary" iconOnly>
|
|
33688
|
+
<ChevronLeft />
|
|
33689
|
+
</Carousel.Prev>
|
|
33690
|
+
<Carousel.Next as={Button} size="small" severity="secondary" iconOnly>
|
|
33691
|
+
<ChevronRight />
|
|
33692
|
+
</Carousel.Next>
|
|
33693
|
+
</div>
|
|
33694
|
+
</div>
|
|
33695
|
+
</Carousel.Root>
|
|
33696
|
+
</div>
|
|
33697
|
+
);
|
|
33698
|
+
}
|
|
33699
|
+
|
|
33700
|
+
export default DynamicDemo;
|
|
33701
|
+
```
|
|
33702
|
+
|
|
33635
33703
|
## Related
|
|
33636
33704
|
|
|
33637
33705
|
### Sub-Components
|
|
@@ -35544,7 +35612,7 @@ export default function Preview() {
|
|
|
35544
35612
|
</DataTable.THeadRow>
|
|
35545
35613
|
</DataTable.THead>
|
|
35546
35614
|
<DataTable.TBody>
|
|
35547
|
-
{({ item }: { item:
|
|
35615
|
+
{({ item }: { item: Product }) => (
|
|
35548
35616
|
<DataTable.Row key={item.id}>
|
|
35549
35617
|
<DataTable.Cell>
|
|
35550
35618
|
<div className="flex items-center gap-3">
|
|
@@ -35678,7 +35746,7 @@ export default function BasicDemo() {
|
|
|
35678
35746
|
</DataTable.THeadRow>
|
|
35679
35747
|
</DataTable.THead>
|
|
35680
35748
|
<DataTable.TBody>
|
|
35681
|
-
{({ item }: { item:
|
|
35749
|
+
{({ item }: { item: Product }) => (
|
|
35682
35750
|
<DataTable.Row key={item.id}>
|
|
35683
35751
|
<DataTable.Cell>{item.code}</DataTable.Cell>
|
|
35684
35752
|
<DataTable.Cell>{item.name}</DataTable.Cell>
|
|
@@ -35778,7 +35846,7 @@ export default function SizeDemo() {
|
|
|
35778
35846
|
</DataTable.THeadRow>
|
|
35779
35847
|
</DataTable.THead>
|
|
35780
35848
|
<DataTable.TBody>
|
|
35781
|
-
{({ item }: { item:
|
|
35849
|
+
{({ item }: { item: Customer }) => (
|
|
35782
35850
|
<DataTable.Row key={item.id}>
|
|
35783
35851
|
<DataTable.Cell>
|
|
35784
35852
|
<span className="font-medium">{item.name}</span>
|
|
@@ -35895,7 +35963,7 @@ export default function GridlinesDemo() {
|
|
|
35895
35963
|
</DataTable.THeadRow>
|
|
35896
35964
|
</DataTable.THead>
|
|
35897
35965
|
<DataTable.TBody>
|
|
35898
|
-
{({ item }: { item:
|
|
35966
|
+
{({ item }: { item: Customer }) => (
|
|
35899
35967
|
<DataTable.Row key={item.id}>
|
|
35900
35968
|
<DataTable.Cell>
|
|
35901
35969
|
<span className="font-medium">{item.name}</span>
|
|
@@ -36012,7 +36080,7 @@ export default function StripedRowsDemo() {
|
|
|
36012
36080
|
</DataTable.THeadRow>
|
|
36013
36081
|
</DataTable.THead>
|
|
36014
36082
|
<DataTable.TBody>
|
|
36015
|
-
{({ item }: { item:
|
|
36083
|
+
{({ item }: { item: Customer }) => (
|
|
36016
36084
|
<DataTable.Row key={item.id}>
|
|
36017
36085
|
<DataTable.Cell>
|
|
36018
36086
|
<span className="font-medium">{item.name}</span>
|
|
@@ -36145,7 +36213,7 @@ export default function SingleSelectionDemo() {
|
|
|
36145
36213
|
</DataTable.THeadRow>
|
|
36146
36214
|
</DataTable.THead>
|
|
36147
36215
|
<DataTable.TBody>
|
|
36148
|
-
{({ item }: { item:
|
|
36216
|
+
{({ item }: { item: Product }) => (
|
|
36149
36217
|
<DataTable.Row key={item.id}>
|
|
36150
36218
|
<DataTable.Cell>
|
|
36151
36219
|
<div className="flex items-center gap-3">
|
|
@@ -36303,7 +36371,7 @@ export default function MultipleSelectionDemo() {
|
|
|
36303
36371
|
</DataTable.THeadRow>
|
|
36304
36372
|
</DataTable.THead>
|
|
36305
36373
|
<DataTable.TBody>
|
|
36306
|
-
{({ item }: { item:
|
|
36374
|
+
{({ item }: { item: Product }) => (
|
|
36307
36375
|
<DataTable.Row key={item.id}>
|
|
36308
36376
|
<DataTable.Cell>
|
|
36309
36377
|
<div className="flex items-center gap-3">
|
|
@@ -36462,7 +36530,7 @@ export default function CheckboxSelectionDemo() {
|
|
|
36462
36530
|
</DataTable.THeadRow>
|
|
36463
36531
|
</DataTable.THead>
|
|
36464
36532
|
<DataTable.TBody>
|
|
36465
|
-
{({ item }: { item:
|
|
36533
|
+
{({ item }: { item: Customer }) => (
|
|
36466
36534
|
<DataTable.Row key={item.id}>
|
|
36467
36535
|
<DataTable.Cell>
|
|
36468
36536
|
<DataTable.Selection>
|
|
@@ -36624,7 +36692,7 @@ export default function RadioSelectionDemo() {
|
|
|
36624
36692
|
</DataTable.THeadRow>
|
|
36625
36693
|
</DataTable.THead>
|
|
36626
36694
|
<DataTable.TBody>
|
|
36627
|
-
{({ item }: { item:
|
|
36695
|
+
{({ item }: { item: Customer }) => (
|
|
36628
36696
|
<DataTable.Row key={item.id}>
|
|
36629
36697
|
<DataTable.Cell>
|
|
36630
36698
|
<DataTable.Selection mode="radio">
|
|
@@ -36778,7 +36846,7 @@ export default function KeyboardDemo() {
|
|
|
36778
36846
|
</DataTable.THeadRow>
|
|
36779
36847
|
</DataTable.THead>
|
|
36780
36848
|
<DataTable.TBody>
|
|
36781
|
-
{({ item }: { item:
|
|
36849
|
+
{({ item }: { item: Product }) => (
|
|
36782
36850
|
<DataTable.Row key={item.id}>
|
|
36783
36851
|
<DataTable.Cell>
|
|
36784
36852
|
<div className="flex items-center gap-3">
|
|
@@ -36949,7 +37017,7 @@ export default function SortDemo() {
|
|
|
36949
37017
|
</DataTable.THeadRow>
|
|
36950
37018
|
</DataTable.THead>
|
|
36951
37019
|
<DataTable.TBody>
|
|
36952
|
-
{({ item }: { item:
|
|
37020
|
+
{({ item }: { item: Product }) => (
|
|
36953
37021
|
<DataTable.Row key={item.id}>
|
|
36954
37022
|
<DataTable.Cell>
|
|
36955
37023
|
<div className="flex items-center gap-3">
|
|
@@ -37105,7 +37173,7 @@ export default function MultiSortDemo() {
|
|
|
37105
37173
|
</DataTable.THeadRow>
|
|
37106
37174
|
</DataTable.THead>
|
|
37107
37175
|
<DataTable.TBody>
|
|
37108
|
-
{({ item }: { item:
|
|
37176
|
+
{({ item }: { item: Product }) => (
|
|
37109
37177
|
<DataTable.Row key={item.id}>
|
|
37110
37178
|
<DataTable.Cell>
|
|
37111
37179
|
<div className="flex items-center gap-3">
|
|
@@ -37267,7 +37335,7 @@ export default function PresortDemo() {
|
|
|
37267
37335
|
</DataTable.THeadRow>
|
|
37268
37336
|
</DataTable.THead>
|
|
37269
37337
|
<DataTable.TBody>
|
|
37270
|
-
{({ item }: { item:
|
|
37338
|
+
{({ item }: { item: Product }) => (
|
|
37271
37339
|
<DataTable.Row key={item.id}>
|
|
37272
37340
|
<DataTable.Cell>
|
|
37273
37341
|
<div className="flex items-center gap-3">
|
|
@@ -37442,7 +37510,7 @@ export default function PresortMultiDemo() {
|
|
|
37442
37510
|
</DataTable.THeadRow>
|
|
37443
37511
|
</DataTable.THead>
|
|
37444
37512
|
<DataTable.TBody>
|
|
37445
|
-
{({ item }: { item:
|
|
37513
|
+
{({ item }: { item: Product }) => (
|
|
37446
37514
|
<DataTable.Row key={item.id}>
|
|
37447
37515
|
<DataTable.Cell>
|
|
37448
37516
|
<div className="flex items-center gap-3">
|
|
@@ -37565,7 +37633,7 @@ export default function PaginationDemo() {
|
|
|
37565
37633
|
</DataTable.THeadRow>
|
|
37566
37634
|
</DataTable.THead>
|
|
37567
37635
|
<DataTable.TBody>
|
|
37568
|
-
{({ item }: { item:
|
|
37636
|
+
{({ item }: { item: Product }) => (
|
|
37569
37637
|
<DataTable.Row key={item.id}>
|
|
37570
37638
|
<DataTable.Cell>
|
|
37571
37639
|
<div className="flex items-center gap-3">
|
|
@@ -37722,7 +37790,7 @@ export default function ScrollVerticalDemo() {
|
|
|
37722
37790
|
</DataTable.THeadRow>
|
|
37723
37791
|
</DataTable.THead>
|
|
37724
37792
|
<DataTable.TBody>
|
|
37725
|
-
{({ item }: { item:
|
|
37793
|
+
{({ item }: { item: Customer }) => (
|
|
37726
37794
|
<DataTable.Row key={item.id}>
|
|
37727
37795
|
<DataTable.Cell>
|
|
37728
37796
|
<span className="font-medium">{item.name}</span>
|
|
@@ -37846,7 +37914,7 @@ export default function ScrollHorizontalDemo() {
|
|
|
37846
37914
|
</DataTable.THeadRow>
|
|
37847
37915
|
</DataTable.THead>
|
|
37848
37916
|
<DataTable.TBody>
|
|
37849
|
-
{({ item }: { item:
|
|
37917
|
+
{({ item }: { item: Customer }) => (
|
|
37850
37918
|
<DataTable.Row key={item.id}>
|
|
37851
37919
|
<DataTable.Cell>{item.id}</DataTable.Cell>
|
|
37852
37920
|
<DataTable.Cell>
|
|
@@ -37962,7 +38030,7 @@ export default function ScrollFlexDemo() {
|
|
|
37962
38030
|
</DataTable.THeadRow>
|
|
37963
38031
|
</DataTable.THead>
|
|
37964
38032
|
<DataTable.TBody>
|
|
37965
|
-
{({ item }: { item:
|
|
38033
|
+
{({ item }: { item: Customer }) => (
|
|
37966
38034
|
<DataTable.Row key={item.id}>
|
|
37967
38035
|
<DataTable.Cell>
|
|
37968
38036
|
<span className="font-medium">{item.name}</span>
|
|
@@ -38089,7 +38157,7 @@ export default function ScrollFrozenColumnsDemo() {
|
|
|
38089
38157
|
</DataTable.THeadRow>
|
|
38090
38158
|
</DataTable.THead>
|
|
38091
38159
|
<DataTable.TBody>
|
|
38092
|
-
{({ item }: { item:
|
|
38160
|
+
{({ item }: { item: Customer }) => (
|
|
38093
38161
|
<DataTable.Row key={String(item.id)}>
|
|
38094
38162
|
<DataTable.Cell frozen>
|
|
38095
38163
|
<span className="font-semibold">{String(item.name)}</span>
|
|
@@ -38205,7 +38273,7 @@ export default function ScrollFrozenColumnsMultiDemo() {
|
|
|
38205
38273
|
</DataTable.THeadRow>
|
|
38206
38274
|
</DataTable.THead>
|
|
38207
38275
|
<DataTable.TBody>
|
|
38208
|
-
{({ item }: { item:
|
|
38276
|
+
{({ item }: { item: Customer }) => (
|
|
38209
38277
|
<DataTable.Row key={String(item.id)}>
|
|
38210
38278
|
<DataTable.Cell frozen>
|
|
38211
38279
|
<span className="text-xs text-surface-500 dark:text-surface-400 tabular-nums">#{String(item.id)}</span>
|
|
@@ -38310,6 +38378,7 @@ export default function ScrollFrozenRowsDemo() {
|
|
|
38310
38378
|
const toggleLock = React.useCallback((id: number) => {
|
|
38311
38379
|
setLockedIds((prev) => {
|
|
38312
38380
|
if (prev.includes(id)) return prev.filter((x) => x !== id);
|
|
38381
|
+
|
|
38313
38382
|
if (prev.length >= 2) return prev;
|
|
38314
38383
|
|
|
38315
38384
|
return [...prev, id];
|
|
@@ -38366,7 +38435,7 @@ export default function ScrollFrozenRowsDemo() {
|
|
|
38366
38435
|
);
|
|
38367
38436
|
}, []);
|
|
38368
38437
|
|
|
38369
|
-
const tbodyRender = React.useCallback(({ item }: { item:
|
|
38438
|
+
const tbodyRender = React.useCallback(({ item }: { item: Customer }) => renderRow(item as Customer), [renderRow]);
|
|
38370
38439
|
|
|
38371
38440
|
return (
|
|
38372
38441
|
<div className="w-full">
|
|
@@ -38519,7 +38588,7 @@ export default function ExpansionDemo() {
|
|
|
38519
38588
|
</DataTable.THeadRow>
|
|
38520
38589
|
</DataTable.THead>
|
|
38521
38590
|
<DataTable.TBody>
|
|
38522
|
-
{({ item }: { item:
|
|
38591
|
+
{({ item }: { item: Product }) => (
|
|
38523
38592
|
<React.Fragment key={item.id}>
|
|
38524
38593
|
<DataTable.Row>
|
|
38525
38594
|
<DataTable.Cell>
|
|
@@ -38633,6 +38702,7 @@ import { InputText } from '@primereact/ui/inputtext';
|
|
|
38633
38702
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
38634
38703
|
import { Tag } from '@primereact/ui/tag';
|
|
38635
38704
|
import * as React from 'react';
|
|
38705
|
+
import type { InputNumberRootValueChangeEvent } from '@primereact/ui/inputnumber';
|
|
38636
38706
|
|
|
38637
38707
|
const statusOptions = [
|
|
38638
38708
|
{ label: 'In Stock', value: 'INSTOCK' },
|
|
@@ -38708,7 +38778,7 @@ export default function CellEditDemo() {
|
|
|
38708
38778
|
</DataTable.THeadRow>
|
|
38709
38779
|
</DataTable.THead>
|
|
38710
38780
|
<DataTable.TBody>
|
|
38711
|
-
{({ item, index }: { item:
|
|
38781
|
+
{({ item, index }: { item: Product; index: number }) => (
|
|
38712
38782
|
<DataTable.Row key={item.id}>
|
|
38713
38783
|
<DataTable.Cell>
|
|
38714
38784
|
<img
|
|
@@ -38727,7 +38797,7 @@ export default function CellEditDemo() {
|
|
|
38727
38797
|
<DataTable.CellEditorContent>
|
|
38728
38798
|
<InputText
|
|
38729
38799
|
defaultValue={item.name}
|
|
38730
|
-
onChange={(e:
|
|
38800
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
38731
38801
|
pendingValueRef.current[`${index}-name`] = e.target.value;
|
|
38732
38802
|
}}
|
|
38733
38803
|
size="small"
|
|
@@ -38744,7 +38814,7 @@ export default function CellEditDemo() {
|
|
|
38744
38814
|
<DataTable.CellEditorContent>
|
|
38745
38815
|
<InputText
|
|
38746
38816
|
defaultValue={item.category}
|
|
38747
|
-
onChange={(e:
|
|
38817
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
38748
38818
|
pendingValueRef.current[`${index}-category`] = e.target.value;
|
|
38749
38819
|
}}
|
|
38750
38820
|
size="small"
|
|
@@ -38759,7 +38829,7 @@ export default function CellEditDemo() {
|
|
|
38759
38829
|
<DataTable.CellEditorContent>
|
|
38760
38830
|
<InputNumber.Root
|
|
38761
38831
|
defaultValue={item.quantity}
|
|
38762
|
-
onValueChange={(e:
|
|
38832
|
+
onValueChange={(e: InputNumberRootValueChangeEvent) => {
|
|
38763
38833
|
pendingValueRef.current[`${index}-quantity`] = e.value;
|
|
38764
38834
|
}}
|
|
38765
38835
|
size="small"
|
|
@@ -38780,7 +38850,7 @@ export default function CellEditDemo() {
|
|
|
38780
38850
|
defaultValue={item.price}
|
|
38781
38851
|
mode="currency"
|
|
38782
38852
|
currency="USD"
|
|
38783
|
-
onValueChange={(e:
|
|
38853
|
+
onValueChange={(e: InputNumberRootValueChangeEvent) => {
|
|
38784
38854
|
pendingValueRef.current[`${index}-price`] = e.value;
|
|
38785
38855
|
}}
|
|
38786
38856
|
size="small"
|
|
@@ -38876,6 +38946,7 @@ import { InputText } from '@primereact/ui/inputtext';
|
|
|
38876
38946
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
38877
38947
|
import { Tag } from '@primereact/ui/tag';
|
|
38878
38948
|
import * as React from 'react';
|
|
38949
|
+
import type { InputNumberRootValueChangeEvent } from '@primereact/ui/inputnumber';
|
|
38879
38950
|
|
|
38880
38951
|
const statusOptions = [
|
|
38881
38952
|
{ label: 'In Stock', value: 'INSTOCK' },
|
|
@@ -38993,7 +39064,7 @@ export default function CellEditSelectionDemo() {
|
|
|
38993
39064
|
</DataTable.THeadRow>
|
|
38994
39065
|
</DataTable.THead>
|
|
38995
39066
|
<DataTable.TBody>
|
|
38996
|
-
{({ item, index }: { item:
|
|
39067
|
+
{({ item, index }: { item: Product; index: number }) => (
|
|
38997
39068
|
<DataTable.Row key={item.id}>
|
|
38998
39069
|
<DataTable.Cell>
|
|
38999
39070
|
<DataTable.Selection>
|
|
@@ -39028,7 +39099,7 @@ export default function CellEditSelectionDemo() {
|
|
|
39028
39099
|
<DataTable.CellEditorContent>
|
|
39029
39100
|
<InputText
|
|
39030
39101
|
defaultValue={item.name}
|
|
39031
|
-
onChange={(e:
|
|
39102
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
39032
39103
|
pendingValueRef.current[`${index}-name`] = e.target.value;
|
|
39033
39104
|
}}
|
|
39034
39105
|
size="small"
|
|
@@ -39045,7 +39116,7 @@ export default function CellEditSelectionDemo() {
|
|
|
39045
39116
|
<DataTable.CellEditorContent>
|
|
39046
39117
|
<InputText
|
|
39047
39118
|
defaultValue={item.category}
|
|
39048
|
-
onChange={(e:
|
|
39119
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
39049
39120
|
pendingValueRef.current[`${index}-category`] = e.target.value;
|
|
39050
39121
|
}}
|
|
39051
39122
|
size="small"
|
|
@@ -39060,7 +39131,7 @@ export default function CellEditSelectionDemo() {
|
|
|
39060
39131
|
<DataTable.CellEditorContent>
|
|
39061
39132
|
<InputNumber.Root
|
|
39062
39133
|
defaultValue={item.quantity}
|
|
39063
|
-
onValueChange={(e:
|
|
39134
|
+
onValueChange={(e: InputNumberRootValueChangeEvent) => {
|
|
39064
39135
|
pendingValueRef.current[`${index}-quantity`] = e.value;
|
|
39065
39136
|
}}
|
|
39066
39137
|
size="small"
|
|
@@ -39081,7 +39152,7 @@ export default function CellEditSelectionDemo() {
|
|
|
39081
39152
|
defaultValue={item.price}
|
|
39082
39153
|
mode="currency"
|
|
39083
39154
|
currency="USD"
|
|
39084
|
-
onValueChange={(e:
|
|
39155
|
+
onValueChange={(e: InputNumberRootValueChangeEvent) => {
|
|
39085
39156
|
pendingValueRef.current[`${index}-price`] = e.value;
|
|
39086
39157
|
}}
|
|
39087
39158
|
size="small"
|
|
@@ -39177,6 +39248,8 @@ import { InputText } from '@primereact/ui/inputtext';
|
|
|
39177
39248
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
39178
39249
|
import { Tag } from '@primereact/ui/tag';
|
|
39179
39250
|
import * as React from 'react';
|
|
39251
|
+
import type { DataTableEditingEvent } from '@primereact/ui/datatable';
|
|
39252
|
+
import type { InputNumberRootValueChangeEvent } from '@primereact/ui/inputnumber';
|
|
39180
39253
|
|
|
39181
39254
|
const statusOptions = [
|
|
39182
39255
|
{ label: 'In Stock', value: 'INSTOCK' },
|
|
@@ -39232,7 +39305,7 @@ export default function RowEditDemo() {
|
|
|
39232
39305
|
dataKey="id"
|
|
39233
39306
|
editMode="row"
|
|
39234
39307
|
editingKeys={editingKeys}
|
|
39235
|
-
onEditingKeysChange={(e:
|
|
39308
|
+
onEditingKeysChange={(e: DataTableEditingEvent) => setEditingKeys(e.value)}
|
|
39236
39309
|
onRowEditSave={handleSave}
|
|
39237
39310
|
onRowEditCancel={handleCancel}
|
|
39238
39311
|
>
|
|
@@ -39261,7 +39334,7 @@ export default function RowEditDemo() {
|
|
|
39261
39334
|
</DataTable.THeadRow>
|
|
39262
39335
|
</DataTable.THead>
|
|
39263
39336
|
<DataTable.TBody>
|
|
39264
|
-
{({ item, index }: { item:
|
|
39337
|
+
{({ item, index }: { item: Product; index: number }) => {
|
|
39265
39338
|
const id = item.id;
|
|
39266
39339
|
|
|
39267
39340
|
return (
|
|
@@ -39287,7 +39360,7 @@ export default function RowEditDemo() {
|
|
|
39287
39360
|
<DataTable.CellEditorContent>
|
|
39288
39361
|
<InputText
|
|
39289
39362
|
defaultValue={item.name}
|
|
39290
|
-
onChange={(e:
|
|
39363
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
39291
39364
|
draftRef.current[id] = { ...draftRef.current[id], name: e.target.value };
|
|
39292
39365
|
}}
|
|
39293
39366
|
fluid
|
|
@@ -39303,7 +39376,7 @@ export default function RowEditDemo() {
|
|
|
39303
39376
|
<DataTable.CellEditorContent>
|
|
39304
39377
|
<InputText
|
|
39305
39378
|
defaultValue={item.category}
|
|
39306
|
-
onChange={(e:
|
|
39379
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
39307
39380
|
draftRef.current[id] = { ...draftRef.current[id], category: e.target.value };
|
|
39308
39381
|
}}
|
|
39309
39382
|
fluid
|
|
@@ -39317,7 +39390,7 @@ export default function RowEditDemo() {
|
|
|
39317
39390
|
<DataTable.CellEditorContent>
|
|
39318
39391
|
<InputNumber.Root
|
|
39319
39392
|
defaultValue={item.quantity}
|
|
39320
|
-
onValueChange={(e:
|
|
39393
|
+
onValueChange={(e: InputNumberRootValueChangeEvent) => {
|
|
39321
39394
|
draftRef.current[id] = { ...draftRef.current[id], quantity: e.value ?? 0 };
|
|
39322
39395
|
}}
|
|
39323
39396
|
fluid
|
|
@@ -39337,7 +39410,7 @@ export default function RowEditDemo() {
|
|
|
39337
39410
|
defaultValue={item.price}
|
|
39338
39411
|
mode="currency"
|
|
39339
39412
|
currency="USD"
|
|
39340
|
-
onValueChange={(e:
|
|
39413
|
+
onValueChange={(e: InputNumberRootValueChangeEvent) => {
|
|
39341
39414
|
draftRef.current[id] = { ...draftRef.current[id], price: e.value ?? 0 };
|
|
39342
39415
|
}}
|
|
39343
39416
|
fluid
|
|
@@ -39440,6 +39513,7 @@ import { Database } from '@primeicons/react/database';
|
|
|
39440
39513
|
import { Avatar } from '@primereact/ui/avatar';
|
|
39441
39514
|
import { Badge } from '@primereact/ui/badge';
|
|
39442
39515
|
import { DataTable } from '@primereact/ui/datatable';
|
|
39516
|
+
import type { RowGroupMeta } from '@primereact/ui/datatable';
|
|
39443
39517
|
import { Tag } from '@primereact/ui/tag';
|
|
39444
39518
|
import * as React from 'react';
|
|
39445
39519
|
|
|
@@ -39481,7 +39555,7 @@ export default function RowGroupDemo() {
|
|
|
39481
39555
|
</DataTable.THeadRow>
|
|
39482
39556
|
</DataTable.THead>
|
|
39483
39557
|
<DataTable.TBody>
|
|
39484
|
-
{({ item, groupMeta }: { item:
|
|
39558
|
+
{({ item, groupMeta }: { item: Customer; groupMeta?: RowGroupMeta }) => {
|
|
39485
39559
|
const repName = item.representative.name as string;
|
|
39486
39560
|
const repImage = item.representative.image;
|
|
39487
39561
|
const groupTotal = customers.reduce(
|
|
@@ -39572,6 +39646,7 @@ import { CustomerService, type Customer } from '@/shared/services/customer.servi
|
|
|
39572
39646
|
import { Database } from '@primeicons/react/database';
|
|
39573
39647
|
import { Avatar } from '@primereact/ui/avatar';
|
|
39574
39648
|
import { DataTable } from '@primereact/ui/datatable';
|
|
39649
|
+
import type { RowGroupMeta } from '@primereact/ui/datatable';
|
|
39575
39650
|
import { Tag } from '@primereact/ui/tag';
|
|
39576
39651
|
import * as React from 'react';
|
|
39577
39652
|
|
|
@@ -39622,7 +39697,7 @@ export default function RowGroupRowSpanDemo() {
|
|
|
39622
39697
|
</DataTable.THeadRow>
|
|
39623
39698
|
</DataTable.THead>
|
|
39624
39699
|
<DataTable.TBody>
|
|
39625
|
-
{({ item, groupMeta }: { item:
|
|
39700
|
+
{({ item, groupMeta }: { item: Customer; groupMeta?: RowGroupMeta }) => (
|
|
39626
39701
|
<DataTable.Row key={item.id}>
|
|
39627
39702
|
{groupMeta?.isGroupStart && (
|
|
39628
39703
|
<DataTable.Cell rowSpan={groupMeta.groupCount}>
|
|
@@ -39702,18 +39777,6 @@ import { DataTable } from '@primereact/ui/datatable';
|
|
|
39702
39777
|
import { Tag } from '@primereact/ui/tag';
|
|
39703
39778
|
import * as React from 'react';
|
|
39704
39779
|
|
|
39705
|
-
const statusSeverity: Record<string, 'success' | 'warn' | 'danger'> = {
|
|
39706
|
-
INSTOCK: 'success',
|
|
39707
|
-
LOWSTOCK: 'warn',
|
|
39708
|
-
OUTOFSTOCK: 'danger'
|
|
39709
|
-
};
|
|
39710
|
-
|
|
39711
|
-
const statusLabel: Record<string, string> = {
|
|
39712
|
-
INSTOCK: 'In Stock',
|
|
39713
|
-
LOWSTOCK: 'Low Stock',
|
|
39714
|
-
OUTOFSTOCK: 'Out of Stock'
|
|
39715
|
-
};
|
|
39716
|
-
|
|
39717
39780
|
export default function ResizeDemo() {
|
|
39718
39781
|
const [products, setProducts] = React.useState<Product[]>([]);
|
|
39719
39782
|
|
|
@@ -39748,7 +39811,7 @@ export default function ResizeDemo() {
|
|
|
39748
39811
|
</DataTable.THeadRow>
|
|
39749
39812
|
</DataTable.THead>
|
|
39750
39813
|
<DataTable.TBody>
|
|
39751
|
-
{({ item }: { item:
|
|
39814
|
+
{({ item }: { item: Product }) => (
|
|
39752
39815
|
<DataTable.Row key={item.id}>
|
|
39753
39816
|
<DataTable.Cell>
|
|
39754
39817
|
<div className="flex items-center gap-3">
|
|
@@ -39859,7 +39922,7 @@ export default function ResizeExpandDemo() {
|
|
|
39859
39922
|
</DataTable.THeadRow>
|
|
39860
39923
|
</DataTable.THead>
|
|
39861
39924
|
<DataTable.TBody>
|
|
39862
|
-
{({ item }: { item:
|
|
39925
|
+
{({ item }: { item: Product }) => (
|
|
39863
39926
|
<DataTable.Row key={item.id}>
|
|
39864
39927
|
<DataTable.Cell>
|
|
39865
39928
|
<div className="flex items-center gap-3">
|
|
@@ -40021,7 +40084,7 @@ export default function ReorderDemo() {
|
|
|
40021
40084
|
</DataTable.THeadRow>
|
|
40022
40085
|
</DataTable.THead>
|
|
40023
40086
|
<DataTable.TBody key={columns.map((c) => c.field).join(',')}>
|
|
40024
|
-
{({ item }: { item:
|
|
40087
|
+
{({ item }: { item: Product }) => (
|
|
40025
40088
|
<DataTable.Row key={item.id}>
|
|
40026
40089
|
{columns.map((col) => (
|
|
40027
40090
|
<DataTable.Cell key={col.field}>{renderCell(col.field, item)}</DataTable.Cell>
|
|
@@ -40124,7 +40187,7 @@ export default function RowReorderDemo() {
|
|
|
40124
40187
|
</DataTable.THeadRow>
|
|
40125
40188
|
</DataTable.THead>
|
|
40126
40189
|
<DataTable.TBody>
|
|
40127
|
-
{({ item, index }: { item:
|
|
40190
|
+
{({ item, index }: { item: Product; index: number }) => (
|
|
40128
40191
|
<DataTable.Row key={item.id}>
|
|
40129
40192
|
<DataTable.Cell>
|
|
40130
40193
|
<DataTable.RowReorder rowIndex={index} className="cursor-grab text-surface-400 hover:text-surface-600">
|
|
@@ -40293,6 +40356,7 @@ function ColumnsPopover({ columns, visibleFields, onColumnsChange, onVisibleFiel
|
|
|
40293
40356
|
|
|
40294
40357
|
if (set.has(field)) set.delete(field);
|
|
40295
40358
|
else set.add(field);
|
|
40359
|
+
|
|
40296
40360
|
onVisibleFieldsChange(Array.from(set));
|
|
40297
40361
|
};
|
|
40298
40362
|
|
|
@@ -40394,7 +40458,7 @@ export default function ColumnToggleDemo() {
|
|
|
40394
40458
|
</DataTable.THeadRow>
|
|
40395
40459
|
</DataTable.THead>
|
|
40396
40460
|
<DataTable.TBody key={visibleFields.join(',') + '|' + columns.map((c) => c.field).join(',')}>
|
|
40397
|
-
{({ item }: { item:
|
|
40461
|
+
{({ item }: { item: Product }) => (
|
|
40398
40462
|
<DataTable.Row key={item.id}>
|
|
40399
40463
|
{visibleColumns.map((col) => (
|
|
40400
40464
|
<DataTable.Cell key={col.field}>{renderCell(col.field, item)}</DataTable.Cell>
|
|
@@ -40515,7 +40579,7 @@ export default function ColumnGroupDemo() {
|
|
|
40515
40579
|
</DataTable.THeadRow>
|
|
40516
40580
|
</DataTable.THead>
|
|
40517
40581
|
<DataTable.TBody>
|
|
40518
|
-
{({ item }: { item:
|
|
40582
|
+
{({ item }: { item: Sale }) => (
|
|
40519
40583
|
<DataTable.Row key={item.id}>
|
|
40520
40584
|
<DataTable.Cell>
|
|
40521
40585
|
<span className="font-medium">{item.product}</span>
|
|
@@ -40684,7 +40748,7 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
40684
40748
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
40685
40749
|
<InputText
|
|
40686
40750
|
value={(value as string) ?? ''}
|
|
40687
|
-
onChange={(e:
|
|
40751
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
40688
40752
|
placeholder="Search"
|
|
40689
40753
|
size="small"
|
|
40690
40754
|
fluid
|
|
@@ -40698,7 +40762,9 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
40698
40762
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
40699
40763
|
<InputText
|
|
40700
40764
|
value={(value as string) ?? ''}
|
|
40701
|
-
onChange={(e:
|
|
40765
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
40766
|
+
onChange(e, e.target.value ? Number(e.target.value) : null, 'gte')
|
|
40767
|
+
}
|
|
40702
40768
|
placeholder="≥"
|
|
40703
40769
|
size="small"
|
|
40704
40770
|
fluid
|
|
@@ -40711,7 +40777,7 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
40711
40777
|
</DataTable.THeadRow>
|
|
40712
40778
|
</DataTable.THead>
|
|
40713
40779
|
<DataTable.TBody>
|
|
40714
|
-
{({ item }: { item:
|
|
40780
|
+
{({ item }: { item: Sale }) => (
|
|
40715
40781
|
<DataTable.Row key={item.id}>
|
|
40716
40782
|
<DataTable.Cell>
|
|
40717
40783
|
<span className="font-medium">{item.product}</span>
|
|
@@ -40863,7 +40929,7 @@ export default function FilterBasicDemo() {
|
|
|
40863
40929
|
type="search"
|
|
40864
40930
|
placeholder="Keyword Search"
|
|
40865
40931
|
value={globalFilter}
|
|
40866
|
-
onChange={(e:
|
|
40932
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
40867
40933
|
/>
|
|
40868
40934
|
</IconField.Root>
|
|
40869
40935
|
</div>
|
|
@@ -40900,7 +40966,7 @@ export default function FilterBasicDemo() {
|
|
|
40900
40966
|
{({ value, onChange, isActive }: DataTableFilterInstance) => (
|
|
40901
40967
|
<InputText
|
|
40902
40968
|
value={(value as string) ?? ''}
|
|
40903
|
-
onChange={(e:
|
|
40969
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
40904
40970
|
placeholder="Search name..."
|
|
40905
40971
|
invalid={isActive && !value}
|
|
40906
40972
|
size="small"
|
|
@@ -40914,7 +40980,7 @@ export default function FilterBasicDemo() {
|
|
|
40914
40980
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
40915
40981
|
<InputText
|
|
40916
40982
|
value={(value as string) ?? ''}
|
|
40917
|
-
onChange={(e:
|
|
40983
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
40918
40984
|
placeholder="Search country..."
|
|
40919
40985
|
size="small"
|
|
40920
40986
|
fluid
|
|
@@ -40939,7 +41005,7 @@ export default function FilterBasicDemo() {
|
|
|
40939
41005
|
</DataTable.THeadRow>
|
|
40940
41006
|
</DataTable.THead>
|
|
40941
41007
|
<DataTable.TBody>
|
|
40942
|
-
{({ item }: { item:
|
|
41008
|
+
{({ item }: { item: (typeof customers)[number] }) => (
|
|
40943
41009
|
<DataTable.Row key={String(item.id)}>
|
|
40944
41010
|
<DataTable.Cell>
|
|
40945
41011
|
<span className="font-medium">{String(item.name)}</span>
|
|
@@ -41205,7 +41271,7 @@ export default function FilterAdvancedDemo() {
|
|
|
41205
41271
|
type="search"
|
|
41206
41272
|
placeholder="Keyword Search"
|
|
41207
41273
|
value={globalFilter}
|
|
41208
|
-
onChange={(e:
|
|
41274
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
41209
41275
|
/>
|
|
41210
41276
|
</IconField.Root>
|
|
41211
41277
|
</div>
|
|
@@ -41297,7 +41363,9 @@ export default function FilterAdvancedDemo() {
|
|
|
41297
41363
|
</div>
|
|
41298
41364
|
<InputText
|
|
41299
41365
|
value={(constraint.value as string) ?? ''}
|
|
41300
|
-
onChange={(e:
|
|
41366
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
41367
|
+
onConstraintChange(e, idx, e.target.value)
|
|
41368
|
+
}
|
|
41301
41369
|
placeholder="Search by name..."
|
|
41302
41370
|
size="small"
|
|
41303
41371
|
fluid
|
|
@@ -41364,7 +41432,9 @@ export default function FilterAdvancedDemo() {
|
|
|
41364
41432
|
/>
|
|
41365
41433
|
<InputText
|
|
41366
41434
|
value={(constraint.value as string) ?? ''}
|
|
41367
|
-
onChange={(e:
|
|
41435
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
41436
|
+
onConstraintChange(e, idx, e.target.value)
|
|
41437
|
+
}
|
|
41368
41438
|
placeholder="Search by country..."
|
|
41369
41439
|
size="small"
|
|
41370
41440
|
fluid
|
|
@@ -41852,7 +41922,7 @@ export default function FilterAdvancedDemo() {
|
|
|
41852
41922
|
</DataTable.THeadRow>
|
|
41853
41923
|
</DataTable.THead>
|
|
41854
41924
|
<DataTable.TBody>
|
|
41855
|
-
{({ item }: { item:
|
|
41925
|
+
{({ item }: { item: Customer }) => (
|
|
41856
41926
|
<DataTable.Row key={String(item.id)}>
|
|
41857
41927
|
<DataTable.Cell>
|
|
41858
41928
|
<span className="font-medium">{String(item.name)}</span>
|
|
@@ -42044,7 +42114,7 @@ export default function ExportDemo() {
|
|
|
42044
42114
|
</DataTable.THeadRow>
|
|
42045
42115
|
</DataTable.THead>
|
|
42046
42116
|
<DataTable.TBody>
|
|
42047
|
-
{({ item }: { item:
|
|
42117
|
+
{({ item }: { item: Product }) => (
|
|
42048
42118
|
<DataTable.Row key={item.id}>
|
|
42049
42119
|
<DataTable.Cell>
|
|
42050
42120
|
<div className="flex items-center gap-3">
|
|
@@ -42170,6 +42240,7 @@ function mockFetch(params: {
|
|
|
42170
42240
|
const vb = b[field];
|
|
42171
42241
|
|
|
42172
42242
|
if (va < vb) return -1 * dir;
|
|
42243
|
+
|
|
42173
42244
|
if (va > vb) return 1 * dir;
|
|
42174
42245
|
|
|
42175
42246
|
return 0;
|
|
@@ -42223,7 +42294,7 @@ export default function LazyDemo() {
|
|
|
42223
42294
|
type="search"
|
|
42224
42295
|
placeholder="Search code / name / category..."
|
|
42225
42296
|
value={search}
|
|
42226
|
-
onChange={(e:
|
|
42297
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSearch(e.target.value)}
|
|
42227
42298
|
style={{ minWidth: '20rem' }}
|
|
42228
42299
|
/>
|
|
42229
42300
|
<span className="text-xs text-surface-500 dark:text-surface-400">Last lazy event: {lastEvent || '—'}</span>
|
|
@@ -42309,7 +42380,7 @@ export default function LazyDemo() {
|
|
|
42309
42380
|
</DataTable.THeadRow>
|
|
42310
42381
|
</DataTable.THead>
|
|
42311
42382
|
<DataTable.TBody>
|
|
42312
|
-
{({ item }: { item:
|
|
42383
|
+
{({ item }: { item: Product }) => (
|
|
42313
42384
|
<DataTable.Row key={String(item.id)}>
|
|
42314
42385
|
<DataTable.Cell>
|
|
42315
42386
|
<span className="font-mono text-xs text-surface-500 dark:text-surface-400">{String(item.code)}</span>
|
|
@@ -42467,7 +42538,7 @@ export default function LoadingOverlayDemo() {
|
|
|
42467
42538
|
</DataTable.THeadRow>
|
|
42468
42539
|
</DataTable.THead>
|
|
42469
42540
|
<DataTable.TBody>
|
|
42470
|
-
{({ item }: { item:
|
|
42541
|
+
{({ item }: { item: Product }) => (
|
|
42471
42542
|
<DataTable.Row key={item.id}>
|
|
42472
42543
|
<DataTable.Cell>
|
|
42473
42544
|
<div className="flex items-center gap-3">
|
|
@@ -42587,7 +42658,7 @@ export default function LoadingSkeletonDemo() {
|
|
|
42587
42658
|
</DataTable.THeadRow>
|
|
42588
42659
|
</DataTable.THead>
|
|
42589
42660
|
<DataTable.TBody>
|
|
42590
|
-
{({ item }: { item:
|
|
42661
|
+
{({ item }: { item: Product }) =>
|
|
42591
42662
|
isLoading ? (
|
|
42592
42663
|
<DataTable.Row key={item.id}>
|
|
42593
42664
|
<DataTable.Cell>
|
|
@@ -42681,7 +42752,7 @@ export default function EmptyDemo() {
|
|
|
42681
42752
|
</DataTable.THeadRow>
|
|
42682
42753
|
</DataTable.THead>
|
|
42683
42754
|
<DataTable.TBody>
|
|
42684
|
-
{({ item }: { item:
|
|
42755
|
+
{({ item }: { item: Record<string, unknown> }) => (
|
|
42685
42756
|
<DataTable.Row key={String(item.id)}>
|
|
42686
42757
|
<DataTable.Cell>{String(item.name)}</DataTable.Cell>
|
|
42687
42758
|
<DataTable.Cell>{String(item.category)}</DataTable.Cell>
|
|
@@ -42740,6 +42811,7 @@ import { InputNumber } from '@primereact/ui/inputnumber';
|
|
|
42740
42811
|
import { InputText } from '@primereact/ui/inputtext';
|
|
42741
42812
|
import { Tag } from '@primereact/ui/tag';
|
|
42742
42813
|
import * as React from 'react';
|
|
42814
|
+
import type { InputNumberRootValueChangeEvent } from '@primereact/ui/inputnumber';
|
|
42743
42815
|
|
|
42744
42816
|
const statusSeverity: Record<string, 'success' | 'warn' | 'danger'> = {
|
|
42745
42817
|
INSTOCK: 'success',
|
|
@@ -42808,7 +42880,7 @@ export default function AdvancedDemo() {
|
|
|
42808
42880
|
type="search"
|
|
42809
42881
|
placeholder="Keyword search"
|
|
42810
42882
|
value={globalFilter}
|
|
42811
|
-
onChange={(e:
|
|
42883
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
42812
42884
|
className="w-full"
|
|
42813
42885
|
/>
|
|
42814
42886
|
</IconField.Root>
|
|
@@ -42860,7 +42932,7 @@ export default function AdvancedDemo() {
|
|
|
42860
42932
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
42861
42933
|
<InputText
|
|
42862
42934
|
value={(value as string) ?? ''}
|
|
42863
|
-
onChange={(e:
|
|
42935
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
42864
42936
|
placeholder="Search"
|
|
42865
42937
|
size="small"
|
|
42866
42938
|
fluid
|
|
@@ -42873,7 +42945,7 @@ export default function AdvancedDemo() {
|
|
|
42873
42945
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
42874
42946
|
<InputText
|
|
42875
42947
|
value={(value as string) ?? ''}
|
|
42876
|
-
onChange={(e:
|
|
42948
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
42877
42949
|
placeholder="Search"
|
|
42878
42950
|
size="small"
|
|
42879
42951
|
fluid
|
|
@@ -42887,7 +42959,7 @@ export default function AdvancedDemo() {
|
|
|
42887
42959
|
</DataTable.THeadRow>
|
|
42888
42960
|
</DataTable.THead>
|
|
42889
42961
|
<DataTable.TBody>
|
|
42890
|
-
{({ item, index }: { item:
|
|
42962
|
+
{({ item, index }: { item: Product; index: number }) => (
|
|
42891
42963
|
<DataTable.Row key={item.id}>
|
|
42892
42964
|
<DataTable.Cell>
|
|
42893
42965
|
<DataTable.CellEditor field="name" rowIndex={index} rowData={item}>
|
|
@@ -42897,7 +42969,7 @@ export default function AdvancedDemo() {
|
|
|
42897
42969
|
<DataTable.CellEditorContent>
|
|
42898
42970
|
<InputText
|
|
42899
42971
|
defaultValue={String(item.name)}
|
|
42900
|
-
onChange={(e:
|
|
42972
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
42901
42973
|
pendingValueRef.current[`${item.id}-name`] = e.target.value;
|
|
42902
42974
|
}}
|
|
42903
42975
|
size="small"
|
|
@@ -42914,7 +42986,7 @@ export default function AdvancedDemo() {
|
|
|
42914
42986
|
<DataTable.CellEditorContent>
|
|
42915
42987
|
<InputText
|
|
42916
42988
|
defaultValue={String(item.category)}
|
|
42917
|
-
onChange={(e:
|
|
42989
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
42918
42990
|
pendingValueRef.current[`${item.id}-category`] = e.target.value;
|
|
42919
42991
|
}}
|
|
42920
42992
|
size="small"
|
|
@@ -42931,7 +43003,7 @@ export default function AdvancedDemo() {
|
|
|
42931
43003
|
<DataTable.CellEditorContent>
|
|
42932
43004
|
<InputNumber.Root
|
|
42933
43005
|
defaultValue={Number(item.price)}
|
|
42934
|
-
onValueChange={(e:
|
|
43006
|
+
onValueChange={(e: InputNumberRootValueChangeEvent) => {
|
|
42935
43007
|
pendingValueRef.current[`${item.id}-price`] = e.value;
|
|
42936
43008
|
}}
|
|
42937
43009
|
mode="currency"
|
|
@@ -43002,7 +43074,13 @@ import { Times } from '@primeicons/react/times';
|
|
|
43002
43074
|
import { Trash } from '@primeicons/react/trash';
|
|
43003
43075
|
import { Button } from '@primereact/ui/button';
|
|
43004
43076
|
import { Checkbox, type CheckboxRootChangeEvent } from '@primereact/ui/checkbox';
|
|
43005
|
-
import type {
|
|
43077
|
+
import type {
|
|
43078
|
+
DataTableColumnReorderEvent,
|
|
43079
|
+
DataTablePaginationInstance,
|
|
43080
|
+
DataTableSelectionInstance,
|
|
43081
|
+
DataTableSortEvent,
|
|
43082
|
+
SortOrder
|
|
43083
|
+
} from '@primereact/ui/datatable';
|
|
43006
43084
|
import { DataTable } from '@primereact/ui/datatable';
|
|
43007
43085
|
import { Drawer, type DrawerRootChangeEvent } from '@primereact/ui/drawer';
|
|
43008
43086
|
import { IconField } from '@primereact/ui/iconfield';
|
|
@@ -43456,7 +43534,7 @@ export default function DatabaseEditorDemo() {
|
|
|
43456
43534
|
</DataTable.THeadRow>
|
|
43457
43535
|
</DataTable.THead>
|
|
43458
43536
|
<DataTable.TBody key={columns.map((c) => c.field).join(',')}>
|
|
43459
|
-
{({ item, index }: { item:
|
|
43537
|
+
{({ item, index }: { item: Row; index: number }) => (
|
|
43460
43538
|
<DataTable.Row key={String(item.__rid)}>
|
|
43461
43539
|
<DataTable.Cell frozen>
|
|
43462
43540
|
<DataTable.Selection>
|
|
@@ -52267,6 +52345,7 @@ import { InputGroup } from '@primereact/ui/inputgroup';
|
|
|
52267
52345
|
import { InputText } from '@primereact/ui/inputtext';
|
|
52268
52346
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
52269
52347
|
import * as React from 'react';
|
|
52348
|
+
|
|
52270
52349
|
const options = [
|
|
52271
52350
|
{ label: 'HEX', value: 'hex' },
|
|
52272
52351
|
{ label: 'RGBA', value: 'rgba' },
|
|
@@ -52412,6 +52491,7 @@ import { InputGroup } from '@primereact/ui/inputgroup';
|
|
|
52412
52491
|
import { InputText } from '@primereact/ui/inputtext';
|
|
52413
52492
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
52414
52493
|
import * as React from 'react';
|
|
52494
|
+
|
|
52415
52495
|
const options = [
|
|
52416
52496
|
{ label: 'HEX', value: 'hex' },
|
|
52417
52497
|
{ label: 'RGBA', value: 'rgba' },
|
|
@@ -52624,6 +52704,7 @@ import { Button } from '@primereact/ui/button';
|
|
|
52624
52704
|
import { InputColor, type InputColorRootChangeEvent } from '@primereact/ui/inputcolor';
|
|
52625
52705
|
import { InputText } from '@primereact/ui/inputtext';
|
|
52626
52706
|
import * as React from 'react';
|
|
52707
|
+
|
|
52627
52708
|
export default function ControlledDemo() {
|
|
52628
52709
|
const [value, setValue] = React.useState<ColorInstance>(parseColor('#000000'));
|
|
52629
52710
|
const [endValue, setEndValue] = React.useState<ColorInstance>(parseColor('#000000'));
|
|
@@ -69277,11 +69358,14 @@ const nodes: TreeNodeData[] = [
|
|
|
69277
69358
|
function findPath(list: TreeNodeData[], key: string, trail: string[] = []): { path: string[]; label: string } | undefined {
|
|
69278
69359
|
for (const node of list) {
|
|
69279
69360
|
if (node.key === key) return { path: trail, label: node.label as string };
|
|
69361
|
+
|
|
69280
69362
|
if (node.children) {
|
|
69281
69363
|
const found = findPath(node.children, key, [...trail, node.key as string]);
|
|
69364
|
+
|
|
69282
69365
|
if (found) return found;
|
|
69283
69366
|
}
|
|
69284
69367
|
}
|
|
69368
|
+
|
|
69285
69369
|
return undefined;
|
|
69286
69370
|
}
|
|
69287
69371
|
|
|
@@ -69296,9 +69380,12 @@ export default function TreeDemo() {
|
|
|
69296
69380
|
// Expand the path to the selected node when the popup opens.
|
|
69297
69381
|
const onOpenChange = (e: SelectOpenChangeEvent) => {
|
|
69298
69382
|
const isOpen = !!e.value;
|
|
69383
|
+
|
|
69299
69384
|
setOpen(isOpen);
|
|
69385
|
+
|
|
69300
69386
|
if (isOpen && selectedInfo) {
|
|
69301
69387
|
const next: TreeExpandedKeys = {};
|
|
69388
|
+
|
|
69302
69389
|
for (const key of selectedInfo.path) next[key] = true;
|
|
69303
69390
|
setExpandedKeys(next);
|
|
69304
69391
|
}
|
|
@@ -69416,9 +69503,10 @@ import { Avatar } from '@primereact/ui/avatar';
|
|
|
69416
69503
|
import { Button } from '@primereact/ui/button';
|
|
69417
69504
|
import { Sidebar } from '@primereact/ui/sidebar';
|
|
69418
69505
|
import * as React from 'react';
|
|
69506
|
+
import type { IconProps } from '@primeicons/react/core';
|
|
69419
69507
|
|
|
69420
69508
|
type NavItem = {
|
|
69421
|
-
icon: React.FC<
|
|
69509
|
+
icon: React.FC<IconProps>;
|
|
69422
69510
|
label: string;
|
|
69423
69511
|
isActive?: boolean;
|
|
69424
69512
|
badge?: string;
|
|
@@ -69640,9 +69728,11 @@ import { ToggleButton } from '@primereact/ui/togglebutton';
|
|
|
69640
69728
|
import { ToggleSwitch, type ToggleSwitchRootChangeEvent } from '@primereact/ui/toggleswitch';
|
|
69641
69729
|
import { ToggleButtonGroup, ToggleButtonGroupValueChangeEvent } from '@primereact/ui/togglebuttongroup';
|
|
69642
69730
|
import * as React from 'react';
|
|
69731
|
+
import type { IconProps } from '@primeicons/react/core';
|
|
69732
|
+
import type { SidebarCollapsible, SidebarSide, SidebarVariant } from '@primereact/ui/sidebar';
|
|
69643
69733
|
|
|
69644
69734
|
type NavItem = {
|
|
69645
|
-
icon: React.FC<
|
|
69735
|
+
icon: React.FC<IconProps>;
|
|
69646
69736
|
label: string;
|
|
69647
69737
|
isActive?: boolean;
|
|
69648
69738
|
badge?: string;
|
|
@@ -69691,9 +69781,9 @@ const collapsibleOptions = [
|
|
|
69691
69781
|
];
|
|
69692
69782
|
|
|
69693
69783
|
export default function VariantsDemo() {
|
|
69694
|
-
const [variant, setVariant] = React.useState<
|
|
69695
|
-
const [collapsible, setCollapsible] = React.useState<
|
|
69696
|
-
const [side, setSide] = React.useState<
|
|
69784
|
+
const [variant, setVariant] = React.useState<SidebarVariant>('sidebar');
|
|
69785
|
+
const [collapsible, setCollapsible] = React.useState<SidebarCollapsible>('icon');
|
|
69786
|
+
const [side, setSide] = React.useState<SidebarSide>('left');
|
|
69697
69787
|
const [overlay, setOverlay] = React.useState(false);
|
|
69698
69788
|
const [openOnHover, setOpenOnHover] = React.useState(false);
|
|
69699
69789
|
const [backdrop, setBackdrop] = React.useState(false);
|
|
@@ -69705,7 +69795,7 @@ export default function VariantsDemo() {
|
|
|
69705
69795
|
<Label>Variant</Label>
|
|
69706
69796
|
<Select.Root
|
|
69707
69797
|
value={variant}
|
|
69708
|
-
onValueChange={(e: SelectValueChangeEvent) => setVariant(e.value as
|
|
69798
|
+
onValueChange={(e: SelectValueChangeEvent) => setVariant(e.value as SidebarVariant)}
|
|
69709
69799
|
options={variantOptions}
|
|
69710
69800
|
optionLabel="label"
|
|
69711
69801
|
optionValue="value"
|
|
@@ -69730,7 +69820,7 @@ export default function VariantsDemo() {
|
|
|
69730
69820
|
<Label>Collapsible</Label>
|
|
69731
69821
|
<Select.Root
|
|
69732
69822
|
value={collapsible}
|
|
69733
|
-
onValueChange={(e: SelectValueChangeEvent) => setCollapsible(e.value as
|
|
69823
|
+
onValueChange={(e: SelectValueChangeEvent) => setCollapsible(e.value as SidebarCollapsible)}
|
|
69734
69824
|
options={collapsibleOptions}
|
|
69735
69825
|
optionLabel="label"
|
|
69736
69826
|
optionValue="value"
|
|
@@ -70666,10 +70756,11 @@ import { useIsMobile } from '@primereact/hooks';
|
|
|
70666
70756
|
import { Avatar } from '@primereact/ui/avatar';
|
|
70667
70757
|
import { Button } from '@primereact/ui/button';
|
|
70668
70758
|
import { Sidebar } from '@primereact/ui/sidebar';
|
|
70759
|
+
import type { IconProps } from '@primeicons/react/core';
|
|
70669
70760
|
|
|
70670
70761
|
type MenuItem = {
|
|
70671
70762
|
label: string;
|
|
70672
|
-
icon?: React.FC<
|
|
70763
|
+
icon?: React.FC<IconProps>;
|
|
70673
70764
|
isActive?: boolean;
|
|
70674
70765
|
children?: MenuItem[];
|
|
70675
70766
|
};
|
|
@@ -79194,6 +79285,7 @@ function fetchChildren(parent: TreeNodeData): Promise<TreeNodeData[]> {
|
|
|
79194
79285
|
function setChildren(list: TreeNodeData[], key: string, children: TreeNodeData[]): TreeNodeData[] {
|
|
79195
79286
|
return list.map((n) => {
|
|
79196
79287
|
if (n.key === key) return { ...n, children, loading: false };
|
|
79288
|
+
|
|
79197
79289
|
if (n.children?.length) return { ...n, children: setChildren(n.children, key, children) };
|
|
79198
79290
|
|
|
79199
79291
|
return n;
|
|
@@ -79203,6 +79295,7 @@ function setChildren(list: TreeNodeData[], key: string, children: TreeNodeData[]
|
|
|
79203
79295
|
function setLoading(list: TreeNodeData[], key: string, loading: boolean): TreeNodeData[] {
|
|
79204
79296
|
return list.map((n) => {
|
|
79205
79297
|
if (n.key === key) return { ...n, loading };
|
|
79298
|
+
|
|
79206
79299
|
if (n.children?.length) return { ...n, children: setLoading(n.children, key, loading) };
|
|
79207
79300
|
|
|
79208
79301
|
return n;
|
|
@@ -79295,6 +79388,7 @@ export default function LoadingOverlayDemo() {
|
|
|
79295
79388
|
setLoading(true);
|
|
79296
79389
|
setTimeout(async () => {
|
|
79297
79390
|
const data = await NodeService.getTreeNodes();
|
|
79391
|
+
|
|
79298
79392
|
setNodes(data);
|
|
79299
79393
|
setLoading(false);
|
|
79300
79394
|
}, 1500);
|
|
@@ -79365,6 +79459,7 @@ export default function LoadingSkeletonDemo() {
|
|
|
79365
79459
|
setLoading(true);
|
|
79366
79460
|
setTimeout(async () => {
|
|
79367
79461
|
const data = await NodeService.getTreeNodes();
|
|
79462
|
+
|
|
79368
79463
|
setNodes(data);
|
|
79369
79464
|
setLoading(false);
|
|
79370
79465
|
}, 1500);
|
|
@@ -79433,6 +79528,7 @@ export default function EmptyDemo() {
|
|
|
79433
79528
|
|
|
79434
79529
|
const addNode = () => {
|
|
79435
79530
|
const next: TreeNodeData = { key: `root-${nodes.length}`, label: `New Folder ${nodes.length + 1}` };
|
|
79531
|
+
|
|
79436
79532
|
setNodes((prev) => [...prev, next]);
|
|
79437
79533
|
};
|
|
79438
79534
|
|
|
@@ -79723,6 +79819,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
79723
79819
|
import { Video } from '@primeicons/react/video';
|
|
79724
79820
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
79725
79821
|
import { DataTable } from '@primereact/ui/datatable';
|
|
79822
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
79726
79823
|
import { Tag } from '@primereact/ui/tag';
|
|
79727
79824
|
import * as React from 'react';
|
|
79728
79825
|
|
|
@@ -79736,7 +79833,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
79736
79833
|
|
|
79737
79834
|
function TypeIcon({ type }: { type: string }) {
|
|
79738
79835
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
79836
|
+
|
|
79739
79837
|
if (type === 'Video') return <Video size={16} />;
|
|
79838
|
+
|
|
79740
79839
|
if (type === 'Folder') return <Folder size={16} />;
|
|
79741
79840
|
|
|
79742
79841
|
return <File size={16} />;
|
|
@@ -79833,7 +79932,7 @@ export default function Preview() {
|
|
|
79833
79932
|
</DataTable.THeadRow>
|
|
79834
79933
|
</DataTable.THead>
|
|
79835
79934
|
<DataTable.TBody>
|
|
79836
|
-
{({ item }: { item:
|
|
79935
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
79837
79936
|
<DataTable.Row key={String(item.key)}>
|
|
79838
79937
|
<DataTable.Cell>
|
|
79839
79938
|
<div className="flex items-center gap-2">
|
|
@@ -79944,6 +80043,7 @@ import { ChevronDown } from '@primeicons/react/chevron-down';
|
|
|
79944
80043
|
import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
79945
80044
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
79946
80045
|
import { DataTable } from '@primereact/ui/datatable';
|
|
80046
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
79947
80047
|
import * as React from 'react';
|
|
79948
80048
|
|
|
79949
80049
|
interface TreeNode {
|
|
@@ -80007,7 +80107,7 @@ export default function BasicDemo() {
|
|
|
80007
80107
|
</DataTable.THeadRow>
|
|
80008
80108
|
</DataTable.THead>
|
|
80009
80109
|
<DataTable.TBody>
|
|
80010
|
-
{({ item }: { item:
|
|
80110
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
80011
80111
|
<DataTable.Row key={String(item.key)}>
|
|
80012
80112
|
<DataTable.Cell>
|
|
80013
80113
|
<div className="flex items-center gap-2">
|
|
@@ -80050,6 +80150,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
80050
80150
|
import { Video } from '@primeicons/react/video';
|
|
80051
80151
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
80052
80152
|
import { DataTable } from '@primereact/ui/datatable';
|
|
80153
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
80053
80154
|
import { Tag } from '@primereact/ui/tag';
|
|
80054
80155
|
import { ToggleButton } from '@primereact/ui/togglebutton';
|
|
80055
80156
|
import { ToggleButtonGroup } from '@primereact/ui/togglebuttongroup';
|
|
@@ -80065,7 +80166,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
80065
80166
|
|
|
80066
80167
|
function TypeIcon({ type }: { type: string }) {
|
|
80067
80168
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
80169
|
+
|
|
80068
80170
|
if (type === 'Video') return <Video size={16} />;
|
|
80171
|
+
|
|
80069
80172
|
if (type === 'Folder') return <Folder size={16} />;
|
|
80070
80173
|
|
|
80071
80174
|
return <File size={16} />;
|
|
@@ -80172,7 +80275,7 @@ export default function TreeTableSizeDemo() {
|
|
|
80172
80275
|
</DataTable.THeadRow>
|
|
80173
80276
|
</DataTable.THead>
|
|
80174
80277
|
<DataTable.TBody>
|
|
80175
|
-
{({ item }: { item:
|
|
80278
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
80176
80279
|
<DataTable.Row key={String(item.key)}>
|
|
80177
80280
|
<DataTable.Cell>
|
|
80178
80281
|
<div className="flex items-center gap-2">
|
|
@@ -80238,6 +80341,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
80238
80341
|
import { Video } from '@primeicons/react/video';
|
|
80239
80342
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
80240
80343
|
import { DataTable } from '@primereact/ui/datatable';
|
|
80344
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
80241
80345
|
import { Tag } from '@primereact/ui/tag';
|
|
80242
80346
|
import * as React from 'react';
|
|
80243
80347
|
|
|
@@ -80251,7 +80355,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
80251
80355
|
|
|
80252
80356
|
function TypeIcon({ type }: { type: string }) {
|
|
80253
80357
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
80358
|
+
|
|
80254
80359
|
if (type === 'Video') return <Video size={16} />;
|
|
80360
|
+
|
|
80255
80361
|
if (type === 'Folder') return <Folder size={16} />;
|
|
80256
80362
|
|
|
80257
80363
|
return <File size={16} />;
|
|
@@ -80335,7 +80441,7 @@ export default function TreeTableGridlinesDemo() {
|
|
|
80335
80441
|
</DataTable.THeadRow>
|
|
80336
80442
|
</DataTable.THead>
|
|
80337
80443
|
<DataTable.TBody>
|
|
80338
|
-
{({ item }: { item:
|
|
80444
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
80339
80445
|
<DataTable.Row key={String(item.key)}>
|
|
80340
80446
|
<DataTable.Cell>
|
|
80341
80447
|
<div className="flex items-center gap-2">
|
|
@@ -80401,6 +80507,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
80401
80507
|
import { Video } from '@primeicons/react/video';
|
|
80402
80508
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
80403
80509
|
import { DataTable } from '@primereact/ui/datatable';
|
|
80510
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
80404
80511
|
import { Tag } from '@primereact/ui/tag';
|
|
80405
80512
|
import * as React from 'react';
|
|
80406
80513
|
|
|
@@ -80414,7 +80521,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
80414
80521
|
|
|
80415
80522
|
function TypeIcon({ type }: { type: string }) {
|
|
80416
80523
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
80524
|
+
|
|
80417
80525
|
if (type === 'Video') return <Video size={16} />;
|
|
80526
|
+
|
|
80418
80527
|
if (type === 'Folder') return <Folder size={16} />;
|
|
80419
80528
|
|
|
80420
80529
|
return <File size={16} />;
|
|
@@ -80498,7 +80607,7 @@ export default function TreeTableStripedRowsDemo() {
|
|
|
80498
80607
|
</DataTable.THeadRow>
|
|
80499
80608
|
</DataTable.THead>
|
|
80500
80609
|
<DataTable.TBody>
|
|
80501
|
-
{({ item }: { item:
|
|
80610
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
80502
80611
|
<DataTable.Row key={String(item.key)}>
|
|
80503
80612
|
<DataTable.Cell>
|
|
80504
80613
|
<div className="flex items-center gap-2">
|
|
@@ -80563,6 +80672,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
80563
80672
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
80564
80673
|
import type { DataTableExpansionEvent, DataTableSelectionEvent } from '@primereact/ui/datatable';
|
|
80565
80674
|
import { DataTable } from '@primereact/ui/datatable';
|
|
80675
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
80566
80676
|
import { Tag } from '@primereact/ui/tag';
|
|
80567
80677
|
import * as React from 'react';
|
|
80568
80678
|
import { File } from '@primeicons/react/file';
|
|
@@ -80585,7 +80695,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
80585
80695
|
|
|
80586
80696
|
function TypeIcon({ type }: { type: string }) {
|
|
80587
80697
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
80698
|
+
|
|
80588
80699
|
if (type === 'Video') return <Video size={16} />;
|
|
80700
|
+
|
|
80589
80701
|
if (type === 'Folder') return <Folder size={16} />;
|
|
80590
80702
|
|
|
80591
80703
|
return <File size={16} />;
|
|
@@ -80628,7 +80740,7 @@ export default function SingleSelectionDemo() {
|
|
|
80628
80740
|
</DataTable.THeadRow>
|
|
80629
80741
|
</DataTable.THead>
|
|
80630
80742
|
<DataTable.TBody>
|
|
80631
|
-
{({ item }: { item:
|
|
80743
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
80632
80744
|
<DataTable.Row key={String(item.key)}>
|
|
80633
80745
|
<DataTable.Cell>
|
|
80634
80746
|
<div className="flex items-center gap-2">
|
|
@@ -80691,6 +80803,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
80691
80803
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
80692
80804
|
import type { DataTableExpansionEvent, DataTableSelectionEvent } from '@primereact/ui/datatable';
|
|
80693
80805
|
import { DataTable } from '@primereact/ui/datatable';
|
|
80806
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
80694
80807
|
import { Tag } from '@primereact/ui/tag';
|
|
80695
80808
|
import * as React from 'react';
|
|
80696
80809
|
import { File } from '@primeicons/react/file';
|
|
@@ -80713,7 +80826,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
80713
80826
|
|
|
80714
80827
|
function TypeIcon({ type }: { type: string }) {
|
|
80715
80828
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
80829
|
+
|
|
80716
80830
|
if (type === 'Video') return <Video size={16} />;
|
|
80831
|
+
|
|
80717
80832
|
if (type === 'Folder') return <Folder size={16} />;
|
|
80718
80833
|
|
|
80719
80834
|
return <File size={16} />;
|
|
@@ -80757,7 +80872,7 @@ export default function MultipleSelectionDemo() {
|
|
|
80757
80872
|
</DataTable.THeadRow>
|
|
80758
80873
|
</DataTable.THead>
|
|
80759
80874
|
<DataTable.TBody>
|
|
80760
|
-
{({ item }: { item:
|
|
80875
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
80761
80876
|
<DataTable.Row key={String(item.key)}>
|
|
80762
80877
|
<DataTable.Cell>
|
|
80763
80878
|
<div className="flex items-center gap-2">
|
|
@@ -80828,6 +80943,7 @@ import type { CheckboxRootChangeEvent } from '@primereact/ui/checkbox';
|
|
|
80828
80943
|
import type { DataTableSelectionInstance } from '@primereact/ui/datatable';
|
|
80829
80944
|
import { Checkbox } from '@primereact/ui/checkbox';
|
|
80830
80945
|
import { DataTable } from '@primereact/ui/datatable';
|
|
80946
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
80831
80947
|
import { Tag } from '@primereact/ui/tag';
|
|
80832
80948
|
import * as React from 'react';
|
|
80833
80949
|
|
|
@@ -80841,7 +80957,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
80841
80957
|
|
|
80842
80958
|
function TypeIcon({ type }: { type: string }) {
|
|
80843
80959
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
80960
|
+
|
|
80844
80961
|
if (type === 'Video') return <Video size={16} />;
|
|
80962
|
+
|
|
80845
80963
|
if (type === 'Folder') return <Folder size={16} />;
|
|
80846
80964
|
|
|
80847
80965
|
return <File size={16} />;
|
|
@@ -80968,7 +81086,7 @@ export default function TreeTableSelectionDemo() {
|
|
|
80968
81086
|
</DataTable.THeadRow>
|
|
80969
81087
|
</DataTable.THead>
|
|
80970
81088
|
<DataTable.TBody key={JSON.stringify(selectionKeys)}>
|
|
80971
|
-
{({ item }: { item:
|
|
81089
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
80972
81090
|
<DataTable.Row key={String(item.key)}>
|
|
80973
81091
|
<DataTable.Cell>
|
|
80974
81092
|
<div className="flex items-center gap-2">
|
|
@@ -81049,6 +81167,7 @@ import type { DataTableExpansionEvent, DataTableSelectionEvent } from '@primerea
|
|
|
81049
81167
|
import type { DataTableSelectionInstance } from '@primereact/ui/datatable';
|
|
81050
81168
|
import type { RadioButtonRootChangeEvent } from '@primereact/ui/radiobutton';
|
|
81051
81169
|
import { DataTable } from '@primereact/ui/datatable';
|
|
81170
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
81052
81171
|
import { RadioButton } from '@primereact/ui/radiobutton';
|
|
81053
81172
|
import { Tag } from '@primereact/ui/tag';
|
|
81054
81173
|
import * as React from 'react';
|
|
@@ -81072,7 +81191,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
81072
81191
|
|
|
81073
81192
|
function TypeIcon({ type }: { type: string }) {
|
|
81074
81193
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
81194
|
+
|
|
81075
81195
|
if (type === 'Video') return <Video size={16} />;
|
|
81196
|
+
|
|
81076
81197
|
if (type === 'Folder') return <Folder size={16} />;
|
|
81077
81198
|
|
|
81078
81199
|
return <File size={16} />;
|
|
@@ -81116,7 +81237,7 @@ export default function RadioSelectionDemo() {
|
|
|
81116
81237
|
</DataTable.THeadRow>
|
|
81117
81238
|
</DataTable.THead>
|
|
81118
81239
|
<DataTable.TBody>
|
|
81119
|
-
{({ item }: { item:
|
|
81240
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
81120
81241
|
<DataTable.Row key={String(item.key)}>
|
|
81121
81242
|
<DataTable.Cell>
|
|
81122
81243
|
<DataTable.Selection mode="radio">
|
|
@@ -81194,6 +81315,7 @@ import { NodeService, type TreeTableNode } from '@/shared/services/node.service'
|
|
|
81194
81315
|
import type { DataTableExpansionEvent, DataTableSelectionEvent } from '@primereact/ui/datatable';
|
|
81195
81316
|
import { Badge } from '@primereact/ui/badge';
|
|
81196
81317
|
import { DataTable } from '@primereact/ui/datatable';
|
|
81318
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
81197
81319
|
import { Tag } from '@primereact/ui/tag';
|
|
81198
81320
|
import * as React from 'react';
|
|
81199
81321
|
import { File } from '@primeicons/react/file';
|
|
@@ -81216,7 +81338,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
81216
81338
|
|
|
81217
81339
|
function TypeIcon({ type }: { type: string }) {
|
|
81218
81340
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
81341
|
+
|
|
81219
81342
|
if (type === 'Video') return <Video size={16} />;
|
|
81343
|
+
|
|
81220
81344
|
if (type === 'Folder') return <Folder size={16} />;
|
|
81221
81345
|
|
|
81222
81346
|
return <File size={16} />;
|
|
@@ -81275,7 +81399,7 @@ export default function KeyboardDemo() {
|
|
|
81275
81399
|
</DataTable.THeadRow>
|
|
81276
81400
|
</DataTable.THead>
|
|
81277
81401
|
<DataTable.TBody>
|
|
81278
|
-
{({ item }: { item:
|
|
81402
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
81279
81403
|
<DataTable.Row key={String(item.key)}>
|
|
81280
81404
|
<DataTable.Cell>
|
|
81281
81405
|
<div className="flex items-center gap-2">
|
|
@@ -81345,6 +81469,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
81345
81469
|
import type { DataTableSortOrderInstance } from '@primereact/ui/datatable';
|
|
81346
81470
|
import { Badge } from '@primereact/ui/badge';
|
|
81347
81471
|
import { DataTable } from '@primereact/ui/datatable';
|
|
81472
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
81348
81473
|
import { OverlayBadge } from '@primereact/ui/overlaybadge';
|
|
81349
81474
|
import { Tag } from '@primereact/ui/tag';
|
|
81350
81475
|
import * as React from 'react';
|
|
@@ -81368,7 +81493,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
81368
81493
|
|
|
81369
81494
|
function TypeIcon({ type }: { type: string }) {
|
|
81370
81495
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
81496
|
+
|
|
81371
81497
|
if (type === 'Video') return <Video size={16} />;
|
|
81498
|
+
|
|
81372
81499
|
if (type === 'Folder') return <Folder size={16} />;
|
|
81373
81500
|
|
|
81374
81501
|
return <File size={16} />;
|
|
@@ -81440,7 +81567,7 @@ export default function SortDemo() {
|
|
|
81440
81567
|
</DataTable.THeadRow>
|
|
81441
81568
|
</DataTable.THead>
|
|
81442
81569
|
<DataTable.TBody>
|
|
81443
|
-
{({ item }: { item:
|
|
81570
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
81444
81571
|
<DataTable.Row key={String(item.key)}>
|
|
81445
81572
|
<DataTable.Cell>
|
|
81446
81573
|
<div className="flex items-center gap-2">
|
|
@@ -81506,6 +81633,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
81506
81633
|
import type { DataTableSortOrderInstance } from '@primereact/ui/datatable';
|
|
81507
81634
|
import { Badge } from '@primereact/ui/badge';
|
|
81508
81635
|
import { DataTable } from '@primereact/ui/datatable';
|
|
81636
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
81509
81637
|
import { OverlayBadge } from '@primereact/ui/overlaybadge';
|
|
81510
81638
|
import { Tag } from '@primereact/ui/tag';
|
|
81511
81639
|
import * as React from 'react';
|
|
@@ -81529,7 +81657,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
81529
81657
|
|
|
81530
81658
|
function TypeIcon({ type }: { type: string }) {
|
|
81531
81659
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
81660
|
+
|
|
81532
81661
|
if (type === 'Video') return <Video size={16} />;
|
|
81662
|
+
|
|
81533
81663
|
if (type === 'Folder') return <Folder size={16} />;
|
|
81534
81664
|
|
|
81535
81665
|
return <File size={16} />;
|
|
@@ -81601,7 +81731,7 @@ export default function MultiSortDemo() {
|
|
|
81601
81731
|
</DataTable.THeadRow>
|
|
81602
81732
|
</DataTable.THead>
|
|
81603
81733
|
<DataTable.TBody>
|
|
81604
|
-
{({ item }: { item:
|
|
81734
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
81605
81735
|
<DataTable.Row key={String(item.key)}>
|
|
81606
81736
|
<DataTable.Cell>
|
|
81607
81737
|
<div className="flex items-center gap-2">
|
|
@@ -81665,6 +81795,7 @@ import { SortAmountUpAlt } from '@primeicons/react/sort-amount-up-alt';
|
|
|
81665
81795
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
81666
81796
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
81667
81797
|
import { DataTable } from '@primereact/ui/datatable';
|
|
81798
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
81668
81799
|
import { Tag } from '@primereact/ui/tag';
|
|
81669
81800
|
import * as React from 'react';
|
|
81670
81801
|
import { File } from '@primeicons/react/file';
|
|
@@ -81687,7 +81818,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
81687
81818
|
|
|
81688
81819
|
function TypeIcon({ type }: { type: string }) {
|
|
81689
81820
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
81821
|
+
|
|
81690
81822
|
if (type === 'Video') return <Video size={16} />;
|
|
81823
|
+
|
|
81691
81824
|
if (type === 'Folder') return <Folder size={16} />;
|
|
81692
81825
|
|
|
81693
81826
|
return <File size={16} />;
|
|
@@ -81762,7 +81895,7 @@ export default function PresortDemo() {
|
|
|
81762
81895
|
</DataTable.THeadRow>
|
|
81763
81896
|
</DataTable.THead>
|
|
81764
81897
|
<DataTable.TBody>
|
|
81765
|
-
{({ item }: { item:
|
|
81898
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
81766
81899
|
<DataTable.Row key={String(item.key)}>
|
|
81767
81900
|
<DataTable.Cell>
|
|
81768
81901
|
<div className="flex items-center gap-2">
|
|
@@ -81826,6 +81959,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
81826
81959
|
import type { DataTableSortOrderInstance } from '@primereact/ui/datatable';
|
|
81827
81960
|
import { Badge } from '@primereact/ui/badge';
|
|
81828
81961
|
import { DataTable } from '@primereact/ui/datatable';
|
|
81962
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
81829
81963
|
import { OverlayBadge } from '@primereact/ui/overlaybadge';
|
|
81830
81964
|
import { Tag } from '@primereact/ui/tag';
|
|
81831
81965
|
import * as React from 'react';
|
|
@@ -81849,7 +81983,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
81849
81983
|
|
|
81850
81984
|
function TypeIcon({ type }: { type: string }) {
|
|
81851
81985
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
81986
|
+
|
|
81852
81987
|
if (type === 'Video') return <Video size={16} />;
|
|
81988
|
+
|
|
81853
81989
|
if (type === 'Folder') return <Folder size={16} />;
|
|
81854
81990
|
|
|
81855
81991
|
return <File size={16} />;
|
|
@@ -81953,7 +82089,7 @@ export default function PresortMultiDemo() {
|
|
|
81953
82089
|
</DataTable.THeadRow>
|
|
81954
82090
|
</DataTable.THead>
|
|
81955
82091
|
<DataTable.TBody>
|
|
81956
|
-
{({ item }: { item:
|
|
82092
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
81957
82093
|
<DataTable.Row key={String(item.key)}>
|
|
81958
82094
|
<DataTable.Cell>
|
|
81959
82095
|
<div className="flex items-center gap-2">
|
|
@@ -82023,6 +82159,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
82023
82159
|
import type { PaginatorRootChangeEvent } from '@primereact/ui/paginator';
|
|
82024
82160
|
import type { DataTablePaginationInstance } from '@primereact/ui/datatable';
|
|
82025
82161
|
import { DataTable } from '@primereact/ui/datatable';
|
|
82162
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
82026
82163
|
import { Paginator } from '@primereact/ui/paginator';
|
|
82027
82164
|
import { Tag } from '@primereact/ui/tag';
|
|
82028
82165
|
import type { PaginatorPagesInstance } from '@primereact/ui/paginator';
|
|
@@ -82047,7 +82184,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
82047
82184
|
|
|
82048
82185
|
function TypeIcon({ type }: { type: string }) {
|
|
82049
82186
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
82187
|
+
|
|
82050
82188
|
if (type === 'Video') return <Video size={16} />;
|
|
82189
|
+
|
|
82051
82190
|
if (type === 'Folder') return <Folder size={16} />;
|
|
82052
82191
|
|
|
82053
82192
|
return <File size={16} />;
|
|
@@ -82088,7 +82227,7 @@ export default function PaginationDemo() {
|
|
|
82088
82227
|
</DataTable.THeadRow>
|
|
82089
82228
|
</DataTable.THead>
|
|
82090
82229
|
<DataTable.TBody>
|
|
82091
|
-
{({ item }: { item:
|
|
82230
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
82092
82231
|
<DataTable.Row key={String(item.key)}>
|
|
82093
82232
|
<DataTable.Cell>
|
|
82094
82233
|
<div className="flex items-center gap-2">
|
|
@@ -82197,6 +82336,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
82197
82336
|
import { Video } from '@primeicons/react/video';
|
|
82198
82337
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
82199
82338
|
import { DataTable } from '@primereact/ui/datatable';
|
|
82339
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
82200
82340
|
import { Tag } from '@primereact/ui/tag';
|
|
82201
82341
|
import * as React from 'react';
|
|
82202
82342
|
|
|
@@ -82220,7 +82360,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
82220
82360
|
|
|
82221
82361
|
function TypeIcon({ type }: { type: string }) {
|
|
82222
82362
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
82363
|
+
|
|
82223
82364
|
if (type === 'Video') return <Video size={16} />;
|
|
82365
|
+
|
|
82224
82366
|
if (type === 'Folder') return <Folder size={16} />;
|
|
82225
82367
|
|
|
82226
82368
|
return <File size={16} />;
|
|
@@ -82276,7 +82418,7 @@ export default function TreeTableScrollDemo() {
|
|
|
82276
82418
|
</DataTable.THeadRow>
|
|
82277
82419
|
</DataTable.THead>
|
|
82278
82420
|
<DataTable.TBody>
|
|
82279
|
-
{({ item }: { item:
|
|
82421
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
82280
82422
|
<DataTable.Row key={String(item.key)}>
|
|
82281
82423
|
<DataTable.Cell>
|
|
82282
82424
|
<div className="flex items-center gap-2">
|
|
@@ -82337,6 +82479,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
82337
82479
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
82338
82480
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
82339
82481
|
import { DataTable } from '@primereact/ui/datatable';
|
|
82482
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
82340
82483
|
import { Tag } from '@primereact/ui/tag';
|
|
82341
82484
|
import * as React from 'react';
|
|
82342
82485
|
import { File } from '@primeicons/react/file';
|
|
@@ -82359,7 +82502,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
82359
82502
|
|
|
82360
82503
|
function TypeIcon({ type }: { type: string }) {
|
|
82361
82504
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
82505
|
+
|
|
82362
82506
|
if (type === 'Video') return <Video size={16} />;
|
|
82507
|
+
|
|
82363
82508
|
if (type === 'Folder') return <Folder size={16} />;
|
|
82364
82509
|
|
|
82365
82510
|
return <File size={16} />;
|
|
@@ -82409,7 +82554,7 @@ export default function ScrollHorizontalDemo() {
|
|
|
82409
82554
|
</DataTable.THeadRow>
|
|
82410
82555
|
</DataTable.THead>
|
|
82411
82556
|
<DataTable.TBody>
|
|
82412
|
-
{({ item }: { item:
|
|
82557
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
82413
82558
|
<DataTable.Row key={String(item.key)}>
|
|
82414
82559
|
<DataTable.Cell>
|
|
82415
82560
|
<div className="flex items-center gap-2">
|
|
@@ -82475,6 +82620,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
82475
82620
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
82476
82621
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
82477
82622
|
import { DataTable } from '@primereact/ui/datatable';
|
|
82623
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
82478
82624
|
import { Tag } from '@primereact/ui/tag';
|
|
82479
82625
|
import * as React from 'react';
|
|
82480
82626
|
import { File } from '@primeicons/react/file';
|
|
@@ -82497,7 +82643,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
82497
82643
|
|
|
82498
82644
|
function TypeIcon({ type }: { type: string }) {
|
|
82499
82645
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
82646
|
+
|
|
82500
82647
|
if (type === 'Video') return <Video size={16} />;
|
|
82648
|
+
|
|
82501
82649
|
if (type === 'Folder') return <Folder size={16} />;
|
|
82502
82650
|
|
|
82503
82651
|
return <File size={16} />;
|
|
@@ -82538,7 +82686,7 @@ export default function ScrollFlexDemo() {
|
|
|
82538
82686
|
</DataTable.THeadRow>
|
|
82539
82687
|
</DataTable.THead>
|
|
82540
82688
|
<DataTable.TBody>
|
|
82541
|
-
{({ item }: { item:
|
|
82689
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
82542
82690
|
<DataTable.Row key={String(item.key)}>
|
|
82543
82691
|
<DataTable.Cell>
|
|
82544
82692
|
<div className="flex items-center gap-2">
|
|
@@ -82604,6 +82752,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
82604
82752
|
import { Video } from '@primeicons/react/video';
|
|
82605
82753
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
82606
82754
|
import { DataTable } from '@primereact/ui/datatable';
|
|
82755
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
82607
82756
|
import { Tag } from '@primereact/ui/tag';
|
|
82608
82757
|
import * as React from 'react';
|
|
82609
82758
|
|
|
@@ -82623,7 +82772,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
82623
82772
|
|
|
82624
82773
|
function TypeIcon({ type }: { type: string }) {
|
|
82625
82774
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
82775
|
+
|
|
82626
82776
|
if (type === 'Video') return <Video size={16} />;
|
|
82777
|
+
|
|
82627
82778
|
if (type === 'Folder') return <Folder size={16} />;
|
|
82628
82779
|
|
|
82629
82780
|
return <File size={16} />;
|
|
@@ -82697,7 +82848,7 @@ export default function TreeTableFrozenColumnsDemo() {
|
|
|
82697
82848
|
</DataTable.THeadRow>
|
|
82698
82849
|
</DataTable.THead>
|
|
82699
82850
|
<DataTable.TBody>
|
|
82700
|
-
{({ item }: { item:
|
|
82851
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
82701
82852
|
<DataTable.Row key={String(item.key)}>
|
|
82702
82853
|
<DataTable.Cell frozen>
|
|
82703
82854
|
<div className="flex items-center gap-2">
|
|
@@ -82763,6 +82914,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
82763
82914
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
82764
82915
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
82765
82916
|
import { DataTable } from '@primereact/ui/datatable';
|
|
82917
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
82766
82918
|
import { Tag } from '@primereact/ui/tag';
|
|
82767
82919
|
import * as React from 'react';
|
|
82768
82920
|
import { File } from '@primeicons/react/file';
|
|
@@ -82785,7 +82937,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
82785
82937
|
|
|
82786
82938
|
function TypeIcon({ type }: { type: string }) {
|
|
82787
82939
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
82940
|
+
|
|
82788
82941
|
if (type === 'Video') return <Video size={16} />;
|
|
82942
|
+
|
|
82789
82943
|
if (type === 'Folder') return <Folder size={16} />;
|
|
82790
82944
|
|
|
82791
82945
|
return <File size={16} />;
|
|
@@ -82835,7 +82989,7 @@ export default function ScrollFrozenColumnsMultiDemo() {
|
|
|
82835
82989
|
</DataTable.THeadRow>
|
|
82836
82990
|
</DataTable.THead>
|
|
82837
82991
|
<DataTable.TBody>
|
|
82838
|
-
{({ item }: { item:
|
|
82992
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
82839
82993
|
<DataTable.Row key={String(item.key)}>
|
|
82840
82994
|
<DataTable.Cell frozen>
|
|
82841
82995
|
<div className="flex items-center gap-2">
|
|
@@ -82906,6 +83060,7 @@ import { LockOpen } from '@primeicons/react/lock-open';
|
|
|
82906
83060
|
import { Video } from '@primeicons/react/video';
|
|
82907
83061
|
import { Button } from '@primereact/ui/button';
|
|
82908
83062
|
import { DataTable } from '@primereact/ui/datatable';
|
|
83063
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
82909
83064
|
import { Tag } from '@primereact/ui/tag';
|
|
82910
83065
|
import * as React from 'react';
|
|
82911
83066
|
|
|
@@ -82925,7 +83080,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
82925
83080
|
|
|
82926
83081
|
function TypeIcon({ type }: { type: string }) {
|
|
82927
83082
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
83083
|
+
|
|
82928
83084
|
if (type === 'Video') return <Video size={16} />;
|
|
83085
|
+
|
|
82929
83086
|
if (type === 'Folder') return <Folder size={16} />;
|
|
82930
83087
|
|
|
82931
83088
|
return <File size={16} />;
|
|
@@ -82989,7 +83146,7 @@ export default function TreeTableFrozenRowsDemo() {
|
|
|
82989
83146
|
</DataTable.Row>
|
|
82990
83147
|
);
|
|
82991
83148
|
|
|
82992
|
-
const renderBodyRow = (item:
|
|
83149
|
+
const renderBodyRow = (item: DataTableTreeRow<TreeNode>) => (
|
|
82993
83150
|
<DataTable.Row key={String(item.key)}>
|
|
82994
83151
|
<DataTable.Cell>
|
|
82995
83152
|
<div className="flex items-center gap-2">
|
|
@@ -83043,7 +83200,7 @@ export default function TreeTableFrozenRowsDemo() {
|
|
|
83043
83200
|
<DataTable.FrozenTBody>
|
|
83044
83201
|
{lockedFolders.flatMap((folder) => flattenBranch(folder).map((node) => renderFrozenRow(node)))}
|
|
83045
83202
|
</DataTable.FrozenTBody>
|
|
83046
|
-
<DataTable.TBody>{({ item }: { item:
|
|
83203
|
+
<DataTable.TBody>{({ item }: { item: DataTableTreeRow<TreeNode> }) => renderBodyRow(item)}</DataTable.TBody>
|
|
83047
83204
|
<DataTable.EmptyTBody>
|
|
83048
83205
|
<DataTable.Row>
|
|
83049
83206
|
<DataTable.Cell colSpan={4}>
|
|
@@ -83087,6 +83244,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
83087
83244
|
import { Video } from '@primeicons/react/video';
|
|
83088
83245
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
83089
83246
|
import { DataTable } from '@primereact/ui/datatable';
|
|
83247
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
83090
83248
|
import { InputText } from '@primereact/ui/inputtext';
|
|
83091
83249
|
import { Tag } from '@primereact/ui/tag';
|
|
83092
83250
|
import * as React from 'react';
|
|
@@ -83101,7 +83259,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
83101
83259
|
|
|
83102
83260
|
function TypeIcon({ type }: { type: string }) {
|
|
83103
83261
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
83262
|
+
|
|
83104
83263
|
if (type === 'Video') return <Video size={16} />;
|
|
83264
|
+
|
|
83105
83265
|
if (type === 'Folder') return <Folder size={16} />;
|
|
83106
83266
|
|
|
83107
83267
|
return <File size={16} />;
|
|
@@ -83208,7 +83368,7 @@ export default function TreeTableCellEditDemo() {
|
|
|
83208
83368
|
</DataTable.THeadRow>
|
|
83209
83369
|
</DataTable.THead>
|
|
83210
83370
|
<DataTable.TBody>
|
|
83211
|
-
{({ item, index }: { item:
|
|
83371
|
+
{({ item, index }: { item: DataTableTreeRow<TreeNode>; index: number }) => (
|
|
83212
83372
|
<DataTable.Row key={String(item.key)}>
|
|
83213
83373
|
<DataTable.Cell>
|
|
83214
83374
|
<div className="flex items-center gap-2">
|
|
@@ -83226,7 +83386,7 @@ export default function TreeTableCellEditDemo() {
|
|
|
83226
83386
|
<DataTable.CellEditorContent>
|
|
83227
83387
|
<InputText
|
|
83228
83388
|
defaultValue={String(item.name)}
|
|
83229
|
-
onChange={(e:
|
|
83389
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83230
83390
|
pendingValueRef.current[`${item.key}-name`] = e.target.value;
|
|
83231
83391
|
}}
|
|
83232
83392
|
size="small"
|
|
@@ -83242,7 +83402,7 @@ export default function TreeTableCellEditDemo() {
|
|
|
83242
83402
|
<DataTable.CellEditorContent>
|
|
83243
83403
|
<InputText
|
|
83244
83404
|
defaultValue={String(item.size)}
|
|
83245
|
-
onChange={(e:
|
|
83405
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83246
83406
|
pendingValueRef.current[`${item.key}-size`] = e.target.value;
|
|
83247
83407
|
}}
|
|
83248
83408
|
size="small"
|
|
@@ -83259,7 +83419,7 @@ export default function TreeTableCellEditDemo() {
|
|
|
83259
83419
|
<DataTable.CellEditorContent>
|
|
83260
83420
|
<InputText
|
|
83261
83421
|
defaultValue={String(item.type)}
|
|
83262
|
-
onChange={(e:
|
|
83422
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83263
83423
|
pendingValueRef.current[`${item.key}-type`] = e.target.value;
|
|
83264
83424
|
}}
|
|
83265
83425
|
size="small"
|
|
@@ -83313,6 +83473,7 @@ import type { DataTableSelectionInstance } from '@primereact/ui/datatable';
|
|
|
83313
83473
|
import { Badge } from '@primereact/ui/badge';
|
|
83314
83474
|
import { Checkbox } from '@primereact/ui/checkbox';
|
|
83315
83475
|
import { DataTable } from '@primereact/ui/datatable';
|
|
83476
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
83316
83477
|
import { InputText } from '@primereact/ui/inputtext';
|
|
83317
83478
|
import { Tag } from '@primereact/ui/tag';
|
|
83318
83479
|
import * as React from 'react';
|
|
@@ -83336,7 +83497,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
83336
83497
|
|
|
83337
83498
|
function TypeIcon({ type }: { type: string }) {
|
|
83338
83499
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
83500
|
+
|
|
83339
83501
|
if (type === 'Video') return <Video size={16} />;
|
|
83502
|
+
|
|
83340
83503
|
if (type === 'Folder') return <Folder size={16} />;
|
|
83341
83504
|
|
|
83342
83505
|
return <File size={16} />;
|
|
@@ -83432,7 +83595,7 @@ export default function CellEditSelectionDemo() {
|
|
|
83432
83595
|
</DataTable.THeadRow>
|
|
83433
83596
|
</DataTable.THead>
|
|
83434
83597
|
<DataTable.TBody>
|
|
83435
|
-
{({ item, index }: { item:
|
|
83598
|
+
{({ item, index }: { item: DataTableTreeRow<TreeTableNode>; index: number }) => (
|
|
83436
83599
|
<DataTable.Row key={String(item.key)}>
|
|
83437
83600
|
<DataTable.Cell>
|
|
83438
83601
|
<DataTable.Selection>
|
|
@@ -83470,7 +83633,7 @@ export default function CellEditSelectionDemo() {
|
|
|
83470
83633
|
<DataTable.CellEditorContent>
|
|
83471
83634
|
<InputText
|
|
83472
83635
|
defaultValue={String(item.name)}
|
|
83473
|
-
onChange={(e:
|
|
83636
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83474
83637
|
pendingValueRef.current[`${item.key}-name`] = e.target.value;
|
|
83475
83638
|
}}
|
|
83476
83639
|
size="small"
|
|
@@ -83488,7 +83651,7 @@ export default function CellEditSelectionDemo() {
|
|
|
83488
83651
|
<DataTable.CellEditorContent>
|
|
83489
83652
|
<InputText
|
|
83490
83653
|
defaultValue={String(item.size)}
|
|
83491
|
-
onChange={(e:
|
|
83654
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83492
83655
|
pendingValueRef.current[`${item.key}-size`] = e.target.value;
|
|
83493
83656
|
}}
|
|
83494
83657
|
size="small"
|
|
@@ -83546,9 +83709,11 @@ import { Times } from '@primeicons/react/times';
|
|
|
83546
83709
|
import type { DataTableExpansionEvent, DataTableRowEditEvent } from '@primereact/ui/datatable';
|
|
83547
83710
|
import { Button } from '@primereact/ui/button';
|
|
83548
83711
|
import { DataTable } from '@primereact/ui/datatable';
|
|
83712
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
83549
83713
|
import { InputText } from '@primereact/ui/inputtext';
|
|
83550
83714
|
import { Tag } from '@primereact/ui/tag';
|
|
83551
83715
|
import * as React from 'react';
|
|
83716
|
+
import type { DataTableEditingEvent } from '@primereact/ui/datatable';
|
|
83552
83717
|
|
|
83553
83718
|
const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> = {
|
|
83554
83719
|
Folder: 'warn',
|
|
@@ -83559,7 +83724,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
83559
83724
|
|
|
83560
83725
|
function TypeIcon({ type }: { type: string }) {
|
|
83561
83726
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
83727
|
+
|
|
83562
83728
|
if (type === 'Video') return <Video size={16} />;
|
|
83729
|
+
|
|
83563
83730
|
if (type === 'Folder') return <Folder size={16} />;
|
|
83564
83731
|
|
|
83565
83732
|
return <File size={16} />;
|
|
@@ -83655,7 +83822,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
83655
83822
|
onExpandedChange={(e: DataTableExpansionEvent) => setExpandedKeys(e.value)}
|
|
83656
83823
|
editMode="row"
|
|
83657
83824
|
editingKeys={editingKeys}
|
|
83658
|
-
onEditingKeysChange={(e:
|
|
83825
|
+
onEditingKeysChange={(e: DataTableEditingEvent) => setEditingKeys(e.value)}
|
|
83659
83826
|
onRowEditSave={handleSave}
|
|
83660
83827
|
onRowEditCancel={handleCancel}
|
|
83661
83828
|
>
|
|
@@ -83678,7 +83845,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
83678
83845
|
</DataTable.THeadRow>
|
|
83679
83846
|
</DataTable.THead>
|
|
83680
83847
|
<DataTable.TBody>
|
|
83681
|
-
{({ item, index }: { item:
|
|
83848
|
+
{({ item, index }: { item: DataTableTreeRow<TreeNode>; index: number }) => {
|
|
83682
83849
|
const key = String(item.key);
|
|
83683
83850
|
|
|
83684
83851
|
return (
|
|
@@ -83700,7 +83867,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
83700
83867
|
<DataTable.CellEditorContent>
|
|
83701
83868
|
<InputText
|
|
83702
83869
|
defaultValue={String(item.name)}
|
|
83703
|
-
onChange={(e:
|
|
83870
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83704
83871
|
draftRef.current[key] = { ...draftRef.current[key], name: e.target.value };
|
|
83705
83872
|
}}
|
|
83706
83873
|
size="small"
|
|
@@ -83716,7 +83883,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
83716
83883
|
<DataTable.CellEditorContent>
|
|
83717
83884
|
<InputText
|
|
83718
83885
|
defaultValue={String(item.size)}
|
|
83719
|
-
onChange={(e:
|
|
83886
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83720
83887
|
draftRef.current[key] = { ...draftRef.current[key], size: e.target.value };
|
|
83721
83888
|
}}
|
|
83722
83889
|
size="small"
|
|
@@ -83733,7 +83900,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
83733
83900
|
<DataTable.CellEditorContent>
|
|
83734
83901
|
<InputText
|
|
83735
83902
|
defaultValue={String(item.type)}
|
|
83736
|
-
onChange={(e:
|
|
83903
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83737
83904
|
draftRef.current[key] = { ...draftRef.current[key], type: e.target.value };
|
|
83738
83905
|
}}
|
|
83739
83906
|
size="small"
|
|
@@ -83800,6 +83967,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
83800
83967
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
83801
83968
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
83802
83969
|
import { DataTable } from '@primereact/ui/datatable';
|
|
83970
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
83803
83971
|
import { Tag } from '@primereact/ui/tag';
|
|
83804
83972
|
import * as React from 'react';
|
|
83805
83973
|
import { File } from '@primeicons/react/file';
|
|
@@ -83822,7 +83990,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
83822
83990
|
|
|
83823
83991
|
function TypeIcon({ type }: { type: string }) {
|
|
83824
83992
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
83993
|
+
|
|
83825
83994
|
if (type === 'Video') return <Video size={16} />;
|
|
83995
|
+
|
|
83826
83996
|
if (type === 'Folder') return <Folder size={16} />;
|
|
83827
83997
|
|
|
83828
83998
|
return <File size={16} />;
|
|
@@ -83868,7 +84038,7 @@ export default function ResizeDemo() {
|
|
|
83868
84038
|
</DataTable.THeadRow>
|
|
83869
84039
|
</DataTable.THead>
|
|
83870
84040
|
<DataTable.TBody>
|
|
83871
|
-
{({ item }: { item:
|
|
84041
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
83872
84042
|
<DataTable.Row key={String(item.key)}>
|
|
83873
84043
|
<DataTable.Cell>
|
|
83874
84044
|
<div className="flex items-center gap-2">
|
|
@@ -83929,6 +84099,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
83929
84099
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
83930
84100
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
83931
84101
|
import { DataTable } from '@primereact/ui/datatable';
|
|
84102
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
83932
84103
|
import { Tag } from '@primereact/ui/tag';
|
|
83933
84104
|
import * as React from 'react';
|
|
83934
84105
|
import { File } from '@primeicons/react/file';
|
|
@@ -83951,7 +84122,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
83951
84122
|
|
|
83952
84123
|
function TypeIcon({ type }: { type: string }) {
|
|
83953
84124
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
84125
|
+
|
|
83954
84126
|
if (type === 'Video') return <Video size={16} />;
|
|
84127
|
+
|
|
83955
84128
|
if (type === 'Folder') return <Folder size={16} />;
|
|
83956
84129
|
|
|
83957
84130
|
return <File size={16} />;
|
|
@@ -83998,7 +84171,7 @@ export default function ResizeExpandDemo() {
|
|
|
83998
84171
|
</DataTable.THeadRow>
|
|
83999
84172
|
</DataTable.THead>
|
|
84000
84173
|
<DataTable.TBody>
|
|
84001
|
-
{({ item }: { item:
|
|
84174
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
84002
84175
|
<DataTable.Row key={String(item.key)}>
|
|
84003
84176
|
<DataTable.Cell>
|
|
84004
84177
|
<div className="flex items-center gap-2">
|
|
@@ -84068,6 +84241,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
84068
84241
|
import { Video } from '@primeicons/react/video';
|
|
84069
84242
|
import type { DataTableColumnReorderEvent, DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
84070
84243
|
import { DataTable } from '@primereact/ui/datatable';
|
|
84244
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
84071
84245
|
import { Tag } from '@primereact/ui/tag';
|
|
84072
84246
|
import * as React from 'react';
|
|
84073
84247
|
|
|
@@ -84086,7 +84260,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
84086
84260
|
|
|
84087
84261
|
function TypeIcon({ type }: { type: string }) {
|
|
84088
84262
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
84263
|
+
|
|
84089
84264
|
if (type === 'Video') return <Video size={16} />;
|
|
84265
|
+
|
|
84090
84266
|
if (type === 'Folder') return <Folder size={16} />;
|
|
84091
84267
|
|
|
84092
84268
|
return <File size={16} />;
|
|
@@ -84103,7 +84279,7 @@ const initialColumns: Column[] = [
|
|
|
84103
84279
|
{ field: 'type', header: 'Type' }
|
|
84104
84280
|
];
|
|
84105
84281
|
|
|
84106
|
-
function renderCell(field: Column['field'], item:
|
|
84282
|
+
function renderCell(field: Column['field'], item: DataTableTreeRow<TreeTableNode>) {
|
|
84107
84283
|
if (field === 'name') {
|
|
84108
84284
|
return (
|
|
84109
84285
|
<div className="flex items-center gap-2">
|
|
@@ -84171,7 +84347,7 @@ export default function ReorderDemo() {
|
|
|
84171
84347
|
</DataTable.THeadRow>
|
|
84172
84348
|
</DataTable.THead>
|
|
84173
84349
|
<DataTable.TBody key={columns.map((c) => c.field).join(',')}>
|
|
84174
|
-
{({ item }: { item:
|
|
84350
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
84175
84351
|
<DataTable.Row key={String(item.key)}>
|
|
84176
84352
|
{columns.map((col) => (
|
|
84177
84353
|
<DataTable.Cell key={col.field}>{renderCell(col.field, item)}</DataTable.Cell>
|
|
@@ -84224,6 +84400,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
84224
84400
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
84225
84401
|
import type { DataTableExpansionEvent, DataTableRowReorderEvent } from '@primereact/ui/datatable';
|
|
84226
84402
|
import { DataTable } from '@primereact/ui/datatable';
|
|
84403
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
84227
84404
|
import { Tag } from '@primereact/ui/tag';
|
|
84228
84405
|
import * as React from 'react';
|
|
84229
84406
|
import { File } from '@primeicons/react/file';
|
|
@@ -84246,7 +84423,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
84246
84423
|
|
|
84247
84424
|
function TypeIcon({ type }: { type: string }) {
|
|
84248
84425
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
84426
|
+
|
|
84249
84427
|
if (type === 'Video') return <Video size={16} />;
|
|
84428
|
+
|
|
84250
84429
|
if (type === 'Folder') return <Folder size={16} />;
|
|
84251
84430
|
|
|
84252
84431
|
return <File size={16} />;
|
|
@@ -84266,6 +84445,7 @@ export default function RowReorderDemo() {
|
|
|
84266
84445
|
const toNode = flat[e.dropIndex];
|
|
84267
84446
|
|
|
84268
84447
|
if (!fromNode || !toNode) return;
|
|
84448
|
+
|
|
84269
84449
|
if ((fromNode._treeLevel ?? 0) !== 0 || (toNode._treeLevel ?? 0) !== 0) return;
|
|
84270
84450
|
|
|
84271
84451
|
setNodes((prev) => {
|
|
@@ -84314,7 +84494,7 @@ export default function RowReorderDemo() {
|
|
|
84314
84494
|
</DataTable.THeadRow>
|
|
84315
84495
|
</DataTable.THead>
|
|
84316
84496
|
<DataTable.TBody>
|
|
84317
|
-
{({ item, index }: { item:
|
|
84497
|
+
{({ item, index }: { item: DataTableTreeRow<TreeTableNode>; index: number }) => (
|
|
84318
84498
|
<DataTable.Row key={String(item.key)}>
|
|
84319
84499
|
<DataTable.Cell>
|
|
84320
84500
|
{Number(item._treeLevel ?? 0) === 0 ? (
|
|
@@ -84391,6 +84571,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
84391
84571
|
import { Button } from '@primereact/ui/button';
|
|
84392
84572
|
import { Checkbox } from '@primereact/ui/checkbox';
|
|
84393
84573
|
import { DataTable } from '@primereact/ui/datatable';
|
|
84574
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
84394
84575
|
import { Popover } from '@primereact/ui/popover';
|
|
84395
84576
|
import { Tag } from '@primereact/ui/tag';
|
|
84396
84577
|
import * as React from 'react';
|
|
@@ -84414,7 +84595,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
84414
84595
|
|
|
84415
84596
|
function TypeIcon({ type }: { type: string }) {
|
|
84416
84597
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
84598
|
+
|
|
84417
84599
|
if (type === 'Video') return <Video size={16} />;
|
|
84600
|
+
|
|
84418
84601
|
if (type === 'Folder') return <Folder size={16} />;
|
|
84419
84602
|
|
|
84420
84603
|
return <File size={16} />;
|
|
@@ -84436,7 +84619,7 @@ const initialColumns: ColumnDef[] = [
|
|
|
84436
84619
|
|
|
84437
84620
|
const defaultVisibleFields: ColumnDef['field'][] = ['name', 'size', 'type'];
|
|
84438
84621
|
|
|
84439
|
-
function renderCell(field: ColumnDef['field'], item:
|
|
84622
|
+
function renderCell(field: ColumnDef['field'], item: DataTableTreeRow<TreeTableNode>) {
|
|
84440
84623
|
if (field === 'name') {
|
|
84441
84624
|
return (
|
|
84442
84625
|
<div className="flex items-center gap-2">
|
|
@@ -84497,6 +84680,7 @@ function ColumnsPopover({
|
|
|
84497
84680
|
|
|
84498
84681
|
if (set.has(field)) set.delete(field);
|
|
84499
84682
|
else set.add(field);
|
|
84683
|
+
|
|
84500
84684
|
onVisibleFieldsChange(Array.from(set));
|
|
84501
84685
|
};
|
|
84502
84686
|
|
|
@@ -84605,7 +84789,7 @@ export default function ColumnToggleDemo() {
|
|
|
84605
84789
|
</DataTable.THeadRow>
|
|
84606
84790
|
</DataTable.THead>
|
|
84607
84791
|
<DataTable.TBody key={visibleFields.join(',') + '|' + columns.map((c) => c.field).join(',')}>
|
|
84608
|
-
{({ item }: { item:
|
|
84792
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
84609
84793
|
<DataTable.Row key={String(item.key)}>
|
|
84610
84794
|
{visibleColumns.map((col) => (
|
|
84611
84795
|
<DataTable.Cell key={col.field}>{renderCell(col.field, item)}</DataTable.Cell>
|
|
@@ -84652,6 +84836,7 @@ import { ChevronDown } from '@primeicons/react/chevron-down';
|
|
|
84652
84836
|
import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
84653
84837
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
84654
84838
|
import { DataTable } from '@primereact/ui/datatable';
|
|
84839
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
84655
84840
|
import { Tag } from '@primereact/ui/tag';
|
|
84656
84841
|
import * as React from 'react';
|
|
84657
84842
|
|
|
@@ -84751,7 +84936,7 @@ export default function ColumnGroupDemo() {
|
|
|
84751
84936
|
</DataTable.THeadRow>
|
|
84752
84937
|
</DataTable.THead>
|
|
84753
84938
|
<DataTable.TBody>
|
|
84754
|
-
{({ item }: { item:
|
|
84939
|
+
{({ item }: { item: DataTableTreeRow<SalesNode> }) => (
|
|
84755
84940
|
<DataTable.Row key={String(item.key)}>
|
|
84756
84941
|
<DataTable.Cell>
|
|
84757
84942
|
<div className="flex items-center gap-2">
|
|
@@ -84830,7 +85015,7 @@ import { Database } from '@primeicons/react/database';
|
|
|
84830
85015
|
import { SortAlt } from '@primeicons/react/sort-alt';
|
|
84831
85016
|
import { SortAmountDown } from '@primeicons/react/sort-amount-down';
|
|
84832
85017
|
import { SortAmountUpAlt } from '@primeicons/react/sort-amount-up-alt';
|
|
84833
|
-
import type { DataTableExpansionEvent, DataTableFilterInstance } from '@primereact/ui/datatable';
|
|
85018
|
+
import type { DataTableExpansionEvent, DataTableFilterInstance, DataTableTreeRow } from '@primereact/ui/datatable';
|
|
84834
85019
|
import { DataTable, FilterMatchMode } from '@primereact/ui/datatable';
|
|
84835
85020
|
import { InputText } from '@primereact/ui/inputtext';
|
|
84836
85021
|
import { Tag } from '@primereact/ui/tag';
|
|
@@ -84950,7 +85135,7 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
84950
85135
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
84951
85136
|
<InputText
|
|
84952
85137
|
value={(value as string) ?? ''}
|
|
84953
|
-
onChange={(e:
|
|
85138
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
84954
85139
|
placeholder="Search"
|
|
84955
85140
|
size="small"
|
|
84956
85141
|
fluid
|
|
@@ -84964,7 +85149,9 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
84964
85149
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
84965
85150
|
<InputText
|
|
84966
85151
|
value={(value as string) ?? ''}
|
|
84967
|
-
onChange={(e:
|
|
85152
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
85153
|
+
onChange(e, e.target.value ? Number(e.target.value) : null, 'gte')
|
|
85154
|
+
}
|
|
84968
85155
|
placeholder="≥"
|
|
84969
85156
|
size="small"
|
|
84970
85157
|
fluid
|
|
@@ -84977,7 +85164,7 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
84977
85164
|
</DataTable.THeadRow>
|
|
84978
85165
|
</DataTable.THead>
|
|
84979
85166
|
<DataTable.TBody>
|
|
84980
|
-
{({ item }: { item:
|
|
85167
|
+
{({ item }: { item: DataTableTreeRow<SalesNode> }) => (
|
|
84981
85168
|
<DataTable.Row key={String(item.key)}>
|
|
84982
85169
|
<DataTable.Cell>
|
|
84983
85170
|
<div className="flex items-center gap-2">
|
|
@@ -85054,6 +85241,7 @@ import { FilterMatchMode } from '@primereact/ui/datatable';
|
|
|
85054
85241
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
85055
85242
|
import type { DataTableFilterInstance } from '@primereact/ui/datatable';
|
|
85056
85243
|
import { DataTable } from '@primereact/ui/datatable';
|
|
85244
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
85057
85245
|
import { IconField } from '@primereact/ui/iconfield';
|
|
85058
85246
|
import { InputText } from '@primereact/ui/inputtext';
|
|
85059
85247
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
@@ -85075,7 +85263,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
85075
85263
|
|
|
85076
85264
|
function TypeIcon({ type }: { type: string }) {
|
|
85077
85265
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
85266
|
+
|
|
85078
85267
|
if (type === 'Video') return <Video size={16} />;
|
|
85268
|
+
|
|
85079
85269
|
if (type === 'Folder') return <Folder size={16} />;
|
|
85080
85270
|
|
|
85081
85271
|
return <File size={16} />;
|
|
@@ -85114,7 +85304,7 @@ export default function FilterBasicDemo() {
|
|
|
85114
85304
|
type="search"
|
|
85115
85305
|
placeholder="Keyword search"
|
|
85116
85306
|
value={globalFilter}
|
|
85117
|
-
onChange={(e:
|
|
85307
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
85118
85308
|
className="w-full"
|
|
85119
85309
|
/>
|
|
85120
85310
|
</IconField.Root>
|
|
@@ -85150,7 +85340,7 @@ export default function FilterBasicDemo() {
|
|
|
85150
85340
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
85151
85341
|
<InputText
|
|
85152
85342
|
value={(value as string) ?? ''}
|
|
85153
|
-
onChange={(e:
|
|
85343
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
85154
85344
|
placeholder="Search name..."
|
|
85155
85345
|
size="small"
|
|
85156
85346
|
fluid
|
|
@@ -85191,7 +85381,7 @@ export default function FilterBasicDemo() {
|
|
|
85191
85381
|
</DataTable.THeadRow>
|
|
85192
85382
|
</DataTable.THead>
|
|
85193
85383
|
<DataTable.TBody>
|
|
85194
|
-
{({ item }: { item:
|
|
85384
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
85195
85385
|
<DataTable.Row key={String(item.key)}>
|
|
85196
85386
|
<DataTable.Cell>
|
|
85197
85387
|
<div className="flex items-center gap-2">
|
|
@@ -85266,6 +85456,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
85266
85456
|
import type { DataTableFilterInstance } from '@primereact/ui/datatable';
|
|
85267
85457
|
import { Button } from '@primereact/ui/button';
|
|
85268
85458
|
import { DataTable } from '@primereact/ui/datatable';
|
|
85459
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
85269
85460
|
import { IconField } from '@primereact/ui/iconfield';
|
|
85270
85461
|
import { InputText } from '@primereact/ui/inputtext';
|
|
85271
85462
|
import { Popover, type PopoverRootOpenChangeEvent } from '@primereact/ui/popover';
|
|
@@ -85288,7 +85479,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
85288
85479
|
|
|
85289
85480
|
function TypeIcon({ type }: { type: string }) {
|
|
85290
85481
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
85482
|
+
|
|
85291
85483
|
if (type === 'Video') return <Video size={16} />;
|
|
85484
|
+
|
|
85292
85485
|
if (type === 'Folder') return <Folder size={16} />;
|
|
85293
85486
|
|
|
85294
85487
|
return <File size={16} />;
|
|
@@ -85427,7 +85620,7 @@ export default function FilterAdvancedDemo() {
|
|
|
85427
85620
|
type="search"
|
|
85428
85621
|
placeholder="Keyword search"
|
|
85429
85622
|
value={globalFilter}
|
|
85430
|
-
onChange={(e:
|
|
85623
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
85431
85624
|
className="w-full"
|
|
85432
85625
|
/>
|
|
85433
85626
|
</IconField.Root>
|
|
@@ -85521,7 +85714,9 @@ export default function FilterAdvancedDemo() {
|
|
|
85521
85714
|
</div>
|
|
85522
85715
|
<InputText
|
|
85523
85716
|
value={(constraint.value as string) ?? ''}
|
|
85524
|
-
onChange={(e:
|
|
85717
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
85718
|
+
onConstraintChange(e, idx, e.target.value)
|
|
85719
|
+
}
|
|
85525
85720
|
placeholder="Search by name..."
|
|
85526
85721
|
size="small"
|
|
85527
85722
|
fluid
|
|
@@ -85607,7 +85802,7 @@ export default function FilterAdvancedDemo() {
|
|
|
85607
85802
|
</DataTable.THeadRow>
|
|
85608
85803
|
</DataTable.THead>
|
|
85609
85804
|
<DataTable.TBody>
|
|
85610
|
-
{({ item }: { item:
|
|
85805
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
85611
85806
|
<DataTable.Row key={String(item.key)}>
|
|
85612
85807
|
<DataTable.Cell>
|
|
85613
85808
|
<div className="flex items-center gap-2">
|
|
@@ -85672,6 +85867,7 @@ import { NodeService, type TreeTableNode } from '@/shared/services/node.service'
|
|
|
85672
85867
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
85673
85868
|
import { Button } from '@primereact/ui/button';
|
|
85674
85869
|
import { DataTable } from '@primereact/ui/datatable';
|
|
85870
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
85675
85871
|
import { Tag } from '@primereact/ui/tag';
|
|
85676
85872
|
import * as React from 'react';
|
|
85677
85873
|
import { File } from '@primeicons/react/file';
|
|
@@ -85694,7 +85890,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
85694
85890
|
|
|
85695
85891
|
function TypeIcon({ type }: { type: string }) {
|
|
85696
85892
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
85893
|
+
|
|
85697
85894
|
if (type === 'Video') return <Video size={16} />;
|
|
85895
|
+
|
|
85698
85896
|
if (type === 'Folder') return <Folder size={16} />;
|
|
85699
85897
|
|
|
85700
85898
|
return <File size={16} />;
|
|
@@ -85740,7 +85938,7 @@ export default function ExportDemo() {
|
|
|
85740
85938
|
</DataTable.THeadRow>
|
|
85741
85939
|
</DataTable.THead>
|
|
85742
85940
|
<DataTable.TBody>
|
|
85743
|
-
{({ item }: { item:
|
|
85941
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
85744
85942
|
<DataTable.Row key={String(item.key)}>
|
|
85745
85943
|
<DataTable.Cell>
|
|
85746
85944
|
<div className="flex items-center gap-2">
|
|
@@ -85802,6 +86000,7 @@ import { Database } from '@primeicons/react/database';
|
|
|
85802
86000
|
import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
85803
86001
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
85804
86002
|
import { DataTable } from '@primereact/ui/datatable';
|
|
86003
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
85805
86004
|
import { Skeleton } from '@primereact/ui/skeleton';
|
|
85806
86005
|
import * as React from 'react';
|
|
85807
86006
|
|
|
@@ -85919,7 +86118,7 @@ export default function LazyDemo() {
|
|
|
85919
86118
|
</DataTable.THeadRow>
|
|
85920
86119
|
</DataTable.THead>
|
|
85921
86120
|
<DataTable.TBody>
|
|
85922
|
-
{({ item }: { item:
|
|
86121
|
+
{({ item }: { item: DataTableTreeRow<LazyNode> }) => {
|
|
85923
86122
|
const isLoading = loadingKeys[item.key] && expandedKeys[item.key];
|
|
85924
86123
|
|
|
85925
86124
|
return (
|
|
@@ -85986,6 +86185,7 @@ import { NodeService, type TreeTableNode } from '@/shared/services/node.service'
|
|
|
85986
86185
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
85987
86186
|
import { Button } from '@primereact/ui/button';
|
|
85988
86187
|
import { DataTable } from '@primereact/ui/datatable';
|
|
86188
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
85989
86189
|
import { Tag } from '@primereact/ui/tag';
|
|
85990
86190
|
import * as React from 'react';
|
|
85991
86191
|
import { File } from '@primeicons/react/file';
|
|
@@ -86008,7 +86208,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
86008
86208
|
|
|
86009
86209
|
function TypeIcon({ type }: { type: string }) {
|
|
86010
86210
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
86211
|
+
|
|
86011
86212
|
if (type === 'Video') return <Video size={16} />;
|
|
86213
|
+
|
|
86012
86214
|
if (type === 'Folder') return <Folder size={16} />;
|
|
86013
86215
|
|
|
86014
86216
|
return <File size={16} />;
|
|
@@ -86065,7 +86267,7 @@ export default function LoadingOverlayDemo() {
|
|
|
86065
86267
|
</DataTable.THeadRow>
|
|
86066
86268
|
</DataTable.THead>
|
|
86067
86269
|
<DataTable.TBody>
|
|
86068
|
-
{({ item }: { item:
|
|
86270
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
86069
86271
|
<DataTable.Row key={String(item.key)}>
|
|
86070
86272
|
<DataTable.Cell>
|
|
86071
86273
|
<div className="flex items-center gap-2">
|
|
@@ -86135,7 +86337,7 @@ export default function LoadingSkeletonDemo() {
|
|
|
86135
86337
|
</DataTable.THeadRow>
|
|
86136
86338
|
</DataTable.THead>
|
|
86137
86339
|
<DataTable.TBody>
|
|
86138
|
-
{({ item }: { item:
|
|
86340
|
+
{({ item }: { item: (typeof placeholders)[number] }) => (
|
|
86139
86341
|
<DataTable.Row key={String(item.key)}>
|
|
86140
86342
|
<DataTable.Cell>
|
|
86141
86343
|
<Skeleton className="h-5 w-3/4" />
|
|
@@ -86188,7 +86390,7 @@ export default function EmptyDemo() {
|
|
|
86188
86390
|
</DataTable.THeadRow>
|
|
86189
86391
|
</DataTable.THead>
|
|
86190
86392
|
<DataTable.TBody>
|
|
86191
|
-
{({ item }: { item:
|
|
86393
|
+
{({ item }: { item: Record<string, unknown> }) => (
|
|
86192
86394
|
<DataTable.Row key={String(item.key)}>
|
|
86193
86395
|
<DataTable.Cell>{String(item.name)}</DataTable.Cell>
|
|
86194
86396
|
<DataTable.Cell>{String(item.size)}</DataTable.Cell>
|
|
@@ -86247,6 +86449,7 @@ import { FilterMatchMode } from '@primereact/ui/datatable';
|
|
|
86247
86449
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
86248
86450
|
import type { DataTableFilterInstance } from '@primereact/ui/datatable';
|
|
86249
86451
|
import { DataTable } from '@primereact/ui/datatable';
|
|
86452
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
86250
86453
|
import { IconField } from '@primereact/ui/iconfield';
|
|
86251
86454
|
import { InputText } from '@primereact/ui/inputtext';
|
|
86252
86455
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
@@ -86268,7 +86471,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
86268
86471
|
|
|
86269
86472
|
function TypeIcon({ type }: { type: string }) {
|
|
86270
86473
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
86474
|
+
|
|
86271
86475
|
if (type === 'Video') return <Video size={16} />;
|
|
86476
|
+
|
|
86272
86477
|
if (type === 'Folder') return <Folder size={16} />;
|
|
86273
86478
|
|
|
86274
86479
|
return <File size={16} />;
|
|
@@ -86349,7 +86554,7 @@ export default function AdvancedDemo() {
|
|
|
86349
86554
|
type="search"
|
|
86350
86555
|
placeholder="Keyword search"
|
|
86351
86556
|
value={globalFilter}
|
|
86352
|
-
onChange={(e:
|
|
86557
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
86353
86558
|
className="w-full"
|
|
86354
86559
|
/>
|
|
86355
86560
|
</IconField.Root>
|
|
@@ -86394,7 +86599,7 @@ export default function AdvancedDemo() {
|
|
|
86394
86599
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
86395
86600
|
<InputText
|
|
86396
86601
|
value={(value as string) ?? ''}
|
|
86397
|
-
onChange={(e:
|
|
86602
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
86398
86603
|
placeholder="Search"
|
|
86399
86604
|
size="small"
|
|
86400
86605
|
fluid
|
|
@@ -86435,7 +86640,7 @@ export default function AdvancedDemo() {
|
|
|
86435
86640
|
</DataTable.THeadRow>
|
|
86436
86641
|
</DataTable.THead>
|
|
86437
86642
|
<DataTable.TBody>
|
|
86438
|
-
{({ item, index }: { item:
|
|
86643
|
+
{({ item, index }: { item: DataTableTreeRow<TreeTableNode>; index: number }) => (
|
|
86439
86644
|
<DataTable.Row key={String(item.key)}>
|
|
86440
86645
|
<DataTable.Cell>
|
|
86441
86646
|
<div className="flex items-center gap-2">
|
|
@@ -86455,7 +86660,7 @@ export default function AdvancedDemo() {
|
|
|
86455
86660
|
<DataTable.CellEditorContent>
|
|
86456
86661
|
<InputText
|
|
86457
86662
|
defaultValue={String(item.name)}
|
|
86458
|
-
onChange={(e:
|
|
86663
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
86459
86664
|
pendingValueRef.current[`${item.key}-name`] = e.target.value;
|
|
86460
86665
|
}}
|
|
86461
86666
|
size="small"
|
|
@@ -86473,7 +86678,7 @@ export default function AdvancedDemo() {
|
|
|
86473
86678
|
<DataTable.CellEditorContent>
|
|
86474
86679
|
<InputText
|
|
86475
86680
|
defaultValue={String(item.size)}
|
|
86476
|
-
onChange={(e:
|
|
86681
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
86477
86682
|
pendingValueRef.current[`${item.key}-size`] = e.target.value;
|
|
86478
86683
|
}}
|
|
86479
86684
|
size="small"
|
|
@@ -92499,7 +92704,7 @@ export default function Preview() {
|
|
|
92499
92704
|
</DataTableTHeadRow>
|
|
92500
92705
|
</DataTableTHead>
|
|
92501
92706
|
<DataTableTBody>
|
|
92502
|
-
{({ item }: { item:
|
|
92707
|
+
{({ item }: { item: Product }) => (
|
|
92503
92708
|
<DataTableRow key={item.id}>
|
|
92504
92709
|
<DataTableCell>
|
|
92505
92710
|
<div className="flex items-center gap-3">
|
|
@@ -92683,7 +92888,7 @@ export default function BasicDemo() {
|
|
|
92683
92888
|
</DataTableTHeadRow>
|
|
92684
92889
|
</DataTableTHead>
|
|
92685
92890
|
<DataTableTBody>
|
|
92686
|
-
{({ item }: { item:
|
|
92891
|
+
{({ item }: { item: Product }) => (
|
|
92687
92892
|
<DataTableRow key={item.id}>
|
|
92688
92893
|
<DataTableCell>
|
|
92689
92894
|
<div className="flex items-center gap-3">
|
|
@@ -92773,7 +92978,7 @@ function ProductTable({ stripedRows, showGridlines, size }: { stripedRows?: bool
|
|
|
92773
92978
|
</DataTableTHeadRow>
|
|
92774
92979
|
</DataTableTHead>
|
|
92775
92980
|
<DataTableTBody>
|
|
92776
|
-
{({ item }: { item:
|
|
92981
|
+
{({ item }: { item: Product }) => (
|
|
92777
92982
|
<DataTableRow key={item.id}>
|
|
92778
92983
|
<DataTableCell>
|
|
92779
92984
|
<span className="font-medium">{item.name}</span>
|
|
@@ -92900,7 +93105,7 @@ export default function SingleSelectionDemo() {
|
|
|
92900
93105
|
</DataTableTHeadRow>
|
|
92901
93106
|
</DataTableTHead>
|
|
92902
93107
|
<DataTableTBody>
|
|
92903
|
-
{({ item }: { item:
|
|
93108
|
+
{({ item }: { item: Product }) => (
|
|
92904
93109
|
<DataTableRow key={item.id}>
|
|
92905
93110
|
<DataTableCell>
|
|
92906
93111
|
<div className="flex items-center gap-3">
|
|
@@ -93070,7 +93275,7 @@ export default function MultipleSelectionDemo() {
|
|
|
93070
93275
|
</DataTableTHeadRow>
|
|
93071
93276
|
</DataTableTHead>
|
|
93072
93277
|
<DataTableTBody>
|
|
93073
|
-
{({ item }: { item:
|
|
93278
|
+
{({ item }: { item: Product }) => (
|
|
93074
93279
|
<DataTableRow key={item.id}>
|
|
93075
93280
|
<DataTableCell>
|
|
93076
93281
|
<div className="flex items-center gap-3">
|
|
@@ -93219,7 +93424,7 @@ export default function CheckboxSelectionDemo() {
|
|
|
93219
93424
|
</DataTableTHeadRow>
|
|
93220
93425
|
</DataTableTHead>
|
|
93221
93426
|
<DataTableTBody>
|
|
93222
|
-
{({ item }: { item:
|
|
93427
|
+
{({ item }: { item: Customer }) => (
|
|
93223
93428
|
<DataTableRow key={item.id}>
|
|
93224
93429
|
<DataTableCell>
|
|
93225
93430
|
<PRDataTable.Selection>
|
|
@@ -93345,7 +93550,7 @@ export default function KeyboardDemo() {
|
|
|
93345
93550
|
</DataTableTHeadRow>
|
|
93346
93551
|
</DataTableTHead>
|
|
93347
93552
|
<DataTableTBody>
|
|
93348
|
-
{({ item }: { item:
|
|
93553
|
+
{({ item }: { item: Product }) => (
|
|
93349
93554
|
<DataTableRow key={item.id}>
|
|
93350
93555
|
<DataTableCell>
|
|
93351
93556
|
<div className="flex items-center gap-3">
|
|
@@ -93517,7 +93722,7 @@ export default function SortDemo() {
|
|
|
93517
93722
|
</DataTableTHeadRow>
|
|
93518
93723
|
</DataTableTHead>
|
|
93519
93724
|
<DataTableTBody>
|
|
93520
|
-
{({ item }: { item:
|
|
93725
|
+
{({ item }: { item: Product }) => (
|
|
93521
93726
|
<DataTableRow key={item.id}>
|
|
93522
93727
|
<DataTableCell>
|
|
93523
93728
|
<div className="flex items-center gap-3">
|
|
@@ -93688,7 +93893,7 @@ export default function MultiSortDemo() {
|
|
|
93688
93893
|
</DataTableTHeadRow>
|
|
93689
93894
|
</DataTableTHead>
|
|
93690
93895
|
<DataTableTBody>
|
|
93691
|
-
{({ item }: { item:
|
|
93896
|
+
{({ item }: { item: Product }) => (
|
|
93692
93897
|
<DataTableRow key={item.id}>
|
|
93693
93898
|
<DataTableCell>
|
|
93694
93899
|
<div className="flex items-center gap-3">
|
|
@@ -93859,7 +94064,7 @@ export default function PresortDemo() {
|
|
|
93859
94064
|
</DataTableTHeadRow>
|
|
93860
94065
|
</DataTableTHead>
|
|
93861
94066
|
<DataTableTBody>
|
|
93862
|
-
{({ item }: { item:
|
|
94067
|
+
{({ item }: { item: Product }) => (
|
|
93863
94068
|
<DataTableRow key={item.id}>
|
|
93864
94069
|
<DataTableCell>
|
|
93865
94070
|
<div className="flex items-center gap-3">
|
|
@@ -94035,7 +94240,7 @@ export default function PresortMultiDemo() {
|
|
|
94035
94240
|
</DataTableTHeadRow>
|
|
94036
94241
|
</DataTableTHead>
|
|
94037
94242
|
<DataTableTBody>
|
|
94038
|
-
{({ item }: { item:
|
|
94243
|
+
{({ item }: { item: Product }) => (
|
|
94039
94244
|
<DataTableRow key={item.id}>
|
|
94040
94245
|
<DataTableCell>
|
|
94041
94246
|
<div className="flex items-center gap-3">
|
|
@@ -94160,7 +94365,7 @@ export default function PaginationDemo() {
|
|
|
94160
94365
|
</DataTableTHeadRow>
|
|
94161
94366
|
</DataTableTHead>
|
|
94162
94367
|
<DataTableTBody>
|
|
94163
|
-
{({ item }: { item:
|
|
94368
|
+
{({ item }: { item: Product }) => (
|
|
94164
94369
|
<DataTableRow key={item.id}>
|
|
94165
94370
|
<DataTableCell>
|
|
94166
94371
|
<span className="font-medium">{item.name}</span>
|
|
@@ -94282,7 +94487,7 @@ export default function ScrollHorizontalDemo() {
|
|
|
94282
94487
|
</DataTableTHeadRow>
|
|
94283
94488
|
</DataTableTHead>
|
|
94284
94489
|
<DataTableTBody>
|
|
94285
|
-
{({ item }: { item:
|
|
94490
|
+
{({ item }: { item: Customer }) => (
|
|
94286
94491
|
<DataTableRow key={item.id}>
|
|
94287
94492
|
<DataTableCell>{item.id}</DataTableCell>
|
|
94288
94493
|
<DataTableCell>
|
|
@@ -94407,7 +94612,7 @@ export default function ScrollFrozenColumnsMultiDemo() {
|
|
|
94407
94612
|
</DataTableTHeadRow>
|
|
94408
94613
|
</DataTableTHead>
|
|
94409
94614
|
<DataTableTBody>
|
|
94410
|
-
{({ item }: { item:
|
|
94615
|
+
{({ item }: { item: Customer }) => (
|
|
94411
94616
|
<DataTableRow key={String(item.id)}>
|
|
94412
94617
|
<DataTableCell frozen>
|
|
94413
94618
|
<span className="text-xs text-surface-500 dark:text-surface-400 tabular-nums">#{String(item.id)}</span>
|
|
@@ -94525,6 +94730,7 @@ export default function ScrollFrozenRowsDemo() {
|
|
|
94525
94730
|
const toggleLock = React.useCallback((id: number) => {
|
|
94526
94731
|
setLockedIds((prev) => {
|
|
94527
94732
|
if (prev.includes(id)) return prev.filter((x) => x !== id);
|
|
94733
|
+
|
|
94528
94734
|
if (prev.length >= 2) return prev;
|
|
94529
94735
|
|
|
94530
94736
|
return [...prev, id];
|
|
@@ -94581,7 +94787,7 @@ export default function ScrollFrozenRowsDemo() {
|
|
|
94581
94787
|
);
|
|
94582
94788
|
}, []);
|
|
94583
94789
|
|
|
94584
|
-
const tbodyRender = React.useCallback(({ item }: { item:
|
|
94790
|
+
const tbodyRender = React.useCallback(({ item }: { item: Customer }) => renderRow(item as Customer), [renderRow]);
|
|
94585
94791
|
|
|
94586
94792
|
return (
|
|
94587
94793
|
<div className="w-full">
|
|
@@ -94749,7 +94955,7 @@ export default function ExpansionDemo() {
|
|
|
94749
94955
|
</DataTableTHeadRow>
|
|
94750
94956
|
</DataTableTHead>
|
|
94751
94957
|
<DataTableTBody>
|
|
94752
|
-
{({ item }: { item:
|
|
94958
|
+
{({ item }: { item: Product }) => (
|
|
94753
94959
|
<React.Fragment key={item.id}>
|
|
94754
94960
|
<DataTableRow>
|
|
94755
94961
|
<DataTableCell>
|
|
@@ -94874,18 +95080,6 @@ import {
|
|
|
94874
95080
|
import { Tag } from '@/components/ui/tag';
|
|
94875
95081
|
import * as React from 'react';
|
|
94876
95082
|
|
|
94877
|
-
const statusSeverity: Record<string, 'success' | 'warn' | 'danger'> = {
|
|
94878
|
-
INSTOCK: 'success',
|
|
94879
|
-
LOWSTOCK: 'warn',
|
|
94880
|
-
OUTOFSTOCK: 'danger'
|
|
94881
|
-
};
|
|
94882
|
-
|
|
94883
|
-
const statusLabel: Record<string, string> = {
|
|
94884
|
-
INSTOCK: 'In Stock',
|
|
94885
|
-
LOWSTOCK: 'Low Stock',
|
|
94886
|
-
OUTOFSTOCK: 'Out of Stock'
|
|
94887
|
-
};
|
|
94888
|
-
|
|
94889
95083
|
export default function ResizeDemo() {
|
|
94890
95084
|
const [products, setProducts] = React.useState<Product[]>([]);
|
|
94891
95085
|
|
|
@@ -94920,7 +95114,7 @@ export default function ResizeDemo() {
|
|
|
94920
95114
|
</DataTableTHeadRow>
|
|
94921
95115
|
</DataTableTHead>
|
|
94922
95116
|
<DataTableTBody>
|
|
94923
|
-
{({ item }: { item:
|
|
95117
|
+
{({ item }: { item: Product }) => (
|
|
94924
95118
|
<DataTableRow key={item.id}>
|
|
94925
95119
|
<DataTableCell>
|
|
94926
95120
|
<div className="flex items-center gap-3">
|
|
@@ -95047,7 +95241,7 @@ export default function ResizeExpandDemo() {
|
|
|
95047
95241
|
</DataTableTHeadRow>
|
|
95048
95242
|
</DataTableTHead>
|
|
95049
95243
|
<DataTableTBody>
|
|
95050
|
-
{({ item }: { item:
|
|
95244
|
+
{({ item }: { item: Product }) => (
|
|
95051
95245
|
<DataTableRow key={item.id}>
|
|
95052
95246
|
<DataTableCell>
|
|
95053
95247
|
<div className="flex items-center gap-3">
|
|
@@ -95225,7 +95419,7 @@ export default function ReorderDemo() {
|
|
|
95225
95419
|
</DataTableTHeadRow>
|
|
95226
95420
|
</DataTableTHead>
|
|
95227
95421
|
<DataTableTBody key={columns.map((c) => c.field).join(',')}>
|
|
95228
|
-
{({ item }: { item:
|
|
95422
|
+
{({ item }: { item: Product }) => (
|
|
95229
95423
|
<DataTableRow key={item.id}>
|
|
95230
95424
|
{columns.map((col) => (
|
|
95231
95425
|
<DataTableCell key={col.field}>{renderCell(col.field, item)}</DataTableCell>
|
|
@@ -95341,7 +95535,7 @@ export default function RowReorderDemo() {
|
|
|
95341
95535
|
</DataTableTHeadRow>
|
|
95342
95536
|
</DataTableTHead>
|
|
95343
95537
|
<DataTableTBody>
|
|
95344
|
-
{({ item, index }: { item:
|
|
95538
|
+
{({ item, index }: { item: Product; index: number }) => (
|
|
95345
95539
|
<DataTableRow key={item.id}>
|
|
95346
95540
|
<DataTableCell>
|
|
95347
95541
|
<DataTableRowReorder rowIndex={index} className="cursor-grab text-surface-400 hover:text-surface-600">
|
|
@@ -95503,7 +95697,7 @@ export default function ColumnGroupDemo() {
|
|
|
95503
95697
|
</DataTableTHeadRow>
|
|
95504
95698
|
</DataTableTHead>
|
|
95505
95699
|
<DataTableTBody>
|
|
95506
|
-
{({ item }: { item:
|
|
95700
|
+
{({ item }: { item: Sale }) => (
|
|
95507
95701
|
<DataTableRow key={item.id}>
|
|
95508
95702
|
<DataTableCell>
|
|
95509
95703
|
<span className="font-medium">{item.product}</span>
|
|
@@ -95688,7 +95882,7 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
95688
95882
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
95689
95883
|
<InputText
|
|
95690
95884
|
value={(value as string) ?? ''}
|
|
95691
|
-
onChange={(e:
|
|
95885
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
95692
95886
|
placeholder="Search"
|
|
95693
95887
|
size="small"
|
|
95694
95888
|
fluid
|
|
@@ -95702,7 +95896,9 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
95702
95896
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
95703
95897
|
<InputText
|
|
95704
95898
|
value={(value as string) ?? ''}
|
|
95705
|
-
onChange={(e:
|
|
95899
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
95900
|
+
onChange(e, e.target.value ? Number(e.target.value) : null, 'gte')
|
|
95901
|
+
}
|
|
95706
95902
|
placeholder="≥"
|
|
95707
95903
|
size="small"
|
|
95708
95904
|
fluid
|
|
@@ -95715,7 +95911,7 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
95715
95911
|
</DataTableTHeadRow>
|
|
95716
95912
|
</DataTableTHead>
|
|
95717
95913
|
<DataTableTBody>
|
|
95718
|
-
{({ item }: { item:
|
|
95914
|
+
{({ item }: { item: Sale }) => (
|
|
95719
95915
|
<DataTableRow key={item.id}>
|
|
95720
95916
|
<DataTableCell>
|
|
95721
95917
|
<span className="font-medium">{item.product}</span>
|
|
@@ -95838,7 +96034,7 @@ export default function FilterDemo() {
|
|
|
95838
96034
|
</DataTableTHeadRow>
|
|
95839
96035
|
</DataTableTHead>
|
|
95840
96036
|
<DataTableTBody>
|
|
95841
|
-
{({ item }: { item:
|
|
96037
|
+
{({ item }: { item: Product }) => (
|
|
95842
96038
|
<DataTableRow key={item.id}>
|
|
95843
96039
|
<DataTableCell>
|
|
95844
96040
|
<span className="font-medium">{item.name}</span>
|
|
@@ -95925,7 +96121,7 @@ export default function TemplateDemo() {
|
|
|
95925
96121
|
</DataTableTHeadRow>
|
|
95926
96122
|
</DataTableTHead>
|
|
95927
96123
|
<DataTableTBody>
|
|
95928
|
-
{({ item }: { item:
|
|
96124
|
+
{({ item }: { item: Product }) => (
|
|
95929
96125
|
<DataTableRow key={item.id}>
|
|
95930
96126
|
<DataTableCell>
|
|
95931
96127
|
<div className="flex items-center gap-3">
|
|
@@ -96047,7 +96243,7 @@ export default function ExportDemo() {
|
|
|
96047
96243
|
</DataTableTHeadRow>
|
|
96048
96244
|
</DataTableTHead>
|
|
96049
96245
|
<DataTableTBody>
|
|
96050
|
-
{({ item }: { item:
|
|
96246
|
+
{({ item }: { item: Product }) => (
|
|
96051
96247
|
<DataTableRow key={item.id}>
|
|
96052
96248
|
<DataTableCell>
|
|
96053
96249
|
<div className="flex items-center gap-3">
|
|
@@ -96191,7 +96387,7 @@ export default function LoadingOverlayDemo() {
|
|
|
96191
96387
|
</DataTableTHeadRow>
|
|
96192
96388
|
</DataTableTHead>
|
|
96193
96389
|
<DataTableTBody>
|
|
96194
|
-
{({ item }: { item:
|
|
96390
|
+
{({ item }: { item: Product }) => (
|
|
96195
96391
|
<DataTableRow key={item.id}>
|
|
96196
96392
|
<DataTableCell>
|
|
96197
96393
|
<div className="flex items-center gap-3">
|
|
@@ -96322,7 +96518,7 @@ export default function LoadingSkeletonDemo() {
|
|
|
96322
96518
|
</DataTableTHeadRow>
|
|
96323
96519
|
</DataTableTHead>
|
|
96324
96520
|
<DataTableTBody>
|
|
96325
|
-
{({ item }: { item:
|
|
96521
|
+
{({ item }: { item: Product }) =>
|
|
96326
96522
|
isLoading ? (
|
|
96327
96523
|
<DataTableRow key={item.id}>
|
|
96328
96524
|
<DataTableCell>
|
|
@@ -96428,7 +96624,7 @@ export default function EmptyDemo() {
|
|
|
96428
96624
|
</DataTableTHeadRow>
|
|
96429
96625
|
</DataTableTHead>
|
|
96430
96626
|
<DataTableTBody>
|
|
96431
|
-
{({ item }: { item:
|
|
96627
|
+
{({ item }: { item: Record<string, unknown> }) => (
|
|
96432
96628
|
<DataTableRow key={String(item.id)}>
|
|
96433
96629
|
<DataTableCell>{String(item.name)}</DataTableCell>
|
|
96434
96630
|
<DataTableCell>{String(item.category)}</DataTableCell>
|
|
@@ -101793,7 +101989,6 @@ Checkbox and RadioButton components can be combined with an input element under
|
|
|
101793
101989
|
|
|
101794
101990
|
```tsx
|
|
101795
101991
|
'use client';
|
|
101796
|
-
import { Check } from '@primeicons/react';
|
|
101797
101992
|
import { Checkbox } from '@/components/ui/checkbox';
|
|
101798
101993
|
import { InputGroup, InputGroupAddon } from '@/components/ui/inputgroup';
|
|
101799
101994
|
import { InputText } from '@/components/ui/inputtext';
|
|
@@ -110307,6 +110502,7 @@ Select is used to choose an item from a collection of options.
|
|
|
110307
110502
|
import { Select, SelectList, SelectOption, SelectPopup, SelectPortal, SelectPositioner, SelectTrigger, SelectValue } from '@/components/ui/select';
|
|
110308
110503
|
import type { SelectValueChangeEvent } from 'primereact/select';
|
|
110309
110504
|
import * as React from 'react';
|
|
110505
|
+
|
|
110310
110506
|
const languages = [
|
|
110311
110507
|
{ label: 'Select your language', value: '' },
|
|
110312
110508
|
{ label: 'English', value: 'en' },
|
|
@@ -110412,6 +110608,7 @@ Choose a single value from a dropdown list of options.
|
|
|
110412
110608
|
import { Select, SelectList, SelectOption, SelectPopup, SelectPortal, SelectPositioner, SelectTrigger, SelectValue } from '@/components/ui/select';
|
|
110413
110609
|
import type { SelectValueChangeEvent } from 'primereact/select';
|
|
110414
110610
|
import * as React from 'react';
|
|
110611
|
+
|
|
110415
110612
|
const languages = [
|
|
110416
110613
|
{ label: 'Select your language', value: '' },
|
|
110417
110614
|
{ label: 'English', value: 'en' },
|
|
@@ -110935,6 +111132,7 @@ export default function GroupDemo() {
|
|
|
110935
111132
|
<SelectList>
|
|
110936
111133
|
{(() => {
|
|
110937
111134
|
let index = 0;
|
|
111135
|
+
|
|
110938
111136
|
return jobCategories.flatMap((category) => [
|
|
110939
111137
|
<SelectOption key={`group-${category.code}`} index={index++} group>
|
|
110940
111138
|
{category.label}
|
|
@@ -111569,9 +111767,10 @@ import {
|
|
|
111569
111767
|
Users
|
|
111570
111768
|
} from '@primeicons/react';
|
|
111571
111769
|
import * as React from 'react';
|
|
111770
|
+
import type { IconProps } from '@primeicons/react/core';
|
|
111572
111771
|
|
|
111573
111772
|
type NavItem = {
|
|
111574
|
-
icon: React.FC<
|
|
111773
|
+
icon: React.FC<IconProps>;
|
|
111575
111774
|
label: string;
|
|
111576
111775
|
isActive?: boolean;
|
|
111577
111776
|
badge?: string;
|
|
@@ -111851,9 +112050,12 @@ import { ChevronDown } from '@primeicons/react/chevron-down';
|
|
|
111851
112050
|
import { SelectValueChangeEvent } from 'primereact/select';
|
|
111852
112051
|
import { ToggleButtonGroupValueChangeEvent } from 'primereact/togglebuttongroup';
|
|
111853
112052
|
import * as React from 'react';
|
|
112053
|
+
import type { CheckboxRootChangeEvent } from 'primereact/checkbox';
|
|
112054
|
+
import type { IconProps } from '@primeicons/react/core';
|
|
112055
|
+
import type { SidebarCollapsible, SidebarSide, SidebarVariant } from '@primereact/ui/sidebar';
|
|
111854
112056
|
|
|
111855
112057
|
type NavItem = {
|
|
111856
|
-
icon: React.FC<
|
|
112058
|
+
icon: React.FC<IconProps>;
|
|
111857
112059
|
label: string;
|
|
111858
112060
|
isActive?: boolean;
|
|
111859
112061
|
badge?: string;
|
|
@@ -111902,9 +112104,9 @@ const collapsibleOptions = [
|
|
|
111902
112104
|
];
|
|
111903
112105
|
|
|
111904
112106
|
export default function VariantsDemo() {
|
|
111905
|
-
const [variant, setVariant] = React.useState<
|
|
111906
|
-
const [collapsible, setCollapsible] = React.useState<
|
|
111907
|
-
const [side, setSide] = React.useState<
|
|
112107
|
+
const [variant, setVariant] = React.useState<SidebarVariant>('sidebar');
|
|
112108
|
+
const [collapsible, setCollapsible] = React.useState<SidebarCollapsible>('icon');
|
|
112109
|
+
const [side, setSide] = React.useState<SidebarSide>('left');
|
|
111908
112110
|
const [overlay, setOverlay] = React.useState(false);
|
|
111909
112111
|
const [openOnHover, setOpenOnHover] = React.useState(false);
|
|
111910
112112
|
const [backdrop, setBackdrop] = React.useState(false);
|
|
@@ -111914,7 +112116,7 @@ export default function VariantsDemo() {
|
|
|
111914
112116
|
<div className="flex flex-wrap items-center gap-4 mb-4">
|
|
111915
112117
|
<Select
|
|
111916
112118
|
value={variant}
|
|
111917
|
-
onValueChange={(e: SelectValueChangeEvent) => setVariant(e.value as
|
|
112119
|
+
onValueChange={(e: SelectValueChangeEvent) => setVariant(e.value as SidebarVariant)}
|
|
111918
112120
|
options={variantOptions}
|
|
111919
112121
|
optionLabel="label"
|
|
111920
112122
|
optionValue="value"
|
|
@@ -111933,7 +112135,7 @@ export default function VariantsDemo() {
|
|
|
111933
112135
|
</Select>
|
|
111934
112136
|
<Select
|
|
111935
112137
|
value={collapsible}
|
|
111936
|
-
onValueChange={(e: SelectValueChangeEvent) => setCollapsible(e.value as
|
|
112138
|
+
onValueChange={(e: SelectValueChangeEvent) => setCollapsible(e.value as SidebarCollapsible)}
|
|
111937
112139
|
options={collapsibleOptions}
|
|
111938
112140
|
optionLabel="label"
|
|
111939
112141
|
optionValue="value"
|
|
@@ -111960,19 +112162,19 @@ export default function VariantsDemo() {
|
|
|
111960
112162
|
<ToggleButton value="right">Right</ToggleButton>
|
|
111961
112163
|
</ToggleButtonGroup>
|
|
111962
112164
|
<div className="flex items-center gap-2">
|
|
111963
|
-
<Checkbox inputId="overlay-cb" checked={overlay} onCheckedChange={(e:
|
|
112165
|
+
<Checkbox inputId="overlay-cb" checked={overlay} onCheckedChange={(e: CheckboxRootChangeEvent) => setOverlay(e.checked)} />
|
|
111964
112166
|
<label htmlFor="overlay-cb" className="text-sm font-medium cursor-pointer">
|
|
111965
112167
|
Overlay
|
|
111966
112168
|
</label>
|
|
111967
112169
|
</div>
|
|
111968
112170
|
<div className="flex items-center gap-2">
|
|
111969
|
-
<Checkbox inputId="hover-cb" checked={openOnHover} onCheckedChange={(e:
|
|
112171
|
+
<Checkbox inputId="hover-cb" checked={openOnHover} onCheckedChange={(e: CheckboxRootChangeEvent) => setOpenOnHover(e.checked)} />
|
|
111970
112172
|
<label htmlFor="hover-cb" className="text-sm font-medium cursor-pointer">
|
|
111971
112173
|
Open on Hover
|
|
111972
112174
|
</label>
|
|
111973
112175
|
</div>
|
|
111974
112176
|
<div className="flex items-center gap-2">
|
|
111975
|
-
<Checkbox inputId="backdrop-cb" checked={backdrop} onCheckedChange={(e:
|
|
112177
|
+
<Checkbox inputId="backdrop-cb" checked={backdrop} onCheckedChange={(e: CheckboxRootChangeEvent) => setBackdrop(e.checked)} />
|
|
111976
112178
|
<label htmlFor="backdrop-cb" className="text-sm font-medium cursor-pointer">
|
|
111977
112179
|
Backdrop
|
|
111978
112180
|
</label>
|
|
@@ -112701,10 +112903,11 @@ import {
|
|
|
112701
112903
|
SidebarTrigger
|
|
112702
112904
|
} from '@/components/ui/sidebar';
|
|
112703
112905
|
import { ChevronDown, Folder, Globe, Image, Sidebar as SidebarIcon, Video } from '@primeicons/react';
|
|
112906
|
+
import type { IconProps } from '@primeicons/react/core';
|
|
112704
112907
|
|
|
112705
112908
|
type MenuItem = {
|
|
112706
112909
|
label: string;
|
|
112707
|
-
icon?: React.FC<
|
|
112910
|
+
icon?: React.FC<IconProps>;
|
|
112708
112911
|
isActive?: boolean;
|
|
112709
112912
|
children?: MenuItem[];
|
|
112710
112913
|
};
|
|
@@ -117461,7 +117664,7 @@ export default function BasicDemo() {
|
|
|
117461
117664
|
type="search"
|
|
117462
117665
|
placeholder="Search name, category, code..."
|
|
117463
117666
|
value={search}
|
|
117464
|
-
onChange={(e:
|
|
117667
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSearch(e.target.value)}
|
|
117465
117668
|
className="w-full"
|
|
117466
117669
|
/>
|
|
117467
117670
|
</IconField.Root>
|
|
@@ -117555,7 +117758,7 @@ export default function AdvancedDemo() {
|
|
|
117555
117758
|
placeholder="Name contains..."
|
|
117556
117759
|
size="small"
|
|
117557
117760
|
value={(nameRule?.value as string) ?? ''}
|
|
117558
|
-
onChange={(e:
|
|
117761
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => nameRule?.setValue(e.target.value)}
|
|
117559
117762
|
className="w-full"
|
|
117560
117763
|
/>
|
|
117561
117764
|
</IconField.Root>
|
|
@@ -118750,7 +118953,9 @@ export default function TreeDemo() {
|
|
|
118750
118953
|
type="search"
|
|
118751
118954
|
placeholder="Search nodes..."
|
|
118752
118955
|
value={search}
|
|
118753
|
-
onChange={(e:
|
|
118956
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
118957
|
+
setRules([{ field: 'name', value: e.target.value, matchMode: 'contains' }])
|
|
118958
|
+
}
|
|
118754
118959
|
/>
|
|
118755
118960
|
</IconField.Root>
|
|
118756
118961
|
|
|
@@ -120818,7 +121023,7 @@ Tokens follow the [Design Tokens Format Module](https://www.designtokens.org/tr/
|
|
|
120818
121023
|
|
|
120819
121024
|
### Moving existing customizations
|
|
120820
121025
|
|
|
120821
|
-
| v10
|
|
121026
|
+
| v10 | Where it goes in v11 |
|
|
120822
121027
|
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120823
121028
|
| A SASS theme built from `theme.scss` | Variable overrides become token overrides in a preset. A rewrite, but usually a much shorter file, since a preset only lists what differs from the base. |
|
|
120824
121029
|
| CSS overrides against `p-*` classes | Still work. The class names survived. Keep them as the fallback, since a token reaches every component that uses it while a selector reaches one. |
|
|
@@ -120837,7 +121042,7 @@ v10 had one way to get unstyled components: the `unstyled` flag, set globally or
|
|
|
120837
121042
|
| `<PrimeReactProvider unstyled>` | The whole application is styled by something else |
|
|
120838
121043
|
| `unstyled` on a component | Most of the app is themed, one screen is not |
|
|
120839
121044
|
| Import from `primereact` | Building a design system on the primitives, with no theme layer in the bundle |
|
|
120840
|
-
| Import from `@primereact/headless` | Hand-written markup as well as hand-written styling
|
|
121045
|
+
| Import from `@primereact/headless` | Hand-written markup as well as hand-written styling |
|
|
120841
121046
|
|
|
120842
121047
|
The last two are the difference from v10. There, unstyled mode meant the styled component with its class generation switched off, so the theming layer still shipped. In v11 the layers are separate packages, so importing from `primereact` means the styles never enter the bundle at all.
|
|
120843
121048
|
|
|
@@ -123578,13 +123783,13 @@ Define an _Authorization: Bearer_ request header to configure your secret key.
|
|
|
123578
123783
|
|
|
123579
123784
|
The request type must be _POST_.
|
|
123580
123785
|
|
|
123581
|
-
| Name
|
|
123582
|
-
|
|
|
123583
|
-
| `name`
|
|
123584
|
-
| `tokens`
|
|
123585
|
-
| `project`
|
|
123586
|
-
| `config.font_size`
|
|
123587
|
-
| `config.font_family` | string | no
|
|
123786
|
+
| Name | Type | Required | Description |
|
|
123787
|
+
| -------------------- | ------ | -------- | ----------------------------------------------------------------------------------- |
|
|
123788
|
+
| `name` | string | yes | Name of the theme to be generated. |
|
|
123789
|
+
| `tokens` | json | yes | Content of the json file exported from Figma. |
|
|
123790
|
+
| `project` | string | yes | Name of the project, possible values are "primereact", "primeng" or "primevue". |
|
|
123791
|
+
| `config.font_size` | string | no | Font size for theme preview in visual editor at website, defaults to "14px". |
|
|
123792
|
+
| `config.font_family` | string | no | Font family for theme preview in visual editor at website, defaults to "Inter Var". |
|
|
123588
123793
|
|
|
123589
123794
|
### Example
|
|
123590
123795
|
|
|
@@ -124197,6 +124402,7 @@ Theme Designer offers an API that can be utilized to implement continuous integr
|
|
|
124197
124402
|
In our own workflow, we prefer to update the variables manually, as the export feature can be unstable with large files like PrimeOne. We recommend this manual approach for reliability. However, if you choose to use the export feature, make sure the settings match the screenshot provided. Specifically, ensure the "**Themes (Pro)**" tab is selected during the second step. Don't worry, even though it says "Pro," you don't need a Pro license to access this feature in Tokens Studio. If you notice missing or incomplete exports on your first attempt, try running the export again from the beginning. This is a known issue with Tokens Studio and often resolves on the second attempt. For more detailed guidance, see the [official documentation](https://docs.tokens.studio/figma/export).
|
|
124198
124403
|
|
|
124199
124404
|

|
|
124405
|
+
|
|
124200
124406
|
- **Get Updates on Consumer Files** - We do not recommend making design changes directly in consumer files, as this goes against best practices. Instead, apply all design updates in the main UI Kit file, then publish the library and accept the updates in any consumer files that rely on it.
|
|
124201
124407
|
|
|
124202
124408
|
## Token Sets
|
|
@@ -125323,6 +125529,31 @@ import { Select } from '@primereact/ui/select'; // themed, opt out with `unstyle
|
|
|
125323
125529
|
import { Select } from 'primereact/select'; // unstyled by construction
|
|
125324
125530
|
```
|
|
125325
125531
|
|
|
125532
|
+
## Preflight
|
|
125533
|
+
|
|
125534
|
+
Preflight resets the browser defaults on the native elements PrimeReact renders, such as `button`, `input`, `ul`, `table`, `img` and the heading tags. It removes the margins, borders, font inheritance and list styling browsers apply by default, so a component's own styles are the only ones in effect. It is on by default.
|
|
125535
|
+
|
|
125536
|
+
The reset only applies to elements PrimeReact renders itself, scoped through the `data-scope` attribute each component sets. A `<button>` or `<ul>` outside a PrimeReact component keeps its normal browser defaults.
|
|
125537
|
+
|
|
125538
|
+
Turn it off with the `preflight` property on the provider:
|
|
125539
|
+
|
|
125540
|
+
```tsx showLineNumbers {6}
|
|
125541
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
125542
|
+
...
|
|
125543
|
+
|
|
125544
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
125545
|
+
<React.StrictMode>
|
|
125546
|
+
<PrimeReactProvider preflight={false}>
|
|
125547
|
+
<App />
|
|
125548
|
+
</PrimeReactProvider>
|
|
125549
|
+
</React.StrictMode>
|
|
125550
|
+
);
|
|
125551
|
+
```
|
|
125552
|
+
|
|
125553
|
+
Turn it off in a project that already resets these elements, for example with Tailwind's own preflight, normalize.css or Bootstrap's reboot.
|
|
125554
|
+
|
|
125555
|
+
An application that loads Tailwind through a cascade layer needs the `primeui` layer declared before the `tailwindcss` import. The reset lives in `primeui.base`, a layer nested inside `primeui`, so declaring `primeui` alone is enough to position both the reset and the theme; a separate `primeui-base` declaration does not reach it and the reset ends up overriding the theme instead. This is also the layer name `theme.options.cssLayer` wraps component styles in when enabled (`primeui` by default, or the name passed to it), so an application already using that option has already declared the layer it needs. See the [Tailwind guide](/docs/styled/guides/theming/tailwind) for the declaration and why the order matters.
|
|
125556
|
+
|
|
125326
125557
|
## PassThrough
|
|
125327
125558
|
|
|
125328
125559
|
Defines the shared pass through properties per component type. Visit the [Pass Through Props](/docs/passthrough) documentation for more information.
|
|
@@ -127934,7 +128165,7 @@ Tokens follow the [Design Tokens Format Module](https://www.designtokens.org/tr/
|
|
|
127934
128165
|
|
|
127935
128166
|
### Moving existing customizations
|
|
127936
128167
|
|
|
127937
|
-
| v10
|
|
128168
|
+
| v10 | Where it goes in v11 |
|
|
127938
128169
|
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
127939
128170
|
| A SASS theme built from `theme.scss` | Variable overrides become token overrides in a preset. A rewrite, but usually a much shorter file, since a preset only lists what differs from the base. |
|
|
127940
128171
|
| CSS overrides against `p-*` classes | Still work. The class names survived. Keep them as the fallback, since a token reaches every component that uses it while a selector reaches one. |
|
|
@@ -127953,7 +128184,7 @@ v10 had one way to get unstyled components: the `unstyled` flag, set globally or
|
|
|
127953
128184
|
| `<PrimeReactProvider unstyled>` | The whole application is styled by something else |
|
|
127954
128185
|
| `unstyled` on a component | Most of the app is themed, one screen is not |
|
|
127955
128186
|
| Import from `primereact` | Building a design system on the primitives, with no theme layer in the bundle |
|
|
127956
|
-
| Import from `@primereact/headless` | Hand-written markup as well as hand-written styling
|
|
128187
|
+
| Import from `@primereact/headless` | Hand-written markup as well as hand-written styling |
|
|
127957
128188
|
|
|
127958
128189
|
The last two are the difference from v10. There, unstyled mode meant the styled component with its class generation switched off, so the theming layer still shipped. In v11 the layers are separate packages, so importing from `primereact` means the styles never enter the bundle at all.
|
|
127959
128190
|
|
|
@@ -131917,6 +132148,31 @@ In the CSS file that contains the tailwindcss import, add the `tailwindcss-prime
|
|
|
131917
132148
|
@import 'tailwindcss-primeui';
|
|
131918
132149
|
```
|
|
131919
132150
|
|
|
132151
|
+
### Cascade layer
|
|
132152
|
+
|
|
132153
|
+
PrimeReact resets the browser defaults on the native elements it renders (preflight, see the [configuration guide](/docs/styled/guides/configuration)), and those rules live in `primeui.base`, a cascade layer nested under `primeui`. A CSS layer is ordered where its name is first declared, not where its rules are written, so when `tailwindcss` declares its layers first, `primeui` ends up after them and the reset wins over utility classes.
|
|
132154
|
+
|
|
132155
|
+
This only shows up in server-rendered apps, and only before hydration: PrimeReact injects the layer declaration at runtime, which lands after the application's own CSS on the first server-rendered response. Utility classes meant to override the reset lose until the client takes over, so the first paint is visibly wrong and corrects itself once React hydrates.
|
|
132156
|
+
|
|
132157
|
+
Fix the order by declaring the layer above the `tailwindcss` import:
|
|
132158
|
+
|
|
132159
|
+
```css
|
|
132160
|
+
@layer primeui;
|
|
132161
|
+
|
|
132162
|
+
@import 'tailwindcss';
|
|
132163
|
+
@import 'tailwindcss-primeui';
|
|
132164
|
+
```
|
|
132165
|
+
|
|
132166
|
+
Declaring `primeui` is enough on its own: `primeui.base`, where the reset lives, is nested inside it, and a nested layer's order is fixed by its parent's. Declaring it after the `tailwindcss` import does nothing, since the order is already fixed by then. This applies to any framework that declares its own layers, not just Tailwind.
|
|
132167
|
+
|
|
132168
|
+
An application with `theme.options.cssLayer` enabled has already declared this layer: that option wraps PrimeReact's component styles, variables and global style in a layer named `primeui` by default, or in whatever name is passed to it (`{ name: 'myui' }` produces `myui`), and `@layer primeui;` covers the reset and that layer with the same line.
|
|
132169
|
+
|
|
132170
|
+
Where Tailwind's own preflight is already in use, or another reset such as normalize.css or Bootstrap's reboot, turn off PrimeReact's instead of maintaining two resets:
|
|
132171
|
+
|
|
132172
|
+
```tsx
|
|
132173
|
+
<PrimeReactProvider preflight={false}>
|
|
132174
|
+
```
|
|
132175
|
+
|
|
131920
132176
|
### Tailwind v3
|
|
131921
132177
|
|
|
131922
132178
|
Use the plugins option in your Tailwind config file to configure the plugin.
|