@drax/crud-vue 0.8.3 → 0.8.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.
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.8.
|
|
6
|
+
"version": "0.8.5",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
9
|
"module": "./src/index.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@drax/common-front": "^0.8.3",
|
|
28
28
|
"@drax/crud-front": "^0.8.3",
|
|
29
|
-
"@drax/crud-share": "^0.8.
|
|
29
|
+
"@drax/crud-share": "^0.8.5",
|
|
30
30
|
"@drax/media-vue": "^0.8.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"vue-tsc": "^2.0.11",
|
|
65
65
|
"vuetify": "^3.7.1"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "df40172e28cb654c26d622d16d6aef53e2db8a78"
|
|
68
68
|
}
|
|
@@ -21,8 +21,8 @@ const {entity, multiple} = defineProps({
|
|
|
21
21
|
label: {type: String},
|
|
22
22
|
itemValue: {type: [String], default: '_id'},
|
|
23
23
|
itemTitle: {type: [String], default: 'name'},
|
|
24
|
-
rules: {type: Array as PropType<any>, default: []},
|
|
25
|
-
errorMessages: {type: Array as PropType<string[]>, default: []},
|
|
24
|
+
rules: {type: Array as PropType<any>, default: () => []},
|
|
25
|
+
errorMessages: {type: Array as PropType<string[]>, default: () => []},
|
|
26
26
|
hideDetails: {type: Boolean, default: false},
|
|
27
27
|
singleLine: {type: Boolean, default: false},
|
|
28
28
|
density: {type: String as PropType<'comfortable' | 'compact' | 'default'>, default: 'default'},
|
|
@@ -18,6 +18,33 @@ const aFields = computed(() => {
|
|
|
18
18
|
return entity.filters.filter((field:IEntityCrudFilter) => !field.permission || hasPermission(field.permission))
|
|
19
19
|
})
|
|
20
20
|
|
|
21
|
+
const icon = computed(() => {
|
|
22
|
+
return (field: IEntityCrudFilter) => {
|
|
23
|
+
switch(field.operator){
|
|
24
|
+
case 'eq':
|
|
25
|
+
return 'mdi-equal'
|
|
26
|
+
case 'ne':
|
|
27
|
+
return 'mdi-not-equal'
|
|
28
|
+
case 'gt':
|
|
29
|
+
return 'mdi-greater-than'
|
|
30
|
+
case 'gte':
|
|
31
|
+
return 'mdi-greater-than-or-equal'
|
|
32
|
+
case 'lt':
|
|
33
|
+
return 'mdi-less-than'
|
|
34
|
+
case 'lte':
|
|
35
|
+
return 'mdi-less-than-or-equal'
|
|
36
|
+
case 'in':
|
|
37
|
+
return 'mdi-code-array'
|
|
38
|
+
case 'nin':
|
|
39
|
+
return 'mdi-not-equal'
|
|
40
|
+
case 'like':
|
|
41
|
+
return 'mdi-contain'
|
|
42
|
+
default:
|
|
43
|
+
return ''
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
21
48
|
|
|
22
49
|
async function filter() {
|
|
23
50
|
emit('filter')
|
|
@@ -50,6 +77,7 @@ const emit = defineEmits(['filter', 'clear','updateValue'])
|
|
|
50
77
|
:clearable="true"
|
|
51
78
|
density="compact"
|
|
52
79
|
variant="outlined"
|
|
80
|
+
:prepend-inner-icon="icon(filter)"
|
|
53
81
|
hide-details single-line disable-rules
|
|
54
82
|
@updateValue="$emit('updateValue')"
|
|
55
83
|
/>
|
|
@@ -46,7 +46,7 @@ const show = ref(false)
|
|
|
46
46
|
const name = computed(() => index >= 0 ? `${parentField ? parentField + "_" : ""}${field.name}_${index}` : `${parentField ? parentField + "_" : ""}${field.name}`)
|
|
47
47
|
|
|
48
48
|
const label = computed(() => {
|
|
49
|
-
const i18n = `${entity.name.toLowerCase()}.field.${field.name}`
|
|
49
|
+
const i18n = `${entity.name.toLowerCase()}.field.${field.label ? field.label : field.name}`
|
|
50
50
|
return te(i18n) ? t(i18n) : field.label
|
|
51
51
|
})
|
|
52
52
|
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import CrudFormList from "./components/CrudFormList.vue";
|
|
|
6
6
|
import CrudList from "./components/CrudList.vue";
|
|
7
7
|
import CrudNotify from "./components/CrudNotify.vue";
|
|
8
8
|
import CrudSearch from "./components/CrudSearch.vue";
|
|
9
|
+
import CrudAutocomplete from "./components/CrudAutocomplete.vue";
|
|
9
10
|
import {useCrudStore} from "./stores/UseCrudStore";
|
|
10
11
|
import {useCrud} from "./composables/UseCrud";
|
|
11
12
|
import {useFormUtils} from "./composables/UseFormUtils";
|
|
@@ -21,6 +22,7 @@ export {
|
|
|
21
22
|
CrudList,
|
|
22
23
|
CrudNotify,
|
|
23
24
|
CrudSearch,
|
|
25
|
+
CrudAutocomplete,
|
|
24
26
|
useCrud,
|
|
25
27
|
useFormUtils,
|
|
26
28
|
useCrudStore,
|