@primereact/mcp 11.0.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 +1116 -141
- 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/headless/guides/misc/internationalization.md +282 -0
- 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 +10444 -1743
- package/data/llms/llms.txt +15 -0
- 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 +215 -121
- 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 +2219 -0
- package/data/llms/primitive/guides/misc/internationalization.md +287 -0
- package/data/llms/styled/add-ons/designer/ci.md +273 -0
- package/data/llms/styled/add-ons/designer/guide.md +99 -0
- package/data/llms/styled/add-ons/designer/overview.md +194 -0
- package/data/llms/styled/add-ons/uikit/guide/v3.md +182 -0
- package/data/llms/styled/add-ons/uikit/guide/v4.md +163 -0
- package/data/llms/styled/add-ons/uikit/overview.md +204 -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 +101 -88
- 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/menu.md +39 -41
- 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 +223 -0
- package/data/llms/styled/guides/form/formik.md +448 -0
- package/data/llms/styled/guides/form/react-hook-form.md +503 -0
- package/data/llms/styled/guides/form/tanstack.md +502 -0
- package/data/llms/styled/guides/migration/updating-to-v11.md +2219 -0
- package/data/llms/styled/guides/misc/internationalization.md +379 -0
- 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/menu.md +5 -5
- package/data/llms/tailwind/components/select.md +3 -0
- package/data/llms/tailwind/components/sidebar.md +16 -11
- package/data/llms/tailwind/components/tooltip.md +4 -13
- package/data/llms/tailwind/guides/misc/internationalization.md +287 -0
- package/data/manifest.json +1089 -779
- package/data/mcp-data.json +263 -32
- package/dist/index.d.ts +7 -2
- package/dist/index.js +1 -1
- package/package.json +9 -8
- package/data/llms/styled/guides/installation/configuration.md +0 -135
- package/data/llms/tailwind/guides/theming/guide.md +0 -179
|
@@ -13,6 +13,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
13
13
|
import { Video } from '@primeicons/react/video';
|
|
14
14
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
15
15
|
import { DataTable } from '@primereact/ui/datatable';
|
|
16
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
16
17
|
import { Tag } from '@primereact/ui/tag';
|
|
17
18
|
import * as React from 'react';
|
|
18
19
|
|
|
@@ -26,7 +27,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
26
27
|
|
|
27
28
|
function TypeIcon({ type }: { type: string }) {
|
|
28
29
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
30
|
+
|
|
29
31
|
if (type === 'Video') return <Video size={16} />;
|
|
32
|
+
|
|
30
33
|
if (type === 'Folder') return <Folder size={16} />;
|
|
31
34
|
|
|
32
35
|
return <File size={16} />;
|
|
@@ -123,7 +126,7 @@ export default function Preview() {
|
|
|
123
126
|
</DataTable.THeadRow>
|
|
124
127
|
</DataTable.THead>
|
|
125
128
|
<DataTable.TBody>
|
|
126
|
-
{({ item }: { item:
|
|
129
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
127
130
|
<DataTable.Row key={String(item.key)}>
|
|
128
131
|
<DataTable.Cell>
|
|
129
132
|
<div className="flex items-center gap-2">
|
|
@@ -234,6 +237,7 @@ import { ChevronDown } from '@primeicons/react/chevron-down';
|
|
|
234
237
|
import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
235
238
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
236
239
|
import { DataTable } from '@primereact/ui/datatable';
|
|
240
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
237
241
|
import * as React from 'react';
|
|
238
242
|
|
|
239
243
|
interface TreeNode {
|
|
@@ -297,7 +301,7 @@ export default function BasicDemo() {
|
|
|
297
301
|
</DataTable.THeadRow>
|
|
298
302
|
</DataTable.THead>
|
|
299
303
|
<DataTable.TBody>
|
|
300
|
-
{({ item }: { item:
|
|
304
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
301
305
|
<DataTable.Row key={String(item.key)}>
|
|
302
306
|
<DataTable.Cell>
|
|
303
307
|
<div className="flex items-center gap-2">
|
|
@@ -340,6 +344,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
340
344
|
import { Video } from '@primeicons/react/video';
|
|
341
345
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
342
346
|
import { DataTable } from '@primereact/ui/datatable';
|
|
347
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
343
348
|
import { Tag } from '@primereact/ui/tag';
|
|
344
349
|
import { ToggleButton } from '@primereact/ui/togglebutton';
|
|
345
350
|
import { ToggleButtonGroup } from '@primereact/ui/togglebuttongroup';
|
|
@@ -355,7 +360,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
355
360
|
|
|
356
361
|
function TypeIcon({ type }: { type: string }) {
|
|
357
362
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
363
|
+
|
|
358
364
|
if (type === 'Video') return <Video size={16} />;
|
|
365
|
+
|
|
359
366
|
if (type === 'Folder') return <Folder size={16} />;
|
|
360
367
|
|
|
361
368
|
return <File size={16} />;
|
|
@@ -462,7 +469,7 @@ export default function TreeTableSizeDemo() {
|
|
|
462
469
|
</DataTable.THeadRow>
|
|
463
470
|
</DataTable.THead>
|
|
464
471
|
<DataTable.TBody>
|
|
465
|
-
{({ item }: { item:
|
|
472
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
466
473
|
<DataTable.Row key={String(item.key)}>
|
|
467
474
|
<DataTable.Cell>
|
|
468
475
|
<div className="flex items-center gap-2">
|
|
@@ -528,6 +535,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
528
535
|
import { Video } from '@primeicons/react/video';
|
|
529
536
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
530
537
|
import { DataTable } from '@primereact/ui/datatable';
|
|
538
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
531
539
|
import { Tag } from '@primereact/ui/tag';
|
|
532
540
|
import * as React from 'react';
|
|
533
541
|
|
|
@@ -541,7 +549,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
541
549
|
|
|
542
550
|
function TypeIcon({ type }: { type: string }) {
|
|
543
551
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
552
|
+
|
|
544
553
|
if (type === 'Video') return <Video size={16} />;
|
|
554
|
+
|
|
545
555
|
if (type === 'Folder') return <Folder size={16} />;
|
|
546
556
|
|
|
547
557
|
return <File size={16} />;
|
|
@@ -625,7 +635,7 @@ export default function TreeTableGridlinesDemo() {
|
|
|
625
635
|
</DataTable.THeadRow>
|
|
626
636
|
</DataTable.THead>
|
|
627
637
|
<DataTable.TBody>
|
|
628
|
-
{({ item }: { item:
|
|
638
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
629
639
|
<DataTable.Row key={String(item.key)}>
|
|
630
640
|
<DataTable.Cell>
|
|
631
641
|
<div className="flex items-center gap-2">
|
|
@@ -691,6 +701,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
691
701
|
import { Video } from '@primeicons/react/video';
|
|
692
702
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
693
703
|
import { DataTable } from '@primereact/ui/datatable';
|
|
704
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
694
705
|
import { Tag } from '@primereact/ui/tag';
|
|
695
706
|
import * as React from 'react';
|
|
696
707
|
|
|
@@ -704,7 +715,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
704
715
|
|
|
705
716
|
function TypeIcon({ type }: { type: string }) {
|
|
706
717
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
718
|
+
|
|
707
719
|
if (type === 'Video') return <Video size={16} />;
|
|
720
|
+
|
|
708
721
|
if (type === 'Folder') return <Folder size={16} />;
|
|
709
722
|
|
|
710
723
|
return <File size={16} />;
|
|
@@ -788,7 +801,7 @@ export default function TreeTableStripedRowsDemo() {
|
|
|
788
801
|
</DataTable.THeadRow>
|
|
789
802
|
</DataTable.THead>
|
|
790
803
|
<DataTable.TBody>
|
|
791
|
-
{({ item }: { item:
|
|
804
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
792
805
|
<DataTable.Row key={String(item.key)}>
|
|
793
806
|
<DataTable.Cell>
|
|
794
807
|
<div className="flex items-center gap-2">
|
|
@@ -853,6 +866,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
853
866
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
854
867
|
import type { DataTableExpansionEvent, DataTableSelectionEvent } from '@primereact/ui/datatable';
|
|
855
868
|
import { DataTable } from '@primereact/ui/datatable';
|
|
869
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
856
870
|
import { Tag } from '@primereact/ui/tag';
|
|
857
871
|
import * as React from 'react';
|
|
858
872
|
import { File } from '@primeicons/react/file';
|
|
@@ -875,7 +889,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
875
889
|
|
|
876
890
|
function TypeIcon({ type }: { type: string }) {
|
|
877
891
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
892
|
+
|
|
878
893
|
if (type === 'Video') return <Video size={16} />;
|
|
894
|
+
|
|
879
895
|
if (type === 'Folder') return <Folder size={16} />;
|
|
880
896
|
|
|
881
897
|
return <File size={16} />;
|
|
@@ -918,7 +934,7 @@ export default function SingleSelectionDemo() {
|
|
|
918
934
|
</DataTable.THeadRow>
|
|
919
935
|
</DataTable.THead>
|
|
920
936
|
<DataTable.TBody>
|
|
921
|
-
{({ item }: { item:
|
|
937
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
922
938
|
<DataTable.Row key={String(item.key)}>
|
|
923
939
|
<DataTable.Cell>
|
|
924
940
|
<div className="flex items-center gap-2">
|
|
@@ -981,6 +997,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
981
997
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
982
998
|
import type { DataTableExpansionEvent, DataTableSelectionEvent } from '@primereact/ui/datatable';
|
|
983
999
|
import { DataTable } from '@primereact/ui/datatable';
|
|
1000
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
984
1001
|
import { Tag } from '@primereact/ui/tag';
|
|
985
1002
|
import * as React from 'react';
|
|
986
1003
|
import { File } from '@primeicons/react/file';
|
|
@@ -1003,7 +1020,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
1003
1020
|
|
|
1004
1021
|
function TypeIcon({ type }: { type: string }) {
|
|
1005
1022
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
1023
|
+
|
|
1006
1024
|
if (type === 'Video') return <Video size={16} />;
|
|
1025
|
+
|
|
1007
1026
|
if (type === 'Folder') return <Folder size={16} />;
|
|
1008
1027
|
|
|
1009
1028
|
return <File size={16} />;
|
|
@@ -1047,7 +1066,7 @@ export default function MultipleSelectionDemo() {
|
|
|
1047
1066
|
</DataTable.THeadRow>
|
|
1048
1067
|
</DataTable.THead>
|
|
1049
1068
|
<DataTable.TBody>
|
|
1050
|
-
{({ item }: { item:
|
|
1069
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
1051
1070
|
<DataTable.Row key={String(item.key)}>
|
|
1052
1071
|
<DataTable.Cell>
|
|
1053
1072
|
<div className="flex items-center gap-2">
|
|
@@ -1118,6 +1137,7 @@ import type { CheckboxRootChangeEvent } from '@primereact/ui/checkbox';
|
|
|
1118
1137
|
import type { DataTableSelectionInstance } from '@primereact/ui/datatable';
|
|
1119
1138
|
import { Checkbox } from '@primereact/ui/checkbox';
|
|
1120
1139
|
import { DataTable } from '@primereact/ui/datatable';
|
|
1140
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
1121
1141
|
import { Tag } from '@primereact/ui/tag';
|
|
1122
1142
|
import * as React from 'react';
|
|
1123
1143
|
|
|
@@ -1131,7 +1151,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
1131
1151
|
|
|
1132
1152
|
function TypeIcon({ type }: { type: string }) {
|
|
1133
1153
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
1154
|
+
|
|
1134
1155
|
if (type === 'Video') return <Video size={16} />;
|
|
1156
|
+
|
|
1135
1157
|
if (type === 'Folder') return <Folder size={16} />;
|
|
1136
1158
|
|
|
1137
1159
|
return <File size={16} />;
|
|
@@ -1258,7 +1280,7 @@ export default function TreeTableSelectionDemo() {
|
|
|
1258
1280
|
</DataTable.THeadRow>
|
|
1259
1281
|
</DataTable.THead>
|
|
1260
1282
|
<DataTable.TBody key={JSON.stringify(selectionKeys)}>
|
|
1261
|
-
{({ item }: { item:
|
|
1283
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
1262
1284
|
<DataTable.Row key={String(item.key)}>
|
|
1263
1285
|
<DataTable.Cell>
|
|
1264
1286
|
<div className="flex items-center gap-2">
|
|
@@ -1339,6 +1361,7 @@ import type { DataTableExpansionEvent, DataTableSelectionEvent } from '@primerea
|
|
|
1339
1361
|
import type { DataTableSelectionInstance } from '@primereact/ui/datatable';
|
|
1340
1362
|
import type { RadioButtonRootChangeEvent } from '@primereact/ui/radiobutton';
|
|
1341
1363
|
import { DataTable } from '@primereact/ui/datatable';
|
|
1364
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
1342
1365
|
import { RadioButton } from '@primereact/ui/radiobutton';
|
|
1343
1366
|
import { Tag } from '@primereact/ui/tag';
|
|
1344
1367
|
import * as React from 'react';
|
|
@@ -1362,7 +1385,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
1362
1385
|
|
|
1363
1386
|
function TypeIcon({ type }: { type: string }) {
|
|
1364
1387
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
1388
|
+
|
|
1365
1389
|
if (type === 'Video') return <Video size={16} />;
|
|
1390
|
+
|
|
1366
1391
|
if (type === 'Folder') return <Folder size={16} />;
|
|
1367
1392
|
|
|
1368
1393
|
return <File size={16} />;
|
|
@@ -1406,7 +1431,7 @@ export default function RadioSelectionDemo() {
|
|
|
1406
1431
|
</DataTable.THeadRow>
|
|
1407
1432
|
</DataTable.THead>
|
|
1408
1433
|
<DataTable.TBody>
|
|
1409
|
-
{({ item }: { item:
|
|
1434
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
1410
1435
|
<DataTable.Row key={String(item.key)}>
|
|
1411
1436
|
<DataTable.Cell>
|
|
1412
1437
|
<DataTable.Selection mode="radio">
|
|
@@ -1484,6 +1509,7 @@ import { NodeService, type TreeTableNode } from '@/shared/services/node.service'
|
|
|
1484
1509
|
import type { DataTableExpansionEvent, DataTableSelectionEvent } from '@primereact/ui/datatable';
|
|
1485
1510
|
import { Badge } from '@primereact/ui/badge';
|
|
1486
1511
|
import { DataTable } from '@primereact/ui/datatable';
|
|
1512
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
1487
1513
|
import { Tag } from '@primereact/ui/tag';
|
|
1488
1514
|
import * as React from 'react';
|
|
1489
1515
|
import { File } from '@primeicons/react/file';
|
|
@@ -1506,7 +1532,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
1506
1532
|
|
|
1507
1533
|
function TypeIcon({ type }: { type: string }) {
|
|
1508
1534
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
1535
|
+
|
|
1509
1536
|
if (type === 'Video') return <Video size={16} />;
|
|
1537
|
+
|
|
1510
1538
|
if (type === 'Folder') return <Folder size={16} />;
|
|
1511
1539
|
|
|
1512
1540
|
return <File size={16} />;
|
|
@@ -1565,7 +1593,7 @@ export default function KeyboardDemo() {
|
|
|
1565
1593
|
</DataTable.THeadRow>
|
|
1566
1594
|
</DataTable.THead>
|
|
1567
1595
|
<DataTable.TBody>
|
|
1568
|
-
{({ item }: { item:
|
|
1596
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
1569
1597
|
<DataTable.Row key={String(item.key)}>
|
|
1570
1598
|
<DataTable.Cell>
|
|
1571
1599
|
<div className="flex items-center gap-2">
|
|
@@ -1635,6 +1663,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
1635
1663
|
import type { DataTableSortOrderInstance } from '@primereact/ui/datatable';
|
|
1636
1664
|
import { Badge } from '@primereact/ui/badge';
|
|
1637
1665
|
import { DataTable } from '@primereact/ui/datatable';
|
|
1666
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
1638
1667
|
import { OverlayBadge } from '@primereact/ui/overlaybadge';
|
|
1639
1668
|
import { Tag } from '@primereact/ui/tag';
|
|
1640
1669
|
import * as React from 'react';
|
|
@@ -1658,7 +1687,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
1658
1687
|
|
|
1659
1688
|
function TypeIcon({ type }: { type: string }) {
|
|
1660
1689
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
1690
|
+
|
|
1661
1691
|
if (type === 'Video') return <Video size={16} />;
|
|
1692
|
+
|
|
1662
1693
|
if (type === 'Folder') return <Folder size={16} />;
|
|
1663
1694
|
|
|
1664
1695
|
return <File size={16} />;
|
|
@@ -1730,7 +1761,7 @@ export default function SortDemo() {
|
|
|
1730
1761
|
</DataTable.THeadRow>
|
|
1731
1762
|
</DataTable.THead>
|
|
1732
1763
|
<DataTable.TBody>
|
|
1733
|
-
{({ item }: { item:
|
|
1764
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
1734
1765
|
<DataTable.Row key={String(item.key)}>
|
|
1735
1766
|
<DataTable.Cell>
|
|
1736
1767
|
<div className="flex items-center gap-2">
|
|
@@ -1796,6 +1827,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
1796
1827
|
import type { DataTableSortOrderInstance } from '@primereact/ui/datatable';
|
|
1797
1828
|
import { Badge } from '@primereact/ui/badge';
|
|
1798
1829
|
import { DataTable } from '@primereact/ui/datatable';
|
|
1830
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
1799
1831
|
import { OverlayBadge } from '@primereact/ui/overlaybadge';
|
|
1800
1832
|
import { Tag } from '@primereact/ui/tag';
|
|
1801
1833
|
import * as React from 'react';
|
|
@@ -1819,7 +1851,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
1819
1851
|
|
|
1820
1852
|
function TypeIcon({ type }: { type: string }) {
|
|
1821
1853
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
1854
|
+
|
|
1822
1855
|
if (type === 'Video') return <Video size={16} />;
|
|
1856
|
+
|
|
1823
1857
|
if (type === 'Folder') return <Folder size={16} />;
|
|
1824
1858
|
|
|
1825
1859
|
return <File size={16} />;
|
|
@@ -1891,7 +1925,7 @@ export default function MultiSortDemo() {
|
|
|
1891
1925
|
</DataTable.THeadRow>
|
|
1892
1926
|
</DataTable.THead>
|
|
1893
1927
|
<DataTable.TBody>
|
|
1894
|
-
{({ item }: { item:
|
|
1928
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
1895
1929
|
<DataTable.Row key={String(item.key)}>
|
|
1896
1930
|
<DataTable.Cell>
|
|
1897
1931
|
<div className="flex items-center gap-2">
|
|
@@ -1955,6 +1989,7 @@ import { SortAmountUpAlt } from '@primeicons/react/sort-amount-up-alt';
|
|
|
1955
1989
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
1956
1990
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
1957
1991
|
import { DataTable } from '@primereact/ui/datatable';
|
|
1992
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
1958
1993
|
import { Tag } from '@primereact/ui/tag';
|
|
1959
1994
|
import * as React from 'react';
|
|
1960
1995
|
import { File } from '@primeicons/react/file';
|
|
@@ -1977,7 +2012,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
1977
2012
|
|
|
1978
2013
|
function TypeIcon({ type }: { type: string }) {
|
|
1979
2014
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
2015
|
+
|
|
1980
2016
|
if (type === 'Video') return <Video size={16} />;
|
|
2017
|
+
|
|
1981
2018
|
if (type === 'Folder') return <Folder size={16} />;
|
|
1982
2019
|
|
|
1983
2020
|
return <File size={16} />;
|
|
@@ -2052,7 +2089,7 @@ export default function PresortDemo() {
|
|
|
2052
2089
|
</DataTable.THeadRow>
|
|
2053
2090
|
</DataTable.THead>
|
|
2054
2091
|
<DataTable.TBody>
|
|
2055
|
-
{({ item }: { item:
|
|
2092
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
2056
2093
|
<DataTable.Row key={String(item.key)}>
|
|
2057
2094
|
<DataTable.Cell>
|
|
2058
2095
|
<div className="flex items-center gap-2">
|
|
@@ -2116,6 +2153,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
2116
2153
|
import type { DataTableSortOrderInstance } from '@primereact/ui/datatable';
|
|
2117
2154
|
import { Badge } from '@primereact/ui/badge';
|
|
2118
2155
|
import { DataTable } from '@primereact/ui/datatable';
|
|
2156
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
2119
2157
|
import { OverlayBadge } from '@primereact/ui/overlaybadge';
|
|
2120
2158
|
import { Tag } from '@primereact/ui/tag';
|
|
2121
2159
|
import * as React from 'react';
|
|
@@ -2139,7 +2177,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
2139
2177
|
|
|
2140
2178
|
function TypeIcon({ type }: { type: string }) {
|
|
2141
2179
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
2180
|
+
|
|
2142
2181
|
if (type === 'Video') return <Video size={16} />;
|
|
2182
|
+
|
|
2143
2183
|
if (type === 'Folder') return <Folder size={16} />;
|
|
2144
2184
|
|
|
2145
2185
|
return <File size={16} />;
|
|
@@ -2243,7 +2283,7 @@ export default function PresortMultiDemo() {
|
|
|
2243
2283
|
</DataTable.THeadRow>
|
|
2244
2284
|
</DataTable.THead>
|
|
2245
2285
|
<DataTable.TBody>
|
|
2246
|
-
{({ item }: { item:
|
|
2286
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
2247
2287
|
<DataTable.Row key={String(item.key)}>
|
|
2248
2288
|
<DataTable.Cell>
|
|
2249
2289
|
<div className="flex items-center gap-2">
|
|
@@ -2313,6 +2353,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
2313
2353
|
import type { PaginatorRootChangeEvent } from '@primereact/ui/paginator';
|
|
2314
2354
|
import type { DataTablePaginationInstance } from '@primereact/ui/datatable';
|
|
2315
2355
|
import { DataTable } from '@primereact/ui/datatable';
|
|
2356
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
2316
2357
|
import { Paginator } from '@primereact/ui/paginator';
|
|
2317
2358
|
import { Tag } from '@primereact/ui/tag';
|
|
2318
2359
|
import type { PaginatorPagesInstance } from '@primereact/ui/paginator';
|
|
@@ -2337,7 +2378,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
2337
2378
|
|
|
2338
2379
|
function TypeIcon({ type }: { type: string }) {
|
|
2339
2380
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
2381
|
+
|
|
2340
2382
|
if (type === 'Video') return <Video size={16} />;
|
|
2383
|
+
|
|
2341
2384
|
if (type === 'Folder') return <Folder size={16} />;
|
|
2342
2385
|
|
|
2343
2386
|
return <File size={16} />;
|
|
@@ -2378,7 +2421,7 @@ export default function PaginationDemo() {
|
|
|
2378
2421
|
</DataTable.THeadRow>
|
|
2379
2422
|
</DataTable.THead>
|
|
2380
2423
|
<DataTable.TBody>
|
|
2381
|
-
{({ item }: { item:
|
|
2424
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
2382
2425
|
<DataTable.Row key={String(item.key)}>
|
|
2383
2426
|
<DataTable.Cell>
|
|
2384
2427
|
<div className="flex items-center gap-2">
|
|
@@ -2487,6 +2530,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
2487
2530
|
import { Video } from '@primeicons/react/video';
|
|
2488
2531
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
2489
2532
|
import { DataTable } from '@primereact/ui/datatable';
|
|
2533
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
2490
2534
|
import { Tag } from '@primereact/ui/tag';
|
|
2491
2535
|
import * as React from 'react';
|
|
2492
2536
|
|
|
@@ -2510,7 +2554,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
2510
2554
|
|
|
2511
2555
|
function TypeIcon({ type }: { type: string }) {
|
|
2512
2556
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
2557
|
+
|
|
2513
2558
|
if (type === 'Video') return <Video size={16} />;
|
|
2559
|
+
|
|
2514
2560
|
if (type === 'Folder') return <Folder size={16} />;
|
|
2515
2561
|
|
|
2516
2562
|
return <File size={16} />;
|
|
@@ -2566,7 +2612,7 @@ export default function TreeTableScrollDemo() {
|
|
|
2566
2612
|
</DataTable.THeadRow>
|
|
2567
2613
|
</DataTable.THead>
|
|
2568
2614
|
<DataTable.TBody>
|
|
2569
|
-
{({ item }: { item:
|
|
2615
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
2570
2616
|
<DataTable.Row key={String(item.key)}>
|
|
2571
2617
|
<DataTable.Cell>
|
|
2572
2618
|
<div className="flex items-center gap-2">
|
|
@@ -2627,6 +2673,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
2627
2673
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
2628
2674
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
2629
2675
|
import { DataTable } from '@primereact/ui/datatable';
|
|
2676
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
2630
2677
|
import { Tag } from '@primereact/ui/tag';
|
|
2631
2678
|
import * as React from 'react';
|
|
2632
2679
|
import { File } from '@primeicons/react/file';
|
|
@@ -2649,7 +2696,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
2649
2696
|
|
|
2650
2697
|
function TypeIcon({ type }: { type: string }) {
|
|
2651
2698
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
2699
|
+
|
|
2652
2700
|
if (type === 'Video') return <Video size={16} />;
|
|
2701
|
+
|
|
2653
2702
|
if (type === 'Folder') return <Folder size={16} />;
|
|
2654
2703
|
|
|
2655
2704
|
return <File size={16} />;
|
|
@@ -2699,7 +2748,7 @@ export default function ScrollHorizontalDemo() {
|
|
|
2699
2748
|
</DataTable.THeadRow>
|
|
2700
2749
|
</DataTable.THead>
|
|
2701
2750
|
<DataTable.TBody>
|
|
2702
|
-
{({ item }: { item:
|
|
2751
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
2703
2752
|
<DataTable.Row key={String(item.key)}>
|
|
2704
2753
|
<DataTable.Cell>
|
|
2705
2754
|
<div className="flex items-center gap-2">
|
|
@@ -2765,6 +2814,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
2765
2814
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
2766
2815
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
2767
2816
|
import { DataTable } from '@primereact/ui/datatable';
|
|
2817
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
2768
2818
|
import { Tag } from '@primereact/ui/tag';
|
|
2769
2819
|
import * as React from 'react';
|
|
2770
2820
|
import { File } from '@primeicons/react/file';
|
|
@@ -2787,7 +2837,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
2787
2837
|
|
|
2788
2838
|
function TypeIcon({ type }: { type: string }) {
|
|
2789
2839
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
2840
|
+
|
|
2790
2841
|
if (type === 'Video') return <Video size={16} />;
|
|
2842
|
+
|
|
2791
2843
|
if (type === 'Folder') return <Folder size={16} />;
|
|
2792
2844
|
|
|
2793
2845
|
return <File size={16} />;
|
|
@@ -2828,7 +2880,7 @@ export default function ScrollFlexDemo() {
|
|
|
2828
2880
|
</DataTable.THeadRow>
|
|
2829
2881
|
</DataTable.THead>
|
|
2830
2882
|
<DataTable.TBody>
|
|
2831
|
-
{({ item }: { item:
|
|
2883
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
2832
2884
|
<DataTable.Row key={String(item.key)}>
|
|
2833
2885
|
<DataTable.Cell>
|
|
2834
2886
|
<div className="flex items-center gap-2">
|
|
@@ -2894,6 +2946,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
2894
2946
|
import { Video } from '@primeicons/react/video';
|
|
2895
2947
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
2896
2948
|
import { DataTable } from '@primereact/ui/datatable';
|
|
2949
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
2897
2950
|
import { Tag } from '@primereact/ui/tag';
|
|
2898
2951
|
import * as React from 'react';
|
|
2899
2952
|
|
|
@@ -2913,7 +2966,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
2913
2966
|
|
|
2914
2967
|
function TypeIcon({ type }: { type: string }) {
|
|
2915
2968
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
2969
|
+
|
|
2916
2970
|
if (type === 'Video') return <Video size={16} />;
|
|
2971
|
+
|
|
2917
2972
|
if (type === 'Folder') return <Folder size={16} />;
|
|
2918
2973
|
|
|
2919
2974
|
return <File size={16} />;
|
|
@@ -2987,7 +3042,7 @@ export default function TreeTableFrozenColumnsDemo() {
|
|
|
2987
3042
|
</DataTable.THeadRow>
|
|
2988
3043
|
</DataTable.THead>
|
|
2989
3044
|
<DataTable.TBody>
|
|
2990
|
-
{({ item }: { item:
|
|
3045
|
+
{({ item }: { item: DataTableTreeRow<TreeNode> }) => (
|
|
2991
3046
|
<DataTable.Row key={String(item.key)}>
|
|
2992
3047
|
<DataTable.Cell frozen>
|
|
2993
3048
|
<div className="flex items-center gap-2">
|
|
@@ -3053,6 +3108,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
3053
3108
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
3054
3109
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
3055
3110
|
import { DataTable } from '@primereact/ui/datatable';
|
|
3111
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
3056
3112
|
import { Tag } from '@primereact/ui/tag';
|
|
3057
3113
|
import * as React from 'react';
|
|
3058
3114
|
import { File } from '@primeicons/react/file';
|
|
@@ -3075,7 +3131,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
3075
3131
|
|
|
3076
3132
|
function TypeIcon({ type }: { type: string }) {
|
|
3077
3133
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
3134
|
+
|
|
3078
3135
|
if (type === 'Video') return <Video size={16} />;
|
|
3136
|
+
|
|
3079
3137
|
if (type === 'Folder') return <Folder size={16} />;
|
|
3080
3138
|
|
|
3081
3139
|
return <File size={16} />;
|
|
@@ -3125,7 +3183,7 @@ export default function ScrollFrozenColumnsMultiDemo() {
|
|
|
3125
3183
|
</DataTable.THeadRow>
|
|
3126
3184
|
</DataTable.THead>
|
|
3127
3185
|
<DataTable.TBody>
|
|
3128
|
-
{({ item }: { item:
|
|
3186
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
3129
3187
|
<DataTable.Row key={String(item.key)}>
|
|
3130
3188
|
<DataTable.Cell frozen>
|
|
3131
3189
|
<div className="flex items-center gap-2">
|
|
@@ -3196,6 +3254,7 @@ import { LockOpen } from '@primeicons/react/lock-open';
|
|
|
3196
3254
|
import { Video } from '@primeicons/react/video';
|
|
3197
3255
|
import { Button } from '@primereact/ui/button';
|
|
3198
3256
|
import { DataTable } from '@primereact/ui/datatable';
|
|
3257
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
3199
3258
|
import { Tag } from '@primereact/ui/tag';
|
|
3200
3259
|
import * as React from 'react';
|
|
3201
3260
|
|
|
@@ -3215,7 +3274,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
3215
3274
|
|
|
3216
3275
|
function TypeIcon({ type }: { type: string }) {
|
|
3217
3276
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
3277
|
+
|
|
3218
3278
|
if (type === 'Video') return <Video size={16} />;
|
|
3279
|
+
|
|
3219
3280
|
if (type === 'Folder') return <Folder size={16} />;
|
|
3220
3281
|
|
|
3221
3282
|
return <File size={16} />;
|
|
@@ -3279,7 +3340,7 @@ export default function TreeTableFrozenRowsDemo() {
|
|
|
3279
3340
|
</DataTable.Row>
|
|
3280
3341
|
);
|
|
3281
3342
|
|
|
3282
|
-
const renderBodyRow = (item:
|
|
3343
|
+
const renderBodyRow = (item: DataTableTreeRow<TreeNode>) => (
|
|
3283
3344
|
<DataTable.Row key={String(item.key)}>
|
|
3284
3345
|
<DataTable.Cell>
|
|
3285
3346
|
<div className="flex items-center gap-2">
|
|
@@ -3333,7 +3394,7 @@ export default function TreeTableFrozenRowsDemo() {
|
|
|
3333
3394
|
<DataTable.FrozenTBody>
|
|
3334
3395
|
{lockedFolders.flatMap((folder) => flattenBranch(folder).map((node) => renderFrozenRow(node)))}
|
|
3335
3396
|
</DataTable.FrozenTBody>
|
|
3336
|
-
<DataTable.TBody>{({ item }: { item:
|
|
3397
|
+
<DataTable.TBody>{({ item }: { item: DataTableTreeRow<TreeNode> }) => renderBodyRow(item)}</DataTable.TBody>
|
|
3337
3398
|
<DataTable.EmptyTBody>
|
|
3338
3399
|
<DataTable.Row>
|
|
3339
3400
|
<DataTable.Cell colSpan={4}>
|
|
@@ -3377,6 +3438,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
3377
3438
|
import { Video } from '@primeicons/react/video';
|
|
3378
3439
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
3379
3440
|
import { DataTable } from '@primereact/ui/datatable';
|
|
3441
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
3380
3442
|
import { InputText } from '@primereact/ui/inputtext';
|
|
3381
3443
|
import { Tag } from '@primereact/ui/tag';
|
|
3382
3444
|
import * as React from 'react';
|
|
@@ -3391,7 +3453,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
3391
3453
|
|
|
3392
3454
|
function TypeIcon({ type }: { type: string }) {
|
|
3393
3455
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
3456
|
+
|
|
3394
3457
|
if (type === 'Video') return <Video size={16} />;
|
|
3458
|
+
|
|
3395
3459
|
if (type === 'Folder') return <Folder size={16} />;
|
|
3396
3460
|
|
|
3397
3461
|
return <File size={16} />;
|
|
@@ -3498,7 +3562,7 @@ export default function TreeTableCellEditDemo() {
|
|
|
3498
3562
|
</DataTable.THeadRow>
|
|
3499
3563
|
</DataTable.THead>
|
|
3500
3564
|
<DataTable.TBody>
|
|
3501
|
-
{({ item, index }: { item:
|
|
3565
|
+
{({ item, index }: { item: DataTableTreeRow<TreeNode>; index: number }) => (
|
|
3502
3566
|
<DataTable.Row key={String(item.key)}>
|
|
3503
3567
|
<DataTable.Cell>
|
|
3504
3568
|
<div className="flex items-center gap-2">
|
|
@@ -3516,7 +3580,7 @@ export default function TreeTableCellEditDemo() {
|
|
|
3516
3580
|
<DataTable.CellEditorContent>
|
|
3517
3581
|
<InputText
|
|
3518
3582
|
defaultValue={String(item.name)}
|
|
3519
|
-
onChange={(e:
|
|
3583
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
3520
3584
|
pendingValueRef.current[`${item.key}-name`] = e.target.value;
|
|
3521
3585
|
}}
|
|
3522
3586
|
size="small"
|
|
@@ -3532,7 +3596,7 @@ export default function TreeTableCellEditDemo() {
|
|
|
3532
3596
|
<DataTable.CellEditorContent>
|
|
3533
3597
|
<InputText
|
|
3534
3598
|
defaultValue={String(item.size)}
|
|
3535
|
-
onChange={(e:
|
|
3599
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
3536
3600
|
pendingValueRef.current[`${item.key}-size`] = e.target.value;
|
|
3537
3601
|
}}
|
|
3538
3602
|
size="small"
|
|
@@ -3549,7 +3613,7 @@ export default function TreeTableCellEditDemo() {
|
|
|
3549
3613
|
<DataTable.CellEditorContent>
|
|
3550
3614
|
<InputText
|
|
3551
3615
|
defaultValue={String(item.type)}
|
|
3552
|
-
onChange={(e:
|
|
3616
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
3553
3617
|
pendingValueRef.current[`${item.key}-type`] = e.target.value;
|
|
3554
3618
|
}}
|
|
3555
3619
|
size="small"
|
|
@@ -3603,6 +3667,7 @@ import type { DataTableSelectionInstance } from '@primereact/ui/datatable';
|
|
|
3603
3667
|
import { Badge } from '@primereact/ui/badge';
|
|
3604
3668
|
import { Checkbox } from '@primereact/ui/checkbox';
|
|
3605
3669
|
import { DataTable } from '@primereact/ui/datatable';
|
|
3670
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
3606
3671
|
import { InputText } from '@primereact/ui/inputtext';
|
|
3607
3672
|
import { Tag } from '@primereact/ui/tag';
|
|
3608
3673
|
import * as React from 'react';
|
|
@@ -3626,7 +3691,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
3626
3691
|
|
|
3627
3692
|
function TypeIcon({ type }: { type: string }) {
|
|
3628
3693
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
3694
|
+
|
|
3629
3695
|
if (type === 'Video') return <Video size={16} />;
|
|
3696
|
+
|
|
3630
3697
|
if (type === 'Folder') return <Folder size={16} />;
|
|
3631
3698
|
|
|
3632
3699
|
return <File size={16} />;
|
|
@@ -3722,7 +3789,7 @@ export default function CellEditSelectionDemo() {
|
|
|
3722
3789
|
</DataTable.THeadRow>
|
|
3723
3790
|
</DataTable.THead>
|
|
3724
3791
|
<DataTable.TBody>
|
|
3725
|
-
{({ item, index }: { item:
|
|
3792
|
+
{({ item, index }: { item: DataTableTreeRow<TreeTableNode>; index: number }) => (
|
|
3726
3793
|
<DataTable.Row key={String(item.key)}>
|
|
3727
3794
|
<DataTable.Cell>
|
|
3728
3795
|
<DataTable.Selection>
|
|
@@ -3760,7 +3827,7 @@ export default function CellEditSelectionDemo() {
|
|
|
3760
3827
|
<DataTable.CellEditorContent>
|
|
3761
3828
|
<InputText
|
|
3762
3829
|
defaultValue={String(item.name)}
|
|
3763
|
-
onChange={(e:
|
|
3830
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
3764
3831
|
pendingValueRef.current[`${item.key}-name`] = e.target.value;
|
|
3765
3832
|
}}
|
|
3766
3833
|
size="small"
|
|
@@ -3778,7 +3845,7 @@ export default function CellEditSelectionDemo() {
|
|
|
3778
3845
|
<DataTable.CellEditorContent>
|
|
3779
3846
|
<InputText
|
|
3780
3847
|
defaultValue={String(item.size)}
|
|
3781
|
-
onChange={(e:
|
|
3848
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
3782
3849
|
pendingValueRef.current[`${item.key}-size`] = e.target.value;
|
|
3783
3850
|
}}
|
|
3784
3851
|
size="small"
|
|
@@ -3836,9 +3903,11 @@ import { Times } from '@primeicons/react/times';
|
|
|
3836
3903
|
import type { DataTableExpansionEvent, DataTableRowEditEvent } from '@primereact/ui/datatable';
|
|
3837
3904
|
import { Button } from '@primereact/ui/button';
|
|
3838
3905
|
import { DataTable } from '@primereact/ui/datatable';
|
|
3906
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
3839
3907
|
import { InputText } from '@primereact/ui/inputtext';
|
|
3840
3908
|
import { Tag } from '@primereact/ui/tag';
|
|
3841
3909
|
import * as React from 'react';
|
|
3910
|
+
import type { DataTableEditingEvent } from '@primereact/ui/datatable';
|
|
3842
3911
|
|
|
3843
3912
|
const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> = {
|
|
3844
3913
|
Folder: 'warn',
|
|
@@ -3849,7 +3918,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
3849
3918
|
|
|
3850
3919
|
function TypeIcon({ type }: { type: string }) {
|
|
3851
3920
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
3921
|
+
|
|
3852
3922
|
if (type === 'Video') return <Video size={16} />;
|
|
3923
|
+
|
|
3853
3924
|
if (type === 'Folder') return <Folder size={16} />;
|
|
3854
3925
|
|
|
3855
3926
|
return <File size={16} />;
|
|
@@ -3945,7 +4016,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
3945
4016
|
onExpandedChange={(e: DataTableExpansionEvent) => setExpandedKeys(e.value)}
|
|
3946
4017
|
editMode="row"
|
|
3947
4018
|
editingKeys={editingKeys}
|
|
3948
|
-
onEditingKeysChange={(e:
|
|
4019
|
+
onEditingKeysChange={(e: DataTableEditingEvent) => setEditingKeys(e.value)}
|
|
3949
4020
|
onRowEditSave={handleSave}
|
|
3950
4021
|
onRowEditCancel={handleCancel}
|
|
3951
4022
|
>
|
|
@@ -3968,7 +4039,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
3968
4039
|
</DataTable.THeadRow>
|
|
3969
4040
|
</DataTable.THead>
|
|
3970
4041
|
<DataTable.TBody>
|
|
3971
|
-
{({ item, index }: { item:
|
|
4042
|
+
{({ item, index }: { item: DataTableTreeRow<TreeNode>; index: number }) => {
|
|
3972
4043
|
const key = String(item.key);
|
|
3973
4044
|
|
|
3974
4045
|
return (
|
|
@@ -3990,7 +4061,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
3990
4061
|
<DataTable.CellEditorContent>
|
|
3991
4062
|
<InputText
|
|
3992
4063
|
defaultValue={String(item.name)}
|
|
3993
|
-
onChange={(e:
|
|
4064
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
3994
4065
|
draftRef.current[key] = { ...draftRef.current[key], name: e.target.value };
|
|
3995
4066
|
}}
|
|
3996
4067
|
size="small"
|
|
@@ -4006,7 +4077,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
4006
4077
|
<DataTable.CellEditorContent>
|
|
4007
4078
|
<InputText
|
|
4008
4079
|
defaultValue={String(item.size)}
|
|
4009
|
-
onChange={(e:
|
|
4080
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
4010
4081
|
draftRef.current[key] = { ...draftRef.current[key], size: e.target.value };
|
|
4011
4082
|
}}
|
|
4012
4083
|
size="small"
|
|
@@ -4023,7 +4094,7 @@ export default function TreeTableRowEditDemo() {
|
|
|
4023
4094
|
<DataTable.CellEditorContent>
|
|
4024
4095
|
<InputText
|
|
4025
4096
|
defaultValue={String(item.type)}
|
|
4026
|
-
onChange={(e:
|
|
4097
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
4027
4098
|
draftRef.current[key] = { ...draftRef.current[key], type: e.target.value };
|
|
4028
4099
|
}}
|
|
4029
4100
|
size="small"
|
|
@@ -4090,6 +4161,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
4090
4161
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
4091
4162
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
4092
4163
|
import { DataTable } from '@primereact/ui/datatable';
|
|
4164
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
4093
4165
|
import { Tag } from '@primereact/ui/tag';
|
|
4094
4166
|
import * as React from 'react';
|
|
4095
4167
|
import { File } from '@primeicons/react/file';
|
|
@@ -4112,7 +4184,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
4112
4184
|
|
|
4113
4185
|
function TypeIcon({ type }: { type: string }) {
|
|
4114
4186
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
4187
|
+
|
|
4115
4188
|
if (type === 'Video') return <Video size={16} />;
|
|
4189
|
+
|
|
4116
4190
|
if (type === 'Folder') return <Folder size={16} />;
|
|
4117
4191
|
|
|
4118
4192
|
return <File size={16} />;
|
|
@@ -4158,7 +4232,7 @@ export default function ResizeDemo() {
|
|
|
4158
4232
|
</DataTable.THeadRow>
|
|
4159
4233
|
</DataTable.THead>
|
|
4160
4234
|
<DataTable.TBody>
|
|
4161
|
-
{({ item }: { item:
|
|
4235
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
4162
4236
|
<DataTable.Row key={String(item.key)}>
|
|
4163
4237
|
<DataTable.Cell>
|
|
4164
4238
|
<div className="flex items-center gap-2">
|
|
@@ -4219,6 +4293,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
4219
4293
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
4220
4294
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
4221
4295
|
import { DataTable } from '@primereact/ui/datatable';
|
|
4296
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
4222
4297
|
import { Tag } from '@primereact/ui/tag';
|
|
4223
4298
|
import * as React from 'react';
|
|
4224
4299
|
import { File } from '@primeicons/react/file';
|
|
@@ -4241,7 +4316,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
4241
4316
|
|
|
4242
4317
|
function TypeIcon({ type }: { type: string }) {
|
|
4243
4318
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
4319
|
+
|
|
4244
4320
|
if (type === 'Video') return <Video size={16} />;
|
|
4321
|
+
|
|
4245
4322
|
if (type === 'Folder') return <Folder size={16} />;
|
|
4246
4323
|
|
|
4247
4324
|
return <File size={16} />;
|
|
@@ -4288,7 +4365,7 @@ export default function ResizeExpandDemo() {
|
|
|
4288
4365
|
</DataTable.THeadRow>
|
|
4289
4366
|
</DataTable.THead>
|
|
4290
4367
|
<DataTable.TBody>
|
|
4291
|
-
{({ item }: { item:
|
|
4368
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
4292
4369
|
<DataTable.Row key={String(item.key)}>
|
|
4293
4370
|
<DataTable.Cell>
|
|
4294
4371
|
<div className="flex items-center gap-2">
|
|
@@ -4358,6 +4435,7 @@ import { Image as ImageIcon } from '@primeicons/react/image';
|
|
|
4358
4435
|
import { Video } from '@primeicons/react/video';
|
|
4359
4436
|
import type { DataTableColumnReorderEvent, DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
4360
4437
|
import { DataTable } from '@primereact/ui/datatable';
|
|
4438
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
4361
4439
|
import { Tag } from '@primereact/ui/tag';
|
|
4362
4440
|
import * as React from 'react';
|
|
4363
4441
|
|
|
@@ -4376,7 +4454,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
4376
4454
|
|
|
4377
4455
|
function TypeIcon({ type }: { type: string }) {
|
|
4378
4456
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
4457
|
+
|
|
4379
4458
|
if (type === 'Video') return <Video size={16} />;
|
|
4459
|
+
|
|
4380
4460
|
if (type === 'Folder') return <Folder size={16} />;
|
|
4381
4461
|
|
|
4382
4462
|
return <File size={16} />;
|
|
@@ -4393,7 +4473,7 @@ const initialColumns: Column[] = [
|
|
|
4393
4473
|
{ field: 'type', header: 'Type' }
|
|
4394
4474
|
];
|
|
4395
4475
|
|
|
4396
|
-
function renderCell(field: Column['field'], item:
|
|
4476
|
+
function renderCell(field: Column['field'], item: DataTableTreeRow<TreeTableNode>) {
|
|
4397
4477
|
if (field === 'name') {
|
|
4398
4478
|
return (
|
|
4399
4479
|
<div className="flex items-center gap-2">
|
|
@@ -4461,7 +4541,7 @@ export default function ReorderDemo() {
|
|
|
4461
4541
|
</DataTable.THeadRow>
|
|
4462
4542
|
</DataTable.THead>
|
|
4463
4543
|
<DataTable.TBody key={columns.map((c) => c.field).join(',')}>
|
|
4464
|
-
{({ item }: { item:
|
|
4544
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
4465
4545
|
<DataTable.Row key={String(item.key)}>
|
|
4466
4546
|
{columns.map((col) => (
|
|
4467
4547
|
<DataTable.Cell key={col.field}>{renderCell(col.field, item)}</DataTable.Cell>
|
|
@@ -4514,6 +4594,7 @@ import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
|
4514
4594
|
import { NodeService, type TreeTableNode } from '@/shared/services/node.service';
|
|
4515
4595
|
import type { DataTableExpansionEvent, DataTableRowReorderEvent } from '@primereact/ui/datatable';
|
|
4516
4596
|
import { DataTable } from '@primereact/ui/datatable';
|
|
4597
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
4517
4598
|
import { Tag } from '@primereact/ui/tag';
|
|
4518
4599
|
import * as React from 'react';
|
|
4519
4600
|
import { File } from '@primeicons/react/file';
|
|
@@ -4536,7 +4617,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
4536
4617
|
|
|
4537
4618
|
function TypeIcon({ type }: { type: string }) {
|
|
4538
4619
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
4620
|
+
|
|
4539
4621
|
if (type === 'Video') return <Video size={16} />;
|
|
4622
|
+
|
|
4540
4623
|
if (type === 'Folder') return <Folder size={16} />;
|
|
4541
4624
|
|
|
4542
4625
|
return <File size={16} />;
|
|
@@ -4556,6 +4639,7 @@ export default function RowReorderDemo() {
|
|
|
4556
4639
|
const toNode = flat[e.dropIndex];
|
|
4557
4640
|
|
|
4558
4641
|
if (!fromNode || !toNode) return;
|
|
4642
|
+
|
|
4559
4643
|
if ((fromNode._treeLevel ?? 0) !== 0 || (toNode._treeLevel ?? 0) !== 0) return;
|
|
4560
4644
|
|
|
4561
4645
|
setNodes((prev) => {
|
|
@@ -4604,7 +4688,7 @@ export default function RowReorderDemo() {
|
|
|
4604
4688
|
</DataTable.THeadRow>
|
|
4605
4689
|
</DataTable.THead>
|
|
4606
4690
|
<DataTable.TBody>
|
|
4607
|
-
{({ item, index }: { item:
|
|
4691
|
+
{({ item, index }: { item: DataTableTreeRow<TreeTableNode>; index: number }) => (
|
|
4608
4692
|
<DataTable.Row key={String(item.key)}>
|
|
4609
4693
|
<DataTable.Cell>
|
|
4610
4694
|
{Number(item._treeLevel ?? 0) === 0 ? (
|
|
@@ -4681,6 +4765,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
4681
4765
|
import { Button } from '@primereact/ui/button';
|
|
4682
4766
|
import { Checkbox } from '@primereact/ui/checkbox';
|
|
4683
4767
|
import { DataTable } from '@primereact/ui/datatable';
|
|
4768
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
4684
4769
|
import { Popover } from '@primereact/ui/popover';
|
|
4685
4770
|
import { Tag } from '@primereact/ui/tag';
|
|
4686
4771
|
import * as React from 'react';
|
|
@@ -4704,7 +4789,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
4704
4789
|
|
|
4705
4790
|
function TypeIcon({ type }: { type: string }) {
|
|
4706
4791
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
4792
|
+
|
|
4707
4793
|
if (type === 'Video') return <Video size={16} />;
|
|
4794
|
+
|
|
4708
4795
|
if (type === 'Folder') return <Folder size={16} />;
|
|
4709
4796
|
|
|
4710
4797
|
return <File size={16} />;
|
|
@@ -4726,7 +4813,7 @@ const initialColumns: ColumnDef[] = [
|
|
|
4726
4813
|
|
|
4727
4814
|
const defaultVisibleFields: ColumnDef['field'][] = ['name', 'size', 'type'];
|
|
4728
4815
|
|
|
4729
|
-
function renderCell(field: ColumnDef['field'], item:
|
|
4816
|
+
function renderCell(field: ColumnDef['field'], item: DataTableTreeRow<TreeTableNode>) {
|
|
4730
4817
|
if (field === 'name') {
|
|
4731
4818
|
return (
|
|
4732
4819
|
<div className="flex items-center gap-2">
|
|
@@ -4787,6 +4874,7 @@ function ColumnsPopover({
|
|
|
4787
4874
|
|
|
4788
4875
|
if (set.has(field)) set.delete(field);
|
|
4789
4876
|
else set.add(field);
|
|
4877
|
+
|
|
4790
4878
|
onVisibleFieldsChange(Array.from(set));
|
|
4791
4879
|
};
|
|
4792
4880
|
|
|
@@ -4895,7 +4983,7 @@ export default function ColumnToggleDemo() {
|
|
|
4895
4983
|
</DataTable.THeadRow>
|
|
4896
4984
|
</DataTable.THead>
|
|
4897
4985
|
<DataTable.TBody key={visibleFields.join(',') + '|' + columns.map((c) => c.field).join(',')}>
|
|
4898
|
-
{({ item }: { item:
|
|
4986
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
4899
4987
|
<DataTable.Row key={String(item.key)}>
|
|
4900
4988
|
{visibleColumns.map((col) => (
|
|
4901
4989
|
<DataTable.Cell key={col.field}>{renderCell(col.field, item)}</DataTable.Cell>
|
|
@@ -4942,6 +5030,7 @@ import { ChevronDown } from '@primeicons/react/chevron-down';
|
|
|
4942
5030
|
import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
4943
5031
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
4944
5032
|
import { DataTable } from '@primereact/ui/datatable';
|
|
5033
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
4945
5034
|
import { Tag } from '@primereact/ui/tag';
|
|
4946
5035
|
import * as React from 'react';
|
|
4947
5036
|
|
|
@@ -5041,7 +5130,7 @@ export default function ColumnGroupDemo() {
|
|
|
5041
5130
|
</DataTable.THeadRow>
|
|
5042
5131
|
</DataTable.THead>
|
|
5043
5132
|
<DataTable.TBody>
|
|
5044
|
-
{({ item }: { item:
|
|
5133
|
+
{({ item }: { item: DataTableTreeRow<SalesNode> }) => (
|
|
5045
5134
|
<DataTable.Row key={String(item.key)}>
|
|
5046
5135
|
<DataTable.Cell>
|
|
5047
5136
|
<div className="flex items-center gap-2">
|
|
@@ -5120,7 +5209,7 @@ import { Database } from '@primeicons/react/database';
|
|
|
5120
5209
|
import { SortAlt } from '@primeicons/react/sort-alt';
|
|
5121
5210
|
import { SortAmountDown } from '@primeicons/react/sort-amount-down';
|
|
5122
5211
|
import { SortAmountUpAlt } from '@primeicons/react/sort-amount-up-alt';
|
|
5123
|
-
import type { DataTableExpansionEvent, DataTableFilterInstance } from '@primereact/ui/datatable';
|
|
5212
|
+
import type { DataTableExpansionEvent, DataTableFilterInstance, DataTableTreeRow } from '@primereact/ui/datatable';
|
|
5124
5213
|
import { DataTable, FilterMatchMode } from '@primereact/ui/datatable';
|
|
5125
5214
|
import { InputText } from '@primereact/ui/inputtext';
|
|
5126
5215
|
import { Tag } from '@primereact/ui/tag';
|
|
@@ -5240,7 +5329,7 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
5240
5329
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
5241
5330
|
<InputText
|
|
5242
5331
|
value={(value as string) ?? ''}
|
|
5243
|
-
onChange={(e:
|
|
5332
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
5244
5333
|
placeholder="Search"
|
|
5245
5334
|
size="small"
|
|
5246
5335
|
fluid
|
|
@@ -5254,7 +5343,9 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
5254
5343
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
5255
5344
|
<InputText
|
|
5256
5345
|
value={(value as string) ?? ''}
|
|
5257
|
-
onChange={(e:
|
|
5346
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
5347
|
+
onChange(e, e.target.value ? Number(e.target.value) : null, 'gte')
|
|
5348
|
+
}
|
|
5258
5349
|
placeholder="≥"
|
|
5259
5350
|
size="small"
|
|
5260
5351
|
fluid
|
|
@@ -5267,7 +5358,7 @@ export default function ColumnGroupFilterSortDemo() {
|
|
|
5267
5358
|
</DataTable.THeadRow>
|
|
5268
5359
|
</DataTable.THead>
|
|
5269
5360
|
<DataTable.TBody>
|
|
5270
|
-
{({ item }: { item:
|
|
5361
|
+
{({ item }: { item: DataTableTreeRow<SalesNode> }) => (
|
|
5271
5362
|
<DataTable.Row key={String(item.key)}>
|
|
5272
5363
|
<DataTable.Cell>
|
|
5273
5364
|
<div className="flex items-center gap-2">
|
|
@@ -5344,6 +5435,7 @@ import { FilterMatchMode } from '@primereact/ui/datatable';
|
|
|
5344
5435
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
5345
5436
|
import type { DataTableFilterInstance } from '@primereact/ui/datatable';
|
|
5346
5437
|
import { DataTable } from '@primereact/ui/datatable';
|
|
5438
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
5347
5439
|
import { IconField } from '@primereact/ui/iconfield';
|
|
5348
5440
|
import { InputText } from '@primereact/ui/inputtext';
|
|
5349
5441
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
@@ -5365,7 +5457,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
5365
5457
|
|
|
5366
5458
|
function TypeIcon({ type }: { type: string }) {
|
|
5367
5459
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
5460
|
+
|
|
5368
5461
|
if (type === 'Video') return <Video size={16} />;
|
|
5462
|
+
|
|
5369
5463
|
if (type === 'Folder') return <Folder size={16} />;
|
|
5370
5464
|
|
|
5371
5465
|
return <File size={16} />;
|
|
@@ -5404,7 +5498,7 @@ export default function FilterBasicDemo() {
|
|
|
5404
5498
|
type="search"
|
|
5405
5499
|
placeholder="Keyword search"
|
|
5406
5500
|
value={globalFilter}
|
|
5407
|
-
onChange={(e:
|
|
5501
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
5408
5502
|
className="w-full"
|
|
5409
5503
|
/>
|
|
5410
5504
|
</IconField.Root>
|
|
@@ -5440,7 +5534,7 @@ export default function FilterBasicDemo() {
|
|
|
5440
5534
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
5441
5535
|
<InputText
|
|
5442
5536
|
value={(value as string) ?? ''}
|
|
5443
|
-
onChange={(e:
|
|
5537
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
5444
5538
|
placeholder="Search name..."
|
|
5445
5539
|
size="small"
|
|
5446
5540
|
fluid
|
|
@@ -5481,7 +5575,7 @@ export default function FilterBasicDemo() {
|
|
|
5481
5575
|
</DataTable.THeadRow>
|
|
5482
5576
|
</DataTable.THead>
|
|
5483
5577
|
<DataTable.TBody>
|
|
5484
|
-
{({ item }: { item:
|
|
5578
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
5485
5579
|
<DataTable.Row key={String(item.key)}>
|
|
5486
5580
|
<DataTable.Cell>
|
|
5487
5581
|
<div className="flex items-center gap-2">
|
|
@@ -5556,6 +5650,7 @@ import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
|
5556
5650
|
import type { DataTableFilterInstance } from '@primereact/ui/datatable';
|
|
5557
5651
|
import { Button } from '@primereact/ui/button';
|
|
5558
5652
|
import { DataTable } from '@primereact/ui/datatable';
|
|
5653
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
5559
5654
|
import { IconField } from '@primereact/ui/iconfield';
|
|
5560
5655
|
import { InputText } from '@primereact/ui/inputtext';
|
|
5561
5656
|
import { Popover, type PopoverRootOpenChangeEvent } from '@primereact/ui/popover';
|
|
@@ -5578,7 +5673,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
5578
5673
|
|
|
5579
5674
|
function TypeIcon({ type }: { type: string }) {
|
|
5580
5675
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
5676
|
+
|
|
5581
5677
|
if (type === 'Video') return <Video size={16} />;
|
|
5678
|
+
|
|
5582
5679
|
if (type === 'Folder') return <Folder size={16} />;
|
|
5583
5680
|
|
|
5584
5681
|
return <File size={16} />;
|
|
@@ -5717,7 +5814,7 @@ export default function FilterAdvancedDemo() {
|
|
|
5717
5814
|
type="search"
|
|
5718
5815
|
placeholder="Keyword search"
|
|
5719
5816
|
value={globalFilter}
|
|
5720
|
-
onChange={(e:
|
|
5817
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
5721
5818
|
className="w-full"
|
|
5722
5819
|
/>
|
|
5723
5820
|
</IconField.Root>
|
|
@@ -5811,7 +5908,9 @@ export default function FilterAdvancedDemo() {
|
|
|
5811
5908
|
</div>
|
|
5812
5909
|
<InputText
|
|
5813
5910
|
value={(constraint.value as string) ?? ''}
|
|
5814
|
-
onChange={(e:
|
|
5911
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
5912
|
+
onConstraintChange(e, idx, e.target.value)
|
|
5913
|
+
}
|
|
5815
5914
|
placeholder="Search by name..."
|
|
5816
5915
|
size="small"
|
|
5817
5916
|
fluid
|
|
@@ -5897,7 +5996,7 @@ export default function FilterAdvancedDemo() {
|
|
|
5897
5996
|
</DataTable.THeadRow>
|
|
5898
5997
|
</DataTable.THead>
|
|
5899
5998
|
<DataTable.TBody>
|
|
5900
|
-
{({ item }: { item:
|
|
5999
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
5901
6000
|
<DataTable.Row key={String(item.key)}>
|
|
5902
6001
|
<DataTable.Cell>
|
|
5903
6002
|
<div className="flex items-center gap-2">
|
|
@@ -5962,6 +6061,7 @@ import { NodeService, type TreeTableNode } from '@/shared/services/node.service'
|
|
|
5962
6061
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
5963
6062
|
import { Button } from '@primereact/ui/button';
|
|
5964
6063
|
import { DataTable } from '@primereact/ui/datatable';
|
|
6064
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
5965
6065
|
import { Tag } from '@primereact/ui/tag';
|
|
5966
6066
|
import * as React from 'react';
|
|
5967
6067
|
import { File } from '@primeicons/react/file';
|
|
@@ -5984,7 +6084,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
5984
6084
|
|
|
5985
6085
|
function TypeIcon({ type }: { type: string }) {
|
|
5986
6086
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
6087
|
+
|
|
5987
6088
|
if (type === 'Video') return <Video size={16} />;
|
|
6089
|
+
|
|
5988
6090
|
if (type === 'Folder') return <Folder size={16} />;
|
|
5989
6091
|
|
|
5990
6092
|
return <File size={16} />;
|
|
@@ -6030,7 +6132,7 @@ export default function ExportDemo() {
|
|
|
6030
6132
|
</DataTable.THeadRow>
|
|
6031
6133
|
</DataTable.THead>
|
|
6032
6134
|
<DataTable.TBody>
|
|
6033
|
-
{({ item }: { item:
|
|
6135
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
6034
6136
|
<DataTable.Row key={String(item.key)}>
|
|
6035
6137
|
<DataTable.Cell>
|
|
6036
6138
|
<div className="flex items-center gap-2">
|
|
@@ -6092,6 +6194,7 @@ import { Database } from '@primeicons/react/database';
|
|
|
6092
6194
|
import { ChevronRight } from '@primeicons/react/chevron-right';
|
|
6093
6195
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
6094
6196
|
import { DataTable } from '@primereact/ui/datatable';
|
|
6197
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
6095
6198
|
import { Skeleton } from '@primereact/ui/skeleton';
|
|
6096
6199
|
import * as React from 'react';
|
|
6097
6200
|
|
|
@@ -6209,7 +6312,7 @@ export default function LazyDemo() {
|
|
|
6209
6312
|
</DataTable.THeadRow>
|
|
6210
6313
|
</DataTable.THead>
|
|
6211
6314
|
<DataTable.TBody>
|
|
6212
|
-
{({ item }: { item:
|
|
6315
|
+
{({ item }: { item: DataTableTreeRow<LazyNode> }) => {
|
|
6213
6316
|
const isLoading = loadingKeys[item.key] && expandedKeys[item.key];
|
|
6214
6317
|
|
|
6215
6318
|
return (
|
|
@@ -6276,6 +6379,7 @@ import { NodeService, type TreeTableNode } from '@/shared/services/node.service'
|
|
|
6276
6379
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
6277
6380
|
import { Button } from '@primereact/ui/button';
|
|
6278
6381
|
import { DataTable } from '@primereact/ui/datatable';
|
|
6382
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
6279
6383
|
import { Tag } from '@primereact/ui/tag';
|
|
6280
6384
|
import * as React from 'react';
|
|
6281
6385
|
import { File } from '@primeicons/react/file';
|
|
@@ -6298,7 +6402,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
6298
6402
|
|
|
6299
6403
|
function TypeIcon({ type }: { type: string }) {
|
|
6300
6404
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
6405
|
+
|
|
6301
6406
|
if (type === 'Video') return <Video size={16} />;
|
|
6407
|
+
|
|
6302
6408
|
if (type === 'Folder') return <Folder size={16} />;
|
|
6303
6409
|
|
|
6304
6410
|
return <File size={16} />;
|
|
@@ -6355,7 +6461,7 @@ export default function LoadingOverlayDemo() {
|
|
|
6355
6461
|
</DataTable.THeadRow>
|
|
6356
6462
|
</DataTable.THead>
|
|
6357
6463
|
<DataTable.TBody>
|
|
6358
|
-
{({ item }: { item:
|
|
6464
|
+
{({ item }: { item: DataTableTreeRow<TreeTableNode> }) => (
|
|
6359
6465
|
<DataTable.Row key={String(item.key)}>
|
|
6360
6466
|
<DataTable.Cell>
|
|
6361
6467
|
<div className="flex items-center gap-2">
|
|
@@ -6425,7 +6531,7 @@ export default function LoadingSkeletonDemo() {
|
|
|
6425
6531
|
</DataTable.THeadRow>
|
|
6426
6532
|
</DataTable.THead>
|
|
6427
6533
|
<DataTable.TBody>
|
|
6428
|
-
{({ item }: { item:
|
|
6534
|
+
{({ item }: { item: (typeof placeholders)[number] }) => (
|
|
6429
6535
|
<DataTable.Row key={String(item.key)}>
|
|
6430
6536
|
<DataTable.Cell>
|
|
6431
6537
|
<Skeleton className="h-5 w-3/4" />
|
|
@@ -6478,7 +6584,7 @@ export default function EmptyDemo() {
|
|
|
6478
6584
|
</DataTable.THeadRow>
|
|
6479
6585
|
</DataTable.THead>
|
|
6480
6586
|
<DataTable.TBody>
|
|
6481
|
-
{({ item }: { item:
|
|
6587
|
+
{({ item }: { item: Record<string, unknown> }) => (
|
|
6482
6588
|
<DataTable.Row key={String(item.key)}>
|
|
6483
6589
|
<DataTable.Cell>{String(item.name)}</DataTable.Cell>
|
|
6484
6590
|
<DataTable.Cell>{String(item.size)}</DataTable.Cell>
|
|
@@ -6537,6 +6643,7 @@ import { FilterMatchMode } from '@primereact/ui/datatable';
|
|
|
6537
6643
|
import type { DataTableExpansionEvent } from '@primereact/ui/datatable';
|
|
6538
6644
|
import type { DataTableFilterInstance } from '@primereact/ui/datatable';
|
|
6539
6645
|
import { DataTable } from '@primereact/ui/datatable';
|
|
6646
|
+
import type { DataTableTreeRow } from '@primereact/ui/datatable';
|
|
6540
6647
|
import { IconField } from '@primereact/ui/iconfield';
|
|
6541
6648
|
import { InputText } from '@primereact/ui/inputtext';
|
|
6542
6649
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
@@ -6558,7 +6665,9 @@ const typeSeverity: Record<string, 'info' | 'warn' | 'success' | 'secondary'> =
|
|
|
6558
6665
|
|
|
6559
6666
|
function TypeIcon({ type }: { type: string }) {
|
|
6560
6667
|
if (type === 'Picture') return <ImageIcon size={16} />;
|
|
6668
|
+
|
|
6561
6669
|
if (type === 'Video') return <Video size={16} />;
|
|
6670
|
+
|
|
6562
6671
|
if (type === 'Folder') return <Folder size={16} />;
|
|
6563
6672
|
|
|
6564
6673
|
return <File size={16} />;
|
|
@@ -6639,7 +6748,7 @@ export default function AdvancedDemo() {
|
|
|
6639
6748
|
type="search"
|
|
6640
6749
|
placeholder="Keyword search"
|
|
6641
6750
|
value={globalFilter}
|
|
6642
|
-
onChange={(e:
|
|
6751
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setGlobalFilter(e.target.value)}
|
|
6643
6752
|
className="w-full"
|
|
6644
6753
|
/>
|
|
6645
6754
|
</IconField.Root>
|
|
@@ -6684,7 +6793,7 @@ export default function AdvancedDemo() {
|
|
|
6684
6793
|
{({ value, onChange }: DataTableFilterInstance) => (
|
|
6685
6794
|
<InputText
|
|
6686
6795
|
value={(value as string) ?? ''}
|
|
6687
|
-
onChange={(e:
|
|
6796
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e, e.target.value)}
|
|
6688
6797
|
placeholder="Search"
|
|
6689
6798
|
size="small"
|
|
6690
6799
|
fluid
|
|
@@ -6725,7 +6834,7 @@ export default function AdvancedDemo() {
|
|
|
6725
6834
|
</DataTable.THeadRow>
|
|
6726
6835
|
</DataTable.THead>
|
|
6727
6836
|
<DataTable.TBody>
|
|
6728
|
-
{({ item, index }: { item:
|
|
6837
|
+
{({ item, index }: { item: DataTableTreeRow<TreeTableNode>; index: number }) => (
|
|
6729
6838
|
<DataTable.Row key={String(item.key)}>
|
|
6730
6839
|
<DataTable.Cell>
|
|
6731
6840
|
<div className="flex items-center gap-2">
|
|
@@ -6745,7 +6854,7 @@ export default function AdvancedDemo() {
|
|
|
6745
6854
|
<DataTable.CellEditorContent>
|
|
6746
6855
|
<InputText
|
|
6747
6856
|
defaultValue={String(item.name)}
|
|
6748
|
-
onChange={(e:
|
|
6857
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
6749
6858
|
pendingValueRef.current[`${item.key}-name`] = e.target.value;
|
|
6750
6859
|
}}
|
|
6751
6860
|
size="small"
|
|
@@ -6763,7 +6872,7 @@ export default function AdvancedDemo() {
|
|
|
6763
6872
|
<DataTable.CellEditorContent>
|
|
6764
6873
|
<InputText
|
|
6765
6874
|
defaultValue={String(item.size)}
|
|
6766
|
-
onChange={(e:
|
|
6875
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
6767
6876
|
pendingValueRef.current[`${item.key}-size`] = e.target.value;
|
|
6768
6877
|
}}
|
|
6769
6878
|
size="small"
|