@teselagen/ui 0.5.23-beta.29 → 0.5.23-beta.30
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 +6 -6
- package/index.cjs.js +156 -204
- package/index.es.js +156 -204
- package/package.json +1 -1
- package/src/DataTable/index.js +12 -23
- package/src/DataTable/utils/queryParams.js +68 -68
- package/src/DataTable/utils/useTableEntities.js +5 -8
- package/src/DataTable/utils/withTableParams.js +48 -46
package/index.es.js
CHANGED
|
@@ -3105,89 +3105,63 @@ 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
|
-
__name(
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
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;
|
|
3108
|
+
var ReactPropTypesSecret$1 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
3109
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
3110
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
3111
|
+
function emptyFunction() {
|
|
3112
|
+
}
|
|
3113
|
+
__name(emptyFunction, "emptyFunction");
|
|
3114
|
+
function emptyFunctionWithReset() {
|
|
3115
|
+
}
|
|
3116
|
+
__name(emptyFunctionWithReset, "emptyFunctionWithReset");
|
|
3117
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3118
|
+
var factoryWithThrowingShims = /* @__PURE__ */ __name(function() {
|
|
3119
|
+
function shim(props, propName, componentName, location2, propFullName, secret) {
|
|
3120
|
+
if (secret === ReactPropTypesSecret) {
|
|
3121
|
+
return;
|
|
3143
3122
|
}
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
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()();
|
|
3123
|
+
var err = new Error(
|
|
3124
|
+
"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"
|
|
3125
|
+
);
|
|
3126
|
+
err.name = "Invariant Violation";
|
|
3127
|
+
throw err;
|
|
3186
3128
|
}
|
|
3187
|
-
|
|
3129
|
+
__name(shim, "shim");
|
|
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();
|
|
3188
3163
|
}
|
|
3189
|
-
|
|
3190
|
-
var propTypesExports = requirePropTypes();
|
|
3164
|
+
var propTypesExports = propTypes$1.exports;
|
|
3191
3165
|
const PropTypes$1 = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
3192
3166
|
function __awaiter(thisArg, _arguments, P2, generator) {
|
|
3193
3167
|
function adopt(value) {
|
|
@@ -13478,7 +13452,7 @@ var reactList = {};
|
|
|
13478
13452
|
(function(exports2) {
|
|
13479
13453
|
(function(global2, factory) {
|
|
13480
13454
|
{
|
|
13481
|
-
factory(exports2,
|
|
13455
|
+
factory(exports2, propTypesExports, React__default);
|
|
13482
13456
|
}
|
|
13483
13457
|
})(commonjsGlobal, function(_exports, _propTypes2, _react3) {
|
|
13484
13458
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -17188,15 +17162,13 @@ const useTableEntities = /* @__PURE__ */ __name((tableFormName) => {
|
|
|
17188
17162
|
},
|
|
17189
17163
|
[dispatch, tableFormName]
|
|
17190
17164
|
);
|
|
17191
|
-
const { allOrderedEntities
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
|
|
17197
|
-
|
|
17198
|
-
}
|
|
17199
|
-
);
|
|
17165
|
+
const { allOrderedEntities, selectedEntities } = useSelector((state) => {
|
|
17166
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17167
|
+
return {
|
|
17168
|
+
allOrderedEntities: (_c = (_b = (_a = state.form) == null ? void 0 : _a[tableFormName]) == null ? void 0 : _b.values) == null ? void 0 : _c.allOrderedEntities,
|
|
17169
|
+
selectedEntities: (_f = (_e = (_d = state.form) == null ? void 0 : _d[tableFormName]) == null ? void 0 : _e.values) == null ? void 0 : _f.reduxFormSelectedEntityIdMap
|
|
17170
|
+
};
|
|
17171
|
+
});
|
|
17200
17172
|
return { selectTableEntities, allOrderedEntities, selectedEntities };
|
|
17201
17173
|
}, "useTableEntities");
|
|
17202
17174
|
function rowClick(e2, rowInfo, entities, {
|
|
@@ -20091,42 +20063,36 @@ function makeDataTableHandlers({
|
|
|
20091
20063
|
defaults: defaults2,
|
|
20092
20064
|
onlyOneFilter
|
|
20093
20065
|
}) {
|
|
20094
|
-
|
|
20095
|
-
|
|
20066
|
+
const setSearchTerm = /* @__PURE__ */ __name((searchTerm) => {
|
|
20067
|
+
setNewParams((prev) => __spreadProps(__spreadValues({}, prev != null ? prev : {}), {
|
|
20096
20068
|
page: void 0,
|
|
20097
20069
|
//set page undefined to return the table to page 1
|
|
20098
20070
|
searchTerm: searchTerm === defaults2.searchTerm ? void 0 : searchTerm
|
|
20099
|
-
});
|
|
20100
|
-
setNewParams(newParams);
|
|
20071
|
+
}));
|
|
20101
20072
|
onlyOneFilter && clearFilters();
|
|
20102
|
-
}
|
|
20103
|
-
__name(
|
|
20104
|
-
function addFilters(newFilters, currentParams) {
|
|
20073
|
+
}, "setSearchTerm");
|
|
20074
|
+
const addFilters = /* @__PURE__ */ __name((newFilters) => {
|
|
20105
20075
|
if (!newFilters)
|
|
20106
20076
|
return;
|
|
20107
|
-
|
|
20108
|
-
|
|
20109
|
-
|
|
20110
|
-
|
|
20111
|
-
|
|
20112
|
-
|
|
20113
|
-
|
|
20114
|
-
|
|
20077
|
+
setNewParams((prev) => {
|
|
20078
|
+
const filters = uniqBy(
|
|
20079
|
+
[...newFilters, ...onlyOneFilter ? [] : (prev == null ? void 0 : prev.filters) || []],
|
|
20080
|
+
"filterOn"
|
|
20081
|
+
);
|
|
20082
|
+
return __spreadProps(__spreadValues({}, prev != null ? prev : {}), {
|
|
20083
|
+
page: void 0,
|
|
20084
|
+
//set page undefined to return the table to page 1
|
|
20085
|
+
filters
|
|
20086
|
+
});
|
|
20115
20087
|
});
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
function removeSingleFilter(filterOn, currentParams) {
|
|
20120
|
-
const filters = currentParams.filters ? currentParams.filters.filter((filter2) => {
|
|
20088
|
+
}, "addFilters");
|
|
20089
|
+
const removeSingleFilter = /* @__PURE__ */ __name((filterOn) => setNewParams((prev) => {
|
|
20090
|
+
const filters = (prev == null ? void 0 : prev.filters) ? prev.filters.filter((filter2) => {
|
|
20121
20091
|
return filter2.filterOn !== filterOn;
|
|
20122
20092
|
}) : void 0;
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
|
|
20126
|
-
setNewParams(newParams);
|
|
20127
|
-
}
|
|
20128
|
-
__name(removeSingleFilter, "removeSingleFilter");
|
|
20129
|
-
function clearFilters(additionalFilterKeys = []) {
|
|
20093
|
+
return __spreadProps(__spreadValues({}, prev != null ? prev : {}), { filters });
|
|
20094
|
+
}), "removeSingleFilter");
|
|
20095
|
+
const clearFilters = /* @__PURE__ */ __name((additionalFilterKeys = []) => {
|
|
20130
20096
|
const toClear = {
|
|
20131
20097
|
filters: void 0,
|
|
20132
20098
|
searchTerm: void 0,
|
|
@@ -20136,21 +20102,16 @@ function makeDataTableHandlers({
|
|
|
20136
20102
|
toClear[key] = void 0;
|
|
20137
20103
|
});
|
|
20138
20104
|
setNewParams(toClear);
|
|
20139
|
-
}
|
|
20140
|
-
__name(
|
|
20141
|
-
|
|
20142
|
-
|
|
20143
|
-
|
|
20144
|
-
|
|
20145
|
-
|
|
20146
|
-
});
|
|
20147
|
-
setNewParams(newParams);
|
|
20148
|
-
}
|
|
20149
|
-
__name(setPageSize, "setPageSize");
|
|
20150
|
-
function setOrder(order2, isRemove, shiftHeld, currentParams) {
|
|
20105
|
+
}, "clearFilters");
|
|
20106
|
+
const setPageSize = /* @__PURE__ */ __name((pageSize) => setNewParams((prev) => __spreadProps(__spreadValues({}, prev != null ? prev : {}), {
|
|
20107
|
+
pageSize: pageSize === defaults2.pageSize ? void 0 : pageSize,
|
|
20108
|
+
page: void 0
|
|
20109
|
+
//set page undefined to return the table to page 1
|
|
20110
|
+
})), "setPageSize");
|
|
20111
|
+
const setOrder = /* @__PURE__ */ __name((order2, isRemove, shiftHeld) => setNewParams((prev) => {
|
|
20151
20112
|
let newOrder = [];
|
|
20152
20113
|
if (shiftHeld) {
|
|
20153
|
-
newOrder = [...
|
|
20114
|
+
newOrder = [...(prev == null ? void 0 : prev.order) || []].filter((value) => {
|
|
20154
20115
|
const shouldRemove = value.replace(/^-/, "") === order2.replace(/^-/, "");
|
|
20155
20116
|
return !shouldRemove;
|
|
20156
20117
|
});
|
|
@@ -20164,19 +20125,15 @@ function makeDataTableHandlers({
|
|
|
20164
20125
|
newOrder = [order2];
|
|
20165
20126
|
}
|
|
20166
20127
|
}
|
|
20167
|
-
|
|
20128
|
+
return __spreadProps(__spreadValues({}, prev != null ? prev : {}), {
|
|
20168
20129
|
order: newOrder
|
|
20169
20130
|
});
|
|
20170
|
-
|
|
20171
|
-
|
|
20172
|
-
|
|
20173
|
-
function setPage(page, currentParams) {
|
|
20174
|
-
const newParams = __spreadProps(__spreadValues({}, currentParams), {
|
|
20131
|
+
}), "setOrder");
|
|
20132
|
+
const setPage = /* @__PURE__ */ __name((page) => {
|
|
20133
|
+
setNewParams((prev) => __spreadProps(__spreadValues({}, prev != null ? prev : {}), {
|
|
20175
20134
|
page: page === defaults2.page ? void 0 : page
|
|
20176
|
-
});
|
|
20177
|
-
|
|
20178
|
-
}
|
|
20179
|
-
__name(setPage, "setPage");
|
|
20135
|
+
}));
|
|
20136
|
+
}, "setPage");
|
|
20180
20137
|
return {
|
|
20181
20138
|
setSearchTerm,
|
|
20182
20139
|
addFilters,
|
|
@@ -52559,26 +52516,24 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52559
52516
|
const tableParams = useMemo(() => {
|
|
52560
52517
|
if (!isTableParamsConnected) {
|
|
52561
52518
|
const setNewParams2 = /* @__PURE__ */ __name((newParams) => {
|
|
52562
|
-
|
|
52563
|
-
|
|
52519
|
+
change$1("reduxFormQueryParams", (prev) => {
|
|
52520
|
+
let tmp = newParams;
|
|
52521
|
+
if (typeof tmp === "function")
|
|
52522
|
+
tmp = newParams(prev);
|
|
52523
|
+
urlConnected && setCurrentParamsOnUrl(tmp, history == null ? void 0 : history.replace);
|
|
52524
|
+
return tmp;
|
|
52525
|
+
});
|
|
52564
52526
|
}, "setNewParams2");
|
|
52565
|
-
const
|
|
52527
|
+
const dispatchProps = makeDataTableHandlers({
|
|
52566
52528
|
setNewParams: setNewParams2,
|
|
52567
52529
|
defaults: defaults2,
|
|
52568
52530
|
onlyOneFilter: props.onlyOneFilter
|
|
52569
52531
|
});
|
|
52570
|
-
const boundDispatchProps = {};
|
|
52571
|
-
Object.keys(bindThese).forEach(function(key) {
|
|
52572
|
-
const action2 = bindThese[key];
|
|
52573
|
-
boundDispatchProps[key] = function(...args) {
|
|
52574
|
-
action2(...args, currentParams);
|
|
52575
|
-
};
|
|
52576
|
-
});
|
|
52577
52532
|
const changeFormValue = /* @__PURE__ */ __name((...args) => change$1(...args), "changeFormValue");
|
|
52578
52533
|
return __spreadProps(__spreadValues(__spreadValues({
|
|
52579
52534
|
changeFormValue,
|
|
52580
52535
|
selectedEntities
|
|
52581
|
-
}, _tableParams),
|
|
52536
|
+
}, _tableParams), dispatchProps), {
|
|
52582
52537
|
isTableParamsConnected: true
|
|
52583
52538
|
//let the table know not to do local sorting/filtering etc.
|
|
52584
52539
|
});
|
|
@@ -52587,9 +52542,8 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52587
52542
|
}, [
|
|
52588
52543
|
_tableParams,
|
|
52589
52544
|
change$1,
|
|
52590
|
-
currentParams,
|
|
52591
52545
|
defaults2,
|
|
52592
|
-
history.replace,
|
|
52546
|
+
history == null ? void 0 : history.replace,
|
|
52593
52547
|
isTableParamsConnected,
|
|
52594
52548
|
props.onlyOneFilter,
|
|
52595
52549
|
selectedEntities,
|
|
@@ -52637,7 +52591,7 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
52637
52591
|
additionalFooterButtons,
|
|
52638
52592
|
autoFocusSearch,
|
|
52639
52593
|
cellRenderer,
|
|
52640
|
-
children
|
|
52594
|
+
children,
|
|
52641
52595
|
className = "",
|
|
52642
52596
|
clearFilters = noop$4,
|
|
52643
52597
|
compact: _compact = true,
|
|
@@ -54555,12 +54509,6 @@ const DataTable = /* @__PURE__ */ __name((_G) => {
|
|
|
54555
54509
|
acc[index2] = expandedEntityIdMap[rowId];
|
|
54556
54510
|
return acc;
|
|
54557
54511
|
}, {});
|
|
54558
|
-
const children = useMemo(() => {
|
|
54559
|
-
if (maybeChildren && typeof maybeChildren === "function") {
|
|
54560
|
-
return maybeChildren(props);
|
|
54561
|
-
}
|
|
54562
|
-
return maybeChildren;
|
|
54563
|
-
}, [maybeChildren, props]);
|
|
54564
54512
|
const showHeader = (withTitle || withSearch || children) && !noHeader;
|
|
54565
54513
|
const toggleFullscreenButton = /* @__PURE__ */ React__default.createElement(
|
|
54566
54514
|
Button,
|
|
@@ -68619,11 +68567,11 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68619
68567
|
}, props), {
|
|
68620
68568
|
pageSize: controlled_pageSize || pageSize,
|
|
68621
68569
|
defaults: defaultsToUse,
|
|
68622
|
-
location: history.location
|
|
68570
|
+
location: history == null ? void 0 : history.location
|
|
68623
68571
|
}),
|
|
68624
68572
|
// We don't want to rerender this every time a prop changes
|
|
68625
68573
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68626
|
-
[controlled_pageSize, defaultsToUse, pageSize, history.location]
|
|
68574
|
+
[controlled_pageSize, defaultsToUse, pageSize, history == null ? void 0 : history.location]
|
|
68627
68575
|
);
|
|
68628
68576
|
const queryParams = useMemo(() => {
|
|
68629
68577
|
const additionalFilterToUse = typeof additionalFilter === "function" ? additionalFilter.bind(void 0, passingProps) : () => additionalFilter;
|
|
@@ -68662,27 +68610,33 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68662
68610
|
isCodeModel
|
|
68663
68611
|
]);
|
|
68664
68612
|
const dispatch = useDispatch();
|
|
68665
|
-
const
|
|
68666
|
-
|
|
68667
|
-
|
|
68668
|
-
|
|
68669
|
-
|
|
68670
|
-
|
|
68671
|
-
|
|
68613
|
+
const change$1 = useCallback(
|
|
68614
|
+
(...args) => dispatch(change(formName, ...args)),
|
|
68615
|
+
[dispatch, formName]
|
|
68616
|
+
);
|
|
68617
|
+
const setNewParams = useCallback(
|
|
68618
|
+
(newParams) => {
|
|
68619
|
+
change$1("reduxFormQueryParams", (prev) => {
|
|
68620
|
+
let tmp = newParams;
|
|
68621
|
+
if (typeof tmp === "function")
|
|
68622
|
+
tmp = newParams(prev);
|
|
68623
|
+
urlConnected && setCurrentParamsOnUrl(tmp, history == null ? void 0 : history.replace);
|
|
68624
|
+
return tmp;
|
|
68625
|
+
});
|
|
68626
|
+
},
|
|
68627
|
+
[change$1, history == null ? void 0 : history.replace, urlConnected]
|
|
68628
|
+
);
|
|
68629
|
+
const dispatchProps = useMemo(
|
|
68630
|
+
() => makeDataTableHandlers({
|
|
68672
68631
|
setNewParams,
|
|
68673
68632
|
defaults: defaults2,
|
|
68674
68633
|
onlyOneFilter
|
|
68675
|
-
})
|
|
68676
|
-
|
|
68677
|
-
|
|
68678
|
-
|
|
68679
|
-
|
|
68680
|
-
|
|
68681
|
-
};
|
|
68682
|
-
});
|
|
68683
|
-
const changeFormValue = /* @__PURE__ */ __name((...args) => change$1(...args), "changeFormValue");
|
|
68684
|
-
return __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({
|
|
68685
|
-
changeFormValue,
|
|
68634
|
+
}),
|
|
68635
|
+
[defaults2, onlyOneFilter, setNewParams]
|
|
68636
|
+
);
|
|
68637
|
+
const tableParams = useMemo(
|
|
68638
|
+
() => __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({
|
|
68639
|
+
changeFormValue: (...args) => change$1(...args),
|
|
68686
68640
|
selectedEntities
|
|
68687
68641
|
}, _tableParams), {
|
|
68688
68642
|
formName,
|
|
@@ -68691,28 +68645,26 @@ const useTableParams = /* @__PURE__ */ __name((props) => {
|
|
|
68691
68645
|
schema,
|
|
68692
68646
|
currentParams,
|
|
68693
68647
|
withDisplayOptions
|
|
68694
|
-
}), queryParams),
|
|
68648
|
+
}), queryParams), dispatchProps), {
|
|
68695
68649
|
form: formName,
|
|
68696
68650
|
//this will override the default redux form name
|
|
68697
68651
|
isTableParamsConnected: true
|
|
68698
68652
|
//let the table know not to do local sorting/filtering etc.
|
|
68699
|
-
})
|
|
68700
|
-
|
|
68701
|
-
|
|
68702
|
-
|
|
68703
|
-
|
|
68704
|
-
|
|
68705
|
-
|
|
68706
|
-
|
|
68707
|
-
|
|
68708
|
-
|
|
68709
|
-
|
|
68710
|
-
|
|
68711
|
-
|
|
68712
|
-
|
|
68713
|
-
|
|
68714
|
-
withDisplayOptions
|
|
68715
|
-
]);
|
|
68653
|
+
}),
|
|
68654
|
+
[
|
|
68655
|
+
_tableParams,
|
|
68656
|
+
change$1,
|
|
68657
|
+
currentParams,
|
|
68658
|
+
dispatchProps,
|
|
68659
|
+
formName,
|
|
68660
|
+
initialValues,
|
|
68661
|
+
isLocalCall,
|
|
68662
|
+
queryParams,
|
|
68663
|
+
schema,
|
|
68664
|
+
selectedEntities,
|
|
68665
|
+
withDisplayOptions
|
|
68666
|
+
]
|
|
68667
|
+
);
|
|
68716
68668
|
return __spreadProps(__spreadValues(__spreadValues({
|
|
68717
68669
|
isLocalCall,
|
|
68718
68670
|
schema
|
|
@@ -69360,7 +69312,7 @@ Object.defineProperty(DraggableCore$2, "__esModule", {
|
|
|
69360
69312
|
});
|
|
69361
69313
|
DraggableCore$2.default = void 0;
|
|
69362
69314
|
var React = _interopRequireWildcard$1(React__default);
|
|
69363
|
-
var _propTypes = _interopRequireDefault$2(
|
|
69315
|
+
var _propTypes = _interopRequireDefault$2(propTypesExports);
|
|
69364
69316
|
var _reactDom$1 = _interopRequireDefault$2(require$$2$1);
|
|
69365
69317
|
var _domFns = domFns;
|
|
69366
69318
|
var _positionFns = positionFns;
|
|
@@ -69952,7 +69904,7 @@ _defineProperty(DraggableCore$1, "defaultProps", {
|
|
|
69952
69904
|
});
|
|
69953
69905
|
exports2.default = void 0;
|
|
69954
69906
|
var React2 = _interopRequireWildcard2(React__default);
|
|
69955
|
-
var _propTypes2 = _interopRequireDefault2(
|
|
69907
|
+
var _propTypes2 = _interopRequireDefault2(propTypesExports);
|
|
69956
69908
|
var _reactDom2 = _interopRequireDefault2(require$$2$1);
|
|
69957
69909
|
var _clsx2 = _interopRequireDefault2(require$$3);
|
|
69958
69910
|
var _domFns2 = domFns;
|
|
@@ -73783,7 +73735,7 @@ var Transition$1 = {};
|
|
|
73783
73735
|
const require$$2 = /* @__PURE__ */ getAugmentedNamespace(reactLifecyclesCompat_es);
|
|
73784
73736
|
Transition$1.__esModule = true;
|
|
73785
73737
|
Transition$1.default = Transition$1.EXITING = Transition$1.ENTERED = Transition$1.ENTERING = Transition$1.EXITED = Transition$1.UNMOUNTED = void 0;
|
|
73786
|
-
var PropTypes = _interopRequireWildcard(
|
|
73738
|
+
var PropTypes = _interopRequireWildcard(propTypesExports);
|
|
73787
73739
|
var _react$1 = _interopRequireDefault$1(React__default);
|
|
73788
73740
|
var _reactDom = _interopRequireDefault$1(require$$2$1);
|
|
73789
73741
|
var _reactLifecyclesCompat = require$$2;
|
|
@@ -74101,7 +74053,7 @@ Transition$1.default = _default;
|
|
|
74101
74053
|
(function(module2, exports2) {
|
|
74102
74054
|
exports2.__esModule = true;
|
|
74103
74055
|
exports2.default = void 0;
|
|
74104
|
-
_interopRequireWildcard2(
|
|
74056
|
+
_interopRequireWildcard2(propTypesExports);
|
|
74105
74057
|
var _addClass = _interopRequireDefault2(addClassExports);
|
|
74106
74058
|
var _removeClass = _interopRequireDefault2(removeClass);
|
|
74107
74059
|
var _react3 = _interopRequireDefault2(React__default);
|
|
@@ -74384,7 +74336,7 @@ __name(getNextChildMapping, "getNextChildMapping");
|
|
|
74384
74336
|
(function(module2, exports2) {
|
|
74385
74337
|
exports2.__esModule = true;
|
|
74386
74338
|
exports2.default = void 0;
|
|
74387
|
-
var _propTypes2 = _interopRequireDefault2(
|
|
74339
|
+
var _propTypes2 = _interopRequireDefault2(propTypesExports);
|
|
74388
74340
|
var _react3 = _interopRequireDefault2(React__default);
|
|
74389
74341
|
var _reactLifecyclesCompat2 = require$$2;
|
|
74390
74342
|
var _ChildMapping = ChildMapping;
|
|
@@ -74538,7 +74490,7 @@ var TransitionGroupExports = TransitionGroup.exports;
|
|
|
74538
74490
|
(function(module2, exports2) {
|
|
74539
74491
|
exports2.__esModule = true;
|
|
74540
74492
|
exports2.default = void 0;
|
|
74541
|
-
_interopRequireDefault2(
|
|
74493
|
+
_interopRequireDefault2(propTypesExports);
|
|
74542
74494
|
var _react3 = _interopRequireDefault2(React__default);
|
|
74543
74495
|
var _reactDom2 = require$$2$1;
|
|
74544
74496
|
var _TransitionGroup2 = _interopRequireDefault2(TransitionGroupExports);
|
package/package.json
CHANGED
package/src/DataTable/index.js
CHANGED
|
@@ -291,32 +291,29 @@ const DataTable = ({
|
|
|
291
291
|
const tableParams = useMemo(() => {
|
|
292
292
|
if (!isTableParamsConnected) {
|
|
293
293
|
const setNewParams = newParams => {
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
// we always will update the redux params as a workaround for withRouter not always working
|
|
295
|
+
// if inside a redux-connected container https://github.com/ReactTraining/react-router/issues/5037
|
|
296
|
+
change("reduxFormQueryParams", prev => {
|
|
297
|
+
let tmp = newParams;
|
|
298
|
+
if (typeof tmp === "function") tmp = newParams(prev);
|
|
299
|
+
urlConnected && setCurrentParamsOnUrl(tmp, history?.replace);
|
|
300
|
+
return tmp;
|
|
301
|
+
});
|
|
296
302
|
};
|
|
297
303
|
|
|
298
|
-
const
|
|
304
|
+
const dispatchProps = makeDataTableHandlers({
|
|
299
305
|
setNewParams,
|
|
300
306
|
defaults,
|
|
301
307
|
onlyOneFilter: props.onlyOneFilter
|
|
302
308
|
});
|
|
303
309
|
|
|
304
|
-
const boundDispatchProps = {};
|
|
305
|
-
//bind currentParams to actions
|
|
306
|
-
Object.keys(bindThese).forEach(function (key) {
|
|
307
|
-
const action = bindThese[key];
|
|
308
|
-
boundDispatchProps[key] = function (...args) {
|
|
309
|
-
action(...args, currentParams);
|
|
310
|
-
};
|
|
311
|
-
});
|
|
312
|
-
|
|
313
310
|
const changeFormValue = (...args) => change(...args);
|
|
314
311
|
|
|
315
312
|
return {
|
|
316
313
|
changeFormValue,
|
|
317
314
|
selectedEntities,
|
|
318
315
|
..._tableParams,
|
|
319
|
-
...
|
|
316
|
+
...dispatchProps,
|
|
320
317
|
isTableParamsConnected: true //let the table know not to do local sorting/filtering etc.
|
|
321
318
|
};
|
|
322
319
|
}
|
|
@@ -324,9 +321,8 @@ const DataTable = ({
|
|
|
324
321
|
}, [
|
|
325
322
|
_tableParams,
|
|
326
323
|
change,
|
|
327
|
-
currentParams,
|
|
328
324
|
defaults,
|
|
329
|
-
history
|
|
325
|
+
history?.replace,
|
|
330
326
|
isTableParamsConnected,
|
|
331
327
|
props.onlyOneFilter,
|
|
332
328
|
selectedEntities,
|
|
@@ -392,7 +388,7 @@ const DataTable = ({
|
|
|
392
388
|
additionalFooterButtons,
|
|
393
389
|
autoFocusSearch,
|
|
394
390
|
cellRenderer,
|
|
395
|
-
children
|
|
391
|
+
children,
|
|
396
392
|
className = "",
|
|
397
393
|
clearFilters = noop,
|
|
398
394
|
compact: _compact = true,
|
|
@@ -2523,13 +2519,6 @@ const DataTable = ({
|
|
|
2523
2519
|
return acc;
|
|
2524
2520
|
}, {});
|
|
2525
2521
|
|
|
2526
|
-
const children = useMemo(() => {
|
|
2527
|
-
if (maybeChildren && typeof maybeChildren === "function") {
|
|
2528
|
-
return maybeChildren(props);
|
|
2529
|
-
}
|
|
2530
|
-
return maybeChildren;
|
|
2531
|
-
}, [maybeChildren, props]);
|
|
2532
|
-
|
|
2533
2522
|
const showHeader = (withTitle || withSearch || children) && !noHeader;
|
|
2534
2523
|
const toggleFullscreenButton = (
|
|
2535
2524
|
<Button
|