@everchron/ec-shards 0.6.74 → 0.6.78

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.6.74",
3
+ "version": "0.6.78",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><polygon vector-effect="non-scaling-stroke" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" points="16.048 5.25 7.146 17.167 15 17.167 13.952 24.75 22.854 12.833 15 12.833"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><g vector-effect="non-scaling-stroke" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><g vector-effect="non-scaling-stroke" stroke="currentColor" opacity=".5" transform="translate(5.333 5.333)"><path vector-effect="non-scaling-stroke" d="M9.84967295,19.333333 L5,19.333333 C2.23857625,19.333333 0,17.0947567 0,14.333333 L0,5 C0,2.23857625 2.23857625,0 5,0 L14.333333,0 C17.0947567,0 19.333333,2.23857625 19.333333,5 L19.333333,10.2751109 L19.333333,10.2751109"/><path vector-effect="non-scaling-stroke" d="M6.74809447,7.25183654 C6.74809447,6.81652264 6.98227676,6.41486596 7.36108777,6.2003889 C7.73989879,5.98591183 8.2047937,5.99177103 8.57807902,6.21572698 L12.6027714,8.63055693 C12.9667018,8.8489372 13.1893762,9.24224309 13.1893762,9.6666665 C13.1893762,10.0910899 12.9667018,10.4843958 12.6027714,10.7027761 L8.57807902,13.1176664 C8.2047937,13.3416224 7.73989879,13.3474816 7.36108777,13.1330045 C6.98227676,12.9185275 6.74809447,12.5168708 6.74809447,12.0815569 L6.74809447,7.25183654 Z"/></g><g vector-effect="non-scaling-stroke" stroke="currentColor" transform="translate(19 19)"><line vector-effect="non-scaling-stroke" x2="6" y2="6"/><line vector-effect="non-scaling-stroke" x1="6" y2="6"/></g></g></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><g vector-effect="non-scaling-stroke" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><rect vector-effect="non-scaling-stroke" width="17.333" height="17.333" x="6.333" y="6.333" stroke="currentColor" rx="5"/><path vector-effect="non-scaling-stroke" stroke="currentColor" d="M12.3833492,12.83498 C12.3833492,12.4446986 12.5933057,12.0845926 12.9329294,11.8923028 C13.2725531,11.700013 13.6893554,11.7052661 14.024025,11.9060542 L17.63237,14.0710742 C17.9586524,14.2668634 18.1582915,14.6194825 18.1582915,15 C18.1582915,15.3805175 17.9586524,15.7331366 17.63237,15.9289258 L14.024025,18.094 C13.6893554,18.2947881 13.2725531,18.3000412 12.9329294,18.1077514 C12.5933057,17.9154616 12.3833492,17.5553556 12.3833492,17.1650742 L12.3833492,12.83498 Z"/></g></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><g vector-effect="non-scaling-stroke" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><rect vector-effect="non-scaling-stroke" width="19.333" height="19.333" x="5.333" y="5.333" stroke="currentColor" rx="5"/><path vector-effect="non-scaling-stroke" stroke="currentColor" d="M12.0814278,12.5851699 C12.0814278,12.149856 12.3156101,11.7481993 12.6944211,11.5337222 C13.0732321,11.3192452 13.538127,11.3251044 13.9114124,11.5490603 L17.9361048,13.9638903 C18.3000351,14.1822705 18.5227096,14.5755764 18.5227096,14.9999998 C18.5227096,15.4244232 18.3000351,15.8177291 17.9361048,16.0361094 L13.9114124,18.4509998 C13.538127,18.6749557 13.0732321,18.6808149 12.6944211,18.4663379 C12.3156101,18.2518608 12.0814278,17.8502041 12.0814278,17.4148902 L12.0814278,12.5851699 Z"/></g></svg>
@@ -4,15 +4,18 @@
4
4
  :class="[
5
5
  active ? 'active' : '',
6
6
  hasLabel,
7
- subtle ? 'subtle' : ''
7
+ subtle ? 'subtle' : '',
8
+ pale ? 'pale' : '',
9
+ sizeClass
8
10
  ]"
