@a-vision-software/vue-input-components 1.4.19 → 1.4.21

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.
@@ -11,28 +11,53 @@
11
11
  <!-- Default Presentation -->
12
12
  <section class="list-test__section">
13
13
  <h2>Default Presentation</h2>
14
- <List :actions="listActions" :columns="columns" :data="data" :filter="{ placeholder: 'Search users...' }"
15
- @row-click="handleRowClick" @row-dblclick="handleRowDblClick" :CSVDownload="'users'" />
14
+ <List
15
+ :actions="listActions"
16
+ :columns="columns"
17
+ :data="data"
18
+ :filter="{ placeholder: 'Search users...' }"
19
+ @row-click="handleRowClick"
20
+ @row-dblclick="handleRowDblClick"
21
+ :CSVDownload="'users'"
22
+ />
16
23
  </section>
17
24
 
18
25
  <!-- Minimal Presentation -->
19
26
  <section class="list-test__section">
20
27
  <h2>Minimal Presentation</h2>
21
- <List :actions="listActions" :columns="columns" :data="data" presentation="minimal" width="50em"
22
- :filter="{ placeholder: 'Search users...' }" @row-click="handleRowClick" @row-dblclick="handleRowDblClick"
23
- :CSVDownload="'user-list'" />
28
+ <List
29
+ :actions="listActions"
30
+ :columns="columns"
31
+ :data="data"
32
+ presentation="minimal"
33
+ width="50em"
34
+ :filter="{ placeholder: 'Search users...' }"
35
+ @row-click="handleRowClick"
36
+ @row-dblclick="handleRowDblClick"
37
+ :CSVDownload="'user-list'"
38
+ />
24
39
  </section>
25
40
 
26
41
  <!-- Loading State -->
27
42
  <section class="list-test__section">
28
43
  <h2>Loading State</h2>
29
- <List :columns="columns" :data="[]" :loading="true" :filter="{ placeholder: 'Search users...' }" />
44
+ <List
45
+ :columns="columns"
46
+ :data="[]"
47
+ :loading="true"
48
+ :filter="{ placeholder: 'Search users...' }"
49
+ />
30
50
  </section>
31
51
 
32
52
  <!-- Empty State -->
33
53
  <section class="list-test__section">
34
54
  <h2>Empty State</h2>
35
- <List :columns="columns" :data="[]" empty-message="No users found" :filter="{ placeholder: 'Search users...' }" />
55
+ <List
56
+ :columns="columns"
57
+ :data="[]"
58
+ empty-message="No users found"
59
+ :filter="{ placeholder: 'Search users...' }"
60
+ />
36
61
  </section>
37
62
  </div>
38
63
  </template>
@@ -40,7 +65,13 @@
40
65
  <script setup lang="ts">
41
66
  import { ref } from 'vue'
42
67
  import List from '@/components/List.vue'
43
- import type { ListColumn, ListActionProps, ListCheckboxProps, ListIconProps } from '@/types'
68
+ import type {
69
+ ListColumn,
70
+ ListActionProps,
71
+ ListCheckboxProps,
72
+ ListIconProps,
73
+ ListRowData,
74
+ } from '@/types'
44
75
 
45
76
  const autosaveActive = (info: any) => {
46
77
  console.log('Autosave active', info)
@@ -83,8 +114,8 @@ const listActions = ref<ListActionProps[]>([
83
114
  label: 'New user',
84
115
  icon: 'add',
85
116
  color: 'var(--primary-color)',
86
- onActionClick: listActionClick
87
- }
117
+ onActionClick: listActionClick,
118
+ },
88
119
  ])
89
120
 
