@veritree/ui 0.22.2 → 0.22.3-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/index.js +64 -72
- package/mixins/floating-ui-content.js +1 -22
- package/mixins/floating-ui-item.js +101 -51
- package/mixins/floating-ui.js +7 -9
- package/mixins/form-control-icon.js +5 -5
- package/mixins/form-control.js +17 -18
- package/nuxt.js +30 -23
- package/package.json +14 -6
- package/src/components/Alert/VTAlert.vue +55 -14
- package/src/components/Button/VTButton.vue +20 -12
- package/src/components/Checkbox/VTCheckbox.vue +134 -0
- package/src/components/Checkbox/VTCheckboxLabel.vue +3 -0
- package/src/components/Checkbox/VTCheckboxText.vue +20 -0
- package/src/components/Dialog/VTDialog.vue +22 -32
- package/src/components/Dialog/VTDialogClose.vue +19 -25
- package/src/components/Dialog/VTDialogContent.vue +24 -19
- package/src/components/Dialog/VTDialogFooter.vue +11 -16
- package/src/components/Dialog/VTDialogHeader.vue +16 -18
- package/src/components/Dialog/VTDialogMain.vue +11 -18
- package/src/components/Dialog/VTDialogOverlay.vue +14 -18
- package/src/components/Dialog/VTDialogTitle.vue +10 -7
- package/src/components/Disclosure/VTDisclosureContent.vue +1 -1
- package/src/components/Disclosure/VTDisclosureDetails.vue +1 -1
- package/src/components/Disclosure/VTDisclosureHeader.vue +2 -2
- package/src/components/Disclosure/VTDisclosureIcon.vue +1 -1
- package/src/components/Drawer/VTDrawer.vue +6 -15
- package/src/components/Drawer/VTDrawerClose.vue +5 -5
- package/src/components/Drawer/VTDrawerContent.vue +9 -9
- 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 +19 -6
- package/src/components/DropdownMenu/VTDropdownMenuContent.vue +14 -6
- package/src/components/DropdownMenu/VTDropdownMenuDivider.vue +7 -16
- package/src/components/DropdownMenu/VTDropdownMenuItem.vue +7 -3
- package/src/components/DropdownMenu/VTDropdownMenuLabel.vue +1 -10
- package/src/components/DropdownMenu/VTDropdownMenuTrigger.vue +2 -4
- package/src/components/Form/VTFormFeedback.vue +11 -5
- package/src/components/Form/VTFormGroup.vue +5 -7
- package/src/components/Form/VTFormLabel.vue +22 -0
- package/src/components/Form/VTFormRow.vue +5 -0
- package/src/components/Form/VTInput.vue +7 -7
- package/src/components/Form/VTInputIcon.vue +1 -2
- package/src/components/Form/VTInputPassword.vue +14 -5
- package/src/components/Form/VTTextarea.vue +1 -1
- package/src/components/Image/VTImage.vue +33 -4
- package/src/components/Listbox/VTListbox.vue +105 -14
- package/src/components/Listbox/VTListboxContent.vue +3 -7
- package/src/components/Listbox/VTListboxItem.vue +127 -6
- package/src/components/Listbox/VTListboxLabel.vue +3 -4
- package/src/components/Listbox/VTListboxList.vue +3 -24
- package/src/components/Listbox/VTListboxSearch.vue +64 -55
- package/src/components/Listbox/VTListboxTrigger.vue +9 -4
- package/src/components/Popover/VTPopover.vue +19 -0
- package/src/components/Popover/VTPopoverItem.vue +6 -2
- package/src/components/ProgressBar/VTProgressBar.vue +21 -3
- package/src/components/Skeleton/VTSkeleton.vue +11 -0
- package/src/components/Skeleton/VTSkeletonItem.vue +9 -0
- package/src/components/Tabs/VTTab.vue +6 -5
- package/src/components/Tabs/VTTabGroup.vue +9 -7
- package/src/components/Tabs/VTTabPanel.vue +4 -5
- package/src/components/Tooltip/VTTooltip.vue +65 -0
- package/src/components/Tooltip/VTTooltipContent.vue +59 -0
- package/src/components/Tooltip/VTTooltipTrigger.vue +98 -0
- package/src/components/Transitions/FadeInOut.vue +2 -2
- package/src/components/Utils/FloatingUi.vue +56 -24
- package/src/utils/components.js +18 -0
- package/src/components/Input/VTInput.vue +0 -82
- package/src/components/Input/VTInputDate.vue +0 -36
- package/src/components/Input/VTInputFile.vue +0 -60
- package/src/components/Input/VTInputUpload.vue +0 -54
- package/src/components/Modal/VTModal.vue +0 -69
- package/src/utils/genId.js +0 -13
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<transition
|
|
3
3
|
enter-active-class="duration-300 ease-out"
|
|
4
|
-
enter-class="translate-y-[50px] opacity-0"
|
|
4
|
+
enter-from-class="translate-y-[50px] opacity-0"
|
|
5
5
|
enter-to-class="translate-y-0 opacity-100"
|
|
6
6
|
leave-active-class="duration-300 ease-out"
|
|
7
|
-
leave-class="translate-y-0 opacity-100"
|
|
7
|
+
leave-from-class="translate-y-0 opacity-100"
|
|
8
8
|
leave-to-class="translate-y-[50px] opacity-0"
|
|
9
9
|
@after-leave="hideDialog"
|
|
10
10
|
>
|
|
11
11
|
<div
|
|
12
12
|
v-show="visible"
|
|
13
13
|
:id="id"
|
|
14
|
-
:class="
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'bg-fd-600': dark,
|
|
20
|
-
}"
|
|
14
|
+
:class="
|
|
15
|
+
headless
|
|
16
|
+
? 'dialog-content'
|
|
17
|
+
: `relative m-auto flex flex-col overflow-auto rounded bg-white p-4 focus:outline-none lg:p-6 ${classes}`
|
|
18
|
+
"
|
|
21
19
|
tabindex="-1"
|
|
22
|
-
@
|
|
20
|
+
@keydown.esc.stop="hide"
|
|
23
21
|
>
|
|
24
22
|
<slot></slot>
|
|
25
23
|
</div>
|
|
@@ -28,9 +26,16 @@
|
|
|
28
26
|
|
|
29
27
|
<script>
|
|
30
28
|
export default {
|
|
31
|
-
name:
|
|
29
|
+
name: 'VTDialogContent',
|
|
32
30
|
|
|
33
|
-
inject: [
|
|
31
|
+
inject: ['apiDialog'],
|
|
32
|
+
|
|
33
|
+
props: {
|
|
34
|
+
headless: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
34
39
|
|
|
35
40
|
data() {
|
|
36
41
|
return {
|
|
@@ -40,20 +45,20 @@ export default {
|
|
|
40
45
|
|
|
41
46
|
computed: {
|
|
42
47
|
id() {
|
|
43
|
-
return `dialog-content-${this.
|
|
48
|
+
return `dialog-content-${this.apiDialog().componentId}`;
|
|
44
49
|
},
|
|
45
50
|
|
|
46
|
-
|
|
47
|
-
return this.
|
|
51
|
+
classes() {
|
|
52
|
+
return this.full ? 'h-screen w-screen' : 'max-h-full max-w-full';
|
|
48
53
|
},
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
return this.
|
|
55
|
+
full() {
|
|
56
|
+
return this.apiDialog().full;
|
|
52
57
|
},
|
|
53
58
|
},
|
|
54
59
|
|
|
55
60
|
mounted() {
|
|
56
|
-
this.
|
|
61
|
+
this.apiDialog().registerContent(this);
|
|
57
62
|
this.show();
|
|
58
63
|
|
|
59
64
|
this.$nextTick(() => this.$el.focus());
|
|
@@ -69,7 +74,7 @@ export default {
|
|
|
69
74
|
},
|
|
70
75
|
|
|
71
76
|
hideDialog() {
|
|
72
|
-
this.
|
|
77
|
+
this.apiDialog().emit();
|
|
73
78
|
},
|
|
74
79
|
},
|
|
75
80
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
3
|
:is="as"
|
|
4
|
-
:class="
|
|
4
|
+
:class="[
|
|
5
|
+
headless
|
|
6
|
+
? 'dialog-footer'
|
|
7
|
+
: '-mx-4 -mb-4 flex items-center justify-between gap-x-3 p-4 md:-mx-6 md:-mb-6 md:p-6',
|
|
8
|
+
]"
|
|
5
9
|
>
|
|
6
10
|
<slot></slot>
|
|
7
11
|
</component>
|
|
@@ -9,24 +13,15 @@
|
|
|
9
13
|
|
|
10
14
|
<script>
|
|
11
15
|
export default {
|
|
12
|
-
name:
|
|
13
|
-
|
|
14
|
-
inject: ["api"],
|
|
15
|
-
|
|
16
|
+
name: 'VTDialogFooter',
|
|
16
17
|
props: {
|
|
18
|
+
headless: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
17
22
|
as: {
|
|
18
23
|
type: String,
|
|
19
|
-
default:
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
computed: {
|
|
24
|
-
dark() {
|
|
25
|
-
return this.api().isDark;
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
headless() {
|
|
29
|
-
return this.api().isHeadless;
|
|
24
|
+
default: 'footer',
|
|
30
25
|
},
|
|
31
26
|
},
|
|
32
27
|
};
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
<component
|
|
3
3
|
:is="as"
|
|
4
4
|
:id="id"
|
|
5
|
-
:class="
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
:class="[
|
|
6
|
+
headless
|
|
7
|
+
? 'dialog-header'
|
|
8
|
+
: '-mx-4 -mt-4 flex items-center justify-between gap-x-3 p-4 md:-mx-6 md:-mt-6 md:p-6',
|
|
9
|
+
]"
|
|
10
|
+
@click.stop
|
|
9
11
|
>
|
|
10
12
|
<slot></slot>
|
|
11
13
|
</component>
|
|
@@ -13,28 +15,24 @@
|
|
|
13
15
|
|
|
14
16
|
<script>
|
|
15
17
|
export default {
|
|
16
|
-
name:
|
|
18
|
+
name: 'VTDialogHeader',
|
|
17
19
|
|
|
18
|
-
inject: [
|
|
20
|
+
inject: ['apiDialog'],
|
|
19
21
|
|
|
20
22
|
props: {
|
|
23
|
+
headless: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
21
27
|
as: {
|
|
22
28
|
type: String,
|
|
23
|
-
default:
|
|
29
|
+
default: 'header',
|
|
24
30
|
},
|
|
25
31
|
},
|
|
26
32
|
|
|
27
33
|
computed: {
|
|
28
|
-
dark() {
|
|
29
|
-
return this.api().isDark;
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
headless() {
|
|
33
|
-
return this.api().isHeadless;
|
|
34
|
-
},
|
|
35
|
-
|
|
36
34
|
id() {
|
|
37
|
-
return
|
|
35
|
+
return `dialog-header-${this.apiDialog().componentId}`;
|
|
38
36
|
},
|
|
39
37
|
},
|
|
40
38
|
|
|
@@ -45,10 +43,10 @@ export default {
|
|
|
45
43
|
methods: {
|
|
46
44
|
// In here because if there is no header, the dialog will not be labelled by
|
|
47
45
|
setDialogLabelledby() {
|
|
48
|
-
const dialog = document.getElementById(this.
|
|
46
|
+
const dialog = document.getElementById(this.apiDialog().id);
|
|
49
47
|
|
|
50
48
|
if (dialog) {
|
|
51
|
-
dialog.setAttribute(
|
|
49
|
+
dialog.setAttribute('aria-labelledby', this.id);
|
|
52
50
|
}
|
|
53
51
|
},
|
|
54
52
|
},
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
<component
|
|
3
3
|
:is="as"
|
|
4
4
|
:id="id"
|
|
5
|
-
:class="
|
|
6
|
-
'Dialog-body': headless,
|
|
7
|
-
'flex-1 w-full h-full overflow-y-auto': !headless,
|
|
8
|
-
}"
|
|
5
|
+
:class="[headless ? 'dialog-body' : 'h-full flex-1 overflow-y-auto']"
|
|
9
6
|
>
|
|
10
7
|
<slot></slot>
|
|
11
8
|
</component>
|
|
@@ -13,28 +10,24 @@
|
|
|
13
10
|
|
|
14
11
|
<script>
|
|
15
12
|
export default {
|
|
16
|
-
name:
|
|
13
|
+
name: 'VTDialogMain',
|
|
17
14
|
|
|
18
|
-
inject: [
|
|
15
|
+
inject: ['apiDialog'],
|
|
19
16
|
|
|
20
17
|
props: {
|
|
18
|
+
headless: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
21
22
|
as: {
|
|
22
23
|
type: String,
|
|
23
|
-
default:
|
|
24
|
+
default: 'main',
|
|
24
25
|
},
|
|
25
26
|
},
|
|
26
27
|
|
|
27
28
|
computed: {
|
|
28
|
-
dark() {
|
|
29
|
-
return this.api().isDark;
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
headless() {
|
|
33
|
-
return this.api().isHeadless;
|
|
34
|
-
},
|
|
35
|
-
|
|
36
29
|
id() {
|
|
37
|
-
return
|
|
30
|
+
return `dialog-main-${this.apiDialog().componentId}`;
|
|
38
31
|
},
|
|
39
32
|
},
|
|
40
33
|
|
|
@@ -45,10 +38,10 @@ export default {
|
|
|
45
38
|
methods: {
|
|
46
39
|
// In here because if there is no body, the dialog will not be described by
|
|
47
40
|
setDialogDescribedby() {
|
|
48
|
-
const dialog = document.getElementById(this.
|
|
41
|
+
const dialog = document.getElementById(this.apiDialog().id);
|
|
49
42
|
|
|
50
43
|
if (dialog) {
|
|
51
|
-
dialog.setAttribute(
|
|
44
|
+
dialog.setAttribute('aria-describedby', this.id);
|
|
52
45
|
}
|
|
53
46
|
},
|
|
54
47
|
},
|
|
@@ -3,25 +3,29 @@
|
|
|
3
3
|
<div
|
|
4
4
|
v-if="visible"
|
|
5
5
|
:id="id"
|
|
6
|
-
:class="
|
|
7
|
-
|
|
8
|
-
'fixed inset-0 bg-fd-450/80': !headless,
|
|
9
|
-
}"
|
|
10
|
-
></div>
|
|
6
|
+
:class="[headless ? 'dialog-overlay' : 'bg-primary-200/80 fixed inset-0']"
|
|
7
|
+
/>
|
|
11
8
|
</FadeInOut>
|
|
12
9
|
</template>
|
|
13
10
|
|
|
14
11
|
<script>
|
|
15
|
-
import FadeInOut from
|
|
12
|
+
import FadeInOut from '../Transitions/FadeInOut.vue';
|
|
16
13
|
|
|
17
14
|
export default {
|
|
18
|
-
name:
|
|
15
|
+
name: 'VTDialogOverlay',
|
|
19
16
|
|
|
20
17
|
components: {
|
|
21
18
|
FadeInOut,
|
|
22
19
|
},
|
|
23
20
|
|
|
24
|
-
inject: [
|
|
21
|
+
inject: ['apiDialog'],
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
headless: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
25
29
|
|
|
26
30
|
data() {
|
|
27
31
|
return {
|
|
@@ -31,21 +35,13 @@ export default {
|
|
|
31
35
|
|
|
32
36
|
computed: {
|
|
33
37
|
id() {
|
|
34
|
-
return `dialog-overlay-${this.
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
dark() {
|
|
38
|
-
return this.api().isDark;
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
headless() {
|
|
42
|
-
return this.api().isHeadless;
|
|
38
|
+
return `dialog-overlay-${this.apiDialog().componentId}`;
|
|
43
39
|
},
|
|
44
40
|
},
|
|
45
41
|
|
|
46
42
|
mounted() {
|
|
47
43
|
this.visible = true;
|
|
48
|
-
this.
|
|
44
|
+
this.apiDialog().registerOverlay(this);
|
|
49
45
|
},
|
|
50
46
|
|
|
51
47
|
methods: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span
|
|
3
3
|
:id="id"
|
|
4
|
-
:class="
|
|
4
|
+
:class="[headless ? 'dialog-header' : 'text-2xl font-semibold']"
|
|
5
5
|
>
|
|
6
6
|
<slot></slot
|
|
7
7
|
></span>
|
|
@@ -9,17 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
<script>
|
|
11
11
|
export default {
|
|
12
|
-
name:
|
|
12
|
+
name: 'VTDialogTitle',
|
|
13
13
|
|
|
14
|
-
inject: [
|
|
14
|
+
inject: ['apiDialog'],
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
headless
|
|
18
|
-
|
|
16
|
+
props: {
|
|
17
|
+
headless: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
19
20
|
},
|
|
21
|
+
},
|
|
20
22
|
|
|
23
|
+
computed: {
|
|
21
24
|
id() {
|
|
22
|
-
return
|
|
25
|
+
return `dialog-overlay-${this.apiDialog().componentId}`;
|
|
23
26
|
},
|
|
24
27
|
},
|
|
25
28
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:class="[
|
|
5
5
|
headless
|
|
6
6
|
? 'details-header'
|
|
7
|
-
: 'flex cursor-pointer justify-between gap-3
|
|
7
|
+
: 'text-body flex cursor-pointer justify-between gap-3 font-semibold',
|
|
8
8
|
]"
|
|
9
9
|
:aria-controls="ariaControls"
|
|
10
10
|
:aria-expanded="String(ariaExpanded)"
|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
78
78
|
this.apiDisclosure().register('headers', header);
|
|
79
79
|
},
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
beforeUnmount() {
|
|
82
82
|
this.apiDisclosure().unregister('headers', this.id);
|
|
83
83
|
},
|
|
84
84
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<Teleport to="body">
|
|
3
3
|
<div
|
|
4
|
-
v-if="
|
|
4
|
+
v-if="modelValue"
|
|
5
5
|
:id="id"
|
|
6
6
|
:class="{ Drawer: headless, 'fixed inset-0 z-50 h-screen': !headless }"
|
|
7
7
|
aria-modal="true"
|
|
@@ -9,23 +9,18 @@
|
|
|
9
9
|
>
|
|
10
10
|
<slot></slot>
|
|
11
11
|
</div>
|
|
12
|
-
</
|
|
12
|
+
</Teleport>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script>
|
|
16
|
-
import { Portal } from '@linusborg/vue-simple-portal';
|
|
17
16
|
import { genId } from '../../utils/ids';
|
|
18
17
|
|
|
19
18
|
export default {
|
|
20
19
|
name: 'VTDrawer',
|
|
21
20
|
|
|
22
|
-
components: {
|
|
23
|
-
Portal,
|
|
24
|
-
},
|
|
25
|
-
|
|
26
21
|
provide() {
|
|
27
22
|
return {
|
|
28
|
-
|
|
23
|
+
apiDrawer: () => {
|
|
29
24
|
const id = this.id;
|
|
30
25
|
const isDark = this.dark;
|
|
31
26
|
const isHeadless = this.headless;
|
|
@@ -58,12 +53,8 @@ export default {
|
|
|
58
53
|
};
|
|
59
54
|
},
|
|
60
55
|
|
|
61
|
-
model: {
|
|
62
|
-
prop: 'visible',
|
|
63
|
-
},
|
|
64
|
-
|
|
65
56
|
props: {
|
|
66
|
-
|
|
57
|
+
modelValue: {
|
|
67
58
|
type: Boolean,
|
|
68
59
|
default: false,
|
|
69
60
|
},
|
|
@@ -117,7 +108,7 @@ export default {
|
|
|
117
108
|
|
|
118
109
|
emit() {
|
|
119
110
|
this.$nextTick(() => {
|
|
120
|
-
this.$emit('
|
|
111
|
+
this.$emit('update:modelValue', false);
|
|
121
112
|
this.$emit('hidden');
|
|
122
113
|
});
|
|
123
114
|
},
|
|
@@ -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
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<transition
|
|
3
3
|
:enter-active-class="activeClass"
|
|
4
|
-
:enter-class="enterClass"
|
|
4
|
+
:enter-from-class="enterClass"
|
|
5
5
|
:enter-to-class="enterToClass"
|
|
6
6
|
:leave-active-class="activeClass"
|
|
7
|
-
:leave-class="leaveClass"
|
|
7
|
+
:leave-from-class="leaveClass"
|
|
8
8
|
:leave-to-class="leaveToClass"
|
|
9
9
|
@after-leave="hideDrawer"
|
|
10
10
|
>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
v-show="visible"
|
|
13
13
|
:class="{
|
|
14
14
|
'Drawer-content': headless,
|
|
15
|
-
'
|
|
15
|
+
'absolute z-20 flex h-screen max-h-full max-w-full flex-col overflow-auto p-5 outline-0 sm:px-10 sm:py-6':
|
|
16
16
|
!headless,
|
|
17
17
|
'bg-white text-gray-600': !dark,
|
|
18
18
|
'bg-fd-600': dark,
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
export default {
|
|
34
34
|
name: 'VTDrawerContent',
|
|
35
35
|
|
|
36
|
-
inject: ['
|
|
36
|
+
inject: ['apiDrawer'],
|
|
37
37
|
|
|
38
38
|
data() {
|
|
39
39
|
return {
|
|
@@ -43,15 +43,15 @@ export default {
|
|
|
43
43
|
|
|
44
44
|
computed: {
|
|
45
45
|
dark() {
|
|
46
|
-
return this.
|
|
46
|
+
return this.apiDrawer().isDark;
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
headless() {
|
|
50
|
-
return this.
|
|
50
|
+
return this.apiDrawer().isHeadless;
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
position() {
|
|
54
|
-
return this.
|
|
54
|
+
return this.apiDrawer().position;
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
activeClass() {
|
|
@@ -132,7 +132,7 @@ export default {
|
|
|
132
132
|
},
|
|
133
133
|
|
|
134
134
|
mounted() {
|
|
135
|
-
this.
|
|
135
|
+
this.apiDrawer().registerContent(this);
|
|
136
136
|
this.show();
|
|
137
137
|
|
|
138
138
|
this.$nextTick(() => this.$el.focus());
|
|
@@ -148,7 +148,7 @@ export default {
|
|
|
148
148
|
},
|
|
149
149
|
|
|
150
150
|
hideDrawer() {
|
|
151
|
-
this.
|
|
151
|
+
this.apiDrawer().emit();
|
|
152
152
|
},
|
|
153
153
|
},
|
|
154
154
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export default {
|
|
9
9
|
name: 'VTDrawerFooter',
|
|
10
10
|
|
|
11
|
-
inject: ['
|
|
11
|
+
inject: ['apiDrawer'],
|
|
12
12
|
|
|
13
13
|
props: {
|
|
14
14
|
as: {
|
|
@@ -19,11 +19,11 @@ export default {
|
|
|
19
19
|
|
|
20
20
|
computed: {
|
|
21
21
|
dark() {
|
|
22
|
-
return this.
|
|
22
|
+
return this.apiDrawer().isDark;
|
|
23
23
|
},
|
|
24
24
|
|
|
25
25
|
headless() {
|
|
26
|
-
return this.
|
|
26
|
+
return this.apiDrawer().isHeadless;
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
};
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export default {
|
|
16
16
|
name: 'VTDrawerHeader',
|
|
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}-header`;
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
};
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
export default {
|
|
13
13
|
name: 'VTDrawerMain',
|
|
14
14
|
|
|
15
|
-
inject: ['
|
|
15
|
+
inject: ['apiDrawer'],
|
|
16
16
|
|
|
17
17
|
props: {
|
|
18
18
|
as: {
|
|
@@ -23,15 +23,15 @@ export default {
|
|
|
23
23
|
|
|
24
24
|
computed: {
|
|
25
25
|
dark() {
|
|
26
|
-
return this.
|
|
26
|
+
return this.apiDrawer().isDark;
|
|
27
27
|
},
|
|
28
28
|
|
|
29
29
|
headless() {
|
|
30
|
-
return this.
|
|
30
|
+
return this.apiDrawer().isHeadless;
|
|
31
31
|
},
|
|
32
32
|
|
|
33
33
|
id() {
|
|
34
|
-
return `${this.
|
|
34
|
+
return `${this.apiDrawer().id}-desc`;
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
|
|
@@ -42,7 +42,7 @@ export default {
|
|
|
42
42
|
methods: {
|
|
43
43
|
// In here because if there is no body, the dialog will not be described by
|
|
44
44
|
setDialogDescribedby() {
|
|
45
|
-
const dialog = document.getElementById(this.
|
|
45
|
+
const dialog = document.getElementById(this.apiDrawer().id);
|
|
46
46
|
|
|
47
47
|
if (dialog) {
|
|
48
48
|
dialog.setAttribute('aria-describedby', this.id);
|