@voicenter-team/voicenter-ui-plus 3.0.0 → 3.0.1

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.
Files changed (81) hide show
  1. package/library/assets/assets/sass/main.css +1 -1
  2. package/library/assets/components/VcButton/VcButton.css +1 -1
  3. package/library/assets/components/VcButton/VcButtonIcon.css +1 -1
  4. package/library/assets/components/VcDelimitedList/VcDelimitedList.css +1 -1
  5. package/library/assets/components/VcExcelUploader/VcExcelFileUploadBlock.css +1 -1
  6. package/library/assets/components/VcModal/VcModal.css +1 -1
  7. package/library/assets/components/VcSoundplayer/VcSoundPlayer.css +1 -1
  8. package/library/assets/components/VcSplitButton/VcSplitButton.css +1 -1
  9. package/library/assets/components/VcTable/VcTable.css +1 -1
  10. package/library/assets/entity/components/Form/VcBaseVerticalForm.css +1 -1
  11. package/library/assets/entity/components/Table/VcEntityListTable.css +1 -1
  12. package/library/assets/entity/components/Tabs/VcEntityEditableTabs.css +1 -1
  13. package/library/components/VcButton/VcButton.vue.mjs +3 -2
  14. package/library/components/VcButton/VcButtonIcon.vue.mjs +92 -5
  15. package/library/components/VcButton/VcButtonIcon.vue3.mjs +5 -0
  16. package/library/components/VcButton/VcToggleButton.vue.mjs +20 -7
  17. package/library/components/VcDelimitedList/VcDelimitedList.vue.mjs +194 -5
  18. package/library/components/VcDelimitedList/VcDelimitedList.vue3.mjs +5 -0
  19. package/library/components/VcExcelUploader/VcExcelFileUploadBlock.vue.mjs +140 -5
  20. package/library/components/VcExcelUploader/VcExcelFileUploadBlock.vue3.mjs +5 -0
  21. package/library/components/VcExcelUploader/VcExcelFileUploader.vue.mjs +6 -5
  22. package/library/components/VcExcelUploader/VcFileImportParseResultBlock.vue.mjs +5 -3
  23. package/library/components/VcExcelUploader/VcFileImportResultBindDataTable.vue.mjs +21 -18
  24. package/library/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePickerQuickOptionsSelection.vue.mjs +4 -3
  25. package/library/components/VcFileUploader/VcFileUploader.vue2.mjs +11 -9
  26. package/library/components/VcHtmlEditor/VcHtmlEditorToolbar.vue.mjs +10 -9
  27. package/library/components/VcIcon/VcIcon.vue.mjs +7 -3
  28. package/library/components/VcJsonSchema/Components/JsonSchemaEditor.vue.mjs +8 -7
  29. package/library/components/VcJsonSchema/PropertySetup/JsonSchemaPropertyModal.vue.mjs +10 -9
  30. package/library/components/VcMdEditor/ParameterNode.vue2.mjs +6 -5
  31. package/library/components/VcMdEditor/VcMdEditor.vue.mjs +8 -7
  32. package/library/components/VcPagination/VcPaginationButton.vue.mjs +3 -2
  33. package/library/components/VcSelect/VcSelect.vue.mjs +9 -5
  34. package/library/components/VcSoundplayer/VcSoundPlayer.vue.mjs +274 -5
  35. package/library/components/VcSoundplayer/VcSoundPlayer.vue3.mjs +5 -0
  36. package/library/components/VcSplitButton/VcSplitButton.vue.mjs +4 -3
  37. package/library/components/VcTable/VcTable.vue.mjs +1069 -6
  38. package/library/components/VcTable/VcTable.vue4.mjs +6 -0
  39. package/library/components/VcTree/VcTreeSelect.vue.mjs +8 -7
  40. package/library/entity/components/Button/VcEntityDeleteIconButton.vue.mjs +3 -2
  41. package/library/entity/components/Button/VcEntityEditIconButton.vue.mjs +3 -2
  42. package/library/entity/components/Form/VcBaseVerticalForm.vue.mjs +95 -5
  43. package/library/entity/components/Form/VcBaseVerticalForm.vue3.mjs +5 -0
  44. package/library/entity/components/Form/VcEntityVerticalCreateForm.vue.mjs +3 -2
  45. package/library/entity/components/Form/VcEntityVerticalEditForm.vue.mjs +9 -8
  46. package/library/entity/components/Table/VcEntityListTable.vue.mjs +414 -5
  47. package/library/entity/components/Table/VcEntityListTable.vue3.mjs +5 -0
  48. package/library/entity/components/Tabs/VcEntityEditableTabs.vue.mjs +287 -5
  49. package/library/entity/components/Tabs/VcEntityEditableTabs.vue3.mjs +5 -0
  50. package/library/index.mjs +8 -0
  51. package/library/index.mjs.br +0 -0
  52. package/library/index.mjs.gz +0 -0
  53. package/library/plugin.mjs +272 -264
  54. package/library/plugin.mjs.br +0 -0
  55. package/library/plugin.mjs.gz +0 -0
  56. package/library/style.css +12 -12
  57. package/library/style.css.br +0 -0
  58. package/library/style.css.gz +0 -0
  59. package/library/types/components/VcButton/VcButton.vue.d.ts +1 -1
  60. package/library/types/components/VcButton/VcToggleButton.vue.d.ts +4 -0
  61. package/library/types/components/VcDelimitedList/VcDelimitedList.vue.d.ts +1 -2
  62. package/library/types/components/VcIcon/VcIcon.vue.d.ts +1 -0
  63. package/library/types/components/VcLoading/VcLoading.vue.d.ts +1 -1
  64. package/library/types/components/VcOtpInput/VcOtpInput.vue.d.ts +1 -1
  65. package/library/types/components/VcSelect/VcSelect.vue.d.ts +3 -3
  66. package/library/types/components/VcSelect/VcSelectGrouped.vue.d.ts +3 -3
  67. package/library/types/components/VcSipFlow/VcSipFlow.vue.d.ts +1 -1
  68. package/library/types/components/VcSplitButton/VcSplitButton.vue.d.ts +1 -1
  69. package/library/types/components/VcSwitch/VcSwitch.vue.d.ts +3 -3
  70. package/library/types/components/VcTable/VcTable.vue.d.ts +3 -3
  71. package/library/types/components/VcTree/VcTree.vue.d.ts +3 -3
  72. package/library/types/components/VcTree/VcTreeSelect.vue.d.ts +3 -3
  73. package/package.json +1 -1
  74. package/library/components/VcButton/VcButtonIcon.vue2.mjs +0 -92
  75. package/library/components/VcDelimitedList/VcDelimitedList.vue2.mjs +0 -195
  76. package/library/components/VcExcelUploader/VcExcelFileUploadBlock.vue2.mjs +0 -141
  77. package/library/components/VcSoundplayer/VcSoundPlayer.vue2.mjs +0 -275
  78. package/library/components/VcTable/VcTable.vue2.mjs +0 -1069
  79. package/library/entity/components/Form/VcBaseVerticalForm.vue2.mjs +0 -96
  80. package/library/entity/components/Table/VcEntityListTable.vue2.mjs +0 -413
  81. package/library/entity/components/Tabs/VcEntityEditableTabs.vue2.mjs +0 -288
