@rkosafo/cai.components 0.0.73 → 0.0.74
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.
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
onItemChecked,
|
|
18
18
|
toggelImportant,
|
|
19
19
|
toggleFavorited,
|
|
20
|
-
onItemSelected
|
|
20
|
+
onItemSelected,
|
|
21
|
+
showCheckbox = true,
|
|
22
|
+
showMarkAsFavorite = true,
|
|
23
|
+
showMarkAsImportant = true
|
|
21
24
|
}: MailingMessageCardProps = $props();
|
|
22
25
|
|
|
23
26
|
function handleClik(e: any) {
|
|
@@ -41,31 +44,29 @@
|
|
|
41
44
|
</script>
|
|
42
45
|
|
|
43
46
|
<div
|
|
44
|
-
class:bg-blue-100={isChecked}
|
|
45
47
|
class:hover:bg-gray-200={!isChecked}
|
|
46
|
-
class
|
|
47
|
-
class:shadow={!isRead && !isChecked}
|
|
48
|
-
class:border={!isRead && !isChecked}
|
|
49
|
-
class:border-gray-300={!isRead && !isChecked}
|
|
50
|
-
class="flex items-center border-y px-2"
|
|
48
|
+
class="flex items-center border border-gray-300 bg-white px-2 shadow"
|
|
51
49
|
role="button"
|
|
52
50
|
tabindex="0"
|
|
53
51
|
onkeydown={handleClik}
|
|
54
52
|
onclick={handleClik}
|
|
55
53
|
>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
{#if showCheckbox}
|
|
55
|
+
<Checkbox
|
|
56
|
+
checked={isChecked}
|
|
57
|
+
class="cursor-pointer border-2 border-gray-400 transition-colors hover:ring-4 hover:ring-gray-400 focus:ring-0"
|
|
58
|
+
onchange={(e) => {
|
|
59
|
+
const target = e.target;
|
|
60
|
+
onItemChecked?.({ checked: target.checked, id });
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
{/if}
|
|
64
64
|
<div class="my-1 flex w-full cursor-pointer items-center justify-between p-1">
|
|
65
65
|
<div class="flex w-full items-center">
|
|
66
66
|
<div class="flex">
|
|
67
67
|
<div class="mr-4 flex items-center gap-1 space-x-1">
|
|
68
68
|
<button
|
|
69
|
+
class:hidden={!showMarkAsFavorite}
|
|
69
70
|
onclick={(e) => {
|
|
70
71
|
toggleFavorited?.(id);
|
|
71
72
|
}}
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
/>
|
|
81
82
|
</button>
|
|
82
83
|
<button
|
|
84
|
+
class:hidden={!showMarkAsImportant}
|
|
83
85
|
onclick={(e) => {
|
|
84
86
|
toggelImportant?.(id);
|
|
85
87
|
}}
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
showFavoriteButton = true,
|
|
32
32
|
showMarkAsSpamButton = true,
|
|
33
33
|
showReplies = true,
|
|
34
|
+
showMarkAsImportantButton = true,
|
|
34
35
|
readInbox = $bindable((skip?: number, take?: number, filter?: TableFilter<any>) => {
|
|
35
36
|
return null;
|
|
36
37
|
}),
|
|
@@ -415,6 +416,8 @@
|
|
|
415
416
|
<MailingMessageCard
|
|
416
417
|
{...message}
|
|
417
418
|
onItemChecked={handleItemChecked}
|
|
419
|
+
showMarkAsFavorite={showFavoriteButton}
|
|
420
|
+
showMarkAsImportant={showMarkAsImportantButton}
|
|
418
421
|
toggleFavorited={() => {
|
|
419
422
|
selectedMessages = [message.id];
|
|
420
423
|
handleMarkAsFavorite(message.isStared ? 'unfavorite' : 'favorite');
|
|
@@ -62,6 +62,7 @@ export interface MailingModuleProps {
|
|
|
62
62
|
showMarkReadButton?: boolean;
|
|
63
63
|
showFavoriteButton?: boolean;
|
|
64
64
|
showMarkAsSpamButton?: boolean;
|
|
65
|
+
showMarkAsImportantButton?: boolean;
|
|
65
66
|
readInbox: (skip?: number, take?: number, filter?: TableFilter<any>) => Promise<PaginatedResult<MailingMessage>> | PaginatedResult<MailingMessage> | null;
|
|
66
67
|
readOutbox?: (skip?: number, take?: number, filter?: TableFilter<any>) => Promise<PaginatedResult<MailingMessage>> | PaginatedResult<MailingMessage> | null;
|
|
67
68
|
toggleArchieve?: (id: string | number) => Promise<CrudResult<any>> | CrudResult<any> | null;
|
|
@@ -104,6 +105,9 @@ export interface MailingMessageCardProps extends MailingMessage {
|
|
|
104
105
|
onItemChecked?: (val: MailingMessageCardChecked) => void;
|
|
105
106
|
toggelImportant?: (id: number) => void;
|
|
106
107
|
toggleFavorited?: (id: number) => void;
|
|
108
|
+
showMarkAsImportant?: boolean;
|
|
109
|
+
showMarkAsFavorite?: boolean;
|
|
110
|
+
showCheckbox?: boolean;
|
|
107
111
|
}
|
|
108
112
|
export type MailingActiveBox = 'inbox' | 'outbox';
|
|
109
113
|
export interface MailingMessageViewerProps {
|