warqadui 0.0.86 → 0.0.87

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 CHANGED
@@ -1179,10 +1179,11 @@ type AccountProps<T extends FieldValues> = {
1179
1179
  showBalance?: boolean;
1180
1180
  v?: number;
1181
1181
  required?: boolean;
1182
+ disabled?: boolean;
1182
1183
  };
1183
- declare function Account<T extends FieldValues>({ name, label, placeholder, api, form, filter, v, showBalance, required, }: AccountProps<T>): react_jsx_runtime.JSX.Element;
1184
+ declare function Account<T extends FieldValues>({ name, label, placeholder, api, form, filter, v, showBalance, required, disabled, }: AccountProps<T>): react_jsx_runtime.JSX.Element;
1184
1185
 
1185
- type Props$3<T extends FieldValues> = {
1186
+ type Props$2<T extends FieldValues> = {
1186
1187
  name?: Path<T>;
1187
1188
  label?: string;
1188
1189
  form: UseFormReturn<T>;
@@ -1192,10 +1193,11 @@ type Props$3<T extends FieldValues> = {
1192
1193
  showBalance?: boolean;
1193
1194
  v?: number;
1194
1195
  required?: boolean;
1196
+ disabled?: boolean;
1195
1197
  };
1196
- declare function Customer<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, }: Props$3<T>): react_jsx_runtime.JSX.Element;
1198
+ declare function Customer<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, disabled, v, }: Props$2<T>): react_jsx_runtime.JSX.Element;
1197
1199
 
1198
- type Props$2<T extends FieldValues> = {
1200
+ type Props$1<T extends FieldValues> = {
1199
1201
  name?: Path<T>;
1200
1202
  label?: string;
1201
1203
  form: UseFormReturn<T>;
@@ -1205,10 +1207,11 @@ type Props$2<T extends FieldValues> = {
1205
1207
  showBalance?: boolean;
1206
1208
  v?: number;
1207
1209
  required?: boolean;
1210
+ disabled?: boolean;
1208
1211
  };
1209
- declare function Employee<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, }: Props$2<T>): react_jsx_runtime.JSX.Element;
1212
+ declare function Employee<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, disabled, v, }: Props$1<T>): react_jsx_runtime.JSX.Element;
1210
1213
 
1211
- type Props$1<T extends FieldValues> = {
1214
+ type Props<T extends FieldValues> = {
1212
1215
  name?: Path<T>;
1213
1216
  label?: string;
1214
1217
  form: UseFormReturn<T>;
@@ -1218,14 +1221,15 @@ type Props$1<T extends FieldValues> = {
1218
1221
  showBalance?: boolean;
1219
1222
  v?: number;
1220
1223
  required?: boolean;
1224
+ disabled?: boolean;
1221
1225
  };
1222
- declare function Branches$1<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, }: Props$1<T>): react_jsx_runtime.JSX.Element;
1226
+ declare function Branches<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, disabled, }: Props<T>): react_jsx_runtime.JSX.Element;
1223
1227
 
1224
1228
  declare const AccountFields: {
1225
1229
  Account: typeof Account;
1226
1230
  Customer: typeof Customer;
1227
1231
  Employee: typeof Employee;
1228
- Branches: typeof Branches$1;
1232
+ Branches: typeof Branches;
1229
1233
  };
1230
1234
 
1231
1235
  declare const createAccountSchema: z$1.ZodObject<{
@@ -1361,25 +1365,12 @@ type WalletFieldProps<T extends FieldValues> = {
1361
1365
  showBalance?: boolean;
1362
1366
  v?: number;
1363
1367
  required?: boolean;
1368
+ disabled?: boolean;
1364
1369
  };
1365
- declare function Wallet<T extends FieldValues>({ name, label, placeholder, api, form, filter, v, showBalance, required, }: WalletFieldProps<T>): react_jsx_runtime.JSX.Element;
1366
-
1367
- type Props<T extends FieldValues> = {
1368
- name?: Path<T>;
1369
- label?: string;
1370
- form: UseFormReturn<T>;
1371
- placeholder?: string;
1372
- api?: string;
1373
- filter?: string[];
1374
- showBalance?: boolean;
1375
- v?: number;
1376
- required?: boolean;
1377
- };
1378
- declare function Branches<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, }: Props<T>): react_jsx_runtime.JSX.Element;
1370
+ declare function Wallet<T extends FieldValues>({ name, label, placeholder, api, form, filter, v, showBalance, required, disabled, }: WalletFieldProps<T>): react_jsx_runtime.JSX.Element;
1379
1371
 
1380
1372
  declare const WalletField: {
1381
1373
  Wallet: typeof Wallet;
1382
- Branches: typeof Branches;
1383
1374
  };
1384
1375
 
1385
1376
  declare const createWalletSchema: z$1.ZodObject<{
package/dist/index.d.ts CHANGED
@@ -1179,10 +1179,11 @@ type AccountProps<T extends FieldValues> = {
1179
1179
  showBalance?: boolean;
1180
1180
  v?: number;
1181
1181
  required?: boolean;
1182
+ disabled?: boolean;
1182
1183
  };
1183
- declare function Account<T extends FieldValues>({ name, label, placeholder, api, form, filter, v, showBalance, required, }: AccountProps<T>): react_jsx_runtime.JSX.Element;
1184
+ declare function Account<T extends FieldValues>({ name, label, placeholder, api, form, filter, v, showBalance, required, disabled, }: AccountProps<T>): react_jsx_runtime.JSX.Element;
1184
1185
 
1185
- type Props$3<T extends FieldValues> = {
1186
+ type Props$2<T extends FieldValues> = {
1186
1187
  name?: Path<T>;
1187
1188
  label?: string;
1188
1189
  form: UseFormReturn<T>;
@@ -1192,10 +1193,11 @@ type Props$3<T extends FieldValues> = {
1192
1193
  showBalance?: boolean;
1193
1194
  v?: number;
1194
1195
  required?: boolean;
1196
+ disabled?: boolean;
1195
1197
  };
1196
- declare function Customer<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, }: Props$3<T>): react_jsx_runtime.JSX.Element;
1198
+ declare function Customer<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, disabled, v, }: Props$2<T>): react_jsx_runtime.JSX.Element;
1197
1199
 
