@knitify/vue 2.0.0 → 2.2.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.
Files changed (94) hide show
  1. package/README.md +6 -1
  2. package/dist/index.es.js +6611 -2755
  3. package/dist/index.umd.js +1 -1
  4. package/dist/types/components/Alert/KAlert.vue.d.ts +22 -2
  5. package/dist/types/components/Alert/types.d.ts +11 -1
  6. package/dist/types/components/ArticleList/KArticleList.vue.d.ts +11 -0
  7. package/dist/types/components/ArticleList/KArticleListItem.vue.d.ts +15 -0
  8. package/dist/types/components/ArticleList/types.d.ts +47 -0
  9. package/dist/types/components/Avatar/types.d.ts +1 -1
  10. package/dist/types/components/ButtonGroup/KButtonGroup.vue.d.ts +11 -0
  11. package/dist/types/components/ButtonGroup/types.d.ts +7 -0
  12. package/dist/types/components/Calendar/types.d.ts +2 -0
  13. package/dist/types/components/Chat/KChatPrompt.vue.d.ts +2 -2
  14. package/dist/types/components/Chat/keys.d.ts +1 -0
  15. package/dist/types/components/Chat/types.d.ts +19 -4
  16. package/dist/types/components/ChatDock/KChatDock.vue.d.ts +4 -2
  17. package/dist/types/components/ChatDock/KChatNewWindow.vue.d.ts +28 -0
  18. package/dist/types/components/ChatDock/KMessenger.vue.d.ts +6 -0
  19. package/dist/types/components/ChatDock/messenger-types.d.ts +56 -1
  20. package/dist/types/components/ChatDock/types.d.ts +30 -2
  21. package/dist/types/components/DataTable/KDataTable.vue.d.ts +71 -0
  22. package/dist/types/components/DataTable/KDataTableLinkCell.vue.d.ts +21 -0
  23. package/dist/types/components/DataTable/KDataTableSettings.vue.d.ts +32 -0
  24. package/dist/types/components/DataTable/KDataTableSort.vue.d.ts +17 -0
  25. package/dist/types/components/DataTable/columnTypes.d.ts +19 -0
  26. package/dist/types/components/DataTable/keys.d.ts +9 -0
  27. package/dist/types/components/DataTable/types.d.ts +269 -0
  28. package/dist/types/components/DateInput/KDateInput.vue.d.ts +26 -0
  29. package/dist/types/components/DateInput/KDateRangeInput.vue.d.ts +31 -0
  30. package/dist/types/components/DateInput/types.d.ts +69 -0
  31. package/dist/types/components/DateInput/useDateInput.d.ts +27 -0
  32. package/dist/types/components/Dialog/KDialogHost.vue.d.ts +3 -0
  33. package/dist/types/components/Dialog/KDialogItem.vue.d.ts +16 -0
  34. package/dist/types/components/Dialog/types.d.ts +61 -0
  35. package/dist/types/components/Dialog/useDialog.d.ts +41 -0
  36. package/dist/types/components/Divider/KDivider.vue.d.ts +11 -0
  37. package/dist/types/components/Divider/types.d.ts +19 -0
  38. package/dist/types/components/Dropzone/KDropzone.vue.d.ts +39 -0
  39. package/dist/types/components/Dropzone/types.d.ts +89 -0
  40. package/dist/types/components/Field/FieldIsolate.d.ts +4 -0
  41. package/dist/types/components/Field/KField.vue.d.ts +11 -0
  42. package/dist/types/components/Field/keys.d.ts +21 -0
  43. package/dist/types/components/Field/types.d.ts +35 -0
  44. package/dist/types/components/FileTree/KFileTree.vue.d.ts +2 -2
  45. package/dist/types/components/Flex/KFlex.vue.d.ts +11 -0
  46. package/dist/types/components/Flex/types.d.ts +26 -0
  47. package/dist/types/components/Input/KInput.vue.d.ts +2 -0
  48. package/dist/types/components/Input/types.d.ts +10 -0
  49. package/dist/types/components/Modal/types.d.ts +9 -1
  50. package/dist/types/components/Pagination/KPagination.vue.d.ts +13 -0
  51. package/dist/types/components/Pagination/range.d.ts +6 -0
  52. package/dist/types/components/Pagination/types.d.ts +20 -0
  53. package/dist/types/components/RadioCard/KRadioCard.vue.d.ts +20 -0
  54. package/dist/types/components/RadioCard/KRadioCardGroup.vue.d.ts +11 -0
  55. package/dist/types/components/RadioCard/types.d.ts +25 -0
  56. package/dist/types/components/SearchInput/KSearchInput.vue.d.ts +22 -0
  57. package/dist/types/components/SearchInput/types.d.ts +7 -0
  58. package/dist/types/components/SegmentedButtons/KSegmentedButton.vue.d.ts +20 -0
  59. package/dist/types/components/SegmentedButtons/KSegmentedButtons.vue.d.ts +11 -0
  60. package/dist/types/components/SegmentedButtons/types.d.ts +25 -0
  61. package/dist/types/components/Select/KSelect.vue.d.ts +2 -0
  62. package/dist/types/components/Select/types.d.ts +8 -0
  63. package/dist/types/components/Skeleton/KSkeleton.vue.d.ts +4 -0
  64. package/dist/types/components/Skeleton/types.d.ts +19 -0
  65. package/dist/types/components/Table/KTable.vue.d.ts +8 -1
  66. package/dist/types/components/Table/KTableResizer.vue.d.ts +4 -0
  67. package/dist/types/components/Table/types.d.ts +28 -1
  68. package/dist/types/components/Tabs/KTabs.vue.d.ts +1 -1
  69. package/dist/types/components/Tabs/types.d.ts +42 -3
  70. package/dist/types/components/TagsInput/KTagsInput.vue.d.ts +32 -0
  71. package/dist/types/components/TagsInput/types.d.ts +68 -0
  72. package/dist/types/components/TagsInput/useTagsInput.d.ts +27 -0
  73. package/dist/types/components/Time/KTime.vue.d.ts +18 -0
  74. package/dist/types/components/Time/types.d.ts +23 -0
  75. package/dist/types/components/TimeInput/KTimeInput.vue.d.ts +26 -0
  76. package/dist/types/components/TimeInput/types.d.ts +27 -0
  77. package/dist/types/components/TimeInput/useTimeInput.d.ts +22 -0
  78. package/dist/types/components/Toast/types.d.ts +22 -0
  79. package/dist/types/components/Toast/useToast.d.ts +14 -2
  80. package/dist/types/components/Toggle/types.d.ts +2 -0
  81. package/dist/types/components/Tooltip/triggerHandlers.d.ts +33 -0
  82. package/dist/types/components/Tooltip/types.d.ts +5 -0
  83. package/dist/types/components/Tooltip/vTooltip.d.ts +10 -0
  84. package/dist/types/components/Workspace/KWorkspace.vue.d.ts +13 -1
  85. package/dist/types/components/Workspace/types.d.ts +10 -0
  86. package/dist/types/components/index.d.ts +29 -0
  87. package/dist/types/components/types.d.ts +20 -0
  88. package/dist/types/index.d.ts +11 -2
  89. package/dist/types/utils/useCoreModule.d.ts +30 -0
  90. package/dist/types/utils/useFieldControl.d.ts +25 -0
  91. package/dist/types/utils/useRootClasses.d.ts +15 -0
  92. package/dist/types/utils/useTopmost.d.ts +3 -1
  93. package/dist/web-types.json +4927 -1307
  94. package/package.json +3 -3
