@tablemodels/fontawesome-vuetify 1.0.5

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.
@@ -0,0 +1,41 @@
1
+ <script lang="ts">
2
+ import { faCalendar } from '@fortawesome/free-regular-svg-icons';
3
+ export default {
4
+ props: {
5
+ data: {
6
+ type: Object,
7
+ required: true
8
+ },
9
+ filter: {
10
+ type: Object,
11
+ required: true
12
+ },
13
+ prop: {
14
+ type: String,
15
+ required: true
16
+ }
17
+ },
18
+ data() {
19
+ return {
20
+ data: this.data,
21
+ filter: this.filter,
22
+ prop: this.prop,
23
+ calendar: faCalendar
24
+ }
25
+ },
26
+ methods: {
27
+ filterDate(event: any){
28
+ this.data[this.prop] = event.target.value;
29
+ this.$emit('filterValue', event);
30
+ }
31
+ }
32
+ }
33
+ </script>
34
+
35
+ <template>
36
+ <v-date-input :prepend-icon="''" label="Date input" @save="filterDate($event)" :v-model="data" :model-value="filter">
37
+ <template v-if="calendar" #prepend-inner>
38
+ <FontAwesomeIcon :icon="calendar" />
39
+ </template>
40
+ </v-date-input>
41
+ </template>
@@ -0,0 +1,90 @@
1
+ <script lang="ts">
2
+ import { faHashtag } from '@fortawesome/free-solid-svg-icons';
3
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
4
+ import { isDateTime, isNumber, isString } from '../helpers/instances';
5
+ import Date from '../headerFilters/Date.vue';
6
+ import Number from '../headerFilters/Number.vue';
7
+ import Text from '../headerFilters/Text.vue';
8
+
9
+ export default {
10
+ components: {
11
+ Date,
12
+ Number,
13
+ Text,
14
+ FontAwesomeIcon
15
+ },
16
+ props: {
17
+ item: {
18
+ type: Object,
19
+ required: true
20
+ },
21
+ filters: {
22
+ type: Object,
23
+ required: true
24
+ },
25
+ showFilters: {
26
+ type: Boolean,
27
+ required: true
28
+ },
29
+ key: {
30
+ type: String,
31
+ required: false
32
+ },
33
+ prop: {
34
+ type: String,
35
+ required: true
36
+ }
37
+ },
38
+ data() {
39
+ return {
40
+ item: this.item,
41
+ index: this.index,
42
+ filters: this.filters,
43
+ showFilters: this.showFilters,
44
+ key: this.key,
45
+ hashTag: faHashtag,
46
+ isString: isString,
47
+ isNumber: isNumber,
48
+ isDateTime: isDateTime
49
+ }
50
+ },
51
+ methods: {
52
+ filterValue(event: any, filter: any){
53
+ this.$emit('filterValue', event, filter);
54
+ },
55
+ filterDate(event: any, filter: any){
56
+ this.$emit('filterValue', event, filter);
57
+ }
58
+ }
59
+ }
60
+ </script>
61
+ <template>
62
+ <span v-if="prop == key!">
63
+ <FontAwesomeIcon :icon="hashTag"></FontAwesomeIcon>
64
+ </span>
65
+ <span v-else>
66
+ <div v-if="isNumber(item[prop])">
67
+ <Number
68
+ :filter="filters[prop]"
69
+ :prop="prop":data="filters"
70
+ @filterValue="filterValue($event, filters[prop])">
71
+ </Number>
72
+ </div>
73
+ <div v-else-if="isDateTime(item[prop])">
74
+ <Date
75
+ :data="filters"
76
+ :filter="filters[prop]"
77
+ :prop="prop"
78
+ @filterValue="filterDate($event, filters[prop])">
79
+ </Date>
80
+ </div>
81
+ <div v-else-if="isString(item[prop])">
82
+ <Text
83
+ :data="filters"
84
+ :filter="filters[prop]"
85
+ :prop="prop"
86
+ @filterValue="filterValue($event, filters[prop])">
87
+ </Text>
88
+ </div>
89
+ </span>
90
+ </template>
@@ -0,0 +1,41 @@
1
+ <script lang="ts">
2
+ export default {
3
+ props: {
4
+ data: {
5
+ type: Object,
6
+ required: true
7
+ },
8
+ filter: {
9
+ type: Object,
10
+ required: true
11
+ },
12
+ prop: {
13
+ type: String,
14
+ required: true
15
+ }
16
+ },
17
+ data() {
18
+ return {
19
+ data: this.data,
20
+ filter: this.filter,
21
+ prop: this.prop
22
+ }
23
+ },
24
+ methods: {
25
+ filterValue(event: any, prop: string){
26
+ this.data[this.prop] = event.target.value;
27
+ this.$emit('filterValue', event, prop);
28
+ }
29
+ }
30
+ }
31
+ </script>
32
+
33
+ <template>
34
+ <v-number-input
35
+ @blur="filterValue($event, prop)"
36
+ :v-model="data"
37
+ :model-value="filter"
38
+ :precision="2"
39
+ control-variant="hidden">
40
+ </v-number-input>
41
+ </template>
@@ -0,0 +1,39 @@
1
+ <script lang="ts">
2
+ export default {
3
+ props: {
4
+ data: {
5
+ type: Object,
6
+ required: true
7
+ },
8
+ filter: {
9
+ type: Object,
10
+ required: true
11
+ },
12
+ prop: {
13
+ type: String,
14
+ required: true
15
+ }
16
+ },
17
+ data() {
18
+ return {
19
+ data: this.data,
20
+ filter: this.filter,
21
+ prop: this.prop
22
+ }
23
+ },
24
+ methods: {
25
+ filterValue(event: any){
26
+ this.data[this.prop] = event.target.value;
27
+ this.$emit('filterValue', event);
28
+ }
29
+ }
30
+ }
31
+ </script>
32
+
33
+ <template>
34
+ <v-text-field
35
+ @blur="filterValue($event)"
36
+ :v-model="data"
37
+ :model-value="filter">
38
+ </v-text-field>
39
+ </template>
@@ -0,0 +1,20 @@
1
+ export const isNumber = (n: any) => {
2
+ return !isNaN(parseFloat(n)) && !isNaN(n - 0)
3
+ }
4
+
5
+ export const isDateTime = (d: any) =>{
6
+ if(/^[\d]{4}-[\d]{2}-[\d]{2}T[\d]{2}:[\d]{2}:[\d]{2}.[\d]+$/.test(d)){
7
+ let datetime = new window.Date(d);
8
+ return datetime instanceof window.Date;
9
+ }
10
+ return false;
11
+ }
12
+
13
+ export const isString = (s: any) =>{
14
+ return typeof s === 'string' || s instanceof String;
15
+ }
16
+
17
+ export const toDate = (value: any) => {
18
+ const date = new Date(value);
19
+ return date.toLocaleDateString() + ' ' + date.toLocaleTimeString();
20
+ }
@@ -0,0 +1,5 @@
1
+ export const change = 'change';
2
+ export const load = 'load';
3
+ export const rowClick = 'rowClick';
4
+ export const search = 'search';
5
+ export const Id = 'Id';
@@ -0,0 +1,14 @@
1
+ /*! @licence MIT */
2
+
3
+ export { default as TableView } from "./table/TableView.vue";
4
+ export { HeaderModel, PaginatonModel, PaginatedResponse } from './models/tablemodels';
5
+
6
+ /*!
7
+ * Vuetify Labs v3.4.0 by vuetify - https://vuetifyjs.com
8
+ * Licensed under the MIT License (MIT), see LICENSE.
9
+ * Copyright 2025S Vuetify Labs, Inc.
10
+
11
+ * Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
12
+ * License - https://fontawesome.com/license/free - MIT License
13
+ * Copyright 2025 Fonticons, Inc.
14
+ */
File without changes
@@ -0,0 +1,7 @@
1
+ // Minimal build entry for Vue CLI pages
2
+ console.log('components/index.js loaded for build');
3
+
4
+ // If you want to mount a demo app during build, import Vue and mount here.
5
+ // import { createApp } from 'vue';
6
+ // import App from './App.vue';
7
+ // createApp(App).mount('#app');
@@ -0,0 +1,20 @@
1
+ export declare class HeaderModel {
2
+ title: string;
3
+ key?: string;
4
+ sort?: any;
5
+ }
6
+
7
+ export declare class PaginatonModel {
8
+ PageCount: number;
9
+ PerPage: number;
10
+ CurrentPage: number;
11
+ TotalCount: number;
12
+ }
13
+
14
+ export declare class PaginatedResponse<T> {
15
+ PageSize?: number;
16
+ PageCount?: number;
17
+ CurrentPage?: number;
18
+ TotalCount?: number;
19
+ Items: Array<T>;
20
+ }
@@ -0,0 +1,26 @@
1
+ export class HeaderModel {
2
+ constructor() {
3
+ this.title = '';
4
+ this.key = undefined;
5
+ this.sort = undefined;
6
+ }
7
+ }
8
+
9
+ export class PaginatonModel {
10
+ constructor() {
11
+ this.PageCount = 1;
12
+ this.PerPage = 10;
13
+ this.CurrentPage = 1;
14
+ this.TotalCount = 0;
15
+ }
16
+ }
17
+
18
+ export class PaginatedResponse {
19
+ constructor() {
20
+ this.PageSize = undefined;
21
+ this.PageCount = undefined;
22
+ this.CurrentPage = undefined;
23
+ this.TotalCount = undefined;
24
+ this.Items = [];
25
+ }
26
+ }
@@ -0,0 +1,20 @@
1
+ export class HeaderModel{
2
+ title: string = '';
3
+ key?: string;
4
+ sort?: any;
5
+ }
6
+
7
+ export class PaginatonModel{
8
+ PageCount: number = 1;
9
+ PerPage: number = 10;
10
+ CurrentPage: number = 1;
11
+ TotalCount: number = 0;
12
+ }
13
+
14
+ export class PaginatedResponse<T>{
15
+ PageSize?: number;
16
+ PageCount?: number;
17
+ CurrentPage?: number;
18
+ TotalCount?: number;
19
+ Items: Array<T> = []
20
+ }
@@ -0,0 +1,118 @@
1
+ <script lang="ts">
2
+ import { faArrowAltCircleDown } from '@fortawesome/free-regular-svg-icons';
3
+ import { faChevronLeft, faChevronRight, faFastBackward, faFastForward } from '@fortawesome/free-solid-svg-icons';
4
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
5
+
6
+ export default {
7
+ components: {
8
+ FontAwesomeIcon: FontAwesomeIcon
9
+ },
10
+ props: {
11
+ totalCount: {
12
+ type: Number,
13
+ required: true
14
+ },
15
+ pageCount: {
16
+ type: Number,
17
+ required: true
18
+ },
19
+ perPage: {
20
+ type: Number,
21
+ required: true
22
+ },
23
+ page: {
24
+ type: Number,
25
+ required: true
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ totalCount: this.totalCount,
31
+ pageCount: this.pageCount,
32
+ perPage: this.perPage,
33
+ page: this.page,
34
+ arrowDown: faArrowAltCircleDown,
35
+ chevronLeft: faChevronLeft,
36
+ chevronRight: faChevronRight,
37
+ fastBackward: faFastBackward,
38
+ fastForward: faFastForward
39
+ }
40
+ },
41
+ methods: {
42
+ pageChange(event: any){
43
+ this.$emit('pageChange', event);
44
+ },
45
+ pageSize(event: any){
46
+ this.$emit('pageSize', event);
47
+ },
48
+ firstPage(event: any){
49
+ this.$emit('firstPage', event);
50
+ },
51
+ lastPage(event: any){
52
+ this.$emit('lastPage', event);
53
+ },
54
+ previousPage(event: any){
55
+ this.$emit('previousPage', event);
56
+ },
57
+ nextPage(event: any){
58
+ this.$emit('nextPage', event);
59
+ }
60
+ }
61
+ }
62
+
63
+ </script>
64
+
65
+ <template>
66
+ <v-row class="text-center px-4 align-center" wrap>
67
+ <v-col class="text-truncate" cols="12" md="2">
68
+ Total {{ totalCount }} records
69
+ </v-col>
70
+ <v-col cols="12" md="8">
71
+ <v-pagination
72
+ v-model="page"
73
+ :prev-icon="''"
74
+ :next-icon="''"
75
+ :width="'200px'"
76
+ :length="pageCount"
77
+ @update:model-value="pageChange($event)">
78
+ <template v-if="fastBackward" #prev>
79
+ <div style="display:flex; margin-top: 6px;">
80
+ <v-btn v-if="pageCount > 1" @click="firstPage($event)" style="margin-right: 10px;">
81
+ <FontAwesomeIcon :icon="fastBackward" color="#303133"/>
82
+ </v-btn>
83
+ <v-btn v-if="pageCount > 1" @click="previousPage($event)">
84
+ <FontAwesomeIcon color="#303133" :icon="chevronLeft"/>
85
+ </v-btn>
86
+ </div>
87
+ </template>
88
+ <template v-if="chevronLeft" #next>
89
+ <div style="display:flex; margin-top: 6px;">
90
+ <v-btn v-if="pageCount > 1" @click="nextPage($event)">
91
+ <FontAwesomeIcon color="#303133" :icon="chevronRight"/>
92
+ </v-btn>
93
+ <v-btn v-if="pageCount > 1" @click="lastPage($event)" style="margin-left: 10px;">
94
+ <FontAwesomeIcon color="#303133" :icon="fastForward"/>
95
+ </v-btn>
96
+ </div>
97
+ </template>
98
+ </v-pagination>
99
+ </v-col>
100
+ <v-col cols="12" md="2">
101
+ <v-select
102
+ v-if="pageCount > 1"
103
+ dense
104
+ outlined
105
+ hide-details
106
+ :value="perPage"
107
+ :menu-icon="''"
108
+ label="Items per page"
109
+ :items="[10,20,50,100]"
110
+ @update:modelValue="pageSize($event)">
111
+ <template v-if="arrowDown" #append-inner>
112
+ <FontAwesomeIcon :icon="arrowDown" />
113
+ </template>
114
+ </v-select>
115
+ </v-col>
116
+ </v-row>
117
+
118
+ </template>
@@ -0,0 +1,41 @@
1
+ <script lang="ts">
2
+ import { faRefresh, faSearch } from '@fortawesome/free-solid-svg-icons';
3
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
4
+
5
+ export default {
6
+ components: {
7
+ FontAwesomeIcon: FontAwesomeIcon
8
+ },
9
+ props: {
10
+ showFilters: {
11
+ type: Boolean,
12
+ required: true
13
+ }
14
+ },
15
+ data() {
16
+ return {
17
+ showFilters: this.showFilters,
18
+ faSearch: faSearch,
19
+ reload: faRefresh
20
+ }
21
+ },
22
+ methods: {
23
+ search(){
24
+ this.$emit('search');
25
+ },
26
+ refresh(){
27
+ this.$emit('refresh');
28
+ }
29
+ }
30
+ }
31
+ </script>
32
+
33
+ <template>
34
+ <v-btn @click="search()" style="margin-right: 10px" color="#1697f6" v-if="showFilters" v-tooltip="'Search'">
35
+ <FontAwesomeIcon :icon="faSearch"></FontAwesomeIcon>
36
+ </v-btn>
37
+ <v-btn @click="refresh()" style="margin-right: 10px" color="#1697f6" v-if="showFilters" v-tooltip="'Refresh'">
38
+ <FontAwesomeIcon :icon="reload"></FontAwesomeIcon>
39
+ </v-btn>
40
+
41
+ </template>
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
3
+ import { faCaretDown, faCaretUp } from '@fortawesome/free-solid-svg-icons';
4
+ export default {
5
+ components: {
6
+ FontAwesomeIcon
7
+ },
8
+ props: {
9
+ prop: {
10
+ type: Object,
11
+ required: true
12
+ },
13
+ index: {
14
+ type: Number,
15
+ required: true
16
+ }
17
+ },
18
+ data() {
19
+ return {
20
+ prop: this.prop,
21
+ index: this.index,
22
+ carretDown: faCaretDown,
23
+ carretUp: faCaretUp
24
+ }
25
+ },
26
+ methods: {
27
+ sort(event: any, prop: any, index: number){
28
+ this.$emit('sort', event, prop, index);
29
+ }
30
+ }
31
+ }
32
+ </script>
33
+
34
+ <template>
35
+ <div style="display: flex">
36
+ {{ prop.title }}
37
+ <div v-if="prop.sort">
38
+ <FontAwesomeIcon @click="sort($event, prop, index)" :icon="carretDown"></FontAwesomeIcon>
39
+ </div>
40
+ <div v-else>
41
+ <FontAwesomeIcon @click="sort($event, prop, index)" :icon="carretUp"></FontAwesomeIcon>
42
+ </div>
43
+ </div>
44
+
45
+ </template>