mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Created Folder For SearchInput And Changed Paths
This commit is contained in:
parent
79596ab375
commit
6b68e18be6
@ -37,25 +37,7 @@
|
||||
@click.capture.native="isOpen = true"
|
||||
>
|
||||
<template slot="option" slot-scope="{ option }">
|
||||
<ds-flex v-if="option.heading" class="search-option-heading">
|
||||
<ds-flex-item>
|
||||
<ds-heading soft size="h5">{{ option.heading }}</ds-heading>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
<ds-flex v-else-if="option.searchType === 'Users'">
|
||||
<ds-flex-item class="search-option">
|
||||
<ds-avatar class="avatar" name="option.name" image="option.avatar" />
|
||||
<div>
|
||||
<ds-text class="userinfo">
|
||||
<b class="username">{{ option.label | truncate(70) }}</b>
|
||||
</ds-text>
|
||||
</div>
|
||||
<ds-text align="left" size="small" color="soft">
|
||||
@{{ option.slug | truncate(70) }}
|
||||
</ds-text>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
<ds-flex v-else>
|
||||
<ds-flex>
|
||||
<ds-flex-item class="search-option-label">
|
||||
<ds-text>{{ option.label | truncate(70) }}</ds-text>
|
||||
</ds-flex-item>
|
||||
@ -76,8 +58,7 @@
|
||||
<ds-flex-item>
|
||||
<ds-text size="small" color="softer" align="right">
|
||||
{{ option.author.name | truncate(32) }} -
|
||||
{{ option.createdAt }}
|
||||
<!-- removed | dateTime('dd.MM.yyyy') -->
|
||||
{{ option.createdAt | dateTime('dd.MM.yyyy') }}
|
||||
</ds-text>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
@ -91,9 +72,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isEmpty } from 'lodash'
|
||||
import { isEmpty } from 'lodash'
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'SearchInput',
|
||||
props: {
|
||||
id: {
|
||||
@ -155,7 +136,6 @@
|
||||
},
|
||||
onSelect(item) {
|
||||
this.isOpen = false
|
||||
console.log('onSelect', item)
|
||||
this.$emit('select', item)
|
||||
this.$nextTick(() => {
|
||||
this.searchValue = this.lastSearchTerm
|
||||
@ -183,7 +163,7 @@
|
||||
}
|
||||
},
|
||||
/**
|
||||
* TODO: on enter we should go to a dedicated search page!?
|
||||
* TODO: on enter we should go to a dedicated seach page!?
|
||||
*/
|
||||
onEnter(e) {
|
||||
// this.isOpen = false
|
||||
@ -202,11 +182,11 @@
|
||||
this.searchValue = ''
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.search {
|
||||
.search {
|
||||
display: flex;
|
||||
align-self: center;
|
||||
width: 100%;
|
||||
@ -284,43 +264,5 @@
|
||||
.control {
|
||||
width: 100%;
|
||||
}
|
||||
.search-option-heading {
|
||||
font-weight: bold;
|
||||
cursor: default;
|
||||
background-color:white;
|
||||
padding: 0;
|
||||
}
|
||||
.avatar {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
margin-right: 4px;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.userinfo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
> .ds-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: $space-xx-small;
|
||||
}
|
||||
}
|
||||
.user {
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&:hover,
|
||||
&.active {
|
||||
z-index: 999;
|
||||
}
|
||||
}
|
||||
.username {
|
||||
color: #17b53f;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user