@afeefa/vue-app 0.0.180 → 0.0.182

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.180
1
+ 0.0.182
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.180",
3
+ "version": "0.0.182",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -41,7 +41,8 @@ export default class InformationBar extends Vue {
41
41
  visible = false
42
42
  mobile = false
43
43
  rail = false
44
- width = 300
44
+ defaultWidth = 300
45
+ width = this.defaultWidth
45
46
 
46
47
  created () {
47
48
  this.$events.on(SidebarEvent.STATUS, ({payload: {information, informationRailed, mobile}}) => {
@@ -88,20 +89,30 @@ export default class InformationBar extends Vue {
88
89
 
89
90
  @Watch('rail')
90
91
  railChanged () {
91
- const right = `calc(-${this.width}px - 3rem + 60px)`
92
- this.$el.style.marginRight = this.rail ? right : 0
92
+ this.setRailMargin()
93
93
  }
94
94
 
95
95
  toggleRail () {
96
96
  sidebarService.setRailInformation(!this.rail)
97
97
  }
98
98
 
99
+ setRailMargin () {
100
+ if (this.rail) {
101
+ const right = `calc(-${this.width}px - 3rem + 60px)`
102
+ this.$el.style.marginRight = right
103
+ } else {
104
+ this.$el.style.marginRight = 0
105
+ }
106
+ }
107
+
99
108
  domChanged () {
100
109
  const old = this.visible
101
110
  const visible = this.hasSidebarItems()
102
111
 
103
112
  if (visible && !old) {
104
- this.width = this.getWidthFromItems()
113
+ this.width = this.getWidthFromItems() || this.defaultWidth
114
+ this.setRailMargin()
115
+
105
116
  sidebarService.setInformation(true)
106
117
  }
107
118
 
@@ -135,14 +146,14 @@ export default class InformationBar extends Vue {
135
146
  let width = 0
136
147
 
137
148
  Array.from(this.getTopContainer().children).forEach(c => {
138
- if (c.style.width !== 'auto') {
149
+ if (c.style.width !== '100%') {
139
150
  const w = parseInt(c.style.width)
140
151
  width = Math.max(width, w)
141
152
  }
142
153
  })
143
154
 
144
155
  Array.from(this.getBottomContainer().children).forEach(c => {
145
- if (c.style.width !== 'auto') {
156
+ if (c.style.width !== '100%') {
146
157
  const w = parseInt(c.style.width)
147
158
  width = Math.max(width, w)
148
159
  }
@@ -4,15 +4,13 @@
4
4
  :class="['item', infoItemId, {expanded, rail}]"
5
5
  :style="{width}"
6
6
  >
7
- <a-row justify-space-between>
8
- <div
9
- class="header"
10
- @click="derail"
11
- >
7
+ <div class="headerContainer">
8
+ <div class="header">
12
9
  <v-icon
13
10
  v-if="icon"
14
11
  :color="icon.color"
15
12
  size="2rem"
13
+ @click="derail"
16
14
  >
17
15
  {{ icon.icon }}
18
16
  </v-icon>
@@ -23,18 +21,28 @@
23
21
  />
24
22
 
25
23
  <template v-if="!rail">
26
- <label class="label">{{ label }}</label>
27
-
28
- <v-icon class="contextButton mt-n1">
24
+ <div
25
+ class="labelContainer"
26
+ @click="derail"
27
+ >
28
+ <div class="label">
29
+ {{ label }}
30
+ </div>
31
+ </div>
32
+
33
+ <v-icon
34
+ class="contextButton expand mt-n1"
35
+ @click="derail"
36
+ >
29
37
  {{ expanded ? '$caretDownIcon' : '$caretRightIcon' }}
30
38
  </v-icon>
31
- </template>
32
- </div>
33
39
 
34
- <div v-if="expanded">
35
- <slot name="actionButton" />
40
+ <div v-if="expanded">
41
+ <slot name="actionButton" />
42
+ </div>
43
+ </template>
36
44
  </div>
37
- </a-row>
45
+ </div>
38
46
 
39
47
  <collapse-transition>
40
48
  <div
@@ -66,7 +74,7 @@ import { SidebarEvent } from '@a-admin/events'
66
74
  {
67
75
  top: true,
68
76
  bottom: false,
69
- width: 'auto',
77
+ width: '100%',
70
78
  open: false
71
79
  }
72
80
  ]
@@ -157,15 +165,26 @@ export default class InformationBarItem extends Vue {
157
165
  }
158
166
  }
159
167
 
168
+ .headerContainer {
169
+ width: 100%;
170
+ line-height: 0; // kill inline-flex space
171
+ }
172
+
160
173
  .header {
161
- display: flex;
162
- flex-wrap: nowrap;
174
+ display: inline-flex;
163
175
  align-items: center;
164
176
  font-size: .8rem;
165
- cursor: pointer;
177
+ line-height: 1.5; // end kill inline-flex space
178
+ max-width: 100%;
166
179
 
167
180
  > .v-icon {
168
181
  margin-right: .75rem;
182
+ cursor: pointer;
183
+ }
184
+
185
+ .labelContainer {
186
+ overflow: hidden;
187
+ cursor: pointer;
169
188
  }
170
189
 
171
190
  .label {
@@ -173,15 +192,16 @@ export default class InformationBarItem extends Vue {
173
192
  text-transform: uppercase;
174
193
  letter-spacing: 3px;
175
194
  color: #666666;
176
- cursor: pointer;
195
+ overflow: hidden;
196
+ text-overflow: ellipsis;
177
197
  }
178
198
 
179
199
  &:hover {
180
- label {
200
+ .label {
181
201
  color: #333333;
182
202
  }
183
203
 
184
- .v-icon.contextButton {
204
+ .v-icon.expand {
185
205
  color: #333333 !important;
186
206
  }
187
207
  }