@@ -1,6 +1,26 @@
1
- import type { KAlertProps, KAlertSlots } from './types';
1
+ import type { KAlertSlots } from './types';
2
2
  type __VLS_Slots = KAlertSlots;
3
- declare const __VLS_base: import("vue").DefineComponent<KAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KAlertProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const __VLS_base: import("vue").DefineComponent<({
4
+ title?: string;
5
+ } & {
6
+ banner?: false;
7
+ variant?: import("../..").Intent;
8
+ }) | ({
9
+ title?: string;
10
+ } & {
11
+ banner: true;
12
+ variant?: import("./types").KAlertBannerIntent;
13
+ }), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<({
14
+ title?: string;
15
+ } & {
16
+ banner?: false;
17
+ variant?: import("../..").Intent;
18
+ }) | ({
19
+ title?: string;
20
+ } & {
21
+ banner: true;
22
+ variant?: import("./types").KAlertBannerIntent;
23
+ })> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
24
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
5
25
  declare const _default: typeof __VLS_export;
6
26
  export default _default;
@@ -1,4 +1,6 @@
1
1
  import { Intent } from '../../types';
2
+ /** The intents core gives a banner colour to. */
3
+ export type KAlertBannerIntent = Extract<Intent, 'caution' | 'critical' | 'info'>;
2
4
  /**
3
5
  * Core ships no `--edged` modifier — the one in its docs helper does not exist
4
6
  * in the stylesheet — so there is deliberately no `edged` prop here.
@@ -6,12 +8,20 @@ import { Intent } from '../../types';
6
8
  * Anchors inside the message need `class="KAlert-link"` to pick up the alert's
7
9
  * text colour. That stays the consumer's job: the slot content is arbitrary,
8
10
  * so the wrapper has nothing to attach it to.
11
+ *
12
+ * `banner` narrows `variant` to the intents that have a banner colour.
9
13
  */
