3
0

Add ability to toggle block border

This commit is contained in:
Jože Fortun 2023-02-09 13:09:15 +01:00
parent 3af167c1d6
commit ee392ecf16
7 changed files with 23 additions and 4 deletions

View File

@ -96,6 +96,13 @@
>
{{ $t('general.wrap') }}
</b-form-checkbox>
<b-form-checkbox
v-model="block.style.border.enabled"
switch
>
{{ $t('general.border.show') }}
</b-form-checkbox>
</b-col>
<b-col

View File

@ -2,7 +2,7 @@
<div class="h-100">
<b-card
no-body
class="h-100 border-0 shadow"
class="h-100 shadow"
:class="blockClass"
>
<b-card-header

View File

@ -1,7 +1,7 @@
<template>
<div class="h-100">
<div
class="d-flex flex-column border position-relative h-100 card bg-transparent"
class="card bg-transparent h-100"
:class="blockClass"
>
<div

View File

@ -22,6 +22,7 @@ export default {
blockClass () {
return [
'block',
{ border: this.block.style.border.enabled },
this.block.kind,
]
},

View File

@ -9,9 +9,14 @@ interface PageBlockStyleWrap {
kind: string;
}
interface PageBlockStyleBorder {
enabled?: boolean;
}
interface PageBlockStyle {
variants: PageBlockStyleVariants;
wrap?: PageBlockStyleWrap;
border?: PageBlockStyleBorder;
}
export type PageBlockInput = PageBlock | Partial<PageBlock>
@ -36,6 +41,9 @@ export class PageBlock {
wrap: {
kind: 'card',
},
border: {
enabled: false,
},
}
constructor (i?: PageBlockInput) {

View File

@ -125,6 +125,8 @@ general:
show: Show refresh button
description: Setting value to 5 seconds or more enables auto-refresh
rate: seconds
border:
show: Show border
label:
add: Add
back: Back

View File

@ -71,8 +71,9 @@ type (
}
PageBlockStyle struct {
Variants map[string]string `json:"variants,omitempty"`
Wrap map[string]string `json:"wrap,omitempty"`
Variants map[string]string `json:"variants,omitempty"`
Wrap map[string]string `json:"wrap,omitempty"`
Border map[string]interface{} `json:"border,omitempty"`
}
PageButton struct {