@webitel/ui-sdk 2.1.25 → 2.1.26

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": "@webitel/ui-sdk",
3
- "version": "2.1.25",
3
+ "version": "2.1.26",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -6,6 +6,7 @@ const headers = [
6
6
  {
7
7
  text: 'heading 1',
8
8
  value: 'h1',
9
+ sort: null,
9
10
  },
10
11
  {
11
12
  text: 'heading2',
@@ -13,7 +13,7 @@
13
13
  v-for="(col, key) of dataHeaders"
14
14
  :key="key"
15
15
  :class="[
16
- {'wt-table__th--sortable': sortable},
16
+ {'wt-table__th--sortable': isColSortable(col)},
17
17
  `wt-table__th--sort-${col.sort}`,
18
18
  ]"
19
19
  class="wt-table__th"
@@ -146,10 +146,17 @@ export default {
146
146
 
147
147
  methods: {
148
148
  sort(col) {
149
+ if (!this.isColSortable(col)) return;
149
150
  const nextSort = getNextSortOrder(col.sort);
150
- if (this.sortable) this.$emit('sort', col, nextSort);
151
+ this.$emit('sort', col, nextSort);
152
+ },
153
+ isColSortable({ sort }) {
154
+ /* --sortable = sortable && col.sort === undefined cause there may be some columns we don't want to sort
155
+ strict check for === undefined is used because col.sort = null is sort order too (actualu, without sort)
156
+ so we need to check if this property is present
157
+ */
158
+ return this.sortable && sort !== undefined;
151
159
  },
152
-
153
160
  selectAll() {
154
161
  const { isAllSelected } = this;
155
162
  // eslint-disable-next-line no-param-reassign,no-return-assign