@afeefa/vue-app 0.0.52 → 0.0.55
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.
- 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 +1 -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 +121 -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 +1 -1
- 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 +14 -0
- package/src/utils/props-helper.js +0 -21
@@ -6,12 +6,12 @@
|
|
6
6
|
</template>
|
7
7
|
|
8
8
|
<script>
|
9
|
-
import { Component, Vue } from 'vue
|
9
|
+
import { Component, Vue } from '@a-vue'
|
10
10
|
|
11
11
|
@Component({
|
12
12
|
props: ['splash']
|
13
13
|
})
|
14
|
-
export default class
|
14
|
+
export default class Start extends Vue {
|
15
15
|
appLoaded () {
|
16
16
|
this.splash.$destroy()
|
17
17
|
}
|
@@ -0,0 +1,223 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<a-table
|
4
|
+
v-if="selectedItems.length"
|
5
|
+
:style="selectedWidthStyle"
|
6
|
+
>
|
7
|
+
<a-table-header
|
8
|
+
v-if="hasHeader"
|
9
|
+
small
|
10
|
+
>
|
11
|
+
<div
|
12
|
+
v-for="(column, index) in selectedColumns"
|
13
|
+
:key="index"
|
14
|
+
>
|
15
|
+
{{ column.header }}
|
16
|
+
</div>
|
17
|
+
</a-table-header>
|
18
|
+
|
19
|
+
<a-table-row
|
20
|
+
v-for="(item, index) in selectedItems"
|
21
|
+
:key="item.id"
|
22
|
+
:selected="isClicked(item)"
|
23
|
+
>
|
24
|
+
<template v-for="(column, index2) in selectedColumns">
|
25
|
+
<v-icon
|
26
|
+
v-if="column.icon"
|
27
|
+
:key="'icon' + index2"
|
28
|
+
:color="column.icon.color"
|
29
|
+
class="selectedIcon"
|
30
|
+
size="1.5rem"
|
31
|
+
v-text="column.icon.icon"
|
32
|
+
/>
|
33
|
+
|
34
|
+
<div
|
35
|
+
v-else
|
36
|
+
:key="'text' + index2"
|
37
|
+
class="selectedContent"
|
38
|
+
>
|
39
|
+
{{ column.text(item) }}
|
40
|
+
</div>
|
41
|
+
</template>
|
42
|
+
|
43
|
+
<div>
|
44
|
+
<a-context-menu
|
45
|
+
:ref="'editItem' + index"
|
46
|
+
@open="clickedItem = item"
|
47
|
+
@close="clickedItem = null"
|
48
|
+
>
|
49
|
+
<a-context-menu-item @click="removeItem(item, index)">
|
50
|
+
<v-icon>$trashCanIcon</v-icon>
|
51
|
+
Löschen
|
52
|
+
</a-context-menu-item>
|
53
|
+
</a-context-menu>
|
54
|
+
</div>
|
55
|
+
</a-table-row>
|
56
|
+
</a-table>
|
57
|
+
|
58
|
+
<div v-else>
|
59
|
+
{{ isEmptyText }}
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<a-search-select
|
63
|
+
:listViewConfig="selectableConfig.listViewConfig"
|
64
|
+
:loadOnlyIfKeyword="false"
|
65
|
+
:selectedItems="selectableSelectedItems"
|
66
|
+
:width="selectableWidth"
|
67
|
+
@select="addItem"
|
68
|
+
>
|
69
|
+
<template #activator>
|
70
|
+
<a-icon-button
|
71
|
+
icon="$plusIcon"
|
72
|
+
:text="selectableConfig.addButtonTitle || 'Hinzufügen'"
|
73
|
+
class="mt-4"
|
74
|
+
/>
|
75
|
+
</template>
|
76
|
+
|
77
|
+
<template #filters>
|
78
|
+
<list-filter-row>
|
79
|
+
<list-filter-search
|
80
|
+
:focus="true"
|
81
|
+
maxWidth="100%"
|
82
|
+
label="Suche Berater:in"
|
83
|
+
/>
|
84
|
+
|
85
|
+
<list-filter-page
|
86
|
+
:has="{page_size: false, page_number: true}"
|
87
|
+
:totalVisible="0"
|
88
|
+
/>
|
89
|
+
</list-filter-row>
|
90
|
+
</template>
|
91
|
+
|
92
|
+
<template #row="{ model, on }">
|
93
|
+
<template
|
94
|
+
v-for="(column, index) in selectableColumns"
|
95
|
+
v-on="on"
|
96
|
+
>
|
97
|
+
<v-icon
|
98
|
+
v-if="column.icon"
|
99
|
+
:key="'icon' + index"
|
100
|
+
:color="column.icon.color"
|
101
|
+
class="selectableIcon"
|
102
|
+
size="1.5rem"
|
103
|
+
v-on="on"
|
104
|
+
v-text="column.icon.icon"
|
105
|
+
/>
|
106
|
+
|
107
|
+
<div
|
108
|
+
v-else
|
109
|
+
:key="'text' + index"
|
110
|
+
class="selectableContent"
|
111
|
+
v-on="on"
|
112
|
+
>
|
113
|
+
{{ column.text(model) }}
|
114
|
+
</div>
|
115
|
+
</template>
|
116
|
+
</template>
|
117
|
+
</a-search-select>
|
118
|
+
</div>
|
119
|
+
</template>
|
120
|
+
|
121
|
+
|
122
|
+
<script>
|
123
|
+
import { Component, Vue } from '@a-vue'
|
124
|
+
|
125
|
+
@Component({
|
126
|
+
props: [
|
127
|
+
'value',
|
128
|
+
'selectedConfig',
|
129
|
+
'selectedWidth',
|
130
|
+
'selectableConfig',
|
131
|
+
'selectableWidth'
|
132
|
+
]
|
133
|
+
})
|
134
|
+
export default class SearchSelectFormField extends Vue {
|
135
|
+
clickedItem = null
|
136
|
+
|
137
|
+
get hasHeader () {
|
138
|
+
return this.selectedColumns.some(c => !!c.header)
|
139
|
+
}
|
140
|
+
|
141
|
+
get selectedItems () {
|
142
|
+
return this.value
|
143
|
+
}
|
144
|
+
|
145
|
+
get selectableSelectedItems () {
|
146
|
+
return this.value.map(this.selectedConfig.selectedToSelectableItem)
|
147
|
+
}
|
148
|
+
|
149
|
+
get isEmptyText () {
|
150
|
+
return this.selectedConfig.isEmptyText
|
151
|
+
}
|
152
|
+
|
153
|
+
isClicked (selectedItem) {
|
154
|
+
return selectedItem === this.clickedItem
|
155
|
+
}
|
156
|
+
|
157
|
+
get selectedColumns () {
|
158
|
+
return this.selectedConfig.columns
|
159
|
+
}
|
160
|
+
|
161
|
+
get selectableColumns () {
|
162
|
+
return this.selectableConfig.columns
|
163
|
+
}
|
164
|
+
|
165
|
+
addItem (selectableItem) {
|
166
|
+
const selectedItem = this.selectedConfig.newSelectedItem(selectableItem)
|
167
|
+
const selectedItems = [...this.value, selectedItem]
|
168
|
+
if (this.$listeners.add) {
|
169
|
+
this.$emit('add', selectedItems)
|
170
|
+
} else {
|
171
|
+
this.$emit('input', selectedItems)
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
async removeItem (selectedItem, rowIndex) {
|
176
|
+
const removeDialog = this.selectedConfig.removeDialog(selectedItem)
|
177
|
+
const dialog = {
|
178
|
+
anchor: this.$refs['editItem' + rowIndex], // is array [component]
|
179
|
+
...removeDialog,
|
180
|
+
yesButton: 'Löschen',
|
181
|
+
yesColor: 'red white--text'
|
182
|
+
}
|
183
|
+
|
184
|
+
const selectedItems = this.value.filter(i => i !== selectedItem)
|
185
|
+
if (this.$listeners.remove) {
|
186
|
+
this.$emit('remove', selectedItems, dialog)
|
187
|
+
} else {
|
188
|
+
this.$emit('input', selectedItems)
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
get selectedWidthStyle () {
|
193
|
+
if (!this.selectedWidth) {
|
194
|
+
return ''
|
195
|
+
}
|
196
|
+
|
197
|
+
let width = this.selectedWidth
|
198
|
+
if (!isNaN(width)) {
|
199
|
+
width = width + 'px'
|
200
|
+
}
|
201
|
+
return `width: ${width};`
|
202
|
+
}
|
203
|
+
}
|
204
|
+
</script>
|
205
|
+
|
206
|
+
|
207
|
+
<style scoped lang="scss">
|
208
|
+
.selectedIcon::v-deep {
|
209
|
+
padding-right: .3rem !important;
|
210
|
+
}
|
211
|
+
|
212
|
+
.selectableIcon::v-deep {
|
213
|
+
padding-right: 2rem !important;
|
214
|
+
}
|
215
|
+
|
216
|
+
.selectedContent::v-deep {
|
217
|
+
width: 100%;
|
218
|
+
}
|
219
|
+
|
220
|
+
.selectableContent::v-deep {
|
221
|
+
width: 100%;
|
222
|
+
}
|
223
|
+
</style>
|
@@ -24,8 +24,7 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
<script>
|
27
|
-
import { Component, Vue } from 'vue
|
28
|
-
import { apiResources } from '@afeefa/api-resources-client'
|
27
|
+
import { Component, Vue } from '@a-vue'
|
29
28
|
|
30
29
|
@Component({
|
31
30
|
props: ['icon', 'iconModelType', 'label']
|
@@ -37,7 +36,7 @@ export default class DetailProperty extends Vue {
|
|
37
36
|
}
|
38
37
|
|
39
38
|
if (this.iconModelType) {
|
40
|
-
const ModelClass = apiResources.getModelClass(this.iconModelType)
|
39
|
+
const ModelClass = this.$apiResources.getModelClass(this.iconModelType)
|
41
40
|
return ModelClass.icon
|
42
41
|
}
|
43
42
|
}
|
@@ -77,6 +76,5 @@ export default class DetailProperty extends Vue {
|
|
77
76
|
padding-left: 55px;
|
78
77
|
}
|
79
78
|
}
|
80
|
-
|
81
79
|
}
|
82
80
|
</style>
|
@@ -4,9 +4,10 @@
|
|
4
4
|
:class="['content', {order}]"
|
5
5
|
@click="toggleSort"
|
6
6
|
>
|
7
|
-
<div
|
8
|
-
|
9
|
-
|
7
|
+
<div
|
8
|
+
:class="['text', {active}]"
|
9
|
+
v-html="text"
|
10
|
+
/>
|
10
11
|
|
11
12
|
<svg
|
12
13
|
v-if="order"
|
@@ -21,7 +22,7 @@
|
|
21
22
|
|
22
23
|
|
23
24
|
<script>
|
24
|
-
import { Component, Vue } from 'vue
|
25
|
+
import { Component, Vue } from '@a-vue'
|
25
26
|
|
26
27
|
@Component({
|
27
28
|
props: ['text', 'order']
|
@@ -9,7 +9,15 @@
|
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<template v-if="models_.length">
|
12
|
-
<template v-if="
|
12
|
+
<template v-if="$scopedSlots.models">
|
13
|
+
<slot
|
14
|
+
name="models"
|
15
|
+
:models="models_"
|
16
|
+
:setFilter="setFilter"
|
17
|
+
/>
|
18
|
+
</template>
|
19
|
+
|
20
|
+
<template v-else-if="$scopedSlots['model-table']">
|
13
21
|
<a-table>
|
14
22
|
<a-table-header>
|
15
23
|
<div v-if="$has.icon" />
|
@@ -37,7 +45,7 @@
|
|
37
45
|
</a-table>
|
38
46
|
</template>
|
39
47
|
|
40
|
-
<template v-else>
|
48
|
+
<template v-else-if="$scopedSlots.model">
|
41
49
|
<div
|
42
50
|
v-for="model in models_"
|
43
51
|
:key="model.id"
|
@@ -61,13 +69,11 @@
|
|
61
69
|
|
62
70
|
|
63
71
|
<script>
|
64
|
-
import { Component, Watch, Mixins } from 'vue
|
72
|
+
import { Component, Watch, Mixins } from '@a-vue'
|
65
73
|
import { ListViewMixin } from '@a-vue/components/list/ListViewMixin'
|
66
74
|
import { LoadingEvent } from '@a-vue/events'
|
67
75
|
|
68
|
-
@Component
|
69
|
-
props: ['table']
|
70
|
-
})
|
76
|
+
@Component
|
71
77
|
export default class ListView extends Mixins(ListViewMixin) {
|
72
78
|
$hasOptions = ['icon']
|
73
79
|
|
@@ -83,10 +89,6 @@ export default class ListView extends Mixins(ListViewMixin) {
|
|
83
89
|
this.$emit('update:isLoading', this.isLoading)
|
84
90
|
}
|
85
91
|
|
86
|
-
get _table () {
|
87
|
-
return this.table !== false
|
88
|
-
}
|
89
|
-
|
90
92
|
setFilter (name, value) {
|
91
93
|
this.filters[name].value = value
|
92
94
|
}
|
@@ -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'
|