@tak-ps/vue-tabler 4.13.0 → 4.15.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/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v4.15.0 - 2026-04-20
14
+
15
+ - :rocket: Click anywhere collapse
16
+
17
+ ### v4.14.0 - 2026-04-19
18
+
19
+ - :rocket: Add ability to turn off border
20
+
13
21
  ### v4.13.0
14
22
 
15
23
  - :tada: Add PillGroup Component
@@ -3,9 +3,10 @@
3
3
  class='hover-expandable rounded position-relative px-2 py-2'
4
4
  :class='{
5
5
  "expanded mb-3": isExpanded,
6
- "cursor-pointer": props.clickAnywhereExpand && !isExpanded
6
+ "cursor-pointer": props.clickAnywhereExpand || props.clickAnywhereCollapse,
7
+ "no-border": !props.border
7
8
  }'
8
- @click='(props.clickAnywhereExpand && !isExpanded) ? toggle() : null'
9
+ @click='handleClick'
9
10
  >
10
11
  <div
11
12
  :class='{
@@ -50,12 +51,16 @@ import {
50
51
 
51
52
  export interface SlidedownProps {
52
53
  arrow?: boolean;
54
+ border?: boolean;
53
55
  clickAnywhereExpand?: boolean;
56
+ clickAnywhereCollapse?: boolean;
54
57
  }
55
58
 
56
59
  const props = withDefaults(defineProps<SlidedownProps>(), {
57
60
  arrow: true,
58
- clickAnywhereExpand: false
61
+ border: true,
62
+ clickAnywhereExpand: false,
63
+ clickAnywhereCollapse: false
59
64
  });
60
65
 
61
66
  const isExpanded = ref(false);
@@ -74,6 +79,19 @@ function toggle() {
74
79
  el.style.maxHeight = ''; // Reset to CSS default (0)
75
80
  }
76
81
  }
82
+ }
83
+
84
+ function handleClick(event: MouseEvent) {
85
+ // Don't handle clicks from the expanded content wrapper
86
+ const el = contentWrapperRef.value;
87
+ if (el && el === event.target) return;
88
+ if (el && el.contains(event.target as Node)) return;
89
+
90
+ if (props.clickAnywhereExpand) {
91
+ toggle();
92
+ } else if (props.clickAnywhereCollapse && isExpanded.value) {
93
+ toggle();
94
+ }
77
95
  };
78
96
  </script>
79
97
 
@@ -83,10 +101,18 @@ function toggle() {
83
101
  transition: border-color 0.2s ease;
84
102
  }
85
103
 
104
+ .hover-expandable.no-border {
105
+ border: none;
106
+ }
107
+
86
108
  .hover-expandable:not(.expanded):hover {
87
109
  border: 1px solid color-mix(in srgb, var(--tblr-border-color), white 10%);
88
110
  }
89
111
 
112
+ .hover-expandable.no-border:not(.expanded):hover {
113
+ border: none;
114
+ }
115
+
90
116
  .hover-expandable:not(.expanded):hover .arrow-container {
91
117
  border-color: color-mix(in srgb, var(--tblr-border-color), white 25%);
92
118
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "4.13.0",
4
+ "version": "4.15.0",
5
5
  "lib": "lib.ts",
6
6
  "main": "lib.ts",
7
7
  "module": "lib.ts",