@webitel/ui-sdk 26.8.8 → 26.8.9

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.
@@ -1,4 +1,4 @@
1
- import "./components-DL68kJ6J.js";
1
+ import "./components-BEEq6Fvq.js";
2
2
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { l as t } from "./enums-De8CDKZ1.js";
4
4
  import { t as n } from "./wt-button-DwAda_g4.js";
@@ -1,4 +1,4 @@
1
- import { C as e, i as t } from "./components-DL68kJ6J.js";
1
+ import { C as e, i as t } from "./components-BEEq6Fvq.js";
2
2
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { t as r } from "./displayText-CtaxzaBz.js";
4
4
  import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, openBlock as d, renderList as f, renderSlot as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
@@ -1,5 +1,5 @@
1
1
  import { n as e, r as t } from "./clients-DqzkR0RW.js";
2
- import { n } from "./components-DL68kJ6J.js";
2
+ import { n } from "./components-BEEq6Fvq.js";
3
3
  import { t as r } from "./vue-i18n-Db_oYfO8.js";
4
4
  import { createBlock as i, createTextVNode as a, createVNode as o, defineComponent as s, inject as c, mergeProps as l, onMounted as u, openBlock as d, ref as f, resolveComponent as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
5
5
  //#endregion
@@ -4,7 +4,7 @@ import { n, t as r } from "./sortQueryAdapters-CyYXvnDN.js";
4
4
  import { t as i } from "./composables-DgOEWk-2.js";
5
5
  import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, createTextVNode as f, createVNode as p, defineComponent as m, nextTick as h, normalizeStyle as g, onMounted as _, onUnmounted as v, openBlock as y, ref as b, renderList as x, renderSlot as S, resolveComponent as C, resolveDirective as w, toDisplayString as T, useSlots as E, useTemplateRef as D, withCtx as O, withDirectives as k, withModifiers as A } from "vue";
6
6
  //#region src/components/wt-table/wt-table.vue?vue&type=script&setup=true&lang.ts
7
- var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-table__td__actions" }, N = 10, P = /*#__PURE__*/ e(/* @__PURE__ */ m({
7
+ var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-table__td__actions" }, N = /*#__PURE__*/ e(/* @__PURE__ */ m({
8
8
  __name: "wt-table",
9
9
  props: {
10
10
  headers: { default: () => [] },
@@ -145,85 +145,82 @@ var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-ta
145
145
  "column-reorder"
146
146
  ],
