@bluemarble/bm-components 1.17.0 → 1.17.2

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.mjs CHANGED
@@ -2404,7 +2404,7 @@ function createBox(options = {}) {
2404
2404
  const BoxRoot = styled("div", {
2405
2405
  shouldForwardProp: (prop) => prop !== "theme" && prop !== "sx" && prop !== "as"
2406
2406
  })(styleFunctionSx_default);
2407
- const Box8 = /* @__PURE__ */ React3.forwardRef(function Box9(inProps, ref) {
2407
+ const Box9 = /* @__PURE__ */ React3.forwardRef(function Box10(inProps, ref) {
2408
2408
  const theme = useTheme_default(defaultTheme);
2409
2409
  const _extendSxProp = extendSxProp(inProps), {
2410
2410
  className,
@@ -2417,7 +2417,7 @@ function createBox(options = {}) {
2417
2417
  theme: themeId ? theme[themeId] || theme : theme
2418
2418
  }, other));
2419
2419
  });
2420
- return Box8;
2420
+ return Box9;
2421
2421
  }
2422
2422
 
2423
2423
  // node_modules/@mui/utils/generateUtilityClass/generateUtilityClass.js
@@ -4157,6 +4157,175 @@ var DialogConfirm = (props) => {
4157
4157
  ))))));
4158
4158
  };
4159
4159
 
