@dolanske/vui 0.3.1 → 0.3.2
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/dist/style.css +1 -1
- package/dist/vui.js +1083 -1079
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.vue +7 -5
- package/src/components/CopyClipboard/CopyClipboard.vue +2 -2
- package/src/components/Dropdown/Dropdown.vue +1 -1
- package/src/components/Input/Dropzone.vue +8 -6
- package/src/components/Table/Cell.vue +1 -1
- package/src/components/Tabs/Tabs.vue +5 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { Icon } from '@iconify/vue'
|
|
3
3
|
import { useResizeObserver } from '@vueuse/core'
|
|
4
|
-
import { ref, useTemplateRef, watch, watchEffect } from 'vue'
|
|
4
|
+
import { onMounted, ref, useTemplateRef, watch, watchEffect } from 'vue'
|
|
5
5
|
import './accordion.scss'
|
|
6
6
|
|
|
7
7
|
export interface AccordionProps {
|
|
@@ -58,10 +58,12 @@ defineExpose({
|
|
|
58
58
|
isOpen,
|
|
59
59
|
})
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
contentMaxHeight.value
|
|
64
|
-
|
|
61
|
+
onMounted(() => {
|
|
62
|
+
useResizeObserver(contentRef, ([entry]) => {
|
|
63
|
+
if (isOpen.value && contentMaxHeight.value !== entry.contentRect.height) {
|
|
64
|
+
contentMaxHeight.value = entry.contentRect.height || 0
|
|
65
|
+
}
|
|
66
|
+
})
|
|
65
67
|
})
|
|
66
68
|
</script>
|
|
67
69
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { autoUpdate, flip, offset, shift, useFloating } from '@floating-ui/vue'
|
|
3
3
|
import { Icon } from '@iconify/vue'
|
|
4
4
|
import { useClipboard } from '@vueuse/core'
|
|
5
|
-
import {
|
|
5
|
+
import { onMounted, useSlots, useTemplateRef } from 'vue'
|
|
6
6
|
import Flex from '../Flex/Flex.vue'
|
|
7
7
|
import './copy-clipboard.scss'
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ const {
|
|
|
36
36
|
})
|
|
37
37
|
const slots = useSlots()
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
onMounted(() => {
|
|
40
40
|
if (!isSupported.value) {
|
|
41
41
|
console.error('Clipboard API is not supported. This component will not work')
|
|
42
42
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { InputProps } from './Input.vue'
|
|
3
3
|
import { Icon } from '@iconify/vue'
|
|
4
4
|
import { useEventListener } from '@vueuse/core'
|
|
5
|
-
import { ref, useTemplateRef } from 'vue'
|
|
5
|
+
import { onMounted, ref, useTemplateRef } from 'vue'
|
|
6
6
|
import Flex from '../Flex/Flex.vue'
|
|
7
7
|
import Input from './Input.vue'
|
|
8
8
|
|
|
@@ -25,11 +25,13 @@ function onSubmitHandler(e: any, isFromField?: boolean) {
|
|
|
25
25
|
|
|
26
26
|
const dropzoneRef = useTemplateRef<HTMLDivElement>('dropzone')
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
useEventListener(dropzoneRef, '
|
|
30
|
-
useEventListener(dropzoneRef, '
|
|
31
|
-
useEventListener(dropzoneRef, '
|
|
32
|
-
useEventListener(dropzoneRef, '
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
useEventListener(dropzoneRef, 'dragenter', onSubmitHandler, false)
|
|
30
|
+
useEventListener(dropzoneRef, 'dragleave', onSubmitHandler, false)
|
|
31
|
+
useEventListener(dropzoneRef, 'dragover', onSubmitHandler, false)
|
|
32
|
+
useEventListener(dropzoneRef, 'drop', onSubmitHandler, false)
|
|
33
|
+
useEventListener(dropzoneRef, 'input', e => onSubmitHandler(e, true), false)
|
|
34
|
+
})
|
|
33
35
|
</script>
|
|
34
36
|
|
|
35
37
|
<template>
|
|
@@ -4,7 +4,7 @@ import { computed, useSlots, useTemplateRef } from 'vue'
|
|
|
4
4
|
const slots = useSlots()
|
|
5
5
|
const contextRef = useTemplateRef<HTMLTableCellElement>('context')
|
|
6
6
|
const computedStyle = computed(() => {
|
|
7
|
-
if (!slots.context)
|
|
7
|
+
if (!slots.context || !window)
|
|
8
8
|
return {}
|
|
9
9
|
const width = contextRef.value?.getBoundingClientRect().width ?? 0
|
|
10
10
|
return {
|
|
@@ -27,6 +27,9 @@ const underlineRef = useTemplateRef('underline')
|
|
|
27
27
|
const tabsRef = useTemplateRef('tabs')
|
|
28
28
|
|
|
29
29
|
function computeUnderlinePosition() {
|
|
30
|
+
if (!window)
|
|
31
|
+
return
|
|
32
|
+
|
|
30
33
|
if (tabsRef.value && underlineRef.value) {
|
|
31
34
|
const activeBounds = tabsRef.value.querySelector('.vui-tab.active')?.getBoundingClientRect()
|
|
32
35
|
const parentBounds = tabsRef.value.getBoundingClientRect()
|
|
@@ -39,6 +42,8 @@ function computeUnderlinePosition() {
|
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
onMounted(() => {
|
|
45
|
+
useEventListener(window, 'resize', computeUnderlinePosition)
|
|
46
|
+
|
|
42
47
|
watch(
|
|
43
48
|
[active, () => expand],
|
|
44
49
|
computeUnderlinePosition,
|
|
@@ -48,8 +53,6 @@ onMounted(() => {
|
|
|
48
53
|
},
|
|
49
54
|
)
|
|
50
55
|
})
|
|
51
|
-
|
|
52
|
-
useEventListener(window, 'resize', computeUnderlinePosition)
|
|
53
56
|
</script>
|
|
54
57
|
|
|
55
58
|
<template>
|