@knitify/vue 2.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 +2 -0
- package/dist/index.es.js +4847 -2383
- 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/types.d.ts +1 -1
- package/dist/types/components/Calendar/types.d.ts +2 -0
- package/dist/types/components/Chat/keys.d.ts +1 -0
- package/dist/types/components/Chat/types.d.ts +19 -4
- package/dist/types/components/ChatDock/KChatDock.vue.d.ts +2 -0
- package/dist/types/components/ChatDock/KChatNewWindow.vue.d.ts +28 -0
- package/dist/types/components/ChatDock/KMessenger.vue.d.ts +6 -0
- package/dist/types/components/ChatDock/messenger-types.d.ts +56 -1
- package/dist/types/components/ChatDock/types.d.ts +30 -2
- 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/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 +10 -0
- 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/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/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 +22 -0
- package/dist/types/components/types.d.ts +15 -0
- package/dist/types/utils/useCoreModule.d.ts +30 -0
- package/dist/types/utils/useFieldControl.d.ts +25 -0
- package/dist/types/utils/useRootClasses.d.ts +15 -0
- package/dist/web-types.json +4319 -1440
- package/package.json +3 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type KFieldProps = {
|
|
2
|
+
counter?: boolean;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
/** A string shows it as the message; `true` marks the field invalid with no message. */
|
|
5
|
+
error?: string | boolean;
|
|
6
|
+
group?: boolean;
|
|
7
|
+
hint?: string;
|
|
8
|
+
horizontal?: boolean;
|
|
9
|
+
id?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The text announced for a required group or button control (KSelect),
|
|
14
|
+
* where `aria-required` is not allowed. Defaults to `'required'`.
|
|
15
|
+
*/
|
|
16
|
+
requiredLabel?: string;
|
|
17
|
+
/** A string shows it as the message; `true` marks the field successful with no message. */
|
|
18
|
+
success?: string | boolean;
|
|
19
|
+
};
|
|
20
|
+
export type KFieldSlotProps = {
|
|
21
|
+
id: string;
|
|
22
|
+
describedBy: string | undefined;
|
|
23
|
+
invalid: boolean;
|
|
24
|
+
required: boolean;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type KFieldSlots = {
|
|
28
|
+
default?(props: KFieldSlotProps): any;
|
|
29
|
+
label?(): any;
|
|
30
|
+
labelEnd?(): any;
|
|
31
|
+
};
|
|
32
|
+
export type KFieldCount = {
|
|
33
|
+
length: number;
|
|
34
|
+
max: number;
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KFlexProps, KFlexSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KFlexSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KFlexProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KFlexProps> & 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,26 @@
|
|
|
1
|
+
import type { Size } from '../../types';
|
|
2
|
+
/** Maps to core's `is-items-*`. */
|
|
3
|
+
export type KFlexAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
4
|
+
/** Maps to core's `is-justify-*`. */
|
|
5
|
+
export type KFlexJustify = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
|
|
6
|
+
/** Space tokens, matching core's `is-gap-*`. `0` is a real gap. */
|
|
7
|
+
export type KFlexGap = 0 | Size | '6xl';
|
|
8
|
+
export type KFlexProps = {
|
|
9
|
+
/** Cross-axis alignment of the children. */
|
|
10
|
+
align?: KFlexAlign;
|
|
11
|
+
/** Element to render. Defaults to `div`. */
|
|
12
|
+
as?: string;
|
|
13
|
+
gap?: KFlexGap;
|
|
14
|
+
/** `inline-flex` instead of `flex`. */
|
|
15
|
+
inline?: boolean;
|
|
16
|
+
/** Main-axis distribution of the children. */
|
|
17
|
+
justify?: KFlexJustify;
|
|
18
|
+
/** Reverses the order along the main axis. */
|
|
19
|
+
reverse?: boolean;
|
|
20
|
+
/** Lays the children out top to bottom instead of left to right. */
|
|
21
|
+
vertical?: boolean;
|
|
22
|
+
wrap?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type KFlexSlots = {
|
|
25
|
+
default?(): any;
|
|
26
|
+
};
|
|
@@ -8,8 +8,10 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
9
9
|
field: Readonly<import("vue").ShallowRef<HTMLTextAreaElement | null>>;
|
|
10
10
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
clear: () => any;
|
|
11
12
|
"update:modelValue": (value: string | undefined) => any;
|
|
12
13
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
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>;
|
|
@@ -2,12 +2,22 @@ export type KInputSlots = {
|
|
|
2
2
|
prefix?(): any;
|
|
3
3
|
suffix?(): any;
|
|
4
4
|
};
|
|
5
|
+
export type KInputEmits = {
|
|
6
|
+
/** The × emptied the field. */
|
|
7
|
+
clear: [];
|
|
8
|
+
};
|
|
5
9
|
export type KInputProps = {
|
|
6
10
|
addonBordered?: boolean;
|
|
7
11
|
/** Implies `textarea`. Growth is core's `Input.ts`, driven by this component. */
|
|
8
12
|
autosize?: boolean;
|
|
13
|
+
/** Shows a × that clears the value while there is one. Not for textareas. */
|
|
14
|
+
clearable?: boolean;
|
|
15
|
+
/** The × button's accessible name. Default `'Clear'`. */
|
|
16
|
+
clearLabel?: string;
|
|
9
17
|
disabled?: boolean;
|
|
10
18
|
ghost?: boolean;
|
|
19
|
+
/** Shows a spinner as the last addon and marks the field busy. It stays editable. */
|
|
20
|
+
loading?: boolean;
|
|
11
21
|
maxRows?: number;
|
|
12
22
|
placeholder?: string;
|
|
13
23
|
readonly?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClassValue } from 'vue';
|
|
2
|
-
export type KModalSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
2
|
+
export type KModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
3
|
export type KModalProps = {
|
|
4
4
|
bodyClass?: ClassValue;
|
|
5
5
|
/** Vertically centre the dialog rather than aligning it to the top. */
|
|
@@ -9,6 +9,8 @@ export type KModalProps = {
|
|
|
9
9
|
containerClass?: ClassValue;
|
|
10
10
|
dialogClass?: ClassValue;
|
|
11
11
|
dialogLabel?: string;
|
|
12
|
+
/** Removes the header and footer borders that divide them from the body. */
|
|
13
|
+
flush?: boolean;
|
|
12
14
|
/**
|
|
13
15
|
* Focus the first focusable element on open. Core rebuilds its own instance
|
|
14
16
|
* for `data-kt-modal-toggle` clicks and does not read this off the DOM, so it
|
|
@@ -31,6 +33,8 @@ export type KModalProps = {
|
|
|
31
33
|
mainClass?: ClassValue;
|
|
32
34
|
scrollable?: boolean;
|
|
33
35
|
sidebarClass?: ClassValue;
|
|
36
|
+
/** Any CSS length, e.g. `'280px'`. Sets `--kt-modal-sidebar-width`. */
|
|
37
|
+
sidebarWidth?: string;
|
|
34
38
|
size?: KModalSize;
|
|
35
39
|
/** Ignore backdrop clicks, leaving an explicit dismiss the only way out. */
|
|
36
40
|
staticBackdrop?: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { KPaginationProps } from './types';
|
|
2
|
+
type __VLS_Props = KPaginationProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
'page'?: number;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:page": (value: number) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { KPaginationItem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The pages to show around `page`. The item count stays the same wherever the
|
|
4
|
+
* current page is, so the control doesn't change width as you page through.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getPaginationRange(page: number, total: number, siblings: number, boundaries: number): KPaginationItem[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { KButtonSize } from '../Button/types';
|
|
2
|
+
export type KPaginationProps = {
|
|
3
|
+
/** Names the navigation landmark. */
|
|
4
|
+
ariaLabel?: string;
|
|
5
|
+
/** Pages shown at each end, before and after the ellipses. */
|
|
6
|
+
boundaries?: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Accessible name of the next-page button. */
|
|
9
|
+
nextLabel?: string;
|
|
10
|
+
/** Accessible name of the previous-page button. */
|
|
11
|
+
prevLabel?: string;
|
|
12
|
+
/** Pages shown either side of the current one. */
|
|
13
|
+
siblings?: number;
|
|
14
|
+
/** Passed to every page button. Defaults to `sm`. */
|
|
15
|
+
size?: KButtonSize;
|
|
16
|
+
/** Number of pages. */
|
|
17
|
+
total: number;
|
|
18
|
+
};
|
|
19
|
+
/** A page number, or a gap rendered as an ellipsis. */
|
|
20
|
+
export type KPaginationItem = number | 'ellipsis';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { KRadioCardProps, KRadioCardSlots } from './types';
|
|
2
|
+
type __VLS_Props = KRadioCardProps;
|
|
3
|
+
type __VLS_Slots = KRadioCardSlots;
|
|
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,11 @@
|
|
|
1
|
+
import type { KRadioCardGroupSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KRadioCardGroupSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, 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,25 @@
|
|
|
1
|
+
export type KRadioCardProps = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Sprite id of the illustration above the label, e.g. `kt-megaphoneColored`.
|
|
5
|
+
* The `media` slot overrides it.
|
|
6
|
+
*/
|
|
7
|
+
icon?: string;
|
|
8
|
+
/** Text under the illustration. The default slot overrides it. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Groups cards for keyboard navigation. Selection is driven by the shared
|
|
12
|
+
* `v-model`, so this is only needed when the group must also work natively —
|
|
13
|
+
* inside an uncontrolled form, say.
|
|
14
|
+
*/
|
|
15
|
+
name?: string;
|
|
16
|
+
/** What the shared model is set to when this card is picked. */
|
|
17
|
+
value?: unknown;
|
|
18
|
+
};
|
|
19
|
+
export type KRadioCardSlots = {
|
|
20
|
+
default?(): any;
|
|
21
|
+
media?(): any;
|
|
22
|
+
};
|
|
23
|
+
export type KRadioCardGroupSlots = {
|
|
24
|
+
default?(): any;
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { KSearchInputProps, KSearchInputSlots } from './types';
|
|
2
|
+
type __VLS_Props = KSearchInputProps;
|
|
3
|
+
type __VLS_Slots = KSearchInputSlots;
|
|
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
|
+
field: import("vue").ComputedRef<HTMLTextAreaElement | null | undefined>;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
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,7 @@
|
|
|
1
|
+
import type { KInputProps } from '../Input/types';
|
|
2
|
+
export type KSearchInputProps = Omit<KInputProps, 'autosize' | 'maxRows' | 'rows' | 'textarea' | 'type'>;
|
|
3
|
+
export type KSearchInputSlots = {
|
|
4
|
+
/** Replaces the search icon. */
|
|
5
|
+
prefix?(): any;
|
|
6
|
+
suffix?(): any;
|
|
7
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { KSegmentedButtonProps, KSegmentedButtonSlots } from './types';
|
|
2
|
+
type __VLS_Props = KSegmentedButtonProps;
|
|
3
|
+
type __VLS_Slots = KSegmentedButtonSlots;
|
|
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,11 @@
|
|
|
1
|
+
import type { KSegmentedButtonsProps, KSegmentedButtonsSlots } from './types';
|
|
2
|
+
type __VLS_Slots = KSegmentedButtonsSlots;
|
|
3
|
+
declare const __VLS_base: import("vue").DefineComponent<KSegmentedButtonsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KSegmentedButtonsProps> & 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,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
|
+
};
|
|
@@ -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 {};
|