@everchron/ec-shards 0.6.30 → 0.6.34
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/dist/ec-shards.common.js +107 -58
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +107 -58
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +2 -2
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/overlay/overlay.vue +134 -14
- package/src/components/sidebar-header/sidebar-header.vue +22 -5
- package/src/stories/overlay/overlay.stories.js +39 -0
- package/src/stories/sidebar-header/sidebar-header.stories.js +9 -4
- package/src/stories/sidebar-header/sidebar-header.stories.mdx +5 -5
package/package.json
CHANGED
|
@@ -12,20 +12,34 @@
|
|
|
12
12
|
<div v-if="$slots.headercontrols" class="ecs-overlay-header-controls">
|
|
13
13
|
<slot name="headercontrols"></slot>
|
|
14
14
|
</div>
|
|
15
|
+
<ecs-button-toolbar v-if="$slots.sidebar && width <= 1400" @click="sidebarToggle" :icon="sidebarIcon" :title="showSidebar ? 'Hide ' + sidebarTitle : 'Show ' + sidebarTitle" :active="showSidebar" class="sidebar-button" />
|
|
15
16
|
<ecs-button-toolbar @click="$emit('close')" icon="close">{{ closeText }}</ecs-button-toolbar>
|
|
16
17
|
</div>
|
|
17
|
-
<div class="ecs-overlay-content scrollbar">
|
|
18
|
+
<div ref="content" class="ecs-overlay-content scrollbar">
|
|
18
19
|
<div v-if="$slots.tabs" class="ecs-overlay-tabs scrollbar scrollbar-sml">
|
|
19
20
|
<slot name="tabs"></slot>
|
|
20
21
|
</div>
|
|
21
|
-
<div class="ecs-overlay-content-inner"
|
|
22
|
-
<
|
|
22
|
+
<div class="ecs-overlay-content-inner">
|
|
23
|
+
<div class="ecs-overlay-content-inner-inner" :class="$slots.sidebar && !fullWidth && width > 1400 ? 'has-sidebar' : ' '" :style="{ width: contentWidth, maxWidth: contentMaxWidth, minWidth: contentMinWidth }">
|
|
24
|
+
<slot></slot>
|
|
25
|
+
</div>
|
|
26
|
+
<div v-if="$slots.sidebar && width > 1400" class="ecs-overlay-sidebar ecs-overlay-sidebar-static">
|
|
27
|
+
<slot name="sidebar"></slot>
|
|
28
|
+
</div>
|
|
29
|
+
<transition name="slide">
|
|
30
|
+
<div v-if="$slots.sidebar && width <= 1400 && showSidebar" class="ecs-overlay-sidebar ecs-overlay-sidebar-float scrollbar scrollbar-sml">
|
|
31
|
+
<slot name="sidebar"></slot>
|
|
32
|
+
</div>
|
|
33
|
+
</transition>
|
|
23
34
|
</div>
|
|
24
35
|
</div>
|
|
25
36
|
<div v-if="$slots.footer" class="ecs-overlay-footer">
|
|
26
|
-
<div v-if="$slots.tabs
|
|
27
|
-
<div class="ecs-overlay-footer-content"
|
|
28
|
-
<
|
|
37
|
+
<div v-if="$slots.tabs" class="spacer-tabs" />
|
|
38
|
+
<div class="ecs-overlay-footer-content">
|
|
39
|
+
<div class="ecs-overlay-footer-content-inner" :style="{ width: contentWidth, maxWidth: contentMaxWidth, minWidth: contentMinWidth }">
|
|
40
|
+
<slot name="footer"></slot>
|
|
41
|
+
</div>
|
|
42
|
+
<div v-if="$slots.sidebar && width > 1400" class="spacer-sidebar" />
|
|
29
43
|
</div>
|
|
30
44
|
</div>
|
|
31
45
|
</div>
|
|
@@ -68,19 +82,30 @@
|
|
|
68
82
|
offsetTop: {
|
|
69
83
|
type: Number,
|
|
70
84
|
default: 41
|
|
71
|
-
}
|
|
85
|
+
},
|
|
86
|
+
//Props for additional slide-in sidbar
|
|
87
|
+
sidebarIcon: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: 'bell'
|
|
90
|
+
},
|
|
91
|
+
sidebarTitle: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: 'Notifications'
|
|
94
|
+
},
|
|
72
95
|
},
|
|
73
96
|
|
|
74
97
|
data () {
|
|
75
98
|
return {
|
|
76
|
-
isShown: this.show
|
|
99
|
+
isShown: this.show,
|
|
100
|
+
showSidebar: false,
|
|
101
|
+
width: window.innerWidth,
|
|
77
102
|
}
|
|
78
103
|
},
|
|
79
104
|
|
|
80
105
|
computed:{
|
|
81
106
|
contentWidth(){
|
|
82
107
|
if(this.fullWidth && this.$slots.tabs){
|
|
83
|
-
return 'calc(
|
|
108
|
+
return 'calc(100vw - 260px)'
|
|
84
109
|
} else{
|
|
85
110
|
return '100%'
|
|
86
111
|
}
|
|
@@ -95,19 +120,44 @@
|
|
|
95
120
|
},
|
|
96
121
|
|
|
97
122
|
contentMinWidth(){
|
|
98
|
-
if(this.
|
|
99
|
-
return 'calc(
|
|
123
|
+
if(this.$slots.tabs && this.$slots.sidebar){
|
|
124
|
+
return 'calc(100vw - 260px - 400px)'
|
|
125
|
+
} else if(this.fullWidth && this.$slots.tabs){
|
|
126
|
+
return 'calc(100vw - 260px)'
|
|
100
127
|
} else {
|
|
101
128
|
return '780px'
|
|
102
129
|
}
|
|
103
130
|
}
|
|
104
131
|
},
|
|
105
132
|
|
|
106
|
-
|
|
133
|
+
mounted(){
|
|
134
|
+
this.$nextTick(() => {
|
|
135
|
+
window.addEventListener('resize', this.windowWidth)
|
|
136
|
+
})
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
beforeDestroy() {
|
|
140
|
+
window.removeEventListener('resize', this.windowWidth)
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
methods :{
|
|
107
144
|
toggleShow(){
|
|
108
145
|
this.isShown = !this.isShown
|
|
109
146
|
this.$emit('toggled', this.id, this.isShown)
|
|
110
|
-
}
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
windowWidth() {
|
|
150
|
+
this.width = window.innerWidth
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
sidebarToggle(){
|
|
154
|
+
this.showSidebar = !this.showSidebar
|
|
155
|
+
this.$refs.content.classList.add('overflow-hidden')
|
|
156
|
+
setTimeout(() => {
|
|
157
|
+
this.$refs.content.classList.remove('overflow-hidden')
|
|
158
|
+
}, 360);
|
|
159
|
+
|
|
160
|
+
},
|
|
111
161
|
},
|
|
112
162
|
|
|
113
163
|
watch: {
|
|
@@ -143,16 +193,40 @@
|
|
|
143
193
|
&-controls{
|
|
144
194
|
margin-right: 24px;
|
|
145
195
|
}
|
|
196
|
+
|
|
197
|
+
.sidebar-button{
|
|
198
|
+
margin-right: 24px;
|
|
199
|
+
}
|
|
146
200
|
}
|
|
147
201
|
|
|
148
202
|
&-content{
|
|
149
203
|
flex: 1;
|
|
150
204
|
display: flex;
|
|
151
205
|
overflow: auto;
|
|
206
|
+
position: relative;
|
|
207
|
+
|
|
208
|
+
&.overflow-hidden{
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
}
|
|
152
211
|
}
|
|
153
212
|
|
|
154
213
|
&-content-inner{
|
|
155
214
|
margin: 0 auto;
|
|
215
|
+
display: flex;
|
|
216
|
+
width: 100%;
|
|
217
|
+
height: 100%;
|
|
218
|
+
min-height: min-content;
|
|
219
|
+
position: relative;
|
|
220
|
+
|
|
221
|
+
&-inner{
|
|
222
|
+
position: relative;
|
|
223
|
+
height: min-content;
|
|
224
|
+
margin: 0 auto;
|
|
225
|
+
|
|
226
|
+
&.has-sidebar{
|
|
227
|
+
margin: 0 0 0 auto;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
156
230
|
}
|
|
157
231
|
|
|
158
232
|
&-tabs{
|
|
@@ -164,6 +238,28 @@
|
|
|
164
238
|
flex-shrink: 0;
|
|
165
239
|
}
|
|
166
240
|
|
|
241
|
+
&-sidebar{
|
|
242
|
+
flex-shrink: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&-sidebar-static{
|
|
246
|
+
padding: 0 15px 0 30px;
|
|
247
|
+
width: 400px;
|
|
248
|
+
margin: 0 auto 0 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&-sidebar-float{
|
|
252
|
+
padding: 0 15px 0 20px;
|
|
253
|
+
width: 400px;
|
|
254
|
+
overflow: auto;
|
|
255
|
+
position: absolute;
|
|
256
|
+
right: 0;
|
|
257
|
+
top: 0;
|
|
258
|
+
bottom: 0;
|
|
259
|
+
background: #FFF;
|
|
260
|
+
box-shadow: 0 0 20px rgba(0,0,0,.12);
|
|
261
|
+
}
|
|
262
|
+
|
|
167
263
|
&-footer{
|
|
168
264
|
flex-shrink: 0;
|
|
169
265
|
background: #FFF;
|
|
@@ -175,17 +271,26 @@
|
|
|
175
271
|
padding: 30px;
|
|
176
272
|
}
|
|
177
273
|
|
|
178
|
-
.spacer{
|
|
274
|
+
.spacer-tabs{
|
|
179
275
|
width: 260px;
|
|
180
276
|
flex-shrink: 0;
|
|
181
277
|
}
|
|
182
278
|
|
|
279
|
+
.spacer-sidebar{
|
|
280
|
+
min-width: 400px;
|
|
281
|
+
}
|
|
282
|
+
|
|
183
283
|
&-content{
|
|
284
|
+
width: 100%;
|
|
285
|
+
display: flex;
|
|
286
|
+
|
|
287
|
+
&-inner{
|
|
184
288
|
margin: 0 auto;
|
|
185
289
|
display: flex;
|
|
186
290
|
align-items: center;
|
|
187
291
|
justify-content: space-between;
|
|
188
292
|
}
|
|
293
|
+
}
|
|
189
294
|
}
|
|
190
295
|
|
|
191
296
|
&-titles{
|
|
@@ -231,5 +336,20 @@
|
|
|
231
336
|
.fade-leave-to{
|
|
232
337
|
opacity: 0;
|
|
233
338
|
}
|
|
339
|
+
|
|
340
|
+
.slide-enter-active,
|
|
341
|
+
.slide-leave-active{
|
|
342
|
+
transition: all .3s;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.slide-enter{
|
|
346
|
+
opacity: 0;
|
|
347
|
+
transform: translateX(100%);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.slide-leave-to{
|
|
351
|
+
opacity: 0;
|
|
352
|
+
transform: translateX(100%);
|
|
353
|
+
}
|
|
234
354
|
</style>
|
|
235
355
|
|
|
@@ -73,13 +73,13 @@ export default {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.expansion-enter-active
|
|
77
|
-
animation: expansion-in .
|
|
76
|
+
.expansion-enter-active{
|
|
77
|
+
animation: expansion-in .3s ease;
|
|
78
78
|
overflow: hidden;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.expansion-leave-active
|
|
82
|
-
animation: expansion-in .
|
|
81
|
+
.expansion-leave-active{
|
|
82
|
+
animation: expansion-in .3s ease reverse;
|
|
83
83
|
overflow: hidden;
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -88,7 +88,7 @@ export default {
|
|
|
88
88
|
max-height: 0;
|
|
89
89
|
}
|
|
90
90
|
100% {
|
|
91
|
-
max-height:
|
|
91
|
+
max-height: 46px;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
</style>
|
|
@@ -106,6 +106,23 @@ export default {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.ecs-sidebar-header-row{
|
|
109
|
+
> *{
|
|
110
|
+
opacity: 1;
|
|
111
|
+
transition: opacity .2s ease;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.expansion-enter-active{
|
|
115
|
+
> *{
|
|
116
|
+
opacity: 0;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.expansion-leave-active{
|
|
121
|
+
> *{
|
|
122
|
+
opacity: 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
109
126
|
.ecs-tab-bar{
|
|
110
127
|
width: 100%;
|
|
111
128
|
}
|
|
@@ -78,3 +78,42 @@ export const overlayFullWidthTabs = () => ({
|
|
|
78
78
|
</ecs-overlay>
|
|
79
79
|
</div>`,
|
|
80
80
|
});
|
|
81
|
+
|
|
82
|
+
export const overlaySidebar = () => ({
|
|
83
|
+
components: { EcsOverlay },
|
|
84
|
+
data() {
|
|
85
|
+
return {
|
|
86
|
+
showOverlay: false
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
template: `<div>
|
|
90
|
+
<button @click="showOverlay = true">Show Overlay</button>
|
|
91
|
+
<ecs-overlay :show="showOverlay" @close="showOverlay = false" icon="archive" header-title="Title" header-title-emphasized="Overlay:" header-title-subline="John G. Deposition (10/12/2020) – Pages 1 - 321" >
|
|
92
|
+
|
|
93
|
+
<div style="height:700px;background:gray">content area</div>
|
|
94
|
+
|
|
95
|
+
<template slot="footer">footer area</template>
|
|
96
|
+
<template slot="sidebar"><div style="height:500px;background:gray">sidebar area</div></template>
|
|
97
|
+
</ecs-overlay>
|
|
98
|
+
</div>`,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export const overlayTabsSidebar = () => ({
|
|
102
|
+
components: { EcsOverlay },
|
|
103
|
+
data() {
|
|
104
|
+
return {
|
|
105
|
+
showOverlay: false
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
template: `<div>
|
|
109
|
+
<button @click="showOverlay = true">Show Overlay</button>
|
|
110
|
+
<ecs-overlay :show="showOverlay" @close="showOverlay = false" icon="archive" header-title="Title" header-title-emphasized="Overlay:" header-title-subline="John G. Deposition (10/12/2020) – Pages 1 - 321">
|
|
111
|
+
|
|
112
|
+
content area
|
|
113
|
+
|
|
114
|
+
<template slot="tabs">tab area</template>
|
|
115
|
+
<template slot="sidebar"><div style="height:500px;background:gray">sidebar area</div></template>
|
|
116
|
+
<template slot="footer">footer area</template>
|
|
117
|
+
</ecs-overlay>
|
|
118
|
+
</div>`,
|
|
119
|
+
});
|
|
@@ -28,7 +28,7 @@ export const headerWithSubheaderExpanded = () => ({
|
|
|
28
28
|
<ecs-button type="secondary" icon-only icon="search" />
|
|
29
29
|
<ecs-button type="primary" icon="add-plus" class="ml-2">Add</ecs-button>
|
|
30
30
|
</template>
|
|
31
|
-
<template slot="
|
|
31
|
+
<template slot="subheader">
|
|
32
32
|
<ecs-tab-bar type="segment">
|
|
33
33
|
<ecs-tab-button show>Locations</ecs-tab-button>
|
|
34
34
|
<ecs-tab-button>Family</ecs-tab-button>
|
|
@@ -40,13 +40,18 @@ export const headerWithSubheaderExpanded = () => ({
|
|
|
40
40
|
|
|
41
41
|
export const headerWithSubheader = () => ({
|
|
42
42
|
components: { EcsSidebarHeader, EcsButton, EcsTabBar, EcsTabButton },
|
|
43
|
-
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
expand: false
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
template: `<ecs-sidebar-header :sub-header-expanded="expand">
|
|
44
49
|
<h3 class="headline-2">Sidebar</h3>
|
|
45
50
|
<template slot="primary-controls">
|
|
46
|
-
<ecs-button type="secondary" icon-only icon="search" />
|
|
51
|
+
<ecs-button @click="expand = !expand" type="secondary" icon-only icon="search" />
|
|
47
52
|
<ecs-button type="primary" icon="add-plus" class="ml-2">Add</ecs-button>
|
|
48
53
|
</template>
|
|
49
|
-
<template slot="
|
|
54
|
+
<template slot="subheader">
|
|
50
55
|
<ecs-tab-bar type="segment">
|
|
51
56
|
<ecs-tab-button show>Locations</ecs-tab-button>
|
|
52
57
|
<ecs-tab-button>Family</ecs-tab-button>
|
|
@@ -35,13 +35,13 @@ The sidebar header is a required sub component of EcsSidebar. It always needs to
|
|
|
35
35
|
</Canvas>
|
|
36
36
|
|
|
37
37
|
```js
|
|
38
|
-
<ecs-sidebar-header>
|
|
38
|
+
<ecs-sidebar-header :sub-header-expanded="expand">
|
|
39
39
|
<h3 class="headline-2">Sidebar</h3>
|
|
40
40
|
<template slot="primary-controls">
|
|
41
|
-
<ecs-button type="secondary" icon-only icon="search" />
|
|
41
|
+
<ecs-button @click="expand = !expand" type="secondary" icon-only icon="search" />
|
|
42
42
|
<ecs-button type="primary" icon="add-plus" class="ml-2">Add</ecs-button>
|
|
43
43
|
</template>
|
|
44
|
-
<template slot="
|
|
44
|
+
<template slot="subheader">
|
|
45
45
|
<ecs-tab-bar type="segment">
|
|
46
46
|
<ecs-tab-button show>Locations</ecs-tab-button>
|
|
47
47
|
<ecs-tab-button>Family</ecs-tab-button>
|
|
@@ -66,7 +66,7 @@ The sidebar header is a required sub component of EcsSidebar. It always needs to
|
|
|
66
66
|
<ecs-button type="secondary" icon-only icon="search" />
|
|
67
67
|
<ecs-button type="primary" icon="add-plus" class="ml-2">Add</ecs-button>
|
|
68
68
|
</template>
|
|
69
|
-
<template slot="
|
|
69
|
+
<template slot="subheader">
|
|
70
70
|
<ecs-tab-bar type="segment">
|
|
71
71
|
<ecs-tab-button show>Locations</ecs-tab-button>
|
|
72
72
|
<ecs-tab-button>Family</ecs-tab-button>
|
|
@@ -78,4 +78,4 @@ The sidebar header is a required sub component of EcsSidebar. It always needs to
|
|
|
78
78
|
|
|
79
79
|
## Props and Slots
|
|
80
80
|
|
|
81
|
-
<ArgsTable of={EcsSidebarHeader} />
|
|
81
|
+
<ArgsTable of={EcsSidebarHeader} />
|