daisy-ui-kit 2.1.8 → 2.1.10
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/Accordion.vue +17 -4
- package/components/Code.vue +1 -1
- package/components/Dropdown.vue +17 -5
- package/components/Modal.vue +16 -4
- package/package.json +1 -1
package/components/Accordion.vue
CHANGED
|
@@ -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
|
|
5
|
-
|
|
6
|
-
|
|
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)
|
package/components/Code.vue
CHANGED
package/components/Dropdown.vue
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, watch } from 'vue'
|
|
2
|
+
import { computed, onMounted, 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
|
|
27
|
-
|
|
28
|
-
|
|
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(() => {
|
package/components/Modal.vue
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|