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.
@@ -69,6 +69,7 @@ import idify from './helpers/idify';
69
69
  import makeLinksClickable from './helpers/makeLinksClickable';
70
70
  import combineClassNames from './helpers/combineClassNames';
71
71
  import prefixWithAOrAn from './helpers/prefixWithAOrAn';
72
+ import useForceRender from './helpers/useForceRender';
72
73
  import ModalButtonType from './types/ModalButtonType';
73
74
  import ModalSize from './types/ModalSize';
74
75
  import ModalType from './types/ModalType';
@@ -87,4 +88,4 @@ import PickableItem from './components/ItemPicker/types/PickableItem';
87
88
  import DBEntry from './components/DBEntryManagerPanel/types/DBEntry';
88
89
  import DBEntryField from './components/DBEntryManagerPanel/types/DBEntryField';
89
90
  import DBEntryFieldType from './components/DBEntryManagerPanel/types/DBEntryFieldType';
90
- export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, MultiSwitch, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, makeLinksClickable, prefixWithAOrAn, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, leaveToURL, combineClassNames, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, addDBEditorEndpoints, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, ParamType, };
91
+ export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, DBEntryManagerPanel, Tooltip, ToggleSwitch, AutoscrollToBottomContainer, MultiSwitch, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, makeLinksClickable, prefixWithAOrAn, initClient, visitServerEndpoint, logClientEvent, addFatalErrorHandler, leaveToURL, combineClassNames, useForceRender, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, addDBEditorEndpoints, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, DBEntry, DBEntryField, DBEntryFieldType, ParamType, };
package/dist/esm/index.js CHANGED
@@ -595,7 +595,11 @@ const Modal = (props) => {
595
595
  React__default.createElement("h5", { className: "modal-title", style: {
596
596
  fontWeight: 'bold',
597
597
  } }, title),
598
- onClose && (React__default.createElement("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: () => {
598
+ onClose && (React__default.createElement("button", { type: "button", className: "Modal-x-button btn-close", "aria-label": "Close", style: {
599
+ backgroundColor: (isDarkModeOn()
600
+ ? 'white'
601
+ : undefined),
602
+ }, onClick: () => {
599
603
  // Handle close
600
604
  handleClose(ModalButtonType$1.Cancel);
601
605
  } }))),
@@ -2060,7 +2064,7 @@ var ActionType$9;
2060
2064
  * @param state current state
2061
2065
  * @param action action to execute
2062
2066
  */
2063
- const reducer$9 = (state, action) => {
2067
+ const reducer$a = (state, action) => {
2064
2068
  switch (action.type) {
2065
2069
  case ActionType$9.IndicateRecentlyCopied: {
2066
2070
  return {
@@ -2093,7 +2097,7 @@ const CopiableBox = (props) => {
2093
2097
  recentlyCopied: false,
2094
2098
  };
2095
2099
  // Initialize state
2096
- const [state, dispatch] = useReducer(reducer$9, initialState);
2100
+ const [state, dispatch] = useReducer(reducer$a, initialState);
2097
2101
  // Destructure common state
2098
2102
  const { recentlyCopied, } = state;
2099
2103
  /*------------------------------------------------------------------------*/
@@ -2186,7 +2190,7 @@ var ActionType$8;
2186
2190
  * @param state current state
2187
2191
  * @param action action to execute
2188
2192
  */
2189
- const reducer$8 = (state, action) => {
2193
+ const reducer$9 = (state, action) => {
2190
2194
  switch (action.type) {
2191
2195
  case ActionType$8.ToggleChild: {
2192
2196
  return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
@@ -2217,7 +2221,7 @@ const NestableItemList = (props) => {
2217
2221
  childExpanded: initChildExpanded,
2218
2222
  };
2219
2223
  // Initialize state
2220
- const [state, dispatch] = useReducer(reducer$8, initialState);
2224
+ const [state, dispatch] = useReducer(reducer$9, initialState);
2221
2225
  // Destructure common state
2222
2226
  const { childExpanded, } = state;
2223
2227
  /*------------------------------------------------------------------------*/
@@ -2602,7 +2606,7 @@ var ActionType$7;
2602
2606
  * @param state current state
2603
2607
  * @param action action to execute
2604
2608
  */
2605
- const reducer$7 = (state, action) => {
2609
+ const reducer$8 = (state, action) => {
2606
2610
  switch (action.type) {
2607
2611
  case ActionType$7.ToggleSortColumn: {
2608
2612
  if (action.param !== state.sortColumnParam) {
@@ -2678,7 +2682,7 @@ const IntelliTable = (props) => {
2678
2682
  columnVisibilityCustomizationModalVisible: false,
2679
2683
  };
2680
2684
  // Initialize state
2681
- const [state, dispatch] = useReducer(reducer$7, initialState);
2685
+ const [state, dispatch] = useReducer(reducer$8, initialState);
2682
2686
  // Destructure common state
2683
2687
  const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
2684
2688
  /*------------------------------------------------------------------------*/
@@ -3356,7 +3360,7 @@ var ActionType$6;
3356
3360
  * @param state current state
3357
3361
  * @param action action to execute
3358
3362
  */
3359
- const reducer$6 = (state, action) => {
3363
+ const reducer$7 = (state, action) => {
3360
3364
  switch (action.type) {
3361
3365
  case ActionType$6.StartLoading: {
3362
3366
  return Object.assign(Object.assign({}, state), { loading: true });
@@ -3516,7 +3520,7 @@ const LogReviewer = (props) => {
3516
3520
  advancedFilterState: initAdvancedFilterState,
3517
3521
  };
3518
3522
  // Initialize state
3519
- const [state, dispatch] = useReducer(reducer$6, initialState);
3523
+ const [state, dispatch] = useReducer(reducer$7, initialState);
3520
3524
  // Destructure common state
3521
3525
  const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
3522
3526
  /*------------------------------------------------------------------------*/
@@ -39667,7 +39671,7 @@ var ActionType$5;
39667
39671
  * @param action action to execute
39668
39672
  * @returns updated state
39669
39673
  */
39670
- const reducer$5 = (state, action) => {
39674
+ const reducer$6 = (state, action) => {
39671
39675
  switch (action.type) {
39672
39676
  case ActionType$5.SetInputValue: {
39673
39677
  return Object.assign(Object.assign({}, state), { inputValue: action.value });
@@ -39689,7 +39693,7 @@ const CreatableMultiselect = (props) => {
39689
39693
  inputValue: '',
39690
39694
  };
39691
39695
  // Initialize state
39692
- const [state, dispatch] = useReducer(reducer$5, initialState);
39696
+ const [state, dispatch] = useReducer(reducer$6, initialState);
39693
39697
  // Destructure common state
39694
39698
  const { inputValue } = state;
39695
39699
  /*------------------------------------------------------------------------*/
@@ -39871,7 +39875,7 @@ var ActionType$4;
39871
39875
  * @param action action to execute
39872
39876
  * @returns updated state
39873
39877
  */
39874
- const reducer$4 = (state, action) => {
39878
+ const reducer$5 = (state, action) => {
39875
39879
  switch (action.type) {
39876
39880
  case ActionType$4.UpdateDBEntry: {
39877
39881
  return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
@@ -39901,7 +39905,7 @@ const AddOrEditDBEntry = (props) => {
39901
39905
  saving: false,
39902
39906
  };
39903
39907
  // Initialize state
39904
- const [state, dispatch] = useReducer(reducer$4, initialState);
39908
+ const [state, dispatch] = useReducer(reducer$5, initialState);
39905
39909
  // Destructure common state
39906
39910
  const { entry, saving, } = state;
39907
39911
  /*------------------------------------------------------------------------*/
@@ -40275,7 +40279,7 @@ var ActionType$3;
40275
40279
  * @param action action to execute
40276
40280
  * @returns updated state
40277
40281
  */
40278
- const reducer$3 = (state, action) => {
40282
+ const reducer$4 = (state, action) => {
40279
40283
  switch (action.type) {
40280
40284
  case ActionType$3.FinishLoading: {
40281
40285
  return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
@@ -40339,7 +40343,7 @@ const DBEntryManagerPanel = (props) => {
40339
40343
  loading: true,
40340
40344
  };
40341
40345
  // Initialize state
40342
- const [state, dispatch] = useReducer(reducer$3, initialState);
40346
+ const [state, dispatch] = useReducer(reducer$4, initialState);
40343
40347
  // Destructure common state
40344
40348
  const { adding, dbEntryToEdit, dbEntries, loading, } = state;
40345
40349
  /*------------------------------------------------------------------------*/
@@ -40684,7 +40688,7 @@ var ActionType$2;
40684
40688
  * @param state current state
40685
40689
  * @param action action to execute
40686
40690
  */
40687
- const reducer$2 = (state, action) => {
40691
+ const reducer$3 = (state, action) => {
40688
40692
  switch (action.type) {
40689
40693
  case ActionType$2.Show: {
40690
40694
  return Object.assign(Object.assign({}, state), { isVisible: true });
@@ -40723,7 +40727,7 @@ const Tooltip = (props) => {
40723
40727
  nudgePx: 0,
40724
40728
  };
40725
40729
  // Initialize state
40726
- const [state, dispatch] = useReducer(reducer$2, initialState);
40730
+ const [state, dispatch] = useReducer(reducer$3, initialState);
40727
40731
  // Destructure common state
40728
40732
  const { isVisible, nudgePx, squareBottomLeft, squareBottomRight, } = state;
40729
40733
  /* -------------- Refs -------------- */
@@ -40982,7 +40986,7 @@ var ActionType$1;
40982
40986
  * @param state current state
40983
40987
  * @param action action to execute
40984
40988
  */
40985
- const reducer$1 = (state, action) => {
40989
+ const reducer$2 = (state, action) => {
40986
40990
  switch (action.type) {
40987
40991
  case ActionType$1.HideJumpToBottomButton: {
40988
40992
  return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
@@ -41011,7 +41015,7 @@ const AutoscrollToBottomContainer = (props) => {
41011
41015
  jumpToBottomButtonVisible: false,
41012
41016
  };
41013
41017
  // Initialize state
41014
- const [state, dispatch] = useReducer(reducer$1, initialState);
41018
+ const [state, dispatch] = useReducer(reducer$2, initialState);
41015
41019
  // Destructure common state
41016
41020
  const { jumpToBottomButtonVisible, } = state;
41017
41021
  /* -------------- Refs -------------- */
@@ -41206,7 +41210,7 @@ var ActionType;
41206
41210
  * @param state current state
41207
41211
  * @param action action to execute
41208
41212
  */
41209
- const reducer = (state, action) => {
41213
+ const reducer$1 = (state, action) => {
41210
41214
  switch (action.type) {
41211
41215
  case ActionType.StartHover: {
41212
41216
  return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
@@ -41235,7 +41239,7 @@ const MultiSwitch = (props) => {
41235
41239
  hoveredOptionId: undefined,
41236
41240
  };
41237
41241
  // Initialize state
41238
- const [state, dispatch] = useReducer(reducer, initialState);
41242
+ const [state, dispatch] = useReducer(reducer$1, initialState);
41239
41243
  // Destructure common state
41240
41244
  const { hoveredOptionId, } = state;
41241
41245
  /*------------------------------------------------------------------------*/
@@ -43348,6 +43352,40 @@ const prefixWithAOrAn = (text, capitalize = false) => {
43348
43352
  return `${prefix} ${text}`;
43349
43353
  };
43350
43354
 
43355
+ /* -------- State Definition -------- */
43356
+ /* ------------- Reducer ------------ */
43357
+ /**
43358
+ * Reducer that executes actions
43359
+ * @author Gabe Abrams
43360
+ * @param state current state
43361
+ */
43362
+ const reducer = (state) => {
43363
+ return {
43364
+ renderCount: state.renderCount + 1,
43365
+ };
43366
+ };
43367
+ /* -------------- Main -------------- */
43368
+ /**
43369
+ * Create a function that forces a render of a component. Use this only when
43370
+ * absolutely necessary
43371
+ * @author Gabe Abrams
43372
+ * @param useReducer the useReducer hook
43373
+ * @returns forceRender function
43374
+ */
43375
+ const useForceRender = (useReducer) => {
43376
+ // Initial state
43377
+ const initialState = {
43378
+ renderCount: 0,
43379
+ };
43380
+ // Initialize state
43381
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
43382
+ const [state, dispatch] = useReducer(reducer, initialState);
43383
+ // Create and return the forceRender function
43384
+ return () => {
43385
+ dispatch();
43386
+ };
43387
+ };
43388
+
43351
43389
  /**
43352
43390
  * Days of the week
43353
43391
  * @author Gabe Abrams
@@ -43364,5 +43402,5 @@ var DayOfWeek;
43364
43402
  })(DayOfWeek || (DayOfWeek = {}));
43365
43403
  var DayOfWeek$1 = DayOfWeek;
43366
43404
 
43367
- export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
43405
+ export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, addFatalErrorHandler, alert, avg, canReviewLogs, ceilToNumDecimals, combineClassNames, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genCommaList, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, idify, initClient, initLogCollection, initServer, isMobileOrTablet, leaveToURL, logClientEvent, makeLinksClickable, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, prefixWithAOrAn, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, useForceRender, validateEmail, validatePhoneNumber, validateString, visitServerEndpoint, waitMs };
43368
43406
  //# sourceMappingURL=index.js.map