Files
mixtape/zero.Backoffice.UI/app/components/ui-header-bar.vue
T

210 lines
4.1 KiB
Vue
Raw Normal View History

2020-04-06 23:48:28 +02:00
<template>
<div class="ui-header-bar">
2020-05-06 21:46:34 +02:00
<div class="ui-header-bar-inner">
<div class="ui-header-bar-main">
2021-03-20 09:54:16 +01:00
<ui-icon-button v-if="backButton" type="light onbg" @click="onBack" :size="15" />
<div class="ui-header-bar-main-title">
2020-09-02 16:22:02 +02:00
<slot name="title">
<h2 class="ui-header-bar-title" :class="{'is-empty': !title && titleEmpty}">
2021-09-14 12:32:20 +02:00
<template v-for="prefix in prefixes">
<span class="-minor -prefix" v-localize:html="prefix"></span>
<ui-icon class="-chevron" symbol="fth-chevron-right" :size="14" />
</template>
2020-09-02 16:22:02 +02:00
<span v-localize="title || titleEmpty"></span>
2021-03-21 15:14:29 +01:00
<span v-if="suffix" class="-minor -suffix" v-localize:html="suffix"></span>
2020-10-07 12:37:35 +02:00
<span v-if="count > 0" class="-minor -count">{{count}}</span>
2020-09-02 16:22:02 +02:00
</h2>
</slot>
2020-05-06 21:46:34 +02:00
<p v-if="description" class="ui-header-bar-description" v-localize="description"></p>
</div>
</div>
<div class="ui-header-bar-aside">
<slot></slot>
2021-12-23 08:38:01 +01:00
<ui-icon-button class="ui-header-bar-close" v-if="closeButton" @click="$emit('close')" icon="fth-x" title="@ui.close" />
2020-04-30 12:04:34 +02:00
</div>
2020-04-07 00:11:35 +02:00
</div>
2020-04-06 23:48:28 +02:00
</div>
</template>
<script>
export default {
name: 'uiHeaderBar',
2021-12-23 08:38:01 +01:00
emits: ['close'],
2020-04-06 23:48:28 +02:00
props: {
2020-10-15 14:10:04 +02:00
title: {
type: String
},
titleEmpty: {
type: String
},
prefix: {
2021-09-14 12:32:20 +02:00
type: [String, Array]
2020-10-15 14:10:04 +02:00
},
suffix: {
type: String
},
count: {
type: Number,
default: 0
},
description: {
type: String
},
backButton: {
type: Boolean,
default: false
},
closeButton: {
type: Boolean,
default: false
}
2020-04-06 23:48:28 +02:00
},
2021-09-14 12:32:20 +02:00
computed: {
prefixes()
{
let items = Array.isArray(this.prefix) ? this.prefix : [this.prefix];
return items.filter(x => !!x);
}
},
2020-10-15 14:10:04 +02:00
methods: {
onBack()
{
this.$router.go(-1);
}
2020-04-06 23:48:28 +02:00
}
}
</script>
<style lang="scss">
.ui-header-bar
{
width: 100%;
2021-09-12 13:00:07 +02:00
height: 90px;
2020-09-06 23:36:03 +02:00
padding: 0 var(--padding) 0; //10px;
2020-05-06 15:49:21 +02:00
& + .ui-blank-box, & + .ui-box, & + .ui-view-box
{
margin-top: 0;
}
& + .ui-view-box
{
padding-top: 0;
2020-05-06 15:49:21 +02:00
}
2020-09-06 23:36:03 +02:00
.app-tree &
{
2020-09-18 15:12:51 +02:00
margin-bottom: 8px;
2020-09-06 23:36:03 +02:00
}
2020-04-07 00:11:35 +02:00
}
2020-05-06 21:46:34 +02:00
.ui-header-bar-inner
{
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
2020-05-07 11:45:28 +02:00
/*max-width: 1104px;*/
2020-05-06 21:46:34 +02:00
}
2020-04-07 00:11:35 +02:00
.ui-header-bar-main
{
display: flex;
align-items: center;
height: 100%;
flex: 1 0 auto;
2020-04-07 00:11:35 +02:00
.ui-icon-button
{
2020-09-09 14:30:56 +02:00
margin-right: var(--padding-s);
2021-09-11 14:54:28 +02:00
//margin-top: -2px;
2020-04-07 00:11:35 +02:00
}
}
.ui-header-bar-main-title
{
flex: 1 0 auto;
}
2020-04-07 00:11:35 +02:00
.ui-header-bar-aside
{
display: flex;
align-items: center;
height: 100%;
flex-shrink: 0;
2020-09-09 14:30:56 +02:00
padding-left: var(--padding-s);
2020-04-07 12:28:47 +02:00
> * + *
{
2020-09-09 14:30:56 +02:00
margin-left: var(--padding-s);
2020-04-07 12:28:47 +02:00
}
2020-04-06 23:48:28 +02:00
}
.ui-header-bar-title
{
2020-04-10 15:47:29 +02:00
font-family: var(--font);
color: var(--color-text);
2020-04-06 23:48:28 +02:00
margin: 0;
2022-01-05 13:28:09 +01:00
font-size: var(--font-size-xl);
2021-03-16 13:57:52 +01:00
font-weight: 700;
2021-09-11 14:54:28 +02:00
display: flex;
align-items: center;
2020-04-08 15:16:05 +02:00
2020-05-26 16:04:11 +02:00
&.is-empty, .-minor
2020-04-08 15:16:05 +02:00
{
color: var(--color-text-dim);
2020-04-08 15:16:05 +02:00
font-weight: 400;
}
2020-10-07 12:37:35 +02:00
2021-09-11 14:54:28 +02:00
.-prefix
{
flex-shrink: 0;
}
2021-09-12 13:00:07 +02:00
.-chevron
{
color: var(--color-text-dim);
position: relative;
top: -1px;
margin: 0 var(--padding-xxs);
}
2020-10-07 12:37:35 +02:00
.-count
{
display: inline-block;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
2021-03-21 15:14:29 +01:00
background: var(--color-box);
2020-10-07 12:37:35 +02:00
//box-shadow: var(--shadow-short);
color: var(--color-text);
height: 22px;
line-height: 22px;
padding: 0 10px;
border-radius: 16px;
letter-spacing: .5px;
font-style: normal;
margin-left: 12px;
margin-top: 2px;
position: relative;
top: -1px;
}
2020-04-06 23:48:28 +02:00
}
2020-04-30 12:04:34 +02:00
.ui-header-bar-description
{
font-size: var(--font-size-s);
color: var(--color-text-dim);
2020-04-30 12:04:34 +02:00
margin: 2px 0 0;
}
2020-09-08 13:33:30 +02:00
.ui-header-bar-close
{
background: transparent !important;
}
2020-04-06 23:48:28 +02:00
</style>