@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,195 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, onMounted, withDirectives, openBlock, createElementBlock, createElementVNode, Fragment, renderList, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createBlock, withCtx, unref, nextTick } from "vue";
|
|
2
|
-
import { getRefElement } from "../../utils/helpers.mjs";
|
|
3
|
-
import _sfc_main$1 from "../VcPopover/VcPopover.vue.mjs";
|
|
4
|
-
import '../../assets/components/VcPopover/VcPopover.css';/* empty css */
|
|
5
|
-
import { resize } from "../../directives/resize.mjs";
|
|
6
|
-
const _hoisted_1 = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "text-break"
|
|
9
|
-
};
|
|
10
|
-
const _hoisted_2 = { class: "flex items-center" };
|
|
11
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
-
__name: "VcDelimitedList",
|
|
13
|
-
props: {
|
|
14
|
-
list: { default: () => [] },
|
|
15
|
-
limit: { default: 3 },
|
|
16
|
-
trigger: { default: "hover" },
|
|
17
|
-
separator: { default: "," },
|
|
18
|
-
popoverMaxWidth: { default: 250 },
|
|
19
|
-
popoverDisabled: { type: Boolean, default: false },
|
|
20
|
-
valueKey: { default: void 0 }
|
|
21
|
-
},
|
|
22
|
-
setup(__props) {
|
|
23
|
-
const props = __props;
|
|
24
|
-
const localLimit = ref(1);
|
|
25
|
-
const oldLocalLimit = ref(1);
|
|
26
|
-
const minLimit = ref(1);
|
|
27
|
-
const dListWrapperRef = ref();
|
|
28
|
-
const dListRef = ref();
|
|
29
|
-
const shortList = computed(() => {
|
|
30
|
-
return props.list.slice(0, localLimit.value);
|
|
31
|
-
});
|
|
32
|
-
const otherList = computed(() => {
|
|
33
|
-
return props.list.length > localLimit.value ? props.list.slice(localLimit.value) : [];
|
|
34
|
-
});
|
|
35
|
-
function getValueKey(option, index) {
|
|
36
|
-
if (props.valueKey) {
|
|
37
|
-
return option[props.valueKey];
|
|
38
|
-
}
|
|
39
|
-
return index;
|
|
40
|
-
}
|
|
41
|
-
function initLimit() {
|
|
42
|
-
localLimit.value = 1;
|
|
43
|
-
}
|
|
44
|
-
async function isListSmaller({ listWidth, listWrapperWidth, list, listWrapper }) {
|
|
45
|
-
while (listWidth < listWrapperWidth) {
|
|
46
|
-
if (localLimit.value > props.limit) {
|
|
47
|
-
localLimit.value = props.limit;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
localLimit.value++;
|
|
51
|
-
await nextTick();
|
|
52
|
-
listWidth = list.clientWidth;
|
|
53
|
-
listWrapperWidth = listWrapper.clientWidth;
|
|
54
|
-
if (listWidth > listWrapperWidth) {
|
|
55
|
-
if (localLimit.value > minLimit.value && localLimit.value <= props.limit) {
|
|
56
|
-
localLimit.value--;
|
|
57
|
-
} else if (localLimit.value > props.limit) {
|
|
58
|
-
localLimit.value = props.limit;
|
|
59
|
-
} else if (localLimit.value < minLimit.value) {
|
|
60
|
-
localLimit.value = minLimit.value;
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
async function isListBigger({ listWidth, listWrapperWidth, list, listWrapper }) {
|
|
67
|
-
while (listWidth > listWrapperWidth) {
|
|
68
|
-
if (localLimit.value < minLimit.value) {
|
|
69
|
-
localLimit.value = minLimit.value;
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
localLimit.value--;
|
|
73
|
-
await nextTick();
|
|
74
|
-
listWidth = list.clientWidth;
|
|
75
|
-
listWrapperWidth = listWrapper.clientWidth;
|
|
76
|
-
if (listWidth < listWrapperWidth) {
|
|
77
|
-
if (localLimit.value > props.limit) {
|
|
78
|
-
localLimit.value = props.limit;
|
|
79
|
-
} else if (localLimit.value < minLimit.value) {
|
|
80
|
-
localLimit.value = minLimit.value;
|
|
81
|
-
}
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
async function updateLocalLimit({ list, listWrapper }) {
|
|
87
|
-
const listWidth = list.clientWidth;
|
|
88
|
-
const listWrapperWidth = listWrapper.clientWidth;
|
|
89
|
-
if (listWidth < listWrapperWidth) {
|
|
90
|
-
await isListSmaller({
|
|
91
|
-
listWidth,
|
|
92
|
-
listWrapperWidth,
|
|
93
|
-
list,
|
|
94
|
-
listWrapper
|
|
95
|
-
});
|
|
96
|
-
} else if (listWidth > listWrapperWidth) {
|
|
97
|
-
await isListBigger({
|
|
98
|
-
listWidth,
|
|
99
|
-
listWrapperWidth,
|
|
100
|
-
list,
|
|
101
|
-
listWrapper
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
oldLocalLimit.value = localLimit.value;
|
|
105
|
-
}
|
|
106
|
-
async function updateList() {
|
|
107
|
-
initLimit();
|
|
108
|
-
if (dListRef.value && dListWrapperRef.value) {
|
|
109
|
-
const list = getRefElement(dListRef.value);
|
|
110
|
-
const listWrapper = getRefElement(dListWrapperRef.value);
|
|
111
|
-
if (!(list instanceof HTMLElement) || !(listWrapper instanceof HTMLElement)) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
await nextTick();
|
|
115
|
-
await updateLocalLimit({
|
|
116
|
-
list,
|
|
117
|
-
listWrapper
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function showSeparator(index) {
|
|
122
|
-
return index < shortList.value.length - 1 && !otherList.value.length || index < shortList.value.length && otherList.value.length;
|
|
123
|
-
}
|
|
124
|
-
watch(
|
|
125
|
-
() => props.limit,
|
|
126
|
-
() => {
|
|
127
|
-
updateList();
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
watch(
|
|
131
|
-
() => props.list.length,
|
|
132
|
-
() => {
|
|
133
|
-
updateList();
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
onMounted(updateList);
|
|
137
|
-
return (_ctx, _cache) => {
|
|
138
|
-
return withDirectives((openBlock(), createElementBlock("div", {
|
|
139
|
-
ref_key: "dListWrapperRef",
|
|
140
|
-
ref: dListWrapperRef,
|
|
141
|
-
class: "vc-delimited-list-wrapper"
|
|
142
|
-
}, [
|
|
143
|
-
createElementVNode("div", {
|
|
144
|
-
ref_key: "dListRef",
|
|
145
|
-
ref: dListRef,
|
|
146
|
-
class: "flex md:inline-flex items-center vc-delimited-list-container"
|
|
147
|
-
}, [
|
|
148
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(shortList.value, (item, index) => {
|
|
149
|
-
return openBlock(), createElementBlock("div", {
|
|
150
|
-
key: index,
|
|
151
|
-
class: "flex items-center vc-delimited-list-item-wrapper"
|
|
152
|
-
}, [
|
|
153
|
-
renderSlot(_ctx.$slots, "list-item", {
|
|
154
|
-
item,
|
|
155
|
-
index
|
|
156
|
-
}, () => [
|
|
157
|
-
createTextVNode(toDisplayString(getValueKey(item, index)), 1)
|
|
158
|
-
], true),
|
|
159
|
-
showSeparator(index) ? (openBlock(), createElementBlock("span", _hoisted_1, [
|
|
160
|
-
renderSlot(_ctx.$slots, "separator", {}, () => [
|
|
161
|
-
createTextVNode(toDisplayString(__props.separator), 1)
|
|
162
|
-
], true)
|
|
163
|
-
])) : createCommentVNode("", true)
|
|
164
|
-
]);
|
|
165
|
-
}), 128)),
|
|
166
|
-
otherList.value.length ? (openBlock(), createBlock(_sfc_main$1, {
|
|
167
|
-
key: 0,
|
|
168
|
-
trigger: __props.trigger,
|
|
169
|
-
"popover-max-width": __props.popoverMaxWidth,
|
|
170
|
-
disabled: __props.popoverDisabled,
|
|
171
|
-
placement: "bottom-end"
|
|
172
|
-
}, {
|
|
173
|
-
reference: withCtx(() => [
|
|
174
|
-
renderSlot(_ctx.$slots, "reference", {
|
|
175
|
-
listLength: otherList.value.length,
|
|
176
|
-
items: otherList.value
|
|
177
|
-
}, () => [
|
|
178
|
-
createElementVNode("span", _hoisted_2, " (" + toDisplayString(otherList.value.length) + ") ", 1)
|
|
179
|
-
], true)
|
|
180
|
-
]),
|
|
181
|
-
default: withCtx(() => [
|
|
182
|
-
renderSlot(_ctx.$slots, "other-content", { list: otherList.value }, void 0, true)
|
|
183
|
-
]),
|
|
184
|
-
_: 3
|
|
185
|
-
}, 8, ["trigger", "popover-max-width", "disabled"])) : createCommentVNode("", true)
|
|
186
|
-
], 512)
|
|
187
|
-
])), [
|
|
188
|
-
[unref(resize), updateList]
|
|
189
|
-
]);
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
export {
|
|
194
|
-
_sfc_main as default
|
|
195
|
-
};
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, renderSlot, withModifiers, createVNode, toDisplayString, unref, withCtx, createTextVNode } from "vue";
|
|
2
|
-
import { tVU } from "../../localization/index.mjs";
|
|
3
|
-
import _sfc_main$2 from "../VcButton/VcButton.vue.mjs";
|
|
4
|
-
import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcButton/VcButton.css';/* empty css */
|
|
5
|
-
import _sfc_main$1 from "../VcIcon/VcIcon.vue.mjs";
|
|
6
|
-
/* empty css */
|
|
7
|
-
const _hoisted_1 = { class: "flex flex-col justify-center items-center w-full h-full" };
|
|
8
|
-
const _hoisted_2 = { class: "w-full flex justify-center items-center" };
|
|
9
|
-
const _hoisted_3 = { class: "flex justify-center items-center w-full" };
|
|
10
|
-
const _hoisted_4 = { class: "file-uploader border border-inactive-elements rounded-lg p-5 w-full" };
|
|
11
|
-
const _hoisted_5 = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "w-full flex gap-4 flex-col md:flex-row items-center justify-between md:h-24"
|
|
14
|
-
};
|
|
15
|
-
const _hoisted_6 = { class: "flex items-center flex-grow gap-2 lg:gap-4" };
|
|
16
|
-
const _hoisted_7 = { class: "text-base flex-grow md:ltr:pr-12 md:rtl:pl-12" };
|
|
17
|
-
const _hoisted_8 = {
|
|
18
|
-
key: 1,
|
|
19
|
-
class: "drop-zone w-full flex items-center justify-center h-24 rounded border-dashed border-2 border-active-elements"
|
|
20
|
-
};
|
|
21
|
-
const _hoisted_9 = { class: "text-md text-default-text" };
|
|
22
|
-
const _hoisted_10 = ["accept"];
|
|
23
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
|
-
__name: "VcExcelFileUploadBlock",
|
|
25
|
-
props: {
|
|
26
|
-
acceptFiles: { default: "*" },
|
|
27
|
-
uploadActions: { default: "" },
|
|
28
|
-
dropText: { default: "" },
|
|
29
|
-
fileUploaderInstructions: { default: "" },
|
|
30
|
-
resultFile: { default: "file" }
|
|
31
|
-
},
|
|
32
|
-
emits: ["add-files", "add-base-files"],
|
|
33
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
34
|
-
const props = __props;
|
|
35
|
-
const emit = __emit;
|
|
36
|
-
const fileInputRef = ref();
|
|
37
|
-
const isDragEnter = ref(false);
|
|
38
|
-
const onDragEnter = () => {
|
|
39
|
-
isDragEnter.value = true;
|
|
40
|
-
};
|
|
41
|
-
const onDragLeave = () => {
|
|
42
|
-
isDragEnter.value = false;
|
|
43
|
-
};
|
|
44
|
-
const onDrop = (e) => {
|
|
45
|
-
e.preventDefault();
|
|
46
|
-
isDragEnter.value = false;
|
|
47
|
-
const dt = e.dataTransfer;
|
|
48
|
-
const files = dt == null ? void 0 : dt.files;
|
|
49
|
-
if (files) {
|
|
50
|
-
validateFiles(files);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const validateFiles = (files) => {
|
|
54
|
-
for (let i = 0; i < files.length; i++) {
|
|
55
|
-
const file = files.item(i);
|
|
56
|
-
if (!file) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (props.resultFile === "base64") {
|
|
60
|
-
emitData(file);
|
|
61
|
-
} else {
|
|
62
|
-
emit("add-files", file);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const emitData = (file) => {
|
|
67
|
-
const reader = new FileReader();
|
|
68
|
-
reader.readAsDataURL(file);
|
|
69
|
-
reader.onload = (base64File) => {
|
|
70
|
-
emit("add-base-files", base64File);
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
const onChange = () => {
|
|
74
|
-
var _a;
|
|
75
|
-
const files = (_a = fileInputRef.value) == null ? void 0 : _a.files;
|
|
76
|
-
if (files) {
|
|
77
|
-
validateFiles(files);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
const browseFiles = () => {
|
|
81
|
-
var _a;
|
|
82
|
-
(_a = fileInputRef.value) == null ? void 0 : _a.click();
|
|
83
|
-
};
|
|
84
|
-
const addNewFile = () => {
|
|
85
|
-
browseFiles();
|
|
86
|
-
};
|
|
87
|
-
__expose({
|
|
88
|
-
getNewFile: addNewFile
|
|
89
|
-
});
|
|
90
|
-
return (_ctx, _cache) => {
|
|
91
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
92
|
-
createElementVNode("div", _hoisted_2, [
|
|
93
|
-
renderSlot(_ctx.$slots, "document-requirements", {}, void 0, true)
|
|
94
|
-
]),
|
|
95
|
-
createElementVNode("div", _hoisted_3, [
|
|
96
|
-
createElementVNode("div", _hoisted_4, [
|
|
97
|
-
createElementVNode("div", {
|
|
98
|
-
class: "w-full px-1 sm:px-8 py-1",
|
|
99
|
-
onDrop: withModifiers(onDrop, ["prevent"]),
|
|
100
|
-
onDragover: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
101
|
-
}, ["prevent"])),
|
|
102
|
-
onDragenter: withModifiers(onDragEnter, ["stop"]),
|
|
103
|
-
onDragleave: onDragLeave
|
|
104
|
-
}, [
|
|
105
|
-
!isDragEnter.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
106
|
-
createElementVNode("div", _hoisted_6, [
|
|
107
|
-
createVNode(_sfc_main$1, { icon: "vc-icon-upload icon-download text-active-elements ltr:mr-8 rtl:ml-8" }),
|
|
108
|
-
createElementVNode("span", _hoisted_7, toDisplayString(__props.fileUploaderInstructions || unref(tVU).t("voicenterUi.uploader.fileUploaderInstructions")), 1)
|
|
109
|
-
]),
|
|
110
|
-
createVNode(_sfc_main$2, {
|
|
111
|
-
icon: "vc-icon-search",
|
|
112
|
-
class: "mt-3 md:m-0",
|
|
113
|
-
onClick: browseFiles
|
|
114
|
-
}, {
|
|
115
|
-
default: withCtx(() => [
|
|
116
|
-
createTextVNode(toDisplayString(__props.uploadActions || unref(tVU).t("voicenterUi.uploader.browse")), 1)
|
|
117
|
-
]),
|
|
118
|
-
_: 1
|
|
119
|
-
})
|
|
120
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
121
|
-
createElementVNode("span", _hoisted_9, toDisplayString(__props.dropText || unref(tVU).t("voicenterUi.uploader.dropText")), 1)
|
|
122
|
-
])),
|
|
123
|
-
createElementVNode("input", {
|
|
124
|
-
ref_key: "fileInputRef",
|
|
125
|
-
ref: fileInputRef,
|
|
126
|
-
type: "file",
|
|
127
|
-
hidden: "",
|
|
128
|
-
multiple: false,
|
|
129
|
-
accept: __props.acceptFiles,
|
|
130
|
-
onChange
|
|
131
|
-
}, null, 40, _hoisted_10)
|
|
132
|
-
], 32)
|
|
133
|
-
])
|
|
134
|
-
])
|
|
135
|
-
]);
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
export {
|
|
140
|
-
_sfc_main as default
|
|
141
|
-
};
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createBlock, withCtx, createVNode, createCommentVNode, withDirectives, normalizeClass, vShow, createElementVNode, Fragment, renderList, withModifiers } from "vue";
|
|
2
|
-
import _sfc_main$2 from "./VcSoundPlayerError.vue.mjs";
|
|
3
|
-
import _sfc_main$3 from "./VcPlayerPlayStopButton.vue.mjs";
|
|
4
|
-
import _sfc_main$4 from "./VcPlayerSkipButtons.vue.mjs";
|
|
5
|
-
import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcPopover/VcPopover.css';import '../../assets/components/VcSoundplayer/VcSoundPlayerWrapper.css';import '../../assets/components/VcSoundplayer/VcSoundPlayerProgress.css';import '../../assets/components/VcSoundplayer/VcSoundVolume.css';import '../../assets/components/VcSoundplayer/VcPlayerSkipButtons.css';/* empty css */
|
|
6
|
-
import _sfc_main$6 from "./VcSoundCurrentTime.vue.mjs";
|
|
7
|
-
import _sfc_main$8 from "./VcSoundDuration.vue.mjs";
|
|
8
|
-
import _sfc_main$9 from "./VcSoundVolume.vue.mjs";
|
|
9
|
-
/* empty css */
|
|
10
|
-
import _sfc_main$7 from "./VcSoundPlayerProgress.vue.mjs";
|
|
11
|
-
/* empty css */
|
|
12
|
-
import _sfc_main$1 from "./VcSoundPlayerWrapper.vue.mjs";
|
|
13
|
-
/* empty css */
|
|
14
|
-
import { DEFAULT_OPTIONS } from "./player.options.mjs";
|
|
15
|
-
import _sfc_main$a from "../VcPopover/VcPopover.vue.mjs";
|
|
16
|
-
/* empty css */
|
|
17
|
-
import _sfc_main$5 from "../VcIcon/VcIcon.vue.mjs";
|
|
18
|
-
/* empty css */
|
|
19
|
-
const _hoisted_1 = { class: "vc-sound-player" };
|
|
20
|
-
const _hoisted_2 = {
|
|
21
|
-
key: 1,
|
|
22
|
-
class: "w-full flex items-center gap-x-2 relative"
|
|
23
|
-
};
|
|
24
|
-
const _hoisted_3 = {
|
|
25
|
-
key: 1,
|
|
26
|
-
class: "flex items-center px-1"
|
|
27
|
-
};
|
|
28
|
-
const _hoisted_4 = { key: 5 };
|
|
29
|
-
const _hoisted_5 = { class: "cursor-pointer text-inactive-elements hover:text-primary-actions duration-200" };
|
|
30
|
-
const _hoisted_6 = { class: "p-2" };
|
|
31
|
-
const _hoisted_7 = ["onClick"];
|
|
32
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
33
|
-
__name: "VcSoundPlayer",
|
|
34
|
-
props: {
|
|
35
|
-
soundId: { default: void 0 },
|
|
36
|
-
src: {},
|
|
37
|
-
currentPlay: { default: void 0 },
|
|
38
|
-
preIcon: { default: "" },
|
|
39
|
-
simple: { type: Boolean, default: false },
|
|
40
|
-
disabled: { type: Boolean, default: false },
|
|
41
|
-
showSkipButtons: { type: Boolean, default: false },
|
|
42
|
-
skipLength: { default: void 0 },
|
|
43
|
-
size: { default: "md" },
|
|
44
|
-
downloadLinks: { default: () => [] }
|
|
45
|
-
},
|
|
46
|
-
emits: ["ready", "start", "stop", "onPlay", "pause"],
|
|
47
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
48
|
-
const props = __props;
|
|
49
|
-
const emit = __emit;
|
|
50
|
-
const SoundPlayerWrapper = ref();
|
|
51
|
-
const isError = ref(false);
|
|
52
|
-
const audioErrorMessage = ref("");
|
|
53
|
-
const height = computed(() => {
|
|
54
|
-
return props.size === "sm" ? "h-4" : "h-8";
|
|
55
|
-
});
|
|
56
|
-
const playerOptions = computed(() => {
|
|
57
|
-
const configColors = getComputedStyle(document.body);
|
|
58
|
-
const activeColor = configColors.getPropertyValue("--primary-actions");
|
|
59
|
-
const inActiveColor = configColors.getPropertyValue("--ui-lines");
|
|
60
|
-
return {
|
|
61
|
-
...DEFAULT_OPTIONS,
|
|
62
|
-
height: props.size === "sm" ? 16 : 32,
|
|
63
|
-
waveColor: inActiveColor || DEFAULT_OPTIONS.waveColor,
|
|
64
|
-
progressColor: activeColor || DEFAULT_OPTIONS.progressColor
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
const showDownloadButton = computed(() => {
|
|
68
|
-
return props.downloadLinks.length > 0 && props.size === "md";
|
|
69
|
-
});
|
|
70
|
-
const iconClass = computed(() => {
|
|
71
|
-
const classes = {
|
|
72
|
-
md: "icon-2xl",
|
|
73
|
-
sm: "icon-lg"
|
|
74
|
-
};
|
|
75
|
-
return classes[props.size] || "icon-2md";
|
|
76
|
-
});
|
|
77
|
-
function onError(error) {
|
|
78
|
-
isError.value = true;
|
|
79
|
-
audioErrorMessage.value = error.message;
|
|
80
|
-
}
|
|
81
|
-
function initSound() {
|
|
82
|
-
var _a;
|
|
83
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.initSound();
|
|
84
|
-
}
|
|
85
|
-
function onStart(soundId, src) {
|
|
86
|
-
emit("start", soundId || "", src || "");
|
|
87
|
-
}
|
|
88
|
-
function onStop(soundId, src) {
|
|
89
|
-
emit("stop", soundId || "", src || "");
|
|
90
|
-
}
|
|
91
|
-
function onPlay(soundId, src) {
|
|
92
|
-
emit("onPlay", soundId || "", src || "");
|
|
93
|
-
}
|
|
94
|
-
function onPause(soundId, src) {
|
|
95
|
-
emit("pause", soundId || "", src || "");
|
|
96
|
-
}
|
|
97
|
-
function onReady(soundId) {
|
|
98
|
-
emit("ready", soundId);
|
|
99
|
-
}
|
|
100
|
-
function stop() {
|
|
101
|
-
var _a;
|
|
102
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.stop();
|
|
103
|
-
}
|
|
104
|
-
function pause() {
|
|
105
|
-
var _a;
|
|
106
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.pause();
|
|
107
|
-
}
|
|
108
|
-
function play() {
|
|
109
|
-
var _a;
|
|
110
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.play();
|
|
111
|
-
}
|
|
112
|
-
function setVolume() {
|
|
113
|
-
var _a;
|
|
114
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.setVolume();
|
|
115
|
-
}
|
|
116
|
-
function resetInitSound() {
|
|
117
|
-
var _a;
|
|
118
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.resetInitSound();
|
|
119
|
-
}
|
|
120
|
-
function skipBackward() {
|
|
121
|
-
var _a;
|
|
122
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.skipBackward();
|
|
123
|
-
}
|
|
124
|
-
function skipForward() {
|
|
125
|
-
var _a;
|
|
126
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.skipForward();
|
|
127
|
-
}
|
|
128
|
-
function toTime(time) {
|
|
129
|
-
var _a;
|
|
130
|
-
(_a = SoundPlayerWrapper.value) == null ? void 0 : _a.setTime(time);
|
|
131
|
-
}
|
|
132
|
-
async function download(sound) {
|
|
133
|
-
const response = await fetch(sound);
|
|
134
|
-
const dataBlob = await response.blob();
|
|
135
|
-
const url = window.URL.createObjectURL(dataBlob);
|
|
136
|
-
const link = document.createElement("a");
|
|
137
|
-
const splitedUrl = sound.split("/");
|
|
138
|
-
link.href = url;
|
|
139
|
-
link.setAttribute("download", splitedUrl[splitedUrl.length - 1]);
|
|
140
|
-
document.body.appendChild(link);
|
|
141
|
-
link.click();
|
|
142
|
-
link.remove();
|
|
143
|
-
return dataBlob;
|
|
144
|
-
}
|
|
145
|
-
function downloadIconType(item) {
|
|
146
|
-
const splitUrl = item.split(".");
|
|
147
|
-
const type = splitUrl[splitUrl.length - 1];
|
|
148
|
-
if (type === "mp3") {
|
|
149
|
-
return "vc-icon-mp3";
|
|
150
|
-
}
|
|
151
|
-
return "vc-icon-wav";
|
|
152
|
-
}
|
|
153
|
-
watch(
|
|
154
|
-
() => props.src,
|
|
155
|
-
(newValue) => {
|
|
156
|
-
isError.value = false;
|
|
157
|
-
audioErrorMessage.value = "";
|
|
158
|
-
if (newValue) {
|
|
159
|
-
initSound();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
__expose({
|
|
164
|
-
download,
|
|
165
|
-
skipForward,
|
|
166
|
-
skipBackward,
|
|
167
|
-
resetInitSound,
|
|
168
|
-
setVolume,
|
|
169
|
-
play,
|
|
170
|
-
pause,
|
|
171
|
-
stop,
|
|
172
|
-
initSound,
|
|
173
|
-
toTime
|
|
174
|
-
});
|
|
175
|
-
return (_ctx, _cache) => {
|
|
176
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
177
|
-
__props.src ? (openBlock(), createBlock(_sfc_main$1, {
|
|
178
|
-
key: 0,
|
|
179
|
-
ref_key: "SoundPlayerWrapper",
|
|
180
|
-
ref: SoundPlayerWrapper,
|
|
181
|
-
disabled: __props.disabled,
|
|
182
|
-
src: __props.src,
|
|
183
|
-
"current-play": __props.currentPlay,
|
|
184
|
-
size: __props.size,
|
|
185
|
-
"sound-id": __props.soundId,
|
|
186
|
-
options: playerOptions.value,
|
|
187
|
-
"skip-seconds": __props.skipLength,
|
|
188
|
-
class: "w-full",
|
|
189
|
-
onReady,
|
|
190
|
-
onPause,
|
|
191
|
-
onOnPlay: onPlay,
|
|
192
|
-
onStart,
|
|
193
|
-
onStop,
|
|
194
|
-
onOnError: onError
|
|
195
|
-
}, {
|
|
196
|
-
default: withCtx(() => [
|
|
197
|
-
isError.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
198
|
-
key: 0,
|
|
199
|
-
"is-simple": __props.simple,
|
|
200
|
-
"audio-error-message": audioErrorMessage.value
|
|
201
|
-
}, null, 8, ["is-simple", "audio-error-message"])) : (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
202
|
-
createVNode(_sfc_main$3, {
|
|
203
|
-
disabled: __props.disabled,
|
|
204
|
-
"icon-class": iconClass.value,
|
|
205
|
-
class: "gap-x-3"
|
|
206
|
-
}, null, 8, ["disabled", "icon-class"]),
|
|
207
|
-
__props.showSkipButtons ? (openBlock(), createBlock(_sfc_main$4, {
|
|
208
|
-
key: 0,
|
|
209
|
-
"icon-class": iconClass.value
|
|
210
|
-
}, null, 8, ["icon-class"])) : createCommentVNode("", true),
|
|
211
|
-
__props.preIcon && !__props.simple ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
212
|
-
createVNode(_sfc_main$5, {
|
|
213
|
-
icon: __props.preIcon,
|
|
214
|
-
class: "text-primary-actions icon-base"
|
|
215
|
-
}, null, 8, ["icon"])
|
|
216
|
-
])) : createCommentVNode("", true),
|
|
217
|
-
!__props.simple ? (openBlock(), createBlock(_sfc_main$6, {
|
|
218
|
-
key: 2,
|
|
219
|
-
class: "sound-time-current"
|
|
220
|
-
})) : createCommentVNode("", true),
|
|
221
|
-
withDirectives(createVNode(_sfc_main$7, {
|
|
222
|
-
class: normalizeClass(height.value)
|
|
223
|
-
}, null, 8, ["class"]), [
|
|
224
|
-
[vShow, !__props.simple]
|
|
225
|
-
]),
|
|
226
|
-
!__props.simple ? (openBlock(), createBlock(_sfc_main$8, {
|
|
227
|
-
key: 3,
|
|
228
|
-
class: "sound-duration"
|
|
229
|
-
})) : createCommentVNode("", true),
|
|
230
|
-
!__props.simple ? (openBlock(), createBlock(_sfc_main$9, {
|
|
231
|
-
key: 4,
|
|
232
|
-
disabled: __props.disabled
|
|
233
|
-
}, null, 8, ["disabled"])) : createCommentVNode("", true),
|
|
234
|
-
showDownloadButton.value && !__props.simple ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
235
|
-
createVNode(_sfc_main$a, {
|
|
236
|
-
disabled: __props.disabled,
|
|
237
|
-
"popover-class": "!min-w-max",
|
|
238
|
-
"popover-width": "auto"
|
|
239
|
-
}, {
|
|
240
|
-
reference: withCtx(() => [
|
|
241
|
-
createElementVNode("span", _hoisted_5, [
|
|
242
|
-
createVNode(_sfc_main$5, { icon: "vc-icon-menu" })
|
|
243
|
-
])
|
|
244
|
-
]),
|
|
245
|
-
default: withCtx(() => [
|
|
246
|
-
createElementVNode("div", _hoisted_6, [
|
|
247
|
-
_cache[0] || (_cache[0] = createElementVNode("div", { class: "font-medium text-xs mb-1" }, " Download: ", -1)),
|
|
248
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.downloadLinks, (item, index) => {
|
|
249
|
-
return openBlock(), createElementBlock("div", {
|
|
250
|
-
key: index,
|
|
251
|
-
class: "cursor-pointer right-offset p-1 flex items-center hover:bg-primary-actions-bg--focus duration-200 rounded-sm",
|
|
252
|
-
onClick: withModifiers(($event) => download(item), ["stop"])
|
|
253
|
-
}, [
|
|
254
|
-
createVNode(_sfc_main$5, {
|
|
255
|
-
class: "text-primary-actions icon-xl",
|
|
256
|
-
icon: downloadIconType(item)
|
|
257
|
-
}, null, 8, ["icon"])
|
|
258
|
-
], 8, _hoisted_7);
|
|
259
|
-
}), 128))
|
|
260
|
-
])
|
|
261
|
-
]),
|
|
262
|
-
_: 1
|
|
263
|
-
}, 8, ["disabled"])
|
|
264
|
-
])) : createCommentVNode("", true)
|
|
265
|
-
]))
|
|
266
|
-
]),
|
|
267
|
-
_: 1
|
|
268
|
-
}, 8, ["disabled", "src", "current-play", "size", "sound-id", "options", "skip-seconds"])) : createCommentVNode("", true)
|
|
269
|
-
]);
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
export {
|
|
274
|
-
_sfc_main as default
|
|
275
|
-
};
|