@knitify/vue 1.0.0 → 2.0.0
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 -86
- package/dist/index.es.js +3384 -1526
- package/dist/index.umd.js +1 -1
- package/dist/types/components/Avatar/KAvatar.vue.d.ts +5 -1
- package/dist/types/components/Avatar/types.d.ts +91 -3
- package/dist/types/components/Badge/types.d.ts +2 -0
- package/dist/types/components/Chat/KChatDivider.vue.d.ts +11 -0
- package/dist/types/components/Chat/KChatMessageActions.vue.d.ts +18 -0
- package/dist/types/components/Chat/KChatNotice.vue.d.ts +11 -0
- package/dist/types/components/Chat/KChatPrompt.vue.d.ts +1 -1
- package/dist/types/components/Chat/types.d.ts +90 -0
- package/dist/types/components/ChatDock/KChatDock.vue.d.ts +45 -0
- package/dist/types/components/ChatDock/KChatDockItem.vue.d.ts +11 -0
- package/dist/types/components/ChatDock/KChatDockPanel.vue.d.ts +11 -0
- package/dist/types/components/ChatDock/KChatWindow.vue.d.ts +27 -0
- package/dist/types/components/ChatDock/KMessenger.vue.d.ts +23 -0
- package/dist/types/components/ChatDock/keys.d.ts +98 -0
- package/dist/types/components/ChatDock/messenger-types.d.ts +280 -0
- package/dist/types/components/ChatDock/store-keys.d.ts +7 -0
- package/dist/types/components/ChatDock/types.d.ts +134 -0
- package/dist/types/components/ChatDock/useChatDock.d.ts +11 -0
- package/dist/types/components/Collapse/KCollapse.vue.d.ts +2 -2
- package/dist/types/components/Collapse/useCollapseSync.d.ts +7 -5
- package/dist/types/components/Drawer/KDrawer.vue.d.ts +3 -3
- package/dist/types/components/Dropdown/KDropdown.vue.d.ts +2 -2
- package/dist/types/components/Input/types.d.ts +1 -1
- package/dist/types/components/Modal/KModal.vue.d.ts +3 -3
- package/dist/types/components/Popover/KPopover.vue.d.ts +2 -2
- package/dist/types/components/Popover/useOverlaySync.d.ts +15 -1
- package/dist/types/components/Spinner/KSpinner.vue.d.ts +6 -0
- package/dist/types/components/Spinner/types.d.ts +13 -0
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/types.d.ts +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/useDocumentEvent.d.ts +19 -0
- package/dist/types/utils/useExclusive.d.ts +13 -0
- package/dist/types/utils/useTopmost.d.ts +17 -0
- package/dist/web-types.json +5107 -0
- package/package.json +17 -5
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type InjectionKey } from 'vue';
|
|
2
|
+
import type { ChatDockStore } from './messenger-types';
|
|
3
|
+
export declare const chatDockStoreKey: InjectionKey<ChatDockStore>;
|
|
4
|
+
/** Shares a store created with `useChatDock` with the component subtree. */
|
|
5
|
+
export declare function provideChatDock(store: ChatDockStore): void;
|
|
6
|
+
/** The store an ancestor provided, or `undefined` outside one. */
|
|
7
|
+
export declare function injectChatDock(): ChatDockStore | undefined;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export type KChatWindowState = 'expanded' | 'railed';
|
|
2
|
+
export type KChatDockProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Capacity floor, so a narrow dock still shows one window rather than
|
|
5
|
+
* nothing but heads. Gap, offset and window dimensions are deliberately not
|
|
6
|
+
* props — they are the CSS variables registered on `.KChatDock`, and the
|
|
7
|
+
* module measures them back rather than being told them twice.
|
|
8
|
+
*/
|
|
9
|
+
minWindows?: number;
|
|
10
|
+
};
|
|
11
|
+
export type KChatDockEmits = {
|
|
12
|
+
reflow: [];
|
|
13
|
+
launcher: [];
|
|
14
|
+
/** After the panel opens or closes. */
|
|
15
|
+
panel: [open: boolean];
|
|
16
|
+
/** After each filter, including the reset when the panel closes. */
|
|
17
|
+
search: [query: string];
|
|
18
|
+
/**
|
|
19
|
+
* An item was picked. `opened` is `true` when the dock expanded an existing
|
|
20
|
+
* `KChatWindow` with that id itself; `false` means the app must mount one.
|
|
21
|
+
*/
|
|
22
|
+
select: [id: string, opened: boolean];
|
|
23
|
+
/**
|
|
24
|
+
* A user expanded a railed window from its head, a `+N` popover row, or the
|
|
25
|
+
* window's own toggle. Distinct from `update:state` on the window, which
|
|
26
|
+
* also fires when a reflow un-rails by capacity.
|
|
27
|
+
*/
|
|
28
|
+
activate: [id: string];
|
|
29
|
+
};
|
|
30
|
+
export type KChatDockSlots = {
|
|
31
|
+
default?(): any;
|
|
32
|
+
launcher?(): any;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* `KChatWindow` teleports its head into the dock's rail, which makes it a
|
|
36
|
+
* multi-root (Fragment) component — unlike every other component in this
|
|
37
|
+
* package. A template `ref` on it resolves `$el` to the fragment's anchor
|
|
38
|
+
* text node, not the window element, so reading DOM properties (e.g.
|
|
39
|
+
* `.classList`) off that ref will throw.
|
|
40
|
+
*/
|
|
41
|
+
export type KChatWindowProps = {
|
|
42
|
+
closable?: boolean;
|
|
43
|
+
minimizable?: boolean;
|
|
44
|
+
title?: string;
|
|
45
|
+
unread?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Links this window to its head in the rail. Core reads it from
|
|
48
|
+
* `data-kt-chat-window` to pair the two, so a window without one gets no
|
|
49
|
+
* head — which is legitimate, just headless.
|
|
50
|
+
*/
|
|
51
|
+
id?: string;
|
|
52
|
+
};
|
|
53
|
+
export type KChatWindowEmits = {
|
|
54
|
+
close: [];
|
|
55
|
+
};
|
|
56
|
+
export type KChatWindowSlots = {
|
|
57
|
+
actions?(): any;
|
|
58
|
+
/**
|
|
59
|
+
* The fallback for `head` and `row` — a railed head's circle and a `+N`
|
|
60
|
+
* popover row. It does NOT appear in an open window's header: the title
|
|
61
|
+
* already names the conversation there, and the 320px header has the
|
|
62
|
+
* minimize and close controls competing for it.
|
|
63
|
+
*/
|
|
64
|
+
avatar?(): any;
|
|
65
|
+
default?(): any;
|
|
66
|
+
/** A railed head's circle. Falls back to `avatar` when not given. */
|
|
67
|
+
head?(): any;
|
|
68
|
+
/** The popover row's avatar. Falls back to `avatar` when not given. */
|
|
69
|
+
row?(): any;
|
|
70
|
+
title?(): any;
|
|
71
|
+
};
|
|
72
|
+
export type KChatDockPanelProps = {
|
|
73
|
+
/** Header text. */
|
|
74
|
+
title?: string;
|
|
75
|
+
/** Search field placeholder. */
|
|
76
|
+
placeholder?: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* `KChatDockPanel` teleports into the dock's row zone, so it is multi-root
|
|
80
|
+
* like `KChatWindow`: a template `ref` on it resolves `$el` to a fragment
|
|
81
|
+
* anchor, not the panel element.
|
|
82
|
+
*/
|
|
83
|
+
export type KChatDockPanelSlots = {
|
|
84
|
+
/** `KChatDockItem`s. */
|
|
85
|
+
default?(): any;
|
|
86
|
+
/**
|
|
87
|
+
* Header controls, between the title and the close button — so close stays
|
|
88
|
+
* last in the DOM and in the tab order. Rendered only when passed.
|
|
89
|
+
*
|
|
90
|
+
* Controls here bind their own handlers. Do not put
|
|
91
|
+
* `data-kt-chat-dock-item` on anything in this slot: `KChatDock`'s root
|
|
92
|
+
* click handler routes that attribute as a conversation selection.
|
|
93
|
+
*/
|
|
94
|
+
actions?(): any;
|
|
95
|
+
/** Replaces the "No conversations found" text. */
|
|
96
|
+
empty?(): any;
|
|
97
|
+
};
|
|
98
|
+
export type KChatDockItemProps = {
|
|
99
|
+
/** Conversation id, the same page-wide id space as `KChatWindow`'s `id`. */
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
/** One-line last-message preview, muted and truncated. */
|
|
103
|
+
preview?: string;
|
|
104
|
+
unread?: number;
|
|
105
|
+
};
|
|
106
|
+
export type KChatDockItemSlots = {
|
|
107
|
+
/** Inside the avatar circle. Falls back to initials from `name`. */
|
|
108
|
+
avatar?(): any;
|
|
109
|
+
/**
|
|
110
|
+
* Replaces the avatar circle entirely, for an app that draws its own — a
|
|
111
|
+
* stack of participant avatars for a group, a presence dot overlaid on the
|
|
112
|
+
* photo. `avatar` fills the built-in circle; this one stands in for it, so
|
|
113
|
+
* use it instead of nesting a circle inside `KAvatar`.
|
|
114
|
+
*
|
|
115
|
+
* Like `trailing`, this renders inside the row's own `<button>`: keep the
|
|
116
|
+
* content non-interactive, or the parser closes the button early and breaks
|
|
117
|
+
* `data-kt-chat-dock-item` click routing for every row after it.
|
|
118
|
+
*/
|
|
119
|
+
media?(): any;
|
|
120
|
+
/**
|
|
121
|
+
* After the body, where the unread badge sits. Falls back to that badge, so
|
|
122
|
+
* a row that does not use this slot is unchanged. Replacing the badge does
|
|
123
|
+
* not change the row's accessible name, which still folds in `unread` —
|
|
124
|
+
* keep the two consistent or pass a matching `unread`.
|
|
125
|
+
*
|
|
126
|
+
* This slot renders inside the row's own `<button>` — non-interactive
|
|
127
|
+
* content only (a badge, a timestamp). A nested `<button>` (e.g. a mute
|
|
128
|
+
* control) is invalid HTML: the parser repairs it by closing the outer
|
|
129
|
+
* button early, corrupting the row and breaking
|
|
130
|
+
* `data-kt-chat-dock-item` click routing for everything after it. For a
|
|
131
|
+
* real control, render it outside the row instead.
|
|
132
|
+
*/
|
|
133
|
+
trailing?(): any;
|
|
134
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChatDockLoaders, ChatDockOptions, ChatDockStore } from './messenger-types';
|
|
2
|
+
/**
|
|
3
|
+
* Owns everything about a dock's conversations except the DOM: which windows
|
|
4
|
+
* are open, each one's messages, cursor, loading state, error and draft, and
|
|
5
|
+
* every call to the app's loaders. `KMessenger` renders it; any component can
|
|
6
|
+
* hold the same instance through `provideChatDock` / `injectChatDock`.
|
|
7
|
+
*
|
|
8
|
+
* Every action is idempotent and safe before the list has loaded. None throws:
|
|
9
|
+
* a loader rejection becomes `error` / `listError` and an `'error'` event.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useChatDock(loaders: ChatDockLoaders, options?: ChatDockOptions): ChatDockStore;
|
|
@@ -10,16 +10,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
10
10
|
expand: () => boolean;
|
|
11
11
|
collapse: () => boolean;
|
|
12
12
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
expanded: () => any;
|
|
13
14
|
collapse: () => any;
|
|
14
15
|
collapsed: () => any;
|
|
15
16
|
expand: () => any;
|
|
16
|
-
expanded: () => any;
|
|
17
17
|
"update:expanded": (value: boolean) => any;
|
|
18
18
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
onExpanded?: (() => any) | undefined;
|
|
19
20
|
onCollapse?: (() => any) | undefined;
|
|
20
21
|
onCollapsed?: (() => any) | undefined;
|
|
21
22
|
onExpand?: (() => any) | undefined;
|
|
22
|
-
onExpanded?: (() => any) | undefined;
|
|
23
23
|
"onUpdate:expanded"?: ((value: boolean) => any) | undefined;
|
|
24
24
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -10,11 +10,13 @@ export type CollapseSyncOptions = {
|
|
|
10
10
|
/**
|
|
11
11
|
* Two-way binding between a `v-model` and core's Collapse module.
|
|
12
12
|
*
|
|
13
|
-
* `data-kt-collapse` stays on the element, so
|
|
14
|
-
* working
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* `data-kt-collapse` stays on the element, so `data-kt-collapse-group` keeps
|
|
14
|
+
* working: opening one pane closes its siblings inside core's `expand()` rather
|
|
15
|
+
* than through Vue. Each sibling hears its own `kt.collapse` and updates its own
|
|
16
|
+
* model, so grouping needs no coordination here.
|
|
17
|
+
*
|
|
18
|
+
* The toggle click is bound below rather than left to core's delegated handler,
|
|
19
|
+
* so a collapse works in an app that never called `Knitify.init()`.
|
|
18
20
|
*
|
|
19
21
|
* The guard is `moduleExpanded` — which way the module is actually going —
|
|
20
22
|
* rather than a flag set around the model write. Vue 3.5 batches reactive
|
|
@@ -13,16 +13,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
13
13
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
14
|
"update:open": (value: boolean) => any;
|
|
15
15
|
} & {
|
|
16
|
+
shown: () => any;
|
|
16
17
|
hidden: () => any;
|
|
17
18
|
hide: () => any;
|
|
18
19
|
show: () => any;
|
|
19
|
-
shown: () => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
|
+
onShown?: (() => any) | undefined;
|
|
21
22
|
onHidden?: (() => any) | undefined;
|
|
22
23
|
onHide?: (() => any) | undefined;
|
|
23
|
-
onShow?: (() => any) | undefined;
|
|
24
|
-
onShown?: (() => any) | undefined;
|
|
25
24
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
25
|
+
onShow?: (() => any) | undefined;
|
|
26
26
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
28
|
declare const _default: typeof __VLS_export;
|
|
@@ -10,12 +10,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
10
10
|
show: () => boolean;
|
|
11
11
|
hide: () => boolean;
|
|
12
12
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
-
hidden: () => any;
|
|
14
13
|
shown: () => any;
|
|
14
|
+
hidden: () => any;
|
|
15
15
|
"update:open": (value: boolean) => any;
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
-
onHidden?: (() => any) | undefined;
|
|
18
17
|
onShown?: (() => any) | undefined;
|
|
18
|
+
onHidden?: (() => any) | undefined;
|
|
19
19
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
20
20
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -4,7 +4,7 @@ export type KInputSlots = {
|
|
|
4
4
|
};
|
|
5
5
|
export type KInputProps = {
|
|
6
6
|
addonBordered?: boolean;
|
|
7
|
-
/** Implies `textarea`. Growth is core's `Input.ts`,
|
|
7
|
+
/** Implies `textarea`. Growth is core's `Input.ts`, driven by this component. */
|
|
8
8
|
autosize?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
ghost?: boolean;
|
|
@@ -15,16 +15,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
15
15
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
16
|
"update:open": (value: boolean) => any;
|
|
17
17
|
} & {
|
|
18
|
+
shown: () => any;
|
|
18
19
|
hidden: () => any;
|
|
19
20
|
hide: () => any;
|
|
20
21
|
show: () => any;
|
|
21
|
-
shown: () => any;
|
|
22
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
onShown?: (() => any) | undefined;
|
|
23
24
|
onHidden?: (() => any) | undefined;
|
|
24
25
|
onHide?: (() => any) | undefined;
|
|
25
|
-
onShow?: (() => any) | undefined;
|
|
26
|
-
onShown?: (() => any) | undefined;
|
|
27
26
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
27
|
+
onShow?: (() => any) | undefined;
|
|
28
28
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
30
|
declare const _default: typeof __VLS_export;
|
|
@@ -10,12 +10,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
10
10
|
show: () => boolean;
|
|
11
11
|
hide: () => boolean;
|
|
12
12
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
-
hidden: () => any;
|
|
14
13
|
shown: () => any;
|
|
14
|
+
hidden: () => any;
|
|
15
15
|
"update:open": (value: boolean) => any;
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
-
onHidden?: (() => any) | undefined;
|
|
18
17
|
onShown?: (() => any) | undefined;
|
|
18
|
+
onHidden?: (() => any) | undefined;
|
|
19
19
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
20
20
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -2,6 +2,8 @@ import { type Ref, type ShallowRef } from 'vue';
|
|
|
2
2
|
export type OverlayModule = {
|
|
3
3
|
hide(): void;
|
|
4
4
|
show(): void;
|
|
5
|
+
/** Core moves this to `<body>` while open, so it is outside the root. */
|
|
6
|
+
getContent?(): Element | null;
|
|
5
7
|
};
|
|
6
8
|
export type OverlaySyncOptions<T extends OverlayModule> = {
|
|
7
9
|
/** Builds the core module against the root element. */
|
|
@@ -10,6 +12,12 @@ export type OverlaySyncOptions<T extends OverlayModule> = {
|
|
|
10
12
|
element: Readonly<ShallowRef<HTMLElement | null>>;
|
|
11
13
|
onEvent?: (name: 'shown' | 'hidden') => void;
|
|
12
14
|
open: Ref<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Opening this overlay closes every other mounted overlay sharing the group.
|
|
17
|
+
* Replaces the sweep core's delegated toggle did by querying
|
|
18
|
+
* `[data-kt-popover].is-active` across the page.
|
|
19
|
+
*/
|
|
20
|
+
group?: string;
|
|
13
21
|
};
|
|
14
22
|
/**
|
|
15
23
|
* Two-way binding between a `v-model` and core's Popover, Dropdown or Tooltip.
|
|
@@ -28,7 +36,13 @@ export type OverlaySyncOptions<T extends OverlayModule> = {
|
|
|
28
36
|
* because Vue 3.5 batches reactive effects: a flag set around the model write
|
|
29
37
|
* would already be cleared by the time even a `sync` watcher ran.
|
|
30
38
|
*/
|
|
31
|
-
export declare function useOverlaySync<T extends OverlayModule>({ create, element, onEvent, open, }: OverlaySyncOptions<T>): {
|
|
39
|
+
export declare function useOverlaySync<T extends OverlayModule>({ create, element, group, onEvent, open, }: OverlaySyncOptions<T>): {
|
|
40
|
+
/**
|
|
41
|
+
* The live core instance, for module-specific behaviour a wrapper binds
|
|
42
|
+
* itself — Dropdown's submenus, for instance. Undefined before the root
|
|
43
|
+
* element exists.
|
|
44
|
+
*/
|
|
45
|
+
getInstance: () => T | undefined;
|
|
32
46
|
hide: () => void;
|
|
33
47
|
show: () => void;
|
|
34
48
|
toggle: () => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { KSpinnerProps } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<KSpinnerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KSpinnerProps> & Readonly<{}>, {
|
|
3
|
+
label: string;
|
|
4
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Intent, Size } from '../../types';
|
|
2
|
+
export type KSpinnerSize = Extract<Size, 'sm' | 'md' | 'lg'>;
|
|
3
|
+
export type KSpinnerProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Hide the spinner from assistive technology. Use when adjacent visible text
|
|
6
|
+
* already announces the loading state.
|
|
7
|
+
*/
|
|
8
|
+
decorative?: boolean;
|
|
9
|
+
/** Announced by screen readers to describe what is loading. */
|
|
10
|
+
label?: string;
|
|
11
|
+
size?: KSpinnerSize;
|
|
12
|
+
variant?: Intent;
|
|
13
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { accordionGroupKey } from './Accordion/keys';
|
|
2
2
|
export { chatBusyKey } from './Chat/keys';
|
|
3
|
+
export { chatDockKey } from './ChatDock/keys';
|
|
4
|
+
export { chatDockStoreKey, injectChatDock, provideChatDock, } from './ChatDock/store-keys';
|
|
5
|
+
export { useChatDock } from './ChatDock/useChatDock';
|
|
3
6
|
export { default as KAccordion } from './Accordion/KAccordion.vue';
|
|
4
7
|
export { default as KAccordionItem } from './Accordion/KAccordionItem.vue';
|
|
5
8
|
export { default as KAlert } from './Alert/KAlert.vue';
|
|
@@ -12,10 +15,18 @@ export { default as KButton } from './Button/KButton.vue';
|
|
|
12
15
|
export { default as KCalendar } from './Calendar/KCalendar.vue';
|
|
13
16
|
export { default as KCard } from './Card/KCard.vue';
|
|
14
17
|
export { default as KChat } from './Chat/KChat.vue';
|
|
18
|
+
export { default as KChatDock } from './ChatDock/KChatDock.vue';
|
|
19
|
+
export { default as KChatDockItem } from './ChatDock/KChatDockItem.vue';
|
|
20
|
+
export { default as KChatDockPanel } from './ChatDock/KChatDockPanel.vue';
|
|
21
|
+
export { default as KChatDivider } from './Chat/KChatDivider.vue';
|
|
22
|
+
export { default as KMessenger } from './ChatDock/KMessenger.vue';
|
|
15
23
|
export { default as KChatMessage } from './Chat/KChatMessage.vue';
|
|
24
|
+
export { default as KChatMessageActions } from './Chat/KChatMessageActions.vue';
|
|
16
25
|
export { default as KChatMessages } from './Chat/KChatMessages.vue';
|
|
26
|
+
export { default as KChatNotice } from './Chat/KChatNotice.vue';
|
|
17
27
|
export { default as KChatPrompt } from './Chat/KChatPrompt.vue';
|
|
18
28
|
export { default as KChatShimmer } from './Chat/KChatShimmer.vue';
|
|
29
|
+
export { default as KChatWindow } from './ChatDock/KChatWindow.vue';
|
|
19
30
|
export { default as KCheckbox } from './Checkbox/KCheckbox.vue';
|
|
20
31
|
export { default as KCollapse } from './Collapse/KCollapse.vue';
|
|
21
32
|
export { default as KContainer } from './Container/KContainer.vue';
|
|
@@ -40,6 +51,7 @@ export { default as KPopover } from './Popover/KPopover.vue';
|
|
|
40
51
|
export { default as KProgress } from './Progress/KProgress.vue';
|
|
41
52
|
export { default as KRadio } from './Radio/KRadio.vue';
|
|
42
53
|
export { default as KSelect } from './Select/KSelect.vue';
|
|
54
|
+
export { default as KSpinner } from './Spinner/KSpinner.vue';
|
|
43
55
|
export { default as KTab } from './Tabs/KTab.vue';
|
|
44
56
|
export { default as KTable } from './Table/KTable.vue';
|
|
45
57
|
export { default as KTabPanel } from './Tabs/KTabPanel.vue';
|
|
@@ -7,6 +7,9 @@ export * from './Button/types';
|
|
|
7
7
|
export * from './Calendar/types';
|
|
8
8
|
export * from './Card/types';
|
|
9
9
|
export * from './Chat/types';
|
|
10
|
+
export type { ChatDockCallResult, ChatDockContext, ChatDockInstance, } from './ChatDock/keys';
|
|
11
|
+
export * from './ChatDock/types';
|
|
12
|
+
export * from './ChatDock/messenger-types';
|
|
10
13
|
export * from './Checkbox/types';
|
|
11
14
|
export * from './Collapse/types';
|
|
12
15
|
export * from './Container/types';
|
|
@@ -24,6 +27,7 @@ export * from './Popover/types';
|
|
|
24
27
|
export * from './Progress/types';
|
|
25
28
|
export * from './Radio/types';
|
|
26
29
|
export * from './Select/types';
|
|
30
|
+
export * from './Spinner/types';
|
|
27
31
|
export * from './Table/types';
|
|
28
32
|
export * from './Tabs/types';
|
|
29
33
|
export * from './Toast/types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export type DocumentEventOptions = {
|
|
3
|
+
capture?: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* A `document` listener that exists only while `active` is true.
|
|
7
|
+
*
|
|
8
|
+
* Outside-click and Escape cannot be bound to the component's own element —
|
|
9
|
+
* they are about events that happen elsewhere. Core solves this with a
|
|
10
|
+
* permanent delegated listener that runs on every click on the page and then
|
|
11
|
+
* queries the DOM for anything open. Scoping the listener to the open state
|
|
12
|
+
* instead means a closed component costs nothing, and the handler never has to
|
|
13
|
+
* ask whether it should be running.
|
|
14
|
+
*
|
|
15
|
+
* Registered on the next tick after `active` turns true, so the very click or
|
|
16
|
+
* keypress that opened the component cannot immediately close it again by
|
|
17
|
+
* reaching this listener as it bubbles.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useDocumentEvent(active: Ref<boolean>, type: string, handler: (event: any) => void, options?: DocumentEventOptions): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Opening this overlay closes every other mounted member of `group`.
|
|
4
|
+
*
|
|
5
|
+
* Core got this from its delegated toggles, which swept the page — Popover
|
|
6
|
+
* hiding every other `[data-kt-popover].is-active`, Dropdown and Select calling
|
|
7
|
+
* `destroyAll`. Once each component binds its own toggle there is no sweep, so
|
|
8
|
+
* the group replaces it.
|
|
9
|
+
*
|
|
10
|
+
* Dropdowns and selects share one group, as they did in core: `Select` extends
|
|
11
|
+
* `Dropdown`, and opening either closed the other.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useExclusive(group: string, open: Ref<boolean>, close: () => void): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks whether this overlay is the innermost open one of its kind.
|
|
4
|
+
*
|
|
5
|
+
* Core answered the same question with a single delegated Escape handler that
|
|
6
|
+
* closed the first `.is-active` overlay it found. Once each component binds its
|
|
7
|
+
* own Escape, they would all close together, so the stack keeps that to one.
|
|
8
|
+
*
|
|
9
|
+
* Modals and drawers keep separate stacks, matching core's independent
|
|
10
|
+
* handlers: Escape in a drawer opened over a modal closes the drawer only.
|
|
11
|
+
*
|
|
12
|
+
* `priority` breaks the ordering where recency is the wrong answer. Core's
|
|
13
|
+
* drawer handler preferred a drawer with a backdrop over a `noBackdrop` one
|
|
14
|
+
* regardless of which opened last, since the latter is a persistent panel
|
|
15
|
+
* rather than something Escape should dismiss.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useTopmost(name: string, active: Ref<boolean>, priority?: () => number): () => boolean;
|