blob: 9ebf46809473980e4c3ed4ed97a45c23099af605 [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')"
Yoshie Muranaka129d79b2020-07-02 16:04:18 -07005 :label-for="`searchInput-${_uid}`"
SurenNeware71724be2020-06-01 15:31:00 +05306 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
Yoshie Muranaka129d79b2020-07-02 16:04:18 -070014 :id="`searchInput-${_uid}`"
SurenNeware71724be2020-06-01 15:31:00 +053015 v-model="filter"
Yoshie Muranaka129d79b2020-07-02 16:04:18 -070016 class="search-input"
SurenNeware71724be2020-06-01 15:31:00 +053017 type="text"
18 :placeholder="placeholder"
19 @input="onChangeInput"
20 ></b-form-input>
21 </b-input-group>
22 </b-form-group>
23 </div>
24</template>
25
26<script>
27import IconSearch from '@carbon/icons-vue/es/search/16';
28export default {
29 name: 'Search',
30 components: { IconSearch },
31 props: {
32 placeholder: {
33 type: String,
Yoshie Muranaka83458ae2020-06-18 14:01:57 -070034 default: function() {
SurenNeware71724be2020-06-01 15:31:00 +053035 return this.$t('global.form.search');
36 }
37 }
38 },
39 data() {
40 return {
41 filter: null
42 };
43 },
44 methods: {
45 onChangeInput() {
46 this.$emit('changeSearch', this.filter);
47 }
48 }
49};
50</script>
51
52<style lang="scss" scoped>
Yoshie Muranaka129d79b2020-07-02 16:04:18 -070053.search-input {
SurenNeware71724be2020-06-01 15:31:00 +053054 padding-left: ($spacer * 2);
55}
56.search-icon {
57 position: absolute;
58 left: 10px;
59 top: 12px;
60 z-index: 4;
Yoshie Muranaka01da8182020-07-08 15:46:43 -070061 stroke: gray('400');
SurenNeware71724be2020-06-01 15:31:00 +053062}
63</style>