4160
+ // src/components/BaseDialog/BaseDialog.tsx
4161
+ import React28 from "react";
4162
+
4163
+ // src/components/BaseDialog/BaseDialogHook.ts
4164
+ import { useContext as useContext2 } from "react";
4165
+
4166
+ // src/components/BaseDialog/BaseDialogContext.tsx
4167
+ import React25 from "react";
4168
+ import { createContext, useCallback, useState as useState5 } from "react";
4169
+ var BaseDialogContext = createContext({});
4170
+ var BaseDialogProvider = (props) => {
4171
+ const [openedDialogs, setOpenedDialogs] = useState5([]);
4172
+ const isOpened = useCallback(
4173
+ (dialog) => {
4174
+ return openedDialogs.includes(dialog);
4175
+ },
4176
+ [openedDialogs]
4177
+ );
4178
+ const toggleDialog = useCallback(
4179
+ (dialog) => {
4180
+ return openedDialogs.includes(dialog);
4181
+ },
4182
+ [openedDialogs]
4183
+ );
4184
+ const openDialog = useCallback((dialog) => {
4185
+ return setOpenedDialogs((prev) => {
4186
+ const filteredArr = prev.filter((item) => item !== dialog);
4187
+ return [...filteredArr, dialog];
4188
+ });
4189
+ }, []);
4190
+ const closeDialog = useCallback((dialog) => {
4191
+ return setOpenedDialogs((prev) => prev.filter((item) => item !== dialog));
4192
+ }, []);
4193
+ const closeAllDialogs = useCallback(() => {
4194
+ return setOpenedDialogs([]);
4195
+ }, [openedDialogs]);
4196
+ return /* @__PURE__ */ React25.createElement(
4197
+ BaseDialogContext.Provider,
4198
+ {
4199
+ value: {
4200
+ opened: openedDialogs,
4201
+ isOpened,
4202
+ toggle: toggleDialog,
4203
+ open: openDialog,
4204
+ closeAll: closeAllDialogs,
4205
+ close: closeDialog
4206
+ }
4207
+ },
4208
+ props.children
4209
+ );
4210
+ };
4211
+
4212
+ // src/components/BaseDialog/BaseDialogInstanceContext.tsx
4213
+ import React26 from "react";
4214
+ import { createContext as createContext2 } from "react";
4215
+ var BaseDialogInstanceContext = createContext2(
4216
+ {}
4217
+ );
4218
+ var BaseDialogInstanceProvider = (props) => {
4219
+ const actions = useBaseDialog();
4220
+ return /* @__PURE__ */ React26.createElement(BaseDialogInstanceContext.Provider, { value: { name: props.name, actions } }, props.children);
4221
+ };
4222
+
4223
+ // src/components/BaseDialog/BaseDialogHook.ts
4224
+ function useBaseDialog() {
4225
+ return useContext2(BaseDialogContext);
4226
+ }
4227
+ function useBaseDialogInstance() {
4228
+ return useContext2(BaseDialogInstanceContext);
4229
+ }
4230
+
4231
+ // src/components/BaseDialog/BaseDialog.tsx
4232
+ import { Box as Box8, Button as Button4 } from "@mui/material";
4233
+
4234
+ // src/components/BaseDialog/BaseDialogHeader.tsx
4235
+ import React27 from "react";
4236
+ import {
4237
+ IconButton as IconButton4,
4238
+ Stack as Stack3,
4239
+ Typography as Typography4
4240
+ } from "@mui/material";
4241
+ import { MdClose as MdClose2 } from "react-icons/md";
4242
+ var BaseDialogHeader = (_a) => {
4243
+ var _b = _a, {
4244
+ title,
4245
+ onClose,
4246
+ IconButtonProps,
4247
+ TypographyProps: TypographyProps2
4248
+ } = _b, props = __objRest(_b, [
4249
+ "title",
4250
+ "onClose",
4251
+ "IconButtonProps",
4252
+ "TypographyProps"
4253
+ ]);
4254
+ const { name } = useBaseDialogInstance();
4255
+ const { close: closeDialog } = useBaseDialog();
4256
+ function handleClose() {
4257
+ if (onClose)
4258
+ return onClose();
4259
+ closeDialog(name);
4260
+ }
4261
+ return /* @__PURE__ */ React27.createElement(
4262
+ Stack3,
4263
+ __spreadValues({
4264
+ direction: "row",
4265
+ alignItems: "center",
4266
+ justifyContent: "space-between",
4267
+ px: 2,
4268
+ my: 1
4269
+ }, props),
4270
+ /* @__PURE__ */ React27.createElement(Typography4, __spreadValues({ variant: "h6", fontWeight: "bold" }, TypographyProps2), title),
4271
+ /* @__PURE__ */ React27.createElement(IconButton4, __spreadProps(__spreadValues({}, IconButtonProps), { onClick: handleClose }), /* @__PURE__ */ React27.createElement(MdClose2, null))
4272
+ );
4273
+ };
4274
+
4275
+ // src/components/BaseDialog/BaseDialog.tsx
4276
+ var BaseDialogContainer = (_a) => {
4277
+ var _b = _a, {
4278
+ children
4279
+ } = _b, rest = __objRest(_b, [
4280
+ "children"
4281
+ ]);
4282
+ const { name } = useBaseDialogInstance();
4283
+ const { isOpened, close: closeDialog } = useBaseDialog();
4284
+ return /* @__PURE__ */ React28.createElement(Modal, __spreadValues({ open: isOpened(name), onClose: () => closeDialog(name) }, rest), children instanceof Function ? children({ close: () => closeDialog(name) }) : children);
4285
+ };
4286
+ var BaseDialogBody = (props) => {
4287
+ return /* @__PURE__ */ React28.createElement(Box8, __spreadValues({ px: 2, pb: 2, width: "100vw", maxWidth: 650 }, props), props.children);
4288
+ };
4289
+ var BaseDialogTrigger = (_a) => {
4290
+ var _b = _a, {
4291
+ name,
4292
+ onClick
4293
+ } = _b, props = __objRest(_b, [
4294
+ "name",
4295
+ "onClick"
4296
+ ]);
4297
+ const { open } = useBaseDialog();
4298
+ return /* @__PURE__ */ React28.createElement(
4299
+ Button4,
4300
+ __spreadProps(__spreadValues({}, props), {
4301
+ onClick: (...params) => {
4302
+ if (onClick)
4303
+ onClick(...params);
4304
+ open(name);
4305
+ }
4306
+ }),
4307
+ props.children
4308
+ );
4309
+ };
4310
+ var BaseDialogCreate = (name = Symbol()) => {
4311
+ return {
4312
+ Trigger: (props) => /* @__PURE__ */ React28.createElement(BaseDialogTrigger, __spreadValues({ name }, props)),
4313
+ Root: (props) => /* @__PURE__ */ React28.createElement(BaseDialogInstanceProvider, __spreadValues({ name }, props)),
4314
+ Container: BaseDialogContainer,
4315
+ Header: BaseDialogHeader,
4316
+ Body: BaseDialogBody
4317
+ };
4318
+ };
4319
+ var BaseDialog = {
4320
+ Create: BaseDialogCreate,
4321
+ Trigger: BaseDialogTrigger,
4322
+ Provider: BaseDialogProvider,
4323
+ Root: BaseDialogInstanceProvider,
4324
+ Container: BaseDialogContainer,
4325
+ Header: BaseDialogHeader,
4326
+ Body: BaseDialogBody
4327
+ };
4328
+
4160
4329
  // src/errors/HttpError.ts
