@a-vision-software/vue-input-components 1.4.25 → 1.4.27

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.25",
3
+ "version": "1.4.27",
4
4
  "description": "A collection of reusable Vue 3 input components with TypeScript support",
5
5
  "author": "A-Vision Software",
6
6
  "license": "MIT",
@@ -54,14 +54,21 @@
54
54
  "test": "vitest"
55
55
  },
56
56
  "peerDependencies": {
57
- "vue": "^3.5.0"
57
+ "vue": "^3.5.0",
58
+ "floating-vue": "^5.2.2"
59
+ },
60
+ "peerDependenciesMeta": {
61
+ "floating-vue": {
62
+ "optional": true
63
+ }
58
64
  },
59
65
  "dependencies": {
60
66
  "@fortawesome/fontawesome-svg-core": "^6.7.0",
61
67
  "@fortawesome/free-regular-svg-icons": "^6.7.0",
62
68
  "@fortawesome/free-solid-svg-icons": "^6.7.0",
63
69
  "@fortawesome/vue-fontawesome": "^3.0.0",
64
- "@vuepic/vue-datepicker": "^11.0.2"
70
+ "@vuepic/vue-datepicker": "^11.0.2",
71
+ "floating-vue": "^5.2.2"
65
72
  },
66
73
  "devDependencies": {
67
74
  "@tsconfig/node20": "^20.1.2",
@@ -33,6 +33,7 @@
33
33
  --disabled-background: #f5f7fa;
34
34
  --card-bg: #ffffff;
35
35
  --background-color: #f8f9fa;
36
+ --tooltip-bg-color: #ffeba1;
36
37
 
37
38
  /* Input colors */
38
39
  --input-bg-color: rgba(255, 255, 255, 0.8);
@@ -73,4 +74,4 @@
73
74
  --success-text-color: var(--success-color);
74
75
  --error-bg-color: var(--error-color-light);
75
76
  --error-text-color: var(--error-color);
76
- }
77
+ }
@@ -148,6 +148,14 @@ a:hover {
148
148
  }
149
149
  }
150
150
 
151
+ /* Tooltip styles (floating-vue) */
152
+ .v-popper--theme-tooltip .v-popper__inner {
153
+ background: var(--tooltip-bg-color);
154
+ color: var(--text-color);
155
+ border: 1px solid var(--border-color);
156
+ font-size: 14px;
157
+ }
158
+
151
159
  /* Print styles */
