@panneau/core 3.0.3 → 3.0.5
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/contexts.js +3 -2
- package/es/hooks.js +11 -3
- package/lib/contexts.js +3 -2
- package/lib/hooks.js +11 -3
- package/package.json +2 -2
package/es/contexts.js
CHANGED
|
@@ -1501,7 +1501,7 @@ var useUppy = function useUppy() {
|
|
|
1501
1501
|
var uppy = useMemo(function () {
|
|
1502
1502
|
return buildUppy !== null ? buildUppy({
|
|
1503
1503
|
meta: meta,
|
|
1504
|
-
|
|
1504
|
+
allowMultipleUploadBatches: allowMultipleUploads,
|
|
1505
1505
|
restrictions: {
|
|
1506
1506
|
maxNumberOfFiles: maxNumberOfFiles,
|
|
1507
1507
|
allowedFileTypes: allowedFileTypes
|
|
@@ -1541,7 +1541,7 @@ var useUppy = function useUppy() {
|
|
|
1541
1541
|
ids = _ref5$fileIDs === void 0 ? [] : _ref5$fileIDs;
|
|
1542
1542
|
ids.forEach(function (id) {
|
|
1543
1543
|
var file = uppy.getFile(id);
|
|
1544
|
-
console.log(file);
|
|
1544
|
+
console.log('file', file);
|
|
1545
1545
|
var newName = null;
|
|
1546
1546
|
if (withUUID) {
|
|
1547
1547
|
newName = getFileNameWithUUID(file);
|
|
@@ -1649,6 +1649,7 @@ var UppyProvider = function UppyProvider(_ref6) {
|
|
|
1649
1649
|
_ref8$sources = _ref8.sources,
|
|
1650
1650
|
customSources = _ref8$sources === void 0 ? sources : _ref8$sources,
|
|
1651
1651
|
uppyOpts = _objectWithoutProperties(_ref8, _excluded);
|
|
1652
|
+
console.log(uppyOpts);
|
|
1652
1653
|
var newUppy = new Uppy(_objectSpread({
|
|
1653
1654
|
id: id,
|
|
1654
1655
|
locale: uppyLocale
|
package/es/hooks.js
CHANGED
|
@@ -158,6 +158,10 @@ var useForm = function useForm() {
|
|
|
158
158
|
providedValue = _opts$value === void 0 ? null : _opts$value,
|
|
159
159
|
_opts$setValue = opts.setValue,
|
|
160
160
|
setProvidedValue = _opts$setValue === void 0 ? null : _opts$setValue,
|
|
161
|
+
_opts$withoutDefault = opts.withoutDefault,
|
|
162
|
+
withoutDefault = _opts$withoutDefault === void 0 ? true : _opts$withoutDefault,
|
|
163
|
+
_opts$withoutPropagat = opts.withoutPropagation,
|
|
164
|
+
withoutPropagation = _opts$withoutPropagat === void 0 ? true : _opts$withoutPropagat,
|
|
161
165
|
_opts$onComplete = opts.onComplete,
|
|
162
166
|
onComplete = _opts$onComplete === void 0 ? null : _opts$onComplete,
|
|
163
167
|
_opts$locales = opts.locales,
|
|
@@ -260,12 +264,16 @@ var useForm = function useForm() {
|
|
|
260
264
|
}, [finalPostForm, action, value]);
|
|
261
265
|
var onSubmit = useCallback(function (e) {
|
|
262
266
|
// console.log('form submit', e); //
|
|
263
|
-
|
|
267
|
+
if (withoutDefault) {
|
|
268
|
+
e.preventDefault();
|
|
269
|
+
}
|
|
270
|
+
if (withoutPropagation) {
|
|
271
|
+
e.stopPropagation();
|
|
272
|
+
}
|
|
264
273
|
// This one is very important with multiple forms
|
|
265
274
|
// Nested forms (even in portals) will bubble the onSubmit event to the parent
|
|
266
|
-
e.stopPropagation();
|
|
267
275
|
submit();
|
|
268
|
-
}, [submit, action]);
|
|
276
|
+
}, [submit, action, withoutDefault, withoutPropagation]);
|
|
269
277
|
var status = null;
|
|
270
278
|
if (requestState.loading) {
|
|
271
279
|
status = 'loading';
|
package/lib/contexts.js
CHANGED
|
@@ -1536,7 +1536,7 @@ var useUppy = function useUppy() {
|
|
|
1536
1536
|
var uppy = React.useMemo(function () {
|
|
1537
1537
|
return buildUppy !== null ? buildUppy({
|
|
1538
1538
|
meta: meta,
|
|
1539
|
-
|
|
1539
|
+
allowMultipleUploadBatches: allowMultipleUploads,
|
|
1540
1540
|
restrictions: {
|
|
1541
1541
|
maxNumberOfFiles: maxNumberOfFiles,
|
|
1542
1542
|
allowedFileTypes: allowedFileTypes
|
|
@@ -1576,7 +1576,7 @@ var useUppy = function useUppy() {
|
|
|
1576
1576
|
ids = _ref5$fileIDs === void 0 ? [] : _ref5$fileIDs;
|
|
1577
1577
|
ids.forEach(function (id) {
|
|
1578
1578
|
var file = uppy.getFile(id);
|
|
1579
|
-
console.log(file);
|
|
1579
|
+
console.log('file', file);
|
|
1580
1580
|
var newName = null;
|
|
1581
1581
|
if (withUUID) {
|
|
1582
1582
|
newName = getFileNameWithUUID(file);
|
|
@@ -1684,6 +1684,7 @@ var UppyProvider = function UppyProvider(_ref6) {
|
|
|
1684
1684
|
_ref8$sources = _ref8.sources,
|
|
1685
1685
|
customSources = _ref8$sources === void 0 ? sources : _ref8$sources,
|
|
1686
1686
|
uppyOpts = _objectWithoutProperties__default["default"](_ref8, _excluded);
|
|
1687
|
+
console.log(uppyOpts);
|
|
1687
1688
|
var newUppy = new Uppy(_objectSpread__default["default"]({
|
|
1688
1689
|
id: id,
|
|
1689
1690
|
locale: uppyLocale
|
package/lib/hooks.js
CHANGED
|
@@ -193,6 +193,10 @@ var useForm = function useForm() {
|
|
|
193
193
|
providedValue = _opts$value === void 0 ? null : _opts$value,
|
|
194
194
|
_opts$setValue = opts.setValue,
|
|
195
195
|
setProvidedValue = _opts$setValue === void 0 ? null : _opts$setValue,
|
|
196
|
+
_opts$withoutDefault = opts.withoutDefault,
|
|
197
|
+
withoutDefault = _opts$withoutDefault === void 0 ? true : _opts$withoutDefault,
|
|
198
|
+
_opts$withoutPropagat = opts.withoutPropagation,
|
|
199
|
+
withoutPropagation = _opts$withoutPropagat === void 0 ? true : _opts$withoutPropagat,
|
|
196
200
|
_opts$onComplete = opts.onComplete,
|
|
197
201
|
onComplete = _opts$onComplete === void 0 ? null : _opts$onComplete,
|
|
198
202
|
_opts$locales = opts.locales,
|
|
@@ -295,12 +299,16 @@ var useForm = function useForm() {
|
|
|
295
299
|
}, [finalPostForm, action, value]);
|
|
296
300
|
var onSubmit = react.useCallback(function (e) {
|
|
297
301
|
// console.log('form submit', e); //
|
|
298
|
-
|
|
302
|
+
if (withoutDefault) {
|
|
303
|
+
e.preventDefault();
|
|
304
|
+
}
|
|
305
|
+
if (withoutPropagation) {
|
|
306
|
+
e.stopPropagation();
|
|
307
|
+
}
|
|
299
308
|
// This one is very important with multiple forms
|
|
300
309
|
// Nested forms (even in portals) will bubble the onSubmit event to the parent
|
|
301
|
-
e.stopPropagation();
|
|
302
310
|
submit();
|
|
303
|
-
}, [submit, action]);
|
|
311
|
+
}, [submit, action, withoutDefault, withoutPropagation]);
|
|
304
312
|
var status = null;
|
|
305
313
|
if (requestState.loading) {
|
|
306
314
|
status = 'loading';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "8789e14a978cb46a2d310fcde987f856f2bb772e"
|
|
118
118
|
}
|