@sb1/ffe-form-react 9.0.0 → 9.0.4

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.
Files changed (43) hide show
  1. package/es/BaseRadioButton.js +3 -3
  2. package/es/PhoneNumber.js +3 -3
  3. package/es/RadioBlock.js +3 -3
  4. package/es/RadioButtonInputGroup.js +2 -2
  5. package/es/Tooltip.js +3 -3
  6. package/lib/BaseRadioButton.js +3 -3
  7. package/lib/Checkbox.js +1 -1
  8. package/lib/InputGroup.js +1 -1
  9. package/lib/PhoneNumber.js +3 -3
  10. package/lib/RadioBlock.js +3 -3
  11. package/lib/RadioButtonInputGroup.js +2 -2
  12. package/lib/RadioSwitch.js +1 -1
  13. package/lib/Tooltip.js +3 -3
  14. package/package.json +9 -11
  15. package/types/index.d.ts +1 -1
  16. package/es/BaseFieldMessage.spec.js +0 -31
  17. package/es/BaseRadioButton.spec.js +0 -136
  18. package/es/Checkbox.spec.js +0 -109
  19. package/es/ErrorFieldMessage.spec.js +0 -15
  20. package/es/InfoFieldMessage.spec.js +0 -15
  21. package/es/Input.spec.js +0 -49
  22. package/es/InputGroup.spec.js +0 -245
  23. package/es/Label.spec.js +0 -41
  24. package/es/PhoneNumber.spec.js +0 -102
  25. package/es/RadioBlock.spec.js +0 -74
  26. package/es/RadioButtonInputGroup.spec.js +0 -170
  27. package/es/RadioSwitch.spec.js +0 -105
  28. package/es/SuccessFieldMessage.spec.js +0 -15
  29. package/es/Tooltip.spec.js +0 -68
  30. package/lib/BaseFieldMessage.spec.js +0 -37
  31. package/lib/BaseRadioButton.spec.js +0 -143
  32. package/lib/Checkbox.spec.js +0 -115
  33. package/lib/ErrorFieldMessage.spec.js +0 -21
  34. package/lib/InfoFieldMessage.spec.js +0 -21
  35. package/lib/Input.spec.js +0 -55
  36. package/lib/InputGroup.spec.js +0 -257
  37. package/lib/Label.spec.js +0 -48
  38. package/lib/PhoneNumber.spec.js +0 -108
  39. package/lib/RadioBlock.spec.js +0 -81
  40. package/lib/RadioButtonInputGroup.spec.js +0 -179
  41. package/lib/RadioSwitch.spec.js +0 -113
  42. package/lib/SuccessFieldMessage.spec.js +0 -21
  43. package/lib/Tooltip.spec.js +0 -76
@@ -1,4 +1,4 @@
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
  var _excluded = ["aria-invalid", "children", "checked", "className", "labelProps", "selectedValue", "tooltip", "tooltipProps", "value", "innerRef"];
4
4
 
@@ -12,9 +12,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
12
12
 
13
13
  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); } }
14
14
 
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
15
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
16
 
17
- 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); }
17
+ 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); }
18
18
 
19
19
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
20
 
package/es/PhoneNumber.js CHANGED
@@ -1,12 +1,12 @@
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
 
package/es/RadioBlock.js CHANGED
@@ -1,4 +1,4 @@
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
  var _excluded = ["checked", "children", "className", "innerRef", "label", "labelClass", "name", "selectedValue", "showChildren", "value"];
4
4
 
@@ -12,9 +12,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
12
12
 
13
13
  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); } }
14
14
 
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
15
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
16
 
17
- 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); }
17
+ 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); }
18
18
 
19
19
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
20
 
@@ -2,9 +2,9 @@ var _excluded = ["aria-invalid", "children", "className", "extraMargin", "descri
2
2
 
3
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); }
4
4
 
5
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
 
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
9
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
10
 
package/es/Tooltip.js CHANGED
@@ -1,4 +1,4 @@
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
  var _excluded = ["aria-controls", "aria-label", "children", "className", "onClick", "tabIndex"];
