@panneau/action-upload 3.0.310 → 4.0.1

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 (2) hide show
  1. package/es/index.js +16 -40
  2. package/package.json +7 -7
package/es/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
- import PropTypes from 'prop-types';
3
2
  import React, { useCallback } from 'react';
4
3
  import { FormattedMessage } from 'react-intl';
5
4
  import { useFieldsComponentsManager } from '@panneau/core/contexts';
@@ -8,45 +7,24 @@ var _excluded = ["endpoint", "action", "label", "value", "icon", "theme", "disab
8
7
 
9
8
  // TODO: figure out what happens when an item / multiple items are selected
10
9
 
11
- var propTypes = {
12
- // eslint-disable-next-line react/no-unused-prop-types
13
- id: PropTypes.string,
14
- endpoint: PropTypes.string,
15
- action: PropTypes.func,
16
- // Promise
17
- label: PropTypes.string,
18
- value: PropTypes.shape({}),
19
- icon: PropTypes.string,
20
- theme: PropTypes.string,
21
- disabled: PropTypes.bool,
22
- fieldComponent: PropTypes.string,
23
- onConfirmed: PropTypes.func,
24
- className: PropTypes.string
25
- };
26
- var defaultProps = {
27
- id: null,
28
- endpoint: '/import',
29
- action: null,
30
- label: null,
31
- value: null,
32
- icon: 'upload',
33
- theme: 'primary',
34
- disabled: false,
35
- fieldComponent: 'upload',
36
- onConfirmed: null,
37
- className: null
38
- };
39
- var UploadAction = function UploadAction(_ref) {
10
+ function UploadAction(_ref) {
40
11
  _ref.endpoint;
41
12
  _ref.action;
42
- var label = _ref.label;
13
+ var _ref$label = _ref.label,
14
+ label = _ref$label === void 0 ? null : _ref$label;
43
15
  _ref.value;
44
- var icon = _ref.icon,
45
- theme = _ref.theme,
46
- disabled = _ref.disabled,
47
- onConfirmed = _ref.onConfirmed,
48
- fieldComponent = _ref.fieldComponent,
49
- className = _ref.className,
16
+ var _ref$icon = _ref.icon,
17
+ icon = _ref$icon === void 0 ? 'upload' : _ref$icon,
18
+ _ref$theme = _ref.theme,
19
+ theme = _ref$theme === void 0 ? 'primary' : _ref$theme,
20
+ _ref$disabled = _ref.disabled,
21
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
22
+ _ref$onConfirmed = _ref.onConfirmed,
23
+ onConfirmed = _ref$onConfirmed === void 0 ? null : _ref$onConfirmed,
24
+ _ref$fieldComponent = _ref.fieldComponent,
25
+ fieldComponent = _ref$fieldComponent === void 0 ? 'upload' : _ref$fieldComponent,
26
+ _ref$className = _ref.className,
27
+ className = _ref$className === void 0 ? null : _ref$className,
50
28
  props = _objectWithoutProperties(_ref, _excluded);
51
29
  var FieldComponents = useFieldsComponentsManager();
52
30
  var FieldComponent = FieldComponents.getComponent(fieldComponent);
@@ -71,8 +49,6 @@ var UploadAction = function UploadAction(_ref) {
71
49
  disabled: disabled,
72
50
  className: className
73
51
  }, props));
74
- };
75
- UploadAction.propTypes = propTypes;
76
- UploadAction.defaultProps = defaultProps;
52
+ }
77
53
 
78
54
  export { UploadAction as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/action-upload",
3
- "version": "3.0.310",
3
+ "version": "4.0.1",
4
4
  "description": "Upload action",
5
5
  "keywords": [
6
6
  "javascript"
@@ -49,16 +49,16 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.12.5",
52
- "@panneau/core": "^3.0.307",
53
- "@panneau/element-button": "^3.0.308",
54
- "@panneau/field-upload": "^3.0.310",
55
- "@panneau/themes": "^3.0.308",
52
+ "@panneau/core": "^4.0.1",
53
+ "@panneau/element-button": "^4.0.1",
54
+ "@panneau/field-upload": "^4.0.1",
55
+ "@panneau/themes": "^4.0.1",
56
56
  "classnames": "^2.5.1",
57
57
  "prop-types": "^15.7.2",
58
- "react-intl": "^5.15.8||^6.0.0"
58
+ "react-intl": "^5.15.8 || ^6.0.0 || ^7.0.0"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "d7d8937d48a4f972a8fa742256267f6b4aaf3f4f"
63
+ "gitHead": "dbdf65640625c027ecd56cf2b816b80a5c38cb8d"
64
64
  }