@panneau/field-upload 3.0.118 → 3.0.121
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 +8 -2
- package/lib/index.js +8 -2
- package/package.json +14 -14
package/es/index.js
CHANGED
|
@@ -55,6 +55,8 @@ var propTypes = {
|
|
|
55
55
|
disabled: PropTypes.bool,
|
|
56
56
|
onChange: PropTypes.func,
|
|
57
57
|
onClear: PropTypes.func,
|
|
58
|
+
onClickAdd: PropTypes.func,
|
|
59
|
+
onClickFind: PropTypes.func,
|
|
58
60
|
className: PropTypes.string
|
|
59
61
|
};
|
|
60
62
|
var defaultProps = {
|
|
@@ -118,6 +120,8 @@ var defaultProps = {
|
|
|
118
120
|
disabled: false,
|
|
119
121
|
onChange: null,
|
|
120
122
|
onClear: null,
|
|
123
|
+
onClickAdd: null,
|
|
124
|
+
onClickFind: null,
|
|
121
125
|
className: null
|
|
122
126
|
};
|
|
123
127
|
var UploadField = function UploadField(_ref) {
|
|
@@ -145,6 +149,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
145
149
|
disabled = _ref.disabled,
|
|
146
150
|
onChange = _ref.onChange,
|
|
147
151
|
onClear = _ref.onClear,
|
|
152
|
+
onClickAdd = _ref.onClickAdd,
|
|
153
|
+
onClickFind = _ref.onClickFind,
|
|
148
154
|
className = _ref.className;
|
|
149
155
|
var mergeData = useCallback(function (newValue) {
|
|
150
156
|
// Merge the response from our back-end
|
|
@@ -357,7 +363,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
357
363
|
id: "trigger-uppy",
|
|
358
364
|
type: "button",
|
|
359
365
|
theme: "primary",
|
|
360
|
-
onClick: openModal,
|
|
366
|
+
onClick: onClickAdd || openModal,
|
|
361
367
|
disabled: disabled,
|
|
362
368
|
outline: true
|
|
363
369
|
}, /*#__PURE__*/React.createElement(Label, null, addButtonLabel))), withFind ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -365,7 +371,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
365
371
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
366
372
|
type: "button",
|
|
367
373
|
theme: "primary",
|
|
368
|
-
onClick: toggleResourceModal,
|
|
374
|
+
onClick: onClickFind || toggleResourceModal,
|
|
369
375
|
disabled: disabled,
|
|
370
376
|
outline: true
|
|
371
377
|
}, /*#__PURE__*/React.createElement(Label, null, findButtonLabel))) : null) : null, !showResourceModal && !disabled && !hasMedia && !withButton && finalUppy !== null ? /*#__PURE__*/React.createElement("div", {
|
package/lib/index.js
CHANGED
|
@@ -75,6 +75,8 @@ var propTypes = {
|
|
|
75
75
|
disabled: PropTypes__default["default"].bool,
|
|
76
76
|
onChange: PropTypes__default["default"].func,
|
|
77
77
|
onClear: PropTypes__default["default"].func,
|
|
78
|
+
onClickAdd: PropTypes__default["default"].func,
|
|
79
|
+
onClickFind: PropTypes__default["default"].func,
|
|
78
80
|
className: PropTypes__default["default"].string
|
|
79
81
|
};
|
|
80
82
|
var defaultProps = {
|
|
@@ -138,6 +140,8 @@ var defaultProps = {
|
|
|
138
140
|
disabled: false,
|
|
139
141
|
onChange: null,
|
|
140
142
|
onClear: null,
|
|
143
|
+
onClickAdd: null,
|
|
144
|
+
onClickFind: null,
|
|
141
145
|
className: null
|
|
142
146
|
};
|
|
143
147
|
var UploadField = function UploadField(_ref) {
|
|
@@ -165,6 +169,8 @@ var UploadField = function UploadField(_ref) {
|
|
|
165
169
|
disabled = _ref.disabled,
|
|
166
170
|
onChange = _ref.onChange,
|
|
167
171
|
onClear = _ref.onClear,
|
|
172
|
+
onClickAdd = _ref.onClickAdd,
|
|
173
|
+
onClickFind = _ref.onClickFind,
|
|
168
174
|
className = _ref.className;
|
|
169
175
|
var mergeData = React.useCallback(function (newValue) {
|
|
170
176
|
// Merge the response from our back-end
|
|
@@ -377,7 +383,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
377
383
|
id: "trigger-uppy",
|
|
378
384
|
type: "button",
|
|
379
385
|
theme: "primary",
|
|
380
|
-
onClick: openModal,
|
|
386
|
+
onClick: onClickAdd || openModal,
|
|
381
387
|
disabled: disabled,
|
|
382
388
|
outline: true
|
|
383
389
|
}, /*#__PURE__*/React__default["default"].createElement(Label__default["default"], null, addButtonLabel))), withFind ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -385,7 +391,7 @@ var UploadField = function UploadField(_ref) {
|
|
|
385
391
|
}, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
386
392
|
type: "button",
|
|
387
393
|
theme: "primary",
|
|
388
|
-
onClick: toggleResourceModal,
|
|
394
|
+
onClick: onClickFind || toggleResourceModal,
|
|
389
395
|
disabled: disabled,
|
|
390
396
|
outline: true
|
|
391
397
|
}, /*#__PURE__*/React__default["default"].createElement(Label__default["default"], null, findButtonLabel))) : null) : null, !showResourceModal && !disabled && !hasMedia && !withButton && finalUppy !== null ? /*#__PURE__*/React__default["default"].createElement("div", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-upload",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.121",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@babel/runtime": "^7.12.5",
|
|
56
|
-
"@fortawesome/fontawesome-svg-core": "^
|
|
57
|
-
"@fortawesome/free-solid-svg-icons": "^5.
|
|
58
|
-
"@fortawesome/react-fontawesome": "^0.
|
|
59
|
-
"@panneau/core": "^3.0.
|
|
60
|
-
"@panneau/element-button": "^3.0.
|
|
61
|
-
"@panneau/element-label": "^3.0.
|
|
62
|
-
"@panneau/element-media-card": "^3.0.
|
|
63
|
-
"@panneau/list-resource-items": "^3.0.
|
|
64
|
-
"@panneau/modal-dialog": "^3.0.
|
|
65
|
-
"@panneau/modal-upload": "^3.0.
|
|
66
|
-
"@panneau/themes": "^3.0.
|
|
67
|
-
"@panneau/uppy": "^3.0.
|
|
56
|
+
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
57
|
+
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
|
58
|
+
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
59
|
+
"@panneau/core": "^3.0.119",
|
|
60
|
+
"@panneau/element-button": "^3.0.119",
|
|
61
|
+
"@panneau/element-label": "^3.0.119",
|
|
62
|
+
"@panneau/element-media-card": "^3.0.119",
|
|
63
|
+
"@panneau/list-resource-items": "^3.0.119",
|
|
64
|
+
"@panneau/modal-dialog": "^3.0.119",
|
|
65
|
+
"@panneau/modal-upload": "^3.0.119",
|
|
66
|
+
"@panneau/themes": "^3.0.119",
|
|
67
|
+
"@panneau/uppy": "^3.0.119",
|
|
68
68
|
"@uppy/core": "^3.9.1",
|
|
69
69
|
"@uppy/dashboard": "^3.7.3",
|
|
70
70
|
"@uppy/drag-drop": "^3.0.3",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "ce13769f10b3bafb3efaa8b2e3cb4b7e2cb749b0"
|
|
85
85
|
}
|