edvoyui-component-library-test-flight 0.0.171 → 0.0.173

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "edvoyui-component-library-test-flight",
3
3
  "private": false,
4
- "version": "0.0.171",
4
+ "version": "0.0.173",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist/",
@@ -22,8 +22,8 @@
22
22
  <div
23
23
  v-if="isOpen && menuItems.length"
24
24
  :class="[
25
- 'absolute left-0 z-0 p-2 mt-1 transition-all duration-300 ease-in-out bg-white border border-gray-200 border-solid rounded-lg shadow-2xl shadow-gray-300 min-w-32 max-w-64 w-max',
26
- placement === 'top' ? 'bottom-full' : 'top-full',
25
+ 'absolute z-0 p-2 transition-all duration-300 ease-in-out bg-white border border-gray-200 border-solid rounded-lg shadow-2xl shadow-gray-300 min-w-32 max-w-64 w-max',
26
+ mainDropdownClasses,
27
27
  dropdownClass,
28
28
  ]"
29
29
  @click.stop
@@ -57,7 +57,7 @@
57
57
  <!-- Sub-menu lists-->
58
58
  <div
59
59
  v-if="item.subMenu && activeMenuItem === item.text"
60
- class="absolute top-0 z-10 transition-all duration-300 ease-in-out left-full min-w-32 max-w-64 w-max"
60
+ :class="['absolute top-0 z-10 transition-all duration-300 ease-in-out min-w-32 max-w-64 w-max', placement === 'right' ? 'right-full' : 'left-full']"
61
61
  >
62
62
  <div
63
63
  class="bg-white border border-gray-200 border-solid rounded-lg shadow-2xl ms-2 shadow-gray-300"
@@ -91,7 +91,7 @@
91
91
  </template>
92
92
 
93
93
  <script setup lang="ts">
94
- import { ref, defineProps, PropType } from "vue";
94
+ import { ref, defineProps, PropType, computed } from "vue";
95
95
  import { onClickOutside } from "@vueuse/core";
96
96
  import ChevronDownStroke from "../../assets/svg/ChevronDownStroke.vue";
97
97
  import ChevronDownStrokeSolid from "../../assets/svg/ChevronDownStrokeSolid.vue";
@@ -102,7 +102,7 @@ interface MenuItem {
102
102
  enableAction?: boolean;
103
103
  }
104
104
 
105
- defineProps({
105
+ const props = defineProps({
106
106
  title: {
107
107
  type: String,
108
108
  default: "My Students",
@@ -143,7 +143,7 @@ defineProps({
143
143
  },
144
144
  disabled: Boolean,
145
145
  placement: {
146
- type: String as PropType<"top" | "bottom">,
146
+ type: String as PropType<"top" | "bottom" | "left" | "right">,
147
147
  default: "bottom",
148
148
  },
149
149
  });
@@ -169,6 +169,19 @@ const clearActiveMenuItem = () => {
169
169
  onClickOutside(dropdownButton, () => {
170
170
  isOpen.value = false;
171
171
  });
172
+
173
+ const mainDropdownClasses = computed(() => {
174
+ switch (props.placement) {
175
+ case 'top':
176
+ return 'bottom-full left-0 mb-1';
177
+ case 'left':
178
+ return 'right-full top-0 me-1'; // me-1 is margin-end for spacing
179
+ case 'right':
180
+ return 'left-full top-0 ms-1'; // ms-1 is margin-start for spacing
181
+ default: // 'bottom'
182
+ return 'top-full left-0 mt-1';
183
+ }
184
+ });
172
185
  </script>
173
186
 
174
187
  <style lang="scss" scoped></style>