@afeefa/vue-app 0.0.53 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) 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 +2 -2
  10. package/src/components/AContextMenuItem.vue +2 -2
  11. package/src/components/ADatePicker.vue +1 -1
  12. package/src/components/ADialog.vue +3 -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/ARichTextArea.vue +257 -0
  21. package/src/components/ARow.vue +1 -1
  22. package/src/components/ASaveIndicator.vue +1 -1
  23. package/src/components/ASearchSelect.vue +34 -18
  24. package/src/components/ASelect.vue +1 -1
  25. package/src/components/ATable.vue +1 -1
  26. package/src/components/ATableHeader.vue +1 -1
  27. package/src/components/ATableRow.vue +1 -1
  28. package/src/components/ATextArea.vue +1 -1
  29. package/src/components/ATextField.vue +1 -1
  30. package/src/components/form/EditForm.vue +2 -6
  31. package/src/components/form/EditModal.vue +23 -18
  32. package/src/components/form/FormFieldMixin.js +2 -3
  33. package/src/components/form/fields/FormFieldCheckbox.vue +18 -0
  34. package/src/components/form/fields/FormFieldDate.vue +1 -1
  35. package/src/components/form/fields/FormFieldRadioGroup.vue +1 -1
  36. package/src/components/form/fields/FormFieldRichTextArea.vue +14 -0
  37. package/src/components/form/fields/FormFieldSearchSelect.vue +1 -1
  38. package/src/components/form/fields/FormFieldSelect.vue +1 -1
  39. package/src/components/form/fields/FormFieldSelect2.vue +1 -1
  40. package/src/components/form/fields/FormFieldText.vue +1 -1
  41. package/src/components/form/fields/FormFieldTextArea.vue +1 -1
  42. package/src/components/index.js +4 -0
  43. package/src/components/list/ListFilterMixin.js +1 -1
  44. package/src/components/list/ListFilterRow.vue +1 -1
  45. package/src/components/list/ListViewMixin.js +7 -4
  46. package/src/components/list/filters/ListFilterPage.vue +1 -1
  47. package/src/components/list/filters/ListFilterSearch.vue +1 -1
  48. package/src/components/list/filters/ListFilterSelect.vue +1 -1
  49. package/src/components/mixins/ClickOutsideMixin.js +1 -1
  50. package/src/components/mixins/ComponentWidthMixin.js +1 -1
  51. package/src/components/search-select/SearchSelectFilters.vue +1 -1
  52. package/src/components/search-select/SearchSelectList.vue +13 -3
  53. package/src/components/vue/Component.js +46 -0
  54. package/src/index.js +4 -0
  55. package/src/plugins/api-resources/ApiResourcesPlugin.js +12 -0
  56. package/src/plugins/route-config/RouteConfigPlugin.js +25 -1
  57. package/src/services/escape/CancelOnEscMixin.js +1 -1
  58. package/src/services/position/UsesPositionServiceMixin.js +1 -1
  59. package/src/styles/forms.scss +8 -0
  60. package/src/styles/vue-app.scss +1 -0
  61. package/src-admin/bootstrap.js +2 -5
  62. package/src-admin/components/App.vue +1 -1
  63. package/src-admin/components/NotFound.vue +65 -0
  64. package/src-admin/components/SidebarMenu.vue +1 -1
  65. package/src-admin/components/Splash.vue +34 -34
  66. package/src-admin/components/Start.vue +2 -2
  67. package/src-admin/components/app/AppBarButton.vue +1 -1
  68. package/src-admin/components/app/AppBarButtons.vue +1 -1
  69. package/src-admin/components/app/AppBarTitle.vue +1 -1
  70. package/src-admin/components/app/AppBarTitleContainer.vue +1 -1
  71. package/src-admin/components/controls/SearchSelectFormField.vue +223 -0
  72. package/src-admin/components/detail/DetailProperty.vue +2 -4
  73. package/src-admin/components/list/ListColumnHeader.vue +5 -4
  74. package/src-admin/components/list/ListTitle.vue +1 -1
  75. package/src-admin/components/list/ListView.vue +12 -10
  76. package/src-admin/components/menu/SidebarMenuItem.vue +1 -1
  77. package/src-admin/components/model/ModelCount.vue +1 -1
  78. package/src-admin/components/model/ModelIcon.vue +1 -1
  79. package/src-admin/components/pages/CreatePage.vue +2 -3
  80. package/src-admin/components/pages/DetailPage.vue +4 -4
  81. package/src-admin/components/pages/EditPage.vue +5 -6
  82. package/src-admin/components/pages/EditPageMixin.js +1 -1
  83. package/src-admin/components/pages/ListPage.vue +3 -4
  84. package/src-admin/components/routes/CreateRoute.vue +1 -1
  85. package/src-admin/components/routes/DetailRoute.vue +4 -4
  86. package/src-admin/components/routes/EditRoute.vue +4 -4
  87. package/src-admin/components/routes/ListRoute.vue +4 -4
  88. package/src-admin/config/vuetify.js +3 -1
  89. package/src-admin/models/Model.js +13 -0
  90. package/src-admin/models/ModelAdminConfig.js +20 -0
  91. package/src-components/AMdiIcon.vue +18 -0
  92. package/src/utils/props-helper.js +0 -21
