Skip to content

Commit 262bdf3

Browse files
authored
Fix primefaces#7504: TreeTable update docs example data (primefaces#7572)
1 parent 1f0e936 commit 262bdf3

21 files changed

+987
-252
lines changed

components/doc/treetable/basicdoc.js

+47-12
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,61 @@ export default function BasicDemo() {
7272
data: `
7373
{
7474
key: '0',
75-
label: 'Documents',
76-
data: 'Documents Folder',
77-
icon: 'pi pi-fw pi-inbox',
75+
data: {
76+
name: 'Applications',
77+
size: '100kb',
78+
type: 'Folder'
79+
},
7880
children: [
7981
{
8082
key: '0-0',
81-
label: 'Work',
82-
data: 'Work Folder',
83-
icon: 'pi pi-fw pi-cog',
83+
data: {
84+
name: 'React',
85+
size: '25kb',
86+
type: 'Folder'
87+
},
8488
children: [
85-
{ key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' },
86-
{ key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }
89+
{
90+
key: '0-0-0',
91+
data: {
92+
name: 'react.app',
93+
size: '10kb',
94+
type: 'Application'
95+
}
96+
},
97+
{
98+
key: '0-0-1',
99+
data: {
100+
name: 'native.app',
101+
size: '10kb',
102+
type: 'Application'
103+
}
104+
},
105+
{
106+
key: '0-0-2',
107+
data: {
108+
name: 'mobile.app',
109+
size: '5kb',
110+
type: 'Application'
111+
}
112+
}
87113
]
88114
},
89115
{
90116
key: '0-1',
91-
label: 'Home',
92-
data: 'Home Folder',
93-
icon: 'pi pi-fw pi-home',
94-
children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }]
117+
data: {
118+
name: 'editor.app',
119+
size: '25kb',
120+
type: 'Application'
121+
}
122+
},
123+
{
124+
key: '0-2',
125+
data: {
126+
name: 'settings.app',
127+
size: '50kb',
128+
type: 'Application'
129+
}
95130
}
96131
]
97132
},

components/doc/treetable/columntoggledoc.js

+47-12
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,61 @@ export default function ColumnToggleDemo() {
125125
data: `
126126
{
127127
key: '0',
128-
label: 'Documents',
129-
data: 'Documents Folder',
130-
icon: 'pi pi-fw pi-inbox',
128+
data: {
129+
name: 'Applications',
130+
size: '100kb',
131+
type: 'Folder'
132+
},
131133
children: [
132134
{
133135
key: '0-0',
134-
label: 'Work',
135-
data: 'Work Folder',
136-
icon: 'pi pi-fw pi-cog',
136+
data: {
137+
name: 'React',
138+
size: '25kb',
139+
type: 'Folder'
140+
},
137141
children: [
138-
{ key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' },
139-
{ key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }
142+
{
143+
key: '0-0-0',
144+
data: {
145+
name: 'react.app',
146+
size: '10kb',
147+
type: 'Application'
148+
}
149+
},
150+
{
151+
key: '0-0-1',
152+
data: {
153+
name: 'native.app',
154+
size: '10kb',
155+
type: 'Application'
156+
}
157+
},
158+
{
159+
key: '0-0-2',
160+
data: {
161+
name: 'mobile.app',
162+
size: '5kb',
163+
type: 'Application'
164+
}
165+
}
140166
]
141167
},
142168
{
143169
key: '0-1',
144-
label: 'Home',
145-
data: 'Home Folder',
146-
icon: 'pi pi-fw pi-home',
147-
children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }]
170+
data: {
171+
name: 'editor.app',
172+
size: '25kb',
173+
type: 'Application'
174+
}
175+
},
176+
{
177+
key: '0-2',
178+
data: {
179+
name: 'settings.app',
180+
size: '50kb',
181+
type: 'Application'
182+
}
148183
}
149184
]
150185
},

components/doc/treetable/conditionalstyledoc.js

