@vanillabp/bc-ui 0.0.3

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.
Files changed (47) hide show
  1. package/README.md +1 -0
  2. package/dist/chunk-YH4NJHER.js +58 -0
  3. package/dist/components/ListCell.d.ts +27 -0
  4. package/dist/components/ListCell.js +123 -0
  5. package/dist/components/ListColumnHeader.d.ts +22 -0
  6. package/dist/components/ListColumnHeader.js +135 -0
  7. package/dist/components/ListOfTasks.d.ts +35 -0
  8. package/dist/components/ListOfTasks.js +1327 -0
  9. package/dist/components/ListOfWorkflows.d.ts +36 -0
  10. package/dist/components/ListOfWorkflows.js +974 -0
  11. package/dist/components/NoElementGivenByModule.d.ts +10 -0
  12. package/dist/components/NoElementGivenByModule.js +54 -0
  13. package/dist/components/NoUserTaskGiven.d.ts +10 -0
  14. package/dist/components/NoUserTaskGiven.js +23 -0
  15. package/dist/components/NoWorkflowGiven.d.ts +10 -0
  16. package/dist/components/NoWorkflowGiven.js +22 -0
  17. package/dist/components/SearchableAndSortableUpdatingList.d.ts +49 -0
  18. package/dist/components/SearchableAndSortableUpdatingList.js +200 -0
  19. package/dist/components/SnapScrolling.d.ts +15 -0
  20. package/dist/components/SnapScrolling.js +17 -0
  21. package/dist/components/SnapScrollingDataTable.d.ts +17 -0
  22. package/dist/components/SnapScrollingDataTable.js +113 -0
  23. package/dist/components/User.d.ts +11 -0
  24. package/dist/components/User.js +39 -0
  25. package/dist/components/UserAvatar.d.ts +12 -0
  26. package/dist/components/UserAvatar.js +133 -0
  27. package/dist/components/UserTaskPage.d.ts +24 -0
  28. package/dist/components/UserTaskPage.js +121 -0
  29. package/dist/components/WorkflowPage.d.ts +16 -0
  30. package/dist/components/WorkflowPage.js +124 -0
  31. package/dist/components/index.d.ts +25 -0
  32. package/dist/components/index.js +13 -0
  33. package/dist/index.d.ts +25 -0
  34. package/dist/index.js +3 -0
  35. package/dist/types/apis.d.ts +50 -0
  36. package/dist/types/apis.js +0 -0
  37. package/dist/types/index.d.ts +7 -0
  38. package/dist/types/index.js +3 -0
  39. package/dist/types/lists.d.ts +12 -0
  40. package/dist/types/lists.js +0 -0
  41. package/dist/types/navigate.d.ts +6 -0
  42. package/dist/types/navigate.js +0 -0
  43. package/dist/utils/index.d.ts +2 -0
  44. package/dist/utils/index.js +1 -0
  45. package/dist/utils/module-federation.d.ts +40 -0
  46. package/dist/utils/module-federation.js +182 -0
  47. package/package.json +66 -0
