@panneau/field-upload 3.0.192 → 3.0.194
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/index.js +7 -3
- package/lib/index.js +7 -3
- package/package.json +9 -9
package/es/index.js
CHANGED
|
@@ -51,6 +51,7 @@ var propTypes$1 = {
|
|
|
51
51
|
width: PropTypes.number,
|
|
52
52
|
height: PropTypes.number,
|
|
53
53
|
disabled: PropTypes.bool,
|
|
54
|
+
loading: PropTypes.bool,
|
|
54
55
|
onChange: PropTypes.func,
|
|
55
56
|
onClear: PropTypes.func,
|
|
56
57
|
onClickAdd: PropTypes.func,
|
|
@@ -99,6 +100,7 @@ var defaultProps$1 = {
|
|
|
99
100
|
width: null,
|
|
100
101
|
height: 300,
|
|
101
102
|
disabled: false,
|
|
103
|
+
loading: false,
|
|
102
104
|
onChange: null,
|
|
103
105
|
onClear: null,
|
|
104
106
|
onClickAdd: null,
|
|
@@ -129,6 +131,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
129
131
|
width = _ref.width,
|
|
130
132
|
height = _ref.height,
|
|
131
133
|
disabled = _ref.disabled,
|
|
134
|
+
parentLoading = _ref.loading,
|
|
132
135
|
onChange = _ref.onChange,
|
|
133
136
|
onClear = _ref.onClear,
|
|
134
137
|
onClickAdd = _ref.onClickAdd;
|
|
@@ -341,6 +344,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
341
344
|
}
|
|
342
345
|
};
|
|
343
346
|
}, [uppy, startLoading, endLoading]);
|
|
347
|
+
var finalLoading = loading || parentLoading;
|
|
344
348
|
return /*#__PURE__*/React.createElement("div", {
|
|
345
349
|
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
346
350
|
ref: containerRef
|
|
@@ -368,11 +372,11 @@ var UploadField = function UploadField(_ref) {
|
|
|
368
372
|
id: "trigger-uppy",
|
|
369
373
|
type: "button",
|
|
370
374
|
theme: "primary",
|
|
371
|
-
icon:
|
|
375
|
+
icon: finalLoading ? 'loading' : 'upload',
|
|
372
376
|
iconPosition: "right",
|
|
373
377
|
onClick: onClickAdd || openModal,
|
|
374
|
-
disabled:
|
|
375
|
-
}, /*#__PURE__*/React.createElement(Label, null,
|
|
378
|
+
disabled: finalLoading || disabled
|
|
379
|
+
}, /*#__PURE__*/React.createElement(Label, null, finalLoading ? /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
376
380
|
id: "NozDYd",
|
|
377
381
|
defaultMessage: [{
|
|
378
382
|
"type": 0,
|
package/lib/index.js
CHANGED
|
@@ -55,6 +55,7 @@ var propTypes$1 = {
|
|
|
55
55
|
width: PropTypes.number,
|
|
56
56
|
height: PropTypes.number,
|
|
57
57
|
disabled: PropTypes.bool,
|
|
58
|
+
loading: PropTypes.bool,
|
|
58
59
|
onChange: PropTypes.func,
|
|
59
60
|
onClear: PropTypes.func,
|
|
60
61
|
onClickAdd: PropTypes.func,
|
|
@@ -103,6 +104,7 @@ var defaultProps$1 = {
|
|
|
103
104
|
width: null,
|
|
104
105
|
height: 300,
|
|
105
106
|
disabled: false,
|
|
107
|
+
loading: false,
|
|
106
108
|
onChange: null,
|
|
107
109
|
onClear: null,
|
|
108
110
|
onClickAdd: null,
|
|
@@ -133,6 +135,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
133
135
|
width = _ref.width,
|
|
134
136
|
height = _ref.height,
|
|
135
137
|
disabled = _ref.disabled,
|
|
138
|
+
parentLoading = _ref.loading,
|
|
136
139
|
onChange = _ref.onChange,
|
|
137
140
|
onClear = _ref.onClear,
|
|
138
141
|
onClickAdd = _ref.onClickAdd;
|
|
@@ -345,6 +348,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
345
348
|
}
|
|
346
349
|
};
|
|
347
350
|
}, [uppy$1, startLoading, endLoading]);
|
|
351
|
+
var finalLoading = loading || parentLoading;
|
|
348
352
|
return /*#__PURE__*/React.createElement("div", {
|
|
349
353
|
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
350
354
|
ref: containerRef
|
|
@@ -372,11 +376,11 @@ var UploadField = function UploadField(_ref) {
|
|
|
372
376
|
id: "trigger-uppy",
|
|
373
377
|
type: "button",
|
|
374
378
|
theme: "primary",
|
|
375
|
-
icon:
|
|
379
|
+
icon: finalLoading ? 'loading' : 'upload',
|
|
376
380
|
iconPosition: "right",
|
|
377
381
|
onClick: onClickAdd || openModal,
|
|
378
|
-
disabled:
|
|
379
|
-
}, /*#__PURE__*/React.createElement(Label, null,
|
|
382
|
+
disabled: finalLoading || disabled
|
|
383
|
+
}, /*#__PURE__*/React.createElement(Label, null, finalLoading ? /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
380
384
|
id: "NozDYd",
|
|
381
385
|
defaultMessage: [{
|
|
382
386
|
"type": 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-upload",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.194",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
58
58
|
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
|
59
59
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
60
|
-
"@panneau/core": "^3.0.
|
|
61
|
-
"@panneau/element-button": "^3.0.
|
|
62
|
-
"@panneau/element-label": "^3.0.
|
|
63
|
-
"@panneau/element-media-card": "^3.0.
|
|
64
|
-
"@panneau/list-resource-items": "^3.0.
|
|
65
|
-
"@panneau/themes": "^3.0.
|
|
66
|
-
"@panneau/uppy": "^3.0.
|
|
60
|
+
"@panneau/core": "^3.0.194",
|
|
61
|
+
"@panneau/element-button": "^3.0.194",
|
|
62
|
+
"@panneau/element-label": "^3.0.194",
|
|
63
|
+
"@panneau/element-media-card": "^3.0.194",
|
|
64
|
+
"@panneau/list-resource-items": "^3.0.194",
|
|
65
|
+
"@panneau/themes": "^3.0.194",
|
|
66
|
+
"@panneau/uppy": "^3.0.194",
|
|
67
67
|
"@uppy/core": "^3.9.1",
|
|
68
68
|
"@uppy/dashboard": "^3.7.3",
|
|
69
69
|
"@uppy/drag-drop": "^3.0.3",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "6d49da8ecbe43b3a5c11dc9ddb9553ef64e58c83"
|
|
84
84
|
}
|