@afeefa/vue-app 0.0.179 → 0.0.181
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.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.181
|
package/package.json
CHANGED
package/src/components/AInfo.vue
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<v-alert
|
3
3
|
v-bind="$attrs"
|
4
|
+
:type="type"
|
4
5
|
:style="{display: inline ? 'inline-block' : 'block'}"
|
5
6
|
:class="['a-info', {xSmall}]"
|
6
7
|
dense
|
@@ -17,7 +18,7 @@
|
|
17
18
|
import { Component, Vue } from '@a-vue'
|
18
19
|
|
19
20
|
@Component({
|
20
|
-
props: [{inline: true, xSmall: false}]
|
21
|
+
props: [{inline: true, xSmall: false, type: 'info'}]
|
21
22
|
})
|
22
23
|
export default class AInfo extends Vue {
|
23
24
|
}
|
package/src/components/ATabs.vue
CHANGED
@@ -30,8 +30,6 @@ export default class ATabs extends Vue {
|
|
30
30
|
currentIndex = 0
|
31
31
|
|
32
32
|
mounted () {
|
33
|
-
console.log(this.$children)
|
34
|
-
|
35
33
|
this.titles = this.$children.map(c => c.title)
|
36
34
|
|
37
35
|
this.$children[this.currentIndex].show()
|
@@ -52,7 +50,7 @@ export default class ATabs extends Vue {
|
|
52
50
|
|
53
51
|
<style lang="scss" scoped>
|
54
52
|
.menuContainer {
|
55
|
-
border-bottom:
|
53
|
+
border-bottom: 3px solid #DDDDDD;
|
56
54
|
margin: 2rem 0;
|
57
55
|
|
58
56
|
&.first {
|
@@ -64,29 +62,26 @@ export default class ATabs extends Vue {
|
|
64
62
|
position: relative;
|
65
63
|
display: flex;
|
66
64
|
justify-content: center;
|
67
|
-
margin-bottom: -2px;
|
68
65
|
|
69
66
|
.label {
|
70
|
-
padding: .
|
71
|
-
border-bottom: 2px solid #EEEEEE;
|
72
|
-
// border-top-left-radius: 6px;
|
73
|
-
// border-top-right-radius: 6px;
|
67
|
+
padding: .5rem 1rem .7rem;
|
74
68
|
background: white;
|
75
69
|
cursor: pointer;
|
76
70
|
|
77
71
|
text-transform: uppercase;
|
78
72
|
letter-spacing: 5px;
|
79
|
-
color: #
|
73
|
+
color: #BBBBBB;
|
80
74
|
font-size: .8rem;
|
81
75
|
white-space: nowrap;
|
82
76
|
|
83
|
-
|
84
|
-
|
77
|
+
&:hover {
|
78
|
+
background: #F4F4F4;
|
79
|
+
color: #AAAAAA;
|
80
|
+
}
|
85
81
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
border-bottom: none;
|
82
|
+
&.selected {
|
83
|
+
background: #DDDDDD;
|
84
|
+
color: #666666;
|
90
85
|
}
|
91
86
|
}
|
92
87
|
}
|
@@ -3,6 +3,7 @@
|
|
3
3
|
v-show="visible"
|
4
4
|
id="information-bar"
|
5
5
|
:class="{mobile, rail}"
|
6
|
+
:style="widthStyle"
|
6
7
|
>
|
7
8
|
<div :class="['toggleButton', {rail}]">
|
8
9
|
<v-app-bar-nav-icon
|
@@ -40,6 +41,8 @@ export default class InformationBar extends Vue {
|
|
40
41
|
visible = false
|
41
42
|
mobile = false
|
42
43
|
rail = false
|
44
|
+
defaultWidth = 300
|
45
|
+
width = this.defaultWidth
|
43
46
|
|
44
47
|
created () {
|
45
48
|
this.$events.on(SidebarEvent.STATUS, ({payload: {information, informationRailed, mobile}}) => {
|
@@ -69,15 +72,15 @@ export default class InformationBar extends Vue {
|
|
69
72
|
|
70
73
|
const elTop = document.createElement('div')
|
71
74
|
document.body.appendChild(elTop)
|
72
|
-
moveChildren(this
|
75
|
+
moveChildren(this.getTopContainer(), elTop)
|
73
76
|
|
74
77
|
const elBottom = document.createElement('div')
|
75
78
|
document.body.appendChild(elBottom)
|
76
|
-
moveChildren(this
|
79
|
+
moveChildren(this.getBottomContainer(), elBottom)
|
77
80
|
|
78
81
|
this.$nextTick(() => {
|
79
|
-
moveChildren(elTop,
|
80
|
-
moveChildren(elBottom,
|
82
|
+
moveChildren(elTop, this.getTopContainer())
|
83
|
+
moveChildren(elBottom, this.getBottomContainer())
|
81
84
|
this.$nextTick(() => {
|
82
85
|
this.$events.dispatch(new SidebarEvent(SidebarEvent.STATUS, new SidebarState(sidebarService)))
|
83
86
|
})
|
@@ -86,18 +89,30 @@ export default class InformationBar extends Vue {
|
|
86
89
|
|
87
90
|
@Watch('rail')
|
88
91
|
railChanged () {
|
89
|
-
this
|
92
|
+
this.setRailMargin()
|
90
93
|
}
|
91
94
|
|
92
95
|
toggleRail () {
|
93
96
|
sidebarService.setRailInformation(!this.rail)
|
94
97
|
}
|
95
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
|
+
|
96
108
|
domChanged () {
|
97
109
|
const old = this.visible
|
98
110
|
const visible = this.hasSidebarItems()
|
99
111
|
|
100
112
|
if (visible && !old) {
|
113
|
+
this.width = this.getWidthFromItems() || this.defaultWidth
|
114
|
+
this.setRailMargin()
|
115
|
+
|
101
116
|
sidebarService.setInformation(true)
|
102
117
|
}
|
103
118
|
|
@@ -110,6 +125,14 @@ export default class InformationBar extends Vue {
|
|
110
125
|
return this.$el.querySelector('#information-bar__children')
|
111
126
|
}
|
112
127
|
|
128
|
+
getTopContainer () {
|
129
|
+
return document.querySelector('#information-bar__children .top')
|
130
|
+
}
|
131
|
+
|
132
|
+
getBottomContainer () {
|
133
|
+
return document.querySelector('#information-bar__children .bottom')
|
134
|
+
}
|
135
|
+
|
113
136
|
hasSidebarItems () {
|
114
137
|
return !!(this.$el.querySelector('#information-bar__children .top').children.length +
|
115
138
|
this.$el.querySelector('#information-bar__children .bottom').children.length)
|
@@ -118,6 +141,33 @@ export default class InformationBar extends Vue {
|
|
118
141
|
hideSidebar () {
|
119
142
|
sidebarService.setInformation(false)
|
120
143
|
}
|
144
|
+
|
145
|
+
getWidthFromItems () {
|
146
|
+
let width = 0
|
147
|
+
|
148
|
+
Array.from(this.getTopContainer().children).forEach(c => {
|
149
|
+
if (c.style.width !== 'auto') {
|
150
|
+
const w = parseInt(c.style.width)
|
151
|
+
width = Math.max(width, w)
|
152
|
+
}
|
153
|
+
})
|
154
|
+
|
155
|
+
Array.from(this.getBottomContainer().children).forEach(c => {
|
156
|
+
if (c.style.width !== 'auto') {
|
157
|
+
const w = parseInt(c.style.width)
|
158
|
+
width = Math.max(width, w)
|
159
|
+
}
|
160
|
+
})
|
161
|
+
|
162
|
+
return width
|
163
|
+
}
|
164
|
+
|
165
|
+
get widthStyle () {
|
166
|
+
return {
|
167
|
+
flex: `0 0 calc(${this.width}px + 3rem)`,
|
168
|
+
width: `calc(${this.width}px + 3rem)`
|
169
|
+
}
|
170
|
+
}
|
121
171
|
}
|
122
172
|
</script>
|
123
173
|
|
@@ -126,8 +176,6 @@ export default class InformationBar extends Vue {
|
|
126
176
|
#information-bar {
|
127
177
|
position: relative;
|
128
178
|
|
129
|
-
flex: 0 0 300px;
|
130
|
-
width: 300px;
|
131
179
|
height: 100vh;
|
132
180
|
overflow-x: hidden;
|
133
181
|
overflow-y: auto;
|