@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.
Files changed (116) hide show
  1. package/.claude/settings.local.json +10 -0
  2. package/index.js +105 -75
  3. package/mixins/floating-ui-content.js +17 -4
  4. package/mixins/floating-ui-item.js +31 -15
  5. package/mixins/floating-ui.js +142 -24
  6. package/mixins/form-control-icon.js +3 -3
  7. package/mixins/form-control.js +45 -20
  8. package/nuxt.js +38 -26
  9. package/package.json +17 -6
  10. package/src/components/Alert/VTAlert.vue +55 -14
  11. package/src/components/Avatar/VTAvatarImage.vue +6 -26
  12. package/src/components/Badge/VTBadge.vue +60 -0
  13. package/src/components/Badge/VTBadgeNew.vue +60 -0
  14. package/src/components/Breadcrumb/VTBreadcrumbItem.vue +11 -0
  15. package/src/components/Breadcrumb/VTBreadcrumbLink.vue +40 -0
  16. package/src/components/Breadcrumb/VTBreadcrumbList.vue +11 -0
  17. package/src/components/Breadcrumb/VTBreadcrumbRoot.vue +11 -0
  18. package/src/components/Breadcrumb/VTBreadcrumbSeparator.vue +19 -0
  19. package/src/components/Button/VTButton.vue +104 -56
  20. package/src/components/Carousel/VTCarousel.vue +69 -0
  21. package/src/components/Carousel/VTCarouselBackward.vue +36 -0
  22. package/src/components/Carousel/VTCarouselForward.vue +38 -0
  23. package/src/components/Carousel/VTCarouselTracker.vue +80 -0
  24. package/src/components/Checkbox/VTCheckbox.vue +134 -0
  25. package/src/components/Checkbox/VTCheckboxLabel.vue +3 -0
  26. package/src/components/Checkbox/VTCheckboxText.vue +20 -0
  27. package/src/components/Chip/VTChip.vue +29 -0
  28. package/src/components/Dialog/VTDialog.vue +59 -25
  29. package/src/components/Dialog/VTDialogClose.vue +3 -2
  30. package/src/components/Dialog/VTDialogContent.vue +29 -7
  31. package/src/components/Dialog/VTDialogFooter.vue +17 -2
  32. package/src/components/Dialog/VTDialogHeader.vue +2 -1
  33. package/src/components/Dialog/VTDialogMain.vue +5 -1
  34. package/src/components/Dialog/VTDialogOverlay.vue +5 -1
  35. package/src/components/Dialog/VTDialogTitle.vue +1 -1
  36. package/src/components/Disclosure/VTDisclosure.vue +2 -11
  37. package/src/components/Disclosure/VTDisclosureContent.vue +26 -52
  38. package/src/components/Disclosure/VTDisclosureDetails.vue +27 -2
  39. package/src/components/Disclosure/VTDisclosureHeader.vue +56 -89
  40. package/src/components/Disclosure/VTDisclosureIcon.vue +42 -31
  41. package/src/components/Divider/VTDivider.vue +9 -0
  42. package/src/components/Drawer/VTDrawer.vue +6 -15
  43. package/src/components/Drawer/VTDrawerClose.vue +5 -5
  44. package/src/components/Drawer/VTDrawerContent.vue +10 -10
  45. package/src/components/Drawer/VTDrawerFooter.vue +4 -4
  46. package/src/components/Drawer/VTDrawerHeader.vue +4 -4
  47. package/src/components/Drawer/VTDrawerMain.vue +5 -5
  48. package/src/components/Drawer/VTDrawerOverlay.vue +6 -6
  49. package/src/components/Drawer/VTDrawerTitle.vue +5 -5
  50. package/src/components/DropdownMenu/VTDropdownMenu.vue +0 -6
  51. package/src/components/DropdownMenu/VTDropdownMenuContent.vue +10 -1
  52. package/src/components/DropdownMenu/VTDropdownMenuDivider.vue +7 -16
  53. package/src/components/DropdownMenu/VTDropdownMenuItem.vue +5 -1
  54. package/src/components/DropdownMenu/VTDropdownMenuLabel.vue +1 -10
  55. package/src/components/DropdownMenu/VTDropdownMenuTrigger.vue +2 -4
  56. package/src/components/Form/VTFieldset.vue +5 -0
  57. package/src/components/Form/VTForm.vue +11 -0
  58. package/src/components/Form/VTFormCol.vue +20 -0
  59. package/src/components/Form/VTFormFeedback.vue +7 -1
  60. package/src/components/Form/VTFormGroup.vue +5 -7
  61. package/src/components/Form/VTFormLabel.vue +22 -0
  62. package/src/components/Form/VTFormLabelHelper.vue +22 -0
  63. package/src/components/Form/VTFormRow.vue +5 -0
  64. package/src/components/Form/VTInput.vue +2 -5
  65. package/src/components/Form/VTInputDate.vue +602 -0
  66. package/src/components/Form/VTInputIcon.vue +3 -9
  67. package/src/components/Form/VTInputNumber.vue +198 -0
  68. package/src/components/Form/VTInputPassword.vue +14 -5
  69. package/src/components/Form/VTInputRange.vue +92 -0
  70. package/src/components/Form/VTLegend.vue +24 -0
  71. package/src/components/Form/VTTextarea.vue +2 -2
  72. package/src/components/Image/VTImage.vue +10 -10
  73. package/src/components/Listbox/VTListbox.vue +128 -9
  74. package/src/components/Listbox/VTListboxContent.vue +14 -1
  75. package/src/components/Listbox/VTListboxDivider.vue +21 -0
  76. package/src/components/Listbox/VTListboxGroup.vue +9 -0
  77. package/src/components/Listbox/VTListboxItem.vue +57 -15
  78. package/src/components/Listbox/VTListboxLabel.vue +5 -4
  79. package/src/components/Listbox/VTListboxList.vue +1 -6
  80. package/src/components/Listbox/VTListboxPlaceholder.vue +25 -0
  81. package/src/components/Listbox/VTListboxSearch.vue +12 -8
  82. package/src/components/Listbox/VTListboxTrigger.vue +87 -6
  83. package/src/components/Listbox/VTListboxTriggerHighlight.vue +204 -0
  84. package/src/components/Listbox/VTListboxViewport.vue +33 -0
  85. package/src/components/Popover/VTPopoverContent.vue +3 -3
  86. package/src/components/Popover/VTPopoverDivider.vue +1 -1
  87. package/src/components/Popover/VTPopoverItem.vue +6 -2
  88. package/src/components/ProgressBar/VTProgressBar.vue +35 -10
  89. package/src/components/ProgressBar/VTProgressBarIndicator.vue +53 -0
  90. package/src/components/ScrollShadows/VTScrollShadows.vue +76 -0
  91. package/src/components/Separator/VTSeparator.vue +13 -0
  92. package/src/components/Switch/VTSwitch.vue +61 -0
  93. package/src/components/Tabs/VTTab.vue +6 -5
  94. package/src/components/Tabs/VTTabGroup.vue +88 -9
  95. package/src/components/Tabs/VTTabPanel.vue +4 -5
  96. package/src/components/Toast/README.md +263 -0
  97. package/src/components/Toast/VTToast.vue +145 -0
  98. package/src/components/Toast/VTToastAction.vue +25 -0
  99. package/src/components/Toast/VTToastClose.vue +52 -0
  100. package/src/components/Toast/VTToastContent.vue +25 -0
  101. package/src/components/Toast/VTToastDescription.vue +36 -0
  102. package/src/components/Toast/VTToastIcon.vue +72 -0
  103. package/src/components/Toast/VTToastItem.vue +180 -0
  104. package/src/components/Toast/VTToastTitle.vue +34 -0
  105. package/src/components/Tooltip/VTTooltipTrigger.vue +3 -5
  106. package/src/components/Transitions/FadeInOut.vue +2 -2
  107. package/src/components/Utils/FloatingUi.vue +31 -13
  108. package/src/helpers/currency.js +21 -0
  109. package/src/utils/components.js +18 -0
  110. package/src/utils/images.js +31 -12
  111. package/src/components/Input/VTInput.vue +0 -82
  112. package/src/components/Input/VTInputDate.vue +0 -36
  113. package/src/components/Input/VTInputFile.vue +0 -60
  114. package/src/components/Input/VTInputUpload.vue +0 -54
  115. package/src/components/Modal/VTModal.vue +0 -69
  116. package/src/utils/genId.js +0 -13
