@umbraco-ui/uui-input-file 1.0.0-rc.1 → 1.0.0-rc.2
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/lib/index.js +12 -4
- package/package.json +8 -8
package/lib/index.js
CHANGED
|
@@ -70,7 +70,9 @@ let UUIInputFileElement = class extends FormControlMixin(LitElement) {
|
|
|
70
70
|
}
|
|
71
71
|
async _handleFilesChange(event) {
|
|
72
72
|
const entries = event.detail.files;
|
|
73
|
-
const files = entries.filter(
|
|
73
|
+
const files = entries.filter(
|
|
74
|
+
(entry) => entry instanceof File || entry.isFile
|
|
75
|
+
);
|
|
74
76
|
if (!this.multiple) {
|
|
75
77
|
const entry = files[0];
|
|
76
78
|
const isFile = entry instanceof File;
|
|
@@ -99,7 +101,9 @@ let UUIInputFileElement = class extends FormControlMixin(LitElement) {
|
|
|
99
101
|
this.value = newValue;
|
|
100
102
|
}
|
|
101
103
|
async _getFile(fileEntry) {
|
|
102
|
-
return await new Promise(
|
|
104
|
+
return await new Promise(
|
|
105
|
+
(resolve, reject) => fileEntry.file(resolve, reject)
|
|
106
|
+
);
|
|
103
107
|
}
|
|
104
108
|
_removeFile(index) {
|
|
105
109
|
const fileToRemove = this._files[index];
|
|
@@ -141,7 +145,11 @@ let UUIInputFileElement = class extends FormControlMixin(LitElement) {
|
|
|
141
145
|
</uui-file-preview>`;
|
|
142
146
|
}
|
|
143
147
|
_renderFiles() {
|
|
144
|
-
return html`${repeat(
|
|
148
|
+
return html`${repeat(
|
|
149
|
+
this._files,
|
|
150
|
+
(file) => file.name + file.size,
|
|
151
|
+
(file, index) => this._renderFileItem(file, index)
|
|
152
|
+
)}`;
|
|
145
153
|
}
|
|
146
154
|
render() {
|
|
147
155
|
return html`
|
|
@@ -210,7 +218,7 @@ UUIInputFileElement.styles = [
|
|
|
210
218
|
padding: 16px;
|
|
211
219
|
box-sizing: border-box;
|
|
212
220
|
justify-content: center;
|
|
213
|
-
align-items:
|
|
221
|
+
align-items: stretch;
|
|
214
222
|
}
|
|
215
223
|
`
|
|
216
224
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-input-file",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-action-bar": "1.0.0-rc.
|
|
34
|
-
"@umbraco-ui/uui-base": "1.0.0-rc.
|
|
35
|
-
"@umbraco-ui/uui-button": "1.0.0-rc.
|
|
36
|
-
"@umbraco-ui/uui-file-dropzone": "1.0.0-rc.
|
|
37
|
-
"@umbraco-ui/uui-icon": "1.0.0-rc.
|
|
38
|
-
"@umbraco-ui/uui-icon-registry-essential": "1.0.0-rc.
|
|
33
|
+
"@umbraco-ui/uui-action-bar": "1.0.0-rc.2",
|
|
34
|
+
"@umbraco-ui/uui-base": "1.0.0-rc.2",
|
|
35
|
+
"@umbraco-ui/uui-button": "1.0.0-rc.2",
|
|
36
|
+
"@umbraco-ui/uui-file-dropzone": "1.0.0-rc.2",
|
|
37
|
+
"@umbraco-ui/uui-icon": "1.0.0-rc.2",
|
|
38
|
+
"@umbraco-ui/uui-icon-registry-essential": "1.0.0-rc.2"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-input-file",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "436dd8d9fff81481feb88f06b461167c98dac91a"
|
|
50
50
|
}
|