@tak-ps/vue-tabler 5.1.0 → 5.2.1

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
@@ -12,6 +12,14 @@
12
12
 
13
13
  ### Pending
14
14
 
15
+ ### v5.2.1
16
+
17
+ - :bug: Ensure Input Error border is shown consistently
18
+
19
+ ### v5.2.0
20
+
21
+ - :rocket: Allow setting custom Delete title
22
+
15
23
  ### v5.1.0
16
24
 
17
25
  - :bug: TablerSlidedown: `clickAnywhereExpand` no longer collapses an expanded slidedown - collapse is explicit via the arrow control (or opt-in via `clickAnywhereCollapse`)
@@ -29,7 +29,7 @@
29
29
  </template>
30
30
  <template v-else>
31
31
  <TablerIconButton
32
- title='Delete'
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'
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <div
3
3
  :ref='iconid'
4
- v-tooltip='props.title'
4
+ :title='props.title'
5
+ :aria-label='props.title'
5
6
  tabindex='0'
6
7
  role='button'
7
8
  :class='{
@@ -324,6 +324,17 @@ input:autofill {
324
324
  border-color: var(--tblr-border-color);
325
325
  }
326
326
 
327
+ /*
328
+ * The border-color reset above outranks Tabler's own .form-control.is-invalid
329
+ * rule (the scoped attribute selector adds specificity), so restore the
330
+ * invalid border at the same scope or the red outline only ever appears on
331
+ * the end adornment span
332
+ */
333
+ .input-group :deep(.form-control.is-invalid),
334
+ .position-relative > .form-control.is-invalid {
335
+ border-color: var(--tblr-form-invalid-border-color, var(--tblr-danger));
336
+ }
337
+
327
338
  .input-group :deep(.form-control),
328
339
  .position-relative > .form-control {
329
340
  color: var(--tblr-body-color);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "5.1.0",
4
+ "version": "5.2.1",
5
5
  "lib": "lib.ts",
6
6
  "main": "lib.ts",
7
7
  "module": "lib.ts",
@@ -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')