@tak-ps/vue-tabler 4.16.1 → 4.20.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
@@ -9,6 +9,16 @@
9
9
  - :tada: when adding new features
10
10
 
11
11
  ## Version History
12
+ ### v4.19.1
13
+
14
+ - :bug: Fix `TablerBorder` `tools` slot not appearing on hover when scoped CSS selector matched the wrong element
15
+
16
+ ### v4.19.0
17
+
18
+ - :rocket: Simplify `TablerBorder` to expose a generic `tools` slot for hover-revealed actions; remove edit-specific props and slots
19
+ ### v4.17.0
20
+
21
+ - :rocket: `TablerBorder` now supports `background`, `editable`, `editing`, `editAriaLabel` props plus `actions` and `editor` slots and an `edit` event for inline edit container patterns
12
22
 
13
23
  ### v4.16.1
14
24
 
@@ -1,7 +1,14 @@
1
1
  <template>
2
- <div class='card h-100 border border-light-subtle shadow-sm'>
2
+ <div
3
+ class='card tabler-border border border-light-subtle'
4
+ :class='{
5
+ "h-100": fillHeight,
6
+ "shadow-sm": shadow,
7
+ }'
8
+ :style='backgroundStyle'
9
+ >
3
10
  <div
4
- class='card-body d-flex flex-column'
11
+ class='card-body d-flex flex-column position-relative'
5
12
  :class='{
6
13
  "gap-4": gap === "lg",
7
14
  "gap-3": gap === "md",
@@ -21,19 +28,55 @@
21
28
  </slot>
22
29
  <slot name='header' />
23
30
  </div>
31
+
32
+ <div
33
+ v-if='$slots.tools'
34
+ class='tabler-border__tools position-absolute'
35
+ >
36
+ <slot name='tools' />
37
+ </div>
38
+
24
39
  <slot />
25
40
  </div>
26
41
  </div>
27
42
  </template>
28
43
 
29
44
  <script setup lang='ts'>
45
+ import { computed } from 'vue';
46
+
30
47
  export interface BorderProps {
31
48
  label?: string;
32
49
  gap?: 'sm' | 'md' | 'lg';
50
+ background?: string;
51
+ shadow?: boolean;
52
+ fillHeight?: boolean;
33
53
  }
34
54
 
35
- withDefaults(defineProps<BorderProps>(), {
55
+ const props = withDefaults(defineProps<BorderProps>(), {
36
56
  label: '',
37
57
  gap: 'md',
58
+ background: '',
59
+ shadow: true,
60
+ fillHeight: true,
61
+ });
62
+
63
+ const backgroundStyle = computed(() => {
64
+ if (!props.background) return undefined;
65
+ return { backgroundColor: props.background };
38
66
  });
39
67
  </script>
68
+
69
+ <style scoped>
70
+ .tabler-border__tools {
71
+ top: 8px;
72
+ right: 8px;
73
+ z-index: 2;
74
+ opacity: 0;
75
+ transition: opacity 0.15s ease-in-out;
76
+ }
77
+
78
+ .tabler-border:hover > .card-body > .tabler-border__tools,
79
+ .tabler-border:focus-within > .card-body > .tabler-border__tools {
80
+ opacity: 1;
81
+ }
82
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "4.16.1",
4
+ "version": "4.20.0",
5
5
  "lib": "lib.ts",
6
6
  "main": "lib.ts",
7
7
  "module": "lib.ts",