Skip to content

Commit

Permalink
[5.x] Allow hiding border around group fieldtype (#10570)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Varga <[email protected]>
  • Loading branch information
daun and jasonvarga authored Aug 5, 2024
1 parent 1aa0d20 commit 77d6fc6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions resources/js/components/fieldtypes/GroupFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
/>
</button>
</div>
<div class="mb-4 border dark:border-dark-900 rounded shadow-sm replicator-set">
<div class="replicator-set-body publish-fields @container">
<div :class="{ 'border dark:border-dark-900 rounded shadow-sm replicator-set': config.border }">
<div class="publish-fields @container" :class="{ 'replicator-set-body': config.border, '-mx-4': !config.border }">
<set-field
v-for="field in fields"
:key="field.handle"
Expand All @@ -55,7 +55,6 @@
@meta-updated="updateMeta(field.handle, $event)"
@focus="$emit('focus')"
@blur="$emit('blur')"
class="p-4"
/>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/fieldtypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
'grid.config.add_row' => 'Customize the label of the "Add Row" button.',
'grid.config.fields' => 'Each field becomes a column in the grid table.',
'grid.config.fullscreen' => 'Enable toggle for fullscreen mode.',
'grid.config.border' => 'Show a border and padding around fields in this group.',
'grid.config.max_rows' => 'Set a maximum number of creatable rows.',
'grid.config.min_rows' => 'Set a minimum number of creatable rows.',
'grid.config.mode' => 'Choose your preferred layout style.',
Expand Down
6 changes: 6 additions & 0 deletions src/Fieldtypes/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ protected function configFieldItems(): array
'type' => 'toggle',
'default' => true,
],
'border' => [
'display' => __('Border'),
'instructions' => __('statamic::fieldtypes.grid.config.border'),
'type' => 'toggle',
'default' => true,
],
],
],
];
Expand Down

0 comments on commit 77d6fc6

Please sign in to comment.