dce-reactkit 3.7.37 → 3.8.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/cjs/index.js +16 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +16 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Modal/index.tsx +49 -44
- package/src/helpers/visitServerEndpoint.tsx +15 -1
package/dist/cjs/index.js
CHANGED
|
@@ -510,6 +510,8 @@ const Modal = (props) => {
|
|
|
510
510
|
var _a;
|
|
511
511
|
/* -------------- Props ------------- */
|
|
512
512
|
const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, largeTitle, children, onClose, dontAllowBackdropExit, dontShowXButton, onTopOfOtherModals, } = props;
|
|
513
|
+
// Determine if no header either
|
|
514
|
+
const noHeader = (!title && type === ModalType$1.NoButtons);
|
|
513
515
|
/* -------------- State ------------- */
|
|
514
516
|
// True if animation is in use
|
|
515
517
|
const [animatingIn, setAnimatingIn] = React.useState(true);
|
|
@@ -647,7 +649,7 @@ const Modal = (props) => {
|
|
|
647
649
|
? 'gray'
|
|
648
650
|
: undefined),
|
|
649
651
|
} },
|
|
650
|
-
React__default["default"].createElement("div", { className: "modal-header", style: {
|
|
652
|
+
!noHeader && (React__default["default"].createElement("div", { className: "modal-header", style: {
|
|
651
653
|
color: (isDarkModeOn()
|
|
652
654
|
? 'white'
|
|
653
655
|
: undefined),
|
|
@@ -671,7 +673,7 @@ const Modal = (props) => {
|
|
|
671
673
|
}, onClick: () => {
|
|
672
674
|
// Handle close
|
|
673
675
|
handleClose(ModalButtonType$1.Cancel);
|
|
674
|
-
} }))),
|
|
676
|
+
} })))),
|
|
675
677
|
children && (React__default["default"].createElement("div", { className: "modal-body", style: {
|
|
676
678
|
color: (isDarkModeOn()
|
|
677
679
|
? 'white'
|
|
@@ -794,10 +796,21 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function
|
|
|
794
796
|
if (opts.params) {
|
|
795
797
|
params = Object.fromEntries(Object
|
|
796
798
|
.entries(opts.params)
|
|
797
|
-
.filter(([
|
|
799
|
+
.filter(([, value]) => {
|
|
798
800
|
return value !== undefined;
|
|
799
801
|
}));
|
|
800
802
|
}
|
|
803
|
+
// Automatically JSONify arrays and objects
|
|
804
|
+
if (params) {
|
|
805
|
+
params = Object.fromEntries(Object
|
|
806
|
+
.entries(params)
|
|
807
|
+
.map(([key, value]) => {
|
|
808
|
+
if (Array.isArray(value) || typeof value === 'object') {
|
|
809
|
+
return [key, JSON.stringify(value)];
|
|
810
|
+
}
|
|
811
|
+
return [key, value];
|
|
812
|
+
}));
|
|
813
|
+
}
|
|
801
814
|
// Send the request
|
|
802
815
|
const sendRequest = yield getSendRequest();
|
|
803
816
|
const response = yield sendRequest({
|