@afeefa/vue-app 0.0.158 → 0.0.160

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.158
1
+ 0.0.160
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.158",
3
+ "version": "0.0.160",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -47,6 +47,7 @@
47
47
 
48
48
  <template #row="{ model, on }">
49
49
  <v-icon
50
+ v-if="$has.icon"
50
51
  :color="model.getIcon().color"
51
52
  size="1.5rem"
52
53
  class="mr-2"
@@ -70,9 +71,11 @@ import { FormFieldMixin } from '../FormFieldMixin'
70
71
  import { ListAction } from '@a-vue/api-resources/ApiActions'
71
72
 
72
73
  @Component({
73
- props: ['value', 'q', 'listConfig']
74
+ props: ['value', 'q']
74
75
  })
75
76
  export default class FormFieldSearchSelect extends Mixins(FormFieldMixin) {
77
+ $hasOptions = ['icon']
78
+
76
79
  mounted () {
77
80
  if (this.validator) {
78
81
  this.$refs.input.validate()
@@ -11,6 +11,7 @@ import { adminConfig } from './config/AdminConfig'
11
11
  import routeConfigPlugin from './config/routing'
12
12
  import vuetify from './config/vuetify'
13
13
  import { authPlugin } from './plugins/AuthPlugin'
14
+ import { configPlugin } from './plugins/ConfigPlugin'
14
15
 
15
16
  Vue.config.productionTip = false
16
17
 
@@ -27,6 +28,11 @@ export class AfeefaAdmin {
27
28
  return this
28
29
  }
29
30
 
31
+ customConfig (customConfig) {
32
+ adminConfig.config = customConfig
33
+ return this
34
+ }
35
+
30
36
  routing (routeConfigCallback) {
31
37
  this._routeConfigCallback = routeConfigCallback
32
38
  return this
@@ -51,6 +57,8 @@ export class AfeefaAdmin {
51
57
  // set app config
52
58
  adminConfig.app = this._appConfig
53
59
 
60
+ Vue.use(configPlugin)
61
+
54
62
  // authenticate current user before doing any gui-voodo
55
63
  if (this._authService) {
56
64
  adminConfig.authService = this._authService
@@ -88,7 +96,7 @@ export class AfeefaAdmin {
88
96
 
89
97
  // load initial data
90
98
  if (this._initCallback) {
91
- await this._initCallback()
99
+ await this._initCallback(this)
92
100
  }
93
101
 
94
102
  // setup router, routes and breadcrumb
@@ -15,7 +15,7 @@ import { modelCountService } from './ModelCountService'
15
15
  import { SaveEvent } from '@a-vue/events'
16
16
 
17
17
  @Component({
18
- props: ['action', 'field']
18
+ props: ['action', 'field', 'count']
19
19
  })
20
20
  export default class ModelCount extends Vue {
21
21
  countRequest = null
@@ -24,8 +24,12 @@ export default class ModelCount extends Vue {
24
24
  created () {
25
25
  this.$events.on(SaveEvent.STOP_SAVING, this.loadCount)
26
26
 
27
- this.countRequest = modelCountService.addAction(this.action)
28
- this.loadCount()
27
+ if (this.count) {
28
+ this.content = this.count
29
+ } else {
30
+ this.countRequest = modelCountService.addAction(this.action)
31
+ this.loadCount()
32
+ }
29
33
  }
30
34
 
31
35
  loadCount () {
@@ -14,6 +14,8 @@ class AdminConfig {
14
14
  SidebarMenu: null
15
15
  }
16
16
  }
17
+
18
+ config = {}
17
19
  }
18
20
 
19
21
  export const adminConfig = new AdminConfig()
@@ -0,0 +1,13 @@
1
+ import { adminConfig } from '../config/AdminConfig'
2
+
3
+ class ConfigPlugin {
4
+ install (Vue) {
5
+ Object.defineProperty(Vue.prototype, '$config', {
6
+ get () {
7
+ return adminConfig.config
8
+ }
9
+ })
10
+ }
11
+ }
12
+
13
+ export const configPlugin = new ConfigPlugin()