@enso-ui/uploader 2.0.13 → 2.0.16

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": "@enso-ui/uploader",
3
- "version": "2.0.13",
3
+ "version": "2.0.16",
4
4
  "description": "File Uploader",
5
5
  "main": "bulma/index.js",
6
6
  "scripts": {
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <uploader :http="http"
3
3
  :i18n="i18n"
4
- ref="uploader"/>
4
+ ref="uploader">
5
+ <template #control="props">
6
+ <slot name="control"
7
+ v-bind="props"/>
8
+ </template>
9
+ </uploader>
5
10
  </template>
6
11
 
7
12
  <script>
@@ -4,7 +4,7 @@
4
4
  <core-uploader v-bind="$attrs"
5
5
  ref="uploader">
6
6
  <template #default="{
7
- compact, controlEvents, files, inputBindings, inputEvents, label, manual,
7
+ controlEvents, files, inputBindings, inputEvents, label, manual,
8
8
  }">
9
9
  <input class="is-hidden"
10
10
  v-bind="inputBindings"
@@ -13,15 +13,23 @@
13
13
  :control-events="controlEvents">
14
14
  <a :class="['file', {'is-small': isSmall}, {'is-large': isLarge}]"
15
15
  v-on="controlEvents">
16
- <span :class="['file-cta', {'is-rounded': isRounded}]">
16
+ <span :class="['file-cta', {'is-rounded': isRounded}]"
17
+ v-if="label">
17
18
  <span class="file-icon"
18
19
  v-if="!manual || files">
19
20
  <fa icon="upload"/>
20
21
  </span>
21
- <span class="file-label" v-if="!compact">
22
+ <span class="file-label">
22
23
  {{ label }}
23
24
  </span>
24
25
  </span>
26
+ <span class="button"
27
+ v-else>
28
+ <span class="icon"
29
+ v-if="!manual || files">
30
+ <fa icon="upload"/>
31
+ </span>
32
+ </span>
25
33
  </a>
26
34
  </slot>
27
35
  </template>
@@ -64,6 +64,10 @@ export default {
64
64
 
65
65
  computed: {
66
66
  displayLabel() {
67
+ if (this.compact) {
68
+ return null;
69
+ }
70
+
67
71
  if (this.manual && this.files) {
68
72
  return this.i18n('Upload');
69
73
  }
@@ -178,7 +182,6 @@ export default {
178
182
 
179
183
  render() {
180
184
  return this.$slots.default({
181
- compact: this.compact,
182
185
  controlEvents: {
183
186
  click: this.browseFiles,
184
187
  },