daisy-ui-kit 2.1.7 → 2.1.9

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.
@@ -1,9 +1,22 @@
1
1
  <script setup lang="ts">
2
- import { provide } from 'vue'
2
+ import { computed, provide, ref } from 'vue'
3
3
 
4
- const value = defineModel({
5
- required: true,
6
- local: true,
4
+ const props = defineProps<{
5
+ modelValue?: boolean
6
+ }>()
7
+ const emit = defineEmits(['update:modelValue'])
8
+
9
+ const _value = ref(props.modelValue)
10
+ watch(() => props.modelValue, (val) => {
11
+ _value.value = val
12
+ })
13
+ const value = computed({
14
+ get: () => _value.value,
15
+ set: (val) => {
16
+ _value.value = val
17
+ if (props.modelValue !== val)
18
+ emit('update:modelValue', val)
19
+ },
7
20
  })
8
21
 
9
22
  provide('accordion-value', value)
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { createDrawerState } from '../utils/drawer-utils'
3
+
2
4
  const props = withDefaults(defineProps<{
3
5
  name?: string
4
6
  }>(), {
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { createDrawerState } from '../utils/drawer-utils'
3
+
2
4
  const props = withDefaults(defineProps<{
3
5
  name?: string
4
6
  }>(), {
@@ -1,8 +1,10 @@
1
1
  <script setup lang="ts">
2
- import { computed, watch } from 'vue'
2
+ import { computed, ref, watch } from 'vue'
3
3
  import { onClickOutside, syncRefs, useElementHover } from '@vueuse/core'
4
4
 
5
5
  const props = withDefaults(defineProps<{
6
+ open?: boolean
7
+
6
8
  position?: string
7
9
  top?: boolean
8
10
  bottom?: boolean
@@ -13,7 +15,6 @@ const props = withDefaults(defineProps<{
13
15
  hover?: boolean
14
16
  delayEnter?: number
15
17
  delayLeave?: number
16
- open?: boolean
17
18
  closeOnClickOutside?: boolean
18
19
  }>(), {
19
20
  position: 'bottom',
@@ -23,9 +24,20 @@ const props = withDefaults(defineProps<{
23
24
  delayLeave: 300,
24
25
  closeOnClickOutside: false,
25
26
  })
26
- const isOpen = defineModel<boolean>('open', {
27
- local: true,
28
- default: false,
27
+ const emit = defineEmits(['update:open'])
28
+
29
+ // defineModel 'open'
30
+ const _isOpen = ref(props.open)
31
+ watch(() => props.open, (val) => {
32
+ _isOpen.value = val
33
+ })
34
+ const isOpen = computed({
35
+ get: () => _isOpen.value,
36
+ set: (val) => {
37
+ _isOpen.value = val
38
+ if (props.open !== val)
39
+ emit('update:open', val)
40
+ },
29
41
  })
30
42
 
31
43
  const classes = computed(() => {
@@ -1,18 +1,30 @@
1
1
  <script setup lang="ts">
2
+ import { computed, ref, watch } from 'vue'
3
+
2
4
  const props = defineProps<{
3
5
  modelValue?: boolean
4
6
  closeOnClickOutside?: boolean
5
7
  top?: boolean
6
8
  bottom?: boolean
7
9
  }>()
10
+ const emit = defineEmits(['update:modelValue'])
8
11
 
9
12
  const is = 'div'
10
13
 
11
- const isOpen = defineModel({
12
- default: false,
13
- local: true,
14
- type: Boolean,
14
+ // defineModel 'open'
15
+ const _isOpen = ref(props.modelValue)
16
+ watch(() => props.modelValue, (val) => {
17
+ _isOpen.value = val
18
+ })
19
+ const isOpen = computed({
20
+ get: () => _isOpen.value,
21
+ set: (val) => {
22
+ _isOpen.value = val
23
+ if (props.modelValue !== val)
24
+ emit('update:modelValue', val)
25
+ },
15
26
  })
27
+
16
28
  function handleClick() {
17
29
  if (props.closeOnClickOutside)
18
30
  isOpen.value = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daisy-ui-kit",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "nuxi build",