@homebound/beam 2.146.2 → 2.147.0
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.
|
@@ -802,9 +802,13 @@ function resolveStyles(style) {
|
|
|
802
802
|
* We return a copy of `[Parent, [Child]]` tuples so that we don't modify the `GridDataRow.children`.
|
|
803
803
|
*/
|
|
804
804
|
function filterRows(api, columns, rows, filter) {
|
|
805
|
-
// Make a
|
|
806
|
-
function
|
|
805
|
+
// Make a functions to do recursion
|
|
806
|
+
function acceptAll(acc, row) {
|
|
807
807
|
var _a, _b;
|
|
808
|
+
return acc.concat([[row, (_b = (_a = row.children) === null || _a === void 0 ? void 0 : _a.reduce(acceptAll, [])) !== null && _b !== void 0 ? _b : []]]);
|
|
809
|
+
}
|
|
810
|
+
function filterFn(acc, row) {
|
|
811
|
+
var _a, _b, _c, _d;
|
|
808
812
|
// Break up "foo bar" into `[foo, bar]` and a row must match both `foo` and `bar`
|
|
809
813
|
const filters = (filter && filter.split(/ +/)) || [];
|
|
810
814
|
const matches = row.kind === "header" ||
|
|
@@ -812,15 +816,18 @@ function filterRows(api, columns, rows, filter) {
|
|
|
812
816
|
filters.length === 0 ||
|
|
813
817
|
!!row.pin ||
|
|
814
818
|
filters.every((f) => columns.map((c) => applyRowFn(c, row, api, 0)).some((maybeContent) => matchesFilter(maybeContent, f)));
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
if (matches || matchedChildren.length > 0) {
|
|
818
|
-
return acc.concat([[row, matchedChildren]]);
|
|
819
|
+
if (matches) {
|
|
820
|
+
return acc.concat([[row, (_b = (_a = row.children) === null || _a === void 0 ? void 0 : _a.reduce(acceptAll, [])) !== null && _b !== void 0 ? _b : []]]);
|
|
819
821
|
}
|
|
820
822
|
else {
|
|
821
|
-
|
|
823
|
+
const matchedChildren = (_d = (_c = row.children) === null || _c === void 0 ? void 0 : _c.reduce(filterFn, [])) !== null && _d !== void 0 ? _d : [];
|
|
824
|
+
if (matchedChildren.length > 0) {
|
|
825
|
+
return acc.concat([[row, matchedChildren]]);
|
|
826
|
+
}
|
|
827
|
+
else {
|
|
828
|
+
return acc;
|
|
829
|
+
}
|
|
822
830
|
}
|
|
823
831
|
}
|
|
824
|
-
;
|
|
825
832
|
return rows.reduce(filterFn, []);
|
|
826
833
|
}
|
|
@@ -25,9 +25,9 @@ function sortBatch(columns, batch, sortState, caseSensitive) {
|
|
|
25
25
|
const v2 = sortValue((0, GridTable_1.applyRowFn)(column, b, {}, 0), caseSensitive);
|
|
26
26
|
const v1e = v1 === null || v1 === undefined;
|
|
27
27
|
const v2e = v2 === null || v2 === undefined;
|
|
28
|
-
if (a.pin || b.pin) {
|
|
28
|
+
if ((a.pin || b.pin) && !(a.pin === b.pin)) {
|
|
29
29
|
const ap = a.pin === "first" ? -1 : a.pin === "last" ? 1 : 0;
|
|
30
|
-
const bp = b.pin === "first" ? -1 :
|
|
30
|
+
const bp = b.pin === "first" ? -1 : b.pin === "last" ? 1 : 0;
|
|
31
31
|
return ap === bp ? 0 : ap < bp ? -1 : 1;
|
|
32
32
|
}
|
|
33
33
|
else if ((v1e && v2e) || v1 === v2) {
|