9
11
  :disabled="disabled"
10
12
  @click="$emit('click', $event)"
11
13
  @mouseover="$emit('mouseover', $event)"
12
14
  @mouseleave="$emit('mouseleave', $event)">
13
15
 
14
- <ecs-icon v-if="icon" :type="icon" width="20" height="20" />
15
- <div v-if="label != null">{{ label }}</div>
16
+ <ecs-icon v-if="icon" :type="icon" :width="iconSize" :height="iconSize" />
17
+ <div v-if="label != null" class="button-label">{{ label }}</div>
18
+ <div v-if="chevron" class="chevron" :class="active ? 'expand' : ''" />
16
19
  </button>
17
20
  </template>
18
21
 
@@ -30,6 +33,15 @@
30
33
  type: Boolean,
31
34
  default: false
32
35
  },
36
+ pale: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ size: {
41
+ type: String,
42
+ validator: v => ['md', 'sml', null].includes(v),
43
+ default: 'md'
44
+ },
33
45
  icon: {
34
46
  type: String
35
47
  },
@@ -39,6 +51,10 @@
39
51
  disabled: {
40
52
  type: Boolean,
41
53
  default: false
54
+ },
55
+ chevron: {
56
+ type: Boolean,
57
+ default: false
42
58
  }
43
59
  },
44
60
 
@@ -47,6 +63,19 @@
47
63
  if (this.label && this.label !== '' || this.label != null)
48
64
  return `has-label`
49
65
  return this.label
66
+ },
67
+
68
+ sizeClass() {
69
+ if (this.size && this.size !== '')
70
+ return `ecs-button-table-${this.size}`
71
+ return this.size
72
+ },
73
+
74
+ iconSize() {
75
+ if (this.size == 'sml')
76
+ return '16'
77
+ else
78
+ return '20'
50
79
  }
51
80
  }
52
81
  }
@@ -63,24 +92,53 @@
63
92
  background: rgba($gray-7, .1);
64
93
  color: $gray-14;
65
94
  transition: .2s;
66
- font-size: 14px;
67
- padding: 1px;
68
95
  cursor: pointer;
69
96
  position: relative;
70
97
  z-index: 1;
71
98
  flex-shrink: 0;
72
99
 
100
+ &-md{
101
+ font-size: 14px;
102
+ padding: 1px;
103
+ height: 22px;
104
+
105
+ .button-label{
106
+ padding: 0 6px;
107
+ }
108
+
109
+ &.has-label{
110
+ padding: 4px;
111
+ height: 28px;
112
+ }
113
+ }
114
+
115
+ &-sml{
116
+ padding: 2px;
117
+ font-size: 12px;
118
+ height: 20px;
119
+
120
+ .button-label{
121
+ padding: 0 4px;
122
+ }
123
+ }
124
+
73
125
  .icon{
74
126
  color: $gray-8;
75
127
  transition: .2s;
76
128
  }
77
129
 
78
- > div{
79
- padding: 0 6px;
80
- }
130
+ .chevron{
131
+ width: 16px;
132
+ height: 16px;
133
+ background: svg-uri('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><polyline fill="none" stroke="#858E9E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" points="-2 2 2 6 6 2" transform="rotate(-90 7.2 3.2)"/></svg>');
134
+ transition: .2s;
135
+ opacity: .6;
136
+ margin: 0 -1px 0 -2px;
81
137
 
82
- &.has-label{
83
- padding: 4px;
138
+ &.expand{
139
+ transform: rotate(90deg);
140
+ opacity: 1;
141
+ }
84
142
  }
85
143
 
86
144
  &.subtle{
@@ -128,6 +186,33 @@
128
186
  }
129
187
  }
130
188
 