@@ -1,17 +1,11 @@
1
1
  <template>
2
2
  <header
3
3
  :id="id"
4
- :class="[
5
- headless
6
- ? 'details-header'
7
- : 'flex cursor-pointer justify-between gap-3 text-body font-semibold',
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
- id() {
41
- return this.apiDetails().idSummary;
42
- },
40
+ headerClasses() {
41
+ if (this.headless) {
42
+ return 'details-header';
43
+ }
43
44
 
44
- idGroup() {
45
- return this.apiDetails().idGroup;
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
- ariaControls() {
49
- return this.apiDetails().idContent;
48
+ return classes;
50
49
  },
51
50
 
52
- details() {
53
- return this.apiDisclosure().details;
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
- headers() {
57
- return this.apiDisclosure().headers;
64
+ id() {
65
+ return this.apiDetails().idSummary;
58
66
  },
59
67
 
60
- icons() {
61
- return this.apiDisclosure().icons;
68
+ ariaControls() {
69
+ return this.apiDetails().idContent;
62
70
  },
63
71
 
64
- contents() {
65
- return this.apiDisclosure().contents;
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
- beforeDestroy() {
82
- this.apiDisclosure().unregister('headers', this.id);
76
+ ariaExpanded() {
77
+ return String(this.isVisible);
78
+ },
83
79
  },
84
80
 
85
81
  methods: {
86
82
  toggle() {
87
- this.toggleDetails();
88
- this.toggleHeaders();
89
- this.toggleContents();
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
- if (isAccordion && !isSameGroup) {
122
- content.collapse();
123
- }
124
- });
87
+ this.apiDetails().setVisible(!this.isVisible);
125
88
  },
126
89
 
127
- toggleHeaders() {
128
- this.headers.forEach((summary) => summary.isExpanded());
90
+ handleClick() {
91
+ if (!this.actionless) {
92
+ this.toggle();
93
+ }
129
94
  },
130
95
 
131
- toggleIcons() {
132
- this.icons.forEach((icon) => icon.isExpanded());
96
+ handleKeydown() {
97
+ if (!this.actionless) {
98
+ this.toggle();
99
+ }
133
100
  },
134
101
  },
135
102
  };
@@ -1,12 +1,14 @@
1
1
  <template>
2
- <span
3
- :class="[
4
- headless ? 'disclosure-icon' : 'shrink-0 transition-all',
5
- headless ? null : expanded ? 'rotate-180' : 'rotate-0',
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
- </span>
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
- data() {
26
- return {
27
- expanded: false,
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
- id() {
33
- return this.apiDetails().idIcon;
34
- },
35
+ ariaAttributes() {
36
+ if (this.as !== 'button') {
37
+ return {};
38
+ }
35
39
 
36
- idGroup() {
37
- return this.apiDetails().idGroup;
40
+ return {
41
+ 'aria-expanded': String(this.expanded),
42
+ 'aria-controls': this.apiDetails().idContent,
43
+ };
38
44
  },
39
- },
40
45
 
41
- mounted() {
42
- this.isExpanded();
46
+ iconClasses() {
47
+ const classes = [];
43
48
 
44
- const icon = {
45
- id: this.id,
46
- idGroup: this.idGroup,
47
- isExpanded: this.isExpanded,
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
- this.apiDisclosure().register('icons', icon);
51
- },
57
+ return classes.filter(Boolean);
58
+ },
52
59
 
53
- beforeDestroy() {
54
- this.apiDisclosure().unregister('icons', this.id);
60
+ expanded() {
61
+ return this.apiDetails().visible;
62
+ },
55
63
  },
56
64
 
57
65
  methods: {
58
- isExpanded() {
59
- this.expanded = this.apiDetails().isVisible();
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
  };
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div class="border-b border-gray-200" />
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'VTDivider',
8
+ };
9
+ </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <Portal>
2
+ <Teleport to="body">
3
3
  <div
4
- v-if="visible"
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
- </Portal>
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
- api: () => {
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
- visible: {
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('input', false);
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: ['api'],
23
+ inject: ['apiDrawer'],
24
24
 
25
25
  computed: {
26
26
  dark() {
27
- return this.api().isDark;
27
+ return this.apiDrawer().isDark;
28
28
  },
29
29
 
30
30
  headless() {
31
- return this.api().isHeadless;
31
+ return this.apiDrawer().isHeadless;
32
32
  },
33
33
 
34
34
  right() {
35
- return this.api().isRight;
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.api().hide();
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
- 'fixed 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':
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
- @keydown.esc.stop="hide"
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: ['api'],
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.api().isDark;
46
+ return this.apiDrawer().isDark;
47
47
  },
48
48
 
49
49
  headless() {
50
- return this.api().isHeadless;
50
+ return this.apiDrawer().isHeadless;
51
51
  },
52
52
 
53
53
  position() {
54
- return this.api().position;
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.api().registerContent(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.api().emit();
151
+ this.apiDrawer().emit();
152
152
  },
153
153
  },
154
154
  };
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <component :is="as" :class="{ 'dialog-footer': headless }">
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: ['api'],
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.api().isDark;
22
+ return this.apiDrawer().isDark;
23
23
  },
24
24
 
25
25
  headless() {
26
- return this.api().isHeadless;
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: ['api'],
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.api().isDark;
29
+ return this.apiDrawer().isDark;
30
30
  },
31
31
 
32
32
  headless() {
33
- return this.api().isHeadless;
33
+ return this.apiDrawer().isHeadless;
34
34
  },
35
35
 
36
36
  id() {
37
- return `${this.api().id}-header`;
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: ['api'],
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.api().isDark;
26
+ return this.apiDrawer().isDark;
27
27
  },
28
28
 
29
29
  headless() {
30
- return this.api().isHeadless;
30
+ return this.apiDrawer().isHeadless;
31
31
  },
32
32
 
33
33
  id() {
34
- return `${this.api().id}-desc`;
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.api().id);
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 "../Transitions/FadeInOut.vue";
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: ["api"],
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.api().isDark;
32
+ return this.apiDrawer().isDark;
33
33
  },
34
34
 
35
35
  headless() {
36
- return this.api().isHeadless;
36
+ return this.apiDrawer().isHeadless;
37
37
  },
38
38
 
39
39
  id() {
40
- return `${this.api().id}-overlay`;
40
+ return `${this.apiDrawer().id}-overlay`;
41
41
  },
42
42
  },
43
43
 
44
44
  mounted() {
45
45
  this.visible = true;
46
- this.api().registerOverlay(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: ['api'],
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.api().isDark;
29
+ return this.apiDrawer().isDark;
30
30
  },
31
31
 
32
32
  headless() {
33
- return this.api().isHeadless;
33
+ return this.apiDrawer().isHeadless;
34
34
  },
35
35
 
36
36
  id() {
37
- return `${this.api().id}-title`;
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.api().id);
48
+ const dialog = document.getElementById(this.apiDrawer().id);
49
49
 
50
50
  if (dialog) {
51
51
  dialog.setAttribute('aria-labelledby', this.id);
@@ -83,11 +83,5 @@ export default {
83
83
  floatingUiMinWidth: 200,
84
84
  };
85
85
  },
86
-
87
- computed: {
88
- id() {
89
- return `dropdown-menu-${this.componentId}`;
90
- },
91
- },
92
86
  };
93
87
  </script>
@@ -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>