warqadui 0.0.17 → 0.0.18
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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +45 -37
- package/dist/index.mjs +45 -37
- package/dist/styles.js +1 -1
- package/dist/styles.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -480,7 +480,7 @@ declare const useA4StatementView: ({ url, v, delay, params, }?: {
|
|
|
480
480
|
delay?: number;
|
|
481
481
|
params?: Record<string, any>;
|
|
482
482
|
}) => {
|
|
483
|
-
A4DataView: ({ columns, data, error, info, index, title, subtitle, printable, rowPadding, headers, }: {
|
|
483
|
+
A4DataView: ({ columns, data, error, info, index, title, subtitle, printable, rowPadding, verticalLines, headers, }: {
|
|
484
484
|
columns?: SimpleTableColumn<any>[];
|
|
485
485
|
data?: any[];
|
|
486
486
|
error?: string | null;
|
|
@@ -490,6 +490,7 @@ declare const useA4StatementView: ({ url, v, delay, params, }?: {
|
|
|
490
490
|
subtitle?: string;
|
|
491
491
|
printable?: boolean;
|
|
492
492
|
rowPadding?: string;
|
|
493
|
+
verticalLines?: boolean;
|
|
493
494
|
headers?: React.ReactNode;
|
|
494
495
|
}) => react_jsx_runtime.JSX.Element;
|
|
495
496
|
data: any;
|
package/dist/index.d.ts
CHANGED
|
@@ -480,7 +480,7 @@ declare const useA4StatementView: ({ url, v, delay, params, }?: {
|
|
|
480
480
|
delay?: number;
|
|
481
481
|
params?: Record<string, any>;
|
|
482
482
|
}) => {
|
|
483
|
-
A4DataView: ({ columns, data, error, info, index, title, subtitle, printable, rowPadding, headers, }: {
|
|
483
|
+
A4DataView: ({ columns, data, error, info, index, title, subtitle, printable, rowPadding, verticalLines, headers, }: {
|
|
484
484
|
columns?: SimpleTableColumn<any>[];
|
|
485
485
|
data?: any[];
|
|
486
486
|
error?: string | null;
|
|
@@ -490,6 +490,7 @@ declare const useA4StatementView: ({ url, v, delay, params, }?: {
|
|
|
490
490
|
subtitle?: string;
|
|
491
491
|
printable?: boolean;
|
|
492
492
|
rowPadding?: string;
|
|
493
|
+
verticalLines?: boolean;
|
|
493
494
|
headers?: React.ReactNode;
|
|
494
495
|
}) => react_jsx_runtime.JSX.Element;
|
|
495
496
|
data: any;
|
package/dist/index.js
CHANGED
|
@@ -171,7 +171,7 @@ var InfoGrid = ({
|
|
|
171
171
|
{
|
|
172
172
|
className: `grid ${colClasses[cols] || "grid-cols-3"} gap-4 p-4 bg-gray-50 rounded-lg border border-gray-100 ${className}`,
|
|
173
173
|
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
174
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "block text-
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "block text-xs uppercase font-bold text-gray-400 mb-1 tracking-wider text-left", children: item.label }),
|
|
175
175
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
176
176
|
"span",
|
|
177
177
|
{
|
|
@@ -233,7 +233,7 @@ var PageA4 = ({
|
|
|
233
233
|
width: `${A4_WIDTH_PX * scale}px`,
|
|
234
234
|
height: `${A4_HEIGHT_PX * scale}px`
|
|
235
235
|
},
|
|
236
|
-
className: "relative print:w-full! print:h-auto!
|
|
236
|
+
className: "relative a4-paper-wrapper print:w-full! print:h-auto!",
|
|
237
237
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
@@ -248,7 +248,7 @@ var PageA4 = ({
|
|
|
248
248
|
},
|
|
249
249
|
children: [
|
|
250
250
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-full flex-1 overflow-hidden pb-4", children }),
|
|
251
|
-
pageNumber !== void 0 && totalPages !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "w-full h-
|
|
251
|
+
pageNumber !== void 0 && totalPages !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "w-full h-14 flex items-center justify-center text-xs font-medium text-gray-500 print:text-black mt-auto shrink-0 border-t border-gray-100 dark:border-zinc-800/10 dark:text-gray-400", children: [
|
|
252
252
|
"Page ",
|
|
253
253
|
pageNumber,
|
|
254
254
|
" / ",
|
|
@@ -298,6 +298,10 @@ var PageA4 = ({
|
|
|
298
298
|
overflow: hidden !important; /* Prevent micro-spillover from text rounding! */
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
.a4-paper-wrapper {
|
|
302
|
+
min-height: 297mm !important;
|
|
303
|
+
}
|
|
304
|
+
|
|
301
305
|
.print-page-break {
|
|
302
306
|
page-break-after: always !important;
|
|
303
307
|
break-after: page !important;
|
|
@@ -457,7 +461,7 @@ var SidebarItem = ({
|
|
|
457
461
|
"w-full flex items-center py-2.5 rounded-xl text-sm font-medium transition-all duration-200",
|
|
458
462
|
isSidebarCollapsed ? "justify-center px-2" : "justify-between px-3",
|
|
459
463
|
!shouldHighlight || item.disabled ? "text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200" : "",
|
|
460
|
-
item.disabled && "opacity-50 cursor-not-allowed grayscale
|
|
464
|
+
item.disabled && "opacity-50 cursor-not-allowed grayscale"
|
|
461
465
|
),
|
|
462
466
|
style: shouldHighlight && !item.disabled ? {
|
|
463
467
|
backgroundColor: isDarkMode ? `${primaryColor}33` : `${primaryColor}1A`,
|
|
@@ -554,7 +558,7 @@ var SubItem = ({
|
|
|
554
558
|
className: cn(
|
|
555
559
|
"relative w-full flex items-center px-3 py-2 pl-6 rounded-lg text-sm transition-colors duration-200",
|
|
556
560
|
isActive && !isDisabled ? "font-medium" : "text-gray-500 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",
|
|
557
|
-
isDisabled && "opacity-50 cursor-not-allowed grayscale
|
|
561
|
+
isDisabled && "opacity-50 cursor-not-allowed grayscale"
|
|
558
562
|
),
|
|
559
563
|
style: isActive && !isDisabled ? {
|
|
560
564
|
backgroundColor: isDarkMode ? `${primaryColor}4D` : `${primaryColor}1A`,
|
|
@@ -697,7 +701,7 @@ var DashboardLayout = ({
|
|
|
697
701
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
698
702
|
"div",
|
|
699
703
|
{
|
|
700
|
-
className: "min-h-screen bg-gray-50 dark:bg-
|
|
704
|
+
className: "min-h-screen bg-gray-50 dark:bg-slate-950 text-slate-900 dark:text-slate-100 flex transition-colors duration-500 font-sans overflow-hidden",
|
|
701
705
|
style: { fontFamily },
|
|
702
706
|
children: [
|
|
703
707
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_framer_motion.AnimatePresence, { children: !isDesktop && isSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -837,7 +841,7 @@ var LoadingBox = () => {
|
|
|
837
841
|
var import_lucide_react3 = require("lucide-react");
|
|
838
842
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
839
843
|
var ClassicSpin = ({ msg = "Please wait..." }) => {
|
|
840
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute inset-0 z-50 flex flex-col items-center justify-center bg-white/30 dark:bg-zinc-900/30 backdrop-blur-
|
|
844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute inset-0 z-50 flex flex-col items-center justify-center bg-white/30 dark:bg-zinc-900/30 backdrop-blur-sm transition-all duration-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col items-center justify-center p-6 bg-white dark:bg-zinc-800 rounded-2xl shadow-2xl border border-gray-100 dark:border-zinc-700 animate-in zoom-in-95 duration-200", children: [
|
|
841
845
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
|
|
842
846
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute inset-0 bg-indigo-500 blur-lg opacity-20 animate-pulse" }),
|
|
843
847
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Loader2, { className: "h-8 w-8 animate-spin text-indigo-600 dark:text-indigo-400 relative z-10" })
|
|
@@ -848,7 +852,7 @@ var ClassicSpin = ({ msg = "Please wait..." }) => {
|
|
|
848
852
|
|
|
849
853
|
// src/components/spins/OverlaySpin.tsx
|
|
850
854
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
851
|
-
var OverlaySpin = ({ msg = "Processing..." }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute inset-0 bg-white/50 dark:bg-black/50 backdrop-blur-
|
|
855
|
+
var OverlaySpin = ({ msg = "Processing..." }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute inset-0 bg-white/50 dark:bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center rounded-xl transition-all duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col items-center gap-2 bg-white dark:bg-zinc-800 p-4 rounded-xl shadow-xl border border-gray-100 dark:border-zinc-700", children: [
|
|
852
856
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w-6 h-6 border-2 border-blue-600 border-t-transparent rounded-full animate-spin" }),
|
|
853
857
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium text-gray-500 animate-pulse", children: msg })
|
|
854
858
|
] }) });
|
|
@@ -921,7 +925,7 @@ var CodeBlock = ({
|
|
|
921
925
|
),
|
|
922
926
|
children: [
|
|
923
927
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between px-4 py-2 bg-gray-100 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-gray-800", children: [
|
|
924
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-
|
|
928
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-xs font-bold uppercase tracking-widest text-gray-400", children: language }),
|
|
925
929
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
926
930
|
"button",
|
|
927
931
|
{
|
|
@@ -1010,7 +1014,7 @@ var Modal = ({
|
|
|
1010
1014
|
isLoading = false,
|
|
1011
1015
|
width = 500
|
|
1012
1016
|
}) => {
|
|
1013
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_framer_motion2.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "fixed inset-0 z-
|
|
1017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_framer_motion2.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6", children: [
|
|
1014
1018
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1015
1019
|
import_framer_motion2.motion.div,
|
|
1016
1020
|
{
|
|
@@ -1028,8 +1032,8 @@ var Modal = ({
|
|
|
1028
1032
|
animate: { opacity: 1, scale: 1, y: 0 },
|
|
1029
1033
|
exit: { opacity: 0, scale: 0.95, y: 10 },
|
|
1030
1034
|
transition: { type: "spring", duration: 0.3 },
|
|
1031
|
-
style: { maxWidth: width },
|
|
1032
|
-
className: "w-full bg-white dark:bg-zinc-900 rounded-
|
|
1035
|
+
style: { maxWidth: width, maxHeight: "90vh" },
|
|
1036
|
+
className: "w-full bg-white dark:bg-zinc-900 rounded-3xl shadow-2xl border border-gray-200 dark:border-white/5 overflow-hidden relative z-10 flex flex-col",
|
|
1033
1037
|
children: [
|
|
1034
1038
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "px-8 py-5 border-b border-gray-100 dark:border-white/5 flex items-center justify-between bg-white/50 dark:bg-zinc-900/50 backdrop-blur-xl sticky top-0 z-20", children: [
|
|
1035
1039
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "text-xl font-bold text-gray-900 dark:text-white tracking-tight", children: title }),
|
|
@@ -1697,7 +1701,7 @@ var Textarea = (0, import_react11.forwardRef)(
|
|
|
1697
1701
|
setIsFocused(false);
|
|
1698
1702
|
onBlur?.(e);
|
|
1699
1703
|
},
|
|
1700
|
-
className: `block w-full px-2.5 py-1 rounded-xl border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-900/50 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-zinc-500 focus:bg-white dark:focus:bg-zinc-900 outline-none transition-all duration-200 border min-h-
|
|
1704
|
+
className: `block w-full px-2.5 py-1 rounded-xl border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-900/50 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-zinc-500 focus:bg-white dark:focus:bg-zinc-900 outline-none transition-all duration-200 border min-h-24 resize-none text-sm ${className}`,
|
|
1701
1705
|
style: {
|
|
1702
1706
|
borderColor: isFocused ? primaryColor : void 0,
|
|
1703
1707
|
boxShadow: isFocused ? `${primaryColor}33 0px 0px 0px 2px` : void 0
|
|
@@ -2240,7 +2244,7 @@ var SearchApiContent = ({
|
|
|
2240
2244
|
}
|
|
2241
2245
|
)
|
|
2242
2246
|
] }),
|
|
2243
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pr-2.5 w-
|
|
2247
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pr-2.5 w-16! flex items-center gap-1 shrink-0 min-w-10 justify-end", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Loader2, { className: "h-4 w-4 animate-spin text-blue-500 shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2244
2248
|
currentValue && !disabled && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2245
2249
|
"button",
|
|
2246
2250
|
{
|
|
@@ -2654,7 +2658,7 @@ function DataTable({
|
|
|
2654
2658
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("thead", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-zinc-800", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2655
2659
|
"th",
|
|
2656
2660
|
{
|
|
2657
|
-
className: `${rowPadding} text-
|
|
2661
|
+
className: `${rowPadding} text-sm font-semibold text-gray-900 dark:text-zinc-100 text-left ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${header.id === "_index" || header.id === "select" || header.id === "_select" ? "w-px whitespace-nowrap" : ""}`,
|
|
2658
2662
|
children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
|
|
2659
2663
|
header.column.columnDef.header,
|
|
2660
2664
|
header.getContext()
|
|
@@ -2695,7 +2699,7 @@ function DataTable({
|
|
|
2695
2699
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2696
2700
|
"td",
|
|
2697
2701
|
{
|
|
2698
|
-
className: `${rowPadding} text-sm text-gray-700 dark:text-gray-200 ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${cell.column.id === "_index" || cell.column.id === "select" || cell.column.id === "_select" ? "w-
|
|
2702
|
+
className: `${rowPadding} text-sm text-gray-700 dark:text-gray-200 ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${cell.column.id === "_index" || cell.column.id === "select" || cell.column.id === "_select" ? "w-px whitespace-nowrap" : ""}`,
|
|
2699
2703
|
children: (0, import_react_table.flexRender)(
|
|
2700
2704
|
cell.column.columnDef.cell,
|
|
2701
2705
|
cell.getContext()
|
|
@@ -2727,7 +2731,7 @@ function DataTable({
|
|
|
2727
2731
|
) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-t border-gray-200 dark:border-zinc-800", children: table.getFooterGroups().map((footerGroup) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tr", { children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2728
2732
|
"td",
|
|
2729
2733
|
{
|
|
2730
|
-
className: `${rowPadding} text-
|
|
2734
|
+
className: `${rowPadding} text-sm font-semibold text-gray-900 dark:text-zinc-100 text-left ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${header.id === "_index" || header.id === "select" || header.id === "_select" ? "w-px whitespace-nowrap" : ""}`,
|
|
2731
2735
|
children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
|
|
2732
2736
|
header.column.columnDef.footer,
|
|
2733
2737
|
header.getContext()
|
|
@@ -2949,7 +2953,7 @@ function PostTable({
|
|
|
2949
2953
|
"button",
|
|
2950
2954
|
{
|
|
2951
2955
|
onClick: () => handleEdit(row.index, row.original),
|
|
2952
|
-
className: "p-1 px-2 rounded-md hover:bg-gray-100 dark:hover:bg-zinc-800 text-gray-500 hover:text-
|
|
2956
|
+
className: "p-1 px-2 rounded-md hover:bg-gray-100 dark:hover:bg-zinc-800 text-gray-500 hover:text-(--theme-primary) dark:hover:text-(--theme-primary) transition-colors",
|
|
2953
2957
|
title: "Edit",
|
|
2954
2958
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Edit2, { size: 16 })
|
|
2955
2959
|
}
|
|
@@ -3022,7 +3026,7 @@ function PostTable({
|
|
|
3022
3026
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("thead", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-zinc-800", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3023
3027
|
"th",
|
|
3024
3028
|
{
|
|
3025
|
-
className: `${rowPadding} text-
|
|
3029
|
+
className: `${rowPadding} text-sm font-semibold text-gray-900 dark:text-zinc-100 text-left ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${header.id === "_index" ? "w-px whitespace-nowrap" : ""}`,
|
|
3026
3030
|
children: header.isPlaceholder ? null : (0, import_react_table2.flexRender)(
|
|
3027
3031
|
header.column.columnDef.header,
|
|
3028
3032
|
header.getContext()
|
|
@@ -3064,7 +3068,7 @@ function PostTable({
|
|
|
3064
3068
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3065
3069
|
"td",
|
|
3066
3070
|
{
|
|
3067
|
-
className: `${rowPadding} text-sm text-gray-700 dark:text-gray-200 ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${cell.column.id === "_index" ? "w-
|
|
3071
|
+
className: `${rowPadding} text-sm text-gray-700 dark:text-gray-200 ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${cell.column.id === "_index" ? "w-px whitespace-nowrap" : ""}`,
|
|
3068
3072
|
children: (0, import_react_table2.flexRender)(
|
|
3069
3073
|
cell.column.columnDef.cell,
|
|
3070
3074
|
cell.getContext()
|
|
@@ -3142,7 +3146,10 @@ function PostTable({
|
|
|
3142
3146
|
{
|
|
3143
3147
|
onClick: handleSaveField,
|
|
3144
3148
|
disabled: isSavingAsync,
|
|
3145
|
-
className: "w-full cursor-pointer h-8 flex items-center justify-center gap-1.5 rounded-lg text-white text-xs font-medium transition-all shadow-
|
|
3149
|
+
className: "w-full cursor-pointer h-8 flex items-center justify-center gap-1.5 rounded-lg text-white text-xs font-medium transition-all shadow-sm hover:shadow-md hover:-translate-y-px active:scale-95 active:translate-y-0 hover:brightness-110 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
3150
|
+
style: {
|
|
3151
|
+
backgroundColor: "var(--theme-primary)"
|
|
3152
|
+
},
|
|
3146
3153
|
title: "Add Row",
|
|
3147
3154
|
children: [
|
|
3148
3155
|
isSavingAsync ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "w-3.5 h-3.5 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.Plus, { size: 14, strokeWidth: 2.5 }),
|
|
@@ -3188,7 +3195,7 @@ function PostTable({
|
|
|
3188
3195
|
"py-1! text-sm align-middle transition-colors duration-200",
|
|
3189
3196
|
column.id !== "_index" ? "cursor-text" : "",
|
|
3190
3197
|
verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : "",
|
|
3191
|
-
column.id === "_index" ? "w-
|
|
3198
|
+
column.id === "_index" ? "w-px whitespace-nowrap" : "",
|
|
3192
3199
|
hasError && "ring-1 ring-inset ring-red-500"
|
|
3193
3200
|
),
|
|
3194
3201
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
@@ -3196,7 +3203,7 @@ function PostTable({
|
|
|
3196
3203
|
{
|
|
3197
3204
|
className: cn(
|
|
3198
3205
|
"flex items-center",
|
|
3199
|
-
column.id === "_index" ? "" : "w-full min-w-
|
|
3206
|
+
column.id === "_index" ? "" : "w-full min-w-32 h-9"
|
|
3200
3207
|
),
|
|
3201
3208
|
onKeyDown: (e) => {
|
|
3202
3209
|
if (e.key === "Enter") {
|
|
@@ -3238,7 +3245,7 @@ function PostTable({
|
|
|
3238
3245
|
) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tfoot", { className: "bg-gray-50/50 dark:bg-zinc-900/50 border-t border-gray-200 dark:border-zinc-800", children: table.getFooterGroups().map((footerGroup) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3239
3246
|
"td",
|
|
3240
3247
|
{
|
|
3241
|
-
className: `${rowPadding} text-
|
|
3248
|
+
className: `${rowPadding} text-sm font-semibold text-gray-900 dark:text-zinc-100 text-left ${verticalLines ? "border-x border-gray-200 dark:border-zinc-800" : ""} ${header.id === "_index" ? "w-px whitespace-nowrap" : ""}`,
|
|
3242
3249
|
children: header.isPlaceholder ? null : (0, import_react_table2.flexRender)(
|
|
3243
3250
|
header.column.columnDef.footer,
|
|
3244
3251
|
header.getContext()
|
|
@@ -3314,7 +3321,7 @@ function SimpleTable({
|
|
|
3314
3321
|
children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3315
3322
|
"th",
|
|
3316
3323
|
{
|
|
3317
|
-
className: `${rowPadding} font-semibold text-gray-900 dark:text-zinc-100 text-
|
|
3324
|
+
className: `${rowPadding} font-semibold text-gray-900 dark:text-zinc-100 text-sm align-top ${verticalLines ? "border-x border-black dark:border-white" : ""} ${header.column.columnDef.className || "wrap-break-word"}`,
|
|
3318
3325
|
style: {
|
|
3319
3326
|
width: header.column.columnDef.width !== void 0 ? header.column.columnDef.width : header.column.columnDef.flex !== void 0 ? "auto" : "1%",
|
|
3320
3327
|
minWidth: header.column.columnDef.minWidth,
|
|
@@ -3337,7 +3344,7 @@ function SimpleTable({
|
|
|
3337
3344
|
children: columns.map((col, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3338
3345
|
"td",
|
|
3339
3346
|
{
|
|
3340
|
-
className: `text-
|
|
3347
|
+
className: `text-sm ${rowPadding} align-top ${verticalLines ? "border-x border-black dark:border-white" : ""}`,
|
|
3341
3348
|
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-4 bg-gray-200 dark:bg-zinc-800 rounded-sm animate-pulse w-full" })
|
|
3342
3349
|
},
|
|
3343
3350
|
`skeleton-col-${colIdx}`
|
|
@@ -3358,7 +3365,7 @@ function SimpleTable({
|
|
|
3358
3365
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3359
3366
|
"td",
|
|
3360
3367
|
{
|
|
3361
|
-
className: `text-
|
|
3368
|
+
className: `text-sm ${rowPadding} align-top ${verticalLines ? "border-x border-black dark:border-white" : ""} ${cell.column.columnDef.className || "wrap-break-word"}`,
|
|
3362
3369
|
children: (0, import_react_table3.flexRender)(cell.column.columnDef.cell, cell.getContext())
|
|
3363
3370
|
},
|
|
3364
3371
|
cell.id
|
|
@@ -3373,7 +3380,7 @@ function SimpleTable({
|
|
|
3373
3380
|
children: footerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3374
3381
|
"td",
|
|
3375
3382
|
{
|
|
3376
|
-
className: `text-
|
|
3383
|
+
className: `text-sm ${rowPadding} ${verticalLines ? "border-x border-black dark:border-white" : ""} ${header.column.columnDef.className || "wrap-break-word"}`,
|
|
3377
3384
|
children: header.isPlaceholder ? null : (0, import_react_table3.flexRender)(
|
|
3378
3385
|
header.column.columnDef.footer,
|
|
3379
3386
|
header.getContext()
|
|
@@ -3411,7 +3418,7 @@ var Badge = import_react18.default.forwardRef(
|
|
|
3411
3418
|
success: outline ? "border border-green-600 text-green-600 dark:border-green-400 dark:text-green-400 bg-transparent" : "bg-green-600 text-white dark:bg-green-500 border border-transparent"
|
|
3412
3419
|
};
|
|
3413
3420
|
const sizes = {
|
|
3414
|
-
sm: "px-2 py-0.5 text-
|
|
3421
|
+
sm: "px-2 py-0.5 text-xs leading-none uppercase tracking-wider font-semibold",
|
|
3415
3422
|
md: "px-2.5 py-1 text-xs leading-tight font-semibold",
|
|
3416
3423
|
lg: "px-3 py-1.5 text-sm leading-tight font-semibold"
|
|
3417
3424
|
};
|
|
@@ -3439,7 +3446,7 @@ var Branding = ({
|
|
|
3439
3446
|
"p",
|
|
3440
3447
|
{
|
|
3441
3448
|
className: cn(
|
|
3442
|
-
"text-center text-
|
|
3449
|
+
"text-center text-xs font-bold uppercase tracking-widest transition-all duration-300 font-bona",
|
|
3443
3450
|
disabled ? "opacity-40 cursor-not-allowed" : "text-slate-900 dark:text-slate-50",
|
|
3444
3451
|
className
|
|
3445
3452
|
),
|
|
@@ -3489,6 +3496,7 @@ var useA4StatementView = ({
|
|
|
3489
3496
|
subtitle = "Official Account Statement",
|
|
3490
3497
|
printable = true,
|
|
3491
3498
|
rowPadding = "p-3",
|
|
3499
|
+
verticalLines = true,
|
|
3492
3500
|
headers
|
|
3493
3501
|
}) => {
|
|
3494
3502
|
const { store } = useWarqadConfig();
|
|
@@ -3523,7 +3531,7 @@ var useA4StatementView = ({
|
|
|
3523
3531
|
{
|
|
3524
3532
|
className: "flex items-center gap-3 px-4 py-2 rounded-md border border-black dark:border-zinc-700 print:border-black",
|
|
3525
3533
|
children: [
|
|
3526
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-black dark:text-white print:text-black font-bold uppercase tracking-widest text-
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-black dark:text-white print:text-black font-bold uppercase tracking-widest text-xs", children: typeof col.header === "string" ? col.header : typeof col.key === "string" ? col.key : "Total" }),
|
|
3527
3535
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-base font-bold font-sans tabular-nums text-black dark:text-white print:text-black", children: col.renderFooter(filteredDisplayData) })
|
|
3528
3536
|
]
|
|
3529
3537
|
},
|
|
@@ -3622,7 +3630,7 @@ var useA4StatementView = ({
|
|
|
3622
3630
|
);
|
|
3623
3631
|
const DisplayInfoGridEl = Array.isArray(info) && info.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { id: "a4-info-grid", className: "px-8", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InfoGrid, { className: "mb-4", items: info, isLoading }) }) : null;
|
|
3624
3632
|
if (!isLoading && (error || !data || data.length === 0)) {
|
|
3625
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col relative w-full items-center justify-center p-8 min-h-
|
|
3633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col relative w-full items-center justify-center p-8 min-h-96", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center justify-center p-12 bg-gray-50/50 dark:bg-zinc-900/30 rounded-2xl border border-dashed border-gray-300 dark:border-zinc-700 w-full max-w-xl text-center shadow-sm", children: [
|
|
3626
3634
|
error ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-16 h-16 bg-red-100 dark:bg-red-500/10 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.AlertCircle, { className: "w-8 h-8 text-red-600 dark:text-red-500" }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-16 h-16 bg-gray-200 dark:bg-zinc-800 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react12.FileX, { className: "w-8 h-8 text-gray-500 dark:text-gray-400" }) }),
|
|
3627
3635
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-xl font-bold text-gray-900 dark:text-white mb-2", children: error ? "Failed to Load Statement" : "No Records Found" }),
|
|
3628
3636
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-xs mb-8 leading-relaxed", children: error ? typeof error === "string" ? error : "An unexpected error occurred while fetching the statement data." : "There are no transactions or records available in this requested statement." }),
|
|
@@ -3640,7 +3648,7 @@ var useA4StatementView = ({
|
|
|
3640
3648
|
] }) });
|
|
3641
3649
|
}
|
|
3642
3650
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col relative w-full items-center", children: [
|
|
3643
|
-
isMeasuring && filteredDisplayData.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute top-0 opacity-0 pointer-events-none -left-
|
|
3651
|
+
isMeasuring && filteredDisplayData.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute top-0 opacity-0 pointer-events-none -left-full", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3644
3652
|
"div",
|
|
3645
3653
|
{
|
|
3646
3654
|
style: { width: "210mm", boxSizing: "border-box" },
|
|
@@ -3727,12 +3735,12 @@ var useA4StatementView = ({
|
|
|
3727
3735
|
value: globalFilter,
|
|
3728
3736
|
onChange: (e) => setGlobalFilter(e.target.value),
|
|
3729
3737
|
placeholder: "Search...",
|
|
3730
|
-
className: "block w-full max-w-
|
|
3738
|
+
className: "block w-full max-w-xs px-3 py-2 border border-gray-300 rounded-md text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-900 dark:border-zinc-700 dark:text-white"
|
|
3731
3739
|
}
|
|
3732
3740
|
)
|
|
3733
3741
|
] }),
|
|
3734
3742
|
pageIndex === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "hidden print:flex mb-4 border-b border-gray-200 print:border-gray-200 pb-2 items-center gap-2 justify-between px-2 mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-sm font-bold text-gray-800 print:text-gray-800 uppercase tracking-wide shrink-0", children: "Recent Transactions" }) }),
|
|
3735
|
-
pageIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "h-
|
|
3743
|
+
pageIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "h-5 print:h-0" }),
|
|
3736
3744
|
(pageData.length > 0 || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3737
3745
|
SimpleTable,
|
|
3738
3746
|
{
|
|
@@ -3742,7 +3750,7 @@ var useA4StatementView = ({
|
|
|
3742
3750
|
rowPadding,
|
|
3743
3751
|
index,
|
|
3744
3752
|
startIndex: pages.slice(0, pageIndex).reduce((acc, curr) => acc + curr.length, 0),
|
|
3745
|
-
verticalLines
|
|
3753
|
+
verticalLines,
|
|
3746
3754
|
isLoading: isLoading || isMeasuring && pages.length === 1 && pages[0].length === 0
|
|
3747
3755
|
}
|
|
3748
3756
|
),
|
|
@@ -3828,7 +3836,7 @@ var useTransaction = ({
|
|
|
3828
3836
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3829
3837
|
"div",
|
|
3830
3838
|
{
|
|
3831
|
-
className: `flex flex-col relative w-full items-center justify-center p-8 min-h-
|
|
3839
|
+
className: `flex flex-col relative w-full items-center justify-center p-8 min-h-96 ${className}`,
|
|
3832
3840
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col items-center justify-center p-12 bg-gray-50/50 dark:bg-zinc-900/30 rounded-2xl border border-dashed border-gray-300 dark:border-zinc-700 w-full max-w-xl text-center shadow-sm", children: [
|
|
3833
3841
|
error ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-16 h-16 bg-red-100 dark:bg-red-500/10 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.AlertCircle, { className: "w-8 h-8 text-red-600 dark:text-red-500" }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-16 h-16 bg-gray-200 dark:bg-zinc-800 rounded-full flex items-center justify-center mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react13.FileX, { className: "w-8 h-8 text-gray-500 dark:text-gray-400" }) }),
|
|
3834
3842
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "text-xl font-bold text-gray-900 dark:text-white mb-2", children: error ? "Failed to Load Data" : "No Records Found" }),
|