@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
package/README.md
CHANGED
|
@@ -1,86 +1,113 @@
|
|
|
1
|
-
# @knitify/vue
|
|
2
|
-
|
|
3
|
-
Vue 3 components for [Knitify](https://www.npmjs.com/package/@knitify/core), the core UI library
|
|
4
|
-
powering the Knitware ecosystem. Each component wraps Knitify's markup, classes, and interactive
|
|
5
|
-
behaviour behind a typed Vue API.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
pnpm add @knitify/vue @knitify/core
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
`@knitify/core`, `vue`, and `vue-router` are peer dependencies — install them alongside this
|
|
14
|
-
package.
|
|
15
|
-
|
|
16
|
-
| Peer | Range |
|
|
17
|
-
| --------------- | --------- |
|
|
18
|
-
| `@knitify/core` | `^1.1.0` |
|
|
19
|
-
| `vue` | `^3.5.12` |
|
|
20
|
-
| `vue-router` | `^4.0.3` |
|
|
21
|
-
|
|
22
|
-
## Setup
|
|
23
|
-
|
|
24
|
-
The components ship unstyled on their own — Knitify's stylesheet lives in `@knitify/core` and must
|
|
25
|
-
be imported once by the consuming app:
|
|
26
|
-
|
|
27
|
-
```ts
|
|
28
|
-
import '@knitify/core/main.css'
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Register every component
|
|
32
|
-
|
|
33
|
-
The default export is a Vue plugin that registers all components globally:
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
import { createApp } from 'vue'
|
|
37
|
-
import Knitify from '@knitify/vue'
|
|
38
|
-
import '@knitify/core/main.css'
|
|
39
|
-
import App from './App.vue'
|
|
40
|
-
|
|
41
|
-
createApp(App).use(Knitify).mount('#app')
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Or import individually
|
|
45
|
-
|
|
46
|
-
Every component is also a named export, which keeps your bundle to what you actually use:
|
|
47
|
-
|
|
48
|
-
```vue
|
|
49
|
-
<script setup lang="ts">
|
|
50
|
-
import { ref } from 'vue'
|
|
51
|
-
import { KButton, KModal } from '@knitify/vue'
|
|
52
|
-
|
|
53
|
-
const modal = ref<InstanceType<typeof KModal>>()
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<template>
|
|
57
|
-
<KButton variant="info" @click="modal?.show()">Open</KButton>
|
|
58
|
-
<KModal ref="modal" title="Hello" closable>Content</KModal>
|
|
59
|
-
</template>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
`KModal` is opened through the instance it exposes (`show`, `hide`, `toggle`) rather than a
|
|
63
|
-
`v-model`, which keeps it in step with core's own `data-kt-modal-toggle` attribute.
|
|
64
|
-
|
|
65
|
-
Colour-carrying props take Knitify's semantic intents — `caution`, `warning`, `critical`, `info`,
|
|
66
|
-
`discovery`, `affirm` — rather than generic names like `primary`.
|
|
67
|
-
|
|
68
|
-
## What's included
|
|
69
|
-
|
|
70
|
-
47 components covering layout (`KContainer`, `KGrid`, `KWorkspace`), navigation (`KNavbar`,
|
|
71
|
-
`KBreadcrumb`, `KTabs`, `KMenuList`), forms (`KInput`, `KSelect`, `KCheckbox`, `KRadio`,
|
|
72
|
-
`KToggle`, `KCalendar`), overlays (`KModal`, `KDrawer`, `KPopover`, `KTooltip`, `KDropdown`),
|
|
73
|
-
feedback (`KAlert`, `KProgress`, `KNotificationList`), and data display (`KTable`,
|
|
74
|
-
`KCard`, `KAvatar`, `KBadge`, `KAccordion`, `KCollapse`, `KFileTree`, `KChat`).
|
|
75
|
-
|
|
76
|
-
Alongside the components:
|
|
77
|
-
|
|
78
|
-
- `useToast()` — composable for pushing toasts imperatively
|
|
79
|
-
- `
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
# @knitify/vue
|
|
2
|
+
|
|
3
|
+
Vue 3 components for [Knitify](https://www.npmjs.com/package/@knitify/core), the core UI library
|
|
4
|
+
powering the Knitware ecosystem. Each component wraps Knitify's markup, classes, and interactive
|
|
5
|
+
behaviour behind a typed Vue API.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @knitify/vue @knitify/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`@knitify/core`, `vue`, and `vue-router` are peer dependencies — install them alongside this
|
|
14
|
+
package.
|
|
15
|
+
|
|
16
|
+
| Peer | Range |
|
|
17
|
+
| --------------- | --------- |
|
|
18
|
+
| `@knitify/core` | `^1.1.0` |
|
|
19
|
+
| `vue` | `^3.5.12` |
|
|
20
|
+
| `vue-router` | `^4.0.3` |
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
The components ship unstyled on their own — Knitify's stylesheet lives in `@knitify/core` and must
|
|
25
|
+
be imported once by the consuming app:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import '@knitify/core/main.css'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Register every component
|
|
32
|
+
|
|
33
|
+
The default export is a Vue plugin that registers all components globally:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { createApp } from 'vue'
|
|
37
|
+
import Knitify from '@knitify/vue'
|
|
38
|
+
import '@knitify/core/main.css'
|
|
39
|
+
import App from './App.vue'
|
|
40
|
+
|
|
41
|
+
createApp(App).use(Knitify).mount('#app')
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Or import individually
|
|
45
|
+
|
|
46
|
+
Every component is also a named export, which keeps your bundle to what you actually use:
|
|
47
|
+
|
|
48
|
+
```vue
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
import { ref } from 'vue'
|
|
51
|
+
import { KButton, KModal } from '@knitify/vue'
|
|
52
|
+
|
|
53
|
+
const modal = ref<InstanceType<typeof KModal>>()
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<KButton variant="info" @click="modal?.show()">Open</KButton>
|
|
58
|
+
<KModal ref="modal" title="Hello" closable>Content</KModal>
|
|
59
|
+
</template>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`KModal` is opened through the instance it exposes (`show`, `hide`, `toggle`) rather than a
|
|
63
|
+
`v-model`, which keeps it in step with core's own `data-kt-modal-toggle` attribute.
|
|
64
|
+
|
|
65
|
+
Colour-carrying props take Knitify's semantic intents — `caution`, `warning`, `critical`, `info`,
|
|
66
|
+
`discovery`, `affirm` — rather than generic names like `primary`.
|
|
67
|
+
|
|
68
|
+
## What's included
|
|
69
|
+
|
|
70
|
+
47 components covering layout (`KContainer`, `KGrid`, `KWorkspace`), navigation (`KNavbar`,
|
|
71
|
+
`KBreadcrumb`, `KTabs`, `KMenuList`), forms (`KInput`, `KSelect`, `KCheckbox`, `KRadio`,
|
|
72
|
+
`KToggle`, `KCalendar`), overlays (`KModal`, `KDrawer`, `KPopover`, `KTooltip`, `KDropdown`),
|
|
73
|
+
feedback (`KAlert`, `KProgress`, `KNotificationList`), and data display (`KTable`,
|
|
74
|
+
`KCard`, `KAvatar`, `KBadge`, `KAccordion`, `KCollapse`, `KFileTree`, `KChat`).
|
|
75
|
+
|
|
76
|
+
Alongside the components:
|
|
77
|
+
|
|
78
|
+
- `useToast()` — composable for pushing toasts imperatively
|
|
79
|
+
- `v-tooltip` — directive form of `KTooltip` (`v-tooltip:bottom="'Save'"`), registered by the
|
|
80
|
+
plugin and exported as `vTooltip` for local use
|
|
81
|
+
- `accordionGroupKey`, `chatBusyKey` — injection keys for building on the accordion and chat
|
|
82
|
+
primitives
|
|
83
|
+
- Prop and emit types for every component, re-exported from the package root
|
|
84
|
+
|
|
85
|
+
### Chat dock with a backend
|
|
86
|
+
|
|
87
|
+
`KMessenger` wires the chat dock to your API with loader functions; `useChatDock` is the same state without the rendering.
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<script setup lang="ts">
|
|
91
|
+
import type { ChatDockLoaders } from '@knitify/vue'
|
|
92
|
+
|
|
93
|
+
const loaders: ChatDockLoaders = {
|
|
94
|
+
loadConversations: () => api.conversations(),
|
|
95
|
+
loadMessages: (id, cursor) => api.messages(id, cursor),
|
|
96
|
+
sendMessage: (id, text) => api.send(id, text),
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<template>
|
|
101
|
+
<KMessenger :loaders="loaders" />
|
|
102
|
+
</template>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The loaders are read once, when the component mounts — so bind a stable object
|
|
106
|
+
rather than an inline literal, which a re-render would replace to no effect.
|
|
107
|
+
|
|
108
|
+
Note that Vue unwraps refs on an exposed object, so through a template ref `conversations`, `openIds` and `listLoading` read as plain values rather than refs; the store you create yourself with `useChatDock` keeps them as refs.
|
|
109
|
+
|
|
110
|
+
## TypeScript
|
|
111
|
+
|
|
112
|
+
The package is TypeScript-first and ships declarations at `dist/types/index.d.ts`. No
|
|
113
|
+
`@types/*` package is needed.
|