@@ -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,9 +47,8 @@
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
- import { apiResources } from '@afeefa/api-resources-client'
53
52
 
54
53
  @Component({
55
54
  props: ['icon', 'title', 'createModel', 'listLink']
@@ -86,7 +85,7 @@ export default class CreatePage extends Mixins(EditPageMixin) {
86
85
  return this.title
87
86
  }
88
87
 
89
- const type = apiResources.getType(this.ModelClass.type)
88
+ const type = this.$apiResources.getType(this.ModelClass.type)
90
89
  return type.t('TITLE_NEW')
91
90
  }
92
91
 
@@ -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({
@@ -64,8 +64,8 @@ export default class DetailPage extends Vue {
64
64
  removeConfirmed = null
65
65
 
66
66
  created () {
67
- if (!this.$parent.constructor.detailRouteConfig) {
68
- console.warn('<detail-page> owner must provide a static getDetailConfig method.')
67
+ if (!this.$parent.constructor.getDetailRouteConfig) {
68
+ console.warn('<detail-page> owner must provide a static getDetailRouteConfig method.')
69
69
  }
70
70
  this.$emit('model', this.model)
71
71
  }
@@ -80,7 +80,7 @@ export default class DetailPage extends Vue {
80
80
  }
81
81
 
82
82
  get detailConfig () {
83
- return this.$parent.constructor.detailRouteConfig
83
+ return this.$parent.constructor.getDetailRouteConfig(this.$route)
84
84
  }
85
85
 
86
86
  get document () {
@@ -65,8 +65,7 @@
65
65
  </template>
66
66
 
67
67
  <script>
68
- import { Component, Mixins, Watch } from 'vue-property-decorator'
69
- import { apiResources } from '@afeefa/api-resources-client'
68
+ import { Component, Mixins, Watch } from '@a-vue'
70
69
  import { EditPageMixin } from './EditPageMixin'
71
70
 
72
71
  @Component({
@@ -78,8 +77,8 @@ export default class EditPage extends Mixins(EditPageMixin) {
78
77
  model_ = null
79
78
 
80
79
  created () {
81
- if (!this.$parent.constructor.editRouteConfig) {
82
- console.warn('<edit-page> owner must provide a static editRouteConfig method.')
80
+ if (!this.$parent.constructor.getEditRouteConfig) {
81
+ console.warn('<edit-page> owner must provide a static getEditRouteConfig method.')
83
82
  }
84
83
 
85
84
  this.model_ = this.model
@@ -95,7 +94,7 @@ export default class EditPage extends Mixins(EditPageMixin) {
95
94
  }
96
95
 
97
96
  get editConfig () {
98
- return this.$parent.constructor.editRouteConfig
97
+ return this.$parent.constructor.getEditRouteConfig(this.$route)
99
98
  }
100
99
 
101
100
  get modelUpateAction () {
@@ -123,7 +122,7 @@ export default class EditPage extends Mixins(EditPageMixin) {
123
122
  return this.title
124
123
  }
125
124
 
126
- const type = apiResources.getType(this.ModelClass.type)
125
+ const type = this.$apiResources.getType(this.ModelClass.type)
127
126
  return type.t('TITLE_EMPTY')
128
127
  }
129
128
 
@@ -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,8 +20,7 @@
20
20
  </template>
21
21
 
22
22
  <script>
23
- import { Component, Vue } from 'vue-property-decorator'
24
- import { apiResources } from '@afeefa/api-resources-client'
23
+ import { Component, Vue } from '@a-vue'
25
24
 
26
25
  @Component({
27
26
  props: ['icon', 'title', 'newTitle', 'newLink', 'Model']
@@ -38,7 +37,7 @@ export default class ListPage extends Vue {
38
37
  return this.title
39
38
  }
40
39
 
41
- const type = apiResources.getType(this.Model.type)
40
+ const type = this.$apiResources.getType(this.Model.type)
42
41
  return type.t('TITLE_PLURAL')
43
42
  }
44
43
 
@@ -47,7 +46,7 @@ export default class ListPage extends Vue {
47
46
  return this.newTitle
48
47
  }
49
48
 
50
- const type = apiResources.getType(this.Model.type)
49
+ const type = this.$apiResources.getType(this.Model.type)
51
50
  return type.t('TITLE_SINGULAR')
52
51
  }
53
52
 
@@ -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([
@@ -19,11 +19,11 @@ function load (route) {
19
19
  const routeDefinition = route.meta.routeDefinition
20
20
  const Component = routeDefinition.config.detail
21
21
 
22
- if (!Component.detailRouteConfig) {
23
- console.warn('A detail route component must implement a static detailRouteConfig property.')
22
+ if (!Component.getDetailRouteConfig) {
23
+ console.warn('A detail route component must implement a static getDetailRouteConfig property.')
24
24
  }
25
25
 
26
- const detailConfig = Component.detailRouteConfig
26
+ const detailConfig = Component.getDetailRouteConfig(route)
27
27
  const action = detailConfig.action || detailConfig.ModelClass.getAction('get')
28
28
 
29
29
  return new GetAction()
@@ -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([
@@ -20,11 +20,11 @@ function load (route) {
20
20
  const routeDefinition = route.meta.routeDefinition
21
21
  const Component = routeDefinition.config.edit
22
22
 
23
- if (!Component.editRouteConfig) {
24
- console.warn('An edit route component must implement a static editRouteConfig property.')
23
+ if (!Component.getEditRouteConfig) {
24
+ console.warn('An edit route component must implement a static getEditRouteConfig property.')
25
25
  }
26
26
 
27
- const editConfig = Component.editRouteConfig
27
+ const editConfig = Component.getEditRouteConfig(route)
28
28
  const action = editConfig.getAction || editConfig.ModelClass.getAction('get')
29
29
 
30
30
  return new GetAction()
@@ -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'
@@ -31,11 +31,11 @@ function load (route) {
31
31
  const routeDefinition = route.meta.routeDefinition
32
32
  const Component = routeDefinition.config.list
33
33
 
34
- if (!Component.listViewConfig) {
35
- console.warn('A list route component must implement a static listViewConfig property.')
34
+ if (!Component.getListRouteConfig) {
35
+ console.warn('A list route component must implement a static getListRouteConfig property.')
36
36
  }
37
37
 
38
- const request = new ListViewModel(Component.listViewConfig)
38
+ const request = new ListViewModel(Component.getListRouteConfig(route))
39
39
  // read from next route query string, but do not push
40
40
  // list component will be init with used_filters
41
41
  .filterSource(new NextRouteFilterSource(route), false)
@@ -6,6 +6,7 @@ import {
6
6
  mdiDelete,
7
7
  mdiDotsHorizontal,
8
8
  mdiDotsVertical,
9
+ mdiLock,
9
10
  mdiLogoutVariant,
10
11
  mdiMagnify,
11
12
  mdiPencil,
@@ -32,7 +33,8 @@ export default new Vuetify({
32
33
  pencilIcon: mdiPencil,
33
34
  trashCanIcon: mdiDelete,
34
35
  calendarIcon: mdiCalendar,
35
- searchIcon: mdiMagnify
36
+ searchIcon: mdiMagnify,
37
+ lockIcon: mdiLock
36
38
  }
37
39
  },
38
40
  breakpoint: {
@@ -1,11 +1,17 @@
1
1
  import { Model as ApiResourcesModel, apiResources } from '@afeefa/api-resources-client'
2
2
  import { mdiAlphaMCircle } from '@mdi/js'
3
3
 
4
+ import { ModelAdminConfig } from './ModelAdminConfig'
5
+
6
+ export { ModelAdminConfig }
7
+
4
8
  export class Model extends ApiResourcesModel {
5
9
  static resourceType = null
6
10
  static routeName = null
7
11
  static routeIdKey = 'id'
8
12
 
13
+ static config = null
14
+
9
15
  static getLink (action) {
10
16
  return (new this()).getLink(action)
11
17
  }
@@ -21,6 +27,13 @@ export class Model extends ApiResourcesModel {
21
27
  return null
22
28
  }
23
29
 
30
+ static get adminConfig () {
31
+ return new ModelAdminConfig()
32
+ .setIcon({
33
+ icon: mdiAlphaMCircle
34
+ })
35
+ }
36
+
24
37
  static icon = {
25
38
  icon: mdiAlphaMCircle,
26
39
  color: 'blue lighten-2'
@@ -0,0 +1,20 @@
1
+ export class ModelAdminConfig {
2
+ icon = null
3
+ selectedListConfig = null
4
+ selectableListConfig = null
5
+
6
+ setIcon (icon) {
7
+ this.icon = icon
8
+ return this
9
+ }
10
+
11
+ setSelectedListConfig (selectedListConfig) {
12
+ this.selectedListConfig = selectedListConfig
13
+ return this
14
+ }
15
+
16
+ setSelectableListConfig (selectableListConfig) {
17
+ this.selectableListConfig = selectableListConfig
18
+ return this
19
+ }
20
+ }
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <div>TEST</div>
3
+ </template>
4
+
5
+
6
+ <script>
7
+ import { Component, Vue } from '@a-vue'
8
+
9
+ @Component({
10
+ props: ['name']
11
+ })
12
+ export default class Splash extends Vue {
13
+ }
14
+ </script>
15
+
16
+
17
+ <style lang="scss" scoped>
18
+ </style>
@@ -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
- }