@everchron/ec-shards 4.1.1 → 4.1.2

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": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -56,6 +56,7 @@
56
56
 
57
57
  &.selected{
58
58
  border-bottom-color: $color-blue-3;
59
+ background-color: #F4F9FF;
59
60
 
60
61
  &:hover:before{
61
62
  background-color: $color-blue-5;
@@ -65,6 +66,7 @@
65
66
 
66
67
  &.opened{
67
68
  border-bottom-color: $color-blue-3;
69
+ background-color: $color-blue-2;
68
70
 
69
71
  &:hover:before{
70
72
  background-color: $color-blue-5;
@@ -78,6 +80,7 @@
78
80
 
79
81
  &.droppable{
80
82
  border-bottom-color: $color-green-4;
83
+ background-color: $color-green-2;
81
84
  cursor: copy;
82
85
 
83
86
  &:hover:before{
@@ -97,4 +100,3 @@
97
100
  }
98
101
  }
99
102
  </style>
100
-
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="ecs-data-grid scrollbar" :class="$slots.empty ? 'empty' : ' '">
3
- <div class="ecs-data-grid-head">
3
+ <div class="ecs-data-grid-head" :class="sidebarOverlay ? 'sidebar-space' : ''">
4
4
  <!-- @slot Slot for the table head row cells. -->
5
5
  <slot name="head"></slot>
6
6
  </div>
@@ -10,7 +10,7 @@
10
10
  <slot name="empty"></slot>
11
11
  </div>
12
12
 
13
- <div v-else class="ecs-data-grid-rows" :class="striped ? 'striped' : ''">
13
+ <div v-else class="ecs-data-grid-rows" :class="[striped ? 'striped' : '', sidebarOverlay ? 'sidebar-space' : '']">
14
14
  <!-- @slot Default slot for the table rows. -->
15
15
  <slot></slot>
16
16
  </div>
@@ -24,6 +24,11 @@
24
24
  striped: {
25
25
  type: Boolean,
26
26
  default: true
27
+ },
28
+ /** If there is a sidebar overlaying this table, use this prop to add some forced padding on the right side, to avoid the sidebar blocking any actual content of the table rows. */
29
+ sidebarOverlay: {
30
+ type: Boolean,
31
+ default: false
27
32
  }
28
33
  },
29
34
 
@@ -72,16 +77,38 @@
72
77
  position: sticky;
73
78
  top: 0;
74
79
  box-shadow: 0 1px 0 rgba($color-gray-6, .4);
80
+
81
+ &.sidebar-space{
82
+ padding-right: 54px;
83
+ }
75
84
  }
76
85
 
77
86
  &-rows{
78
87
  flex: 1;
79
88
  min-width: fit-content;
89
+
90
+ &.sidebar-space .ecs-data-grid-row{
91
+ padding-right: 54px;
92
+ }
80
93
  }
81
94
 
82
95
  &-empty{
83
96
  flex: 1;
84
97
  }
85
98
  }
99
+
100
+ .ecs-data-grid-rows.striped{
101
+ .ecs-data-grid-row.default:nth-child(even){
102
+ background-color: #FBFBFC;
103
+ }
104
+
105
+ .ecs-data-grid-row.added:nth-child(even){
106
+ animation: highlight-to-gray 8s ease forwards;
107
+ }
108
+
109
+ .ecs-data-grid-row.added:nth-child(odd){
110
+ animation: highlight-to-white 8s ease forwards;
111
+ }
112
+ }
86
113
  </style>
87
114
 
@@ -13,7 +13,7 @@ export default {
13
13
  export const states = () => ({
14
14
  components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell },
15
15
  template: `<div style="width: 100%; height: 500px">
16
- <ecs-data-grid striped>
16
+ <ecs-data-grid striped sidebar-overlay>
17
17
  <template slot="head">
18
18
  <ecs-data-grid-head-cell name="First Column" :width="400" fixed-left fixed-left-last />
19
19
  <ecs-data-grid-head-cell name="Second Column" :width="500" />
@@ -68,7 +68,7 @@ export const newRowStates = () => ({
68
68
  template: `<div style="width: 100%; height: 400px">
69
69
  <ecs-button @click="addRows" style="position:absolute; bottom: 16px; left: 16px;">Add Rows</ecs-button>
70
70
 
71
- <ecs-data-grid>
71
+ <ecs-data-grid sidebar-overlay>
72
72
  <template slot="head">
73
73
  <ecs-data-grid-head-cell name="First Column" :width="400" fixed-left fixed-left-last />
74
74
  <ecs-data-grid-head-cell name="Second Column" :width="500" />
@@ -46,3 +46,22 @@ export const gridStriped = () => ({
46
46
  </ecs-data-grid>
47
47
  </div>`,
48
48
  });
49
+
50
+ export const gridSidebarPadding = () => ({
51
+ components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell },
52
+ template: `<div style="width: 100%; height: 500px">
53
+ <ecs-data-grid striped sidebar-overlay>
54
+ <template slot="head">
55
+ <ecs-data-grid-head-cell name="First Column" :min-width="200" :width="400" fixed-left fixed-left-last />
56
+ <ecs-data-grid-head-cell name="Second Column" :min-width="300" :width="500" />
57
+ <ecs-data-grid-head-cell name="Third Column" :min-width="140" :width="200" />
58
+ </template>
59
+
60
+ <ecs-data-grid-row v-for="index in 100" :key="index">
61
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>First Column</ecs-data-grid-cell>
62
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
63
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
64
+ </ecs-data-grid-row>
65
+ </ecs-data-grid>
66
+ </div>`,
67
+ });