blob: c385740b5ff2a2a862e9fe5ebb25123bd889891b [file] [log] [blame]
SurenNeware71724be2020-06-01 15:31:00 +05301<template>
2 <div class="search-global">
3 <b-form-group
4 :label="$t('global.form.search')"
5 label-for="searchInput"
6 label-sr-only
7 class="mb-2"
8 >
9 <b-input-group size="md" class="align-items-center">
10 <b-input-group-prepend>
11 <icon-search class="search-icon" />
12 </b-input-group-prepend>
13 <b-form-input
14 id="searchInput"
15 v-model="filter"
16 type="text"
17 :placeholder="placeholder"
18 @input="onChangeInput"
19 ></b-form-input>
20 </b-input-group>
21 </b-form-group>
22 </div>
23</template>
24
25<script>
26import IconSearch from '@carbon/icons-vue/es/search/16';
27export default {
28 name: 'Search',
29 components: { IconSearch },
30 props: {
31 placeholder: {
32 type: String,
Yoshie Muranaka83458ae2020-06-18 14:01:57 -070033 default: function() {
SurenNeware71724be2020-06-01 15:31:00 +053034 return this.$t('global.form.search');
35 }
36 }
37 },
38 data() {
39 return {
40 filter: null
41 };
42 },
43 methods: {
44 onChangeInput() {
45 this.$emit('changeSearch', this.filter);
46 }
47 }
48};
49</script>
50
51<style lang="scss" scoped>
52@import 'src/assets/styles/helpers';
53
54#searchInput {
55 padding-left: ($spacer * 2);
56}
57.search-icon {
58 position: absolute;
59 left: 10px;
60 top: 12px;
61 z-index: 4;
Yoshie Muranaka01da8182020-07-08 15:46:43 -070062 stroke: gray('400');
SurenNeware71724be2020-06-01 15:31:00 +053063}
64</style>