@knitify/vue 0.0.8 → 1.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 +86 -0
- package/dist/index.es.js +2627 -115
- package/dist/index.umd.js +1 -1
- package/dist/types/components/Accordion/KAccordion.vue.d.ts +11 -0
- package/dist/types/components/Accordion/KAccordionItem.vue.d.ts +22 -0
- package/dist/types/components/Accordion/keys.d.ts +2 -0
- package/dist/types/components/Accordion/types.d.ts +37 -0
- package/dist/types/components/Alert/KAlert.vue.d.ts +11 -0
- package/dist/types/components/Alert/types.d.ts +18 -0
- package/dist/types/components/Avatar/KAvatar.vue.d.ts +11 -0
- package/dist/types/components/Avatar/KAvatarGroup.vue.d.ts +11 -0
- package/dist/types/components/Avatar/types.d.ts +42 -0
- package/dist/types/components/Breadcrumb/KBreadcrumb.vue.d.ts +11 -0
- package/dist/types/components/Breadcrumb/KBreadcrumbItem.vue.d.ts +11 -0
- package/dist/types/components/Breadcrumb/types.d.ts +23 -0
- package/dist/types/components/Button/KButton.vue.d.ts +11 -0
- package/dist/types/components/Button/types.d.ts +28 -0
- package/dist/types/components/Calendar/KCalendar.vue.d.ts +34 -0
- package/dist/types/components/Calendar/types.d.ts +26 -0
- package/dist/types/components/Card/KCard.vue.d.ts +11 -0
- package/dist/types/components/Card/types.d.ts +26 -0
- package/dist/types/components/Chat/KChat.vue.d.ts +14 -0
- package/dist/types/components/Chat/KChatMessage.vue.d.ts +11 -0
- package/dist/types/components/Chat/KChatMessages.vue.d.ts +11 -0
- package/dist/types/components/Chat/KChatPrompt.vue.d.ts +30 -0
- package/dist/types/components/Chat/KChatShimmer.vue.d.ts +11 -0
- package/dist/types/components/Chat/keys.d.ts +2 -0
- package/dist/types/components/Chat/types.d.ts +50 -0
- package/dist/types/components/Checkbox/KCheckbox.vue.d.ts +20 -0
- package/dist/types/components/Checkbox/types.d.ts +23 -0
- package/dist/types/components/Collapse/KCollapse.vue.d.ts +32 -0
- package/dist/types/components/Collapse/types.d.ts +32 -0
- package/dist/types/components/Collapse/useCollapseSync.d.ts +29 -0
- package/dist/types/components/Drawer/KDrawer.vue.d.ts +34 -0
- package/dist/types/components/Drawer/types.d.ts +54 -0
- package/dist/types/components/Dropdown/KDropdown.vue.d.ts +28 -0
- package/dist/types/components/Dropdown/KDropdownItem.vue.d.ts +13 -0
- package/dist/types/components/Dropdown/KDropdownMenu.vue.d.ts +13 -0
- package/dist/types/components/Dropdown/types.d.ts +34 -0
- package/dist/types/components/FileTree/KFileTree.vue.d.ts +34 -0
- package/dist/types/components/FileTree/KFileTreeNode.vue.d.ts +20 -0
- package/dist/types/components/FileTree/types.d.ts +39 -0
- package/dist/types/components/Grid/KGrid.vue.d.ts +11 -0
- package/dist/types/components/Grid/KGridColumn.vue.d.ts +11 -0
- package/dist/types/components/Grid/KGridRow.vue.d.ts +19 -0
- package/dist/types/components/Grid/types.d.ts +41 -0
- package/dist/types/components/Grid/useGrid.d.ts +8 -0
- package/dist/types/components/Icon/types.d.ts +1 -1
- package/dist/types/components/Input/KInput.vue.d.ts +22 -0
- package/dist/types/components/Input/types.d.ts +21 -0
- package/dist/types/components/MenuList/KMenuList.vue.d.ts +11 -0
- package/dist/types/components/MenuList/KMenuListItem.vue.d.ts +11 -0
- package/dist/types/components/MenuList/types.d.ts +20 -0
- package/dist/types/components/Modal/KModal.vue.d.ts +36 -0
- package/dist/types/components/Modal/types.d.ts +57 -0
- package/dist/types/components/NotificationList/KNotificationList.vue.d.ts +11 -0
- package/dist/types/components/NotificationList/KNotificationListItem.vue.d.ts +11 -0
- package/dist/types/components/NotificationList/types.d.ts +36 -0
- package/dist/types/components/Popover/KPopover.vue.d.ts +28 -0
- package/dist/types/components/Popover/types.d.ts +24 -0
- package/dist/types/components/Popover/useOverlaySync.d.ts +35 -0
- package/dist/types/components/Progress/KProgress.vue.d.ts +11 -0
- package/dist/types/components/Progress/types.d.ts +19 -0
- package/dist/types/components/Radio/KRadio.vue.d.ts +20 -0
- package/dist/types/components/Radio/types.d.ts +20 -0
- package/dist/types/components/Select/KSelect.vue.d.ts +22 -0
- package/dist/types/components/Select/types.d.ts +30 -0
- package/dist/types/components/Table/KTable.vue.d.ts +11 -0
- package/dist/types/components/Table/types.d.ts +16 -0
- package/dist/types/components/Tabs/KTab.vue.d.ts +13 -0
- package/dist/types/components/Tabs/KTabPanel.vue.d.ts +13 -0
- package/dist/types/components/Tabs/KTabs.vue.d.ts +25 -0
- package/dist/types/components/Tabs/types.d.ts +35 -0
- package/dist/types/components/Toast/types.d.ts +20 -0
- package/dist/types/components/Toast/useToast.d.ts +20 -0
- package/dist/types/components/Toggle/KToggle.vue.d.ts +20 -0
- package/dist/types/components/Toggle/types.d.ts +8 -0
- package/dist/types/components/Tooltip/KTooltip.vue.d.ts +45 -0
- package/dist/types/components/Tooltip/types.d.ts +18 -0
- package/dist/types/components/Workspace/KWorkspace.vue.d.ts +30 -0
- package/dist/types/components/Workspace/types.d.ts +29 -0
- package/dist/types/components/index.d.ts +46 -0
- package/dist/types/components/types.d.ts +29 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/utils/capitalize.d.ts +1 -0
- package/package.json +13 -5
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type KInputSlots = {
|
|
2
|
+
prefix?(): any;
|
|
3
|
+
suffix?(): any;
|
|
4
|
+
};
|
|
5
|
+
export type KInputProps = {
|
|
6
|
+
addonBordered?: boolean;
|
|
7
|
+
/** Implies `textarea`. Growth is core's `Input.ts`, so it needs `Knitify.init()`. */
|
|
8
|
+
autosize?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
ghost?: boolean;
|
|
11
|
+
maxRows?: number;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
rounded?: boolean;
|
|
15
|
+
/** Fixed-height textareas only — an autosize field is always one row tall to start. */
|
|
16
|
+
rows?: number;
|
|
17
|
+
sunken?: boolean;
|
|
18
|
+
textarea?: boolean;
|
|
19
|
+
transparent?: boolean;
|
|
20
|
+
type?: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KMenuListProps, KMenuListSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KMenuListSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KMenuListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KMenuListProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KMenuListItemProps, KMenuListSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KMenuListSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KMenuListItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KMenuListItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
2
|
+
export type KMenuListProps = {
|
|
3
|
+
/** Names the navigation landmark wrapping the list. Omit for a plain list. */
|
|
4
|
+
ariaLabel?: string;
|
|
5
|
+
};
|
|
6
|
+
export type KMenuListItemProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Marks the current row. With `to` and no explicit value, it follows the
|
|
9
|
+
* router's own active state.
|
|
10
|
+
*/
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/** Native `disabled` on a button; `is-disabled` + `aria-disabled` on a link. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
href?: string;
|
|
15
|
+
/** Router destination. Takes precedence over `href`. */
|
|
16
|
+
to?: RouteLocationRaw;
|
|
17
|
+
};
|
|
18
|
+
export type KMenuListSlots = {
|
|
19
|
+
default?(): any;
|
|
20
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { KModalProps, KModalSlots } from './types';
|
|
2
|
+
type __VLS_Props = KModalProps;
|
|
3
|
+
type __VLS_Slots = KModalSlots;
|
|
4
|
+
declare function show(): void;
|
|
5
|
+
declare function hide(): void;
|
|
6
|
+
declare function toggle(): void;
|
|
7
|
+
type __VLS_ModelProps = {
|
|
8
|
+
'open'?: boolean;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
12
|
+
show: typeof show;
|
|
13
|
+
hide: typeof hide;
|
|
14
|
+
toggle: typeof toggle;
|
|
15
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:open": (value: boolean) => any;
|
|
17
|
+
} & {
|
|
18
|
+
hidden: () => any;
|
|
19
|
+
hide: () => any;
|
|
20
|
+
show: () => any;
|
|
21
|
+
shown: () => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
onHidden?: (() => any) | undefined;
|
|
24
|
+
onHide?: (() => any) | undefined;
|
|
25
|
+
onShow?: (() => any) | undefined;
|
|
26
|
+
onShown?: (() => any) | undefined;
|
|
27
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
28
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ClassValue } from 'vue';
|
|
2
|
+
export type KModalSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type KModalProps = {
|
|
4
|
+
bodyClass?: ClassValue;
|
|
5
|
+
/** Vertically centre the dialog rather than aligning it to the top. */
|
|
6
|
+
centered?: boolean;
|
|
7
|
+
/** Renders the header's dismiss button. */
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
containerClass?: ClassValue;
|
|
10
|
+
dialogClass?: ClassValue;
|
|
11
|
+
dialogLabel?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Focus the first focusable element on open. Core rebuilds its own instance
|
|
14
|
+
* for `data-kt-modal-toggle` clicks and does not read this off the DOM, so it
|
|
15
|
+
* only applies when Vue opens the modal.
|
|
16
|
+
*/
|
|
17
|
+
focus?: boolean;
|
|
18
|
+
footerClass?: ClassValue;
|
|
19
|
+
fullscreen?: boolean;
|
|
20
|
+
headerClass?: ClassValue;
|
|
21
|
+
/** Defaults to a generated id. Point `data-kt-modal-toggle` at this. */
|
|
22
|
+
id?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Close on Escape. Honoured on both paths — the wrapper intercepts the key in
|
|
25
|
+
* the capture phase to hold core's own handler off.
|
|
26
|
+
*
|
|
27
|
+
* With two modals open at once, core closes the first `is-active` element in
|
|
28
|
+
* document order rather than the topmost, so Escape can reach the wrong one.
|
|
29
|
+
*/
|
|
30
|
+
keyboard?: boolean;
|
|
31
|
+
mainClass?: ClassValue;
|
|
32
|
+
scrollable?: boolean;
|
|
33
|
+
sidebarClass?: ClassValue;
|
|
34
|
+
size?: KModalSize;
|
|
35
|
+
/** Ignore backdrop clicks, leaving an explicit dismiss the only way out. */
|
|
36
|
+
staticBackdrop?: boolean;
|
|
37
|
+
title?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Render into `document.body`. On by default: the modal is `position: fixed`,
|
|
40
|
+
* which a transformed or filtered ancestor would otherwise contain.
|
|
41
|
+
*/
|
|
42
|
+
teleport?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type KModalEmits = {
|
|
45
|
+
(event: 'hide'): void;
|
|
46
|
+
(event: 'hidden'): void;
|
|
47
|
+
(event: 'show'): void;
|
|
48
|
+
(event: 'shown'): void;
|
|
49
|
+
};
|
|
50
|
+
export type KModalSlots = {
|
|
51
|
+
close?(): any;
|
|
52
|
+
default?(): any;
|
|
53
|
+
footer?(): any;
|
|
54
|
+
header?(): any;
|
|
55
|
+
sidebar?(): any;
|
|
56
|
+
title?(): any;
|
|
57
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KNotificationListProps, KNotificationListSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KNotificationListSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KNotificationListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KNotificationListProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KNotificationListItemProps, KNotificationListItemSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KNotificationListItemSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KNotificationListItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KNotificationListItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type KNotificationListProps = {
|
|
2
|
+
/** Names the list for a screen reader. */
|
|
3
|
+
ariaLabel?: string;
|
|
4
|
+
};
|
|
5
|
+
export type KNotificationListItemProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Forces the actions slot open. Core hides it until the row is hovered or
|
|
8
|
+
* focused within.
|
|
9
|
+
*/
|
|
10
|
+
hovered?: boolean;
|
|
11
|
+
/** Relative timestamp. The `time` slot overrides it. */
|
|
12
|
+
time?: string;
|
|
13
|
+
/** Unread. Maps to core's `is-active`. */
|
|
14
|
+
unread?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Visually hidden prefix announcing the unread state. Core's `is-active`
|
|
17
|
+
* changes only a fill and a bar, which conveys nothing to a screen reader
|
|
18
|
+
* or to anyone who cannot separate the brand tint from the base surface
|
|
19
|
+
* (WCAG 1.4.1). Core ships no visually-hidden utility, so this supplies one.
|
|
20
|
+
*/
|
|
21
|
+
unreadLabel?: string;
|
|
22
|
+
};
|
|
23
|
+
export type KNotificationListSlots = {
|
|
24
|
+
default?(): any;
|
|
25
|
+
};
|
|
26
|
+
export type KNotificationListItemSlots = {
|
|
27
|
+
/**
|
|
28
|
+
* The overflow trigger. Core keeps this `display: none` until hover, which
|
|
29
|
+
* puts it outside the tab order — on a row with no inline link there is no
|
|
30
|
+
* keyboard path to it. Use `hovered` to keep it visible where that matters.
|
|
31
|
+
*/
|
|
32
|
+
actions?(): any;
|
|
33
|
+
default?(): any;
|
|
34
|
+
media?(): any;
|
|
35
|
+
time?(): any;
|
|
36
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { KPopoverProps, KPopoverSlots } from './types';
|
|
2
|
+
type __VLS_Props = KPopoverProps;
|
|
3
|
+
type __VLS_Slots = KPopoverSlots;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
'open'?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
9
|
+
toggle: () => void;
|
|
10
|
+
show: () => boolean;
|
|
11
|
+
hide: () => boolean;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
hidden: () => any;
|
|
14
|
+
shown: () => any;
|
|
15
|
+
"update:open": (value: boolean) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
onHidden?: (() => any) | undefined;
|
|
18
|
+
onShown?: (() => any) | undefined;
|
|
19
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ClassValue } from 'vue';
|
|
2
|
+
export type KPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
3
|
+
export type KPopoverProps = {
|
|
4
|
+
contentClass?: ClassValue;
|
|
5
|
+
placement?: KPlacement;
|
|
6
|
+
toggleClass?: ClassValue;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Core dispatches only the completion pair, so these fire once the overlay has
|
|
10
|
+
* finished opening or closing rather than when it begins.
|
|
11
|
+
*/
|
|
12
|
+
export type KPopoverEmits = {
|
|
13
|
+
hidden: [];
|
|
14
|
+
shown: [];
|
|
15
|
+
};
|
|
16
|
+
export type KPopoverSlots = {
|
|
17
|
+
/** The floating panel. */
|
|
18
|
+
default?(): any;
|
|
19
|
+
/** The element the panel is anchored to. */
|
|
20
|
+
toggle?(props: {
|
|
21
|
+
open: boolean;
|
|
22
|
+
toggle: () => void;
|
|
23
|
+
}): any;
|
|
24
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Ref, type ShallowRef } from 'vue';
|
|
2
|
+
export type OverlayModule = {
|
|
3
|
+
hide(): void;
|
|
4
|
+
show(): void;
|
|
5
|
+
};
|
|
6
|
+
export type OverlaySyncOptions<T extends OverlayModule> = {
|
|
7
|
+
/** Builds the core module against the root element. */
|
|
8
|
+
create: (element: HTMLElement) => T;
|
|
9
|
+
/** The `[data-kt-*]` root. */
|
|
10
|
+
element: Readonly<ShallowRef<HTMLElement | null>>;
|
|
11
|
+
onEvent?: (name: 'shown' | 'hidden') => void;
|
|
12
|
+
open: Ref<boolean>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Two-way binding between a `v-model` and core's Popover, Dropdown or Tooltip.
|
|
16
|
+
*
|
|
17
|
+
* Two things differ from the Modal flavour of this pattern:
|
|
18
|
+
*
|
|
19
|
+
* 1. These modules dispatch bare `kt.shown` / `kt.hidden` rather than a
|
|
20
|
+
* namespaced `kt.modal.*`, and the events bubble. A tooltip inside a
|
|
21
|
+
* dropdown would therefore reach the dropdown's listener, so every event is
|
|
22
|
+
* checked against the element it was dispatched on.
|
|
23
|
+
* 2. There is no `show` / `hide` intent event — only the completion pair — so
|
|
24
|
+
* the model updates when the overlay has opened or closed rather than when
|
|
25
|
+
* it starts to.
|
|
26
|
+
*
|
|
27
|
+
* The guard is `moduleOpen`, which tracks the direction the module is heading,
|
|
28
|
+
* because Vue 3.5 batches reactive effects: a flag set around the model write
|
|
29
|
+
* would already be cleared by the time even a `sync` watcher ran.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useOverlaySync<T extends OverlayModule>({ create, element, onEvent, open, }: OverlaySyncOptions<T>): {
|
|
32
|
+
hide: () => void;
|
|
33
|
+
show: () => void;
|
|
34
|
+
toggle: () => void;
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KProgressProps, KProgressSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KProgressSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KProgressProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KProgressProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type KProgressShape = 'linear' | 'circular' | 'semiCircular';
|
|
2
|
+
/** `md` is core's default and emits no modifier class. */
|
|
3
|
+
export type KProgressSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type KProgressProps = {
|
|
5
|
+
/** Overrides the default `{percent}%` readout. The `label` slot wins over both. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Upper bound for `value`. Core's fill runs on a 0–100 scale regardless. */
|
|
8
|
+
max?: number;
|
|
9
|
+
/** Fully rounds the track and fill. Linear only. */
|
|
10
|
+
rounded?: boolean;
|
|
11
|
+
shape?: KProgressShape;
|
|
12
|
+
/** Linear only — the circular shapes take their size from the container. */
|
|
13
|
+
size?: KProgressSize;
|
|
14
|
+
/** Clamped to 0…`max`. */
|
|
15
|
+
value?: number;
|
|
16
|
+
};
|
|
17
|
+
export type KProgressSlots = {
|
|
18
|
+
label?(): any;
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { KRadioProps, KRadioSlots } from './types';
|
|
2
|
+
type __VLS_Props = KRadioProps;
|
|
3
|
+
type __VLS_Slots = KRadioSlots;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: unknown;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:modelValue": (value: unknown) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core ships no `--error` modifier — the one in its docs helper was removed —
|
|
3
|
+
* so there is deliberately no `error` prop here.
|
|
4
|
+
*/
|
|
5
|
+
export type KRadioProps = {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Text beside the dot. The default slot overrides it. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Groups radios for keyboard navigation. Selection is driven by the shared
|
|
11
|
+
* `v-model`, so this is only needed when the group must also work natively —
|
|
12
|
+
* inside an uncontrolled form, say.
|
|
13
|
+
*/
|
|
14
|
+
name?: string;
|
|
15
|
+
/** What the shared model is set to when this radio is picked. */
|
|
16
|
+
value?: unknown;
|
|
17
|
+
};
|
|
18
|
+
export type KRadioSlots = {
|
|
19
|
+
default?(): any;
|
|
20
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { KSelectProps, KSelectSlots } from './types';
|
|
2
|
+
type __VLS_Props = KSelectProps;
|
|
3
|
+
type __VLS_Slots = KSelectSlots;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: string;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
change: (value: string) => any;
|
|
10
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
+
onChange?: ((value: string) => any) | undefined;
|
|
13
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ClassValue } from 'vue';
|
|
2
|
+
export type KSelectOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export type KSelectProps = {
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Sprite href for the caret. */
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** Renders the control inline rather than filling its container. */
|
|
11
|
+
inline?: boolean;
|
|
12
|
+
menuClass?: ClassValue;
|
|
13
|
+
/**
|
|
14
|
+
* A bare string is used as both value and label.
|
|
15
|
+
*
|
|
16
|
+
* Values are read back off a DOM attribute, so the model is always a string —
|
|
17
|
+
* numbers and objects are not preserved.
|
|
18
|
+
*/
|
|
19
|
+
options?: (KSelectOption | string)[];
|
|
20
|
+
/** Shown until something is chosen. */
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
toggleClass?: ClassValue;
|
|
23
|
+
};
|
|
24
|
+
export type KSelectEmits = {
|
|
25
|
+
change: [value: string];
|
|
26
|
+
};
|
|
27
|
+
export type KSelectSlots = {
|
|
28
|
+
/** Replaces the generated items. Give each one `data-kt-select-item`. */
|
|
29
|
+
default?(): any;
|
|
30
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KTableProps, KTableSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KTableSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KTableProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KTableProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
+
new (): {
|
|
9
|
+
$slots: S;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** `md` is core's default and emits no modifier class. */
|
|
2
|
+
export type KTableSize = 'md' | 'lg' | 'xl';
|
|
3
|
+
/**
|
|
4
|
+
* A styling wrapper over a real `<table>`, deliberately not a data grid. Core's
|
|
5
|
+
* Table is pure CSS, so the markup — and with it sorting, selection, and
|
|
6
|
+
* colspans — stays yours.
|
|
7
|
+
*/
|
|
8
|
+
export type KTableProps = {
|
|
9
|
+
borderless?: boolean;
|
|
10
|
+
hoverable?: boolean;
|
|
11
|
+
size?: KTableSize;
|
|
12
|
+
striped?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type KTableSlots = {
|
|
15
|
+
default?(): any;
|
|
16
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { KTabProps } from './types';
|
|
2
|
+
type __VLS_Slots = {
|
|
3
|
+
default?(): any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<KTabProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KTabProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { KTabPanelProps } from './types';
|
|
2
|
+
type __VLS_Slots = {
|
|
3
|
+
default?(): any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<KTabPanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KTabPanelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { KTabsProps, KTabsSlots } from './types';
|
|
2
|
+
type __VLS_Props = KTabsProps;
|
|
3
|
+
type __VLS_Slots = KTabsSlots;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: string;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
9
|
+
show: (name: string) => string;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
12
|
+
} & {
|
|
13
|
+
shown: (name: string) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
16
|
+
onShown?: ((name: string) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
export type KTabsVariant = 'pills' | 'underline';
|
|
3
|
+
export type KTabsProps = {
|
|
4
|
+
/** Names the tablist. */
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
variant?: KTabsVariant;
|
|
7
|
+
};
|
|
8
|
+
export type KTabProps = {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Matches this tab to its panel, and is what `v-model` holds. */
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
export type KTabPanelProps = {
|
|
14
|
+
/** Matches this panel to its tab. */
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
export type KTabsEmits = {
|
|
18
|
+
(event: 'shown', name: string): void;
|
|
19
|
+
};
|
|
20
|
+
export type KTabsSlots = {
|
|
21
|
+
/** The panels. */
|
|
22
|
+
default?(): any;
|
|
23
|
+
/** The tab buttons, rendered into the tablist. */
|
|
24
|
+
tabs?(): any;
|
|
25
|
+
};
|
|
26
|
+
export type KTabsContext = {
|
|
27
|
+
active: ComputedRef<string | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* Core resolves a panel with `querySelector('#' + target)` without escaping,
|
|
30
|
+
* so the id is restricted to characters that are safe unquoted. Two names
|
|
31
|
+
* differing only in punctuation therefore collapse to the same id.
|
|
32
|
+
*/
|
|
33
|
+
panelId: (name: string) => string;
|
|
34
|
+
};
|
|
35
|
+
export declare const tabsKey: InjectionKey<KTabsContext>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type KToastPosition = 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
2
|
+
export type KToastOptions = {
|
|
3
|
+
description?: string;
|
|
4
|
+
/** Milliseconds before it closes itself. */
|
|
5
|
+
duration?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Leading glyph, as a raw **HTML string** — core assigns it with `innerHTML`,
|
|
8
|
+
* not as a sprite href. Never pass user-supplied content here.
|
|
9
|
+
*/
|
|
10
|
+
icon?: string;
|
|
11
|
+
position?: KToastPosition;
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
/** Defaults applied to every toast raised through the returned helper. */
|
|
15
|
+
export type KToastDefaults = Omit<KToastOptions, 'title'>;
|
|
16
|
+
export type KToastHandle = {
|
|
17
|
+
close(): void;
|
|
18
|
+
pause(): void;
|
|
19
|
+
resume(): void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { KToastDefaults, KToastHandle, KToastOptions, KToastPosition } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Toasts have no component because core's Toast has no markup to wrap:
|
|
4
|
+
* `new Toast({ title })` builds its own element, mounts it into a container it
|
|
5
|
+
* manages, and runs its own stacking and timers. A `<KToast>` would mean
|
|
6
|
+
* reimplementing that in Vue and letting the two drift apart.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const toast = useToast({ position: 'bottom-right' })
|
|
10
|
+
* toast.show({ title: 'Saved', description: 'Your changes are live.' })
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Nothing here is reactive or tied to a component instance, so it can be called
|
|
14
|
+
* from a setup function, an event handler, or a plain module.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useToast(defaults?: KToastDefaults): {
|
|
17
|
+
/** Dismisses every toast, or only those in one corner. */
|
|
18
|
+
closeAll(position?: KToastPosition): void;
|
|
19
|
+
show(options: KToastOptions): KToastHandle;
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { KToggleProps, KToggleSlots } from './types';
|
|
2
|
+
type __VLS_Props = KToggleProps;
|
|
3
|
+
type __VLS_Slots = KToggleSlots;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:modelValue": (value: boolean) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|