warqadui 0.0.68 → 0.0.69
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 +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +58 -14
- package/dist/index.mjs +58 -15
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -9,6 +9,7 @@ import { z as z$1 } from 'zod';
|
|
|
9
9
|
import * as react_to_print from 'react-to-print';
|
|
10
10
|
import { UploadFile } from 'antd';
|
|
11
11
|
import * as zustand from 'zustand';
|
|
12
|
+
import * as react_router from 'react-router';
|
|
12
13
|
|
|
13
14
|
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
15
|
variant?: "primary" | "secondary" | "outline" | "ghost" | "danger" | "warning";
|
|
@@ -1122,14 +1123,20 @@ declare const createAccountSchema: z$1.ZodObject<{
|
|
|
1122
1123
|
email: z$1.ZodEffects<z$1.ZodEffects<z$1.ZodOptional<z$1.ZodString>, string | undefined, string | undefined>, string | undefined, string | undefined>;
|
|
1123
1124
|
phoneNumber: z$1.ZodOptional<z$1.ZodString>;
|
|
1124
1125
|
sex: z$1.ZodEnum<["male", "female"]>;
|
|
1126
|
+
owner: z$1.ZodString;
|
|
1127
|
+
host: z$1.ZodString;
|
|
1125
1128
|
}, "strip", z$1.ZodTypeAny, {
|
|
1126
1129
|
name: string;
|
|
1127
1130
|
sex: "male" | "female";
|
|
1131
|
+
owner: string;
|
|
1132
|
+
host: string;
|
|
1128
1133
|
email?: string | undefined;
|
|
1129
1134
|
phoneNumber?: string | undefined;
|
|
1130
1135
|
}, {
|
|
1131
1136
|
name: string;
|
|
1132
1137
|
sex: "male" | "female";
|
|
1138
|
+
owner: string;
|
|
1139
|
+
host: string;
|
|
1133
1140
|
email?: string | undefined;
|
|
1134
1141
|
phoneNumber?: string | undefined;
|
|
1135
1142
|
}>;
|
|
@@ -1155,6 +1162,14 @@ declare const UserProfile: React__default.FC<UserProfileProps>;
|
|
|
1155
1162
|
|
|
1156
1163
|
declare const ProfilePage: () => react_jsx_runtime.JSX.Element;
|
|
1157
1164
|
|
|
1165
|
+
declare const useApp: () => {
|
|
1166
|
+
navigate: react_router.NavigateFunction;
|
|
1167
|
+
getQuery: (key?: string) => string | {
|
|
1168
|
+
[k: string]: string;
|
|
1169
|
+
} | null;
|
|
1170
|
+
getParams: (key?: string) => string | Readonly<react_router.Params<string>> | undefined;
|
|
1171
|
+
};
|
|
1172
|
+
|
|
1158
1173
|
declare const linkUserSchema: z$1.ZodObject<{
|
|
1159
1174
|
email: z$1.ZodEffects<z$1.ZodEffects<z$1.ZodString, string, string>, string, string>;
|
|
1160
1175
|
name: z$1.ZodString;
|
|
@@ -1203,4 +1218,4 @@ type verifyUserEmailSchemaType = z$1.infer<typeof verifyUserEmailSchema>;
|
|
|
1203
1218
|
type updateUserEmailSchemaType = z$1.infer<typeof updateUserEmailSchema>;
|
|
1204
1219
|
type resetPasswordSchemaType = z$1.infer<typeof resetPasswordSchema>;
|
|
1205
1220
|
|
|
1206
|
-
export { AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserProfile, Users, Views, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
|
|
1221
|
+
export { AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserProfile, Users, Views, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { z as z$1 } from 'zod';
|
|
|
9
9
|
import * as react_to_print from 'react-to-print';
|
|
10
10
|
import { UploadFile } from 'antd';
|
|
11
11
|
import * as zustand from 'zustand';
|
|
12
|
+
import * as react_router from 'react-router';
|
|
12
13
|
|
|
13
14
|
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
15
|
variant?: "primary" | "secondary" | "outline" | "ghost" | "danger" | "warning";
|
|
@@ -1122,14 +1123,20 @@ declare const createAccountSchema: z$1.ZodObject<{
|
|
|
1122
1123
|
email: z$1.ZodEffects<z$1.ZodEffects<z$1.ZodOptional<z$1.ZodString>, string | undefined, string | undefined>, string | undefined, string | undefined>;
|
|
1123
1124
|
phoneNumber: z$1.ZodOptional<z$1.ZodString>;
|
|
1124
1125
|
sex: z$1.ZodEnum<["male", "female"]>;
|
|
1126
|
+
owner: z$1.ZodString;
|
|
1127
|
+
host: z$1.ZodString;
|
|
1125
1128
|
}, "strip", z$1.ZodTypeAny, {
|
|
1126
1129
|
name: string;
|
|
1127
1130
|
sex: "male" | "female";
|
|
1131
|
+
owner: string;
|
|
1132
|
+
host: string;
|
|
1128
1133
|
email?: string | undefined;
|
|
1129
1134
|
phoneNumber?: string | undefined;
|
|
1130
1135
|
}, {
|
|
1131
1136
|
name: string;
|
|
1132
1137
|
sex: "male" | "female";
|
|
1138
|
+
owner: string;
|
|
1139
|
+
host: string;
|
|
1133
1140
|
email?: string | undefined;
|
|
1134
1141
|
phoneNumber?: string | undefined;
|
|
1135
1142
|
}>;
|
|
@@ -1155,6 +1162,14 @@ declare const UserProfile: React__default.FC<UserProfileProps>;
|
|
|
1155
1162
|
|
|
1156
1163
|
declare const ProfilePage: () => react_jsx_runtime.JSX.Element;
|
|
1157
1164
|
|
|
1165
|
+
declare const useApp: () => {
|
|
1166
|
+
navigate: react_router.NavigateFunction;
|
|
1167
|
+
getQuery: (key?: string) => string | {
|
|
1168
|
+
[k: string]: string;
|
|
1169
|
+
} | null;
|
|
1170
|
+
getParams: (key?: string) => string | Readonly<react_router.Params<string>> | undefined;
|
|
1171
|
+
};
|
|
1172
|
+
|
|
1158
1173
|
declare const linkUserSchema: z$1.ZodObject<{
|
|
1159
1174
|
email: z$1.ZodEffects<z$1.ZodEffects<z$1.ZodString, string, string>, string, string>;
|
|
1160
1175
|
name: z$1.ZodString;
|
|
@@ -1203,4 +1218,4 @@ type verifyUserEmailSchemaType = z$1.infer<typeof verifyUserEmailSchema>;
|
|
|
1203
1218
|
type updateUserEmailSchemaType = z$1.infer<typeof updateUserEmailSchema>;
|
|
1204
1219
|
type resetPasswordSchemaType = z$1.infer<typeof resetPasswordSchema>;
|
|
1205
1220
|
|
|
1206
|
-
export { AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserProfile, Users, Views, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
|
|
1221
|
+
export { AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserProfile, Users, Views, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
|
package/dist/index.js
CHANGED
|
@@ -98,6 +98,7 @@ __export(index_exports, {
|
|
|
98
98
|
useA4StatementView: () => useA4DataView_default,
|
|
99
99
|
useAntdImageUpload: () => useAntdImageUpload_default,
|
|
100
100
|
useApi: () => useApis_default,
|
|
101
|
+
useApp: () => useApp_default,
|
|
101
102
|
useAuth: () => useAuth_default,
|
|
102
103
|
useAuthStore: () => useAuthStore,
|
|
103
104
|
useLogin: () => useLogin,
|
|
@@ -3331,7 +3332,7 @@ function DataTable({
|
|
|
3331
3332
|
},
|
|
3332
3333
|
header.id
|
|
3333
3334
|
)) }, headerGroup.id)) }),
|
|
3334
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tbody", { className: "", children: isLoading
|
|
3335
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tbody", { className: "", children: isLoading ? Array.from({ length: pageRows || 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3335
3336
|
"tr",
|
|
3336
3337
|
{
|
|
3337
3338
|
className: "border-b border-gray-100 dark:border-zinc-800/50",
|
|
@@ -10549,7 +10550,9 @@ var createAccountSchema = import_zod2.z.object({
|
|
|
10549
10550
|
message: "Please enter a valid email address"
|
|
10550
10551
|
}).transform((val) => val?.toLowerCase()),
|
|
10551
10552
|
phoneNumber: import_zod2.z.string().optional(),
|
|
10552
|
-
sex: import_zod2.z.enum(Enums_default.sex)
|
|
10553
|
+
sex: import_zod2.z.enum(Enums_default.sex),
|
|
10554
|
+
owner: import_zod2.z.string().min(1, { message: "Owner is required" }),
|
|
10555
|
+
host: import_zod2.z.string().min(1, { message: "Host is required" })
|
|
10553
10556
|
});
|
|
10554
10557
|
|
|
10555
10558
|
// src/components/accounts/AccountForm.tsx
|
|
@@ -10571,7 +10574,9 @@ function AccountForm() {
|
|
|
10571
10574
|
name: "",
|
|
10572
10575
|
email: "",
|
|
10573
10576
|
phoneNumber: "",
|
|
10574
|
-
sex: "male"
|
|
10577
|
+
sex: "male",
|
|
10578
|
+
owner: "",
|
|
10579
|
+
host: ""
|
|
10575
10580
|
},
|
|
10576
10581
|
shouldUnregister: false
|
|
10577
10582
|
});
|
|
@@ -10673,6 +10678,28 @@ function AccountForm() {
|
|
|
10673
10678
|
name: "phoneNumber",
|
|
10674
10679
|
placeholder: "Enter phone number"
|
|
10675
10680
|
}
|
|
10681
|
+
),
|
|
10682
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10683
|
+
Fields_default.SearchApi,
|
|
10684
|
+
{
|
|
10685
|
+
label: "Owner",
|
|
10686
|
+
form: methods,
|
|
10687
|
+
name: "owner",
|
|
10688
|
+
api: "/accounts/get/customer",
|
|
10689
|
+
placeholder: "Search for account owner...",
|
|
10690
|
+
required: true
|
|
10691
|
+
}
|
|
10692
|
+
),
|
|
10693
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10694
|
+
Fields_default.Input,
|
|
10695
|
+
{
|
|
10696
|
+
label: "Host",
|
|
10697
|
+
form: methods,
|
|
10698
|
+
name: "host",
|
|
10699
|
+
type: "text",
|
|
10700
|
+
placeholder: "Unique host name",
|
|
10701
|
+
required: true
|
|
10702
|
+
}
|
|
10676
10703
|
)
|
|
10677
10704
|
] }),
|
|
10678
10705
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
@@ -11608,8 +11635,11 @@ var UserProfile = ({
|
|
|
11608
11635
|
var UserProfile_default = UserProfile;
|
|
11609
11636
|
|
|
11610
11637
|
// src/components/users/ProfilePage.tsx
|
|
11638
|
+
var import_react_router_dom8 = require("react-router-dom");
|
|
11639
|
+
var import_lucide_react23 = require("lucide-react");
|
|
11611
11640
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
11612
11641
|
var ProfilePage = () => {
|
|
11642
|
+
const navigate = (0, import_react_router_dom8.useNavigate)();
|
|
11613
11643
|
const { user, account } = useAuth();
|
|
11614
11644
|
if (!user) {
|
|
11615
11645
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h1", { children: "Please login to view your profile" }) });
|
|
@@ -11631,17 +11661,30 @@ var ProfilePage = () => {
|
|
|
11631
11661
|
copiable: false
|
|
11632
11662
|
}
|
|
11633
11663
|
];
|
|
11634
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.
|
|
11635
|
-
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
|
|
11644
|
-
|
|
11664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "p-4 sm:p-8 space-y-6", children: [
|
|
11665
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "max-w-5xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
11666
|
+
Button,
|
|
11667
|
+
{
|
|
11668
|
+
variant: "outline",
|
|
11669
|
+
size: "sm",
|
|
11670
|
+
onClick: () => navigate(-1),
|
|
11671
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react23.ArrowLeft, { size: 16 }),
|
|
11672
|
+
className: "rounded-full font-bold px-5",
|
|
11673
|
+
children: "Back"
|
|
11674
|
+
}
|
|
11675
|
+
) }),
|
|
11676
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
11677
|
+
ProfileView,
|
|
11678
|
+
{
|
|
11679
|
+
name: account?.name || "User Account",
|
|
11680
|
+
email: user.email || account?.email,
|
|
11681
|
+
role: user.role,
|
|
11682
|
+
info: extraInfo,
|
|
11683
|
+
title: "User Profile",
|
|
11684
|
+
description: "View your profile information"
|
|
11685
|
+
}
|
|
11686
|
+
)
|
|
11687
|
+
] });
|
|
11645
11688
|
};
|
|
11646
11689
|
var ProfilePage_default = ProfilePage;
|
|
11647
11690
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -11714,6 +11757,7 @@ var ProfilePage_default = ProfilePage;
|
|
|
11714
11757
|
useA4StatementView,
|
|
11715
11758
|
useAntdImageUpload,
|
|
11716
11759
|
useApi,
|
|
11760
|
+
useApp,
|
|
11717
11761
|
useAuth,
|
|
11718
11762
|
useAuthStore,
|
|
11719
11763
|
useLogin,
|
package/dist/index.mjs
CHANGED
|
@@ -3253,7 +3253,7 @@ function DataTable({
|
|
|
3253
3253
|
},
|
|
3254
3254
|
header.id
|
|
3255
3255
|
)) }, headerGroup.id)) }),
|
|
3256
|
-
/* @__PURE__ */ jsx24("tbody", { className: "", children: isLoading
|
|
3256
|
+
/* @__PURE__ */ jsx24("tbody", { className: "", children: isLoading ? Array.from({ length: pageRows || 5 }).map((_, i) => /* @__PURE__ */ jsx24(
|
|
3257
3257
|
"tr",
|
|
3258
3258
|
{
|
|
3259
3259
|
className: "border-b border-gray-100 dark:border-zinc-800/50",
|
|
@@ -10518,7 +10518,9 @@ var createAccountSchema = z2.object({
|
|
|
10518
10518
|
message: "Please enter a valid email address"
|
|
10519
10519
|
}).transform((val) => val?.toLowerCase()),
|
|
10520
10520
|
phoneNumber: z2.string().optional(),
|
|
10521
|
-
sex: z2.enum(Enums_default.sex)
|
|
10521
|
+
sex: z2.enum(Enums_default.sex),
|
|
10522
|
+
owner: z2.string().min(1, { message: "Owner is required" }),
|
|
10523
|
+
host: z2.string().min(1, { message: "Host is required" })
|
|
10522
10524
|
});
|
|
10523
10525
|
|
|
10524
10526
|
// src/components/accounts/AccountForm.tsx
|
|
@@ -10540,7 +10542,9 @@ function AccountForm() {
|
|
|
10540
10542
|
name: "",
|
|
10541
10543
|
email: "",
|
|
10542
10544
|
phoneNumber: "",
|
|
10543
|
-
sex: "male"
|
|
10545
|
+
sex: "male",
|
|
10546
|
+
owner: "",
|
|
10547
|
+
host: ""
|
|
10544
10548
|
},
|
|
10545
10549
|
shouldUnregister: false
|
|
10546
10550
|
});
|
|
@@ -10642,6 +10646,28 @@ function AccountForm() {
|
|
|
10642
10646
|
name: "phoneNumber",
|
|
10643
10647
|
placeholder: "Enter phone number"
|
|
10644
10648
|
}
|
|
10649
|
+
),
|
|
10650
|
+
/* @__PURE__ */ jsx43(
|
|
10651
|
+
Fields_default.SearchApi,
|
|
10652
|
+
{
|
|
10653
|
+
label: "Owner",
|
|
10654
|
+
form: methods,
|
|
10655
|
+
name: "owner",
|
|
10656
|
+
api: "/accounts/get/customer",
|
|
10657
|
+
placeholder: "Search for account owner...",
|
|
10658
|
+
required: true
|
|
10659
|
+
}
|
|
10660
|
+
),
|
|
10661
|
+
/* @__PURE__ */ jsx43(
|
|
10662
|
+
Fields_default.Input,
|
|
10663
|
+
{
|
|
10664
|
+
label: "Host",
|
|
10665
|
+
form: methods,
|
|
10666
|
+
name: "host",
|
|
10667
|
+
type: "text",
|
|
10668
|
+
placeholder: "Unique host name",
|
|
10669
|
+
required: true
|
|
10670
|
+
}
|
|
10645
10671
|
)
|
|
10646
10672
|
] }),
|
|
10647
10673
|
/* @__PURE__ */ jsx43("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx43(
|
|
@@ -11583,8 +11609,11 @@ var UserProfile = ({
|
|
|
11583
11609
|
var UserProfile_default = UserProfile;
|
|
11584
11610
|
|
|
11585
11611
|
// src/components/users/ProfilePage.tsx
|
|
11586
|
-
import {
|
|
11612
|
+
import { useNavigate as useNavigate8 } from "react-router-dom";
|
|
11613
|
+
import { ArrowLeft as ArrowLeft3 } from "lucide-react";
|
|
11614
|
+
import { jsx as jsx52, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
11587
11615
|
var ProfilePage = () => {
|
|
11616
|
+
const navigate = useNavigate8();
|
|
11588
11617
|
const { user, account } = useAuth();
|
|
11589
11618
|
if (!user) {
|
|
11590
11619
|
return /* @__PURE__ */ jsx52("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsx52("h1", { children: "Please login to view your profile" }) });
|
|
@@ -11606,17 +11635,30 @@ var ProfilePage = () => {
|
|
|
11606
11635
|
copiable: false
|
|
11607
11636
|
}
|
|
11608
11637
|
];
|
|
11609
|
-
return /* @__PURE__ */
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11638
|
+
return /* @__PURE__ */ jsxs41("div", { className: "p-4 sm:p-8 space-y-6", children: [
|
|
11639
|
+
/* @__PURE__ */ jsx52("div", { className: "max-w-5xl mx-auto", children: /* @__PURE__ */ jsx52(
|
|
11640
|
+
Button,
|
|
11641
|
+
{
|
|
11642
|
+
variant: "outline",
|
|
11643
|
+
size: "sm",
|
|
11644
|
+
onClick: () => navigate(-1),
|
|
11645
|
+
icon: /* @__PURE__ */ jsx52(ArrowLeft3, { size: 16 }),
|
|
11646
|
+
className: "rounded-full font-bold px-5",
|
|
11647
|
+
children: "Back"
|
|
11648
|
+
}
|
|
11649
|
+
) }),
|
|
11650
|
+
/* @__PURE__ */ jsx52(
|
|
11651
|
+
ProfileView,
|
|
11652
|
+
{
|
|
11653
|
+
name: account?.name || "User Account",
|
|
11654
|
+
email: user.email || account?.email,
|
|
11655
|
+
role: user.role,
|
|
11656
|
+
info: extraInfo,
|
|
11657
|
+
title: "User Profile",
|
|
11658
|
+
description: "View your profile information"
|
|
11659
|
+
}
|
|
11660
|
+
)
|
|
11661
|
+
] });
|
|
11620
11662
|
};
|
|
11621
11663
|
var ProfilePage_default = ProfilePage;
|
|
11622
11664
|
export {
|
|
@@ -11688,6 +11730,7 @@ export {
|
|
|
11688
11730
|
useA4DataView_default as useA4StatementView,
|
|
11689
11731
|
useAntdImageUpload_default as useAntdImageUpload,
|
|
11690
11732
|
useApis_default as useApi,
|
|
11733
|
+
useApp_default as useApp,
|
|
11691
11734
|
useAuth_default as useAuth,
|
|
11692
11735
|
useAuthStore,
|
|
11693
11736
|
useLogin,
|