@afeefa/vue-app 0.0.62 → 0.0.65

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/.afeefa/package/release/version.txt +1 -1
  2. package/README.md +3 -1
  3. package/package.json +1 -1
  4. package/src/components/ABreadcrumbs.vue +3 -2
  5. package/src/components/AModal.vue +21 -3
  6. package/src/components/ARichTextArea.vue +95 -85
  7. package/src/components/ATableRow.vue +4 -0
  8. package/src/components/flying-context/FlyingContextEvent.js +5 -0
  9. package/src/components/form/EditForm.vue +13 -3
  10. package/src/components/form/EditModal.vue +52 -35
  11. package/src/components/form/NestedEditForm.vue +4 -0
  12. package/src/components/form/fields/FormFieldRichTextArea.vue +5 -3
  13. package/src/components/list/ListViewMixin.js +14 -2
  14. package/src/components/search-select/SearchSelectList.vue +0 -1
  15. package/src/components/vue/Component.js +9 -2
  16. package/src/events.js +2 -0
  17. package/src-admin/bootstrap.js +1 -0
  18. package/src-admin/components/App.vue +55 -6
  19. package/src-admin/components/FlyingContext.vue +77 -0
  20. package/src-admin/components/FlyingContextContainer.vue +85 -0
  21. package/src-admin/components/StickyFooter.vue +42 -0
  22. package/src-admin/components/StickyFooterContainer.vue +66 -0
  23. package/src-admin/components/form/EditFormButtons.vue +8 -3
  24. package/src-admin/components/index.js +4 -7
  25. package/src-admin/components/list/ListView.vue +22 -9
  26. package/src-admin/components/pages/EditPage.vue +23 -9
  27. package/src-admin/components/routes/DataRouteMixin.js +24 -15
  28. package/src-admin/config/routing.js +0 -11
  29. package/src-admin/config/vuetify.js +7 -1
  30. package/src-admin/directives/index.js +26 -0
  31. package/src-admin/styles.scss +1 -4
  32. package/src-admin/components/pages/CreatePage.vue +0 -114
  33. package/src-admin/components/pages/DetailPage.vue +0 -143
  34. package/src-admin/components/pages/EditPageMixin.js +0 -96
  35. package/src-admin/components/pages/ListPage.vue +0 -55
  36. package/src-admin/components/routes/CreateRoute.vue +0 -15
  37. package/src-admin/components/routes/DetailRoute.vue +0 -85
  38. package/src-admin/components/routes/EditRoute.vue +0 -78
  39. package/src-admin/components/routes/ListRoute.vue +0 -110
@@ -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>