1198
- type Props$2<T extends FieldValues> = {
1200
+ type Props$1<T extends FieldValues> = {
1199
1201
  name?: Path<T>;
1200
1202
  label?: string;
1201
1203
  form: UseFormReturn<T>;
@@ -1205,10 +1207,11 @@ type Props$2<T extends FieldValues> = {
1205
1207
  showBalance?: boolean;
1206
1208
  v?: number;
1207
1209
  required?: boolean;
1210
+ disabled?: boolean;
1208
1211
  };
1209
- declare function Employee<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, }: Props$2<T>): react_jsx_runtime.JSX.Element;
1212
+ declare function Employee<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, disabled, v, }: Props$1<T>): react_jsx_runtime.JSX.Element;
1210
1213
 
1211
- type Props$1<T extends FieldValues> = {
1214
+ type Props<T extends FieldValues> = {
1212
1215
  name?: Path<T>;
1213
1216
  label?: string;
1214
1217
  form: UseFormReturn<T>;
@@ -1218,14 +1221,15 @@ type Props$1<T extends FieldValues> = {
1218
1221
  showBalance?: boolean;
1219
1222
  v?: number;
1220
1223
  required?: boolean;
1224
+ disabled?: boolean;
1221
1225
  };
1222
- declare function Branches$1<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, }: Props$1<T>): react_jsx_runtime.JSX.Element;
1226
+ declare function Branches<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, disabled, }: Props<T>): react_jsx_runtime.JSX.Element;
1223
1227
 
1224
1228
  declare const AccountFields: {
1225
1229
  Account: typeof Account;
1226
1230
  Customer: typeof Customer;
1227
1231
  Employee: typeof Employee;
1228
- Branches: typeof Branches$1;
1232
+ Branches: typeof Branches;
1229
1233
  };
1230
1234
 