4
4
 
@@ -12,9 +12,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
12
12
 
13
13
  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); } }
14
14
 
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
15
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
16
 
17
- 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); }
17
+ 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); }
18
18
 
19
19
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
20
 
@@ -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
@@ -35,9 +35,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
35
35
 
36
36
  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); } }
37
37
 
38
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
38
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
39
39
 
40
- 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); }
40
+ 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); }
41
41
 
42
42
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
43
43
 
package/lib/Checkbox.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
package/lib/InputGroup.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
@@ -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
@@ -25,9 +25,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
25
25
 
26
26
  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); } }
27
27
 
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
29
 
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
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
32
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
33
 
package/lib/RadioBlock.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
@@ -33,9 +33,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
33
33
 
34
34
  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); } }
35
35
 
36
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
36
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
37
 
38
- 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); }
38
+ 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); }
39
39
 
40
40
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
41
 
@@ -21,9 +21,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
21
21
 
22
22
  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); }
23
23
 
24
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
24
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
25
 
26
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
27
 
28
28
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
29
 
@@ -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
package/lib/Tooltip.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
@@ -31,9 +31,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
31
31
 
32
32
  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); } }
33
33
 
34
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
34
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
35
35
 
36
- 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); }
36
+ 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); }
37
37
 
38
38
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-form-react",
3
- "version": "9.0.0",
3
+ "version": "9.0.4",
4
4
  "description": "React component for form elements in ffe",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
@@ -18,11 +18,8 @@
18
18
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
19
19
  },
20
20
  "scripts": {
21
- "build": "npm run build:cjs && npm run build:es && npm run build:types",
22
- "build:cjs": "babel -d lib/. --root-mode=upward --env-name=cjs --ignore=*.spec.js src/.",
23
- "build:es": "babel -d es/. --root-mode=upward --env-name=es --ignore=*.spec.js src/.",
24
- "build:types": "copyfiles -f src/index.d.ts types/",
25
- "lint": "eslint src/.",
21
+ "build": "ffe-buildtool babel",
22
+ "lint": "eslint src",
26
23
  "test": "jest",
27
24
  "test:watch": "jest --watch"
28
25
  },
@@ -30,16 +27,17 @@
30
27
  "setupTestFrameworkScriptFile": "../../test-setup.js"
31
28
  },
32
29
  "dependencies": {
33
- "@sb1/ffe-collapse-react": "^1.1.6",
34
- "classnames": "^2.2.5",
35
- "uuid": "^8.0.0"
30
+ "@sb1/ffe-collapse-react": "^1.1.9",
31
+ "classnames": "^2.3.1",
32
+ "uuid": "^8.3.2"
36
33
  },
37
34
  "devDependencies": {
35
+ "@sb1/ffe-buildtool": "^0.2.0",
38
36
  "enzyme": "^3.7.0",
39
37
  "enzyme-adapter-react-16": "^1.7.0",
40
38
  "eslint": "^5.9.0",
41
39
  "jest": "^26.0.0",
42
- "prop-types": "^15.6.0",
40
+ "prop-types": "^15.7.2",
43
41
  "react": "^16.9.0",
44
42
  "react-dom": "^16.9.0",
45
43
  "react-motion": "^0.5.2",
@@ -54,5 +52,5 @@
54
52
  "publishConfig": {
55
53
  "access": "public"
56
54
  },
57
- "gitHead": "21dd36e1ae3ba1d6801e783f89df347908aa7481"
55
+ "gitHead": "8b55807a4d7a475c277e7b621b76cc28160191f7"
58
56
  }
