@veritree/ui 0.19.2-2 → 0.19.2-4
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/package.json +2 -2
- package/src/components/Dialog/VTDialog.vue +1 -1
- package/src/components/Dialog/VTDialogClose.vue +9 -9
- package/src/components/Dialog/VTDialogContent.vue +9 -9
- package/src/components/Dialog/VTDialogFooter.vue +5 -5
- package/src/components/Dialog/VTDialogHeader.vue +8 -8
- package/src/components/Dialog/VTDialogMain.vue +8 -8
- package/src/components/Dialog/VTDialogOverlay.vue +7 -7
- package/src/components/Dialog/VTDialogTitle.vue +4 -4
- package/src/components/Drawer/VTDrawer.vue +12 -10
- package/src/components/Drawer/VTDrawerClose.vue +9 -9
- package/src/components/Drawer/VTDrawerContent.vue +8 -8
- package/src/components/Drawer/VTDrawerFooter.vue +3 -3
- package/src/components/Drawer/VTDrawerHeader.vue +4 -4
- package/src/components/Drawer/VTDrawerMain.vue +5 -5
- package/src/components/Drawer/VTDrawerOverlay.vue +6 -6
- package/src/components/Drawer/VTDrawerTitle.vue +5 -5
- package/src/components/DropdownMenu/VTDropdownMenu.vue +3 -3
- package/src/components/DropdownMenu/VTDropdownMenuContent.vue +10 -10
- package/src/components/DropdownMenu/VTDropdownMenuDivider.vue +3 -3
- package/src/components/DropdownMenu/VTDropdownMenuItem.vue +20 -9
- package/src/components/DropdownMenu/VTDropdownMenuTrigger.vue +27 -37
- package/src/components/Listbox/VTListbox.vue +5 -5
- package/src/components/Listbox/VTListboxContent.vue +15 -15
- package/src/components/Listbox/VTListboxItem.vue +13 -13
- package/src/components/Listbox/VTListboxLabel.vue +2 -2
- package/src/components/Listbox/VTListboxList.vue +4 -4
- package/src/components/Listbox/VTListboxSearch.vue +6 -6
- package/src/components/Listbox/VTListboxTrigger.vue +5 -5
- package/src/components/Popover/VTPopover.vue +3 -3
- package/src/components/Popover/VTPopoverContent.vue +13 -13
- package/src/components/Popover/VTPopoverDivider.vue +3 -3
- package/src/components/Popover/VTPopoverItem.vue +8 -4
- package/src/components/Popover/VTPopoverTrigger.vue +21 -16
- package/src/components/Tabs/VTTab.vue +9 -10
- package/src/components/Tabs/VTTabGroup.vue +9 -7
- package/src/components/Tabs/VTTabPanel.vue +3 -4
- package/src/components/Transitions/FadeInOut.vue +2 -2
- package/package-lock.json +0 -13
- package/src/components/Modal/VTModal.vue +0 -69
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
export default {
|
|
19
19
|
name: 'VTPopoverItem',
|
|
20
20
|
|
|
21
|
-
inject: ['
|
|
21
|
+
inject: ['apiPopover'],
|
|
22
22
|
|
|
23
23
|
props: {
|
|
24
24
|
to: {
|
|
@@ -33,15 +33,19 @@ export default {
|
|
|
33
33
|
|
|
34
34
|
computed: {
|
|
35
35
|
dark() {
|
|
36
|
-
return this.
|
|
36
|
+
return this.apiPopover().isDark;
|
|
37
37
|
},
|
|
38
38
|
|
|
39
39
|
headless() {
|
|
40
|
-
return this.
|
|
40
|
+
return this.apiPopover().isHeadless;
|
|
41
41
|
},
|
|
42
42
|
|
|
43
43
|
as() {
|
|
44
|
-
return this.href
|
|
44
|
+
return this.href
|
|
45
|
+
? 'a'
|
|
46
|
+
: this.to
|
|
47
|
+
? resolveComponent('NuxtLink')
|
|
48
|
+
: 'button';
|
|
45
49
|
},
|
|
46
50
|
},
|
|
47
51
|
|
|
@@ -8,32 +8,37 @@
|
|
|
8
8
|
export default {
|
|
9
9
|
name: 'VTPopoverTrigger',
|
|
10
10
|
|
|
11
|
-
inject: ['
|
|
11
|
+
inject: ['apiPopover'],
|
|
12
12
|
|
|
13
13
|
computed: {
|
|
14
14
|
content() {
|
|
15
|
-
return this.
|
|
15
|
+
return this.apiPopover().content;
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
mounted() {
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
20
|
+
this.apiPopover().registerButton(this);
|
|
21
|
+
this.setTrigger();
|
|
22
|
+
this.addTriggerEvents();
|
|
22
23
|
},
|
|
23
24
|
|
|
24
25
|
methods: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
setTrigger() {
|
|
27
|
+
this.trigger = this.$el.querySelector(':first-child');
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
addTriggerEvents() {
|
|
31
|
+
this.trigger.addEventListener('click', (e) => {
|
|
32
|
+
if (this.expanded) {
|
|
33
|
+
this.onClick();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// delay stop propagation to close other visible
|
|
38
|
+
// dropdowns and delay click event to control
|
|
39
|
+
// this dropdown visibility
|
|
40
|
+
setTimeout(() => e.stopImmediatePropagation(), 50);
|
|
41
|
+
setTimeout(() => this.onClick(), 100);
|
|
37
42
|
});
|
|
38
43
|
},
|
|
39
44
|
|
|
@@ -32,7 +32,7 @@ import { keys } from '../../utils/keyboard';
|
|
|
32
32
|
export default {
|
|
33
33
|
name: 'VTTabItem',
|
|
34
34
|
|
|
35
|
-
inject: ['
|
|
35
|
+
inject: ['apiTabs'],
|
|
36
36
|
|
|
37
37
|
props: {
|
|
38
38
|
headless: {
|
|
@@ -43,7 +43,6 @@ export default {
|
|
|
43
43
|
|
|
44
44
|
data() {
|
|
45
45
|
return {
|
|
46
|
-
api: this.api(),
|
|
47
46
|
index: null,
|
|
48
47
|
indexFocus: null,
|
|
49
48
|
selected: false,
|
|
@@ -57,11 +56,11 @@ export default {
|
|
|
57
56
|
},
|
|
58
57
|
|
|
59
58
|
mounted() {
|
|
60
|
-
this.
|
|
59
|
+
this.apiTabs().registerTab(this);
|
|
61
60
|
},
|
|
62
61
|
|
|
63
62
|
beforeDestroy() {
|
|
64
|
-
this.
|
|
63
|
+
this.apiTabs().unregisterTab(this.index);
|
|
65
64
|
},
|
|
66
65
|
|
|
67
66
|
methods: {
|
|
@@ -78,11 +77,11 @@ export default {
|
|
|
78
77
|
},
|
|
79
78
|
|
|
80
79
|
focusFirstTab() {
|
|
81
|
-
this.
|
|
80
|
+
this.apiTabs().focusTab(0);
|
|
82
81
|
},
|
|
83
82
|
|
|
84
83
|
focusLastTab(lastTabIndex) {
|
|
85
|
-
this.
|
|
84
|
+
this.apiTabs().focusTab(lastTabIndex);
|
|
86
85
|
},
|
|
87
86
|
|
|
88
87
|
focusPreviousTab(lastTabIndex) {
|
|
@@ -91,7 +90,7 @@ export default {
|
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
this.
|
|
93
|
+
this.apiTabs().focusTab(this.indexFocus - 1);
|
|
95
94
|
},
|
|
96
95
|
|
|
97
96
|
focusNextTab(lastTabIndex) {
|
|
@@ -100,17 +99,17 @@ export default {
|
|
|
100
99
|
return;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
this.
|
|
102
|
+
this.apiTabs().focusTab(this.indexFocus + 1);
|
|
104
103
|
},
|
|
105
104
|
|
|
106
105
|
onClick() {
|
|
107
|
-
this.
|
|
106
|
+
this.apiTabs().selectTab(this.index);
|
|
108
107
|
this.$emit('change');
|
|
109
108
|
},
|
|
110
109
|
|
|
111
110
|
onKeyDown(event) {
|
|
112
111
|
const key = event.key;
|
|
113
|
-
const lastTabIndex = this.
|
|
112
|
+
const lastTabIndex = this.apiTabs().getTabsLength() - 1;
|
|
114
113
|
|
|
115
114
|
if (this.indexFocus === null) {
|
|
116
115
|
this.indexFocus = this.index;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<style scoped>
|
|
8
|
-
.TabGroup.vertical{
|
|
8
|
+
.TabGroup.vertical {
|
|
9
9
|
display: flex;
|
|
10
10
|
}
|
|
11
|
-
.TabGroup.vertical .TabList{
|
|
11
|
+
.TabGroup.vertical .TabList {
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
}
|
|
@@ -17,15 +17,17 @@
|
|
|
17
17
|
<script>
|
|
18
18
|
export default {
|
|
19
19
|
name: 'VTTabGroup',
|
|
20
|
+
|
|
20
21
|
props: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
vertical: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
25
26
|
},
|
|
27
|
+
|
|
26
28
|
provide() {
|
|
27
29
|
return {
|
|
28
|
-
|
|
30
|
+
apiTabs: () => {
|
|
29
31
|
const registerTab = (tab) => {
|
|
30
32
|
_register(this.tabs, tab);
|
|
31
33
|
if (tab.index === 0) tab.select();
|
|
@@ -14,11 +14,10 @@
|
|
|
14
14
|
export default {
|
|
15
15
|
name: 'VTTabPanel',
|
|
16
16
|
|
|
17
|
-
inject: ['
|
|
17
|
+
inject: ['apiTabs'],
|
|
18
18
|
|
|
19
19
|
data() {
|
|
20
20
|
return {
|
|
21
|
-
api: this.api(),
|
|
22
21
|
index: null,
|
|
23
22
|
visible: false,
|
|
24
23
|
};
|
|
@@ -31,11 +30,11 @@ export default {
|
|
|
31
30
|
},
|
|
32
31
|
|
|
33
32
|
mounted() {
|
|
34
|
-
this.
|
|
33
|
+
this.apiTabs().registerTabPanel(this);
|
|
35
34
|
},
|
|
36
35
|
|
|
37
36
|
beforeDestroy() {
|
|
38
|
-
this.
|
|
37
|
+
this.apiTabs().unregisterTabPanel(this.id);
|
|
39
38
|
},
|
|
40
39
|
|
|
41
40
|
methods: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<transition
|
|
3
3
|
enter-active-class="duration-300 ease-out"
|
|
4
|
-
enter-class="transform opacity-0"
|
|
4
|
+
enter-from-class="transform opacity-0"
|
|
5
5
|
enter-to-class="opacity-100"
|
|
6
6
|
leave-active-class="duration-300 ease-in"
|
|
7
|
-
leave-class="opacity-100"
|
|
7
|
+
leave-from-class="opacity-100"
|
|
8
8
|
leave-to-class="transform opacity-0"
|
|
9
9
|
@after-enter="afterEnter"
|
|
10
10
|
@after-leave="afterLeave"
|
package/package-lock.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@veritree/ui",
|
|
3
|
-
"version": "0.1.9",
|
|
4
|
-
"lockfileVersion": 1,
|
|
5
|
-
"requires": true,
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@veritree/icons": {
|
|
8
|
-
"version": "0.12.0",
|
|
9
|
-
"resolved": "https://registry.npmjs.org/@veritree/icons/-/icons-0.12.0.tgz",
|
|
10
|
-
"integrity": "sha512-vunUKzvS9neslSf3R3y6RYQrcfRpxmp8PnhWWe2peYiyElLIJcb7zAsfCZ+I0Fg5PQ6GZG6StqWy0WF7MJ7VOg=="
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition
|
|
3
|
-
enter-active-class="duration-300 ease-out"
|
|
4
|
-
enter-class="transform opacity-0"
|
|
5
|
-
enter-to-class="opacity-100"
|
|
6
|
-
leave-active-class="duration-300 ease-in"
|
|
7
|
-
leave-class="opacity-100"
|
|
8
|
-
leave-to-class="transform opacity-0"
|
|
9
|
-
@after-enter="afterEnter"
|
|
10
|
-
@after-leave="afterLeave"
|
|
11
|
-
>
|
|
12
|
-
<div
|
|
13
|
-
v-if="visible"
|
|
14
|
-
class="fixed inset-0 z-50 flex flex-col justify-center bg-fd-700/75"
|
|
15
|
-
tabindex="-1"
|
|
16
|
-
@keyup.esc="close"
|
|
17
|
-
@click="close"
|
|
18
|
-
>
|
|
19
|
-
<div
|
|
20
|
-
class="relative mx-auto flex max-w-lg flex-col justify-center rounded bg-white"
|
|
21
|
-
@click.stop
|
|
22
|
-
>
|
|
23
|
-
<div class="absolute right-4 top-4">
|
|
24
|
-
<VTButton variant="icon" @click.prevent="close"
|
|
25
|
-
><IconClose class="h-4 w-4"
|
|
26
|
-
/></VTButton>
|
|
27
|
-
</div>
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</transition>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import { IconClose } from '@veritree/icons';
|
|
36
|
-
import VTButton from '../Button/VTButton.vue';
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
name: 'VTModal',
|
|
40
|
-
|
|
41
|
-
components: { IconClose, VTButton },
|
|
42
|
-
|
|
43
|
-
model: {
|
|
44
|
-
prop: 'visible',
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
props: {
|
|
48
|
-
visible: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
methods: {
|
|
55
|
-
close() {
|
|
56
|
-
this.$emit('input', false);
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
afterEnter() {
|
|
60
|
-
this.$emit('shown');
|
|
61
|
-
this.$nextTick(() => this.$el.focus());
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
afterLeave() {
|
|
65
|
-
this.$emit('hidden');
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
</script>
|