@modeltables/fontawesome-vuetify 1.3.1 → 1.4.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/README.md CHANGED
@@ -0,0 +1,73 @@
1
+ @modeltables/fontawesome-vuetify — focused Vue table toolkit
2
+
3
+ @modeltables/fontawesome-vuetify is a small, practical Vue library that makes building polished data tables quick and painless. It provides ready-to-use components and TypeScript helpers you can drop into Vuetify or plain Vue apps to add filtering, sorting, searching and pagination with minimal setup.
4
+
5
+ Why use @modeltables/fontawesome-vuetify?
6
+
7
+ - Easy to use: helpful wrappers for headers, filters and table views so your grids look intentional from the start.
8
+ - Reactive by design: components update predictably with Vue reactivity as your data or form state changes.
9
+ - Lightweight: small surface area and minimal runtime overhead so your bundle stays lean.
10
+ - Customizable: swap icons, change sizes, or theme with your existing Vuetify setup without touching core logic.
11
+ - Accessibility-minded: uses clear affordances and aria-friendly patterns to improve form and table clarity.
12
+
13
+ Install
14
+
15
+ ```bash
16
+ pnpm add @modeltables/fontawesome-vuetify
17
+ ```
18
+
19
+ Quick start
20
+
21
+ Import the components or helpers you need and register them in your app. Example (single-file component):
22
+
23
+ ```vue
24
+ <script setup lang="ts">
25
+ import TableView from '@tablemodels/table/TableView.vue'
26
+ </script>
27
+
28
+ <template>
29
+ <div>
30
+ <SearchView />
31
+ <TableView />
32
+ </div>
33
+ </template>
34
+ ```
35
+
36
+ Core models
37
+
38
+ The package includes a small TypeScript models module (see `components/models/tablemodels.ts`) that the components use and that you can reuse in your services:
39
+
40
+ - HeaderModel — column metadata (title, key, sort).
41
+ - PaginatonModel — pagination state (PageCount, PerPage, CurrentPage, TotalCount).
42
+ - PaginatedResponse<T> — generic paged response with `Items: T[]`.
43
+ - Options — a simple option shape (`Key`, `ShowKey`, `Name`, `Active`).
44
+
45
+ Example TypeScript snippet
46
+
47
+ ```ts
48
+ import { PaginatedResponse, HeaderModel } from 'tablemodels'
49
+
50
+ type Item = { id: number; name: string }
51
+
52
+ const page: PaginatedResponse<Item> = {
53
+ PageSize: 10,
54
+ PageCount: 3,
55
+ CurrentPage: 1,
56
+ TotalCount: 25,
57
+ Items: []
58
+ }
59
+
60
+ const col = new HeaderModel()
61
+ col.title = 'Name'
62
+ col.key = 'name'
63
+ ```
64
+
65
+ Contributing
66
+
67
+ PRs and issues welcome — open an issue to discuss larger changes first. Keep changes focused and lightweight.
68
+
69
+ License
70
+
71
+ ISC
72
+
73
+
@@ -66,7 +66,7 @@ export default {
66
66
  }
67
67
  </script>
68
68
  <template>
69
- <span v-if="prop == options.Key!">
69
+ <span v-if="prop == options.Key! && options.Active">
70
70
  <FontAwesomeIcon :icon="hashTag"></FontAwesomeIcon>
71
71
  </span>
72
72
  <span v-else>
@@ -21,5 +21,7 @@ export declare class PaginatedResponse<T> {
21
21
 
22
22
  export declare class Options {
23
23
  Key?: string;
24
+ ShowKey: boolean;
24
25
  Name?: string;
26
+ Active: boolean;
25
27
  }
@@ -29,5 +29,7 @@ export class Options {
29
29
  constructor() {
30
30
  this.Key = "Id";
31
31
  this.Name = undefined;
32
+ this.ShowKey = false;
33
+ this.Active = true;
32
34
  }
33
35
  }
@@ -21,5 +21,7 @@ export class PaginatedResponse<T>{
21
21
 
22
22
  export class Options{
23
23
  Key?: string;
24
+ ShowKey: boolean;
24
25
  Name?: string;
26
+ Active: boolean;
25
27
  }
@@ -54,6 +54,9 @@ export default {
54
54
  <FontAwesomeIcon @click="sort($event, prop, index)" :icon="carretUp"></FontAwesomeIcon>
55
55
  </div>
56
56
  </div>
57
+ <div v-else-if="options.Active">
58
+ {{ prop.title }}
59
+ </div>
57
60
  <div v-else>
58
61
  {{ prop.title }}
59
62
  </div>
@@ -48,7 +48,13 @@
48
48
  </script>
49
49
  <template>
50
50
  <span v-if="prop == options.Key!">
51
- {{ index + 1 }}
51
+ <template v-if="options.ShowKey">
52
+ {{ item[prop] }}
53
+
54
+ </template>
55
+ <template v-else>
56
+ {{ index + 1 }}
57
+ </template>
52
58
  </span>
53
59
  <span v-else-if="isDateTime(item[prop])">
54
60
  {{ toDate(item[prop]) }}