@sb1/ffe-file-upload-react 5.0.3 → 5.0.7

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"); } 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
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"); } 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); }
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.3",
3
+ "version": "5.0.7",
4
4
  "description": "Upload file button with validation and list of uploaded files.",
5
5
  "keywords": [
6
6
  "ffe"
@@ -19,10 +19,9 @@
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
+ "watch": "ffe-buildtool babel-watch",
24
+ "lint": "eslint src",
26
25
  "test": "jest",
27
26
  "test:watch": "jest --watch"
28
27
  },
@@ -30,9 +29,10 @@
30
29
  "setupTestFrameworkScriptFile": "../../test-setup.js"
31
30
  },
32
31
  "dependencies": {
33
- "classnames": "^2.2.5"
32
+ "classnames": "^2.3.1"
34
33
  },
35
34
  "devDependencies": {
35
+ "@sb1/ffe-buildtool": "^0.3.0",
36
36
  "enzyme": "^3.7.0",
37
37
  "enzyme-adapter-react-16": "^1.7.0",
38
38
  "jest": "^26.0.0",
@@ -40,9 +40,9 @@
40
40
  "react-dom": "^16.9.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@sb1/ffe-core": "^15.2.0",
44
- "@sb1/ffe-form": ">=11.0.1",
45
- "react": "^16.9.0"
43
+ "@sb1/ffe-core": "*",
44
+ "@sb1/ffe-form": "*",
45
+ "react": ">=16.9.0"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
@@ -50,5 +50,5 @@
50
50
  "depencencies": {
51
51
  "prop-types": "^15.6.0"
52
52
  },
53
- "gitHead": "072f7a0ce24bd7fe80978a54e5a4d7c6216d700a"
53
+ "gitHead": "1960685a8b6055efc0653aa1643138cf4a7054fc"
54
54
  }
