@sb1/ffe-dropdown-react 5.1.5 → 5.1.9

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/Dropdown.js CHANGED
@@ -1,3 +1,5 @@
1
+ var _excluded = ["className", "inline", "innerRef"];
2
+
1
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
4
 
3
5
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -11,15 +13,12 @@ import classNames from 'classnames';
11
13
  var Dropdown = function Dropdown(props) {
12
14
  var className = props.className,
13
15
  inline = props.inline,
14
- dark = props.dark,
15
16
  innerRef = props.innerRef,
16
- rest = _objectWithoutProperties(props, ["className", "inline", "dark", "innerRef"]);
17
+ rest = _objectWithoutProperties(props, _excluded);
17
18
 
18
19
  return /*#__PURE__*/React.createElement("select", _extends({
19
20
  className: classNames('ffe-dropdown', {
20
21
  'ffe-dropdown--inline': inline
21
- }, {
22
- 'ffe-dropdown--dark': dark
23
22
  }, className),
24
23
  ref: innerRef
25
24
  }, rest));
@@ -30,15 +29,9 @@ Dropdown.propTypes = {
30
29
  inline: bool,
31
30
  className: string,
32
31
 
33
- /** Dark variant */
34
- dark: bool,
35
-
36
32
  /** Ref-setting function, or ref created by useRef, passed to the select element */
37
33
  innerRef: oneOfType([func, shape({
38
34
  current: object
39
35
  })])
40
36
  };
41
- Dropdown.defaultProps = {
42
- dark: false
43
- };
44
37
  export default Dropdown;
package/lib/Dropdown.js CHANGED
@@ -11,6 +11,8 @@ var _propTypes = require("prop-types");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _excluded = ["className", "inline", "innerRef"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
18
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -22,15 +24,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
22
24
  var Dropdown = function Dropdown(props) {
23
25
  var className = props.className,
24
26
  inline = props.inline,
25
- dark = props.dark,
26
27
  innerRef = props.innerRef,
27
- rest = _objectWithoutProperties(props, ["className", "inline", "dark", "innerRef"]);
28
+ rest = _objectWithoutProperties(props, _excluded);
28
29
 
29
30
  return /*#__PURE__*/_react.default.createElement("select", _extends({
30
31
  className: (0, _classnames.default)('ffe-dropdown', {
31
32
  'ffe-dropdown--inline': inline
32
- }, {
33
- 'ffe-dropdown--dark': dark
34
33
  }, className),
35
34
  ref: innerRef
36
35
  }, rest));
@@ -41,16 +40,10 @@ Dropdown.propTypes = {
41
40
  inline: _propTypes.bool,
42
41
  className: _propTypes.string,
43
42
 
44
- /** Dark variant */
45
- dark: _propTypes.bool,
46
-
47
43
  /** Ref-setting function, or ref created by useRef, passed to the select element */
48
44
  innerRef: (0, _propTypes.oneOfType)([_propTypes.func, (0, _propTypes.shape)({
49
45
  current: _propTypes.object
50
46
  })])
51
47
  };
52
- Dropdown.defaultProps = {
53
- dark: false
54
- };
55
48
  var _default = Dropdown;
56
49
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-dropdown-react",
3
- "version": "5.1.5",
3
+ "version": "5.1.9",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "lib",
@@ -16,11 +16,8 @@
16
16
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
17
17
  },
18
18
  "scripts": {
19
- "build": "npm run build:cjs && npm run build:es && npm run build:types",
20
- "build:cjs": "babel -d lib/. --root-mode=upward --env-name=cjs --ignore=*.spec.js src/.",
21
- "build:es": "babel -d es/. --root-mode=upward --env-name=es --ignore=*.spec.js src/.",
22
- "build:types": "copyfiles -f src/index.d.ts types/",
23
- "lint": "eslint src/.",
19
+ "build": "ffe-buildtool babel",
20
+ "lint": "eslint src",
24
21
  "test": "jest",
25
22
  "test:watch": "jest --watch"
26
23
  },
@@ -28,9 +25,10 @@
28
25
  "setupTestFrameworkScriptFile": "../../test-setup.js"
29
26
  },
30
27
  "dependencies": {
31
- "classnames": "^2.2.5"
28
+ "classnames": "^2.3.1"
32
29
  },
33
30
  "devDependencies": {
31
+ "@sb1/ffe-buildtool": "^0.2.0",
34
32
  "enzyme": "^3.7.0",
35
33
  "enzyme-adapter-react-16": "^1.7.0",
36
34
  "eslint": "^5.9.0",
@@ -46,5 +44,5 @@
46
44
  "publishConfig": {
47
45
  "access": "public"
48
46
  },
49
- "gitHead": "274d896b03703139da2bfeab8ab32652f6b4c1e2"
47
+ "gitHead": "10669ef6d5ebf454feb4eddb9aa4ca7bc8f439dc"
50
48
  }
package/types/index.d.ts CHANGED
@@ -5,7 +5,6 @@ export interface DropdownProps
5
5
  children?: React.ReactNode;
6
6
  className?: string;
7
7
  inline?: boolean;
8
- dark?: boolean;
9
8
  innerRef?: React.Ref<HTMLSelectElement>;
10
9
  }
