lkt-table 2.0.4 → 2.0.6

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.
@@ -33,24 +33,24 @@ declare const canItem: boolean;
33
33
  declare const onClick: ($event: any) => void, onShow: ($event: any, i: any) => void, classes: import("vue").ComputedRef<string>, hasNavButtonSlot: import("vue").ComputedRef<boolean>, navButtonSlot: import("vue").ComputedRef<string | import("vue").Component>, onClickUp: () => void, onClickDown: () => void, onClickDrop: () => void, onClickEdit: () => void;
34
34
  declare const canRenderDragIndicator: import("vue").ComputedRef<any>;
35
35
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
36
- declare var __VLS_26: `item-${number}`, __VLS_27: {
36
+ declare var __VLS_24: `item-${number}`, __VLS_25: {
37
37
  item: LktObject;
38
38
  index: number;
39
- }, __VLS_29: {
39
+ }, __VLS_27: {
40
40
  item: LktObject;
41
41
  index: number;
42
- }, __VLS_32: string, __VLS_33: {
42
+ }, __VLS_30: string, __VLS_31: {
43
43
  value: any;
44
44
  item: LktObject;
45
45
  column: Column;
46
46
  i: number;
47
47
  };
48
48
  type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
49
- [K in NonNullable<typeof __VLS_26>]?: (props: typeof __VLS_27) => any;
49
+ [K in NonNullable<typeof __VLS_24>]?: (props: typeof __VLS_25) => any;
50
50
  } & {
51
- [K in NonNullable<typeof __VLS_32>]?: (props: typeof __VLS_33) => any;
51
+ [K in NonNullable<typeof __VLS_30>]?: (props: typeof __VLS_31) => any;
52
52
  } & {
53
- item?: (props: typeof __VLS_29) => any;
53
+ item?: (props: typeof __VLS_27) => any;
54
54
  }>;
55
55
  declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
56
56
  canRenderColumn: typeof canRenderColumn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-table",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lkt",
@@ -53,13 +53,13 @@
53
53
  "lkt-button": "^2.0.7",
54
54
  "lkt-data-state": "^1.0.11",
55
55
  "lkt-date-tools": "^1.0.4",
56
- "lkt-field": "^0.0.34",
56
+ "lkt-field": "^1.0.0",
57
57
  "lkt-http-client": "^1.0.34",
58
58
  "lkt-i18n": "^1.0.6",
59
59
  "lkt-loader": "^1.2.0",
60
60
  "lkt-paginator": "^1.3.3",
61
- "lkt-string-tools": "^1.0.8",
62
- "lkt-vue-kernel": "^1.0.31",
61
+ "lkt-string-tools": "^1.1.0",
62
+ "lkt-vue-kernel": "^1.0.35",
63
63
  "vue": "^3.3",
64
64
  "vue-router": "^4.2.5"
65
65
  }
@@ -1,8 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import {getColumnClasses, getVerticalColSpan} from "../functions/table-functions";
3
- import {Column, LktObject} from "lkt-vue-kernel";
3
+ import {Column, extractI18nValue, LktObject, LktSettings, SortDirection} from "lkt-vue-kernel";
4
4
  import {computed} from "vue";
5
- import {__} from "lkt-i18n";
6
5
 
7
6
  const emit = defineEmits(['click']);
8
7
 
@@ -33,10 +32,16 @@ const computedColSpan = computed(() => {
33
32
  return '';
34
33
  }),
35
34
  computedLabel = computed(() => {
36
- if (props.column.label.startsWith('__:')) {
37
- return __(props.column.label.substring(3));
35
+ return extractI18nValue(props.column.label);
36
+ }),
37
+ computedSortableIcon = computed(() => {
38
+ if (!computedSortable.value) return '';
39
+ if (props.sortBy === props.column.key) {
40
+ if (props.sortDirection === SortDirection.Asc) return LktSettings.defaultTableSortAscIcon;
41
+ if (props.sortDirection === SortDirection.Desc) return LktSettings.defaultTableSortDescIcon;
42
+ return '';
38
43
  }
39
- return props.column.label;
44
+ return '';
40
45
  });
41
46
 
42
47
  const onClick = () => emit('click', props.column)
@@ -51,6 +56,6 @@ const onClick = () => emit('click', props.column)
51
56
  :class="getColumnClasses(column)"
52
57
  v-on:click="onClick"
53
58
  >
54
- <div>{{ computedLabel }}</div>
59
+ <div>{{ computedLabel }} <i v-if="computedSortableIcon" :class="computedSortableIcon"/> </div>
55
60
  </th>
56
61
  </template>
@@ -263,6 +263,7 @@ const getItemByEvent = (e: any) => {
263
263
  });
264
264
  SortingDirection.value = SortingDirection.value === SortDirection.Asc ? SortDirection.Desc : SortDirection.Asc;
265
265
  SortBy.value = column.key;
266
+ updateTimeStamp.value = time();
266
267
  emit('sort', [SortBy.value, SortingDirection.value]);
267
268
  }
268
269
  },
@@ -574,7 +575,7 @@ const hasEmptySlot = computed(() => {
574
575
  :sort-direction="SortingDirection"
575
576
  :amount-of-columns="columns.length"
576
577
  :items="Items"
577
- v-on:click="sort(column)"
578
+ @click="sort(column)"
578
579
  />
579
580
  </template>
580
581
  <th