189
+ &.pale{
190
+ color: $gray-10;
191
+ background: rgba($gray-7, .08);
192
+
193
+ .icon{
194
+ color: $gray-6;
195
+ }
196
+
197
+ &:hover{
198
+ color: $gray-11;
199
+ background: rgba($gray-7, .14);
200
+
201
+ .icon{
202
+ color: $gray-7;
203
+ }
204
+ }
205
+
206
+ &.active{
207
+ background: rgba($gray-8, .16);
208
+ color: $gray-11;
209
+
210
+ .icon{
211
+ color: $gray-7;
212
+ }
213
+ }
214
+ }
215
+
131
216
  &:disabled{
132
217
  opacity: .5;
133
218
  cursor: default;
@@ -5,6 +5,7 @@
5
5
  $slots.actions ? 'ecs-data-card-hover' : '',
6
6
  hover ? 'ecs-data-card-hover' : '',
7
7
  active ? 'active' : '',
8
+ isExpanded ? 'expanded' : '',
8
9
  loading ? 'loading' : ''
9
10
  ]">
10
11
 
@@ -24,6 +25,7 @@
24
25
  <div v-if="$slots.actions" class="ecs-data-card-actions">
25
26
  <slot name="actions"></slot>
26
27
  </div>
28
+ <ecs-button-table @click="isExpanded = !isExpanded" v-if="expandable" pale chevron size="sml" :active="isExpanded" :icon="expandIcon" :label="expandLabel" class="expand-button" />
27
29
  </div>
28
30
  <div v-if="$slots.meta" class="ecs-data-card-row">
29
31
  <div class="ecs-data-card-row-inner">
@@ -31,6 +33,11 @@
31
33
  <ecs-skeleton-loader v-if="loading" type="single" :width="skeletonWidth(15, 30)" />
32
34
  </div>
33
35
  </div>
36
+ <div v-if="$slots.expand" v-show="isExpanded" class="ecs-data-card-expand">
37
+ <div class="ecs-data-card-expand-inner">
38
+ <slot name="expand"></slot>
39
+ </div>
40
+ </div>
34
41
  </div>
35
42
  </div>
36
43
  </template>
@@ -38,9 +45,10 @@
38
45
  <script>
39
46
  import EcsIcon from '../icon/icon'
40
47
  import EcsSkeletonLoader from '../skeleton-loader/skeleton-loader'
48
+ import EcsButtonTable from '../button-table/button-table'
41
49
 
42
50
  export default {
43
- components: { EcsIcon, EcsSkeletonLoader },
51
+ components: { EcsIcon, EcsSkeletonLoader, EcsButtonTable },
44
52
 
45
53
  props: {
46
54
  icon: {
@@ -68,6 +76,26 @@
68
76
  spinning: {
69
77
  type: Boolean,
70
78
  default: false
79
+ },
80
+ expandable: {
81
+ type: Boolean,
82
+ default: false
83
+ },
84
+ expanded: {
85
+ type: Boolean,
86
+ default: false
87
+ },
88
+ expandIcon: {
89
+ type: String
90
+ },
91
+ expandLabel: {
92
+ type: String
93
+ }
94
+ },
95
+
96
+ data () {
97
+ return {
98
+ isExpanded: this.expanded
71
99
  }
72
100
  },
73
101
 
@@ -121,6 +149,10 @@
121
149
  background: rgba($gray-8, .04);
122
150
  }
123
151
 
152
+ &.expanded{
153
+ background: $gray-1;
154
+ }
155
+
124
156
  &.active{
125
157
  background: rgba(#0661EB, .05);
126
158
  cursor: default;
@@ -184,6 +216,16 @@
184
216
  }
185
217
  }
186
218
 
219
+ &-expand{
220
+ padding-top: 12px;
221
+
222
+ &-inner{
223
+ background: #FFF;
224
+ border: 1px solid $gray-3;
225
+ border-radius: 4px;
226
+ }
227
+ }
228
+
187
229
  .small{
188
230
  font-size: 12px;
189
231
  }
@@ -235,6 +277,10 @@
235
277
  color: $gray-10;
236
278
  }
237
279
 
280
+ .expand-button{
281
+ margin-left: 8px;
282
+ }
283
+
238
284
  .chained{
239
285
  display: inline-flex;
240
286
 
@@ -5,7 +5,7 @@
5
5
  indentation,
6
6
  headlineIndentation]">
7
7
 