package/types/index.d.ts CHANGED
@@ -120,7 +120,7 @@ export interface RadioButtonInputGroupProps extends WeakFieldSetAttributes {
120
120
  fieldMessage?: string | React.ReactNode;
121
121
  inline?: boolean;
122
122
  label?: string | React.ReactNode;
123
- name?: string;
123
+ name: string;
124
124
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
125
125
  selectedValue?: string | boolean | number;
126
126
  tooltip?: string | React.ReactNode;
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import BaseFieldMessage from './BaseFieldMessage';
4
-
5
- var getWrapper = function getWrapper(props) {
6
- return shallow( /*#__PURE__*/React.createElement(BaseFieldMessage, props, "Field message"));
7
- };
8
-
9
- describe('<BaseFieldMessage>', function () {
10
- it('renders the correct class name based on type prop', function () {
11
- var wrapper = getWrapper({
12
- type: 'error'
13
- });
14
- expect(wrapper.exists()).toBe(true);
15
- expect(wrapper.hasClass('ffe-field-error-message')).toBe(true);
16
- });
17
- it('renders the correct class name based on type prop', function () {
18
- var wrapper = getWrapper({
19
- type: 'info'
20
- });
21
- expect(wrapper.exists()).toBe(true);
22
- expect(wrapper.hasClass('ffe-field-info-message')).toBe(true);
23
- });
24
- it('renders the correct class name based on type prop', function () {
25
- var wrapper = getWrapper({
26
- type: 'success'
27
- });
28
- expect(wrapper.exists()).toBe(true);
29
- expect(wrapper.hasClass('ffe-field-success-message')).toBe(true);
30
- });
31
- });
@@ -1,136 +0,0 @@
1
- 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
-
3
- import React from 'react';
4
- import { shallow } from 'enzyme';
5
- import BaseRadioButton from './BaseRadioButton';
6
- var defaultProps = {
7
- children: 'Some choice',
8
- name: 'choice',
9
- value: 'value'
10
- };
11
-
12
- var getWrapper = function getWrapper(props) {
13
- return shallow( /*#__PURE__*/React.createElement(BaseRadioButton, _extends({}, defaultProps, props)));
14
- };
15
-
16
- describe('<BaseRadioButton />', function () {
17
- it('renders without exploding', function () {
18
- var wrapper = getWrapper();
19
- expect(wrapper.exists()).toBe(true);
20
- });
21
- it('is checked undefined if checked prop is undefined and selectedValue is undefined', function () {
22
- var wrapper = getWrapper({});
23
- expect(wrapper.find('input').props()).toHaveProperty('checked', undefined);
24
- wrapper.setProps({
25
- checked: true
26
- });
27
- expect(wrapper.find('input').props()).toHaveProperty('checked', true);
28
- });
29
- it('is checked if checked prop is true', function () {
30
- var wrapper = getWrapper({
31
- checked: false
32
- });
33
- expect(wrapper.find('input').props()).toHaveProperty('checked', false);
34
- wrapper.setProps({
35
- checked: true
36
- });
37
- expect(wrapper.find('input').props()).toHaveProperty('checked', true);
38
- });
39
- it('is checked if selectedValue equals value', function () {
40
- var wrapper = getWrapper({
41
- selectedValue: 'other_value'
42
- });
43
- expect(wrapper.find('input').props()).toHaveProperty('checked', false);
44
- wrapper.setProps({
45
- selectedValue: 'value'
46
- });
47
- expect(wrapper.find('input').props()).toHaveProperty('checked', true);
48
- });
49
- it('is not checked if not checked and selectedValue !== value', function () {
50
- var wrapper = getWrapper({
51
- checked: false,
52
- selectedValue: 'nope'
53
- });
54
- expect(wrapper.find('input').props()).toHaveProperty('checked', false);
55
- });
56
- it('is not checked if checked === undefined and selectedValue is falsy, but not undefined', function () {
57
- var wrapperWithNull = getWrapper({
58
- selectedValue: null
59
- });
60
- expect(wrapperWithNull.find('input').props()).toHaveProperty('checked', false);
61
- var wrapperWithEmptyString = getWrapper({
62
- selectedValue: ''
63
- });
64
- expect(wrapperWithEmptyString.find('input').props()).toHaveProperty('checked', false);
65
- });
66
- it('accepts boolean values and checks the input if it is selected', function () {
67
- var wrapper = getWrapper({
68
- selectedValue: true,
69
- value: true
70
- });
71
- expect(wrapper.find('input').props()).toHaveProperty('checked', true);
72
- });
73
- it('accepts boolean values and does not check the input if it is not selected', function () {
74
- var wrapper = getWrapper({
75
- selectedValue: 'false',
76
- value: true
77
- });
78
- expect(wrapper.find('input').props()).toHaveProperty('checked', false);
79
- });
80
- describe('id', function () {
81
- it('is unique across instances', function () {
82
- var oneId = getWrapper().find('input').prop('id');
83
- var anotherId = getWrapper().find('input').prop('id');
84
- expect(oneId).not.toBe(anotherId);
85
- });
86
- it('is stable per instance', function () {
87
- var wrapper = getWrapper();
88
- var idBeforeUpdate = wrapper.find('input').prop('id');
89
- wrapper.setProps({
90
- selectedValue: 'red'
91
- });
92
- var idAfterUpdate = wrapper.find('input').prop('id');
93
- expect(idBeforeUpdate).toBe(idAfterUpdate);
94
- });
95
- });
96
- describe('tooltip', function () {
97
- it('does not render if not present', function () {
98
- var wrapper = getWrapper({
99
- tooltip: undefined
100
- });
101
- expect(wrapper.find('Tooltip').exists()).toBe(false);
102
- });
103
- it('renders if present', function () {
104
- var wrapper = getWrapper({
105
- tooltip: 'Tip generously'
106
- });
107
- expect(wrapper.find('Tooltip').exists()).toBe(true);
108
- });
109
- it('does not add the correct class if not present', function () {
110
- var wrapper = getWrapper({
111
- tooltip: undefined
112
- });
113
- expect(wrapper.find('.ffe-radio-button--with-tooltip').exists()).toBe(false);
114
- });
115
- it('adds the correct class if present', function () {
116
- var wrapper = getWrapper({
117
- tooltip: 'Tip generously'
118
- });
119
- expect(wrapper.find('.ffe-radio-button--with-tooltip').exists()).toBe(true);
120
- });
121
- });
122
- describe('aria-invalid', function () {
123
- it('does not add the class if false', function () {
124
- var wrapper = getWrapper({
125
- 'aria-invalid': 'false'
126
- });
127
- expect(wrapper.find('.ffe-radio-button--invalid').exists()).toBe(false);
128
- });
129
- it('adds the correct class if true', function () {
130
- var wrapper = getWrapper({
131
- 'aria-invalid': 'true'
132
- });
133
- expect(wrapper.find('.ffe-radio-button--invalid').exists()).toBe(true);
134
- });
135
- });
136
- });
@@ -1,109 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import Checkbox from './Checkbox';
4
-
5
- var getWrapper = function getWrapper(props) {
6
- return shallow( /*#__PURE__*/React.createElement(Checkbox, props));
7
- };
8
-
9
- describe('<Checkbox />', function () {
10
- it('should render a input', function () {
11
- var wrapper = getWrapper();
12
- expect(wrapper.find('input').exists()).toBe(true);
13
- });
14
- it('should call onChange when clicked', function () {
15
- var spy = jest.fn();
16
- var wrapper = getWrapper({
17
- onChange: spy
18
- });
19
- wrapper.find('input').simulate('change');
20
- expect(spy).toHaveBeenCalledTimes(1);
21
- });
22
- it('should call onChange with the correct parameter', function () {
23
- var mockEvent = {
24
- target: {
25
- value: true
26
- }
27
- };
28
- var spy = jest.fn();
29
- var wrapper = getWrapper({
30
- onChange: spy
31
- });
32
- wrapper.find('input').simulate('change', mockEvent);
33
- expect(spy.mock.calls[0][0]).toBe(mockEvent);
34
- });
35
- it('should render a default value if passed', function () {
36
- var wrapper = getWrapper();
37
- expect(wrapper.find('input').prop('checked')).toBe(undefined);
38
- wrapper = getWrapper({
39
- checked: true
40
- });
41
- expect(wrapper.find('input').prop('checked')).toBe(true);
42
- });
43
- it('should apply the same id to <label> and <input>', function () {
44
- var wrapper = getWrapper({
45
- name: 'Some text goes here'
46
- });
47
- expect(wrapper.find('label').prop('htmlFor')).toBe(wrapper.find('input').prop('id'));
48
- });
49
- it('should support noMargins', function () {
50
- var wrapper = getWrapper({
51
- noMargins: false
52
- });
53
- expect(wrapper.find('.ffe-checkbox--no-margin').exists()).toBe(false);
54
- wrapper.setProps({
55
- noMargins: true
56
- });
57
- expect(wrapper.find('.ffe-checkbox--no-margin').exists()).toBe(true);
58
- });
59
- it('should support inline', function () {
60
- var wrapper = getWrapper();
61
- expect(wrapper.find('.ffe-checkbox--inline').exists()).toBe(true);
62
- wrapper.setProps({
63
- inline: false
64
- });
65
- expect(wrapper.find('.ffe-checkbox--inline').exists()).toBe(false);
66
- wrapper.setProps({
67
- inline: true
68
- });
69
- expect(wrapper.find('.ffe-checkbox--inline').exists()).toBe(true);
70
- });
71
- it('should support aria-invalid', function () {
72
- var wrapper = getWrapper({
73
- 'aria-invalid': 'false'
74
- });
75
- expect(wrapper.find('input').prop('aria-invalid')).toBe('false');
76
- });
77
- it('should set arbitrary props (rest) on input', function () {
78
- var wrapper = getWrapper({
79
- name: 'checkbox',
80
- iDontReallyDoAnything: 'false',
81
- tabIndex: -1
82
- });
83
- expect(wrapper.find('input').prop('name')).toBe('checkbox');
84
- expect(wrapper.find('input').prop('iDontReallyDoAnything')).toBe('false');
85
- expect(wrapper.find('input').prop('tabIndex')).toBe(-1);
86
- });
87
- it('should render children if it is a function', function () {
88
- var wrapper = shallow( /*#__PURE__*/React.createElement(Checkbox, null, function (labelProps) {
89
- return (
90
- /*#__PURE__*/
91
- // eslint-disable-next-line jsx-a11y/label-has-for
92
- React.createElement("label", labelProps, "Hello world")
93
- );
94
- }));
95
- expect(wrapper.find('label').prop('children')).toBe('Hello world');
96
- });
97
- it('should render with a hidden label', function () {
98
- var wrapper = getWrapper({
99
- 'aria-label': 'I am label',
100
- hiddenLabel: true
101
- });
102
- var label = wrapper.find('.ffe-checkbox--hidden-label');
103
- var input = wrapper.find('.ffe-hidden-checkbox');
104
- expect(label.exists()).toBe(true);
105
- expect(label.children()).toHaveLength(0);
106
- expect(input.exists()).toBe(true);
107
- expect(input.prop('aria-label')).toBe('I am label');
108
- });
109
- });
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { mount } from 'enzyme';
3
- import ErrorFieldMessage from './ErrorFieldMessage';
4
-
5
- var getWrapper = function getWrapper() {
6
- return mount( /*#__PURE__*/React.createElement(ErrorFieldMessage, null, "Field message"));
7
- };
8
-
9
- describe('<ErrorFieldMessage>', function () {
10
- it('renders the correct class name based on type prop', function () {
11
- var wrapper = getWrapper();
12
- expect(wrapper.exists()).toBe(true);
13
- expect(wrapper.find('div').hasClass('ffe-field-error-message')).toBe(true);
14
- });
15
- });
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { mount } from 'enzyme';
3
- import InfoFieldMessage from './InfoFieldMessage';
4
-
5
- var getWrapper = function getWrapper() {
6
- return mount( /*#__PURE__*/React.createElement(InfoFieldMessage, null, "Field message"));
7
- };
8
-
9
- describe('<InfoFieldMessage>', function () {
10
- it('renders the correct class name based on type prop', function () {
11
- var wrapper = getWrapper();
12
- expect(wrapper.exists()).toBe(true);
13
- expect(wrapper.find('div').hasClass('ffe-field-info-message')).toBe(true);
14
- });
15
- });