@rkosafo/cai.components 0.0.73 → 0.0.75
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/dist/layout/mailing/MailingMessageCard.svelte +17 -15
- package/dist/layout/mailing/MailingModule.svelte +3 -0
- package/dist/layout/mailing/types.d.ts +4 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/ui/breadcrumb/Breadcrumb.svelte +14 -3
- package/dist/ui/table/Table.svelte +2 -0
- package/package.json +1 -1
|
@@ -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 {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -568,7 +568,7 @@ export interface TableSortInfo {
|
|
|
568
568
|
id: string;
|
|
569
569
|
order: 'asc' | 'desc';
|
|
570
570
|
}
|
|
571
|
-
export type TableColor = 'green' | 'orange' | 'white' | 'purple' | 'sky' | 'blue';
|
|
571
|
+
export type TableColor = 'green' | 'orange' | 'white' | 'purple' | 'sky' | 'blue' | 'red' | 'pink';
|
|
572
572
|
export type HeaderTextColor = 'black' | 'white' | 'gray';
|
|
573
573
|
export interface TableProps {
|
|
574
574
|
data?: any[];
|
|
@@ -810,6 +810,7 @@ export interface BreadcrumbProps {
|
|
|
810
810
|
options: IBreadcrumb[];
|
|
811
811
|
activeBreadCrumb: string;
|
|
812
812
|
onclik?: (val: IBreadcrumbClick) => void;
|
|
813
|
+
activeClass?: 'pink' | 'blue' | 'red' | 'indigo' | 'purple' | 'black' | 'amber' | 'orange';
|
|
813
814
|
}
|
|
814
815
|
export interface IBreadcrumbClick {
|
|
815
816
|
title: string;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { IconifyIcon, type BreadcrumbProps } from '../../index.js';
|
|
3
3
|
|
|
4
|
-
let {
|
|
4
|
+
let {
|
|
5
|
+
options = [],
|
|
6
|
+
activeBreadCrumb = '',
|
|
7
|
+
onclik,
|
|
8
|
+
activeClass = 'blue'
|
|
9
|
+
}: BreadcrumbProps = $props();
|
|
5
10
|
</script>
|
|
6
11
|
|
|
7
12
|
<ul class="flex items-center gap-1">
|
|
@@ -10,8 +15,14 @@
|
|
|
10
15
|
<button
|
|
11
16
|
onclick={() => onclik?.({ title, path, index })}
|
|
12
17
|
class="capitalize"
|
|
13
|
-
class:text-blue-500={activeBreadCrumb === title}
|
|
14
|
-
class:text-
|
|
18
|
+
class:text-blue-500={activeBreadCrumb === title && activeClass === 'blue'}
|
|
19
|
+
class:text-red-500={activeBreadCrumb === title && activeClass === 'red'}
|
|
20
|
+
class:text-pink-500={activeBreadCrumb === title && activeClass === 'pink'}
|
|
21
|
+
class:text-indigo-500={activeBreadCrumb === title && activeClass === 'indigo'}
|
|
22
|
+
class:text-purple-500={activeBreadCrumb === title && activeClass === 'purple'}
|
|
23
|
+
class:text-black={activeBreadCrumb === title && activeClass === 'black'}
|
|
24
|
+
class:text-amber-500={activeBreadCrumb === title && activeClass === 'amber'}
|
|
25
|
+
class:text-orange-500={activeBreadCrumb === title && activeClass === 'orange'}
|
|
15
26
|
class:hover:text-gray-400={activeBreadCrumb !== title}
|
|
16
27
|
class:cursor-default={activeBreadCrumb === title}>{title}</button
|
|
17
28
|
>
|
|
@@ -130,6 +130,8 @@
|
|
|
130
130
|
class:bg-[#CF9B14]={headerColor === 'orange'}
|
|
131
131
|
class:bg-[#cbc3fa]={headerColor === 'purple'}
|
|
132
132
|
class:bg-blue-300={headerColor === 'blue'}
|
|
133
|
+
class:bg-red-300={headerColor === 'red'}
|
|
134
|
+
class:bg-pink-300={headerColor === 'pink'}
|
|
133
135
|
class:bg-white={headerColor === 'white'}
|
|
134
136
|
class:text-gray-700={headerTextColor === 'gray'}
|
|
135
137
|
class:text-white={headerTextColor === 'white'}
|