90
121
  const columns: ListColumn[] = [
@@ -95,7 +126,7 @@ const columns: ListColumn[] = [
95
126
  sortable: false,
96
127
  filterable: false,
97
128
  align: 'center',
98
- width: '4rem'
129
+ width: '4rem',
99
130
  },
100
131
  {
101
132
  key: 'status',
@@ -104,28 +135,35 @@ const columns: ListColumn[] = [
104
135
  sortable: false,
105
136
  filterable: false,
106
137
  align: 'center',
107
- width: '4rem'
138
+ width: '4rem',
139
+ headerTooltip: 'User status indicator',
108
140
  },
109
141
  {
110
142
  key: 'name',
111
143
  label: 'Name',
112
144
  type: 'text',
113
145
  sortable: true,
114
- filterable: true
146
+ filterable: true,
147
+ headerTooltip: 'The full name of the user',
115
148
  },
116
149
  {
117
150
  key: 'email',
118
151
  label: 'Email',
119
152
  type: 'email',
120
153
  sortable: true,
121
- filterable: true
154
+ filterable: true,
155
+ headerTooltip: 'Contact email address',
156
+ cellClasses: {
157
+ lightredEmail: (value: any) => value.includes('bob'),
158
+ },
122
159
  },
123
160
  {
124
161
  key: 'joined',
125
162
  label: 'Joined',
126
163
  type: 'date',
127
164
  sortable: true,
128
- width: '6rem'
165
+ width: '6rem',
166
+ headerTooltip: 'Account creation date',
129
167
  },
130
168
  {
131
169
  key: 'active',
@@ -133,25 +171,58 @@ const columns: ListColumn[] = [
133
171
  type: 'checkbox',
134
172
  align: 'center',
135
173
  sortable: true,
136
- width: '4rem'
174
+ width: '4rem',
175
+ headerTooltip: 'Account active status',
137
176
  },
138
177
  {
139
178
  key: 'actions',
140
179
  label: 'Actions',
141
180
  type: 'action',
142
181
  align: 'right',
143
- width: '12rem'
144
- }
182
+ width: '12rem',
183
+ },
145
184
  ]
146
185
 
147
- const data = ref([
186
+ const data = ref<ListRowData[]>([
187
+ {
188
+ // This row will always appear at the top when sorting
189
+ excludeFromSort: true,
190
+ fixed: 'top',
191
+ selected: false,
192
+ select: <ListCheckboxProps>{
193
+ modelValue: false,
194
+ disabled: false,
195
+ onCheckboxClick: selectClick,
196
+ },
197
+ status: <ListIconProps>{
198
+ icon: 'crown',
199
+ color: 'gold',
200
+ },
201
+ name: 'Current User (Fixed at Top)',
202
+ email: 'current@example.com',
203
+ joined: '2024-01-01',
204
+ active: {
205
+ modelValue: true,
206
+ disabled: false,
207
+ autosave: autosaveActive,
208
+ onCheckboxClick: selectClick,
209
+ },
210
+ actions: <ListActionProps[]>[
211
+ {
212
+ id: 'edit',
213
+ label: 'Edit',
214
+ icon: 'edit',
215
+ onActionClick: rowActionClick,
216
+ },
217
+ ],
218
+ },
148
219
  {
149
220
  class: 'testclass',
150
221
  selected: false,
151
222
  select: <ListCheckboxProps>{
152
223
  modelValue: false,
153
224
  disabled: false,
154
- onCheckboxClick: selectClick
225
+ onCheckboxClick: selectClick,
155
226
  },
156
227
  status: <ListIconProps>{
157
228
  icon: 'star',
@@ -164,30 +235,30 @@ const data = ref([
164
235
  modelValue: true,
165
236
  disabled: false,
166
237
  autosave: autosaveActive,
167
- onCheckboxClick: selectClick
238
+ onCheckboxClick: selectClick,
168
239
  },
169
240
  actions: <ListActionProps[]>[
170
241
  {
171
242
  id: 'edit',
172
243
  label: 'Edit',
173
244
  icon: 'edit',
174
- onActionClick: rowActionClick
245
+ onActionClick: rowActionClick,
175
246
  },
176
247
  {
177
248
  id: 'delete',
178
249
  label: 'Delete',
179
250
  icon: 'trash',
180
251
  color: 'var(--danger-color)',
181
- onActionClick: rowActionClick
182
- }
183
- ]
252
+ onActionClick: rowActionClick,
253
+ },
254
+ ],
184
255
  },
185
256
  {
186
257
  selected: false,
187
258
  select: <ListCheckboxProps>{
188
259
  modelValue: false,
189
260
  disabled: false,
190
- onCheckboxClick: selectClick
261
+ onCheckboxClick: selectClick,
191
262
  },
192
263
  status: <ListIconProps>{
193
264
  icon: 'star',
@@ -199,51 +270,51 @@ const data = ref([
199
270
  active: <ListCheckboxProps>{
200
271
  modelValue: false,
201
272
  disabled: false,
202
- autosave: autosaveActive
273
+ autosave: autosaveActive,
203
274
  },
204
275
  actions: <ListActionProps[]>[
205
276
  {
206
277
  id: 'edit',
207
278
  label: 'Edit',
208
279
  icon: 'edit',
209
- onActionClick: rowActionClick
280
+ onActionClick: rowActionClick,
210
281
  },
211
282
  {
212
283
  id: 'delete',
213
284
  label: 'Delete',
214
285
  icon: 'trash',
215
- onActionClick: rowActionClick
216
- }
217
- ]
286
+ onActionClick: rowActionClick,
287
+ },
288
+ ],
218
289
  },
219
290
  {
220
291
  select: <ListCheckboxProps>{
221
292
  modelValue: false,
222
293
  disabled: false,
223
- onCheckboxClick: selectClick
294
+ onCheckboxClick: selectClick,
224
295
  },
225
296
  name: 'Alice Johnson',
226
297
  email: 'alice@example.com',
227
298
  joined: '2024-01-10',
228
299
  active: <ListCheckboxProps>{
229
300
  modelValue: true,
230
- disabled: false
301
+ disabled: false,
231
302
  },
232
303
  actions: <ListActionProps[]>[
233
304
  {
234
305
  id: 'edit',
235
306
  label: 'Edit',
236
307
  icon: 'edit',
237
- onActionClick: rowActionClick
308
+ onActionClick: rowActionClick,
238
309
  },
239
310
  {
240
311
  id: 'delete',
241
312
  label: 'Delete',
242
313
  icon: 'trash',
243
314
  disabled: true,
244
- onActionClick: rowActionClick
245
- }
246
- ]
315
+ onActionClick: rowActionClick,
316
+ },
317
+ ],
247
318
  },
248
319
  {
249
320
  name: 'Bob Wilson',
@@ -251,119 +322,148 @@ const data = ref([
251
322
  joined: '2023-11-05',
252
323
  active: <ListCheckboxProps>{
253
324
  modelValue: true,
254
- disabled: true
325
+ disabled: true,
255
326
  },
256
327
  actions: <ListActionProps[]>[
257
328
  {
258
329
  id: 'view',
259
330
  label: 'View',
260
331
  icon: 'eye',
261
- onActionClick: rowActionClick
262
- }
263
- ]
332
+ onActionClick: rowActionClick,
333
+ },
334
+ ],
264
335
  },
265
336
  {
266
337
  select: <ListCheckboxProps>{
267
338
  modelValue: false,
268
339
  disabled: false,
269
- onCheckboxClick: selectClick
340
+ onCheckboxClick: selectClick,
270
341
  },
271
342
  name: 'Carol Brown',
272
343
  email: 'carol@example.com',
273
344
  joined: '2023-08-30',
274
345
  active: <ListCheckboxProps>{
275
346
  modelValue: false,
276
- disabled: false
347
+ disabled: false,
277
348
  },
278
349
  actions: <ListActionProps[]>[
279
350
  {
280
351
  id: 'edit',
281
352
  label: 'Edit',
282
353
  icon: 'edit',
283
- onActionClick: rowActionClick
354
+ onActionClick: rowActionClick,
284
355
  },
285
356
  {
286
357
  id: 'delete',
287
358
  label: 'Delete',
288
359
  icon: 'trash',
289
- onActionClick: rowActionClick
290
- }
291
- ]
360
+ onActionClick: rowActionClick,
361
+ },
362
+ ],
292
363
  },
293
364
  {
294
365
  select: <ListCheckboxProps>{
295
366
  modelValue: false,
296
367
  disabled: false,
297
- onCheckboxClick: selectClick
368
+ onCheckboxClick: selectClick,
298
369
  },
299
370
  name: 'David Miller',
300
371
  email: 'david@example.com',
301
372
  joined: '2024-02-01',
302
373
  active: <ListCheckboxProps>{
303
374
  modelValue: true,
304
- disabled: false
375
+ disabled: false,
305
376
  },
306
377
  actions: <ListActionProps[]>[
307
378
  {
308
379
  id: 'edit',
309
380
  label: 'Edit',
310
381
  icon: 'edit',
311
- onActionClick: rowActionClick
382
+ onActionClick: rowActionClick,
312
383
  },
313
384
  {
314
385
  id: 'delete',
315
386
  label: 'Delete',
316
387
  icon: 'trash',
317
- onActionClick: rowActionClick
318
- }
319
- ]
388
+ onActionClick: rowActionClick,
389
+ },
390
+ ],
320
391
  },
