@veritree/ui 0.27.0 → 0.28.0-1
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/.claude/settings.local.json +10 -0
- package/index.js +105 -75
- package/mixins/floating-ui-content.js +17 -4
- package/mixins/floating-ui-item.js +31 -15
- package/mixins/floating-ui.js +142 -24
- package/mixins/form-control-icon.js +3 -3
- package/mixins/form-control.js +45 -20
- package/nuxt.js +38 -26
- package/package.json +17 -6
- package/src/components/Alert/VTAlert.vue +55 -14
- package/src/components/Avatar/VTAvatarImage.vue +6 -26
- package/src/components/Badge/VTBadge.vue +60 -0
- package/src/components/Badge/VTBadgeNew.vue +60 -0
- package/src/components/Breadcrumb/VTBreadcrumbItem.vue +11 -0
- package/src/components/Breadcrumb/VTBreadcrumbLink.vue +40 -0
- package/src/components/Breadcrumb/VTBreadcrumbList.vue +11 -0
- package/src/components/Breadcrumb/VTBreadcrumbRoot.vue +11 -0
- package/src/components/Breadcrumb/VTBreadcrumbSeparator.vue +19 -0
- package/src/components/Button/VTButton.vue +104 -56
- package/src/components/Carousel/VTCarousel.vue +69 -0
- package/src/components/Carousel/VTCarouselBackward.vue +36 -0
- package/src/components/Carousel/VTCarouselForward.vue +38 -0
- package/src/components/Carousel/VTCarouselTracker.vue +80 -0
- 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/Chip/VTChip.vue +29 -0
- package/src/components/Dialog/VTDialog.vue +59 -25
- package/src/components/Dialog/VTDialogClose.vue +3 -2
- package/src/components/Dialog/VTDialogContent.vue +29 -7
- package/src/components/Dialog/VTDialogFooter.vue +17 -2
- package/src/components/Dialog/VTDialogHeader.vue +2 -1
- package/src/components/Dialog/VTDialogMain.vue +5 -1
- package/src/components/Dialog/VTDialogOverlay.vue +5 -1
- package/src/components/Dialog/VTDialogTitle.vue +1 -1
- package/src/components/Disclosure/VTDisclosure.vue +2 -11
- package/src/components/Disclosure/VTDisclosureContent.vue +26 -52
- package/src/components/Disclosure/VTDisclosureDetails.vue +27 -2
- package/src/components/Disclosure/VTDisclosureHeader.vue +56 -89
- package/src/components/Disclosure/VTDisclosureIcon.vue +42 -31
- package/src/components/Divider/VTDivider.vue +9 -0
- package/src/components/Drawer/VTDrawer.vue +6 -15
- package/src/components/Drawer/VTDrawerClose.vue +5 -5
- package/src/components/Drawer/VTDrawerContent.vue +10 -10
- package/src/components/Drawer/VTDrawerFooter.vue +4 -4
- 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 +0 -6
- package/src/components/DropdownMenu/VTDropdownMenuContent.vue +10 -1
- package/src/components/DropdownMenu/VTDropdownMenuDivider.vue +7 -16
- package/src/components/DropdownMenu/VTDropdownMenuItem.vue +5 -1
- package/src/components/DropdownMenu/VTDropdownMenuLabel.vue +1 -10
- package/src/components/DropdownMenu/VTDropdownMenuTrigger.vue +2 -4
- package/src/components/Form/VTFieldset.vue +5 -0
- package/src/components/Form/VTForm.vue +11 -0
- package/src/components/Form/VTFormCol.vue +20 -0
- package/src/components/Form/VTFormFeedback.vue +7 -1
- package/src/components/Form/VTFormGroup.vue +5 -7
- package/src/components/Form/VTFormLabel.vue +22 -0
- package/src/components/Form/VTFormLabelHelper.vue +22 -0
- package/src/components/Form/VTFormRow.vue +5 -0
- package/src/components/Form/VTInput.vue +2 -5
- package/src/components/Form/VTInputDate.vue +602 -0
- package/src/components/Form/VTInputIcon.vue +3 -9
- package/src/components/Form/VTInputNumber.vue +198 -0
- package/src/components/Form/VTInputPassword.vue +14 -5
- package/src/components/Form/VTInputRange.vue +92 -0
- package/src/components/Form/VTLegend.vue +24 -0
- package/src/components/Form/VTTextarea.vue +2 -2
- package/src/components/Image/VTImage.vue +10 -10
- package/src/components/Listbox/VTListbox.vue +128 -9
- package/src/components/Listbox/VTListboxContent.vue +14 -1
- package/src/components/Listbox/VTListboxDivider.vue +21 -0
- package/src/components/Listbox/VTListboxGroup.vue +9 -0
- package/src/components/Listbox/VTListboxItem.vue +57 -15
- package/src/components/Listbox/VTListboxLabel.vue +5 -4
- package/src/components/Listbox/VTListboxList.vue +1 -6
- package/src/components/Listbox/VTListboxPlaceholder.vue +25 -0
- package/src/components/Listbox/VTListboxSearch.vue +12 -8
- package/src/components/Listbox/VTListboxTrigger.vue +87 -6
- package/src/components/Listbox/VTListboxTriggerHighlight.vue +204 -0
- package/src/components/Listbox/VTListboxViewport.vue +33 -0
- package/src/components/Popover/VTPopoverContent.vue +3 -3
- package/src/components/Popover/VTPopoverDivider.vue +1 -1
- package/src/components/Popover/VTPopoverItem.vue +6 -2
- package/src/components/ProgressBar/VTProgressBar.vue +35 -10
- package/src/components/ProgressBar/VTProgressBarIndicator.vue +53 -0
- package/src/components/ScrollShadows/VTScrollShadows.vue +76 -0
- package/src/components/Separator/VTSeparator.vue +13 -0
- package/src/components/Switch/VTSwitch.vue +61 -0
- package/src/components/Tabs/VTTab.vue +6 -5
- package/src/components/Tabs/VTTabGroup.vue +88 -9
- package/src/components/Tabs/VTTabPanel.vue +4 -5
- package/src/components/Toast/README.md +263 -0
- package/src/components/Toast/VTToast.vue +145 -0
- package/src/components/Toast/VTToastAction.vue +25 -0
- package/src/components/Toast/VTToastClose.vue +52 -0
- package/src/components/Toast/VTToastContent.vue +25 -0
- package/src/components/Toast/VTToastDescription.vue +36 -0
- package/src/components/Toast/VTToastIcon.vue +72 -0
- package/src/components/Toast/VTToastItem.vue +180 -0
- package/src/components/Toast/VTToastTitle.vue +34 -0
- package/src/components/Tooltip/VTTooltipTrigger.vue +3 -5
- package/src/components/Transitions/FadeInOut.vue +2 -2
- package/src/components/Utils/FloatingUi.vue +31 -13
- package/src/helpers/currency.js +21 -0
- package/src/utils/components.js +18 -0
- package/src/utils/images.js +31 -12
- 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,17 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<header
|
|
3
3
|
:id="id"
|
|
4
|
-
:class="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
:aria-controls="ariaControls"
|
|
10
|
-
:aria-expanded="String(ariaExpanded)"
|
|
11
|
-
role="button"
|
|
12
|
-
tabindex="0"
|
|
13
|
-
@click.prevent="toggle"
|
|
14
|
-
@keydown.enter="toggle"
|
|
4
|
+
:class="headerClasses"
|
|
5
|
+
v-bind="ariaAttributes"
|
|
6
|
+
@click.prevent="handleClick"
|
|
7
|
+
@keydown.enter.prevent="handleKeydown"
|
|
8
|
+
@keydown.space.prevent="handleKeydown"
|
|
15
9
|
>
|
|
16
10
|
<slot></slot>
|
|
17
11
|
</header>
|
|
@@ -24,112 +18,85 @@ export default {
|
|
|
24
18
|
inject: ['apiDisclosure', 'apiDetails'],
|
|
25
19
|
|
|
26
20
|
props: {
|
|
21
|
+
/**
|
|
22
|
+
* If true, the header will not toggle visibility of the content.
|
|
23
|
+
* Useful for headers that are purely informational.
|
|
24
|
+
*/
|
|
25
|
+
actionless: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* If true, the header will not have any visual styles applied.
|
|
31
|
+
* Useful for headless implementations where you want to style it yourself.
|
|
32
|
+
*/
|
|
27
33
|
headless: {
|
|
28
34
|
type: Boolean,
|
|
29
35
|
default: false,
|
|
30
36
|
},
|
|
31
37
|
},
|
|
32
38
|
|
|
33
|
-
data() {
|
|
34
|
-
return {
|
|
35
|
-
ariaExpanded: false,
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
|
|
39
39
|
computed: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
headerClasses() {
|
|
41
|
+
if (this.headless) {
|
|
42
|
+
return 'details-header';
|
|
43
|
+
}
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
45
|
+
const classes = ['flex justify-between gap-3 text-body font-semibold'];
|
|
46
|
+
classes.push(this.actionless ? 'cursor-default' : 'cursor-pointer');
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
return this.apiDetails().idContent;
|
|
48
|
+
return classes;
|
|
50
49
|
},
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
ariaAttributes() {
|
|
52
|
+
if (this.actionless) {
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
'aria-controls': this.ariaControls,
|
|
58
|
+
'aria-expanded': this.ariaExpanded,
|
|
59
|
+
'role': 'button',
|
|
60
|
+
'tabindex': '0',
|
|
61
|
+
};
|
|
54
62
|
},
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
return this.
|
|
64
|
+
id() {
|
|
65
|
+
return this.apiDetails().idSummary;
|
|
58
66
|
},
|
|
59
67
|
|
|
60
|
-
|
|
61
|
-
return this.
|
|
68
|
+
ariaControls() {
|
|
69
|
+
return this.apiDetails().idContent;
|
|
62
70
|
},
|
|
63
71
|
|
|
64
|
-
|
|
65
|
-
return this.
|
|
72
|
+
isVisible() {
|
|
73
|
+
return this.apiDetails().visible;
|
|
66
74
|
},
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
mounted() {
|
|
70
|
-
this.isExpanded();
|
|
71
|
-
|
|
72
|
-
const header = {
|
|
73
|
-
id: this.id,
|
|
74
|
-
idGroup: this.idGroup,
|
|
75
|
-
isExpanded: this.isExpanded,
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
this.apiDisclosure().register('headers', header);
|
|
79
|
-
},
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
ariaExpanded() {
|
|
77
|
+
return String(this.isVisible);
|
|
78
|
+
},
|
|
83
79
|
},
|
|
84
80
|
|
|
85
81
|
methods: {
|
|
86
82
|
toggle() {
|
|
87
|
-
this.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this.toggleIcons();
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
isExpanded() {
|
|
94
|
-
this.ariaExpanded = this.apiDetails().isVisible();
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
toggleDetails() {
|
|
98
|
-
this.details.forEach((detail) => {
|
|
99
|
-
const isSameGroup = detail.idGroup === this.idGroup;
|
|
100
|
-
const isAccordion = this.apiDisclosure().accordion;
|
|
101
|
-
|
|
102
|
-
if (isSameGroup) {
|
|
103
|
-
detail.isVisible() ? detail.hide() : detail.show();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (isAccordion && !isSameGroup) {
|
|
107
|
-
detail.hide();
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
toggleContents() {
|
|
113
|
-
this.contents.forEach((content) => {
|
|
114
|
-
const isSameGroup = content.idGroup === this.idGroup;
|
|
115
|
-
const isAccordion = this.apiDisclosure().accordion;
|
|
116
|
-
|
|
117
|
-
if (isSameGroup) {
|
|
118
|
-
content.isVisible() ? content.collapse() : content.expand();
|
|
119
|
-
}
|
|
83
|
+
if (this.actionless) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
120
86
|
|
|
121
|
-
|
|
122
|
-
content.collapse();
|
|
123
|
-
}
|
|
124
|
-
});
|
|
87
|
+
this.apiDetails().setVisible(!this.isVisible);
|
|
125
88
|
},
|
|
126
89
|
|
|
127
|
-
|
|
128
|
-
this.
|
|
90
|
+
handleClick() {
|
|
91
|
+
if (!this.actionless) {
|
|
92
|
+
this.toggle();
|
|
93
|
+
}
|
|
129
94
|
},
|
|
130
95
|
|
|
131
|
-
|
|
132
|
-
this.
|
|
96
|
+
handleKeydown() {
|
|
97
|
+
if (!this.actionless) {
|
|
98
|
+
this.toggle();
|
|
99
|
+
}
|
|
133
100
|
},
|
|
134
101
|
},
|
|
135
102
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<component
|
|
3
|
+
:is="as"
|
|
4
|
+
:class="iconClasses"
|
|
5
|
+
v-bind="ariaAttributes"
|
|
6
|
+
@click.stop="onClick"
|
|
7
|
+
@keydown.enter="onClick"
|
|
8
|
+
@keydown.space.prevent="onClick"
|
|
7
9
|
>
|
|
8
10
|
<slot><IconChevronDown /></slot>
|
|
9
|
-
</
|
|
11
|
+
</component>
|
|
10
12
|
</template>
|
|
11
13
|
|
|
12
14
|
<script>
|
|
@@ -20,43 +22,52 @@ export default {
|
|
|
20
22
|
type: Boolean,
|
|
21
23
|
default: false,
|
|
22
24
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
as: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'span',
|
|
28
|
+
validator(value) {
|
|
29
|
+
return ['span', 'button', 'div', 'a'].includes(value);
|
|
30
|
+
},
|
|
31
|
+
},
|
|
29
32
|
},
|
|
30
33
|
|
|
31
34
|
computed: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
ariaAttributes() {
|
|
36
|
+
if (this.as !== 'button') {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
return {
|
|
41
|
+
'aria-expanded': String(this.expanded),
|
|
42
|
+
'aria-controls': this.apiDetails().idContent,
|
|
43
|
+
};
|
|
38
44
|
},
|
|
39
|
-
},
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
iconClasses() {
|
|
47
|
+
const classes = [];
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
if (this.headless) {
|
|
50
|
+
classes.push('disclosure-icon');
|
|
51
|
+
} else {
|
|
52
|
+
classes.push('shrink-0 transition-all');
|
|
53
|
+
classes.push(this.expanded ? 'rotate-180' : 'rotate-0');
|
|
54
|
+
classes.push(this.as === 'button' ? null : 'pointer-events-none');
|
|
55
|
+
}
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
return classes.filter(Boolean);
|
|
58
|
+
},
|
|
52
59
|
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
expanded() {
|
|
61
|
+
return this.apiDetails().visible;
|
|
62
|
+
},
|
|
55
63
|
},
|
|
56
64
|
|
|
57
65
|
methods: {
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
onClick() {
|
|
67
|
+
// Only handle click if rendered as a button
|
|
68
|
+
if (this.as === 'button') {
|
|
69
|
+
this.apiDetails().setVisible(!this.expanded);
|
|
70
|
+
}
|
|
60
71
|
},
|
|
61
72
|
},
|
|
62
73
|
};
|
|
@@ -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,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
'bottom-0': position === 'bottom',
|
|
23
23
|
}"
|
|
24
24
|
tabindex="-1"
|
|
25
|
-
@
|
|
25
|
+
@keyup.esc="hide"
|
|
26
26
|
>
|
|
27
27
|
<slot></slot>
|
|
28
28
|
</div>
|
|
@@ -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
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="as" :class="{ '
|
|
2
|
+
<component :is="as" :class="{ 'Dialog-footer': headless }">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</component>
|
|
5
5
|
</template>
|
|
@@ -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);
|
|
@@ -12,14 +12,14 @@
|
|
|
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: {
|
|
@@ -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);
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
:id="id"
|
|
4
4
|
:visible="visible"
|
|
5
5
|
:headless="headless"
|
|
6
|
-
:portal-class="$vnode.data.staticClass"
|
|
7
6
|
component="dropdown"
|
|
8
7
|
>
|
|
9
8
|
<slot></slot>
|
|
@@ -46,5 +45,15 @@ export default {
|
|
|
46
45
|
|
|
47
46
|
this.apiDropdownMenu().registerContent(content);
|
|
48
47
|
},
|
|
48
|
+
|
|
49
|
+
methods: {
|
|
50
|
+
hidden() {
|
|
51
|
+
this.$emit('hidden');
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
shown() {
|
|
55
|
+
this.$emit('shown');
|
|
56
|
+
},
|
|
57
|
+
},
|
|
49
58
|
};
|
|
50
59
|
</script>
|