@veritree/ui 0.57.0 → 0.58.0
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 +1 -1
- package/src/components/Drawer/VTDrawer.vue +1 -1
- package/src/components/Drawer/VTDrawerClose.vue +7 -7
- package/src/components/Drawer/VTDrawerContent.vue +18 -11
- package/src/components/Drawer/VTDrawerDivider.vue +16 -0
- package/src/components/Drawer/VTDrawerFooter.vue +5 -11
- package/src/components/Drawer/VTDrawerHeader.vue +8 -12
- package/src/components/Drawer/VTDrawerMain.vue +11 -12
- package/src/components/Drawer/VTDrawerOverlay.vue +8 -8
- package/src/components/Drawer/VTDrawerTitle.vue +6 -6
- package/src/components/Listbox/VTListbox.vue +7 -3
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<VTButton
|
|
3
3
|
variant="icon"
|
|
4
4
|
:class="{
|
|
5
|
-
'
|
|
6
|
-
'ml-auto -
|
|
5
|
+
'drawer-close': headless,
|
|
6
|
+
'-mr-2 ml-auto shrink-0 text-inherit': !headless,
|
|
7
7
|
}"
|
|
8
8
|
:theme="theme"
|
|
9
9
|
@click.prevent="hide"
|
|
@@ -20,19 +20,19 @@ export default {
|
|
|
20
20
|
|
|
21
21
|
components: { IconLeft, VTButton },
|
|
22
22
|
|
|
23
|
-
inject: ['
|
|
23
|
+
inject: ['apiDrawer'],
|
|
24
24
|
|
|
25
25
|
computed: {
|
|
26
26
|
dark() {
|
|
27
|
-
return this.
|
|
27
|
+
return this.apiDrawer().isDark;
|
|
28
28
|
},
|
|
29
29
|
|
|
30
30
|
headless() {
|
|
31
|
-
return this.
|
|
31
|
+
return this.apiDrawer().isHeadless;
|
|
32
32
|
},
|
|
33
33
|
|
|
34
34
|
right() {
|
|
35
|
-
return this.
|
|
35
|
+
return this.apiDrawer().isRight;
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
// temporary till button theme is implemented
|
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
|
|
44
44
|
methods: {
|
|
45
45
|
hide() {
|
|
46
|
-
this.
|
|
46
|
+
this.apiDrawer().hide();
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
};
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<div
|
|
12
12
|
v-show="visible"
|
|
13
13
|
:class="{
|
|
14
|
-
'
|
|
15
|
-
'fixed z-20 flex h-screen max-h-full max-w-full flex-col overflow-auto
|
|
14
|
+
'drawer-content': headless,
|
|
15
|
+
'fixed z-20 flex h-screen max-h-full max-w-full flex-col overflow-auto outline-0':
|
|
16
16
|
!headless,
|
|
17
17
|
'bg-white text-gray-600': !dark,
|
|
18
18
|
'bg-fd-600': dark,
|
|
@@ -33,7 +33,14 @@
|
|
|
33
33
|
export default {
|
|
34
34
|
name: 'VTDrawerContent',
|
|
35
35
|
|
|
36
|
-
inject: ['
|
|
36
|
+
inject: ['apiDrawer'],
|
|
37
|
+
|
|
38
|
+
props: {
|
|
39
|
+
headless: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
37
44
|
|
|
38
45
|
data() {
|
|
39
46
|
return {
|
|
@@ -43,15 +50,11 @@ export default {
|
|
|
43
50
|
|
|
44
51
|
computed: {
|
|
45
52
|
dark() {
|
|
46
|
-
return this.
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
headless() {
|
|
50
|
-
return this.api().isHeadless;
|
|
53
|
+
return this.apiDrawer().isDark;
|
|
51
54
|
},
|
|
52
55
|
|
|
53
56
|
position() {
|
|
54
|
-
return this.
|
|
57
|
+
return this.apiDrawer().position;
|
|
55
58
|
},
|
|
56
59
|
|
|
57
60
|
activeClass() {
|
|
@@ -73,6 +76,7 @@ export default {
|
|
|
73
76
|
default:
|
|
74
77
|
translateClass = '-translate-x-full';
|
|
75
78
|
}
|
|
79
|
+
|
|
76
80
|
return `opacity-0 ${translateClass}`;
|
|
77
81
|
},
|
|
78
82
|
|
|
@@ -91,6 +95,7 @@ export default {
|
|
|
91
95
|
default:
|
|
92
96
|
translateClass = 'translate-x-0';
|
|
93
97
|
}
|
|
98
|
+
|
|
94
99
|
return `opacity-100 ${translateClass}`;
|
|
95
100
|
},
|
|
96
101
|
|
|
@@ -109,6 +114,7 @@ export default {
|
|
|
109
114
|
default:
|
|
110
115
|
translateClass = 'translate-x-0';
|
|
111
116
|
}
|
|
117
|
+
|
|
112
118
|
return `opacity-100 ${translateClass}`;
|
|
113
119
|
},
|
|
114
120
|
|
|
@@ -127,12 +133,13 @@ export default {
|
|
|
127
133
|
default:
|
|
128
134
|
translateClass = '-translate-x-full';
|
|
129
135
|
}
|
|
136
|
+
|
|
130
137
|
return `opacity-0 ${translateClass}`;
|
|
131
138
|
},
|
|
132
139
|
},
|
|
133
140
|
|
|
134
141
|
mounted() {
|
|
135
|
-
this.
|
|
142
|
+
this.apiDrawer().registerContent(this);
|
|
136
143
|
this.show();
|
|
137
144
|
|
|
138
145
|
this.$nextTick(() => this.$el.focus());
|
|
@@ -148,7 +155,7 @@ export default {
|
|
|
148
155
|
},
|
|
149
156
|
|
|
150
157
|
hideDrawer() {
|
|
151
|
-
this.
|
|
158
|
+
this.apiDrawer().emit();
|
|
152
159
|
},
|
|
153
160
|
},
|
|
154
161
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="[headless ? 'drawer-divider' : 'h-[1px] bg-gray-200']" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
name: 'VTDrawerDivider',
|
|
8
|
+
|
|
9
|
+
props: {
|
|
10
|
+
headless: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="as" :class="
|
|
2
|
+
<component :is="as" :class="[headless ? 'dialog-footer' : 'px-5 py-4']">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</component>
|
|
5
5
|
</template>
|
|
@@ -8,22 +8,16 @@
|
|
|
8
8
|
export default {
|
|
9
9
|
name: 'VTDrawerFooter',
|
|
10
10
|
|
|
11
|
-
inject: ['
|
|
11
|
+
inject: ['apiDrawer'],
|
|
12
12
|
|
|
13
13
|
props: {
|
|
14
14
|
as: {
|
|
15
15
|
type: String,
|
|
16
16
|
default: 'footer',
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
dark() {
|
|
22
|
-
return this.api().isDark;
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
headless() {
|
|
26
|
-
return this.api().isHeadless;
|
|
18
|
+
headless: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
27
21
|
},
|
|
28
22
|
},
|
|
29
23
|
};
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
:is="as"
|
|
4
4
|
:id="id"
|
|
5
5
|
:class="{
|
|
6
|
-
'
|
|
7
|
-
'
|
|
6
|
+
'drawer-header': headless,
|
|
7
|
+
'flex items-center justify-between gap-3 px-5 py-4': !headless,
|
|
8
8
|
}"
|
|
9
9
|
>
|
|
10
10
|
<slot></slot>
|
|
@@ -15,26 +15,22 @@
|
|
|
15
15
|
export default {
|
|
16
16
|
name: 'VTDrawerHeader',
|
|
17
17
|
|
|
18
|
-
inject: ['
|
|
18
|
+
inject: ['apiDrawer'],
|
|
19
19
|
|
|
20
20
|
props: {
|
|
21
21
|
as: {
|
|
22
22
|
type: String,
|
|
23
23
|
default: 'header',
|
|
24
24
|
},
|
|
25
|
+
headless: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
25
29
|
},
|
|
26
30
|
|
|
27
31
|
computed: {
|
|
28
|
-
dark() {
|
|
29
|
-
return this.api().isDark;
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
headless() {
|
|
33
|
-
return this.api().isHeadless;
|
|
34
|
-
},
|
|
35
|
-
|
|
36
32
|
id() {
|
|
37
|
-
return `${this.
|
|
33
|
+
return `${this.apiDrawer().id}-header`;
|
|
38
34
|
},
|
|
39
35
|
},
|
|
40
36
|
};
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<component
|
|
3
3
|
:is="as"
|
|
4
4
|
:id="id"
|
|
5
|
-
:class="{
|
|
5
|
+
:class="{
|
|
6
|
+
'drawer-body': headless,
|
|
7
|
+
'grow overflow-hidden overflow-y-auto px-5 py-6': !headless,
|
|
8
|
+
}"
|
|
6
9
|
>
|
|
7
10
|
<slot></slot>
|
|
8
11
|
</component>
|
|
@@ -12,26 +15,22 @@
|
|
|
12
15
|
export default {
|
|
13
16
|
name: 'VTDrawerMain',
|
|
14
17
|
|
|
15
|
-
inject: ['
|
|
18
|
+
inject: ['apiDrawer'],
|
|
16
19
|
|
|
17
20
|
props: {
|
|
18
21
|
as: {
|
|
19
22
|
type: String,
|
|
20
23
|
default: 'main',
|
|
21
24
|
},
|
|
25
|
+
headless: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
22
29
|
},
|
|
23
30
|
|
|
24
31
|
computed: {
|
|
25
|
-
dark() {
|
|
26
|
-
return this.api().isDark;
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
headless() {
|
|
30
|
-
return this.api().isHeadless;
|
|
31
|
-
},
|
|
32
|
-
|
|
33
32
|
id() {
|
|
34
|
-
return `${this.
|
|
33
|
+
return `${this.apiDrawer().id}-desc`;
|
|
35
34
|
},
|
|
36
35
|
},
|
|
37
36
|
|
|
@@ -42,7 +41,7 @@ export default {
|
|
|
42
41
|
methods: {
|
|
43
42
|
// In here because if there is no body, the dialog will not be described by
|
|
44
43
|
setDialogDescribedby() {
|
|
45
|
-
const dialog = document.getElementById(this.
|
|
44
|
+
const dialog = document.getElementById(this.apiDrawer().id);
|
|
46
45
|
|
|
47
46
|
if (dialog) {
|
|
48
47
|
dialog.setAttribute('aria-describedby', this.id);
|
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
v-if="visible"
|
|
5
5
|
:id="id"
|
|
6
6
|
:class="{
|
|
7
|
-
'
|
|
8
|
-
'fixed inset-0 z-10
|
|
7
|
+
'drawer-overlay': headless,
|
|
8
|
+
'bg-fd-450/80 fixed inset-0 z-10': !headless,
|
|
9
9
|
}"
|
|
10
10
|
></div>
|
|
11
11
|
</FadeInOut>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script>
|
|
15
|
-
import FadeInOut from
|
|
15
|
+
import FadeInOut from '../Transitions/FadeInOut.vue';
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
18
|
components: {
|
|
19
19
|
FadeInOut,
|
|
20
20
|
},
|
|
21
21
|
|
|
22
|
-
inject: [
|
|
22
|
+
inject: ['apiDrawer'],
|
|
23
23
|
|
|
24
24
|
data() {
|
|
25
25
|
return {
|
|
@@ -29,21 +29,21 @@ export default {
|
|
|
29
29
|
|
|
30
30
|
computed: {
|
|
31
31
|
dark() {
|
|
32
|
-
return this.
|
|
32
|
+
return this.apiDrawer().isDark;
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
headless() {
|
|
36
|
-
return this.
|
|
36
|
+
return this.apiDrawer().isHeadless;
|
|
37
37
|
},
|
|
38
38
|
|
|
39
39
|
id() {
|
|
40
|
-
return `${this.
|
|
40
|
+
return `${this.apiDrawer().id}-overlay`;
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
|
|
44
44
|
mounted() {
|
|
45
45
|
this.visible = true;
|
|
46
|
-
this.
|
|
46
|
+
this.apiDrawer().registerOverlay(this);
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
methods: {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:is="as"
|
|
4
4
|
:id="id"
|
|
5
5
|
:class="{
|
|
6
|
-
'
|
|
6
|
+
'drawer-title': headless,
|
|
7
7
|
'text-2xl font-semibold': !headless,
|
|
8
8
|
}"
|
|
9
9
|
>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export default {
|
|
16
16
|
name: 'VTDrawerTitle',
|
|
17
17
|
|
|
18
|
-
inject: ['
|
|
18
|
+
inject: ['apiDrawer'],
|
|
19
19
|
|
|
20
20
|
props: {
|
|
21
21
|
as: {
|
|
@@ -26,15 +26,15 @@ export default {
|
|
|
26
26
|
|
|
27
27
|
computed: {
|
|
28
28
|
dark() {
|
|
29
|
-
return this.
|
|
29
|
+
return this.apiDrawer().isDark;
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
headless() {
|
|
33
|
-
return this.
|
|
33
|
+
return this.apiDrawer().isHeadless;
|
|
34
34
|
},
|
|
35
35
|
|
|
36
36
|
id() {
|
|
37
|
-
return `${this.
|
|
37
|
+
return `${this.apiDrawer().id}-title`;
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
methods: {
|
|
46
46
|
// In here because if there is no header, the dialog will not be labelled by
|
|
47
47
|
setDialogLabelledby() {
|
|
48
|
-
const dialog = document.getElementById(this.
|
|
48
|
+
const dialog = document.getElementById(this.apiDrawer().id);
|
|
49
49
|
|
|
50
50
|
if (dialog) {
|
|
51
51
|
dialog.setAttribute('aria-labelledby', this.id);
|
|
@@ -83,9 +83,13 @@ export default {
|
|
|
83
83
|
* is also only used when the prop multiple is true.
|
|
84
84
|
*/
|
|
85
85
|
const removeValueFromValueComputed = (value) => {
|
|
86
|
-
this.valueComputed = this.valueComputed.filter(
|
|
87
|
-
(valueComputed
|
|
88
|
-
|
|
86
|
+
this.valueComputed = this.valueComputed.filter((valueComputed) => {
|
|
87
|
+
if (typeof valueComputed === 'object') {
|
|
88
|
+
return JSON.stringify(valueComputed) !== JSON.stringify(value);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return valueComputed !== value;
|
|
92
|
+
});
|
|
89
93
|
};
|
|
90
94
|
|
|
91
95
|
return {
|