Skip to content

Commit cb6209c

Browse files
committed
added support for nova booleanGroup against displayIf
1 parent 1f3084a commit cb6209c

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

dist/js/field.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"git-cz": "^4.7.6",
2020
"laravel-mix": "^5.0.9",
2121
"laravel-nova": "^1.6.0",
22-
"laravel-vapor": "^0.4.1",
22+
"laravel-vapor": "^0.4.2",
2323
"minimist": "^1.2.2",
2424
"resolve-url-loader": "^3.1.2",
2525
"serialize-javascript": "^5.0.1",

resources/js/components/NestedFormField.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,14 @@ export default {
162162
attribute,
163163
is,
164164
isNot,
165+
isNull,
165166
isNotNull,
166167
isMoreThan,
167168
isLessThan,
168169
isMoreThanOrEqual,
169170
isLessThanOrEqual,
170171
includes,
172+
booleanGroup,
171173
} = this.field.displayIf[i];
172174
173175
if (attribute) {
@@ -193,6 +195,13 @@ export default {
193195
shouldDisplay.push(values.every((v) => v <= isLessThanOrEqual));
194196
} else if (includes) {
195197
shouldDisplay.push(values.every((v) => v && includes.includes(v)));
198+
} else if (typeof booleanGroup !== "undefined") {
199+
shouldDisplay.push(values.every((o) => {
200+
let oo = JSON.parse(JSON.stringify(o)).filter((x) => {
201+
return x.name === booleanGroup;
202+
});
203+
return oo && oo[0] && oo[0].checked;
204+
}));
196205
}
197206
}
198207
}

0 commit comments

Comments
 (0)