@tripup-company/element-ui-extended 0.0.78 → 0.0.81

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.
@@ -1 +1 @@
1
- {"version":3,"file":"filter-convertor.d.ts","sourceRoot":"","sources":["../../../../src/components/GenericFilters/filter-convertor.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,eAAe;IAGlC,WAAW,CAAC,MAAM,KAAA;;;;CAkBnB"}
1
+ {"version":3,"file":"filter-convertor.d.ts","sourceRoot":"","sources":["../../../../src/components/GenericFilters/filter-convertor.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,eAAe;IAGlC,WAAW,CAAC,MAAM,KAAA;;;;CAqBnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tripup-company/element-ui-extended",
3
- "version": "0.0.78",
3
+ "version": "0.0.81",
4
4
  "main": "./dist/element-ui-extended.umd.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve && tsc --emitDeclarationOnly",
@@ -2,12 +2,24 @@
2
2
  <div v-loading="loading" class="composite-table">
3
3
  <slot>
4
4
  <el-row :gutter="20">
5
- <el-col :span="filters.length ? 18 : 24">
5
+ <el-col :span="filters.length && showRightFilter ? 18 : 24">
6
+ <slot
7
+ v-if="showTopFilter"
8
+ v-bind="{ filters, search, handleApplyFilter, handleResetFilter }"
9
+ name="top-filter"
10
+ >
11
+ <generic-filter
12
+ :filters="filters"
13
+ :search="search"
14
+ @apply:filter="handleApplyFilter"
15
+ @reset:filter="handleResetFilter"
16
+ />
17
+ </slot>
6
18
  <slot
7
19
  name="quick-search-filter"
8
20
  v-bind="{
9
21
  topFilter,
10
- search,
22
+ topSearch,
11
23
  handleApplyTopFilter,
12
24
  handleResetTopFilter,
13
25
  }"
@@ -43,6 +55,7 @@
43
55
  </el-col>
44
56
  <el-col :span="filters.length ? 6 : 0">
45
57
  <slot
58
+ v-if="showRightFilter"
46
59
  name="filter"
47
60
  v-bind="{ filters, search, handleApplyFilter, handleResetFilter }"
48
61
  >
@@ -79,6 +92,14 @@ export default {
79
92
  },
80
93
  name: "CompositeTable",
81
94
  props: {
95
+ showTopFilter: {
96
+ default: false,
97
+ type: Boolean,
98
+ },
99
+ showRightFilter: {
100
+ default: true,
101
+ type: Boolean,
102
+ },
82
103
  repository: {
83
104
  default() {
84
105
  return {};
@@ -115,6 +136,10 @@ export default {
115
136
  default: "storage.key",
116
137
  type: String,
117
138
  },
139
+ filterConvertor: {
140
+ default: () => new FilterConverter(),
141
+ type: Object,
142
+ },
118
143
  },
119
144
  data: function () {
120
145
  const localStorage = new LocalStorageService(this.storageKey);
@@ -123,7 +148,6 @@ export default {
123
148
  localStorage
124
149
  );
125
150
  let listQueryObj = listQueryService.getListQuery();
126
- const filterConvertor = new FilterConverter();
127
151
  let search = {};
128
152
  let topSearch = {};
129
153
  for (const column of this.filters) {
@@ -140,16 +164,13 @@ export default {
140
164
  }
141
165
 
142
166
  search = Object.assign(search, listQueryObj.search);
143
- topSearch = Object.assign(
144
- topSearch,
145
- listQueryObj.topSearch
146
- );
167
+ topSearch = Object.assign(topSearch, listQueryObj.topSearch);
147
168
  let sort = {};
148
169
  if (listQueryObj.orderBy) {
149
- sort = Object.assign(sort, {orderBy: listQueryObj.orderBy})
170
+ sort = Object.assign(sort, { orderBy: listQueryObj.orderBy });
150
171
  }
151
172
  if (listQueryObj.sortedBy) {
152
- sort = Object.assign(sort, {sortedBy: listQueryObj.sortedBy})
173
+ sort = Object.assign(sort, { sortedBy: listQueryObj.sortedBy });
153
174
  }
154
175
  return {
155
176
  loading: false,
@@ -157,7 +178,6 @@ export default {
157
178
  data: [],
158
179
  search: search,
159
180
  topSearch: topSearch,
160
- filterConvertor: filterConvertor,
161
181
  meta: listQueryService.getListQuery().meta,
162
182
  metaModel: new MetaModel(),
163
183
  listQueryService: listQueryService,
@@ -192,7 +192,7 @@ export default {
192
192
  return {
193
193
  isEditMode: false,
194
194
  model: "",
195
- selectListLocal: [],
195
+ selectListLocal: this.selectList,
196
196
  };
197
197
  },
198
198
  computed: {
@@ -215,9 +215,6 @@ export default {
215
215
  },
216
216
  },
217
217
  },
218
- mounted() {
219
- this.selectListLocal = this.selectList;
220
- },
221
218
  methods: {
222
219
  createList() {
223
220
  let label = "";
@@ -12,7 +12,14 @@
12
12
  :sortable="field.sortable ? field.sortable : null"
13
13
  >
14
14
  <el-link
15
- @click="field.callback(field.prop, context.$index, context.row)"
15
+ :href="
16
+ field.href
17
+ ? typeof field.href === 'function'
18
+ ? field.href(field.prop, context.$index, context.row)
19
+ : field.href
20
+ : '#'
21
+ "
22
+ @click.prevent="field.callback(field.prop, context.$index, context.row)"
16
23
  >
17
24
  {{
18
25
  typeof field.formatter === "function"