@everchron/ec-shards 0.7.49 → 0.7.52

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.49",
3
+ "version": "0.7.52",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -5,7 +5,7 @@
5
5
  ]"
6
6
  @click="$emit('click', $event)">
7
7
 
8
- <ecs-icon v-if="type == 'ellipsis'" type="more" width="20" height="20" />
8
+ <ecs-icon v-if="type == 'ellipsis'" type="more" width="20" height="20" color="#FFF" />
9
9
  <slot></slot>
10
10
  </button>
11
11
  </template>
@@ -55,6 +55,7 @@ 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
57
  import EcsLayoutDirectory from "./layout-directory/layout-directory.vue"
58
+ import EcsLayoutDataTable from "./layout-data-table/layout-data-table.vue"
58
59
  import EcsMap from "./map/map.vue"
59
60
  import EcsModal from "./modal/modal.vue"
60
61
  import EcsModalHeader from "./modal-header/modal-header.vue"
@@ -160,6 +161,7 @@ const Components = {
160
161
  EcsJumperPage,
161
162
  EcsLayoutIndex,
162
163
  EcsLayoutDirectory,
164
+ EcsLayoutDataTable,
163
165
  EcsMap,
164
166
  EcsModal,
165
167
  EcsModalHeader,
@@ -0,0 +1,136 @@
1
+ <template>
2
+ <div class="ecs-data-layout">
3
+ <div class="ecs-data-layout-content">
4
+ <div v-if="$slots.toolbar" class="ecs-data-layout-toolbar">
5
+ <slot name="toolbar"></slot>
6
+ </div>
7
+
8
+ <ecs-action-toolbar v-if="$slots.actionbar" v-show="showActionbar">
9
+ <slot name="actionbar"></slot>
10
+ </ecs-action-toolbar>
11
+
12
+ <div class="ecs-data-layout-data">
13
+ <slot></slot>
14
+ </div>
15
+ </div>
16
+
17
+ <div v-if="$slots.sidebarcontent || $slots.sidebarheader" class="ecs-data-layout-sidebar" :class="sidebarExpanded ? 'expanded' : ''">
18
+ <div class="ecs-data-layout-sidebar-inner">
19
+ <div v-if="$slots.sidebarheader" class="ecs-data-layout-sidebar-header">
20
+ <slot name="sidebarheader"></slot>
21
+ </div>
22
+
23
+ <div class="ecs-data-layout-sidebar-content scrollbar scrollbar-sml">
24
+ <slot name="sidebarcontent"></slot>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+ import EcsActionToolbar from '../action-toolbar/action-toolbar'
33
+
34
+ export default {
35
+ components: { EcsActionToolbar },
36
+
37
+ props: {
38
+ sidebarExpanded: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ showActionbar: {
43
+ type: Boolean,
44
+ default: false
45
+ }
46
+ }
47
+ }
48
+ </script>
49
+
50
+ <style lang="scss" scoped>
51
+ @import "../tokens/tokens";
52
+ @import "../mixins/svg-uri";
53
+
54
+ $bar-height: 41px;
55
+
56
+ .ecs-data-layout{
57
+ display: flex;
58
+ width: 100%;
59
+ height: 100%;
60
+ background: #FFF;
61
+ overflow: hidden;
62
+
63
+ &-toolbar{
64
+ display: flex;
65
+ align-items: center;
66
+ width: 100%;
67
+ padding: 0 12px;
68
+ background: #FFF;
69
+ height: $bar-height;
70
+ border-bottom: 1px solid $gray-3;
71
+ position: relative;
72
+ z-index: 3;
73
+ }
74
+
75
+ &-content{
76
+ flex: 1;
77
+ overflow: hidden;
78
+ position: relative;
79
+ display: flex;
80
+ flex-direction: column;
81
+ transition: .4s;
82
+ }
83
+
84
+ &-data{
85
+ flex: 1;
86
+ overflow: hidden;
87
+ }
88
+
89
+ &-sidebar{
90
+ width: 0;
91
+ min-width: 0;
92
+ overflow: hidden;
93
+ height: 100%;
94
+ background: #FFF;
95
+ border-left: 1px solid #FFF;
96
+ transition: .4s;
97
+
98
+ &.expanded{
99
+ min-width: 320px;
100
+ width: 25%;
101
+ max-width: 500px;
102
+ border-left-color: $gray-3;
103
+
104
+ .ecs-data-layout-sidebar-inner{
105
+ opacity: 1;
106
+ }
107
+ }
108
+
109
+ &-inner{
110
+ width: 100%;
111
+ min-width: 320px;
112
+ height: 100%;
113
+ display: flex;
114
+ flex-direction: column;
115
+ overflow: hidden;
116
+ transition: .5s;
117
+ opacity: 0;
118
+ }
119
+
120
+ &-header{
121
+ height: $bar-height;
122
+ flex-shrink: 0;
123
+ border-bottom: 1px solid $gray-3;
124
+ display: flex;
125
+ align-items: center;
126
+ padding: 0 16px 0 20px;
127
+ }
128
+
129
+ &-content{
130
+ flex: 1;
131
+ padding: 20px;
132
+ overflow: auto;
133
+ }
134
+ }
135
+ }
136
+ </style>
@@ -72,6 +72,7 @@
72
72
  }
