@modeltables/fontawesome-vuetify 1.1.2 → 1.2.1
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/components/headerFilters/Filters.vue +14 -7
- package/components/headerFilters/Number.vue +2 -1
- package/components/index.d.ts +2 -2
- package/components/models/tablemodels.d.ts +5 -0
- package/components/models/tablemodels.js +7 -0
- package/components/models/tablemodels.ts +5 -0
- package/components/sort/SortView.vue +12 -0
- package/components/table/TableView.vue +22 -20
- package/components/table/data/ItemView.vue +9 -6
- package/dist/index.amd.ts +15 -15
- package/dist/index.esm.ts +1880 -1855
- package/package.json +8 -9
- package/tsconfig.json +4 -0
- package/vite.config.js +3 -0
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { faHashtag } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
4
4
|
import { isDateTime, isNumber, isString } from '../helpers/instances';
|
|
5
|
-
import Date from '
|
|
6
|
-
import Number from '
|
|
7
|
-
import Text from '
|
|
5
|
+
import Date from '@/components/headerFilters/Date.vue';
|
|
6
|
+
import Number from '@/components/headerFilters/Number.vue';
|
|
7
|
+
import Text from '@/components/headerFilters/Text.vue';
|
|
8
|
+
import { Options } from '@/components/models/tablemodels';
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
11
|
components: {
|
|
@@ -26,9 +27,10 @@ export default {
|
|
|
26
27
|
type: Boolean,
|
|
27
28
|
required: true
|
|
28
29
|
},
|
|
29
|
-
|
|
30
|
-
type:
|
|
31
|
-
required:
|
|
30
|
+
options: {
|
|
31
|
+
type: Options,
|
|
32
|
+
required: true,
|
|
33
|
+
default: () => new Options()
|
|
32
34
|
},
|
|
33
35
|
prop: {
|
|
34
36
|
type: String,
|
|
@@ -48,6 +50,11 @@ export default {
|
|
|
48
50
|
isDateTime: isDateTime
|
|
49
51
|
}
|
|
50
52
|
},
|
|
53
|
+
watch: {
|
|
54
|
+
key(newVal: any) {
|
|
55
|
+
this.key = newVal;
|
|
56
|
+
},
|
|
57
|
+
},
|
|
51
58
|
methods: {
|
|
52
59
|
filterValue(event: any, filter: any){
|
|
53
60
|
this.$emit('filterValue', event, filter);
|
|
@@ -59,7 +66,7 @@ export default {
|
|
|
59
66
|
}
|
|
60
67
|
</script>
|
|
61
68
|
<template>
|
|
62
|
-
<span v-if="prop ==
|
|
69
|
+
<span v-if="prop == options.Key!">
|
|
63
70
|
<FontAwesomeIcon :icon="hashTag"></FontAwesomeIcon>
|
|
64
71
|
</span>
|
|
65
72
|
<span v-else>
|
package/components/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @licence MIT */
|
|
2
2
|
|
|
3
|
-
export { default as TableView } from "
|
|
4
|
-
export { HeaderModel, PaginatonModel, PaginatedResponse } from '
|
|
3
|
+
export { default as TableView } from "@/components/table/TableView.vue";
|
|
4
|
+
export { HeaderModel, PaginatonModel, PaginatedResponse, Options } from '@/components/models/tablemodels';
|
|
5
5
|
|
|
6
6
|
/*!
|
|
7
7
|
* Vuetify Labs v3.4.0 by vuetify - https://vuetifyjs.com
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
3
3
|
import { faCaretDown, faCaretUp } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { Options } from '@/components/models/tablemodels';
|
|
4
5
|
export default {
|
|
5
6
|
components: {
|
|
6
7
|
FontAwesomeIcon
|
|
7
8
|
},
|
|
8
9
|
props: {
|
|
10
|
+
options: {
|
|
11
|
+
type: Options,
|
|
12
|
+
required: true,
|
|
13
|
+
default: () => new Options()
|
|
14
|
+
},
|
|
9
15
|
prop: {
|
|
10
16
|
type: Object,
|
|
11
17
|
required: true
|
|
@@ -17,12 +23,18 @@ export default {
|
|
|
17
23
|
},
|
|
18
24
|
data() {
|
|
19
25
|
return {
|
|
26
|
+
key: this.key,
|
|
20
27
|
prop: this.prop,
|
|
21
28
|
index: this.index,
|
|
22
29
|
carretDown: faCaretDown,
|
|
23
30
|
carretUp: faCaretUp
|
|
24
31
|
}
|
|
25
32
|
},
|
|
33
|
+
watch: {
|
|
34
|
+
key(newVal: any) {
|
|
35
|
+
this.key = newVal;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
26
38
|
methods: {
|
|
27
39
|
sort(event: any, prop: any, index: number){
|
|
28
40
|
this.$emit('sort', event, prop, index);
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
4
4
|
import { faRefresh, faSearch } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
-
import { HeaderModel } from '
|
|
6
|
-
import { PaginatonModel } from '
|
|
7
|
-
import { change,
|
|
8
|
-
import Date from '
|
|
9
|
-
import Search from '
|
|
10
|
-
import Text from '
|
|
11
|
-
import Number from '
|
|
12
|
-
import Filters from '
|
|
13
|
-
import SortView from '
|
|
14
|
-
import PaginationView from '
|
|
15
|
-
import DataItem from '
|
|
5
|
+
import { HeaderModel, Options } from '@/components/models/tablemodels';
|
|
6
|
+
import { PaginatonModel } from '@/components/models/tablemodels';
|
|
7
|
+
import { change, load, rowClick, search } from '@/components/helpers/resources';
|
|
8
|
+
import Date from '@/components/headerFilters/Date.vue';
|
|
9
|
+
import Search from '@/components/search/SearchView.vue';
|
|
10
|
+
import Text from '@/components/headerFilters/Text.vue';
|
|
11
|
+
import Number from '@/components/headerFilters/Number.vue';
|
|
12
|
+
import Filters from '@/components/headerFilters/Filters.vue';
|
|
13
|
+
import SortView from '@/components/sort/SortView.vue';
|
|
14
|
+
import PaginationView from '@/components/pagination/PaginationView.vue';
|
|
15
|
+
import DataItem from '@/components/table/data/ItemView.vue';
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
18
|
props: {
|
|
@@ -20,9 +20,10 @@ export default {
|
|
|
20
20
|
type: Array<HeaderModel>,
|
|
21
21
|
default: () => []
|
|
22
22
|
},
|
|
23
|
-
|
|
24
|
-
type:
|
|
25
|
-
|
|
23
|
+
options: {
|
|
24
|
+
type: Options,
|
|
25
|
+
required: false,
|
|
26
|
+
default: () => new Options()
|
|
26
27
|
},
|
|
27
28
|
name: {
|
|
28
29
|
type: String
|
|
@@ -108,12 +109,13 @@ export default {
|
|
|
108
109
|
},
|
|
109
110
|
emits: [change, load, rowClick, search],
|
|
110
111
|
data() {
|
|
112
|
+
console.log(this.options);
|
|
111
113
|
return {
|
|
112
114
|
dataheader: this.dataheader,
|
|
113
115
|
dataItems: this.dataItems,
|
|
114
116
|
dialog: false,
|
|
115
117
|
new: true,
|
|
116
|
-
|
|
118
|
+
options: this.options,
|
|
117
119
|
name: this.name,
|
|
118
120
|
currentId: this.currentId,
|
|
119
121
|
currentItem: this.currentItem,
|
|
@@ -167,7 +169,7 @@ export default {
|
|
|
167
169
|
if(!this.crud){
|
|
168
170
|
this.rowClick(item);
|
|
169
171
|
}else{
|
|
170
|
-
this.currentId = item[this.
|
|
172
|
+
this.currentId = item[this.options.Key!];
|
|
171
173
|
this.$emit(change, item);
|
|
172
174
|
}
|
|
173
175
|
},
|
|
@@ -191,7 +193,7 @@ export default {
|
|
|
191
193
|
isNumber(n: any) {
|
|
192
194
|
return !isNaN(parseFloat(n)) && !isNaN(n - 0)
|
|
193
195
|
},
|
|
194
|
-
|
|
196
|
+
optionschange(event: any){
|
|
195
197
|
this.page = event!.page;
|
|
196
198
|
this.filters.CurrentPage = this.page;
|
|
197
199
|
this.search();
|
|
@@ -261,7 +263,7 @@ export default {
|
|
|
261
263
|
:loading="loading"
|
|
262
264
|
:v-bind:model-value="modelValue"
|
|
263
265
|
:items="dataItems"
|
|
264
|
-
@update:options="
|
|
266
|
+
@update:options="optionschange($event)"
|
|
265
267
|
:items-per-page="perPage"
|
|
266
268
|
:page="page"
|
|
267
269
|
hide-default-header
|
|
@@ -284,7 +286,7 @@ export default {
|
|
|
284
286
|
:item="item"
|
|
285
287
|
:filters="filters"
|
|
286
288
|
:showFilters="showFilters"
|
|
287
|
-
:
|
|
289
|
+
:options="options"
|
|
288
290
|
:prop="prop"
|
|
289
291
|
@filterValue="filterValue($event, filters[prop])">
|
|
290
292
|
</Filters>
|
|
@@ -295,7 +297,7 @@ export default {
|
|
|
295
297
|
<DataItem
|
|
296
298
|
:item="item"
|
|
297
299
|
:prop="prop"
|
|
298
|
-
:
|
|
300
|
+
:options="options"
|
|
299
301
|
:index="index">
|
|
300
302
|
</DataItem>
|
|
301
303
|
</td>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { isDateTime, toDate } from '
|
|
2
|
+
import { isDateTime, toDate } from '@/components/helpers/instances';
|
|
3
|
+
import { Options } from '@/components/models/tablemodels';
|
|
4
|
+
|
|
3
5
|
export default {
|
|
4
6
|
props: {
|
|
5
7
|
item: {
|
|
@@ -14,9 +16,10 @@
|
|
|
14
16
|
type: String,
|
|
15
17
|
required: true
|
|
16
18
|
},
|
|
17
|
-
|
|
18
|
-
type:
|
|
19
|
-
required: false
|
|
19
|
+
options: {
|
|
20
|
+
type: Options,
|
|
21
|
+
required: false,
|
|
22
|
+
default: () => new Options()
|
|
20
23
|
}
|
|
21
24
|
},
|
|
22
25
|
watch: {
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
item: this.item,
|
|
36
39
|
index: this.index,
|
|
37
40
|
prop: this.prop,
|
|
38
|
-
|
|
41
|
+
options: this.options,
|
|
39
42
|
isDateTime: isDateTime,
|
|
40
43
|
toDate: toDate
|
|
41
44
|
}
|
|
@@ -44,7 +47,7 @@
|
|
|
44
47
|
|
|
45
48
|
</script>
|
|
46
49
|
<template>
|
|
47
|
-
<span v-if="prop ==
|
|
50
|
+
<span v-if="prop == options.Key!">
|
|
48
51
|
{{ index + 1 }}
|
|
49
52
|
</span>
|
|
50
53
|
<span v-else-if="isDateTime(item[prop])">
|