@everchron/ec-shards 2.0.4 → 2.0.6
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 +56 -28
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +56 -28
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +1 -1
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/dropzone/dropzone.vue +25 -2
- package/src/stories/Changelog.stories.mdx +18 -0
- package/src/stories/dropzone/dropzone.stories.js +12 -1
package/package.json
CHANGED
|
@@ -12,10 +12,16 @@
|
|
|
12
12
|
|
|
13
13
|
<input @change="change" type="file" :multiple="multiple" ref="file" />
|
|
14
14
|
|
|
15
|
-
<ecs-empty-state type="
|
|
15
|
+
<ecs-empty-state :type="iconType" :iconColor="iconColor">
|
|
16
16
|
<ecs-skeleton-loader v-if="initializing" type="single" :width="100" class="ecs-dropzone-skeleton" />
|
|
17
17
|
<div v-else>
|
|
18
|
-
|
|
18
|
+
<template v-if="!$slots.customlabel">
|
|
19
|
+
Drag and drop your {{ fileTypeLabel }} or <i @click="() => this.$refs.file.click()">browse</i> to upload.
|
|
20
|
+
</template>
|
|
21
|
+
<div v-if="$slots.customlabel">
|
|
22
|
+
<!-- @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. -->
|
|
23
|
+
<slot name="customlabel"></slot>
|
|
24
|
+
</div>
|
|
19
25
|
<div v-if="$slots.hint" class="ecs-dropzone-hint">
|
|
20
26
|
<!-- @slot Slot for an additional informational label underneath the dropzone text. Can contain basic HTML tags: `a`, `b`, `strong`. -->
|
|
21
27
|
<slot name="hint"></slot>
|
|
@@ -44,6 +50,12 @@
|
|
|
44
50
|
},
|
|
45
51
|
|
|
46
52
|
props: {
|
|
53
|
+
/** Determines the icon that should be shown inside the drop zone. */
|
|
54
|
+
state: {
|
|
55
|
+
type: String,
|
|
56
|
+
validator: v => ['default', 'upload', 'viruscheck'].includes(v),
|
|
57
|
+
default: 'default'
|
|
58
|
+
},
|
|
47
59
|
/** Determines the file label in the informational text. E.g. "Drag and drop your **`load file`** or browse to upload." */
|
|
48
60
|
fileTypeLabel: {
|
|
49
61
|
type: String,
|
|
@@ -107,6 +119,17 @@
|
|
|
107
119
|
return !this.dragging && this.error
|
|
108
120
|
},
|
|
109
121
|
|
|
122
|
+
iconType(){
|
|
123
|
+
switch (this.state){
|
|
124
|
+
case 'upload':
|
|
125
|
+
return 'empty-file-upload'
|
|
126
|
+
case 'viruscheck':
|
|
127
|
+
return 'empty-file-virus-scan'
|
|
128
|
+
default:
|
|
129
|
+
return 'empty-file-drag'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
|
|
110
133
|
iconColor(){
|
|
111
134
|
if(this.dragging)
|
|
112
135
|
return '#6BAFFF'
|
|
@@ -6,6 +6,24 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
6
6
|
Changelog
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
+
## Version 2.0.6 (6 October 2022)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- Added custom label slot to EcsDropzone
|
|
14
|
+
|
|
15
|
+
## Version 2.0.5 (5 October 2022)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- Added `state` prop to EcsDropzone that allows to change the dropzone icon.
|
|
20
|
+
|
|
21
|
+
## Version 2.0.4 (5 October 2022)
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
- Animated the icons for virus check and file upload.
|
|
26
|
+
|
|
9
27
|
## Version 2.0.2 (22 September 2022)
|
|
10
28
|
|
|
11
29
|
### Breaking Changes
|
|
@@ -65,7 +65,18 @@ export const dropzoneUploading = () => ({
|
|
|
65
65
|
components: { EcsDropzone },
|
|
66
66
|
template: `
|
|
67
67
|
<div style="width:100%; height: 600px">
|
|
68
|
-
<ecs-dropzone :progress="56" />
|
|
68
|
+
<ecs-dropzone state="upload" :progress="56" />
|
|
69
|
+
</div>
|
|
70
|
+
`,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const dropzoneCustomLabel = () => ({
|
|
74
|
+
components: { EcsDropzone },
|
|
75
|
+
template: `
|
|
76
|
+
<div style="width:100%; height: 600px">
|
|
77
|
+
<ecs-dropzone state="viruscheck">
|
|
78
|
+
<template slot="customlabel">Checking for viruses...</template>
|
|
79
|
+
</ecs-dropzone>
|
|
69
80
|
</div>
|
|
70
81
|
`,
|
|
71
82
|
});
|