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