@umbraco-ui/uui-file-dropzone 1.6.0-rc.4 → 1.7.0-rc.0
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 +6 -20
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -5,25 +5,12 @@ import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
|
|
|
5
5
|
import { LabelMixin } from '@umbraco-ui/uui-base/lib/mixins';
|
|
6
6
|
import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
|
|
7
7
|
|
|
8
|
-
var __defProp$1 = Object.defineProperty;
|
|
9
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
8
|
class UUIFileDropzoneEvent extends UUIEvent {
|
|
25
9
|
constructor(evName, eventInit = {}) {
|
|
26
|
-
super(evName,
|
|
10
|
+
super(evName, {
|
|
11
|
+
...{ bubbles: true },
|
|
12
|
+
...eventInit
|
|
13
|
+
});
|
|
27
14
|
}
|
|
28
15
|
}
|
|
29
16
|
UUIFileDropzoneEvent.CHANGE = "change";
|
|
@@ -57,7 +44,7 @@ let UUIFileDropzoneElement = class extends LabelMixin("", LitElement) {
|
|
|
57
44
|
const fileextensions = [];
|
|
58
45
|
value.split(",").forEach((item) => {
|
|
59
46
|
item = item.trim().toLowerCase();
|
|
60
|
-
if (
|
|
47
|
+
if (/[a-z]+\/[a-z*]/s.test(item)) {
|
|
61
48
|
mimetypes.push(item);
|
|
62
49
|
} else {
|
|
63
50
|
fileextensions.push(item.replace(/^\./, ""));
|
|
@@ -150,10 +137,9 @@ let UUIFileDropzoneElement = class extends LabelMixin("", LitElement) {
|
|
|
150
137
|
return false;
|
|
151
138
|
}
|
|
152
139
|
async _onDrop(e) {
|
|
153
|
-
var _a;
|
|
154
140
|
e.preventDefault();
|
|
155
141
|
this._dropzone.classList.remove("hover");
|
|
156
|
-
const items =
|
|
142
|
+
const items = e.dataTransfer?.items;
|
|
157
143
|
if (items) {
|
|
158
144
|
let result = await this._getAllFileEntries(items);
|
|
159
145
|
if (this.multiple === false && result.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-file-dropzone",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "1.
|
|
34
|
-
"@umbraco-ui/uui-symbol-file-dropzone": "1.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.7.0-rc.0",
|
|
34
|
+
"@umbraco-ui/uui-symbol-file-dropzone": "1.7.0-rc.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "npm run analyze && tsc --build
|
|
37
|
+
"build": "npm run analyze && tsc --build && rollup -c rollup.config.js",
|
|
38
38
|
"clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js *.tgz lib/**/*.d.ts custom-elements.json",
|
|
39
39
|
"analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json"
|
|
40
40
|
},
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-file-dropzone",
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "a7166e62b37b609e74b96821d397c694a5f42458"
|
|
46
46
|
}
|