dce-reactkit 3.7.8 → 3.7.10-beta.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 CHANGED
@@ -413,7 +413,7 @@ const getModalButtonTypeToLabelAndVariant = () => {
413
413
  /* -------------------------------- Style ------------------------------- */
414
414
  /*------------------------------------------------------------------------*/
415
415
  const style$a = `
416
- .Modal-backdrop {
416
+ .ModalForWrapper-backdrop {
417
417
  position: fixed;
418
418
  top: 0;
419
419
  left: 0;
@@ -421,7 +421,7 @@ const style$a = `
421
421
  height: 200vh;
422
422
  background-color: rgba(0, 0, 0, 0.7);
423
423
  }
424
- .Modal-fading-in {
424
+ .ModalForWrapper-fading-in {
425
425
  animation-name: Modal-fading-in;
426
426
  animation-duration: ${Math.floor(MS_TO_ANIMATE * 2)}ms;
427
427
  animation-iteration-count: 1;
@@ -436,7 +436,7 @@ const style$a = `
436
436
  opacity: 1;
437
437
  }
438
438
  }
439
- .Modal-animating-in {
439
+ .ModalForWrapper-animating-in {
440
440
  animation-name: Modal-animating-in;
441
441
  animation-duration: ${MS_TO_ANIMATE}ms;
442
442
  animation-iteration-count: 1;
@@ -453,14 +453,14 @@ const style$a = `
453
453
  opacity: 1;
454
454
  }
455
455
  }