73
73
 
74
74
  &-close{
75
+ cursor: pointer;
75
76
  width: 40px;
76
77
  height: 40px;
77
78
  border-radius: 3px;
@@ -4,7 +4,8 @@
4
4
  party,
5
5
  shared ? 'shared' : '',
6
6
  background ? 'ecs-party-entry-background' : ''
7
- ]">
7
+ ]"
8
+ :style="annotationStyles">
8
9
  <ecs-icon v-if="icon && iconPosition == 'left'" :type="iconType" :color="iconColor" :style="'margin-right:'+iconSpacing" :width="iconSize" :height="iconSize" />
9
10
  <slot></slot>
10
11
  <ecs-icon v-if="icon && iconPosition == 'right'" :type="iconType" :color="iconColor" :style="'margin-left:'+iconSpacing" :width="iconSize" :height="iconSize" />
@@ -23,8 +24,7 @@
23
24
  },
24
25
  party: {
25
26
  type: String,
26
- validator: v => ['client', 'opposing', 'joint', 'other', 'court', 'unaffiliated'].includes(v),
27
- required: true
27
+ validator: v => ['client', 'opposing', 'joint', 'other', 'court', 'unaffiliated'].includes(v)
28
28
  },
29
29
  background: {
30
30
  type: Boolean,
@@ -46,6 +46,10 @@
46
46
  type: String,
47
47
  default: '30px'
48
48
  },
49
+ annotationColor: {
50
+ type: Number,
51
+ default: null
52
+ },
49
53
  },
50
54
 
51
55
  computed: {
@@ -64,22 +68,85 @@
64
68
  }
65
69
  },
66
70
 
