dce-reactkit 3.6.17 → 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.
- package/dist/cjs/index.js +55 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/index.js +55 -21
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/index.d.ts +10 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
package/dist/cjs/index.js
CHANGED
|
@@ -2086,7 +2086,7 @@ var ActionType$9;
|
|
|
2086
2086
|
* @param state current state
|
|
2087
2087
|
* @param action action to execute
|
|
2088
2088
|
*/
|
|
2089
|
-
const reducer$
|
|
2089
|
+
const reducer$a = (state, action) => {
|
|
2090
2090
|
switch (action.type) {
|
|
2091
2091
|
case ActionType$9.IndicateRecentlyCopied: {
|
|
2092
2092
|
return {
|
|
@@ -2119,7 +2119,7 @@ const CopiableBox = (props) => {
|
|
|
2119
2119
|
recentlyCopied: false,
|
|
2120
2120
|
};
|
|
2121
2121
|
// Initialize state
|
|
2122
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2122
|
+
const [state, dispatch] = React.useReducer(reducer$a, initialState);
|
|
2123
2123
|
// Destructure common state
|
|
2124
2124
|
const { recentlyCopied, } = state;
|
|
2125
2125
|
/*------------------------------------------------------------------------*/
|
|
@@ -2212,7 +2212,7 @@ var ActionType$8;
|
|
|
2212
2212
|
* @param state current state
|
|
2213
2213
|
* @param action action to execute
|
|
2214
2214
|
*/
|
|
2215
|
-
const reducer$
|
|
2215
|
+
const reducer$9 = (state, action) => {
|
|
2216
2216
|
switch (action.type) {
|
|
2217
2217
|
case ActionType$8.ToggleChild: {
|
|
2218
2218
|
return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
|
|
@@ -2243,7 +2243,7 @@ const NestableItemList = (props) => {
|
|
|
2243
2243
|
childExpanded: initChildExpanded,
|
|
2244
2244
|
};
|
|
2245
2245
|
// Initialize state
|
|
2246
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2246
|
+
const [state, dispatch] = React.useReducer(reducer$9, initialState);
|
|
2247
2247
|
// Destructure common state
|
|
2248
2248
|
const { childExpanded, } = state;
|
|
2249
2249
|
/*------------------------------------------------------------------------*/
|
|
@@ -2628,7 +2628,7 @@ var ActionType$7;
|
|
|
2628
2628
|
* @param state current state
|
|
2629
2629
|
* @param action action to execute
|
|
2630
2630
|
*/
|
|
2631
|
-
const reducer$
|
|
2631
|
+
const reducer$8 = (state, action) => {
|
|
2632
2632
|
switch (action.type) {
|
|
2633
2633
|
case ActionType$7.ToggleSortColumn: {
|
|
2634
2634
|
if (action.param !== state.sortColumnParam) {
|
|
@@ -2704,7 +2704,7 @@ const IntelliTable = (props) => {
|
|
|
2704
2704
|
columnVisibilityCustomizationModalVisible: false,
|
|
2705
2705
|
};
|
|
2706
2706
|
// Initialize state
|
|
2707
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2707
|
+
const [state, dispatch] = React.useReducer(reducer$8, initialState);
|
|
2708
2708
|
// Destructure common state
|
|
2709
2709
|
const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
|
|
2710
2710
|
/*------------------------------------------------------------------------*/
|
|
@@ -3382,7 +3382,7 @@ var ActionType$6;
|
|
|
3382
3382
|
* @param state current state
|
|
3383
3383
|
* @param action action to execute
|
|
3384
3384
|
*/
|
|
3385
|
-
const reducer$
|
|
3385
|
+
const reducer$7 = (state, action) => {
|
|
3386
3386
|
switch (action.type) {
|
|
3387
3387
|
case ActionType$6.StartLoading: {
|
|
3388
3388
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
@@ -3542,7 +3542,7 @@ const LogReviewer = (props) => {
|
|
|
3542
3542
|
advancedFilterState: initAdvancedFilterState,
|
|
3543
3543
|
};
|
|
3544
3544
|
// Initialize state
|
|
3545
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
3545
|
+
const [state, dispatch] = React.useReducer(reducer$7, initialState);
|
|
3546
3546
|
// Destructure common state
|
|
3547
3547
|
const { loading, logMap, expandedFilterDrawer, dateFilterState, contextFilterState, tagFilterState, actionErrorFilterState, advancedFilterState, } = state;
|
|
3548
3548
|
/*------------------------------------------------------------------------*/
|
|
@@ -39693,7 +39693,7 @@ var ActionType$5;
|
|
|
39693
39693
|
* @param action action to execute
|
|
39694
39694
|
* @returns updated state
|
|
39695
39695
|
*/
|
|
39696
|
-
const reducer$
|
|
39696
|
+
const reducer$6 = (state, action) => {
|
|
39697
39697
|
switch (action.type) {
|
|
39698
39698
|
case ActionType$5.SetInputValue: {
|
|
39699
39699
|
return Object.assign(Object.assign({}, state), { inputValue: action.value });
|
|
@@ -39715,7 +39715,7 @@ const CreatableMultiselect = (props) => {
|
|
|
39715
39715
|
inputValue: '',
|
|
39716
39716
|
};
|
|
39717
39717
|
// Initialize state
|
|
39718
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
39718
|
+
const [state, dispatch] = React.useReducer(reducer$6, initialState);
|
|
39719
39719
|
// Destructure common state
|
|
39720
39720
|
const { inputValue } = state;
|
|
39721
39721
|
/*------------------------------------------------------------------------*/
|
|
@@ -39897,7 +39897,7 @@ var ActionType$4;
|
|
|
39897
39897
|
* @param action action to execute
|
|
39898
39898
|
* @returns updated state
|
|
39899
39899
|
*/
|
|
39900
|
-
const reducer$
|
|
39900
|
+
const reducer$5 = (state, action) => {
|
|
39901
39901
|
switch (action.type) {
|
|
39902
39902
|
case ActionType$4.UpdateDBEntry: {
|
|
39903
39903
|
return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
|
|
@@ -39927,7 +39927,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
39927
39927
|
saving: false,
|
|
39928
39928
|
};
|
|
39929
39929
|
// Initialize state
|
|
39930
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
39930
|
+
const [state, dispatch] = React.useReducer(reducer$5, initialState);
|
|
39931
39931
|
// Destructure common state
|
|
39932
39932
|
const { entry, saving, } = state;
|
|
39933
39933
|
/*------------------------------------------------------------------------*/
|
|
@@ -40301,7 +40301,7 @@ var ActionType$3;
|
|
|
40301
40301
|
* @param action action to execute
|
|
40302
40302
|
* @returns updated state
|
|
40303
40303
|
*/
|
|
40304
|
-
const reducer$
|
|
40304
|
+
const reducer$4 = (state, action) => {
|
|
40305
40305
|
switch (action.type) {
|
|
40306
40306
|
case ActionType$3.FinishLoading: {
|
|
40307
40307
|
return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
|
|
@@ -40365,7 +40365,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
40365
40365
|
loading: true,
|
|
40366
40366
|
};
|
|
40367
40367
|
// Initialize state
|
|
40368
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
40368
|
+
const [state, dispatch] = React.useReducer(reducer$4, initialState);
|
|
40369
40369
|
// Destructure common state
|
|
40370
40370
|
const { adding, dbEntryToEdit, dbEntries, loading, } = state;
|
|
40371
40371
|
/*------------------------------------------------------------------------*/
|
|
@@ -40710,7 +40710,7 @@ var ActionType$2;
|
|
|
40710
40710
|
* @param state current state
|
|
40711
40711
|
* @param action action to execute
|
|
40712
40712
|
*/
|
|
40713
|
-
const reducer$
|
|
40713
|
+
const reducer$3 = (state, action) => {
|
|
40714
40714
|
switch (action.type) {
|
|
40715
40715
|
case ActionType$2.Show: {
|
|
40716
40716
|
return Object.assign(Object.assign({}, state), { isVisible: true });
|
|
@@ -40749,7 +40749,7 @@ const Tooltip = (props) => {
|
|
|
40749
40749
|
nudgePx: 0,
|
|
40750
40750
|
};
|
|
40751
40751
|
// Initialize state
|
|
40752
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
40752
|
+
const [state, dispatch] = React.useReducer(reducer$3, initialState);
|
|
40753
40753
|
// Destructure common state
|
|
40754
40754
|
const { isVisible, nudgePx, squareBottomLeft, squareBottomRight, } = state;
|
|
40755
40755
|
/* -------------- Refs -------------- */
|
|
@@ -41008,7 +41008,7 @@ var ActionType$1;
|
|
|
41008
41008
|
* @param state current state
|
|
41009
41009
|
* @param action action to execute
|
|
41010
41010
|
*/
|
|
41011
|
-
const reducer$
|
|
41011
|
+
const reducer$2 = (state, action) => {
|
|
41012
41012
|
switch (action.type) {
|
|
41013
41013
|
case ActionType$1.HideJumpToBottomButton: {
|
|
41014
41014
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
|
|
@@ -41037,7 +41037,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
41037
41037
|
jumpToBottomButtonVisible: false,
|
|
41038
41038
|
};
|
|
41039
41039
|
// Initialize state
|
|
41040
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
41040
|
+
const [state, dispatch] = React.useReducer(reducer$2, initialState);
|
|
41041
41041
|
// Destructure common state
|
|
41042
41042
|
const { jumpToBottomButtonVisible, } = state;
|
|
41043
41043
|
/* -------------- Refs -------------- */
|
|
@@ -41232,7 +41232,7 @@ var ActionType;
|
|
|
41232
41232
|
* @param state current state
|
|
41233
41233
|
* @param action action to execute
|
|
41234
41234
|
*/
|
|
41235
|
-
const reducer = (state, action) => {
|
|
41235
|
+
const reducer$1 = (state, action) => {
|
|
41236
41236
|
switch (action.type) {
|
|
41237
41237
|
case ActionType.StartHover: {
|
|
41238
41238
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
|
|
@@ -41261,7 +41261,7 @@ const MultiSwitch = (props) => {
|
|
|
41261
41261
|
hoveredOptionId: undefined,
|
|
41262
41262
|
};
|
|
41263
41263
|
// Initialize state
|
|
41264
|
-
const [state, dispatch] = React.useReducer(reducer, initialState);
|
|
41264
|
+
const [state, dispatch] = React.useReducer(reducer$1, initialState);
|
|
41265
41265
|
// Destructure common state
|
|
41266
41266
|
const { hoveredOptionId, } = state;
|
|
41267
41267
|
/*------------------------------------------------------------------------*/
|
|
@@ -43374,6 +43374,40 @@ const prefixWithAOrAn = (text, capitalize = false) => {
|
|
|
43374
43374
|
return `${prefix} ${text}`;
|
|
43375
43375
|
};
|
|
43376
43376
|
|
|
43377
|
+
/* -------- State Definition -------- */
|
|
43378
|
+
/* ------------- Reducer ------------ */
|
|
43379
|
+
/**
|
|
43380
|
+
* Reducer that executes actions
|
|
43381
|
+
* @author Gabe Abrams
|
|
43382
|
+
* @param state current state
|
|
43383
|
+
*/
|
|
43384
|
+
const reducer = (state) => {
|
|
43385
|
+
return {
|
|
43386
|
+
renderCount: state.renderCount + 1,
|
|
43387
|
+
};
|
|
43388
|
+
};
|
|
43389
|
+
/* -------------- Main -------------- */
|
|
43390
|
+
/**
|
|
43391
|
+
* Create a function that forces a render of a component. Use this only when
|
|
43392
|
+
* absolutely necessary
|
|
43393
|
+
* @author Gabe Abrams
|
|
43394
|
+
* @param useReducer the useReducer hook
|
|
43395
|
+
* @returns forceRender function
|
|
43396
|
+
*/
|
|
43397
|
+
const useForceRender = (useReducer) => {
|
|
43398
|
+
// Initial state
|
|
43399
|
+
const initialState = {
|
|
43400
|
+
renderCount: 0,
|
|
43401
|
+
};
|
|
43402
|
+
// Initialize state
|
|
43403
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43404
|
+
const [state, dispatch] = useReducer(reducer, initialState);
|
|
43405
|
+
// Create and return the forceRender function
|
|
43406
|
+
return () => {
|
|
43407
|
+
dispatch();
|
|
43408
|
+
};
|
|
43409
|
+
};
|
|
43410
|
+
|
|
43377
43411
|
/**
|
|
43378
43412
|
* Days of the week
|
|
43379
43413
|
* @author Gabe Abrams
|
|
@@ -43473,6 +43507,7 @@ exports.startMinWait = startMinWait;
|
|
|
43473
43507
|
exports.stringsToHumanReadableList = stringsToHumanReadableList;
|
|
43474
43508
|
exports.stubServerEndpoint = stubServerEndpoint;
|
|
43475
43509
|
exports.sum = sum;
|
|
43510
|
+
exports.useForceRender = useForceRender;
|
|
43476
43511
|
exports.validateEmail = validateEmail;
|
|
43477
43512
|
exports.validatePhoneNumber = validatePhoneNumber;
|
|
43478
43513
|
exports.validateString = validateString;
|