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