@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
|
@@ -26,8 +26,9 @@ export const i18n = function (data) {
|
|
|
26
26
|
return {
|
|
27
27
|
locale: toRef(localeReactive, 'locale'),
|
|
28
28
|
t(key) {
|
|
29
|
+
var _a;
|
|
29
30
|
const { locale } = localeReactive;
|
|
30
|
-
return data[locale][key];
|
|
31
|
+
return (_a = data[locale]) === null || _a === void 0 ? void 0 : _a[key];
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
};
|
package/es/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>;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { h, defineComponent, inject } from 'vue';
|
|
11
11
|
import { UUpload, UUploadFileList } from '../../../upload';
|
|
12
|
-
import { chatInjectionKey } from '../interface';
|
|
12
|
+
import { ChatAttachmentStatus, chatInjectionKey } from '../interface';
|
|
13
13
|
export default defineComponent({
|
|
14
14
|
name: 'ChatAttachment',
|
|
15
15
|
props: {
|
|
@@ -59,7 +59,7 @@ export default defineComponent({
|
|
|
59
59
|
return ({
|
|
60
60
|
id: `${String(props.message.id)}-attachment-${index}`,
|
|
61
61
|
name: attachment.name,
|
|
62
|
-
status: attachment.status ||
|
|
62
|
+
status: attachment.status || ChatAttachmentStatus.FINISHED,
|
|
63
63
|
percentage: (_a = attachment.percentage) !== null && _a !== void 0 ? _a : null,
|
|
64
64
|
url: (_b = attachment.url) !== null && _b !== void 0 ? _b : null,
|
|
65
65
|
thumbnailUrl: getThumbnailUrl(attachment),
|
|
@@ -75,9 +75,9 @@ export default defineComponent({
|
|
|
75
75
|
gap: '2px',
|
|
76
76
|
marginTop: '0'
|
|
77
77
|
}
|
|
78
|
-
: undefined, showRemoveButton: false, showDownloadButton: props.attachments.some((attachment) => attachment.status ===
|
|
78
|
+
: undefined, showRemoveButton: false, showDownloadButton: props.attachments.some((attachment) => attachment.status === ChatAttachmentStatus.FINISHED &&
|
|
79
79
|
attachment.url &&
|
|
80
|
-
attachment.url !== '#'), showRetryButton: props.attachments.some((attachment) => attachment.status ===
|
|
80
|
+
attachment.url !== '#'), showRetryButton: props.attachments.some((attachment) => attachment.status === ChatAttachmentStatus.ERROR), onDownload: handleDownload }), {
|
|
81
81
|
default: () => (h(UUploadFileList, null, {
|
|
82
82
|
'upload-file-title': slots['upload-file-title']
|
|
83
83
|
? ({ file }) => { var _a; return (_a = slots['upload-file-title']) === null || _a === void 0 ? void 0 : _a.call(slots, file); }
|
|
@@ -355,6 +355,16 @@ export default defineComponent({
|
|
|
355
355
|
}))();
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
|
+
const handleOnChange = () => {
|
|
359
|
+
var _a;
|
|
360
|
+
const outerOnChange = (_a = footerUploadPropsRef.value) === null || _a === void 0 ? void 0 : _a.onChange;
|
|
361
|
+
if (outerOnChange) {
|
|
362
|
+
return (data) => {
|
|
363
|
+
outerOnChange(data);
|
|
364
|
+
attachmentFileList.value = [];
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
};
|
|
358
368
|
const renderEditingBlock = () => {
|
|
359
369
|
if (!(editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value) || !editingMessage.value)
|
|
360
370
|
return null;
|
|
@@ -374,7 +384,7 @@ export default defineComponent({
|
|
|
374
384
|
};
|
|
375
385
|
const renderFooter = () => {
|
|
376
386
|
return (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__footer` },
|
|
377
|
-
h(UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value), {
|
|
387
|
+
h(UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
|
|
378
388
|
default: () => (h(UFlex, { align: "end", size: "small", wrap: false, class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
|
|
379
389
|
default: () => (h(Fragment, null,
|
|
380
390
|
h(UUploadTrigger, { abstract: true }, {
|
|
@@ -8,6 +8,7 @@ import { EmptyProps } from '../../empty';
|
|
|
8
8
|
import { InputProps } from '../../input';
|
|
9
9
|
import type { ChatTheme } from '../styles';
|
|
10
10
|
import type { MergedTheme } from '../../_mixins';
|
|
11
|
+
import { OnChangePayload } from '../../upload/src/interface';
|
|
11
12
|
export declare enum MessageStatus {
|
|
12
13
|
READ = "read",
|
|
13
14
|
UNREAD = "unread",
|
|
@@ -20,6 +21,12 @@ export declare enum ChatMessageType {
|
|
|
20
21
|
FILE = "file",
|
|
21
22
|
MARK = "mark"
|
|
22
23
|
}
|
|
24
|
+
export declare enum ChatAttachmentStatus {
|
|
25
|
+
PENDING = "pending",
|
|
26
|
+
UPLOADING = "uploading",
|
|
27
|
+
FINISHED = "finished",
|
|
28
|
+
ERROR = "error"
|
|
29
|
+
}
|
|
23
30
|
export declare enum ChatMarkType {
|
|
24
31
|
SYSTEM = "system",
|
|
25
32
|
EVENT = "event",
|
|
@@ -120,7 +127,7 @@ export interface ChatAttachment {
|
|
|
120
127
|
size?: number | string;
|
|
121
128
|
thumbnail?: string | (() => VNodeChild);
|
|
122
129
|
preview?: string | (() => VNodeChild);
|
|
123
|
-
status?:
|
|
130
|
+
status?: ChatAttachmentStatus;
|
|
124
131
|
percentage?: number;
|
|
125
132
|
uploadProps?: Partial<UploadProps>;
|
|
126
133
|
}
|
|
@@ -346,3 +353,4 @@ export declare const chatInjectionKey: InjectionKey<{
|
|
|
346
353
|
headerShareIconPropsRef: Ref<Partial<IconProps> | undefined>;
|
|
347
354
|
headerProfileIconPropsRef: Ref<Partial<IconProps> | undefined>;
|
|
348
355
|
}>;
|
|
356
|
+
export type HandleOnChangeType = ((data: OnChangePayload) => void) | undefined;
|
package/es/chat/src/interface.js
CHANGED
|
@@ -13,6 +13,13 @@ export var ChatMessageType;
|
|
|
13
13
|
ChatMessageType["FILE"] = "file";
|
|
14
14
|
ChatMessageType["MARK"] = "mark";
|
|
15
15
|
})(ChatMessageType || (ChatMessageType = {}));
|
|
16
|
+
export var ChatAttachmentStatus;
|
|
17
|
+
(function (ChatAttachmentStatus) {
|
|
18
|
+
ChatAttachmentStatus["PENDING"] = "pending";
|
|
19
|
+
ChatAttachmentStatus["UPLOADING"] = "uploading";
|
|
20
|
+
ChatAttachmentStatus["FINISHED"] = "finished";
|
|
21
|
+
ChatAttachmentStatus["ERROR"] = "error";
|
|
22
|
+
})(ChatAttachmentStatus || (ChatAttachmentStatus = {}));
|
|
16
23
|
export var ChatMarkType;
|
|
17
24
|
(function (ChatMarkType) {
|
|
18
25
|
ChatMarkType["SYSTEM"] = "system";
|
|
@@ -399,6 +399,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
399
399
|
handleSearchResultSelect: (result: HeaderSearchResult) => void;
|
|
400
400
|
handlePreviewClick: () => void;
|
|
401
401
|
handleLogoutClick: () => void;
|
|
402
|
+
handleLogoClick: () => void;
|
|
402
403
|
toggleMobileMenu: () => void;
|
|
403
404
|
closeMobileMenu: () => void;
|
|
404
405
|
handleMobileMenuItemClick: (option: HeaderMenuOption) => void;
|
|
@@ -407,7 +408,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
407
408
|
menuPaneClass: ComputedRef<string>;
|
|
408
409
|
menuPaneWrapperClass: ComputedRef<string>;
|
|
409
410
|
onRender: () => void;
|
|
410
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ["search", "search-result-select", "preview", "logout", "language-select", "mobile-primary-action", "mobile-secondary-action"], "search" | "logout" | "preview" | "search-result-select" | "language-select" | "mobile-primary-action" | "mobile-secondary-action", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
411
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ["search", "search-result-select", "preview", "logout", "language-select", "logo-click", "mobile-primary-action", "mobile-secondary-action"], "search" | "logout" | "preview" | "search-result-select" | "language-select" | "logo-click" | "mobile-primary-action" | "mobile-secondary-action", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
411
412
|
menuOptions: {
|
|
412
413
|
type: PropType<HeaderPropsInterface["menuOptions"]>;
|
|
413
414
|
default: () => never[];
|
|
@@ -582,6 +583,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
582
583
|
onLogout?: ((...args: any[]) => any) | undefined;
|
|
583
584
|
"onSearch-result-select"?: ((...args: any[]) => any) | undefined;
|
|
584
585
|
"onLanguage-select"?: ((...args: any[]) => any) | undefined;
|
|
586
|
+
"onLogo-click"?: ((...args: any[]) => any) | undefined;
|
|
585
587
|
"onMobile-primary-action"?: ((...args: any[]) => any) | undefined;
|
|
586
588
|
"onMobile-secondary-action"?: ((...args: any[]) => any) | undefined;
|
|
587
589
|
}, {
|
package/es/header/src/Header.js
CHANGED
|
@@ -95,6 +95,7 @@ export default defineComponent({
|
|
|
95
95
|
'preview',
|
|
96
96
|
'logout',
|
|
97
97
|
'language-select',
|
|
98
|
+
'logo-click',
|
|
98
99
|
'mobile-primary-action',
|
|
99
100
|
'mobile-secondary-action'
|
|
100
101
|
],
|
|
@@ -193,9 +194,7 @@ export default defineComponent({
|
|
|
193
194
|
call(_onUpdateMenuValue, value);
|
|
194
195
|
}
|
|
195
196
|
function handleMenuValueUpdate(value) {
|
|
196
|
-
|
|
197
|
-
doUpdateMenuValue(value);
|
|
198
|
-
}
|
|
197
|
+
doUpdateMenuValue(value);
|
|
199
198
|
}
|
|
200
199
|
function handleSearchClick() {
|
|
201
200
|
searchVisibleRef.value = true;
|
|
@@ -232,6 +231,9 @@ export default defineComponent({
|
|
|
232
231
|
if (option.key !== undefined) {
|
|
233
232
|
doUpdateMenuValue(option.key);
|
|
234
233
|
}
|
|
234
|
+
if (option.onClick) {
|
|
235
|
+
option.onClick();
|
|
236
|
+
}
|
|
235
237
|
closeMobileMenu();
|
|
236
238
|
}
|
|
237
239
|
function handleMobilePrimaryAction() {
|
|
@@ -240,6 +242,9 @@ export default defineComponent({
|
|
|
240
242
|
function handleMobileSecondaryAction() {
|
|
241
243
|
emit('mobile-secondary-action');
|
|
242
244
|
}
|
|
245
|
+
function handleLogoClick() {
|
|
246
|
+
emit('logo-click');
|
|
247
|
+
}
|
|
243
248
|
return {
|
|
244
249
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
245
250
|
cssVars: cssVarsRef,
|
|
@@ -258,6 +263,7 @@ export default defineComponent({
|
|
|
258
263
|
handleSearchResultSelect,
|
|
259
264
|
handlePreviewClick,
|
|
260
265
|
handleLogoutClick,
|
|
266
|
+
handleLogoClick,
|
|
261
267
|
toggleMobileMenu,
|
|
262
268
|
closeMobileMenu,
|
|
263
269
|
handleMobileMenuItemClick,
|
|
@@ -273,7 +279,13 @@ export default defineComponent({
|
|
|
273
279
|
const { mergedClsPrefix, $slots } = this;
|
|
274
280
|
(_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
275
281
|
const blockClass = `${mergedClsPrefix}-header`;
|
|
276
|
-
const logoNode = resolveWrappedSlot($slots.logo, (children) => children ?
|
|
282
|
+
const logoNode = resolveWrappedSlot($slots.logo, (children) => children ? (h("div", { class: [
|
|
283
|
+
`${blockClass}__logo`,
|
|
284
|
+
this.logoSrc && `${blockClass}__logo--clickable`
|
|
285
|
+
].filter(Boolean), onClick: this.handleLogoClick }, children)) : null) || (h("div", { class: [
|
|
286
|
+
`${blockClass}__logo`,
|
|
287
|
+
this.logoSrc && `${blockClass}__logo--clickable`
|
|
288
|
+
].filter(Boolean), onClick: this.handleLogoClick },
|
|
277
289
|
h("img", { src: this.logoSrc, alt: this.logoAlt })));
|
|
278
290
|
const navigationNode = resolveWrappedSlot($slots.navigation, (children) => children !== null && children !== void 0 ? children : null) || (h(HeaderNavigation, { menuOptions: this.menuOptions, menuPlacement: this.menuPlacement, menuTrigger: this.menuTrigger, menuValue: this.mergedMenuValue, menuTabsProps: this.menuTabsProps, menuCardMinColumnWidth: this.menuCardMinColumnWidth, mergedClsPrefix: mergedClsPrefix, menuPaneClass: this.menuPaneClass, menuPaneWrapperClass: this.menuPaneWrapperClass, onUpdateMenuValue: this.handleMenuValueUpdate }));
|
|
279
291
|
const mobileNode = this.responsive && this.isMobile ? (h(HeaderMobile, { visible: this.mobileMenuVisible, menuOptions: this.normalizedMenuItems, activeMenuValue: this.mergedMenuValue, langOptions: this.langOptions || defaultLangOptions, currentLang: this.currentLang, mergedClsPrefix: mergedClsPrefix, cssVars: this.cssVars, menuType: this.mobileMenuType, showFooterActions: this.mobileShowFooterActions, showHeaderActions: this.mobileShowHeaderActions, primaryActionText: this.mobilePrimaryActionText, secondaryActionText: this.mobileSecondaryActionText, onToggle: this.toggleMobileMenu, onClose: this.closeMobileMenu, onMenuItemClick: this.handleMobileMenuItemClick, onLanguageSelect: this.handleSelectLang, onPrimaryAction: this.handleMobilePrimaryAction, onSecondaryAction: this.handleMobileSecondaryAction, onSearchClick: this.handleSearchClick, onPreview: this.handlePreviewClick, onLogout: this.handleLogoutClick }, {
|