@tak-ps/vue-tabler 3.79.3 → 3.81.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,15 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v3.81.0
14
+
15
+ - :rocket: Add visual indicator on hover to TablerIconButton
16
+ - :tada: Support Disabled State for TablerIconButton & TablerDelete
17
+
18
+ ### v3.80.0
19
+
20
+ - :rocket: Add `clickAnywhereExpand` prop to TablerSlidedown
21
+
13
22
  ### v3.79.3
14
23
 
15
24
  - :bug: Remove Debug Code
@@ -1,17 +1,21 @@
1
1
  <template>
2
2
  <div>
3
3
  <template v-if='props.displaytype === "button"'>
4
- <div
4
+ <button
5
5
  class='btn btn-outline-danger'
6
- @click.stop.prevent='modal = true'
6
+ :disabled='props.disabled'
7
+ @click.stop.prevent='props.disabled ? undefined : modal = true'
7
8
  >
8
9
  <span v-text='props.label' />
9
- </div>
10
+ </button>
10
11
  </template>
11
12
  <template v-else-if='props.displaytype === "menu"'>
12
13
  <div
13
- class='cursor-pointer col-12 d-flex align-items-center px-2 py-2'
14
- @click.stop.prevent='modal = true'
14
+ class='col-12 d-flex align-items-center px-2 py-2'
15
+ :class='{
16
+ "cursor-pointer": !props.disabled,
17
+ }'
18
+ @click.stop.prevent='props.disabled ? undefined : modal = true'
15
19
  >
16
20
  <IconTrash
17
21
  :size='32'
@@ -26,7 +30,8 @@
26
30
  <template v-else>
27
31
  <TablerIconButton
28
32
  title='Delete'
29
- @click.stop.prevent='modal = true'
33
+ :disabled='props.disabled'
34
+ @click.stop.prevent='props.disabled ? undefined : modal = true'
30
35
  >
31
36
  <IconTrash
32
37
  :size='props.size'
@@ -91,6 +96,10 @@ const props = defineProps({
91
96
  type: Number,
92
97
  default: 32
93
98
  },
99
+ disabled: {
100
+ type: Boolean,
101
+ default: false
102
+ },
94
103
  displaytype: {
95
104
  type: String,
96
105
  default: 'button' // Or icon
@@ -1,10 +1,15 @@
1
1
  <template>
2
2
  <div
3
3
  :ref='iconid'
4
- v-tooltip='title'
4
+ v-tooltip='props.title'
5
5
  tabindex='0'
6
6
  role='button'
7
- class='cursor-pointer rounded'
7
+ :class='{
8
+ "cursor-pointer": props.disabled === false,
9
+ "cursor-default disabled": props.disabled === true,
10
+ "custom-hover": props.hover,
11
+ }'
12
+ class='rounded'
8
13
  @keyup.enter='icon.click()'
9
14
  >
10
15
  <slot />
@@ -18,10 +23,28 @@ const iconid = useId();
18
23
 
19
24
  const icon = useTemplateRef(iconid);
20
25
 
21
- defineProps({
26
+ const props = defineProps({
22
27
  title: {
23
28
  type: String,
24
29
  required: true
25
30
  },
31
+ hover: {
32
+ type: Boolean,
33
+ default: true
34
+ },
35
+ disabled: {
36
+ type: Boolean,
37
+ default: false
38
+ }
26
39
  })
27
40
  </script>
41
+
42
+ <style scoped>
43
+ .disabled {
44
+ color: var(--tblr-gray-500);
45
+ }
46
+
47
+ .custom-hover:not(.disabled):hover {
48
+ background-color: var(--tblr-border-color);
49
+ }
50
+ </style>
@@ -2,8 +2,10 @@
2
2
  <div
3
3
  class='hover-expandable rounded position-relative px-2 py-2'
4
4
  :class='{
5
- "expanded": isExpanded
5
+ "expanded": isExpanded,
6
+ "cursor-pointer": props.clickAnywhereExpand && !isExpanded
6
7
  }'
8
+ @click='(props.clickAnywhereExpand && !isExpanded) ? toggle() : null'
7
9
  >
8
10
  <div class='mb-2'>
9
11
  <slot />
@@ -21,7 +23,7 @@
21
23
  <div
22
24
  class='arrow-container'
23
25
  title='Toggle content'
24
- @click='toggle'
26
+ @click.stop='toggle'
25
27
  >
26
28
  <IconChevronDown
27
29
  size='24'
@@ -45,6 +47,13 @@ const isExpanded = ref(false);
45
47
 
46
48
  const contentWrapperRef = ref(null);
47
49
 
50
+ const props = defineProps({
51
+ clickAnywhereExpand: {
52
+ type: Boolean,
53
+ default: false
54
+ }
55
+ });
56
+
48
57
  function toggle() {
49
58
  isExpanded.value = !isExpanded.value;
50
59
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "3.79.3",
4
+ "version": "3.81.0",
5
5
  "lib": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",