@teselagen/ui 0.5.23-beta.28 → 0.5.23-beta.29
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/DataTable/utils/queryParams.d.ts +1 -2
- package/index.cjs.js +95 -93
- package/index.es.js +95 -93
- package/package.json +1 -1
- package/src/DataTable/SearchBar.js +2 -2
- package/src/DataTable/index.js +2 -12
- package/src/DataTable/utils/queryParams.js +0 -4
- package/src/DataTable/utils/withTableParams.js +4 -16
|
@@ -11,9 +11,8 @@ export function getMergedOpts(topLevel?: {}, instanceLevel?: {}): {
|
|
|
11
11
|
export function getCCDisplayName(field: object): string;
|
|
12
12
|
export function getCurrentParamsFromUrl(location: any, isSimple: any): any;
|
|
13
13
|
export function setCurrentParamsOnUrl(newParams: any, replace: any, isSimple: any): void;
|
|
14
|
-
export function makeDataTableHandlers({ setNewParams,
|
|
14
|
+
export function makeDataTableHandlers({ setNewParams, defaults, onlyOneFilter }: {
|
|
15
15
|
setNewParams: any;
|
|
16
|
-
updateSearch: any;
|
|
17
16
|
defaults: any;
|
|
18
17
|
onlyOneFilter: any;
|
|
19
18
|
}): {
|
package/index.cjs.js
CHANGED
|
@@ -3123,63 +3123,89 @@ function getAugmentedNamespace(n2) {
|
|
|
3123
3123
|
}
|
|
3124
3124
|
__name(getAugmentedNamespace, "getAugmentedNamespace");
|
|
3125
3125
|
var propTypes$1 = { exports: {} };
|
|
3126
|
-
var
|
|
3127
|
-
var
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3126
|
+
var ReactPropTypesSecret_1;
|
|
3127
|
+
var hasRequiredReactPropTypesSecret;
|
|
3128
|
+
function requireReactPropTypesSecret() {
|
|
3129
|
+
if (hasRequiredReactPropTypesSecret)
|
|
3130
|
+
return ReactPropTypesSecret_1;
|
|
3131
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
3132
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
3133
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
3134
|
+
return ReactPropTypesSecret_1;
|
|
3135
|
+
}
|
|
3136
|
+
__name(requireReactPropTypesSecret, "requireReactPropTypesSecret");
|
|
3137
|
+
var factoryWithThrowingShims;
|
|
3138
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
3139
|
+
function requireFactoryWithThrowingShims() {
|
|
3140
|
+
if (hasRequiredFactoryWithThrowingShims)
|
|
3141
|
+
return factoryWithThrowingShims;
|
|
3142
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
3143
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
3144
|
+
function emptyFunction() {
|
|
3145
|
+
}
|
|
3146
|
+
__name(emptyFunction, "emptyFunction");
|
|
3147
|
+
function emptyFunctionWithReset() {
|
|
3148
|
+
}
|
|
3149
|
+
__name(emptyFunctionWithReset, "emptyFunctionWithReset");
|
|
3150
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3151
|
+
factoryWithThrowingShims = /* @__PURE__ */ __name(function() {
|
|
3152
|
+
function shim(props, propName, componentName, location2, propFullName, secret) {
|
|
3153
|
+
if (secret === ReactPropTypesSecret) {
|
|
3154
|
+
return;
|
|
3155
|
+
}
|
|
3156
|
+
var err = new Error(
|
|
3157
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
3158
|
+
);
|
|
3159
|
+
err.name = "Invariant Violation";
|
|
3160
|
+
throw err;
|
|
3140
3161
|
}
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
)
|
|
3144
|
-
|
|
3145
|
-
|
|
3162
|
+
__name(shim, "shim");
|
|
3163
|
+
shim.isRequired = shim;
|
|
3164
|
+
function getShim() {
|
|
3165
|
+
return shim;
|
|
3166
|
+
}
|
|
3167
|
+
__name(getShim, "getShim");
|
|
3168
|
+
var ReactPropTypes = {
|
|
3169
|
+
array: shim,
|
|
3170
|
+
bigint: shim,
|
|
3171
|
+
bool: shim,
|
|
3172
|
+
func: shim,
|
|
3173
|
+
number: shim,
|
|
3174
|
+
object: shim,
|
|
3175
|
+
string: shim,
|
|
3176
|
+
symbol: shim,
|
|
3177
|
+
any: shim,
|
|
3178
|
+
arrayOf: getShim,
|
|
3179
|
+
element: shim,
|
|
3180
|
+
elementType: shim,
|
|
3181
|
+
instanceOf: getShim,
|
|
3182
|
+
node: shim,
|
|
3183
|
+
objectOf: getShim,
|
|
3184
|
+
oneOf: getShim,
|
|
3185
|
+
oneOfType: getShim,
|
|
3186
|
+
shape: getShim,
|
|
3187
|
+
exact: getShim,
|
|
3188
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
3189
|
+
resetWarningCache: emptyFunction
|
|
3190
|
+
};
|
|
3191
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3192
|
+
return ReactPropTypes;
|
|
3193
|
+
}, "factoryWithThrowingShims");
|
|
3194
|
+
return factoryWithThrowingShims;
|
|
3195
|
+
}
|
|
3196
|
+
__name(requireFactoryWithThrowingShims, "requireFactoryWithThrowingShims");
|
|
3197
|
+
var hasRequiredPropTypes;
|
|
3198
|
+
function requirePropTypes() {
|
|
3199
|
+
if (hasRequiredPropTypes)
|
|
3200
|
+
return propTypes$1.exports;
|
|
3201
|
+
hasRequiredPropTypes = 1;
|
|
3202
|
+
{
|
|
3203
|
+
propTypes$1.exports = requireFactoryWithThrowingShims()();
|
|
3146
3204
|
}
|
|
3147
|
-
|
|
3148
|
-
shim.isRequired = shim;
|
|
3149
|
-
function getShim() {
|
|
3150
|
-
return shim;
|
|
3151
|
-
}
|
|
3152
|
-
__name(getShim, "getShim");
|
|
3153
|
-
var ReactPropTypes = {
|
|
3154
|
-
array: shim,
|
|
3155
|
-
bigint: shim,
|
|
3156
|
-
bool: shim,
|
|
3157
|
-
func: shim,
|
|
3158
|
-
number: shim,
|
|
3159
|
-
object: shim,
|
|
3160
|
-
string: shim,
|
|
3161
|
-
symbol: shim,
|
|
3162
|
-
any: shim,
|
|
3163
|
-
arrayOf: getShim,
|
|
3164
|
-
element: shim,
|
|
3165
|
-
elementType: shim,
|
|
3166
|
-
instanceOf: getShim,
|
|
3167
|
-
node: shim,
|
|
3168
|
-
objectOf: getShim,
|
|
3169
|
-
oneOf: getShim,
|
|
3170
|
-
oneOfType: getShim,
|
|
3171
|
-
shape: getShim,
|
|
3172
|
-
exact: getShim,
|
|
3173
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
3174
|
-
resetWarningCache: emptyFunction
|
|
3175
|
-
};
|
|
3176
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3177
|
-
return ReactPropTypes;
|
|
3178
|
-
}, "factoryWithThrowingShims");
|
|
3179
|
-
{
|
|
3180
|
-
propTypes$1.exports = factoryWithThrowingShims();
|
|
3205
|
+
return propTypes$1.exports;
|
|
3181
3206
|
}
|
|
3182
|
-
|
|
3207
|
+
__name(requirePropTypes, "requirePropTypes");
|
|
3208
|
+
var propTypesExports = requirePropTypes();
|
|
3183
3209
|
const PropTypes$1 = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
3184
3210
|
function __awaiter(thisArg, _arguments, P2, generator) {
|
|
3185
3211
|
function adopt(value) {
|
|
@@ -13470,7 +13496,7 @@ var reactList = {};
|
|
|
13470
13496
|
(function(exports2) {
|
|
13471
13497
|
(function(global2, factory) {
|
|
13472
13498
|
{
|
|
13473
|
-
factory(exports2,
|
|
13499
|
+
factory(exports2, requirePropTypes(), React$1);
|
|
13474
13500
|
}
|
|
13475
13501
|
})(commonjsGlobal, function(_exports, _propTypes2, _react3) {
|
|
13476
13502
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -20080,7 +20106,6 @@ function buildRef(qb, reference2, searchField, expression) {
|
|
|
20080
20106
|
__name(buildRef, "buildRef");
|
|
20081
20107
|
function makeDataTableHandlers({
|
|
20082
20108
|
setNewParams,
|
|
20083
|
-
updateSearch,
|
|
20084
20109
|
defaults: defaults2,
|
|
20085
20110
|
onlyOneFilter
|
|
20086
20111
|
}) {
|
|
@@ -20091,7 +20116,6 @@ function makeDataTableHandlers({
|
|
|
20091
20116
|
searchTerm: searchTerm === defaults2.searchTerm ? void 0 : searchTerm
|
|
20092
20117
|
});
|
|
20093
20118
|
setNewParams(newParams);
|
|
20094
|
-
updateSearch(searchTerm);
|
|
20095
20119
|
onlyOneFilter && clearFilters();
|
|
20096
20120
|
}
|
|
20097
20121
|
__name(setSearchTerm, "setSearchTerm");
|
|
@@ -20108,7 +20132,6 @@ function makeDataTableHandlers({
|
|
|
20108
20132
|
filters
|
|
20109
20133
|
});
|
|
20110
20134
|
setNewParams(newParams);
|
|
20111
|
-
onlyOneFilter && updateSearch();
|
|
20112
20135
|
}
|
|
20113
20136
|
__name(addFilters, "addFilters");
|
|
20114
20137
|
function removeSingleFilter(filterOn, currentParams) {
|
|
@@ -20131,7 +20154,6 @@ function makeDataTableHandlers({
|
|
|
20131
20154
|
toClear[key] = void 0;
|
|
20132
20155
|
});
|
|
20133
20156
|
setNewParams(toClear);
|
|
20134
|
-
updateSearch();
|
|
20135
20157
|
}
|
|
20136
20158
|
__name(clearFilters, "clearFilters");
|
|
20137
20159
|
function setPageSize(pageSize, currentParams) {
|
|
@@ -32988,13 +33010,13 @@ const SearchBar = /* @__PURE__ */ __name(({
|
|
|
32988
33010
|
disabled,
|
|
32989
33011
|
loading,
|
|
32990
33012
|
type: "search",
|
|
32991
|
-
|
|
33013
|
+
defaultValue: searchInput,
|
|
32992
33014
|
className: classNames("datatable-search-input", core.Classes.ROUND),
|
|
32993
33015
|
placeholder: "Search..."
|
|
32994
33016
|
}, onEnterHelper((e2) => {
|
|
32995
33017
|
e2.preventDefault();
|
|
32996
33018
|
e2.stopPropagation();
|
|
32997
|
-
setSearchTerm(
|
|
33019
|
+
setSearchTerm(e2.target.value);
|
|
32998
33020
|
e2.nativeEvent.stopImmediatePropagation();
|
|
32999
33021
|
})), {
|
|
33000
33022
|
rightElement
|
|
@@ -52463,7 +52485,6 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52463
52485
|
reduxFormEditingCell,
|
|
52464
52486
|
reduxFormEntities,
|
|
52465
52487
|
reduxFormQueryParams: _reduxFormQueryParams = {},
|
|
52466
|
-
reduxFormSearchInput: _reduxFormSearchInput = "",
|
|
52467
52488
|
reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {}
|
|
52468
52489
|
} = reactRedux.useSelector(
|
|
52469
52490
|
(state) => reduxForm.formValueSelector(formName)(
|
|
@@ -52471,13 +52492,11 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52471
52492
|
"reduxFormCellValidation",
|
|
52472
52493
|
"reduxFormEntities",
|
|
52473
52494
|
"reduxFormQueryParams",
|
|
52474
|
-
"reduxFormSearchInput",
|
|
52475
52495
|
"reduxFormSelectedEntityIdMap"
|
|
52476
52496
|
)
|
|
52477
52497
|
);
|
|
52478
52498
|
const reduxFormCellValidation = useDeepEqualMemo(_reduxFormCellValidation);
|
|
52479
52499
|
const reduxFormQueryParams = useDeepEqualMemo(_reduxFormQueryParams);
|
|
52480
|
-
const reduxFormSearchInput = useDeepEqualMemo(_reduxFormSearchInput);
|
|
52481
52500
|
const reduxFormSelectedEntityIdMap = useDeepEqualMemo(
|
|
52482
52501
|
_reduxFormSelectedEntityIdMap
|
|
52483
52502
|
);
|
|
@@ -52552,22 +52571,17 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52552
52571
|
});
|
|
52553
52572
|
const _currentParams = React$1.useMemo(() => {
|
|
52554
52573
|
const tmp = (urlConnected ? getCurrentParamsFromUrl(history.location) : reduxFormQueryParams) || {};
|
|
52555
|
-
tmp.searchTerm = reduxFormSearchInput;
|
|
52556
52574
|
return tmp;
|
|
52557
|
-
}, [history, reduxFormQueryParams,
|
|
52575
|
+
}, [history, reduxFormQueryParams, urlConnected]);
|
|
52558
52576
|
const currentParams = useDeepEqualMemo(_currentParams);
|
|
52559
52577
|
const tableParams = React$1.useMemo(() => {
|
|
52560
52578
|
if (!isTableParamsConnected) {
|
|
52561
|
-
const updateSearch = /* @__PURE__ */ __name((val) => {
|
|
52562
|
-
change("reduxFormSearchInput", val || "");
|
|
52563
|
-
}, "updateSearch");
|
|
52564
52579
|
const setNewParams2 = /* @__PURE__ */ __name((newParams) => {
|
|
52565
52580
|
urlConnected && setCurrentParamsOnUrl(newParams, history.replace);
|
|
52566
52581
|
change("reduxFormQueryParams", newParams);
|
|
52567
52582
|
}, "setNewParams2");
|
|
52568
52583
|
const bindThese = makeDataTableHandlers({
|
|
52569
52584
|
setNewParams: setNewParams2,
|
|
52570
|
-
updateSearch,
|
|
52571
52585
|
defaults: defaults2,
|
|
52572
52586
|
onlyOneFilter: props.onlyOneFilter
|
|
52573
52587
|
});
|
|
@@ -54988,7 +55002,7 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
54988
55002
|
)) : "", /* @__PURE__ */ React$1.createElement(
|
|
54989
55003
|
SearchBar,
|
|
54990
55004
|
{
|
|
54991
|
-
searchInput:
|
|
55005
|
+
searchInput: currentParams.searchTerm,
|
|
54992
55006
|
setSearchTerm,
|
|
54993
55007
|
loading: isLoading,
|
|
54994
55008
|
searchMenuButton,
|
|
@@ -68586,31 +68600,22 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68586
68600
|
}
|
|
68587
68601
|
const {
|
|
68588
68602
|
reduxFormQueryParams: _reduxFormQueryParams = {},
|
|
68589
|
-
reduxFormSearchInput: _reduxFormSearchInput = "",
|
|
68590
68603
|
reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {}
|
|
68591
68604
|
} = reactRedux.useSelector(
|
|
68592
68605
|
(state) => reduxForm.formValueSelector(formName)(
|
|
68593
68606
|
state,
|
|
68594
68607
|
"reduxFormQueryParams",
|
|
68595
|
-
"reduxFormSearchInput",
|
|
68596
68608
|
"reduxFormSelectedEntityIdMap"
|
|
68597
68609
|
)
|
|
68598
68610
|
);
|
|
68599
68611
|
const reduxFormQueryParams = useDeepEqualMemo(_reduxFormQueryParams);
|
|
68600
|
-
const reduxFormSearchInput = useDeepEqualMemo(_reduxFormSearchInput);
|
|
68601
68612
|
const reduxFormSelectedEntityIdMap = useDeepEqualMemo(
|
|
68602
68613
|
_reduxFormSelectedEntityIdMap
|
|
68603
68614
|
);
|
|
68604
68615
|
const _currentParams = React$1.useMemo(() => {
|
|
68605
68616
|
const tmp = (urlConnected ? getCurrentParamsFromUrl(history == null ? void 0 : history.location) : reduxFormQueryParams) || {};
|
|
68606
|
-
tmp.searchTerm = reduxFormSearchInput;
|
|
68607
68617
|
return tmp;
|
|
68608
|
-
}, [
|
|
68609
|
-
history == null ? void 0 : history.location,
|
|
68610
|
-
reduxFormQueryParams,
|
|
68611
|
-
reduxFormSearchInput,
|
|
68612
|
-
urlConnected
|
|
68613
|
-
]);
|
|
68618
|
+
}, [history == null ? void 0 : history.location, reduxFormQueryParams, urlConnected]);
|
|
68614
68619
|
const selectedEntities = React$1.useMemo(
|
|
68615
68620
|
() => withSelectedEntities2 ? Object.values(reduxFormSelectedEntityIdMap).sort((a2, b2) => a2.rowIndex - b2.rowIndex).map((item) => item.entity) : void 0,
|
|
68616
68621
|
[reduxFormSelectedEntityIdMap, withSelectedEntities2]
|
|
@@ -68631,11 +68636,12 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68631
68636
|
formName: "tgDataTable"
|
|
68632
68637
|
}, props), {
|
|
68633
68638
|
pageSize: controlled_pageSize || pageSize,
|
|
68634
|
-
defaults: defaultsToUse
|
|
68639
|
+
defaults: defaultsToUse,
|
|
68640
|
+
location: history.location
|
|
68635
68641
|
}),
|
|
68636
68642
|
// We don't want to rerender this every time a prop changes
|
|
68637
68643
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68638
|
-
[controlled_pageSize, defaultsToUse, pageSize]
|
|
68644
|
+
[controlled_pageSize, defaultsToUse, pageSize, history.location]
|
|
68639
68645
|
);
|
|
68640
68646
|
const queryParams = React$1.useMemo(() => {
|
|
68641
68647
|
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter.bind(void 0, passingProps) : () => additionalFilter;
|
|
@@ -68676,16 +68682,12 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68676
68682
|
const dispatch = reactRedux.useDispatch();
|
|
68677
68683
|
const tableParams = React$1.useMemo(() => {
|
|
68678
68684
|
const change = /* @__PURE__ */ __name((...args) => dispatch(reduxForm.change(formName, ...args)), "change");
|
|
68679
|
-
const updateSearch = /* @__PURE__ */ __name((val) => {
|
|
68680
|
-
change("reduxFormSearchInput", val || "");
|
|
68681
|
-
}, "updateSearch");
|
|
68682
68685
|
const setNewParams = /* @__PURE__ */ __name((newParams) => {
|
|
68683
68686
|
urlConnected && setCurrentParamsOnUrl(newParams, history == null ? void 0 : history.replace);
|
|
68684
68687
|
change("reduxFormQueryParams", newParams);
|
|
68685
68688
|
}, "setNewParams");
|
|
68686
68689
|
const bindThese = makeDataTableHandlers({
|
|
68687
68690
|
setNewParams,
|
|
68688
|
-
updateSearch,
|
|
68689
68691
|
defaults: defaults2,
|
|
68690
68692
|
onlyOneFilter
|
|
68691
68693
|
});
|
|
@@ -69376,7 +69378,7 @@ Object.defineProperty(DraggableCore$2, "__esModule", {
|
|
|
69376
69378
|
});
|
|
69377
69379
|
DraggableCore$2.default = void 0;
|
|
69378
69380
|
var React = _interopRequireWildcard$1(React$1);
|
|
69379
|
-
var _propTypes = _interopRequireDefault$2(
|
|
69381
|
+
var _propTypes = _interopRequireDefault$2(requirePropTypes());
|
|
69380
69382
|
var _reactDom$1 = _interopRequireDefault$2(require$$2$1);
|
|
69381
69383
|
var _domFns = domFns;
|
|
69382
69384
|
var _positionFns = positionFns;
|
|
@@ -69968,7 +69970,7 @@ _defineProperty(DraggableCore$1, "defaultProps", {
|
|
|
69968
69970
|
});
|
|
69969
69971
|
exports2.default = void 0;
|
|
69970
69972
|
var React2 = _interopRequireWildcard2(React$1);
|
|
69971
|
-
var _propTypes2 = _interopRequireDefault2(
|
|
69973
|
+
var _propTypes2 = _interopRequireDefault2(requirePropTypes());
|
|
69972
69974
|
var _reactDom2 = _interopRequireDefault2(require$$2$1);
|
|
69973
69975
|
var _clsx2 = _interopRequireDefault2(require$$3);
|
|
69974
69976
|
var _domFns2 = domFns;
|
|
@@ -73799,7 +73801,7 @@ var Transition$1 = {};
|
|
|
73799
73801
|
const require$$2 = /* @__PURE__ */ getAugmentedNamespace(reactLifecyclesCompat_es);
|
|
73800
73802
|
Transition$1.__esModule = true;
|
|
73801
73803
|
Transition$1.default = Transition$1.EXITING = Transition$1.ENTERED = Transition$1.ENTERING = Transition$1.EXITED = Transition$1.UNMOUNTED = void 0;
|
|
73802
|
-
var PropTypes = _interopRequireWildcard(
|
|
73804
|
+
var PropTypes = _interopRequireWildcard(requirePropTypes());
|
|
73803
73805
|
var _react$1 = _interopRequireDefault$1(React$1);
|
|
73804
73806
|
var _reactDom = _interopRequireDefault$1(require$$2$1);
|
|
73805
73807
|
var _reactLifecyclesCompat = require$$2;
|
|
@@ -74117,7 +74119,7 @@ Transition$1.default = _default;
|
|
|
74117
74119
|
(function(module2, exports2) {
|
|
74118
74120
|
exports2.__esModule = true;
|
|
74119
74121
|
exports2.default = void 0;
|
|
74120
|
-
_interopRequireWildcard2(
|
|
74122
|
+
_interopRequireWildcard2(requirePropTypes());
|
|
74121
74123
|
var _addClass = _interopRequireDefault2(addClassExports);
|
|
74122
74124
|
var _removeClass = _interopRequireDefault2(removeClass);
|
|
74123
74125
|
var _react3 = _interopRequireDefault2(React$1);
|
|
@@ -74400,7 +74402,7 @@ __name(getNextChildMapping, "getNextChildMapping");
|
|
|
74400
74402
|
(function(module2, exports2) {
|
|
74401
74403
|
exports2.__esModule = true;
|
|
74402
74404
|
exports2.default = void 0;
|
|
74403
|
-
var _propTypes2 = _interopRequireDefault2(
|
|
74405
|
+
var _propTypes2 = _interopRequireDefault2(requirePropTypes());
|
|
74404
74406
|
var _react3 = _interopRequireDefault2(React$1);
|
|
74405
74407
|
var _reactLifecyclesCompat2 = require$$2;
|
|
74406
74408
|
var _ChildMapping = ChildMapping;
|
|
@@ -74554,7 +74556,7 @@ var TransitionGroupExports = TransitionGroup.exports;
|
|
|
74554
74556
|
(function(module2, exports2) {
|
|
74555
74557
|
exports2.__esModule = true;
|
|
74556
74558
|
exports2.default = void 0;
|
|
74557
|
-
_interopRequireDefault2(
|
|
74559
|
+
_interopRequireDefault2(requirePropTypes());
|
|
74558
74560
|
var _react3 = _interopRequireDefault2(React$1);
|
|
74559
74561
|
var _reactDom2 = require$$2$1;
|
|
74560
74562
|
var _TransitionGroup2 = _interopRequireDefault2(TransitionGroupExports);
|
package/index.es.js
CHANGED
|
@@ -3105,63 +3105,89 @@ function getAugmentedNamespace(n2) {
|
|
|
3105
3105
|
}
|
|
3106
3106
|
__name(getAugmentedNamespace, "getAugmentedNamespace");
|
|
3107
3107
|
var propTypes$1 = { exports: {} };
|
|
3108
|
-
var
|
|
3109
|
-
var
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3108
|
+
var ReactPropTypesSecret_1;
|
|
3109
|
+
var hasRequiredReactPropTypesSecret;
|
|
3110
|
+
function requireReactPropTypesSecret() {
|
|
3111
|
+
if (hasRequiredReactPropTypesSecret)
|
|
3112
|
+
return ReactPropTypesSecret_1;
|
|
3113
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
3114
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
3115
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
3116
|
+
return ReactPropTypesSecret_1;
|
|
3117
|
+
}
|
|
3118
|
+
__name(requireReactPropTypesSecret, "requireReactPropTypesSecret");
|
|
3119
|
+
var factoryWithThrowingShims;
|
|
3120
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
3121
|
+
function requireFactoryWithThrowingShims() {
|
|
3122
|
+
if (hasRequiredFactoryWithThrowingShims)
|
|
3123
|
+
return factoryWithThrowingShims;
|
|
3124
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
3125
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
3126
|
+
function emptyFunction() {
|
|
3127
|
+
}
|
|
3128
|
+
__name(emptyFunction, "emptyFunction");
|
|
3129
|
+
function emptyFunctionWithReset() {
|
|
3130
|
+
}
|
|
3131
|
+
__name(emptyFunctionWithReset, "emptyFunctionWithReset");
|
|
3132
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3133
|
+
factoryWithThrowingShims = /* @__PURE__ */ __name(function() {
|
|
3134
|
+
function shim(props, propName, componentName, location2, propFullName, secret) {
|
|
3135
|
+
if (secret === ReactPropTypesSecret) {
|
|
3136
|
+
return;
|
|
3137
|
+
}
|
|
3138
|
+
var err = new Error(
|
|
3139
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
3140
|
+
);
|
|
3141
|
+
err.name = "Invariant Violation";
|
|
3142
|
+
throw err;
|
|
3122
3143
|
}
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
)
|
|
3126
|
-
|
|
3127
|
-
|
|
3144
|
+
__name(shim, "shim");
|
|
3145
|
+
shim.isRequired = shim;
|
|
3146
|
+
function getShim() {
|
|
3147
|
+
return shim;
|
|
3148
|
+
}
|
|
3149
|
+
__name(getShim, "getShim");
|
|
3150
|
+
var ReactPropTypes = {
|
|
3151
|
+
array: shim,
|
|
3152
|
+
bigint: shim,
|
|
3153
|
+
bool: shim,
|
|
3154
|
+
func: shim,
|
|
3155
|
+
number: shim,
|
|
3156
|
+
object: shim,
|
|
3157
|
+
string: shim,
|
|
3158
|
+
symbol: shim,
|
|
3159
|
+
any: shim,
|
|
3160
|
+
arrayOf: getShim,
|
|
3161
|
+
element: shim,
|
|
3162
|
+
elementType: shim,
|
|
3163
|
+
instanceOf: getShim,
|
|
3164
|
+
node: shim,
|
|
3165
|
+
objectOf: getShim,
|
|
3166
|
+
oneOf: getShim,
|
|
3167
|
+
oneOfType: getShim,
|
|
3168
|
+
shape: getShim,
|
|
3169
|
+
exact: getShim,
|
|
3170
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
3171
|
+
resetWarningCache: emptyFunction
|
|
3172
|
+
};
|
|
3173
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3174
|
+
return ReactPropTypes;
|
|
3175
|
+
}, "factoryWithThrowingShims");
|
|
3176
|
+
return factoryWithThrowingShims;
|
|
3177
|
+
}
|
|
3178
|
+
__name(requireFactoryWithThrowingShims, "requireFactoryWithThrowingShims");
|
|
3179
|
+
var hasRequiredPropTypes;
|
|
3180
|
+
function requirePropTypes() {
|
|
3181
|
+
if (hasRequiredPropTypes)
|
|
3182
|
+
return propTypes$1.exports;
|
|
3183
|
+
hasRequiredPropTypes = 1;
|
|
3184
|
+
{
|
|
3185
|
+
propTypes$1.exports = requireFactoryWithThrowingShims()();
|
|
3128
3186
|
}
|
|
3129
|
-
|
|
3130
|
-
shim.isRequired = shim;
|
|
3131
|
-
function getShim() {
|
|
3132
|
-
return shim;
|
|
3133
|
-
}
|
|
3134
|
-
__name(getShim, "getShim");
|
|
3135
|
-
var ReactPropTypes = {
|
|
3136
|
-
array: shim,
|
|
3137
|
-
bigint: shim,
|
|
3138
|
-
bool: shim,
|
|
3139
|
-
func: shim,
|
|
3140
|
-
number: shim,
|
|
3141
|
-
object: shim,
|
|
3142
|
-
string: shim,
|
|
3143
|
-
symbol: shim,
|
|
3144
|
-
any: shim,
|
|
3145
|
-
arrayOf: getShim,
|
|
3146
|
-
element: shim,
|
|
3147
|
-
elementType: shim,
|
|
3148
|
-
instanceOf: getShim,
|
|
3149
|
-
node: shim,
|
|
3150
|
-
objectOf: getShim,
|
|
3151
|
-
oneOf: getShim,
|
|
3152
|
-
oneOfType: getShim,
|
|
3153
|
-
shape: getShim,
|
|
3154
|
-
exact: getShim,
|
|
3155
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
3156
|
-
resetWarningCache: emptyFunction
|
|
3157
|
-
};
|
|
3158
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3159
|
-
return ReactPropTypes;
|
|
3160
|
-
}, "factoryWithThrowingShims");
|
|
3161
|
-
{
|
|
3162
|
-
propTypes$1.exports = factoryWithThrowingShims();
|
|
3187
|
+
return propTypes$1.exports;
|
|
3163
3188
|
}
|
|
3164
|
-
|
|
3189
|
+
__name(requirePropTypes, "requirePropTypes");
|
|
3190
|
+
var propTypesExports = requirePropTypes();
|
|
3165
3191
|
const PropTypes$1 = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
3166
3192
|
function __awaiter(thisArg, _arguments, P2, generator) {
|
|
3167
3193
|
function adopt(value) {
|
|
@@ -13452,7 +13478,7 @@ var reactList = {};
|
|
|
13452
13478
|
(function(exports2) {
|
|
13453
13479
|
(function(global2, factory) {
|
|
13454
13480
|
{
|
|
13455
|
-
factory(exports2,
|
|
13481
|
+
factory(exports2, requirePropTypes(), React__default);
|
|
13456
13482
|
}
|
|
13457
13483
|
})(commonjsGlobal, function(_exports, _propTypes2, _react3) {
|
|
13458
13484
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -20062,7 +20088,6 @@ function buildRef(qb, reference2, searchField, expression) {
|
|
|
20062
20088
|
__name(buildRef, "buildRef");
|
|
20063
20089
|
function makeDataTableHandlers({
|
|
20064
20090
|
setNewParams,
|
|
20065
|
-
updateSearch,
|
|
20066
20091
|
defaults: defaults2,
|
|
20067
20092
|
onlyOneFilter
|
|
20068
20093
|
}) {
|
|
@@ -20073,7 +20098,6 @@ function makeDataTableHandlers({
|
|
|
20073
20098
|
searchTerm: searchTerm === defaults2.searchTerm ? void 0 : searchTerm
|
|
20074
20099
|
});
|
|
20075
20100
|
setNewParams(newParams);
|
|
20076
|
-
updateSearch(searchTerm);
|
|
20077
20101
|
onlyOneFilter && clearFilters();
|
|
20078
20102
|
}
|
|
20079
20103
|
__name(setSearchTerm, "setSearchTerm");
|
|
@@ -20090,7 +20114,6 @@ function makeDataTableHandlers({
|
|
|
20090
20114
|
filters
|
|
20091
20115
|
});
|
|
20092
20116
|
setNewParams(newParams);
|
|
20093
|
-
onlyOneFilter && updateSearch();
|
|
20094
20117
|
}
|
|
20095
20118
|
__name(addFilters, "addFilters");
|
|
20096
20119
|
function removeSingleFilter(filterOn, currentParams) {
|
|
@@ -20113,7 +20136,6 @@ function makeDataTableHandlers({
|
|
|
20113
20136
|
toClear[key] = void 0;
|
|
20114
20137
|
});
|
|
20115
20138
|
setNewParams(toClear);
|
|
20116
|
-
updateSearch();
|
|
20117
20139
|
}
|
|
20118
20140
|
__name(clearFilters, "clearFilters");
|
|
20119
20141
|
function setPageSize(pageSize, currentParams) {
|
|
@@ -32970,13 +32992,13 @@ const SearchBar = /* @__PURE__ */ __name(({
|
|
|
32970
32992
|
disabled,
|
|
32971
32993
|
loading,
|
|
32972
32994
|
type: "search",
|
|
32973
|
-
|
|
32995
|
+
defaultValue: searchInput,
|
|
32974
32996
|
className: classNames("datatable-search-input", Classes.ROUND),
|
|
32975
32997
|
placeholder: "Search..."
|
|
32976
32998
|
}, onEnterHelper((e2) => {
|
|
32977
32999
|
e2.preventDefault();
|
|
32978
33000
|
e2.stopPropagation();
|
|
32979
|
-
setSearchTerm(
|
|
33001
|
+
setSearchTerm(e2.target.value);
|
|
32980
33002
|
e2.nativeEvent.stopImmediatePropagation();
|
|
32981
33003
|
})), {
|
|
32982
33004
|
rightElement
|
|
@@ -52445,7 +52467,6 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52445
52467
|
reduxFormEditingCell,
|
|
52446
52468
|
reduxFormEntities,
|
|
52447
52469
|
reduxFormQueryParams: _reduxFormQueryParams = {},
|
|
52448
|
-
reduxFormSearchInput: _reduxFormSearchInput = "",
|
|
52449
52470
|
reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {}
|
|
52450
52471
|
} = useSelector(
|
|
52451
52472
|
(state) => formValueSelector(formName)(
|
|
@@ -52453,13 +52474,11 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52453
52474
|
"reduxFormCellValidation",
|
|
52454
52475
|
"reduxFormEntities",
|
|
52455
52476
|
"reduxFormQueryParams",
|
|
52456
|
-
"reduxFormSearchInput",
|
|
52457
52477
|
"reduxFormSelectedEntityIdMap"
|
|
52458
52478
|
)
|
|
52459
52479
|
);
|
|
52460
52480
|
const reduxFormCellValidation = useDeepEqualMemo(_reduxFormCellValidation);
|
|
52461
52481
|
const reduxFormQueryParams = useDeepEqualMemo(_reduxFormQueryParams);
|
|
52462
|
-
const reduxFormSearchInput = useDeepEqualMemo(_reduxFormSearchInput);
|
|
52463
52482
|
const reduxFormSelectedEntityIdMap = useDeepEqualMemo(
|
|
52464
52483
|
_reduxFormSelectedEntityIdMap
|
|
52465
52484
|
);
|
|
@@ -52534,22 +52553,17 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52534
52553
|
});
|
|
52535
52554
|
const _currentParams = useMemo(() => {
|
|
52536
52555
|
const tmp = (urlConnected ? getCurrentParamsFromUrl(history.location) : reduxFormQueryParams) || {};
|
|
52537
|
-
tmp.searchTerm = reduxFormSearchInput;
|
|
52538
52556
|
return tmp;
|
|
52539
|
-
}, [history, reduxFormQueryParams,
|
|
52557
|
+
}, [history, reduxFormQueryParams, urlConnected]);
|
|
52540
52558
|
const currentParams = useDeepEqualMemo(_currentParams);
|
|
52541
52559
|
const tableParams = useMemo(() => {
|
|
52542
52560
|
if (!isTableParamsConnected) {
|
|
52543
|
-
const updateSearch = /* @__PURE__ */ __name((val) => {
|
|
52544
|
-
change$1("reduxFormSearchInput", val || "");
|
|
52545
|
-
}, "updateSearch");
|
|
52546
52561
|
const setNewParams2 = /* @__PURE__ */ __name((newParams) => {
|
|
52547
52562
|
urlConnected && setCurrentParamsOnUrl(newParams, history.replace);
|
|
52548
52563
|
change$1("reduxFormQueryParams", newParams);
|
|
52549
52564
|
}, "setNewParams2");
|
|
52550
52565
|
const bindThese = makeDataTableHandlers({
|
|
52551
52566
|
setNewParams: setNewParams2,
|
|
52552
|
-
updateSearch,
|
|
52553
52567
|
defaults: defaults2,
|
|
52554
52568
|
onlyOneFilter: props.onlyOneFilter
|
|
52555
52569
|
});
|
|
@@ -54970,7 +54984,7 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
54970
54984
|
)) : "", /* @__PURE__ */ React__default.createElement(
|
|
54971
54985
|
SearchBar,
|
|
54972
54986
|
{
|
|
54973
|
-
searchInput:
|
|
54987
|
+
searchInput: currentParams.searchTerm,
|
|
54974
54988
|
setSearchTerm,
|
|
54975
54989
|
loading: isLoading,
|
|
54976
54990
|
searchMenuButton,
|
|
@@ -68568,31 +68582,22 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68568
68582
|
}
|
|
68569
68583
|
const {
|
|
68570
68584
|
reduxFormQueryParams: _reduxFormQueryParams = {},
|
|
68571
|
-
reduxFormSearchInput: _reduxFormSearchInput = "",
|
|
68572
68585
|
reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {}
|
|
68573
68586
|
} = useSelector(
|
|
68574
68587
|
(state) => formValueSelector(formName)(
|
|
68575
68588
|
state,
|
|
68576
68589
|
"reduxFormQueryParams",
|
|
68577
|
-
"reduxFormSearchInput",
|
|
68578
68590
|
"reduxFormSelectedEntityIdMap"
|
|
68579
68591
|
)
|
|
68580
68592
|
);
|
|
68581
68593
|
const reduxFormQueryParams = useDeepEqualMemo(_reduxFormQueryParams);
|
|
68582
|
-
const reduxFormSearchInput = useDeepEqualMemo(_reduxFormSearchInput);
|
|
68583
68594
|
const reduxFormSelectedEntityIdMap = useDeepEqualMemo(
|
|
68584
68595
|
_reduxFormSelectedEntityIdMap
|
|
68585
68596
|
);
|
|
68586
68597
|
const _currentParams = useMemo(() => {
|
|
68587
68598
|
const tmp = (urlConnected ? getCurrentParamsFromUrl(history == null ? void 0 : history.location) : reduxFormQueryParams) || {};
|
|
68588
|
-
tmp.searchTerm = reduxFormSearchInput;
|
|
68589
68599
|
return tmp;
|
|
68590
|
-
}, [
|
|
68591
|
-
history == null ? void 0 : history.location,
|
|
68592
|
-
reduxFormQueryParams,
|
|
68593
|
-
reduxFormSearchInput,
|
|
68594
|
-
urlConnected
|
|
68595
|
-
]);
|
|
68600
|
+
}, [history == null ? void 0 : history.location, reduxFormQueryParams, urlConnected]);
|
|
68596
68601
|
const selectedEntities = useMemo(
|
|
68597
68602
|
() => withSelectedEntities2 ? Object.values(reduxFormSelectedEntityIdMap).sort((a2, b2) => a2.rowIndex - b2.rowIndex).map((item) => item.entity) : void 0,
|
|
68598
68603
|
[reduxFormSelectedEntityIdMap, withSelectedEntities2]
|
|
@@ -68613,11 +68618,12 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68613
68618
|
formName: "tgDataTable"
|
|
68614
68619
|
}, props), {
|
|
68615
68620
|
pageSize: controlled_pageSize || pageSize,
|
|
68616
|
-
defaults: defaultsToUse
|
|
68621
|
+
defaults: defaultsToUse,
|
|
68622
|
+
location: history.location
|
|
68617
68623
|
}),
|
|
68618
68624
|
// We don't want to rerender this every time a prop changes
|
|
68619
68625
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68620
|
-
[controlled_pageSize, defaultsToUse, pageSize]
|
|
68626
|
+
[controlled_pageSize, defaultsToUse, pageSize, history.location]
|
|
68621
68627
|
);
|
|
68622
68628
|
const queryParams = useMemo(() => {
|
|
68623
68629
|
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter.bind(void 0, passingProps) : () => additionalFilter;
|
|
@@ -68658,16 +68664,12 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68658
68664
|
const dispatch = useDispatch();
|
|
68659
68665
|
const tableParams = useMemo(() => {
|
|
68660
68666
|
const change$1 = /* @__PURE__ */ __name((...args) => dispatch(change(formName, ...args)), "change$1");
|
|
68661
|
-
const updateSearch = /* @__PURE__ */ __name((val) => {
|
|
68662
|
-
change$1("reduxFormSearchInput", val || "");
|
|
68663
|
-
}, "updateSearch");
|
|
68664
68667
|
const setNewParams = /* @__PURE__ */ __name((newParams) => {
|
|
68665
68668
|
urlConnected && setCurrentParamsOnUrl(newParams, history == null ? void 0 : history.replace);
|
|
68666
68669
|
change$1("reduxFormQueryParams", newParams);
|
|
68667
68670
|
}, "setNewParams");
|
|
68668
68671
|
const bindThese = makeDataTableHandlers({
|
|
68669
68672
|
setNewParams,
|
|
68670
|
-
updateSearch,
|
|
68671
68673
|
defaults: defaults2,
|
|
68672
68674
|
onlyOneFilter
|
|
68673
68675
|
});
|
|
@@ -69358,7 +69360,7 @@ Object.defineProperty(DraggableCore$2, "__esModule", {
|
|
|
69358
69360
|
});
|
|
69359
69361
|
DraggableCore$2.default = void 0;
|
|
69360
69362
|
var React = _interopRequireWildcard$1(React__default);
|
|
69361
|
-
var _propTypes = _interopRequireDefault$2(
|
|
69363
|
+
var _propTypes = _interopRequireDefault$2(requirePropTypes());
|
|
69362
69364
|
var _reactDom$1 = _interopRequireDefault$2(require$$2$1);
|
|
69363
69365
|
var _domFns = domFns;
|
|
69364
69366
|
var _positionFns = positionFns;
|
|
@@ -69950,7 +69952,7 @@ _defineProperty(DraggableCore$1, "defaultProps", {
|
|
|
69950
69952
|
});
|
|
69951
69953
|
exports2.default = void 0;
|
|
69952
69954
|
var React2 = _interopRequireWildcard2(React__default);
|
|
69953
|
-
var _propTypes2 = _interopRequireDefault2(
|
|
69955
|
+
var _propTypes2 = _interopRequireDefault2(requirePropTypes());
|
|
69954
69956
|
var _reactDom2 = _interopRequireDefault2(require$$2$1);
|
|
69955
69957
|
var _clsx2 = _interopRequireDefault2(require$$3);
|
|
69956
69958
|
var _domFns2 = domFns;
|
|
@@ -73781,7 +73783,7 @@ var Transition$1 = {};
|
|
|
73781
73783
|
const require$$2 = /* @__PURE__ */ getAugmentedNamespace(reactLifecyclesCompat_es);
|
|
73782
73784
|
Transition$1.__esModule = true;
|
|
73783
73785
|
Transition$1.default = Transition$1.EXITING = Transition$1.ENTERED = Transition$1.ENTERING = Transition$1.EXITED = Transition$1.UNMOUNTED = void 0;
|
|
73784
|
-
var PropTypes = _interopRequireWildcard(
|
|
73786
|
+
var PropTypes = _interopRequireWildcard(requirePropTypes());
|
|
73785
73787
|
var _react$1 = _interopRequireDefault$1(React__default);
|
|
73786
73788
|
var _reactDom = _interopRequireDefault$1(require$$2$1);
|
|
73787
73789
|
var _reactLifecyclesCompat = require$$2;
|
|
@@ -74099,7 +74101,7 @@ Transition$1.default = _default;
|
|
|
74099
74101
|
(function(module2, exports2) {
|
|
74100
74102
|
exports2.__esModule = true;
|
|
74101
74103
|
exports2.default = void 0;
|
|
74102
|
-
_interopRequireWildcard2(
|
|
74104
|
+
_interopRequireWildcard2(requirePropTypes());
|
|
74103
74105
|
var _addClass = _interopRequireDefault2(addClassExports);
|
|
74104
74106
|
var _removeClass = _interopRequireDefault2(removeClass);
|
|
74105
74107
|
var _react3 = _interopRequireDefault2(React__default);
|
|
@@ -74382,7 +74384,7 @@ __name(getNextChildMapping, "getNextChildMapping");
|
|
|
74382
74384
|
(function(module2, exports2) {
|
|
74383
74385
|
exports2.__esModule = true;
|
|
74384
74386
|
exports2.default = void 0;
|
|
74385
|
-
var _propTypes2 = _interopRequireDefault2(
|
|
74387
|
+
var _propTypes2 = _interopRequireDefault2(requirePropTypes());
|
|
74386
74388
|
var _react3 = _interopRequireDefault2(React__default);
|
|
74387
74389
|
var _reactLifecyclesCompat2 = require$$2;
|
|
74388
74390
|
var _ChildMapping = ChildMapping;
|
|
@@ -74536,7 +74538,7 @@ var TransitionGroupExports = TransitionGroup.exports;
|
|
|
74536
74538
|
(function(module2, exports2) {
|
|
74537
74539
|
exports2.__esModule = true;
|
|
74538
74540
|
exports2.default = void 0;
|
|
74539
|
-
_interopRequireDefault2(
|
|
74541
|
+
_interopRequireDefault2(requirePropTypes());
|
|
74540
74542
|
var _react3 = _interopRequireDefault2(React__default);
|
|
74541
74543
|
var _reactDom2 = require$$2$1;
|
|
74542
74544
|
var _TransitionGroup2 = _interopRequireDefault2(TransitionGroupExports);
|
package/package.json
CHANGED
|
@@ -40,13 +40,13 @@ const SearchBar = ({
|
|
|
40
40
|
disabled={disabled}
|
|
41
41
|
loading={loading}
|
|
42
42
|
type="search"
|
|
43
|
-
|
|
43
|
+
defaultValue={searchInput}
|
|
44
44
|
className={classNames("datatable-search-input", Classes.ROUND)}
|
|
45
45
|
placeholder="Search..."
|
|
46
46
|
{...onEnterHelper(e => {
|
|
47
47
|
e.preventDefault();
|
|
48
48
|
e.stopPropagation();
|
|
49
|
-
setSearchTerm(
|
|
49
|
+
setSearchTerm(e.target.value);
|
|
50
50
|
e.nativeEvent.stopImmediatePropagation();
|
|
51
51
|
})}
|
|
52
52
|
rightElement={rightElement}
|
package/src/DataTable/index.js
CHANGED
|
@@ -169,7 +169,6 @@ const DataTable = ({
|
|
|
169
169
|
reduxFormEditingCell,
|
|
170
170
|
reduxFormEntities,
|
|
171
171
|
reduxFormQueryParams: _reduxFormQueryParams = {},
|
|
172
|
-
reduxFormSearchInput: _reduxFormSearchInput = "",
|
|
173
172
|
reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {}
|
|
174
173
|
} = useSelector(state =>
|
|
175
174
|
formValueSelector(formName)(
|
|
@@ -177,7 +176,6 @@ const DataTable = ({
|
|
|
177
176
|
"reduxFormCellValidation",
|
|
178
177
|
"reduxFormEntities",
|
|
179
178
|
"reduxFormQueryParams",
|
|
180
|
-
"reduxFormSearchInput",
|
|
181
179
|
"reduxFormSelectedEntityIdMap"
|
|
182
180
|
)
|
|
183
181
|
);
|
|
@@ -186,7 +184,6 @@ const DataTable = ({
|
|
|
186
184
|
// with redux-forms we tend to do unnecessary renders
|
|
187
185
|
const reduxFormCellValidation = useDeepEqualMemo(_reduxFormCellValidation);
|
|
188
186
|
const reduxFormQueryParams = useDeepEqualMemo(_reduxFormQueryParams);
|
|
189
|
-
const reduxFormSearchInput = useDeepEqualMemo(_reduxFormSearchInput);
|
|
190
187
|
const reduxFormSelectedEntityIdMap = useDeepEqualMemo(
|
|
191
188
|
_reduxFormSelectedEntityIdMap
|
|
192
189
|
);
|
|
@@ -286,19 +283,13 @@ const DataTable = ({
|
|
|
286
283
|
(urlConnected
|
|
287
284
|
? getCurrentParamsFromUrl(history.location) //important to use history location and not ownProps.location because for some reason the location path lags one render behind!!
|
|
288
285
|
: reduxFormQueryParams) || {};
|
|
289
|
-
|
|
290
|
-
tmp.searchTerm = reduxFormSearchInput;
|
|
291
286
|
return tmp;
|
|
292
|
-
}, [history, reduxFormQueryParams,
|
|
287
|
+
}, [history, reduxFormQueryParams, urlConnected]);
|
|
293
288
|
|
|
294
289
|
const currentParams = useDeepEqualMemo(_currentParams);
|
|
295
290
|
|
|
296
291
|
const tableParams = useMemo(() => {
|
|
297
292
|
if (!isTableParamsConnected) {
|
|
298
|
-
const updateSearch = val => {
|
|
299
|
-
change("reduxFormSearchInput", val || "");
|
|
300
|
-
};
|
|
301
|
-
|
|
302
293
|
const setNewParams = newParams => {
|
|
303
294
|
urlConnected && setCurrentParamsOnUrl(newParams, history.replace);
|
|
304
295
|
change("reduxFormQueryParams", newParams); //we always will update the redux params as a workaround for withRouter not always working if inside a redux-connected container https://github.com/ReactTraining/react-router/issues/5037
|
|
@@ -306,7 +297,6 @@ const DataTable = ({
|
|
|
306
297
|
|
|
307
298
|
const bindThese = makeDataTableHandlers({
|
|
308
299
|
setNewParams,
|
|
309
|
-
updateSearch,
|
|
310
300
|
defaults,
|
|
311
301
|
onlyOneFilter: props.onlyOneFilter
|
|
312
302
|
});
|
|
@@ -3031,7 +3021,7 @@ const DataTable = ({
|
|
|
3031
3021
|
""
|
|
3032
3022
|
)}
|
|
3033
3023
|
<SearchBar
|
|
3034
|
-
searchInput={
|
|
3024
|
+
searchInput={currentParams.searchTerm}
|
|
3035
3025
|
setSearchTerm={setSearchTerm}
|
|
3036
3026
|
loading={isLoading}
|
|
3037
3027
|
searchMenuButton={searchMenuButton}
|
|
@@ -603,7 +603,6 @@ function buildRef(qb, reference, searchField, expression) {
|
|
|
603
603
|
|
|
604
604
|
export function makeDataTableHandlers({
|
|
605
605
|
setNewParams,
|
|
606
|
-
updateSearch,
|
|
607
606
|
defaults,
|
|
608
607
|
onlyOneFilter
|
|
609
608
|
}) {
|
|
@@ -615,7 +614,6 @@ export function makeDataTableHandlers({
|
|
|
615
614
|
searchTerm: searchTerm === defaults.searchTerm ? undefined : searchTerm
|
|
616
615
|
};
|
|
617
616
|
setNewParams(newParams);
|
|
618
|
-
updateSearch(searchTerm);
|
|
619
617
|
onlyOneFilter && clearFilters();
|
|
620
618
|
}
|
|
621
619
|
function addFilters(newFilters, currentParams) {
|
|
@@ -631,7 +629,6 @@ export function makeDataTableHandlers({
|
|
|
631
629
|
filters
|
|
632
630
|
};
|
|
633
631
|
setNewParams(newParams);
|
|
634
|
-
onlyOneFilter && updateSearch();
|
|
635
632
|
}
|
|
636
633
|
function removeSingleFilter(filterOn, currentParams) {
|
|
637
634
|
const filters = currentParams.filters
|
|
@@ -655,7 +652,6 @@ export function makeDataTableHandlers({
|
|
|
655
652
|
toClear[key] = undefined;
|
|
656
653
|
});
|
|
657
654
|
setNewParams(toClear);
|
|
658
|
-
updateSearch();
|
|
659
655
|
}
|
|
660
656
|
function setPageSize(pageSize, currentParams) {
|
|
661
657
|
const newParams = {
|
|
@@ -101,13 +101,11 @@ export const useTableParams = props => {
|
|
|
101
101
|
|
|
102
102
|
const {
|
|
103
103
|
reduxFormQueryParams: _reduxFormQueryParams = {},
|
|
104
|
-
reduxFormSearchInput: _reduxFormSearchInput = "",
|
|
105
104
|
reduxFormSelectedEntityIdMap: _reduxFormSelectedEntityIdMap = {}
|
|
106
105
|
} = useSelector(state =>
|
|
107
106
|
formValueSelector(formName)(
|
|
108
107
|
state,
|
|
109
108
|
"reduxFormQueryParams",
|
|
110
|
-
"reduxFormSearchInput",
|
|
111
109
|
"reduxFormSelectedEntityIdMap"
|
|
112
110
|
)
|
|
113
111
|
);
|
|
@@ -115,7 +113,6 @@ export const useTableParams = props => {
|
|
|
115
113
|
// We want to make sure we don't rerender everything unnecessary
|
|
116
114
|
// with redux-forms we tend to do unnecessary renders
|
|
117
115
|
const reduxFormQueryParams = useDeepEqualMemo(_reduxFormQueryParams);
|
|
118
|
-
const reduxFormSearchInput = useDeepEqualMemo(_reduxFormSearchInput);
|
|
119
116
|
const reduxFormSelectedEntityIdMap = useDeepEqualMemo(
|
|
120
117
|
_reduxFormSelectedEntityIdMap
|
|
121
118
|
);
|
|
@@ -126,14 +123,8 @@ export const useTableParams = props => {
|
|
|
126
123
|
? getCurrentParamsFromUrl(history?.location) //important to use history location and not ownProps.location because for some reason the location path lags one render behind!!
|
|
127
124
|
: reduxFormQueryParams) || {};
|
|
128
125
|
|
|
129
|
-
tmp.searchTerm = reduxFormSearchInput;
|
|
130
126
|
return tmp;
|
|
131
|
-
}, [
|
|
132
|
-
history?.location,
|
|
133
|
-
reduxFormQueryParams,
|
|
134
|
-
reduxFormSearchInput,
|
|
135
|
-
urlConnected
|
|
136
|
-
]);
|
|
127
|
+
}, [history?.location, reduxFormQueryParams, urlConnected]);
|
|
137
128
|
|
|
138
129
|
const selectedEntities = useMemo(
|
|
139
130
|
() =>
|
|
@@ -166,11 +157,12 @@ export const useTableParams = props => {
|
|
|
166
157
|
formName: "tgDataTable",
|
|
167
158
|
...props,
|
|
168
159
|
pageSize: controlled_pageSize || pageSize,
|
|
169
|
-
defaults: defaultsToUse
|
|
160
|
+
defaults: defaultsToUse,
|
|
161
|
+
location: history.location
|
|
170
162
|
}),
|
|
171
163
|
// We don't want to rerender this every time a prop changes
|
|
172
164
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
173
|
-
[controlled_pageSize, defaultsToUse, pageSize]
|
|
165
|
+
[controlled_pageSize, defaultsToUse, pageSize, history.location]
|
|
174
166
|
);
|
|
175
167
|
|
|
176
168
|
const queryParams = useMemo(() => {
|
|
@@ -221,9 +213,6 @@ export const useTableParams = props => {
|
|
|
221
213
|
|
|
222
214
|
const tableParams = useMemo(() => {
|
|
223
215
|
const change = (...args) => dispatch(_change(formName, ...args));
|
|
224
|
-
const updateSearch = val => {
|
|
225
|
-
change("reduxFormSearchInput", val || "");
|
|
226
|
-
};
|
|
227
216
|
|
|
228
217
|
const setNewParams = newParams => {
|
|
229
218
|
urlConnected && setCurrentParamsOnUrl(newParams, history?.replace);
|
|
@@ -232,7 +221,6 @@ export const useTableParams = props => {
|
|
|
232
221
|
|
|
233
222
|
const bindThese = makeDataTableHandlers({
|
|
234
223
|
setNewParams,
|
|
235
|
-
updateSearch,
|
|
236
224
|
defaults,
|
|
237
225
|
onlyOneFilter
|
|
238
226
|
});
|