@sebgroup/green-core 2.35.1 → 2.36.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/components/button/button.trans.styles.scss.js +1 -1
- package/components/calendar/calendar.trans.styles.scss.js +1 -1
- package/components/context-menu/context-menu.trans.styles.scss.js +1 -1
- package/components/datepicker/datepicker.trans.styles.scss.js +1 -1
- package/components/dialog/dialog.component.d.ts +22 -2
- package/components/dialog/dialog.component.js +104 -23
- package/components/formatted-text/date/date-time-formatter.js +1 -3
- package/components/grouped-list/grouped-list.trans.styles.scss.js +1 -1
- package/components/pagination/pagination.component.js +11 -8
- package/components/popover/popover.trans.styles.scss.js +1 -1
- package/components/segmented-control/segment/segment.trans.styles.scss.js +1 -1
- package/components/segmented-control/segmented-control.trans.styles.css.js +1 -1
- package/components/table/table.component.d.ts +16 -1
- package/components/table/table.component.js +116 -190
- package/components/table/table.stories.data.d.ts +25 -47
- package/components/table/table.stories.data.js +261 -288
- package/components/table/table.styles.js +15 -2
- package/components/table/table.types.d.ts +16 -81
- package/components/table/table.types.js +40 -10
- package/components/theme/chlorophyll-tokens.scss.js +1 -1
- package/custom-elements.json +20809 -20571
- package/gds-element.js +1 -1
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/dialog/api.md +8 -4
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/table/api.md +2 -1
- package/generated/react/dialog/index.d.ts +2 -1
- package/generated/react/index.d.ts +1 -1
- package/generated/react/index.js +1 -1
- package/generated/react/table/index.d.ts +2 -1
- package/package.json +1 -1
- package/primitives/field-base/field-base.trans.styles.scss.js +1 -1
- package/primitives/listbox/listbox.trans.styles.scss.js +1 -1
- package/primitives/listbox/option.trans.styles.scss.js +1 -1
- package/primitives/menu/menu-heading.trans.styles.scss.js +1 -1
- package/utils/helpers/custom-element-scoping.js +1 -1
- package/utils/helpers/id.d.ts +0 -3
- package/utils/helpers/id.js +6 -1
|
@@ -1,67 +1,69 @@
|
|
|
1
1
|
import "../../chunks/chunk.QU3DSPNU.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import { html } from "lit";
|
|
3
|
+
import { Slot } from "./table.types.js";
|
|
4
|
+
const USERS_URL = "https://api.seb.io/components/table/table.users.json";
|
|
5
|
+
const FEEDBACK_URL = "https://api.seb.io/components/table/table.feedback.json";
|
|
6
|
+
let usersCache = null;
|
|
7
|
+
let usersPromise = null;
|
|
8
|
+
let feedbackCache = null;
|
|
9
|
+
let feedbackPromise = null;
|
|
10
|
+
const defineSlots = (row) => ({
|
|
11
|
+
...row,
|
|
12
|
+
name: Slot(row.name, ["avatar", "value"]),
|
|
13
|
+
// name: Slot(row.name, ['avatar', 'value'], row.email),
|
|
14
|
+
email: Slot(row.email, ["value", "copy-button"]),
|
|
15
|
+
status: Slot(row.status, ["status"]),
|
|
16
|
+
amount: Slot(row.amount, ["amount", "currency"]),
|
|
17
|
+
account: Slot(row.account, ["main"]),
|
|
18
|
+
login: Slot(row.lastLogin, ["main"]),
|
|
19
|
+
download: Slot(row.download ?? "#", ["main"])
|
|
20
|
+
});
|
|
21
|
+
let usersRawCache = null;
|
|
22
|
+
let usersRawPromise = null;
|
|
23
|
+
const loadUsersRaw = async () => {
|
|
24
|
+
if (usersRawCache) return usersRawCache;
|
|
25
|
+
if (usersRawPromise) return usersRawPromise;
|
|
26
|
+
usersRawPromise = fetch(USERS_URL).then((response) => response.json()).then((data) => {
|
|
27
|
+
usersRawCache = data;
|
|
28
|
+
return data;
|
|
29
|
+
});
|
|
30
|
+
return usersRawPromise;
|
|
16
31
|
};
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
role: USERS.ROLES[index % USERS.ROLES.length],
|
|
26
|
-
status: USERS.STATUSES[index % USERS.STATUSES.length],
|
|
27
|
-
department: USERS.DEPARTMENTS[index % USERS.DEPARTMENTS.length],
|
|
28
|
-
amount: Math.floor(Math.random() * 5e5) + 1e4,
|
|
29
|
-
account: `5440${String(index * 7919 % 1e7).padStart(7, "0")}`,
|
|
30
|
-
lastLogin: new Date(
|
|
31
|
-
Date.now() - Math.random() * 30 * 864e5
|
|
32
|
-
).toISOString(),
|
|
33
|
-
avatarUrl: `https://api.dicebear.com/7.x/avataaars/svg?seed=${firstName}${lastName}`,
|
|
34
|
-
download: `#`
|
|
35
|
-
};
|
|
32
|
+
const loadUsers = async () => {
|
|
33
|
+
if (usersCache) return usersCache;
|
|
34
|
+
if (usersPromise) return usersPromise;
|
|
35
|
+
usersPromise = loadUsersRaw().then((data) => data.map(defineSlots)).then((data) => {
|
|
36
|
+
usersCache = data;
|
|
37
|
+
return data;
|
|
38
|
+
});
|
|
39
|
+
return usersPromise;
|
|
36
40
|
};
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
40
|
-
const allData = generateUserDataset();
|
|
41
|
-
let processedData = [...allData];
|
|
41
|
+
const createDataProvider = (loader) => async (request) => {
|
|
42
|
+
let data = await loader();
|
|
42
43
|
if (request.searchQuery) {
|
|
43
44
|
const query = request.searchQuery.toLowerCase();
|
|
44
|
-
|
|
45
|
+
data = data.filter(
|
|
45
46
|
(item) => Object.values(item).some(
|
|
46
|
-
(value) =>
|
|
47
|
+
(value) => value?.toString().toLowerCase().includes(query)
|
|
47
48
|
)
|
|
48
49
|
);
|
|
49
50
|
}
|
|
50
|
-
if (request.sortColumn) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
51
|
+
if (request.sortColumn && data.length > 0) {
|
|
52
|
+
const key = request.sortColumn;
|
|
53
|
+
data = [...data].sort((a, b) => {
|
|
54
|
+
const aVal = a[key]?.toString() ?? "";
|
|
55
|
+
const bVal = b[key]?.toString() ?? "";
|
|
56
|
+
return request.sortDirection === "asc" ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);
|
|
55
57
|
});
|
|
56
58
|
}
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const paginatedData = processedData.slice(startIndex, endIndex);
|
|
59
|
+
const start = (request.page - 1) * request.rows;
|
|
60
|
+
const end = start + request.rows;
|
|
60
61
|
return {
|
|
61
|
-
rows:
|
|
62
|
-
total:
|
|
62
|
+
rows: data.slice(start, end),
|
|
63
|
+
total: data.length
|
|
63
64
|
};
|
|
64
65
|
};
|
|
66
|
+
const userDataProvider = createDataProvider(loadUsers);
|
|
65
67
|
const Users = {
|
|
66
68
|
Columns: [
|
|
67
69
|
{
|
|
@@ -72,223 +74,156 @@ const Users = {
|
|
|
72
74
|
{
|
|
73
75
|
key: "name",
|
|
74
76
|
label: "Name",
|
|
75
|
-
sortable: true
|
|
76
|
-
cell: {
|
|
77
|
-
lead: {
|
|
78
|
-
type: "image",
|
|
79
|
-
src: (row) => row.avatarUrl,
|
|
80
|
-
alt: (row) => row.name,
|
|
81
|
-
width: "xl",
|
|
82
|
-
height: "xl"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
77
|
+
sortable: true
|
|
85
78
|
},
|
|
86
79
|
{
|
|
87
80
|
key: "email",
|
|
88
81
|
label: "Email",
|
|
89
82
|
sortable: true,
|
|
90
|
-
justify: "space-between"
|
|
91
|
-
cell: {
|
|
92
|
-
trail: {
|
|
93
|
-
type: "button",
|
|
94
|
-
rank: "tertiary",
|
|
95
|
-
value: (row) => row.email,
|
|
96
|
-
/* size: 'xs', */
|
|
97
|
-
template: "email-copy"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
83
|
+
justify: "space-between"
|
|
100
84
|
},
|
|
101
85
|
{
|
|
102
86
|
key: "role",
|
|
103
87
|
label: "Role",
|
|
104
88
|
sortable: true,
|
|
105
|
-
visible: false
|
|
106
|
-
value: (row) => `${row.role.toUpperCase()} (${row.department || "N/A"})`
|
|
89
|
+
visible: false
|
|
107
90
|
},
|
|
108
91
|
{
|
|
109
92
|
key: "status",
|
|
110
93
|
label: "Status",
|
|
111
|
-
sortable: true
|
|
112
|
-
justify: "end",
|
|
113
|
-
cell: {
|
|
114
|
-
value: {
|
|
115
|
-
type: "badge",
|
|
116
|
-
value: (row) => row.status,
|
|
117
|
-
variant: (row) => row.status === "Active" ? "positive" : "negative"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
94
|
+
sortable: true
|
|
120
95
|
},
|
|
121
96
|
{
|
|
122
97
|
key: "department",
|
|
123
98
|
label: "Department",
|
|
124
|
-
sortable: true
|
|
125
|
-
cell: {
|
|
126
|
-
lead: {
|
|
127
|
-
type: "icon",
|
|
128
|
-
template: "department-icon"
|
|
129
|
-
}
|
|
130
|
-
}
|
|
99
|
+
sortable: true
|
|
131
100
|
},
|
|
132
101
|
{
|
|
133
102
|
key: "amount",
|
|
134
103
|
label: "Amount",
|
|
135
104
|
sortable: true,
|
|
136
|
-
justify: "end"
|
|
137
|
-
cell: {
|
|
138
|
-
value: {
|
|
139
|
-
type: "formatted-number",
|
|
140
|
-
value: (row) => row.amount
|
|
141
|
-
},
|
|
142
|
-
trail: {
|
|
143
|
-
type: "badge",
|
|
144
|
-
value: "SEK"
|
|
145
|
-
}
|
|
146
|
-
}
|
|
105
|
+
justify: "end"
|
|
147
106
|
},
|
|
148
107
|
{
|
|
149
108
|
key: "account",
|
|
150
109
|
label: "Account",
|
|
151
|
-
sortable: true
|
|
152
|
-
cell: {
|
|
153
|
-
value: {
|
|
154
|
-
type: "formatted-account",
|
|
155
|
-
value: (row) => row.account,
|
|
156
|
-
format: "seb-account"
|
|
157
|
-
}
|
|
158
|
-
}
|
|
110
|
+
sortable: true
|
|
159
111
|
},
|
|
160
112
|
{
|
|
161
|
-
key: "
|
|
113
|
+
key: "login",
|
|
162
114
|
label: "Last Login",
|
|
163
|
-
sortable: true
|
|
164
|
-
cell: {
|
|
165
|
-
value: {
|
|
166
|
-
type: "formatted-date",
|
|
167
|
-
value: (row) => row.lastLogin,
|
|
168
|
-
locale: "sv-SE",
|
|
169
|
-
format: "dateLong"
|
|
170
|
-
}
|
|
171
|
-
}
|
|
115
|
+
sortable: true
|
|
172
116
|
},
|
|
173
117
|
{
|
|
174
118
|
key: "download",
|
|
175
|
-
label: "Download"
|
|
176
|
-
cell: {
|
|
177
|
-
value: {
|
|
178
|
-
type: "link",
|
|
179
|
-
href: (row) => row.download,
|
|
180
|
-
download: true,
|
|
181
|
-
template: "download-image",
|
|
182
|
-
label: "Download file"
|
|
183
|
-
}
|
|
184
|
-
}
|
|
119
|
+
label: "Download"
|
|
185
120
|
}
|
|
186
121
|
],
|
|
187
122
|
Actions: {
|
|
188
123
|
label: "Actions",
|
|
189
|
-
justify: "end"
|
|
190
|
-
cell: {
|
|
191
|
-
type: "context-menu",
|
|
192
|
-
items: [
|
|
193
|
-
{
|
|
194
|
-
label: (row) => row.status === "Active" ? "Deactivate" : "Activate"
|
|
195
|
-
/* onClick: (row: UserData) => console.log('Toggle status', row), */
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
label: "View Details"
|
|
199
|
-
/* onClick: (row: UserData) => console.log('View user', row), */
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
label: "Edit Profile"
|
|
203
|
-
/* onClick: (row: UserData) => console.log('Edit user', row), */
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
divider: true,
|
|
207
|
-
label: "Delete User"
|
|
208
|
-
/* onClick: (row: UserData) => {
|
|
209
|
-
if (confirm(`Delete ${row.name}?`)) {
|
|
210
|
-
console.log('Delete user', row)
|
|
211
|
-
}
|
|
212
|
-
}, */
|
|
213
|
-
}
|
|
214
|
-
]
|
|
215
|
-
}
|
|
124
|
+
justify: "end"
|
|
216
125
|
},
|
|
217
|
-
Data: userDataProvider
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
126
|
+
Data: userDataProvider,
|
|
127
|
+
/**
|
|
128
|
+
* Generates slot content for the given rows (current page).
|
|
129
|
+
* Creates per-row slot elements using `columnKey:rowKey:slotId` convention.
|
|
130
|
+
*
|
|
131
|
+
* Used with Lit's `render()` to update table light DOM on each data load:
|
|
132
|
+
* ```ts
|
|
133
|
+
* @gds-table-data-loaded=${(e) => render(Users.SlotContent(e.detail.rows), table)}
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
SlotContent: (rows) => {
|
|
137
|
+
return html`
|
|
138
|
+
${rows.map(
|
|
139
|
+
(row) => html`
|
|
140
|
+
<!-- name: avatar -->
|
|
141
|
+
<gds-img
|
|
142
|
+
src="${row.avatarUrl ?? "#"}"
|
|
143
|
+
alt="${String(row.name)}"
|
|
144
|
+
slot="name:${row.id}:avatar"
|
|
145
|
+
width="xl"
|
|
146
|
+
height="xl"
|
|
147
|
+
></gds-img>
|
|
148
|
+
|
|
149
|
+
<!-- email: copy button -->
|
|
150
|
+
<gds-button
|
|
151
|
+
slot="email:${row.id}:copy-button"
|
|
152
|
+
rank="tertiary"
|
|
153
|
+
size="small"
|
|
154
|
+
>
|
|
155
|
+
<gds-icon-copy></gds-icon-copy>
|
|
156
|
+
</gds-button>
|
|
157
|
+
|
|
158
|
+
<!-- status: badge -->
|
|
159
|
+
<gds-badge
|
|
160
|
+
slot="status:${row.id}:status"
|
|
161
|
+
variant="${String(row.status) === "Active" ? "positive" : "negative"}"
|
|
162
|
+
size="small"
|
|
163
|
+
>
|
|
164
|
+
${String(row.status)}
|
|
165
|
+
</gds-badge>
|
|
166
|
+
|
|
167
|
+
<!-- amount: formatted number -->
|
|
168
|
+
<gds-formatted-number
|
|
169
|
+
slot="amount:${row.id}:amount"
|
|
170
|
+
.value=${row.amount}
|
|
171
|
+
></gds-formatted-number>
|
|
172
|
+
|
|
173
|
+
<!-- amount: currency -->
|
|
174
|
+
<gds-badge slot="amount:${row.id}:currency" size="small">
|
|
175
|
+
SEK
|
|
176
|
+
</gds-badge>
|
|
177
|
+
|
|
178
|
+
<!-- account: formatted account -->
|
|
179
|
+
<gds-formatted-account
|
|
180
|
+
slot="account:${row.id}:main"
|
|
181
|
+
account="${row.account}"
|
|
182
|
+
format="seb-account"
|
|
183
|
+
></gds-formatted-account>
|
|
184
|
+
|
|
185
|
+
<!-- login: formatted date -->
|
|
186
|
+
<gds-formatted-date
|
|
187
|
+
slot="login:${row.id}:main"
|
|
188
|
+
.value="${String(row.login)}"
|
|
189
|
+
locale="sv-SE"
|
|
190
|
+
format="dateLong"
|
|
191
|
+
></gds-formatted-date>
|
|
192
|
+
|
|
193
|
+
<!-- download: link with icon -->
|
|
194
|
+
<gds-link
|
|
195
|
+
slot="download:${row.id}:main"
|
|
196
|
+
href="${row.download ?? "#"}"
|
|
197
|
+
text-decoration="underline"
|
|
198
|
+
download
|
|
199
|
+
>
|
|
200
|
+
Download file
|
|
201
|
+
<gds-icon-cloud-download slot="trail"></gds-icon-cloud-download>
|
|
202
|
+
</gds-link>
|
|
203
|
+
|
|
204
|
+
<!-- actions: context menu -->
|
|
205
|
+
<gds-context-menu slot="actions:${row.id}:main">
|
|
206
|
+
<gds-button slot="trigger" rank="tertiary" size="small">
|
|
207
|
+
<gds-icon-dot-grid-one-horizontal></gds-icon-dot-grid-one-horizontal>
|
|
208
|
+
</gds-button>
|
|
209
|
+
<gds-menu-item>Edit ${String(row.name)}</gds-menu-item>
|
|
210
|
+
<gds-menu-item>Delete</gds-menu-item>
|
|
211
|
+
</gds-context-menu>
|
|
212
|
+
`
|
|
213
|
+
)}
|
|
214
|
+
`;
|
|
283
215
|
}
|
|
284
|
-
const startIndex = (request.page - 1) * request.rows;
|
|
285
|
-
const endIndex = startIndex + request.rows;
|
|
286
|
-
const paginatedData = processedData.slice(startIndex, endIndex);
|
|
287
|
-
return {
|
|
288
|
-
rows: paginatedData,
|
|
289
|
-
total: processedData.length
|
|
290
|
-
};
|
|
291
216
|
};
|
|
217
|
+
const loadFeedback = async () => {
|
|
218
|
+
if (feedbackCache) return feedbackCache;
|
|
219
|
+
if (feedbackPromise) return feedbackPromise;
|
|
220
|
+
feedbackPromise = fetch(FEEDBACK_URL).then((response) => response.json()).then((data) => {
|
|
221
|
+
feedbackCache = data;
|
|
222
|
+
return data;
|
|
223
|
+
});
|
|
224
|
+
return feedbackPromise;
|
|
225
|
+
};
|
|
226
|
+
const feedbackDataProvider = createDataProvider(loadFeedback);
|
|
292
227
|
const Feedback = {
|
|
293
228
|
Columns: [
|
|
294
229
|
{
|
|
@@ -300,13 +235,14 @@ const Feedback = {
|
|
|
300
235
|
{
|
|
301
236
|
key: "feedback",
|
|
302
237
|
label: "Feedback",
|
|
238
|
+
align: "start",
|
|
303
239
|
width: "350px"
|
|
304
240
|
},
|
|
305
241
|
{
|
|
306
242
|
key: "notes",
|
|
307
243
|
label: "Notes",
|
|
308
244
|
align: "start",
|
|
309
|
-
width: "
|
|
245
|
+
width: "460px"
|
|
310
246
|
},
|
|
311
247
|
{
|
|
312
248
|
key: "department",
|
|
@@ -320,83 +256,120 @@ const Feedback = {
|
|
|
320
256
|
sortable: true,
|
|
321
257
|
align: "start",
|
|
322
258
|
justify: "end",
|
|
323
|
-
width: "100px"
|
|
324
|
-
cell: {
|
|
325
|
-
value: {
|
|
326
|
-
type: "badge",
|
|
327
|
-
value: (row) => row.status,
|
|
328
|
-
variant: (row) => row.status === "Active" ? "positive" : "negative",
|
|
329
|
-
size: "small"
|
|
330
|
-
}
|
|
331
|
-
}
|
|
259
|
+
width: "100px"
|
|
332
260
|
}
|
|
333
261
|
],
|
|
262
|
+
Data: feedbackDataProvider
|
|
263
|
+
};
|
|
264
|
+
const actionsStaticRows = [
|
|
265
|
+
{
|
|
266
|
+
id: 1,
|
|
267
|
+
task: "Review contract",
|
|
268
|
+
assignee: "Anna Svensson",
|
|
269
|
+
priority: "High"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
id: 2,
|
|
273
|
+
task: "Update pricing",
|
|
274
|
+
assignee: "Erik Lindgren",
|
|
275
|
+
priority: "Medium"
|
|
276
|
+
},
|
|
277
|
+
{ id: 3, task: "Send invoice", assignee: "Maria Berg", priority: "Low" },
|
|
278
|
+
{
|
|
279
|
+
id: 4,
|
|
280
|
+
task: "Approve budget",
|
|
281
|
+
assignee: "Johan Nilsson",
|
|
282
|
+
priority: "High"
|
|
283
|
+
}
|
|
284
|
+
];
|
|
285
|
+
const actionsDataProvider = async (request) => {
|
|
286
|
+
const start = (request.page - 1) * request.rows;
|
|
287
|
+
const page = actionsStaticRows.slice(start, start + request.rows);
|
|
288
|
+
return { rows: page, total: actionsStaticRows.length };
|
|
289
|
+
};
|
|
290
|
+
const Actions = {
|
|
291
|
+
Columns: [
|
|
292
|
+
{ key: "task", label: "Task", align: "center" },
|
|
293
|
+
{ key: "assignee", label: "Assignee", align: "center" },
|
|
294
|
+
{ key: "priority", label: "Priority", align: "center", width: "100px" }
|
|
295
|
+
],
|
|
334
296
|
MultipleActions: {
|
|
335
297
|
label: "Actions",
|
|
336
|
-
align: "
|
|
298
|
+
align: "center",
|
|
337
299
|
justify: "start",
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
300
|
+
width: "150px"
|
|
301
|
+
},
|
|
302
|
+
MultipleActionsSlotContent: (rows) => {
|
|
303
|
+
return html`
|
|
304
|
+
${rows.map(
|
|
305
|
+
(row, i) => html`
|
|
306
|
+
<gds-button
|
|
307
|
+
slot="actions:${row.id ?? i + 1}:main"
|
|
308
|
+
rank="secondary"
|
|
309
|
+
size="small"
|
|
310
|
+
variant="positive"
|
|
311
|
+
>
|
|
312
|
+
<gds-icon-circle-check size="m"></gds-icon-circle-check>
|
|
313
|
+
</gds-button>
|
|
314
|
+
<gds-button
|
|
315
|
+
slot="actions:${row.id ?? i + 1}:main"
|
|
316
|
+
rank="secondary"
|
|
317
|
+
size="small"
|
|
318
|
+
variant="negative"
|
|
319
|
+
>
|
|
320
|
+
<gds-icon-cross-small size="m"></gds-icon-cross-small>
|
|
321
|
+
</gds-button>
|
|
322
|
+
`
|
|
323
|
+
)}
|
|
324
|
+
`;
|
|
351
325
|
},
|
|
352
326
|
ActionLink: {
|
|
353
327
|
label: "Actions",
|
|
354
|
-
align: "
|
|
328
|
+
align: "center",
|
|
355
329
|
justify: "end",
|
|
356
|
-
|
|
357
|
-
{
|
|
358
|
-
type: "link",
|
|
359
|
-
href: "#",
|
|
360
|
-
label: "Link"
|
|
361
|
-
}
|
|
362
|
-
]
|
|
330
|
+
width: "150px"
|
|
363
331
|
},
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
332
|
+
ActionLinkSlotContent: (rows) => {
|
|
333
|
+
return html`
|
|
334
|
+
${rows.map(
|
|
335
|
+
(row, i) => html`
|
|
336
|
+
<gds-button
|
|
337
|
+
slot="actions:${row.id ?? i + 1}:main"
|
|
338
|
+
size="small"
|
|
339
|
+
rank="secondary"
|
|
340
|
+
>
|
|
341
|
+
View details
|
|
342
|
+
</gds-button>
|
|
343
|
+
`
|
|
344
|
+
)}
|
|
345
|
+
`;
|
|
374
346
|
},
|
|
375
347
|
ActionContextMenu: {
|
|
376
348
|
label: "Actions",
|
|
377
|
-
align: "
|
|
349
|
+
align: "center",
|
|
378
350
|
justify: "end",
|
|
379
|
-
|
|
380
|
-
type: "context-menu",
|
|
381
|
-
items: [
|
|
382
|
-
{
|
|
383
|
-
label: "Activate"
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
label: "View Details"
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
label: "Edit Profile"
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
label: "Delete User"
|
|
393
|
-
}
|
|
394
|
-
]
|
|
395
|
-
}
|
|
351
|
+
width: "150px"
|
|
396
352
|
},
|
|
397
|
-
|
|
353
|
+
ActionContextMenuSlotContent: (rows) => {
|
|
354
|
+
return html`
|
|
355
|
+
${rows.map(
|
|
356
|
+
(row, i) => html`
|
|
357
|
+
<gds-context-menu slot="actions:${row.id ?? i + 1}:main">
|
|
358
|
+
<gds-button slot="trigger" rank="tertiary" size="small">
|
|
359
|
+
<gds-icon-dot-grid-one-horizontal></gds-icon-dot-grid-one-horizontal>
|
|
360
|
+
</gds-button>
|
|
361
|
+
<gds-menu-item>Edit</gds-menu-item>
|
|
362
|
+
<gds-menu-item>Archive</gds-menu-item>
|
|
363
|
+
<gds-menu-item>Delete</gds-menu-item>
|
|
364
|
+
</gds-context-menu>
|
|
365
|
+
`
|
|
366
|
+
)}
|
|
367
|
+
`;
|
|
368
|
+
},
|
|
369
|
+
Data: actionsDataProvider
|
|
398
370
|
};
|
|
399
371
|
export {
|
|
372
|
+
Actions,
|
|
400
373
|
Feedback,
|
|
401
374
|
Users
|
|
402
375
|
};
|