@@ -0,0 +1,1327 @@
1
+ import {
2
+ __async,
3
+ __objRest,
4
+ __spreadProps,
5
+ __spreadValues
6
+ } from "../chunk-YH4NJHER.js";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { useEffect, useMemo, useRef, useState } from "react";
9
+ import { Box, CheckBox, Drop, Grid, Grommet, Text, TextInput, Tip } from "grommet";
10
+ import {
11
+ colorForEndedItemsOrUndefined,
12
+ colorRowAccordingToUpdateStatus,
13
+ debounce,
14
+ DefaultListCell,
15
+ ENDED_FONT_COLOR,
16
+ Link,
17
+ ListCell as StyledListCell,
18
+ ListItemStatus,
19
+ useOnClickOutside,
20
+ useResponsiveScreen
21
+ } from "@vanillabp/bc-shared";
22
+ import {
23
+ ListCell,
24
+ SearchableAndSortableUpdatingList,
25
+ TypeOfItem,
26
+ useFederationModules
27
+ } from "../index.js";
28
+ import { Blank, ContactInfo, FormTrash, FormView, Hide, Refresh, User as UserIcon } from "grommet-icons";
29
+ import { User } from "./User.js";
30
+ import { ListColumnHeader } from "./ListColumnHeader.js";
31
+ import { useTheme } from "styled-components";
32
+ const minWidthOfTitleColumn = "20rem";
33
+ const updateModuleDefinitions = (userTasks, existingModuleDefinitions, setModulesOfTasks, existingUserTaskDefinitions, setDefinitionsOfTasks) => {
34
+ const newModuleDefinitions = userTasks.filter((userTask) => userTask.workflowModuleId !== void 0).reduce((moduleDefinitions, userTask) => moduleDefinitions.includes(userTask) ? moduleDefinitions : moduleDefinitions.concat(userTask), existingModuleDefinitions || []);
35
+ if ((existingModuleDefinitions == null ? void 0 : existingModuleDefinitions.length) !== newModuleDefinitions.length) {
36
+ setModulesOfTasks(newModuleDefinitions);
37
+ const newUserTaskDefinitions = __spreadValues({}, existingUserTaskDefinitions);
38
+ userTasks.filter((userTask) => userTask.taskDefinition !== void 0).forEach((userTask) => newUserTaskDefinitions[`${userTask.workflowModuleId}#${userTask.taskDefinition}`] = userTask);
39
+ if (existingUserTaskDefinitions === void 0 || Object.keys(existingUserTaskDefinitions).length !== Object.keys(newUserTaskDefinitions).length) {
40
+ setDefinitionsOfTasks(newUserTaskDefinitions);
41
+ }
42
+ }
43
+ };
44
+ const loadUserTasks = (tasklistApi, setNumberOfUserTasks, existingModuleDefinitions, setModulesOfTasks, existingUserTaskDefinitions, setDefinitionsOfTasks, pageSize, pageNumber, initialTimestamp, sort, sortAscending, mapToBcUserTask) => __async(void 0, null, function* () {
45
+ const result = yield tasklistApi.getUserTasks(
46
+ (/* @__PURE__ */ new Date()).getTime().toString(),
47
+ pageNumber,
48
+ pageSize,
49
+ sort,
50
+ sortAscending,
51
+ initialTimestamp
52
+ );
53
+ setNumberOfUserTasks(result.page.totalElements);
54
+ updateModuleDefinitions(result.userTasks, existingModuleDefinitions, setModulesOfTasks, existingUserTaskDefinitions, setDefinitionsOfTasks);
55
+ return {
56
+ serverTimestamp: result.serverTimestamp,
57
+ items: result.userTasks.map((userTask) => mapToBcUserTask(userTask))
58
+ };
59
+ });
60
+ const reloadUserTasks = (tasklistApi, setNumberOfUserTasks, existingModuleDefinitions, setModulesOfTasks, existingUserTaskDefinitions, setDefinitionsOfTasks, numberOfItems, knownItemsIds, initialTimestamp, sort, sortAscending, mapToBcUserTask, allSelected) => __async(void 0, null, function* () {
61
+ const result = yield tasklistApi.getUserTasksUpdate(
62
+ (/* @__PURE__ */ new Date()).getTime().toString(),
63
+ numberOfItems,
64
+ knownItemsIds,
65
+ sort,
66
+ sortAscending,
67
+ initialTimestamp
68
+ );
69
+ setNumberOfUserTasks(result.page.totalElements);
70
+ updateModuleDefinitions(result.userTasks, existingModuleDefinitions, setModulesOfTasks, existingUserTaskDefinitions, setDefinitionsOfTasks);
71
+ return {
72
+ serverTimestamp: result.serverTimestamp,
73
+ items: result.userTasks.map((userTask) => {
74
+ return __spreadProps(__spreadValues({}, mapToBcUserTask(userTask)), {
75
+ selected: allSelected
76
+ });
77
+ })
78
+ };
79
+ });
80
+ const SetReadStatusButtons = ({
81
+ t,
82
+ disabled,
83
+ markAsRead,
84
+ markAsUnread
85
+ }) => {
86
+ const color = disabled ? "light-4" : "dark-3";
87
+ const textColor = disabled ? "dark-4" : "dark-1";
88
+ return /* @__PURE__ */ jsxs(
89
+ Box,
90
+ {
91
+ direction: "row",
92
+ round: { size: "0.4rem" },
93
+ border: { color },
94
+ elevation: "small",
95
+ children: [
96
+ /* @__PURE__ */ jsx(
97
+ Tip,
98
+ {
99
+ content: t("mark_as_read"),
100
+ children: /* @__PURE__ */ jsx(
101
+ Box,
102
+ {
103
+ hoverIndicator: "light-2",
104
+ focusIndicator: false,
105
+ onClick: markAsRead,
106
+ width: "2rem",
107
+ height: "2rem",
108
+ round: { size: "0.4rem", corner: "left" },
109
+ align: "center",
110
+ justify: "center",
111
+ children: /* @__PURE__ */ jsx(
112
+ FormView,
113
+ {
114
+ color: textColor
115
+ }
116
+ )
117
+ }
118
+ )
119
+ }
120
+ ),
121
+ /* @__PURE__ */ jsx(
122
+ Tip,
123
+ {
124
+ content: t("mark_as_unread"),
125
+ children: /* @__PURE__ */ jsx(
126
+ Box,
127
+ {
128
+ hoverIndicator: "light-2",
129
+ focusIndicator: false,
130
+ onClick: markAsUnread,
131
+ width: "2rem",
132
+ height: "2rem",
133
+ round: { size: "0.4rem", corner: "right" },
134
+ align: "center",
135
+ justify: "center",
136
+ border: { color, side: "left" },
137
+ children: /* @__PURE__ */ jsx(
138
+ Hide,
139
+ {
140
+ color: textColor
141
+ }
142
+ )
143
+ }
144
+ )
145
+ }
146
+ )
147
+ ]
148
+ }
149
+ );
150
+ };
151
+ const ClaimButtons = ({
152
+ t,
153
+ disabled,
154
+ claimTasks,
155
+ unclaimTasks
156
+ }) => {
157
+ const color = disabled ? "light-4" : "dark-3";
158
+ const textColor = disabled ? "dark-4" : "dark-1";
159
+ const { isNotPhone } = useResponsiveScreen();
160
+ return /* @__PURE__ */ jsxs(
161
+ Box,
162
+ {
163
+ direction: "row",
164
+ elevation: "small",
165
+ round: { size: "0.4rem" },
166
+ border: { color },
167
+ children: [
168
+ /* @__PURE__ */ jsx(
169
+ Tip,
170
+ {
171
+ content: t("claim_tasks"),
172
+ children: /* @__PURE__ */ jsxs(
173
+ Box,
174
+ {
175
+ hoverIndicator: "light-2",
176
+ focusIndicator: false,
177
+ onClick: claimTasks,
178
+ height: "2rem",
179
+ pad: { horizontal: "0.4rem" },
180
+ gap: "0.4rem",
181
+ round: { size: "0.4rem", corner: "left" },
182
+ align: "center",
183
+ direction: "row",
184
+ justify: "center",
185
+ children: [
186
+ /* @__PURE__ */ jsx(
187
+ UserIcon,
188
+ {
189
+ size: "20rem",
190
+ color: textColor
191
+ }
192
+ ),
193
+ isNotPhone && /* @__PURE__ */ jsx(
194
+ Text,
195
+ {
196
+ truncate: "tip",
197
+ color: textColor,
198
+ children: t("claim_task")
199
+ }
200
+ )
201
+ ]
202
+ }
203
+ )
204
+ }
205
+ ),
206
+ /* @__PURE__ */ jsx(
207
+ Tip,
208
+ {
209
+ content: t("unclaim_tasks"),
210
+ children: /* @__PURE__ */ jsxs(
211
+ Box,
212
+ {
213
+ hoverIndicator: "light-2",
214
+ focusIndicator: false,
215
+ onClick: unclaimTasks,
216
+ round: { size: "0.4rem", corner: "right" },
217
+ style: { position: "relative" },
218
+ width: "2rem",
219
+ height: "2rem",
220
+ align: "center",
221
+ justify: "center",
222
+ border: { color, side: "left" },
223
+ children: [
224
+ /* @__PURE__ */ jsx(
225
+ UserIcon,
226
+ {
227
+ style: { position: "absolute" },
228
+ color: textColor,
229
+ size: "20rem"
230
+ }
231
+ ),
232
+ /* @__PURE__ */ jsx(
233
+ Blank,
234
+ {
235
+ style: { position: "absolute" },
236
+ color: textColor,
237
+ size: "20rem",
238
+ children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("line", { x1: "24", y1: "4", x2: "4", y2: "24", strokeWidth: "2" }) })
239
+ }
240
+ )
241
+ ]
242
+ }
243
+ )
244
+ }
245
+ )
246
+ ]
247
+ }
248
+ );
249
+ };
250
+ const AssignButton = ({
251
+ t,
252
+ tasklistApi,
253
+ disabled,
254
+ assign
255
+ }) => {
256
+ const [edit, setEdit] = useState(false);
257
+ const [hide, setHide] = useState(false);
258
+ const [focus, setFocus] = useState(false);
259
+ const [active, setActive] = useState(false);
260
+ const [query, setQuery] = useState("");
261
+ const currentQuery = useRef("");
262
+ const [users, setUsers] = useState(void 0);
263
+ const inputRef = useRef(null);
264
+ const loadResult = () => __async(void 0, null, function* () {
265
+ const result = yield tasklistApi.findUsers(currentQuery.current, 10);
266
+ setUsers(result.users);
267
+ });
268
+ const showEdit = () => {
269
+ if (edit)
270
+ return;
271
+ loadResult();
272
+ setEdit(true);
273
+ setHide(false);
274
+ setFocus(false);
275
+ };
276
+ const finalizeShowEdit = () => {
277
+ inputRef.current.focus();
278
+ setActive(true);
279
+ };
280
+ const hideEdit = () => {
281
+ if (!edit)
282
+ return;
283
+ setHide(true);
284
+ setFocus(false);
285
+ setActive(false);
286
+ };
287
+ const finalizeHideEdit = () => {
288
+ setEdit(false);
289
+ setHide(false);
290
+ };
291
+ useOnClickOutside(inputRef, hideEdit);
292
+ const findUsersDebounced = useMemo(() => debounce(loadResult, 300), [tasklistApi, currentQuery]);
293
+ const updateResult = (newQuery) => {
294
+ currentQuery.current = newQuery;
295
+ setQuery(newQuery);
296
+ findUsersDebounced();
297
+ };
298
+ const color = disabled ? "light-4" : "dark-3";
299
+ const textColor = disabled ? "dark-4" : "dark-1";
300
+ return /* @__PURE__ */ jsxs(
301
+ Box,
302
+ {
303
+ elevation: "small",
304
+ hoverIndicator: edit ? "white" : "light-2",
305
+ focusIndicator: false,
306
+ onClick: showEdit,
307
+ round: { size: "0.4rem" },
308
+ style: { position: "relative" },
309
+ border: { color },
310
+ children: [
311
+ /* @__PURE__ */ jsxs(
312
+ Box,
313
+ {
314
+ height: "2rem",
315
+ width: "15rem",
316
+ align: "center",
317
+ justify: "center",
318
+ style: { position: "relative" },
319
+ overflow: "hidden",
320
+ children: [
321
+ /* @__PURE__ */ jsxs(
322
+ Box,
323
+ {
324
+ gap: "0.4rem",
325
+ pad: { horizontal: "0.4rem" },
326
+ align: "center",
327
+ direction: "row",
328
+ children: [
329
+ /* @__PURE__ */ jsx(
330
+ ContactInfo,
331
+ {
332
+ color: textColor
333
+ }
334
+ ),
335
+ /* @__PURE__ */ jsx(
336
+ Text,
337
+ {
338
+ truncate: "tip",
339
+ color: textColor,
340
+ children: t("assign_task")
341
+ }
342
+ )
343
+ ]
344
+ }
345
+ ),
346
+ edit ? /* @__PURE__ */ jsx(
347
+ Box,
348
+ {
349
+ fill: true,
350
+ overflow: "visible",
351
+ style: { position: "absolute", top: hide ? "3.85rem" : "-0.15rem" },
352
+ animation: { type: hide ? "slideDown" : "slideUp", size: "xlarge", duration: 700 },
353
+ onAnimationEnd: hide ? finalizeHideEdit : finalizeShowEdit,
354
+ children: /* @__PURE__ */ jsxs(
355
+ Box,
356
+ {
357
+ margin: { vertical: "0.4rem", horizontal: "0.4rem" },
358
+ pad: "0.1rem",
359
+ direction: "row",
360
+ justify: "center",
361
+ background: "white",
362
+ children: [
363
+ /* @__PURE__ */ jsx(
364
+ TextInput,
365
+ {
366
+ plain: "full",
367
+ ref: inputRef,
368
+ placeholder: t("assign_placeholder"),
369
+ autoFocus: focus,
370
+ value: query,
371
+ onChange: (event) => updateResult(event.target.value),
372
+ focusIndicator: false,
373
+ reverse: true
374
+ }
375
+ ),
376
+ /* @__PURE__ */ jsx(
377
+ ContactInfo,
378
+ {
379
+ color: textColor
380
+ }
381
+ )
382
+ ]
383
+ }
384
+ )
385
+ }
386
+ ) : void 0
387
+ ]
388
+ }
389
+ ),
390
+ active || hide ? /* @__PURE__ */ jsx(
391
+ Box,
392
+ {
393
+ animation: { type: hide ? "fadeOut" : "fadeIn", duration: 700 },
394
+ style: { position: "absolute", zIndex: 20, top: "1.6rem", left: "-1px", right: "-1px", maxWidth: "unset" },
395
+ children: /* @__PURE__ */ jsx(
396
+ Box,
397
+ {
398
+ background: "white",
399
+ elevation: "small",
400
+ gap: "xsmall",
401
+ pad: { top: "0.4rem", horizontal: "0.4rem" },
402
+ round: { corner: "bottom", size: "0.4rem" },
403
+ border: [{ color, side: "left" }, { color, side: "bottom" }, { color, side: "right" }],
404
+ animation: { type: !active ? "fadeOut" : "fadeIn", duration: 700 },
405
+ children: /* @__PURE__ */ jsx(
406
+ Box,
407
+ {
408
+ pad: { top: "0.2rem" },
409
+ height: { max: "24rem" },
410
+ overflow: { vertical: "auto" },
411
+ children: users === void 0 ? t("assign_loading") : users.map((user) => /* @__PURE__ */ jsx(
412
+ Box,
413
+ {
414
+ height: { min: "2rem" },
415
+ onClick: () => assign(user.id),
416
+ children: /* @__PURE__ */ jsx(
417
+ User,
418
+ {
419
+ user,
420
+ isUserLoggedIn: false,
421
+ iconSize: "small",
422
+ size: "medium"
423
+ }
424
+ )
425
+ },
426
+ user.id
427
+ ))
428
+ }
429
+ )
430
+ }
431
+ )
432
+ }
433
+ ) : void 0
434
+ ]
435
+ }
436
+ );
437
+ };
438
+ const RefreshButton = ({
439
+ t,
440
+ disabled,
441
+ refresh
442
+ }) => {
443
+ const color = disabled ? "light-4" : "dark-3";
444
+ const textColor = disabled ? "dark-4" : "dark-1";
445
+ return /* @__PURE__ */ jsx(
446
+ Box,
447
+ {
448
+ hoverIndicator: disabled ? "light-2" : "accent-1",
449
+ focusIndicator: false,
450
+ onClick: refresh,
451
+ direction: "row",
452
+ elevation: "small",
453
+ background: !disabled ? { color: "accent-1", opacity: "strong" } : void 0,
454
+ round: { size: "0.4rem" },
455
+ border: { color },
456
+ children: /* @__PURE__ */ jsx(
457
+ Tip,
458
+ {
459
+ content: t("refresh_tasks"),
460
+ children: /* @__PURE__ */ jsx(
461
+ Box,
462
+ {
463
+ height: "2rem",
464
+ pad: { horizontal: "0.4rem" },
465
+ align: "center",
466
+ direction: "row",
467
+ justify: "center",
468
+ children: /* @__PURE__ */ jsx(
469
+ Refresh,
470
+ {
471
+ size: "20rem",
472
+ color: textColor
473
+ }
474
+ )
475
+ }
476
+ )
477
+ }
478
+ )
479
+ }
480
+ );
481
+ };
482
+ const DefaultFooter = ({
483
+ t,
484
+ isPhone,
485
+ isTablet,
486
+ numberOfTasks
487
+ }) => {
488
+ const isNotPhone = !isPhone;
489
+ return /* @__PURE__ */ jsxs(
490
+ Box,
491
+ {
492
+ direction: "row",
493
+ justify: "between",
494
+ align: "center",
495
+ children: [
496
+ /* @__PURE__ */ jsxs(
497
+ Box,
498
+ {
499
+ pad: "xsmall",
500
+ children: [
501
+ t("total"),
502
+ " ",
503
+ numberOfTasks
504
+ ]
505
+ }
506
+ ),
507
+ /* @__PURE__ */ jsxs(
508
+ Box,
509
+ {
510
+ direction: "row",
511
+ gap: "medium",
512
+ pad: "xsmall",
513
+ align: "center",
514
+ children: [
515
+ /* @__PURE__ */ jsxs(
516
+ Box,
517
+ {
518
+ direction: "row",
519
+ align: "center",
520
+ gap: "xsmall",
521
+ children: [
522
+ /* @__PURE__ */ jsx(
523
+ Box,
524
+ {
525
+ direction: "row",
526
+ height: "1rem",
527
+ border: { color: "light-4", size: "1px" },
528
+ children: /* @__PURE__ */ jsx(
529
+ Box,
530
+ {
531
+ width: "1rem",
532
+ height: "100%",
533
+ align: "center",
534
+ justify: "center",
535
+ background: "white",
536
+ children: /* @__PURE__ */ jsx(Text, { size: "xsmall", children: "T" })
537
+ }
538
+ )
539
+ }
540
+ ),
541
+ isNotPhone ? /* @__PURE__ */ jsx(Box, { children: t("legend_unchanged") }) : void 0
542
+ ]
543
+ }
544
+ ),
545
+ /* @__PURE__ */ jsxs(
546
+ Box,
547
+ {
548
+ direction: "row",
549
+ align: "center",
550
+ gap: "xsmall",
551
+ children: [
552
+ /* @__PURE__ */ jsx(
553
+ Box,
554
+ {
555
+ direction: "row",
556
+ height: "1rem",
557
+ border: { color: "light-4", size: "1px" },
558
+ children: /* @__PURE__ */ jsx(
559
+ Box,
560
+ {
561
+ width: "1rem",
562
+ height: "100%",
563
+ align: "center",
564
+ justify: "center",
565
+ background: { color: "accent-3", opacity: 0.1 },
566
+ children: /* @__PURE__ */ jsx(Text, { size: "xsmall", children: "T" })
567
+ }
568
+ )
569
+ }
570
+ ),
571
+ isNotPhone ? /* @__PURE__ */ jsx(Box, { children: t("legend_new") }) : void 0
572
+ ]
573
+ }
574
+ ),
575
+ /* @__PURE__ */ jsxs(
576
+ Box,
577
+ {
578
+ direction: "row",
579
+ align: "center",
580
+ gap: "xsmall",
581
+ children: [
582
+ /* @__PURE__ */ jsx(
583
+ Box,
584
+ {
585
+ direction: "row",
586
+ height: "1rem",
587
+ border: { color: "light-4", size: "1px" },
588
+ children: /* @__PURE__ */ jsx(
589
+ Box,
590
+ {
591
+ width: "1rem",
592
+ height: "100%",
593
+ align: "center",
594
+ justify: "center",
595
+ background: { color: "accent-1", opacity: 0.35 },
596
+ children: /* @__PURE__ */ jsx(Text, { size: "xsmall", children: "T" })
597
+ }
598
+ )
599
+ }
600
+ ),
601
+ isNotPhone ? /* @__PURE__ */ jsx(Box, { children: t("legend_updated") }) : void 0
602
+ ]
603
+ }
604
+ ),
605
+ /* @__PURE__ */ jsxs(
606
+ Box,
607
+ {
608
+ direction: "row",
609
+ align: "center",
610
+ gap: "xsmall",
611
+ children: [
612
+ /* @__PURE__ */ jsx(
613
+ Box,
614
+ {
615
+ direction: "row",
616
+ height: "1rem",
617
+ border: { color: "light-4", size: "1px" },
618
+ children: /* @__PURE__ */ jsx(
619
+ Box,
620
+ {
621
+ width: "1rem",
622
+ height: "100%",
623
+ align: "center",
624
+ justify: "center",
625
+ background: { color: "light-2", opacity: 0.5 },
626
+ children: /* @__PURE__ */ jsx(Text, { size: "xsmall", color: ENDED_FONT_COLOR, children: "T" })
627
+ }
628
+ )
629
+ }
630
+ ),
631
+ isNotPhone ? /* @__PURE__ */ jsx(Box, { children: t("legend_completed") }) : void 0
632
+ ]
633
+ }
634
+ ),
635
+ /* @__PURE__ */ jsxs(
636
+ Box,
637
+ {
638
+ direction: "row",
639
+ align: "center",
640
+ gap: "xsmall",
641
+ children: [
642
+ /* @__PURE__ */ jsx(
643
+ Box,
644
+ {
645
+ direction: "row",
646
+ height: "1rem",
647
+ border: { color: "light-4", size: "1px" },
648
+ children: /* @__PURE__ */ jsx(
649
+ Box,
650
+ {
651
+ width: "1rem",
652
+ height: "100%",
653
+ align: "center",
654
+ justify: "center",
655
+ background: { color: "light-2", opacity: 0.5 },
656
+ children: /* @__PURE__ */ jsx(Text, { size: "xsmall", children: "T" })
657
+ }
658
+ )
659
+ }
660
+ ),
661
+ isNotPhone ? /* @__PURE__ */ jsx(Box, { children: t("legend_filtered") }) : void 0
662
+ ]
663
+ }
664
+ )
665
+ ]
666
+ }
667
+ )
668
+ ]
669
+ },
670
+ "footer"
671
+ );
672
+ };
673
+ const DefaultHeader = ({
674
+ tasklistApi,
675
+ t,
676
+ refresh,
677
+ refreshDisabled,
678
+ markAsRead,
679
+ markAsUnread,
680
+ markAsReadDisabled,
681
+ claimTasks,
682
+ unclaimTasks,
683
+ claimTasksDisabled,
684
+ assignTasks,
685
+ assignDisabled
686
+ }) => {
687
+ return /* @__PURE__ */ jsxs(
688
+ Box,
689
+ {
690
+ fill: true,
691
+ background: "white",
692
+ direction: "row",
693
+ align: "center",
694
+ justify: "start",
695
+ gap: "small",
696
+ pad: { horizontal: "xsmall" },
697
+ children: [
698
+ /* @__PURE__ */ jsx(
699
+ SetReadStatusButtons,
700
+ {
701
+ t,
702
+ disabled: markAsReadDisabled,
703
+ markAsRead,
704
+ markAsUnread
705
+ }
706
+ ),
707
+ /* @__PURE__ */ jsx(
708
+ ClaimButtons,
709
+ {
710
+ t,
711
+ disabled: claimTasksDisabled,
712
+ claimTasks,
713
+ unclaimTasks
714
+ }
715
+ ),
716
+ /* @__PURE__ */ jsx(
717
+ AssignButton,
718
+ {
719
+ tasklistApi,
720
+ t,
721
+ disabled: assignDisabled,
722
+ assign: assignTasks
723
+ }
724
+ ),
725
+ /* @__PURE__ */ jsx(
726
+ RefreshButton,
727
+ {
728
+ t,
729
+ refresh,
730
+ disabled: refreshDisabled
731
+ }
732
+ )
733
+ ]
734
+ }
735
+ );
736
+ };
737
+ const CandidateUsersListCell = ({
738
+ item
739
+ }) => {
740
+ var _a, _b;
741
+ const targetRef = useRef(null);
742
+ const [dropIdentifier, setDropIdentifier] = useState(void 0);
743
+ const background = colorRowAccordingToUpdateStatus(item);
744
+ return /* @__PURE__ */ jsx(
745
+ StyledListCell,
746
+ {
747
+ background,
748
+ align: "center",
749
+ children: item.data.candidateUsers && ((_a = item.data.candidateUsers) == null ? void 0 : _a.length) > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
750
+ /* @__PURE__ */ jsx(
751
+ Box,
752
+ {
753
+ onMouseEnter: () => setDropIdentifier(item.id),
754
+ ref: targetRef,
755
+ children: /* @__PURE__ */ jsx(ContactInfo, {})
756
+ }
757
+ ),
758
+ dropIdentifier && dropIdentifier === item.id && /* @__PURE__ */ jsx(
759
+ Drop,
760
+ {
761
+ inline: true,
762
+ round: "xsmall",
763
+ onMouseLeave: () => setDropIdentifier(void 0),
764
+ target: targetRef,
765
+ children: /* @__PURE__ */ jsx(
766
+ Box,
767
+ {
768
+ direction: "column",
769
+ margin: "xsmall",
770
+ gap: "xsmall",
771
+ children: (_b = item.data.candidateUsers) == null ? void 0 : _b.map((user) => /* @__PURE__ */ jsxs(
772
+ Box,
773
+ {
774
+ direction: "row",
775
+ align: "center",
776
+ justify: "center",
777
+ children: [
778
+ user,
779
+ /* @__PURE__ */ jsx(FormTrash, { onClick: () => item.data.unassign(user) })
780
+ ]
781
+ }
782
+ ))
783
+ }
784
+ )
785
+ }
786
+ )
787
+ ] }) : void 0
788
+ }
789
+ );
790
+ };
791
+ const SelectDefaultListCell = ({
792
+ item,
793
+ selectItem
794
+ }) => {
795
+ const background = colorRowAccordingToUpdateStatus(item);
796
+ return /* @__PURE__ */ jsx(
797
+ StyledListCell,
798
+ {
799
+ background,
800
+ align: "center",
801
+ children: /* @__PURE__ */ jsx(
802
+ CheckBox,
803
+ {
804
+ checked: item.selected,
805
+ onChange: (event) => selectItem(event.currentTarget.checked)
806
+ }
807
+ )
808
+ }
809
+ );
810
+ };
811
+ const TitleDefaultListCell = ({
812
+ item,
813
+ currentLanguage
814
+ }) => {
815
+ const titleLanguages = Object.keys(item.data["title"]);
816
+ let title;
817
+ if (titleLanguages.includes(currentLanguage)) {
818
+ title = item.data["title"][currentLanguage];
819
+ } else {
820
+ title = item.data["title"][titleLanguages[0]];
821
+ }
822
+ const background = colorRowAccordingToUpdateStatus(item);
823
+ return /* @__PURE__ */ jsx(
824
+ StyledListCell,
825
+ {
826
+ align: "left",
827
+ background,
828
+ children: /* @__PURE__ */ jsx(
829
+ Text,
830
+ {
831
+ color: colorForEndedItemsOrUndefined(item),
832
+ weight: item.read === void 0 ? "bold" : "normal",
833
+ truncate: "tip",
834
+ children: item.status === ListItemStatus.ENDED ? /* @__PURE__ */ jsx(Fragment, { children: title }) : /* @__PURE__ */ jsx(
835
+ Link,
836
+ {
837
+ onClick: item.data.open,
838
+ children: title
839
+ }
840
+ )
841
+ }
842
+ )
843
+ }
844
+ );
845
+ };
846
+ const UserTaskDefaultListCell = (_a) => {
847
+ var _b = _a, { column } = _b, props = __objRest(_b, ["column"]);
848
+ let Cell;
849
+ if (column.path === "id") {
850
+ Cell = SelectDefaultListCell;
851
+ } else if (column.path === "candidateUsers") {
852
+ Cell = CandidateUsersListCell;
853
+ } else if (column.path === "title") {
854
+ Cell = TitleDefaultListCell;
855
+ } else {
856
+ Cell = DefaultListCell;
857
+ }
858
+ return /* @__PURE__ */ jsx(
859
+ Cell,
860
+ __spreadValues({
861
+ column
862
+ }, props)
863
+ );
864
+ };
865
+ const ListOfTasks = ({
866
+ showLoadingIndicator,
867
+ useGuiSse,
868
+ useTasklistApi,
869
+ openTask,
870
+ navigateToWorkflow,
871
+ t,
872
+ currentLanguage,
873
+ defaultSort,
874
+ defaultSortAscending,
875
+ name,
876
+ columns,
877
+ children,
878
+ headerHeight = "3rem",
879
+ footer,
880
+ footerHeight = "2rem",
881
+ rowSeparator = true,
882
+ applyBackgroundColor = true,
883
+ showColumnHeaders = true,
884
+ excludeIdColumn = false,
885
+ columnHeader,
886
+ columnHeaderBackground = "dark-3",
887
+ columnHeaderSeparator
888
+ }) => {
889
+ const { isPhone, isTablet } = useResponsiveScreen();
890
+ const wakeupSseCallback = useRef(void 0);
891
+ const tasklistApi = useTasklistApi(wakeupSseCallback);
892
+ const [refreshIndicator, setRefreshIndicator] = useState(/* @__PURE__ */ new Date());
893
+ const updateListRef = useRef(void 0);
894
+ const updateList = useMemo(() => (ev) => __async(void 0, null, function* () {
895
+ if (!updateListRef.current)
896
+ return;
897
+ const listOfUpdatedTasks = ev.data.map((userTaskEvent) => userTaskEvent.event.id);
898
+ updateListRef.current(listOfUpdatedTasks);
899
+ }), [updateListRef]);
900
+ wakeupSseCallback.current = useGuiSse(
901
+ updateList,
902
+ /^UserTask$/
903
+ );
904
+ const refreshItemRef = useRef(void 0);
905
+ const mapToBcUserTask = (userTask) => {
906
+ return __spreadProps(__spreadValues({}, userTask), {
907
+ open: () => openTask(userTask),
908
+ navigateToWorkflow: () => navigateToWorkflow(userTask),
909
+ unassign: (userId) => unassign(userTask.id, userId)
910
+ });
911
+ };
912
+ const userTasks = useRef(void 0);
913
+ const [numberOfTasks, setNumberOfTasks] = useState(0);
914
+ const [modulesOfTasks, setModulesOfTasks] = useState(void 0);
915
+ const [languagesOfTitles, setLanguagesOfTitles] = useState([currentLanguage]);
916
+ const [definitionsOfTasks, setDefinitionsOfTasks] = useState(void 0);
917
+ useEffect(
918
+ () => {
919
+ const loadMetaInformation = () => __async(void 0, null, function* () {
920
+ const result = yield loadUserTasks(
921
+ tasklistApi,
922
+ setNumberOfTasks,
923
+ modulesOfTasks,
924
+ setModulesOfTasks,
925
+ definitionsOfTasks,
926
+ setDefinitionsOfTasks,
927
+ 20,
928
+ 0,
929
+ void 0,
930
+ void 0,
931
+ true,
932
+ mapToBcUserTask
933
+ );
934
+ const titleLanguages = result.items.flatMap((userTask) => Object.keys(userTask.title)).reduce((allLanguages, titleLanguage) => {
935
+ if (!allLanguages.includes(titleLanguage)) {
936
+ allLanguages.push(titleLanguage);
937
+ }
938
+ return allLanguages;
939
+ }, new Array(currentLanguage));
940
+ setLanguagesOfTitles(titleLanguages);
941
+ });
942
+ if (userTasks.current === void 0) {
943
+ showLoadingIndicator(true);
944
+ loadMetaInformation();
945
+ }
946
+ },
947
+ // tasklistApi is not part of dependency because it changes one time but this is irrelevant to the
948
+ // purpose of preloading modules used by usertasks
949
+ [userTasks, setNumberOfTasks, setModulesOfTasks, setDefinitionsOfTasks, showLoadingIndicator, refreshIndicator, setLanguagesOfTitles]
950
+ );
951
+ const [columnsOfTasks, setColumnsOfTasks] = useState(void 0);
952
+ const modules = useFederationModules(modulesOfTasks, "UserTaskList");
953
+ useEffect(() => {
954
+ if (modules === void 0) {
955
+ return;
956
+ }
957
+ if (definitionsOfTasks === void 0) {
958
+ return;
959
+ }
960
+ const totalColumns = Object.keys(definitionsOfTasks).map((definition) => definitionsOfTasks[definition]).map((definition) => {
961
+ const columnsOfProcess = modules.filter((m) => m !== void 0).filter((m) => m.workflowModuleId === definition.workflowModuleId).filter((m) => m.userTaskListColumns !== void 0).map((m) => m.userTaskListColumns(definition));
962
+ if (columnsOfProcess.length === 0)
963
+ return void 0;
964
+ return columnsOfProcess[0];
965
+ }).filter((columnsOfTask) => columnsOfTask !== void 0).reduce((totalColumns2, columnsOfTask) => {
966
+ columnsOfTask.forEach((column) => {
967
+ totalColumns2[column.path] = column;
968
+ });
969
+ return totalColumns2;
970
+ }, {});
971
+ if (totalColumns.id === void 0 && !excludeIdColumn) {
972
+ totalColumns.id = {
973
+ title: { [currentLanguage]: "id" },
974
+ path: "id",
975
+ width: "2.2rem",
976
+ priority: -1,
977
+ show: true,
978
+ sortable: false,
979
+ filterable: false,
980
+ resizeable: false
981
+ };
982
+ }
983
+ if (totalColumns.title === void 0) {
984
+ totalColumns.title = {
985
+ title: { [currentLanguage]: t("column_title") },
986
+ path: "title",
987
+ width: "",
988
+ priority: 0,
989
+ show: true,
990
+ sortable: true,
991
+ filterable: true,
992
+ resizeable: true
993
+ };
994
+ }
995
+ if (totalColumns.assignee === void 0) {
996
+ totalColumns.assignee = {
997
+ path: "assignee",
998
+ show: true,
999
+ sortable: false,
1000
+ filterable: false,
1001
+ title: { [currentLanguage]: t("column_assignee") },
1002
+ width: "10rem",
1003
+ resizeable: true,
1004
+ priority: 1
1005
+ };
1006
+ }
1007
+ if (totalColumns.candidateUsers === void 0) {
1008
+ totalColumns.candidateUsers = {
1009
+ path: "candidateUsers",
1010
+ show: true,
1011
+ sortable: false,
1012
+ filterable: false,
1013
+ title: { [currentLanguage]: t("column_candidateUsers") },
1014
+ width: "3rem",
1015
+ resizeable: false,
1016
+ priority: 2
1017
+ };
1018
+ }
1019
+ const existingColumnsSignature = columnsOfTasks === void 0 ? " " : columnsOfTasks.map((c) => c.path).join("|");
1020
+ const columnsToShow = Object.values(totalColumns).sort((a, b) => a.priority - b.priority);
1021
+ const newColumnsSignature = columnsToShow.map((c) => c.path).join("|");
1022
+ if (existingColumnsSignature === newColumnsSignature) {
1023
+ return;
1024
+ }
1025
+ setColumnsOfTasks(columnsToShow);
1026
+ }, [modules, definitionsOfTasks, columnsOfTasks, setColumnsOfTasks, refreshIndicator]);
1027
+ const [allSelected, setAllSelected] = useState(false);
1028
+ const [anySelected, setAnySelected] = useState(false);
1029
+ const [refreshNecessary, setRefreshNecessary] = useState(false);
1030
+ const [effectiveSort, _setSort] = useState(defaultSort);
1031
+ const sort = (effectiveSort == null ? void 0 : effectiveSort.startsWith("title.")) ? "title" : effectiveSort;
1032
+ const [sortAscending, _setSortAscending] = useState(defaultSortAscending === void 0 ? true : defaultSortAscending);
1033
+ const refreshList = () => {
1034
+ userTasks.current = void 0;
1035
+ setRefreshNecessary(false);
1036
+ setColumnsOfTasks(void 0);
1037
+ setRefreshIndicator(/* @__PURE__ */ new Date());
1038
+ };
1039
+ const setSort = (column) => {
1040
+ if (column) {
1041
+ if (column.path === "title") {
1042
+ _setSort("title." + languagesOfTitles.join(",title."));
1043
+ } else {
1044
+ _setSort(column.path);
1045
+ }
1046
+ } else {
1047
+ _setSort(defaultSort);
1048
+ }
1049
+ _setSortAscending(defaultSortAscending === void 0 ? true : defaultSortAscending);
1050
+ refreshList();
1051
+ };
1052
+ const setSortAscending = (sortAscending2) => {
1053
+ _setSortAscending(sortAscending2);
1054
+ refreshList();
1055
+ };
1056
+ const unassign = (userTaskId, userId) => {
1057
+ tasklistApi.assignTask(userTaskId, userId, true);
1058
+ };
1059
+ const [columnWidthAdjustments, setColumnWidthAdjustments] = useState({});
1060
+ const getColumnSize = (column) => {
1061
+ return !column.resizeable ? column.width : column.width !== "" ? `max(4rem, calc(${column.width} + ${columnWidthAdjustments[column.path] ? columnWidthAdjustments[column.path] : 0}px))` : columnWidthAdjustments[column.path] ? `${columnWidthAdjustments[column.path]}px` : void 0;
1062
+ };
1063
+ const setColumnWidthAdjustment = (column, adjustment) => {
1064
+ if (column.width === "") {
1065
+ column.width = `${adjustment}px`;
1066
+ return;
1067
+ }
1068
+ const current = columnWidthAdjustments[column.path];
1069
+ if (current === adjustment)
1070
+ return;
1071
+ setColumnWidthAdjustments(__spreadProps(__spreadValues({}, columnWidthAdjustments), { [column.path]: adjustment }));
1072
+ };
1073
+ const selectAll = (select) => {
1074
+ refreshItemRef.current(
1075
+ userTasks.current.reduce((allItemIds, item) => {
1076
+ item.selected = select;
1077
+ allItemIds.push(item.id);
1078
+ return allItemIds;
1079
+ }, new Array())
1080
+ );
1081
+ setAllSelected(select);
1082
+ if (anySelected !== select) {
1083
+ setAnySelected(select);
1084
+ }
1085
+ };
1086
+ const selectItem = (item, select) => {
1087
+ item.selected = select;
1088
+ refreshItemRef.current([item.id]);
1089
+ const currentlyAllSelected = userTasks.current.reduce((allSelected2, userTask) => allSelected2 && userTask.selected, true);
1090
+ if (currentlyAllSelected !== allSelected) {
1091
+ setAllSelected(currentlyAllSelected);
1092
+ }
1093
+ const currentlyAnySelected = userTasks.current.reduce((anySelected2, userTask) => anySelected2 || userTask.selected, false);
1094
+ if (anySelected !== currentlyAnySelected) {
1095
+ setAnySelected(currentlyAnySelected);
1096
+ }
1097
+ };
1098
+ const columnsOfList = columnsOfTasks === void 0 ? [] : columnsOfTasks.filter((column) => column.show).filter((column) => columns === void 0 || columns.includes(column.path)).map((column, columnIndex, allColumns) => ({
1099
+ property: column.path,
1100
+ size: getColumnSize(column),
1101
+ plain: true,
1102
+ verticalAlign: "top",
1103
+ header: /* @__PURE__ */ jsx(
1104
+ ListColumnHeader,
1105
+ {
1106
+ t,
1107
+ currentLanguage,
1108
+ nameOfList: name,
1109
+ columnHeader,
1110
+ hasColumnWidthAdjustment: columnWidthAdjustments[column.path] !== void 0,
1111
+ setColumnWidthAdjustment,
1112
+ sort: sort === column.path,
1113
+ setSort,
1114
+ sortAscending,
1115
+ setSortAscending,
1116
+ column,
1117
+ columnIndex,
1118
+ numberOfAllColumns: allColumns.length,
1119
+ allSelected,
1120
+ selectAll
1121
+ }
1122
+ ),
1123
+ render: (item) => /* @__PURE__ */ jsx(
1124
+ ListCell,
1125
+ {
1126
+ modulesAvailable: modules,
1127
+ column,
1128
+ currentLanguage,
1129
+ nameOfList: name,
1130
+ typeOfItem: TypeOfItem.TaskList,
1131
+ showUnreadAsBold: true,
1132
+ t,
1133
+ item,
1134
+ selectItem,
1135
+ defaultListCell: UserTaskDefaultListCell
1136
+ }
1137
+ )
1138
+ }));
1139
+ const markAsRead = (unread) => {
1140
+ const read = unread ? void 0 : /* @__PURE__ */ new Date();
1141
+ const userTaskMarkedIds = userTasks.current.filter((userTask) => userTask.selected).map((userTask) => {
1142
+ userTask.read = read;
1143
+ userTask.selected = false;
1144
+ return userTask.id;
1145
+ }).reduce((userTaskIds, userTaskId) => {
1146
+ userTaskIds.push(userTaskId);
1147
+ return userTaskIds;
1148
+ }, new Array());
1149
+ refreshItemRef.current(userTaskMarkedIds);
1150
+ setAllSelected(false);
1151
+ setAnySelected(false);
1152
+ tasklistApi.markUserTasksAsRead(userTaskMarkedIds, unread);
1153
+ };
1154
+ const claim = (unclaim) => {
1155
+ const userTaskMarkedIds = userTasks.current.filter((userTask) => userTask.selected).map((userTask) => {
1156
+ userTask.selected = false;
1157
+ return userTask.id;
1158
+ }).reduce((userTaskIds, userTaskId) => {
1159
+ userTaskIds.push(userTaskId);
1160
+ return userTaskIds;
1161
+ }, new Array());
1162
+ refreshItemRef.current(userTaskMarkedIds);
1163
+ setAllSelected(false);
1164
+ setAnySelected(false);
1165
+ tasklistApi.claimTasks(userTaskMarkedIds, unclaim);
1166
+ };
1167
+ const assign = (userId) => {
1168
+ const userTaskMarkedIds = userTasks.current.filter((userTask) => userTask.selected).map((userTask) => {
1169
+ userTask.selected = false;
1170
+ return userTask.id;
1171
+ }).reduce((userTaskIds, userTaskId) => {
1172
+ userTaskIds.push(userTaskId);
1173
+ return userTaskIds;
1174
+ }, new Array());
1175
+ refreshItemRef.current(userTaskMarkedIds);
1176
+ setAllSelected(false);
1177
+ setAnySelected(false);
1178
+ tasklistApi.assignTasks(userTaskMarkedIds, userId);
1179
+ };
1180
+ const defaultFooter = () => /* @__PURE__ */ jsx(
1181
+ DefaultFooter,
1182
+ {
1183
+ isPhone,
1184
+ isTablet,
1185
+ numberOfTasks,
1186
+ t
1187
+ }
1188
+ );
1189
+ const defaultHeader = () => /* @__PURE__ */ jsx(
1190
+ DefaultHeader,
1191
+ {
1192
+ tasklistApi,
1193
+ t,
1194
+ refresh: refreshList,
1195
+ refreshDisabled: !refreshNecessary,
1196
+ markAsRead: () => markAsRead(false),
1197
+ markAsUnread: () => markAsRead(true),
1198
+ markAsReadDisabled: !anySelected,
1199
+ claimTasks: () => claim(false),
1200
+ unclaimTasks: () => claim(true),
1201
+ claimTasksDisabled: !anySelected,
1202
+ assignTasks: assign,
1203
+ assignDisabled: !anySelected
1204
+ }
1205
+ );
1206
+ const themeContext = useTheme();
1207
+ return /* @__PURE__ */ jsx(
1208
+ Grommet,
1209
+ {
1210
+ plain: true,
1211
+ style: { height: "100%", minHeight: "100%", maxHeight: "100%" },
1212
+ theme: themeContext,
1213
+ children: /* @__PURE__ */ jsxs(
1214
+ Grid,
1215
+ {
1216
+ rows: [headerHeight, "auto", footerHeight],
1217
+ fill: true,
1218
+ children: [
1219
+ children !== void 0 ? children(
1220
+ isPhone,
1221
+ isTablet,
1222
+ numberOfTasks,
1223
+ columnsOfTasks,
1224
+ sort,
1225
+ setSort,
1226
+ sortAscending,
1227
+ setSortAscending,
1228
+ selectAll,
1229
+ allSelected,
1230
+ refreshList,
1231
+ !refreshNecessary,
1232
+ () => markAsRead(false),
1233
+ () => markAsRead(true),
1234
+ !anySelected,
1235
+ () => claim(false),
1236
+ () => claim(true),
1237
+ !anySelected,
1238
+ assign,
1239
+ !anySelected
1240
+ ) : defaultHeader(),
1241
+ columnsOfTasks === void 0 ? /* @__PURE__ */ jsx(Box, {}, "list") : /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
1242
+ SearchableAndSortableUpdatingList,
1243
+ {
1244
+ rowSeparator,
1245
+ applyBackgroundColor,
1246
+ showLoadingIndicator,
1247
+ minWidthOfAutoColumn: minWidthOfTitleColumn,
1248
+ columns: columnsOfList,
1249
+ itemsRef: userTasks,
1250
+ showColumnHeaders,
1251
+ columnHeaderBackground,
1252
+ columnHeaderSeparator,
1253
+ updateListRef,
1254
+ refreshItemRef,
1255
+ refreshNecessaryCallback: () => setRefreshNecessary(true),
1256
+ retrieveItems: (pageNumber, pageSize, initialTimestamp) => __async(void 0, null, function* () {
1257
+ return (
1258
+ // @ts-ignore
1259
+ yield loadUserTasks(
1260
+ tasklistApi,
1261
+ setNumberOfTasks,
1262
+ modulesOfTasks,
1263
+ setModulesOfTasks,
1264
+ definitionsOfTasks,
1265
+ setDefinitionsOfTasks,
1266
+ pageSize,
1267
+ pageNumber,
1268
+ initialTimestamp,
1269
+ effectiveSort,
1270
+ sortAscending,
1271
+ mapToBcUserTask
1272
+ )
1273
+ );
1274
+ }),
1275
+ reloadItems: (numberOfItems, updatedItemsIds, initialTimestamp) => __async(void 0, null, function* () {
1276
+ return (
1277
+ // @ts-ignore
1278
+ yield reloadUserTasks(
1279
+ tasklistApi,
1280
+ setNumberOfTasks,
1281
+ modulesOfTasks,
1282
+ setModulesOfTasks,
1283
+ definitionsOfTasks,
1284
+ setDefinitionsOfTasks,
1285
+ numberOfItems,
1286
+ updatedItemsIds,
1287
+ initialTimestamp,
1288
+ effectiveSort,
1289
+ sortAscending,
1290
+ mapToBcUserTask
1291
+ )
1292
+ );
1293
+ })
1294
+ }
1295
+ ) }, "list"),
1296
+ footer !== void 0 ? footer(
1297
+ isPhone,
1298
+ isTablet,
1299
+ numberOfTasks,
1300
+ columnsOfTasks,
1301
+ sort,
1302
+ setSort,
1303
+ sortAscending,
1304
+ setSortAscending,
1305
+ selectAll,
1306
+ allSelected,
1307
+ refreshList,
1308
+ !refreshNecessary,
1309
+ () => markAsRead(false),
1310
+ () => markAsRead(true),
1311
+ !anySelected,
1312
+ () => claim(false),
1313
+ () => claim(true),
1314
+ !anySelected,
1315
+ assign,
1316
+ !anySelected
1317
+ ) : defaultFooter()
1318
+ ]
1319
+ },
1320
+ "grid"
1321
+ )
1322
+ }
1323
+ );
1324
+ };
1325
+ export {
1326
+ ListOfTasks
1327
+ };