321
392
  {
322
393
  select: <ListCheckboxProps>{
323
394
  modelValue: false,
324
395
  disabled: false,
325
- onCheckboxClick: selectClick
396
+ onCheckboxClick: selectClick,
326
397
  },
327
398
  name: 'Eva Garcia',
328
399
  email: 'eva@example.com',
329
400
  joined: '2023-05-15',
330
401
  active: {
331
402
  modelValue: true,
332
- disabled: false
403
+ disabled: false,
333
404
  },
334
405
  actions: <ListActionProps[]>[
335
406
  {
336
407
  id: 'view',
337
408
  label: 'View',
338
409
  icon: 'eye',
339
- onActionClick: rowActionClick
340
- }
341
- ]
410
+ onActionClick: rowActionClick,
411
+ },
412
+ ],
342
413
  },
343
414
  {
344
415
  select: <ListCheckboxProps>{
345
416
  modelValue: false,
346
417
  disabled: false,
347
- onCheckboxClick: selectClick
418
+ onCheckboxClick: selectClick,
348
419
  },
349
420
  name: 'Frank Lee',
350
421
  email: 'frank@example.com',
351
422
  joined: '2023-12-20',
352
423
  active: {
353
424
  modelValue: false,
354
- disabled: true
425
+ disabled: true,
355
426
  },
356
427
  actions: <ListActionProps[]>[
357
428
  {
358
429
  id: 'view',
359
430
  label: 'View',
360
431
  icon: 'eye',
361
- onActionClick: rowActionClick
362
- }
363
- ]
364
- }
432
+ onActionClick: rowActionClick,
433
+ },
434
+ ],
435
+ },
436
+ {
437
+ // This row will always appear at the bottom when sorting and is excluded from filtering
438
+ excludeFromSort: true,
439
+ excludeFromFilter: true,
440
+ fixed: 'bottom',
441
+ select: <ListCheckboxProps>{
442
+ modelValue: false,
443
+ disabled: false,
444
+ onCheckboxClick: selectClick,
445
+ },
446
+ status: <ListIconProps>{
447
+ icon: 'info-circle',
448
+ color: 'blue',
449
+ },
450
+ name: 'Footer Row (Fixed at Bottom)',
451
+ email: 'footer@example.com',
452
+ joined: '2024-12-31',
453
+ active: {
454
+ modelValue: true,
455
+ disabled: false,
456
+ },
457
+ actions: <ListActionProps[]>[
458
+ {
459
+ id: 'info',
460
+ label: 'Info',
461
+ icon: 'info',
462
+ onActionClick: rowActionClick,
463
+ },
464
+ ],
465
+ },
365
466
  ])
366
-
367
467
  </script>
368
468
 
369
469
  <style scoped>
@@ -400,4 +500,12 @@ const data = ref([
400
500
  margin-bottom: 1rem;
401
501
  color: var(--text-primary);
402
502
  }
503
+
504
+ :deep(.list-test__section .list__cell.lightredEmail) {
505
+ background-color: rgba(255, 0, 0, 0.1);
506
+ }
507
+
508
+ :deep(.list-test__section .list__row--testclass) {
509
+ background-color: rgba(155, 155, 0, 0.1);
510
+ }
403
511
  </style>