@tak-ps/vue-tabler 5.1.0 → 5.2.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 +4 -0
- package/components/Delete.vue +3 -1
- package/components/IconButton.vue +2 -1
- package/package.json +1 -1
- package/test/IconButton.spec.ts +14 -12
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
### Pending
|
|
14
14
|
|
|
15
|
+
### v5.2.0
|
|
16
|
+
|
|
17
|
+
- :rocket: Allow setting custom Delete title
|
|
18
|
+
|
|
15
19
|
### v5.1.0
|
|
16
20
|
|
|
17
21
|
- :bug: TablerSlidedown: `clickAnywhereExpand` no longer collapses an expanded slidedown - collapse is explicit via the arrow control (or opt-in via `clickAnywhereCollapse`)
|
package/components/Delete.vue
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
<template v-else>
|
|
31
31
|
<TablerIconButton
|
|
32
|
-
title='
|
|
32
|
+
:title='props.title'
|
|
33
33
|
:disabled='props.disabled'
|
|
34
34
|
@click.stop.prevent='openModal'
|
|
35
35
|
>
|
|
@@ -103,6 +103,7 @@ import {
|
|
|
103
103
|
|
|
104
104
|
export interface DeleteProps {
|
|
105
105
|
label?: string;
|
|
106
|
+
title?: string;
|
|
106
107
|
size?: number;
|
|
107
108
|
disabled?: boolean;
|
|
108
109
|
displaytype?: 'button' | 'icon' | 'menu';
|
|
@@ -111,6 +112,7 @@ export interface DeleteProps {
|
|
|
111
112
|
|
|
112
113
|
const props = withDefaults(defineProps<DeleteProps>(), {
|
|
113
114
|
label: 'Delete',
|
|
115
|
+
title: 'Delete',
|
|
114
116
|
size: 32,
|
|
115
117
|
disabled: false,
|
|
116
118
|
displaytype: 'button'
|
package/package.json
CHANGED
package/test/IconButton.spec.ts
CHANGED
|
@@ -5,16 +5,6 @@ import { mount } from '@vue/test-utils'
|
|
|
5
5
|
import IconButton from '../components/IconButton.vue'
|
|
6
6
|
import iconButtonSource from '../components/IconButton.vue?raw'
|
|
7
7
|
|
|
8
|
-
const global = {
|
|
9
|
-
directives: {
|
|
10
|
-
tooltip: {
|
|
11
|
-
mounted() {
|
|
12
|
-
return undefined
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
}
|
|
17
|
-
|
|
18
8
|
describe('TablerIconButton', () => {
|
|
19
9
|
it('adds hover styling when no explicit color is provided', () => {
|
|
20
10
|
const wrapper = mount(IconButton, {
|
|
@@ -24,12 +14,25 @@ describe('TablerIconButton', () => {
|
|
|
24
14
|
slots: {
|
|
25
15
|
default: 'X',
|
|
26
16
|
},
|
|
27
|
-
global,
|
|
28
17
|
})
|
|
29
18
|
|
|
30
19
|
expect(wrapper.get('div').classes()).toContain('custom-hover')
|
|
31
20
|
})
|
|
32
21
|
|
|
22
|
+
it('exposes the title as a native tooltip and accessible name', () => {
|
|
23
|
+
const wrapper = mount(IconButton, {
|
|
24
|
+
props: {
|
|
25
|
+
title: 'Toggle Panel',
|
|
26
|
+
},
|
|
27
|
+
slots: {
|
|
28
|
+
default: 'X',
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
expect(wrapper.get('div').attributes('title')).toBe('Toggle Panel')
|
|
33
|
+
expect(wrapper.get('div').attributes('aria-label')).toBe('Toggle Panel')
|
|
34
|
+
})
|
|
35
|
+
|
|
33
36
|
it('skips hover styling when a custom color is provided', () => {
|
|
34
37
|
const wrapper = mount(IconButton, {
|
|
35
38
|
props: {
|
|
@@ -39,7 +42,6 @@ describe('TablerIconButton', () => {
|
|
|
39
42
|
slots: {
|
|
40
43
|
default: 'X',
|
|
41
44
|
},
|
|
42
|
-
global,
|
|
43
45
|
})
|
|
44
46
|
|
|
45
47
|
expect(wrapper.get('div').classes()).not.toContain('custom-hover')
|