@tripup-company/element-ui-extended 0.0.14 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tripup-company/element-ui-extended",
3
- "version": "0.0.14",
3
+ "version": "0.0.18",
4
4
  "main": "./dist/element-ui-extended.umd.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -3,7 +3,12 @@
3
3
  <slot>
4
4
  <el-row :gutter="20">
5
5
  <el-col :span="filters.length ? 18 : 24">
6
- <slot name="quick-search-filter" v-bind="{ topFilter, search }">
6
+ <slot
7
+ name="quick-search-filter"
8
+ v-bind="{ topFilter, search }"
9
+ :handleApplyTopFilter="handleApplyTopFilter"
10
+ :handleResetTopFilter="handleResetTopFilter"
11
+ >
7
12
  <quick-search-filter
8
13
  v-if="topFilter"
9
14
  :filter="topFilter"
@@ -12,7 +17,11 @@
12
17
  @reset:filter="handleResetTopFilter"
13
18
  />
14
19
  </slot>
15
- <slot name="table" v-bind="{ fields, data }">
20
+ <slot
21
+ name="table"
22
+ v-bind="{ fields, data }"
23
+ :handleChangeSort="handleChangeSort"
24
+ >
16
25
  <generic-table
17
26
  :fields="fields"
18
27
  :data="data"
@@ -34,7 +43,12 @@
34
43
  </el-row>
35
44
  </el-col>
36
45
  <el-col :span="filters.length ? 6 : 0">
37
- <slot name="filter" v-bind="{ filters, search }">
46
+ <slot
47
+ name="filter"
48
+ v-bind="{ filters, search }"
49
+ :handleApplyFilter="handleApplyFilter"
50
+ :handleResetFilter="handleResetFilter"
51
+ >
38
52
  <generic-filter
39
53
  v-if="filters.length"
40
54
  :filters="filters"
@@ -55,7 +69,7 @@ import GenericFilter from "../GenericFilters/index";
55
69
  import GenericPaginator from "../GenericPaginator";
56
70
  import GenericTable from "@/components/GenericTable";
57
71
  import ListQueryService from "@/services/list-query-service";
58
- import { LocalStorageService } from "@/services/local-storage-service";
72
+ import LocalStorageService from "@/services/local-storage-service";
59
73
  import MetaModel from "@/models/meta-model";
60
74
  import QuickSearchFilter from "@/components/GenericFilters/QuickSearchFilter";
61
75
  import FilterConverter from "../GenericFilters/filter-convertor";
@@ -216,8 +230,9 @@ export default {
216
230
  handleFilterChange() {
217
231
  this.handleCurrentChange(1);
218
232
  },
219
- handleApplyFilter() {
220
- this.listQueryService.updateListQuery({ search: this.search });
233
+ handleApplyFilter(val) {
234
+ Vue.set(this, "search", val);
235
+ this.listQueryService.updateListQuery({ search: val });
221
236
  this.handleFilterChange();
222
237
  },
223
238
  handleResetFilter() {
@@ -230,8 +245,9 @@ export default {
230
245
  this.listQueryService.updateListQuery({ search: {} });
231
246
  this.handleFilterChange({});
232
247
  },
233
- handleApplyTopFilter() {
234
- this.listQueryService.updateListQuery({ topSearch: this.topSearch });
248
+ handleApplyTopFilter(val) {
249
+ Vue.set(this, "topSearch", val);
250
+ this.listQueryService.updateListQuery({ topSearch: val });
235
251
  this.handleFilterChange();
236
252
  },
237
253
  handleResetTopFilter() {
@@ -32,7 +32,7 @@ export default {
32
32
  },
33
33
  methods: {
34
34
  applyFilter() {
35
- this.$emit("apply:filter");
35
+ this.$emit("apply:filter", this.search);
36
36
  },
37
37
  resetFilter() {
38
38
  this.$emit("reset:filter");
@@ -35,11 +35,8 @@ name: "GenericFilter",
35
35
  };
36
36
  },
37
37
  methods: {
38
- getFilter() {
39
- return this.filterConvertor.applyFilter(this.search);
40
- },
41
38
  applyFilter() {
42
- this.$emit('apply:filter', this.filterConvertor.applyFilter(this.search) );
39
+ this.$emit('apply:filter', this.search);
43
40
  },
44
41
  resetFilter() {
45
42
  this.$emit('reset:filter', {});
@@ -25,7 +25,8 @@ export default class ListQueryService {
25
25
  meta: {
26
26
  page: 1,
27
27
  limit: 10,
28
- }
28
+ },
29
+ search: {},
29
30
  };
30
31
  listQuery = Object.assign(listQuery, this.storageService.get(this.key));
31
32
  return listQuery;
@@ -1,4 +1,4 @@
1
- export class LocalStorageService {
1
+ export default class LocalStorageService {
2
2
  key: string | undefined;
3
3
  constructor(key = '') {
4
4
  this.key = key;