@agentpaid/paid-nextjs-client 0.3.0-test.2 → 0.3.1
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/README.md +184 -79
- package/dist/api/api/handleBlocks.ts +144 -0
- package/dist/api/handleBlocks.d.ts +9 -0
- package/dist/api/handleBlocks.d.ts.map +1 -0
- package/dist/api/handleBlocks.js +107 -0
- package/dist/api/handleBlocks.js.map +1 -0
- package/dist/components/PaidActivityLog.d.ts +13 -26
- package/dist/components/PaidActivityLog.d.ts.map +1 -1
- package/dist/components/PaidActivityLog.js +70 -26
- package/dist/components/PaidActivityLog.js.map +1 -1
- package/dist/components/PaidContainer.d.ts +11 -24
- package/dist/components/PaidContainer.d.ts.map +1 -1
- package/dist/components/PaidContainer.js +18 -9
- package/dist/components/PaidContainer.js.map +1 -1
- package/dist/components/PaidInvoiceTable.d.ts +12 -25
- package/dist/components/PaidInvoiceTable.d.ts.map +1 -1
- package/dist/components/PaidInvoiceTable.js +78 -30
- package/dist/components/PaidInvoiceTable.js.map +1 -1
- package/dist/components/PaidPaymentsTable.d.ts +12 -25
- package/dist/components/PaidPaymentsTable.d.ts.map +1 -1
- package/dist/components/PaidPaymentsTable.js +63 -29
- package/dist/components/PaidPaymentsTable.js.map +1 -1
- package/dist/components/components/PaidActivityLog.js +115 -58
- package/dist/components/components/PaidContainer.js +42 -32
- package/dist/components/components/PaidInvoiceTable.js +126 -89
- package/dist/components/components/PaidPaymentsTable.js +111 -72
- package/dist/components/components/ui/Pagination.js +168 -0
- package/dist/components/ui/Pagination.d.ts +10 -0
- package/dist/components/ui/Pagination.d.ts.map +1 -0
- package/dist/components/ui/Pagination.js +111 -0
- package/dist/components/ui/Pagination.js.map +1 -0
- package/dist/hooks/useCache.d.ts +2 -2
- package/dist/hooks/useCache.d.ts.map +1 -1
- package/dist/hooks/useCache.js +10 -17
- package/dist/hooks/useCache.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/styles/paid-activity-log.css +154 -0
- package/dist/styles/paid-container.css +25 -16
- package/dist/styles/paid-invoice-table.css +135 -120
- package/dist/styles/paid-payments-table.css +65 -109
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/apiClient.d.ts +17 -0
- package/dist/utils/apiClient.d.ts.map +1 -0
- package/dist/utils/apiClient.js +60 -0
- package/dist/utils/apiClient.js.map +1 -0
- package/dist/utils/cache.js +1 -1
- package/dist/utils/cache.js.map +1 -1
- package/package.json +1 -1
- package/dist/api/api/handlePaidInvoicePdf.ts +0 -79
- package/dist/api/api/handlePaidInvoices.ts +0 -77
- package/dist/api/api/handlePaidPayments.ts +0 -77
- package/dist/api/api/handlePaidUsage.ts +0 -52
- package/dist/api/handlePaidInvoicePdf.d.ts +0 -6
- package/dist/api/handlePaidInvoicePdf.d.ts.map +0 -1
- package/dist/api/handlePaidInvoicePdf.js +0 -60
- package/dist/api/handlePaidInvoicePdf.js.map +0 -1
- package/dist/api/handlePaidInvoices.d.ts +0 -6
- package/dist/api/handlePaidInvoices.d.ts.map +0 -1
- package/dist/api/handlePaidInvoices.js +0 -56
- package/dist/api/handlePaidInvoices.js.map +0 -1
- package/dist/api/handlePaidPayments.d.ts +0 -6
- package/dist/api/handlePaidPayments.d.ts.map +0 -1
- package/dist/api/handlePaidPayments.js +0 -56
- package/dist/api/handlePaidPayments.js.map +0 -1
- package/dist/api/handlePaidUsage.d.ts +0 -6
- package/dist/api/handlePaidUsage.d.ts.map +0 -1
- package/dist/api/handlePaidUsage.js +0 -35
- package/dist/api/handlePaidUsage.js.map +0 -1
- package/dist/styles/activity-log-table.css +0 -138
@@ -0,0 +1,168 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
interface PaginationProps {
|
4
|
+
currentPage: number;
|
5
|
+
totalPages: number;
|
6
|
+
onPageChange: (page: number) => void;
|
7
|
+
className?: string;
|
8
|
+
}
|
9
|
+
|
10
|
+
export const Pagination: React.FC<PaginationProps> = ({
|
11
|
+
currentPage,
|
12
|
+
totalPages,
|
13
|
+
onPageChange,
|
14
|
+
className = ''
|
15
|
+
}) => {
|
16
|
+
if (totalPages <= 1) return null;
|
17
|
+
|
18
|
+
const getVisiblePages = () => {
|
19
|
+
const pages: (number | string)[] = [];
|
20
|
+
const maxVisible = 5;
|
21
|
+
|
22
|
+
if (totalPages <= maxVisible) {
|
23
|
+
// Show all pages if total is small
|
24
|
+
for (let i = 1; i <= totalPages; i++) {
|
25
|
+
pages.push(i);
|
26
|
+
}
|
27
|
+
} else {
|
28
|
+
// Always show first page
|
29
|
+
pages.push(1);
|
30
|
+
|
31
|
+
if (currentPage > 3) {
|
32
|
+
pages.push('...');
|
33
|
+
}
|
34
|
+
|
35
|
+
// Show pages around current page
|
36
|
+
const start = Math.max(2, currentPage - 1);
|
37
|
+
const end = Math.min(totalPages - 1, currentPage + 1);
|
38
|
+
|
39
|
+
for (let i = start; i <= end; i++) {
|
40
|
+
if (i !== 1 && i !== totalPages) {
|
41
|
+
pages.push(i);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
if (currentPage < totalPages - 2) {
|
46
|
+
pages.push('...');
|
47
|
+
}
|
48
|
+
|
49
|
+
// Always show last page
|
50
|
+
if (totalPages > 1) {
|
51
|
+
pages.push(totalPages);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
return pages;
|
56
|
+
};
|
57
|
+
|
58
|
+
const visiblePages = getVisiblePages();
|
59
|
+
|
60
|
+
return (
|
61
|
+
<>
|
62
|
+
<style>{`
|
63
|
+
.paid-pagination-btn {
|
64
|
+
padding: 6px 12px;
|
65
|
+
border: 1px solid #E5E7EB;
|
66
|
+
background-color: var(--paid-button-bg-color, #FFFFFF) !important;
|
67
|
+
color: var(--paid-primary-color, #374151) !important;
|
68
|
+
border-radius: 6px;
|
69
|
+
cursor: pointer;
|
70
|
+
fontSize: 13px;
|
71
|
+
font-weight: 500;
|
72
|
+
transition: all 0.15s ease;
|
73
|
+
outline: none !important;
|
74
|
+
user-select: none;
|
75
|
+
-webkit-appearance: none !important;
|
76
|
+
-moz-appearance: none !important;
|
77
|
+
appearance: none !important;
|
78
|
+
box-shadow: none !important;
|
79
|
+
}
|
80
|
+
|
81
|
+
.paid-pagination-btn:hover:not(:disabled) {
|
82
|
+
filter: brightness(0.9) !important;
|
83
|
+
transform: translateY(-1px) !important;
|
84
|
+
background-color: var(--paid-button-bg-color, #FFFFFF) !important;
|
85
|
+
}
|
86
|
+
|
87
|
+
.paid-pagination-btn:active:not(:disabled) {
|
88
|
+
filter: brightness(0.8) !important;
|
89
|
+
transform: translateY(0px) !important;
|
90
|
+
background-color: var(--paid-button-bg-color, #FFFFFF) !important;
|
91
|
+
}
|
92
|
+
|
93
|
+
.paid-pagination-btn:focus:not(:disabled) {
|
94
|
+
filter: brightness(0.9) !important;
|
95
|
+
background-color: var(--paid-button-bg-color, #FFFFFF) !important;
|
96
|
+
box-shadow: none !important;
|
97
|
+
outline: none !important;
|
98
|
+
}
|
99
|
+
|
100
|
+
.paid-pagination-btn:disabled {
|
101
|
+
background-color: var(--paid-button-bg-color, #F9FAFB) !important;
|
102
|
+
color: #9CA3AF !important;
|
103
|
+
cursor: not-allowed;
|
104
|
+
opacity: 0.6;
|
105
|
+
}
|
106
|
+
|
107
|
+
.paid-pagination-btn.current-page {
|
108
|
+
background-color: #F3F4F6 !important;
|
109
|
+
color: var(--paid-primary-color, #111827) !important;
|
110
|
+
font-weight: 600;
|
111
|
+
}
|
112
|
+
|
113
|
+
.paid-pagination-btn.page-number {
|
114
|
+
padding: 6px 10px;
|
115
|
+
min-width: 32px;
|
116
|
+
}
|
117
|
+
`}</style>
|
118
|
+
<div className={`pagination-container ${className}`} style={{
|
119
|
+
display: 'flex',
|
120
|
+
alignItems: 'center',
|
121
|
+
justifyContent: 'flex-end',
|
122
|
+
gap: '6px',
|
123
|
+
padding: '16px 24px',
|
124
|
+
fontSize: '13px',
|
125
|
+
fontFamily: 'inherit',
|
126
|
+
width: '100%',
|
127
|
+
boxSizing: 'border-box'
|
128
|
+
}}>
|
129
|
+
<button
|
130
|
+
onClick={() => onPageChange(currentPage - 1)}
|
131
|
+
disabled={currentPage === 1}
|
132
|
+
className="paid-pagination-btn"
|
133
|
+
>
|
134
|
+
Previous
|
135
|
+
</button>
|
136
|
+
|
137
|
+
{visiblePages.map((page, index) => (
|
138
|
+
<React.Fragment key={index}>
|
139
|
+
{page === '...' ? (
|
140
|
+
<span style={{
|
141
|
+
padding: '6px 4px',
|
142
|
+
color: '#9CA3AF',
|
143
|
+
fontSize: '13px'
|
144
|
+
}}>
|
145
|
+
...
|
146
|
+
</span>
|
147
|
+
) : (
|
148
|
+
<button
|
149
|
+
onClick={() => onPageChange(page as number)}
|
150
|
+
className={`paid-pagination-btn page-number ${currentPage === page ? 'current-page' : ''}`}
|
151
|
+
>
|
152
|
+
{page}
|
153
|
+
</button>
|
154
|
+
)}
|
155
|
+
</React.Fragment>
|
156
|
+
))}
|
157
|
+
|
158
|
+
<button
|
159
|
+
onClick={() => onPageChange(currentPage + 1)}
|
160
|
+
disabled={currentPage === totalPages}
|
161
|
+
className="paid-pagination-btn"
|
162
|
+
>
|
163
|
+
Next
|
164
|
+
</button>
|
165
|
+
</div>
|
166
|
+
</>
|
167
|
+
);
|
168
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
interface PaginationProps {
|
3
|
+
currentPage: number;
|
4
|
+
totalPages: number;
|
5
|
+
onPageChange: (page: number) => void;
|
6
|
+
className?: string;
|
7
|
+
}
|
8
|
+
export declare const Pagination: React.FC<PaginationProps>;
|
9
|
+
export {};
|
10
|
+
//# sourceMappingURL=Pagination.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,eAAe;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8JhD,CAAC"}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
3
|
+
export const Pagination = ({ currentPage, totalPages, onPageChange, className = '' }) => {
|
4
|
+
if (totalPages <= 1)
|
5
|
+
return null;
|
6
|
+
const getVisiblePages = () => {
|
7
|
+
const pages = [];
|
8
|
+
const maxVisible = 5;
|
9
|
+
if (totalPages <= maxVisible) {
|
10
|
+
// Show all pages if total is small
|
11
|
+
for (let i = 1; i <= totalPages; i++) {
|
12
|
+
pages.push(i);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
else {
|
16
|
+
// Always show first page
|
17
|
+
pages.push(1);
|
18
|
+
if (currentPage > 3) {
|
19
|
+
pages.push('...');
|
20
|
+
}
|
21
|
+
// Show pages around current page
|
22
|
+
const start = Math.max(2, currentPage - 1);
|
23
|
+
const end = Math.min(totalPages - 1, currentPage + 1);
|
24
|
+
for (let i = start; i <= end; i++) {
|
25
|
+
if (i !== 1 && i !== totalPages) {
|
26
|
+
pages.push(i);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
if (currentPage < totalPages - 2) {
|
30
|
+
pages.push('...');
|
31
|
+
}
|
32
|
+
// Always show last page
|
33
|
+
if (totalPages > 1) {
|
34
|
+
pages.push(totalPages);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
return pages;
|
38
|
+
};
|
39
|
+
const visiblePages = getVisiblePages();
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { children: `
|
41
|
+
.paid-pagination-btn {
|
42
|
+
padding: 6px 12px;
|
43
|
+
border: 1px solid #E5E7EB;
|
44
|
+
background-color: var(--paid-button-bg-color, #FFFFFF) !important;
|
45
|
+
color: var(--paid-primary-color, #374151) !important;
|
46
|
+
border-radius: 6px;
|
47
|
+
cursor: pointer;
|
48
|
+
fontSize: 13px;
|
49
|
+
font-weight: 500;
|
50
|
+
transition: all 0.15s ease;
|
51
|
+
outline: none !important;
|
52
|
+
user-select: none;
|
53
|
+
-webkit-appearance: none !important;
|
54
|
+
-moz-appearance: none !important;
|
55
|
+
appearance: none !important;
|
56
|
+
box-shadow: none !important;
|
57
|
+
}
|
58
|
+
|
59
|
+
.paid-pagination-btn:hover:not(:disabled) {
|
60
|
+
filter: brightness(0.9) !important;
|
61
|
+
transform: translateY(-1px) !important;
|
62
|
+
background-color: var(--paid-button-bg-color, #FFFFFF) !important;
|
63
|
+
}
|
64
|
+
|
65
|
+
.paid-pagination-btn:active:not(:disabled) {
|
66
|
+
filter: brightness(0.8) !important;
|
67
|
+
transform: translateY(0px) !important;
|
68
|
+
background-color: var(--paid-button-bg-color, #FFFFFF) !important;
|
69
|
+
}
|
70
|
+
|
71
|
+
.paid-pagination-btn:focus:not(:disabled) {
|
72
|
+
filter: brightness(0.9) !important;
|
73
|
+
background-color: var(--paid-button-bg-color, #FFFFFF) !important;
|
74
|
+
box-shadow: none !important;
|
75
|
+
outline: none !important;
|
76
|
+
}
|
77
|
+
|
78
|
+
.paid-pagination-btn:disabled {
|
79
|
+
background-color: var(--paid-button-bg-color, #F9FAFB) !important;
|
80
|
+
color: #9CA3AF !important;
|
81
|
+
cursor: not-allowed;
|
82
|
+
opacity: 0.6;
|
83
|
+
}
|
84
|
+
|
85
|
+
.paid-pagination-btn.current-page {
|
86
|
+
background-color: #F3F4F6 !important;
|
87
|
+
color: var(--paid-primary-color, #111827) !important;
|
88
|
+
font-weight: 600;
|
89
|
+
}
|
90
|
+
|
91
|
+
.paid-pagination-btn.page-number {
|
92
|
+
padding: 6px 10px;
|
93
|
+
min-width: 32px;
|
94
|
+
}
|
95
|
+
` }), _jsxs("div", { className: `pagination-container ${className}`, style: {
|
96
|
+
display: 'flex',
|
97
|
+
alignItems: 'center',
|
98
|
+
justifyContent: 'flex-end',
|
99
|
+
gap: '6px',
|
100
|
+
padding: '16px 24px',
|
101
|
+
fontSize: '13px',
|
102
|
+
fontFamily: 'inherit',
|
103
|
+
width: '100%',
|
104
|
+
boxSizing: 'border-box'
|
105
|
+
}, children: [_jsx("button", { onClick: () => onPageChange(currentPage - 1), disabled: currentPage === 1, className: "paid-pagination-btn", children: "Previous" }), visiblePages.map((page, index) => (_jsx(React.Fragment, { children: page === '...' ? (_jsx("span", { style: {
|
106
|
+
padding: '6px 4px',
|
107
|
+
color: '#9CA3AF',
|
108
|
+
fontSize: '13px'
|
109
|
+
}, children: "..." })) : (_jsx("button", { onClick: () => onPageChange(page), className: `paid-pagination-btn page-number ${currentPage === page ? 'current-page' : ''}`, children: page })) }, index))), _jsx("button", { onClick: () => onPageChange(currentPage + 1), disabled: currentPage === totalPages, className: "paid-pagination-btn", children: "Next" })] })] }));
|
110
|
+
};
|
111
|
+
//# sourceMappingURL=Pagination.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../../src/components/ui/Pagination.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EAClD,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,GAAG,EAAE,EACjB,EAAE,EAAE;IACD,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,eAAe,GAAG,GAAG,EAAE;QACzB,MAAM,KAAK,GAAwB,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,CAAC,CAAC;QAErB,IAAI,UAAU,IAAI,UAAU,EAAE,CAAC;YAC3B,mCAA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;
|
3
|
-
|
3
|
+
clearCustomerCache: (customerId: string) => void;
|
4
4
|
clearInvoicePdfCache: (invoiceId: string) => void;
|
5
|
-
|
5
|
+
refreshCustomerData: (customerId: string) => void;
|
6
6
|
getCacheStats: () => {
|
7
7
|
size: number;
|
8
8
|
keys: string[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCache.d.ts","sourceRoot":"","sources":["../../src/hooks/useCache.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;
|
1
|
+
{"version":3,"file":"useCache.d.ts","sourceRoot":"","sources":["../../src/hooks/useCache.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;qCAKiC,MAAM;sCAML,MAAM;sCAIN,MAAM;;;;;oBAWxB,MAAM;CAY1C,CAAC"}
|
package/dist/hooks/useCache.js
CHANGED
@@ -1,41 +1,34 @@
|
|
1
1
|
import { useCallback } from 'react';
|
2
2
|
import { dataCache, getCacheKey } from '../utils/cache';
|
3
3
|
export const useCache = () => {
|
4
|
-
// Clear all cache
|
5
4
|
const clearAllCache = useCallback(() => {
|
6
5
|
dataCache.clear();
|
7
6
|
}, []);
|
8
|
-
|
9
|
-
|
10
|
-
dataCache.delete(getCacheKey.
|
11
|
-
dataCache.delete(getCacheKey.
|
12
|
-
dataCache.delete(getCacheKey.usage(accountId));
|
7
|
+
const clearCustomerCache = useCallback((customerId) => {
|
8
|
+
dataCache.delete(getCacheKey.invoices(customerId));
|
9
|
+
dataCache.delete(getCacheKey.payments(customerId));
|
10
|
+
dataCache.delete(getCacheKey.usage(customerId));
|
13
11
|
}, []);
|
14
|
-
// Clear PDF cache for specific invoice
|
15
12
|
const clearInvoicePdfCache = useCallback((invoiceId) => {
|
16
13
|
dataCache.delete(getCacheKey.invoicePdf(invoiceId));
|
17
14
|
}, []);
|
18
|
-
|
19
|
-
|
20
|
-
clearAccountCache(accountId);
|
21
|
-
// Trigger a custom event that components can listen to for refetching
|
15
|
+
const refreshCustomerData = useCallback((customerId) => {
|
16
|
+
clearCustomerCache(customerId);
|
22
17
|
window.dispatchEvent(new CustomEvent('cache-refresh', {
|
23
|
-
detail: {
|
18
|
+
detail: { customerId, type: 'customer' }
|
24
19
|
}));
|
25
|
-
}, [
|
26
|
-
// Get cache statistics
|
20
|
+
}, [clearCustomerCache]);
|
27
21
|
const getCacheStats = useCallback(() => {
|
28
22
|
return dataCache.getStats();
|
29
23
|
}, []);
|
30
|
-
// Check if data is cached
|
31
24
|
const isCached = useCallback((key) => {
|
32
25
|
return dataCache.has(key);
|
33
26
|
}, []);
|
34
27
|
return {
|
35
28
|
clearAllCache,
|
36
|
-
|
29
|
+
clearCustomerCache,
|
37
30
|
clearInvoicePdfCache,
|
38
|
-
|
31
|
+
refreshCustomerData,
|
39
32
|
getCacheStats,
|
40
33
|
isCached,
|
41
34
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCache.js","sourceRoot":"","sources":["../../src/hooks/useCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,
|
1
|
+
{"version":3,"file":"useCache.js","sourceRoot":"","sources":["../../src/hooks/useCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,SAAS,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,kBAAkB,GAAG,WAAW,CAAC,CAAC,UAAkB,EAAE,EAAE;QAC5D,SAAS,CAAC,MAAM,C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Table } from './components/PaidInvoiceTable';
|
4
4
|
export { PaidPaymentsTable } from './components/PaidPaymentsTable';
|
5
5
|
export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './components/ui/table';
|
6
|
-
export {
|
7
|
-
export {
|
8
|
-
export {
|
9
|
-
export {
|
6
|
+
export { handleBlocks } from './api/handleBlocks';
|
7
|
+
export { fetchPaidData } from './utils/apiClient';
|
8
|
+
export { Pagination } from './components/ui/Pagination';
|
9
|
+
export { useCache } from './hooks/useCache';
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
@@ -3,7 +3,7 @@ export { PaidContainer, useIsInContainer } from './components/PaidContainer';
|
|
3
3
|
export { PaidInvoiceTable } from './components/PaidInvoiceTable';
|
4
4
|
export { PaidPaymentsTable } from './components/PaidPaymentsTable';
|
5
5
|
export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './components/ui/table';
|
6
|
-
export {
|
7
|
-
export {
|
8
|
-
export {
|
9
|
-
export {
|
6
|
+
export { handleBlocks } from './api/handleBlocks';
|
7
|
+
export { fetchPaidData } from './utils/apiClient';
|
8
|
+
export { Pagination } from './components/ui/Pagination';
|
9
|
+
export { useCache } from './hooks/useCache';
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
|
@@ -0,0 +1,154 @@
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
|
2
|
+
|
3
|
+
/* Activity Log Table Styles */
|
4
|
+
.paid-activity-log-container {
|
5
|
+
position: relative;
|
6
|
+
min-width: 0;
|
7
|
+
font-family: var(--paid-font-family, 'Roboto');
|
8
|
+
width: 100%;
|
9
|
+
max-width: 100%;
|
10
|
+
overflow: hidden;
|
11
|
+
box-sizing: border-box;
|
12
|
+
}
|
13
|
+
|
14
|
+
.paid-activity-log-table-wrapper {
|
15
|
+
position: relative;
|
16
|
+
background: var(--paid-table-background-color, #ffffff);
|
17
|
+
border: 1px solid #e5e7eb;
|
18
|
+
border-radius: 12px;
|
19
|
+
box-shadow: 0 2px 16px 0 rgba(16, 24, 40, 0.08);
|
20
|
+
overflow-x: auto;
|
21
|
+
transition: box-shadow 0.2s;
|
22
|
+
font-family: var(--paid-font-family, 'Roboto');
|
23
|
+
width: 100%;
|
24
|
+
min-width: 0;
|
25
|
+
}
|
26
|
+
|
27
|
+
.paid-activity-log-table-wrapper:active {
|
28
|
+
box-shadow: 0 4px 24px 0 rgba(16, 24, 40, 0.16);
|
29
|
+
}
|
30
|
+
|
31
|
+
.paid-activity-log-header {
|
32
|
+
display: flex;
|
33
|
+
justify-content: space-between;
|
34
|
+
align-items: center;
|
35
|
+
padding: var(--paid-header-padding, 18px 24px);
|
36
|
+
background: var(--paid-container-background-color, #f8f9fa);
|
37
|
+
border-bottom: 1px solid #e5e7eb;
|
38
|
+
border-radius: 12px 12px 0 0;
|
39
|
+
font-family: var(--paid-font-family, 'Roboto');
|
40
|
+
}
|
41
|
+
|
42
|
+
.paid-activity-log-title {
|
43
|
+
margin: 0;
|
44
|
+
font-size: var(--paid-h3-font-size, 1.1rem);
|
45
|
+
font-weight: 600;
|
46
|
+
color: var(--paid-primary-color, #1d2939);
|
47
|
+
font-family: var(--paid-font-family, 'Roboto');
|
48
|
+
}
|
49
|
+
|
50
|
+
.paid-activity-log-table {
|
51
|
+
width: 100%;
|
52
|
+
min-width: 0;
|
53
|
+
table-layout: fixed;
|
54
|
+
word-break: break-word;
|
55
|
+
border-collapse: separate;
|
56
|
+
border-spacing: 0;
|
57
|
+
background: var(--paid-table-background-color, #ffffff);
|
58
|
+
font-family: var(--paid-font-family, 'Roboto');
|
59
|
+
max-width: 100%;
|
60
|
+
box-sizing: border-box;
|
61
|
+
}
|
62
|
+
|
63
|
+
.paid-activity-log-table th,
|
64
|
+
.paid-activity-log-table td {
|
65
|
+
padding: var(--paid-cell-padding, 8px 8px);
|
66
|
+
font-size: var(--paid-paragraph-font-size, 0.95rem);
|
67
|
+
white-space: normal;
|
68
|
+
word-break: break-word;
|
69
|
+
overflow: hidden;
|
70
|
+
text-overflow: ellipsis;
|
71
|
+
}
|
72
|
+
|
73
|
+
.paid-activity-log-table th {
|
74
|
+
font-size: var(--paid-paragraph-font-size, 1rem);
|
75
|
+
font-weight: 500;
|
76
|
+
color: var(--paid-table-header-color, var(--paid-secondary-color, #667085));
|
77
|
+
text-align: left;
|
78
|
+
padding: var(--paid-header-padding, 18px 24px);
|
79
|
+
background: var(--paid-table-header-background-color, #f9fafb);
|
80
|
+
border-bottom: 1px solid #e5e7eb;
|
81
|
+
}
|
82
|
+
|
83
|
+
.paid-activity-log-table td {
|
84
|
+
font-size: var(--paid-paragraph-font-size, 0.97rem);
|
85
|
+
font-weight: normal;
|
86
|
+
color: var(--paid-table-cell-color, var(--paid-primary-color, #1d2939));
|
87
|
+
background: transparent;
|
88
|
+
padding: var(--paid-cell-padding, 16px 24px);
|
89
|
+
border-bottom: 1px solid #f1f1f1;
|
90
|
+
vertical-align: middle;
|
91
|
+
}
|
92
|
+
|
93
|
+
.paid-activity-log-table tr:last-child td {
|
94
|
+
border-bottom: none;
|
95
|
+
}
|
96
|
+
|
97
|
+
.paid-activity-log-table tbody tr:hover td {
|
98
|
+
background: var(--paid-table-hover-color, #f3f4f6);
|
99
|
+
}
|
100
|
+
|
101
|
+
.paid-activity-log-table th,
|
102
|
+
.paid-activity-log-table td {
|
103
|
+
white-space: nowrap;
|
104
|
+
}
|
105
|
+
|
106
|
+
/* Empty State */
|
107
|
+
.paid-activity-log-empty {
|
108
|
+
text-align: center;
|
109
|
+
color: var(--paid-secondary-color, #98a2b3);
|
110
|
+
padding: 40px 0;
|
111
|
+
font-size: var(--paid-paragraph-font-size, 1rem);
|
112
|
+
}
|
113
|
+
|
114
|
+
/* Responsive Design */
|
115
|
+
@media (max-width: 768px) {
|
116
|
+
.paid-activity-log-table th,
|
117
|
+
.paid-activity-log-table td {
|
118
|
+
padding: var(--paid-cell-padding, 12px 16px);
|
119
|
+
font-size: var(--paid-paragraph-font-size, 0.8rem);
|
120
|
+
}
|
121
|
+
|
122
|
+
.paid-activity-log-table {
|
123
|
+
min-width: 600px;
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
/* Resize handles */
|
128
|
+
.paid-activity-log-resize-handle {
|
129
|
+
position: absolute;
|
130
|
+
width: 16px;
|
131
|
+
height: 16px;
|
132
|
+
z-index: 2;
|
133
|
+
}
|
134
|
+
.paid-activity-log-resize-handle-nw { top: 0; left: 0; cursor: nwse-resize; }
|
135
|
+
.paid-activity-log-resize-handle-ne { top: 0; right: 0; cursor: nesw-resize; }
|
136
|
+
.paid-activity-log-resize-handle-sw { bottom: 0; left: 0; cursor: nesw-resize; }
|
137
|
+
.paid-activity-log-resize-handle-se { bottom: 0; right: 0; cursor: nwse-resize; }
|
138
|
+
.paid-activity-log-resize-handle-n { top: 0; left: 16px; right: 16px; height: 8px; cursor: ns-resize; }
|
139
|
+
.paid-activity-log-resize-handle-s { bottom: 0; left: 16px; right: 16px; height: 8px; cursor: ns-resize; }
|
140
|
+
.paid-activity-log-resize-handle-w { left: 0; top: 16px; bottom: 16px; width: 8px; cursor: ew-resize; }
|
141
|
+
.paid-activity-log-resize-handle-e { right: 0; top: 16px; bottom: 16px; width: 8px; cursor: ew-resize; }
|
142
|
+
|
143
|
+
.paid-activity-log-resize-dot {
|
144
|
+
position: absolute;
|
145
|
+
width: 8px;
|
146
|
+
height: 8px;
|
147
|
+
background: #e5e7eb;
|
148
|
+
border-radius: 2px;
|
149
|
+
border: 2px solid #cbd5e1;
|
150
|
+
}
|
151
|
+
.paid-activity-log-resize-dot-nw { top: 2px; left: 2px; }
|
152
|
+
.paid-activity-log-resize-dot-ne { top: 2px; right: 2px; }
|
153
|
+
.paid-activity-log-resize-dot-sw { bottom: 2px; left: 2px; }
|
154
|
+
.paid-activity-log-resize-dot-se { bottom: 2px; right: 2px; }
|