147
147
  setup(e, { emit: m }) {
148
- let P = e, { t: F } = t(), I = E(), L = m, R = D("table"), z = b(0), B = b([]), { addTableDragListener: V, removeTableDragListener: H } = i(R, P.reorderableColumns), U = [
148
+ let N = e, { t: P } = t(), F = E(), I = m, L = D("table"), R = b(0), z = b([]), { addTableDragListener: B, removeTableDragListener: V } = i(L, N.reorderableColumns), H = [
149
149
  "row-select",
150
150
  "row-reorder",
151
151
  "row-actions",
152
152
  "row-expander"
153
- ], W = o(() => P.selectable ? P.selected || P.data.filter((e) => e._isSelected) : []), G = o(() => P.headers.map((e) => !e.text && e.locale ? {
153
+ ], U = o(() => N.selectable ? N.selected || N.data.filter((e) => e._isSelected) : []), W = o(() => N.headers.map((e) => !e.text && e.locale ? {
154
154
  ...e,
155
- text: typeof e.locale == "string" ? F(e.locale) : F(...e.locale)
156
- } : e)), K = (e) => e.show === !1, q = (e) => {
157
- let t = e.width || "140px";
158
- return P.lazy ? { width: t } : { minWidth: t };
159
- }, J = o(() => Object.keys(I).some((e) => e.includes("-footer"))), Y = o(() => Object.keys(I).some((e) => e === "footer")), X = o(() => W.value.length === P.data.length && P.data.length > 0), Z = o(() => P.headers.find((e) => e.sort === r.ASC || e.sort === r.DESC)?.field ?? null), Q = ({ sortField: e }) => {
160
- let t = G.value.find((t) => t.field === e);
161
- if (!$(t)) return;
155
+ text: typeof e.locale == "string" ? P(e.locale) : P(...e.locale)
156
+ } : e)), G = (e) => e.show === !1, K = (e) => ({ minWidth: e.width || "140px" }), q = o(() => Object.keys(F).some((e) => e.includes("-footer"))), J = o(() => Object.keys(F).some((e) => e === "footer")), Y = o(() => U.value.length === N.data.length && N.data.length > 0), X = o(() => N.headers.find((e) => e.sort === r.ASC || e.sort === r.DESC)?.field ?? null), Z = ({ sortField: e }) => {
157
+ let t = W.value.find((t) => t.field === e);
158
+ if (!Q(t)) return;
162
159
  let r = n(t.sort);
163
- L("sort", t, r);
164
- }, $ = ({ sort: e }) => P.sortable && e !== void 0, ee = () => {
165
- P.selected ? X.value ? L("update:selected", []) : L("update:selected", [...P.data]) : X.value ? P.data.forEach((e) => {
160
+ I("sort", t, r);
161
+ }, Q = ({ sort: e }) => N.sortable && e !== void 0, $ = () => {
162
+ N.selected ? Y.value ? I("update:selected", []) : I("update:selected", [...N.data]) : Y.value ? N.data.forEach((e) => {
166
163
  e._isSelected = !1;
167
- }) : P.data.forEach((e) => {
164
+ }) : N.data.forEach((e) => {
168
165
  e._isSelected = !0;
169
166
  });
170
- }, te = (e, t) => {
171
- P.selected ? t ? L("update:selected", [...W.value, e]) : L("update:selected", W.value.filter((t) => t !== e)) : e._isSelected = !e._isSelected;
172
- }, ne = ({ element: e }) => {
167
+ }, ee = (e, t) => {
168
+ N.selected ? t ? I("update:selected", [...U.value, e]) : I("update:selected", U.value.filter((t) => t !== e)) : e._isSelected = !e._isSelected;
169
+ }, te = ({ element: e }) => {
173
170
  let t = e.getAttribute("data-column-field"), n = getComputedStyle(e), r = Number.parseFloat(n.paddingLeft), i = Number.parseFloat(n.paddingRight), a = e.offsetWidth - r - i;
174
- L("column-resize", {
171
+ I("column-resize", {
175
172
  columnName: t,
176
173
  columnWidth: `${a}px`
177
174
  });
178
- }, re = () => {
179
- let e = R.value.$el.querySelector(".p-datatable-table-container").scrollLeft, t = R.value.d_columnOrder.filter((e) => !U.includes(e));
180
- z.value += 1, L("column-reorder", t), h(() => {
181
- V(), R.value.$el.querySelector(".p-datatable-table-container").scrollLeft = e;
175
+ }, ne = () => {
176
+ let e = L.value.$el.querySelector(".p-datatable-table-container").scrollLeft, t = L.value.d_columnOrder.filter((e) => !H.includes(e));
177
+ R.value += 1, I("column-reorder", t), h(() => {
178
+ B(), L.value.$el.querySelector(".p-datatable-table-container").scrollLeft = e;
182
179
  });
183
- }, ie = (e) => B.value.some((t) => t?.id === e?.id), ae = (e) => {
184
- let t = B.value.findIndex((t) => t.id === e.id);
185
- t === -1 ? B.value.push(e) : B.value.splice(t, 1);
186
- }, oe = o(() => {
187
- if (P.lazy) return {
188
- lazy: P.lazy,
189
- onLazyLoad: P.onLoading,
190
- itemSize: P.itemSize,
191
- numToleratedItems: N,
192
- totalRecords: P.data.length,
180
+ }, re = (e) => z.value.some((t) => t?.id === e?.id), ie = (e) => {
181
+ let t = z.value.findIndex((t) => t.id === e.id);
182
+ t === -1 ? z.value.push(e) : z.value.splice(t, 1);
183
+ }, ae = o(() => {
184
+ if (N.lazy) return {
185
+ lazy: N.lazy,
186
+ onLazyLoad: N.onLoading,
187
+ itemSize: N.itemSize,
188
+ numToleratedItems: N.data.length,
189
+ totalRecords: N.data.length,
193
190
  autoSize: !0
194
191
  };
195
192
  });
196
193
  return _(() => {
197
- V();
194
+ B();
198
195
  }), v(() => {
199
- H();
196
+ V();
200
197
  }), (t, n) => {
201
198
  let r = C("wt-icon-btn"), i = C("p-column"), o = C("wt-icon"), m = C("wt-checkbox"), h = C("p-table"), _ = w("tooltip");
202
199
  return y(), s(h, {
203
- key: z.value,
200
+ key: R.value,
204
201
  ref_key: "table",
205
- ref: R,
206
- "expanded-rows": B.value,
202
+ ref: L,
203
+ "expanded-rows": z.value,
207
204
  "reorderable-columns": e.reorderableColumns,
208
205
  "resizable-columns": e.resizableColumns,
209
206
  "row-class": e.rowClass,
210
207
  "row-style": e.rowStyle,
211
208
  "show-headers": !e.headless,
212
209
  value: e.data,
213
- "sort-field": Z.value,
214
- "data-key": P.dataKey,
210
+ "sort-field": X.value,
211
+ "data-key": N.dataKey,
215
212
  class: "wt-table",
216
213
  "column-resize-mode": "expand",
217
214
  lazy: "",
218
215
  "scroll-height": "flex",
219
216
  scrollable: "",
220
- "virtual-scroller-options": oe.value,
217
+ "virtual-scroller-options": ae.value,
221
218
  pt: { tableContainer: "wt-scrollbar" },
222
- onSort: Q,
223
- "onUpdate:expandedRows": n[0] ||= (e) => B.value = e,
224
- onColumnResizeEnd: ne,
225
- onColumnReorder: re,
226
- onRowReorder: n[1] ||= ({ dragIndex: e, dropIndex: t }) => L("reorder:row", {
219
+ onSort: Z,
220
+ "onUpdate:expandedRows": n[0] ||= (e) => z.value = e,
221
+ onColumnResizeEnd: te,
222
+ onColumnReorder: ne,
223
+ onRowReorder: n[1] ||= ({ dragIndex: e, dropIndex: t }) => I("reorder:row", {
227
224
  oldIndex: e,
228
225
  newIndex: t
229
226
  })
@@ -238,9 +235,9 @@ var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-ta
238
235
  "header-style": "width: 1%;"
239
236
  }, {
240
237
  body: O(({ data: e }) => [p(r, {
241
- disabled: P.rowExpansionDisabled(e),
242
- icon: ie(e) ? "arrow-down" : "arrow-right",
243
- onClick: A((t) => ae(e), ["stop"])
238
+ disabled: N.rowExpansionDisabled(e),
239
+ icon: re(e) ? "arrow-down" : "arrow-right",
240
+ onClick: A((t) => ie(e), ["stop"])
244
241
  }, null, 8, [
245
242
  "disabled",
246
243
  "icon",
@@ -273,23 +270,23 @@ var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-ta
273
270
  "header-style": "width: 1%;"
274
271
  }, {
275
272
  header: O(() => [p(m, {
276
- selected: X.value,
277
- "onUpdate:selected": ee
273
+ selected: Y.value,
274
+ "onUpdate:selected": $
278
275
  }, null, 8, ["selected"])]),
279
276
  body: O(({ data: e }) => [e ? (y(), s(m, {
280
277
  key: 0,
281
- selected: W.value.includes(e),
282
- "onUpdate:selected": (t) => te(e, t)
278
+ selected: U.value.includes(e),
279
+ "onUpdate:selected": (t) => ee(e, t)
283
280
  }, null, 8, ["selected", "onUpdate:selected"])) : c("", !0)]),
284
281
  _: 1
285
282
  })) : c("", !0),
286
- (y(!0), l(a, null, x(G.value, (e, n) => (y(), s(i, {
283
+ (y(!0), l(a, null, x(W.value, (e, n) => (y(), s(i, {
287
284
  key: e.value,
288
285
  "column-key": e.field,
289
286
  field: e.field,
290
- hidden: K(e),
287
+ hidden: G(e),
291
288
  pt: { root: { "data-column-field": e.field } },
292
- sortable: $(e)
289
+ sortable: Q(e)
293
290
  }, d({
294
291
  header: O(() => [S(t.$slots, `header-${e.value}`, {
295
292
  index: n,
@@ -306,7 +303,7 @@ var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-ta
306
303
  size: "sm"
307
304
  })) : c("", !0)])], !0)]),
308
305
  body: O(({ data: n, index: r }) => [u("div", {
309
- style: g(q(e)),
306
+ style: g(K(e)),
310
307
  class: "wt-table__td__content typo-body-1"
311
308
  }, [n ? S(t.$slots, e.value, {
312
309
  key: 0,
@@ -315,7 +312,7 @@ var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-ta
315
312
  }, () => [f(T(n[e.value]), 1)], !0) : c("", !0)], 4)]),
316
313
  sorticon: O(() => []),
317
314
  _: 2
318
- }, [J.value ? {
315
+ }, [q.value ? {
319
316
  name: "footer",
320
317
  fn: O(() => [S(t.$slots, `${e.value}-footer`, {}, void 0, !0)]),
321
318
  key: "0"
@@ -343,7 +340,7 @@ var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-ta
343
340
  }, 8, ["frozen"])) : c("", !0)
344
341
  ], void 0, !0),
345
342
  _: 2
346
- }, [Y.value ? {
343
+ }, [J.value ? {
347
344
  name: "footer",
348
345
  fn: O(() => [S(t.$slots, "footer", {}, void 0, !0)]),
349
346
  key: "0"
@@ -361,6 +358,6 @@ var j = { class: "wt-table__th__content typo-body-1-bold" }, M = { class: "wt-ta
361
358
  ]);
362
359
  };
363
360
  }
364
- }), [["__scopeId", "data-v-88411100"]]);
361
+ }), [["__scopeId", "data-v-92454b8d"]]);
365
362
  //#endregion
366
- export { P as default };
363
+ export { N as default };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./clients-DqzkR0RW.js";
2
- import { a as t, o as n, r, s as i } from "./components-DL68kJ6J.js";
2
+ import { a as t, o as n, r, s as i } from "./components-BEEq6Fvq.js";
3
3
  import { t as a } from "./enums-De8CDKZ1.js";
4
4
  import { t as o } from "./vue-i18n-Db_oYfO8.js";
5
5
  import { computed as s, createBlock as c, createCommentVNode as l, createVNode as u, defineComponent as d, mergeModels as f, mergeProps as p, openBlock as m, renderSlot as h, resolveComponent as g, unref as _, useModel as v } from "vue";
@@ -1,4 +1,4 @@
1
- import { w as e } from "./components-DL68kJ6J.js";
1
+ import { w as e } from "./components-BEEq6Fvq.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { l as n } from "./enums-De8CDKZ1.js";
4
4
  import "./wt-button-DwAda_g4.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.8.8",
3
+ "version": "26.8.9",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -232,13 +232,6 @@ import { getNextSortOrder } from '../../scripts/sortQueryAdapters.js';
232
232
  import { useTableColumnDrag } from '../_internals/composables';
233
233
  import type { WtTableHeader } from './types/WtTable';
234
234
 
235
- /**
236
- * Number of items to render outside the visible area for virtual scrolling.
237
- * This helps maintain smooth scrolling performance by pre-rendering items
238
- * that are about to come into view, reducing the chance of blank spaces
239
- * during fast scrolling.
240
- */
241
- const VIRTUAL_SCROLL_TOLERATED_ITEMS = 10;
242
235
  const DEFAULT_ITEM_SIZE = 40;
243
236
 
244
237
  interface Props extends DataTableProps {
@@ -382,15 +375,9 @@ const isColumnHidden = (col) => {
382
375
 
383
376
  const columnStyle = (col) => {
384
377
  const baseWidth = 140;
385
- const width = col.width || `${baseWidth}px`;
386
-
387
- if (props.lazy)
388
- return {
389
- width,
390
- };
391
378
 
392
379
  return {
393
- minWidth: width,
380
+ minWidth: col.width || `${baseWidth}px`,
394
381
  };
395
382
  };
396
383
 
@@ -533,7 +520,7 @@ const virtualScroll = computed(() => {
533
520
  lazy: props.lazy,
534
521
  onLazyLoad: props.onLoading,
535
522
  itemSize: props.itemSize, // The height/width of item according to orientation
536
- numToleratedItems: VIRTUAL_SCROLL_TOLERATED_ITEMS, // Number of items to pre-render outside visible area
523
+ numToleratedItems: props.data.length, // Number of items to pre-render outside visible area
537
524
  totalRecords: props.data.length,
538
525
  autoSize: true, // Enable auto height recalculation
539
526
  };