@everchron/ec-shards 0.7.13 → 0.7.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everchron/ec-shards",
3
- "version": "0.7.13",
3
+ "version": "0.7.16",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -3,30 +3,32 @@
3
3
  :class="[
4
4
  iconClass,
5
5
  active ? 'active' : '',
6
+ loading ? 'loading' : '',
6
7
  activeHighlight ? 'active-highlight' : '',
7
8
  dropdown ? 'ecs-toolbar-button-dropdown' : '',
8
9
  dropdownClass]"
9
10
  @click="$emit('click', $event)">
10
11
 
11
- <ecs-icon v-if="icon && iconPosition == 'left'" :width="iconSize" :height="iconSize" :color="iconTint" :type="icon" />
12
+ <ecs-icon v-if="(icon && iconPosition == 'left') || (loading && iconPosition == 'left')" :width="iconSize" :height="iconSize" :color="iconTint" :type="iconType" :spinning="loading" />
12
13
  <slot></slot>
13
14
  <span class="badge" v-if="badge" :style="{ background: badgeColor }"></span>
14
- <ecs-icon v-if="icon && iconPosition == 'right'" :width="iconSize" :height="iconSize" :color="iconTint" :type="icon" />
15
+ <ecs-icon v-if="(icon && iconPosition == 'right') || (loading && iconPosition == 'right')" :width="iconSize" :height="iconSize" :color="iconTint" :type="iconType" :spinning="loading" />
15
16
  </a>
16
17
 
17
18
  <button v-else class="ecs-toolbar-button"
18
19
  :class="[
19
20
  iconClass,
20
21
  active ? 'active' : '',
22
+ loading ? 'loading' : '',
21
23
  activeHighlight ? 'active-highlight' : '',
22
24
  dropdown ? 'ecs-toolbar-button-dropdown' : '',
23
25
  dropdownClass]"
24
26
  @click="$emit('click', $event)">
25
27
 
26
- <ecs-icon v-if="icon && iconPosition == 'left'" :width="iconSize" :height="iconSize" :color="iconTint" :type="icon" />
28
+ <ecs-icon v-if="(icon && iconPosition == 'left') || (loading && iconPosition == 'left')" :width="iconSize" :height="iconSize" :color="iconTint" :type="iconType" :spinning="loading" />
27
29
  <slot></slot>
28
30
  <span class="badge" v-if="badge" :style="{ background: badgeColor }"></span>
29
- <ecs-icon v-if="icon && iconPosition == 'right'" :width="iconSize" :height="iconSize" :color="iconTint" :type="icon" />
31
+ <ecs-icon v-if="(icon && iconPosition == 'right') || (loading && iconPosition == 'right')" :width="iconSize" :height="iconSize" :color="iconTint" :type="iconType" :spinning="loading" />
30
32
  </button>
31
33
  </template>
32
34
 
@@ -51,6 +53,10 @@
51
53
  type: String,
52
54
  default: null
53
55
  },
56
+ loading: {
57
+ type: Boolean,
58
+ default: false
59
+ },
54
60
  iconSize: {
55
61
  type: String,
56
62
  default: '26'
@@ -99,6 +105,12 @@
99
105
  return this.icon
100
106
  },
101
107
 
108
+ iconType() {
109
+ if (this.loading)
110
+ return 'loading'
111
+ return this.icon
112
+ },
113
+
102
114
  iconTint() {
103
115
  if (this.activeHighlight)
104
116
  return '#0961EB'
@@ -197,6 +209,11 @@
197
209
  }
198
210
  }
199
211
 