67
- iconColor() {
68
- switch (this.party){
69
- case 'client':
70
- return '#227FD3'
71
- case 'opposing':
72
- return '#5DAF00'
73
- case 'joint':
74
- return '#A4927A'
75
- case 'other':
76
- return '#95989C'
77
- case 'court':
78
- return '#D78B21'
79
- case 'unaffiliated':
80
- return '#C1C2C4'
71
+ annotationBackgroundColor() {
72
+ switch (this.annotationColor){
73
+ case 1:
74
+ return 'rgba(249, 223, 0, 0.5)'
75
+ case 2:
76
+ return 'rgba(243, 161, 0, 0.5)'
77
+ case 3:
78
+ return 'rgba(183, 234, 128, 0.5)'
79
+ case 4:
80
+ return 'rgba(72, 228, 194, 0.5)'
81
+ case 5:
82
+ return 'rgba(72, 157, 255, 0.5)'
83
+ case 6:
84
+ return 'rgba(184, 119, 240, 0.5)'
85
+ case 7:
86
+ return 'rgba(253, 120, 253, 0.5)'
87
+ case 8:
88
+ return 'rgba(197, 148, 101, 0.5)'
89
+ case 9:
90
+ return 'rgba(133, 142, 159, 0.5)'
91
+ default:
92
+ return 'rgba(249, 223, 0, 0.5)'
93
+ }
94
+ },
95
+
96
+ annotationIconColor() {
97
+ switch (this.annotationColor){
98
+ case 1:
99
+ return '#B57100'
100
+ case 2:
101
+ return '#A95A00'
102
+ case 3:
103
+ return '#429700'
104
+ case 4:
105
+ return '#06956E'
106
+ case 5:
107
+ return '#0E4BBE'
108
+ case 6:
109
+ return '#6B1ABA'
110
+ case 7:
111
+ return '#BE15BF'
112
+ case 8:
113
+ return '#7B3F1B'
114
+ case 9:
115
+ return '#364258'
81
116
  default:
82
- return '#C1C2C4'
117
+ return '#B57100'
118
+ }
119
+ },
120
+
121
+ iconColor() {
122
+ if( this.annotationColor ){
123
+ return this.annotationIconColor
124
+ } else {
125
+ switch (this.party){
126
+ case 'client':
127
+ return '#227FD3'
128
+ case 'opposing':
129
+ return '#5DAF00'
130
+ case 'joint':
131
+ return '#A4927A'
132
+ case 'other':
133
+ return '#95989C'
134
+ case 'court':
135
+ return '#D78B21'
136
+ case 'unaffiliated':
137
+ return '#C1C2C4'
138
+ default:
139
+ return '#C1C2C4'
140
+ }
141
+ }
142
+ },
143
+
144
+ annotationStyles() {
145
+ if (this.annotationColor){
146
+ return {
147
+ 'background-color': this.annotationBackgroundColor,
148
+ 'color': this.annotationIconColor
149
+ }
83
150
  }
84
151
  }
85
152
  }
@@ -115,6 +182,10 @@
115
182
  opacity: 1;
116
183
  }
117
184
 
185
+ &:not(.ecs-party-entry-background){
186
+ background: transparent !important;
187
+ }
188
+
118
189
  &.client{
119
190
  color: $party-client-text;
120
191
  }
