@bluemarble/bm-components 2.4.4 → 2.4.6
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.cjs +28 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4545,7 +4545,23 @@ var BaseDialogContainer = ({
|
|
|
4545
4545
|
}) => {
|
|
4546
4546
|
const { name } = useBaseDialogInstance();
|
|
4547
4547
|
const { isOpened, close: closeDialog } = useBaseDialog();
|
|
4548
|
-
return /* @__PURE__ */ React2.default.createElement(Modal, { open: isOpened(name), onClose: () => closeDialog(name), ...rest },
|
|
4548
|
+
return /* @__PURE__ */ React2.default.createElement(_material.Modal, { open: isOpened(name), onClose: () => closeDialog(name), ...rest }, /* @__PURE__ */ React2.default.createElement(
|
|
4549
|
+
_material.Box,
|
|
4550
|
+
{
|
|
4551
|
+
..._optionalChain([rest, 'optionalAccess', _90 => _90.BoxProps]),
|
|
4552
|
+
sx: {
|
|
4553
|
+
outline: "none",
|
|
4554
|
+
backgroundColor: "background.paper",
|
|
4555
|
+
position: "absolute",
|
|
4556
|
+
top: "50%",
|
|
4557
|
+
left: "50%",
|
|
4558
|
+
transform: "translate(-50%, -50%)",
|
|
4559
|
+
borderRadius: 1,
|
|
4560
|
+
..._optionalChain([rest, 'optionalAccess', _91 => _91.BoxProps, 'optionalAccess', _92 => _92.sx])
|
|
4561
|
+
}
|
|
4562
|
+
},
|
|
4563
|
+
children
|
|
4564
|
+
));
|
|
4549
4565
|
};
|
|
4550
4566
|
var BaseDialogBody = (props) => {
|
|
4551
4567
|
return /* @__PURE__ */ React2.default.createElement(_material.Box, { px: 2, pb: 2, width: "100vw", maxWidth: 650, ...props }, props.children);
|
|
@@ -4695,7 +4711,7 @@ function useFilter(props = { defaultFilters: [] }) {
|
|
|
4695
4711
|
return defaultFilters || [];
|
|
4696
4712
|
});
|
|
4697
4713
|
const filterBy = _react.useCallback.call(void 0, (newFilter) => {
|
|
4698
|
-
const propToCompare = _optionalChain([newFilter, 'optionalAccess',
|
|
4714
|
+
const propToCompare = _optionalChain([newFilter, 'optionalAccess', _93 => _93.id]) ? "id" : "prop";
|
|
4699
4715
|
function removeRepeatedFilters(filter) {
|
|
4700
4716
|
return filter[propToCompare] !== newFilter[propToCompare];
|
|
4701
4717
|
}
|
|
@@ -5048,7 +5064,7 @@ function useAsyncGrid({
|
|
|
5048
5064
|
const params = new URLSearchParams({
|
|
5049
5065
|
page: String(page),
|
|
5050
5066
|
rowsPerPage: String(rowsPerPage2),
|
|
5051
|
-
searchText: _optionalChain([search2, 'optionalAccess',
|
|
5067
|
+
searchText: _optionalChain([search2, 'optionalAccess', _94 => _94.value]) || "",
|
|
5052
5068
|
sort: sortedBy2.map(({ prop, direction }) => `${prop}:${direction}`).join(","),
|
|
5053
5069
|
filters: filters2.map(
|
|
5054
5070
|
(filter) => `${filter.prop}:${filter.compareType}:${filter.value}`
|
|
@@ -5224,7 +5240,7 @@ function useFormHelper() {
|
|
|
5224
5240
|
);
|
|
5225
5241
|
const errorHandler = _react.useCallback.call(void 0,
|
|
5226
5242
|
(error, callback) => {
|
|
5227
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
5243
|
+
if (_optionalChain([error, 'optionalAccess', _95 => _95.message]) === "cancel.navigation") return;
|
|
5228
5244
|
if (callback) {
|
|
5229
5245
|
if (error.response.data.code === "invalid.body") {
|
|
5230
5246
|
const errors = error.response.data.details.issues;
|
|
@@ -5281,7 +5297,7 @@ function CreateAuthProvider({
|
|
|
5281
5297
|
setStatus("autenticated");
|
|
5282
5298
|
return true;
|
|
5283
5299
|
} catch (error) {
|
|
5284
|
-
createAlert(_optionalChain([error, 'optionalAccess',
|
|
5300
|
+
createAlert(_optionalChain([error, 'optionalAccess', _96 => _96.response, 'optionalAccess', _97 => _97.data, 'optionalAccess', _98 => _98.error]), "error");
|
|
5285
5301
|
setStatus("unauthenticated");
|
|
5286
5302
|
throw error;
|
|
5287
5303
|
}
|
|
@@ -5355,11 +5371,11 @@ var _ApiHelper = class _ApiHelper {
|
|
|
5355
5371
|
async onError(_req, _res, _error) {
|
|
5356
5372
|
}
|
|
5357
5373
|
constructor(props) {
|
|
5358
|
-
this.public = _nullishCoalesce(_optionalChain([props, 'optionalAccess',
|
|
5359
|
-
this.middlewares = (_optionalChain([props, 'optionalAccess',
|
|
5360
|
-
this.onFinally = _optionalChain([props, 'optionalAccess',
|
|
5374
|
+
this.public = _nullishCoalesce(_optionalChain([props, 'optionalAccess', _99 => _99.public]), () => ( false));
|
|
5375
|
+
this.middlewares = (_optionalChain([props, 'optionalAccess', _100 => _100.middlewares]) || []).reverse();
|
|
5376
|
+
this.onFinally = _optionalChain([props, 'optionalAccess', _101 => _101.onFinally]) || (async () => {
|
|
5361
5377
|
});
|
|
5362
|
-
this.onError = _optionalChain([props, 'optionalAccess',
|
|
5378
|
+
this.onError = _optionalChain([props, 'optionalAccess', _102 => _102.onError]) || (async () => {
|
|
5363
5379
|
});
|
|
5364
5380
|
}
|
|
5365
5381
|
createMethods(methods) {
|
|
@@ -5393,6 +5409,7 @@ var _ApiHelper = class _ApiHelper {
|
|
|
5393
5409
|
return async (req, res) => {
|
|
5394
5410
|
const methods = factory(req, res);
|
|
5395
5411
|
const handler = methods[req.method];
|
|
5412
|
+
if (req.method === "OPTIONS") return res.status(200).end();
|
|
5396
5413
|
if (!handler) return res.status(405).json({ error: "M\xE9todo inv\xE1lido" });
|
|
5397
5414
|
const methodWithMiddlewares = this.middlewares.reduce((acc, fn) => {
|
|
5398
5415
|
return fn(acc, options);
|
|
@@ -5439,7 +5456,7 @@ function decodeSessionToken({
|
|
|
5439
5456
|
sessionTokenName,
|
|
5440
5457
|
validate
|
|
5441
5458
|
}) {
|
|
5442
|
-
const token = _optionalChain([req, 'access',
|
|
5459
|
+
const token = _optionalChain([req, 'access', _103 => _103.headers, 'access', _104 => _104.authorization, 'optionalAccess', _105 => _105.split, 'call', _106 => _106(" "), 'access', _107 => _107[1]]) || req.cookies[sessionTokenName];
|
|
5443
5460
|
if (!token) {
|
|
5444
5461
|
res.status(401).json({ error: "Token inv\xE1lido", code: "token.invalid" });
|
|
5445
5462
|
return true;
|
|
@@ -5634,7 +5651,7 @@ var AuthHelper = class {
|
|
|
5634
5651
|
const data = await response.json();
|
|
5635
5652
|
const decodedToken = _jsonwebtoken2.default.decode(data.access_token);
|
|
5636
5653
|
const email = decodedToken.upn;
|
|
5637
|
-
const fullName = `${_optionalChain([decodedToken, 'optionalAccess',
|
|
5654
|
+
const fullName = `${_optionalChain([decodedToken, 'optionalAccess', _108 => _108.given_name])} ${_optionalChain([decodedToken, 'optionalAccess', _109 => _109.family_name])}`;
|
|
5638
5655
|
return { decodedToken, email, fullName };
|
|
5639
5656
|
}
|
|
5640
5657
|
createOauthCallbackGetServerSideProps({
|