storj/web/satellite/src/components/common/VHeader.vue

65 lines
1.4 KiB
Vue
Raw Normal View History

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
<template>
<div class="header-container">
<div class="header-container__buttons-area">
<slot></slot>
</div>
<VSearch
ref="search"
:placeholder="placeholder"
:search="search"
/>
</div>
</template>
<script lang="ts">
2019-09-09 11:33:39 +01:00
import { Component, Prop, Vue } from 'vue-property-decorator';
import VSearch from '@/components/common/VSearch.vue';
2019-09-09 11:33:39 +01:00
declare type searchCallback = (search: string) => Promise<void>;
declare interface ClearSearch {
clearSearch(): void;
2019-09-09 11:33:39 +01:00
}
@Component({
components: {
VSearch,
},
2019-09-09 11:33:39 +01:00
})
export default class VHeader extends Vue {
2019-09-09 11:33:39 +01:00
@Prop({default: ''})
private readonly placeholder: string;
2019-09-09 11:33:39 +01:00
@Prop({default: () => ''})
private readonly search: searchCallback;
public $refs!: {
search: VSearch & ClearSearch;
2019-09-09 11:33:39 +01:00
};
public clearSearch(): void {
2019-09-09 11:33:39 +01:00
this.$refs.search.clearSearch();
}
2019-09-09 11:33:39 +01:00
}
</script>
<style scoped lang="scss">
.header-container {
width: 100%;
height: 85px;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
&__buttons-area {
width: auto;
display: flex;
align-items: center;
justify-content: space-between;
}
}
</style>