@sb1/ffe-file-upload-react 6.0.5 → 6.1.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/es/FileUpload.js +2 -2
- package/lib/FileUpload.js +2 -2
- package/package.json +6 -4
- package/types/index.d.ts +31 -0
package/es/FileUpload.js
CHANGED
|
@@ -8,7 +8,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
8
8
|
|
|
9
9
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
10
|
|
|
11
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
12
|
|
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
18
18
|
|
|
19
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
20
|
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
22
|
|
|
23
23
|
import React from 'react';
|
|
24
24
|
import { object, bool, func, string as stringType } from 'prop-types';
|
package/lib/FileUpload.js
CHANGED
|
@@ -29,7 +29,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
29
29
|
|
|
30
30
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
31
|
|
|
32
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
33
|
|
|
34
34
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
35
|
|
|
@@ -39,7 +39,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
39
39
|
|
|
40
40
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
41
|
|
|
42
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
43
|
|
|
44
44
|
var FileUpload = /*#__PURE__*/function (_React$Component) {
|
|
45
45
|
_inherits(FileUpload, _React$Component);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-file-upload-react",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Upload file button with validation and list of uploaded files.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ffe"
|
|
@@ -9,17 +9,19 @@
|
|
|
9
9
|
"author": "SpareBank 1",
|
|
10
10
|
"files": [
|
|
11
11
|
"lib",
|
|
12
|
-
"es"
|
|
12
|
+
"es",
|
|
13
|
+
"types"
|
|
13
14
|
],
|
|
14
15
|
"main": "lib/index.js",
|
|
15
16
|
"module": "es/index.js",
|
|
17
|
+
"types": "types/index.d.ts",
|
|
16
18
|
"sideEffects": false,
|
|
17
19
|
"repository": {
|
|
18
20
|
"type": "git",
|
|
19
21
|
"url": "ssh://git@github.com:SpareBank1/designsystem.git"
|
|
20
22
|
},
|
|
21
23
|
"scripts": {
|
|
22
|
-
"build": "ffe-buildtool babel
|
|
24
|
+
"build": "ffe-buildtool babel",
|
|
23
25
|
"watch": "ffe-buildtool babel-watch",
|
|
24
26
|
"lint": "eslint src",
|
|
25
27
|
"test": "ffe-buildtool jest",
|
|
@@ -46,5 +48,5 @@
|
|
|
46
48
|
"depencencies": {
|
|
47
49
|
"prop-types": "^15.6.0"
|
|
48
50
|
},
|
|
49
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6030a57eafac2e4bde2bd946bc8d3f233b70ff8e"
|
|
50
52
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface FileItem {
|
|
4
|
+
name: string;
|
|
5
|
+
document?: File;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface FileUploadProps {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
files: Record<string, FileItem>;
|
|
13
|
+
onFilesSelected(fileList: FileList): void;
|
|
14
|
+
onFilesDropped(fileList: FileList): void;
|
|
15
|
+
onFileDeleted(file: File): void;
|
|
16
|
+
multiple?: boolean;
|
|
17
|
+
title: string;
|
|
18
|
+
infoText: string;
|
|
19
|
+
infoSubText?: string;
|
|
20
|
+
cancelText?: string;
|
|
21
|
+
deleteText?: string;
|
|
22
|
+
uploadTitle: string;
|
|
23
|
+
uploadMicroText: string;
|
|
24
|
+
uploadSubText: string;
|
|
25
|
+
}
|
|
26
|
+
declare class FileUpload extends React.Component<FileUploadProps, any> {}
|
|
27
|
+
|
|
28
|
+
declare function getFileContent(file: File): Promise<any>;
|
|
29
|
+
|
|
30
|
+
export default FileUpload;
|
|
31
|
+
export { getFileContent };
|