@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.
- 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 +1 -1
- package/src/components/AContextMenuItem.vue +1 -1
- 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/ARow.vue +1 -1
- package/src/components/ASaveIndicator.vue +1 -1
- package/src/components/ASearchSelect.vue +22 -6
- 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 +1 -1
- package/src/components/form/EditModal.vue +1 -1
- package/src/components/form/FormFieldMixin.js +1 -1
- 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/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 +2 -0
- package/src/components/list/ListFilterMixin.js +1 -1
- package/src/components/list/ListFilterRow.vue +1 -1
- package/src/components/list/ListViewMixin.js +3 -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 +8 -2
- package/src/components/vue/Component.js +46 -0
- package/src/index.js +2 -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-admin/components/App.vue +2 -2
- 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/detail/DetailProperty.vue +1 -1
- package/src-admin/components/list/ListColumnHeader.vue +1 -1
- package/src-admin/components/list/ListTitle.vue +1 -1
- package/src-admin/components/list/ListView.vue +1 -1
- 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 +1 -1
- package/src-admin/components/pages/DetailPage.vue +1 -1
- package/src-admin/components/pages/EditPage.vue +1 -1
- package/src-admin/components/pages/EditPageMixin.js +1 -1
- package/src-admin/components/pages/ListPage.vue +1 -1
- package/src-admin/components/routes/CreateRoute.vue +1 -1
- package/src-admin/components/routes/DetailRoute.vue +1 -1
- package/src-admin/components/routes/EditRoute.vue +1 -1
- package/src-admin/components/routes/ListRoute.vue +1 -1
- package/src/utils/props-helper.js +0 -21
@@ -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
|
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
@@ -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,
|
@@ -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
|
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>
|
@@ -1,41 +1,37 @@
|
|
1
1
|
<template>
|
2
2
|
<v-app class="splash">
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
d-flex
|
8
|
-
align-center
|
9
|
-
justify-center
|
3
|
+
<a-row
|
4
|
+
vertical
|
5
|
+
center
|
6
|
+
class="content"
|
10
7
|
>
|
11
|
-
<div>
|
12
|
-
<
|
13
|
-
|
14
|
-
</div>
|
8
|
+
<div class="logo">
|
9
|
+
<slot />
|
10
|
+
</div>
|
15
11
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
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:
|
48
|
+
position: fixed;
|
54
49
|
top: 0;
|
55
50
|
left: 0;
|
56
51
|
width: 100vw;
|
52
|
+
height: 100vh;
|
57
53
|
}
|
58
54
|
|
59
|
-
.
|
60
|
-
|
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
|
-
.
|
64
|
-
|
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
|
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
|
}
|
@@ -61,7 +61,7 @@
|
|
61
61
|
|
62
62
|
|
63
63
|
<script>
|
64
|
-
import { Component, Watch, Mixins } from 'vue
|
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
|
|
@@ -65,7 +65,7 @@
|
|
65
65
|
</template>
|
66
66
|
|
67
67
|
<script>
|
68
|
-
import { Component, Mixins, Watch } from 'vue
|
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
|
|
@@ -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'
|
@@ -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
|
-
}
|