@knitify/vue 1.0.0 → 2.1.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 +113 -86
- package/dist/index.es.js +5773 -1451
- package/dist/index.umd.js +1 -1
- package/dist/types/components/Alert/KAlert.vue.d.ts +22 -2
- package/dist/types/components/Alert/types.d.ts +11 -1
- package/dist/types/components/ArticleList/KArticleList.vue.d.ts +11 -0
- package/dist/types/components/ArticleList/KArticleListItem.vue.d.ts +15 -0
- package/dist/types/components/ArticleList/types.d.ts +40 -0
- package/dist/types/components/Avatar/KAvatar.vue.d.ts +5 -1
- package/dist/types/components/Avatar/types.d.ts +92 -4
- package/dist/types/components/Badge/types.d.ts +2 -0
- package/dist/types/components/Calendar/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/keys.d.ts +1 -0
- package/dist/types/components/Chat/types.d.ts +109 -4
- package/dist/types/components/ChatDock/KChatDock.vue.d.ts +47 -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/KChatNewWindow.vue.d.ts +28 -0
- package/dist/types/components/ChatDock/KChatWindow.vue.d.ts +27 -0
- package/dist/types/components/ChatDock/KMessenger.vue.d.ts +29 -0
- package/dist/types/components/ChatDock/keys.d.ts +98 -0
- package/dist/types/components/ChatDock/messenger-types.d.ts +335 -0
- package/dist/types/components/ChatDock/store-keys.d.ts +7 -0
- package/dist/types/components/ChatDock/types.d.ts +162 -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/DateInput/KDateInput.vue.d.ts +26 -0
- package/dist/types/components/DateInput/KDateRangeInput.vue.d.ts +31 -0
- package/dist/types/components/DateInput/types.d.ts +69 -0
- package/dist/types/components/DateInput/useDateInput.d.ts +27 -0
- package/dist/types/components/Divider/KDivider.vue.d.ts +11 -0
- package/dist/types/components/Divider/types.d.ts +19 -0
- 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/Field/FieldIsolate.d.ts +4 -0
- package/dist/types/components/Field/KField.vue.d.ts +11 -0
- package/dist/types/components/Field/keys.d.ts +21 -0
- package/dist/types/components/Field/types.d.ts +35 -0
- package/dist/types/components/Flex/KFlex.vue.d.ts +11 -0
- package/dist/types/components/Flex/types.d.ts +26 -0
- package/dist/types/components/Input/KInput.vue.d.ts +2 -0
- package/dist/types/components/Input/types.d.ts +11 -1
- package/dist/types/components/Modal/KModal.vue.d.ts +3 -3
- package/dist/types/components/Modal/types.d.ts +5 -1
- package/dist/types/components/Pagination/KPagination.vue.d.ts +13 -0
- package/dist/types/components/Pagination/range.d.ts +6 -0
- package/dist/types/components/Pagination/types.d.ts +20 -0
- 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/RadioCard/KRadioCard.vue.d.ts +20 -0
- package/dist/types/components/RadioCard/KRadioCardGroup.vue.d.ts +11 -0
- package/dist/types/components/RadioCard/types.d.ts +25 -0
- package/dist/types/components/SearchInput/KSearchInput.vue.d.ts +22 -0
- package/dist/types/components/SearchInput/types.d.ts +7 -0
- package/dist/types/components/SegmentedButtons/KSegmentedButton.vue.d.ts +20 -0
- package/dist/types/components/SegmentedButtons/KSegmentedButtons.vue.d.ts +11 -0
- package/dist/types/components/SegmentedButtons/types.d.ts +25 -0
- package/dist/types/components/Select/KSelect.vue.d.ts +2 -0
- package/dist/types/components/Select/types.d.ts +8 -0
- package/dist/types/components/Skeleton/KSkeleton.vue.d.ts +4 -0
- package/dist/types/components/Skeleton/types.d.ts +19 -0
- 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/Table/KTable.vue.d.ts +8 -1
- package/dist/types/components/Table/KTableResizer.vue.d.ts +4 -0
- package/dist/types/components/Table/types.d.ts +27 -2
- package/dist/types/components/Tabs/types.d.ts +25 -3
- package/dist/types/components/TagsInput/KTagsInput.vue.d.ts +32 -0
- package/dist/types/components/TagsInput/types.d.ts +68 -0
- package/dist/types/components/TagsInput/useTagsInput.d.ts +27 -0
- package/dist/types/components/Time/KTime.vue.d.ts +18 -0
- package/dist/types/components/Time/types.d.ts +23 -0
- package/dist/types/components/TimeInput/KTimeInput.vue.d.ts +26 -0
- package/dist/types/components/TimeInput/types.d.ts +27 -0
- package/dist/types/components/TimeInput/useTimeInput.d.ts +22 -0
- package/dist/types/components/Toggle/types.d.ts +2 -0
- package/dist/types/components/Tooltip/triggerHandlers.d.ts +33 -0
- package/dist/types/components/Tooltip/types.d.ts +5 -0
- package/dist/types/components/Tooltip/vTooltip.d.ts +10 -0
- package/dist/types/components/Workspace/KWorkspace.vue.d.ts +13 -1
- package/dist/types/components/Workspace/types.d.ts +10 -0
- package/dist/types/components/index.d.ts +34 -0
- package/dist/types/components/types.d.ts +19 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/useCoreModule.d.ts +30 -0
- package/dist/types/utils/useDocumentEvent.d.ts +19 -0
- package/dist/types/utils/useExclusive.d.ts +13 -0
- package/dist/types/utils/useFieldControl.d.ts +25 -0
- package/dist/types/utils/useRootClasses.d.ts +15 -0
- package/dist/types/utils/useTopmost.d.ts +17 -0
- package/dist/web-types.json +7986 -0
- package/package.json +17 -5
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type KSegmentedButtonsProps = {
|
|
2
|
+
/** Stretches across the container, splitting the width equally. */
|
|
3
|
+
block?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type KSegmentedButtonsSlots = {
|
|
6
|
+
default?(): any;
|
|
7
|
+
};
|
|
8
|
+
export type KSegmentedButtonProps = {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Sprite id of the icon before the label, e.g. `kt-preview`. */
|
|
11
|
+
icon?: string;
|
|
12
|
+
/** Segment text. The default slot overrides it. */
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Groups segments for keyboard navigation. Selection is driven by the shared
|
|
16
|
+
* `v-model`, so this is only needed when the group must also work natively —
|
|
17
|
+
* inside an uncontrolled form, say.
|
|
18
|
+
*/
|
|
19
|
+
name?: string;
|
|
20
|
+
/** What the shared model is set to when this segment is picked. */
|
|
21
|
+
value?: unknown;
|
|
22
|
+
};
|
|
23
|
+
export type KSegmentedButtonSlots = {
|
|
24
|
+
default?(): any;
|
|
25
|
+
};
|
|
@@ -7,9 +7,11 @@ type __VLS_ModelProps = {
|
|
|
7
7
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
change: (value: string) => any;
|
|
10
|
+
clear: () => any;
|
|
10
11
|
"update:modelValue": (value: string | undefined) => any;
|
|
11
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
13
|
onChange?: ((value: string) => any) | undefined;
|
|
14
|
+
onClear?: (() => any) | undefined;
|
|
13
15
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
14
16
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
17
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -4,11 +4,17 @@ export type KSelectOption = {
|
|
|
4
4
|
value: string;
|
|
5
5
|
};
|
|
6
6
|
export type KSelectProps = {
|
|
7
|
+
/** Shows a × that clears the selection while there is one. */
|
|
8
|
+
clearable?: boolean;
|
|
9
|
+
/** The × button's accessible name. Default `'Clear'`. */
|
|
10
|
+
clearLabel?: string;
|
|
7
11
|
disabled?: boolean;
|
|
8
12
|
/** Sprite href for the caret. */
|
|
9
13
|
icon?: string;
|
|
10
14
|
/** Renders the control inline rather than filling its container. */
|
|
11
15
|
inline?: boolean;
|
|
16
|
+
/** Shows a spinner in place of the caret; the menu does not open while loading. */
|
|
17
|
+
loading?: boolean;
|
|
12
18
|
menuClass?: ClassValue;
|
|
13
19
|
/**
|
|
14
20
|
* A bare string is used as both value and label.
|
|
@@ -23,6 +29,8 @@ export type KSelectProps = {
|
|
|
23
29
|
};
|
|
24
30
|
export type KSelectEmits = {
|
|
25
31
|
change: [value: string];
|
|
32
|
+
/** The × cleared the selection; the model is now `undefined`. */
|
|
33
|
+
clear: [];
|
|
26
34
|
};
|
|
27
35
|
export type KSelectSlots = {
|
|
28
36
|
/** Replaces the generated items. Give each one `data-kt-select-item`. */
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { KSkeletonProps } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<KSkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KSkeletonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type KSkeletonShape = 'rect' | 'text' | 'circle' | 'rounded';
|
|
2
|
+
export type KSkeletonAnimation = 'shimmer' | 'pulse' | 'none';
|
|
3
|
+
/** A CSS length, or a number of pixels. */
|
|
4
|
+
export type KSkeletonSize = string | number;
|
|
5
|
+
export type KSkeletonProps = {
|
|
6
|
+
/** Defaults to `rect`. */
|
|
7
|
+
shape?: KSkeletonShape;
|
|
8
|
+
/**
|
|
9
|
+
* Defaults to the full width, or the base avatar size for a `circle`. With
|
|
10
|
+
* `lines`, the width of the whole group.
|
|
11
|
+
*/
|
|
12
|
+
width?: KSkeletonSize;
|
|
13
|
+
/** For a `circle`, the diameter when `width` is not given. */
|
|
14
|
+
height?: KSkeletonSize;
|
|
15
|
+
/** Number of `text` lines; the last is shortened. Defaults to 1. */
|
|
16
|
+
lines?: number;
|
|
17
|
+
/** Defaults to `shimmer`. Always off under reduced motion. */
|
|
18
|
+
animation?: KSkeletonAnimation;
|
|
19
|
+
};
|
|
@@ -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,6 +1,13 @@
|
|
|
1
1
|
import type { KTableProps, KTableSlots } from './types';
|
|
2
2
|
type __VLS_Slots = KTableSlots;
|
|
3
|
-
declare const __VLS_base: import("vue").DefineComponent<KTableProps, {
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KTableProps, {
|
|
4
|
+
/** Hands every column back to automatic layout. */
|
|
5
|
+
reset: () => void;
|
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
7
|
+
resize: (widths: number[]) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<KTableProps> & Readonly<{
|
|
9
|
+
onResize?: ((widths: number[]) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
11
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
12
|
declare const _default: typeof __VLS_export;
|
|
6
13
|
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { KTableResizerProps } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<KTableResizerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KTableResizerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -6,11 +6,36 @@ export type KTableSize = 'md' | 'lg' | 'xl';
|
|
|
6
6
|
* colspans — stays yours.
|
|
7
7
|
*/
|
|
8
8
|
export type KTableProps = {
|
|
9
|
-
borderless?: boolean;
|
|
10
9
|
hoverable?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* How many leading columns stay put while the table scrolls sideways, up to
|
|
12
|
+
* 4. Wrap the table in an `overflow-x: auto` container.
|
|
13
|
+
*/
|
|
14
|
+
pinStart?: number;
|
|
15
|
+
/** How many trailing columns stay put, up to 4 — e.g. an actions column. */
|
|
16
|
+
pinEnd?: number;
|
|
11
17
|
size?: KTableSize;
|
|
12
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Pins the header to the top of the nearest scrolling ancestor — a
|
|
20
|
+
* height-capped `overflow: auto` wrapper, or the page. Offset it with the
|
|
21
|
+
* `--kt-table-sticky-top` CSS variable, e.g. below a fixed navbar.
|
|
22
|
+
*/
|
|
23
|
+
stickyHeader?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type KTableEmits = {
|
|
26
|
+
/**
|
|
27
|
+
* A column was resized — dragged, stepped with the arrow keys, or reset by
|
|
28
|
+
* a double-click. Carries every column's width in px, header order.
|
|
29
|
+
*/
|
|
30
|
+
(event: 'resize', widths: number[]): void;
|
|
31
|
+
};
|
|
32
|
+
export type KTableResizerProps = {
|
|
33
|
+
/** Names the handle for assistive tech, e.g. "Resize Title". */
|
|
34
|
+
label?: string;
|
|
13
35
|
};
|
|
14
36
|
export type KTableSlots = {
|
|
37
|
+
/** The table's rows — `<thead>`, `<tbody>` and so on. */
|
|
15
38
|
default?(): any;
|
|
39
|
+
/** Rendered inside a `<tfoot>` — pass `<tr>`s, e.g. a totals row. */
|
|
40
|
+
footer?(): any;
|
|
16
41
|
};
|
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
import type { ComputedRef, InjectionKey } from 'vue';
|
|
1
|
+
import type { ClassValue, ComputedRef, InjectionKey } from 'vue';
|
|
2
2
|
export type KTabsVariant = 'pills' | 'underline';
|
|
3
3
|
export type KTabsProps = {
|
|
4
4
|
/** Names the tablist. */
|
|
5
5
|
ariaLabel?: string;
|
|
6
|
+
/** Classes for the panels' wrapper. */
|
|
7
|
+
contentClass?: ClassValue;
|
|
8
|
+
/**
|
|
9
|
+
* Disables every tab. The active panel stays visible, and `v-model` can
|
|
10
|
+
* still switch it.
|
|
11
|
+
*/
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Classes for the tablist, where the variant class also goes. */
|
|
14
|
+
listClass?: ClassValue;
|
|
15
|
+
/**
|
|
16
|
+
* Renders the tablist alone, without the panels' wrapper — for tabs that
|
|
17
|
+
* drive content elsewhere through `v-model`. The default slot is ignored.
|
|
18
|
+
*/
|
|
19
|
+
noContent?: boolean;
|
|
6
20
|
variant?: KTabsVariant;
|
|
7
21
|
};
|
|
8
22
|
export type KTabProps = {
|
|
23
|
+
/**
|
|
24
|
+
* Takes the tab out of roving focus and out of `v-model`'s reach — setting
|
|
25
|
+
* the model to its name is a no-op.
|
|
26
|
+
*/
|
|
9
27
|
disabled?: boolean;
|
|
10
28
|
/** Matches this tab to its panel, and is what `v-model` holds. */
|
|
11
29
|
name: string;
|
|
@@ -25,11 +43,15 @@ export type KTabsSlots = {
|
|
|
25
43
|
};
|
|
26
44
|
export type KTabsContext = {
|
|
27
45
|
active: ComputedRef<string | undefined>;
|
|
46
|
+
disabled: ComputedRef<boolean>;
|
|
47
|
+
/** False under `noContent`, where there is no panel for a tab to control. */
|
|
48
|
+
hasPanels: ComputedRef<boolean>;
|
|
28
49
|
/**
|
|
29
50
|
* Core resolves a panel with `querySelector('#' + target)` without escaping,
|
|
30
|
-
* so the id is restricted to characters that are safe unquoted.
|
|
31
|
-
* differing only in punctuation therefore collapse to the same id.
|
|
51
|
+
* so the id is restricted to characters that are safe unquoted.
|
|
32
52
|
*/
|
|
33
53
|
panelId: (name: string) => string;
|
|
54
|
+
/** The tab's id, which its panel is labelled by. */
|
|
55
|
+
tabId: (name: string) => string;
|
|
34
56
|
};
|
|
35
57
|
export declare const tabsKey: InjectionKey<KTabsContext>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { KTagsInputProps, KTagsInputSlots } from './types';
|
|
2
|
+
type __VLS_Props = KTagsInputProps;
|
|
3
|
+
type __VLS_Slots = KTagsInputSlots;
|
|
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
|
+
add: (value: string) => boolean;
|
|
10
|
+
clear: () => never[];
|
|
11
|
+
focus: () => void | undefined;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
invalid: (value: string, reason: string) => any;
|
|
14
|
+
remove: (value: string, index: number) => any;
|
|
15
|
+
"update:modelValue": (value: string[]) => any;
|
|
16
|
+
add: (value: string) => any;
|
|
17
|
+
loadError: (error: unknown, query: string) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
onInvalid?: ((value: string, reason: string) => any) | undefined;
|
|
20
|
+
onRemove?: ((value: string, index: number) => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
22
|
+
onAdd?: ((value: string) => any) | undefined;
|
|
23
|
+
onLoadError?: ((error: unknown, query: string) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type KTagsInputValidator = (tag: string, tags: string[]) => true | string;
|
|
2
|
+
export type KTagsInputOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
data?: unknown;
|
|
6
|
+
};
|
|
7
|
+
export type KTagsInputLoader = (query: string, context: {
|
|
8
|
+
signal: AbortSignal;
|
|
9
|
+
}) => Promise<(KTagsInputOption | string)[]>;
|
|
10
|
+
export type KTagsInputProps = {
|
|
11
|
+
/** Dedupe treats "Design" and "design" as different tags. */
|
|
12
|
+
caseSensitive?: boolean;
|
|
13
|
+
/** Characters that commit a tag. Enter always commits. Default `',;'`. */
|
|
14
|
+
delimiters?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
ghost?: boolean;
|
|
17
|
+
max?: number;
|
|
18
|
+
/** Renders a hidden input holding the tags joined with commas. */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** Shows a spinner and marks the field busy; combined with a pending `load`. */
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
/** Loads suggestions for the typed text (debounced; stale requests aborted). */
|
|
23
|
+
load?: KTagsInputLoader;
|
|
24
|
+
/** Debounce before `load` runs, in ms. Default `250`. */
|
|
25
|
+
loadDelay?: number;
|
|
26
|
+
/** Shows the whole suggestion list on focus, before anything is typed. */
|
|
27
|
+
openOnFocus?: boolean;
|
|
28
|
+
/** Suggestions shown while typing. A bare string is both label and value. */
|
|
29
|
+
options?: (KTagsInputOption | string)[];
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/** Shows the tags but hides the text field and the remove buttons. */
|
|
32
|
+
readonly?: boolean;
|
|
33
|
+
/** Only listed options can become tags; others are rejected as `'not-in-list'`. */
|
|
34
|
+
restrict?: boolean;
|
|
35
|
+
rounded?: boolean;
|
|
36
|
+
sunken?: boolean;
|
|
37
|
+
transparent?: boolean;
|
|
38
|
+
/** Return `true` to accept, or a reason string to reject. */
|
|
39
|
+
validate?: KTagsInputValidator;
|
|
40
|
+
};
|
|
41
|
+
export type KTagsInputEmits = {
|
|
42
|
+
add: [value: string];
|
|
43
|
+
remove: [value: string, index: number];
|
|
44
|
+
/** `reason` is `'duplicate'`, `'max'`, `'not-in-list'`, or the string `validate` returned. */
|
|
45
|
+
invalid: [value: string, reason: string];
|
|
46
|
+
loadError: [error: unknown, query: string];
|
|
47
|
+
};
|
|
48
|
+
export type KTagsInputSlots = {
|
|
49
|
+
/** Replaces the tag's label. The remove button is still rendered after it. */
|
|
50
|
+
tag?(props: {
|
|
51
|
+
value: string;
|
|
52
|
+
label: string;
|
|
53
|
+
index: number;
|
|
54
|
+
remove: () => void;
|
|
55
|
+
}): any;
|
|
56
|
+
/**
|
|
57
|
+
* Replaces a suggestion row's content (default: the label). Focus stays in
|
|
58
|
+
* the text field and rows are picked with Enter or a click, so put nothing
|
|
59
|
+
* focusable or interactive inside.
|
|
60
|
+
*/
|
|
61
|
+
option?(props: {
|
|
62
|
+
option: KTagsInputOption;
|
|
63
|
+
active: boolean;
|
|
64
|
+
index: number;
|
|
65
|
+
}): any;
|
|
66
|
+
prefix?(): any;
|
|
67
|
+
suffix?(): any;
|
|
68
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ShallowRef } from 'vue';
|
|
2
|
+
import Knitify from '@knitify/core';
|
|
3
|
+
type TagsInputModuleConfig = NonNullable<ConstructorParameters<typeof Knitify.modules.TagsInput>[1]>;
|
|
4
|
+
type TagsInputControls = {
|
|
5
|
+
add(value: string): boolean;
|
|
6
|
+
focus(): void;
|
|
7
|
+
getValues(): string[];
|
|
8
|
+
remove(value: string): boolean;
|
|
9
|
+
setLoading(loading: boolean): void;
|
|
10
|
+
setOptions(options: (string | {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
})[]): void;
|
|
14
|
+
setValues(values: string[]): void;
|
|
15
|
+
};
|
|
16
|
+
type Options = {
|
|
17
|
+
root: Readonly<ShallowRef<HTMLElement | null>>;
|
|
18
|
+
/** Read inside a watcher, so every prop it touches triggers a rebuild. */
|
|
19
|
+
config: () => TagsInputModuleConfig;
|
|
20
|
+
/** Pushes the current model into a freshly built module. */
|
|
21
|
+
apply: (instance: TagsInputControls) => void;
|
|
22
|
+
listeners: Record<string, (event: CustomEvent) => void>;
|
|
23
|
+
};
|
|
24
|
+
export declare function useTagsInput({ root, config, apply, listeners }: Options): {
|
|
25
|
+
getInstance: () => TagsInputControls | undefined;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { KTimeProps } from './types';
|
|
2
|
+
type __VLS_Props = KTimeProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
modelValue?: string | null;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
8
|
+
clear: () => null;
|
|
9
|
+
focus: () => void | undefined;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
select: (value: string) => any;
|
|
12
|
+
"update:modelValue": (value: string | null) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
+
onSelect?: ((value: string) => any) | undefined;
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type KTimeHourCycle = 12 | 24;
|
|
2
|
+
export type KTimeProps = {
|
|
3
|
+
/** `12` adds AM/PM buttons; `24` shows 00–23. The value is always 24-hour. Default `12`. */
|
|
4
|
+
hourCycle?: KTimeHourCycle;
|
|
5
|
+
/** Latest selectable time, `HH:mm` or `HH:mm:ss`, inclusive. */
|
|
6
|
+
maxTime?: string;
|
|
7
|
+
/** Earliest selectable time, `HH:mm` or `HH:mm:ss`, inclusive. */
|
|
8
|
+
minTime?: string;
|
|
9
|
+
/** Minutes per + / − press (and ↑/↓ in the field), 1–30. Default `1`. */
|
|
10
|
+
minuteStep?: number;
|
|
11
|
+
/** The Now button's label. Default `'Now'`. */
|
|
12
|
+
nowLabel?: string;
|
|
13
|
+
/** Seconds per + / − press, 1–30. Default `1`. */
|
|
14
|
+
secondStep?: number;
|
|
15
|
+
/** Adds seconds; the value becomes `HH:mm:ss`. */
|
|
16
|
+
seconds?: boolean;
|
|
17
|
+
/** Shows a Now button that picks the current time. */
|
|
18
|
+
showNow?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type KTimeEmits = {
|
|
21
|
+
/** Enter was pressed in a part, or Now was picked. */
|
|
22
|
+
select: [value: string];
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { KTimeInputInvalidReason, KTimeInputProps } from './types';
|
|
2
|
+
type __VLS_Props = KTimeInputProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
modelValue?: string | null;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
8
|
+
clear: () => null;
|
|
9
|
+
close: () => void | undefined;
|
|
10
|
+
focus: () => void | undefined;
|
|
11
|
+
open: () => void | undefined;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
open: () => any;
|
|
14
|
+
close: () => any;
|
|
15
|
+
invalid: (reason: KTimeInputInvalidReason, text: string) => any;
|
|
16
|
+
clear: () => any;
|
|
17
|
+
"update:modelValue": (value: string | null) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
onOpen?: (() => any) | undefined;
|
|
20
|
+
onClose?: (() => any) | undefined;
|
|
21
|
+
onInvalid?: ((reason: KTimeInputInvalidReason, text: string) => any) | undefined;
|
|
22
|
+
onClear?: (() => any) | undefined;
|
|
23
|
+
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { KTimeProps } from '../Time/types';
|
|
2
|
+
export type KTimeInputInvalidReason = 'incomplete' | 'out-of-range';
|
|
3
|
+
export type KTimeInputProps = KTimeProps & {
|
|
4
|
+
/** Shows a × that clears the value while there is one. */
|
|
5
|
+
clearable?: boolean;
|
|
6
|
+
/** The × button's accessible name. Default `'Clear'`. */
|
|
7
|
+
clearLabel?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
ghost?: boolean;
|
|
10
|
+
/** Shows a spinner as the last addon and disables the clock button; the field stays editable. */
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/** Posts the value (`HH:mm` or `HH:mm:ss`, 24-hour) through a hidden input. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Defaults to the layout, e.g. `hh:mm AA`. */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
readonly?: boolean;
|
|
17
|
+
rounded?: boolean;
|
|
18
|
+
sunken?: boolean;
|
|
19
|
+
transparent?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type KTimeInputEmits = {
|
|
22
|
+
/** The × cleared the value. */
|
|
23
|
+
clear: [];
|
|
24
|
+
close: [];
|
|
25
|
+
invalid: [reason: KTimeInputInvalidReason, text: string];
|
|
26
|
+
open: [];
|
|
27
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ShallowRef } from 'vue';
|
|
2
|
+
import Knitify from '@knitify/core';
|
|
3
|
+
type TimeInputModuleConfig = NonNullable<ConstructorParameters<typeof Knitify.modules.TimeInput>[1]>;
|
|
4
|
+
type TimeInputControls = {
|
|
5
|
+
close(): void;
|
|
6
|
+
getValue(): string | null;
|
|
7
|
+
open(): void;
|
|
8
|
+
setValue(value: string | null): void;
|
|
9
|
+
};
|
|
10
|
+
type Options = {
|
|
11
|
+
root: Readonly<ShallowRef<HTMLElement | null>>;
|
|
12
|
+
/** Read inside a watcher, so every prop it touches triggers a rebuild. */
|
|
13
|
+
config: () => TimeInputModuleConfig;
|
|
14
|
+
/** Pushes the current model into a freshly built module. */
|
|
15
|
+
apply: (instance: TimeInputControls) => void;
|
|
16
|
+
listeners: Record<string, (event: CustomEvent) => void>;
|
|
17
|
+
};
|
|
18
|
+
export declare const syncClearButton: (element: unknown) => void;
|
|
19
|
+
export declare function useTimeInput(options: Options): {
|
|
20
|
+
getInstance: () => TimeInputControls | undefined;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { KTooltipProps } from './types';
|
|
2
|
+
declare function onMouseover(event: MouseEvent): void;
|
|
3
|
+
declare function onMouseout(event: MouseEvent): void;
|
|
4
|
+
declare function onFocusin(event: FocusEvent): void;
|
|
5
|
+
declare function onFocusout(event: FocusEvent): void;
|
|
6
|
+
/** The trigger listeners, keyed by DOM event name. */
|
|
7
|
+
export declare const triggerListeners: {
|
|
8
|
+
readonly focusin: typeof onFocusin;
|
|
9
|
+
readonly focusout: typeof onFocusout;
|
|
10
|
+
readonly mouseout: typeof onMouseout;
|
|
11
|
+
readonly mouseover: typeof onMouseover;
|
|
12
|
+
};
|
|
13
|
+
/** The same listeners as vnode props, for `cloneVNode`. */
|
|
14
|
+
export declare const triggerListenerProps: {
|
|
15
|
+
onFocusin: typeof onFocusin;
|
|
16
|
+
onFocusout: typeof onFocusout;
|
|
17
|
+
onMouseout: typeof onMouseout;
|
|
18
|
+
onMouseover: typeof onMouseover;
|
|
19
|
+
};
|
|
20
|
+
/** Core's attributes for a label, placement and delay, as a plain record. */
|
|
21
|
+
export declare function triggerAttributes(options: KTooltipProps): Record<string, string>;
|
|
22
|
+
export declare const triggerAttributeNames: readonly ["data-kt-tooltip", "data-kt-tooltip-placement", "data-kt-tooltip-delay"];
|
|
23
|
+
export declare function retainEscape(): void;
|
|
24
|
+
export declare function releaseEscape(): void;
|
|
25
|
+
/**
|
|
26
|
+
* A trigger unmounted while its tooltip is up would otherwise strand the
|
|
27
|
+
* bubble, which core has moved to `<body>`. With the trigger in hand, only its
|
|
28
|
+
* own tooltip closes — a row leaving a list must not close the tooltip of the
|
|
29
|
+
* row still under the pointer. Without one (KTooltip, which does not hold its
|
|
30
|
+
* child's element), every tooltip closes, as core's delegated version does.
|
|
31
|
+
*/
|
|
32
|
+
export declare function hideOnUnmount(trigger?: Element): void;
|
|
33
|
+
export {};
|
|
@@ -16,3 +16,8 @@ export type KTooltipSlots = {
|
|
|
16
16
|
*/
|
|
17
17
|
default?(): any;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* The value of `v-tooltip`: a label, the full options, or a falsy value to
|
|
21
|
+
* turn the tooltip off.
|
|
22
|
+
*/
|
|
23
|
+
export type KTooltipDirectiveValue = string | KTooltipProps | null | undefined | false;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ObjectDirective } from 'vue';
|
|
2
|
+
import type { KPlacement } from '../Popover/types';
|
|
3
|
+
import type { KTooltipDirectiveValue } from './types';
|
|
4
|
+
export declare const vTooltip: ObjectDirective<Element, KTooltipDirectiveValue, string, KPlacement>;
|
|
5
|
+
export default vTooltip;
|
|
6
|
+
declare module 'vue' {
|
|
7
|
+
interface GlobalDirectives {
|
|
8
|
+
vTooltip: typeof vTooltip;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import type { KWorkspaceProps, KWorkspaceSlots } from './types';
|
|
1
|
+
import type { KWorkspaceDrawer, KWorkspaceProps, KWorkspaceSlots } from './types';
|
|
2
2
|
type __VLS_Props = KWorkspaceProps;
|
|
3
3
|
type __VLS_Slots = KWorkspaceSlots;
|
|
4
4
|
declare function toggle(): void;
|
|
5
5
|
declare function expand(): void;
|
|
6
6
|
declare function collapseSidebar(): void;
|
|
7
|
+
declare function openDrawer(target?: KWorkspaceDrawer): void;
|
|
8
|
+
declare function closeDrawer(target?: KWorkspaceDrawer): void;
|
|
9
|
+
declare function toggleDrawer(target?: KWorkspaceDrawer): void;
|
|
7
10
|
type __VLS_ModelProps = {
|
|
8
11
|
'expanded'?: boolean;
|
|
12
|
+
'open'?: boolean;
|
|
13
|
+
'bodyOpen'?: boolean;
|
|
9
14
|
};
|
|
10
15
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
16
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
12
17
|
toggle: typeof toggle;
|
|
13
18
|
expand: typeof expand;
|
|
14
19
|
collapse: typeof collapseSidebar;
|
|
20
|
+
openDrawer: typeof openDrawer;
|
|
21
|
+
closeDrawer: typeof closeDrawer;
|
|
22
|
+
toggleDrawer: typeof toggleDrawer;
|
|
15
23
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
24
|
"update:expanded": (value: boolean) => any;
|
|
25
|
+
"update:open": (value: boolean) => any;
|
|
26
|
+
"update:bodyOpen": (value: boolean) => any;
|
|
17
27
|
} & {
|
|
18
28
|
toggle: (value: boolean) => any;
|
|
19
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
30
|
onToggle?: ((value: boolean) => any) | undefined;
|
|
21
31
|
"onUpdate:expanded"?: ((value: boolean) => any) | undefined;
|
|
32
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
33
|
+
"onUpdate:bodyOpen"?: ((value: boolean) => any) | undefined;
|
|
22
34
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
36
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import { ClassValue } from 'vue';
|
|
2
2
|
export type KWorkspaceSide = 'left' | 'right';
|
|
3
|
+
export type KWorkspaceBreakpoint = 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
4
|
+
export type KWorkspaceDrawer = 'sidebar' | 'bodySidebar';
|
|
3
5
|
export type KWorkspaceProps = {
|
|
4
6
|
bodyClass?: ClassValue;
|
|
5
7
|
bodyContentClass?: ClassValue;
|
|
8
|
+
bodyDrawerAt?: KWorkspaceBreakpoint;
|
|
9
|
+
bodyDrawerWidth?: string;
|
|
6
10
|
bodySidebarClass?: ClassValue;
|
|
7
11
|
bodySidebarSide?: KWorkspaceSide;
|
|
12
|
+
bodySidebarWidth?: string;
|
|
8
13
|
collapsible?: boolean;
|
|
14
|
+
drawerAt?: KWorkspaceBreakpoint;
|
|
15
|
+
drawerWidth?: string;
|
|
9
16
|
footerClass?: ClassValue;
|
|
10
17
|
height?: string;
|
|
11
18
|
mainClass?: ClassValue;
|
|
19
|
+
rounded?: boolean;
|
|
12
20
|
side?: KWorkspaceSide;
|
|
13
21
|
sidebarBodyClass?: ClassValue;
|
|
14
22
|
sidebarClass?: ClassValue;
|
|
23
|
+
sidebarHeaderClass?: ClassValue;
|
|
15
24
|
sidebarInnerClass?: ClassValue;
|
|
25
|
+
sidebarWidth?: string;
|
|
16
26
|
topbarClass?: ClassValue;
|
|
17
27
|
};
|
|
18
28
|
export type KWorkspaceEmits = {
|