Support configurable visibility of semantic model cards (#2144)

Closes #2143.

Only render model-card if `visible` computed property is `true`.
Hide divs in model-tabs which do not have a visible model-card.

Signed-off-by: Thomas Wunschel <thomas.wunschel@twistsolutions.de>
pull/2150/head
Thomas Wunschel 2023-10-29 14:39:48 +01:00 committed by GitHub
parent 4f331b5702
commit c2d071a9cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<template>
<f7-card expandable ref="card" class="model-card" :class="type + '-card'" :animate="$f7.data.themeOptions.expandableCardAnimation !== 'disabled'" card-tablet-fullscreen @card:opened="cardOpening" @card:closed="cardClosed">
<f7-card v-if="visible" expandable ref="card" class="model-card" :class="type + '-card'" :animate="$f7.data.themeOptions.expandableCardAnimation !== 'disabled'" card-tablet-fullscreen @card:opened="cardOpening" @card:closed="cardClosed">
<f7-card-content :padding="false">
<div :class="(!backgroundImageUrl) ? `bg-color-${color}` : undefined" :style="{ height: `calc(var(--f7-safe-area-top) + ${headerHeight})` }">
<f7-card-header :text-color="config.invertText ? 'black' : 'white'" class="display-block card-header" :style="{ height: `calc(var(--f7-safe-area-top) + ${headerHeight})` }">

View File

@ -1,5 +1,5 @@
<template>
<div class="disable-user-select">
<div class="disable-user-select model-tab">
<div v-for="(elements, idx) in groups" :key="idx">
<f7-block-title medium v-if="elements.length > 0 && elements[0].separator">
{{ elements[0].separator }}
@ -19,6 +19,8 @@
</template>
<style lang="stylus">
.model-tab > div:not(:has(.model-card))
display none
.model-cards-section
justify-content center