4161
4330
  var HttpError = class extends Error {
4162
4331
  constructor(status, message) {
@@ -4270,21 +4439,21 @@ var ApiHelper = class _ApiHelper {
4270
4439
  };
4271
4440
 
4272
4441
  // src/hooks/useFormHelper.ts
4273
- import { useCallback as useCallback3, useContext as useContext3, useEffect as useEffect4, useRef as useRef4 } from "react";
4442
+ import { useCallback as useCallback4, useContext as useContext4, useEffect as useEffect4, useRef as useRef4 } from "react";
4274
4443
 
4275
4444
  // src/hooks/useAlert.ts
4276
- import { useContext as useContext2 } from "react";
4445
+ import { useContext as useContext3 } from "react";
4277
4446
 
4278
4447
  // src/contexts/AlertContext.tsx
4279
- import React26, { useCallback } from "react";
4280
- import { createContext, useState as useState5 } from "react";
4448
+ import React30, { useCallback as useCallback2 } from "react";
4449
+ import { createContext as createContext3, useState as useState6 } from "react";
4281
4450
 
4282
4451
  // src/components/Toast/index.tsx
4283
- import React25 from "react";
4284
- import { Alert, IconButton as IconButton4, Snackbar } from "@mui/material";
4285
- import { MdClose as MdClose2 } from "react-icons/md";
4452
+ import React29 from "react";
4453
+ import { Alert, IconButton as IconButton5, Snackbar } from "@mui/material";
4454
+ import { MdClose as MdClose3 } from "react-icons/md";
4286
4455
  var Toast = ({ open, onClose, severity, message }) => {
4287
- return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(
4456
+ return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(
4288
4457
  Snackbar,
4289
4458
  {
4290
4459
  open,
@@ -4293,20 +4462,20 @@ var Toast = ({ open, onClose, severity, message }) => {
4293
4462
  anchorOrigin: { vertical: "top", horizontal: "right" },
4294
4463
  sx: { zIndex: 99999999 }
4295
4464
  },
4296
- /* @__PURE__ */ React25.createElement(
4465
+ /* @__PURE__ */ React29.createElement(
4297
4466
  Alert,
4298
4467
  {
4299
4468
  severity,
4300
4469
  elevation: 2,
4301
- action: /* @__PURE__ */ React25.createElement(
4302
- IconButton4,
4470
+ action: /* @__PURE__ */ React29.createElement(
4471
+ IconButton5,
4303
4472
  {
4304
4473
  "aria-label": "close",
4305
4474
  color: "inherit",
4306
4475
  size: "small",
4307
4476
  onClick: onClose
4308
4477
  },
4309
- /* @__PURE__ */ React25.createElement(MdClose2, { fontSize: "inherit" })
4478
+ /* @__PURE__ */ React29.createElement(MdClose3, { fontSize: "inherit" })
4310
4479
  )
4311
4480
  },
4312
4481
  message
@@ -4315,12 +4484,12 @@ var Toast = ({ open, onClose, severity, message }) => {
4315
4484
  };
4316
4485
 
4317
4486
  // src/contexts/AlertContext.tsx
4318
- var AlertContext = createContext({});
4487
+ var AlertContext = createContext3({});
4319
4488
  var AlertProvider = ({ children }) => {
4320
- const [severity, setSeverity] = useState5("info");
4321
- const [message, setMessage] = useState5("");
4322
- const [isVisible, setIsVisible] = useState5(false);
4323
- const createAlert = useCallback(
4489
+ const [severity, setSeverity] = useState6("info");
4490
+ const [message, setMessage] = useState6("");
4491
+ const [isVisible, setIsVisible] = useState6(false);
4492
+ const createAlert = useCallback2(
4324
4493
  (newMessage, severity2) => {
4325
4494
  setMessage(newMessage);
4326
4495
  setSeverity(severity2);
@@ -4328,10 +4497,10 @@ var AlertProvider = ({ children }) => {
4328
4497
  },
4329
4498
  []
4330
4499
  );
4331
- const onCloseToast = useCallback(() => {
4500
+ const onCloseToast = useCallback2(() => {
4332
4501
  setIsVisible(false);
4333
4502
  }, []);
4334
- return /* @__PURE__ */ React26.createElement(AlertContext.Provider, { value: { createAlert } }, children, /* @__PURE__ */ React26.createElement(
4503
+ return /* @__PURE__ */ React30.createElement(AlertContext.Provider, { value: { createAlert } }, children, /* @__PURE__ */ React30.createElement(
4335
4504
  Toast,
4336
4505
  {
4337
4506
  open: isVisible,
@@ -4344,15 +4513,15 @@ var AlertProvider = ({ children }) => {
4344
4513
 
4345
4514
  // src/hooks/useAlert.ts
4346
4515
  var useAlert = () => {
4347
- return useContext2(AlertContext);
4516
+ return useContext3(AlertContext);
4348
4517
  };
4349
4518
 
4350
4519
  // src/hooks/useLoading.ts
4351
- import { useCallback as useCallback2, useState as useState6 } from "react";
4520
+ import { useCallback as useCallback3, useState as useState7 } from "react";
4352
4521
  function useLoading() {
4353
- const [state, setState] = useState6([]);
4354
- const isLoading = useCallback2((prop) => state.includes(prop), [state]);
4355
- const setLoading = useCallback2((prop, remove) => {
4522
+ const [state, setState] = useState7([]);
4523
+ const isLoading = useCallback3((prop) => state.includes(prop), [state]);
4524
+ const setLoading = useCallback3((prop, remove) => {
4356
4525
  if (remove)
4357
4526
  setState((prevState) => prevState.filter((state2) => state2 !== prop));
4358
4527
  else
@@ -4362,22 +4531,22 @@ function useLoading() {
4362
4531
  }
4363
4532
 
4364
4533
  // src/contexts/FormHelperProvider.tsx
4365
- import React27 from "react";
4366
- import { createContext as createContext2 } from "react";
4367
- var FormHelperContext = createContext2({});
4534
+ import React31 from "react";
4535
+ import { createContext as createContext4 } from "react";
4536
+ var FormHelperContext = createContext4({});
4368
4537
  var FormHelperProvider = ({ formatErrorMessage, api, children }) => {
4369
- return /* @__PURE__ */ React27.createElement(FormHelperContext.Provider, { value: { formatErrorMessage, api } }, children);
4538
+ return /* @__PURE__ */ React31.createElement(FormHelperContext.Provider, { value: { formatErrorMessage, api } }, children);
4370
4539
  };
4371
4540
 
4372
4541
  // src/hooks/useFormHelper.ts
4373
4542
  function useFormHelper() {
4374
4543
  const alertProps = useAlert();
4375
4544
  const loadingProps = useLoading();
4376
- const { api, formatErrorMessage } = useContext3(FormHelperContext);
4545
+ const { api, formatErrorMessage } = useContext4(FormHelperContext);
4377
4546
  const { createAlert } = alertProps;
4378
4547
  const { setLoading } = loadingProps;
4379
4548
  const sourceRef = useRef4(new AbortController());
4380
- const onSubmitWrapper = useCallback3(
4549
+ const onSubmitWrapper = useCallback4(
4381
4550
  (fn, { name }) => {
4382
4551
  return (fields, methods) => __async(this, null, function* () {
4383
4552
  const LOADING_NAME = name;
@@ -4393,7 +4562,7 @@ function useFormHelper() {
4393
4562
  },
4394
4563
  [setLoading]
4395
4564
  );
4396
- const onRequestWrapper = useCallback3(
4565
+ const onRequestWrapper = useCallback4(
4397
4566
  (fn, { name }) => {
4398
4567
  return (...params) => __async(this, null, function* () {
4399
4568
  const LOADING_NAME = name;
@@ -4421,7 +4590,7 @@ function useFormHelper() {
4421
4590
  },
4422
4591
  [setLoading, api]
4423
4592
  );
4424
- const errorHandler = useCallback3(
4593
+ const errorHandler = useCallback4(
4425
4594
  (error, callback) => {
4426
4595
  if ((error == null ? void 0 : error.message) === "cancel.navigation")
4427
4596
  return;
@@ -4727,11 +4896,11 @@ var AuthHelper = class {
4727
4896
  };
4728
4897
 
4729
4898
  // src/hooks/useGrid.ts
4730
- import { useCallback as useCallback5, useEffect as useEffect5, useMemo as useMemo3, useState as useState8 } from "react";
4899
+ import { useCallback as useCallback6, useEffect as useEffect5, useMemo as useMemo3, useState as useState9 } from "react";
4731
4900
 
4732
4901
  // src/hooks/useFilter.ts
4733
4902
  import moment2 from "moment";
4734
- import { useCallback as useCallback4, useState as useState7 } from "react";
4903
+ import { useCallback as useCallback5, useState as useState8 } from "react";
4735
4904
 
4736
4905
  // src/components/utils/getObjectValue.ts
4737
4906
  function getObjectValue(obj) {
@@ -4746,11 +4915,11 @@ function getObjectValue(obj) {
4746
4915
 
4747
4916
  // src/hooks/useFilter.ts
4748
4917
  function useFilter(props = { defaultFilters: [] }) {
4749
- const [selectedFilters, setSelectedFilters] = useState7(() => {
4918
+ const [selectedFilters, setSelectedFilters] = useState8(() => {
4750
4919
  const { defaultFilters } = props;
4751
4920
  return defaultFilters || [];
4752
4921
  });
4753
- const filterBy = useCallback4((newFilter) => {
4922
+ const filterBy = useCallback5((newFilter) => {
4754
4923
  const propToCompare = (newFilter == null ? void 0 : newFilter.id) ? "id" : "prop";
4755
4924
  function removeRepeatedFilters(filter) {
4756
4925
  return filter[propToCompare] !== newFilter[propToCompare];
@@ -4760,7 +4929,7 @@ function useFilter(props = { defaultFilters: [] }) {
4760
4929
  newFilter
4761
4930
  ]);
4762
4931
  }, []);
4763
- const removeFilter = useCallback4(
4932
+ const removeFilter = useCallback5(
4764
4933
  (prop, isId) => {
4765
4934
  const propToCompare = isId ? "id" : "prop";
4766
4935
  setSelectedFilters(
@@ -4837,13 +5006,13 @@ function useGrid({
4837
5006
  defaultCurrentPage,
4838
5007
  defaultSortedBy
4839
5008
  }) {
4840
- const [defaultData, setDefaultData] = useState8(externalDefaultData || []);
4841
- const [sortedBy, setSortedBy] = useState8(
5009
+ const [defaultData, setDefaultData] = useState9(externalDefaultData || []);
5010
+ const [sortedBy, setSortedBy] = useState9(
4842
5011
  defaultSortedBy || []
4843
5012
  );
4844
- const [currentPage, setCurrentPage] = useState8(defaultCurrentPage || 0);
4845
- const [rowsPerPage, setRowsPerPage] = useState8(rowsPerPageOptions[0]);
4846
- const toggleSortedDirection = useCallback5(
5013
+ const [currentPage, setCurrentPage] = useState9(defaultCurrentPage || 0);
5014
+ const [rowsPerPage, setRowsPerPage] = useState9(rowsPerPageOptions[0]);
5015
+ const toggleSortedDirection = useCallback6(
4847
5016
  (direction) => {
4848
5017
  if (direction === "asc")
4849
5018
  return "desc";
@@ -4851,16 +5020,16 @@ function useGrid({
4851
5020
  },
4852
5021
  []
4853
5022
  );
4854
- const clearSort = useCallback5(() => {
5023
+ const clearSort = useCallback6(() => {
4855
5024
  setSortedBy([]);
4856
5025
  }, []);
4857
- const appendSort = useCallback5((prop, direction) => {
5026
+ const appendSort = useCallback6((prop, direction) => {
4858
5027
  setSortedBy((prev) => [...prev, { prop, direction }]);
4859
5028
  }, []);
4860
- const setSort = useCallback5((prop, direction) => {
5029
+ const setSort = useCallback6((prop, direction) => {
4861
5030
  setSortedBy([{ prop, direction }]);
4862
5031
  }, []);
4863
- const onSortBy = useCallback5(
5032
+ const onSortBy = useCallback6(
4864
5033
  (prop) => {
4865
5034
  if (!prop)
4866
5035
  return;
@@ -4887,10 +5056,10 @@ function useGrid({
4887
5056
  },
4888
5057
  [toggleSortedDirection, sortedBy]
4889
5058
  );
4890
- const set = useCallback5((data) => {
5059
+ const set = useCallback6((data) => {
4891
5060
  setDefaultData(data);
4892
5061
  }, []);
4893
- const sortData = useCallback5(
5062
+ const sortData = useCallback6(
4894
5063
  (data) => {
4895
5064
  if (sortedBy.length > 0) {
4896
5065
  const symbolDir = {
@@ -4913,7 +5082,7 @@ function useGrid({
4913
5082
  return;
4914
5083
  setCurrentPage(pageNumber);
4915
5084
  };
4916
- const onChangeRowsPerPage = useCallback5(
5085
+ const onChangeRowsPerPage = useCallback6(
4917
5086
  (rows) => {
4918
5087
  let totalNumberOfPages2 = Math.round(filteredData.length / rows) - 1;
4919
5088
  totalNumberOfPages2 = totalNumberOfPages2 <= 0 ? 0 : 1;
@@ -5009,7 +5178,7 @@ function createSearch(options) {
5009
5178
  }
5010
5179
 
5011
5180
  // src/hooks/useAsyncGrid.ts
5012
- import { useCallback as useCallback6, useEffect as useEffect6, useState as useState9 } from "react";
5181
+ import { useCallback as useCallback7, useEffect as useEffect6, useState as useState10 } from "react";
5013
5182
  function useAsyncGrid({
5014
5183
  columns,
5015
5184
  filters = [],
@@ -5022,16 +5191,16 @@ function useAsyncGrid({
5022
5191
  defaultCurrentPage,
5023
5192
  defaultSortedBy
5024
5193
  }) {
5025
- const [defaultData, setDefaultData] = useState9(externalDefaultData || []);
5026
- const [sortedBy, setSortedBy] = useState9(
5194
+ const [defaultData, setDefaultData] = useState10(externalDefaultData || []);
5195
+ const [sortedBy, setSortedBy] = useState10(
5027
5196
  defaultSortedBy || []
5028
5197
  );
5029
- const [totalNumberOfItems, setTotalNumberOfItems] = useState9(0);
5030
- const [isLoading, setIsLoading] = useState9(false);
5031
- const [currentPage, setCurrentPage] = useState9(defaultCurrentPage || 0);
5032
- const [rowsPerPage, setRowsPerPage] = useState9(rowsPerPageOptions[0]);
5198
+ const [totalNumberOfItems, setTotalNumberOfItems] = useState10(0);
5199
+ const [isLoading, setIsLoading] = useState10(false);
5200
+ const [currentPage, setCurrentPage] = useState10(defaultCurrentPage || 0);
5201
+ const [rowsPerPage, setRowsPerPage] = useState10(rowsPerPageOptions[0]);
5033
5202
  const totalNumberOfPages = Math.ceil(totalNumberOfItems / rowsPerPage) - 1;
5034
- const toggleSortedDirection = useCallback6(
5203
+ const toggleSortedDirection = useCallback7(
5035
5204
  (direction) => {
5036
5205
  if (direction === "asc")
5037
5206
  return "desc";
@@ -5039,10 +5208,10 @@ function useAsyncGrid({
5039
5208
  },
5040
5209
  []
5041
5210
  );
5042
- const setSort = useCallback6((prop, direction) => {
5211
+ const setSort = useCallback7((prop, direction) => {
5043
5212
  setSortedBy((prev) => [...prev, { prop, direction }]);
5044
5213
  }, []);
5045
- const onSortBy = useCallback6(
5214
+ const onSortBy = useCallback7(
5046
5215
  (prop) => __async(this, null, function* () {
5047
5216
  if (!prop)
5048
5217
  return;
@@ -5072,10 +5241,10 @@ function useAsyncGrid({
5072
5241
  }),
5073
5242
  [sortedBy, toggleSortedDirection, rowsPerPage, currentPage]
5074
5243
  );
5075
- const set = useCallback6((data) => {
5244
+ const set = useCallback7((data) => {
5076
5245
  setDefaultData(data);
5077
5246
  }, []);
5078
- const baseRequest = useCallback6(
5247
+ const baseRequest = useCallback7(
5079
5248
  (_0) => __async(this, [_0], function* ({
5080
5249
  page,
5081
5250
  search: search2,
@@ -5105,7 +5274,7 @@ function useAsyncGrid({
5105
5274
  }),
5106
5275
  [axiosInstance, url]
5107
5276
  );
5108
- const updateGridContent = useCallback6(
5277
+ const updateGridContent = useCallback7(
5109
5278
  (_0) => __async(this, [_0], function* ({
5110
5279
  page,
5111
5280
  sortedBy: sortedBy2,
@@ -5131,7 +5300,7 @@ function useAsyncGrid({
5131
5300
  }),
5132
5301
  [set, search, filters, onRequest, baseRequest]
5133
5302
  );
5134
- const onPageChange = useCallback6(
5303
+ const onPageChange = useCallback7(
5135
5304
  (pageNumber) => {
5136
5305
  if (pageNumber < 0)
5137
5306
  return;
@@ -5141,7 +5310,7 @@ function useAsyncGrid({
5141
5310
  },
5142
5311
  [updateGridContent, totalNumberOfPages, sortedBy, rowsPerPage]
5143
5312
  );
5144
- const onChangeRowsPerPage = useCallback6(
5313
+ const onChangeRowsPerPage = useCallback7(
5145
5314
  (rows) => {
5146
5315
  let totalNumberOfPages2 = Math.round(totalNumberOfItems / rows) - 1;
5147
5316
  totalNumberOfPages2 = totalNumberOfPages2 <= 0 ? 0 : 1;
@@ -5194,15 +5363,15 @@ function useEvent(event, handler, passive = false) {
5194
5363
  }
5195
5364
 
5196
5365
  // src/contexts/AuthContext.tsx
5197
- import React28, { useCallback as useCallback7 } from "react";
5366
+ import React32, { useCallback as useCallback8 } from "react";
5198
5367
  import {
5199
- createContext as createContext3,
5368
+ createContext as createContext5,
5200
5369
  useEffect as useEffect8,
5201
- useState as useState10
5370
+ useState as useState11
5202
5371
  } from "react";
5203
5372
  import { parseCookies as parseCookies2 } from "nookies";
5204
5373
  function createAuthContext() {
5205
- return createContext3({});
5374
+ return createContext5({});
5206
5375
  }
5207
5376
  function CreateAuthProvider({
5208
5377
  api,
@@ -5210,10 +5379,10 @@ function CreateAuthProvider({
5210
5379
  sessionTokenName,
5211
5380
  Provider
5212
5381
  }) {
5213
- const [user, setUser] = useState10();
5214
- const [status, setStatus] = useState10("unauthenticated");
5382
+ const [user, setUser] = useState11();
5383
+ const [status, setStatus] = useState11("unauthenticated");
5215
5384
  const { createAlert } = useAlert();
5216
- const signIn = useCallback7(
5385
+ const signIn = useCallback8(
5217
5386
  (_0) => __async(this, [_0], function* ({ email, password }) {
5218
5387
  var _a, _b;
5219
5388
  setStatus("loading");
@@ -5236,7 +5405,7 @@ function CreateAuthProvider({
5236
5405
  }),
5237
5406
  [createAlert, api]
5238
5407
  );
5239
- const ClientSignOut = useCallback7(() => __async(this, null, function* () {
5408
+ const ClientSignOut = useCallback8(() => __async(this, null, function* () {
5240
5409
  yield api.get("/auth/logout");
5241
5410
  setUser(void 0);
5242
5411
  }), [api]);
@@ -5252,7 +5421,7 @@ function CreateAuthProvider({
5252
5421
  });
5253
5422
  }
5254
5423
  }, [api, sessionTokenName]);
5255
- return /* @__PURE__ */ React28.createElement(
5424
+ return /* @__PURE__ */ React32.createElement(
5256
5425
  Provider,
5257
5426
  {
5258
5427
  value: {
@@ -5271,6 +5440,11 @@ export {
5271
5440
  ApiHelper,
5272
5441
  AuthHelper,
5273
5442
  Autocomplete2 as Autocomplete,
5443
+ BaseDialog,
5444
+ BaseDialogBody,
5445
+ BaseDialogContainer,
5446
+ BaseDialogCreate,
5447
+ BaseDialogTrigger,
5274
5448
  BaseGrid,
5275
5449
  BaseGridAutoRows,
5276
5450
  Checkbox,
@@ -5301,6 +5475,8 @@ export {
5301
5475
  getTabProps,
5302
5476
  useAlert,
5303
5477
  useAsyncGrid,
5478
+ useBaseDialog,
5479
+ useBaseDialogInstance,
5304
5480
  useEvent,
5305
5481
  useFilter,
5306
5482
  useFormHelper,