@afeefa/vue-app 0.0.174 → 0.0.175

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.174
1
+ 0.0.175
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.174",
3
+ "version": "0.0.175",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -24,6 +24,10 @@ export default class AInfo extends Vue {
24
24
  </script>
25
25
 
26
26
  <style lang="scss" scoped>
27
+ :deep(.v-icon) {
28
+ margin-right: .4rem;
29
+ }
30
+
27
31
  .xSmall {
28
32
  padding: .3rem .6rem;
29
33
  font-size: .9rem;
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <information-bar-item
3
+ v-if="sidebar"
4
+ v-bind="$attrs"
5
+ >
6
+ <template #actionButton>
7
+ <slot name="actionButton" />
8
+ </template>
9
+
10
+ <slot />
11
+ </information-bar-item>
12
+
13
+ <detail-property
14
+ v-else
15
+ v-bind="$attrs"
16
+ >
17
+ <template #actionButton>
18
+ <slot name="actionButton" />
19
+ </template>
20
+
21
+ <slot />
22
+ </detail-property>
23
+ </template>
24
+
25
+ <script>
26
+ import { Component, Vue } from '@a-vue'
27
+
28
+ @Component({
29
+ props: [{sidebar: false}]
30
+ })
31
+ export default class DetailOrInfo extends Vue {
32
+ }
33
+ </script>
@@ -46,6 +46,25 @@ export default class FlyingContextContainer extends Vue {
46
46
  sizeWatcher.observe(this.getChildrenContainer())
47
47
  }
48
48
 
49
+ /**
50
+ * park sidebar children and attach - only for use with HMR which would remove all children on destroy 234567890
51
+ */
52
+ destroyed () {
53
+ function moveChildren (from, to) {
54
+ for (const child of from.children) {
55
+ to.appendChild(child)
56
+ }
57
+ }
58
+
59
+ const elTmp = document.createElement('div')
60
+ document.body.appendChild(elTmp)
61
+ moveChildren(this.getChildrenContainer(), elTmp)
62
+
63
+ this.$nextTick(() => {
64
+ moveChildren(elTmp, document.querySelector('#flyingContextContainer__children'))
65
+ })
66
+ }
67
+
49
68
  getScrollbarWidth () {
50
69
  const el = document.documentElement
51
70
  const overflowY = getComputedStyle(el)['overflow-y']
@@ -157,7 +176,8 @@ export default class FlyingContextContainer extends Vue {
157
176
  transition: left .2s;
158
177
  padding: 2rem;
159
178
  overflow-y: auto;
160
- box-shadow: 0 0 7px #00000033;
179
+ box-shadow: 0 0 17px #00000033;
180
+ border-left: 1px solid #DDDDDD;
161
181
 
162
182
  &:not(.visible) {
163
183
  left: 101vw;
@@ -53,13 +53,12 @@ export default class InformationBar extends Vue {
53
53
  this.mutationWatcher = new MutationObserver(this.domChanged)
54
54
  this.mutationWatcher.observe(this.$el.querySelector('#information-bar__children > .top'), { childList: true })
55
55
  this.mutationWatcher.observe(this.$el.querySelector('#information-bar__children > .bottom'), { childList: true })
56
+
56
57
  this.domChanged()
57
58
  }
58
59
 
59
60
  /**
60
61
  * park sidebar children and attach - only for use with HMR which would remove all children on destroy 234567890
61
- *
62
- * s
63
62
  */
64
63
  destroyed () {
65
64
  function moveChildren (from, to) {
@@ -130,6 +129,7 @@ export default class InformationBar extends Vue {
130
129
  flex: 0 0 300px;
131
130
  width: 300px;
132
131
  height: 100vh;
132
+ overflow-x: hidden;
133
133
  overflow-y: auto;
134
134
 
135
135
  border-left: 1px solid rgba(0, 0, 0, .12);
@@ -94,6 +94,7 @@ export default class StickyHeader extends Vue {
94
94
  background: white;
95
95
  z-index: 2;
96
96
  box-shadow: 0 0 7px #00000033;
97
+ border-bottom: 1px solid #EEEEEE;
97
98
  }
98
99
 
99
100
  .topbar {
@@ -63,7 +63,6 @@ export default class DetailProperty extends Vue {
63
63
  flex-wrap: nowrap;
64
64
  align-items: center;
65
65
  height: 40px;
66
- margin-bottom: .5rem;
67
66
 
68
67
  > .v-icon {
69
68
  flex: 0 0 3rem;
@@ -84,6 +83,7 @@ export default class DetailProperty extends Vue {
84
83
  }
85
84
 
86
85
  .content {
86
+ margin-top: .5rem;
87
87
  padding-left: 4.5rem;
88
88
  }
89
89
  }
@@ -2,17 +2,18 @@ import Vue from 'vue'
2
2
 
3
3
  import AppBarButton from './app/AppBarButton'
4
4
  import AppBarTitle from './app/AppBarTitle'
5
- import CollapsibleSection from './CollapsibleSection.vue'
5
+ import CollapsibleSection from './CollapsibleSection'
6
6
  import DetailColumn from './detail/DetailColumn'
7
7
  import DetailContent from './detail/DetailContent'
8
8
  import DetailMeta from './detail/DetailMeta'
9
9
  import DetailProperty from './detail/DetailProperty'
10
10
  import DetailTitle from './detail/DetailTitle'
11
- import FlyingContext from './FlyingContext.vue'
11
+ import DetailOrInfo from './DetailOrInfo'
12
+ import FlyingContext from './FlyingContext'
12
13
  import EditFormButtons from './form/EditFormButtons'
13
14
  import RemoveButton from './form/RemoveButton'
14
15
  import RemoveDialog from './form/RemoveDialog'
15
- import HSeparator from './HSeparator.vue'
16
+ import HSeparator from './HSeparator'
16
17
  import ListCard from './list/ListCard'
17
18
  import ListColumnHeader from './list/ListColumnHeader'
18
19
  import ListContent from './list/ListContent'
@@ -22,10 +23,10 @@ import ListView from './list/ListView'
22
23
  import ModelCount from './model/ModelCount'
23
24
  import ModelIcon from './model/ModelIcon'
24
25
  import EditPage from './pages/EditPage'
25
- import InformationBarItem from './sidebar/InformationBarItem.vue'
26
- import Start from './Start.vue'
27
- import StickyFooter from './StickyFooter.vue'
28
- import CollapseTransition from './transitions/CollapseTransition.vue'
26
+ import InformationBarItem from './sidebar/InformationBarItem'
27
+ import Start from './Start'
28
+ import StickyFooter from './StickyFooter'
29
+ import CollapseTransition from './transitions/CollapseTransition'
29
30
 
30
31
  Vue.component('ListCard', ListCard)
31
32
  Vue.component('ListColumnHeader', ListColumnHeader)
@@ -59,3 +60,4 @@ Vue.component('Start', Start)
59
60
  Vue.component('FlyingContext', FlyingContext)
60
61
  Vue.component('StickyFooter', StickyFooter)
61
62
  Vue.component('InformationBarItem', InformationBarItem)
63
+ Vue.component('DetailOrInfo', DetailOrInfo)
@@ -73,7 +73,7 @@
73
73
 
74
74
  <div v-else-if="!isLoading">
75
75
  <a-info type="warning">
76
- <div v-if="$has.filters">
76
+ <div v-if="$has.filters && meta_.count_all">
77
77
  Nichts gefunden. <a
78
78
  href=""
79
79
  @click.prevent="resetFilters()"
@@ -4,25 +4,37 @@
4
4
  :class="['item', infoItemId, {expanded, rail}]"
5
5
  :style="{width}"
6
6
  >
7
- <div
8
- class="header"
9
- @click="derail"
10
- >
11
- <v-icon
12
- :color="icon.color"
13
- size="2rem"
7
+ <a-row justify-space-between>
8
+ <div
9
+ class="header"
10
+ @click="derail"
14
11
  >
15
- {{ icon.icon }}
16
- </v-icon>
12
+ <v-icon
13
+ v-if="_icon"
14
+ :color="_icon.color"
15
+ size="2rem"
16
+ >
17
+ {{ _icon.icon }}
18
+ </v-icon>
17
19
 
18
- <template v-if="!rail">
19
- <label class="label">{{ label }}</label>
20
+ <div
21
+ v-else
22
+ class="iconPlaceholder"
23
+ />
20
24
 
21
- <v-icon class="contextButton mt-n1">
22
- {{ expanded ? '$caretDownIcon' : '$caretRightIcon' }}
23
- </v-icon>
24
- </template>
25
- </div>
25
+ <template v-if="!rail">
26
+ <label class="label">{{ label }}</label>
27
+
28
+ <v-icon class="contextButton mt-n1">
29
+ {{ expanded ? '$caretDownIcon' : '$caretRightIcon' }}
30
+ </v-icon>
31
+ </template>
32
+ </div>
33
+
34
+ <div v-if="expanded">
35
+ <slot name="actionButton" />
36
+ </div>
37
+ </a-row>
26
38
 
27
39
  <collapse-transition>
28
40
  <div
@@ -50,6 +62,7 @@ import { SidebarEvent } from '@a-admin/events'
50
62
  @Component({
51
63
  props: [
52
64
  'icon',
65
+ 'iconModelType',
53
66
  'label',
54
67
  {
55
68
  top: true,
@@ -63,9 +76,10 @@ export default class InformationBarItem extends Vue {
63
76
  infoItemId = randomCssClass(10)
64
77
  rail = sidebarService.informationRailed
65
78
  expanded = !this.rail && this.open
79
+ isCreated = false
66
80
 
67
81
  created () {
68
- this.$events.on(SidebarEvent.STATUS, ({payload: {informationRailed}}) => this.railChanged(informationRailed))
82
+ this.$events.on(SidebarEvent.STATUS, this.railChanged)
69
83
  }
70
84
 
71
85
  mounted () {
@@ -79,18 +93,35 @@ export default class InformationBarItem extends Vue {
79
93
  if (container.contains(el)) {
80
94
  container.removeChild(el)
81
95
  }
96
+
97
+ this.$events.off(SidebarEvent.STATUS, this.railChanged)
82
98
  }
83
99
 
84
- railChanged (rail) {
85
- if (this.rail === rail) {
100
+ get _icon () {
101
+ if (this.icon) {
102
+ return this.icon
103
+ }
104
+
105
+ if (this.iconModelType) {
106
+ const ModelClass = this.$apiResources.getModelClass(this.iconModelType)
107
+ return ModelClass.icon
108
+ }
109
+ }
110
+
111
+ railChanged ({payload: {informationRailed}}) {
112
+ if (this.rail === informationRailed) {
86
113
  return
87
114
  }
88
115
 
89
- this.rail = rail
116
+ this.rail = informationRailed
90
117
 
91
- if (!this.rail) {
92
- this.expanded = false
118
+ if (!this.rail) { // derailed
119
+ if (!this.isCreated) { // open only the first time not after subsequent derailing
120
+ this.expanded = this.open
121
+ }
93
122
  }
123
+
124
+ this.isCreated = true
94
125
  }
95
126
 
96
127
  derail () {
@@ -172,7 +203,7 @@ export default class InformationBarItem extends Vue {
172
203
  border-top: 2px solid #EEEEEE;
173
204
  font-size: .9rem;
174
205
 
175
- margin: .5rem -1.5rem;
176
- padding: .5rem 1.5rem;
206
+ margin: .25rem -1.5rem;
207
+ padding: 1rem 1.5rem;
177
208
  }
178
209
  </style>
@@ -65,8 +65,8 @@ class SidebarService {
65
65
 
66
66
  this.information = information
67
67
 
68
- if (information && this.mobile) {
69
- this.informationRailed = true
68
+ if (information) { // rail if mobile, derail if desktop
69
+ this.informationRailed = this.mobile
70
70
  }
71
71
 
72
72
  eventBus.dispatch(new SidebarEvent(SidebarEvent.STATUS, new SidebarState(this)))