+47-12
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,61 @@ export default function ConditionalStyleDemo() {
105105
data: `
106106
{
107107
key: '0',
108-
label: 'Documents',
109-
data: 'Documents Folder',
110-
icon: 'pi pi-fw pi-inbox',
108+
data: {
109+
name: 'Applications',
110+
size: '100kb',
111+
type: 'Folder'
112+
},
111113
children: [
112114
{
113115
key: '0-0',
114-
label: 'Work',
115-
data: 'Work Folder',
116-
icon: 'pi pi-fw pi-cog',
116+
data: {
117+
name: 'React',
118+
size: '25kb',
119+
type: 'Folder'
120+
},
117121
children: [
118-
{ key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' },
119-
{ key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }
122+
{
123+
key: '0-0-0',
124+
data: {
125+
name: 'react.app',
126+
size: '10kb',
127+
type: 'Application'
128+
}
129+
},
130+
{
131+
key: '0-0-1',
132+
data: {
133+
name: 'native.app',
134+
size: '10kb',
135+
type: 'Application'
136+
}
137+
},
138+
{
139+
key: '0-0-2',
140+
data: {
141+
name: 'mobile.app',
142+
size: '5kb',
143+
type: 'Application'
144+
}
145+
}
120146
]
121147
},
122148
{
123149
key: '0-1',
124-
label: 'Home',
125-
data: 'Home Folder',
126-
icon: 'pi pi-fw pi-home',
127-
children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }]
150+
data: {
151+
name: 'editor.app',
152+
size: '25kb',
153+
type: 'Application'
154+
}
155+
},
156+
{
157+
key: '0-2',
158+
data: {
159+
name: 'settings.app',
160+
size: '50kb',
161+
type: 'Application'
162+
}
128163
}
129164
]
130165
},

components/doc/treetable/controlleddoc.js

+47-12
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,61 @@ export default function ControlledDemo() {
111111
data: `
112112
{
113113
key: '0',
114-
label: 'Documents',
115-
data: 'Documents Folder',
116-
icon: 'pi pi-fw pi-inbox',
114+
data: {
115+
name: 'Applications',
116+
size: '100kb',
117+
type: 'Folder'
118+
},
117119
children: [
118120
{
119121
key: '0-0',
120-
label: 'Work',
121-
data: 'Work Folder',
122-
icon: 'pi pi-fw pi-cog',
122+
data: {
123+
name: 'React',
124+
size: '25kb',
125+
type: 'Folder'
126+
},
123127
children: [
124-
{ key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' },
125-
{ key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }
128+
{
129+
key: '0-0-0',
130+
data: {
131+
name: 'react.app',
132+
size: '10kb',
133+
type: 'Application'
134+
}
135+
},
136+
{
137+
key: '0-0-1',
138+
data: {
139+
name: 'native.app',
140+
size: '10kb',
141+
type: 'Application'
142+
}
143+
},
144+
{
145+
key: '0-0-2',
146+
data: {
147+
name: 'mobile.app',
148+
size: '5kb',
149+
type: 'Application'
150+
}
151+
}
126152
]
127153
},
128154
{
129155
key: '0-1',
130-
label: 'Home',
131-
data: 'Home Folder',
132-
icon: 'pi pi-fw pi-home',
133-
children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }]
156+
data: {
157+
name: 'editor.app',
158+
size: '25kb',
159+
type: 'Application'
160+
}
161+
},
162+
{
163+
key: '0-2',
164+
data: {
165+
name: 'settings.app',
166+
size: '50kb',
167+
type: 'Application'
168+
}
134169
}
135170
]
136171
},

components/doc/treetable/dynamiccolumnsdoc.js

+47-12
Original file line numberDiff line numberDiff line change
@@ -92,26 +92,61 @@ export default function DynamicColumnsDemo() {
9292
data: `
9393
{
9494
key: '0',
95-
label: 'Documents',
96-
data: 'Documents Folder',
97-
icon: 'pi pi-fw pi-inbox',
95+
data: {
96+
name: 'Applications',
97+
size: '100kb',
98+
type: 'Folder'
99+
},
98100
children: [
99101
{
100102
key: '0-0',
101-
label: 'Work',
102-
data: 'Work Folder',
103-
icon: 'pi pi-fw pi-cog',
103+
data: {
104+
name: 'React',
105+
size: '25kb',
106+
type: 'Folder'
107+
},
104108
children: [
105-
{ key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' },
106-
{ key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }
109+
{
110+
key: '0-0-0',
111+
data: {
112+
name: 'react.app',
113+
size: '10kb',
114+
type: 'Application'
115+
}
116+
},
117+
{
118+
key: '0-0-1',
119+
data: {
120+
name: 'native.app',
121+
size: '10kb',
122+
type: 'Application'
123+
}
124+
},
125+
{
126+
key: '0-0-2',
127+
data: {
128+
name: 'mobile.app',
129+
size: '5kb',
130+
type: 'Application'
131+
}
132+
}
107133
]
108134
},
109135
{
110136
key: '0-1',
111-
label: 'Home',
112-
data: 'Home Folder',
113-
icon: 'pi pi-fw pi-home',
114-
children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }]
137+
data: {
138+
name: 'editor.app',
139+
size: '25kb',
140+
type: 'Application'
141+
}
142+
},
143+
{
144+
key: '0-2',
145+
data: {
146+
name: 'settings.app',
147+
size: '50kb',
148+
type: 'Application'
149+
}
115150
}
116151
]
117152
},

0 commit comments

Comments
 (0)