212
+ &.loading{
213
+ cursor: wait;
214
+ opacity: .7;
215
+ }
216
+
200
217
  &-dropdown{
201
218
  padding-right: 22px;
202
219
 
@@ -54,6 +54,7 @@ import EcsJumperDocument from "./jumper-document/jumper-document.vue"
54
54
  import EcsJumperIndex from "./jumper-index/jumper-index.vue"
55
55
  import EcsJumperPage from "./jumper-page/jumper-page.vue"
56
56
  import EcsLayoutIndex from "./layout-index/layout-index.vue"
57
+ import EcsLayoutDirectory from "./layout-directory/layout-directory.vue"
57
58
  import EcsMap from "./map/map.vue"
58
59
  import EcsModal from "./modal/modal.vue"
59
60
  import EcsModalHeader from "./modal-header/modal-header.vue"
@@ -158,6 +159,7 @@ const Components = {
158
159
  EcsJumperIndex,
159
160
  EcsJumperPage,
160
161
  EcsLayoutIndex,
162
+ EcsLayoutDirectory,
161
163
  EcsMap,
162
164
  EcsModal,
163
165
  EcsModalHeader,
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <div class="ecs-directory-layout">
3
+
4
+ <slot name="toolbar"></slot>
5
+ <slot name="action-toolbar"></slot>
6
+
7
+ <div class="ecs-directory-layout-wrap">
8
+ <div class="ecs-directory-layout-contents">
9
+ <div v-if="$slots.directory" class="ecs-directory-layout-directory">
10
+ <slot name="directory"></slot>
11
+ </div>
12
+ <div class="ecs-directory-layout-entry scrollbar" :class="[$slots.sidebar ? 'has-sidebar' : '']">
13
+ <slot></slot>
14
+ </div>
15
+ <div v-if="$slots.sidebar" class="ecs-directory-layout-sidebar">
16
+ <slot name="sidebar"></slot>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ props: {
26
+ overlaySidebar: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ indent: {
31
+ type: Boolean,
32
+ default: false
33
+ }
34
+ }
35
+ }
36
+ </script>
37
+
38
+ <style lang="scss" scoped>
39
+ @import "../tokens/tokens";
40
+ @import "../mixins/svg-uri";
41
+
42
+ .ecs-directory-layout{
43
+ display: flex;
44
+ flex-direction: column;
45
+ width: 100%;
46
+ height: calc(100vh - #{$header_height});
47
+ background: #FFF;
48
+
49
+ &-wrap{
50
+ flex: 1;
51
+ display: flex;
52
+ overflow: hidden;
53
+ width: 100%;
54
+ height: 100%;
55
+ transition: .3s;
56
+ position: relative;
57
+ }
58
+
59
+ &-contents{
60
+ flex: 1;
61
+ display: flex;
62
+ max-width: 100%;
63
+ }
64
+
65
+ &-entry{
66
+ flex: 1;
67
+ overflow: auto;
68
+ padding: 30px;
69
+
70
+ &.has-sidebar{
71
+ padding-right: 60px;
72
+ }
73
+ }
74
+
75
+ &-directory{
76
+ flex-shrink: 0;
77
+ border-right: 1px solid $gray-4;
78
+ }
79
+
80
+ &-sidebar{
81
+ position: absolute;
82
+ z-index: 5;
83
+ right: 0;
84
+ top: 0;
85
+ bottom: 0;
86
+ }
87
+ }
88
+ </style>
@@ -12,7 +12,17 @@
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 <= 1500" @click="sidebarToggle" :icon="sidebarIcon" :title="showSidebar ? 'Hide ' + sidebarTitle : 'Show ' + sidebarTitle" :active="showSidebar" :badge="sidebarIconBadge" class="sidebar-button" />
15
+ <ecs-button-toolbar
16
+ v-if="$slots.sidebar && width <= 1500"
17
+ @click="sidebarToggle"
18
+ :icon="sidebarIcon"
19
+ :title="showSidebar ? 'Hide ' + sidebarTitle : 'Show ' + sidebarTitle"
20
+ :active="showSidebar"
21
+ :badge="sidebarIconBadge"
22
+ :badge-color="sidebarIconBadgeColor"
23
+ :loading="sidebarIconLoading"
24
+ class="sidebar-button"
25
+ />
16
26
  <ecs-button-toolbar @click="$emit('close')" :disabled="closeDisabled" icon="close">{{ closeText }}</ecs-button-toolbar>
17
27
  </div>
18
28
  <div ref="content" class="ecs-overlay-content scrollbar">
@@ -99,6 +109,14 @@
99
109
  sidebarIconBadge: {
100
110
  type: Boolean,
101
111
  default: false
112
+ },
113
+ sidebarIconBadgeColor: {
114
+ type: String,
115
+ default: '#FF4B62'
116
+ },
117
+ sidebarIconLoading: {
118
+ type: Boolean,
119
+ default: false
102
120
  }
103
121
  },
104
122
 
@@ -8,7 +8,7 @@ export default {
8
8
 
9
9
  export const regular = () => ({
10
10
  components: { EcsButtonToolbar },
11
- template: `<ecs-button-toolbar icon="marker"></ecs-button-toolbar>`,
11
+ template: `<ecs-button-toolbar loading icon="marker"></ecs-button-toolbar>`,
12
12
  });
13
13
 
14
14
  export const regularText = () => ({
@@ -0,0 +1,27 @@
1
+ import EcsLayoutDirectory from '@components/layout-directory/layout-directory';
2
+
3
+ export default {
4
+ title: 'Layouts/Directory',
5
+ component: EcsLayoutDirectory
6
+ };
7
+
8
+ export const directory = () => ({
9
+ components: { EcsLayoutDirectory },
10
+ template: `<ecs-layout-directory>
11
+ <template slot="toolbar">
12
+ <div>toolbar</div>
13
+ </template>
14
+ <template slot="action-toolbar">
15
+ <div>action-toolbar</div>
16
+ </template>
17
+ <template slot="directory">
18
+ <div>directory</div>
19
+ </template>
20
+
21
+ <div>content slot</div>
22
+
23
+ <template slot="sidebar">
24
+ <div>sidebar</div>
25
+ </template>
26
+ </ecs-layout-directory>`,
27
+ });
@@ -0,0 +1,50 @@
1
+ import { Meta, Story, ArgsTable, Canvas, Description } from '@storybook/addon-docs/blocks';
2
+ import EcsLayoutDirectory from '@components/layout-directory/layout-directory';
3
+ import * as stories from './layout-directory.stories.js';
4
+
5
+ <Meta
6
+ title="Layouts/Directory"
7
+ component={EcsLayoutDirectory} />
8
+
9
+ # Directory Layout `EcsLayoutDirectory`
10
+
11
+ Directory layout are used for pages where you do a pre-selection of an item in a sidebar, and the details of that item are shown in the right content area. Consists of a large scrollable content area, and the following optional components:
12
+
13
+ - toolbar
14
+ - action toolbar
15
+ - left sidebar (the directory)
16
+ - right sidebar (filters)
17
+
18
+ The `overlay-sidebar` attribute sets the sidebar container to be fixed and overlaying other content when expanded (this is used for content areas that need a lot of space, like large tables).
19
+
20
+ <Canvas withSource="none" withToolbar={true}>
21
+ <Story name="Directory" height="900px">
22
+ {stories.directory()}
23
+ </Story>
24
+ </Canvas>
25
+
26
+
27
+ ```js
28
+ <ecs-layout-index>
29
+ <template slot="toolbar">
30
+ <div>toolbar</div>
31
+ </template>
32
+ <template slot="action-toolbar">
33
+ <div>action-toolbar</div>
34
+ </template>
35
+
36
+ <div>content slot</div>
37
+
38
+ <template slot="pagination">
39
+ <div>pagination</div>
40
+ </template>
41
+ <template slot="sidebar">
42
+ <div>sidebar</div>
43
+ </template>
44
+ </ecs-layout-index>
45
+ ```
46
+
47
+
48
+ ## Props and Slots
49
+
50
+ <ArgsTable of={EcsLayoutDirectory} />