@dataloop-ai/components 0.19.45 → 0.19.46

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": "@dataloop-ai/components",
3
- "version": "0.19.45",
3
+ "version": "0.19.46",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -132,6 +132,7 @@
132
132
  :key="col.name"
133
133
  :props="getHeaderScope({ col })"
134
134
  :col-index="colIndex"
135
+ :pagination="computedPagination"
135
136
  >
136
137
  <span class="inner-th">
137
138
  {{ col.label }}
@@ -480,6 +481,7 @@
480
481
  :key="col.name"
481
482
  :props="getHeaderScope({ col })"
482
483
  :col-index="colIndex"
484
+ :pagination="computedPagination"
483
485
  @click="onThClick($event, col.name)"
484
486
  >
485
487
  <span class="inner-th">
@@ -1925,7 +1927,8 @@ export default defineComponent({
1925
1927
  computedVisibleCols,
1926
1928
  totalItemsCount,
1927
1929
  showRowActions,
1928
- tableRef
1930
+ tableRef,
1931
+ computedPagination
1929
1932
  }
1930
1933
  }
1931
1934
  })
@@ -9,7 +9,7 @@
9
9
  <dl-icon
10
10
  v-if="isSortable && align === 'right'"
11
11
  :class="iconClass"
12
- icon="icon-dl-arrow-up"
12
+ :icon="computedSortIcon"
13
13
  />
14
14
  <dl-tooltip v-if="hasEllipsis">
15
15
  <slot />
@@ -33,7 +33,7 @@
33
33
  v-if="isSortable && ['left', 'center'].includes(align)"
34
34
  style="margin-top: 2px"
35
35
  :class="iconClass"
36
- icon="icon-dl-arrow-up"
36
+ :icon="computedSortIcon"
37
37
  />
38
38
  </span>
39
39
  </th>
@@ -41,13 +41,7 @@
41
41
 
42
42
  <script lang="ts">
43
43
  import { isString } from 'lodash'
44
- import {
45
- defineComponent,
46
- getCurrentInstance,
47
- computed,
48
- ref,
49
- toRefs
50
- } from 'vue-demi'
44
+ import { defineComponent, getCurrentInstance, computed, ref } from 'vue-demi'
51
45
  import { useSizeObserver } from '../../../../hooks/use-size-observer'
52
46
  import { stringStyleToRecord } from '../../../../utils'
53
47
  import { DlIcon } from '../../../essential'
@@ -65,6 +59,10 @@ export default defineComponent({
65
59
  colIndex: {
66
60
  type: Number,
67
61
  default: null
62
+ },
63
+ pagination: {
64
+ type: Object,
65
+ default: () => ({})
68
66
  }
69
67
  },
70
68
  emits: ['click'],
@@ -79,6 +77,13 @@ export default defineComponent({
79
77
  emit('click', event, name)
80
78
  }
81
79
 
80
+ const computedSortIcon = computed(() => {
81
+ if (props.props?.col?.name !== props.pagination.sortBy) return ''
82
+ return props.pagination.descending
83
+ ? 'icon-dl-arrowdown'
84
+ : 'icon-dl-arrow-up'
85
+ })
86
+
82
87
  const hasOptionalProps = computed(() => {
83
88
  return !!Object.keys(props.props ?? {})
84
89
  })
@@ -163,7 +168,8 @@ export default defineComponent({
163
168
  tableTh,
164
169
  hasEllipsis,
165
170
  onClick,
166
- column
171
+ column,
172
+ computedSortIcon
167
173
  }
168
174
  }
169
175
  })