Update Kirby and dependencies
This commit is contained in:
parent
503b339974
commit
399fa20902
439 changed files with 66915 additions and 64442 deletions
41
kirby/config/fields/toggles.php
Normal file
41
kirby/config/fields/toggles.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'mixins' => ['options'],
|
||||
'props' => [
|
||||
/**
|
||||
* Unset inherited props
|
||||
*/
|
||||
'after' => null,
|
||||
'before' => null,
|
||||
'icon' => null,
|
||||
'placeholder' => null,
|
||||
|
||||
/**
|
||||
* Toggles will automatically span the full width of the field. With the grow option, you can disable this behaviour for a more compact layout.
|
||||
*/
|
||||
'grow' => function (bool $grow = true) {
|
||||
return $grow;
|
||||
},
|
||||
/**
|
||||
* If `false` all labels will be hidden for icon-only toggles.
|
||||
*/
|
||||
'labels' => function (bool $labels = true) {
|
||||
return $labels;
|
||||
},
|
||||
/**
|
||||
* A toggle can be deactivated on click. If reset is `false` deactivating a toggle is no longer possible.
|
||||
*/
|
||||
'reset' => function (bool $reset = true) {
|
||||
return $reset;
|
||||
}
|
||||
],
|
||||
'computed' => [
|
||||
'default' => function () {
|
||||
return $this->sanitizeOption($this->default);
|
||||
},
|
||||
'value' => function () {
|
||||
return $this->sanitizeOption($this->value) ?? '';
|
||||
},
|
||||
]
|
||||
];
|
Loading…
Add table
Add a link
Reference in a new issue