@mcurros2/microm 1.1.413-0 → 1.1.415-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.d.ts +54 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +357 -198
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -125,6 +125,8 @@ parcelRegister("dC9fs", function(module, exports) {
|
|
|
125
125
|
|
|
126
126
|
var $bW9pc = parcelRequire("bW9pc");
|
|
127
127
|
|
|
128
|
+
var $n9rI9 = parcelRequire("n9rI9");
|
|
129
|
+
|
|
128
130
|
var $vXZlt = parcelRequire("vXZlt");
|
|
129
131
|
|
|
130
132
|
var $bHLhd = parcelRequire("bHLhd");
|
|
@@ -141,6 +143,7 @@ var $dZuNe = parcelRequire("dZuNe");
|
|
|
141
143
|
|
|
142
144
|
var $baoBh = parcelRequire("baoBh");
|
|
143
145
|
$parcel$exportWildcard(module.exports, $bW9pc);
|
|
146
|
+
$parcel$exportWildcard(module.exports, $n9rI9);
|
|
144
147
|
$parcel$exportWildcard(module.exports, $vXZlt);
|
|
145
148
|
$parcel$exportWildcard(module.exports, $bHLhd);
|
|
146
149
|
$parcel$exportWildcard(module.exports, $hAMyt);
|
|
@@ -168,6 +171,8 @@ var $iKzSR = parcelRequire("iKzSR");
|
|
|
168
171
|
var $1Mm5D = parcelRequire("1Mm5D");
|
|
169
172
|
|
|
170
173
|
var $vXZlt = parcelRequire("vXZlt");
|
|
174
|
+
|
|
175
|
+
var $n9rI9 = parcelRequire("n9rI9");
|
|
171
176
|
const $ed5512685e858344$export$659b17aab7c47d60 = {
|
|
172
177
|
validateInputOnBlur: true,
|
|
173
178
|
initialShowDescriptionInFields: true,
|
|
@@ -175,7 +180,8 @@ const $ed5512685e858344$export$659b17aab7c47d60 = {
|
|
|
175
180
|
cancelSaveOnUnmount: true
|
|
176
181
|
};
|
|
177
182
|
function $ed5512685e858344$export$f1f43a62560a15ec(props) {
|
|
178
|
-
const { entity: entity, initialFormMode: initialFormMode, validateInputOnBlur: validateInputOnBlur, validateInputOnChange: validateInputOnChange, onSaved: onSaved, onCancel: onCancel, getDataOnInit: getDataOnInit, forceDirty: forceDirty, initialShowDescriptionInFields: initialShowDescriptionInFields, saveAndGetOverride: saveAndGetOverride, noSaveOnSubmit: noSaveOnSubmit, bindedColumnNames: bindedColumnNames, saveAndGetOnSubmit: saveAndGetOnSubmit, cancelGetOnUnmount: cancelGetOnUnmount, cancelSaveOnUnmount: cancelSaveOnUnmount, navigationProtection: navigationProtection } = (0, $b4te3$mantinecore.useComponentDefaultProps)('', $ed5512685e858344$export$659b17aab7c47d60, props);
|
|
183
|
+
const { entity: entity, initialFormMode: initialFormMode, validateInputOnBlur: validateInputOnBlur, validateInputOnChange: validateInputOnChange, onSaved: onSaved, onCancel: onCancel, getDataOnInit: getDataOnInit, forceDirty: forceDirty, initialShowDescriptionInFields: initialShowDescriptionInFields, saveAndGetOverride: saveAndGetOverride, noSaveOnSubmit: noSaveOnSubmit, bindedColumnNames: bindedColumnNames, saveAndGetOnSubmit: saveAndGetOnSubmit, cancelGetOnUnmount: cancelGetOnUnmount, cancelSaveOnUnmount: cancelSaveOnUnmount, navigationProtection: navigationProtection, validateForm: validateForm } = (0, $b4te3$mantinecore.useComponentDefaultProps)('', $ed5512685e858344$export$659b17aab7c47d60, props);
|
|
184
|
+
const { confirmWarning: confirmWarning, showValidationError: showValidationError } = (0, $n9rI9.useValidateFormModals)();
|
|
179
185
|
const [status, setStatus] = (0, $b4te3$react.useState)({}); // Initial queryStatus is empty on purpose to not disable fields before data is loaded
|
|
180
186
|
const notifyValidationErrorState = (0, $b4te3$react.useState)(false);
|
|
181
187
|
const [, setNotifyValidationError] = notifyValidationErrorState;
|
|
@@ -349,6 +355,28 @@ function $ed5512685e858344$export$f1f43a62560a15ec(props) {
|
|
|
349
355
|
const result = form.validate();
|
|
350
356
|
if (result.hasErrors) setNotifyValidationError(true);
|
|
351
357
|
else {
|
|
358
|
+
if (validateForm) {
|
|
359
|
+
let validation;
|
|
360
|
+
try {
|
|
361
|
+
validation = await Promise.resolve(validateForm(form.values));
|
|
362
|
+
} catch (e) {
|
|
363
|
+
console.error('validateForm callback failed', e);
|
|
364
|
+
validation = {
|
|
365
|
+
error: (0, $n9rI9.ValidateFormLabelsDefaultProps).unexpectedErrorLabel
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
if (validation?.error) {
|
|
369
|
+
await showValidationError(validation.error);
|
|
370
|
+
return;
|
|
371
|
+
} else if (validation?.warning) {
|
|
372
|
+
if (!await confirmWarning(validation.warning)) return;
|
|
373
|
+
} else if (validation?.success !== true) {
|
|
374
|
+
// a malformed result (e.g. undefined from untyped JS) must not be treated as success
|
|
375
|
+
console.error('validateForm returned an invalid result', validation);
|
|
376
|
+
await showValidationError((0, $n9rI9.ValidateFormLabelsDefaultProps).unexpectedErrorLabel);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
352
380
|
let save_result;
|
|
353
381
|
if (saveAndGetOverride) try {
|
|
354
382
|
if (noSaveOnSubmit) save_result = {
|
|
@@ -409,7 +437,10 @@ function $ed5512685e858344$export$f1f43a62560a15ec(props) {
|
|
|
409
437
|
saveAndGet,
|
|
410
438
|
saveAndGetOverride,
|
|
411
439
|
setNotifyValidationError,
|
|
412
|
-
saveAndGetOnSubmit
|
|
440
|
+
saveAndGetOnSubmit,
|
|
441
|
+
validateForm,
|
|
442
|
+
confirmWarning,
|
|
443
|
+
showValidationError
|
|
413
444
|
]);
|
|
414
445
|
// Validation, InitialValues, InitialDirty
|
|
415
446
|
const addValidation = (0, $b4te3$react.useCallback)((column, validation)=>{
|
|
@@ -4031,6 +4062,8 @@ const $5cdab1be66fbf6ab$export$4a25ee9b30a3b11c = ({ modalProps: modalProps, ani
|
|
|
4031
4062
|
]);
|
|
4032
4063
|
const getModalSize = (0, $b4te3$react.useCallback)((size)=>{
|
|
4033
4064
|
if (size === 'fullscreen' || size === '100%' || viewportWidth < 768 && [
|
|
4065
|
+
'xs',
|
|
4066
|
+
'sm',
|
|
4034
4067
|
'md',
|
|
4035
4068
|
'lg',
|
|
4036
4069
|
'xl',
|
|
@@ -4302,6 +4335,326 @@ function $311a427246b4e118$export$b8b825ad46c26a3d(columns, columnNames) {
|
|
|
4302
4335
|
|
|
4303
4336
|
});
|
|
4304
4337
|
|
|
4338
|
+
parcelRegister("n9rI9", function(module, exports) {
|
|
4339
|
+
|
|
4340
|
+
$parcel$export(module.exports, "ValidateFormLabelsDefaultProps", function () { return $896277638843ba48$export$f5e2cdf14a0d5fe; });
|
|
4341
|
+
$parcel$export(module.exports, "useValidateFormModals", function () { return $896277638843ba48$export$894a0a0a56a800a7; });
|
|
4342
|
+
|
|
4343
|
+
|
|
4344
|
+
|
|
4345
|
+
|
|
4346
|
+
|
|
4347
|
+
var $j7Y9b = parcelRequire("j7Y9b");
|
|
4348
|
+
|
|
4349
|
+
var $k7qj2 = parcelRequire("k7qj2");
|
|
4350
|
+
const $896277638843ba48$export$f5e2cdf14a0d5fe = {
|
|
4351
|
+
warningTitle: 'Warning',
|
|
4352
|
+
errorTitle: 'Validation error',
|
|
4353
|
+
doYouWantToContinueLabel: 'Do you want to continue?',
|
|
4354
|
+
continueLabel: 'Continue',
|
|
4355
|
+
cancelLabel: 'Cancel',
|
|
4356
|
+
closeLabel: 'Close',
|
|
4357
|
+
unexpectedErrorLabel: 'An unexpected error occurred while validating the form.'
|
|
4358
|
+
};
|
|
4359
|
+
function $896277638843ba48$export$894a0a0a56a800a7() {
|
|
4360
|
+
const modals = (0, $k7qj2.useModal)();
|
|
4361
|
+
const confirmWarning = (0, $b4te3$react.useCallback)((warning)=>{
|
|
4362
|
+
return new Promise((resolve)=>{
|
|
4363
|
+
let confirmed = false;
|
|
4364
|
+
modals.open({
|
|
4365
|
+
content: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $j7Y9b.ConfirmAndExecutePanel), {
|
|
4366
|
+
content: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Stack), {
|
|
4367
|
+
spacing: "xs",
|
|
4368
|
+
children: [
|
|
4369
|
+
warning,
|
|
4370
|
+
/*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Text), {
|
|
4371
|
+
size: "sm",
|
|
4372
|
+
fw: 700,
|
|
4373
|
+
children: $896277638843ba48$export$f5e2cdf14a0d5fe.doYouWantToContinueLabel
|
|
4374
|
+
})
|
|
4375
|
+
]
|
|
4376
|
+
}),
|
|
4377
|
+
operation: "other",
|
|
4378
|
+
okButtonText: $896277638843ba48$export$f5e2cdf14a0d5fe.continueLabel,
|
|
4379
|
+
cancelButtonText: $896277638843ba48$export$f5e2cdf14a0d5fe.cancelLabel,
|
|
4380
|
+
cancelButtonProps: {
|
|
4381
|
+
color: 'gray'
|
|
4382
|
+
},
|
|
4383
|
+
onOK: async ()=>{
|
|
4384
|
+
confirmed = true;
|
|
4385
|
+
await modals.close();
|
|
4386
|
+
},
|
|
4387
|
+
onCancel: async ()=>{
|
|
4388
|
+
await modals.close();
|
|
4389
|
+
}
|
|
4390
|
+
}),
|
|
4391
|
+
modalProps: {
|
|
4392
|
+
title: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Group), {
|
|
4393
|
+
spacing: "xs",
|
|
4394
|
+
children: [
|
|
4395
|
+
/*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconAlertTriangle), {
|
|
4396
|
+
size: "1.25rem"
|
|
4397
|
+
}),
|
|
4398
|
+
/*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Text), {
|
|
4399
|
+
fw: 700,
|
|
4400
|
+
children: $896277638843ba48$export$f5e2cdf14a0d5fe.warningTitle
|
|
4401
|
+
})
|
|
4402
|
+
]
|
|
4403
|
+
}),
|
|
4404
|
+
size: 'md',
|
|
4405
|
+
withCloseButton: false,
|
|
4406
|
+
closeOnClickOutside: false,
|
|
4407
|
+
closeOnEscape: false
|
|
4408
|
+
},
|
|
4409
|
+
// single resolution point: fires on any close, so an external close counts as cancel
|
|
4410
|
+
onClosed: ()=>resolve(confirmed)
|
|
4411
|
+
});
|
|
4412
|
+
});
|
|
4413
|
+
}, [
|
|
4414
|
+
modals
|
|
4415
|
+
]);
|
|
4416
|
+
const showValidationError = (0, $b4te3$react.useCallback)((error)=>{
|
|
4417
|
+
return new Promise((resolve)=>{
|
|
4418
|
+
modals.open({
|
|
4419
|
+
content: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Stack), {
|
|
4420
|
+
children: [
|
|
4421
|
+
error,
|
|
4422
|
+
/*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Group), {
|
|
4423
|
+
position: "right",
|
|
4424
|
+
children: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Button), {
|
|
4425
|
+
onClick: ()=>void modals.close(),
|
|
4426
|
+
children: $896277638843ba48$export$f5e2cdf14a0d5fe.closeLabel
|
|
4427
|
+
})
|
|
4428
|
+
})
|
|
4429
|
+
]
|
|
4430
|
+
}),
|
|
4431
|
+
modalProps: {
|
|
4432
|
+
title: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Group), {
|
|
4433
|
+
spacing: "xs",
|
|
4434
|
+
children: [
|
|
4435
|
+
/*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconAlertCircle), {
|
|
4436
|
+
size: "1.25rem",
|
|
4437
|
+
color: "red"
|
|
4438
|
+
}),
|
|
4439
|
+
/*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Text), {
|
|
4440
|
+
fw: 700,
|
|
4441
|
+
children: $896277638843ba48$export$f5e2cdf14a0d5fe.errorTitle
|
|
4442
|
+
})
|
|
4443
|
+
]
|
|
4444
|
+
}),
|
|
4445
|
+
size: 'md',
|
|
4446
|
+
withCloseButton: false,
|
|
4447
|
+
closeOnClickOutside: false,
|
|
4448
|
+
closeOnEscape: false
|
|
4449
|
+
},
|
|
4450
|
+
onClosed: ()=>resolve()
|
|
4451
|
+
});
|
|
4452
|
+
});
|
|
4453
|
+
}, [
|
|
4454
|
+
modals
|
|
4455
|
+
]);
|
|
4456
|
+
return {
|
|
4457
|
+
confirmWarning: confirmWarning,
|
|
4458
|
+
showValidationError: showValidationError
|
|
4459
|
+
};
|
|
4460
|
+
}
|
|
4461
|
+
|
|
4462
|
+
});
|
|
4463
|
+
parcelRegister("j7Y9b", function(module, exports) {
|
|
4464
|
+
|
|
4465
|
+
$parcel$export(module.exports, "ConfirmAndExecutePanelDefaultProps", function () { return $09bbe0598d47f4d4$export$15dfcf35178dfa07; });
|
|
4466
|
+
$parcel$export(module.exports, "ConfirmAndExecutePanel", function () { return $09bbe0598d47f4d4$export$4f7e43363cbfcc5e; });
|
|
4467
|
+
|
|
4468
|
+
|
|
4469
|
+
|
|
4470
|
+
|
|
4471
|
+
|
|
4472
|
+
var $d50o9 = parcelRequire("d50o9");
|
|
4473
|
+
|
|
4474
|
+
var $lFsp3 = parcelRequire("lFsp3");
|
|
4475
|
+
|
|
4476
|
+
var $abmo4 = parcelRequire("abmo4");
|
|
4477
|
+
const $09bbe0598d47f4d4$export$15dfcf35178dfa07 = {
|
|
4478
|
+
cancelButtonText: "Cancel",
|
|
4479
|
+
okButtonText: "OK",
|
|
4480
|
+
loadingContent: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $lFsp3.FakeProgressBar), {}),
|
|
4481
|
+
okButtonProps: {
|
|
4482
|
+
color: "red"
|
|
4483
|
+
}
|
|
4484
|
+
};
|
|
4485
|
+
function $09bbe0598d47f4d4$export$4f7e43363cbfcc5e(props) {
|
|
4486
|
+
const { content: content, onOK: onOK, onCancel: onCancel, operation: operation, okButtonText: okButtonText, cancelButtonText: cancelButtonText, loadingContent: loadingContent, okButtonProps: okButtonProps, cancelButtonProps: cancelButtonProps, runOnOpen: runOnOpen } = (0, $b4te3$mantinecore.useComponentDefaultProps)('ConfirmAndExecutePanel', $09bbe0598d47f4d4$export$15dfcf35178dfa07, props);
|
|
4487
|
+
const { operationCallback: operationCallback, status: status } = (0, $abmo4.useOperationStatusCallback)({
|
|
4488
|
+
callback: async ()=>await onOK(),
|
|
4489
|
+
operation: operation,
|
|
4490
|
+
deps: []
|
|
4491
|
+
});
|
|
4492
|
+
(0, $b4te3$react.useEffect)(()=>{
|
|
4493
|
+
const runAsync = async ()=>{
|
|
4494
|
+
await operationCallback();
|
|
4495
|
+
};
|
|
4496
|
+
if (runOnOpen) runAsync();
|
|
4497
|
+
}, []);
|
|
4498
|
+
return /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Stack), {
|
|
4499
|
+
children: [
|
|
4500
|
+
status.loading && loadingContent,
|
|
4501
|
+
!status.loading && !status.error && content,
|
|
4502
|
+
status.error && /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $d50o9.AlertError), {
|
|
4503
|
+
mt: "sm",
|
|
4504
|
+
children: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$reactjsxruntime.Fragment), {
|
|
4505
|
+
children: [
|
|
4506
|
+
status.error.status,
|
|
4507
|
+
" ",
|
|
4508
|
+
status.error.message,
|
|
4509
|
+
" ",
|
|
4510
|
+
status.error.statusMessage
|
|
4511
|
+
]
|
|
4512
|
+
})
|
|
4513
|
+
}),
|
|
4514
|
+
/*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Group), {
|
|
4515
|
+
mt: "xs",
|
|
4516
|
+
position: "right",
|
|
4517
|
+
children: [
|
|
4518
|
+
cancelButtonText && /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Button), {
|
|
4519
|
+
...cancelButtonProps,
|
|
4520
|
+
variant: "light",
|
|
4521
|
+
leftIcon: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconCircleX), {
|
|
4522
|
+
size: "1.5rem"
|
|
4523
|
+
}),
|
|
4524
|
+
onClick: async ()=>await Promise.resolve(onCancel()),
|
|
4525
|
+
children: cancelButtonText
|
|
4526
|
+
}),
|
|
4527
|
+
okButtonText && /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Button), {
|
|
4528
|
+
...okButtonProps,
|
|
4529
|
+
onClick: async ()=>await operationCallback(),
|
|
4530
|
+
disabled: !!status.error,
|
|
4531
|
+
loading: status?.loading,
|
|
4532
|
+
leftIcon: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconCircleCheck), {
|
|
4533
|
+
size: "1.5rem"
|
|
4534
|
+
}),
|
|
4535
|
+
children: okButtonText
|
|
4536
|
+
})
|
|
4537
|
+
]
|
|
4538
|
+
})
|
|
4539
|
+
]
|
|
4540
|
+
});
|
|
4541
|
+
}
|
|
4542
|
+
|
|
4543
|
+
});
|
|
4544
|
+
parcelRegister("d50o9", function(module, exports) {
|
|
4545
|
+
|
|
4546
|
+
$parcel$export(module.exports, "AlertErrorDefaultProps", function () { return $1b52620b67bfba9b$export$99c52b840747c5f7; });
|
|
4547
|
+
$parcel$export(module.exports, "AlertError", function () { return $1b52620b67bfba9b$export$50d48eeda63f0543; });
|
|
4548
|
+
|
|
4549
|
+
|
|
4550
|
+
|
|
4551
|
+
const $1b52620b67bfba9b$export$99c52b840747c5f7 = {
|
|
4552
|
+
title: "Error",
|
|
4553
|
+
color: "red"
|
|
4554
|
+
};
|
|
4555
|
+
function $1b52620b67bfba9b$export$50d48eeda63f0543(props) {
|
|
4556
|
+
const { title: title, color: color, iconTooltip: iconTooltip, ...rest } = (0, $b4te3$mantinecore.useComponentDefaultProps)('AlertError', $1b52620b67bfba9b$export$99c52b840747c5f7, props);
|
|
4557
|
+
return /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Alert), {
|
|
4558
|
+
icon: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconAlertCircle), {
|
|
4559
|
+
size: "2rem",
|
|
4560
|
+
title: iconTooltip
|
|
4561
|
+
}),
|
|
4562
|
+
title: title,
|
|
4563
|
+
color: color,
|
|
4564
|
+
...rest,
|
|
4565
|
+
children: props.children
|
|
4566
|
+
});
|
|
4567
|
+
}
|
|
4568
|
+
|
|
4569
|
+
});
|
|
4570
|
+
|
|
4571
|
+
parcelRegister("lFsp3", function(module, exports) {
|
|
4572
|
+
|
|
4573
|
+
$parcel$export(module.exports, "FakeProgressBar", function () { return $3266db6b02200edc$export$9df718b15505ba95; });
|
|
4574
|
+
|
|
4575
|
+
|
|
4576
|
+
|
|
4577
|
+
function $3266db6b02200edc$export$9df718b15505ba95(props) {
|
|
4578
|
+
const [value, setValue] = (0, $b4te3$react.useState)(0);
|
|
4579
|
+
const initialDelay = 10;
|
|
4580
|
+
const maxWait = 360000; // 1 hour
|
|
4581
|
+
const delayRef = (0, $b4te3$react.useRef)(initialDelay);
|
|
4582
|
+
(0, $b4te3$react.useEffect)(()=>{
|
|
4583
|
+
const interval = setInterval(()=>{
|
|
4584
|
+
setValue((v)=>{
|
|
4585
|
+
if (v >= 60) {
|
|
4586
|
+
delayRef.current = initialDelay + Math.pow((maxWait / 10) ** (1 / 40), v - 60);
|
|
4587
|
+
clearInterval(interval);
|
|
4588
|
+
}
|
|
4589
|
+
return Math.min(v + (v >= 60 ? 0.5 : 1), 100);
|
|
4590
|
+
});
|
|
4591
|
+
}, delayRef.current);
|
|
4592
|
+
return ()=>clearInterval(interval);
|
|
4593
|
+
}, [
|
|
4594
|
+
value
|
|
4595
|
+
]);
|
|
4596
|
+
return /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Progress), {
|
|
4597
|
+
value: value,
|
|
4598
|
+
...props
|
|
4599
|
+
});
|
|
4600
|
+
}
|
|
4601
|
+
|
|
4602
|
+
});
|
|
4603
|
+
|
|
4604
|
+
parcelRegister("abmo4", function(module, exports) {
|
|
4605
|
+
|
|
4606
|
+
$parcel$export(module.exports, "useOperationStatusCallback", function () { return $3da154aa48a5edaf$export$aeb2fb6ba7f2e1af; });
|
|
4607
|
+
|
|
4608
|
+
parcelRequire("6Rdyz");
|
|
4609
|
+
var $8yTUG = parcelRequire("8yTUG");
|
|
4610
|
+
var $98ddT = parcelRequire("98ddT");
|
|
4611
|
+
function $3da154aa48a5edaf$export$aeb2fb6ba7f2e1af(props) {
|
|
4612
|
+
const { callback: callback, deps: deps, operation: operation } = props;
|
|
4613
|
+
const [status, setStatus] = (0, $b4te3$react.useState)({});
|
|
4614
|
+
const result = (0, $b4te3$react.useCallback)(async (...args)=>{
|
|
4615
|
+
setStatus({
|
|
4616
|
+
loading: true,
|
|
4617
|
+
operationType: operation
|
|
4618
|
+
});
|
|
4619
|
+
try {
|
|
4620
|
+
const data = await callback(...args);
|
|
4621
|
+
const new_status = {
|
|
4622
|
+
loading: false,
|
|
4623
|
+
data: data,
|
|
4624
|
+
operationType: operation
|
|
4625
|
+
};
|
|
4626
|
+
if ((0, $8yTUG.isDBStatusResult)(data) && data.Failed) new_status.error = (0, $98ddT.toDBStatusMicroMError)(data.Results);
|
|
4627
|
+
else if ((0, $98ddT.isMicroMError)(data)) new_status.error = data;
|
|
4628
|
+
setStatus(new_status);
|
|
4629
|
+
return new_status;
|
|
4630
|
+
} catch (e) {
|
|
4631
|
+
if (e.name !== 'AbortError') {
|
|
4632
|
+
const new_status = {
|
|
4633
|
+
error: e.Errors ? (0, $98ddT.toDBStatusMicroMError)(e.Errors, operation) : (0, $98ddT.toMicroMError)(e),
|
|
4634
|
+
operationType: operation
|
|
4635
|
+
};
|
|
4636
|
+
setStatus(new_status);
|
|
4637
|
+
return new_status;
|
|
4638
|
+
} else return {
|
|
4639
|
+
loading: false,
|
|
4640
|
+
operationType: operation
|
|
4641
|
+
};
|
|
4642
|
+
}
|
|
4643
|
+
}, [
|
|
4644
|
+
callback,
|
|
4645
|
+
operation,
|
|
4646
|
+
...deps
|
|
4647
|
+
]);
|
|
4648
|
+
return {
|
|
4649
|
+
operationCallback: result,
|
|
4650
|
+
status: status
|
|
4651
|
+
};
|
|
4652
|
+
}
|
|
4653
|
+
|
|
4654
|
+
});
|
|
4655
|
+
|
|
4656
|
+
|
|
4657
|
+
|
|
4305
4658
|
|
|
4306
4659
|
parcelRegister("bHLhd", function(module, exports) {
|
|
4307
4660
|
|
|
@@ -4333,7 +4686,7 @@ const $6d150b07756690a5$export$1c1b666b210bfb32 = {
|
|
|
4333
4686
|
formHeight: '100%'
|
|
4334
4687
|
};
|
|
4335
4688
|
function $6d150b07756690a5$export$6d892edbc3527d79(props) {
|
|
4336
|
-
const { formAPI: formAPI, children: children, showOK: showOK, showCancel: showCancel, showErrors: showErrors, showFormValidationNotification: showFormValidationNotification, showLoadingProgress: showLoadingProgress, OKText: OKText, CancelText: CancelText, invalidFieldsLabel: invalidFieldsLabel, showHelpButton: showHelpButton, preventEnterSubmission: preventEnterSubmission, CloseText: CloseText, buttons: buttons, isDirtyColor: isDirtyColor, cancelButtonVariant: cancelButtonVariant, okButtonVariant: okButtonVariant, disableOKIfNotDirty: disableOKIfNotDirty, formHeight: formHeight } = (0, $b4te3$mantinecore.useComponentDefaultProps)('EntityForm', $6d150b07756690a5$export$1c1b666b210bfb32, props);
|
|
4689
|
+
const { formAPI: formAPI, children: children, showOK: showOK, showCancel: showCancel, showErrors: showErrors, showFormValidationNotification: showFormValidationNotification, showLoadingProgress: showLoadingProgress, OKText: OKText, CancelText: CancelText, invalidFieldsLabel: invalidFieldsLabel, showHelpButton: showHelpButton, preventEnterSubmission: preventEnterSubmission, CloseText: CloseText, buttons: buttons, isDirtyColor: isDirtyColor, cancelButtonVariant: cancelButtonVariant, okButtonVariant: okButtonVariant, disableOKIfNotDirty: disableOKIfNotDirty, formHeight: formHeight, disableOK: disableOK } = (0, $b4te3$mantinecore.useComponentDefaultProps)('EntityForm', $6d150b07756690a5$export$1c1b666b210bfb32, props);
|
|
4337
4690
|
const { entity: entity } = formAPI;
|
|
4338
4691
|
const theme = (0, $b4te3$mantinecore.useMantineTheme)();
|
|
4339
4692
|
const { handleCancel: handleCancel, handleSubmit: handleSubmit, notifyValidationErrorState: notifyValidationErrorState, status: status, form: form, formMode: formMode, showDescriptionState: showDescriptionState, isFormValid: isFormValid, asyncErrors: asyncErrors } = formAPI;
|
|
@@ -4437,7 +4790,7 @@ function $6d150b07756690a5$export$6d892edbc3527d79(props) {
|
|
|
4437
4790
|
type: "submit",
|
|
4438
4791
|
color: form.isDirty() ? isDirtyColor : theme.primaryColor,
|
|
4439
4792
|
loading: status?.loading,
|
|
4440
|
-
disabled: disableOKIfNotDirty && !form.isDirty(),
|
|
4793
|
+
disabled: disableOK === true || disableOKIfNotDirty && !form.isDirty(),
|
|
4441
4794
|
leftIcon: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconCircleCheck), {
|
|
4442
4795
|
size: "1.125rem"
|
|
4443
4796
|
}),
|
|
@@ -4683,33 +5036,6 @@ $parcel$exportWildcard(module.exports, $e6gIh);
|
|
|
4683
5036
|
$parcel$exportWildcard(module.exports, $3hE2A);
|
|
4684
5037
|
|
|
4685
5038
|
});
|
|
4686
|
-
parcelRegister("d50o9", function(module, exports) {
|
|
4687
|
-
|
|
4688
|
-
$parcel$export(module.exports, "AlertErrorDefaultProps", function () { return $1b52620b67bfba9b$export$99c52b840747c5f7; });
|
|
4689
|
-
$parcel$export(module.exports, "AlertError", function () { return $1b52620b67bfba9b$export$50d48eeda63f0543; });
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
const $1b52620b67bfba9b$export$99c52b840747c5f7 = {
|
|
4694
|
-
title: "Error",
|
|
4695
|
-
color: "red"
|
|
4696
|
-
};
|
|
4697
|
-
function $1b52620b67bfba9b$export$50d48eeda63f0543(props) {
|
|
4698
|
-
const { title: title, color: color, iconTooltip: iconTooltip, ...rest } = (0, $b4te3$mantinecore.useComponentDefaultProps)('AlertError', $1b52620b67bfba9b$export$99c52b840747c5f7, props);
|
|
4699
|
-
return /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Alert), {
|
|
4700
|
-
icon: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconAlertCircle), {
|
|
4701
|
-
size: "2rem",
|
|
4702
|
-
title: iconTooltip
|
|
4703
|
-
}),
|
|
4704
|
-
title: title,
|
|
4705
|
-
color: color,
|
|
4706
|
-
...rest,
|
|
4707
|
-
children: props.children
|
|
4708
|
-
});
|
|
4709
|
-
}
|
|
4710
|
-
|
|
4711
|
-
});
|
|
4712
|
-
|
|
4713
5039
|
parcelRegister("i6yJ4", function(module, exports) {
|
|
4714
5040
|
|
|
4715
5041
|
$parcel$export(module.exports, "AlertInfoDefaultProps", function () { return $e5f829fbc82220e4$export$f92dd328e9ea7e55; });
|
|
@@ -5305,39 +5631,6 @@ function $67d717822657aa96$export$9754a00b95c53bcb(props) {
|
|
|
5305
5631
|
}
|
|
5306
5632
|
|
|
5307
5633
|
});
|
|
5308
|
-
parcelRegister("lFsp3", function(module, exports) {
|
|
5309
|
-
|
|
5310
|
-
$parcel$export(module.exports, "FakeProgressBar", function () { return $3266db6b02200edc$export$9df718b15505ba95; });
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
function $3266db6b02200edc$export$9df718b15505ba95(props) {
|
|
5315
|
-
const [value, setValue] = (0, $b4te3$react.useState)(0);
|
|
5316
|
-
const initialDelay = 10;
|
|
5317
|
-
const maxWait = 360000; // 1 hour
|
|
5318
|
-
const delayRef = (0, $b4te3$react.useRef)(initialDelay);
|
|
5319
|
-
(0, $b4te3$react.useEffect)(()=>{
|
|
5320
|
-
const interval = setInterval(()=>{
|
|
5321
|
-
setValue((v)=>{
|
|
5322
|
-
if (v >= 60) {
|
|
5323
|
-
delayRef.current = initialDelay + Math.pow((maxWait / 10) ** (1 / 40), v - 60);
|
|
5324
|
-
clearInterval(interval);
|
|
5325
|
-
}
|
|
5326
|
-
return Math.min(v + (v >= 60 ? 0.5 : 1), 100);
|
|
5327
|
-
});
|
|
5328
|
-
}, delayRef.current);
|
|
5329
|
-
return ()=>clearInterval(interval);
|
|
5330
|
-
}, [
|
|
5331
|
-
value
|
|
5332
|
-
]);
|
|
5333
|
-
return /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Progress), {
|
|
5334
|
-
value: value,
|
|
5335
|
-
...props
|
|
5336
|
-
});
|
|
5337
|
-
}
|
|
5338
|
-
|
|
5339
|
-
});
|
|
5340
|
-
|
|
5341
5634
|
parcelRegister("k00la", function(module, exports) {
|
|
5342
5635
|
|
|
5343
5636
|
$parcel$export(module.exports, "TotpSetupDefaultProps", function () { return $4896b8c893e8a8b7$export$2a737ca3b0b47ab9; });
|
|
@@ -6412,140 +6705,6 @@ function $e376e2988f185d5e$export$94195a47b94ed396(props) {
|
|
|
6412
6705
|
|
|
6413
6706
|
});
|
|
6414
6707
|
|
|
6415
|
-
parcelRegister("j7Y9b", function(module, exports) {
|
|
6416
|
-
|
|
6417
|
-
$parcel$export(module.exports, "ConfirmAndExecutePanelDefaultProps", function () { return $09bbe0598d47f4d4$export$15dfcf35178dfa07; });
|
|
6418
|
-
$parcel$export(module.exports, "ConfirmAndExecutePanel", function () { return $09bbe0598d47f4d4$export$4f7e43363cbfcc5e; });
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
var $d50o9 = parcelRequire("d50o9");
|
|
6425
|
-
|
|
6426
|
-
var $lFsp3 = parcelRequire("lFsp3");
|
|
6427
|
-
|
|
6428
|
-
var $abmo4 = parcelRequire("abmo4");
|
|
6429
|
-
const $09bbe0598d47f4d4$export$15dfcf35178dfa07 = {
|
|
6430
|
-
cancelButtonText: "Cancel",
|
|
6431
|
-
okButtonText: "OK",
|
|
6432
|
-
loadingContent: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $lFsp3.FakeProgressBar), {}),
|
|
6433
|
-
okButtonProps: {
|
|
6434
|
-
color: "red"
|
|
6435
|
-
}
|
|
6436
|
-
};
|
|
6437
|
-
function $09bbe0598d47f4d4$export$4f7e43363cbfcc5e(props) {
|
|
6438
|
-
const { content: content, onOK: onOK, onCancel: onCancel, operation: operation, okButtonText: okButtonText, cancelButtonText: cancelButtonText, loadingContent: loadingContent, okButtonProps: okButtonProps, cancelButtonProps: cancelButtonProps, runOnOpen: runOnOpen } = (0, $b4te3$mantinecore.useComponentDefaultProps)('ConfirmAndExecutePanel', $09bbe0598d47f4d4$export$15dfcf35178dfa07, props);
|
|
6439
|
-
const { operationCallback: operationCallback, status: status } = (0, $abmo4.useOperationStatusCallback)({
|
|
6440
|
-
callback: async ()=>await onOK(),
|
|
6441
|
-
operation: operation,
|
|
6442
|
-
deps: []
|
|
6443
|
-
});
|
|
6444
|
-
(0, $b4te3$react.useEffect)(()=>{
|
|
6445
|
-
const runAsync = async ()=>{
|
|
6446
|
-
await operationCallback();
|
|
6447
|
-
};
|
|
6448
|
-
if (runOnOpen) runAsync();
|
|
6449
|
-
}, []);
|
|
6450
|
-
return /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Stack), {
|
|
6451
|
-
children: [
|
|
6452
|
-
status.loading && loadingContent,
|
|
6453
|
-
!status.loading && !status.error && content,
|
|
6454
|
-
status.error && /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $d50o9.AlertError), {
|
|
6455
|
-
mt: "sm",
|
|
6456
|
-
children: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$reactjsxruntime.Fragment), {
|
|
6457
|
-
children: [
|
|
6458
|
-
status.error.status,
|
|
6459
|
-
" ",
|
|
6460
|
-
status.error.message,
|
|
6461
|
-
" ",
|
|
6462
|
-
status.error.statusMessage
|
|
6463
|
-
]
|
|
6464
|
-
})
|
|
6465
|
-
}),
|
|
6466
|
-
/*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Group), {
|
|
6467
|
-
mt: "xs",
|
|
6468
|
-
position: "right",
|
|
6469
|
-
children: [
|
|
6470
|
-
cancelButtonText && /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Button), {
|
|
6471
|
-
...cancelButtonProps,
|
|
6472
|
-
variant: "light",
|
|
6473
|
-
leftIcon: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconCircleX), {
|
|
6474
|
-
size: "1.5rem"
|
|
6475
|
-
}),
|
|
6476
|
-
onClick: async ()=>await Promise.resolve(onCancel()),
|
|
6477
|
-
children: cancelButtonText
|
|
6478
|
-
}),
|
|
6479
|
-
okButtonText && /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.Button), {
|
|
6480
|
-
...okButtonProps,
|
|
6481
|
-
onClick: async ()=>await operationCallback(),
|
|
6482
|
-
disabled: !!status.error,
|
|
6483
|
-
loading: status?.loading,
|
|
6484
|
-
leftIcon: /*#__PURE__*/ (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconCircleCheck), {
|
|
6485
|
-
size: "1.5rem"
|
|
6486
|
-
}),
|
|
6487
|
-
children: okButtonText
|
|
6488
|
-
})
|
|
6489
|
-
]
|
|
6490
|
-
})
|
|
6491
|
-
]
|
|
6492
|
-
});
|
|
6493
|
-
}
|
|
6494
|
-
|
|
6495
|
-
});
|
|
6496
|
-
parcelRegister("abmo4", function(module, exports) {
|
|
6497
|
-
|
|
6498
|
-
$parcel$export(module.exports, "useOperationStatusCallback", function () { return $3da154aa48a5edaf$export$aeb2fb6ba7f2e1af; });
|
|
6499
|
-
|
|
6500
|
-
parcelRequire("6Rdyz");
|
|
6501
|
-
var $8yTUG = parcelRequire("8yTUG");
|
|
6502
|
-
var $98ddT = parcelRequire("98ddT");
|
|
6503
|
-
function $3da154aa48a5edaf$export$aeb2fb6ba7f2e1af(props) {
|
|
6504
|
-
const { callback: callback, deps: deps, operation: operation } = props;
|
|
6505
|
-
const [status, setStatus] = (0, $b4te3$react.useState)({});
|
|
6506
|
-
const result = (0, $b4te3$react.useCallback)(async (...args)=>{
|
|
6507
|
-
setStatus({
|
|
6508
|
-
loading: true,
|
|
6509
|
-
operationType: operation
|
|
6510
|
-
});
|
|
6511
|
-
try {
|
|
6512
|
-
const data = await callback(...args);
|
|
6513
|
-
const new_status = {
|
|
6514
|
-
loading: false,
|
|
6515
|
-
data: data,
|
|
6516
|
-
operationType: operation
|
|
6517
|
-
};
|
|
6518
|
-
if ((0, $8yTUG.isDBStatusResult)(data) && data.Failed) new_status.error = (0, $98ddT.toDBStatusMicroMError)(data.Results);
|
|
6519
|
-
else if ((0, $98ddT.isMicroMError)(data)) new_status.error = data;
|
|
6520
|
-
setStatus(new_status);
|
|
6521
|
-
return new_status;
|
|
6522
|
-
} catch (e) {
|
|
6523
|
-
if (e.name !== 'AbortError') {
|
|
6524
|
-
const new_status = {
|
|
6525
|
-
error: e.Errors ? (0, $98ddT.toDBStatusMicroMError)(e.Errors, operation) : (0, $98ddT.toMicroMError)(e),
|
|
6526
|
-
operationType: operation
|
|
6527
|
-
};
|
|
6528
|
-
setStatus(new_status);
|
|
6529
|
-
return new_status;
|
|
6530
|
-
} else return {
|
|
6531
|
-
loading: false,
|
|
6532
|
-
operationType: operation
|
|
6533
|
-
};
|
|
6534
|
-
}
|
|
6535
|
-
}, [
|
|
6536
|
-
callback,
|
|
6537
|
-
operation,
|
|
6538
|
-
...deps
|
|
6539
|
-
]);
|
|
6540
|
-
return {
|
|
6541
|
-
operationCallback: result,
|
|
6542
|
-
status: status
|
|
6543
|
-
};
|
|
6544
|
-
}
|
|
6545
|
-
|
|
6546
|
-
});
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
6708
|
parcelRegister("fL9cC", function(module, exports) {
|
|
6550
6709
|
|
|
6551
6710
|
$parcel$export(module.exports, "EmailFieldDefaultProps", function () { return $5783e2898020a483$export$fd661e07366da84f; });
|