lkt-table 2.0.44 → 2.0.45

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": "lkt-table",
3
- "version": "2.0.44",
3
+ "version": "2.0.45",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lkt",
@@ -6,18 +6,26 @@ import {computed, nextTick, onMounted, ref, useSlots, watch} from "vue";
6
6
  import {
7
7
  AccordionConfig,
8
8
  ButtonConfig,
9
- ButtonType, CalendarConfig, CalendarEventConfig, CalendarItemConfig, ClickEventArgs,
10
- Column, ColumnConfig,
9
+ ButtonType,
10
+ CalendarConfig,
11
+ CalendarItemConfig,
12
+ ClickEventArgs,
13
+ Column,
14
+ ColumnConfig,
11
15
  ensureButtonConfig,
12
16
  extractI18nValue,
13
- getDefaultValues, HeaderConfig, ItemSlotComponentConfig,
17
+ getDefaultValues,
18
+ HeaderConfig,
19
+ ItemSlotComponentConfig,
14
20
  LktObject,
15
21
  LktSettings,
22
+ PaginatorConfig,
16
23
  PaginatorType,
17
24
  SortDirection,
18
25
  Table,
19
26
  TableConfig,
20
- TablePermission, TableRowType,
27
+ TablePermission,
28
+ TableRowType,
21
29
  TableType
22
30
  } from "lkt-vue-kernel";
23
31
  import {generateRandomString, replaceAll} from "lkt-string-tools";
@@ -26,7 +34,7 @@ import {HTTPResponse} from "lkt-http-client";
26
34
  import CreateButton from "../components/CreateButton.vue";
27
35
  import Sortable from 'sortablejs';
28
36
  import TableHeader from "../components/TableHeader.vue";
29
- import {date, time} from "lkt-date-tools";
37
+ import {date, findOldestAndNewestDateInObjects, time} from "lkt-date-tools";
30
38
  import {Settings} from "../settings/Settings";
31
39
  import LktTableCell from "../components/LktTableCell.vue";
32
40
 
@@ -71,7 +79,10 @@ const Page = ref(props.paginator?.modelValue),
71
79
  updateTimeStamp = ref(0),
72
80
  sortableContainer = ref(<HTMLElement | null>null),
73
81
  activeType = ref(props.type),
74
- currentSlide = ref(props.carousel?.currentSlide || 0)
82
+ currentSlide = ref(props.carousel?.currentSlide || 0),
83
+ timelineOldestDate = ref(<Date|undefined>undefined),
84
+ timelineNewestDate = ref(<Date|undefined>undefined),
85
+ timelineVisibleDate = ref(<Date|undefined>undefined)
75
86
  ;
76
87
 
77
88
  const safeSaveButton = ref(ensureButtonConfig(props.saveButton, LktSettings.defaultSaveButton)),
@@ -99,6 +110,12 @@ const onPerms = (r: string[]) => {
99
110
  rawItems = props.events.parseResults(rawItems);
100
111
  }
101
112
  Items.value = [...Items.value, ...rawItems];
113
+
114
+ if ([PaginatorType.TimelineAsc, PaginatorType.TimelineDesc, PaginatorType.TimelineAscDesc].includes(props.paginator?.type)) {
115
+ const dateRange = findOldestAndNewestDateInObjects(Items.value, props.paginator.dateKey);
116
+ timelineOldestDate.value = dateRange.oldest;
117
+ timelineNewestDate.value = dateRange.newest;
118
+ }
102
119
  }
103
120
  isLoading.value = false;
104
121
  firstLoadReady.value = true;
@@ -671,6 +688,8 @@ const calendarEvents = {
671
688
  if (typeof props.calendar.events?.visibleMonthChanged === 'function') {
672
689
  props.calendar.events.visibleMonthChanged(args);
673
690
  }
691
+
692
+ timelineVisibleDate.value = args.visibleDate;
674
693
  })
675
694
  }
676
695
 
@@ -1213,7 +1232,12 @@ const calendarEvents = {
1213
1232
  <lkt-paginator
1214
1233
  ref="paginatorRef"
1215
1234
  v-if="paginator && Object.keys(paginator).length > 0"
1216
- v-bind="paginator"
1235
+ v-bind="<PaginatorConfig>{
1236
+ ...paginator,
1237
+ timelineOldestDate,
1238
+ timelineNewestDate,
1239
+ timelineVisibleDate,
1240
+ }"
1217
1241
  v-model="Page"
1218
1242
  @loading="onLoading"
1219
1243
  @perms="onPerms"