@everchron/ec-shards 7.2.1 → 7.2.3
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 +7843 -2044
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +7840 -2041
- 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/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/images/.DS_Store +0 -0
- package/src/assets/images/dialog-icons/.DS_Store +0 -0
- package/src/assets/images/flags/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/dropzone/dropzone.vue +97 -8
- package/src/components/entry-link/entry-link.vue +1 -1
- package/src/components/sticker/sticker.vue +1 -1
- package/src/components/tab-button/tab-button.vue +9 -8
- package/src/stories/Changelog.stories.mdx +10 -0
- package/src/stories/collection-control/.DS_Store +0 -0
- package/src/stories/comment/.DS_Store +0 -0
- package/src/stories/data-card/.DS_Store +0 -0
- package/src/stories/data-list/.DS_Store +0 -0
- package/src/stories/dialog/.DS_Store +0 -0
- package/src/stories/dialog-header/.DS_Store +0 -0
- package/src/stories/directory-entry/.DS_Store +0 -0
- package/src/stories/document-state/.DS_Store +0 -0
- package/src/stories/dropzone/.DS_Store +0 -0
- package/src/stories/dropzone/dropzone.stories.js +41 -0
- package/src/stories/empty-state/.DS_Store +0 -0
- package/src/stories/excerpt-snippet/.DS_Store +0 -0
- package/src/stories/file-icon/.DS_Store +0 -0
- package/src/stories/file-list-item/.DS_Store +0 -0
- package/src/stories/flag/.DS_Store +0 -0
- package/src/stories/form-group/.DS_Store +0 -0
- package/src/stories/form-headline/.DS_Store +0 -0
- package/src/stories/form-set/.DS_Store +0 -0
- package/src/stories/formatted/.DS_Store +0 -0
- package/src/stories/icon/.DS_Store +0 -0
- package/src/stories/index-toolbar/.DS_Store +0 -0
- package/src/stories/info-tooltip/.DS_Store +0 -0
- package/src/stories/input/.DS_Store +0 -0
- package/src/stories/input-group/.DS_Store +0 -0
- package/src/stories/input-search/.DS_Store +0 -0
- package/src/stories/jumper-document/.DS_Store +0 -0
- package/src/stories/jumper-index/.DS_Store +0 -0
- package/src/stories/jumper-page/.DS_Store +0 -0
- package/src/stories/layout-data-table/.DS_Store +0 -0
- package/src/stories/layout-directory/.DS_Store +0 -0
- package/src/stories/layout-index/.DS_Store +0 -0
- package/src/stories/map/.DS_Store +0 -0
- package/src/stories/modal/.DS_Store +0 -0
- package/src/stories/multiselect-option/.DS_Store +0 -0
- package/src/stories/multiselect-search-token/.DS_Store +0 -0
- package/src/stories/multiselect-token/.DS_Store +0 -0
- package/src/stories/overlay/.DS_Store +0 -0
- package/src/stories/pagination/.DS_Store +0 -0
- package/src/stories/party-entry/.DS_Store +0 -0
- package/src/stories/popover-header/.DS_Store +0 -0
- package/src/stories/popover-list/.DS_Store +0 -0
- package/src/stories/popover-list-headline/.DS_Store +0 -0
- package/src/stories/popover-list-item/.DS_Store +0 -0
- package/src/stories/progress/.DS_Store +0 -0
- package/src/stories/quicklink/.DS_Store +0 -0
- package/src/stories/radiobutton/.DS_Store +0 -0
- package/src/stories/rating-favorability/.DS_Store +0 -0
- package/src/stories/rating-star-read/.DS_Store +0 -0
- package/src/stories/rating-star-write/.DS_Store +0 -0
- package/src/stories/scroll-container/.DS_Store +0 -0
- package/src/stories/section/.DS_Store +0 -0
- package/src/stories/segment/.DS_Store +0 -0
- package/src/stories/select/.DS_Store +0 -0
- package/src/stories/separator/.DS_Store +0 -0
- package/src/stories/sequence-map-button/.DS_Store +0 -0
- package/src/stories/sidebar/.DS_Store +0 -0
- package/src/stories/skeleton-loader/.DS_Store +0 -0
- package/src/stories/sortbutton/.DS_Store +0 -0
- package/src/stories/sticker/.DS_Store +0 -0
- package/src/stories/structured-content/.DS_Store +0 -0
- package/src/stories/switch/.DS_Store +0 -0
- package/src/stories/tabs/.DS_Store +0 -0
- package/src/stories/tag/.DS_Store +0 -0
- package/src/stories/toast/.DS_Store +0 -0
- package/src/stories/transcript-state/.DS_Store +0 -0
- package/src/stories/tree-list/.DS_Store +0 -0
- package/src/stories/video/.DS_Store +0 -0
- package/package-lock.json +0 -21148
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
disabled ? 'ecs-dropzone-disabled' : '',
|
|
6
6
|
dragging ? 'ecs-dropzone-dragging' : ''
|
|
7
7
|
]"
|
|
8
|
-
@
|
|
9
|
-
@
|
|
8
|
+
@dragover="handleDragOver"
|
|
9
|
+
@dragenter="handleDragEnter"
|
|
10
|
+
@dragleave="handleDragLeave"
|
|
10
11
|
@drop.prevent="drop"
|
|
11
|
-
|
|
12
|
-
:aria-busy="loading || progress"
|
|
12
|
+
:aria-busy="isBusy"
|
|
13
13
|
:aria-invalid="error">
|
|
14
14
|
|
|
15
15
|
<input @change="change" type="file" :multiple="multiple" ref="file" />
|
|
@@ -24,10 +24,23 @@
|
|
|
24
24
|
<!-- @slot Slot for a custom main label. Note: this will replace the file selector button as well as drag & drop label. Should only be used for states that do not require a drop action, such as active virus scanning. -->
|
|
25
25
|
<slot name="customlabel"></slot>
|
|
26
26
|
</div>
|
|
27
|
-
<div v-if="$slots.hint" class="ecs-dropzone-hint">
|
|
28
|
-
<!-- @slot Slot for an additional informational label underneath the dropzone text. Can contain basic HTML tags: `a`, `b`, `strong`. -->
|
|
27
|
+
<div v-if="$slots.hint && !uploadStats.show" class="ecs-dropzone-hint">
|
|
28
|
+
<!-- @slot Slot for an additional informational label underneath the dropzone text. Can contain basic HTML tags: `a`, `b`, `strong`. **Note:** the hint is hidden when `uploadStats` are present and shown. -->
|
|
29
29
|
<slot name="hint"></slot>
|
|
30
30
|
</div>
|
|
31
|
+
<!-- Shows when uploadStats show is true.-->
|
|
32
|
+
<div v-if="uploadStats.show" class="ecs-dropzone-stats">
|
|
33
|
+
<ecs-flex-row :gap="8" justify="center">
|
|
34
|
+
<ecs-text v-if="uploadStats.speed > 2000000" type="label" emphasized color="#474B60">Uploading</ecs-text>
|
|
35
|
+
<ecs-flex-row v-else :gap="4" title="Slow network, please check your connection.">
|
|
36
|
+
<ecs-sticker type="warning" />
|
|
37
|
+
<ecs-text type="label" emphasized color="warning">Uploading</ecs-text>
|
|
38
|
+
</ecs-flex-row>
|
|
39
|
+
<span>({{ formattedSpeed }})</span>
|
|
40
|
+
<span>Remaining: {{ uploadStats.timeRemaining }}</span>
|
|
41
|
+
</ecs-flex-row>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
31
44
|
<div v-if="error && errorMessage" class="ecs-dropzone-error-message">{{ errorMessage }}</div>
|
|
32
45
|
</div>
|
|
33
46
|
<ecs-progress v-if="loading || progress" :infinite="!progress" :running="!!progress" :value="progress" />
|
|
@@ -43,6 +56,9 @@
|
|
|
43
56
|
import EcsProgress from '../progress/progress'
|
|
44
57
|
import EcsButton from '../button/button'
|
|
45
58
|
import EcsFocusRing from '../mixins/focus-ring'
|
|
59
|
+
import EcsFlexRow from '../flex/flex-row'
|
|
60
|
+
import EcsSticker from '../sticker/sticker'
|
|
61
|
+
import EcsText from '../text/text'
|
|
46
62
|
|
|
47
63
|
export default {
|
|
48
64
|
components: {
|
|
@@ -50,7 +66,10 @@
|
|
|
50
66
|
EcsSkeletonLoader,
|
|
51
67
|
EcsProgress,
|
|
52
68
|
EcsButton,
|
|
53
|
-
EcsFocusRing
|
|
69
|
+
EcsFocusRing,
|
|
70
|
+
EcsFlexRow,
|
|
71
|
+
EcsSticker,
|
|
72
|
+
EcsText
|
|
54
73
|
},
|
|
55
74
|
|
|
56
75
|
props: {
|
|
@@ -108,13 +127,24 @@
|
|
|
108
127
|
icon: 'back'
|
|
109
128
|
}
|
|
110
129
|
}
|
|
130
|
+
},
|
|
131
|
+
/** Shows upload statistics inside the dropzone, while files are uploading. Time remaining must be pre-formatted, as formatting is not handled in the shard component. */
|
|
132
|
+
uploadStats: {
|
|
133
|
+
type: Object,
|
|
134
|
+
default() {
|
|
135
|
+
return {
|
|
136
|
+
show: false,
|
|
137
|
+
speed: 0,
|
|
138
|
+
timeRemaining: ''
|
|
139
|
+
}
|
|
140
|
+
}
|
|
111
141
|
}
|
|
112
142
|
},
|
|
113
143
|
|
|
114
144
|
data() {
|
|
115
145
|
return {
|
|
116
146
|
uploads : [],
|
|
117
|
-
dragging : false
|
|
147
|
+
dragging : false,
|
|
118
148
|
}
|
|
119
149
|
},
|
|
120
150
|
|
|
@@ -143,16 +173,65 @@
|
|
|
143
173
|
return '#D7DAE1'
|
|
144
174
|
},
|
|
145
175
|
|
|
176
|
+
isBusy() {
|
|
177
|
+
return !!(
|
|
178
|
+
this.initializing ||
|
|
179
|
+
this.loading ||
|
|
180
|
+
this.progress ||
|
|
181
|
+
this.uploadStats.show
|
|
182
|
+
);
|
|
183
|
+
},
|
|
184
|
+
|
|
146
185
|
cancelButtonOptions() {
|
|
147
186
|
return Object.assign({
|
|
148
187
|
show: false,
|
|
149
188
|
label: 'Cancel',
|
|
150
189
|
icon: 'back'
|
|
151
190
|
}, this.cancelButton);
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
uploadStatsOptions() {
|
|
194
|
+
return Object.assign({
|
|
195
|
+
show: false,
|
|
196
|
+
speed: 0,
|
|
197
|
+
timeRemaining: ''
|
|
198
|
+
}, this.uploadStats);
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
formattedSpeed() {
|
|
202
|
+
const bytes = this.uploadStats.speed;
|
|
203
|
+
if (bytes === 0) return '0 Bytes';
|
|
204
|
+
|
|
205
|
+
const k = 1024;
|
|
206
|
+
const dm = 2;
|
|
207
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
208
|
+
|
|
209
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
210
|
+
|
|
211
|
+
if (sizes[i] == 'Bytes' && 'KB')
|
|
212
|
+
return '<1 KB';
|
|
213
|
+
|
|
214
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
152
215
|
}
|
|
153
216
|
},
|
|
154
217
|
|
|
155
218
|
methods: {
|
|
219
|
+
handleDragEnter(event) {
|
|
220
|
+
event.preventDefault();
|
|
221
|
+
this.dragging = true;
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
handleDragLeave(event) {
|
|
225
|
+
if (event.target === this.$el || !this.$el.contains(event.target)) {
|
|
226
|
+
this.dragging = false;
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
handleDragOver(event) {
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
this.dragging = true;
|
|
233
|
+
},
|
|
234
|
+
|
|
156
235
|
browseFile() {
|
|
157
236
|
this.$refs.file.click()
|
|
158
237
|
},
|
|
@@ -200,6 +279,10 @@
|
|
|
200
279
|
a{
|
|
201
280
|
color: $color-blue-10;
|
|
202
281
|
}
|
|
282
|
+
|
|
283
|
+
.ecs-empty-state-message{
|
|
284
|
+
max-width: 440px;
|
|
285
|
+
}
|
|
203
286
|
}
|
|
204
287
|
</style>
|
|
205
288
|
|
|
@@ -249,6 +332,12 @@
|
|
|
249
332
|
margin: $spacing-25 auto 0 auto;
|
|
250
333
|
}
|
|
251
334
|
|
|
335
|
+
&-stats{
|
|
336
|
+
font-size: $type-scale-3-font-size;
|
|
337
|
+
line-height: $type-scale-3-line-height;
|
|
338
|
+
margin-top: $spacing-10;
|
|
339
|
+
}
|
|
340
|
+
|
|
252
341
|
&-hint,
|
|
253
342
|
&-error-message{
|
|
254
343
|
font-size: $type-scale-3-font-size;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
/** Sets the sticker icon. */
|
|
21
21
|
type: {
|
|
22
22
|
type: String,
|
|
23
|
-
validator: v => ['current', 'error', 'loading', 'warning', 'success', 'info', 'shared', 'null', null, undefined].includes(v)
|
|
23
|
+
validator: v => ['current', 'error', 'loading', 'warning', 'success', 'info', 'shared', '', 'null', null, undefined].includes(v)
|
|
24
24
|
},
|
|
25
25
|
/** Allows to customize the primary color of the sticker icon. */
|
|
26
26
|
color: {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
@click="handleClick">
|
|
13
13
|
|
|
14
14
|
<ecs-icon v-if="icon" :type="icon" />
|
|
15
|
-
<ecs-
|
|
15
|
+
<ecs-sticker v-if="icon && sticker" :type="sticker" />
|
|
16
16
|
<slot></slot>
|
|
17
17
|
<span v-if="shortcut" class="shortcut">{{ shortcut }}</span>
|
|
18
18
|
<ecs-focus-ring :inset="0" />
|
|
@@ -22,11 +22,13 @@
|
|
|
22
22
|
|
|
23
23
|
<script>
|
|
24
24
|
import EcsIcon from '../icon/icon'
|
|
25
|
+
import EcsSticker from '../sticker/sticker'
|
|
25
26
|
import EcsFocusRing from '../mixins/focus-ring'
|
|
26
27
|
|
|
27
28
|
export default {
|
|
28
29
|
components: {
|
|
29
30
|
EcsIcon,
|
|
31
|
+
EcsSticker,
|
|
30
32
|
EcsFocusRing
|
|
31
33
|
},
|
|
32
34
|
|
|
@@ -52,7 +54,7 @@
|
|
|
52
54
|
},
|
|
53
55
|
/** Adds an ecs-sticker to this tab button, check the Sticker component for available types. */
|
|
54
56
|
sticker: {
|
|
55
|
-
type: String
|
|
57
|
+
type: String,
|
|
56
58
|
},
|
|
57
59
|
/** Disables the tab button. */
|
|
58
60
|
disabled: {
|
|
@@ -70,7 +72,6 @@
|
|
|
70
72
|
},
|
|
71
73
|
|
|
72
74
|
computed: {
|
|
73
|
-
|
|
74
75
|
},
|
|
75
76
|
|
|
76
77
|
mounted() {
|
|
@@ -162,7 +163,7 @@
|
|
|
162
163
|
pointer-events: none;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
|
-
.sticker{
|
|
166
|
+
.ecs-sticker{
|
|
166
167
|
position: absolute;
|
|
167
168
|
}
|
|
168
169
|
}
|
|
@@ -243,11 +244,11 @@
|
|
|
243
244
|
margin-right: 0;
|
|
244
245
|
}
|
|
245
246
|
|
|
246
|
-
.icon
|
|
247
|
+
.icon{
|
|
247
248
|
margin: 0 4px 0 -4px;
|
|
248
249
|
}
|
|
249
250
|
|
|
250
|
-
.sticker{
|
|
251
|
+
.ecs-sticker{
|
|
251
252
|
left: $spacing-25;
|
|
252
253
|
bottom: $spacing-10;
|
|
253
254
|
}
|
|
@@ -275,11 +276,11 @@
|
|
|
275
276
|
border-radius: 0 2px 2px 0;
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
.icon
|
|
279
|
+
.icon{
|
|
279
280
|
margin: -5px 5px -5px -5px;
|
|
280
281
|
}
|
|
281
282
|
|
|
282
|
-
.sticker{
|
|
283
|
+
.ecs-sticker{
|
|
283
284
|
top: 20px;
|
|
284
285
|
left: 29px;
|
|
285
286
|
}
|
|
@@ -6,6 +6,16 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
6
6
|
Changelog
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
+
## Version 7.2.3 (5 June 2023)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- Added uploadStats to EcsDropzone component
|
|
14
|
+
|
|
15
|
+
### Fixes
|
|
16
|
+
|
|
17
|
+
- Fixed the dragover events on EcsDropzone component
|
|
18
|
+
|
|
9
19
|
## Version 7.2.0 (29 May 2023)
|
|
10
20
|
|
|
11
21
|
### Features
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -25,6 +25,17 @@ export const dropzoneWithHint = () => ({
|
|
|
25
25
|
`,
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
export const dropzoneDisabled = () => ({
|
|
29
|
+
components: { EcsDropzone },
|
|
30
|
+
template: `
|
|
31
|
+
<div style="width:100%; height: 600px">
|
|
32
|
+
<ecs-dropzone disabled>
|
|
33
|
+
<template slot="hint">This is an additional <a href="#">hint text</a>.</template>
|
|
34
|
+
</ecs-dropzone>
|
|
35
|
+
</div>
|
|
36
|
+
`,
|
|
37
|
+
});
|
|
38
|
+
|
|
28
39
|
export const dropzoneError = () => ({
|
|
29
40
|
components: { EcsDropzone },
|
|
30
41
|
template: `
|
|
@@ -75,6 +86,36 @@ export const dropzoneUploading = () => ({
|
|
|
75
86
|
`,
|
|
76
87
|
});
|
|
77
88
|
|
|
89
|
+
export const dropzoneUploadingWithStats = () => ({
|
|
90
|
+
components: { EcsDropzone },
|
|
91
|
+
data() {
|
|
92
|
+
return {
|
|
93
|
+
uploadSpeed: 82943,
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
methods: {
|
|
97
|
+
simulateUploadSpeedChange() {
|
|
98
|
+
setInterval(() => {
|
|
99
|
+
this.uploadSpeed = Math.floor(Math.random() * 1000000);
|
|
100
|
+
}, 1000);
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
mounted() {
|
|
104
|
+
this.simulateUploadSpeedChange();
|
|
105
|
+
},
|
|
106
|
+
template: `
|
|
107
|
+
<div style="width:100%; height: 600px">
|
|
108
|
+
<ecs-dropzone
|
|
109
|
+
state="upload"
|
|
110
|
+
:progress="56"
|
|
111
|
+
:uploadStats="{show: true, speed: uploadSpeed, timeRemaining: '2 minutes'}"
|
|
112
|
+
>
|
|
113
|
+
<template slot="hint">This is an additional <a href="#">hint text</a>.</template>
|
|
114
|
+
</ecs-dropzone>
|
|
115
|
+
</div>
|
|
116
|
+
`,
|
|
117
|
+
});
|
|
118
|
+
|
|
78
119
|
export const dropzoneCustomLabel = () => ({
|
|
79
120
|
components: { EcsDropzone },
|
|
80
121
|
template: `
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|