456
- .Modal-animating-pop {
457
- animation-name: Modal-animating-pop;
456
+ .ModalForWrapper-animating-pop {
457
+ animation-name: ModalForWrapper-animating-pop;
458
458
  animation-duration: ${MS_TO_ANIMATE}ms;
459
459
  animation-iteration-count: 1;
460
460
  animation-fill-mode: both;
461
461
  animation-timing-function: ease-in-out;
462
462
  }
463
- @keyframes Modal-animating-pop {
463
+ @keyframes ModalForWrapper-animating-pop {
464
464
  0% {
465
465
  transform: scale(1);
466
466
  opacity: 1;
@@ -474,10 +474,6 @@ const style$a = `
474
474
  opacity: 1;
475
475
  }
476
476
  }
477
-
478
- .modal-dialog-scrollable {
479
- height: 100% !important;
480
- }
481
477
  `;
482
478
  /*------------------------------------------------------------------------*/
483
479
  /* ------------------------------ Component ----------------------------- */
@@ -557,7 +553,7 @@ const Modal = (props) => {
557
553
  // Check if this button is last
558
554
  const last = (i === ModalButtonTypes.length - 1);
559
555
  // Create the button
560
- return (React__default["default"].createElement("button", { key: modalButtonType, type: "button", className: `Modal-${modalButtonType}-button btn btn-${variant} ${last ? '' : 'me-1'}`, onClick: () => {
556
+ return (React__default["default"].createElement("button", { key: modalButtonType, type: "button", className: `ModalForWrapper-${modalButtonType}-button btn btn-${variant} ${last ? '' : 'me-1'}`, onClick: () => {
561
557
  handleClose(modalButtonType);
562
558
  } }, label));
563
559
  });
@@ -569,11 +565,11 @@ const Modal = (props) => {
569
565
  let animationClass = '';
570
566
  let backdropAnimationClass = '';
571
567
  if (animatingIn) {
572
- animationClass = 'Modal-animating-in';
573
- backdropAnimationClass = 'Modal-fading-in';
568
+ animationClass = 'ModalForWrapper-animating-in';
569
+ backdropAnimationClass = 'ModalForWrapper-fading-in';
574
570
  }
575
571
  else if (animatingPop) {
576
- animationClass = 'Modal-animating-pop';
572
+ animationClass = 'ModalForWrapper-animating-pop';
577
573
  }
578
574
  // Render the modal
579
575
  return (React__default["default"].createElement("div", { className: "modal show", tabIndex: -1, style: {
@@ -586,7 +582,7 @@ const Modal = (props) => {
586
582
  right: 0,
587
583
  } },
588
584
  React__default["default"].createElement("style", null, style$a),
589
- React__default["default"].createElement("div", { className: `Modal-backdrop ${backdropAnimationClass}`, style: {
585
+ React__default["default"].createElement("div", { className: `ModalForWrapper-backdrop ${backdropAnimationClass}`, style: {
590
586
  zIndex: 5000000003,
591
587
  }, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
592
588
  // Skip if exit via backdrop not allowed
@@ -625,7 +621,7 @@ const Modal = (props) => {
625
621
  React__default["default"].createElement("h5", { className: "modal-title", style: {
626
622
  fontWeight: 'bold',
627
623
  } }, title),
628
- (onClose && !dontShowXButton) && (React__default["default"].createElement("button", { type: "button", className: "Modal-x-button btn-close", "aria-label": "Close", style: {
624
+ (onClose && !dontShowXButton) && (React__default["default"].createElement("button", { type: "button", className: "ModalForWrapper-x-button btn-close", "aria-label": "Close", style: {
629
625
  backgroundColor: (isDarkModeOn()
630
626
  ? 'white'
631
627
  : undefined),
@@ -1135,6 +1131,8 @@ const AppWrapper = (props) => {
1135
1131
  // Session expired
1136
1132
  const [sessionHasExpired, setSessionHasExpiredInner,] = React.useState(false);
1137
1133
  setSessionHasExpired = setSessionHasExpiredInner;
1134
+ // Modals
1135
+ const [modalsFromState, setModalsInner,] = React.useState([]);
1138
1136
  /*------------------------------------------------------------------------*/
1139
1137
  /* ------------------------------- Render ------------------------------- */
1140
1138
  /*------------------------------------------------------------------------*/
@@ -1162,6 +1160,14 @@ const AppWrapper = (props) => {
1162
1160
  }
1163
1161
  }, dontAllowBackdropExit: true }, confirmInfo.text));
1164
1162
  }
1163
+ /* ---------- Custom Modals --------- */
1164
+ // List of modals added outside reactkit via the Modal component
1165
+ const customModals = [];
1166
+ // Add custom modals
1167
+ modalsFromState.forEach((modalTuple) => {
1168
+ var _a;
1169
+ customModals.push(React__default["default"].createElement(Modal, Object.assign({ key: String((_a = modalTuple.props.key) !== null && _a !== void 0 ? _a : modalTuple.id) }, modalTuple.props)));
1170
+ });
1165
1171
  /*----------------------------------------*/
1166
1172
  /* ---------------- Views --------------- */
1167
1173
  /*----------------------------------------*/
@@ -1226,10 +1232,12 @@ const AppWrapper = (props) => {
1226
1232
  background-color: white;
1227
1233
  color: black;
1228
1234
  border: 0.1rem solid black;
1235
+ pointer-events: none;
1229
1236
  }
1230
1237
  div[data-popper-placement="top"] .tooltip-arrow::before {
1231
1238
  border-top-color: white !important;
1232
1239
  transform: translate(0, -0.05rem);
1240
+ pointer-events: none;
1233
1241
  }
1234
1242
  `
1235
1243
  : `
@@ -1237,10 +1245,12 @@ const AppWrapper = (props) => {
1237
1245
  background-color: black;
1238
1246
  color: black;
1239
1247
  border: 0.1rem solid white;
1248
+ pointer-events: none;
1240
1249
  }
1241
1250
  div[data-popper-placement="top"] .tooltip-arrow::before {
1242
1251
  border-top-color: black !important;
1243
1252
  transform: translate(0, -0.05rem);
1253
+ pointer-events: none;
1244
1254
  }
1245
1255
  `);
1246
1256
  /*----------------------------------------*/
@@ -1250,6 +1260,7 @@ const AppWrapper = (props) => {
1250
1260
  React__default["default"].createElement("style", null, style$9),
1251
1261
  React__default["default"].createElement("style", null, tooltipStyle),
1252
1262
  modal,
1263
+ customModals,
1253
1264
  body));
1254
1265
  };
1255
1266