@afeefa/vue-app 0.0.51 → 0.0.54

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/.afeefa/package/release/version.txt +1 -1
  2. package/package.json +3 -10
  3. package/src/api-resources/ApiActions.js +31 -0
  4. package/src/components/AAlert.vue +1 -1
  5. package/src/components/AAutocomplete.vue +1 -1
  6. package/src/components/ABadge.vue +1 -1
  7. package/src/components/ABreadcrumbs.vue +1 -1
  8. package/src/components/ACheckbox.vue +35 -0
  9. package/src/components/AContextMenu.vue +1 -1
  10. package/src/components/AContextMenuItem.vue +1 -1
  11. package/src/components/ADatePicker.vue +1 -1
  12. package/src/components/ADialog.vue +1 -1
  13. package/src/components/AGrid.vue +2 -1
  14. package/src/components/AIcon.vue +1 -1
  15. package/src/components/AIconButton.vue +1 -1
  16. package/src/components/ALoadingIndicator.vue +1 -1
  17. package/src/components/AModal.vue +1 -1
  18. package/src/components/APagination.vue +1 -1
  19. package/src/components/ARadioGroup.vue +1 -1
  20. package/src/components/ARow.vue +1 -1
  21. package/src/components/ASaveIndicator.vue +1 -1
  22. package/src/components/ASearchSelect.vue +22 -6
  23. package/src/components/ASelect.vue +1 -1
  24. package/src/components/ATable.vue +1 -1
  25. package/src/components/ATableHeader.vue +1 -1
  26. package/src/components/ATableRow.vue +1 -1
  27. package/src/components/ATextArea.vue +1 -1
  28. package/src/components/ATextField.vue +1 -1
  29. package/src/components/form/EditForm.vue +1 -1
  30. package/src/components/form/EditModal.vue +1 -1
  31. package/src/components/form/FormFieldMixin.js +1 -1
  32. package/src/components/form/fields/FormFieldCheckbox.vue +18 -0
  33. package/src/components/form/fields/FormFieldDate.vue +1 -1
  34. package/src/components/form/fields/FormFieldRadioGroup.vue +1 -1
  35. package/src/components/form/fields/FormFieldSearchSelect.vue +1 -1
  36. package/src/components/form/fields/FormFieldSelect.vue +1 -1
  37. package/src/components/form/fields/FormFieldSelect2.vue +1 -1
  38. package/src/components/form/fields/FormFieldText.vue +1 -1
  39. package/src/components/form/fields/FormFieldTextArea.vue +1 -1
  40. package/src/components/index.js +2 -0
  41. package/src/components/list/ListFilterMixin.js +1 -1
  42. package/src/components/list/ListFilterRow.vue +1 -1
  43. package/src/components/list/ListViewMixin.js +3 -4
  44. package/src/components/list/filters/ListFilterPage.vue +1 -1
  45. package/src/components/list/filters/ListFilterSearch.vue +1 -1
  46. package/src/components/list/filters/ListFilterSelect.vue +1 -1
  47. package/src/components/mixins/ClickOutsideMixin.js +1 -1
  48. package/src/components/mixins/ComponentWidthMixin.js +1 -1
  49. package/src/components/search-select/SearchSelectFilters.vue +1 -1
  50. package/src/components/search-select/SearchSelectList.vue +8 -2
  51. package/src/components/vue/Component.js +46 -0
  52. package/src/index.js +2 -0
  53. package/src/plugins/route-config/RouteConfigPlugin.js +25 -1
  54. package/src/services/escape/CancelOnEscMixin.js +1 -1
  55. package/src/services/position/UsesPositionServiceMixin.js +1 -1
  56. package/src-admin/components/App.vue +2 -2
  57. package/src-admin/components/NotFound.vue +65 -0
  58. package/src-admin/components/SidebarMenu.vue +1 -1
  59. package/src-admin/components/Splash.vue +34 -34
  60. package/src-admin/components/Start.vue +2 -2
  61. package/src-admin/components/app/AppBarButton.vue +1 -1
  62. package/src-admin/components/app/AppBarButtons.vue +1 -1
  63. package/src-admin/components/app/AppBarTitle.vue +1 -1
  64. package/src-admin/components/app/AppBarTitleContainer.vue +1 -1
  65. package/src-admin/components/detail/DetailProperty.vue +1 -1
  66. package/src-admin/components/list/ListColumnHeader.vue +1 -1
  67. package/src-admin/components/list/ListTitle.vue +1 -1
  68. package/src-admin/components/list/ListView.vue +1 -1
  69. package/src-admin/components/menu/SidebarMenuItem.vue +1 -1
  70. package/src-admin/components/model/ModelCount.vue +1 -1
  71. package/src-admin/components/model/ModelIcon.vue +1 -1
  72. package/src-admin/components/pages/CreatePage.vue +1 -1
  73. package/src-admin/components/pages/DetailPage.vue +1 -1
  74. package/src-admin/components/pages/EditPage.vue +1 -1
  75. package/src-admin/components/pages/EditPageMixin.js +1 -1
  76. package/src-admin/components/pages/ListPage.vue +1 -1
  77. package/src-admin/components/routes/CreateRoute.vue +1 -1
  78. package/src-admin/components/routes/DetailRoute.vue +1 -1
  79. package/src-admin/components/routes/EditRoute.vue +1 -1
  80. package/src-admin/components/routes/ListRoute.vue +1 -1
  81. package/src/utils/props-helper.js +0 -21
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
  <script>
