daisy-ui-kit 1.0.5 → 1.0.7
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/components/Drawer.vue
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { inject } from 'vue'
|
|
3
|
+
import { drawerStateKey } from './drawer-utils'
|
|
3
4
|
|
|
4
5
|
interface DrawerState {
|
|
5
6
|
isDrawerOpen: boolean
|
|
6
|
-
openDrawer:
|
|
7
|
-
closeDrawer:
|
|
8
|
-
toggleDrawer:
|
|
7
|
+
openDrawer: () => void
|
|
8
|
+
closeDrawer: () => void
|
|
9
|
+
toggleDrawer: () => void
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
const drawerState: DrawerState | undefined = inject(
|
|
12
|
+
const drawerState: DrawerState | undefined = inject(drawerStateKey)
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
15
|
<template>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, provide, reactive } from 'vue'
|
|
3
|
+
import { drawerStateKey } from './drawer-utils'
|
|
3
4
|
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
right: Boolean,
|
|
@@ -17,7 +18,8 @@ const drawerState = reactive({
|
|
|
17
18
|
drawerState.isDrawerOpen = !drawerState.isDrawerOpen
|
|
18
19
|
},
|
|
19
20
|
})
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
provide(drawerStateKey, drawerState)
|
|
21
23
|
|
|
22
24
|
const classes = computed(() => {
|
|
23
25
|
return {
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { inject } from 'vue'
|
|
3
|
+
import { drawerStateKey } from './drawer-utils'
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
interface DrawerState {
|
|
6
|
+
isDrawerOpen: boolean
|
|
7
|
+
openDrawer: () => void
|
|
8
|
+
closeDrawer: () => void
|
|
9
|
+
toggleDrawer: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const drawerState: DrawerState | undefined = inject(drawerStateKey)
|
|
5
13
|
</script>
|
|
6
14
|
|
|
7
15
|
<template>
|
package/components/TextInput.vue
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue'
|
|
2
|
+
|
|
3
|
+
export interface DrawerState {
|
|
4
|
+
isDrawerOpen: boolean
|
|
5
|
+
openDrawer: () => void
|
|
6
|
+
closeDrawer: () => void
|
|
7
|
+
toggleDrawer: () => void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const drawerStateKey = Symbol('drawerState') as InjectionKey<DrawerState>
|