@@ -0,0 +1,19 @@
1
+ import EcsLayoutDataTable from '@components/layout-data-table/layout-data-table';
2
+
3
+ export default {
4
+ title: 'Layouts/Data Table',
5
+ component: EcsLayoutDataTable
6
+ };
7
+
8
+ export const dataTable = () => ({
9
+ components: { EcsLayoutDataTable },
10
+ template: `<ecs-layout-data-table sidebar-expanded>
11
+ <template slot="toolbar">toolbar</template>
12
+ <template slot="actionbar">actionbar</template>
13
+
14
+ table
15
+
16
+ <template slot="sidebarheader">sidebarheader</template>
17
+ <template slot="sidebarcontent">sidebar</template>
18
+ </ecs-layout-data-table>`,
19
+ });
@@ -0,0 +1,36 @@
1
+ import { Meta, Story, ArgsTable, Canvas, Description } from '@storybook/addon-docs/blocks';
2
+ import EcsLayoutDataTable from '@components/layout-data-table/layout-data-table';
3
+ import * as stories from './layout-data-table.stories.js';
4
+
5
+ <Meta
6
+ title="Layouts/Data Table"
7
+ component={EcsLayoutDataTable} />
8
+
9
+ # Data Table `EcsLayoutDataTable`
10
+
11
+ The data table layout is commonly used in App Settings pages. It always features a larger content area (which is most of the time filled by a full width data table component) and an optional sidebar that can expand or collapse.
12
+
13
+
14
+ <Canvas withSource="none" withToolbar={true}>
15
+ <Story name="Data Table" height="900px">
16
+ {stories.dataTable()}
17
+ </Story>
18
+ </Canvas>
19
+
20
+
21
+ ```js
22
+ <ecs-layout-data-table sidebar-expanded>
23
+ <template slot="toolbar">toolbar</template>
24
+ <template slot="actionbar">actionbar</template>
25
+
26
+ table
27
+
28
+ <template slot="sidebarheader">sidebarheader</template>
29
+ <template slot="sidebarcontent">sidebar</template>
30
+ </ecs-layout-data-table>
31
+ ```
32
+
33
+
34
+ ## Props and Slots
35
+
36
+ <ArgsTable of={EcsLayoutDataTable} />
@@ -45,3 +45,18 @@ export const partyEntryWithBackground = () => ({
45
45
  <ecs-party-entry background icon="document" party="unaffiliated">Unaffiliated</ecs-party-entry>
46
46
  </main>`,
47
47
  });
48
+
49
+ export const partyEntryAnnotations = () => ({
50
+ components: { EcsPartyEntry },
51
+ template: `<main>
52
+ <ecs-party-entry background icon="marker" :annotation-color="1">Annotation</ecs-party-entry>
53
+ <ecs-party-entry background icon="marker" :annotation-color="2">Annotation</ecs-party-entry>
54
+ <ecs-party-entry background icon="marker" :annotation-color="3">Annotation</ecs-party-entry>
55
+ <ecs-party-entry background icon="marker" :annotation-color="4">Annotation</ecs-party-entry>
56
+ <ecs-party-entry background icon="marker" :annotation-color="5">Annotation</ecs-party-entry>
57
+ <ecs-party-entry background icon="marker" :annotation-color="6">Annotation</ecs-party-entry>
58
+ <ecs-party-entry background icon="marker" :annotation-color="7">Annotation</ecs-party-entry>
59
+ <ecs-party-entry background icon="marker" :annotation-color="8">Annotation</ecs-party-entry>
60
+ <ecs-party-entry background icon="marker" :annotation-color="9">Annotation</ecs-party-entry>
61
+ </main>`,
62
+ });
@@ -71,6 +71,38 @@ Use the `party` attribute to set the party side. The following sides are availab
71
71
  <ecs-party-entry icon="document" party="unaffiliated">Unaffiliated</ecs-party-entry>
72
72
  ```
73
73
 
74
+ ## Annotations
75
+
76
+ By not using the `party` prop, but `annotation-color` prop instead, you can show the entry tag with a defined annotation mark color. Note that the annotation colors must be a `Number` between `1` and `9` - mapping to the Everchron mark colors table.
77
+
78
+ + Yellow: `1`
79
+ + Orange: `2`
80
+ + Lime: `3`
81
+ + Cyan: `4`
82
+ + Blue: `5`
83
+ + Indigo: `6`
84
+ + Pink: `7`
85
+ + Brown: `8`
86
+ + Grey: `9`
87
+
88
+ <Canvas withSource="none" withToolbar={true}>
89
+ <Story name="Party Entry Annotations" height="80px">
90
+ {stories.partyEntryAnnotations()}
91
+ </Story>
92
+ </Canvas>
93
+
94
+ ```js
95
+ <ecs-party-entry background icon="marker" :annotation-color="1">Annotation</ecs-party-entry>
96
+ <ecs-party-entry background icon="marker" :annotation-color="2">Annotation</ecs-party-entry>
97
+ <ecs-party-entry background icon="marker" :annotation-color="3">Annotation</ecs-party-entry>
98
+ <ecs-party-entry background icon="marker" :annotation-color="4">Annotation</ecs-party-entry>
99
+ <ecs-party-entry background icon="marker" :annotation-color="5">Annotation</ecs-party-entry>
100
+ <ecs-party-entry background icon="marker" :annotation-color="6">Annotation</ecs-party-entry>
101
+ <ecs-party-entry background icon="marker" :annotation-color="7">Annotation</ecs-party-entry>
102
+ <ecs-party-entry background icon="marker" :annotation-color="8">Annotation</ecs-party-entry>
103
+ <ecs-party-entry background icon="marker" :annotation-color="9">Annotation</ecs-party-entry>
104
+ ```
105
+
74
106
  ## Props and Slots
75
107
 
76
108
  <ArgsTable of={EcsPartyEntry} />