12
- import { Component, Vue } from 'vue-property-decorator'
12
+ import { Component, Vue } from '@a-vue'
13
13
 
14
14
  @Component({
15
15
  props: ['filters', 'count']
@@ -13,6 +13,7 @@
13
13
  v-for="model in models_"
14
14
  :key="model.id"
15
15
  small
16
+ :class="{selected: isSelected(model)}"
16
17
  >
17
18
  <slot
18
19
  name="row"
@@ -38,11 +39,11 @@
38
39
 
39
40
 
40
41
  <script>
41
- import { Component, Mixins } from 'vue-property-decorator'
42
+ import { Component, Mixins } from '@a-vue'
42
43
  import { ListViewMixin } from '@a-vue/components/list/ListViewMixin'
43
44
 
44
45
  @Component({
45
- props: ['q']
46
+ props: ['q', 'selectedItems']
46
47
  })
47
48
  export default class SearchSelectList extends Mixins(ListViewMixin) {
48
49
  get hasHeader () {
@@ -58,10 +59,15 @@ export default class SearchSelectList extends Mixins(ListViewMixin) {
58
59
  }
59
60
  }
60
61
 
62
+ isSelected (model) {
63
+ return !!this.selectedItems.find(i => i.equals(model))
64
+ }
65
+
61
66
  _filtersInitialized () {
62
67
  if (this.q) {
63
68
  this.filters.q.value = this.q
64
69
  }
70
+ this.$emit('update:filters', this.filters)
65
71
  }
66
72
  }
67
73
  </script>
@@ -0,0 +1,46 @@
1
+ import { Component as VueComponent } from 'vue-property-decorator'
2
+
3
+ const Component = function (options) {
4
+ if (options.props) {
5
+ options.props = propsWithDefaults(options.props)
6
+ }
7
+ return VueComponent(options)
8
+ }
9
+
10
+ Component.registerHooks = VueComponent.registerHooks
11
+
12
+ export { Component }
13
+
14
+ function propsWithDefaults (props) {
15
+ if (props && typeof props === 'object' && props.constructor === Object) {
16
+ return props
17
+ }
18
+
19
+ const normalizedProps = {}
20
+
21
+ for (const prop of props) {
22
+ if (typeof prop === 'object') {
23
+ Object.keys(prop).forEach(subProp => {
24
+ const value = prop[subProp]
25
+ // property: []
26
+ if (Array.isArray(value)) {
27
+ normalizedProps[subProp] = {
28
+ default () { // must be a function according to vue spec
29
+ return value
30
+ }
31
+ }
32
+ // property: { some object }, should be a normal vue props object
33
+ } else if (value && typeof value === 'object' && value.constructor === Object) {
34
+ normalizedProps[subProp] = value
35
+ // property: true, null, ...
36
+ } else {
37
+ normalizedProps[subProp] = { default: value }
38
+ }
39
+ })
40
+ } else {
41
+ normalizedProps[prop] = null
42
+ }
43
+ }
44
+
45
+ return normalizedProps
46
+ }
package/src/index.js CHANGED
@@ -0,0 +1,2 @@
1
+ export { Mixins, Vue, Watch } from 'vue-property-decorator'
2
+ export { Component } from '@a-vue/components/vue/Component'
@@ -121,7 +121,8 @@ class RouteConfigPlugin {
121
121
  this._promise = this._promise.then(() => {
122
122
  callback = callback({
123
123
  ROUTESET: this.routeSet,
124
- ROUTE: this.route
124
+ ROUTE: this.route,
125
+ GETROUTE: this.getRoute
125
126
  })
126
127
 
127
128
  if (!(callback instanceof Promise)) {
@@ -290,6 +291,29 @@ class RouteConfigPlugin {
290
291
  return new RouteSetDefinition(options).getDefinitions()
291
292
  }
292
293
 
294
+ getRoute = (name, component) => {
295
+ switch (name) {
296
+ case 'notfound':
297
+ return this.route({
298
+ path: '/:pathMatch(.*)*',
299
+ name: 'notfound',
300
+ ignoreBreadcrumb: true,
301
+ component: component || {
302
+ template: '<div>Not found</div>'
303
+ }
304
+ })
305
+ case 'auth':
306
+ return this.route({
307
+ path: '/auth2',
308
+ name: 'auth',
309
+ ignoreBreadcrumb: true,
310
+ component: {
311
+ template: '<div>Auth</div>'
312
+ }
313
+ })
314
+ }
315
+ }
316
+
293
317
  breadcrumb = options => {
294
318
  options.config = {
295
319
  ...this._config,
@@ -1,4 +1,4 @@
1
- import { Component, Vue } from 'vue-property-decorator'
1
+ import { Component, Vue } from '@a-vue'
2
2
 
3
3
  import { cascadingWindowEventDispatcher } from './CascadingWindowEventDispatcher'
4
4
 
@@ -1,4 +1,4 @@
1
- import { Component, Vue } from 'vue-property-decorator'
1
+ import { Component, Vue } from '@a-vue'
2
2
 
3
3
  import { positionService } from '../PositionService'
4
4
 
@@ -13,7 +13,7 @@
13
13
  >
14
14
  <router-link
15
15
  :to="{name: rootRouteName}"
16
- class="logoContainer d-flex flex-column pa-6"
16
+ class="logoContainer d-flex flex-column align-center pa-6"
17
17
  >
18
18
  <img
19
19
  v-if="logoUrl"
@@ -136,7 +136,7 @@
136
136
  </template>
137
137
 
138
138
  <script>
139
- import { Component, Vue, Watch } from 'vue-property-decorator'
139
+ import { Component, Vue, Watch } from '@a-vue'
140
140
  import { LoadingEvent } from '@a-vue/events'
141
141
  import { appConfig } from '@a-admin/config/AppConfig'
142
142
  import { sleep } from '@a-vue/utils/timeout'
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div class="notFound">
3
+ <a-row
4
+ vertical
5
+ center
6
+ class="content"
7
+ >
8
+ <div class="logo">
9
+ <slot />
10
+ </div>
11
+
12
+ <a-row
13
+ vertical
14
+ center
15
+ >
16
+ <div class="mt-0">
17
+ {{ title || '404 - Not Found' }}
18
+ </div>
19
+
20
+ <div class="mt-4">
21
+ <router-link :to="backlink || { path: '/'}">
22
+ {{ backlinkTitle || 'Zurück' }}
23
+ </router-link>
24
+ </div>
25
+ </a-row>
26
+ </a-row>
27
+ </div>
28
+ </template>
29
+
30
+
31
+ <script>
32
+ import { Component, Vue } from '@a-vue'
33
+
34
+ @Component({
35
+ name: 'adminNotFound',
36
+ props: ['title', 'backlink', 'backlinkTitle']
37
+ })
38
+ export default class NotFound extends Vue {
39
+ created () {
40
+ this.$parent.$emit('appLoaded')
41
+ }
42
+ }
43
+ </script>
44
+
45
+ <style lang="scss" scoped>
46
+ .notFound {
47
+ position: fixed;
48
+ top: 0;
49
+ left: 0;
50
+ width: 100vw;
51
+ height: 100vh;
52
+ }
53
+
54
+ .content {
55
+ position: absolute;
56
+ top: 50%;
57
+ left: 50%;
58
+ min-height: 50vh;
59
+ transform: translate(-50%, -50%);
60
+ }
61
+
62
+ .logo {
63
+ margin-bottom: 2rem;
64
+ }
65
+ </style>
@@ -32,7 +32,7 @@
32
32
  </template>
33
33
 
34
34
  <script>
35
- import { Component, Vue } from 'vue-property-decorator'
35
+ import { Component, Vue } from '@a-vue'
36
36
  import SidebarMenuItem from './menu/SidebarMenuItem'
37
37
 
38
38
  @Component({
@@ -1,41 +1,37 @@
1
1
  <template>
2
2
  <v-app class="splash">
3
- <v-container
4
- fill-height
5
- fluid
6
- pb-0
7
- d-flex
8
- align-center
9
- justify-center
3
+ <a-row
4
+ vertical
5
+ center
6
+ class="content"
10
7
  >
11
- <div>
12
- <div class="logo">
13
- <slot />
14
- </div>
8
+ <div class="logo">
9
+ <slot />
10
+ </div>
15
11
 
16
- <a-row
17
- vertical
18
- center
19
- >
20
- <v-progress-linear
21
- :size="45"
22
- :width="6"
23
- indeterminate
24
- :color="color || 'green'"
25
- />
12
+ <a-row
13
+ vertical
14
+ center
15
+ fullWidth
16
+ >
17
+ <v-progress-linear
18
+ :size="45"
19
+ :width="6"
20
+ indeterminate
21
+ :color="color || 'green'"
22
+ />
26
23
 
27
- <div class="mt-4">
28
- {{ title || 'Lade App ...' }}
29
- </div>
30
- </a-row>
31
- </div>
32
- </v-container>
24
+ <div class="mt-4">
25
+ {{ title || 'Lade App ...' }}
26
+ </div>
27
+ </a-row>
28
+ </a-row>
33
29
  </v-app>
34
30
  </template>
35
31
 
36
32
 
37
33
  <script>
38
- import { Component, Vue } from 'vue-property-decorator'
34
+ import { Component, Vue } from '@a-vue'
39
35
 
40
36
  @Component({
41
37
  props: ['title', 'color']
@@ -47,20 +43,24 @@ export default class Splash extends Vue {
47
43
  }
48
44
  </script>
49
45
 
50
-
51
46
  <style lang="scss" scoped>
52
47
  .splash {
53
- position: absolute;
48
+ position: fixed;
54
49
  top: 0;
55
50
  left: 0;
56
51
  width: 100vw;
52
+ height: 100vh;
57
53
  }
58
54
 
59
- .logo {
60
- margin-bottom: 2rem;
55
+ .content {
56
+ position: absolute;
57
+ top: 50%;
58
+ left: 50%;
59
+ min-height: 50vh;
60
+ transform: translate(-50%, -50%);
61
61
  }
62
62
 
63
- .container {
64
- transform: translateY(-10%);
63
+ .logo {
64
+ margin-bottom: 2rem;
65
65
  }
66
66
  </style>
@@ -6,12 +6,12 @@
6
6
  </template>
7
7
 
8
8
  <script>
9
- import { Component, Vue } from 'vue-property-decorator'
9
+ import { Component, Vue } from '@a-vue'
10
10
 
11
11
  @Component({
12
12
  props: ['splash']
13
13
  })
14
- export default class Index extends Vue {
14
+ export default class Start extends Vue {
15
15
  appLoaded () {
16
16
  this.splash.$destroy()
17
17
  }
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import { Component, Vue } from 'vue-property-decorator'
8
+ import { Component, Vue } from '@a-vue'
9
9
 
10
10
  @Component({
11
11
  props: ['prepend']
@@ -6,7 +6,7 @@
6
6
  </template>
7
7
 
8
8
  <script>
9
- import { Component, Vue } from 'vue-property-decorator'
9
+ import { Component, Vue } from '@a-vue'
10
10
 
11
11
  @Component
12
12
  export default class AppBarButtons extends Vue {
@@ -12,7 +12,7 @@
12
12
  </template>
13
13
 
14
14
  <script>
15
- import { Component, Vue } from 'vue-property-decorator'
15
+ import { Component, Vue } from '@a-vue'
16
16
 
17
17
  @Component({
18
18
  props: ['icon', 'title']
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  <script>
7
- import { Component, Vue } from 'vue-property-decorator'
7
+ import { Component, Vue } from '@a-vue'
8
8
 
9
9
  @Component
10
10
  export default class AppBarTitleContainer extends Vue {
@@ -24,7 +24,7 @@
24
24
 
25
25
 
26
26
  <script>
27
- import { Component, Vue } from 'vue-property-decorator'
27
+ import { Component, Vue } from '@a-vue'
28
28
  import { apiResources } from '@afeefa/api-resources-client'
29
29
 
30
30
  @Component({
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  <script>
24
- import { Component, Vue } from 'vue-property-decorator'
24
+ import { Component, Vue } from '@a-vue'
25
25
 
26
26
  @Component({
27
27
  props: ['text', 'order']
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
 
16
16
  <script>
17
- import { Component, Vue } from 'vue-property-decorator'
17
+ import { Component, Vue } from '@a-vue'
18
18
 
19
19
  @Component({
20
20
  props: ['link']
@@ -61,7 +61,7 @@
61
61
 
62
62
 
63
63
  <script>
64
- import { Component, Watch, Mixins } from 'vue-property-decorator'
64
+ import { Component, Watch, Mixins } from '@a-vue'
65
65
  import { ListViewMixin } from '@a-vue/components/list/ListViewMixin'
66
66
  import { LoadingEvent } from '@a-vue/events'
67
67
 
@@ -45,7 +45,7 @@
45
45
  </template>
46
46
 
47
47
  <script>
48
- import { Component, Vue } from 'vue-property-decorator'
48
+ import { Component, Vue } from '@a-vue'
49
49
 
50
50
  @Component({
51
51
  props: ['item']
@@ -10,7 +10,7 @@
10
10
 
11
11
 
12
12
  <script>
13
- import { Component, Vue } from 'vue-property-decorator'
13
+ import { Component, Vue } from '@a-vue'
14
14
  import { modelCountService } from './ModelCountService'
15
15
  import { SaveEvent } from '@a-vue/events'
16
16
 
@@ -8,7 +8,7 @@
8
8
  </template>
9
9
 
10
10
  <script>
11
- import { Component, Vue } from 'vue-property-decorator'
11
+ import { Component, Vue } from '@a-vue'
12
12
 
13
13
  @Component({
14
14
  props: ['model', 'modelClass']
@@ -47,7 +47,7 @@
47
47
  </template>
48
48
 
49
49
  <script>
50
- import { Component, Mixins } from 'vue-property-decorator'
50
+ import { Component, Mixins } from '@a-vue'
51
51
  import { EditPageMixin } from './EditPageMixin'
52
52
  import { apiResources } from '@afeefa/api-resources-client'
53
53
 
@@ -51,7 +51,7 @@
51
51
 
52
52
 
53
53
  <script>
54
- import { Component, Vue, Watch } from 'vue-property-decorator'
54
+ import { Component, Vue, Watch } from '@a-vue'
55
55
  import { RemoveAction } from '@a-vue/api-resources/ApiActions'
56
56
 
57
57
  @Component({
@@ -65,7 +65,7 @@
65
65
  </template>
66
66
 
67
67
  <script>
68
- import { Component, Mixins, Watch } from 'vue-property-decorator'
68
+ import { Component, Mixins, Watch } from '@a-vue'
69
69
  import { apiResources } from '@afeefa/api-resources-client'
70
70
  import { EditPageMixin } from './EditPageMixin'
71
71
 
@@ -1,6 +1,6 @@
1
1
  import { SaveAction } from '@a-vue/api-resources/ApiActions'
2
2
  import { DialogEvent } from '@a-vue/events'
3
- import { Component, Vue } from 'vue-property-decorator'
3
+ import { Component, Vue } from '@a-vue'
4
4
 
5
5
  @Component({
6
6
  props: ['saveAction']
@@ -20,7 +20,7 @@
20
20
  </template>
21
21
 
22
22
  <script>
23
- import { Component, Vue } from 'vue-property-decorator'
23
+ import { Component, Vue } from '@a-vue'
24
24
  import { apiResources } from '@afeefa/api-resources-client'
25
25
 
26
26
  @Component({
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  <script>
7
- import { Component, Vue } from 'vue-property-decorator'
7
+ import { Component, Vue } from '@a-vue'
8
8
 
9
9
  @Component
10
10
  export default class CreateRoute extends Vue {
@@ -7,7 +7,7 @@
7
7
  </template>
8
8
 
9
9
  <script>
10
- import { Component, Vue, Watch } from 'vue-property-decorator'
10
+ import { Component, Vue, Watch } from '@a-vue'
11
11
  import { GetAction } from '@a-vue/api-resources/ApiActions'
12
12
 
13
13
  Component.registerHooks([
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
  <script>
11
- import { Component, Vue, Watch } from 'vue-property-decorator'
11
+ import { Component, Vue, Watch } from '@a-vue'
12
12
  import { GetAction } from '@a-vue/api-resources/ApiActions'
13
13
 
14
14
  Component.registerHooks([
@@ -8,7 +8,7 @@
8
8
  </template>
9
9
 
10
10
  <script>
11
- import { Component, Vue, Watch } from 'vue-property-decorator'
11
+ import { Component, Vue, Watch } from '@a-vue'
12
12
  import { ListAction } from '@a-vue/api-resources/ApiActions'
13
13
  import { NextRouteFilterSource } from '@a-vue/components/list/NextRouteFilterSource'
14
14
  import { ListViewModel } from '@afeefa/api-resources-client'
@@ -1,21 +0,0 @@
1
- export function propsWithDefaults (props) {
2
- const normalizedProps = {}
3
-
4
- for (const prop of props) {
5
- if (typeof prop === 'object') {
6
- Object.keys(prop).forEach(subProp => {
7
- if (typeof prop[subProp] === 'object') {
8
- normalizedProps[subProp] = prop[subProp]
9
- } else {
10
- normalizedProps[subProp] = { default: prop[subProp] }
11
- }
12
- })
13
- } else {
14
- normalizedProps[prop] = null
15
- }
16
- }
17
-
18
- return {
19
- props: normalizedProps
20
- }
21
- }