152
160
  @media print {
153
161
  body {
@@ -168,11 +168,15 @@
168
168
  {{ formatTime(row[column.key]) }}
169
169
  </template>
170
170
  <template v-else-if="column.type === 'action'">
171
- <div class="list__row-actions" v-if="row[column.key]">
171
+ <div
172
+ class="list__row-actions"
173
+ v-if="row[column.key]"
174
+ >
172
175
  <Action
173
- v-for="(action, actionIndex) in row[column.key] as ListAction[]"
176
+ v-for="(action, actionIndex) in row[column.key] as ListActionProps[]"
174
177
  :key="actionIndex"
175
178
  v-bind="action"
179
+ v-tooltip="getActionTooltip(action)"
176
180
  :href="
177
181
  presentation === 'minimal' && !action.href
178
182
  ? `#/${action.id ? action.id : action.label?.toLowerCase()}`
@@ -219,7 +223,8 @@ import { ref, computed, watch } from 'vue'
219
223
  import TextInput from './TextInput.vue'
220
224
  import Action from './Action.vue'
221
225
  import Checkbox from './Checkbox.vue'
222
- import type { ListProps, ListEmits, ListColumn, ListAction, ListRowData } from '../types/list'
226
+ import type { ListProps, ListEmits, ListColumn, ListRowData } from '../types/list'
227
+ import type { ListActionProps } from '../types/action'
223
228
  import { config } from '../config'
224
229
 
225
230
  const props = withDefaults(defineProps<ListProps>(), {
@@ -447,6 +452,12 @@ const getCellClasses = (row: any, column: ListColumn) => {
447
452
  })
448
453
  .join(' ')
449
454
  }
455
+
456
+ function getActionTooltip(action: ListActionProps) {
457
+ const tooltip = action?.tooltip
458
+ if (!tooltip) return false
459
+ return { content: tooltip, html: true }
460
+ }
450
461
  </script>
451
462
 
452
463
  <style scoped>
package/src/main.ts CHANGED
@@ -3,6 +3,8 @@ import { library } from '@fortawesome/fontawesome-svg-core'
3
3
  import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
4
4
  import { fas } from '@fortawesome/free-solid-svg-icons'
5
5
  import { far } from '@fortawesome/free-regular-svg-icons'
6
+ import FloatingVue from 'floating-vue'
7
+ import 'floating-vue/dist/style.css'
6
8
 
7
9
  import App from './App.vue'
8
10
  import router from './router'
@@ -16,6 +18,7 @@ library.add(fas, far)
16
18
  const app = createApp(App)
17
19
 
18
20
  app.use(router)
21
+ app.use(FloatingVue)
19
22
  app.component('font-awesome-icon', FontAwesomeIcon)
20
23
 
21
24
  app.mount('#app')
@@ -19,6 +19,7 @@ interface ActionProps {
19
19
  variant?: 'solid' | 'transparent'
20
20
  size?: 'small' | 'regular' | 'large'
21
21
  presentation?: 'default' | 'minimal'
22
+ tooltip?: string
22
23
  }
23
24
 
24
25
  interface ListActionProps extends ActionProps {
@@ -5,7 +5,7 @@
5
5
  <font-awesome-icon :icon="['fas', 'arrow-left']" />
6
6
  <span>Back to Dashboard</span>
7
7
  </router-link>
8
- <h1>List Component Test</h1>
8
+ <h1 v-tooltip="'List Component Test'">List Component Test</h1>
9
9
  </div>
10
10
 
11
11
  <!-- Default Presentation -->
@@ -114,6 +114,7 @@ const listActions = ref<ListActionProps[]>([
114
114
  label: 'New user',
115
115
  icon: 'add',
116
116
  color: 'var(--primary-color)',
117
+ tooltip: 'Create a new user account',
117
118
  onActionClick: listActionClick,
118
119
  },
119
120
  ])
@@ -212,6 +213,7 @@ const data = ref<ListRowData[]>([
212
213
  id: 'edit',
213
214
  label: 'Edit',
214
215
  icon: 'edit',
216
+ tooltip: 'Edit user details',
215
217
  onActionClick: rowActionClick,
216
218
  },
217
219
  ],
@@ -242,6 +244,7 @@ const data = ref<ListRowData[]>([
242
244
  id: 'edit',
243
245
  label: 'Edit',
244
246
  icon: 'edit',
247
+ tooltip: 'Edit user information',
245
248
  onActionClick: rowActionClick,
246
249
  },
247
250
  {
@@ -249,6 +252,7 @@ const data = ref<ListRowData[]>([
249
252
  label: 'Delete',
250
253
  icon: 'trash',
251
254
  color: 'var(--danger-color)',
255
+ tooltip: 'Permanently delete this user',
252
256
  onActionClick: rowActionClick,
253
257
  },
254
258
  ],
@@ -329,6 +333,7 @@ const data = ref<ListRowData[]>([
329
333
  id: 'view',
330
334
  label: 'View',
331
335
  icon: 'eye',
336
+ tooltip: 'View user profile',
332
337
  onActionClick: rowActionClick,
333
338
  },
334
339
  ],
@@ -407,6 +412,7 @@ const data = ref<ListRowData[]>([
407
412
  id: 'view',
408
413
  label: 'View',
409
414
  icon: 'eye',
415
+ tooltip: 'View user profile',
410
416
  onActionClick: rowActionClick,
411
417
  },
412
418
  ],
@@ -429,6 +435,7 @@ const data = ref<ListRowData[]>([
429
435
  id: 'view',
430
436
  label: 'View',
431
437
  icon: 'eye',
438
+ tooltip: 'View user profile',
432
439
  onActionClick: rowActionClick,
433
440
  },
434
441
  ],
@@ -459,6 +466,7 @@ const data = ref<ListRowData[]>([
459
466
  id: 'info',
460
467
  label: 'Info',
461
468
  icon: 'info',
469
+ tooltip: 'View additional information about this row',
462
470
  onActionClick: rowActionClick,
463
471
  },
464
472
  ],