@everchron/ec-shards 0.6.75 → 0.6.79
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/dist/ec-shards.common.js +207 -118
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +207 -118
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +2 -2
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/automation.svg +1 -0
- package/src/components/button-table/button-table.vue +95 -10
- package/src/components/data-card/data-card.vue +47 -1
- package/src/components/section/section.vue +1 -6
- package/src/components/states/states.vue +15 -0
- package/src/components/tree-list-item/tree-list-item.vue +38 -11
- package/src/stories/button-table/button-table.stories.js +6 -1
- package/src/stories/button-table/button-table.stories.mdx +5 -2
- package/src/stories/data-card/data-card.stories.js +14 -0
- package/src/stories/data-card/data-card.stories.mdx +10 -0
- package/src/stories/tree-list-item/tree-list-item.stories.js +29 -1
- package/src/stories/tree-list-item/tree-list-item.stories.mdx +22 -1
package/package.json
CHANGED
|
@@ -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>
|
|
@@ -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="
|
|
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
|
-
|
|
79
|
-
|
|
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
|
-
|
|
83
|
-
|
|
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',
|
|
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
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
selectable ? 'selectable' : '',
|
|
6
6
|
draggable ? 'draggable' : '',
|
|
7
7
|
large ? 'ecs-tree-view-entry-lg' : '',
|
|
8
|
+
actionsOnHover ? 'actions-hover' : '',
|
|
8
9
|
stateClass
|
|
9
10
|
]">
|
|
10
11
|
|
|
@@ -14,11 +15,14 @@
|
|
|
14
15
|
:collapsed="!isVisible"
|
|
15
16
|
@click="toggleCollapse" />
|
|
16
17
|
|
|
17
|
-
<ecs-icon v-if="icon" :type="icon" :color="iconColor" />
|
|
18
|
-
<span class="title">
|
|
18
|
+
<ecs-icon v-if="icon" :type="icon" :color="iconColor" :width="iconSize" :height="iconSize" />
|
|
19
|
+
<span @click="$emit('click', $event)" class="title">
|
|
19
20
|
<slot></slot>
|
|
20
21
|
</span>
|
|
21
22
|
<span v-if="count" class="after small subtle">{{count}}</span>
|
|
23
|
+
<div v-if="$slots.actions" class="ecs-tree-view-entry-actions">
|
|
24
|
+
<slot name="actions"></slot>
|
|
25
|
+
</div>
|
|
22
26
|
</div>
|
|
23
27
|
<div v-if="$slots.collapse" :class="isVisible ? 'collapse-show' : 'collapse-hide'">
|
|
24
28
|
<slot name="collapse"></slot>
|
|
@@ -58,7 +62,7 @@
|
|
|
58
62
|
},
|
|
59
63
|
state: {
|
|
60
64
|
type: String,
|
|
61
|
-
validator: v => ['active', 'shadow', 'add', 'null', null].includes(v),
|
|
65
|
+
validator: v => ['active', 'shadow', 'add', 'selected', 'hover', 'null', null].includes(v),
|
|
62
66
|
default: null
|
|
63
67
|
},
|
|
64
68
|
selectable: {
|
|
@@ -72,7 +76,11 @@
|
|
|
72
76
|
draggable: {
|
|
73
77
|
type: Boolean,
|
|
74
78
|
default: false
|
|
75
|
-
}
|
|
79
|
+
},
|
|
80
|
+
actionsOnHover: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
76
84
|
},
|
|
77
85
|
|
|
78
86
|
data () {
|
|
@@ -92,6 +100,12 @@
|
|
|
92
100
|
return `color-${this.iconColor}`
|
|
93
101
|
return this.iconColor
|
|
94
102
|
},
|
|
103
|
+
iconSize() {
|
|
104
|
+
if (this.large == true)
|
|
105
|
+
return '30'
|
|
106
|
+
else
|
|
107
|
+
return '20'
|
|
108
|
+
},
|
|
95
109
|
stateClass() {
|
|
96
110
|
if (this.state && this.state !== '')
|
|
97
111
|
return `ecs-state-${this.state}`
|
|
@@ -121,9 +135,6 @@
|
|
|
121
135
|
.ecs-tree-view-entry{
|
|
122
136
|
display: flex;
|
|
123
137
|
align-items: center;
|
|
124
|
-
-webkit-user-select: none;
|
|
125
|
-
-moz-user-select: none;
|
|
126
|
-
-ms-user-select: none;
|
|
127
138
|
user-select: none;
|
|
128
139
|
transition: .1s;
|
|
129
140
|
font-size: 13px;
|
|
@@ -148,6 +159,21 @@
|
|
|
148
159
|
}
|
|
149
160
|
}
|
|
150
161
|
|
|
162
|
+
&.ecs-state-hover{
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&.actions-hover{
|
|
167
|
+
.ecs-tree-view-entry-actions{
|
|
168
|
+
opacity: 0;
|
|
169
|
+
transition: .2s;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:hover .ecs-tree-view-entry-actions{
|
|
173
|
+
opacity: 1;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
151
177
|
&.active{
|
|
152
178
|
background: rgba(#0661EB, .06);
|
|
153
179
|
}
|
|
@@ -175,10 +201,6 @@
|
|
|
175
201
|
line-height: 30px;
|
|
176
202
|
}
|
|
177
203
|
|
|
178
|
-
i[class*="icon-"]{
|
|
179
|
-
margin-right: -4px;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
204
|
.ecs-form-check{
|
|
183
205
|
margin-bottom: 0;
|
|
184
206
|
padding-left: 2px;
|
|
@@ -197,6 +219,11 @@
|
|
|
197
219
|
overflow: hidden;
|
|
198
220
|
white-space: nowrap;
|
|
199
221
|
margin-left: 6px;
|
|
222
|
+
flex: 1;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&-actions{
|
|
226
|
+
margin-left: auto;
|
|
200
227
|
}
|
|
201
228
|
|
|
202
229
|
.after{
|
|
@@ -7,7 +7,12 @@ export default {
|
|
|
7
7
|
|
|
8
8
|
export const text = () => ({
|
|
9
9
|
components: { EcsButtonTable },
|
|
10
|
-
template: `<
|
|
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="
|
|
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.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EcsTreeListItem from '@components/tree-list-item/tree-list-item'
|
|
2
2
|
import EcsTreeList from '@components/tree-list/tree-list'
|
|
3
|
+
import EcsButton from '@components/button/button'
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
title: 'Content Structures/Tree List Item',
|
|
@@ -45,9 +46,18 @@ export const treeListItemSizes = () => ({
|
|
|
45
46
|
export const treeListItemStates = () => ({
|
|
46
47
|
components: { EcsTreeListItem, EcsTreeList },
|
|
47
48
|
template: `<ecs-tree-list>
|
|
48
|
-
<ecs-tree-list-item :count="13"
|
|
49
|
+
<ecs-tree-list-item :count="13" class="mb-1">
|
|
49
50
|
Default
|
|
50
51
|
</ecs-tree-list-item>
|
|
52
|
+
<ecs-tree-list-item :count="13" state="hover" class="mb-1">
|
|
53
|
+
Hover
|
|
54
|
+
</ecs-tree-list-item>
|
|
55
|
+
<ecs-tree-list-item :count="13" selectable class="mb-1">
|
|
56
|
+
Selectable
|
|
57
|
+
</ecs-tree-list-item>
|
|
58
|
+
<ecs-tree-list-item :count="13" selectable state="selected" class="mb-1">
|
|
59
|
+
Selected
|
|
60
|
+
</ecs-tree-list-item>
|
|
51
61
|
<ecs-tree-list-item :count="13" state="active" class="mb-1">
|
|
52
62
|
Active
|
|
53
63
|
</ecs-tree-list-item>
|
|
@@ -83,3 +93,21 @@ export const treeListItemDraggable = () => ({
|
|
|
83
93
|
</ecs-tree-list-item>
|
|
84
94
|
</ecs-tree-list>`,
|
|
85
95
|
});
|
|
96
|
+
|
|
97
|
+
export const treeListItemActions = () => ({
|
|
98
|
+
components: { EcsTreeListItem, EcsTreeList, EcsButton },
|
|
99
|
+
template: `<ecs-tree-list>
|
|
100
|
+
<ecs-tree-list-item state="hover">
|
|
101
|
+
Actions (always visible)
|
|
102
|
+
<template slot="actions">
|
|
103
|
+
<ecs-button size="xsml" icon="link-remove" icon-only />
|
|
104
|
+
</template>
|
|
105
|
+
</ecs-tree-list-item>
|
|
106
|
+
<ecs-tree-list-item state="hover" actions-on-hover>
|
|
107
|
+
Actions (on hover)
|
|
108
|
+
<template slot="actions">
|
|
109
|
+
<ecs-button size="xsml" icon="link-remove" icon-only />
|
|
110
|
+
</template>
|
|
111
|
+
</ecs-tree-list-item>
|
|
112
|
+
</ecs-tree-list>`,
|
|
113
|
+
});
|
|
@@ -143,6 +143,27 @@ If a tree view item can be dragged, set the `draggable` attribute. This will add
|
|
|
143
143
|
</ecs-tree-list>
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
## Actions
|
|
147
|
+
|
|
148
|
+
If a tree view item has any additional controls or action buttons, use the `actions` slot.
|
|
149
|
+
|
|
150
|
+
<Canvas withSource="none" withToolbar={true}>
|
|
151
|
+
<Story name="Tree List Item Actions" height="80px">
|
|
152
|
+
{stories.treeListItemActions()}
|
|
153
|
+
</Story>
|
|
154
|
+
</Canvas>
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
<ecs-tree-list>
|
|
158
|
+
<ecs-tree-list-item>
|
|
159
|
+
Draggable List Item
|
|
160
|
+
<template slot="actions">
|
|
161
|
+
<ecs-button size="xsml" icon="link-break" icon-only />
|
|
162
|
+
</template>
|
|
163
|
+
</ecs-tree-list-item>
|
|
164
|
+
</ecs-tree-list>
|
|
165
|
+
```
|
|
166
|
+
|
|
146
167
|
## Props, Slots and Events
|
|
147
168
|
|
|
148
|
-
<ArgsTable of={EcsTreeListItem} />
|
|
169
|
+
<ArgsTable of={EcsTreeListItem} />
|