@afeefa/vue-app 0.0.63 → 0.0.66
Sign up to get free protection for your applications and to get access to all the features.
- package/.afeefa/package/release/version.txt +1 -1
- package/package.json +1 -1
- package/src/components/ABreadcrumbs.vue +75 -18
- package/src/components/ADatePicker.vue +1 -1
- package/src/components/AIcon.vue +3 -6
- package/src/components/AIconButton.vue +1 -2
- package/src/components/AModal.vue +21 -3
- package/src/components/ARichTextArea.vue +95 -85
- package/src/components/ARow.vue +0 -7
- package/src/components/ATableRow.vue +4 -0
- package/src/components/flying-context/FlyingContextEvent.js +5 -0
- package/src/components/form/EditForm.vue +13 -3
- package/src/components/form/EditModal.vue +52 -35
- package/src/components/form/fields/FormFieldRichTextArea.vue +5 -3
- package/src/components/list/ListViewMixin.js +25 -2
- package/src/components/mixins/ClickOutsideMixin.js +5 -1
- package/src/components/search-select/SearchSelectList.vue +0 -1
- package/src/components/vue/Component.js +9 -2
- package/src/events.js +2 -0
- package/src-admin/bootstrap.js +1 -0
- package/src-admin/components/App.vue +58 -59
- package/src-admin/components/FlyingContext.vue +77 -0
- package/src-admin/components/FlyingContextContainer.vue +85 -0
- package/src-admin/components/Sidebar.vue +66 -0
- package/src-admin/components/SidebarItem.vue +59 -0
- package/src-admin/components/StickyFooter.vue +42 -0
- package/src-admin/components/StickyFooterContainer.vue +66 -0
- package/src-admin/components/StickyHeader.vue +73 -0
- package/src-admin/components/app/AppBarButtons.vue +0 -7
- package/src-admin/components/app/AppBarTitle.vue +55 -11
- package/src-admin/components/app/AppBarTitleContainer.vue +2 -3
- package/src-admin/components/controls/SearchSelectFormField.vue +1 -0
- package/src-admin/components/detail/DetailProperty.vue +20 -16
- package/src-admin/components/form/EditFormButtons.vue +25 -6
- package/src-admin/components/form/RemoveButton.vue +17 -8
- package/src-admin/components/index.js +6 -7
- package/src-admin/components/list/ListView.vue +22 -9
- package/src-admin/components/pages/EditPage.vue +17 -8
- package/src-admin/components/routes/DataRouteMixin.js +24 -15
- package/src-admin/config/routing.js +0 -11
- package/src-admin/config/vuetify.js +22 -2
- package/src-admin/directives/index.js +26 -0
- package/src-admin/styles.scss +21 -4
- package/src-admin/components/pages/CreatePage.vue +0 -114
- package/src-admin/components/pages/DetailPage.vue +0 -143
- package/src-admin/components/pages/EditPageMixin.js +0 -96
- package/src-admin/components/pages/ListPage.vue +0 -55
- package/src-admin/components/routes/CreateRoute.vue +0 -15
- package/src-admin/components/routes/DetailRoute.vue +0 -85
- package/src-admin/components/routes/EditRoute.vue +0 -78
- package/src-admin/components/routes/ListRoute.vue +0 -110
@@ -1,85 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<component
|
3
|
-
:is="Component"
|
4
|
-
v-if="model"
|
5
|
-
:model="model"
|
6
|
-
/>
|
7
|
-
</template>
|
8
|
-
|
9
|
-
<script>
|
10
|
-
import { Component, Vue, Watch } from '@a-vue'
|
11
|
-
import { GetAction } from '@a-vue/api-resources/ApiActions'
|
12
|
-
|
13
|
-
Component.registerHooks([
|
14
|
-
'beforeRouteEnter',
|
15
|
-
'beforeRouteUpdate'
|
16
|
-
])
|
17
|
-
|
18
|
-
function load (route) {
|
19
|
-
const routeDefinition = route.meta.routeDefinition
|
20
|
-
const Component = routeDefinition.config.detail
|
21
|
-
|
22
|
-
if (!Component.getDetailRouteConfig) {
|
23
|
-
console.warn('A detail route component must implement a static getDetailRouteConfig property.')
|
24
|
-
}
|
25
|
-
|
26
|
-
const detailConfig = Component.getDetailRouteConfig(route)
|
27
|
-
const action = detailConfig.action || detailConfig.ModelClass.getAction('get')
|
28
|
-
|
29
|
-
return new GetAction()
|
30
|
-
.setAction(action)
|
31
|
-
.setFields(detailConfig.fields)
|
32
|
-
.setId(detailConfig.id || route.params[routeDefinition.idKey])
|
33
|
-
.load()
|
34
|
-
}
|
35
|
-
|
36
|
-
let routerHookCalled = false
|
37
|
-
|
38
|
-
@Component
|
39
|
-
export default class DetailRoute extends Vue {
|
40
|
-
model = null
|
41
|
-
|
42
|
-
/**
|
43
|
-
* triggered, when the route name changes
|
44
|
-
* not triggered, when only route params change
|
45
|
-
*/
|
46
|
-
async beforeRouteEnter (to, from, next) {
|
47
|
-
routerHookCalled = true
|
48
|
-
const result = await load(to)
|
49
|
-
next(vm => {
|
50
|
-
if (result !== false) {
|
51
|
-
vm.model = result
|
52
|
-
}
|
53
|
-
routerHookCalled = false
|
54
|
-
})
|
55
|
-
}
|
56
|
-
|
57
|
-
/**
|
58
|
-
* triggered both, if route name or route params change
|
59
|
-
*/
|
60
|
-
@Watch('$route.params')
|
61
|
-
async routeParamsChanged () {
|
62
|
-
if (routerHookCalled) {
|
63
|
-
// set model to null in order to not recreate detail route's
|
64
|
-
// child components with the stale model which is still active
|
65
|
-
// in between resolving the route with next() + creating the
|
66
|
-
// route detail component and resetting vm.model later in the callback
|
67
|
-
this.model = null
|
68
|
-
return
|
69
|
-
}
|
70
|
-
this.model = await load(this.$route)
|
71
|
-
}
|
72
|
-
|
73
|
-
// probably not needed
|
74
|
-
// @Watch('$route.name')
|
75
|
-
// async routeNameChanged () {
|
76
|
-
// if (routerHookCalled) {
|
77
|
-
// // this.model = null
|
78
|
-
// }
|
79
|
-
// }
|
80
|
-
|
81
|
-
get Component () {
|
82
|
-
return this.$routeDefinition.config.detail
|
83
|
-
}
|
84
|
-
}
|
85
|
-
</script>
|
@@ -1,78 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<component
|
3
|
-
:is="Component"
|
4
|
-
v-if="model"
|
5
|
-
:model="model"
|
6
|
-
/>
|
7
|
-
</template>
|
8
|
-
|
9
|
-
|
10
|
-
<script>
|
11
|
-
import { Component, Vue, Watch } from '@a-vue'
|
12
|
-
import { GetAction } from '@a-vue/api-resources/ApiActions'
|
13
|
-
|
14
|
-
Component.registerHooks([
|
15
|
-
'beforeRouteEnter',
|
16
|
-
'beforeRouteUpdate'
|
17
|
-
])
|
18
|
-
|
19
|
-
function load (route) {
|
20
|
-
const routeDefinition = route.meta.routeDefinition
|
21
|
-
const Component = routeDefinition.config.edit
|
22
|
-
|
23
|
-
if (!Component.getEditRouteConfig) {
|
24
|
-
console.warn('An edit route component must implement a static getEditRouteConfig property.')
|
25
|
-
}
|
26
|
-
|
27
|
-
const editConfig = Component.getEditRouteConfig(route)
|
28
|
-
const action = editConfig.getAction || editConfig.ModelClass.getAction('get')
|
29
|
-
|
30
|
-
return new GetAction()
|
31
|
-
.setAction(action)
|
32
|
-
.setFields(editConfig.fields)
|
33
|
-
.setId(editConfig.id || route.params[routeDefinition.idKey])
|
34
|
-
.load()
|
35
|
-
}
|
36
|
-
|
37
|
-
let routerHookCalled = false
|
38
|
-
|
39
|
-
@Component
|
40
|
-
export default class EditRoute extends Vue {
|
41
|
-
model = null
|
42
|
-
|
43
|
-
/**
|
44
|
-
* triggered, when the route name changes
|
45
|
-
* not triggered, when only route params change
|
46
|
-
*/
|
47
|
-
async beforeRouteEnter (to, from, next) {
|
48
|
-
routerHookCalled = true
|
49
|
-
const result = await load(to)
|
50
|
-
next(vm => {
|
51
|
-
if (result !== false) {
|
52
|
-
vm.model = result
|
53
|
-
}
|
54
|
-
routerHookCalled = false
|
55
|
-
})
|
56
|
-
}
|
57
|
-
|
58
|
-
/**
|
59
|
-
* triggered both, if route name or route params change
|
60
|
-
*/
|
61
|
-
@Watch('$route.params')
|
62
|
-
async routeParamsChanged () {
|
63
|
-
if (routerHookCalled) {
|
64
|
-
// set model to null in order to not recreate detail route's
|
65
|
-
// child components with the stale model which is still active
|
66
|
-
// in between resolving the route with next() + creating the
|
67
|
-
// route edit component and resetting vm.model later in the callback
|
68
|
-
this.model = null
|
69
|
-
return
|
70
|
-
}
|
71
|
-
this.model = await load(this.$route)
|
72
|
-
}
|
73
|
-
|
74
|
-
get Component () {
|
75
|
-
return this.$routeDefinition.config.edit
|
76
|
-
}
|
77
|
-
}
|
78
|
-
</script>
|
@@ -1,110 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<component
|
3
|
-
:is="Component"
|
4
|
-
v-if="isLoaded"
|
5
|
-
:models="models"
|
6
|
-
:meta="meta"
|
7
|
-
/>
|
8
|
-
</template>
|
9
|
-
|
10
|
-
<script>
|
11
|
-
import { Component, Vue, Watch } from '@a-vue'
|
12
|
-
import { ListAction } from '@a-vue/api-resources/ApiActions'
|
13
|
-
import { NextRouteFilterSource } from '@a-vue/components/list/NextRouteFilterSource'
|
14
|
-
import { ListViewModel } from '@afeefa/api-resources-client'
|
15
|
-
|
16
|
-
Component.registerHooks([
|
17
|
-
'beforeRouteEnter',
|
18
|
-
'beforeRouteUpdate'
|
19
|
-
])
|
20
|
-
|
21
|
-
/**
|
22
|
-
* keep track 'this' in beforeRouteEnter
|
23
|
-
* in order to avoid rendering list pages with a stale set
|
24
|
-
* of models because next(vm => ...) will first create the
|
25
|
-
* list page with the existing set of models and update the
|
26
|
-
* models afterwards.
|
27
|
-
*/
|
28
|
-
let lastVm = null
|
29
|
-
|
30
|
-
function load (route) {
|
31
|
-
const routeDefinition = route.meta.routeDefinition
|
32
|
-
const Component = routeDefinition.config.list
|
33
|
-
|
34
|
-
if (!Component.getListRouteConfig) {
|
35
|
-
console.warn('A list route component must implement a static getListRouteConfig property.')
|
36
|
-
}
|
37
|
-
|
38
|
-
const request = new ListViewModel(Component.getListRouteConfig(route))
|
39
|
-
// read from next route query string, but do not push
|
40
|
-
// list component will be init with used_filters
|
41
|
-
.filterSource(new NextRouteFilterSource(route), false)
|
42
|
-
// read from history, but do not push
|
43
|
-
// list component will be init with used_filters
|
44
|
-
.historyKey(route.path, false)
|
45
|
-
.initFilters({
|
46
|
-
source: true,
|
47
|
-
history: true
|
48
|
-
})
|
49
|
-
.getApiRequest()
|
50
|
-
|
51
|
-
return new ListAction()
|
52
|
-
.setRequest(request)
|
53
|
-
.load()
|
54
|
-
}
|
55
|
-
|
56
|
-
let routerHookCalled = false
|
57
|
-
|
58
|
-
@Component
|
59
|
-
export default class ListRoute extends Vue {
|
60
|
-
models = null
|
61
|
-
meta = null
|
62
|
-
isLoaded = false
|
63
|
-
|
64
|
-
async beforeRouteEnter (to, from, next) {
|
65
|
-
routerHookCalled = true
|
66
|
-
const result = await load(to)
|
67
|
-
|
68
|
-
if (lastVm) {
|
69
|
-
lastVm.isLoaded = false
|
70
|
-
}
|
71
|
-
|
72
|
-
next(vm => {
|
73
|
-
if (result !== false) {
|
74
|
-
const {models, meta} = result
|
75
|
-
vm.models = models
|
76
|
-
vm.meta = meta
|
77
|
-
vm.isLoaded = true
|
78
|
-
}
|
79
|
-
|
80
|
-
lastVm = vm
|
81
|
-
routerHookCalled = false
|
82
|
-
})
|
83
|
-
}
|
84
|
-
|
85
|
-
/**
|
86
|
-
* triggered both, if route name or route params change
|
87
|
-
*/
|
88
|
-
@Watch('$route.params')
|
89
|
-
async routeParamsChanged () {
|
90
|
-
if (routerHookCalled) {
|
91
|
-
return
|
92
|
-
}
|
93
|
-
|
94
|
-
if (!this.isLoaded) {
|
95
|
-
const result = await load(this.$route)
|
96
|
-
|
97
|
-
if (result !== false) {
|
98
|
-
const {models, meta} = result
|
99
|
-
this.models = models
|
100
|
-
this.meta = meta
|
101
|
-
this.isLoaded = true
|
102
|
-
}
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
get Component () {
|
107
|
-
return this.$routeDefinition.config.list
|
108
|
-
}
|
109
|
-
}
|
110
|
-
</script>
|