@sb1/ffe-file-upload-react 5.0.2 → 5.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/es/FileUpload.js CHANGED
@@ -1,22 +1,22 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
 
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
 
5
5
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
6
 
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
8
 
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
10
 
11
11
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || 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
 
15
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
15
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
16
 
17
17
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
18
 
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
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
21
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
22
 
package/lib/FileUpload.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -21,19 +21,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
21
21
 
22
22
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
23
23
 
24
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
25
 
26
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
26
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
27
27
 
28
28
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
29
 
30
30
  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); }; }
31
31
 
32
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
32
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
33
33
 
34
34
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
35
 
36
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
36
+ 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; } }
37
37
 
38
38
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
39
 
package/lib/index.js CHANGED
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.default = void 0;
6
7
  Object.defineProperty(exports, "getFileContent", {
7
8
  enumerable: true,
8
9
  get: function get() {
9
10
  return _fileContent.getFileContent;
10
11
  }
11
12
  });
12
- exports.default = void 0;
13
13
 
14
14
  var _FileUpload = _interopRequireDefault(require("./FileUpload"));
15
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-file-upload-react",
3
- "version": "5.0.2",
3
+ "version": "5.0.6",
4
4
  "description": "Upload file button with validation and list of uploaded files.",
5
5
  "keywords": [
6
6
  "ffe"
@@ -19,10 +19,8 @@
19
19
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
20
20
  },
21
21
  "scripts": {
22
- "build": "npm run build:cjs && npm run build:es",
23
- "build:cjs": "babel -d lib/. --root-mode=upward --env-name=cjs --ignore=*.spec.js src/.",
24
- "build:es": "babel -d es/. --root-mode=upward --env-name=es --ignore=*.spec.js src/.",
25
- "lint": "eslint src/.",
22
+ "build": "ffe-buildtool babel --no-copy-typedef",
23
+ "lint": "eslint src",
26
24
  "test": "jest",
27
25
  "test:watch": "jest --watch"
28
26
  },
@@ -30,19 +28,20 @@
30
28
  "setupTestFrameworkScriptFile": "../../test-setup.js"
31
29
  },
32
30
  "dependencies": {
33
- "classnames": "^2.2.5"
31
+ "classnames": "^2.3.1"
34
32
  },
35
33
  "devDependencies": {
34
+ "@sb1/ffe-buildtool": "^0.2.0",
36
35
  "enzyme": "^3.7.0",
37
36
  "enzyme-adapter-react-16": "^1.7.0",
38
- "jest": "^24.0.0",
37
+ "jest": "^26.0.0",
39
38
  "react": "^16.9.0",
40
39
  "react-dom": "^16.9.0"
41
40
  },
42
41
  "peerDependencies": {
43
- "@sb1/ffe-core": "^15.2.0",
44
- "@sb1/ffe-form": ">=11.0.1",
45
- "react": "^16.9.0"
42
+ "@sb1/ffe-core": "*",
43
+ "@sb1/ffe-form": "*",
44
+ "react": ">=16.9.0"
46
45
  },
47
46
  "publishConfig": {
48
47
  "access": "public"
@@ -50,5 +49,5 @@
50
49
  "depencencies": {
51
50
  "prop-types": "^15.6.0"
52
51
  },
53
- "gitHead": "b421aafe6046e619e961d9ff429096ab80f3c138"
52
+ "gitHead": "10669ef6d5ebf454feb4eddb9aa4ca7bc8f439dc"
54
53
  }
