@a-vision-software/vue-input-components 1.4.6 → 1.4.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a-vision-software/vue-input-components",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "A collection of reusable Vue 3 input components with TypeScript support",
5
5
  "author": "A-Vision Software",
6
6
  "license": "MIT",
@@ -21,19 +21,7 @@
21
21
 
22
22
  <script setup lang="ts">
23
23
  import { computed } from 'vue'
24
-
25
- interface ActionProps {
26
- id?: string
27
- icon?: string
28
- label?: string
29
- href?: string
30
- type?: 'button' | 'submit' | 'reset'
31
- disabled?: boolean
32
- color?: string
33
- size?: 'small' | 'regular' | 'large'
34
- variant?: 'solid' | 'transparent'
35
- presentation?: 'default' | 'minimal'
36
- }
24
+ import type { ActionProps } from '@/types/action'
37
25
 
38
26
  const props = withDefaults(defineProps<ActionProps>(), {
39
27
  id: undefined,
@@ -88,8 +88,9 @@
88
88
  </template>
89
89
  <template v-else-if="column.type === 'action'">
90
90
  <div class="list__row-actions" v-if="row[column.key]">
91
- <Action v-for="(action, actionIndex) in row[column.key]" :key="actionIndex" v-bind="action"
92
- :href="presentation === 'minimal' && !action.href ? `#/${action.id ? action.id : action.label.toLowerCase()}` : action.href"
91
+ <Action v-for="(action, actionIndex) in row[column.key] as ListAction[]" :key="actionIndex"
92
+ v-bind="action"
93
+ :href="presentation === 'minimal' && !action.href ? `#/${action.id ? action.id : action.label?.toLowerCase()}` : action.href"
93
94
  @click.stop="action.onActionClick ? action.onActionClick(row, action) : null"
94
95
  :presentation="presentation" size="small" :color="presentation === 'minimal' ? 'inherit' : ''" />
95
96
  </div>
@@ -117,7 +118,7 @@ import { ref, computed, watch } from 'vue'
117
118
  import TextInput from './TextInput.vue'
118
119
  import Action from './Action.vue'
119
120
  import Checkbox from './Checkbox.vue'
120
- import type { ListProps, ListEmits, ListColumn } from '../types/list'
121
+ import type { ListProps, ListEmits, ListColumn, ListAction } from '../types/list'
121
122
  import { config } from '../config'
122
123
 
123
124
  const props = withDefaults(defineProps<ListProps>(), {
@@ -366,6 +367,9 @@ defineExpose({
366
367
 
367
368
  .list__cell {
368
369
  padding: 0.75rem;
370
+ text-overflow: ellipsis;
371
+ white-space: nowrap;
372
+ overflow: hidden;
369
373
  }
370
374
 
371
375
  .list__column--sortable {
@@ -1,4 +1,14 @@
1
- export interface ActionProps {
1
+ /*******************************************************************************
2
+ * (c) 2025 Copyright A-Vision Software
3
+ *
4
+ * File description : Action types
5
+ *
6
+ * Created by : Arnold Velzel
7
+ * Created on : 26-05-2025
8
+ *
9
+ *******************************************************************************/
10
+
11
+ interface ActionProps {
2
12
  id?: string
3
13
  icon?: string
4
14
  label?: string
@@ -11,11 +21,13 @@ export interface ActionProps {
11
21
  presentation?: 'default' | 'minimal'
12
22
  }
13
23
 
14
- export interface ListActionProps extends ActionProps {
24
+ interface ListActionProps extends ActionProps {
15
25
  onActionClick: (row: any, action: any) => void
16
26
  }
17
27
 
18
- export interface ActionComponent {
28
+ interface ActionComponent {
19
29
  focus: () => void
20
30
  blur: () => void
21
31
  }
32
+
33
+ export type { ActionProps, ListActionProps, ActionComponent }
package/src/types/list.ts CHANGED
@@ -1,13 +1,23 @@
1
1
  import { ListActionProps } from './action'
2
2
 
3
- export type ListPresentation = 'default' | 'minimal'
3
+ type ListPresentation = 'default' | 'minimal'
4
4
 
5
- export type ListDataType = 'text' | 'number' | 'date' | 'action' | 'checkbox' | 'icon'
5
+ type ListDataType = 'text' | 'number' | 'date' | 'action' | 'checkbox' | 'icon'
6
6
 
7
- export interface ListColumn {
7
+ interface ListAction {
8
+ id: string
9
+ label?: string
10
+ icon?: string
11
+ color?: string
12
+ href?: string
13
+ onClick?: (item: any) => void
14
+ onActionClick?: (item: any, action: any) => void
15
+ }
16
+
17
+ interface ListColumn {
8
18
  key: string
9
19
  label: string
10
- type?: 'text' | 'number' | 'date' | 'action' | 'checkbox' | 'icon'
20
+ type?: ListDataType
11
21
  align?: 'left' | 'center' | 'right'
12
22
  sortable?: boolean
13
23
  filterable?: boolean
@@ -16,12 +26,12 @@ export interface ListColumn {
16
26
  maxWidth?: string
17
27
  }
18
28
 
19
- export interface ListFilter {
29
+ interface ListFilter {
20
30
  placeholder?: string
21
31
  debounce?: number
22
32
  }
23
33
 
24
- export interface ListProps {
34
+ interface ListProps {
25
35
  columns: ListColumn[]
26
36
  data: any[]
27
37
  actions?: ListActionProps[]
@@ -34,19 +44,30 @@ export interface ListProps {
34
44
  width?: string
35
45
  }
36
46
 
37
- export interface ListEmits {
47
+ interface ListEmits {
38
48
  (e: 'update:filter', value: string): void
39
49
  (e: 'row-click', row: any, index: number): void
40
50
  (e: 'row-dblclick', row: any, index: number): void
41
51
  }
42
52
 
43
- export interface ListComponent {
53
+ interface ListComponent {
44
54
  focus: () => void
45
55
  blur: () => void
46
56
  clearFilter: () => void
47
57
  }
48
58
 
49
- export interface ListIconProps {
59
+ interface ListIconProps {
50
60
  icon: string
51
61
  color?: string
52
62
  }
63
+
64
+ export type {
65
+ ListPresentation,
66
+ ListProps,
67
+ ListAction,
68
+ ListEmits,
69
+ ListComponent,
70
+ ListIconProps,
71
+ ListColumn,
72
+ ListFilter,
73
+ }