@bluemarble/bm-components 2.6.0-rc → 2.6.0-rc.0
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 +94 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1836,7 +1836,6 @@ function BaseGridAutoRows({ data, columns, rowKey }) {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
|
|
1838
1838
|
// src/components/BlockEditor/index.tsx
|
|
1839
|
-
var _editorjs = require('@editorjs/editorjs'); var _editorjs2 = _interopRequireDefault(_editorjs);
|
|
1840
1839
|
|
|
1841
1840
|
|
|
1842
1841
|
// src/components/BlockEditor/plugins/index.ts
|
|
@@ -4199,70 +4198,82 @@ var BlockEditor = _react.forwardRef.call(void 0, function BlockEditor2({
|
|
|
4199
4198
|
const generatedId = _react.useId.call(void 0, ).replace(/[^a-zA-Z0-9-_]/g, "");
|
|
4200
4199
|
const holderRef = _react.useRef.call(void 0, null);
|
|
4201
4200
|
const editorRef = _react.useRef.call(void 0, null);
|
|
4201
|
+
const loadRef = _react.useRef.call(void 0, null);
|
|
4202
4202
|
const undoRef = _react.useRef.call(void 0, null);
|
|
4203
4203
|
const dragDropRef = _react.useRef.call(void 0, null);
|
|
4204
4204
|
const propsRef = _react.useRef.call(void 0, { onChange, onInitialize, onReady });
|
|
4205
4205
|
propsRef.current = { onChange, onInitialize, onReady };
|
|
4206
|
+
const ready = async () => {
|
|
4207
|
+
const editor = await loadRef.current;
|
|
4208
|
+
await _optionalChain([editor, 'optionalAccess', _363 => _363.isReady]);
|
|
4209
|
+
return editor;
|
|
4210
|
+
};
|
|
4206
4211
|
_react.useImperativeHandle.call(void 0, ref, () => {
|
|
4207
|
-
const ready = async () => {
|
|
4208
|
-
await _optionalChain([editorRef, 'access', _363 => _363.current, 'optionalAccess', _364 => _364.isReady]);
|
|
4209
|
-
return editorRef.current;
|
|
4210
|
-
};
|
|
4211
4212
|
return {
|
|
4212
4213
|
get editor() {
|
|
4213
4214
|
return editorRef.current;
|
|
4214
4215
|
},
|
|
4215
|
-
save: async () => await _asyncOptionalChain([(await ready()), 'optionalAccess', async
|
|
4216
|
-
clear: async () => await _asyncOptionalChain([(await ready()), 'optionalAccess', async
|
|
4217
|
-
render: async (data) => await _asyncOptionalChain([(await ready()), 'optionalAccess', async
|
|
4216
|
+
save: async () => await _asyncOptionalChain([(await ready()), 'optionalAccess', async _364 => _364.save, 'call', async _365 => _365()]),
|
|
4217
|
+
clear: async () => await _asyncOptionalChain([(await ready()), 'optionalAccess', async _366 => _366.clear, 'call', async _367 => _367()]),
|
|
4218
|
+
render: async (data) => await _asyncOptionalChain([(await ready()), 'optionalAccess', async _368 => _368.render, 'call', async _369 => _369(data)]),
|
|
4218
4219
|
focus: async (atEnd) => {
|
|
4219
4220
|
;
|
|
4220
|
-
await _asyncOptionalChain([(await ready()), 'optionalAccess', async
|
|
4221
|
+
await _asyncOptionalChain([(await ready()), 'optionalAccess', async _370 => _370.focus, 'call', async _371 => _371(atEnd)]);
|
|
4221
4222
|
},
|
|
4222
|
-
undo: () => _optionalChain([undoRef, 'access',
|
|
4223
|
-
redo: () => _optionalChain([undoRef, 'access',
|
|
4223
|
+
undo: () => _optionalChain([undoRef, 'access', _372 => _372.current, 'optionalAccess', _373 => _373.undo, 'call', _374 => _374()]),
|
|
4224
|
+
redo: () => _optionalChain([undoRef, 'access', _375 => _375.current, 'optionalAccess', _376 => _376.redo, 'call', _377 => _377()])
|
|
4224
4225
|
};
|
|
4225
4226
|
}, []);
|
|
4226
4227
|
_react.useEffect.call(void 0, () => {
|
|
4227
4228
|
const holderNode = holderRef.current;
|
|
4228
4229
|
if (!holderNode) return;
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4230
|
+
let disposed = false;
|
|
4231
|
+
const load = (async () => {
|
|
4232
|
+
const { default: EditorJS } = await Promise.resolve().then(() => _interopRequireWildcard(require("@editorjs/editorjs")));
|
|
4233
|
+
if (disposed) return null;
|
|
4234
|
+
const editor = new EditorJS({
|
|
4235
|
+
...config,
|
|
4236
|
+
readOnly,
|
|
4237
|
+
placeholder,
|
|
4238
|
+
holder: holderNode,
|
|
4239
|
+
tools: createTools({ uploader, placeholder, headerPlaceholder, tools }),
|
|
4240
|
+
data: defaultValue,
|
|
4241
|
+
style: nonce ? { nonce } : void 0,
|
|
4242
|
+
onChange: (api, event) => {
|
|
4243
|
+
_optionalChain([undoRef, 'access', _378 => _378.current, 'optionalAccess', _379 => _379.registerChange, 'call', _380 => _380()]);
|
|
4244
|
+
_optionalChain([propsRef, 'access', _381 => _381.current, 'access', _382 => _382.onChange, 'optionalCall', _383 => _383(api, event)]);
|
|
4245
|
+
},
|
|
4246
|
+
onReady: () => {
|
|
4247
|
+
if (disposed) return;
|
|
4248
|
+
if (undo) {
|
|
4249
|
+
undoRef.current = new Undo(editor, holderNode);
|
|
4250
|
+
undoRef.current.initialize(defaultValue);
|
|
4251
|
+
}
|
|
4252
|
+
if (dragDrop && !readOnly) {
|
|
4253
|
+
dragDropRef.current = new DragDrop(editor, holderNode);
|
|
4254
|
+
}
|
|
4255
|
+
_optionalChain([propsRef, 'access', _384 => _384.current, 'access', _385 => _385.onReady, 'optionalCall', _386 => _386(editor)]);
|
|
4248
4256
|
}
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4257
|
+
});
|
|
4258
|
+
editorRef.current = editor;
|
|
4259
|
+
_optionalChain([propsRef, 'access', _387 => _387.current, 'access', _388 => _388.onInitialize, 'optionalCall', _389 => _389(editor)]);
|
|
4260
|
+
return editor;
|
|
4261
|
+
})();
|
|
4262
|
+
loadRef.current = load;
|
|
4254
4263
|
return () => {
|
|
4255
|
-
|
|
4256
|
-
_optionalChain([
|
|
4264
|
+
disposed = true;
|
|
4265
|
+
_optionalChain([undoRef, 'access', _390 => _390.current, 'optionalAccess', _391 => _391.destroy, 'call', _392 => _392()]);
|
|
4266
|
+
_optionalChain([dragDropRef, 'access', _393 => _393.current, 'optionalAccess', _394 => _394.destroy, 'call', _395 => _395()]);
|
|
4257
4267
|
undoRef.current = null;
|
|
4258
4268
|
dragDropRef.current = null;
|
|
4259
4269
|
editorRef.current = null;
|
|
4260
|
-
|
|
4270
|
+
loadRef.current = null;
|
|
4271
|
+
load.then((editor) => _optionalChain([editor, 'optionalAccess', _396 => _396.isReady, 'access', _397 => _397.then, 'call', _398 => _398(() => editor.destroy())])).catch(() => void 0);
|
|
4261
4272
|
};
|
|
4262
4273
|
}, []);
|
|
4263
4274
|
_react.useEffect.call(void 0, () => {
|
|
4264
4275
|
if (readOnly === void 0) return;
|
|
4265
|
-
|
|
4276
|
+
ready().then((editor) => _optionalChain([editor, 'optionalAccess', _399 => _399.readOnly, 'access', _400 => _400.toggle, 'call', _401 => _401(readOnly)])).catch(() => void 0);
|
|
4266
4277
|
}, [readOnly]);
|
|
4267
4278
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4268
4279
|
"div",
|
|
@@ -4385,8 +4396,8 @@ function UseDialogConfirm(dialogName) {
|
|
|
4385
4396
|
};
|
|
4386
4397
|
};
|
|
4387
4398
|
const onProceed = async (event) => {
|
|
4388
|
-
_optionalChain([event, 'optionalAccess',
|
|
4389
|
-
_optionalChain([event, 'optionalAccess',
|
|
4399
|
+
_optionalChain([event, 'optionalAccess', _402 => _402.preventDefault, 'call', _403 => _403()]);
|
|
4400
|
+
_optionalChain([event, 'optionalAccess', _404 => _404.stopPropagation, 'call', _405 => _405()]);
|
|
4390
4401
|
setLoading(true);
|
|
4391
4402
|
try {
|
|
4392
4403
|
if (!onConfirmFn.current) return;
|
|
@@ -4397,8 +4408,8 @@ function UseDialogConfirm(dialogName) {
|
|
|
4397
4408
|
}
|
|
4398
4409
|
};
|
|
4399
4410
|
const onCancel = (event) => {
|
|
4400
|
-
_optionalChain([event, 'optionalAccess',
|
|
4401
|
-
_optionalChain([event, 'optionalAccess',
|
|
4411
|
+
_optionalChain([event, 'optionalAccess', _406 => _406.preventDefault, 'call', _407 => _407()]);
|
|
4412
|
+
_optionalChain([event, 'optionalAccess', _408 => _408.stopPropagation, 'call', _409 => _409()]);
|
|
4402
4413
|
close(name);
|
|
4403
4414
|
};
|
|
4404
4415
|
const onCloseModal = () => {
|
|
@@ -4548,13 +4559,13 @@ var DefaultInput = (allProps) => {
|
|
|
4548
4559
|
}
|
|
4549
4560
|
};
|
|
4550
4561
|
const handleSave = (event) => {
|
|
4551
|
-
onUpdateValue(String(_optionalChain([event, 'access',
|
|
4562
|
+
onUpdateValue(String(_optionalChain([event, 'access', _410 => _410.target, 'optionalAccess', _411 => _411.value])));
|
|
4552
4563
|
setIsEditing(false);
|
|
4553
4564
|
const response = {
|
|
4554
4565
|
name,
|
|
4555
4566
|
event,
|
|
4556
|
-
value: _optionalChain([event, 'access',
|
|
4557
|
-
data: { ...rowData, [name]: _optionalChain([event, 'access',
|
|
4567
|
+
value: _optionalChain([event, 'access', _412 => _412.target, 'optionalAccess', _413 => _413.value]),
|
|
4568
|
+
data: { ...rowData, [name]: _optionalChain([event, 'access', _414 => _414.target, 'optionalAccess', _415 => _415.value]) }
|
|
4558
4569
|
};
|
|
4559
4570
|
onSave(response);
|
|
4560
4571
|
};
|
|
@@ -4571,10 +4582,10 @@ var DefaultInput = (allProps) => {
|
|
|
4571
4582
|
autoFocus: true,
|
|
4572
4583
|
type,
|
|
4573
4584
|
size: "small",
|
|
4574
|
-
defaultValue: formatDefaultValue(_optionalChain([rowData, 'optionalAccess',
|
|
4585
|
+
defaultValue: formatDefaultValue(_optionalChain([rowData, 'optionalAccess', _416 => _416[name]])),
|
|
4575
4586
|
sx: {
|
|
4576
4587
|
width: fullWidth ? "100%" : "intial",
|
|
4577
|
-
..._optionalChain([TextFieldProps, 'optionalAccess',
|
|
4588
|
+
..._optionalChain([TextFieldProps, 'optionalAccess', _417 => _417.sx])
|
|
4578
4589
|
},
|
|
4579
4590
|
inputProps: {
|
|
4580
4591
|
style: {
|
|
@@ -4584,11 +4595,11 @@ var DefaultInput = (allProps) => {
|
|
|
4584
4595
|
onKeyDown
|
|
4585
4596
|
},
|
|
4586
4597
|
InputProps: {
|
|
4587
|
-
..._optionalChain([TextFieldProps, 'optionalAccess',
|
|
4598
|
+
..._optionalChain([TextFieldProps, 'optionalAccess', _418 => _418.InputProps]),
|
|
4588
4599
|
sx: {
|
|
4589
4600
|
fontSize: 14,
|
|
4590
4601
|
pl: 0.2,
|
|
4591
|
-
..._optionalChain([TextFieldProps, 'optionalAccess',
|
|
4602
|
+
..._optionalChain([TextFieldProps, 'optionalAccess', _419 => _419.InputProps, 'optionalAccess', _420 => _420.sx])
|
|
4592
4603
|
}
|
|
4593
4604
|
},
|
|
4594
4605
|
...TextFieldProps
|
|
@@ -4616,13 +4627,13 @@ var InputMask = (allProps) => {
|
|
|
4616
4627
|
const { ref, unmaskedValue, setValue } = _reactimask.useIMask.call(void 0, mask);
|
|
4617
4628
|
const handleSave = (event) => {
|
|
4618
4629
|
setIsEditing(false);
|
|
4619
|
-
setValue(String(_optionalChain([event, 'access',
|
|
4630
|
+
setValue(String(_optionalChain([event, 'access', _421 => _421.target, 'optionalAccess', _422 => _422.value])));
|
|
4620
4631
|
const response = {
|
|
4621
4632
|
name,
|
|
4622
4633
|
event,
|
|
4623
|
-
value: _optionalChain([event, 'access',
|
|
4634
|
+
value: _optionalChain([event, 'access', _423 => _423.target, 'optionalAccess', _424 => _424.value]),
|
|
4624
4635
|
unmaskedValue,
|
|
4625
|
-
data: { ...rowData, [name]: _optionalChain([event, 'access',
|
|
4636
|
+
data: { ...rowData, [name]: _optionalChain([event, 'access', _425 => _425.target, 'optionalAccess', _426 => _426.value]) }
|
|
4626
4637
|
};
|
|
4627
4638
|
onSave(response);
|
|
4628
4639
|
};
|
|
@@ -4631,8 +4642,8 @@ var InputMask = (allProps) => {
|
|
|
4631
4642
|
if (ev.code === "Escape") handleCancelEditing();
|
|
4632
4643
|
};
|
|
4633
4644
|
_react.useEffect.call(void 0, () => {
|
|
4634
|
-
if (_optionalChain([rowData, 'optionalAccess',
|
|
4635
|
-
}, [_optionalChain([rowData, 'optionalAccess',
|
|
4645
|
+
if (_optionalChain([rowData, 'optionalAccess', _427 => _427[name]])) setValue(String(_optionalChain([rowData, 'optionalAccess', _428 => _428[name]])));
|
|
4646
|
+
}, [_optionalChain([rowData, 'optionalAccess', _429 => _429[name]])]);
|
|
4636
4647
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4637
4648
|
_material.TextField,
|
|
4638
4649
|
{
|
|
@@ -4644,7 +4655,7 @@ var InputMask = (allProps) => {
|
|
|
4644
4655
|
size: "small",
|
|
4645
4656
|
sx: {
|
|
4646
4657
|
width: fullWidth ? "100%" : "intial",
|
|
4647
|
-
..._optionalChain([TextFieldProps, 'optionalAccess',
|
|
4658
|
+
..._optionalChain([TextFieldProps, 'optionalAccess', _430 => _430.sx])
|
|
4648
4659
|
},
|
|
4649
4660
|
inputProps: {
|
|
4650
4661
|
style: {
|
|
@@ -4654,11 +4665,11 @@ var InputMask = (allProps) => {
|
|
|
4654
4665
|
onKeyDown
|
|
4655
4666
|
},
|
|
4656
4667
|
InputProps: {
|
|
4657
|
-
..._optionalChain([TextFieldProps, 'optionalAccess',
|
|
4668
|
+
..._optionalChain([TextFieldProps, 'optionalAccess', _431 => _431.InputProps]),
|
|
4658
4669
|
sx: {
|
|
4659
4670
|
fontSize: 14,
|
|
4660
4671
|
pl: 0.2,
|
|
4661
|
-
..._optionalChain([TextFieldProps, 'optionalAccess',
|
|
4672
|
+
..._optionalChain([TextFieldProps, 'optionalAccess', _432 => _432.InputProps, 'optionalAccess', _433 => _433.sx])
|
|
4662
4673
|
}
|
|
4663
4674
|
},
|
|
4664
4675
|
...TextFieldProps
|
|
@@ -4686,7 +4697,7 @@ var EditableTableCell = (allProps) => {
|
|
|
4686
4697
|
...props
|
|
4687
4698
|
} = allProps;
|
|
4688
4699
|
const [isEditing, setIsEditing] = _react.useState.call(void 0, false);
|
|
4689
|
-
const [value, setValue] = _react.useState.call(void 0, _optionalChain([rowData, 'optionalAccess',
|
|
4700
|
+
const [value, setValue] = _react.useState.call(void 0, _optionalChain([rowData, 'optionalAccess', _434 => _434[name]]));
|
|
4690
4701
|
const handleCancelEditing = () => {
|
|
4691
4702
|
setIsEditing(false);
|
|
4692
4703
|
if (onCancel) onCancel();
|
|
@@ -4696,7 +4707,7 @@ var EditableTableCell = (allProps) => {
|
|
|
4696
4707
|
{
|
|
4697
4708
|
...props,
|
|
4698
4709
|
sx: {
|
|
4699
|
-
..._optionalChain([props, 'optionalAccess',
|
|
4710
|
+
..._optionalChain([props, 'optionalAccess', _435 => _435.sx]),
|
|
4700
4711
|
p: isEditing ? 0 : "intial",
|
|
4701
4712
|
border: bordered ? "1px solid" : "initial",
|
|
4702
4713
|
borderColor: "divider"
|
|
@@ -4934,7 +4945,7 @@ function sortContainerQueries(theme, css2) {
|
|
|
4934
4945
|
}
|
|
4935
4946
|
const sorted = Object.keys(css2).filter((key) => key.startsWith("@container")).sort((a, b) => {
|
|
4936
4947
|
const regex = /min-width:\s*([0-9.]+)/;
|
|
4937
|
-
return +(_optionalChain([a, 'access',
|
|
4948
|
+
return +(_optionalChain([a, 'access', _436 => _436.match, 'call', _437 => _437(regex), 'optionalAccess', _438 => _438[1]]) || 0) - +(_optionalChain([b, 'access', _439 => _439.match, 'call', _440 => _440(regex), 'optionalAccess', _441 => _441[1]]) || 0);
|
|
4938
4949
|
});
|
|
4939
4950
|
if (!sorted.length) {
|
|
4940
4951
|
return css2;
|
|
@@ -5078,7 +5089,7 @@ function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
5078
5089
|
return output;
|
|
5079
5090
|
}
|
|
5080
5091
|
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
5081
|
-
const breakpointsInOrder = _optionalChain([breakpointsInput, 'access',
|
|
5092
|
+
const breakpointsInOrder = _optionalChain([breakpointsInput, 'access', _442 => _442.keys, 'optionalAccess', _443 => _443.reduce, 'call', _444 => _444((acc, key) => {
|
|
5082
5093
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
5083
5094
|
acc[breakpointStyleKey] = {};
|
|
5084
5095
|
return acc;
|
|
@@ -5524,13 +5535,13 @@ var width = style_default({
|
|
|
5524
5535
|
var maxWidth = (props) => {
|
|
5525
5536
|
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
5526
5537
|
const styleFromPropValue = (propValue) => {
|
|
5527
|
-
const breakpoint = _optionalChain([props, 'access',
|
|
5538
|
+
const breakpoint = _optionalChain([props, 'access', _445 => _445.theme, 'optionalAccess', _446 => _446.breakpoints, 'optionalAccess', _447 => _447.values, 'optionalAccess', _448 => _448[propValue]]) || values[propValue];
|
|
5528
5539
|
if (!breakpoint) {
|
|
5529
5540
|
return {
|
|
5530
5541
|
maxWidth: sizingTransform(propValue)
|
|
5531
5542
|
};
|
|
5532
5543
|
}
|
|
5533
|
-
if (_optionalChain([props, 'access',
|
|
5544
|
+
if (_optionalChain([props, 'access', _449 => _449.theme, 'optionalAccess', _450 => _450.breakpoints, 'optionalAccess', _451 => _451.unit]) !== "px") {
|
|
5534
5545
|
return {
|
|
5535
5546
|
maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
|
|
5536
5547
|
};
|
|
@@ -5988,7 +5999,7 @@ var styleFunctionSx_default = styleFunctionSx;
|
|
|
5988
5999
|
function applyStyles(key, styles2) {
|
|
5989
6000
|
const theme = this;
|
|
5990
6001
|
if (theme.vars) {
|
|
5991
|
-
if (!_optionalChain([theme, 'access',
|
|
6002
|
+
if (!_optionalChain([theme, 'access', _452 => _452.colorSchemes, 'optionalAccess', _453 => _453[key]]) || typeof theme.getColorSchemeSelector !== "function") {
|
|
5992
6003
|
return {};
|
|
5993
6004
|
}
|
|
5994
6005
|
let selector = theme.getColorSchemeSelector(key);
|
|
@@ -6039,7 +6050,7 @@ function createTheme(options = {}, ...args) {
|
|
|
6039
6050
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
6040
6051
|
muiTheme.unstable_sxConfig = {
|
|
6041
6052
|
...defaultSxConfig_default,
|
|
6042
|
-
..._optionalChain([other, 'optionalAccess',
|
|
6053
|
+
..._optionalChain([other, 'optionalAccess', _454 => _454.unstable_sxConfig])
|
|
6043
6054
|
};
|
|
6044
6055
|
muiTheme.unstable_sx = function sx(props) {
|
|
6045
6056
|
return styleFunctionSx_default({
|
|
@@ -6075,7 +6086,7 @@ var splitProps = (props) => {
|
|
|
6075
6086
|
systemProps: {},
|
|
6076
6087
|
otherProps: {}
|
|
6077
6088
|
};
|
|
6078
|
-
const config = _nullishCoalesce(_optionalChain([props, 'optionalAccess',
|
|
6089
|
+
const config = _nullishCoalesce(_optionalChain([props, 'optionalAccess', _455 => _455.theme, 'optionalAccess', _456 => _456.unstable_sxConfig]), () => ( defaultSxConfig_default));
|
|
6079
6090
|
Object.keys(props).forEach((prop) => {
|
|
6080
6091
|
if (config[prop]) {
|
|
6081
6092
|
result.systemProps[prop] = props[prop];
|
|
@@ -6373,7 +6384,7 @@ function filterData(filters, defaultData) {
|
|
|
6373
6384
|
return filteredArray;
|
|
6374
6385
|
}
|
|
6375
6386
|
function getPropertyValue(obj, property) {
|
|
6376
|
-
return String(property.split(".").reduce((o, k) => _optionalChain([o, 'optionalAccess',
|
|
6387
|
+
return String(property.split(".").reduce((o, k) => _optionalChain([o, 'optionalAccess', _457 => _457[k]]), obj));
|
|
6377
6388
|
}
|
|
6378
6389
|
|
|
6379
6390
|
// src/components/Grid/Grid.tsx
|
|
@@ -6791,7 +6802,7 @@ var Modal2 = ({ open, onClose, BoxProps, ...rest }) => {
|
|
|
6791
6802
|
left: "50%",
|
|
6792
6803
|
transform: "translate(-50%, -50%)",
|
|
6793
6804
|
borderRadius: 1,
|
|
6794
|
-
..._optionalChain([BoxProps, 'optionalAccess',
|
|
6805
|
+
..._optionalChain([BoxProps, 'optionalAccess', _458 => _458.sx])
|
|
6795
6806
|
},
|
|
6796
6807
|
children: rest.children
|
|
6797
6808
|
}
|
|
@@ -6907,7 +6918,7 @@ function FormikSelect({
|
|
|
6907
6918
|
const onChange = (_, { props: { value: value2 } }) => {
|
|
6908
6919
|
setValue(value2);
|
|
6909
6920
|
};
|
|
6910
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.FormControl, { fullWidth: true, ...FormControlProps, error: Boolean(_optionalChain([meta, 'optionalAccess',
|
|
6921
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.FormControl, { fullWidth: true, ...FormControlProps, error: Boolean(_optionalChain([meta, 'optionalAccess', _459 => _459.error])), children: [
|
|
6911
6922
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CustomInputLabel, { ...InputLabelProps, children: label }),
|
|
6912
6923
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6913
6924
|
_material.Select,
|
|
@@ -6923,7 +6934,7 @@ function FormikSelect({
|
|
|
6923
6934
|
children
|
|
6924
6935
|
}
|
|
6925
6936
|
),
|
|
6926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.FormHelperText, { children: helperText || _optionalChain([meta, 'optionalAccess',
|
|
6937
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.FormHelperText, { children: helperText || _optionalChain([meta, 'optionalAccess', _460 => _460.error]) })
|
|
6927
6938
|
] });
|
|
6928
6939
|
}
|
|
6929
6940
|
|
|
@@ -7145,7 +7156,7 @@ function useAsyncGrid({
|
|
|
7145
7156
|
const params = new URLSearchParams({
|
|
7146
7157
|
page: String(page),
|
|
7147
7158
|
rowsPerPage: String(rowsPerPage2),
|
|
7148
|
-
searchText: _optionalChain([search2, 'optionalAccess',
|
|
7159
|
+
searchText: _optionalChain([search2, 'optionalAccess', _461 => _461.value]) || "",
|
|
7149
7160
|
sort: sortedBy2.map(({ prop, direction }) => `${prop}:${direction}`).join(","),
|
|
7150
7161
|
filters: filters2.map((filter) => `${filter.prop}:${filter.compareType}:${filter.value}`).join(",")
|
|
7151
7162
|
});
|
|
@@ -7266,7 +7277,7 @@ function useFilter(props = { defaultFilters: [] }) {
|
|
|
7266
7277
|
return defaultFilters || [];
|
|
7267
7278
|
});
|
|
7268
7279
|
const filterBy = _react.useCallback.call(void 0, (newFilter) => {
|
|
7269
|
-
const propToCompare = _optionalChain([newFilter, 'optionalAccess',
|
|
7280
|
+
const propToCompare = _optionalChain([newFilter, 'optionalAccess', _462 => _462.id]) ? "id" : "prop";
|
|
7270
7281
|
function removeRepeatedFilters(filter) {
|
|
7271
7282
|
return filter[propToCompare] !== newFilter[propToCompare];
|
|
7272
7283
|
}
|
|
@@ -7414,7 +7425,7 @@ function useFormHelper() {
|
|
|
7414
7425
|
);
|
|
7415
7426
|
const errorHandler = _react.useCallback.call(void 0,
|
|
7416
7427
|
(error, callback) => {
|
|
7417
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
7428
|
+
if (_optionalChain([error, 'optionalAccess', _463 => _463.message]) === "cancel.navigation") return;
|
|
7418
7429
|
if (callback) {
|
|
7419
7430
|
if (error.response.data.code === "invalid.body") {
|
|
7420
7431
|
const errors = error.response.data.details.issues;
|
|
@@ -7674,7 +7685,7 @@ function CreateAuthProvider({
|
|
|
7674
7685
|
setStatus("autenticated");
|
|
7675
7686
|
return true;
|
|
7676
7687
|
} catch (error) {
|
|
7677
|
-
createAlert(_optionalChain([error, 'optionalAccess',
|
|
7688
|
+
createAlert(_optionalChain([error, 'optionalAccess', _464 => _464.response, 'optionalAccess', _465 => _465.data, 'optionalAccess', _466 => _466.error]), "error");
|
|
7678
7689
|
setStatus("unauthenticated");
|
|
7679
7690
|
throw error;
|
|
7680
7691
|
}
|
|
@@ -7748,11 +7759,11 @@ var _ApiHelper = class _ApiHelper {
|
|
|
7748
7759
|
async onError(_req, _res, _error) {
|
|
7749
7760
|
}
|
|
7750
7761
|
constructor(props) {
|
|
7751
|
-
this.public = _nullishCoalesce(_optionalChain([props, 'optionalAccess',
|
|
7752
|
-
this.middlewares = (_optionalChain([props, 'optionalAccess',
|
|
7753
|
-
this.onFinally = _optionalChain([props, 'optionalAccess',
|
|
7762
|
+
this.public = _nullishCoalesce(_optionalChain([props, 'optionalAccess', _467 => _467.public]), () => ( false));
|
|
7763
|
+
this.middlewares = (_optionalChain([props, 'optionalAccess', _468 => _468.middlewares]) || []).reverse();
|
|
7764
|
+
this.onFinally = _optionalChain([props, 'optionalAccess', _469 => _469.onFinally]) || (async () => {
|
|
7754
7765
|
});
|
|
7755
|
-
this.onError = _optionalChain([props, 'optionalAccess',
|
|
7766
|
+
this.onError = _optionalChain([props, 'optionalAccess', _470 => _470.onError]) || (async () => {
|
|
7756
7767
|
});
|
|
7757
7768
|
}
|
|
7758
7769
|
createMethods(methods) {
|
|
@@ -7828,8 +7839,8 @@ function createApiHelper(defaults) {
|
|
|
7828
7839
|
...defaults,
|
|
7829
7840
|
...options,
|
|
7830
7841
|
middlewares: [
|
|
7831
|
-
..._nullishCoalesce(_optionalChain([defaults, 'optionalAccess',
|
|
7832
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
7842
|
+
..._nullishCoalesce(_optionalChain([defaults, 'optionalAccess', _471 => _471.middlewares]), () => ( [])),
|
|
7843
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _472 => _472.middlewares]), () => ( []))
|
|
7833
7844
|
]
|
|
7834
7845
|
});
|
|
7835
7846
|
return _a = class {
|
|
@@ -7859,7 +7870,7 @@ function decodeSessionToken({
|
|
|
7859
7870
|
sessionTokenName,
|
|
7860
7871
|
validate
|
|
7861
7872
|
}) {
|
|
7862
|
-
const token = _optionalChain([req, 'access',
|
|
7873
|
+
const token = _optionalChain([req, 'access', _473 => _473.headers, 'access', _474 => _474.authorization, 'optionalAccess', _475 => _475.split, 'call', _476 => _476(" "), 'access', _477 => _477[1]]) || req.cookies[sessionTokenName];
|
|
7863
7874
|
if (!token) {
|
|
7864
7875
|
res.status(401).json({ error: "Token inv\xE1lido", code: "token.invalid" });
|
|
7865
7876
|
return true;
|
|
@@ -8052,7 +8063,7 @@ var AuthHelper = class {
|
|
|
8052
8063
|
const data = await response.json();
|
|
8053
8064
|
const decodedToken = _jsonwebtoken2.default.decode(data.access_token);
|
|
8054
8065
|
const email = decodedToken.upn;
|
|
8055
|
-
const fullName = `${_optionalChain([decodedToken, 'optionalAccess',
|
|
8066
|
+
const fullName = `${_optionalChain([decodedToken, 'optionalAccess', _478 => _478.given_name])} ${_optionalChain([decodedToken, 'optionalAccess', _479 => _479.family_name])}`;
|
|
8056
8067
|
return { decodedToken, email, fullName };
|
|
8057
8068
|
}
|
|
8058
8069
|
createOauthCallbackGetServerSideProps({
|