@everchron/ec-shards 0.7.58 → 0.7.61

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.58",
3
+ "version": "0.7.61",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
 
18
18
  <div :class="isVisible ? 'collapse-show' : 'collapse-hide'" :id="`collapse-${ this.id }`" class="collapse">
19
- <div class="ecs-collapsable-content">
19
+ <div class="ecs-collapsable-content" :class="[condensed ? 'condensed' : '']">
20
20
  <slot></slot>
21
21
  </div>
22
22
  </div>
@@ -69,6 +69,10 @@ export default {
69
69
  persist: {
70
70
  type: Boolean,
71
71
  default: true
72
+ },
73
+ condensed: {
74
+ type: Boolean,
75
+ default: false
72
76
  }
73
77
  },
74
78
 
@@ -213,6 +217,11 @@ export default {
213
217
  &-content{
214
218
  padding-top: 15px;
215
219
  padding-bottom: 25px;
220
+
221
+ &.condensed{
222
+ padding-top: 5px;
223
+ padding-bottom: 15px;
224
+ }
216
225
  }
217
226
 
218
227
  &-indent-md,
@@ -259,7 +268,12 @@ export default {
259
268
  padding-left: 15px;
260
269
  padding-right: 15px;
261
270
  padding-top: 10px;
262
- padding-bottom: 20px
271
+ padding-bottom: 20px;
272
+
273
+ &.condensed{
274
+ padding-top: 5px;
275
+ padding-bottom: 15px;
276
+ }
263
277
  }
264
278
  }
265
279
  }
@@ -1,17 +1,23 @@
1
1
  <template>
2
2
  <div class="ecs-collection-control" :class="[
3
3
  noBorder ? '' : 'bordered',
4
- isVisible ? '' : 'collapsed',
4
+ isVisible || nonInteractive ? '' : 'collapsed',
5
5
  size
6
6
  ]">
7
- <div @click="toggleCollapse" class="ecs-collection-control-header" :class="isVisible ? '' : 'collapsed'">
7
+ <div @click="toggleCollapse" class="ecs-collection-control-header" :class="[
8
+ isVisible || nonInteractive ? '' : 'collapsed',
9
+ nonInteractive ? '' : 'interactive',
10
+ ]">
8
11
  <ecs-icon v-if="icon" :type="icon" color="#858E9E" :width="iconSize" :height="iconSize" />
9
12
  <div class="description" v-if="label">{{ label }}</div>
10
- <div class="collection" :title="fullTooltip">
13
+ <div class="collection"
14
+ @mouseover="toggleTooltip"
15
+ @mouseleave="toggleTooltip"
16
+ :title="fullTooltip">
11
17
  <span v-for="item in collection" :key="item.name" v-if="item.value">{{ item.name }}</span>
12
18
  </div>
13
19
  </div>
14
- <div :class="isVisible ? 'collapse-show' : 'collapse-hide'" class="collapse">
20
+ <div :class="isVisible || nonInteractive ? 'collapse-show' : 'collapse-hide'" class="collapse">
15
21
  <div class="ecs-collection-control-list scrollbar scrollbar-sml" :style="listMaxHeight">
16
22
  <slot></slot>
17
23
  </div>
@@ -51,6 +57,10 @@
51
57
  maxHeight: {
52
58
  type: Number,
53
59
  default: null
60
+ },
61
+ nonInteractive: {
62
+ type: Boolean,
63
+ default: false
54
64
  }
55
65
  },
56
66
 
@@ -66,8 +76,8 @@
66
76
  },
67
77
 
68
78
  fullTooltip() {
69
- // FIX ME: should only join items that are value true
70
- return this.collection.map(item => item.name).join(', ')
79
+ const filterItems = this.collection.filter(o => o.value)
80
+ return filterItems.map((item) => item.name).join(', ')
71
81
  },
72
82
 
73
83
  listMaxHeight() {
@@ -79,6 +89,10 @@
79
89
  toggleCollapse(){
80
90
  this.isVisible = !this.isVisible
81
91
  this.$emit('toggled', this.id, this.isVisible)
92
+ },
93
+
94
+ toggleTooltip() {
95
+ this.$emit('collectionTooltip', this.fullTooltip)
82
96
  }
83
97
  },
84
98
 
@@ -134,10 +148,13 @@
134
148
  font-size: 14px;
135
149
  line-height: 20px;
136
150
  position: relative;
137
- cursor: pointer;
138
151
  transition: .2s;
139
152
  user-select: none;
140
153
 
154
+ &.interactive{
155
+ cursor: pointer;
156
+ }
157
+
141
158
  &:not(.collapsed){
142
159
  box-shadow: 0 1px 0 0 $gray-3;
143
160
  }
@@ -149,10 +166,15 @@
149
166
  .description{
150
167
  color: $gray-10;
151
168
  margin-right: 4px;
169
+ white-space: nowrap;
152
170
  }
153
171
 
154
172
  .collection{
155
173
  color: $gray-15;
174
+ white-space: nowrap;
175
+ flex: 1;
176
+ overflow: hidden;
177
+ text-overflow: ellipsis;
156
178
 
157
179
  > span:not(:last-child){
158
180
  &:after{
@@ -161,7 +183,7 @@
161
183
  }
162
184
  }
163
185
 
164
- &:after{
186
+ &.interactive:after{
165
187
  content: "";
166
188
  position: absolute;
167
189
  width: 18px;
@@ -174,7 +196,7 @@
174
196
  opacity: .7;
175
197
  }
176
198
 
177
- &.collapsed:after{
199
+ &.interactive.collapsed:after{
178
200
  transform: rotate(-90deg);
179
201
  opacity: 1;
180
202
  }
@@ -125,6 +125,8 @@
125
125
 
126
126
  .ecs-search-group{
127
127
  position: relative;
128
+ display: block;
129
+ width: 100%;
128
130
 
129
131
  .ecs-input-clear{
130
132
  position: absolute;
@@ -64,7 +64,7 @@ $bar-height: 41px;
64
64
  display: flex;
65
65
  align-items: center;
66
66
  width: 100%;
67
- padding: 0 12px;
67
+ padding: 0 12px 0 4px;
68
68
  background: #FFF;
69
69
  height: $bar-height;
70
70
  border-bottom: 1px solid $gray-3;
@@ -50,7 +50,7 @@ export const collectionControlWithoutBorders = () => ({
50
50
  }
51
51
  },
52
52
  template: `<div>
53
- <ecs-collection-control no-border :collection="collection" label="Grant Access:" icon="parties" style="margin-bottom:24px">
53
+ <ecs-collection-control non-interactive no-border :collection="collection" label="Grant Access:" icon="parties" style="margin-bottom:24px">
54
54
  <ecs-popover-list>
55
55
  <ecs-popover-list-item @input="accessToggle" v-for="item in collection" :value="item.value" type="checkbox">{{ item.name }}</ecs-popover-list-item>
56
56
  </ecs-popover-list>
@@ -41,9 +41,10 @@ data() {
41
41
  </div>
42
42
  ```
43
43
 
44
- ## Without Borders
44
+ ## Without Borders and no Interactivity
45
45
 
46
46
  By adding the `no-border` attribute, the border will be removed.
47
+ Sometimes you may want to disable to collapse functionality, this can be done by adding the `non-interactive` attribute.
47
48
 
48
49
  <Canvas withSource="none" withToolbar={true}>
49
50
  <Story name="Collection Control Without Borders" height="240px">