@voicenter-team/voicenter-ui-plus 3.4.4 → 3.4.6
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/README.md +502 -502
- package/library/assets/assets/sass/main.css +1 -1
- package/library/assets/components/VcAvatar/VcAvatar.css +1 -0
- package/library/assets/components/VcBadgeTag/VcBadgeTag.css +1 -0
- package/library/assets/components/VcChatComposer/VcChatComposer.css +1 -0
- package/library/assets/components/VcEmojiPicker/VcEmojiPicker.css +1 -0
- package/library/assets/components/VcFileUploader/VcFileItem.css +1 -0
- package/library/assets/components/VcFileUploader/VcFileUploaderArea.css +1 -1
- package/library/assets/components/VcFileUploader/VcFileUploaderSimple.css +1 -1
- package/library/assets/components/VcJsonSchema/Components/JsonSchemaEditor.css +1 -1
- package/library/assets/components/VcLoading/Loaders/Circles.css +1 -1
- package/library/assets/components/VcLoading/Loaders/DotSpinner.css +1 -1
- package/library/assets/components/VcLoading/Loaders/LdsSpinner.css +1 -1
- package/library/assets/components/VcLoading/Loaders/LoadIcon.css +1 -1
- package/library/assets/components/VcLoading/Loaders/Stretch.css +1 -1
- package/library/assets/components/VcLoading/VcLoading.css +1 -1
- package/library/assets/components/VcMdEditor/ParameterNode.css +1 -1
- package/library/assets/components/VcMessage/VcMessage.css +1 -0
- package/library/assets/components/VcMessage/content/VcMessageAudioBlock.css +1 -0
- package/library/assets/components/VcMessage/content/VcMessageFileBlock.css +1 -0
- package/library/assets/components/VcMessage/content/VcMessageImageBlock.css +1 -0
- package/library/assets/components/VcMessage/content/VcMessageTextBlock.css +1 -0
- package/library/assets/components/VcMessage/reactions/VcMessageEmojiPicker.css +1 -0
- package/library/assets/components/VcMessage/reactions/VcMessageReactionBar.css +1 -0
- package/library/assets/components/VcMessagesWrapper/VcMessagesWrapper.css +1 -0
- package/library/assets/components/VcSkeletonLoader/Loaders/Card.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Circle.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Row.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Square.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Text.css +1 -1
- package/library/components/VcAvatar/VcAvatar.vue.mjs +62 -0
- package/library/components/VcAvatar/VcAvatar.vue3.mjs +5 -0
- package/library/components/VcBadgeTag/VcBadgeTag.vue.mjs +31 -0
- package/library/components/VcBadgeTag/VcBadgeTag.vue3.mjs +5 -0
- package/library/components/VcChatComposer/VcChatComposer.vue.mjs +554 -0
- package/library/components/VcChatComposer/VcChatComposer.vue3.mjs +5 -0
- package/library/components/VcChatComposer/richText.mjs +320 -0
- package/library/components/VcEmojiPicker/VcEmojiPicker.vue.mjs +387 -0
- package/library/components/VcEmojiPicker/VcEmojiPicker.vue3.mjs +5 -0
- package/library/components/VcEmojiPicker/emojiData.mjs +26 -0
- package/library/components/VcFileUploader/VcFileItem.vue.mjs +146 -0
- package/library/components/VcFileUploader/VcFileItem.vue3.mjs +5 -0
- package/library/components/VcFileUploader/VcFileUploaderArea.vue.mjs +24 -147
- package/library/components/VcFileUploader/VcFileUploaderSimple.vue.mjs +1 -1
- package/library/components/VcJsonSchema/Components/JsonSchemaEditor.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/Circles.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/DotSpinner.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/DotSpinner.vue2.mjs +2 -2
- package/library/components/VcLoading/Loaders/LdsSpinner.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/LoadIcon.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/Stretch.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/Stretch.vue2.mjs +1 -1
- package/library/components/VcLoading/VcLoading.vue.mjs +1 -1
- package/library/components/VcMdEditor/ParameterNode.vue.mjs +1 -1
- package/library/components/VcMessage/VcMessage.vue.mjs +212 -0
- package/library/components/VcMessage/VcMessage.vue3.mjs +5 -0
- package/library/components/VcMessage/content/VcMessageAudioBlock.vue.mjs +53 -0
- package/library/components/VcMessage/content/VcMessageAudioBlock.vue3.mjs +5 -0
- package/library/components/VcMessage/content/VcMessageFileBlock.vue.mjs +80 -0
- package/library/components/VcMessage/content/VcMessageFileBlock.vue3.mjs +5 -0
- package/library/components/VcMessage/content/VcMessageImageBlock.vue.mjs +57 -0
- package/library/components/VcMessage/content/VcMessageImageBlock.vue3.mjs +5 -0
- package/library/components/VcMessage/content/VcMessageTextBlock.vue.mjs +19 -0
- package/library/components/VcMessage/content/VcMessageTextBlock.vue3.mjs +5 -0
- package/library/components/VcMessage/content/messageContentComponents.mjs +17 -0
- package/library/components/VcMessage/reactions/VcMessageEmojiPicker.vue.mjs +167 -0
- package/library/components/VcMessage/reactions/VcMessageEmojiPicker.vue3.mjs +5 -0
- package/library/components/VcMessage/reactions/VcMessageReactionBar.vue.mjs +82 -0
- package/library/components/VcMessage/reactions/VcMessageReactionBar.vue3.mjs +5 -0
- package/library/components/VcMessage/reactions/emojis.mjs +4 -0
- package/library/components/VcMessagesWrapper/VcMessagesWrapper.vue.mjs +243 -0
- package/library/components/VcMessagesWrapper/VcMessagesWrapper.vue3.mjs +5 -0
- package/library/components/VcSkeletonLoader/Loaders/Card.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Circle.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Row.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Square.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Text.vue.mjs +1 -1
- package/library/components/VcSoundplayer/useSoundPlayerProvideInject.mjs +1 -1
- package/library/composables/useAudioRecorder.mjs +120 -0
- package/library/enum/fileTypes.mjs +51 -0
- package/library/index.mjs +237 -216
- package/library/index.mjs.br +0 -0
- package/library/index.mjs.gz +0 -0
- package/library/localization/index.mjs.gz +0 -0
- package/library/localization/locales/en.json.mjs +24 -1
- package/library/plugin-components.gen.mjs +171 -150
- package/library/plugin.mjs +235 -214
- package/library/plugin.mjs.br +0 -0
- package/library/plugin.mjs.gz +0 -0
- package/library/style.css +42 -16
- package/library/style.css.br +0 -0
- package/library/style.css.gz +0 -0
- package/library/theme/index.mjs.gz +0 -0
- package/library/types/components/VcAvatar/VcAvatar.vue.d.ts +47 -0
- package/library/types/components/VcBadgeTag/VcBadgeTag.vue.d.ts +42 -0
- package/library/types/components/VcChatComposer/VcChatComposer.vue.d.ts +81 -0
- package/library/types/components/VcChatComposer/richText.d.ts +12 -0
- package/library/types/components/VcCollapse/VcCollapseItem.vue.d.ts +1 -1
- package/library/types/components/VcEmojiPicker/VcEmojiPicker.vue.d.ts +63 -0
- package/library/types/components/VcEmojiPicker/emojiData.d.ts +16 -0
- package/library/types/components/VcExcelUploader/VcExcelFileUploadBlock.vue.d.ts +1 -1
- package/library/types/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.vue.d.ts +2 -2
- package/library/types/components/VcFileUploader/VcFileItem.vue.d.ts +85 -0
- package/library/types/components/VcFileUploader/VcFileUploader.vue.d.ts +3 -3
- package/library/types/components/VcFileUploader/VcFileUploaderArea.vue.d.ts +17 -18
- package/library/types/components/VcFileUploader/VcFileUploaderSimple.vue.d.ts +3 -3
- package/library/types/components/VcForm/VcForm.vue.d.ts +1 -1
- package/library/types/components/VcMessage/VcMessage.vue.d.ts +66 -0
- package/library/types/components/VcMessage/content/VcMessageAudioBlock.vue.d.ts +24 -0
- package/library/types/components/VcMessage/content/VcMessageFileBlock.vue.d.ts +24 -0
- package/library/types/components/VcMessage/content/VcMessageImageBlock.vue.d.ts +28 -0
- package/library/types/components/VcMessage/content/VcMessageTextBlock.vue.d.ts +24 -0
- package/library/types/components/VcMessage/content/messageContentComponents.d.ts +3 -0
- package/library/types/components/VcMessage/reactions/VcMessageEmojiPicker.vue.d.ts +68 -0
- package/library/types/components/VcMessage/reactions/VcMessageReactionBar.vue.d.ts +28 -0
- package/library/types/components/VcMessage/reactions/emojis.d.ts +1 -0
- package/library/types/components/VcMessagesWrapper/VcMessagesWrapper.vue.d.ts +71 -0
- package/library/types/components/VcProgress/VcProgress.vue.d.ts +1 -1
- package/library/types/components/VcRadioGroup/VcRadioGroup.vue.d.ts +3 -3
- package/library/types/components/VcSelect/VcInfiniteScrollSelect.vue.d.ts +6 -6
- package/library/types/components/VcSelect/VcSelect.vue.d.ts +6 -6
- package/library/types/components/VcSelect/VcSelectGrouped.vue.d.ts +6 -6
- package/library/types/components/VcSelect/VcSelectOption.vue.d.ts +3 -3
- package/library/types/components/VcTree/VcTree.vue.d.ts +6 -6
- package/library/types/components/VcTree/VcTreeSelect.vue.d.ts +3 -3
- package/library/types/components/VcWizard/VcSummaryStep.vue.d.ts +1 -1
- package/library/types/components/VcWizard/VcWizardSummary.vue.d.ts +1 -1
- package/library/types/components/exports.d.ts +15 -1
- package/library/types/components.gen.d.ts +7 -0
- package/library/types/composables/useAudioRecorder.d.ts +18 -0
- package/library/types/entity/components/Button/VcEntityDeleteIconButton.vue.d.ts +3 -3
- package/library/types/enum/fileTypes.d.ts +3 -0
- package/library/types/localization/locales/en.json.d.ts +187 -164
- package/library/types/theme/themes.json.d.ts +227 -227
- package/library/types/types/VcAvatar.types.d.ts +35 -0
- package/library/types/types/VcBadgeTag.types.d.ts +19 -0
- package/library/types/types/VcChatComposer.types.d.ts +112 -0
- package/library/types/types/VcEmojiPicker.types.d.ts +20 -0
- package/library/types/types/VcFileUploader.types.d.ts +4 -0
- package/library/types/types/VcMessage.types.d.ts +131 -0
- package/library/types/types/VcMessagesWrapper.types.d.ts +61 -0
- package/library/types/types/index.d.ts +6 -0
- package/library/utils/jsonSchema/index.mjs.gz +0 -0
- package/package.json +215 -185
- package/src/theme/index.ts +101 -101
- package/src/theme/tailwindScheme.js +37 -37
- package/src/theme/theme.types.ts +31 -31
- package/src/theme/themeMerge.ts +40 -40
- package/src/theme/themes.json +227 -227
- package/tailwind.config.d.ts +5 -5
- package/tailwind.config.js +192 -192
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const EXCLUDED_GROUP_KEYS = ["component"];
|
|
2
|
+
let groupsPromise;
|
|
3
|
+
function loadEmojiGroups() {
|
|
4
|
+
groupsPromise ?? (groupsPromise = Promise.all([
|
|
5
|
+
import("emojibase-data/en/data.json"),
|
|
6
|
+
import("emojibase-data/en/messages.json")
|
|
7
|
+
]).then(([{ default: data }, { default: messages }]) => {
|
|
8
|
+
return [...messages.groups].sort((a, b) => a.order - b.order).filter((group) => !EXCLUDED_GROUP_KEYS.includes(group.key)).map((group) => ({
|
|
9
|
+
key: group.key,
|
|
10
|
+
label: group.message,
|
|
11
|
+
emojis: data.filter((emoji) => emoji.group === group.order).sort((a, b) => (a.order ?? 0) - (b.order ?? 0)).map((emoji) => ({
|
|
12
|
+
emoji: emoji.emoji,
|
|
13
|
+
label: emoji.label,
|
|
14
|
+
tags: emoji.tags ?? [],
|
|
15
|
+
version: emoji.version
|
|
16
|
+
}))
|
|
17
|
+
}));
|
|
18
|
+
}).catch((error) => {
|
|
19
|
+
groupsPromise = void 0;
|
|
20
|
+
throw error;
|
|
21
|
+
}));
|
|
22
|
+
return groupsPromise;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
loadEmojiGroups
|
|
26
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import '../../assets/components/VcFileUploader/VcFileItem.css';
|
|
2
|
+
import { defineComponent, computed, ref, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, createElementVNode, toDisplayString, Fragment, createBlock, unref, createCommentVNode } from "vue";
|
|
3
|
+
import { RefreshCw, X } from "@lucide/vue";
|
|
4
|
+
import _sfc_main$1 from "../VcIcon/VcIcon.vue.mjs";
|
|
5
|
+
import '../../assets/components/VcButton/VcButtonIcon.css';import '../../assets/components/VcIcon/VcIcon.css';/* empty css */
|
|
6
|
+
import _sfc_main$2 from "../VcButton/VcButtonIcon.vue.mjs";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { DEFAULT_FILE_TYPE, DEFAULT_FILE_TYPE_MAP } from "../../enum/fileTypes.mjs";
|
|
9
|
+
import { getFileSize } from "../../utils/helpers.mjs";
|
|
10
|
+
import { tVU } from "../../localization/index.mjs";
|
|
11
|
+
const _hoisted_1 = ["src", "alt"];
|
|
12
|
+
const _hoisted_2 = { class: "vc-file-item__info" };
|
|
13
|
+
const _hoisted_3 = { class: "vc-file-item__name" };
|
|
14
|
+
const _hoisted_4 = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "vc-file-item__meta vc-file-item__error"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_5 = { class: "vc-file-item__meta" };
|
|
19
|
+
const _hoisted_6 = ["aria-valuenow"];
|
|
20
|
+
const _hoisted_7 = {
|
|
21
|
+
key: 2,
|
|
22
|
+
class: "vc-file-item__meta"
|
|
23
|
+
};
|
|
24
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
25
|
+
__name: "VcFileItem",
|
|
26
|
+
props: {
|
|
27
|
+
file: {},
|
|
28
|
+
fileTypeMap: { default: void 0 },
|
|
29
|
+
removable: { type: Boolean, default: true },
|
|
30
|
+
disabled: { type: Boolean, default: false },
|
|
31
|
+
status: { default: void 0 },
|
|
32
|
+
progress: { default: 0 }
|
|
33
|
+
},
|
|
34
|
+
emits: ["remove", "retry"],
|
|
35
|
+
setup(__props, { emit: __emit }) {
|
|
36
|
+
const props = __props;
|
|
37
|
+
const emit = __emit;
|
|
38
|
+
const uploadFailedText = computed(() => tVU.t("voicenterUi.fileItem.uploadFailed"));
|
|
39
|
+
const retryText = computed(() => tVU.t("voicenterUi.fileItem.retry"));
|
|
40
|
+
const progressPercent = computed(() => Math.round(Math.min(Math.max(props.progress, 0), 100)));
|
|
41
|
+
const extension = computed(() => {
|
|
42
|
+
var _a;
|
|
43
|
+
const parts = props.file.name.split(".");
|
|
44
|
+
return parts.length > 1 ? ((_a = parts.pop()) == null ? void 0 : _a.toLowerCase()) ?? "" : "";
|
|
45
|
+
});
|
|
46
|
+
const fileType = computed(() => {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
const fallback = ((_a = props.fileTypeMap) == null ? void 0 : _a.default) ?? DEFAULT_FILE_TYPE;
|
|
49
|
+
const base = DEFAULT_FILE_TYPE_MAP[extension.value] ?? fallback;
|
|
50
|
+
const override = (_b = props.fileTypeMap) == null ? void 0 : _b[extension.value];
|
|
51
|
+
return {
|
|
52
|
+
icon: (override == null ? void 0 : override.icon) ?? base.icon,
|
|
53
|
+
color: (override == null ? void 0 : override.color) ?? base.color
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
const iconStyle = computed(() => ({
|
|
57
|
+
color: fileType.value.color,
|
|
58
|
+
backgroundColor: `color-mix(in srgb, ${fileType.value.color} 15%, transparent)`
|
|
59
|
+
}));
|
|
60
|
+
const meta = computed(() => {
|
|
61
|
+
const [value, measure] = getFileSize(props.file.size);
|
|
62
|
+
const size = `${value}${measure}`;
|
|
63
|
+
return extension.value ? `${extension.value.toUpperCase()} · ${size}` : size;
|
|
64
|
+
});
|
|
65
|
+
const objectUrl = ref();
|
|
66
|
+
function revokeObjectUrl() {
|
|
67
|
+
if (objectUrl.value) {
|
|
68
|
+
URL.revokeObjectURL(objectUrl.value);
|
|
69
|
+
objectUrl.value = void 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
watch(() => props.file.File, (source) => {
|
|
73
|
+
revokeObjectUrl();
|
|
74
|
+
if (source instanceof File && props.file.type.startsWith("image/")) {
|
|
75
|
+
objectUrl.value = URL.createObjectURL(source);
|
|
76
|
+
}
|
|
77
|
+
}, { immediate: true });
|
|
78
|
+
onBeforeUnmount(revokeObjectUrl);
|
|
79
|
+
const previewUrl = computed(() => {
|
|
80
|
+
if (!props.file.type.startsWith("image/")) {
|
|
81
|
+
return void 0;
|
|
82
|
+
}
|
|
83
|
+
return typeof props.file.File === "string" ? props.file.File : objectUrl.value;
|
|
84
|
+
});
|
|
85
|
+
return (_ctx, _cache) => {
|
|
86
|
+
return openBlock(), createElementBlock("div", {
|
|
87
|
+
class: normalizeClass([{ "is--disabled": __props.disabled, [`is--${__props.status}`]: __props.status }, "vc-file-item"])
|
|
88
|
+
}, [
|
|
89
|
+
previewUrl.value ? (openBlock(), createElementBlock("img", {
|
|
90
|
+
key: 0,
|
|
91
|
+
src: previewUrl.value,
|
|
92
|
+
alt: __props.file.name,
|
|
93
|
+
class: "vc-file-item__preview"
|
|
94
|
+
}, null, 8, _hoisted_1)) : (openBlock(), createElementBlock("div", {
|
|
95
|
+
key: 1,
|
|
96
|
+
class: "vc-file-item__icon",
|
|
97
|
+
style: normalizeStyle(iconStyle.value)
|
|
98
|
+
}, [
|
|
99
|
+
createVNode(_sfc_main$1, {
|
|
100
|
+
icon: fileType.value.icon,
|
|
101
|
+
size: 20
|
|
102
|
+
}, null, 8, ["icon"])
|
|
103
|
+
], 4)),
|
|
104
|
+
createElementVNode("div", _hoisted_2, [
|
|
105
|
+
createElementVNode("span", _hoisted_3, toDisplayString(__props.file.name), 1),
|
|
106
|
+
__props.status === "error" ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(uploadFailedText.value), 1)) : __props.status === "uploading" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
107
|
+
createElementVNode("span", _hoisted_5, toDisplayString(meta.value) + " · " + toDisplayString(progressPercent.value) + "%", 1),
|
|
108
|
+
createElementVNode("span", {
|
|
109
|
+
role: "progressbar",
|
|
110
|
+
"aria-valuenow": progressPercent.value,
|
|
111
|
+
"aria-valuemin": "0",
|
|
112
|
+
"aria-valuemax": "100",
|
|
113
|
+
class: "vc-file-item__progress"
|
|
114
|
+
}, [
|
|
115
|
+
createElementVNode("span", {
|
|
116
|
+
class: "vc-file-item__progress-value",
|
|
117
|
+
style: normalizeStyle({ width: `${progressPercent.value}%` })
|
|
118
|
+
}, null, 4)
|
|
119
|
+
], 8, _hoisted_6)
|
|
120
|
+
], 64)) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(meta.value), 1))
|
|
121
|
+
]),
|
|
122
|
+
__props.status === "error" ? (openBlock(), createBlock(_sfc_main$2, {
|
|
123
|
+
key: 2,
|
|
124
|
+
icon: unref(RefreshCw),
|
|
125
|
+
disabled: __props.disabled,
|
|
126
|
+
title: retryText.value,
|
|
127
|
+
"aria-label": retryText.value,
|
|
128
|
+
color: "primary-alternative",
|
|
129
|
+
class: "vc-file-item__retry",
|
|
130
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("retry"))
|
|
131
|
+
}, null, 8, ["icon", "disabled", "title", "aria-label"])) : createCommentVNode("", true),
|
|
132
|
+
__props.removable ? (openBlock(), createBlock(_sfc_main$2, {
|
|
133
|
+
key: 3,
|
|
134
|
+
icon: unref(X),
|
|
135
|
+
disabled: __props.disabled,
|
|
136
|
+
color: "destructive",
|
|
137
|
+
class: "vc-file-item__remove",
|
|
138
|
+
onClick: _cache[1] || (_cache[1] = ($event) => emit("remove"))
|
|
139
|
+
}, null, 8, ["icon", "disabled"])) : createCommentVNode("", true)
|
|
140
|
+
], 2);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
export {
|
|
145
|
+
_sfc_main as default
|
|
146
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import '../../assets/components/VcFileUploader/VcFileUploaderArea.css';
|
|
2
|
-
import { defineComponent, ref, computed,
|
|
2
|
+
import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeStyle, unref, createBlock, createCommentVNode, createElementVNode, withModifiers, normalizeClass, renderSlot, createVNode, toDisplayString, createTextVNode, Fragment, renderList } from "vue";
|
|
3
3
|
import _sfc_main$1 from "../VcForm/UiComponents/VcInputLabel.vue.mjs";
|
|
4
|
-
import '../../assets/components/
|
|
4
|
+
import '../../assets/components/VcFileUploader/VcFileItem.css';import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcForm/UiComponents/VcInputLabel.css';/* empty css */
|
|
5
5
|
import _sfc_main$2 from "../VcIcon/VcIcon.vue.mjs";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import _sfc_main$3 from "
|
|
8
|
-
/* empty css
|
|
7
|
+
import _sfc_main$3 from "./VcFileItem.vue.mjs";
|
|
8
|
+
/* empty css */
|
|
9
9
|
import useInputBase from "../../composables/input/useInputBase.mjs";
|
|
10
10
|
import useFileUploader from "../../composables/input/useFileUploader.mjs";
|
|
11
|
-
import { convertToUnit
|
|
11
|
+
import { convertToUnit } from "../../utils/helpers.mjs";
|
|
12
12
|
import { tVU } from "../../localization/index.mjs";
|
|
13
|
-
import { UploadCloud
|
|
13
|
+
import { UploadCloud } from "@lucide/vue";
|
|
14
14
|
const _hoisted_1 = ["data-test"];
|
|
15
15
|
const _hoisted_2 = { class: "vc-file-uploader-area__text" };
|
|
16
16
|
const _hoisted_3 = { class: "vc-file-uploader-area__link" };
|
|
@@ -24,10 +24,10 @@ const _hoisted_6 = {
|
|
|
24
24
|
class: "vc-input__error-wrapper"
|
|
25
25
|
};
|
|
26
26
|
const _hoisted_7 = { class: "vc-input__error-wrapper--text" };
|
|
27
|
-
const _hoisted_8 =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const _hoisted_8 = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "vc-file-uploader-area__item"
|
|
30
|
+
};
|
|
31
31
|
const DEFAULT_BUTTON_COLOR = "primary";
|
|
32
32
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
33
33
|
__name: "VcFileUploaderArea",
|
|
@@ -77,52 +77,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
77
|
},
|
|
78
78
|
emits: ["update:modelValue", "input"],
|
|
79
79
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
80
|
-
const DEFAULT_FILE_TYPE = {
|
|
81
|
-
icon: FileText,
|
|
82
|
-
color: "var(--secondary-actions)"
|
|
83
|
-
};
|
|
84
|
-
const DEFAULT_FILE_TYPE_MAP = {
|
|
85
|
-
pdf: {
|
|
86
|
-
icon: FileText,
|
|
87
|
-
color: "#D34C4C"
|
|
88
|
-
},
|
|
89
|
-
doc: {
|
|
90
|
-
icon: FileText,
|
|
91
|
-
color: "var(--secondary-text)"
|
|
92
|
-
},
|
|
93
|
-
docx: {
|
|
94
|
-
icon: FileText,
|
|
95
|
-
color: "var(--secondary-text)"
|
|
96
|
-
},
|
|
97
|
-
txt: {
|
|
98
|
-
icon: FileText,
|
|
99
|
-
color: "var(--secondary-text)"
|
|
100
|
-
},
|
|
101
|
-
xls: {
|
|
102
|
-
icon: FileSpreadsheet,
|
|
103
|
-
color: "var(--success-actions)"
|
|
104
|
-
},
|
|
105
|
-
xlsx: {
|
|
106
|
-
icon: FileSpreadsheet,
|
|
107
|
-
color: "var(--success-actions)"
|
|
108
|
-
},
|
|
109
|
-
csv: {
|
|
110
|
-
icon: FileSpreadsheet,
|
|
111
|
-
color: "var(--success-actions)"
|
|
112
|
-
},
|
|
113
|
-
zip: {
|
|
114
|
-
icon: FileArchive,
|
|
115
|
-
color: "var(--warning-actions)"
|
|
116
|
-
},
|
|
117
|
-
rar: {
|
|
118
|
-
icon: FileArchive,
|
|
119
|
-
color: "var(--warning-actions)"
|
|
120
|
-
},
|
|
121
|
-
"7z": {
|
|
122
|
-
icon: FileArchive,
|
|
123
|
-
color: "var(--warning-actions)"
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
80
|
const props = __props;
|
|
127
81
|
const emit = __emit;
|
|
128
82
|
const { maxWidthStyle } = useInputBase(props, {
|
|
@@ -163,63 +117,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
163
117
|
isDragOver.value = false;
|
|
164
118
|
await selectFiles(((_a = event.dataTransfer) == null ? void 0 : _a.files) ?? null);
|
|
165
119
|
}
|
|
166
|
-
const previewCache = /* @__PURE__ */ new Map();
|
|
167
|
-
function isImageFile(item) {
|
|
168
|
-
return item.type.startsWith("image/");
|
|
169
|
-
}
|
|
170
|
-
function previewUrl(item) {
|
|
171
|
-
if (typeof item.File === "string") {
|
|
172
|
-
return item.File;
|
|
173
|
-
}
|
|
174
|
-
if (!(item.File instanceof File)) return void 0;
|
|
175
|
-
let url = previewCache.get(item.File);
|
|
176
|
-
if (!url) {
|
|
177
|
-
url = URL.createObjectURL(item.File);
|
|
178
|
-
previewCache.set(item.File, url);
|
|
179
|
-
}
|
|
180
|
-
return url;
|
|
181
|
-
}
|
|
182
|
-
function pruneStalePreviews() {
|
|
183
|
-
const active = new Set(items.value.map((item) => item.File).filter((file) => file instanceof File));
|
|
184
|
-
previewCache.forEach((url, file) => {
|
|
185
|
-
if (!active.has(file)) {
|
|
186
|
-
URL.revokeObjectURL(url);
|
|
187
|
-
previewCache.delete(file);
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
watch(items, pruneStalePreviews);
|
|
192
|
-
onBeforeUnmount(() => {
|
|
193
|
-
previewCache.forEach((url) => URL.revokeObjectURL(url));
|
|
194
|
-
previewCache.clear();
|
|
195
|
-
});
|
|
196
|
-
function resolveFileType(item) {
|
|
197
|
-
var _a, _b, _c;
|
|
198
|
-
const extension = ((_a = item.name.split(".").pop()) == null ? void 0 : _a.toLowerCase()) ?? "";
|
|
199
|
-
const fallback = ((_b = props.fileTypeMap) == null ? void 0 : _b.default) ?? DEFAULT_FILE_TYPE;
|
|
200
|
-
const base = DEFAULT_FILE_TYPE_MAP[extension] ?? fallback;
|
|
201
|
-
const override = (_c = props.fileTypeMap) == null ? void 0 : _c[extension];
|
|
202
|
-
return {
|
|
203
|
-
icon: (override == null ? void 0 : override.icon) ?? base.icon,
|
|
204
|
-
color: (override == null ? void 0 : override.color) ?? base.color
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
function fileTypeIcon(item) {
|
|
208
|
-
return resolveFileType(item).icon;
|
|
209
|
-
}
|
|
210
|
-
function fileTypeIconStyle(item) {
|
|
211
|
-
const { color } = resolveFileType(item);
|
|
212
|
-
return {
|
|
213
|
-
color,
|
|
214
|
-
backgroundColor: `color-mix(in srgb, ${color} 15%, transparent)`
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function fileMeta(item) {
|
|
218
|
-
var _a;
|
|
219
|
-
const extension = (_a = item.name.split(".").pop()) == null ? void 0 : _a.toUpperCase();
|
|
220
|
-
const [value, measure] = getFileSize(item.size);
|
|
221
|
-
return extension ? `${extension} · ${value}${measure}` : `${value}${measure}`;
|
|
222
|
-
}
|
|
223
120
|
__expose({
|
|
224
121
|
clear: onClear,
|
|
225
122
|
click: triggerInputClick,
|
|
@@ -292,41 +189,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
292
189
|
style: normalizeStyle(listStyle.value)
|
|
293
190
|
}, [
|
|
294
191
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item) => {
|
|
295
|
-
return openBlock(), createElementBlock(
|
|
296
|
-
key: item.id
|
|
297
|
-
class: "vc-file-uploader-area__item"
|
|
192
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
193
|
+
key: item.id
|
|
298
194
|
}, [
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
style: normalizeStyle(fileTypeIconStyle(item))
|
|
312
|
-
}, [
|
|
313
|
-
createVNode(_sfc_main$2, {
|
|
314
|
-
icon: fileTypeIcon(item),
|
|
315
|
-
size: 20
|
|
316
|
-
}, null, 8, ["icon"])
|
|
317
|
-
], 4)),
|
|
318
|
-
createElementVNode("div", _hoisted_9, [
|
|
319
|
-
createElementVNode("span", _hoisted_10, toDisplayString(item.name), 1),
|
|
320
|
-
createElementVNode("span", _hoisted_11, toDisplayString(fileMeta(item)), 1)
|
|
321
|
-
]),
|
|
322
|
-
createVNode(_sfc_main$3, {
|
|
323
|
-
icon: unref(X),
|
|
324
|
-
color: "destructive",
|
|
325
|
-
class: "vc-file-uploader-area__item-close",
|
|
326
|
-
onClick: ($event) => unref(onTagClose)(item.id)
|
|
327
|
-
}, null, 8, ["icon", "onClick"])
|
|
328
|
-
])
|
|
329
|
-
]);
|
|
195
|
+
_ctx.$slots.item ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
196
|
+
renderSlot(_ctx.$slots, "item", {
|
|
197
|
+
data: item,
|
|
198
|
+
close: unref(onTagClose)
|
|
199
|
+
})
|
|
200
|
+
])) : (openBlock(), createBlock(_sfc_main$3, {
|
|
201
|
+
key: 1,
|
|
202
|
+
file: item,
|
|
203
|
+
"file-type-map": __props.fileTypeMap,
|
|
204
|
+
onRemove: ($event) => unref(onTagClose)(item.id)
|
|
205
|
+
}, null, 8, ["file", "file-type-map", "onRemove"]))
|
|
206
|
+
], 64);
|
|
330
207
|
}), 128))
|
|
331
208
|
], 4)) : createCommentVNode("", true)
|
|
332
209
|
], 4);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./VcFileUploaderSimple.vue2.mjs";
|
|
2
2
|
import '../../assets/components/VcFileUploader/VcFileUploaderSimple.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const VcFileUploaderSimple = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const VcFileUploaderSimple = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b70649fc"]]);
|
|
5
5
|
export {
|
|
6
6
|
VcFileUploaderSimple as default
|
|
7
7
|
};
|
|
@@ -62,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
62
|
emits: ["update:modelValue", "update:required", "update:propertyType", "remove:property", "change:propertyName"],
|
|
63
63
|
setup(__props, { emit: __emit }) {
|
|
64
64
|
useCssVars((_ctx) => ({
|
|
65
|
-
"
|
|
65
|
+
"v0a6ae084": spacingRow.value
|
|
66
66
|
}));
|
|
67
67
|
const SCHEMA_TYPE_NAMES = ["string", "number", "integer", "object", "array", "boolean", "null"];
|
|
68
68
|
function asObjectSchema(def) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Circles.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcLoading/Loaders/Circles.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const Circles = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Circles = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6e1e3db5"]]);
|
|
5
5
|
export {
|
|
6
6
|
Circles as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./DotSpinner.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcLoading/Loaders/DotSpinner.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const DotSpinner = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const DotSpinner = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9e57f4ef"]]);
|
|
5
5
|
export {
|
|
6
6
|
DotSpinner as default
|
|
7
7
|
};
|
|
@@ -10,7 +10,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
10
|
},
|
|
11
11
|
setup(__props) {
|
|
12
12
|
useCssVars((_ctx) => ({
|
|
13
|
-
"
|
|
13
|
+
"v57a1ac1a": styles.value.size
|
|
14
14
|
}));
|
|
15
15
|
const props = __props;
|
|
16
16
|
const styles = computed(() => {
|
|
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
return openBlock(), createElementBlock("div", {
|
|
24
24
|
class: normalizeClass([`text-${__props.color}`, "vc-spinner--dots"])
|
|
25
25
|
}, [..._cache[0] || (_cache[0] = [
|
|
26
|
-
createStaticVNode('<div class="dot-spin" data-v-
|
|
26
|
+
createStaticVNode('<div class="dot-spin" data-v-9e57f4ef></div><div class="dot-spin" data-v-9e57f4ef></div><div class="dot-spin" data-v-9e57f4ef></div><div class="dot-spin" data-v-9e57f4ef></div><div class="dot-spin" data-v-9e57f4ef></div><div class="dot-spin" data-v-9e57f4ef></div><div class="dot-spin" data-v-9e57f4ef></div><div class="dot-spin" data-v-9e57f4ef></div>', 8)
|
|
27
27
|
])], 2);
|
|
28
28
|
};
|
|
29
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./LdsSpinner.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcLoading/Loaders/LdsSpinner.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const LdsSpinner = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const LdsSpinner = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e6f2cb88"]]);
|
|
5
5
|
export {
|
|
6
6
|
LdsSpinner as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./LoadIcon.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcLoading/Loaders/LoadIcon.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const LoadIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const LoadIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-83cec7dd"]]);
|
|
5
5
|
export {
|
|
6
6
|
LoadIcon as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Stretch.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcLoading/Loaders/Stretch.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const Stretch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Stretch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-64079461"]]);
|
|
5
5
|
export {
|
|
6
6
|
Stretch as default
|
|
7
7
|
};
|
|
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
style: normalizeStyle(styles.value),
|
|
23
23
|
class: normalizeClass([`text-${__props.color}`, "vc-spinner--stretch"])
|
|
24
24
|
}, [..._cache[0] || (_cache[0] = [
|
|
25
|
-
createStaticVNode('<div class="rect rect-1" data-v-
|
|
25
|
+
createStaticVNode('<div class="rect rect-1" data-v-64079461></div><div class="rect rect-2" data-v-64079461></div><div class="rect rect-3" data-v-64079461></div><div class="rect rect-4" data-v-64079461></div><div class="rect rect-5" data-v-64079461></div>', 5)
|
|
26
26
|
])], 6);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./VcLoading.vue2.mjs";
|
|
2
2
|
import '../../assets/components/VcLoading/VcLoading.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const VcLoading = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const VcLoading = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8bba0c85"]]);
|
|
5
5
|
export {
|
|
6
6
|
VcLoading as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./ParameterNode.vue2.mjs";
|
|
2
2
|
import '../../assets/components/VcMdEditor/ParameterNode.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const ParameterNode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const ParameterNode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e2362d26"]]);
|
|
5
5
|
export {
|
|
6
6
|
ParameterNode as default
|
|
7
7
|
};
|