@everchron/ec-shards 5.0.26 → 5.0.28

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": "5.0.26",
3
+ "version": "5.0.28",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -172,6 +172,7 @@
172
172
  .icon{
173
173
  margin-right: .4em;
174
174
  margin-left: -.4em;
175
+ pointer-events: none;
175
176
  }
176
177
 
177
178
  &-icon-only{
@@ -25,8 +25,10 @@
25
25
  </script>
26
26
 
27
27
  <style lang="scss" scoped>
28
+ @import "../../tokens/build/scss/tokens.scss";
29
+
28
30
  .ecs-popover-list{
29
- padding: 10px;
31
+ padding: $spacing-10;
30
32
 
31
33
  li{
32
34
  position: relative;
@@ -35,14 +37,14 @@
35
37
  hr{
36
38
  border: none;
37
39
  border-bottom: 1px solid rgba(133, 142, 158, 0.2);
38
- margin: 10px -10px;
40
+ margin: $spacing-5 -8px;
39
41
  }
40
42
 
41
43
  &-inner{
42
44
  padding: 0;
43
45
 
44
46
  &::v-deep .ecs-popover-list-item{
45
- padding: 12px 20px;
47
+ padding: $spacing-5 20px;
46
48
  border-radius: 0;
47
49
  }
48
50
  }
@@ -1,6 +1,11 @@
1
1
  <template>
2
- <li :class="[sticky ? 'ecs-popover-list-sticky-title' : 'ecs-popover-list-title']">
3
- <slot></slot>
2
+ <li class="ecs-popover-list-title" :class="[sticky ? 'ecs-popover-list-title-sticky' : 'ecs-popover-list-title-default', sticky && $slots.controls ? 'has-controls' : '']">
3
+ <span>
4
+ <slot></slot>
5
+ </span>
6
+ <div v-if="$slots.controls" class="ecs-popover-list-title-controls">
7
+ <slot name="controls"></slot>
8
+ </div>
4
9
  </li>
5
10
  </template>
6
11
 
@@ -20,28 +25,50 @@
20
25
  @import "../../tokens/build/scss/tokens.scss";
21
26
  @import "../mixins/svg-uri";
22
27
 
23
- .ecs-popover-list{
24
- &-title{
25
- color: $color-gray-8;
26
- font-size: $type-scale-3-font-size;
27
- padding: 13px 12px;
28
- }
28
+ .ecs-popover-list-title{
29
+ display: flex;
30
+ align-items: center;
31
+
32
+ &-default{
33
+ padding: $spacing-10 $spacing-15;
34
+
35
+ &:first-child{
36
+ padding-top: $spacing-5;
37
+ }
29
38
 
30
- li:first-child.ecs-popover-list-title{
31
- padding-top: 5px;
39
+ > span{
40
+ color: $color-gray-8;
41
+ font-size: $type-scale-3-font-size;
42
+ line-height: $type-scale-3-line-height;
43
+ }
32
44
  }
33
45
 
34
- &-sticky-title{
46
+ &-sticky{
35
47
  position: sticky !important;
36
48
  top: 0;
37
49
  background: $color-gray-2;
38
50
  border-top: 1px solid $color-gray-3;
39
- color: $color-gray-9;
40
- font-size: $type-scale-2-font-size;
41
- font-weight: $font-weight-medium;
42
- text-transform: uppercase;
43
51
  z-index: 1;
44
- padding: 7px 20px 8px 20px;
52
+ padding: $spacing-10 $spacing-25;
53
+
54
+ &.has-controls{
55
+ padding: $spacing-5 $spacing-25;
56
+ }
57
+
58
+ > span{
59
+ color: $color-gray-9;
60
+ font-size: $type-scale-2-font-size;
61
+ line-height: $type-scale-2-line-height;
62
+ font-weight: $font-weight-medium;
63
+ text-transform: uppercase;
64
+ }
65
+ }
66
+
67
+ &-controls{
68
+ display: flex;
69
+ align-items: center;
70
+ column-gap: $spacing-5;
71
+ margin-left: auto;
45
72
  }
46
73
  }
47
74
  </style>
@@ -30,7 +30,7 @@
30
30
  </div>
31
31
 
32
32
  <a v-else-if="type === 'link'" @click="$emit('click', $event)" class="ecs-popover-list-item"
33
- :class="[iconClass,
33
+ :class="[
34
34
  danger ? `danger` : '',
35
35
  subtle ? `subtle` : '',
36
36
  disabled ? `disabled` : '',
@@ -38,29 +38,49 @@
38
38
  selected ? `selected` : '']"
39
39
  :href="href">
40
40
 
41
- <ecs-icon v-if="icon" :type="icon" />
41
+ <ecs-icon v-if="icon" :type="icon" size="24" />
42
42
  <ecs-file-icon v-if="fileIcon" :type="fileIcon" />
43
- <slot></slot>
43
+ <span class="text">
44
+ <slot></slot>
45
+ <ecs-button
46
+ v-if="secondaryActionOptions.show"
47
+ @click.stop="handleSecondaryClick"
48
+ @mouseover="preventHover = !preventHover"
49
+ @mouseleave="preventHover = !preventHover"
50
+ size="sml" :type="secondaryActionOptions.type" :icon="secondaryActionOptions.icon" :icon-only="secondaryActionOptions.iconOnly">
51
+ {{ secondaryActionOptions.label }}
52
+ </ecs-button>
53
+ <span v-if="help" class="help">{{help}}</span>
54
+ </span>
44
55
  <span v-if="suffix" class="after">{{suffix}}</span>
45
- <span v-if="help" class="help">{{help}}</span>
46
56
  <ecs-icon v-if="hoverIcon" :type="hoverIcon" class="hover-icon" />
47
57
  </a>
48
58
 
49
59
  <button v-else class="ecs-popover-list-item"
50
- :class="[iconClass,
60
+ :class="[
51
61
  danger ? `danger` : '',
52
62
  subtle ? `subtle` : '',
53
63
  disabled ? `disabled` : '',
54
- noHover ? `no-hover` : '',
64
+ noHover || preventHover ? `no-hover` : '',
55
65
  selected ? `selected` : '']"
56
66
  @click="$emit('click', $event)">
57
67
 
58
- <ecs-icon v-if="icon" :type="icon" />
68
+ <ecs-icon v-if="icon" :type="icon" size="24" />
59
69
  <ecs-file-icon v-if="fileIcon" :type="fileIcon" />
60
- <slot></slot>
70
+ <span class="text">
71
+ <slot></slot>
72
+ <ecs-button
73
+ v-if="secondaryActionOptions.show"
74
+ @click.stop="handleSecondaryClick"
75
+ @mouseover="preventHover = !preventHover"
76
+ @mouseleave="preventHover = !preventHover"
77
+ size="sml" :type="secondaryActionOptions.type" :icon="secondaryActionOptions.icon" :icon-only="secondaryActionOptions.iconOnly">
78
+ {{ secondaryActionOptions.label }}
79
+ </ecs-button>
80
+ <span v-if="help" class="help">{{help}}</span>
81
+ </span>
61
82
  <span v-if="suffix" class="after">{{suffix}}</span>
62
- <span v-if="help" class="help">{{help}}</span>
63
- <ecs-icon v-if="hoverIcon" :type="hoverIcon" class="hover-icon" />
83
+ <ecs-icon v-if="hoverIcon" :type="hoverIcon" size="24" class="hover-icon" />
64
84
  </button>
65
85
  </li>
66
86
  </template>
@@ -72,9 +92,10 @@
72
92
  import EcsSortbutton from '../sortbutton/sortbutton'
73
93
  import EcsIcon from '../icon/icon'
74
94
  import EcsFileIcon from '../file-icon/file-icon'
95
+ import EcsButton from '../button/button'
75
96
 
76
97
  export default {
77
- components: { EcsCheckbox, EcsRadiobutton, EcsSwitch, EcsSortbutton, EcsIcon, EcsFileIcon },
98
+ components: { EcsCheckbox, EcsRadiobutton, EcsSwitch, EcsSortbutton, EcsIcon, EcsFileIcon, EcsButton },
78
99
 
79
100
  props: {
80
101
  /** Determines the type of popover list item.*/
@@ -166,17 +187,46 @@
166
187
  type: String,
167
188
  validator: v => ['ascending', 'descending', null].includes(v),
168
189
  default: null
190
+ },
191
+ /** Adds another small action button inside the popover list item itself, for a secondary action. This is only available for regular list items (**not** sort, checkbox, switch, or radiobutton). */
192
+ secondaryAction: {
193
+ type: Object,
194
+ default () {
195
+ return {
196
+ show: false,
197
+ label: '',
198
+ type: 'secondary',
199
+ icon: null,
200
+ iconOnly: false
201
+ }
202
+ }
203
+ }
204
+ },
205
+
206
+ data() {
207
+ return {
208
+ preventHover : false
169
209
  }
170
210
  },
171
211
 
172
212
  computed: {
173
- iconClass() {
174
- if (this.icon && this.icon !== '' || this.fileIcon && this.fileIcon !== '')
175
- return `has-icon`
176
- else
177
- return
213
+ secondaryActionOptions() {
214
+ return Object.assign({
215
+ show: false,
216
+ label: '',
217
+ type: 'secondary',
218
+ icon: null,
219
+ iconOnly: false
220
+ }, this.secondaryAction);
178
221
  }
179
- }
222
+ },
223
+
224
+ methods : {
225
+ handleSecondaryClick(){
226
+ /** Emitted when the secondary action button is clicked. */
227
+ this.$emit('secondaryClick')
228
+ }
229
+ },
180
230
  }
181
231
  </script>
182
232
 
@@ -199,13 +249,14 @@
199
249
 
200
250
  .ecs-popover-list{
201
251
  &-item{
202
- border-radius: $border-radius-x-small;
252
+ border-radius: $border-radius-small;
203
253
  position: relative;
204
254
  transition: .15s;
205
- display: block;
255
+ display: flex;
256
+ align-items: center;
206
257
  color: $color-gray-13;
207
258
  font-size: $type-scale-3-font-size;
208
- padding: 12px;
259
+ padding: $spacing-5 $spacing-10;
209
260
  width: 100%;
210
261
  text-decoration: none;
211
262
  text-align: left;
@@ -228,21 +279,27 @@
228
279
  pointer-events: none;
229
280
  }
230
281
 
282
+ .text{
283
+ display: flex;
284
+ align-items: center;
285
+ line-height: 24px;
286
+ flex: 1;
287
+ flex-wrap: wrap;
288
+
289
+ .ecs-button{
290
+ margin: -4px 0 -4px 8px;
291
+ }
292
+ }
293
+
231
294
  .icon{
232
- top: 5px;
233
- left: 5px;
234
- position: absolute;
235
295
  color: $color-blue-8;
296
+ margin: 0 10px 0 0px;
236
297
  }
237
298
 
238
299
  &.subtle .icon{
239
300
  color: $color-gray-8;
240
301
  }
241
302
 
242
- &.has-icon{
243
- padding-left: 42px;
244
- }
245
-
246
303
  &.selected{
247
304
  padding-right: 36px;
248
305
 
@@ -259,7 +316,7 @@
259
316
  }
260
317
 
261
318
  &.danger{
262
- &.has-icon .icon{
319
+ .icon{
263
320
  color: $color-gray-8;
264
321
  }
265
322
 
@@ -280,7 +337,7 @@
280
337
  }
281
338
 
282
339
  &.control{
283
- padding: 10px 12px;
340
+ padding: 6px 12px;
284
341
 
285
342
  .ecs-form-check{
286
343
  margin-bottom: 0;
@@ -307,7 +364,6 @@
307
364
  opacity: .4;
308
365
  font-size: $type-scale-2-font-size;
309
366
  line-height: $type-scale-2-line-height;
310
- float: right;
311
367
 
312
368
  &-highlight{
313
369
  opacity: 1;
@@ -317,16 +373,18 @@
317
373
 
318
374
  .help{
319
375
  font-size: $type-scale-2-font-size;
376
+ line-height: $type-scale-2-line-height;
320
377
  opacity: .6;
321
378
  display: block;
322
- margin-top: 4px;
379
+ min-width: 100%;
323
380
  }
324
381
 
325
382
  .icon.hover-icon{
326
383
  position: absolute;
327
- right: 5px;
384
+ right: $spacing-5;
328
385
  left: auto;
329
- top: 5px;
386
+ top: 50%;
387
+ margin-top: -12px;
330
388
  transition: .15s;
331
389
  opacity: 0;
332
390
  }
@@ -28,7 +28,7 @@ import { Meta } from '@storybook/addon-docs/blocks';
28
28
 
29
29
  Reverted all EcsPagination updates and moved these changes to the @next branch, until infinite scroll feature can be implemented. This means 3.2.0 can be used again as a stable release for current application development.
30
30
 
31
- ## Version 3.1.5 (undefined)
31
+ ## Version 3.1.5
32
32
 
33
33
  ### Features
34
34
 
@@ -1,5 +1,6 @@
1
1
  import EcsPopoverListHeadline from '@components/popover-list-headline/popover-list-headline';
2
2
  import EcsPopoverList from '@components/popover-list/popover-list';
3
+ import EcsButton from '@components/button/button';
3
4
 
4
5
  export default {
5
6
  title: 'Action/Popover/Popover List Headline',
@@ -13,9 +14,34 @@ export const popoverListHeadline = () => ({
13
14
  </ecs-popover-list>`,
14
15
  });
15
16
 
17
+ export const popoverListHeadlineWithControls = () => ({
18
+ components: { EcsPopoverListHeadline, EcsPopoverList, EcsButton },
19
+ template: `<ecs-popover-list>
20
+ <ecs-popover-list-headline>
21
+ Headline
22
+ <template slot="controls">
23
+ <ecs-button size="sml" icon="edit">Edit</ecs-button>
24
+ </template>
25
+ </ecs-popover-list-headline>
26
+ </ecs-popover-list>`,
27
+ });
28
+
16
29
  export const popoverListStickyHeadline = () => ({
17
30
  components: { EcsPopoverListHeadline, EcsPopoverList },
18
31
  template: `<ecs-popover-list>
19
32
  <ecs-popover-list-headline sticky>Sticky Headline</ecs-popover-list-headline>
20
33
  </ecs-popover-list>`,
21
34
  });
35
+
36
+ export const popoverListStickyHeadlineWithControls = () => ({
37
+ components: { EcsPopoverListHeadline, EcsPopoverList, EcsButton },
38
+ template: `<ecs-popover-list>
39
+ <ecs-popover-list-headline sticky>
40
+ Sticky Headline
41
+ <template slot="controls">
42
+ <ecs-button size="sml" type="secondary" icon="edit">Edit</ecs-button>
43
+ <ecs-button size="sml" icon="add-plus">Add</ecs-button>
44
+ </template>
45
+ </ecs-popover-list-headline>
46
+ </ecs-popover-list>`,
47
+ });
@@ -17,6 +17,7 @@ export const popoverListItemHelpText = () => ({
17
17
  components: { EcsPopoverListItem, EcsPopoverList },
18
18
  template: `<ecs-popover-list>
19
19
  <ecs-popover-list-item help="Helper Text">List Item</ecs-popover-list-item>
20
+ <ecs-popover-list-item icon="help" help="Helper Text">List Item</ecs-popover-list-item>
20
21
  </ecs-popover-list>`,
21
22
  });
22
23
 
@@ -31,6 +32,7 @@ export const popoverListItemIcon = () => ({
31
32
  components: { EcsPopoverListItem, EcsPopoverList },
32
33
  template: `<ecs-popover-list>
33
34
  <ecs-popover-list-item file-icon="pdf">List Item Default</ecs-popover-list-item>
35
+ <hr>
34
36
  <ecs-popover-list-item icon="share" subtle selected>List Item Subtle</ecs-popover-list-item>
35
37
  <ecs-popover-list-item icon="delete" danger>List Item Danger</ecs-popover-list-item>
36
38
  <ecs-popover-list-item icon="help" hover-icon="add-plus">List Item Hover Item</ecs-popover-list-item>
@@ -51,3 +53,13 @@ export const popoverListItemControls = () => ({
51
53
  <ecs-popover-list-item type="switch" suffix="TXT">List Item Switch</ecs-popover-list-item>
52
54
  </ecs-popover-list>`,
53
55
  });
56
+
57
+ export const popoverListItemSecondaryAction = () => ({
58
+ components: { EcsPopoverListItem, EcsPopoverList },
59
+ template: `<ecs-popover-list>
60
+ <ecs-popover-list-item :secondaryAction="{show: true, label: 'Edit', icon: 'edit', type: 'primary'}">List Item</ecs-popover-list-item>
61
+ <ecs-popover-list-item :secondaryAction="{show: true, label: 'Edit', icon: 'edit', type: 'primary'}" help="Helper Text">List Item</ecs-popover-list-item>
62
+ <ecs-popover-list-item :secondaryAction="{show: true, label: 'Edit', icon: 'edit', type: 'primary'}" suffix="XLS">List Item</ecs-popover-list-item>
63
+ <ecs-popover-list-item icon="share" :secondaryAction="{show: true, label: 'Edit', icon: 'edit', type: 'primary'}" suffix="XLS">List Item</ecs-popover-list-item>
64
+ </ecs-popover-list>`,
65
+ });