@@ -1,8 +1,1071 @@
1
- import _sfc_main from "./VcTable.vue2.mjs";
2
- import '../../assets/components/VcTable/VcTable2.css';import '../../assets/components/VcTable/VcTable.css';/* empty css */
3
- /* empty css */
4
- import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
5
- const VcTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d465e664"]]);
1
+ import '../../assets/components/VcTable/VcTable.css';
2
+ import { defineComponent, useSlots, ref, computed, watch, onMounted, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, renderSlot, createVNode, createCommentVNode, normalizeClass, normalizeStyle, unref, Fragment, renderList, withModifiers, createBlock, createTextVNode, toDisplayString, withCtx, withDirectives, vShow } from "vue";
3
+ import { get, cloneDeep } from "lodash-es";
4
+ import _sfc_main$2 from "../VcCheckbox/VcCheckbox.vue.mjs";
5
+ import '../../assets/components/VcSelect/VcSelect.css';import '../../assets/components/VcPagination/VcPagination.css';import '../../assets/components/VcInput/VcInput.css';import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcButton/VcButtonIcon.css';import '../../assets/components/VcPopover/VcPopover.css';import '../../assets/components/VcCheckbox/VcCheckbox.css';/* empty css */
6
+ import _sfc_main$6 from "../VcCheckboxGroup/VcCheckboxGroup.vue.mjs";
7
+ import _sfc_main$4 from "../VcPopover/VcPopover.vue.mjs";
8
+ /* empty css */
9
+ import _sfc_main$7 from "../VcButton/VcButtonIcon.vue.mjs";
10
+ /* empty css */
11
+ import _sfc_main$3 from "../VcIcon/VcIcon.vue.mjs";
12
+ /* empty css */
13
+ import _sfc_main$5 from "../VcInput/VcInput.vue.mjs";
14
+ /* empty css */
15
+ import { resolveFieldData, convertToUnit } from "../../utils/helpers.mjs";
16
+ import VcLoading from "../VcLoading/VcLoading.vue.mjs";
17
+ import { DEFAULT_PER_PAGE_OPTIONS, DEFAULT_PAGINATION, SORT_TYPE } from "./tableOptions.mjs";
18
+ import _sfc_main$8 from "../VcPagination/VcPagination.vue.mjs";
19
+ /* empty css */
20
+ import _sfc_main$1 from "../VcSelect/VcSelect.vue.mjs";
21
+ /* empty css */
22
+ import { tVU } from "../../localization/index.mjs";
23
+ const _hoisted_1 = { class: "vc-table__container" };
24
+ const _hoisted_2 = { class: "vc-table__header" };
25
+ const _hoisted_3 = {
26
+ key: 0,
27
+ class: "vc-table__perpage"
28
+ };
29
+ const _hoisted_4 = {
30
+ key: 1,
31
+ class: "vc-table__header-actions"
32
+ };
33
+ const _hoisted_5 = { class: "vc-table-header" };
34
+ const _hoisted_6 = { class: "selection-col-content" };
35
+ const _hoisted_7 = {
36
+ key: 1,
37
+ class: "expandable-td"
38
+ };
39
+ const _hoisted_8 = ["onClick"];
40
+ const _hoisted_9 = {
41
+ key: 1,
42
+ class: "header-sort-wrapper"
43
+ };
44
+ const _hoisted_10 = ["onClick"];
45
+ const _hoisted_11 = ["onClick"];
46
+ const _hoisted_12 = { class: "vc-table-filter-content" };
47
+ const _hoisted_13 = { class: "vc-table-filter-header" };
48
+ const _hoisted_14 = { class: "vc-table-slot justify-center" };
49
+ const _hoisted_15 = { class: "vc-table-column-header" };
50
+ const _hoisted_16 = { class: "vc-table-body" };
51
+ const _hoisted_17 = ["onClick"];
52
+ const _hoisted_18 = {
53
+ key: 0,
54
+ class: "selection-col"
55
+ };
56
+ const _hoisted_19 = { class: "selection-col-content" };
57
+ const _hoisted_20 = {
58
+ key: 1,
59
+ class: "expandable-td"
60
+ };
61
+ const _hoisted_21 = ["onClick"];
62
+ const _hoisted_22 = ["data-column"];
63
+ const _hoisted_23 = ["data-column"];
64
+ const _hoisted_24 = {
65
+ key: 0,
66
+ class: "vc-table__expandable-row"
67
+ };
68
+ const _hoisted_25 = ["colspan"];
69
+ const _hoisted_26 = { class: "empty-row" };
70
+ const _hoisted_27 = ["colspan"];
71
+ const _hoisted_28 = { class: "vc-table__empty-block" };
72
+ const _hoisted_29 = ["colspan"];
73
+ const _hoisted_30 = {
74
+ key: 0,
75
+ class: "vc-table-footer"
76
+ };
77
+ const _hoisted_31 = {
78
+ key: 0,
79
+ class: "vc-table-pagination"
80
+ };
81
+ const clickDelay = 250;
82
+ const _sfc_main = /* @__PURE__ */ defineComponent({
83
+ ...{
84
+ inheritAttrs: false
85
+ },
86
+ __name: "VcTable",
87
+ props: {
88
+ columns: { default: () => [] },
89
+ options: { default: () => [] },
90
+ showSelection: { type: Boolean },
91
+ expandableRow: { type: Boolean },
92
+ rowSelectable: { type: Boolean },
93
+ loading: { type: Boolean },
94
+ compact: { type: Boolean },
95
+ stripe: { type: Boolean },
96
+ rowUnselect: { type: Boolean },
97
+ isServerData: { type: Boolean },
98
+ withPagination: { type: Boolean },
99
+ lazyLoadingData: { type: Boolean },
100
+ showActionsColumn: { type: Boolean },
101
+ externalPaginate: { default: void 0 },
102
+ sortingOrderDefault: { default: void 0 },
103
+ filterDefault: { default: void 0 },
104
+ loaderType: { default: "lds-spinner" },
105
+ config: { default: () => ({}) },
106
+ tableClass: { default: "" },
107
+ wrapperClass: { default: "" },
108
+ emptyDataText: { default: "" },
109
+ perPageText: { default: "" },
110
+ pagesLabel: { default: "" },
111
+ rowClassName: { type: [String, Function], default: void 0 },
112
+ actionsColumn: { default: () => ({
113
+ width: "120px",
114
+ columnName: "Actions",
115
+ icon: "vc-icon-edit-pencil",
116
+ minWidth: "100px",
117
+ maxWidth: "auto"
118
+ }) },
119
+ perPageOptions: { default: () => DEFAULT_PER_PAGE_OPTIONS },
120
+ fixedHeader: { type: Boolean },
121
+ fixedActions: { type: Boolean, default: false },
122
+ useTeleportedPopovers: { type: Boolean, default: true },
123
+ height: { default: 480 },
124
+ filterOptions: { default: void 0 }
125
+ },
126
+ emits: ["on-row-click", "on-row-dbclick", "handle-selection-change", "handle-sort", "handle-filter", "update:externalPaginate", "update:currentPage", "load-more", "change-select-all", "click-per-page-option", "update:perPage"],
127
+ setup(__props, { expose: __expose, emit: __emit }) {
128
+ var _a, _b;
129
+ const slots = useSlots();
130
+ const props = __props;
131
+ const emit = __emit;
132
+ let clickTimer = null;
133
+ const loadMoreTrigger = ref();
134
+ const headerCheckedRef = ref();
135
+ const localOptions = ref([]);
136
+ const observer = ref(null);
137
+ const dir = ref("ltr");
138
+ const opened = ref([]);
139
+ const selectedRow = ref(void 0);
140
+ const sortBy = ref(((_a = props.sortingOrderDefault) == null ? void 0 : _a.columnName) || "");
141
+ const sortOrder = ref(((_b = props.sortingOrderDefault) == null ? void 0 : _b.order) || "");
142
+ const customSortFunction = ref(void 0);
143
+ const localPagination = ref({
144
+ ...DEFAULT_PAGINATION,
145
+ perPage: props.perPageOptions ? props.perPageOptions[0] : DEFAULT_PAGINATION.perPage
146
+ });
147
+ const viewObserver = ref(void 0);
148
+ const columnFilters = ref(props.filterDefault ? { ...props.filterDefault } : {});
149
+ const filterSearchQueries = ref({});
150
+ const emptyDataMessage = computed(() => {
151
+ return props.emptyDataText ? props.emptyDataText : tVU.t("voicenterUi.table.no.data");
152
+ });
153
+ const localOptionsEnabled = computed(() => {
154
+ return localOptions.value.filter((option) => !optionDisabled(option));
155
+ });
156
+ const actionsColumnConfig = computed(() => {
157
+ return { ...props.actionsColumn };
158
+ });
159
+ const actionsColumnHeaderClasses = computed(() => {
160
+ let classes = "vc-table-actions-column-header";
161
+ if (props.fixedActions) {
162
+ classes += " vc-table-actions-column-header--fixed";
163
+ }
164
+ if (actionsColumnConfig.value.classes) {
165
+ classes += ` ${actionsColumnConfig.value.classes}`;
166
+ }
167
+ return classes;
168
+ });
169
+ const actionsColumnClasses = computed(() => {
170
+ let classes = "vc-table-actions-column";
171
+ if (props.fixedActions) {
172
+ classes += " vc-table-actions-column--fixed";
173
+ }
174
+ return classes;
175
+ });
176
+ const actionsColumnStyles = computed(() => {
177
+ if (props.showActionsColumn) {
178
+ const { width, minWidth, maxWidth } = props.actionsColumn;
179
+ return setColumnStyles({
180
+ width,
181
+ minWidth,
182
+ maxWidth
183
+ });
184
+ }
185
+ return {};
186
+ });
187
+ const hasFooter = computed(() => {
188
+ return !!(props.withPagination || slots["table-footer"]);
189
+ });
190
+ const isPaginationView = computed(() => {
191
+ return !!(props.withPagination && tableOptions.value.length);
192
+ });
193
+ const visibleOptions = computed(() => {
194
+ if (!props.withPagination || props.isServerData) {
195
+ return tableOptions.value;
196
+ }
197
+ return tableOptions.value.slice(start.value, end.value);
198
+ });
199
+ const pagination = computed(() => {
200
+ if (props.externalPaginate) {
201
+ return { ...props.externalPaginate };
202
+ } else {
203
+ return { ...localPagination.value };
204
+ }
205
+ });
206
+ const paginationCurrentPageModel = computed({
207
+ get() {
208
+ if (props.externalPaginate) {
209
+ return props.externalPaginate.currentPage;
210
+ } else {
211
+ return localPagination.value.currentPage;
212
+ }
213
+ },
214
+ set(val) {
215
+ if (!props.externalPaginate) {
216
+ localPagination.value.currentPage = val;
217
+ }
218
+ emit("update:currentPage", {
219
+ ...pagination.value,
220
+ currentPage: val
221
+ });
222
+ }
223
+ });
224
+ const paginationPerPageModel = computed({
225
+ get() {
226
+ if (props.externalPaginate) {
227
+ return props.externalPaginate.perPage;
228
+ } else {
229
+ return localPagination.value.perPage;
230
+ }
231
+ },
232
+ set(val) {
233
+ if (!props.externalPaginate) {
234
+ localPagination.value.perPage = val;
235
+ if (localPagination.value.currentPage !== 1) {
236
+ localPagination.value.currentPage = 1;
237
+ }
238
+ } else {
239
+ const updatedPagination = {
240
+ ...props.externalPaginate,
241
+ perPage: val
242
+ };
243
+ if (props.externalPaginate.currentPage !== 1) {
244
+ updatedPagination.currentPage = 1;
245
+ }
246
+ emit("update:perPage", updatedPagination);
247
+ }
248
+ }
249
+ });
250
+ const start = computed(() => {
251
+ return Math.max(0, paginationCurrentPageModel.value * paginationPerPageModel.value - paginationPerPageModel.value);
252
+ });
253
+ const end = computed(() => {
254
+ return start.value + paginationPerPageModel.value;
255
+ });
256
+ const setPositionForTooltip = computed(() => {
257
+ var _a2, _b2;
258
+ const styling = {
259
+ top: "50%",
260
+ transform: "translateY(-50%)"
261
+ };
262
+ const height = (_a2 = headerCheckedRef.value) == null ? void 0 : _a2.offsetHeight;
263
+ const align = dir.value === "ltr" ? "left" : "right";
264
+ const _checkBox = (_b2 = headerCheckedRef.value) == null ? void 0 : _b2.querySelector(".vc-checkbox .el-checkbox__input");
265
+ if (height) {
266
+ styling.height = `${height - 6}px`;
267
+ }
268
+ if (_checkBox instanceof HTMLElement) {
269
+ styling[align] = `${_checkBox.offsetLeft + _checkBox.offsetWidth + 14}px`;
270
+ }
271
+ return styling;
272
+ });
273
+ const colspanNumber = computed(() => {
274
+ var _a2;
275
+ let numberOfColumnSpan = (_a2 = props.columns) == null ? void 0 : _a2.length;
276
+ if (props.showSelection) {
277
+ numberOfColumnSpan++;
278
+ }
279
+ if (props.expandableRow) {
280
+ numberOfColumnSpan++;
281
+ }
282
+ if (props.showActionsColumn) {
283
+ numberOfColumnSpan++;
284
+ }
285
+ return numberOfColumnSpan;
286
+ });
287
+ const headerChecked = computed({
288
+ get() {
289
+ return !!(localOptionsEnabled.value.length && localOptionsEnabled.value.every((el) => !!el.selected));
290
+ },
291
+ set(val) {
292
+ return val;
293
+ }
294
+ });
295
+ const isIndeterminate = computed(() => {
296
+ return localOptionsEnabled.value.some((el) => !el.selected) && localOptionsEnabled.value.some((el) => el.selected);
297
+ });
298
+ const selectedOptions = computed(() => {
299
+ if (!props.showSelection) {
300
+ return [];
301
+ }
302
+ return localOptions.value.filter((i) => i.selected);
303
+ });
304
+ const filteredOptions = computed(() => {
305
+ var _a2;
306
+ if (props.isServerData) {
307
+ return [...localOptions.value];
308
+ }
309
+ const activeFilters = [];
310
+ for (const [columnKey, selectedValues] of Object.entries(columnFilters.value)) {
311
+ if (!selectedValues || selectedValues.length === 0) continue;
312
+ const column = props.columns.find((c) => c.columnItemKey === columnKey);
313
+ if (!column || !((_a2 = column.filterableConfig) == null ? void 0 : _a2.enabled)) continue;
314
+ const key = column.rowItemLabelKey || columnKey;
315
+ activeFilters.push({
316
+ key,
317
+ valuesSet: new Set(selectedValues)
318
+ });
319
+ }
320
+ if (activeFilters.length === 0) {
321
+ return [...localOptions.value];
322
+ }
323
+ return localOptions.value.filter((option) => {
324
+ return activeFilters.every(({ key, valuesSet }) => {
325
+ const rawValue = resolveFieldData(option, key);
326
+ const value = typeof rawValue === "string" || typeof rawValue === "number" ? rawValue : String(rawValue);
327
+ return valuesSet.has(value);
328
+ });
329
+ });
330
+ });
331
+ const dataValuesMap = computed(() => {
332
+ const map = {};
333
+ props.columns.forEach((column) => {
334
+ var _a2;
335
+ if (!((_a2 = column.filterableConfig) == null ? void 0 : _a2.enabled)) return;
336
+ const key = column.rowItemLabelKey || column.columnItemKey;
337
+ const columnKey = column.columnItemKey;
338
+ const valueToLabel = /* @__PURE__ */ new Map();
339
+ props.options.forEach((option) => {
340
+ const rawValue = resolveFieldData(option, key);
341
+ if (rawValue === null || rawValue === void 0 || rawValue === "") return;
342
+ const value = typeof rawValue === "string" || typeof rawValue === "number" ? rawValue : String(rawValue);
343
+ if (valueToLabel.has(value)) return;
344
+ let label;
345
+ if (column.format) {
346
+ const formatted = column.format(option);
347
+ label = String(formatted ?? value);
348
+ } else {
349
+ label = String(value);
350
+ }
351
+ valueToLabel.set(value, label);
352
+ });
353
+ map[columnKey] = valueToLabel;
354
+ });
355
+ return map;
356
+ });
357
+ const uniqueColumnValuesMap = computed(() => {
358
+ const map = {};
359
+ props.columns.forEach((column) => {
360
+ var _a2, _b2;
361
+ if (!((_a2 = column.filterableConfig) == null ? void 0 : _a2.enabled)) return;
362
+ const columnKey = column.columnItemKey;
363
+ const valueToLabel = new Map(dataValuesMap.value[columnKey] || []);
364
+ const selectedValues = columnFilters.value[columnKey] || [];
365
+ selectedValues.forEach((val) => {
366
+ const value = typeof val === "string" || typeof val === "number" ? val : String(val);
367
+ if (!valueToLabel.has(value)) {
368
+ valueToLabel.set(value, String(value));
369
+ }
370
+ });
371
+ const defaultOptions = ((_b2 = props.filterOptions) == null ? void 0 : _b2[columnKey]) || [];
372
+ defaultOptions.forEach((val) => {
373
+ if (!valueToLabel.has(val)) {
374
+ valueToLabel.set(val, String(val));
375
+ }
376
+ });
377
+ const options = Array.from(valueToLabel.entries()).map(([value, label]) => ({
378
+ value,
379
+ label
380
+ })).sort((a, b) => a.label.localeCompare(b.label, void 0, { numeric: true }));
381
+ map[columnKey] = options;
382
+ });
383
+ return map;
384
+ });
385
+ const filterCheckboxConfig = {
386
+ valueKey: "value",
387
+ labelKey: "label"
388
+ };
389
+ const tableOptions = computed(() => {
390
+ const baseOptions = filteredOptions.value;
391
+ if (!sortBy.value || !sortOrder.value) {
392
+ return [...baseOptions];
393
+ } else {
394
+ const _options = [...baseOptions];
395
+ const sortFn = customSortFunction.value;
396
+ if (!sortFn) {
397
+ return _options.sort(defaultSortMethod);
398
+ } else {
399
+ return _options.sort((a, b) => {
400
+ const val1 = sortOrder.value === "desc" ? b : a;
401
+ const val2 = sortOrder.value === "desc" ? a : b;
402
+ return sortFn(val1, val2);
403
+ });
404
+ }
405
+ }
406
+ });
407
+ const pagesLabelText = computed(() => {
408
+ return props.pagesLabel ? props.pagesLabel : tVU.t("voicenterUi.table.pagination.pages");
409
+ });
410
+ function optionDisabled(option) {
411
+ const optionDisabledKey = props.config.disabledKey;
412
+ if (option !== null && typeof option === "object" && optionDisabledKey !== void 0) {
413
+ return Boolean(get(option, optionDisabledKey, false));
414
+ }
415
+ return false;
416
+ }
417
+ function defaultSortMethod(data1, data2) {
418
+ const v1 = resolveFieldData(data1, sortBy.value);
419
+ const v2 = resolveFieldData(data2, sortBy.value);
420
+ let result = null;
421
+ if (v1 == null && v2 != null) {
422
+ result = -1;
423
+ } else if (v1 != null && v2 == null) {
424
+ result = 1;
425
+ } else if (v1 == null && v2 == null) {
426
+ result = 0;
427
+ } else if (typeof v1 === "string" && typeof v2 === "string") {
428
+ result = v1.localeCompare(v2, void 0, { numeric: true });
429
+ } else if ((typeof v1 === "number" || typeof v1 === "string") && (typeof v2 === "number" || typeof v2 === "string")) {
430
+ result = v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
431
+ } else {
432
+ result = 0;
433
+ }
434
+ return result * SORT_TYPE[sortOrder.value];
435
+ }
436
+ function onPerPageOptionClick(option) {
437
+ emit("click-per-page-option", option);
438
+ }
439
+ function isActiveSortColumn(column, order) {
440
+ if (!isSortableColumn(column) || order !== sortOrder.value) {
441
+ return "";
442
+ }
443
+ if (column.sortBy === sortBy.value) {
444
+ return "text-active-elements";
445
+ }
446
+ }
447
+ function isSortableColumn(column) {
448
+ return !!(column.sortBy || column.sortableFunction);
449
+ }
450
+ function isFilterableColumn(column) {
451
+ var _a2;
452
+ return !!((_a2 = column.filterableConfig) == null ? void 0 : _a2.enabled);
453
+ }
454
+ function getUniqueColumnValues(column) {
455
+ return uniqueColumnValuesMap.value[column.columnItemKey] || [];
456
+ }
457
+ function getColumnFilterValues(column) {
458
+ return columnFilters.value[column.columnItemKey] || [];
459
+ }
460
+ function handleFilterChange(column, values) {
461
+ const columnKey = column.columnItemKey;
462
+ columnFilters.value = {
463
+ ...columnFilters.value,
464
+ [columnKey]: values
465
+ };
466
+ if (!props.isServerData && !props.externalPaginate) {
467
+ localPagination.value.currentPage = 1;
468
+ }
469
+ const allFilters = {};
470
+ for (const [key, vals] of Object.entries(columnFilters.value)) {
471
+ if (vals && vals.length > 0) {
472
+ allFilters[key] = vals;
473
+ }
474
+ }
475
+ emit("handle-filter", {
476
+ columnKey,
477
+ values,
478
+ allFilters
479
+ });
480
+ }
481
+ function isColumnFiltered(column) {
482
+ const values = columnFilters.value[column.columnItemKey];
483
+ return !!(values && values.length > 0);
484
+ }
485
+ function isSearchableFilter(column) {
486
+ var _a2;
487
+ return !!((_a2 = column.filterableConfig) == null ? void 0 : _a2.searchable);
488
+ }
489
+ function getFilterSearchQuery(column) {
490
+ return filterSearchQueries.value[column.columnItemKey] || "";
491
+ }
492
+ function setFilterSearchQuery(column, query) {
493
+ filterSearchQueries.value = {
494
+ ...filterSearchQueries.value,
495
+ [column.columnItemKey]: query
496
+ };
497
+ }
498
+ function clearFilterSearchQuery(column) {
499
+ const key = column.columnItemKey;
500
+ if (filterSearchQueries.value[key]) {
501
+ const rest = {};
502
+ for (const [k, v] of Object.entries(filterSearchQueries.value)) {
503
+ if (k !== key) {
504
+ rest[k] = v;
505
+ }
506
+ }
507
+ filterSearchQueries.value = rest;
508
+ }
509
+ }
510
+ function getFilteredColumnValues(column) {
511
+ const allOptions = getUniqueColumnValues(column);
512
+ const query = getFilterSearchQuery(column).trim().toLowerCase();
513
+ if (!query) return allOptions;
514
+ return allOptions.filter((option) => option.label.toLowerCase().includes(query));
515
+ }
516
+ function getFilterModelValue(column) {
517
+ const currentValues = getColumnFilterValues(column);
518
+ const query = getFilterSearchQuery(column).trim().toLowerCase();
519
+ if (!isSearchableFilter(column) || !query) return currentValues;
520
+ const visibleValues = new Set(getFilteredColumnValues(column).map((o) => o.value));
521
+ return currentValues.filter((v) => visibleValues.has(v));
522
+ }
523
+ function onFilterModelUpdate(column, newValues) {
524
+ const query = getFilterSearchQuery(column).trim().toLowerCase();
525
+ if (!isSearchableFilter(column) || !query) {
526
+ handleFilterChange(column, newValues);
527
+ return;
528
+ }
529
+ const currentValues = getColumnFilterValues(column);
530
+ const visibleValues = new Set(getFilteredColumnValues(column).map((o) => o.value));
531
+ const hiddenSelected = currentValues.filter((v) => !visibleValues.has(v));
532
+ const merged = [.../* @__PURE__ */ new Set([...hiddenSelected, ...newValues])];
533
+ handleFilterChange(column, merged);
534
+ }
535
+ function handleSortClick(column, order = "") {
536
+ if (isSortableColumn(column)) {
537
+ const oldSort = sortBy.value;
538
+ sortBy.value = column.sortBy || column.columnItemKey;
539
+ customSortFunction.value = column.sortableFunction;
540
+ if (order) {
541
+ sortOrder.value = order;
542
+ } else {
543
+ if (oldSort !== sortBy.value) {
544
+ sortOrder.value = "";
545
+ }
546
+ toggleOrder();
547
+ }
548
+ emit("handle-sort", {
549
+ sortBy: sortBy.value,
550
+ order: sortOrder.value
551
+ });
552
+ }
553
+ }
554
+ function toggleOrder() {
555
+ if (sortOrder.value === "asc") {
556
+ sortOrder.value = "desc";
557
+ } else if (sortOrder.value === "desc") {
558
+ sortOrder.value = "";
559
+ } else {
560
+ sortOrder.value = "asc";
561
+ }
562
+ }
563
+ function onRowClick(option, index) {
564
+ selectedRow.value = index;
565
+ if (props.rowUnselect) {
566
+ selectedRow.value = selectedRow.value === void 0 ? index : void 0;
567
+ }
568
+ emit("on-row-click", option, index);
569
+ }
570
+ function onRowDbClick(option, index) {
571
+ emit("on-row-dbclick", option, index);
572
+ }
573
+ function handleRowClick(option, index) {
574
+ if (clickTimer === null) {
575
+ clickTimer = setTimeout(
576
+ () => {
577
+ onRowClick(option, index);
578
+ clickTimer = null;
579
+ },
580
+ clickDelay
581
+ );
582
+ } else {
583
+ clearTimeout(clickTimer);
584
+ clickTimer = null;
585
+ onRowDbClick(option, index);
586
+ }
587
+ }
588
+ function gettingFlexAlignment(columnAlignment = "center") {
589
+ const alignments = {
590
+ left: "start",
591
+ center: "center",
592
+ right: "end"
593
+ };
594
+ return alignments[columnAlignment];
595
+ }
596
+ function setColumnStyles(column) {
597
+ return {
598
+ minWidth: convertToUnit(column.minWidth),
599
+ maxWidth: convertToUnit(column.maxWidth),
600
+ width: convertToUnit(column.width)
601
+ };
602
+ }
603
+ function gettingColumnItemData(column) {
604
+ return column.columnItemLabel;
605
+ }
606
+ function gettingRowItemData(option, rowColumn) {
607
+ if (rowColumn.format) {
608
+ return rowColumn.format(option);
609
+ }
610
+ const labelKey = rowColumn.rowItemLabelKey ? rowColumn.rowItemLabelKey : rowColumn.columnItemLabel;
611
+ return get(option, labelKey, "");
612
+ }
613
+ function setOptionChecked(option, actionValue) {
614
+ if (optionDisabled(option)) {
615
+ return;
616
+ }
617
+ const optionUniqueKey = props.config.optionUniqueKey;
618
+ if (optionUniqueKey === void 0) {
619
+ return;
620
+ }
621
+ const equalItem = localOptions.value.find((localOption) => localOption[optionUniqueKey] === option[optionUniqueKey]);
622
+ if (equalItem) {
623
+ equalItem.selected = actionValue;
624
+ }
625
+ }
626
+ function setBulkOptionChecked(optionArray, actionValue) {
627
+ optionArray.forEach((option) => {
628
+ setOptionChecked(option, actionValue);
629
+ });
630
+ }
631
+ function onChangeAll(value) {
632
+ localOptions.value.map((el) => {
633
+ if (!optionDisabled(el)) {
634
+ el.selected = value;
635
+ }
636
+ return el;
637
+ });
638
+ onSelectionChange();
639
+ emit("change-select-all", value);
640
+ }
641
+ function onChangeRow(option) {
642
+ if (optionDisabled(option)) {
643
+ return;
644
+ }
645
+ option.selected = !option.selected;
646
+ onSelectionChange();
647
+ }
648
+ function onSelectionChange() {
649
+ emit("handle-selection-change", selectedOptions.value);
650
+ }
651
+ function initObserver() {
652
+ observer.value = new MutationObserver((mutationList) => {
653
+ if (!mutationList || !Object.keys(mutationList).length) {
654
+ return;
655
+ }
656
+ if (mutationList[0].attributeName === "dir") {
657
+ const _dir = document.documentElement.getAttribute("dir");
658
+ if (_dir) {
659
+ dir.value = _dir;
660
+ }
661
+ }
662
+ });
663
+ const elementNode = document.documentElement;
664
+ observer.value.observe(elementNode, {
665
+ attributes: true,
666
+ childList: false,
667
+ subtree: false
668
+ });
669
+ }
670
+ function expandableAction(rowIndex) {
671
+ const index = opened.value.indexOf(rowIndex);
672
+ if (index > -1) {
673
+ opened.value.splice(index, 1);
674
+ } else {
675
+ opened.value.push(rowIndex);
676
+ }
677
+ }
678
+ function getRowClass(row, index) {
679
+ if (typeof props.rowClassName === "string") {
680
+ return props.rowClassName;
681
+ } else if (typeof props.rowClassName === "function") {
682
+ return props.rowClassName.call(null, {
683
+ row,
684
+ index
685
+ });
686
+ }
687
+ }
688
+ watch(
689
+ () => props.options,
690
+ (val) => {
691
+ localOptions.value = cloneDeep(val);
692
+ localPagination.value.total = props.externalPaginate ? props.externalPaginate.total : val.length;
693
+ localPagination.value.currentPage = props.externalPaginate ? props.externalPaginate.currentPage : 1;
694
+ opened.value = [];
695
+ },
696
+ { immediate: true }
697
+ );
698
+ watch(
699
+ () => filteredOptions.value.length,
700
+ (filteredCount) => {
701
+ if (!props.isServerData && !props.externalPaginate) {
702
+ localPagination.value.total = filteredCount;
703
+ }
704
+ }
705
+ );
706
+ watch(
707
+ () => props.columns,
708
+ (newColumns) => {
709
+ const validKeys = new Set(newColumns.map((c) => c.columnItemKey));
710
+ const current = filterSearchQueries.value;
711
+ const hasStale = Object.keys(current).some((key) => !validKeys.has(key));
712
+ if (hasStale) {
713
+ const cleaned = {};
714
+ for (const [key, val] of Object.entries(current)) {
715
+ if (validKeys.has(key)) {
716
+ cleaned[key] = val;
717
+ }
718
+ }
719
+ filterSearchQueries.value = cleaned;
720
+ }
721
+ }
722
+ );
723
+ onMounted(() => {
724
+ if (props.showSelection) {
725
+ localOptions.value = localOptions.value.map((el) => {
726
+ el.selected = !!el.selected;
727
+ return el;
728
+ });
729
+ const _dir = document.documentElement.getAttribute("dir");
730
+ if (_dir) {
731
+ dir.value = _dir;
732
+ }
733
+ if (selectedOptions.value.length) {
734
+ onSelectionChange();
735
+ }
736
+ initObserver();
737
+ }
738
+ if (props.lazyLoadingData && !props.withPagination) {
739
+ if (loadMoreTrigger.value) {
740
+ viewObserver.value = new IntersectionObserver(() => {
741
+ emit("load-more", true);
742
+ });
743
+ viewObserver.value.observe(loadMoreTrigger.value);
744
+ }
745
+ }
746
+ });
747
+ onBeforeUnmount(() => {
748
+ if (observer.value) {
749
+ observer.value.disconnect();
750
+ }
751
+ if (viewObserver.value) {
752
+ viewObserver.value.disconnect();
753
+ }
754
+ });
755
+ __expose({
756
+ setBulkOptionChecked,
757
+ /* Internal state surfaced for tests and integrators that need to
758
+ * observe sort/selection/expansion state imperatively. Refs unwrap
759
+ * through Vue's proxy so reads are plain values (`string`, `Array<number>`,
760
+ * etc.) and the typed wrapper carries the shape through. */
761
+ selectedOptions,
762
+ sortBy,
763
+ sortOrder,
764
+ opened
765
+ });
766
+ return (_ctx, _cache) => {
767
+ var _a2;
768
+ return openBlock(), createElementBlock("div", _hoisted_1, [
769
+ createElementVNode("div", _hoisted_2, [
770
+ renderSlot(_ctx.$slots, "header", {}, () => {
771
+ var _a3;
772
+ return [
773
+ renderSlot(_ctx.$slots, "header-filter"),
774
+ __props.withPagination && ((_a3 = __props.perPageOptions) == null ? void 0 : _a3.length) ? (openBlock(), createElementBlock("div", _hoisted_3, [
775
+ createVNode(_sfc_main$1, {
776
+ modelValue: paginationPerPageModel.value,
777
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => paginationPerPageModel.value = $event),
778
+ teleported: __props.useTeleportedPopovers,
779
+ options: __props.perPageOptions,
780
+ "onOption:click": onPerPageOptionClick
781
+ }, null, 8, ["modelValue", "teleported", "options"])
782
+ ])) : createCommentVNode("", true),
783
+ _ctx.$slots["header-actions"] ? (openBlock(), createElementBlock("div", _hoisted_4, [
784
+ renderSlot(_ctx.$slots, "header-actions")
785
+ ])) : createCommentVNode("", true)
786
+ ];
787
+ })
788
+ ]),
789
+ createElementVNode("div", {
790
+ class: normalizeClass([{ "shadow-table rounded-md": hasFooter.value }, __props.wrapperClass])
791
+ }, [
792
+ createElementVNode("div", {
793
+ class: normalizeClass([{
794
+ "is--fixed": __props.fixedHeader,
795
+ "shadow-table rounded-md": !hasFooter.value
796
+ }, "vc-table-wrapper"]),
797
+ style: normalizeStyle({ "--height": unref(convertToUnit)(__props.height) })
798
+ }, [
799
+ createElementVNode("table", {
800
+ class: normalizeClass(["vc-table", [
801
+ hasFooter.value ? "vc-table--with-footer" : "vc-table--without-footer",
802
+ { "w-full": __props.withPagination },
803
+ { "vc-table--small": __props.compact },
804
+ { "vc-table--striped": __props.stripe },
805
+ __props.tableClass
806
+ ]])
807
+ }, [
808
+ createElementVNode("thead", _hoisted_5, [
809
+ createElementVNode("tr", null, [
810
+ __props.showSelection ? (openBlock(), createElementBlock("th", {
811
+ key: 0,
812
+ ref_key: "headerCheckedRef",
813
+ ref: headerCheckedRef,
814
+ class: "selection-col relative"
815
+ }, [
816
+ createElementVNode("div", _hoisted_6, [
817
+ createVNode(_sfc_main$2, {
818
+ disabled: !tableOptions.value.length,
819
+ "model-value": headerChecked.value,
820
+ indeterminate: isIndeterminate.value,
821
+ onChange: onChangeAll
822
+ }, null, 8, ["disabled", "model-value", "indeterminate"]),
823
+ !!_ctx.$slots["checked-tooltip"] && localOptions.value.some((el) => el.selected) ? (openBlock(), createElementBlock("div", {
824
+ key: 0,
825
+ class: "checked-tooltip",
826
+ style: normalizeStyle(setPositionForTooltip.value)
827
+ }, [
828
+ renderSlot(_ctx.$slots, "checked-tooltip")
829
+ ], 4)) : createCommentVNode("", true)
830
+ ])
831
+ ], 512)) : createCommentVNode("", true),
832
+ __props.expandableRow ? (openBlock(), createElementBlock("th", _hoisted_7)) : createCommentVNode("", true),
833
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column, index) => {
834
+ return openBlock(), createElementBlock("th", {
835
+ key: index,
836
+ style: normalizeStyle(setColumnStyles(column))
837
+ }, [
838
+ createElementVNode("div", {
839
+ class: normalizeClass([`justify-${gettingFlexAlignment(column.columnAlignment)}`, "vc-table-slot"])
840
+ }, [
841
+ renderSlot(_ctx.$slots, column.columnItemKey, { column }, () => [
842
+ createElementVNode("div", {
843
+ class: normalizeClass([{ "cursor-pointer": isSortableColumn(column) }, "vc-table-column-header select-none"]),
844
+ onClick: withModifiers(($event) => handleSortClick(column), ["stop"])
845
+ }, [
846
+ column.columnItemIcon ? (openBlock(), createBlock(_sfc_main$3, {
847
+ key: 0,
848
+ icon: column.columnItemIcon,
849
+ class: "vc-table-column-icon"
850
+ }, null, 8, ["icon"])) : createCommentVNode("", true),
851
+ createElementVNode("span", {
852
+ class: normalizeClass(column.columnClasses)
853
+ }, [
854
+ renderSlot(_ctx.$slots, `${column.columnItemKey}-title`, {
855
+ column,
856
+ title: gettingColumnItemData(column)
857
+ }, () => [
858
+ createTextVNode(toDisplayString(gettingColumnItemData(column)), 1)
859
+ ])
860
+ ], 2),
861
+ isSortableColumn(column) ? (openBlock(), createElementBlock("span", _hoisted_9, [
862
+ createElementVNode("i", {
863
+ class: normalizeClass([isActiveSortColumn(column, "asc"), "sort-caret ascending"]),
864
+ onClick: withModifiers(($event) => handleSortClick(column, "asc"), ["stop"])
865
+ }, null, 10, _hoisted_10),
866
+ createElementVNode("i", {
867
+ class: normalizeClass([isActiveSortColumn(column, "desc"), "sort-caret descending"]),
868
+ onClick: withModifiers(($event) => handleSortClick(column, "desc"), ["stop"])
869
+ }, null, 10, _hoisted_11)
870
+ ])) : createCommentVNode("", true),
871
+ isFilterableColumn(column) ? (openBlock(), createBlock(_sfc_main$4, {
872
+ key: 2,
873
+ teleported: __props.useTeleportedPopovers,
874
+ "popover-width": 220,
875
+ placement: "bottom-end",
876
+ "popover-class": "vc-table-filter-popover",
877
+ onHide: () => clearFilterSearchQuery(column)
878
+ }, {
879
+ reference: withCtx(({ open }) => [
880
+ createVNode(_sfc_main$7, {
881
+ icon: "vc-icon-filter",
882
+ small: "",
883
+ plain: "",
884
+ class: normalizeClass(["header-filter-btn", { "header-filter-btn--active": isColumnFiltered(column), "header-filter-btn--open": open }]),
885
+ onClick: _cache[1] || (_cache[1] = withModifiers(() => {
886
+ }, ["stop"]))
887
+ }, null, 8, ["class"])
888
+ ]),
889
+ default: withCtx(() => [
890
+ createElementVNode("div", _hoisted_12, [
891
+ createElementVNode("div", _hoisted_13, toDisplayString(unref(tVU).t("voicenterUi.table.filter.by", { column: column.columnItemLabel })), 1),
892
+ isSearchableFilter(column) ? (openBlock(), createBlock(_sfc_main$5, {
893
+ key: 0,
894
+ "model-value": getFilterSearchQuery(column),
895
+ placeholder: unref(tVU).t("voicenterUi.table.filter.search"),
896
+ clearable: "",
897
+ "prefix-icon": "vc-icon-search",
898
+ class: "vc-table-filter-search",
899
+ "onUpdate:modelValue": (val) => setFilterSearchQuery(column, String(val ?? ""))
900
+ }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : createCommentVNode("", true),
901
+ createVNode(_sfc_main$6, {
902
+ "model-value": getFilterModelValue(column),
903
+ checkboxes: isSearchableFilter(column) ? getFilteredColumnValues(column) : getUniqueColumnValues(column),
904
+ config: filterCheckboxConfig,
905
+ "visible-all": true,
906
+ "onUpdate:modelValue": (values) => onFilterModelUpdate(column, values)
907
+ }, {
908
+ "checkbox-label": withCtx(({ checkbox }) => [
909
+ renderSlot(_ctx.$slots, `${column.columnItemKey}-filter-option`, {
910
+ option: checkbox,
911
+ column
912
+ }, () => [
913
+ createTextVNode(toDisplayString(checkbox.label), 1)
914
+ ])
915
+ ]),
916
+ _: 2
917
+ }, 1032, ["model-value", "checkboxes", "onUpdate:modelValue"])
918
+ ])
919
+ ]),
920
+ _: 2
921
+ }, 1032, ["teleported", "onHide"])) : createCommentVNode("", true)
922
+ ], 10, _hoisted_8)
923
+ ])
924
+ ], 2),
925
+ renderSlot(_ctx.$slots, `${column.columnItemKey}-extra`, { column })
926
+ ], 4);
927
+ }), 128)),
928
+ __props.showActionsColumn ? (openBlock(), createElementBlock("th", {
929
+ key: 2,
930
+ class: normalizeClass(actionsColumnHeaderClasses.value),
931
+ style: normalizeStyle(actionsColumnStyles.value)
932
+ }, [
933
+ renderSlot(_ctx.$slots, "actions-column-header", {}, () => [
934
+ createElementVNode("div", _hoisted_14, [
935
+ createElementVNode("div", _hoisted_15, [
936
+ actionsColumnConfig.value.icon ? (openBlock(), createBlock(_sfc_main$3, {
937
+ key: 0,
938
+ icon: actionsColumnConfig.value.icon,
939
+ class: "vc-table-column-icon"
940
+ }, null, 8, ["icon"])) : createCommentVNode("", true),
941
+ createElementVNode("span", null, toDisplayString(actionsColumnConfig.value.columnName), 1)
942
+ ])
943
+ ])
944
+ ])
945
+ ], 6)) : createCommentVNode("", true)
946
+ ])
947
+ ]),
948
+ createElementVNode("tbody", _hoisted_16, [
949
+ _ctx.$slots["prepend-row"] ? renderSlot(_ctx.$slots, "prepend-row", {
950
+ key: 0,
951
+ columns: __props.columns
952
+ }) : createCommentVNode("", true),
953
+ (openBlock(true), createElementBlock(Fragment, null, renderList(visibleOptions.value, (option, index) => {
954
+ return openBlock(), createElementBlock(Fragment, {
955
+ key: `tr-${option}`
956
+ }, [
957
+ createElementVNode("tr", {
958
+ class: normalizeClass([
959
+ {
960
+ "selected": __props.rowSelectable && selectedRow.value === index
961
+ },
962
+ getRowClass(option, index)
963
+ ]),
964
+ onClick: ($event) => handleRowClick(option, index)
965
+ }, [
966
+ __props.showSelection ? (openBlock(), createElementBlock("td", _hoisted_18, [
967
+ createElementVNode("div", _hoisted_19, [
968
+ createVNode(_sfc_main$2, {
969
+ disabled: optionDisabled(option),
970
+ "model-value": !!option.selected,
971
+ onChange: ($event) => onChangeRow(option)
972
+ }, null, 8, ["disabled", "model-value", "onChange"])
973
+ ])
974
+ ])) : createCommentVNode("", true),
975
+ __props.expandableRow ? (openBlock(), createElementBlock("td", _hoisted_20, [
976
+ createElementVNode("div", {
977
+ class: "flex items-center justify-center w-full h-full",
978
+ onClick: ($event) => expandableAction(index)
979
+ }, [
980
+ createVNode(_sfc_main$3, {
981
+ icon: "vc-icon-down",
982
+ class: normalizeClass(["icon-expandable p-1", { "icon-expandable-active": opened.value.includes(index) }])
983
+ }, null, 8, ["class"])
984
+ ], 8, _hoisted_21)
985
+ ])) : createCommentVNode("", true),
986
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (rowColumn, rowIndex) => {
987
+ return openBlock(), createElementBlock("td", {
988
+ key: `column-${index}-${rowIndex}`,
989
+ style: normalizeStyle(setColumnStyles(rowColumn)),
990
+ "data-column": gettingColumnItemData(rowColumn)
991
+ }, [
992
+ createElementVNode("div", {
993
+ class: normalizeClass([[`justify-${gettingFlexAlignment(rowColumn.rowItemAlignment)}`, rowColumn.rowItemClasses], "vc-table-slot"])
994
+ }, [
995
+ renderSlot(_ctx.$slots, rowColumn.rowItemKeyKey, {
996
+ row: option,
997
+ index
998
+ }, () => [
999
+ createTextVNode(toDisplayString(gettingRowItemData(option, rowColumn)), 1)
1000
+ ])
1001
+ ], 2)
1002
+ ], 12, _hoisted_22);
1003
+ }), 128)),
1004
+ __props.showActionsColumn ? (openBlock(), createElementBlock("td", {
1005
+ key: 2,
1006
+ style: normalizeStyle(actionsColumnStyles.value),
1007
+ class: normalizeClass(actionsColumnClasses.value),
1008
+ "data-column": actionsColumnConfig.value.columnName
1009
+ }, [
1010
+ renderSlot(_ctx.$slots, "actions-column", {
1011
+ row: option,
1012
+ index
1013
+ })
1014
+ ], 14, _hoisted_23)) : createCommentVNode("", true)
1015
+ ], 10, _hoisted_17),
1016
+ __props.expandableRow && opened.value.includes(index) ? (openBlock(), createElementBlock("tr", _hoisted_24, [
1017
+ createElementVNode("td", { colspan: colspanNumber.value }, [
1018
+ renderSlot(_ctx.$slots, "expanded-content", { row: option })
1019
+ ], 8, _hoisted_25)
1020
+ ])) : createCommentVNode("", true)
1021
+ ], 64);
1022
+ }), 128)),
1023
+ !tableOptions.value.length ? renderSlot(_ctx.$slots, "empty-data", { key: 1 }, () => [
1024
+ createElementVNode("tr", _hoisted_26, [
1025
+ createElementVNode("td", { colspan: colspanNumber.value }, [
1026
+ createElementVNode("div", _hoisted_28, toDisplayString(emptyDataMessage.value), 1)
1027
+ ], 8, _hoisted_27)
1028
+ ])
1029
+ ]) : createCommentVNode("", true),
1030
+ __props.lazyLoadingData && !__props.withPagination ? withDirectives((openBlock(), createElementBlock("tr", {
1031
+ key: 2,
1032
+ ref_key: "loadMoreTrigger",
1033
+ ref: loadMoreTrigger,
1034
+ class: "vc-table__load-trigger"
1035
+ }, [
1036
+ createElementVNode("td", {
1037
+ colspan: (_a2 = __props.columns) == null ? void 0 : _a2.length
1038
+ }, null, 8, _hoisted_29)
1039
+ ], 512)), [
1040
+ [vShow, !__props.loading]
1041
+ ]) : createCommentVNode("", true)
1042
+ ])
1043
+ ], 2)
1044
+ ], 6),
1045
+ hasFooter.value ? (openBlock(), createElementBlock("div", _hoisted_30, [
1046
+ renderSlot(_ctx.$slots, "table-footer", {}, () => [
1047
+ isPaginationView.value ? (openBlock(), createElementBlock("div", _hoisted_31, [
1048
+ createVNode(_sfc_main$8, {
1049
+ modelValue: paginationCurrentPageModel.value,
1050
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => paginationCurrentPageModel.value = $event),
1051
+ "per-page": paginationPerPageModel.value,
1052
+ total: pagination.value.total,
1053
+ label: pagesLabelText.value,
1054
+ "select-teleported": __props.useTeleportedPopovers
1055
+ }, null, 8, ["modelValue", "per-page", "total", "label", "select-teleported"])
1056
+ ])) : createCommentVNode("", true)
1057
+ ])
1058
+ ])) : createCommentVNode("", true)
1059
+ ], 2),
1060
+ createVNode(VcLoading, {
1061
+ active: __props.loading,
1062
+ loader: __props.loaderType,
1063
+ class: "z-5 rounded-md"
1064
+ }, null, 8, ["active", "loader"])
1065
+ ]);
1066
+ };
1067
+ }
1068
+ });
6
1069
  export {
7
- VcTable as default
1070
+ _sfc_main as default
8
1071
  };