@webitel/ui-sdk 25.10.49 → 25.10.50
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/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +4133 -4120
- package/dist/ui-sdk.umd.cjs +150 -150
- package/package.json +1 -1
- package/src/components/wt-table/wt-table.vue +30 -0
- package/types/components/wt-table/wt-table.vue.d.ts +16 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "25.10.
|
|
3
|
+
"version": "25.10.50",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"make-all": "npm version patch --git-tag-version false && npm run build && (npm run build:types || true) && (npm run lint:fix || true) && npm run publish-lib",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
lazy
|
|
15
15
|
scroll-height="flex"
|
|
16
16
|
scrollable
|
|
17
|
+
:virtual-scroller-options="virtualScroll"
|
|
17
18
|
@sort="sort"
|
|
18
19
|
@update:expanded-rows="expandedRows = $event"
|
|
19
20
|
@column-resize-end="columnResize"
|
|
@@ -202,12 +203,22 @@
|
|
|
202
203
|
|
|
203
204
|
<script lang="ts" setup>
|
|
204
205
|
import type { DataTableProps } from 'primevue';
|
|
206
|
+
import { VirtualScrollerLazyEvent } from 'primevue/virtualscroller';
|
|
205
207
|
import { computed, defineProps, ref, useSlots,useTemplateRef, withDefaults } from 'vue';
|
|
206
208
|
import { useI18n } from 'vue-i18n';
|
|
207
209
|
|
|
208
210
|
import { getNextSortOrder } from '../../scripts/sortQueryAdapters.js';
|
|
209
211
|
import type { WtTableHeader } from './types/WtTable';
|
|
210
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Number of items to render outside the visible area for virtual scrolling.
|
|
215
|
+
* This helps maintain smooth scrolling performance by pre-rendering items
|
|
216
|
+
* that are about to come into view, reducing the chance of blank spaces
|
|
217
|
+
* during fast scrolling.
|
|
218
|
+
*/
|
|
219
|
+
const VIRTUAL_SCROLL_TOLERATED_ITEMS = 10;
|
|
220
|
+
const DEFAULT_ITEM_SIZE = 40;
|
|
221
|
+
|
|
211
222
|
interface Props extends DataTableProps{
|
|
212
223
|
/**
|
|
213
224
|
* 'Accepts list of header objects. Draws text depending on "text" property, looks for data values through "value", "show" boolean controls visibility of a column (if undefined, all visible by default). ' Column width is calculated by "width" param. By default, sets 140px. '
|
|
@@ -252,6 +263,12 @@ interface Props extends DataTableProps{
|
|
|
252
263
|
resizableColumns?: boolean
|
|
253
264
|
reorderableColumns?: boolean
|
|
254
265
|
rowExpansionDisabled?: (row: object) => boolean;
|
|
266
|
+
|
|
267
|
+
//lazy loading
|
|
268
|
+
lazy?: boolean;
|
|
269
|
+
onLoading?: (event: VirtualScrollerLazyEvent) => Promise<any>;
|
|
270
|
+
loading?: boolean;
|
|
271
|
+
itemSize?: number | undefined;
|
|
255
272
|
}
|
|
256
273
|
|
|
257
274
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -270,6 +287,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
270
287
|
resizableColumns: false,
|
|
271
288
|
reorderableColumns: false,
|
|
272
289
|
rowExpansionDisabled: () => false,
|
|
290
|
+
lazy: false,
|
|
291
|
+
itemSize: DEFAULT_ITEM_SIZE
|
|
273
292
|
});
|
|
274
293
|
|
|
275
294
|
const { t } = useI18n();
|
|
@@ -417,6 +436,17 @@ const toggleRow = (row) => {
|
|
|
417
436
|
expandedRows.value.push(row);
|
|
418
437
|
}
|
|
419
438
|
};
|
|
439
|
+
|
|
440
|
+
const virtualScroll = computed(() => {
|
|
441
|
+
if (!props.lazy) return;
|
|
442
|
+
|
|
443
|
+
return {
|
|
444
|
+
lazy: props.lazy,
|
|
445
|
+
onLazyLoad: props.onLoading,
|
|
446
|
+
itemSize: props.itemSize, // The height/width of item according to orientation
|
|
447
|
+
numToleratedItems: VIRTUAL_SCROLL_TOLERATED_ITEMS, // Number of items to pre-render outside visible area
|
|
448
|
+
};
|
|
449
|
+
});
|
|
420
450
|
</script>
|
|
421
451
|
|
|
422
452
|
<style lang="scss">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DataTableProps } from 'primevue';
|
|
2
2
|
import type { WtTableHeader } from './types/WtTable';
|
|
3
|
+
import { VirtualScrollerLazyEvent } from 'primevue/virtualscroller';
|
|
3
4
|
interface Props extends DataTableProps {
|
|
4
5
|
/**
|
|
5
6
|
* 'Accepts list of header objects. Draws text depending on "text" property, looks for data values through "value", "show" boolean controls visibility of a column (if undefined, all visible by default). ' Column width is calculated by "width" param. By default, sets 140px. '
|
|
@@ -46,6 +47,10 @@ interface Props extends DataTableProps {
|
|
|
46
47
|
resizableColumns?: boolean;
|
|
47
48
|
reorderableColumns?: boolean;
|
|
48
49
|
rowExpansionDisabled?: (row: object) => boolean;
|
|
50
|
+
lazy?: boolean;
|
|
51
|
+
onLoading?: (event: VirtualScrollerLazyEvent) => Promise<any>;
|
|
52
|
+
loading?: boolean;
|
|
53
|
+
itemSize?: number | undefined;
|
|
49
54
|
}
|
|
50
55
|
declare const emit: (event: "sort" | "update:selected" | "reorder:row" | "column-resize" | "column-reorder", ...args: any[]) => void;
|
|
51
56
|
declare const tableKey: import("vue").Ref<number, number>;
|
|
@@ -73,6 +78,12 @@ declare const columnResize: ({ element }: {
|
|
|
73
78
|
declare const columnReorder: () => void;
|
|
74
79
|
declare const isRowExpanded: (row: any) => boolean;
|
|
75
80
|
declare const toggleRow: (row: any) => void;
|
|
81
|
+
declare const virtualScroll: import("vue").ComputedRef<{
|
|
82
|
+
lazy: true;
|
|
83
|
+
onLazyLoad: (event: VirtualScrollerLazyEvent) => Promise<any>;
|
|
84
|
+
itemSize: number;
|
|
85
|
+
numToleratedItems: number;
|
|
86
|
+
}>;
|
|
76
87
|
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
77
88
|
declare var __VLS_68: string, __VLS_69: {
|
|
78
89
|
index: any;
|
|
@@ -115,6 +126,7 @@ declare const __VLS_self: import("vue").DefineComponent<Props, {
|
|
|
115
126
|
columnReorder: typeof columnReorder;
|
|
116
127
|
isRowExpanded: typeof isRowExpanded;
|
|
117
128
|
toggleRow: typeof toggleRow;
|
|
129
|
+
virtualScroll: typeof virtualScroll;
|
|
118
130
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
119
131
|
sort: (...args: any[]) => void;
|
|
120
132
|
"update:selected": (...args: any[]) => void;
|
|
@@ -130,6 +142,7 @@ declare const __VLS_self: import("vue").DefineComponent<Props, {
|
|
|
130
142
|
}>, {
|
|
131
143
|
headers: WtTableHeader[];
|
|
132
144
|
data: Array<unknown>;
|
|
145
|
+
lazy: boolean;
|
|
133
146
|
sortable: boolean;
|
|
134
147
|
selectable: boolean;
|
|
135
148
|
gridActions: boolean;
|
|
@@ -145,6 +158,7 @@ declare const __VLS_self: import("vue").DefineComponent<Props, {
|
|
|
145
158
|
resizableColumns: boolean;
|
|
146
159
|
reorderableColumns: boolean;
|
|
147
160
|
rowExpansionDisabled: (row: object) => boolean;
|
|
161
|
+
itemSize: number | undefined;
|
|
148
162
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
149
163
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
150
164
|
sort: (...args: any[]) => void;
|
|
@@ -161,6 +175,7 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
|
|
|
161
175
|
}>, {
|
|
162
176
|
headers: WtTableHeader[];
|
|
163
177
|
data: Array<unknown>;
|
|
178
|
+
lazy: boolean;
|
|
164
179
|
sortable: boolean;
|
|
165
180
|
selectable: boolean;
|
|
166
181
|
gridActions: boolean;
|
|
@@ -176,6 +191,7 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
|
|
|
176
191
|
resizableColumns: boolean;
|
|
177
192
|
reorderableColumns: boolean;
|
|
178
193
|
rowExpansionDisabled: (row: object) => boolean;
|
|
194
|
+
itemSize: number | undefined;
|
|
179
195
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
180
196
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
181
197
|
export default _default;
|