@afeefa/vue-app 0.0.114 → 0.0.116

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.114
1
+ 0.0.116
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.114",
3
+ "version": "0.0.116",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -1,4 +1,6 @@
1
1
  import { NextRouteFilterSource } from '@a-vue/components/list/NextRouteFilterSource'
2
+ import { AlertEvent } from '@a-vue/events'
3
+ import { eventBus } from '@a-vue/plugins/event-bus/EventBus'
2
4
  import { ListViewModel } from '@afeefa/api-resources-client'
3
5
 
4
6
  import { ApiAction } from './ApiAction'
@@ -24,4 +26,14 @@ export class ListAction extends ApiAction {
24
26
 
25
27
  return ListAction.fromRequest(request)
26
28
  }
29
+
30
+ processError (result) {
31
+ if (this._showError) {
32
+ eventBus.dispatch(new AlertEvent(AlertEvent.ERROR, {
33
+ headline: 'Die Daten konntent nicht geladen werden.',
34
+ message: result.message,
35
+ detail: result.detail
36
+ }))
37
+ }
38
+ }
27
39
  }
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <v-menu
3
+ ref="menu"
4
+ v-model="menu"
5
+ :close-on-content-click="false"
6
+ :nudge-right="40"
7
+ :return-value.sync="model[name]"
8
+ transition="scale-transition"
9
+ offset-y
10
+ max-width="290px"
11
+ min-width="290px"
12
+ >
13
+ <template #activator="{ on, attrs }">
14
+ <v-text-field
15
+ v-model="model[name]"
16
+ :label="label || name"
17
+ prepend-icon="mdi-clock-time-four-outline"
18
+ readonly
19
+ dense
20
+ outlined
21
+ v-bind="attrs"
22
+ v-on="on"
23
+ />
24
+ </template>
25
+ <v-time-picker
26
+ v-if="menu"
27
+ ref="timePicker"
28
+ v-model="model[name]"
29
+ :validator="validator"
30
+ v-bind="$attrs"
31
+ full-width
32
+ scrollable
33
+ format="24hr"
34
+ v-on="$listeners"
35
+ @click:minute="$refs.menu.save(model[name])"
36
+ />
37
+ </v-menu>
38
+ </template>
39
+
40
+ <script>
41
+ import { Component, Mixins } from '@a-vue'
42
+ import { FormFieldMixin } from '../FormFieldMixin'
43
+
44
+ @Component
45
+ export default class FormFieldTime extends Mixins(FormFieldMixin) {
46
+ menu = false
47
+ validate () {
48
+ this.$refs.timePicker.validate()
49
+ }
50
+ }
51
+ </script>
@@ -4,6 +4,7 @@ import EditForm from './form/EditForm'
4
4
  import EditModal from './form/EditModal'
5
5
  import FormFieldCheckbox from './form/fields/FormFieldCheckbox'
6
6
  import FormFieldDate from './form/fields/FormFieldDate'
7
+ import FormFieldTime from './form/fields/FormFieldTime'
7
8
  import FormFieldRadioGroup from './form/fields/FormFieldRadioGroup'
8
9
  import FormFieldRichTextArea from './form/fields/FormFieldRichTextArea'
9
10
  import FormFieldSearchSelect from './form/fields/FormFieldSearchSelect'
@@ -25,6 +26,7 @@ Vue.component('FormFieldRichTextArea', FormFieldRichTextArea)
25
26
  Vue.component('FormFieldRadioGroup', FormFieldRadioGroup)
26
27
  Vue.component('FormFieldCheckbox', FormFieldCheckbox)
27
28
  Vue.component('FormFieldDate', FormFieldDate)
29
+ Vue.component('FormFieldTime', FormFieldTime)
28
30
  Vue.component('FormFieldSearchSelect', FormFieldSearchSelect)
29
31
  Vue.component('FormFieldSelect', FormFieldSelect)
30
32
  Vue.component('FormFieldSelect2', FormFieldSelect2)
@@ -4,7 +4,7 @@
4
4
  flex-column
5
5
  >
6
6
  <v-list class="pa-0">
7
- <template v-for="item in config.items">
7
+ <template v-for="item in items">
8
8
  <v-list-group
9
9
  v-if="item.group"
10
10
  :key="item.title"
@@ -36,7 +36,7 @@ import { Component, Vue } from '@a-vue'
36
36
  import SidebarMenuItem from './menu/SidebarMenuItem'
37
37
 
38
38
  @Component({
39
- props: ['config'],
39
+ props: ['items'],
40
40
  components: {
41
41
  SidebarMenuItem
42
42
  }
@@ -50,11 +50,12 @@ export default class SidebarMenu extends Vue {
50
50
  :deep(.v-list-group) {
51
51
  > .v-list-item {
52
52
  padding: 0;
53
+
53
54
  > .v-list-item {
54
- padding: 0;
55
- padding-left: 19px;
56
- flex: 0;
57
- color: #999999 !important;
55
+ padding: 0;
56
+ padding-left: 19px;
57
+ flex: 0;
58
+ color: #999999 !important;
58
59
 
59
60
  .v-list-item__icon {
60
61
  margin-right: 18px !important;
@@ -47,7 +47,6 @@ export class DataRouteMixin extends Vue {
47
47
  })
48
48
  }
49
49
 
50
-
51
50
  // watches (if defined) route idKey and reloads data if changed
52
51
  @Watch('drm_id')
53
52
  async drm_routeParamsChanged () {
@@ -68,14 +67,18 @@ export class DataRouteMixin extends Vue {
68
67
  }
69
68
 
70
69
  drm_onLoad (result) {
71
- onLoadCallback(this, result)
70
+ const wrapped = this.$children.find(c => c.constructor.drm_getActions)
71
+ onLoadCallback(wrapped || this, result)
72
72
  lastResult = result
73
73
  }
74
74
 
75
75
  created () {
76
76
  // hmr reload creates vm but not triggers route enter
77
77
  if (!routerHookCalled) {
78
- onLoadCallback(this, lastResult)
78
+ this.$nextTick(() => { // next tick bc c.constructor else not available
79
+ const wrapped = this.$children.find(c => c.constructor.drm_getActions)
80
+ onLoadCallback(wrapped || this, lastResult)
81
+ })
79
82
  }
80
83
  }
81
84
  }