dce-reactkit 3.6.16 → 3.6.18

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.
@@ -6,7 +6,7 @@ import express from 'express';
6
6
  type DCEMangoCollection = {
7
7
  /**
8
8
  * Find all items in the collection that match the filter query
9
- * @param filterQuery
9
+ * @param filterQuery query for the filter
10
10
  * @returns list of items that match the filter query
11
11
  */
12
12
  find: (filterQuery: any) => Promise<any[]>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Create a function that forces a render of a component. Use this only when
3
+ * absolutely necessary
4
+ * @author Gabe Abrams
5
+ * @param useReducer the useReducer hook
6
+ * @returns forceRender function
7
+ */
8
+ declare const useForceRender: (useReducer: any) => () => void;
9
+ export default useForceRender;
@@ -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
@@ -2060,7 +2060,7 @@ var ActionType$9;
2060
2060
  * @param state current state
2061
2061
  * @param action action to execute
2062
2062
  */
2063
- const reducer$9 = (state, action) => {
2063
+ const reducer$a = (state, action) => {
2064
2064
  switch (action.type) {
2065
2065
  case ActionType$9.IndicateRecentlyCopied: {
2066
2066
  return {
@@ -2093,7 +2093,7 @@ const CopiableBox = (props) => {
2093
2093
  recentlyCopied: false,
2094
2094
  };
2095
2095
  // Initialize state
2096
- const [state, dispatch] = useReducer(reducer$9, initialState);
2096
+ const [state, dispatch] = useReducer(reducer$a, initialState);
2097
2097
  // Destructure common state
2098
2098
  const { recentlyCopied, } = state;
2099
2099
  /*------------------------------------------------------------------------*/
@@ -2186,7 +2186,7 @@ var ActionType$8;
2186
2186
  * @param state current state
2187
2187
  * @param action action to execute
2188
2188
  */
2189
- const reducer$8 = (state, action) => {
2189
+ const reducer$9 = (state, action) => {
2190
2190
  switch (action.type) {
2191
2191
  case ActionType$8.ToggleChild: {
2192
2192
  return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
@@ -2217,7 +2217,7 @@ const NestableItemList = (props) => {
2217
2217
  childExpanded: initChildExpanded,
2218
2218
  };
2219
2219
  // Initialize state
2220
- const [state, dispatch] = useReducer(reducer$8, initialState);
2220
+ const [state, dispatch] = useReducer(reducer$9, initialState);
2221
2221
  // Destructure common state
2222
2222
  const { childExpanded, } = state;
2223
2223
  /*------------------------------------------------------------------------*/
@@ -2602,7 +2602,7 @@ var ActionType$7;
2602
2602
  * @param state current state
2603
2603
  * @param action action to execute
2604
2604
  */
2605
- const reducer$7 = (state, action) => {
2605
+ const reducer$8 = (state, action) => {
2606
2606
  switch (action.type) {
2607
2607
  case ActionType$7.ToggleSortColumn: {
2608
2608
  if (action.param !== state.sortColumnParam) {
@@ -2678,7 +2678,7 @@ const IntelliTable = (props) => {
2678
2678
  columnVisibilityCustomizationModalVisible: false,
2679
2679
  };
2680
2680
  // Initialize state
2681
- const [state, dispatch] = useReducer(reducer$7, initialState);
2681
+ const [state, dispatch] = useReducer(reducer$8, initialState);
2682
2682
  // Destructure common state
2683
2683
  const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
2684
2684
  /*------------------------------------------------------------------------*/
@@ -3356,7 +3356,7 @@ var ActionType$6;
3356
3356
  * @param state current state
3357
3357
  * @param action action to execute
3358
3358
  */
3359
- const reducer$6 = (state, action) => {
3359
+ const reducer$7 = (state, action) => {
3360
3360
  switch (action.type) {
3361
3361
  case ActionType$6.StartLoading: {
3362
3362
  return Object.assign(Object.assign({}, state), { loading: true });
@@ -3516,7 +3516,7 @@ const LogReviewer = (props) => {
3516
3516
  advancedFilterState: initAdvancedFilterState,
3517
3517
  };
3518
3518
  // Initialize state
3519
- const [state, dispatch] = useReducer(reducer$6, initialState);
3519
+ const [state, dispatch] = useReducer(reducer$7, initialState);
3520
3520
  // Destructure common state
3521
3521
  const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
3522
3522
  /*------------------------------------------------------------------------*/
@@ -39667,7 +39667,7 @@ var ActionType$5;
39667
39667
  * @param action action to execute
39668
39668
  * @returns updated state
39669
39669
  */
39670
- const reducer$5 = (state, action) => {
39670
+ const reducer$6 = (state, action) => {
39671
39671
  switch (action.type) {
39672
39672
  case ActionType$5.SetInputValue: {
39673
39673
  return Object.assign(Object.assign({}, state), { inputValue: action.value });
@@ -39689,7 +39689,7 @@ const CreatableMultiselect = (props) => {
39689
39689
  inputValue: '',
39690
39690
  };
39691
39691
  // Initialize state
39692
- const [state, dispatch] = useReducer(reducer$5, initialState);
39692
+ const [state, dispatch] = useReducer(reducer$6, initialState);
39693
39693
  // Destructure common state
39694
39694
  const { inputValue } = state;
39695
39695
  /*------------------------------------------------------------------------*/
@@ -39871,7 +39871,7 @@ var ActionType$4;
39871
39871
  * @param action action to execute
39872
39872
  * @returns updated state
39873
39873
  */
39874
- const reducer$4 = (state, action) => {
39874
+ const reducer$5 = (state, action) => {
39875
39875
  switch (action.type) {
39876
39876
  case ActionType$4.UpdateDBEntry: {
39877
39877
  return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
@@ -39901,7 +39901,7 @@ const AddOrEditDBEntry = (props) => {
39901
39901
  saving: false,
39902
39902
  };
39903
39903
  // Initialize state
39904
- const [state, dispatch] = useReducer(reducer$4, initialState);
39904
+ const [state, dispatch] = useReducer(reducer$5, initialState);
39905
39905
  // Destructure common state
39906
39906
  const { entry, saving, } = state;
39907
39907
  /*------------------------------------------------------------------------*/
@@ -40275,7 +40275,7 @@ var ActionType$3;
40275
40275
  * @param action action to execute
40276
40276
  * @returns updated state
40277
40277
  */
40278
- const reducer$3 = (state, action) => {
40278
+ const reducer$4 = (state, action) => {
40279
40279
  switch (action.type) {
40280
40280
  case ActionType$3.FinishLoading: {
40281
40281
  return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
@@ -40339,7 +40339,7 @@ const DBEntryManagerPanel = (props) => {
40339
40339
  loading: true,
40340
40340
  };
40341
40341
  // Initialize state
40342
- const [state, dispatch] = useReducer(reducer$3, initialState);
40342
+ const [state, dispatch] = useReducer(reducer$4, initialState);
40343
40343
  // Destructure common state
40344
40344
  const { adding, dbEntryToEdit, dbEntries, loading, } = state;
40345
40345
  /*------------------------------------------------------------------------*/
@@ -40684,7 +40684,7 @@ var ActionType$2;
40684
40684
  * @param state current state
40685
40685
  * @param action action to execute
40686
40686
  */
40687
- const reducer$2 = (state, action) => {
40687
+ const reducer$3 = (state, action) => {
40688
40688
  switch (action.type) {
40689
40689
  case ActionType$2.Show: {
40690
40690
  return Object.assign(Object.assign({}, state), { isVisible: true });
@@ -40723,7 +40723,7 @@ const Tooltip = (props) => {
40723
40723
  nudgePx: 0,
40724
40724
  };
40725
40725
  // Initialize state
40726
- const [state, dispatch] = useReducer(reducer$2, initialState);
40726
+ const [state, dispatch] = useReducer(reducer$3, initialState);
40727
40727
  // Destructure common state
40728
40728
  const { isVisible, nudgePx, squareBottomLeft, squareBottomRight, } = state;
40729
40729
  /* -------------- Refs -------------- */
@@ -40982,7 +40982,7 @@ var ActionType$1;
40982
40982
  * @param state current state
40983
40983
  * @param action action to execute
40984
40984
  */
40985
- const reducer$1 = (state, action) => {
40985
+ const reducer$2 = (state, action) => {
40986
40986
  switch (action.type) {
40987
40987
  case ActionType$1.HideJumpToBottomButton: {
40988
40988
  return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
@@ -41011,7 +41011,7 @@ const AutoscrollToBottomContainer = (props) => {
41011
41011
  jumpToBottomButtonVisible: false,
41012
41012
  };
41013
41013
  // Initialize state
41014
- const [state, dispatch] = useReducer(reducer$1, initialState);
41014
+ const [state, dispatch] = useReducer(reducer$2, initialState);
41015
41015
  // Destructure common state
41016
41016
  const { jumpToBottomButtonVisible, } = state;
41017
41017
  /* -------------- Refs -------------- */
@@ -41206,7 +41206,7 @@ var ActionType;
41206
41206
  * @param state current state
41207
41207
  * @param action action to execute
41208
41208
  */
41209
- const reducer = (state, action) => {
41209
+ const reducer$1 = (state, action) => {
41210
41210
  switch (action.type) {
41211
41211
  case ActionType.StartHover: {
41212
41212
  return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
@@ -41235,7 +41235,7 @@ const MultiSwitch = (props) => {
41235
41235
  hoveredOptionId: undefined,
41236
41236
  };
41237
41237
  // Initialize state
41238
- const [state, dispatch] = useReducer(reducer, initialState);
41238
+ const [state, dispatch] = useReducer(reducer$1, initialState);
41239
41239
  // Destructure common state
41240
41240
  const { hoveredOptionId, } = state;
41241
41241
  /*------------------------------------------------------------------------*/
@@ -43348,6 +43348,40 @@ const prefixWithAOrAn = (text, capitalize = false) => {
43348
43348
  return `${prefix} ${text}`;
43349
43349
  };
43350
43350
 
43351
+ /* -------- State Definition -------- */
43352
+ /* ------------- Reducer ------------ */
43353
+ /**
43354
+ * Reducer that executes actions
43355
+ * @author Gabe Abrams
43356
+ * @param state current state
43357
+ */
43358
+ const reducer = (state) => {
43359
+ return {
43360
+ renderCount: state.renderCount + 1,
43361
+ };
43362
+ };
43363
+ /* -------------- Main -------------- */
43364
+ /**
43365
+ * Create a function that forces a render of a component. Use this only when
43366
+ * absolutely necessary
43367
+ * @author Gabe Abrams
43368
+ * @param useReducer the useReducer hook
43369
+ * @returns forceRender function
43370
+ */
43371
+ const useForceRender = (useReducer) => {
43372
+ // Initial state
43373
+ const initialState = {
43374
+ renderCount: 0,
43375
+ };
43376
+ // Initialize state
43377
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
43378
+ const [state, dispatch] = useReducer(reducer, initialState);
43379
+ // Create and return the forceRender function
43380
+ return () => {
43381
+ dispatch();
43382
+ };
43383
+ };
43384
+
43351
43385
  /**
43352
43386
  * Days of the week
43353
43387
  * @author Gabe Abrams
@@ -43364,5 +43398,5 @@ var DayOfWeek;
43364
43398
  })(DayOfWeek || (DayOfWeek = {}));
43365
43399
  var DayOfWeek$1 = DayOfWeek;
43366
43400
 
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 };
43401
+ 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
43402
  //# sourceMappingURL=index.js.map