1231
1235
  declare const createAccountSchema: z$1.ZodObject<{
@@ -1361,25 +1365,12 @@ type WalletFieldProps<T extends FieldValues> = {
1361
1365
  showBalance?: boolean;
1362
1366
  v?: number;
1363
1367
  required?: boolean;
1368
+ disabled?: boolean;
1364
1369
  };
1365
- declare function Wallet<T extends FieldValues>({ name, label, placeholder, api, form, filter, v, showBalance, required, }: WalletFieldProps<T>): react_jsx_runtime.JSX.Element;
1366
-
1367
- type Props<T extends FieldValues> = {
1368
- name?: Path<T>;
1369
- label?: string;
1370
- form: UseFormReturn<T>;
1371
- placeholder?: string;
1372
- api?: string;
1373
- filter?: string[];
1374
- showBalance?: boolean;
1375
- v?: number;
1376
- required?: boolean;
1377
- };
1378
- declare function Branches<T extends FieldValues>({ name, label, placeholder, api, form, filter, showBalance, required, v, }: Props<T>): react_jsx_runtime.JSX.Element;
1370
+ declare function Wallet<T extends FieldValues>({ name, label, placeholder, api, form, filter, v, showBalance, required, disabled, }: WalletFieldProps<T>): react_jsx_runtime.JSX.Element;
1379
1371
 
1380
1372
  declare const WalletField: {
1381
1373
  Wallet: typeof Wallet;
1382
- Branches: typeof Branches;
1383
1374
  };
1384
1375
 
1385
1376
  declare const createWalletSchema: z$1.ZodObject<{
package/dist/index.js CHANGED
@@ -8376,7 +8376,8 @@ function Account({
8376
8376
  filter,
8377
8377
  v = 1,
8378
8378
  showBalance,
8379
- required
8379
+ required,
8380
+ disabled
8380
8381
  }) {
8381
8382
  const { branchId } = (0, import_react_router_dom8.useParams)();
8382
8383
  const accountId = form?.watch(name);
@@ -8399,7 +8400,8 @@ function Account({
8399
8400
  v,
8400
8401
  labelKey: "name",
8401
8402
  valueKey: "_id",
8402
- required
8403
+ required,
8404
+ disabled
8403
8405
  }
8404
8406
  ),
8405
8407
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BalanceView, {})
@@ -8418,6 +8420,7 @@ function Customer({
8418
8420
  filter,
8419
8421
  showBalance,
8420
8422
  required,
8423
+ disabled,
8421
8424
  v
8422
8425
  }) {
8423
8426
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
@@ -8431,7 +8434,8 @@ function Customer({
8431
8434
  form,
8432
8435
  filter,
8433
8436
  showBalance,
8434
- required
8437
+ required,
8438
+ disabled
8435
8439
  }
8436
8440
  );
8437
8441
  }
@@ -8448,6 +8452,7 @@ function Employee({
8448
8452
  filter,
8449
8453
  showBalance,
8450
8454
  required,
8455
+ disabled,
8451
8456
  v
8452
8457
  }) {
8453
8458
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
@@ -8461,6 +8466,7 @@ function Employee({
8461
8466
  form,
8462
8467
  filter,
8463
8468
  required,
8469
+ disabled,
8464
8470
  showBalance
8465
8471
  }
8466
8472
  );
@@ -8478,7 +8484,8 @@ function Branches({
8478
8484
  filter,
8479
8485
  showBalance,
8480
8486
  required,
8481
- v
8487
+ v,
8488
+ disabled
8482
8489
  }) {
8483
8490
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8484
8491
  Account_default,
@@ -8491,7 +8498,8 @@ function Branches({
8491
8498
  form,
8492
8499
  filter,
8493
8500
  showBalance,
8494
- required
8501
+ required,
8502
+ disabled
8495
8503
  }
8496
8504
  );
8497
8505
  }
@@ -8507,8 +8515,10 @@ var AccountFields = {
8507
8515
  var Feilds_default = AccountFields;
8508
8516
 
8509
8517
  // src/components/accounts/AccountForm.tsx
8518
+ var import_react_router_dom9 = require("react-router-dom");
8510
8519
  var import_jsx_runtime49 = require("react/jsx-runtime");
8511
8520
  function AccountForm() {
8521
+ const { branchId } = (0, import_react_router_dom9.useParams)();
8512
8522
  const { getQuery, getParams, navigate } = useApp_default();
8513
8523
  const id = getQuery("id");
8514
8524
  const type = getParams("type");
@@ -8530,7 +8540,8 @@ function AccountForm() {
8530
8540
  try {
8531
8541
  const payload = {
8532
8542
  ...data,
8533
- type
8543
+ type,
8544
+ branch: branchId ? branchId : data.branch
8534
8545
  };
8535
8546
  if (isEdit) {
8536
8547
  await put({
@@ -8624,7 +8635,7 @@ function AccountForm() {
8624
8635
  placeholder: "Enter phone number"
8625
8636
  }
8626
8637
  ),
8627
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
8638
+ !branchId && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
8628
8639
  Feilds_default.Branches,
8629
8640
  {
8630
8641
  label: "Branch",
@@ -9200,10 +9211,10 @@ var ActivateUser = ({ data }) => {
9200
9211
  var Activate_default = ActivateUser;
9201
9212
 
9202
9213
  // src/components/users/users.tsx
9203
- var import_react_router_dom9 = require("react-router-dom");
9214
+ var import_react_router_dom10 = require("react-router-dom");
9204
9215
  var import_jsx_runtime55 = require("react/jsx-runtime");
9205
9216
  function Users() {
9206
- const navigate = (0, import_react_router_dom9.useNavigate)();
9217
+ const navigate = (0, import_react_router_dom10.useNavigate)();
9207
9218
  const { data, TransactionViewComponent, reload } = useTransaction_default({
9208
9219
  url: "/users/get",
9209
9220
  v: 1,
@@ -9440,7 +9451,7 @@ var UserForm_default = UserForm;
9440
9451
 
9441
9452
  // src/components/users/ResetPasswordPage.tsx
9442
9453
  var import_react42 = require("react");
9443
- var import_react_router_dom10 = require("react-router-dom");
9454
+ var import_react_router_dom11 = require("react-router-dom");
9444
9455
  var import_lucide_react22 = require("lucide-react");
9445
9456
  var import_react_hook_form14 = require("react-hook-form");
9446
9457
  var import_zod9 = require("@hookform/resolvers/zod");
@@ -9455,8 +9466,8 @@ var resetPageSchema = z4.object({
9455
9466
  path: ["confirmPassword"]
9456
9467
  });
9457
9468
  function ResetPasswordPage() {
9458
- const [searchParams] = (0, import_react_router_dom10.useSearchParams)();
9459
- const navigate = (0, import_react_router_dom10.useNavigate)();
9469
+ const [searchParams] = (0, import_react_router_dom11.useSearchParams)();
9470
+ const navigate = (0, import_react_router_dom11.useNavigate)();
9460
9471
  const { put, isLoading } = useApis_default();
9461
9472
  const [isVerified, setIsVerified] = (0, import_react42.useState)(false);
9462
9473
  const [verifying, setVerifying] = (0, import_react42.useState)(true);
@@ -9628,7 +9639,7 @@ var ResetPasswordPage_default = ResetPasswordPage;
9628
9639
 
9629
9640
  // src/components/users/UserProfile.tsx
9630
9641
  var import_lucide_react23 = require("lucide-react");
9631
- var import_react_router_dom11 = require("react-router-dom");
9642
+ var import_react_router_dom12 = require("react-router-dom");
9632
9643
  var import_antd15 = require("antd");
9633
9644
  var import_jsx_runtime58 = require("react/jsx-runtime");
9634
9645
  var UserProfile = ({
@@ -9641,7 +9652,7 @@ var UserProfile = ({
9641
9652
  }) => {
9642
9653
  const { post } = useApis_default();
9643
9654
  const { user, logout: authLogout, account } = useAuth_default();
9644
- const navigate = (0, import_react_router_dom11.useNavigate)();
9655
+ const navigate = (0, import_react_router_dom12.useNavigate)();
9645
9656
  const logout = async () => {
9646
9657
  if (onLogout) {
9647
9658
  onLogout();
@@ -9693,11 +9704,11 @@ var UserProfile = ({
9693
9704
  var UserProfile_default = UserProfile;
9694
9705
 
9695
9706
  // src/components/users/ProfilePage.tsx
9696
- var import_react_router_dom12 = require("react-router-dom");
9707
+ var import_react_router_dom13 = require("react-router-dom");
9697
9708
  var import_lucide_react24 = require("lucide-react");
9698
9709
  var import_jsx_runtime59 = require("react/jsx-runtime");
9699
9710
  var ProfilePage = () => {
9700
- const navigate = (0, import_react_router_dom12.useNavigate)();
9711
+ const navigate = (0, import_react_router_dom13.useNavigate)();
9701
9712
  const { user, account } = useAuth();
9702
9713
  if (!user) {
9703
9714
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h1", { children: "Please login to view your profile" }) });
@@ -9747,13 +9758,13 @@ var ProfilePage = () => {
9747
9758
  var ProfilePage_default = ProfilePage;
9748
9759
 
9749
9760
  // src/components/wallets/Wallets.tsx
9750
- var import_react_router_dom13 = require("react-router-dom");
9761
+ var import_react_router_dom14 = require("react-router-dom");
9751
9762
  var import_lucide_react25 = require("lucide-react");
9752
9763
  var import_react43 = require("react");
9753
9764
  var import_antd16 = require("antd");
9754
9765
  var import_jsx_runtime60 = require("react/jsx-runtime");
9755
9766
  function Wallets({ v, url }) {
9756
- const { branchId } = (0, import_react_router_dom13.useParams)();
9767
+ const { branchId } = (0, import_react_router_dom14.useParams)();
9757
9768
  const [deleteWallet, setDeleteWallet] = (0, import_react43.useState)(null);
9758
9769
  const { isLoading, remove } = useApis_default();
9759
9770
  const { data, TransactionViewComponent, reload } = useTransaction_default({
@@ -9762,7 +9773,7 @@ function Wallets({ v, url }) {
9762
9773
  dateFilter: false
9763
9774
  });
9764
9775
  const { Modal: Modal2 } = useModal();
9765
- const navigate = (0, import_react_router_dom13.useNavigate)();
9776
+ const navigate = (0, import_react_router_dom14.useNavigate)();
9766
9777
  const items = (data2) => [
9767
9778
  {
9768
9779
  label: `Edit Wallet`,
@@ -9885,90 +9896,10 @@ var import_react_hook_form15 = require("react-hook-form");
9885
9896
  var import_zod11 = require("@hookform/resolvers/zod");
9886
9897
  var import_antd17 = require("antd");
9887
9898
  var import_react44 = require("react");
9888
-
9889
- // src/components/wallets/Feilds/Wallet.tsx
9890
- var import_react_router_dom14 = require("react-router-dom");
9899
+ var import_react_router_dom15 = require("react-router-dom");
9891
9900
  var import_jsx_runtime61 = require("react/jsx-runtime");
9892
- function Wallet({
9893
- name,
9894
- label,
9895
- placeholder,
9896
- api,
9897
- form,
9898
- filter,
9899
- v = 1,
9900
- showBalance,
9901
- required
9902
- }) {
9903
- const { branchId } = (0, import_react_router_dom14.useParams)();
9904
- const walletId = form?.watch(name);
9905
- const { BalanceView } = useAccountBalance_default({
9906
- url: `${api}?id=${walletId}${branchId ? `&branch=${branchId}` : ""}`,
9907
- showBalance,
9908
- accountId: walletId
9909
- });
9910
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col gap-2", children: [
9911
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9912
- Fields_default.SearchApi,
9913
- {
9914
- name,
9915
- form,
9916
- label,
9917
- placeholder: placeholder || `Select ${name}`,
9918
- api: `${api}${branchId ? `?branch=${branchId}` : ""}`,
9919
- queryKey: "search",
9920
- filter,
9921
- v,
9922
- labelKey: "name",
9923
- valueKey: "_id",
9924
- required
9925
- }
9926
- ),
9927
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(BalanceView, {})
9928
- ] });
9929
- }
9930
- var Wallet_default = Wallet;
9931
-
9932
- // src/components/wallets/Feilds/Branches.tsx
9933
- var import_jsx_runtime62 = require("react/jsx-runtime");
9934
- function Branches2({
9935
- name = "branch",
9936
- label = "Branch",
9937
- placeholder = "Select Branch",
9938
- api = "/branches/get",
9939
- form,
9940
- filter,
9941
- showBalance,
9942
- required,
9943
- v
9944
- }) {
9945
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
9946
- Wallet_default,
9947
- {
9948
- name,
9949
- label,
9950
- placeholder,
9951
- api,
9952
- v,
9953
- form,
9954
- filter,
9955
- showBalance,
9956
- required
9957
- }
9958
- );
9959
- }
9960
- var Branches_default2 = Branches2;
9961
-
9962
- // src/components/wallets/Feilds/index.tsx
9963
- var WalletField = {
9964
- Wallet: Wallet_default,
9965
- Branches: Branches_default2
9966
- };
9967
- var Feilds_default2 = WalletField;
9968
-
9969
- // src/components/wallets/WalletForm.tsx
9970
- var import_jsx_runtime63 = require("react/jsx-runtime");
9971
9901
  function WalletForm() {
9902
+ const { branchId } = (0, import_react_router_dom15.useParams)();
9972
9903
  const { getQuery, navigate } = useApp_default();
9973
9904
  const id = getQuery("id");
9974
9905
  const isEdit = !!id;
@@ -9991,7 +9922,10 @@ function WalletForm() {
9991
9922
  if (isEdit) {
9992
9923
  await put({
9993
9924
  url: `/wallets/update/${id}`,
9994
- body: data
9925
+ body: {
9926
+ ...data,
9927
+ branch: branchId ? branchId : data.branch
9928
+ }
9995
9929
  });
9996
9930
  } else {
9997
9931
  await post({
@@ -10021,24 +9955,24 @@ function WalletForm() {
10021
9955
  fetches();
10022
9956
  }
10023
9957
  }, [id]);
10024
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
9958
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
10025
9959
  Card,
10026
9960
  {
10027
9961
  className: "max-w-4xl mx-auto mt-10 relative",
10028
9962
  isLoading: isLoadingGet,
10029
9963
  loadingText: "Processing...",
10030
9964
  children: [
10031
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Card.Header, { children: [
10032
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet` }),
10033
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Card.Description, { children: isEdit ? `Update the details for this wallet` : `Create a new wallet and add it to your list` })
9965
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Card.Header, { children: [
9966
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet` }),
9967
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Card.Description, { children: isEdit ? `Update the details for this wallet` : `Create a new wallet and add it to your list` })
10034
9968
  ] }),
10035
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
9969
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Card.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
10036
9970
  "form",
10037
9971
  {
10038
9972
  onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
10039
9973
  children: [
10040
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
10041
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
9974
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
9975
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
10042
9976
  Fields_default.Input,
10043
9977
  {
10044
9978
  label: "Name",
@@ -10049,7 +9983,7 @@ function WalletForm() {
10049
9983
  required: true
10050
9984
  }
10051
9985
  ),
10052
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
9986
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
10053
9987
  Fields_default.Select,
10054
9988
  {
10055
9989
  label: "Wallet Type",
@@ -10062,7 +9996,7 @@ function WalletForm() {
10062
9996
  }))
10063
9997
  }
10064
9998
  ),
10065
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
9999
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
10066
10000
  Fields_default.Select,
10067
10001
  {
10068
10002
  label: "Currency",
@@ -10075,7 +10009,7 @@ function WalletForm() {
10075
10009
  }))
10076
10010
  }
10077
10011
  ),
10078
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10012
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
10079
10013
  Fields_default.Input,
10080
10014
  {
10081
10015
  label: "Account Number",
@@ -10085,8 +10019,8 @@ function WalletForm() {
10085
10019
  placeholder: "Enter account number (optional)"
10086
10020
  }
10087
10021
  ),
10088
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10089
- Feilds_default2.Branches,
10022
+ !branchId && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
10023
+ Feilds_default.Branches,
10090
10024
  {
10091
10025
  label: "Branch",
10092
10026
  form: methods,
@@ -10096,7 +10030,7 @@ function WalletForm() {
10096
10030
  }
10097
10031
  )
10098
10032
  ] }),
10099
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10033
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
10100
10034
  Button,
10101
10035
  {
10102
10036
  isLoading,
@@ -10116,8 +10050,59 @@ function WalletForm() {
10116
10050
  }
10117
10051
  var WalletForm_default = WalletForm;
10118
10052
 
10053
+ // src/components/wallets/Feilds/Wallet.tsx
10054
+ var import_react_router_dom16 = require("react-router-dom");
10055
+ var import_jsx_runtime62 = require("react/jsx-runtime");
10056
+ function Wallet({
10057
+ name,
10058
+ label,
10059
+ placeholder,
10060
+ api,
10061
+ form,
10062
+ filter,
10063
+ v = 1,
10064
+ showBalance,
10065
+ required,
10066
+ disabled
10067
+ }) {
10068
+ const { branchId } = (0, import_react_router_dom16.useParams)();
10069
+ const walletId = form?.watch(name);
10070
+ const { BalanceView } = useAccountBalance_default({
10071
+ url: `${api}?id=${walletId}${branchId ? `&branch=${branchId}` : ""}`,
10072
+ showBalance,
10073
+ accountId: walletId
10074
+ });
10075
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col gap-2", children: [
10076
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
10077
+ Fields_default.SearchApi,
10078
+ {
10079
+ name,
10080
+ form,
10081
+ label,
10082
+ placeholder: placeholder || `Select ${name}`,
10083
+ api: `${api}${branchId ? `?branch=${branchId}` : ""}`,
10084
+ queryKey: "search",
10085
+ filter,
10086
+ v,
10087
+ labelKey: "name",
10088
+ valueKey: "_id",
10089
+ required,
10090
+ disabled
10091
+ }
10092
+ ),
10093
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(BalanceView, {})
10094
+ ] });
10095
+ }
10096
+ var Wallet_default = Wallet;
10097
+
10098
+ // src/components/wallets/Feilds/index.tsx
10099
+ var WalletField = {
10100
+ Wallet: Wallet_default
10101
+ };
10102
+ var Feilds_default2 = WalletField;
10103
+
10119
10104
  // src/components/ErrorPage/ErrorPage.tsx
10120
- var import_jsx_runtime64 = require("react/jsx-runtime");
10105
+ var import_jsx_runtime63 = require("react/jsx-runtime");
10121
10106
  var ErrorPageBase = ({
10122
10107
  title,
10123
10108
  message: message16,
@@ -10125,20 +10110,20 @@ var ErrorPageBase = ({
10125
10110
  action,
10126
10111
  className = ""
10127
10112
  }) => {
10128
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
10113
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10129
10114
  "div",
10130
10115
  {
10131
10116
  className: `flex-1 m-auto h-full w-full min-h-[50vh] flex flex-col items-center justify-center p-6 text-zinc-900 dark:text-zinc-100 ${className}`,
10132
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative flex flex-col items-center justify-center w-full max-w-2xl text-center", children: [
10133
- statusCode && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "absolute inset-0 flex items-center justify-center z-0 select-none pointer-events-none opacity-[0.03] dark:opacity-5", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-[12rem] sm:text-[16rem] md:text-[20rem] font-bold leading-none tracking-tighter", children: statusCode }) }),
10134
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative z-10 space-y-6", children: [
10135
- statusCode && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("h2", { className: "text-xl md:text-2xl font-semibold text-zinc-500 dark:text-zinc-400", children: [
10117
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative flex flex-col items-center justify-center w-full max-w-2xl text-center", children: [
10118
+ statusCode && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "absolute inset-0 flex items-center justify-center z-0 select-none pointer-events-none opacity-[0.03] dark:opacity-5", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-[12rem] sm:text-[16rem] md:text-[20rem] font-bold leading-none tracking-tighter", children: statusCode }) }),
10119
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative z-10 space-y-6", children: [
10120
+ statusCode && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("h2", { className: "text-xl md:text-2xl font-semibold text-zinc-500 dark:text-zinc-400", children: [
10136
10121
  "Error ",
10137
10122
  statusCode
10138
10123
  ] }),
10139
- title && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
10140
- message16 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message16 }),
10141
- action && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "pt-8", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
10124
+ title && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
10125
+ message16 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message16 }),
10126
+ action && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "pt-8", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10142
10127
  "button",
10143
10128
  {
10144
10129
  onClick: action.onClick,
@@ -10154,9 +10139,9 @@ var ErrorPageBase = ({
10154
10139
  };
10155
10140
 
10156
10141
  // src/components/ErrorPage/ErrorPage.500.tsx
10157
- var import_jsx_runtime65 = require("react/jsx-runtime");
10142
+ var import_jsx_runtime64 = require("react/jsx-runtime");
10158
10143
  var ErrorPage500 = (props) => {
10159
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
10144
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
10160
10145
  ErrorPageBase,
10161
10146
  {
10162
10147
  statusCode: 500,
@@ -10169,9 +10154,9 @@ var ErrorPage500 = (props) => {
10169
10154
  };
10170
10155
 
10171
10156
  // src/components/ErrorPage/ErrorPage.404.tsx
10172
- var import_jsx_runtime66 = require("react/jsx-runtime");
10157
+ var import_jsx_runtime65 = require("react/jsx-runtime");
10173
10158
  var ErrorPage404 = (props) => {
10174
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
10159
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
10175
10160
  ErrorPageBase,
10176
10161
  {
10177
10162
  statusCode: 404,
@@ -10184,9 +10169,9 @@ var ErrorPage404 = (props) => {
10184
10169
  };
10185
10170
 
10186
10171
  // src/components/ErrorPage/ErrorPage.401.tsx
10187
- var import_jsx_runtime67 = require("react/jsx-runtime");
10172
+ var import_jsx_runtime66 = require("react/jsx-runtime");
10188
10173
  var ErrorPage401 = (props) => {
10189
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
10174
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
10190
10175
  ErrorPageBase,
10191
10176
  {
10192
10177
  statusCode: 401,
@@ -10199,9 +10184,9 @@ var ErrorPage401 = (props) => {
10199
10184
  };
10200
10185
 
10201
10186
  // src/components/ErrorPage/ErrorPage.400.tsx
10202
- var import_jsx_runtime68 = require("react/jsx-runtime");
10187
+ var import_jsx_runtime67 = require("react/jsx-runtime");
10203
10188
  var ErrorPage400 = (props) => {
10204
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
10189
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
10205
10190
  ErrorPageBase,
10206
10191
  {
10207
10192
  statusCode: 400,
package/dist/index.mjs CHANGED
@@ -8336,7 +8336,8 @@ function Account({
8336
8336
  filter,
8337
8337
  v = 1,
8338
8338
  showBalance,
8339
- required
8339
+ required,
8340
+ disabled
8340
8341
  }) {
8341
8342
  const { branchId } = useParams3();
8342
8343
  const accountId = form?.watch(name);
@@ -8359,7 +8360,8 @@ function Account({
8359
8360
  v,
8360
8361
  labelKey: "name",
8361
8362
  valueKey: "_id",
8362
- required
8363
+ required,
8364
+ disabled
8363
8365
  }
8364
8366
  ),
8365
8367
  /* @__PURE__ */ jsx45(BalanceView, {})
@@ -8378,6 +8380,7 @@ function Customer({
8378
8380
  filter,
8379
8381
  showBalance,
8380
8382
  required,
8383
+ disabled,
8381
8384
  v
8382
8385
  }) {
8383
8386
  return /* @__PURE__ */ jsx46(
@@ -8391,7 +8394,8 @@ function Customer({
8391
8394
  form,
8392
8395
  filter,
8393
8396
  showBalance,
8394
- required
8397
+ required,
8398
+ disabled
8395
8399
  }
8396
8400
  );
8397
8401
  }
@@ -8408,6 +8412,7 @@ function Employee({
8408
8412
  filter,
8409
8413
  showBalance,
8410
8414
  required,
8415
+ disabled,
8411
8416
  v
8412
8417
  }) {
8413
8418
  return /* @__PURE__ */ jsx47(
@@ -8421,6 +8426,7 @@ function Employee({
8421
8426
  form,
8422
8427
  filter,
8423
8428
  required,
8429
+ disabled,
8424
8430
  showBalance
8425
8431
  }
8426
8432
  );
@@ -8438,7 +8444,8 @@ function Branches({
8438
8444
  filter,
8439
8445
  showBalance,
8440
8446
  required,
8441
- v
8447
+ v,
8448
+ disabled
8442
8449
  }) {
8443
8450
  return /* @__PURE__ */ jsx48(
8444
8451
  Account_default,
@@ -8451,7 +8458,8 @@ function Branches({
8451
8458
  form,
8452
8459
  filter,
8453
8460
  showBalance,
8454
- required
8461
+ required,
8462
+ disabled
8455
8463
  }
8456
8464
  );
8457
8465
  }
@@ -8467,8 +8475,10 @@ var AccountFields = {
8467
8475
  var Feilds_default = AccountFields;
8468
8476
 
8469
8477
  // src/components/accounts/AccountForm.tsx
8478
+ import { useParams as useParams4 } from "react-router-dom";
8470
8479
  import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
8471
8480
  function AccountForm() {
8481
+ const { branchId } = useParams4();
8472
8482
  const { getQuery, getParams, navigate } = useApp_default();
8473
8483
  const id = getQuery("id");
8474
8484
  const type = getParams("type");
@@ -8490,7 +8500,8 @@ function AccountForm() {
8490
8500
  try {
8491
8501
  const payload = {
8492
8502
  ...data,
8493
- type
8503
+ type,
8504
+ branch: branchId ? branchId : data.branch
8494
8505
  };
8495
8506
  if (isEdit) {
8496
8507
  await put({
@@ -8584,7 +8595,7 @@ function AccountForm() {
8584
8595
  placeholder: "Enter phone number"
8585
8596
  }
8586
8597
  ),
8587
- /* @__PURE__ */ jsx49(
8598
+ !branchId && /* @__PURE__ */ jsx49(
8588
8599
  Feilds_default.Branches,
8589
8600
  {
8590
8601
  label: "Branch",
@@ -9707,13 +9718,13 @@ var ProfilePage = () => {
9707
9718
  var ProfilePage_default = ProfilePage;
9708
9719
 
9709
9720
  // src/components/wallets/Wallets.tsx
9710
- import { useNavigate as useNavigate10, useParams as useParams5 } from "react-router-dom";
9721
+ import { useNavigate as useNavigate10, useParams as useParams6 } from "react-router-dom";
9711
9722
  import { EllipsisVertical as EllipsisVertical3, FilePenLine as FilePenLine2, Trash2 as Trash23 } from "lucide-react";
9712
9723
  import { useState as useState32 } from "react";
9713
9724
  import { message as message14 } from "antd";
9714
9725
  import { Fragment as Fragment13, jsx as jsx60, jsxs as jsxs46 } from "react/jsx-runtime";
9715
9726
  function Wallets({ v, url }) {
9716
- const { branchId } = useParams5();
9727
+ const { branchId } = useParams6();
9717
9728
  const [deleteWallet, setDeleteWallet] = useState32(null);
9718
9729
  const { isLoading, remove } = useApis_default();
9719
9730
  const { data, TransactionViewComponent, reload } = useTransaction_default({
@@ -9845,90 +9856,10 @@ import { useForm as useForm9 } from "react-hook-form";
9845
9856
  import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
9846
9857
  import { message as message15 } from "antd";
9847
9858
  import { useEffect as useEffect25 } from "react";
9848
-
9849
- // src/components/wallets/Feilds/Wallet.tsx
9850
- import { useParams as useParams6 } from "react-router-dom";
9859
+ import { useParams as useParams7 } from "react-router-dom";
9851
9860
  import { jsx as jsx61, jsxs as jsxs47 } from "react/jsx-runtime";
9852
- function Wallet({
9853
- name,
9854
- label,
9855
- placeholder,
9856
- api,
9857
- form,
9858
- filter,
9859
- v = 1,
9860
- showBalance,
9861
- required
9862
- }) {
9863
- const { branchId } = useParams6();
9864
- const walletId = form?.watch(name);
9865
- const { BalanceView } = useAccountBalance_default({
9866
- url: `${api}?id=${walletId}${branchId ? `&branch=${branchId}` : ""}`,
9867
- showBalance,
9868
- accountId: walletId
9869
- });
9870
- return /* @__PURE__ */ jsxs47("div", { className: "flex flex-col gap-2", children: [
9871
- /* @__PURE__ */ jsx61(
9872
- Fields_default.SearchApi,
9873
- {
9874
- name,
9875
- form,
9876
- label,
9877
- placeholder: placeholder || `Select ${name}`,
9878
- api: `${api}${branchId ? `?branch=${branchId}` : ""}`,
9879
- queryKey: "search",
9880
- filter,
9881
- v,
9882
- labelKey: "name",
9883
- valueKey: "_id",
9884
- required
9885
- }
9886
- ),
9887
- /* @__PURE__ */ jsx61(BalanceView, {})
9888
- ] });
9889
- }
9890
- var Wallet_default = Wallet;
9891
-
9892
- // src/components/wallets/Feilds/Branches.tsx
9893
- import { jsx as jsx62 } from "react/jsx-runtime";
9894
- function Branches2({
9895
- name = "branch",
9896
- label = "Branch",
9897
- placeholder = "Select Branch",
9898
- api = "/branches/get",
9899
- form,
9900
- filter,
9901
- showBalance,
9902
- required,
9903
- v
9904
- }) {
9905
- return /* @__PURE__ */ jsx62(
9906
- Wallet_default,
9907
- {
9908
- name,
9909
- label,
9910
- placeholder,
9911
- api,
9912
- v,
9913
- form,
9914
- filter,
9915
- showBalance,
9916
- required
9917
- }
9918
- );
9919
- }
9920
- var Branches_default2 = Branches2;
9921
-
9922
- // src/components/wallets/Feilds/index.tsx
9923
- var WalletField = {
9924
- Wallet: Wallet_default,
9925
- Branches: Branches_default2
9926
- };
9927
- var Feilds_default2 = WalletField;
9928
-
9929
- // src/components/wallets/WalletForm.tsx
9930
- import { jsx as jsx63, jsxs as jsxs48 } from "react/jsx-runtime";
9931
9861
  function WalletForm() {
9862
+ const { branchId } = useParams7();
9932
9863
  const { getQuery, navigate } = useApp_default();
9933
9864
  const id = getQuery("id");
9934
9865
  const isEdit = !!id;
@@ -9951,7 +9882,10 @@ function WalletForm() {
9951
9882
  if (isEdit) {
9952
9883
  await put({
9953
9884
  url: `/wallets/update/${id}`,
9954
- body: data
9885
+ body: {
9886
+ ...data,
9887
+ branch: branchId ? branchId : data.branch
9888
+ }
9955
9889
  });
9956
9890
  } else {
9957
9891
  await post({
@@ -9981,24 +9915,24 @@ function WalletForm() {
9981
9915
  fetches();
9982
9916
  }
9983
9917
  }, [id]);
9984
- return /* @__PURE__ */ jsxs48(
9918
+ return /* @__PURE__ */ jsxs47(
9985
9919
  Card,
9986
9920
  {
9987
9921
  className: "max-w-4xl mx-auto mt-10 relative",
9988
9922
  isLoading: isLoadingGet,
9989
9923
  loadingText: "Processing...",
9990
9924
  children: [
9991
- /* @__PURE__ */ jsxs48(Card.Header, { children: [
9992
- /* @__PURE__ */ jsx63(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet` }),
9993
- /* @__PURE__ */ jsx63(Card.Description, { children: isEdit ? `Update the details for this wallet` : `Create a new wallet and add it to your list` })
9925
+ /* @__PURE__ */ jsxs47(Card.Header, { children: [
9926
+ /* @__PURE__ */ jsx61(Card.Title, { children: `${isEdit ? "Edit" : "Add"} Wallet` }),
9927
+ /* @__PURE__ */ jsx61(Card.Description, { children: isEdit ? `Update the details for this wallet` : `Create a new wallet and add it to your list` })
9994
9928
  ] }),
9995
- /* @__PURE__ */ jsx63(Card.Content, { children: /* @__PURE__ */ jsxs48(
9929
+ /* @__PURE__ */ jsx61(Card.Content, { children: /* @__PURE__ */ jsxs47(
9996
9930
  "form",
9997
9931
  {
9998
9932
  onSubmit: handleSubmit(onSubmit, (errors) => console.log(errors)),
9999
9933
  children: [
10000
- /* @__PURE__ */ jsxs48("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
10001
- /* @__PURE__ */ jsx63(
9934
+ /* @__PURE__ */ jsxs47("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
9935
+ /* @__PURE__ */ jsx61(
10002
9936
  Fields_default.Input,
10003
9937
  {
10004
9938
  label: "Name",
@@ -10009,7 +9943,7 @@ function WalletForm() {
10009
9943
  required: true
10010
9944
  }
10011
9945
  ),
10012
- /* @__PURE__ */ jsx63(
9946
+ /* @__PURE__ */ jsx61(
10013
9947
  Fields_default.Select,
10014
9948
  {
10015
9949
  label: "Wallet Type",
@@ -10022,7 +9956,7 @@ function WalletForm() {
10022
9956
  }))
10023
9957
  }
10024
9958
  ),
10025
- /* @__PURE__ */ jsx63(
9959
+ /* @__PURE__ */ jsx61(
10026
9960
  Fields_default.Select,
10027
9961
  {
10028
9962
  label: "Currency",
@@ -10035,7 +9969,7 @@ function WalletForm() {
10035
9969
  }))
10036
9970
  }
10037
9971
  ),
10038
- /* @__PURE__ */ jsx63(
9972
+ /* @__PURE__ */ jsx61(
10039
9973
  Fields_default.Input,
10040
9974
  {
10041
9975
  label: "Account Number",
@@ -10045,8 +9979,8 @@ function WalletForm() {
10045
9979
  placeholder: "Enter account number (optional)"
10046
9980
  }
10047
9981
  ),
10048
- /* @__PURE__ */ jsx63(
10049
- Feilds_default2.Branches,
9982
+ !branchId && /* @__PURE__ */ jsx61(
9983
+ Feilds_default.Branches,
10050
9984
  {
10051
9985
  label: "Branch",
10052
9986
  form: methods,
@@ -10056,7 +9990,7 @@ function WalletForm() {
10056
9990
  }
10057
9991
  )
10058
9992
  ] }),
10059
- /* @__PURE__ */ jsx63("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx63(
9993
+ /* @__PURE__ */ jsx61("footer", { className: "flex justify-end mt-4", children: /* @__PURE__ */ jsx61(
10060
9994
  Button,
10061
9995
  {
10062
9996
  isLoading,
@@ -10076,8 +10010,59 @@ function WalletForm() {
10076
10010
  }
10077
10011
  var WalletForm_default = WalletForm;
10078
10012
 
10013
+ // src/components/wallets/Feilds/Wallet.tsx
10014
+ import { useParams as useParams8 } from "react-router-dom";
10015
+ import { jsx as jsx62, jsxs as jsxs48 } from "react/jsx-runtime";
10016
+ function Wallet({
10017
+ name,
10018
+ label,
10019
+ placeholder,
10020
+ api,
10021
+ form,
10022
+ filter,
10023
+ v = 1,
10024
+ showBalance,
10025
+ required,
10026
+ disabled
10027
+ }) {
10028
+ const { branchId } = useParams8();
10029
+ const walletId = form?.watch(name);
10030
+ const { BalanceView } = useAccountBalance_default({
10031
+ url: `${api}?id=${walletId}${branchId ? `&branch=${branchId}` : ""}`,
10032
+ showBalance,
10033
+ accountId: walletId
10034
+ });
10035
+ return /* @__PURE__ */ jsxs48("div", { className: "flex flex-col gap-2", children: [
10036
+ /* @__PURE__ */ jsx62(
10037
+ Fields_default.SearchApi,
10038
+ {
10039
+ name,
10040
+ form,
10041
+ label,
10042
+ placeholder: placeholder || `Select ${name}`,
10043
+ api: `${api}${branchId ? `?branch=${branchId}` : ""}`,
10044
+ queryKey: "search",
10045
+ filter,
10046
+ v,
10047
+ labelKey: "name",
10048
+ valueKey: "_id",
10049
+ required,
10050
+ disabled
10051
+ }
10052
+ ),
10053
+ /* @__PURE__ */ jsx62(BalanceView, {})
10054
+ ] });
10055
+ }
10056
+ var Wallet_default = Wallet;
10057
+
10058
+ // src/components/wallets/Feilds/index.tsx
10059
+ var WalletField = {
10060
+ Wallet: Wallet_default
10061
+ };
10062
+ var Feilds_default2 = WalletField;
10063
+
10079
10064
  // src/components/ErrorPage/ErrorPage.tsx
10080
- import { jsx as jsx64, jsxs as jsxs49 } from "react/jsx-runtime";
10065
+ import { jsx as jsx63, jsxs as jsxs49 } from "react/jsx-runtime";
10081
10066
  var ErrorPageBase = ({
10082
10067
  title,
10083
10068
  message: message16,
@@ -10085,20 +10070,20 @@ var ErrorPageBase = ({
10085
10070
  action,
10086
10071
  className = ""
10087
10072
  }) => {
10088
- return /* @__PURE__ */ jsx64(
10073
+ return /* @__PURE__ */ jsx63(
10089
10074
  "div",
10090
10075
  {
10091
10076
  className: `flex-1 m-auto h-full w-full min-h-[50vh] flex flex-col items-center justify-center p-6 text-zinc-900 dark:text-zinc-100 ${className}`,
10092
10077
  children: /* @__PURE__ */ jsxs49("div", { className: "relative flex flex-col items-center justify-center w-full max-w-2xl text-center", children: [
10093
- statusCode && /* @__PURE__ */ jsx64("div", { className: "absolute inset-0 flex items-center justify-center z-0 select-none pointer-events-none opacity-[0.03] dark:opacity-5", children: /* @__PURE__ */ jsx64("span", { className: "text-[12rem] sm:text-[16rem] md:text-[20rem] font-bold leading-none tracking-tighter", children: statusCode }) }),
10078
+ statusCode && /* @__PURE__ */ jsx63("div", { className: "absolute inset-0 flex items-center justify-center z-0 select-none pointer-events-none opacity-[0.03] dark:opacity-5", children: /* @__PURE__ */ jsx63("span", { className: "text-[12rem] sm:text-[16rem] md:text-[20rem] font-bold leading-none tracking-tighter", children: statusCode }) }),
10094
10079
  /* @__PURE__ */ jsxs49("div", { className: "relative z-10 space-y-6", children: [
10095
10080
  statusCode && /* @__PURE__ */ jsxs49("h2", { className: "text-xl md:text-2xl font-semibold text-zinc-500 dark:text-zinc-400", children: [
10096
10081
  "Error ",
10097
10082
  statusCode
10098
10083
  ] }),
10099
- title && /* @__PURE__ */ jsx64("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
10100
- message16 && /* @__PURE__ */ jsx64("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message16 }),
10101
- action && /* @__PURE__ */ jsx64("div", { className: "pt-8", children: /* @__PURE__ */ jsx64(
10084
+ title && /* @__PURE__ */ jsx63("h1", { className: "text-4xl md:text-5xl font-extrabold tracking-tight drop-shadow-sm", children: title }),
10085
+ message16 && /* @__PURE__ */ jsx63("p", { className: "text-lg md:text-xl text-zinc-600 dark:text-zinc-400 max-w-md mx-auto", children: message16 }),
10086
+ action && /* @__PURE__ */ jsx63("div", { className: "pt-8", children: /* @__PURE__ */ jsx63(
10102
10087
  "button",
10103
10088
  {
10104
10089
  onClick: action.onClick,
@@ -10114,9 +10099,9 @@ var ErrorPageBase = ({
10114
10099
  };
10115
10100
 
10116
10101
  // src/components/ErrorPage/ErrorPage.500.tsx
10117
- import { jsx as jsx65 } from "react/jsx-runtime";
10102
+ import { jsx as jsx64 } from "react/jsx-runtime";
10118
10103
  var ErrorPage500 = (props) => {
10119
- return /* @__PURE__ */ jsx65(
10104
+ return /* @__PURE__ */ jsx64(
10120
10105
  ErrorPageBase,
10121
10106
  {
10122
10107
  statusCode: 500,
@@ -10129,9 +10114,9 @@ var ErrorPage500 = (props) => {
10129
10114
  };
10130
10115
 
10131
10116
  // src/components/ErrorPage/ErrorPage.404.tsx
10132
- import { jsx as jsx66 } from "react/jsx-runtime";
10117
+ import { jsx as jsx65 } from "react/jsx-runtime";
10133
10118
  var ErrorPage404 = (props) => {
10134
- return /* @__PURE__ */ jsx66(
10119
+ return /* @__PURE__ */ jsx65(
10135
10120
  ErrorPageBase,
10136
10121
  {
10137
10122
  statusCode: 404,
@@ -10144,9 +10129,9 @@ var ErrorPage404 = (props) => {
10144
10129
  };
10145
10130
 
10146
10131
  // src/components/ErrorPage/ErrorPage.401.tsx
10147
- import { jsx as jsx67 } from "react/jsx-runtime";
10132
+ import { jsx as jsx66 } from "react/jsx-runtime";
10148
10133
  var ErrorPage401 = (props) => {
10149
- return /* @__PURE__ */ jsx67(
10134
+ return /* @__PURE__ */ jsx66(
10150
10135
  ErrorPageBase,
10151
10136
  {
10152
10137
  statusCode: 401,
@@ -10159,9 +10144,9 @@ var ErrorPage401 = (props) => {
10159
10144
  };
10160
10145
 
10161
10146
  // src/components/ErrorPage/ErrorPage.400.tsx
10162
- import { jsx as jsx68 } from "react/jsx-runtime";
10147
+ import { jsx as jsx67 } from "react/jsx-runtime";
10163
10148
  var ErrorPage400 = (props) => {
10164
- return /* @__PURE__ */ jsx68(
10149
+ return /* @__PURE__ */ jsx67(
10165
10150
  ErrorPageBase,
10166
10151
  {
10167
10152
  statusCode: 400,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "warqadui",
3
- "version": "0.0.86",
3
+ "version": "0.0.87",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",