adminforth 2.17.0-next.4 → 2.17.0-next.6
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/spa/src/utils.ts +4 -3
- package/package.json +1 -1
package/dist/spa/src/utils.ts
CHANGED
|
@@ -448,9 +448,10 @@ export function createSearchInputHandlers(
|
|
|
448
448
|
|
|
449
449
|
export function checkShowIf(c: AdminForthResourceColumnInputCommon, record: Record<string, any>, allColumns: AdminForthResourceColumnInputCommon[]) {
|
|
450
450
|
if (!c.showIf) return true;
|
|
451
|
+
const recordCopy = { ...record };
|
|
451
452
|
for (const col of allColumns) {
|
|
452
|
-
if (!
|
|
453
|
-
|
|
453
|
+
if (!recordCopy[col.name]) {
|
|
454
|
+
recordCopy[col.name] = null;
|
|
454
455
|
}
|
|
455
456
|
}
|
|
456
457
|
const evaluatePredicate = (predicate: Predicate): boolean => {
|
|
@@ -467,7 +468,7 @@ export function checkShowIf(c: AdminForthResourceColumnInputCommon, record: Reco
|
|
|
467
468
|
const fieldEntries = Object.entries(predicate).filter(([key]) => !key.startsWith('$'));
|
|
468
469
|
if (fieldEntries.length > 0) {
|
|
469
470
|
const fieldResult = fieldEntries.every(([field, condition]) => {
|
|
470
|
-
const recordValue =
|
|
471
|
+
const recordValue = recordCopy[field];
|
|
471
472
|
|
|
472
473
|
if (condition === undefined) {
|
|
473
474
|
return true;
|