10
14
  export type KAlertProps = {
11
15
  /** Bold label above the message. The `title` slot overrides it. */
12
16
  title?: string;
17
+ } & ({
18
+ banner?: false;
13
19
  variant?: Intent;
14
- };
20
+ } | {
21
+ /** Full-width page banner: no border or radius, centered text. */
22
+ banner: true;
23
+ variant?: KAlertBannerIntent;
24
+ });
15
25
  export type KAlertSlots = {
16
26
  default?(): any;
17
27
  title?(): any;
@@ -0,0 +1,11 @@
1
+ import type { KArticleListProps, KArticleListSlots } from './types';
2
+ type __VLS_Slots = KArticleListSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KArticleListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KArticleListProps> & 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,15 @@
1
+ import type { KArticleListItemProps, KArticleListItemSlots } from './types';
2
+ type __VLS_Slots = KArticleListItemSlots;
3
+ declare const __VLS_base: import("vue").DefineComponent<KArticleListItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ click: (event: MouseEvent) => any;
5
+ }, string, import("vue").PublicProps, Readonly<KArticleListItemProps> & Readonly<{
6
+ onClick?: ((event: MouseEvent) => any) | undefined;
7
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,47 @@
1
+ import type { RouteLocationRaw } from 'vue-router';
2
+ export type KArticleListProps = {
3
+ /** Names the list for a screen reader. */
4
+ ariaLabel?: string;
5
+ };
6
+ export type KArticleListItemProps = {
7
+ /**
8
+ * Marks the article currently open. Maps to core's `is-active` plus
9
+ * `aria-current`, since the fill alone conveys nothing to a screen reader.
10
+ */
11
+ active?: boolean;
12
+ /** Publication date. The `date` slot overrides it. */
13
+ date?: string;
14
+ /** Native `disabled` on a button; `is-disabled` + `aria-disabled` on a link. */
15
+ disabled?: boolean;
16
+ /** Excerpt, clamped to three lines by core. The default slot overrides it. */
17
+ excerpt?: string;
18
+ /** Forces the hover fill and the actions slot open, for previews. */
19
+ hovered?: boolean;
20
+ href?: string;
21
+ /** Sprite id of the trailing chevron, shown when there is no actions slot. */
22
+ icon?: string;
23
+ /** Article title. The `title` slot overrides it. */
24
+ title?: string;
25
+ /** Router destination. Takes precedence over `href`. */
26
+ to?: RouteLocationRaw;
27
+ };
28
+ export type KArticleListItemEmits = {
29
+ click: [event: MouseEvent];
30
+ };
31
+ export type KArticleListSlots = {
32
+ default?(): any;
33
+ };
34
+ export type KArticleListItemSlots = {
35
+ /**
36
+ * The overflow trigger, typically a `KDropdown` around a meatball
37
+ * `KButton`. Replaces the chevron. Core fades it in on hover or focus, and
38
+ * keeps it shown while the dropdown is open. Not rendered on a disabled row.
39
+ */
40
+ actions?(): any;
41
+ date?(): any;
42
+ /** The excerpt. */
43
+ default?(): any;
44
+ /** The trailing chevron. Ignored when the actions slot is filled. */
45
+ icon?(): any;
46
+ title?(): any;
47
+ };
@@ -19,7 +19,7 @@ export type KAvatarProps = {
19
19
  */
20
20
  colorKey?: string;
21
21
  /**
22
- * Placeholder glyph, used when there is no `src`. `true` is core's `#user`;
22
+ * Placeholder glyph, used when there is no `src`. `true` is core's `#kt-user`;
23
23
  * a string is any other sprite href.
24
24
  */
25
25
  icon?: boolean | string;
@@ -0,0 +1,11 @@
1
+ import type { KButtonGroupSlots } from './types';
2
+ type __VLS_Slots = KButtonGroupSlots;
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,7 @@
1
+ export type KButtonGroupSlots = {
2
+ /**
3
+ * `KButton`s, or wrappers around one — a `KDropdown` whose toggle is a
4
+ * `KButton` makes a split button.
5
+ */
6
+ default?(): any;
7
+ };
@@ -13,6 +13,8 @@ export type KCalendarProps = {
13
13
  maxDate?: Date;
14
14
  minDate?: Date;
15
15
  mode?: KCalendarMode;
16
+ /** Months shown side by side. Two suits range selection; defaults to `1`. */
17
+ months?: 1 | 2;
16
18
  };
17
19
  export type KCalendarEmits = {
18
20
  clear: [];
@@ -6,12 +6,12 @@ type __VLS_ModelProps = {
6
6
  };
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
- stop: () => any;
10
9
  submit: (value: string) => any;
10
+ stop: () => any;
11
11
  "update:modelValue": (value: string) => any;
12
12
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
- onStop?: (() => any) | undefined;
14
13
  onSubmit?: ((value: string) => any) | undefined;
14
+ onStop?: (() => any) | undefined;
15
15
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
16
16
  }>, {
17
17
  disabled: boolean;
@@ -1,2 +1,3 @@
1
1
  import type { InjectionKey, Ref } from 'vue';
2
2
  export declare const chatBusyKey: InjectionKey<Ref<boolean>>;
3
+ export declare const chatAiKey: InjectionKey<Ref<boolean>>;
@@ -124,11 +124,25 @@ export type KChatPromptEmits = {
124
124
  stop: [];
125
125
  submit: [value: string];
126
126
  };
127
+ /**
128
+ * `busy` is the chat's busy state; `disabled` is whether the send button is
129
+ * disabled (no draft, or the prompt itself disabled), for controls that
130
+ * should follow it.
131
+ */
132
+ type KChatPromptSlotProps = {
133
+ busy: boolean;
134
+ disabled: boolean;
135
+ };
127
136
  export type KChatPromptSlots = {
128
- send?(props: {
129
- busy: boolean;
130
- disabled: boolean;
131
- }): any;
137
+ send?(props: KChatPromptSlotProps): any;
138
+ /** Inside the field border, before the text (a `KInput` addon). */
139
+ prefix?(props: KChatPromptSlotProps): any;
140
+ /** Inside the field border, after the text (a `KInput` addon). */
141
+ suffix?(props: KChatPromptSlotProps): any;
142
+ /** Outside the field, before it. */
143
+ start?(props: KChatPromptSlotProps): any;
144
+ /** Outside the field, between it and the send button. */
145
+ end?(props: KChatPromptSlotProps): any;
132
146
  };
133
147
  export type KChatShimmerProps = {
134
148
  interval?: number;
@@ -138,3 +152,4 @@ export type KChatShimmerProps = {
138
152
  export type KChatShimmerSlots = {
139
153
  default?(): any;
140
154
  };
155
+ export {};
@@ -21,17 +21,19 @@ declare const __VLS_base: import("vue").DefineComponent<KChatDockProps, {
21
21
  togglePanel: typeof togglePanel;
22
22
  refilter: typeof refilter;
23
23
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
- select: (id: string, opened: boolean) => any;
25
24
  search: (query: string) => any;
25
+ select: (id: string, opened: boolean) => any;
26
26
  reflow: () => any;
27
27
  launcher: () => any;
28
+ compose: () => any;
28
29
  panel: (open: boolean) => any;
29
30
  activate: (id: string) => any;
30
31
  }, string, import("vue").PublicProps, Readonly<KChatDockProps> & Readonly<{
31
- onSelect?: ((id: string, opened: boolean) => any) | undefined;
32
32
  onSearch?: ((query: string) => any) | undefined;
33
+ onSelect?: ((id: string, opened: boolean) => any) | undefined;
33
34
  onReflow?: (() => any) | undefined;
34
35
  onLauncher?: (() => any) | undefined;
36
+ onCompose?: (() => any) | undefined;
35
37
  onPanel?: ((open: boolean) => any) | undefined;
36
38
  onActivate?: ((id: string) => any) | undefined;
37
39
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,28 @@
1
+ import type { KChatNewWindowProps, KChatNewWindowSlots, KChatWindowState } from './types';
2
+ type __VLS_Props = KChatNewWindowProps;
3
+ type __VLS_Slots = KChatNewWindowSlots;
4
+ type __VLS_ModelProps = {
5
+ 'state'?: KChatWindowState;
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
9
+ expand: () => void | undefined;
10
+ rail: () => void | undefined;
11
+ focus: () => void | undefined;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ close: () => any;
14
+ search: (query: string) => any;
15
+ "update:state": (value: KChatWindowState) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
+ onClose?: (() => any) | undefined;
18
+ onSearch?: ((query: string) => any) | undefined;
19
+ "onUpdate:state"?: ((value: KChatWindowState) => 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
+ };
@@ -6,12 +6,18 @@ declare const __VLS_base: import("vue").DefineComponent<KMessengerProps, ChatDoc
6
6
  open: (id: string) => any;
7
7
  close: (id: string) => any;
8
8
  receive: (message: import("./messenger-types").ChatMessage) => any;
9
+ compose: () => any;
10
+ "new-chat-search": (query: string) => any;
11
+ "new-chat-close": () => any;
9
12
  }, string, import("vue").PublicProps, Readonly<KMessengerProps> & Readonly<{
10
13
  onError?: ((kind: import("./messenger-types").ChatDockErrorKind, id: string | undefined, error: unknown) => any) | undefined;
11
14
  onSend?: ((message: import("./messenger-types").ChatMessage) => any) | undefined;
12
15
  onOpen?: ((id: string) => any) | undefined;
13
16
  onClose?: ((id: string) => any) | undefined;
14
17
  onReceive?: ((message: import("./messenger-types").ChatMessage) => any) | undefined;
18
+ onCompose?: (() => any) | undefined;
19
+ "onNew-chat-search"?: ((query: string) => any) | undefined;
20
+ "onNew-chat-close"?: (() => any) | undefined;
15
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
22
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
23
  declare const _default: typeof __VLS_export;
@@ -55,6 +55,12 @@ export type ChatDockLoaders = {
55
55
  export type ChatDockOptions = {
56
56
  /** Drop messages, cursor and draft when a window closes. Default `false`. */
57
57
  evictOnClose?: boolean;
58
+ /**
59
+ * Skip the list load the store otherwise starts on creation; nothing is
60
+ * fetched until `ensureConversations` (or `refreshConversations`) is
61
+ * called. `KMessenger` calls it when the panel first opens. Default `false`.
62
+ */
63
+ lazy?: boolean;
58
64
  };
59
65
  export type ChatWindowState = 'closed' | 'expanded' | 'railed';
60
66
  export type LoadState = 'idle' | 'loading' | 'loaded' | 'error';
@@ -82,6 +88,12 @@ export type ChatDockStore = {
82
88
  /** Whether a composer can be rendered at all. */
83
89
  canSend: boolean;
84
90
  refreshConversations: () => Promise<void>;
91
+ /**
92
+ * Loads the list only if it has not loaded yet: starts a load when idle or
93
+ * failed, joins the one in flight, and does nothing once loaded. Safe to
94
+ * call on every panel open.
95
+ */
96
+ ensureConversations: () => Promise<void>;
85
97
  open: (id: string) => Promise<void>;
86
98
  /**
87
99
  * Shows a window again without treating it as a user-initiated open: no
@@ -130,8 +142,19 @@ export type KMessengerProps = {
130
142
  minWindows?: number;
131
143
  title?: string;
132
144
  placeholder?: string;
145
+ /** The "New chat" window's title. Default `'New Chat'`. */
146
+ newChatTitle?: string;
147
+ /** The "New chat" people search placeholder. Default `'To: Search People'`. */
148
+ newChatPlaceholder?: string;
149
+ /** The "New chat" people search's accessible name. Default `'Search people'`. */
150
+ newChatSearchLabel?: string;
133
151
  /** Passed to `useChatDock` when the component creates the store. */
134
152
  evictOnClose?: boolean;
153
+ /**
154
+ * Passed to `useChatDock` when the component creates the store: the list
155
+ * loads when the panel first opens instead of on mount. Default `false`.
156
+ */
157
+ lazy?: boolean;
135
158
  /**
136
159
  * Passed to every window's `KChat`: stacks message actions under the bubble.
137
160
  * Defaults to `true` — a dock window is too narrow to spare the width beside
@@ -175,6 +198,12 @@ export type KMessengerEmits = {
175
198
  send: [message: ChatMessage];
176
199
  receive: [message: ChatMessage];
177
200
  error: [kind: ChatDockErrorKind, id: string | undefined, error: unknown];
201
+ /** The panel's write button was clicked; the "New chat" window is open. */
202
+ compose: [];
203
+ /** Each keystroke in the "New chat" window's people search. */
204
+ 'new-chat-search': [query: string];
205
+ /** The "New chat" window was closed. */
206
+ 'new-chat-close': [];
178
207
  };
179
208
  export type KMessengerSlots = {
180
209
  /** Inside the avatar circle of a head and a panel row. */
@@ -206,8 +235,16 @@ export type KMessengerSlots = {
206
235
  conversation: ChatConversation;
207
236
  entry: ChatEntry;
208
237
  }): any;
209
- /** The panel header's action area, between the title and close. */
238
+ /** The panel header's action area, before the write, maximize and close. */
210
239
  'panel-actions'?(): any;
240
+ /**
241
+ * The "New chat" window's body, under its people search — e.g. a "Create
242
+ * New Group" link and suggested people. `close` dismisses the window, for
243
+ * once a person is picked.
244
+ */
245
+ 'new-chat'?(props: {
246
+ close: () => void;
247
+ }): any;
211
248
  /** The whole panel row. */
212
249
  item?(props: {
213
250
  conversation: ChatConversation;
@@ -238,6 +275,24 @@ export type KMessengerSlots = {
238
275
  send: (text: string) => void;
239
276
  setDraft: (text: string) => void;
240
277
  }): any;
278
+ /**
279
+ * Extra controls on the default composer, scoped by conversation so one
280
+ * template serves every window: `prefix`/`suffix` inside the field border,
281
+ * `start`/`end` outside it (`end` sits before the send button). Ignored
282
+ * when `composer` replaces the whole footer.
283
+ */
284
+ 'composer-prefix'?(props: {
285
+ conversation: ChatConversation;
286
+ }): any;
287
+ 'composer-suffix'?(props: {
288
+ conversation: ChatConversation;
289
+ }): any;
290
+ 'composer-start'?(props: {
291
+ conversation: ChatConversation;
292
+ }): any;
293
+ 'composer-end'?(props: {
294
+ conversation: ChatConversation;
295
+ }): any;
241
296
  /** Window body while the first page loads. */
242
297
  loading?(props: {
243
298
  conversation: ChatConversation;
@@ -11,6 +11,11 @@ export type KChatDockProps = {
11
11
  export type KChatDockEmits = {
12
12
  reflow: [];
13
13
  launcher: [];
14
+ /**
15
+ * The panel's write button was clicked. The dock mounts nothing itself —
16
+ * render a `KChatNewWindow` (or anything else) in response.
17
+ */
18
+ compose: [];
14
19
  /** After the panel opens or closes. */
15
20
  panel: [open: boolean];
16
21
  /** After each filter, including the reset when the panel closes. */
@@ -65,10 +70,33 @@ export type KChatWindowSlots = {
65
70
  default?(): any;
66
71
  /** A railed head's circle. Falls back to `avatar` when not given. */
67
72
  head?(): any;
73
+ /**
74
+ * A full-width row under the title and actions, inside the header — e.g.
75
+ * the people search of `KChatNewWindow`. Rendered only when passed.
76
+ */
77
+ search?(): any;
68
78
  /** The popover row's avatar. Falls back to `avatar` when not given. */
69
79
  row?(): any;
70
80
  title?(): any;
71
81
  };
82
+ export type KChatNewWindowProps = {
83
+ /** Pairs the window with its rail head, as `KChatWindow`'s `id` does. */
84
+ id?: string;
85
+ title?: string;
86
+ /** People search placeholder. */
87
+ placeholder?: string;
88
+ /** People search's accessible name. Default `'Search people'`. */
89
+ searchLabel?: string;
90
+ };
91
+ export type KChatNewWindowEmits = {
92
+ /** On every keystroke in the people search. */
93
+ search: [query: string];
94
+ close: [];
95
+ };
96
+ export type KChatNewWindowSlots = {
97
+ /** The body under the search: e.g. a "Create New Group" link, suggestions. */
98
+ default?(): any;
99
+ };
72
100
  export type KChatDockPanelProps = {
73
101
  /** Header text. */
74
102
  title?: string;
@@ -84,8 +112,8 @@ export type KChatDockPanelSlots = {
84
112
  /** `KChatDockItem`s. */
85
113
  default?(): any;
86
114
  /**
87
- * Header controls, between the title and the close button — so close stays
88
- * last in the DOM and in the tab order. Rendered only when passed.
115
+ * Header controls, between the title and the built-in write, maximize and
116
+ * close buttons — so close stays last in the DOM and in the tab order.
89
117
  *
90
118
  * Controls here bind their own handlers. Do not put
91
119
  * `data-kt-chat-dock-item` on anything in this slot: `KChatDock`'s root
@@ -0,0 +1,71 @@
1
+ import type { KTableSize } from '../Table/types';
2
+ import type { KDataTableActionLabels, KDataTableColumn, KDataTableEmits, KDataTableRowKey, KDataTableSettingsLabels, KDataTableSlots, KDataTableSortLabels, KDataTableSortRule } from './types';
3
+ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<(Omit<import("../types.js").KTableProps, "size" | "striped"> & {
5
+ actionLabels?: Partial<KDataTableActionLabels>;
6
+ columns?: KDataTableColumn<T>[] | undefined;
7
+ emptyLabel?: string;
8
+ filterLabel?: string;
9
+ loading?: boolean;
10
+ maxHeight?: string;
11
+ nextLabel?: string;
12
+ pageSize?: number;
13
+ pinStart?: number;
14
+ prevLabel?: string;
15
+ rowKey?: string | ((row: T) => KDataTableRowKey) | undefined;
16
+ rows?: T[] | undefined;
17
+ searchPlaceholder?: string;
18
+ selectable?: boolean;
19
+ settingsLabel?: string;
20
+ settingsLabels?: Partial<KDataTableSettingsLabels>;
21
+ sortLabel?: string;
22
+ sortLabels?: Partial<KDataTableSortLabels>;
23
+ sortOptions?: import("../types.js").KSelectOption[];
24
+ total: number;
25
+ } & {
26
+ page?: number;
27
+ search?: string;
28
+ selected?: KDataTableRowKey[];
29
+ sort?: KDataTableSortRule[];
30
+ hiddenColumns?: string[];
31
+ size?: KTableSize;
32
+ striped?: boolean;
33
+ }) & {
34
+ onResize?: ((widths: number[]) => any) | undefined;
35
+ onAction?: ((action: string, row: T, column: {
36
+ key: string;
37
+ label: string;
38
+ resizable?: boolean;
39
+ sortable?: boolean;
40
+ } & {
41
+ type: "link";
42
+ } & {
43
+ to: (row: T) => import("vue-router").RouteLocationRaw;
44
+ }, payload?: unknown) => any) | undefined;
45
+ "onUpdate:page"?: ((value: number) => any) | undefined;
46
+ "onUpdate:hiddenColumns"?: ((value: string[]) => any) | undefined;
47
+ "onUpdate:size"?: ((value: KTableSize) => any) | undefined;
48
+ "onUpdate:striped"?: ((value: boolean) => any) | undefined;
49
+ "onUpdate:search"?: ((value: string) => any) | undefined;
50
+ "onUpdate:selected"?: ((value: KDataTableRowKey[]) => any) | undefined;
51
+ "onUpdate:sort"?: ((value: KDataTableSortRule[]) => any) | undefined;
52
+ }> & (typeof globalThis extends {
53
+ __VLS_PROPS_FALLBACK: infer P;
54
+ } ? P : {});
55
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
56
+ /** Hands every column back to automatic layout. */
57
+ reset: () => void | undefined;
58
+ }>) => void;
59
+ attrs: any;
60
+ slots: KDataTableSlots<T>;
61
+ emit: KDataTableEmits<T> & (((event: "update:page", value: number) => void) & ((event: "update:hiddenColumns", value: string[]) => void) & ((event: "update:size", value: KTableSize) => void) & ((event: "update:striped", value: boolean) => void) & ((event: "update:search", value: string) => void) & ((event: "update:selected", value: KDataTableRowKey[]) => void) & ((event: "update:sort", value: KDataTableSortRule[]) => void));
62
+ }>) => import("vue").VNode & {
63
+ __ctx?: Awaited<typeof __VLS_setup>;
64
+ };
65
+ declare const _default: typeof __VLS_export;
66
+ export default _default;
67
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
68
+ [K in keyof T]: T[K];
69
+ } : {
70
+ [K in keyof T as K]: T[K];
71
+ }) & {};
@@ -0,0 +1,21 @@
1
+ import type { KDataTableCellComponentProps } from './types';
2
+ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<KDataTableCellComponentProps<T, "link"> & {
4
+ onAction?: ((action: string, payload?: unknown) => any) | undefined;
5
+ }> & (typeof globalThis extends {
6
+ __VLS_PROPS_FALLBACK: infer P;
7
+ } ? P : {});
8
+ expose: (exposed: {}) => void;
9
+ attrs: any;
10
+ slots: {};
11
+ emit: (evt: "action", action: string, payload?: unknown) => void;
12
+ }>) => import("vue").VNode & {
13
+ __ctx?: Awaited<typeof __VLS_setup>;
14
+ };
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
18
+ [K in keyof T]: T[K];
19
+ } : {
20
+ [K in keyof T as K]: T[K];
21
+ }) & {};
@@ -0,0 +1,32 @@
1
+ import type { KTableSize } from '../Table/types';
2
+ import type { KDataTableColumn, KDataTableSettingsLabels } from './types';
3
+ type __VLS_Props = {
4
+ columns: KDataTableColumn[];
5
+ labels: KDataTableSettingsLabels;
6
+ };
7
+ type __VLS_Slots = {
8
+ default?(): any;
9
+ };
10
+ type __VLS_ModelProps = {
11
+ 'hiddenColumns'?: string[];
12
+ 'size'?: KTableSize;
13
+ 'striped'?: boolean;
14
+ };
15
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ "update:hiddenColumns": (value: string[]) => any;
18
+ "update:size": (value: KTableSize) => any;
19
+ "update:striped": (value: boolean) => any;
20
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
+ "onUpdate:hiddenColumns"?: ((value: string[]) => any) | undefined;
22
+ "onUpdate:size"?: ((value: KTableSize) => any) | undefined;
23
+ "onUpdate:striped"?: ((value: boolean) => 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,17 @@
1
+ import type { KSelectOption } from '../Select/types';
2
+ import type { KDataTableSortLabels, KDataTableSortRule } from './types';
3
+ type __VLS_Props = {
4
+ labels: KDataTableSortLabels;
5
+ options: KSelectOption[];
6
+ };
7
+ type __VLS_ModelProps = {
8
+ modelValue?: KDataTableSortRule[];
9
+ };
10
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ "update:modelValue": (value: KDataTableSortRule[]) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
+ "onUpdate:modelValue"?: ((value: KDataTableSortRule[]) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { type Component } from 'vue';
2
+ import type { KDataTableColumnType } from './types';
3
+ /**
4
+ * Makes `component` render the cells of every column whose `type` is `type`,
5
+ * in every KDataTable. Register before the app mounts — tables already on
6
+ * screen don't pick up a type registered later. Registering a name again
7
+ * replaces its component, built-in `link` included.
8
+ *
9
+ * Declare the type in `KDataTableColumnTypes` first; `type` only accepts the
10
+ * names declared there.
11
+ */
12
+ export declare function registerColumnType(type: KDataTableColumnType, component: Component): void;
13
+ /**
14
+ * The component registered for `type`. With none, its cells fall back to
15
+ * plain text, and the first lookup warns so a missing `registerColumnType`
16
+ * call is noticed. Not gated on a dev flag: the library is prebuilt, so its
17
+ * own build would decide that, not the consumer's.
18
+ */
19
+ export declare function resolveColumnType(type: string): Component | undefined;
@@ -0,0 +1,9 @@
1
+ import type { ComputedRef, InjectionKey } from 'vue';
2
+ import type { KDataTableActionLabels } from './types';
3
+ /** The `link` column type's menu text when `actionLabels` leaves an entry out. */
4
+ export declare const DEFAULT_ACTION_LABELS: KDataTableActionLabels;
5
+ export interface DataTableContext {
6
+ /** The resolved menu text for `link` cells, defaults filled in. */
7
+ actionLabels: ComputedRef<KDataTableActionLabels>;
8
+ }
9
+ export declare const dataTableKey: InjectionKey<DataTableContext>;