dce-reactkit 3.6.17 → 3.6.19

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
@@ -621,7 +621,11 @@ const Modal = (props) => {
621
621
  React__default["default"].createElement("h5", { className: "modal-title", style: {
622
622
  fontWeight: 'bold',
623
623
  } }, title),
624
- onClose && (React__default["default"].createElement("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: () => {
624
+ onClose && (React__default["default"].createElement("button", { type: "button", className: "Modal-x-button btn-close", "aria-label": "Close", style: {
625
+ backgroundColor: (isDarkModeOn()
626
+ ? 'white'
627
+ : undefined),
628
+ }, onClick: () => {
625
629
  // Handle close
626
630
  handleClose(ModalButtonType$1.Cancel);
627
631
  } }))),
@@ -2086,7 +2090,7 @@ var ActionType$9;
2086
2090
  * @param state current state
2087
2091
  * @param action action to execute
2088
2092
  */
2089
- const reducer$9 = (state, action) => {
2093
+ const reducer$a = (state, action) => {
2090
2094
  switch (action.type) {
2091
2095
  case ActionType$9.IndicateRecentlyCopied: {
2092
2096
  return {
@@ -2119,7 +2123,7 @@ const CopiableBox = (props) => {
2119
2123
  recentlyCopied: false,
2120
2124
  };
2121
2125
  // Initialize state
2122
- const [state, dispatch] = React.useReducer(reducer$9, initialState);
2126
+ const [state, dispatch] = React.useReducer(reducer$a, initialState);
2123
2127
  // Destructure common state
2124
2128
  const { recentlyCopied, } = state;
2125
2129
  /*------------------------------------------------------------------------*/
@@ -2212,7 +2216,7 @@ var ActionType$8;
2212
2216
  * @param state current state
2213
2217
  * @param action action to execute
2214
2218
  */
2215
- const reducer$8 = (state, action) => {
2219
+ const reducer$9 = (state, action) => {
2216
2220
  switch (action.type) {
2217
2221
  case ActionType$8.ToggleChild: {
2218
2222
  return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
@@ -2243,7 +2247,7 @@ const NestableItemList = (props) => {
2243
2247
  childExpanded: initChildExpanded,
2244
2248
  };
2245
2249
  // Initialize state
2246
- const [state, dispatch] = React.useReducer(reducer$8, initialState);
2250
+ const [state, dispatch] = React.useReducer(reducer$9, initialState);
2247
2251
  // Destructure common state
2248
2252
  const { childExpanded, } = state;
2249
2253
  /*------------------------------------------------------------------------*/
@@ -2628,7 +2632,7 @@ var ActionType$7;
2628
2632
  * @param state current state
2629
2633
  * @param action action to execute
2630
2634
  */
2631
- const reducer$7 = (state, action) => {
2635
+ const reducer$8 = (state, action) => {
2632
2636
  switch (action.type) {
2633
2637
  case ActionType$7.ToggleSortColumn: {
2634
2638
  if (action.param !== state.sortColumnParam) {
@@ -2704,7 +2708,7 @@ const IntelliTable = (props) => {
2704
2708
  columnVisibilityCustomizationModalVisible: false,
2705
2709
  };
2706
2710
  // Initialize state
2707
- const [state, dispatch] = React.useReducer(reducer$7, initialState);
2711
+ const [state, dispatch] = React.useReducer(reducer$8, initialState);
2708
2712
  // Destructure common state
2709
2713
  const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
2710
2714
  /*------------------------------------------------------------------------*/
@@ -3382,7 +3386,7 @@ var ActionType$6;
3382
3386
  * @param state current state
3383
3387
  * @param action action to execute
3384
3388
  */
3385
- const reducer$6 = (state, action) => {
3389
+ const reducer$7 = (state, action) => {
3386
3390
  switch (action.type) {
3387
3391
  case ActionType$6.StartLoading: {
3388
3392
  return Object.assign(Object.assign({}, state), { loading: true });
@@ -3542,7 +3546,7 @@ const LogReviewer = (props) => {
3542
3546
  advancedFilterState: initAdvancedFilterState,
3543
3547
  };
3544
3548
  // Initialize state
3545
- const [state, dispatch] = React.useReducer(reducer$6, initialState);
3549
+ const [state, dispatch] = React.useReducer(reducer$7, initialState);
3546
3550
  // Destructure common state
3547
3551
  const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
3548
3552
  /*------------------------------------------------------------------------*/
@@ -39693,7 +39697,7 @@ var ActionType$5;
39693
39697
  * @param action action to execute
39694
39698
  * @returns updated state
39695
39699
  */
39696
- const reducer$5 = (state, action) => {
39700
+ const reducer$6 = (state, action) => {
39697
39701
  switch (action.type) {
39698
39702
  case ActionType$5.SetInputValue: {
39699
39703
  return Object.assign(Object.assign({}, state), { inputValue: action.value });
@@ -39715,7 +39719,7 @@ const CreatableMultiselect = (props) => {
39715
39719
  inputValue: '',
39716
39720
  };
39717
39721
  // Initialize state
39718
- const [state, dispatch] = React.useReducer(reducer$5, initialState);
39722
+ const [state, dispatch] = React.useReducer(reducer$6, initialState);
39719
39723
  // Destructure common state
39720
39724
  const { inputValue } = state;
39721
39725
  /*------------------------------------------------------------------------*/
@@ -39897,7 +39901,7 @@ var ActionType$4;
39897
39901
  * @param action action to execute
39898
39902
  * @returns updated state
39899
39903
  */
39900
- const reducer$4 = (state, action) => {
39904
+ const reducer$5 = (state, action) => {
39901
39905
  switch (action.type) {
39902
39906
  case ActionType$4.UpdateDBEntry: {
39903
39907
  return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
@@ -39927,7 +39931,7 @@ const AddOrEditDBEntry = (props) => {
39927
39931
  saving: false,
39928
39932
  };
39929
39933
  // Initialize state
39930
- const [state, dispatch] = React.useReducer(reducer$4, initialState);
39934
+ const [state, dispatch] = React.useReducer(reducer$5, initialState);
39931
39935
  // Destructure common state
39932
39936
  const { entry, saving, } = state;
39933
39937
  /*------------------------------------------------------------------------*/
@@ -40301,7 +40305,7 @@ var ActionType$3;
40301
40305
  * @param action action to execute
40302
40306
  * @returns updated state
40303
40307
  */
40304
- const reducer$3 = (state, action) => {
40308
+ const reducer$4 = (state, action) => {
40305
40309
  switch (action.type) {
40306
40310
  case ActionType$3.FinishLoading: {
40307
40311
  return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
@@ -40365,7 +40369,7 @@ const DBEntryManagerPanel = (props) => {
40365
40369
  loading: true,
40366
40370
  };
40367
40371
  // Initialize state
40368
- const [state, dispatch] = React.useReducer(reducer$3, initialState);
40372
+ const [state, dispatch] = React.useReducer(reducer$4, initialState);
40369
40373
  // Destructure common state
40370
40374
  const { adding, dbEntryToEdit, dbEntries, loading, } = state;
40371
40375
  /*------------------------------------------------------------------------*/
@@ -40710,7 +40714,7 @@ var ActionType$2;
40710
40714
  * @param state current state
40711
40715
  * @param action action to execute
40712
40716
  */
40713
- const reducer$2 = (state, action) => {
40717
+ const reducer$3 = (state, action) => {
40714
40718
  switch (action.type) {
40715
40719
  case ActionType$2.Show: {
40716
40720
  return Object.assign(Object.assign({}, state), { isVisible: true });
@@ -40749,7 +40753,7 @@ const Tooltip = (props) => {
40749
40753
  nudgePx: 0,
40750
40754
  };
40751
40755
  // Initialize state
40752
- const [state, dispatch] = React.useReducer(reducer$2, initialState);
40756
+ const [state, dispatch] = React.useReducer(reducer$3, initialState);
40753
40757
  // Destructure common state
40754
40758
  const { isVisible, nudgePx, squareBottomLeft, squareBottomRight, } = state;
40755
40759
  /* -------------- Refs -------------- */
@@ -41008,7 +41012,7 @@ var ActionType$1;
41008
41012
  * @param state current state
41009
41013
  * @param action action to execute
41010
41014
  */
41011
- const reducer$1 = (state, action) => {
41015
+ const reducer$2 = (state, action) => {
41012
41016
  switch (action.type) {
41013
41017
  case ActionType$1.HideJumpToBottomButton: {
41014
41018
  return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
@@ -41037,7 +41041,7 @@ const AutoscrollToBottomContainer = (props) => {
41037
41041
  jumpToBottomButtonVisible: false,
41038
41042
  };
41039
41043
  // Initialize state
41040
- const [state, dispatch] = React.useReducer(reducer$1, initialState);
41044
+ const [state, dispatch] = React.useReducer(reducer$2, initialState);
41041
41045
  // Destructure common state
41042
41046
  const { jumpToBottomButtonVisible, } = state;
41043
41047
  /* -------------- Refs -------------- */
@@ -41232,7 +41236,7 @@ var ActionType;
41232
41236
  * @param state current state
41233
41237
  * @param action action to execute
41234
41238
  */
41235
- const reducer = (state, action) => {
41239
+ const reducer$1 = (state, action) => {
41236
41240
  switch (action.type) {
41237
41241
  case ActionType.StartHover: {
41238
41242
  return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
@@ -41261,7 +41265,7 @@ const MultiSwitch = (props) => {
41261
41265
  hoveredOptionId: undefined,
41262
41266
  };
41263
41267
  // Initialize state
41264
- const [state, dispatch] = React.useReducer(reducer, initialState);
41268
+ const [state, dispatch] = React.useReducer(reducer$1, initialState);
41265
41269
  // Destructure common state
41266
41270
  const { hoveredOptionId, } = state;
41267
41271
  /*------------------------------------------------------------------------*/
@@ -43374,6 +43378,40 @@ const prefixWithAOrAn = (text, capitalize = false) => {
43374
43378
  return `${prefix} ${text}`;
43375
43379
  };
43376
43380
 
43381
+ /* -------- State Definition -------- */
43382
+ /* ------------- Reducer ------------ */
43383
+ /**
43384
+ * Reducer that executes actions
43385
+ * @author Gabe Abrams
43386
+ * @param state current state
43387
+ */
43388
+ const reducer = (state) => {
43389
+ return {
43390
+ renderCount: state.renderCount + 1,
43391
+ };
43392
+ };
43393
+ /* -------------- Main -------------- */
43394
+ /**
43395
+ * Create a function that forces a render of a component. Use this only when
43396
+ * absolutely necessary
43397
+ * @author Gabe Abrams
43398
+ * @param useReducer the useReducer hook
43399
+ * @returns forceRender function
43400
+ */
43401
+ const useForceRender = (useReducer) => {
43402
+ // Initial state
43403
+ const initialState = {
43404
+ renderCount: 0,
43405
+ };
43406
+ // Initialize state
43407
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
43408
+ const [state, dispatch] = useReducer(reducer, initialState);
43409
+ // Create and return the forceRender function
43410
+ return () => {
43411
+ dispatch();
43412
+ };
43413
+ };
43414
+
43377
43415
  /**
43378
43416
  * Days of the week
43379
43417
  * @author Gabe Abrams
@@ -43473,6 +43511,7 @@ exports.startMinWait = startMinWait;
43473
43511
  exports.stringsToHumanReadableList = stringsToHumanReadableList;
43474
43512
  exports.stubServerEndpoint = stubServerEndpoint;
43475
43513
  exports.sum = sum;
43514
+ exports.useForceRender = useForceRender;
43476
43515
  exports.validateEmail = validateEmail;
43477
43516
  exports.validatePhoneNumber = validatePhoneNumber;
43478
43517
  exports.validateString = validateString;