@uzum-tech/ui 1.12.2 → 1.12.5
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 +1 -1
- package/dist/index.js +1196 -13136
- package/dist/index.prod.js +4 -4
- package/es/_utils/composable/composables.js +2 -1
- package/es/chat/index.d.ts +1 -1
- package/es/chat/src/ChatParts/ChatAttachment.d.ts +1 -1
- package/es/chat/src/ChatParts/ChatAttachment.js +4 -4
- package/es/chat/src/ChatParts/MainArea.js +11 -1
- package/es/chat/src/interface.d.ts +9 -1
- package/es/chat/src/interface.js +7 -0
- package/es/header/src/Header.d.ts +3 -1
- package/es/header/src/Header.js +16 -4
- package/es/header/src/HeaderNavigation.d.ts +1601 -4
- package/es/header/src/HeaderNavigation.js +191 -31
- package/es/header/src/styles/index.cssr.js +47 -10
- package/es/locales/index.d.ts +0 -46
- package/es/locales/index.js +0 -46
- package/es/menu/src/utils.js +3 -1
- package/es/message/src/use-message.js +1 -1
- package/es/slider/src/Slider.js +0 -1
- package/es/tabs/src/Tabs.js +2 -2
- package/es/upload/src/interface.d.ts +3 -2
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_utils/composable/composables.js +2 -1
- package/lib/chat/index.d.ts +1 -1
- package/lib/chat/src/ChatParts/ChatAttachment.d.ts +1 -1
- package/lib/chat/src/ChatParts/ChatAttachment.js +3 -3
- package/lib/chat/src/ChatParts/MainArea.js +11 -1
- package/lib/chat/src/interface.d.ts +9 -1
- package/lib/chat/src/interface.js +8 -1
- package/lib/header/src/Header.d.ts +3 -1
- package/lib/header/src/Header.js +16 -4
- package/lib/header/src/HeaderNavigation.d.ts +1601 -4
- package/lib/header/src/HeaderNavigation.js +189 -29
- package/lib/header/src/styles/index.cssr.js +47 -10
- package/lib/locales/index.d.ts +0 -46
- package/lib/locales/index.js +1 -94
- package/lib/menu/src/utils.js +3 -1
- package/lib/message/src/use-message.js +1 -1
- package/lib/slider/src/Slider.js +0 -1
- package/lib/tabs/src/Tabs.js +2 -2
- package/lib/upload/src/interface.d.ts +3 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +2752 -2752
- package/es/locales/common/arDZ.d.ts +0 -3
- package/es/locales/common/arDZ.js +0 -147
- package/es/locales/common/deDE.d.ts +0 -3
- package/es/locales/common/deDE.js +0 -147
- package/es/locales/common/enGB.d.ts +0 -3
- package/es/locales/common/enGB.js +0 -148
- package/es/locales/common/eo.d.ts +0 -3
- package/es/locales/common/eo.js +0 -149
- package/es/locales/common/esAR.d.ts +0 -3
- package/es/locales/common/esAR.js +0 -151
- package/es/locales/common/faIR.d.ts +0 -3
- package/es/locales/common/faIR.js +0 -147
- package/es/locales/common/frFR.d.ts +0 -3
- package/es/locales/common/frFR.js +0 -147
- package/es/locales/common/idID.d.ts +0 -3
- package/es/locales/common/idID.js +0 -151
- package/es/locales/common/itIT.d.ts +0 -3
- package/es/locales/common/itIT.js +0 -150
- package/es/locales/common/jaJP.d.ts +0 -3
- package/es/locales/common/jaJP.js +0 -150
- package/es/locales/common/koKR.d.ts +0 -3
- package/es/locales/common/koKR.js +0 -150
- package/es/locales/common/nbNO.d.ts +0 -3
- package/es/locales/common/nbNO.js +0 -151
- package/es/locales/common/nlNL.d.ts +0 -3
- package/es/locales/common/nlNL.js +0 -149
- package/es/locales/common/plPL.d.ts +0 -3
- package/es/locales/common/plPL.js +0 -150
- package/es/locales/common/ptBR.d.ts +0 -3
- package/es/locales/common/ptBR.js +0 -147
- package/es/locales/common/skSK.d.ts +0 -3
- package/es/locales/common/skSK.js +0 -151
- package/es/locales/common/svSE.d.ts +0 -3
- package/es/locales/common/svSE.js +0 -147
- package/es/locales/common/thTH.d.ts +0 -3
- package/es/locales/common/thTH.js +0 -151
- package/es/locales/common/trTR.d.ts +0 -3
- package/es/locales/common/trTR.js +0 -148
- package/es/locales/common/ukUA.d.ts +0 -3
- package/es/locales/common/ukUA.js +0 -148
- package/es/locales/common/viVN.d.ts +0 -3
- package/es/locales/common/viVN.js +0 -147
- package/es/locales/common/zhCN.d.ts +0 -3
- package/es/locales/common/zhCN.js +0 -147
- package/es/locales/common/zhTW.d.ts +0 -3
- package/es/locales/common/zhTW.js +0 -147
- package/es/locales/date/arDZ.d.ts +0 -3
- package/es/locales/date/arDZ.js +0 -6
- package/es/locales/date/deDE.d.ts +0 -3
- package/es/locales/date/deDE.js +0 -6
- package/es/locales/date/enGB.d.ts +0 -3
- package/es/locales/date/enGB.js +0 -6
- package/es/locales/date/eo.d.ts +0 -3
- package/es/locales/date/eo.js +0 -6
- package/es/locales/date/esAR.d.ts +0 -3
- package/es/locales/date/esAR.js +0 -6
- package/es/locales/date/faIR.d.ts +0 -3
- package/es/locales/date/faIR.js +0 -6
- package/es/locales/date/frFR.d.ts +0 -3
- package/es/locales/date/frFR.js +0 -6
- package/es/locales/date/idID.d.ts +0 -3
- package/es/locales/date/idID.js +0 -6
- package/es/locales/date/itIT.d.ts +0 -3
- package/es/locales/date/itIT.js +0 -6
- package/es/locales/date/jaJP.d.ts +0 -3
- package/es/locales/date/jaJP.js +0 -6
- package/es/locales/date/koKR.d.ts +0 -3
- package/es/locales/date/koKR.js +0 -6
- package/es/locales/date/nbNO.d.ts +0 -3
- package/es/locales/date/nbNO.js +0 -6
- package/es/locales/date/nlNL.d.ts +0 -3
- package/es/locales/date/nlNL.js +0 -6
- package/es/locales/date/plPL.d.ts +0 -3
- package/es/locales/date/plPL.js +0 -6
- package/es/locales/date/ptBR.d.ts +0 -3
- package/es/locales/date/ptBR.js +0 -6
- package/es/locales/date/skSK.d.ts +0 -3
- package/es/locales/date/skSK.js +0 -6
- package/es/locales/date/svSE.d.ts +0 -3
- package/es/locales/date/svSE.js +0 -6
- package/es/locales/date/thTH.d.ts +0 -3
- package/es/locales/date/thTH.js +0 -6
- package/es/locales/date/trTR.d.ts +0 -3
- package/es/locales/date/trTR.js +0 -6
- package/es/locales/date/ukUA.d.ts +0 -3
- package/es/locales/date/ukUA.js +0 -6
- package/es/locales/date/viVN.d.ts +0 -3
- package/es/locales/date/viVN.js +0 -6
- package/es/locales/date/zhCN.d.ts +0 -3
- package/es/locales/date/zhCN.js +0 -6
- package/es/locales/date/zhTW.d.ts +0 -3
- package/es/locales/date/zhTW.js +0 -6
- package/lib/locales/common/arDZ.d.ts +0 -3
- package/lib/locales/common/arDZ.js +0 -149
- package/lib/locales/common/deDE.d.ts +0 -3
- package/lib/locales/common/deDE.js +0 -149
- package/lib/locales/common/enGB.d.ts +0 -3
- package/lib/locales/common/enGB.js +0 -150
- package/lib/locales/common/eo.d.ts +0 -3
- package/lib/locales/common/eo.js +0 -151
- package/lib/locales/common/esAR.d.ts +0 -3
- package/lib/locales/common/esAR.js +0 -153
- package/lib/locales/common/faIR.d.ts +0 -3
- package/lib/locales/common/faIR.js +0 -149
- package/lib/locales/common/frFR.d.ts +0 -3
- package/lib/locales/common/frFR.js +0 -149
- package/lib/locales/common/idID.d.ts +0 -3
- package/lib/locales/common/idID.js +0 -153
- package/lib/locales/common/itIT.d.ts +0 -3
- package/lib/locales/common/itIT.js +0 -152
- package/lib/locales/common/jaJP.d.ts +0 -3
- package/lib/locales/common/jaJP.js +0 -152
- package/lib/locales/common/koKR.d.ts +0 -3
- package/lib/locales/common/koKR.js +0 -152
- package/lib/locales/common/nbNO.d.ts +0 -3
- package/lib/locales/common/nbNO.js +0 -153
- package/lib/locales/common/nlNL.d.ts +0 -3
- package/lib/locales/common/nlNL.js +0 -151
- package/lib/locales/common/plPL.d.ts +0 -3
- package/lib/locales/common/plPL.js +0 -152
- package/lib/locales/common/ptBR.d.ts +0 -3
- package/lib/locales/common/ptBR.js +0 -149
- package/lib/locales/common/skSK.d.ts +0 -3
- package/lib/locales/common/skSK.js +0 -153
- package/lib/locales/common/svSE.d.ts +0 -3
- package/lib/locales/common/svSE.js +0 -149
- package/lib/locales/common/thTH.d.ts +0 -3
- package/lib/locales/common/thTH.js +0 -153
- package/lib/locales/common/trTR.d.ts +0 -3
- package/lib/locales/common/trTR.js +0 -150
- package/lib/locales/common/ukUA.d.ts +0 -3
- package/lib/locales/common/ukUA.js +0 -150
- package/lib/locales/common/viVN.d.ts +0 -3
- package/lib/locales/common/viVN.js +0 -149
- package/lib/locales/common/zhCN.d.ts +0 -3
- package/lib/locales/common/zhCN.js +0 -149
- package/lib/locales/common/zhTW.d.ts +0 -3
- package/lib/locales/common/zhTW.js +0 -149
- package/lib/locales/date/arDZ.d.ts +0 -3
- package/lib/locales/date/arDZ.js +0 -11
- package/lib/locales/date/deDE.d.ts +0 -3
- package/lib/locales/date/deDE.js +0 -11
- package/lib/locales/date/enGB.d.ts +0 -3
- package/lib/locales/date/enGB.js +0 -11
- package/lib/locales/date/eo.d.ts +0 -3
- package/lib/locales/date/eo.js +0 -11
- package/lib/locales/date/esAR.d.ts +0 -3
- package/lib/locales/date/esAR.js +0 -11
- package/lib/locales/date/faIR.d.ts +0 -3
- package/lib/locales/date/faIR.js +0 -11
- package/lib/locales/date/frFR.d.ts +0 -3
- package/lib/locales/date/frFR.js +0 -11
- package/lib/locales/date/idID.d.ts +0 -3
- package/lib/locales/date/idID.js +0 -11
- package/lib/locales/date/itIT.d.ts +0 -3
- package/lib/locales/date/itIT.js +0 -11
- package/lib/locales/date/jaJP.d.ts +0 -3
- package/lib/locales/date/jaJP.js +0 -11
- package/lib/locales/date/koKR.d.ts +0 -3
- package/lib/locales/date/koKR.js +0 -11
- package/lib/locales/date/nbNO.d.ts +0 -3
- package/lib/locales/date/nbNO.js +0 -11
- package/lib/locales/date/nlNL.d.ts +0 -3
- package/lib/locales/date/nlNL.js +0 -11
- package/lib/locales/date/plPL.d.ts +0 -3
- package/lib/locales/date/plPL.js +0 -11
- package/lib/locales/date/ptBR.d.ts +0 -3
- package/lib/locales/date/ptBR.js +0 -11
- package/lib/locales/date/skSK.d.ts +0 -3
- package/lib/locales/date/skSK.js +0 -11
- package/lib/locales/date/svSE.d.ts +0 -3
- package/lib/locales/date/svSE.js +0 -11
- package/lib/locales/date/thTH.d.ts +0 -3
- package/lib/locales/date/thTH.js +0 -11
- package/lib/locales/date/trTR.d.ts +0 -3
- package/lib/locales/date/trTR.js +0 -11
- package/lib/locales/date/ukUA.d.ts +0 -3
- package/lib/locales/date/ukUA.js +0 -11
- package/lib/locales/date/viVN.d.ts +0 -3
- package/lib/locales/date/viVN.js +0 -11
- package/lib/locales/date/zhCN.d.ts +0 -3
- package/lib/locales/date/zhCN.js +0 -11
- package/lib/locales/date/zhTW.d.ts +0 -3
- package/lib/locales/date/zhTW.js +0 -11
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
11
|
var t = {};
|
|
3
12
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -9,10 +18,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
18
|
}
|
|
10
19
|
return t;
|
|
11
20
|
};
|
|
12
|
-
import { h, defineComponent, computed } from 'vue';
|
|
21
|
+
import { h, defineComponent, computed, ref, watch, nextTick, onMounted, onBeforeUnmount } from 'vue';
|
|
13
22
|
import { call } from '../../_utils';
|
|
14
|
-
import {
|
|
15
|
-
import { renderOptionLabel, renderBadge, getMenuItemKey, isDividerOption, isGroupOption, isColumnOption, isNotNull, resolvePlacement } from './utils';
|
|
23
|
+
import { renderOptionLabel, renderBadge, getMenuItemKey, isDividerOption, isGroupOption, isColumnOption, isNotNull } from './utils';
|
|
16
24
|
export const headerNavigationProps = {
|
|
17
25
|
menuOptions: {
|
|
18
26
|
type: Array,
|
|
@@ -60,7 +68,47 @@ export default defineComponent({
|
|
|
60
68
|
key: getMenuItemKey(option, index)
|
|
61
69
|
}));
|
|
62
70
|
});
|
|
63
|
-
const
|
|
71
|
+
const navRef = ref(null);
|
|
72
|
+
const setNavRef = (el) => {
|
|
73
|
+
navRef.value = el;
|
|
74
|
+
};
|
|
75
|
+
const hoveredKeyRef = ref(null);
|
|
76
|
+
const tabRefs = ref({});
|
|
77
|
+
const indicatorStyleRef = ref({
|
|
78
|
+
width: '0px',
|
|
79
|
+
transform: 'translateX(0)'
|
|
80
|
+
});
|
|
81
|
+
function updateIndicator() {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
const navEl = navRef.value;
|
|
84
|
+
if (!navEl)
|
|
85
|
+
return;
|
|
86
|
+
const isHoverTrigger = props.menuTrigger === 'hover';
|
|
87
|
+
const activeKey = isHoverTrigger
|
|
88
|
+
? (_a = hoveredKeyRef.value) !== null && _a !== void 0 ? _a : null
|
|
89
|
+
: (_b = props.menuValue) !== null && _b !== void 0 ? _b : null;
|
|
90
|
+
if (activeKey === null) {
|
|
91
|
+
indicatorStyleRef.value = {
|
|
92
|
+
width: '0px',
|
|
93
|
+
transform: 'translateX(0)'
|
|
94
|
+
};
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const tabEl = tabRefs.value[activeKey];
|
|
98
|
+
if (!tabEl)
|
|
99
|
+
return;
|
|
100
|
+
const navRect = navEl.getBoundingClientRect();
|
|
101
|
+
const tabRect = tabEl.getBoundingClientRect();
|
|
102
|
+
indicatorStyleRef.value = {
|
|
103
|
+
width: `${tabRect.width}px`,
|
|
104
|
+
transform: `translateX(${tabRect.left - navRect.left}px)`
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function setTabRef(key) {
|
|
108
|
+
return (el) => {
|
|
109
|
+
tabRefs.value[key] = el;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
64
112
|
function handleMenuValueUpdate(value) {
|
|
65
113
|
const { onUpdateMenuValue } = props;
|
|
66
114
|
const { 'onUpdate:menuValue': _onUpdateMenuValue } = props;
|
|
@@ -69,14 +117,42 @@ export default defineComponent({
|
|
|
69
117
|
if (_onUpdateMenuValue)
|
|
70
118
|
call(_onUpdateMenuValue, value);
|
|
71
119
|
}
|
|
120
|
+
onMounted(() => __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
yield nextTick(updateIndicator);
|
|
122
|
+
window.addEventListener('resize', updateIndicator);
|
|
123
|
+
}));
|
|
124
|
+
onBeforeUnmount(() => {
|
|
125
|
+
window.removeEventListener('resize', updateIndicator);
|
|
126
|
+
});
|
|
127
|
+
watch(() => props.menuValue, () => __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
yield nextTick(updateIndicator);
|
|
129
|
+
}));
|
|
130
|
+
watch(() => props.menuTrigger, () => __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
yield nextTick(updateIndicator);
|
|
132
|
+
}));
|
|
133
|
+
watch(hoveredKeyRef, (value, prevValue) => __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
yield nextTick(updateIndicator);
|
|
135
|
+
if (props.menuTrigger === 'hover' &&
|
|
136
|
+
prevValue !== null &&
|
|
137
|
+
value === null) {
|
|
138
|
+
handleMenuValueUpdate(null);
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
141
|
+
watch(normalizedMenuItemsRef, () => __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
yield nextTick(updateIndicator);
|
|
143
|
+
}), { deep: true });
|
|
72
144
|
return {
|
|
73
145
|
normalizedMenuItems: normalizedMenuItemsRef,
|
|
74
|
-
|
|
75
|
-
|
|
146
|
+
handleMenuValueUpdate,
|
|
147
|
+
setNavRef,
|
|
148
|
+
navRef,
|
|
149
|
+
setTabRef,
|
|
150
|
+
indicatorStyle: indicatorStyleRef,
|
|
151
|
+
hoveredKey: hoveredKeyRef
|
|
76
152
|
};
|
|
77
153
|
},
|
|
78
154
|
render() {
|
|
79
|
-
var _a, _b, _c
|
|
155
|
+
var _a, _b, _c;
|
|
80
156
|
const mergedClsPrefix = this.mergedClsPrefix;
|
|
81
157
|
const blockClass = `${mergedClsPrefix}-header`;
|
|
82
158
|
const { $props } = this;
|
|
@@ -130,7 +206,7 @@ export default defineComponent({
|
|
|
130
206
|
] },
|
|
131
207
|
h("div", { class: `${blockClass}__menu-column-list` }, renderMenuItem(option, `${key}-single`))));
|
|
132
208
|
};
|
|
133
|
-
const renderMenuCard = (item) => {
|
|
209
|
+
const renderMenuCard = (item, onClose) => {
|
|
134
210
|
var _a, _b, _c;
|
|
135
211
|
const option = item.option;
|
|
136
212
|
if (!((_a = option.children) === null || _a === void 0 ? void 0 : _a.length))
|
|
@@ -138,35 +214,119 @@ export default defineComponent({
|
|
|
138
214
|
const columns = (_c = (_b = option.children) === null || _b === void 0 ? void 0 : _b.map((child, index) => renderMenuColumn(child, `${item.key}-column-${index}`)).filter(isNotNull)) !== null && _c !== void 0 ? _c : [];
|
|
139
215
|
if (!columns.length)
|
|
140
216
|
return null;
|
|
141
|
-
// Подсчитываем количество колонок (children с type: 'column')
|
|
142
217
|
const columnCount = option.children.filter((child) => isColumnOption(child) || !isDividerOption(child)).length;
|
|
143
|
-
|
|
218
|
+
const handleSafeLeave = (event) => {
|
|
219
|
+
const currentTarget = event.currentTarget;
|
|
220
|
+
const related = event.relatedTarget;
|
|
221
|
+
if (!currentTarget)
|
|
222
|
+
return;
|
|
223
|
+
if (related && currentTarget.contains(related))
|
|
224
|
+
return;
|
|
225
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
226
|
+
};
|
|
227
|
+
return (h("div", { class: `${blockClass}__menu-card`, onMouseleave: onClose, onPointerleave: onClose, onMouseout: handleSafeLeave, onPointerout: handleSafeLeave },
|
|
144
228
|
h("div", { class: `${blockClass}__menu-grid`, style: {
|
|
145
229
|
gridTemplateColumns: `repeat(${columnCount}, minmax(var(--u-header-card-min-col-width), 1fr))`
|
|
146
230
|
} }, columns)));
|
|
147
231
|
};
|
|
148
|
-
const menuItems = this.normalizedMenuItems;
|
|
149
|
-
const activeValue = (_a = this.menuValue) !== null && _a !== void 0 ? _a : undefined;
|
|
150
232
|
const menuTabsProps = this.menuTabsProps;
|
|
151
|
-
const
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
233
|
+
const _d = menuTabsProps || {}, { class: tabsClass, paneClass, paneWrapperClass, 'onUpdate:value': userOnUpdateValue, onUpdateValue: userOnUpdateValueCompat } = _d, restTabsProps = __rest(_d, ["class", "paneClass", "paneWrapperClass", 'onUpdate:value', "onUpdateValue"]);
|
|
234
|
+
const isHoverTrigger = ((_a = restTabsProps.trigger) !== null && _a !== void 0 ? _a : this.menuTrigger) === 'hover';
|
|
235
|
+
const menuItems = this.normalizedMenuItems;
|
|
236
|
+
const activeValue = isHoverTrigger
|
|
237
|
+
? (_b = this.hoveredKey) !== null && _b !== void 0 ? _b : undefined
|
|
238
|
+
: (_c = this.menuValue) !== null && _c !== void 0 ? _c : undefined;
|
|
239
|
+
const emitUpdate = (value) => {
|
|
240
|
+
if (isHoverTrigger && value === null) {
|
|
241
|
+
this.hoveredKey = null;
|
|
242
|
+
}
|
|
243
|
+
this.handleMenuValueUpdate(value);
|
|
244
|
+
if (userOnUpdateValue) {
|
|
245
|
+
call(userOnUpdateValue, value);
|
|
246
|
+
}
|
|
247
|
+
if (userOnUpdateValueCompat) {
|
|
248
|
+
call(userOnUpdateValueCompat, value);
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
const justifyContent = restTabsProps.justifyContent !== undefined
|
|
252
|
+
? restTabsProps.justifyContent
|
|
253
|
+
: 'center';
|
|
254
|
+
const tabsPadding = restTabsProps.tabsPadding !== undefined ? restTabsProps.tabsPadding : 0;
|
|
255
|
+
const tabsPaddingValue = typeof tabsPadding === 'number' ? `${tabsPadding}px` : String(tabsPadding);
|
|
256
|
+
const closeMenu = isHoverTrigger
|
|
257
|
+
? () => {
|
|
258
|
+
this.hoveredKey = null;
|
|
259
|
+
emitUpdate(null);
|
|
260
|
+
}
|
|
261
|
+
: undefined;
|
|
262
|
+
const tabsNode = menuItems.length > 0 ? (h("div", { class: `${blockClass}__tabs-wrapper`, onMouseleave: closeMenu, onPointerleave: closeMenu },
|
|
263
|
+
h("div", { class: [`${blockClass}__tabs`, 'u-tabs', tabsClass].filter(Boolean) },
|
|
264
|
+
h("div", { class: "u-tabs-nav-scroll-wrapper" },
|
|
265
|
+
h("div", { class: "u-tabs-nav-scroll-content", style: {
|
|
266
|
+
paddingLeft: tabsPaddingValue,
|
|
267
|
+
paddingRight: tabsPaddingValue
|
|
268
|
+
} },
|
|
269
|
+
h("div", { class: "u-tabs-nav", style: { justifyContent }, role: "tablist", "aria-orientation": "horizontal", ref: this.setNavRef },
|
|
270
|
+
h("div", { class: "u-tabs-pad", style: { width: tabsPaddingValue } }),
|
|
271
|
+
menuItems.map((item, index) => {
|
|
272
|
+
const isActive = activeValue === item.key;
|
|
273
|
+
const isOpen = isHoverTrigger
|
|
274
|
+
? this.hoveredKey === item.key
|
|
275
|
+
: isActive;
|
|
276
|
+
const isDisabled = !!item.option.disabled;
|
|
277
|
+
const icon = typeof item.option.icon === 'function'
|
|
278
|
+
? item.option.icon()
|
|
279
|
+
: item.option.icon;
|
|
280
|
+
const content = renderMenuCard(item, closeMenu);
|
|
281
|
+
return (h("div", { key: item.key, class: [
|
|
282
|
+
'u-tabs-tab',
|
|
283
|
+
`${blockClass}__tab`,
|
|
284
|
+
isActive && 'u-tabs-tab--active',
|
|
285
|
+
isDisabled && 'u-tabs-tab--disabled'
|
|
286
|
+
], ref: this.setTabRef(item.key), role: "tab", "aria-selected": isActive, "aria-disabled": isDisabled, tabindex: isDisabled ? -1 : isActive ? 0 : -1, onKeydown: (event) => {
|
|
287
|
+
if (!isDisabled &&
|
|
288
|
+
!isHoverTrigger &&
|
|
289
|
+
(event.key === 'Enter' || event.key === ' ')) {
|
|
290
|
+
event.preventDefault();
|
|
291
|
+
emitUpdate(item.key);
|
|
292
|
+
}
|
|
293
|
+
}, onMouseenter: isHoverTrigger && !isDisabled
|
|
294
|
+
? () => {
|
|
295
|
+
this.hoveredKey = item.key;
|
|
296
|
+
emitUpdate(item.key);
|
|
297
|
+
}
|
|
298
|
+
: undefined, onClick: !isDisabled
|
|
299
|
+
? () => {
|
|
300
|
+
if (!isHoverTrigger) {
|
|
301
|
+
emitUpdate(item.key);
|
|
302
|
+
}
|
|
303
|
+
if (item.option.onClick) {
|
|
304
|
+
item.option.onClick();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
: undefined },
|
|
308
|
+
icon ? (h("span", { class: `${blockClass}__tab-icon` }, icon)) : null,
|
|
309
|
+
h("span", { class: `${blockClass}__tab-label` }, renderOptionLabel(item.option)),
|
|
310
|
+
renderBadge(item.option, `${blockClass}__badge`),
|
|
311
|
+
content ? (h("div", { class: [
|
|
312
|
+
'u-tabs-pane-wrapper',
|
|
313
|
+
this.menuPaneWrapperClass,
|
|
314
|
+
paneWrapperClass,
|
|
315
|
+
`${blockClass}__tab-pane-wrapper`
|
|
316
|
+
]
|
|
317
|
+
.filter(Boolean)
|
|
318
|
+
.join(' ') || undefined, style: isOpen ? undefined : { display: 'none' }, "aria-hidden": !isOpen, onMouseleave: closeMenu, onPointerleave: closeMenu },
|
|
319
|
+
h("div", { class: [
|
|
320
|
+
'u-tabs-pane',
|
|
321
|
+
this.menuPaneClass,
|
|
322
|
+
paneClass,
|
|
323
|
+
`${blockClass}__tab-pane`
|
|
324
|
+
]
|
|
325
|
+
.filter(Boolean)
|
|
326
|
+
.join(' ') || undefined }, content))) : null));
|
|
327
|
+
}),
|
|
328
|
+
h("div", { class: "u-tabs-bar", style: this.indicatorStyle, "aria-hidden": "true" }),
|
|
329
|
+
h("div", { class: "u-tabs-pad", style: { width: tabsPaddingValue } }))))))) : null;
|
|
170
330
|
return tabsNode;
|
|
171
331
|
}
|
|
172
332
|
});
|
|
@@ -56,12 +56,19 @@ export default cB('header', `
|
|
|
56
56
|
display: block;
|
|
57
57
|
max-height: 32px;
|
|
58
58
|
width: auto;
|
|
59
|
-
`)]),
|
|
59
|
+
`)]), c('&__logo--clickable', `
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
`), cE('navigation', `
|
|
60
62
|
flex: 1;
|
|
61
63
|
min-width: 0;
|
|
62
64
|
display: flex;
|
|
63
65
|
justify-content: center;
|
|
64
66
|
height: 100%;
|
|
67
|
+
`), cE('tabs-wrapper', `
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
70
|
+
position: relative;
|
|
71
|
+
display: flex;
|
|
65
72
|
`), cE('actions', `
|
|
66
73
|
position: relative;
|
|
67
74
|
display: inline-flex;
|
|
@@ -83,28 +90,52 @@ export default cB('header', `
|
|
|
83
90
|
`)])]), cE('tabs', `
|
|
84
91
|
width: 100%;
|
|
85
92
|
height: 100%;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
position: relative;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
`, [c('& .u-tabs-nav-scroll-wrapper', `
|
|
90
97
|
flex: unset;
|
|
91
98
|
align-items: center;
|
|
99
|
+
display: flex;
|
|
100
|
+
height: 100%;
|
|
101
|
+
`), c('& .u-tabs-nav-scroll-content', `
|
|
102
|
+
height: 100%;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
width: 100%;
|
|
92
106
|
`), c('& .u-tabs-nav', `
|
|
93
107
|
height: 100%;
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
position: relative;
|
|
111
|
+
width: 100%;
|
|
112
|
+
gap: 40px;
|
|
94
113
|
`), c('& .u-tabs-tab', `
|
|
95
114
|
padding: 0;
|
|
96
115
|
color: var(--u-header-tab-text-color);
|
|
116
|
+
display: inline-flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
height: 100%;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
border-bottom: 2px solid transparent;
|
|
97
121
|
`), c('& .u-tabs-tab--active', `
|
|
98
122
|
color: var(--u-header-tab-text-color-active);
|
|
123
|
+
border-color: var(--u-header-tab-indicator-color);
|
|
124
|
+
`), c('& .u-tabs-tab--disabled', `
|
|
125
|
+
cursor: not-allowed;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
opacity: .5;
|
|
99
128
|
`), c('& .u-tabs-tab:hover', `
|
|
100
129
|
color: var(--u-header-tab-text-color-hover);
|
|
101
130
|
`), c('& .u-tabs-bar', `
|
|
102
131
|
background-color: var(--u-header-tab-indicator-color);
|
|
103
|
-
`), c('& .u-tabs-pane-wrapper', `
|
|
104
132
|
position: absolute;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
133
|
+
height: 2px;
|
|
134
|
+
bottom: 0;
|
|
135
|
+
left: 0;
|
|
136
|
+
`), c('& .u-tabs-pad', `
|
|
137
|
+
flex: 0 0 auto;
|
|
138
|
+
height: 100%;
|
|
108
139
|
`), c('& .v-x-scroll', `
|
|
109
140
|
height: 100%;
|
|
110
141
|
`)]), cE('tab', `
|
|
@@ -113,6 +144,8 @@ export default cB('header', `
|
|
|
113
144
|
gap: 8px;
|
|
114
145
|
font-size: var(--u-font-size);
|
|
115
146
|
font-weight: 500;
|
|
147
|
+
position: relative;
|
|
148
|
+
height: 100%;
|
|
116
149
|
`), cE('tab-icon', `
|
|
117
150
|
display: inline-flex;
|
|
118
151
|
font-size: 20px;
|
|
@@ -134,6 +167,11 @@ export default cB('header', `
|
|
|
134
167
|
color: var(--u-header-badge-text-color);
|
|
135
168
|
`), cE('tab-pane-wrapper', `
|
|
136
169
|
overflow: visible;
|
|
170
|
+
position: absolute;
|
|
171
|
+
top: calc(100% + 2px);
|
|
172
|
+
left: 40%;
|
|
173
|
+
transform: translateX(-40%);
|
|
174
|
+
z-index: 1000;
|
|
137
175
|
`), cE('tab-pane', `
|
|
138
176
|
padding: 0;
|
|
139
177
|
`), cE('menu-card', `
|
|
@@ -254,7 +292,6 @@ export const headerMobileMenuStyle = cB('header-mobile-menu', `
|
|
|
254
292
|
position: absolute;
|
|
255
293
|
right: 24px;
|
|
256
294
|
top: 50%;
|
|
257
|
-
transform: translateY(-50%);
|
|
258
295
|
width: 8px;
|
|
259
296
|
height: 8px;
|
|
260
297
|
border-right: 2px solid currentColor;
|
package/es/locales/index.d.ts
CHANGED
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
export { default as zhCN } from './common/zhCN';
|
|
2
|
-
export { default as zhTW } from './common/zhTW';
|
|
3
1
|
export { default as enUS } from './common/enUS';
|
|
4
2
|
export { default as ruRU } from './common/ruRU';
|
|
5
|
-
export { default as ukUA } from './common/ukUA';
|
|
6
|
-
export { default as jaJP } from './common/jaJP';
|
|
7
|
-
export { default as koKR } from './common/koKR';
|
|
8
|
-
export { default as idID } from './common/idID';
|
|
9
|
-
export { default as deDE } from './common/deDE';
|
|
10
|
-
export { default as nbNO } from './common/nbNO';
|
|
11
|
-
export { default as nlNL } from './common/nlNL';
|
|
12
|
-
export { default as frFR } from './common/frFR';
|
|
13
|
-
export { default as esAR } from './common/esAR';
|
|
14
|
-
export { default as itIT } from './common/itIT';
|
|
15
|
-
export { default as skSK } from './common/skSK';
|
|
16
|
-
export { default as enGB } from './common/enGB';
|
|
17
|
-
export { default as plPL } from './common/plPL';
|
|
18
|
-
export { default as ptBR } from './common/ptBR';
|
|
19
|
-
export { default as thTH } from './common/thTH';
|
|
20
|
-
export { default as arDZ } from './common/arDZ';
|
|
21
|
-
export { default as trTR } from './common/trTR';
|
|
22
|
-
export { default as eo } from './common/eo';
|
|
23
|
-
export { default as viVN } from './common/viVN';
|
|
24
|
-
export { default as faIR } from './common/faIR';
|
|
25
|
-
export { default as svSE } from './common/svSE';
|
|
26
|
-
export { default as dateZhCN } from './date/zhCN';
|
|
27
|
-
export { default as dateZhTW } from './date/zhTW';
|
|
28
3
|
export { default as dateEnUS } from './date/enUS';
|
|
29
4
|
export { default as dateRuRU } from './date/ruRU';
|
|
30
|
-
export { default as dateUkUA } from './date/ukUA';
|
|
31
|
-
export { default as dateJaJP } from './date/jaJP';
|
|
32
|
-
export { default as dateKoKR } from './date/koKR';
|
|
33
|
-
export { default as dateIdID } from './date/idID';
|
|
34
|
-
export { default as dateDeDE } from './date/deDE';
|
|
35
|
-
export { default as dateNbNO } from './date/nbNO';
|
|
36
|
-
export { default as dateNlNL } from './date/nlNL';
|
|
37
|
-
export { default as dateFrFR } from './date/frFR';
|
|
38
|
-
export { default as dateEsAR } from './date/esAR';
|
|
39
|
-
export { default as dateItIT } from './date/itIT';
|
|
40
|
-
export { default as dateSkSK } from './date/skSK';
|
|
41
|
-
export { default as dateEnGB } from './date/enGB';
|
|
42
|
-
export { default as datePlPL } from './date/plPL';
|
|
43
|
-
export { default as datePtBR } from './date/ptBR';
|
|
44
|
-
export { default as dateThTH } from './date/thTH';
|
|
45
|
-
export { default as dateArDZ } from './date/arDZ';
|
|
46
|
-
export { default as dateTrTR } from './date/trTR';
|
|
47
|
-
export { default as dateEo } from './date/eo';
|
|
48
|
-
export { default as dateViVN } from './date/viVN';
|
|
49
|
-
export { default as dateFaIR } from './date/faIR';
|
|
50
|
-
export { default as dateSvSE } from './date/svSE';
|
|
51
5
|
export type { ULocale } from './common/enUS';
|
|
52
6
|
export type { UDateLocale } from './date/enUS';
|
|
53
7
|
export type { UPartialLocale } from './utils/index';
|
package/es/locales/index.js
CHANGED
|
@@ -1,51 +1,5 @@
|
|
|
1
|
-
export { default as zhCN } from './common/zhCN';
|
|
2
|
-
export { default as zhTW } from './common/zhTW';
|
|
3
1
|
export { default as enUS } from './common/enUS';
|
|
4
2
|
export { default as ruRU } from './common/ruRU';
|
|
5
|
-
export { default as ukUA } from './common/ukUA';
|
|
6
|
-
export { default as jaJP } from './common/jaJP';
|
|
7
|
-
export { default as koKR } from './common/koKR';
|
|
8
|
-
export { default as idID } from './common/idID';
|
|
9
|
-
export { default as deDE } from './common/deDE';
|
|
10
|
-
export { default as nbNO } from './common/nbNO';
|
|
11
|
-
export { default as nlNL } from './common/nlNL';
|
|
12
|
-
export { default as frFR } from './common/frFR';
|
|
13
|
-
export { default as esAR } from './common/esAR';
|
|
14
|
-
export { default as itIT } from './common/itIT';
|
|
15
|
-
export { default as skSK } from './common/skSK';
|
|
16
|
-
export { default as enGB } from './common/enGB';
|
|
17
|
-
export { default as plPL } from './common/plPL';
|
|
18
|
-
export { default as ptBR } from './common/ptBR';
|
|
19
|
-
export { default as thTH } from './common/thTH';
|
|
20
|
-
export { default as arDZ } from './common/arDZ';
|
|
21
|
-
export { default as trTR } from './common/trTR';
|
|
22
|
-
export { default as eo } from './common/eo';
|
|
23
|
-
export { default as viVN } from './common/viVN';
|
|
24
|
-
export { default as faIR } from './common/faIR';
|
|
25
|
-
export { default as svSE } from './common/svSE';
|
|
26
|
-
export { default as dateZhCN } from './date/zhCN';
|
|
27
|
-
export { default as dateZhTW } from './date/zhTW';
|
|
28
3
|
export { default as dateEnUS } from './date/enUS';
|
|
29
4
|
export { default as dateRuRU } from './date/ruRU';
|
|
30
|
-
export { default as dateUkUA } from './date/ukUA';
|
|
31
|
-
export { default as dateJaJP } from './date/jaJP';
|
|
32
|
-
export { default as dateKoKR } from './date/koKR';
|
|
33
|
-
export { default as dateIdID } from './date/idID';
|
|
34
|
-
export { default as dateDeDE } from './date/deDE';
|
|
35
|
-
export { default as dateNbNO } from './date/nbNO';
|
|
36
|
-
export { default as dateNlNL } from './date/nlNL';
|
|
37
|
-
export { default as dateFrFR } from './date/frFR';
|
|
38
|
-
export { default as dateEsAR } from './date/esAR';
|
|
39
|
-
export { default as dateItIT } from './date/itIT';
|
|
40
|
-
export { default as dateSkSK } from './date/skSK';
|
|
41
|
-
export { default as dateEnGB } from './date/enGB';
|
|
42
|
-
export { default as datePlPL } from './date/plPL';
|
|
43
|
-
export { default as datePtBR } from './date/ptBR';
|
|
44
|
-
export { default as dateThTH } from './date/thTH';
|
|
45
|
-
export { default as dateArDZ } from './date/arDZ';
|
|
46
|
-
export { default as dateTrTR } from './date/trTR';
|
|
47
|
-
export { default as dateEo } from './date/eo';
|
|
48
|
-
export { default as dateViVN } from './date/viVN';
|
|
49
|
-
export { default as dateFaIR } from './date/faIR';
|
|
50
|
-
export { default as dateSvSE } from './date/svSE';
|
|
51
5
|
export { createLocale } from './utils/index';
|
package/es/menu/src/utils.js
CHANGED
|
@@ -29,7 +29,9 @@ export function itemRenderer(tmNode, menuProps) {
|
|
|
29
29
|
}
|
|
30
30
|
const { labelField } = menuProps;
|
|
31
31
|
const { key, level, isGroup } = tmNode;
|
|
32
|
-
const props = Object.assign(Object.assign({}, rawNode), { title: (rawNode.title || rawNode[labelField]), extra: rawNode.titleExtra || rawNode.extra
|
|
32
|
+
const props = Object.assign(Object.assign({}, rawNode), { title: (rawNode.title || rawNode[labelField]), extra: rawNode.titleExtra || rawNode[labelField] !== rawNode.extra
|
|
33
|
+
? rawNode.extra
|
|
34
|
+
: '', key, internalKey: key, // since key can't be used as a prop
|
|
33
35
|
level, root: level === 0, isGroup });
|
|
34
36
|
if (tmNode.children) {
|
|
35
37
|
if (tmNode.isGroup) {
|
|
@@ -4,7 +4,7 @@ import { messageApiInjectionKey } from './context';
|
|
|
4
4
|
export function useMessage() {
|
|
5
5
|
const api = inject(messageApiInjectionKey, null);
|
|
6
6
|
if (api === null) {
|
|
7
|
-
throwError('use-message', 'No outer <u-message-provider /> founded. See prerequisite in https://
|
|
7
|
+
throwError('use-message', 'No outer <u-message-provider /> founded. See prerequisite in https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/message#Q-&-A.');
|
|
8
8
|
}
|
|
9
9
|
return api;
|
|
10
10
|
}
|
package/es/slider/src/Slider.js
CHANGED
|
@@ -7,7 +7,6 @@ import { call, useAdjustedTo, resolveSlot } from '../../_utils';
|
|
|
7
7
|
import { sliderLight } from '../styles';
|
|
8
8
|
import { isTouchEvent, useRefs } from './utils';
|
|
9
9
|
import style from './styles/index.cssr';
|
|
10
|
-
// ref: https://developer.mozilla.org/zh-CN/docs/Web/API/MouseEvent/button
|
|
11
10
|
const eventButtonLeft = 0;
|
|
12
11
|
export const sliderProps = Object.assign(Object.assign({}, useTheme.props), { to: useAdjustedTo.propTo, defaultValue: {
|
|
13
12
|
type: [Number, Array],
|
package/es/tabs/src/Tabs.js
CHANGED
|
@@ -491,12 +491,12 @@ export default defineComponent({
|
|
|
491
491
|
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
492
492
|
const tabPaneChildren = defaultSlot
|
|
493
493
|
? flatten(defaultSlot()).filter((v) => {
|
|
494
|
-
return v.type.
|
|
494
|
+
return v.type.name === 'TabPane';
|
|
495
495
|
})
|
|
496
496
|
: [];
|
|
497
497
|
const tabChildren = defaultSlot
|
|
498
498
|
? flatten(defaultSlot()).filter((v) => {
|
|
499
|
-
return v.type.
|
|
499
|
+
return v.type.name === 'Tab';
|
|
500
500
|
})
|
|
501
501
|
: [];
|
|
502
502
|
const showPane = !tabChildren.length;
|
|
@@ -19,11 +19,12 @@ export type ShouldUseThumbnailUrl = (file: SettledFileInfo) => boolean;
|
|
|
19
19
|
export type FuncOrRecordOrUndef<T = string> = Record<string, T> | (({ file }: {
|
|
20
20
|
file: SettledFileInfo;
|
|
21
21
|
}) => Record<string, T>) | undefined;
|
|
22
|
-
export
|
|
22
|
+
export interface OnChangePayload {
|
|
23
23
|
file: SettledFileInfo;
|
|
24
24
|
fileList: SettledFileInfo[];
|
|
25
25
|
event: ProgressEvent | Event | undefined;
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
|
+
export type OnChange = (data: OnChangePayload) => void;
|
|
27
28
|
export type OnFinish = ({ file, event }: {
|
|
28
29
|
file: SettledFileInfo;
|
|
29
30
|
event?: ProgressEvent;
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.12.
|
|
1
|
+
declare const _default: "1.12.5";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.12.
|
|
1
|
+
export default '1.12.5';
|
|
@@ -32,8 +32,9 @@ const i18n = function (data) {
|
|
|
32
32
|
return {
|
|
33
33
|
locale: (0, vue_1.toRef)(localeReactive, 'locale'),
|
|
34
34
|
t(key) {
|
|
35
|
+
var _a;
|
|
35
36
|
const { locale } = localeReactive;
|
|
36
|
-
return data[locale][key];
|
|
37
|
+
return (_a = data[locale]) === null || _a === void 0 ? void 0 : _a[key];
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
40
|
};
|
package/lib/chat/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as UChat } from './src/Chat';
|
|
2
2
|
export { default as UChatListItems } from './src/ChatListItems';
|
|
3
3
|
export { default as UChatMessages } from './src/ChatMessages';
|
|
4
|
-
export type { ChatId, ChatProps, ChatListItemProps, ChatMessageProps, ChatMarkProps, ChatHeaderProps, ChatFooterProps, ChatListHeaderProps, ChatSlots, ChatListItemSlots, ChatMessageSlots, ChatMarkSlots, ChatHeaderSlots, ChatFooterSlots, ChatListItemData, ChatMessageData, ChatAttachment, OnChatSelect, OnMessageSend, OnAttachmentUpload, OnFilterChange, OnNetworkError, OnUploadError, OnSendError, ChatInst, ChatListInst, chatInjectionKey } from './src/interface';
|
|
4
|
+
export type { ChatId, ChatProps, ChatListItemProps, ChatMessageProps, ChatMarkProps, ChatHeaderProps, ChatFooterProps, ChatListHeaderProps, ChatSlots, ChatListItemSlots, ChatMessageSlots, ChatMarkSlots, ChatHeaderSlots, ChatFooterSlots, ChatListItemData, ChatMessageData, ChatAttachment, OnChatSelect, OnMessageSend, OnAttachmentUpload, OnFilterChange, OnNetworkError, OnUploadError, OnSendError, ChatInst, ChatListInst, ChatAttachmentStatus, chatInjectionKey } from './src/interface';
|
|
5
5
|
export { MessageStatus, ChatMessageType, ChatMarkType } from './src/interface';
|
|
6
6
|
export type { ChatListItemsProps } from './src/ChatListItems';
|
|
7
7
|
export type { ChatMessagesProps } from './src/ChatMessages';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
|
-
import
|
|
2
|
+
import { ChatAttachment as ChatAttachmentType, ChatMessageData } from '../interface';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
message: {
|
|
5
5
|
type: PropType<ChatMessageData>;
|
|
@@ -61,7 +61,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
61
61
|
return ({
|
|
62
62
|
id: `${String(props.message.id)}-attachment-${index}`,
|
|
63
63
|
name: attachment.name,
|
|
64
|
-
status: attachment.status ||
|
|
64
|
+
status: attachment.status || interface_1.ChatAttachmentStatus.FINISHED,
|
|
65
65
|
percentage: (_a = attachment.percentage) !== null && _a !== void 0 ? _a : null,
|
|
66
66
|
url: (_b = attachment.url) !== null && _b !== void 0 ? _b : null,
|
|
67
67
|
thumbnailUrl: getThumbnailUrl(attachment),
|
|
@@ -77,9 +77,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
77
77
|
gap: '2px',
|
|
78
78
|
marginTop: '0'
|
|
79
79
|
}
|
|
80
|
-
: undefined, showRemoveButton: false, showDownloadButton: props.attachments.some((attachment) => attachment.status ===
|
|
80
|
+
: undefined, showRemoveButton: false, showDownloadButton: props.attachments.some((attachment) => attachment.status === interface_1.ChatAttachmentStatus.FINISHED &&
|
|
81
81
|
attachment.url &&
|
|
82
|
-
attachment.url !== '#'), showRetryButton: props.attachments.some((attachment) => attachment.status ===
|
|
82
|
+
attachment.url !== '#'), showRetryButton: props.attachments.some((attachment) => attachment.status === interface_1.ChatAttachmentStatus.ERROR), onDownload: handleDownload }), {
|
|
83
83
|
default: () => ((0, vue_1.h)(upload_1.UUploadFileList, null, {
|
|
84
84
|
'upload-file-title': slots['upload-file-title']
|
|
85
85
|
? ({ file }) => { var _a; return (_a = slots['upload-file-title']) === null || _a === void 0 ? void 0 : _a.call(slots, file); }
|
|
@@ -360,6 +360,16 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
360
360
|
}))();
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
+
const handleOnChange = () => {
|
|
364
|
+
var _a;
|
|
365
|
+
const outerOnChange = (_a = footerUploadPropsRef.value) === null || _a === void 0 ? void 0 : _a.onChange;
|
|
366
|
+
if (outerOnChange) {
|
|
367
|
+
return (data) => {
|
|
368
|
+
outerOnChange(data);
|
|
369
|
+
attachmentFileList.value = [];
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
};
|
|
363
373
|
const renderEditingBlock = () => {
|
|
364
374
|
if (!(editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value) || !editingMessage.value)
|
|
365
375
|
return null;
|
|
@@ -379,7 +389,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
379
389
|
};
|
|
380
390
|
const renderFooter = () => {
|
|
381
391
|
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__footer` },
|
|
382
|
-
(0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value), {
|
|
392
|
+
(0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
|
|
383
393
|
default: () => ((0, vue_1.h)(flex_1.UFlex, { align: "end", size: "small", wrap: false, class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
|
|
384
394
|
default: () => ((0, vue_1.h)(vue_1.Fragment, null,
|
|
385
395
|
(0, vue_1.h)(upload_1.UUploadTrigger, { abstract: true }, {
|