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