@conform-to/react 0.4.0-pre.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,13 @@
1
1
  function ownKeys(object, enumerableOnly) {
2
2
  var keys = Object.keys(object);
3
-
4
3
  if (Object.getOwnPropertySymbols) {
5
4
  var symbols = Object.getOwnPropertySymbols(object);
6
5
  enumerableOnly && (symbols = symbols.filter(function (sym) {
7
6
  return Object.getOwnPropertyDescriptor(object, sym).enumerable;
8
7
  })), keys.push.apply(keys, symbols);
9
8
  }
10
-
11
9
  return keys;
12
10
  }
13
-
14
11
  function _objectSpread2(target) {
15
12
  for (var i = 1; i < arguments.length; i++) {
16
13
  var source = null != arguments[i] ? arguments[i] : {};
@@ -20,10 +17,8 @@ function _objectSpread2(target) {
20
17
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
21
18
  });
22
19
  }
23
-
24
20
  return target;
25
21
  }
26
-
27
22
  function _defineProperty(obj, key, value) {
28
23
  if (key in obj) {
29
24
  Object.defineProperty(obj, key, {
@@ -35,7 +30,6 @@ function _defineProperty(obj, key, value) {
35
30
  } else {
36
31
  obj[key] = value;
37
32
  }
38
-
39
33
  return obj;
40
34
  }
41
35
 
package/module/helpers.js CHANGED
@@ -17,23 +17,19 @@ function input(config) {
17
17
  pattern: config.pattern,
18
18
  multiple: config.multiple
19
19
  };
20
-
21
20
  if (config.initialError && config.initialError.length > 0) {
22
21
  attributes.autoFocus = true;
23
22
  }
24
-
25
23
  if (isCheckboxOrRadio) {
26
24
  attributes.value = value !== null && value !== void 0 ? value : 'on';
27
25
  attributes.defaultChecked = config.defaultValue === attributes.value;
28
26
  } else {
29
27
  attributes.defaultValue = config.defaultValue;
30
28
  }
31
-
32
29
  return attributes;
33
30
  }
34
31
  function select(config) {
35
32
  var _config$defaultValue;
36
-
37
33
  var attributes = {
38
34
  name: config.name,
39
35
  form: config.form,
@@ -41,16 +37,13 @@ function select(config) {
41
37
  required: config.required,
42
38
  multiple: config.multiple
43
39
  };
44
-
45
40
  if (config.initialError && config.initialError.length > 0) {
46
41
  attributes.autoFocus = true;
47
42
  }
48
-
49
43
  return attributes;
50
44
  }
51
45
  function textarea(config) {
52
46
  var _config$defaultValue2;
53
-
54
47
  var attributes = {
55
48
  name: config.name,
56
49
  form: config.form,
@@ -60,11 +53,9 @@ function textarea(config) {
60
53
  maxLength: config.maxLength,
61
54
  autoFocus: Boolean(config.initialError)
62
55
  };
63
-
64
56
  if (config.initialError && config.initialError.length > 0) {
65
57
  attributes.autoFocus = true;
66
58
  }
67
-
68
59
  return attributes;
69
60
  }
70
61