8
- <h3 v-if="title" class="ecs-section-headline" :class="[headlineBold ? 'ecs-headline-section-bold' : 'ecs-headline-section', hasControls]">
8
+ <h3 v-if="title" class="ecs-section-headline" :class="[headlineBold ? 'ecs-headline-section-bold' : 'ecs-headline-section', $slots.controls ? 'has-buttons' : '']">
9
9
  {{title}}
10
10
  <div v-if="$slots.controls" class="ecs-section-controls">
11
11
  <slot name="controls"></slot>
@@ -46,11 +46,6 @@
46
46
  },
47
47
 
48
48
  computed: {
49
- hasControls () {
50
- if (!!this.$slots['controls'])
51
- return 'has-buttons'
52
- },
53
-
54
49
  indentation() {
55
50
  if (this.indent && this.indent !== '')
56
51
  return `ecs-section-indent-${this.indent}`
@@ -35,6 +35,21 @@
35
35
  }
36
36
  }
37
37
 
38
+ &-selected{
39
+ background: rgba($blue-10, .1);
40
+
41
+ .ecs-fade-escape{
42
+ &:before{
43
+ opacity: 1;
44
+ background: linear-gradient(to right, rgba(242,247,254,0) 0%, rgba(242,247,254,1) 60%, rgba(242,247,254,1) 100%);
45
+ }
46
+
47
+ &:after{
48
+ opacity: 0;
49
+ }
50
+ }
51
+ }
52
+
38
53
  &-add{
39
54
  background: #F2FBF5;
40
55
 
@@ -14,11 +14,14 @@
14
14
  :collapsed="!isVisible"
15
15
  @click="toggleCollapse" />
16
16
 
17
- <ecs-icon v-if="icon" :type="icon" :color="iconColor" />
17
+ <ecs-icon v-if="icon" :type="icon" :color="iconColor" :width="iconSize" :height="iconSize" />
18
18
  <span class="title">
19
19
  <slot></slot>
20
20
  </span>
21
21
  <span v-if="count" class="after small subtle">{{count}}</span>
22
+ <div v-if="$slots.actions" class="ecs-tree-view-entry-actions">
23
+ <slot name="actions"></slot>
24
+ </div>
22
25
  </div>
23
26
  <div v-if="$slots.collapse" :class="isVisible ? 'collapse-show' : 'collapse-hide'">
24
27
  <slot name="collapse"></slot>
@@ -58,7 +61,7 @@
58
61
  },
59
62
  state: {
60
63
  type: String,
61
- validator: v => ['active', 'shadow', 'add', 'null', null].includes(v),
64
+ validator: v => ['active', 'shadow', 'add', 'selected', 'hover', 'null', null].includes(v),
62
65
  default: null
63
66
  },
64
67
  selectable: {
@@ -92,6 +95,12 @@
92
95
  return `color-${this.iconColor}`
93
96
  return this.iconColor
94
97
  },
