@afeefa/vue-app 0.0.53 → 0.0.56
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 +3 -10
- package/src/api-resources/ApiActions.js +31 -0
- package/src/components/AAlert.vue +1 -1
- package/src/components/AAutocomplete.vue +1 -1
- package/src/components/ABadge.vue +1 -1
- package/src/components/ABreadcrumbs.vue +1 -1
- package/src/components/ACheckbox.vue +35 -0
- package/src/components/AContextMenu.vue +2 -2
- package/src/components/AContextMenuItem.vue +2 -2
- package/src/components/ADatePicker.vue +1 -1
- package/src/components/ADialog.vue +3 -1
- package/src/components/AGrid.vue +2 -1
- package/src/components/AIcon.vue +1 -1
- package/src/components/AIconButton.vue +1 -1
- package/src/components/ALoadingIndicator.vue +1 -1
- package/src/components/AModal.vue +1 -1
- package/src/components/APagination.vue +1 -1
- package/src/components/ARadioGroup.vue +1 -1
- package/src/components/ARichTextArea.vue +257 -0
- package/src/components/ARow.vue +1 -1
- package/src/components/ASaveIndicator.vue +1 -1
- package/src/components/ASearchSelect.vue +34 -18
- package/src/components/ASelect.vue +1 -1
- package/src/components/ATable.vue +1 -1
- package/src/components/ATableHeader.vue +1 -1
- package/src/components/ATableRow.vue +1 -1
- package/src/components/ATextArea.vue +1 -1
- package/src/components/ATextField.vue +1 -1
- package/src/components/form/EditForm.vue +2 -6
- package/src/components/form/EditModal.vue +23 -18
- package/src/components/form/FormFieldMixin.js +2 -3
- package/src/components/form/fields/FormFieldCheckbox.vue +18 -0
- package/src/components/form/fields/FormFieldDate.vue +1 -1
- package/src/components/form/fields/FormFieldRadioGroup.vue +1 -1
- package/src/components/form/fields/FormFieldRichTextArea.vue +14 -0
- package/src/components/form/fields/FormFieldSearchSelect.vue +1 -1
- package/src/components/form/fields/FormFieldSelect.vue +1 -1
- package/src/components/form/fields/FormFieldSelect2.vue +1 -1
- package/src/components/form/fields/FormFieldText.vue +1 -1
- package/src/components/form/fields/FormFieldTextArea.vue +1 -1
- package/src/components/index.js +4 -0
- package/src/components/list/ListFilterMixin.js +1 -1
- package/src/components/list/ListFilterRow.vue +1 -1
- package/src/components/list/ListViewMixin.js +7 -4
- package/src/components/list/filters/ListFilterPage.vue +1 -1
- package/src/components/list/filters/ListFilterSearch.vue +1 -1
- package/src/components/list/filters/ListFilterSelect.vue +1 -1
- package/src/components/mixins/ClickOutsideMixin.js +1 -1
- package/src/components/mixins/ComponentWidthMixin.js +1 -1
- package/src/components/search-select/SearchSelectFilters.vue +1 -1
- package/src/components/search-select/SearchSelectList.vue +13 -3
- package/src/components/vue/Component.js +46 -0
- package/src/index.js +4 -0
- package/src/plugins/api-resources/ApiResourcesPlugin.js +12 -0
- package/src/plugins/route-config/RouteConfigPlugin.js +25 -1
- package/src/services/escape/CancelOnEscMixin.js +1 -1
- package/src/services/position/UsesPositionServiceMixin.js +1 -1
- package/src/styles/forms.scss +8 -0
- package/src/styles/vue-app.scss +1 -0
- package/src-admin/bootstrap.js +2 -5
- package/src-admin/components/App.vue +1 -1
- package/src-admin/components/NotFound.vue +65 -0
- package/src-admin/components/SidebarMenu.vue +1 -1
- package/src-admin/components/Splash.vue +34 -34
- package/src-admin/components/Start.vue +2 -2
- package/src-admin/components/app/AppBarButton.vue +1 -1
- package/src-admin/components/app/AppBarButtons.vue +1 -1
- package/src-admin/components/app/AppBarTitle.vue +1 -1
- package/src-admin/components/app/AppBarTitleContainer.vue +1 -1
- package/src-admin/components/controls/SearchSelectFormField.vue +223 -0
- package/src-admin/components/detail/DetailProperty.vue +2 -4
- package/src-admin/components/list/ListColumnHeader.vue +5 -4
- package/src-admin/components/list/ListTitle.vue +1 -1
- package/src-admin/components/list/ListView.vue +12 -10
- package/src-admin/components/menu/SidebarMenuItem.vue +1 -1
- package/src-admin/components/model/ModelCount.vue +1 -1
- package/src-admin/components/model/ModelIcon.vue +1 -1
- package/src-admin/components/pages/CreatePage.vue +2 -3
- package/src-admin/components/pages/DetailPage.vue +4 -4
- package/src-admin/components/pages/EditPage.vue +5 -6
- package/src-admin/components/pages/EditPageMixin.js +1 -1
- package/src-admin/components/pages/ListPage.vue +3 -4
- package/src-admin/components/routes/CreateRoute.vue +1 -1
- package/src-admin/components/routes/DetailRoute.vue +4 -4
- package/src-admin/components/routes/EditRoute.vue +4 -4
- package/src-admin/components/routes/ListRoute.vue +4 -4
- package/src-admin/config/vuetify.js +3 -1
- package/src-admin/models/Model.js +13 -0
- package/src-admin/models/ModelAdminConfig.js +20 -0
- package/src-components/AMdiIcon.vue +18 -0
- package/src/utils/props-helper.js +0 -21
@@ -47,9 +47,8 @@
|
|
47
47
|
</template>
|
48
48
|
|
49
49
|
<script>
|
50
|
-
import { Component, Mixins } from 'vue
|
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
|
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.
|
68
|
-
console.warn('<detail-page> owner must provide a static
|
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.
|
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
|
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.
|
82
|
-
console.warn('<edit-page> owner must provide a static
|
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.
|
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
|
|
@@ -20,8 +20,7 @@
|
|
20
20
|
</template>
|
21
21
|
|
22
22
|
<script>
|
23
|
-
import { Component, Vue } from 'vue
|
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
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
</template>
|
8
8
|
|
9
9
|
<script>
|
10
|
-
import { Component, Vue, Watch } from 'vue
|
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.
|
23
|
-
console.warn('A detail route component must implement a static
|
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.
|
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
|
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.
|
24
|
-
console.warn('An edit route component must implement a static
|
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.
|
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
|
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.
|
35
|
-
console.warn('A list route component must implement a static
|
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.
|
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
|
-
}
|