package/CHANGELOG.md DELETED
@@ -1,268 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [5.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@5.0.1...@sb1/ffe-file-upload-react@5.0.2) (2021-02-02)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **ffe-file-upload-react:** reduce vulnerabilities ([9af58e1](https://github.com/SpareBank1/designsystem/commit/9af58e1b015455647460f2f22e4b51ca6ca680ce))
12
-
13
-
14
-
15
-
16
-
17
- ## [5.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@5.0.0...@sb1/ffe-file-upload-react@5.0.1) (2019-10-16)
18
-
19
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
20
-
21
- # [5.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@4.0.0...@sb1/ffe-file-upload-react@5.0.0) (2019-09-16)
22
-
23
- ### Code Refactoring
24
-
25
- - **ffe-file-upload-react:** Refactor with new design ([30400f2](https://github.com/SpareBank1/designsystem/commit/30400f2))
26
-
27
- ### BREAKING CHANGES
28
-
29
- - **ffe-file-upload-react:** Redesign of module with new design, including drag and drop support
30
-
31
- # [4.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.11...@sb1/ffe-file-upload-react@4.0.0) (2019-08-27)
32
-
33
- ### chore
34
-
35
- - bump React to 16.9 to allow for using hooks etc ([e3901f1](https://github.com/SpareBank1/designsystem/commit/e3901f1))
36
-
37
- ### BREAKING CHANGES
38
-
39
- - peerDep of React is raised to 16.9. While this in itself
40
- isn't a breaking change, it allows for the use of hooks in later releases.
41
- Such changes would just be a minor version, or even a patch, but without
42
- this major version bump it would result in a runtime error for consumers.
43
-
44
- ## [3.0.11](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.10...@sb1/ffe-file-upload-react@3.0.11) (2019-06-26)
45
-
46
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
47
-
48
- ## [3.0.10](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.9...@sb1/ffe-file-upload-react@3.0.10) (2019-05-21)
49
-
50
- ### Bug Fixes
51
-
52
- - **ffe-file-upload-react:** ffe-form compat ([ece3fd3](https://github.com/SpareBank1/designsystem/commit/ece3fd3))
53
-
54
- ## [3.0.9](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.8...@sb1/ffe-file-upload-react@3.0.9) (2018-12-11)
55
-
56
- ### Bug Fixes
57
-
58
- - Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
59
-
60
- ## [3.0.8](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.7...@sb1/ffe-file-upload-react@3.0.8) (2018-11-26)
61
-
62
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
63
-
64
- ## [3.0.7](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.6...@sb1/ffe-file-upload-react@3.0.7) (2018-11-09)
65
-
66
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
67
-
68
- ## [3.0.6](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.5...@sb1/ffe-file-upload-react@3.0.6) (2018-11-08)
69
-
70
- ### Bug Fixes
71
-
72
- - **ffe-file-upload-react:** fixed async issues with setState ([0a6b546](https://github.com/SpareBank1/designsystem/commit/0a6b546))
73
-
74
- <a name="3.0.5"></a>
75
-
76
- ## [3.0.5](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.4...@sb1/ffe-file-upload-react@3.0.5) (2018-08-09)
77
-
78
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
79
-
80
- <a name="3.0.4"></a>
81
-
82
- ## [3.0.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.3...@sb1/ffe-file-upload-react@3.0.4) (2018-06-20)
83
-
84
- ### Bug Fixes
85
-
86
- - **ffe-file-upload-react:** added peerDependency to ffe-core@^13.0.0 ([bb426a9](https://github.com/SpareBank1/designsystem/commit/bb426a9))
87
-
88
- <a name="3.0.3"></a>
89
-
90
- ## [3.0.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.2...@sb1/ffe-file-upload-react@3.0.3) (2018-03-27)
91
-
92
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
93
-
94
- <a name="3.0.2"></a>
95
-
96
- ## [3.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.0...@sb1/ffe-file-upload-react@3.0.2) (2018-03-07)
97
-
98
- ### Bug Fixes
99
-
100
- - Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
101
-
102
- <a name="3.0.1"></a>
103
-
104
- ## [3.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@3.0.0...@sb1/ffe-file-upload-react@3.0.1) (2018-03-02)
105
-
106
- ### Bug Fixes
107
-
108
- - Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
109
-
110
- <a name="3.0.0"></a>
111
-
112
- # 3.0.0 (2018-02-25)
113
-
114
- ### Chores
115
-
116
- - **ffe-file-upload-react:** Moving in ([870b07f](https://github.com/SpareBank1/designsystem/commit/870b07f))
117
- - add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
118
-
119
- ### BREAKING CHANGES
120
-
121
- - All packages have been renamed to add the @sb1 scope.
122
-
123
- See links [1] and [2] to read more about package scopes.
124
-
125
- Unfortunately this requires you update both your dependencies in
126
- `package.json` and all `import` or `require` statements in your code.
127
- Also, you unfortunately have to upgrade all FFE packages at once due to
128
- dependency between packages. If you are on the latest version prior to
129
- this breaking change the upgrade should be a matter of updating
130
- `package.json` with new package names and versions, and updating your
131
- imports.
132
-
133
- To help find the proper package versions you can either browse to the
134
- packages you need or check out the list of Git tags either on
135
- Github [3] or by cloning the repository and running the `git tag`
136
- command. All package versions get a tag in the format
137
- _package@version_.
138
-
139
- Update your `package.json` with the latest package version and add the
140
- @sb1 scope to the package name:
141
-
142
- ```diff
143
- - "ffe-core": "11.0.2",
144
- + "@sb1/ffe-core": "11.0.2",
145
- ```
146
-
147
- Scoped packages all get put in a subdirectory in `node_modules/`. In our
148
- case packages will be put in the `node_modules/@sb1/` directory. If your
149
- build depends on file paths (for instance for copying fonts) you need to
150
- update that path to include the scope.
151
-
152
- The directory structure also means you have to update your imports, both
153
- in Less and in JavaScript.
154
-
155
- Using `less-plugin-npm-import`:
156
-
157
- ```diff
158
- - @import 'npm://ffe-core/less/ffe';
159
- + @import 'npm://@sb1/ffe-core/less/ffe';
160
- ```
161
-
162
- Using Webpack:
163
-
164
- ```diff
165
- - @import '~ffe-core/less/ffe';
166
- + @import '~@sb1/ffe-core/less/ffe';
167
- ```
168
-
169
- Using plain old paths:
170
-
171
- ```diff
172
- - @import '../path/to/node_modules/ffe-core/less/ffe';
173
- + @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
174
- ```
175
-
176
- JavaScript `import`:
177
-
178
- ```diff
179
- - import { ActionButton } from 'ffe-buttons-react';
180
- + import { ActionButton } from '@sb1/ffe-buttons-react';
181
- ```
182
-
183
- JavaScript `require`:
184
-
185
- ```diff
186
- - const { ActionButton } = require('ffe-buttons-react').default;
187
- + const { ActionButton } = require('@sb1/ffe-buttons-react').default;
188
- ```
189
-
190
- [1]: https://docs.npmjs.com/misc/scope
191
- [2]: https://docs.npmjs.com/getting-started/scoped-packages
192
- [3]: https://github.com/sparebank1/designsystem/tags
193
-
194
- - **ffe-file-upload-react:** Requires React 16.2 or newer
195
-
196
- With this ffe-file-upload-react is moved to the monorepo. A breaking
197
- change is introduced to remove support for React 15. The upgrade should
198
- be a drop-in upgrade for users of React 16.2 or newer.
199
-
200
- <a name="2.0.6"></a>
201
-
202
- ## [2.0.6](https://github.com/SpareBank1/designsystem/compare/ffe-file-upload-react@2.0.5...ffe-file-upload-react@2.0.6) (2018-02-23)
203
-
204
- **Note:** Version bump only for package ffe-file-upload-react
205
-
206
- <a name="2.0.5"></a>
207
-
208
- ## [2.0.5](https://github.com/SpareBank1/designsystem/compare/ffe-file-upload-react@2.0.4...ffe-file-upload-react@2.0.5) (2018-02-22)
209
-
210
- **Note:** Version bump only for package ffe-file-upload-react
211
-
212
- <a name="2.0.4"></a>
213
-
214
- ## [2.0.4](https://github.com/SpareBank1/designsystem/compare/ffe-file-upload-react@2.0.3...ffe-file-upload-react@2.0.4) (2018-02-16)
215
-
216
- **Note:** Version bump only for package ffe-file-upload-react
217
-
218
- <a name="2.0.3"></a>
219
-
220
- ## [2.0.3](https://github.com/SpareBank1/designsystem/compare/ffe-file-upload-react@2.0.2...ffe-file-upload-react@2.0.3) (2018-01-22)
221
-
222
- **Note:** Version bump only for package ffe-file-upload-react
223
-
224
- <a name="2.0.2"></a>
225
-
226
- ## [2.0.2](https://github.com/SpareBank1/designsystem/compare/ffe-file-upload-react@2.0.1...ffe-file-upload-react@2.0.2) (2018-01-19)
227
-
228
- **Note:** Version bump only for package ffe-file-upload-react
229
-
230
- <a name="2.0.1"></a>
231
-
232
- ## [2.0.1](https://github.com/SpareBank1/designsystem/compare/ffe-file-upload-react@2.0.0...ffe-file-upload-react@2.0.1) (2018-01-18)
233
-
234
- **Note:** Version bump only for package ffe-file-upload-react
235
-
236
- <a name="2.0.0"></a>
237
-
238
- # 2.0.0 (2018-01-12)
239
-
240
- ### Chores
241
-
242
- - **ffe-file-upload-react:** Moving in
243
-
244
- ### BREAKING CHANGES
245
-
246
- - **ffe-file-upload-react:** Requires React 16.2 or newer
247
-
248
- With this ffe-file-upload-react is moved to the monorepo. A breaking
249
- change is introduced to remove support for React 15. The upgrade should
250
- be a drop-in upgrade for users of React 16.2 or newer.
251
-
252
- # 1.2.0
253
-
254
- - aria-label is now set by label
255
-
256
- # 1.1.0
257
-
258
- - Moved clearing of input to enable multiple upload
259
- - Adding success and info message support
260
- - Adding support for multiple error messages
261
-
262
- ## 1.0.1
263
-
264
- - Fixed bug where file input element was not cleared after each upload(causing sequential upload of files with same filename to not perform onChange and therefore no upload)
265
-
266
- # 1.0.0
267
-
268
- - Initial version
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
- import sinon from 'sinon';
3
- import { shallow } from 'enzyme';
4
- import FileUpload from '../src/FileUpload';
5
- describe('<FileUpload/>', function () {
6
- var component;
7
- var onFilesSelected;
8
- var onFileDeleted;
9
- var onFilesDropped;
10
- beforeEach(function () {
11
- onFilesSelected = sinon.spy();
12
- onFileDeleted = sinon.spy();
13
- onFilesDropped = sinon.spy();
14
- });
15
- describe('initial state', function () {
16
- beforeEach(function () {
17
- component = shallow( /*#__PURE__*/React.createElement(FileUpload, {
18
- id: "file-upload",
19
- label: "label",
20
- title: "title",
21
- infoText: "infoText",
22
- uploadTitle: "uploadTitle",
23
- uploadMicroText: "uploadMicroText",
24
- uploadSubText: "uploadSubText",
25
- files: {},
26
- onFilesSelected: onFilesSelected,
27
- onFileDeleted: onFileDeleted,
28
- onFilesDropped: onFilesDropped
29
- }));
30
- });
31
- it('should have a button and input', function () {
32
- expect(component.find('.ffe-file-upload__upload-button').exists()).toBe(true);
33
- expect(component.find('#file-upload').exists()).toBe(true);
34
- });
35
- it('should render input label', function () {
36
- expect(component.find('.ffe-file-upload__upload-button').text()).toBe('label');
37
- });
38
- it('should add label as aria-label', function () {
39
- expect(component.find('#file-upload-label').text()).toBe('label');
40
- });
41
- it('should extract and return files when user finishes selecting files', function () {
42
- component.find('#file-upload').simulate('change', {
43
- target: {
44
- files: {
45
- filename: {
46
- name: 'filename'
47
- }
48
- }
49
- }
50
- });
51
- expect(onFilesSelected.calledOnce).toBe(true);
52
- });
53
- });
54
- });
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _sinon = _interopRequireDefault(require("sinon"));
6
-
7
- var _enzyme = require("enzyme");
8
-
9
- var _FileUpload = _interopRequireDefault(require("../src/FileUpload"));
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- describe('<FileUpload/>', function () {
14
- var component;
15
- var onFilesSelected;
16
- var onFileDeleted;
17
- var onFilesDropped;
18
- beforeEach(function () {
19
- onFilesSelected = _sinon.default.spy();
20
- onFileDeleted = _sinon.default.spy();
21
- onFilesDropped = _sinon.default.spy();
22
- });
23
- describe('initial state', function () {
24
- beforeEach(function () {
25
- component = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_FileUpload.default, {
26
- id: "file-upload",
27
- label: "label",
28
- title: "title",
29
- infoText: "infoText",
30
- uploadTitle: "uploadTitle",
31
- uploadMicroText: "uploadMicroText",
32
- uploadSubText: "uploadSubText",
33
- files: {},
34
- onFilesSelected: onFilesSelected,
35
- onFileDeleted: onFileDeleted,
36
- onFilesDropped: onFilesDropped
37
- }));
38
- });
39
- it('should have a button and input', function () {
40
- expect(component.find('.ffe-file-upload__upload-button').exists()).toBe(true);
41
- expect(component.find('#file-upload').exists()).toBe(true);
42
- });
43
- it('should render input label', function () {
44
- expect(component.find('.ffe-file-upload__upload-button').text()).toBe('label');
45
- });
46
- it('should add label as aria-label', function () {
47
- expect(component.find('#file-upload-label').text()).toBe('label');
48
- });
49
- it('should extract and return files when user finishes selecting files', function () {
50
- component.find('#file-upload').simulate('change', {
51
- target: {
52
- files: {
53
- filename: {
54
- name: 'filename'
55
- }
56
- }
57
- }
58
- });
59
- expect(onFilesSelected.calledOnce).toBe(true);
60
- });
61
- });
62
- });