@monolith-forensics/monolith-ui 1.3.38 → 1.3.40
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.
|
@@ -249,11 +249,12 @@ const Rules = ({ rules = [], combinator, showCombinator, filterDefinitions, onDe
|
|
|
249
249
|
const prevValue = rule.value;
|
|
250
250
|
let newValue;
|
|
251
251
|
const isBetween = operator.value.toLowerCase().includes("between");
|
|
252
|
-
if (
|
|
253
|
-
newValue =
|
|
252
|
+
if (isBetween) {
|
|
253
|
+
newValue = [(prevValue === null || prevValue === void 0 ? void 0 : prevValue[0]) || "", (prevValue === null || prevValue === void 0 ? void 0 : prevValue[1]) || ""];
|
|
254
254
|
}
|
|
255
255
|
else {
|
|
256
|
-
newValue =
|
|
256
|
+
newValue =
|
|
257
|
+
(prevValue === null || prevValue === void 0 ? void 0 : prevValue.length) && prevValue.length > 0 ? prevValue : undefined; // keep existing value if it exists, return undefined if array is empty
|
|
257
258
|
}
|
|
258
259
|
onUpdate(Object.assign(Object.assign({}, rule), { operator, value: newValue }));
|
|
259
260
|
};
|
|
@@ -124,7 +124,7 @@ const TableProvider = (_a) => {
|
|
|
124
124
|
};
|
|
125
125
|
if ((sortState === null || sortState === void 0 ? void 0 : sortState.dataField) === column.dataField) {
|
|
126
126
|
if (sortState.dir === "desc") {
|
|
127
|
-
newSortState =
|
|
127
|
+
newSortState = undefined;
|
|
128
128
|
}
|
|
129
129
|
else {
|
|
130
130
|
if (newSortState) {
|
|
@@ -136,8 +136,8 @@ const TableProvider = (_a) => {
|
|
|
136
136
|
updateSortState(newSortState);
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
(_b = props.onColumnHeaderClick) === null || _b === void 0 ? void 0 : _b.call(props, { column, sort:
|
|
140
|
-
updateSortState(
|
|
139
|
+
(_b = props.onColumnHeaderClick) === null || _b === void 0 ? void 0 : _b.call(props, { column, sort: undefined });
|
|
140
|
+
updateSortState(undefined);
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
const handleFilterChange = (query) => {
|
|
@@ -535,6 +535,20 @@ const TableProvider = (_a) => {
|
|
|
535
535
|
clearSelections,
|
|
536
536
|
runSearch,
|
|
537
537
|
clearSearch,
|
|
538
|
+
getTableState: () => {
|
|
539
|
+
return {
|
|
540
|
+
columnState,
|
|
541
|
+
selectionState: {
|
|
542
|
+
selectedRowKeys,
|
|
543
|
+
excludedRowKeys,
|
|
544
|
+
selectionStatus,
|
|
545
|
+
totalSelected: getCalculatedSelectionTotal(),
|
|
546
|
+
},
|
|
547
|
+
sortState,
|
|
548
|
+
searchState: search,
|
|
549
|
+
filterState,
|
|
550
|
+
};
|
|
551
|
+
},
|
|
538
552
|
};
|
|
539
553
|
}
|
|
540
554
|
const _data = useMemo(() => {
|
package/dist/Table/types.d.ts
CHANGED