@mobilon-dev/chotto 0.3.24 → 0.3.25
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 +111 -22
- package/dist/{CreateChat-DqPybXXn.js → CreateChat-CNWNXaD9.js} +1 -1
- package/dist/{CreateChat2-Bxs28ww_.js → CreateChat2-J1zCJAH1.js} +1 -1
- package/dist/{CreateDialog-IJDv_iIh.js → CreateDialog-D_VjGFWg.js} +1 -1
- package/dist/{ModalVideoRecorder-OOD5jytP.js → ModalVideoRecorder-BumRO5hZ.js} +1 -1
- package/dist/{SelectUser2-D9B0H77q.js → SelectUser2-DsxsLuNu.js} +1 -1
- package/dist/chotto.css +1 -1
- package/dist/{index-as74SdsT.js → index-D8kOhf51.js} +2720 -2462
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -2
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +56 -0
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.d.ts +49 -0
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationChannels.d.ts +42 -0
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationDialogSync.d.ts +26 -0
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts +32 -0
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationSubMenu.d.ts +25 -0
- package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -2
- package/dist/types/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.d.ts +65 -0
- package/dist/types/components/2_feed_elements/MessageStatusIndicator/stories/MessageStatusIndicator.stories.d.ts +12 -0
- package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +1 -5
- package/dist/types/components/3_compounds/ChatList/ChatListHeader.vue.d.ts +16 -0
- package/dist/types/components/3_compounds/ChatList/composables/index.d.ts +4 -0
- package/dist/types/components/3_compounds/ChatList/composables/useChatListActions.d.ts +29 -0
- package/dist/types/components/3_compounds/ChatList/composables/useChatListFilter.d.ts +58 -0
- package/dist/types/components/3_compounds/ChatList/composables/useChatListScroll.d.ts +34 -0
- package/dist/types/components/3_compounds/ChatList/composables/useChatListSelection.d.ts +56 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/vuessages.es.js +97 -95
- package/dist/vuessages.umd.js +21 -21
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
2
|
$emit: (event: "select-attribute-channel" | "phone-call", ...args: any[]) => void;
|
|
3
3
|
channels: unknown[];
|
|
4
|
+
channelTooltips: Record<string, any>;
|
|
4
5
|
contactAttributes: unknown[];
|
|
5
6
|
recentAttributeChannels: Record<string, any>;
|
|
6
7
|
selectedDialog: Record<string, any>;
|
|
7
|
-
channelTooltips: Record<string, any>;
|
|
8
8
|
$props: {
|
|
9
9
|
readonly channels?: unknown[] | undefined;
|
|
10
|
+
readonly channelTooltips?: Record<string, any> | undefined;
|
|
10
11
|
readonly contactAttributes?: unknown[] | undefined;
|
|
11
12
|
readonly recentAttributeChannels?: Record<string, any> | undefined;
|
|
12
13
|
readonly selectedDialog?: Record<string, any> | undefined;
|
|
13
|
-
readonly channelTooltips?: Record<string, any> | undefined;
|
|
14
14
|
};
|
|
15
15
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
16
|
export default _default;
|
package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import type { ContactAttribute } from './useCommunicationAttributes';
|
|
3
|
+
/**
|
|
4
|
+
* Тип канала панели коммуникаций.
|
|
5
|
+
*/
|
|
6
|
+
type Channel = {
|
|
7
|
+
channelId: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Тип информации о недавно использованном атрибуте для канала.
|
|
13
|
+
*/
|
|
14
|
+
type RecentAttributeMap = Record<string, {
|
|
15
|
+
channelId?: string;
|
|
16
|
+
} | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* Сигнатуры событий, которые эмитит панель.
|
|
19
|
+
*/
|
|
20
|
+
interface CommunicationActionsEmit {
|
|
21
|
+
(event: 'select-attribute-channel', payload: {
|
|
22
|
+
attributeId: string;
|
|
23
|
+
channelId: string;
|
|
24
|
+
}): void;
|
|
25
|
+
(event: 'phone-call', payload: {
|
|
26
|
+
attributeId: string;
|
|
27
|
+
phoneNumber: unknown;
|
|
28
|
+
}): void;
|
|
29
|
+
}
|
|
30
|
+
interface UseCommunicationActionsOptions {
|
|
31
|
+
activeChannelType: Ref<string | null>;
|
|
32
|
+
channels: ComputedRef<Channel[]>;
|
|
33
|
+
recentAttributeChannels: ComputedRef<RecentAttributeMap>;
|
|
34
|
+
selectedChannel: Ref<Channel | Record<string, unknown>>;
|
|
35
|
+
selectedChannelType: Ref<string | null>;
|
|
36
|
+
isRecentAttributeHovered: Ref<boolean>;
|
|
37
|
+
hoveredAttribute: Ref<ContactAttribute | null>;
|
|
38
|
+
closeMenu: () => void;
|
|
39
|
+
hasMultipleChannels: (channelType: string) => boolean;
|
|
40
|
+
getSingleChannelForType: (channelType: string) => Channel | null;
|
|
41
|
+
getAvailableChannels: (channelType: string) => Channel[];
|
|
42
|
+
emit: CommunicationActionsEmit;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Инкапсулирует действия панели: звонок, выбор каналов, выбор атрибутов и работу с недавними атрибутами.
|
|
46
|
+
*/
|
|
47
|
+
export declare function useCommunicationActions({ activeChannelType, channels, recentAttributeChannels, selectedChannel, selectedChannelType, isRecentAttributeHovered, hoveredAttribute, closeMenu, hasMultipleChannels, getSingleChannelForType, getAvailableChannels, emit, }: UseCommunicationActionsOptions): {
|
|
48
|
+
handlePhoneCall: (attribute: ContactAttribute | null | undefined) => void;
|
|
49
|
+
handleRecentAttributeClick: (recentAttribute: ContactAttribute | null) => void;
|
|
50
|
+
handleAttributeClick: (attribute: ContactAttribute) => void;
|
|
51
|
+
selectSingleChannel: (attribute: ContactAttribute, channelId: string) => void;
|
|
52
|
+
selectChannelForRecentAttribute: (channelId: string, recentAttribute: ContactAttribute | null) => void;
|
|
53
|
+
selectChannel: (channelId: string) => void;
|
|
54
|
+
availableChannels: () => Channel[];
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Ref, type ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Тип контактного атрибута из панели коммуникаций.
|
|
4
|
+
*/
|
|
5
|
+
export type ContactAttribute = {
|
|
6
|
+
id: string;
|
|
7
|
+
type: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
data?: unknown;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Тип описания недавнего атрибута в пропсах.
|
|
14
|
+
*/
|
|
15
|
+
export type RecentAttributeChannel = {
|
|
16
|
+
attributeId?: string;
|
|
17
|
+
channelId?: string;
|
|
18
|
+
tooltip?: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
};
|
|
21
|
+
type MaybeRef<T> = T | Ref<T> | ComputedRef<T>;
|
|
22
|
+
/**
|
|
23
|
+
* Параметры composable для работы с контактными атрибутами.
|
|
24
|
+
*/
|
|
25
|
+
interface UseCommunicationAttributesOptions {
|
|
26
|
+
/** Реактивный список контактных атрибутов */
|
|
27
|
+
contactAttributes: MaybeRef<ContactAttribute[]>;
|
|
28
|
+
/** Реактивная карта недавних атрибутов по типам */
|
|
29
|
+
recentAttributeChannels: MaybeRef<Record<string, RecentAttributeChannel>>;
|
|
30
|
+
/** Текущий активный тип канала */
|
|
31
|
+
activeChannelType: Ref<string | null>;
|
|
32
|
+
/** Текущий замороженный атрибут (подсвеченный) */
|
|
33
|
+
frozenAttribute: Ref<{
|
|
34
|
+
id?: string;
|
|
35
|
+
} | null>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Формирует структуру организованных атрибутов, вычисляет "последний" атрибут
|
|
39
|
+
* для активного канала и предоставляет вспомогательные методы для панели коммуникаций.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useCommunicationAttributes({ contactAttributes, recentAttributeChannels, activeChannelType, frozenAttribute, }: UseCommunicationAttributesOptions): {
|
|
42
|
+
organizedContactAttributes: Ref<Record<string, ContactAttribute[]>, Record<string, ContactAttribute[]>>;
|
|
43
|
+
organizeContactAttributes: () => void;
|
|
44
|
+
recentAttribute: ComputedRef<ContactAttribute | null>;
|
|
45
|
+
getRecentAttributeByType: (channelType: string) => ContactAttribute | null;
|
|
46
|
+
showRecentAttribute: ComputedRef<boolean>;
|
|
47
|
+
isAttributeFrozen: (attribute: ContactAttribute | null | undefined) => boolean;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationChannels.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Component, type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Список поддерживаемых типов каналов в панели коммуникаций.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CHANNEL_TYPES: readonly ["phone", "whatsapp", "telegram", "max", "sms"];
|
|
6
|
+
export type ChannelType = (typeof CHANNEL_TYPES)[number];
|
|
7
|
+
/**
|
|
8
|
+
* Базовое описание канала.
|
|
9
|
+
*/
|
|
10
|
+
type Channel = {
|
|
11
|
+
channelId: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
type MaybeRef<T> = T | Ref<T> | ComputedRef<T>;
|
|
16
|
+
type ChannelTooltips = Record<string, string>;
|
|
17
|
+
type ChannelsRef = MaybeRef<Channel[]>;
|
|
18
|
+
type ChannelTooltipsRef = MaybeRef<ChannelTooltips | undefined>;
|
|
19
|
+
interface UseCommunicationChannelsOptions {
|
|
20
|
+
/** Реактивный список каналов */
|
|
21
|
+
channels: ChannelsRef;
|
|
22
|
+
/** Реактивная карта пользовательских подсказок */
|
|
23
|
+
channelTooltips?: ChannelTooltipsRef;
|
|
24
|
+
/** Текущий выбранный тип канала */
|
|
25
|
+
selectedChannelType: Ref<string | null>;
|
|
26
|
+
}
|
|
27
|
+
export declare function useCommunicationChannels({ channels, channelTooltips, selectedChannelType }: UseCommunicationChannelsOptions): {
|
|
28
|
+
channelsTypes: ComputedRef<{
|
|
29
|
+
type: "phone" | "whatsapp" | "telegram" | "max" | "sms";
|
|
30
|
+
component: Component;
|
|
31
|
+
}[]>;
|
|
32
|
+
getTooltipText: (channelType: string) => string;
|
|
33
|
+
getChannelTypeFromId: (channelId: string | null | undefined) => string | null;
|
|
34
|
+
hasMultipleChannels: (channelType: string) => boolean;
|
|
35
|
+
isChannelActive: (channelType: string) => boolean;
|
|
36
|
+
getSingleChannelForType: (channelType: string) => Channel | null;
|
|
37
|
+
getMenuChannelIconComponent: (channelType: string) => Component | null;
|
|
38
|
+
getMenuChannelIconComponentForChannelId: (channelId: string) => Component | null;
|
|
39
|
+
getSingleMenuChannelIconComponent: (channelType: string) => Component | null;
|
|
40
|
+
getAvailableChannels: (channelType: string) => Channel[];
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
+
interface Dialog {
|
|
3
|
+
channelId?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
interface Channel {
|
|
7
|
+
channelId: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
interface UseCommunicationDialogSyncOptions {
|
|
11
|
+
/** Текущее выбранное значение типа канала */
|
|
12
|
+
selectedChannelType: Ref<string | null>;
|
|
13
|
+
/** Текущий выбранный канал */
|
|
14
|
+
selectedChannel: Ref<Channel | Record<string, unknown>>;
|
|
15
|
+
/** Список доступных каналов */
|
|
16
|
+
channels: Ref<Channel[]>;
|
|
17
|
+
/** Текущий выбранный диалог */
|
|
18
|
+
selectedDialog: MaybeRef<Dialog | null | undefined>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Синхронизирует выбранный канал панели с внешним диалогом.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useCommunicationDialogSync({ selectedChannelType, selectedChannel, channels, selectedDialog, }: UseCommunicationDialogSyncOptions): {
|
|
24
|
+
updateSelectedChannelFromDialog: (dialog: Dialog | null | undefined) => void;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Опции для composable управления меню коммуникаций.
|
|
4
|
+
*/
|
|
5
|
+
interface UseCommunicationMenuOptions {
|
|
6
|
+
/** Ссылка на корневой контейнер панели */
|
|
7
|
+
panelRef: Ref<HTMLElement | null>;
|
|
8
|
+
/** Ссылка на панель с кнопками каналов */
|
|
9
|
+
channelsPanelRef: Ref<HTMLElement | null>;
|
|
10
|
+
/** Текущий выбранный тип канала */
|
|
11
|
+
selectedChannelType: Ref<string | null>;
|
|
12
|
+
/** Замороженный атрибут (для подсветки при наведении) */
|
|
13
|
+
frozenAttribute: Ref<unknown>;
|
|
14
|
+
/** Флаг наведения на недавний атрибут */
|
|
15
|
+
isRecentAttributeHovered: Ref<boolean>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Компонует состояние и методы открытия/закрытия меню каналов, обработки кликов
|
|
19
|
+
* и вычисления ширины меню.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useCommunicationMenu({ panelRef, channelsPanelRef, selectedChannelType, frozenAttribute, isRecentAttributeHovered, }: UseCommunicationMenuOptions): {
|
|
22
|
+
activeChannelType: Ref<string | null, string | null>;
|
|
23
|
+
hoveredChannel: Ref<string | null, string | null>;
|
|
24
|
+
showMenu: Ref<boolean, boolean>;
|
|
25
|
+
showSubMenu: Ref<boolean, boolean>;
|
|
26
|
+
menuWidth: Ref<string, string>;
|
|
27
|
+
updateMenuWidth: () => void;
|
|
28
|
+
handleChannelClick: (channelType: string) => void;
|
|
29
|
+
closeMenu: () => void;
|
|
30
|
+
handleClickOutside: (event: Event) => void;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationSubMenu.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { ContactAttribute } from './useCommunicationAttributes';
|
|
3
|
+
interface UseCommunicationSubMenuOptions {
|
|
4
|
+
activeChannelType: Ref<string | null>;
|
|
5
|
+
showSubMenu: Ref<boolean>;
|
|
6
|
+
frozenAttribute: Ref<ContactAttribute | null>;
|
|
7
|
+
hoveredAttribute: Ref<ContactAttribute | null>;
|
|
8
|
+
isRecentAttributeHovered: Ref<boolean>;
|
|
9
|
+
hasMultipleChannels: (channelType: string) => boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Управляет состоянием подменю выбора канала и hover-состояниями атрибутов.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useCommunicationSubMenu({ activeChannelType, showSubMenu, frozenAttribute, hoveredAttribute, isRecentAttributeHovered, hasMultipleChannels, }: UseCommunicationSubMenuOptions): {
|
|
15
|
+
subMenuTop: Ref<number, number>;
|
|
16
|
+
resetRegularAttributeHover: () => void;
|
|
17
|
+
handleRecentAttributeMouseEnter: (eventTarget: EventTarget | null) => EventTarget | null | undefined;
|
|
18
|
+
handleRecentAttributeMouseLeave: () => void;
|
|
19
|
+
handleAttributeMouseEnter: (attribute: ContactAttribute, eventTarget: EventTarget | null) => EventTarget | null;
|
|
20
|
+
handleAttributeMouseLeave: () => void;
|
|
21
|
+
keepSubMenuOpen: () => void;
|
|
22
|
+
closeSubMenu: () => void;
|
|
23
|
+
alignSubMenuWithTarget: (panelRef: Ref<HTMLElement | null>, targetEl: HTMLElement | null) => void;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ declare const meta: {
|
|
|
4
4
|
component: import("vue").DefineComponent<{}, {
|
|
5
5
|
$emit: (event: "select-attribute-channel" | "phone-call", ...args: any[]) => void;
|
|
6
6
|
channels: unknown[];
|
|
7
|
+
channelTooltips: Record<string, any>;
|
|
7
8
|
contactAttributes: unknown[];
|
|
8
9
|
recentAttributeChannels: Record<string, any>;
|
|
9
10
|
selectedDialog: Record<string, any>;
|
|
10
|
-
channelTooltips: Record<string, any>;
|
|
11
11
|
$props: {
|
|
12
12
|
readonly channels?: unknown[] | undefined;
|
|
13
|
+
readonly channelTooltips?: Record<string, any> | undefined;
|
|
13
14
|
readonly contactAttributes?: unknown[] | undefined;
|
|
14
15
|
readonly recentAttributeChannels?: Record<string, any> | undefined;
|
|
15
16
|
readonly selectedDialog?: Record<string, any> | undefined;
|
|
16
|
-
readonly channelTooltips?: Record<string, any> | undefined;
|
|
17
17
|
};
|
|
18
18
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
19
19
|
args: {};
|
package/dist/types/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
baseClass: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
messageStatus: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
statusClass: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
statusTitle: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
messageClass: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
tooltipPosition: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
statuses: {
|
|
27
|
+
type: () => string[];
|
|
28
|
+
default: () => string[];
|
|
29
|
+
};
|
|
30
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
baseClass: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
messageStatus: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
statusClass: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
statusTitle: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
messageClass: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
tooltipPosition: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
statuses: {
|
|
56
|
+
type: () => string[];
|
|
57
|
+
default: () => string[];
|
|
58
|
+
};
|
|
59
|
+
}>> & Readonly<{}>, {
|
|
60
|
+
statuses: string[];
|
|
61
|
+
statusClass: string;
|
|
62
|
+
statusTitle: string;
|
|
63
|
+
tooltipPosition: string;
|
|
64
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
65
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import MessageStatusIndicator from '../MessageStatusIndicator.vue';
|
|
3
|
+
declare const meta: Meta<typeof MessageStatusIndicator>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof MessageStatusIndicator>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Read: Story;
|
|
8
|
+
export declare const Received: Story;
|
|
9
|
+
export declare const Sent: Story;
|
|
10
|
+
export declare const Pending: Story;
|
|
11
|
+
export declare const Error: Story;
|
|
12
|
+
export declare const HiddenForLeftMessage: Story;
|
|
@@ -5,10 +5,8 @@ type __VLS_WithSlots<T, S> = T & (new () => {
|
|
|
5
5
|
});
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
7
7
|
$emit: (event: "search" | "select" | "action" | "expand" | "tab-click" | "loadMoreChats" | "clear-search", ...args: any[]) => void;
|
|
8
|
-
title: string;
|
|
9
8
|
chats: unknown[];
|
|
10
9
|
searchQuery: string;
|
|
11
|
-
titleEnabled: boolean;
|
|
12
10
|
filterEnabled: boolean;
|
|
13
11
|
filterQuery: string;
|
|
14
12
|
dialogTabs: unknown[];
|
|
@@ -17,10 +15,8 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
|
17
15
|
searchProgress: string;
|
|
18
16
|
searchStats: Record<string, any>;
|
|
19
17
|
$props: {
|
|
20
|
-
readonly title?: string | undefined;
|
|
21
18
|
readonly chats?: unknown[] | undefined;
|
|
22
19
|
readonly searchQuery?: string | undefined;
|
|
23
|
-
readonly titleEnabled?: boolean | undefined;
|
|
24
20
|
readonly filterEnabled?: boolean | undefined;
|
|
25
21
|
readonly filterQuery?: string | undefined;
|
|
26
22
|
readonly dialogTabs?: unknown[] | undefined;
|
|
@@ -31,7 +27,7 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
|
31
27
|
};
|
|
32
28
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
29
|
type __VLS_Slots = {
|
|
34
|
-
|
|
30
|
+
header?: ((props: {}) => any) | undefined;
|
|
35
31
|
} & {
|
|
36
32
|
sidebar?: ((props: {}) => any) | undefined;
|
|
37
33
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
2
|
+
export default _default;
|
|
3
|
+
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
4
|
+
$slots: S;
|
|
5
|
+
});
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
7
|
+
title: string;
|
|
8
|
+
titleEnabled: boolean;
|
|
9
|
+
$props: {
|
|
10
|
+
readonly title?: string | undefined;
|
|
11
|
+
readonly titleEnabled?: boolean | undefined;
|
|
12
|
+
};
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
type __VLS_Slots = {
|
|
15
|
+
actions?: ((props: {}) => any) | undefined;
|
|
16
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Композабл для обработки действий в списке чатов.
|
|
3
|
+
* Инкапсулирует логику эмита событий для расширения чата,
|
|
4
|
+
* выполнения действий и обработки кликов по табам.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Тип эмиттера событий для действий списка чатов.
|
|
8
|
+
*/
|
|
9
|
+
type ChatListActionsEmit = {
|
|
10
|
+
/** Событие расширения чата */
|
|
11
|
+
(event: 'expand', args: unknown): void;
|
|
12
|
+
/** Событие выполнения действия */
|
|
13
|
+
(event: 'action', data: unknown): void;
|
|
14
|
+
/** Событие клика по табу */
|
|
15
|
+
(event: 'tab-click', tabId: string): void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Параметры и зависимости композабла.
|
|
19
|
+
*/
|
|
20
|
+
interface UseChatListActionsOptions {
|
|
21
|
+
/** Функция эмита событий */
|
|
22
|
+
emit: ChatListActionsEmit;
|
|
23
|
+
}
|
|
24
|
+
export declare function useChatListActions({ emit }: UseChatListActionsOptions): {
|
|
25
|
+
expandChat: (args: unknown) => void;
|
|
26
|
+
action: (data: unknown) => void;
|
|
27
|
+
handleTabClick: (tabId: string) => void;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Композабл для фильтрации и сортировки списка чатов.
|
|
3
|
+
* Инкапсулирует логику сортировки по времени активности и количеству
|
|
4
|
+
* непрочитанных сообщений, фильтрации по табам, тегам и текстовому поиску.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Тип элемента чата.
|
|
8
|
+
*/
|
|
9
|
+
type ChatItem = {
|
|
10
|
+
chatId: string;
|
|
11
|
+
name: string;
|
|
12
|
+
metadata: string;
|
|
13
|
+
countUnread: number;
|
|
14
|
+
'lastActivity.timestamp'?: string | number;
|
|
15
|
+
contact?: {
|
|
16
|
+
tags?: Array<{
|
|
17
|
+
tagId: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Параметры компонента для фильтрации.
|
|
24
|
+
*/
|
|
25
|
+
type ChatListFilterProps = {
|
|
26
|
+
chats: ChatItem[];
|
|
27
|
+
filterEnabled: boolean;
|
|
28
|
+
filterQuery?: string | null;
|
|
29
|
+
dialogTabs?: unknown[];
|
|
30
|
+
activeTabId?: string;
|
|
31
|
+
searchQuery?: string;
|
|
32
|
+
isSearching?: boolean;
|
|
33
|
+
searchProgress?: string;
|
|
34
|
+
searchStats?: {
|
|
35
|
+
loaded: number;
|
|
36
|
+
total: number | string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Тип эмиттера событий для фильтрации.
|
|
41
|
+
*/
|
|
42
|
+
type ChatListFilterEmit = {
|
|
43
|
+
(event: 'search', value: string): void;
|
|
44
|
+
(event: 'clear-search'): void;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Параметры и зависимости композабла.
|
|
48
|
+
*/
|
|
49
|
+
interface UseChatListFilterOptions {
|
|
50
|
+
props: ChatListFilterProps;
|
|
51
|
+
emit: ChatListFilterEmit;
|
|
52
|
+
}
|
|
53
|
+
export declare function useChatListFilter({ props, emit }: UseChatListFilterOptions): {
|
|
54
|
+
filter: import("vue").Ref<string, string>;
|
|
55
|
+
getSortedAndFilteredChats: () => ChatItem[];
|
|
56
|
+
getFilter: (value: string) => void;
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Ref, type ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Композабл для управления скроллом списка чатов.
|
|
4
|
+
* Инкапсулирует логику прокрутки вверх, отслеживания позиции скролла,
|
|
5
|
+
* определения необходимости загрузки дополнительных чатов и отображения
|
|
6
|
+
* кнопки прокрутки вверх.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Тип эмиттера событий для скролла.
|
|
10
|
+
*/
|
|
11
|
+
type ChatListScrollEmit = {
|
|
12
|
+
/** Событие запроса загрузки дополнительных чатов */
|
|
13
|
+
(event: 'loadMoreChats'): void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Параметры и зависимости композабла.
|
|
17
|
+
*/
|
|
18
|
+
interface UseChatListScrollOptions {
|
|
19
|
+
/** Ссылка на DOM-элемент контейнера списка чатов */
|
|
20
|
+
refChatList: Ref<HTMLElement | undefined>;
|
|
21
|
+
/** Реактивный список чатов (для определения момента обновления) */
|
|
22
|
+
chats: ComputedRef<unknown[]> | Ref<unknown[]>;
|
|
23
|
+
/** Функция эмита событий */
|
|
24
|
+
emit: ChatListScrollEmit;
|
|
25
|
+
}
|
|
26
|
+
export declare function useChatListScroll({ refChatList, chats, emit }: UseChatListScrollOptions): {
|
|
27
|
+
allowLoadMore: Ref<boolean, boolean>;
|
|
28
|
+
isShowButton: Ref<boolean, boolean>;
|
|
29
|
+
scrollToTopForce: () => void;
|
|
30
|
+
scrollCheck: () => void;
|
|
31
|
+
startScrollWatch: (event: MouseEvent) => void;
|
|
32
|
+
stopScrollWatch: () => void;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Композабл для управления выбором чатов и диалогов в списке.
|
|
4
|
+
* Инкапсулирует логику установки состояния выбранного чата/диалога,
|
|
5
|
+
* сброса предыдущих выборов и эмита событий выбора.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Тип элемента чата.
|
|
9
|
+
*/
|
|
10
|
+
type ChatItem = {
|
|
11
|
+
chatId: string;
|
|
12
|
+
isSelected?: boolean;
|
|
13
|
+
dialogs?: Array<{
|
|
14
|
+
dialogId: string;
|
|
15
|
+
isSelected?: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Тип элемента диалога.
|
|
21
|
+
*/
|
|
22
|
+
type Dialog = {
|
|
23
|
+
dialogId: string;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Аргументы для выбора чата.
|
|
28
|
+
*/
|
|
29
|
+
type SelectChatArgs = {
|
|
30
|
+
/** Выбранный чат */
|
|
31
|
+
chat: ChatItem;
|
|
32
|
+
/** Опциональный выбранный диалог */
|
|
33
|
+
dialog?: Dialog;
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Тип эмиттера событий для выбора.
|
|
38
|
+
*/
|
|
39
|
+
type ChatListSelectionEmit = {
|
|
40
|
+
/** Событие выбора чата/диалога */
|
|
41
|
+
(event: 'select', args: SelectChatArgs): void;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Параметры и зависимости композабла.
|
|
45
|
+
*/
|
|
46
|
+
interface UseChatListSelectionOptions {
|
|
47
|
+
/** Реактивный список чатов */
|
|
48
|
+
chats: ComputedRef<ChatItem[]> | Ref<ChatItem[]>;
|
|
49
|
+
/** Функция эмита событий */
|
|
50
|
+
emit: ChatListSelectionEmit;
|
|
51
|
+
}
|
|
52
|
+
export declare function useChatListSelection({ chats, emit }: UseChatListSelectionOptions): {
|
|
53
|
+
selectChat: (args: SelectChatArgs) => void;
|
|
54
|
+
selectDialog: (dialog: Dialog) => void;
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
@@ -49,6 +49,7 @@ export { default as FileMessage } from './2_feed_elements/FileMessage/FileMessag
|
|
|
49
49
|
export { default as ImageMessage } from './2_feed_elements/ImageMessage/ImageMessage.vue';
|
|
50
50
|
export { default as MessageKeyboard } from './2_feed_elements/MessageKeyboard/MessageKeyboard.vue';
|
|
51
51
|
export { default as MessageReactions } from './2_feed_elements/MessageReactions/MessageReactions.vue';
|
|
52
|
+
export { default as MessageStatusIndicator } from './2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue';
|
|
52
53
|
export { default as StickerMessage } from './2_feed_elements/StickerMessage/StickerMessage.vue';
|
|
53
54
|
export { default as ReplyAudioMessage } from './2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue';
|
|
54
55
|
export { default as ReplyCallMessage } from './2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue';
|
|
@@ -67,6 +68,7 @@ export { default as ModalFullscreen } from './2_modals/ModalFullscreen/ModalFull
|
|
|
67
68
|
export { default as ModalNoFooter } from './2_modals/ModalNoFooter/ModalNoFooter.vue';
|
|
68
69
|
export { default as SelectUser } from './2_modals/SelectUser/SelectUser.vue';
|
|
69
70
|
export { default as ChatInput } from './3_compounds/ChatInput/ChatInput.vue';
|
|
71
|
+
export { default as ChatListHeader } from './3_compounds/ChatList/ChatListHeader.vue';
|
|
70
72
|
export { default as ChatList } from './3_compounds/ChatList/ChatList.vue';
|
|
71
73
|
export { default as Feed } from './3_compounds/Feed/Feed.vue';
|
|
72
74
|
export { default as SideBar } from './3_compounds/SideBar/SideBar.vue';
|