package/CHANGELOG.md DELETED
@@ -1,279 +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.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-file-upload-react@5.0.2...@sb1/ffe-file-upload-react@5.0.3) (2021-02-02)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * packages/ffe-file-upload-react/package.json to reduce vulnerabilities ([ac3ee52](https://github.com/SpareBank1/designsystem/commit/ac3ee52514b4a65093f09a38e9a40f3d1799b180))
12
-
13
-
14
-
15
-
16
-
17
- ## [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)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * **ffe-file-upload-react:** reduce vulnerabilities ([9af58e1](https://github.com/SpareBank1/designsystem/commit/9af58e1b015455647460f2f22e4b51ca6ca680ce))
23
-
24
-
25
-
26
-
27
-
28
- ## [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)
29
-
30
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
31
-
32
- # [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)
33
-
34
- ### Code Refactoring
35
-
36
- - **ffe-file-upload-react:** Refactor with new design ([30400f2](https://github.com/SpareBank1/designsystem/commit/30400f2))
37
-
38
- ### BREAKING CHANGES
39
-
40
- - **ffe-file-upload-react:** Redesign of module with new design, including drag and drop support
41
-
42
- # [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)
43
-
44
- ### chore
45
-
46
- - bump React to 16.9 to allow for using hooks etc ([e3901f1](https://github.com/SpareBank1/designsystem/commit/e3901f1))
47
-
48
- ### BREAKING CHANGES
49
-
50
- - peerDep of React is raised to 16.9. While this in itself
51
- isn't a breaking change, it allows for the use of hooks in later releases.
52
- Such changes would just be a minor version, or even a patch, but without
53
- this major version bump it would result in a runtime error for consumers.
54
-
55
- ## [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)
56
-
57
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
58
-
59
- ## [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)
60
-
61
- ### Bug Fixes
62
-
63
- - **ffe-file-upload-react:** ffe-form compat ([ece3fd3](https://github.com/SpareBank1/designsystem/commit/ece3fd3))
64
-
65
- ## [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)
66
-
67
- ### Bug Fixes
68
-
69
- - Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
70
-
71
- ## [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)
72
-
73
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
74
-
75
- ## [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)
76
-
77
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
78
-
79
- ## [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)
80
-
81
- ### Bug Fixes
82
-
83
- - **ffe-file-upload-react:** fixed async issues with setState ([0a6b546](https://github.com/SpareBank1/designsystem/commit/0a6b546))
84
-
85
- <a name="3.0.5"></a>
86
-
87
- ## [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)
88
-
89
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
90
-
91
- <a name="3.0.4"></a>
92
-
93
- ## [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)
94
-
95
- ### Bug Fixes
96
-
97
- - **ffe-file-upload-react:** added peerDependency to ffe-core@^13.0.0 ([bb426a9](https://github.com/SpareBank1/designsystem/commit/bb426a9))
98
-
99
- <a name="3.0.3"></a>
100
-
101
- ## [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)
102
-
103
- **Note:** Version bump only for package @sb1/ffe-file-upload-react
104
-
105
- <a name="3.0.2"></a>
106
-
107
- ## [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)
108
-
109
- ### Bug Fixes
110
-
111
- - Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
112
-
113
- <a name="3.0.1"></a>
114
-
115
- ## [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)
116
-
117
- ### Bug Fixes
118
-
119
- - Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
120
-
121
- <a name="3.0.0"></a>
122
-
123
- # 3.0.0 (2018-02-25)
124
-
125
- ### Chores
126
-
127
- - **ffe-file-upload-react:** Moving in ([870b07f](https://github.com/SpareBank1/designsystem/commit/870b07f))
128
- - add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
129
-
130
- ### BREAKING CHANGES
131
-
132
- - All packages have been renamed to add the @sb1 scope.
133
-
134
- See links [1] and [2] to read more about package scopes.
135
-
136
- Unfortunately this requires you update both your dependencies in
137
- `package.json` and all `import` or `require` statements in your code.
138
- Also, you unfortunately have to upgrade all FFE packages at once due to
139
- dependency between packages. If you are on the latest version prior to
140
- this breaking change the upgrade should be a matter of updating
141
- `package.json` with new package names and versions, and updating your
142
- imports.
143
-
144
- To help find the proper package versions you can either browse to the
145
- packages you need or check out the list of Git tags either on
146
- Github [3] or by cloning the repository and running the `git tag`
147
- command. All package versions get a tag in the format
148
- _package@version_.
149
-
150
- Update your `package.json` with the latest package version and add the
151
- @sb1 scope to the package name:
152
-
153
- ```diff
154
- - "ffe-core": "11.0.2",
155
- + "@sb1/ffe-core": "11.0.2",
156
- ```
157
-
158
- Scoped packages all get put in a subdirectory in `node_modules/`. In our
159
- case packages will be put in the `node_modules/@sb1/` directory. If your
160
- build depends on file paths (for instance for copying fonts) you need to
161
- update that path to include the scope.
162
-
163
- The directory structure also means you have to update your imports, both
164
- in Less and in JavaScript.
165
-
166
- Using `less-plugin-npm-import`:
167
-
168
- ```diff
169
- - @import 'npm://ffe-core/less/ffe';
170
- + @import 'npm://@sb1/ffe-core/less/ffe';
171
- ```
172
-
173
- Using Webpack:
174
-
175
- ```diff
176
- - @import '~ffe-core/less/ffe';
177
- + @import '~@sb1/ffe-core/less/ffe';
178
- ```
179
-
180
- Using plain old paths:
181
-
182
- ```diff
183
- - @import '../path/to/node_modules/ffe-core/less/ffe';
184
- + @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
185
- ```
186
-
187
- JavaScript `import`:
188
-
189
- ```diff
190
- - import { ActionButton } from 'ffe-buttons-react';
191
- + import { ActionButton } from '@sb1/ffe-buttons-react';
192
- ```
193
-
194
- JavaScript `require`:
195
-
196
- ```diff
197
- - const { ActionButton } = require('ffe-buttons-react').default;
198
- + const { ActionButton } = require('@sb1/ffe-buttons-react').default;
199
- ```
200
-
201
- [1]: https://docs.npmjs.com/misc/scope
202
- [2]: https://docs.npmjs.com/getting-started/scoped-packages
203
- [3]: https://github.com/sparebank1/designsystem/tags
204
-
205
- - **ffe-file-upload-react:** Requires React 16.2 or newer
206
-
207
- With this ffe-file-upload-react is moved to the monorepo. A breaking
208
- change is introduced to remove support for React 15. The upgrade should
209
- be a drop-in upgrade for users of React 16.2 or newer.
210
-
211
- <a name="2.0.6"></a>
212
-
213
- ## [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)
214
-
215
- **Note:** Version bump only for package ffe-file-upload-react
216
-
217
- <a name="2.0.5"></a>
218
-
219
- ## [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)
220
-
221
- **Note:** Version bump only for package ffe-file-upload-react
222
-
223
- <a name="2.0.4"></a>
224
-
225
- ## [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)
226
-
227
- **Note:** Version bump only for package ffe-file-upload-react
228
-
229
- <a name="2.0.3"></a>
230
-
231
- ## [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)
232
-
233
- **Note:** Version bump only for package ffe-file-upload-react
234
-
235
- <a name="2.0.2"></a>
236
-
237
- ## [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)
238
-
239
- **Note:** Version bump only for package ffe-file-upload-react
240
-
241
- <a name="2.0.1"></a>
242
-
243
- ## [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)
244
-
245
- **Note:** Version bump only for package ffe-file-upload-react
246
-
247
- <a name="2.0.0"></a>
248
-
249
- # 2.0.0 (2018-01-12)
250
-
251
- ### Chores
252
-
253
- - **ffe-file-upload-react:** Moving in
254
-
255
- ### BREAKING CHANGES
256
-
257
- - **ffe-file-upload-react:** Requires React 16.2 or newer
258
-
259
- With this ffe-file-upload-react is moved to the monorepo. A breaking
260
- change is introduced to remove support for React 15. The upgrade should
261
- be a drop-in upgrade for users of React 16.2 or newer.
262
-
263
- # 1.2.0
264
-
265
- - aria-label is now set by label
266
-
267
- # 1.1.0
268
-
269
- - Moved clearing of input to enable multiple upload
270
- - Adding success and info message support
271
- - Adding support for multiple error messages
272
-
273
- ## 1.0.1
274
-
275
- - 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)
276
-
277
- # 1.0.0
278
-
279
- - 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
- });