98
+ iconSize() {
99
+ if (this.large == true)
100
+ return '30'
101
+ else
102
+ return '20'
103
+ },
95
104
  stateClass() {
96
105
  if (this.state && this.state !== '')
97
106
  return `ecs-state-${this.state}`
@@ -121,9 +130,6 @@
121
130
  .ecs-tree-view-entry{
122
131
  display: flex;
123
132
  align-items: center;
124
- -webkit-user-select: none;
125
- -moz-user-select: none;
126
- -ms-user-select: none;
127
133
  user-select: none;
128
134
  transition: .1s;
129
135
  font-size: 13px;
@@ -175,10 +181,6 @@
175
181
  line-height: 30px;
176
182
  }
177
183
 
178
- i[class*="icon-"]{
179
- margin-right: -4px;
180
- }
181
-
182
184
  .ecs-form-check{
183
185
  margin-bottom: 0;
184
186
  padding-left: 2px;
@@ -7,7 +7,12 @@ export default {
7
7
 
8
8
  export const text = () => ({
9
9
  components: { EcsButtonTable },
10
- template: `<ecs-button-table icon="parties" label="5"></ecs-button-table>`,
10
+ template: `<main>
11
+ <ecs-button-table size="md" icon="parties" label="5" />
12
+ <ecs-button-table size="sml" icon="parties" label="5" />
13
+ <ecs-button-table size="md" chevron pale icon="parties" label="5" />
14
+ <ecs-button-table size="sml" chevron pale icon="parties" label="5" active />
15
+ </main>`,
11
16
  });
12
17
 
13
18
  export const iconOnly = () => ({
@@ -21,7 +21,10 @@ Add text (usually a count) by using the `label` attribute. An icon should always
21
21
  </Canvas>
22
22
 
23
23
  ```js
24
- <ecs-button-table icon="parties" label="4"></ecs-button-table>
24
+ <ecs-button-table size="md" icon="parties" label="5" />
25
+ <ecs-button-table size="sml" icon="parties" label="5" />
26
+ <ecs-button-table size="md" chevron pale icon="parties" label="5" />
27
+ <ecs-button-table size="sml" chevron pale icon="parties" label="5" active />
25
28
  ```
26
29
 
27
30
  ## Icon Only
@@ -50,4 +53,4 @@ Add text (usually a count) by using the `label` attribute. An icon should always
50
53
 
51
54
  ## Props and Events
52
55
 
53
- <ArgsTable of={EcsButtonTable} />
56
+ <ArgsTable of={EcsButtonTable} />
@@ -132,6 +132,20 @@ export const doubleAction = () => ({
132
132
  </ecs-data-card>`
133
133
  });
134
134
 
135
+ export const expandable = () => ({
136
+ components: { EcsDataCard, EcsButtonMore },
137
+ template: `<ecs-data-card expandable expand-icon="link" expand-label="2">
138
+ <span>Added last 2 months</span>
139
+ <span class="subtle">4h ago</span>
140
+ <template slot="meta">
141
+ <span class="subtle"><span class="color-venta-1">32 documents</span> added by Marie Walsh</span>
142
+ </template>
143
+ <template slot="expand">
144
+ test
145
+ </template>
146
+ </ecs-data-card>`
147
+ });
148
+
135
149
  export const loading = () => ({
136
150
  components: { EcsDataCardList, EcsDataCard },
137
151
  template: `<ecs-data-card-list>
@@ -200,6 +200,16 @@ The `control` prop and slot allows to show a simple control (checkbox, radiobutt
200
200
  </ecs-data-card-list>
201
201
  ```
202
202
 
203
+ ### Expandable Area
204
+
205
+ The `expand` slot allows you to add an expandable area to the data card. Please note that if the expand slot is used, the props `expandable` (bool), `expandIcon` (String, icon for expand button) and `expandLabel` (String, label for expand button) will be required.
206
+
207
+ <Canvas withSource="none" withToolbar={true}>
208
+ <Story name="Expandable" height="200px">
209
+ {stories.expandable()}
210
+ </Story>
211
+ </Canvas>
212
+
203
213
  ### Loading States
204
214
 
205
215
  Add a dynamic skeleton loading state to each data card by using the `loading` attribute. Note that this requires content within the data card, so if no content exists yet, you need to place some text as a placeholder.
@@ -45,9 +45,18 @@ export const treeListItemSizes = () => ({
45
45
  export const treeListItemStates = () => ({
46
46
  components: { EcsTreeListItem, EcsTreeList },
47
47
  template: `<ecs-tree-list>
48
- <ecs-tree-list-item :count="13" state="null" class="mb-1">
48
+ <ecs-tree-list-item :count="13" class="mb-1">
49
49
  Default
50
50
  </ecs-tree-list-item>
51
+ <ecs-tree-list-item :count="13" state="hover" class="mb-1">
52
+ Hover
53
+ </ecs-tree-list-item>
54
+ <ecs-tree-list-item :count="13" selectable class="mb-1">
55
+ Selectable
56
+ </ecs-tree-list-item>
57
+ <ecs-tree-list-item :count="13" selectable state="selected" class="mb-1">
58
+ Selected
59
+ </ecs-tree-list-item>
51
60
  <ecs-tree-list-item :count="13" state="active" class="mb-1">
52
61
  Active
53
62
  </ecs-tree-list-item>