@wipco/sdui 1.4.0 → 1.4.2
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/index.js +9 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -596,6 +596,10 @@ function resolveViewItems(views, disableGrid, disableList) {
|
|
|
596
596
|
}
|
|
597
597
|
return items.length > 0 ? items : [DEFAULT_VIEWS[0]];
|
|
598
598
|
}
|
|
599
|
+
function localSearchText(row) {
|
|
600
|
+
const scalar = (v) => typeof v === "string" || typeof v === "number";
|
|
601
|
+
return Object.values(row ?? {}).flatMap((v) => Array.isArray(v) ? v.filter(scalar) : scalar(v) ? [v] : []).join(" ");
|
|
602
|
+
}
|
|
599
603
|
function SearchResults({
|
|
600
604
|
item,
|
|
601
605
|
columns,
|
|
@@ -672,12 +676,7 @@ function SearchResults({
|
|
|
672
676
|
let rows = item.data;
|
|
673
677
|
if (hasAllRows) {
|
|
674
678
|
if (appliedSearch) {
|
|
675
|
-
rows = rows.filter(
|
|
676
|
-
(row) => includesLooseSearch(
|
|
677
|
-
Object.values(row).filter((v) => typeof v === "string" || typeof v === "number").join(" "),
|
|
678
|
-
appliedSearch
|
|
679
|
-
)
|
|
680
|
-
);
|
|
679
|
+
rows = rows.filter((row) => includesLooseSearch(localSearchText(row), appliedSearch));
|
|
681
680
|
}
|
|
682
681
|
for (const { key, values } of activeFilters) {
|
|
683
682
|
rows = rows.filter((row) => values.includes(String(cell(row, key))));
|
|
@@ -2228,6 +2227,9 @@ function isAction(v) {
|
|
|
2228
2227
|
function isActionList(v) {
|
|
2229
2228
|
return Array.isArray(v) && v.length > 0 && v.every(isAction);
|
|
2230
2229
|
}
|
|
2230
|
+
function deferRunEntry(key, v) {
|
|
2231
|
+
return key === "run" && (isAction(v) || isActionList(v));
|
|
2232
|
+
}
|
|
2231
2233
|
function isActionEntryList(v) {
|
|
2232
2234
|
return Array.isArray(v) && v.length > 0 && v.every((x) => isAction(x) || isArgRef(x));
|
|
2233
2235
|
}
|
|
@@ -2709,7 +2711,7 @@ function SduiRenderer({
|
|
|
2709
2711
|
if (isPlainObject(value)) {
|
|
2710
2712
|
const out = {};
|
|
2711
2713
|
for (const [k, v] of Object.entries(value)) {
|
|
2712
|
-
out[k] = deferChainEntry(value, k) ? v : resolveValue(v, scope);
|
|
2714
|
+
out[k] = deferChainEntry(value, k) || deferRunEntry(k, v) ? v : resolveValue(v, scope);
|
|
2713
2715
|
}
|
|
2714
2716
|
return out;
|
|
2715
2717
|
}
|