v-uixy 1.3.1 → 1.5.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.
Files changed (64) hide show
  1. package/package.json +1 -1
  2. package/templates/assets/css/main.css +4 -0
  3. package/templates/components/Alert/Alert.types.ts +4 -0
  4. package/templates/components/Alert/AlertItem.component.vue +2 -4
  5. package/templates/components/Alert/index.ts +6 -1
  6. package/templates/components/Avatar/Avatar.component.vue +7 -3
  7. package/templates/components/Avatar/Avatar.styles.ts +3 -3
  8. package/templates/components/Breadcrumb/Breadcrumb.component.vue +116 -0
  9. package/templates/components/Breadcrumb/Breadcrumb.styles.ts +40 -0
  10. package/templates/components/Breadcrumb/Breadcrumb.types.ts +30 -0
  11. package/templates/components/Breadcrumb/index.ts +17 -0
  12. package/templates/components/Button/Button.styles.ts +3 -3
  13. package/templates/components/Calendar/Calendar.component.vue +76 -17
  14. package/templates/components/Calendar/Calendar.styles.ts +15 -3
  15. package/templates/components/Calendar/Calendar.types.ts +9 -0
  16. package/templates/components/Chart/Chart.component.vue +308 -0
  17. package/templates/components/Chart/Chart.types.ts +18 -0
  18. package/templates/components/Chart/index.ts +13 -0
  19. package/templates/components/Checkbox/Checkbox.styles.ts +1 -1
  20. package/templates/components/ColorPicker/ColorPicker.component.vue +4 -4
  21. package/templates/components/Command/Command.component.vue +6 -6
  22. package/templates/components/Command/Command.types.ts +1 -0
  23. package/templates/components/DatePicker/DatePicker.component.vue +219 -0
  24. package/templates/components/DatePicker/DatePicker.styles.ts +74 -0
  25. package/templates/components/DatePicker/DatePicker.types.ts +18 -0
  26. package/templates/components/DatePicker/DatePicker.utils.ts +46 -0
  27. package/templates/components/DatePicker/TimeWheel.vue +145 -0
  28. package/templates/components/DatePicker/TimeWheelColumn.vue +147 -0
  29. package/templates/components/DatePicker/index.ts +11 -0
  30. package/templates/components/DateRangePicker/DateRangePicker.component.vue +304 -0
  31. package/templates/components/DateRangePicker/DateRangePicker.types.ts +23 -0
  32. package/templates/components/DateRangePicker/index.ts +11 -0
  33. package/templates/components/FileUpload/FileUpload.component.vue +306 -0
  34. package/templates/components/FileUpload/FileUpload.styles.ts +74 -0
  35. package/templates/components/FileUpload/FileUpload.types.ts +31 -0
  36. package/templates/components/FileUpload/index.ts +15 -0
  37. package/templates/components/Input/Input.component.vue +27 -27
  38. package/templates/components/Input/Input.styles.ts +5 -5
  39. package/templates/components/Input/Input.types.ts +1 -0
  40. package/templates/components/InputOTP/InputOTP.component.vue +4 -2
  41. package/templates/components/InputOTP/InputOTP.types.ts +1 -0
  42. package/templates/components/Modal/Modal.component.vue +28 -4
  43. package/templates/components/Modal/Modal.types.ts +3 -1
  44. package/templates/components/Popover/Popover.component.vue +33 -2
  45. package/templates/components/Popover/Popover.types.ts +1 -0
  46. package/templates/components/SegmentedControl/SegmentedControl.component.vue +85 -0
  47. package/templates/components/SegmentedControl/SegmentedControl.styles.ts +55 -0
  48. package/templates/components/SegmentedControl/SegmentedControl.types.ts +15 -0
  49. package/templates/components/SegmentedControl/index.ts +11 -0
  50. package/templates/components/Select/Select.component.vue +253 -108
  51. package/templates/components/Select/Select.styles.ts +6 -6
  52. package/templates/components/Select/Select.types.ts +12 -0
  53. package/templates/components/Select/SelectTreeItem.vue +154 -0
  54. package/templates/components/Select/composables/useSelect.composable.ts +260 -42
  55. package/templates/components/Tabs/Tabs.component.vue +11 -2
  56. package/templates/components/Tabs/Tabs.types.ts +1 -0
  57. package/templates/components/Textarea/Textarea.component.vue +23 -32
  58. package/templates/components/Textarea/Textarea.styles.ts +4 -4
  59. package/templates/components/Textarea/Textarea.types.ts +1 -0
  60. package/templates/components/TimePicker/TimePicker.component.vue +21 -18
  61. package/templates/components/TimePicker/TimePicker.styles.ts +1 -1
  62. package/templates/components/TimePicker/TimePicker.types.ts +1 -0
  63. package/templates/components.json +37 -1
  64. package/templates/composables/usePosition.ts +17 -2
@@ -39,12 +39,27 @@ export function usePosition({ direction = "bottom" }: UsePositionOptions) {
39
39
  const tooltipRect = refElement.value.getBoundingClientRect();
40
40
  const targetRect = target.value.getBoundingClientRect();
41
41
  const winW = window.innerWidth;
42
+ const winH = window.innerHeight;
42
43
 
43
44
  let top: number;
44
45
  const scrollY = hasFixedParent(target.value) ? 0 : window.scrollY;
45
46
 
46
- top =
47
+ const spaceBelow = winH - targetRect.bottom;
48
+ const spaceAbove = targetRect.top;
49
+ const fitsBelow = spaceBelow >= tooltipRect.height + 6;
50
+ const fitsAbove = spaceAbove >= tooltipRect.height + 6;
51
+
52
+ const effectiveDirection =
47
53
  direction === "top"
54
+ ? fitsAbove || !fitsBelow
55
+ ? "top"
56
+ : "bottom"
57
+ : fitsBelow || !fitsAbove
58
+ ? "bottom"
59
+ : "top";
60
+
61
+ top =
62
+ effectiveDirection === "top"
48
63
  ? targetRect.top - tooltipRect.height - 6 + scrollY
49
64
  : targetRect.bottom + 6 + scrollY;
50
65
 
@@ -80,7 +95,7 @@ export function usePosition({ direction = "bottom" }: UsePositionOptions) {
80
95
  window.removeEventListener("resize", updatePosition);
81
96
  }
82
97
  },
83
- { flush: "post" }
98
+ { flush: "post" },
84
99
  );
85
100
 
86
101
  onBeforeUnmount(() => {