@tak-ps/vue-tabler 3.80.0 → 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 +5 -0
- package/components/Delete.vue +15 -6
- package/components/IconButton.vue +26 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,11 @@
|
|
|
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
|
+
|
|
13
18
|
### v3.80.0
|
|
14
19
|
|
|
15
20
|
- :rocket: Add `clickAnywhereExpand` prop to TablerSlidedown
|
package/components/Delete.vue
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<template v-if='props.displaytype === "button"'>
|
|
4
|
-
<
|
|
4
|
+
<button
|
|
5
5
|
class='btn btn-outline-danger'
|
|
6
|
-
|
|
6
|
+
:disabled='props.disabled'
|
|
7
|
+
@click.stop.prevent='props.disabled ? undefined : modal = true'
|
|
7
8
|
>
|
|
8
9
|
<span v-text='props.label' />
|
|
9
|
-
</
|
|
10
|
+
</button>
|
|
10
11
|
</template>
|
|
11
12
|
<template v-else-if='props.displaytype === "menu"'>
|
|
12
13
|
<div
|
|
13
|
-
class='
|
|
14
|
-
|
|
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
|
-
|
|
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='
|
|
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>
|