@panneau/field-upload 2.0.16 → 2.0.17
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 +9 -4
- package/lib/index.js +9 -4
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -33,6 +33,7 @@ var propTypes = {
|
|
|
33
33
|
namePath: PropTypes.string,
|
|
34
34
|
thumbnailPath: PropTypes.string,
|
|
35
35
|
sizePath: PropTypes.string,
|
|
36
|
+
disabled: PropTypes.bool,
|
|
36
37
|
onChange: PropTypes.func,
|
|
37
38
|
className: PropTypes.string
|
|
38
39
|
};
|
|
@@ -53,6 +54,7 @@ var defaultProps = {
|
|
|
53
54
|
namePath: null,
|
|
54
55
|
thumbnailPath: null,
|
|
55
56
|
sizePath: null,
|
|
57
|
+
disabled: false,
|
|
56
58
|
onChange: null,
|
|
57
59
|
className: null
|
|
58
60
|
};
|
|
@@ -67,6 +69,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
67
69
|
namePath = _ref.namePath,
|
|
68
70
|
thumbnailPath = _ref.thumbnailPath,
|
|
69
71
|
sizePath = _ref.sizePath,
|
|
72
|
+
disabled = _ref.disabled,
|
|
70
73
|
onChange = _ref.onChange,
|
|
71
74
|
className = _ref.className;
|
|
72
75
|
var onComplete = useCallback(function (response) {
|
|
@@ -219,19 +222,21 @@ var UploadField = function UploadField(_ref) {
|
|
|
219
222
|
outline: true,
|
|
220
223
|
onClick: function onClick() {
|
|
221
224
|
return onClickRemove(idx);
|
|
222
|
-
}
|
|
225
|
+
},
|
|
226
|
+
disabled: disabled
|
|
223
227
|
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
224
228
|
icon: faTimes
|
|
225
229
|
})))));
|
|
226
230
|
}) : null, !hasMedia && withButton ? /*#__PURE__*/React.createElement(Button, {
|
|
227
231
|
type: "button",
|
|
228
232
|
theme: "primary",
|
|
229
|
-
onClick: openModal
|
|
230
|
-
|
|
233
|
+
onClick: openModal,
|
|
234
|
+
disabled: disabled
|
|
235
|
+
}, /*#__PURE__*/React.createElement(Label, null, addButtonLabel)) : null, !disabled && !hasMedia && !withButton && uppy !== null ? /*#__PURE__*/React.createElement(Dashboard, {
|
|
231
236
|
uppy: uppy,
|
|
232
237
|
height: 300,
|
|
233
238
|
plugins: sources
|
|
234
|
-
}) : null, withButton && uppy !== null ? /*#__PURE__*/React.createElement(DashboardModal, {
|
|
239
|
+
}) : null, !disabled && withButton && uppy !== null ? /*#__PURE__*/React.createElement(DashboardModal, {
|
|
235
240
|
uppy: uppy,
|
|
236
241
|
plugins: sources,
|
|
237
242
|
open: modalOpened,
|
package/lib/index.js
CHANGED
|
@@ -51,6 +51,7 @@ var propTypes = {
|
|
|
51
51
|
namePath: PropTypes__default["default"].string,
|
|
52
52
|
thumbnailPath: PropTypes__default["default"].string,
|
|
53
53
|
sizePath: PropTypes__default["default"].string,
|
|
54
|
+
disabled: PropTypes__default["default"].bool,
|
|
54
55
|
onChange: PropTypes__default["default"].func,
|
|
55
56
|
className: PropTypes__default["default"].string
|
|
56
57
|
};
|
|
@@ -71,6 +72,7 @@ var defaultProps = {
|
|
|
71
72
|
namePath: null,
|
|
72
73
|
thumbnailPath: null,
|
|
73
74
|
sizePath: null,
|
|
75
|
+
disabled: false,
|
|
74
76
|
onChange: null,
|
|
75
77
|
className: null
|
|
76
78
|
};
|
|
@@ -85,6 +87,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
85
87
|
namePath = _ref.namePath,
|
|
86
88
|
thumbnailPath = _ref.thumbnailPath,
|
|
87
89
|
sizePath = _ref.sizePath,
|
|
90
|
+
disabled = _ref.disabled,
|
|
88
91
|
onChange = _ref.onChange,
|
|
89
92
|
className = _ref.className;
|
|
90
93
|
var onComplete = React.useCallback(function (response) {
|
|
@@ -237,19 +240,21 @@ var UploadField = function UploadField(_ref) {
|
|
|
237
240
|
outline: true,
|
|
238
241
|
onClick: function onClick() {
|
|
239
242
|
return onClickRemove(idx);
|
|
240
|
-
}
|
|
243
|
+
},
|
|
244
|
+
disabled: disabled
|
|
241
245
|
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
242
246
|
icon: freeSolidSvgIcons.faTimes
|
|
243
247
|
})))));
|
|
244
248
|
}) : null, !hasMedia && withButton ? /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
245
249
|
type: "button",
|
|
246
250
|
theme: "primary",
|
|
247
|
-
onClick: openModal
|
|
248
|
-
|
|
251
|
+
onClick: openModal,
|
|
252
|
+
disabled: disabled
|
|
253
|
+
}, /*#__PURE__*/React__default["default"].createElement(Label__default["default"], null, addButtonLabel)) : null, !disabled && !hasMedia && !withButton && uppy !== null ? /*#__PURE__*/React__default["default"].createElement(react.Dashboard, {
|
|
249
254
|
uppy: uppy,
|
|
250
255
|
height: 300,
|
|
251
256
|
plugins: sources
|
|
252
|
-
}) : null, withButton && uppy !== null ? /*#__PURE__*/React__default["default"].createElement(react.DashboardModal, {
|
|
257
|
+
}) : null, !disabled && withButton && uppy !== null ? /*#__PURE__*/React__default["default"].createElement(react.DashboardModal, {
|
|
253
258
|
uppy: uppy,
|
|
254
259
|
plugins: sources,
|
|
255
260
|
open: modalOpened,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-upload",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.17",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "3c06458008eb0b0b12017ca43cae9baf1904d6dc"
|
|
77
77
|
}
|