11
10
 
package/CHANGELOG.md DELETED
@@ -1,399 +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.1.5](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@5.1.4...@sb1/ffe-dropdown-react@5.1.5) (2021-03-15)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **ffe-dropdown-react:** broadens version of peer dependencies ([09f3640](https://github.com/SpareBank1/designsystem/commit/09f364091814ca77e5f4c7a8b18c2a3c4a27b02c))
12
-
13
-
14
-
15
-
16
-
17
- ## [5.1.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@5.1.3...@sb1/ffe-dropdown-react@5.1.4) (2021-02-03)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * packages/ffe-dropdown-react/package.json to reduce vulnerabilities ([9493e8c](https://github.com/SpareBank1/designsystem/commit/9493e8cd7fe5d970f16cd910d03a25f14f954478))
23
-
24
-
25
-
26
-
27
-
28
- ## [5.1.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@5.1.2...@sb1/ffe-dropdown-react@5.1.3) (2021-02-02)
29
-
30
-
31
- ### Bug Fixes
32
-
33
- * **ffe-dropdown-react:** reduce vulnerabilities ([f0eb019](https://github.com/SpareBank1/designsystem/commit/f0eb01913c24163a04c3c3346481cf1fc40f6758))
34
-
35
-
36
-
37
-
38
-
39
- ## [5.1.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@5.1.1...@sb1/ffe-dropdown-react@5.1.2) (2020-02-10)
40
-
41
- ### Bug Fixes
42
-
43
- - **ffe-dropdown-react:** fixing incorrect types ([64b7adc](https://github.com/SpareBank1/designsystem/commit/64b7adcd8ba518351bc7570306df5efceeab4ff1))
44
-
45
- ## [5.1.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@5.1.0...@sb1/ffe-dropdown-react@5.1.1) (2020-01-16)
46
-
47
- ### Bug Fixes
48
-
49
- - **ffe-dropdown-react:** fixed type definition of innerref ([16caf9c](https://github.com/SpareBank1/designsystem/commit/16caf9ced84d5d069d8e5682d4fefff8c2af8833))
50
-
51
- # [5.1.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@5.0.0...@sb1/ffe-dropdown-react@5.1.0) (2020-01-08)
52
-
53
- ### Features
54
-
55
- - **ffe-dropdown-react:** added optional property innerref ([4867d27](https://github.com/SpareBank1/designsystem/commit/4867d27a61a7549de9a1258d94b8d2e6a455531d))
56
-
57
- # [5.0.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.2.2...@sb1/ffe-dropdown-react@5.0.0) (2019-08-27)
58
-
59
- ### chore
60
-
61
- - bump React to 16.9 to allow for using hooks etc ([e3901f1](https://github.com/SpareBank1/designsystem/commit/e3901f1))
62
-
63
- ### BREAKING CHANGES
64
-
65
- - peerDep of React is raised to 16.9. While this in itself
66
- isn't a breaking change, it allows for the use of hooks in later releases.
67
- Such changes would just be a minor version, or even a patch, but without
68
- this major version bump it would result in a runtime error for consumers.
69
-
70
- ## [4.2.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.2.1...@sb1/ffe-dropdown-react@4.2.2) (2019-06-26)
71
-
72
- **Note:** Version bump only for package @sb1/ffe-dropdown-react
73
-
74
- ## [4.2.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.2.0...@sb1/ffe-dropdown-react@4.2.1) (2019-05-21)
75
-
76
- ### Bug Fixes
77
-
78
- - **ffe-dropdown-react:** ffe-form compat ([d52f3bf](https://github.com/SpareBank1/designsystem/commit/d52f3bf))
79
-
80
- # [4.2.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.1.4...@sb1/ffe-dropdown-react@4.2.0) (2019-05-10)
81
-
82
- ### Features
83
-
84
- - **ffe-dropdown-react:** Added type definitions for typescript ([9e91e0c](https://github.com/SpareBank1/designsystem/commit/9e91e0c))
85
-
86
- ## [4.1.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.1.3...@sb1/ffe-dropdown-react@4.1.4) (2018-12-11)
87
-
88
- ### Bug Fixes
89
-
90
- - Build tree shakeable packages ([fb4a9ea](https://github.com/SpareBank1/designsystem/commit/fb4a9ea))
91
-
92
- ## [4.1.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.1.2...@sb1/ffe-dropdown-react@4.1.3) (2018-12-04)
93
-
94
- **Note:** Version bump only for package @sb1/ffe-dropdown-react
95
-
96
- ## [4.1.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.1.1...@sb1/ffe-dropdown-react@4.1.2) (2018-11-26)
97
-
98
- **Note:** Version bump only for package @sb1/ffe-dropdown-react
99
-
100
- ## [4.1.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.1.0...@sb1/ffe-dropdown-react@4.1.1) (2018-11-09)
101
-
102
- **Note:** Version bump only for package @sb1/ffe-dropdown-react
103
-
104
- # [4.1.0](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.0.4...@sb1/ffe-dropdown-react@4.1.0) (2018-10-25)
105
-
106
- ### Bug Fixes
107
-
108
- - **ffe-dropdown-react:** Added defaultProps false for dark variant. ([69d109b](https://github.com/SpareBank1/designsystem/commit/69d109b))
109
-
110
- ### Features
111
-
112
- - **ffe-dropdown-react:** Added dark property with documentation ([28bc5f4](https://github.com/SpareBank1/designsystem/commit/28bc5f4))
113
-
114
- <a name="4.0.4"></a>
115
-
116
- ## [4.0.4](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.0.3...@sb1/ffe-dropdown-react@4.0.4) (2018-08-09)
117
-
118
- **Note:** Version bump only for package @sb1/ffe-dropdown-react
119
-
120
- <a name="4.0.3"></a>
121
-
122
- ## [4.0.3](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.0.2...@sb1/ffe-dropdown-react@4.0.3) (2018-03-27)
123
-
124
- **Note:** Version bump only for package @sb1/ffe-dropdown-react
125
-
126
- <a name="4.0.2"></a>
127
-
128
- ## [4.0.2](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.0.0...@sb1/ffe-dropdown-react@4.0.2) (2018-03-07)
129
-
130
- ### Bug Fixes
131
-
132
- - Correct peerDependencies after breaking change ([aab59ce](https://github.com/SpareBank1/designsystem/commit/aab59ce))
133
-
134
- <a name="4.0.1"></a>
135
-
136
- ## [4.0.1](https://github.com/SpareBank1/designsystem/compare/@sb1/ffe-dropdown-react@4.0.0...@sb1/ffe-dropdown-react@4.0.1) (2018-03-02)
137
-
138
- ### Bug Fixes
139
-
140
- - Correct peerDependencies after breaking change ([4318363](https://github.com/SpareBank1/designsystem/commit/4318363))
141
-
142
- <a name="4.0.0"></a>
143
-
144
- # 4.0.0 (2018-02-25)
145
-
146
- ### Bug Fixes
147
-
148
- - **ffe-dropdown-react:** Add missing proptypes check ([77bb118](https://github.com/SpareBank1/designsystem/commit/77bb118))
149
-
150
- ### Chores
151
-
152
- - **ffe-dropdown-react:** Import ffe-dropdown-react ([9234074](https://github.com/SpareBank1/designsystem/commit/9234074))
153
- - add [@sb1](https://github.com/sb1)/ scope to all packages ([37efbb4](https://github.com/SpareBank1/designsystem/commit/37efbb4))
154
-
155
- ### BREAKING CHANGES
156
-
157
- - All packages have been renamed to add the @sb1 scope.
158
-
159
- See links [1] and [2] to read more about package scopes.
160
-
161
- Unfortunately this requires you update both your dependencies in
162
- `package.json` and all `import` or `require` statements in your code.
163
- Also, you unfortunately have to upgrade all FFE packages at once due to
164
- dependency between packages. If you are on the latest version prior to
165
- this breaking change the upgrade should be a matter of updating
166
- `package.json` with new package names and versions, and updating your
167
- imports.
168
-
169
- To help find the proper package versions you can either browse to the
170
- packages you need or check out the list of Git tags either on
171
- Github [3] or by cloning the repository and running the `git tag`
172
- command. All package versions get a tag in the format
173
- _package@version_.
174
-
175
- Update your `package.json` with the latest package version and add the
176
- @sb1 scope to the package name:
177
-
178
- ```diff
179
- - "ffe-core": "11.0.2",
180
- + "@sb1/ffe-core": "11.0.2",
181
- ```
182
-
183
- Scoped packages all get put in a subdirectory in `node_modules/`. In our
184
- case packages will be put in the `node_modules/@sb1/` directory. If your
185
- build depends on file paths (for instance for copying fonts) you need to
186
- update that path to include the scope.
187
-
188
- The directory structure also means you have to update your imports, both
189
- in Less and in JavaScript.
190
-
191
- Using `less-plugin-npm-import`:
192
-
193
- ```diff
194
- - @import 'npm://ffe-core/less/ffe';
195
- + @import 'npm://@sb1/ffe-core/less/ffe';
196
- ```
197
-
198
- Using Webpack:
199
-
200
- ```diff
201
- - @import '~ffe-core/less/ffe';
202
- + @import '~@sb1/ffe-core/less/ffe';
203
- ```
204
-
205
- Using plain old paths:
206
-
207
- ```diff
208
- - @import '../path/to/node_modules/ffe-core/less/ffe';
209
- + @import '../path/to/node_modules/@sb1/ffe-core/less/ffe';
210
- ```
211
-
212
- JavaScript `import`:
213
-
214
- ```diff
215
- - import { ActionButton } from 'ffe-buttons-react';
216
- + import { ActionButton } from '@sb1/ffe-buttons-react';
217
- ```
218
-
219
- JavaScript `require`:
220
-
221
- ```diff
222
- - const { ActionButton } = require('ffe-buttons-react').default;
223
- + const { ActionButton } = require('@sb1/ffe-buttons-react').default;
224
- ```
225
-
226
- [1]: https://docs.npmjs.com/misc/scope
227
- [2]: https://docs.npmjs.com/getting-started/scoped-packages
228
- [3]: https://github.com/sparebank1/designsystem/tags
229
-
230
- - **ffe-dropdown-react:** Simplify the ffe-dropdown-react implementation.
231
-
232
- This commit simplifies the component, and leaves more of the
233
- compositional power to the consumer.
234
-
235
- In order to migrate to this new major, the consumer should wrap
236
- their existing component in `ffe-form-react`'s `InputGroup`
237
- component. This will provide most of the functionality that this
238
- major removes from `ffe-dropdown-react`. Please refer to the
239
- documentation for new usage information.
240
-
241
- <a name="3.0.7"></a>
242
-
243
- ## [3.0.7](https://github.com/SpareBank1/designsystem/compare/ffe-dropdown-react@3.0.6...ffe-dropdown-react@3.0.7) (2018-02-23)
244
-
245
- **Note:** Version bump only for package ffe-dropdown-react
246
-
247
- <a name="3.0.6"></a>
248
-
249
- ## [3.0.6](https://github.com/SpareBank1/designsystem/compare/ffe-dropdown-react@3.0.5...ffe-dropdown-react@3.0.6) (2018-02-22)
250
-
251
- **Note:** Version bump only for package ffe-dropdown-react
252
-
253
- <a name="3.0.5"></a>
254
-
255
- ## [3.0.5](https://github.com/SpareBank1/designsystem/compare/ffe-dropdown-react@3.0.4...ffe-dropdown-react@3.0.5) (2018-01-22)
256
-
257
- **Note:** Version bump only for package ffe-dropdown-react
258
-
259
- <a name="3.0.4"></a>
260
-
261
- ## [3.0.4](https://github.com/SpareBank1/designsystem/compare/ffe-dropdown-react@3.0.3...ffe-dropdown-react@3.0.4) (2018-01-22)
262
-
263
- ### Bug Fixes
264
-
265
- - **ffe-dropdown-react:** Add missing proptypes check
266
-
267
- <a name="3.0.3"></a>
268
-
269
- ## [3.0.3](https://github.com/SpareBank1/designsystem/compare/ffe-dropdown-react@3.0.2...ffe-dropdown-react@3.0.3) (2018-01-19)
270
-
271
- **Note:** Version bump only for package ffe-dropdown-react
272
-
273
- <a name="3.0.2"></a>
274
-
275
- ## [3.0.2](https://github.com/SpareBank1/designsystem/compare/ffe-dropdown-react@3.0.1...ffe-dropdown-react@3.0.2) (2018-01-18)
276
-
277
- **Note:** Version bump only for package ffe-dropdown-react
278
-
279
- <a name="3.0.1"></a>
280
-
281
- ## [3.0.1](https://github.com/SpareBank1/designsystem/compare/ffe-dropdown-react@3.0.0...ffe-dropdown-react@3.0.1) (2018-01-12)
282
-
283
- **Note:** Version bump only for package ffe-dropdown-react
284
-
285
- <a name="3.0.0"></a>
286
-
287
- # 3.0.0 (2018-01-12)
288
-
289
- ### Chores
290
-
291
- - **ffe-dropdown-react:** Import ffe-dropdown-react
292
-
293
- ### BREAKING CHANGES
294
-
295
- - **ffe-dropdown-react:** Simplify the ffe-dropdown-react implementation.
296
-
297
- This commit simplifies the component, and leaves more of the
298
- compositional power to the consumer.
299
-
300
- In order to migrate to this new major, the consumer should wrap
301
- their existing component in `ffe-form-react`'s `InputGroup`
302
- component. This will provide most of the functionality that this
303
- major removes from `ffe-dropdown-react`. Please refer to the
304
- documentation for new usage information.
305
-
306
- ## 2.9.2
307
-
308
- - Setting the default behaviour to tabbable.
309
-
310
- ## 2.9.1
311
-
312
- - Add support for version 8 of `ffe-form`.
313
- - Specify version of `React`-related packages to `15.x`
314
-
315
- # 2.9.0
316
-
317
- - Added support for `isTabbable`
318
-
319
- ## 2.8.1
320
-
321
- - Use PropTypes from prop-types package
322
-
323
- # 2.8.0
324
-
325
- - Increased version range for ffe-form.
326
-
327
- # 2.7.0
328
-
329
- - Pass through (almost) all `props` passed to `Dropdown` directly to `select`. Then we can use the component more like the native ones.
330
- - Remove `aria-live="polite"` from the wrapping input group.
331
-
332
- ## 2.6.1
333
-
334
- - Expand peerDep scope of `ffe-form` to include `5.x`.
335
- - Remove peerDep on `ffe-core` and `ffe-spinner`.
336
-
337
- # 2.6.0
338
-
339
- - Added support for autoFocus attribute
340
-
341
- ## 2.5.2
342
-
343
- - Use latest FFE eslint config
344
-
345
- ## 2.5.1
346
-
347
- - Added support for ffe-form version 4.x.x
348
-
349
- # 2.5.0
350
-
351
- - Added support for `name` property
352
-
353
- ## 2.4.2
354
-
355
- - Added ffe-form-label--block to label
356
-
357
- ## 2.4.1
358
-
359
- - Added support for ffe-form version 3.x.x
360
-
361
- # 2.4.0
362
-
363
- - Added added support for css styling of container-div, using prop containerClassName
364
-
365
- # 2.3.0
366
-
367
- - Added onBlur support
368
-
369
- # 2.2.0
370
-
371
- - Relaxing the peer dependency on `ffe-form` to allow both 1.x and 2.x
372
-
373
- # 2.1.0
374
-
375
- - Removed dependency on ffe-dropdown - styling in ffe-dropdown has been moved to ffe-form
376
- - Bumped dependency on ffe-form
377
-
378
- # 2.0.0
379
-
380
- - Bumped dependency on `ffe-core` to `^8.0.2`
381
- - Added peerDependency on `ffe-form`, `ffe-spinner` and `ffe-dropdown`
382
- - Added a budo example page that can be launched with `npm start`
383
- - Fixed error message class by updating to `.ffe-field-error-message`
384
-
385
- # 1.8.0
386
-
387
- - Add isLoading support
388
-
389
- # 1.7.0
390
-
391
- - Add custom className support
392
-
393
- # 1.6.0
394
-
395
- - Add error message support
396
-
397
- # 1.5.0 (16.6.2016)
398
-
399
- - Add `defaultValue` property.
@@ -1,42 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import Dropdown from './Dropdown';
4
-
5
- var getWrapper = function getWrapper(props) {
6
- return shallow( /*#__PURE__*/React.createElement(Dropdown, props, /*#__PURE__*/React.createElement("option", null, "Option 1"), /*#__PURE__*/React.createElement("option", null, "Option 2")));
7
- };
8
-
9
- describe('<Dropdown />', function () {
10
- it('renders a select', function () {
11
- var wrapper = getWrapper();
12
- expect(wrapper.is('select')).toBe(true);
13
- expect(wrapper.hasClass('ffe-dropdown')).toBe(true);
14
- });
15
- it('renders children inside the select', function () {
16
- var wrapper = getWrapper();
17
- expect(wrapper.find('option')).toHaveLength(2);
18
- });
19
- it('sets the inline modifier class', function () {
20
- var wrapper = getWrapper();
21
- expect(wrapper.hasClass('ffe-dropdown--inline')).toBe(false);
22
- wrapper.setProps({
23
- inline: true
24
- });
25
- expect(wrapper.hasClass('ffe-dropdown--inline')).toBe(true);
26
- });
27
- it('adds additional classes', function () {
28
- var wrapper = getWrapper({
29
- className: 'custom-test-class'
30
- });
31
- expect(wrapper.hasClass('custom-test-class')).toBe(true);
32
- expect(wrapper.hasClass('ffe-dropdown')).toBe(true);
33
- });
34
- it('passes on any props to the <select />', function () {
35
- var wrapper = getWrapper({
36
- 'aria-invalid': 'true',
37
- disabled: 'true'
38
- });
39
- expect(wrapper.find('select').prop('aria-invalid')).toBe('true');
40
- expect(wrapper.find('select').prop('disabled')).toBe('true');
41
- });
42
- });
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _enzyme = require("enzyme");
6
-
7
- var _Dropdown = _interopRequireDefault(require("./Dropdown"));
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- var getWrapper = function getWrapper(props) {
12
- return (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_Dropdown.default, props, /*#__PURE__*/_react.default.createElement("option", null, "Option 1"), /*#__PURE__*/_react.default.createElement("option", null, "Option 2")));
13
- };
14
-
15
- describe('<Dropdown />', function () {
16
- it('renders a select', function () {
17
- var wrapper = getWrapper();
18
- expect(wrapper.is('select')).toBe(true);
19
- expect(wrapper.hasClass('ffe-dropdown')).toBe(true);
20
- });
21
- it('renders children inside the select', function () {
22
- var wrapper = getWrapper();
23
- expect(wrapper.find('option')).toHaveLength(2);
24
- });
25
- it('sets the inline modifier class', function () {
26
- var wrapper = getWrapper();
27
- expect(wrapper.hasClass('ffe-dropdown--inline')).toBe(false);
28
- wrapper.setProps({
29
- inline: true
30
- });
31
- expect(wrapper.hasClass('ffe-dropdown--inline')).toBe(true);
32
- });
33
- it('adds additional classes', function () {
34
- var wrapper = getWrapper({
35
- className: 'custom-test-class'
36
- });
37
- expect(wrapper.hasClass('custom-test-class')).toBe(true);
38
- expect(wrapper.hasClass('ffe-dropdown')).toBe(true);
39
- });
40
- it('passes on any props to the <select />', function () {
41
- var wrapper = getWrapper({
42
- 'aria-invalid': 'true',
43
- disabled: 'true'
44
- });
45
- expect(wrapper.find('select').prop('aria-invalid')).toBe('true');
46
- expect(wrapper.find('select').prop('disabled')).toBe('true');
47
- });
48
- });