Skip to content

Commit cdf17f1

Browse files
author
phoenix
committed
add -- option ->isActiveFalseValue( $value )
1 parent d47a2d8 commit cdf17f1

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-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.

resources/js/components/FormField.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default {
4646
id: node[this.field.idKey],
4747
label: node[this.field.labelKey],
4848
isDisabled: node.hasOwnProperty(this.field.activeKey)
49-
&& node[this.field.activeKey] !== true,
49+
&& node[this.field.activeKey] === this.field.isActiveFalse,
5050
children: node.hasOwnProperty(this.field.childrenKey)
5151
&& node[this.field.childrenKey].length > 0
5252
? node[this.field.childrenKey]

src/NestedTreeAttachManyField.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function __construct($name, $attribute = null, $resource = null)
6464
'disabled' => false,
6565
'rtl' => false,
6666
'maxHeight' => 500,
67+
'isActiveFalse' => false
6768
]);
6869

6970
/** @var Domain\Cache\Cache $requestCache */
@@ -172,6 +173,15 @@ public function withFlatten(bool $flatten): NestedTreeAttachManyField
172173
return $this;
173174
}
174175

176+
public function isActiveFalseValue( $value = false ): NestedTreeAttachManyField
177+
{
178+
$this->withMeta([
179+
'isActiveFalse' => $value,
180+
]);
181+
182+
return $this;
183+
}
184+
175185
public function useSingleSelect(): NestedTreeAttachManyField
176186
{
177187
$this->withMeta([

0 commit comments

Comments
 (0)