@panneau/field-upload 4.0.27 → 4.0.31

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/dist/index.js +11 -6
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -119,7 +119,6 @@ function UploadField(_ref) {
119
119
  return newValue;
120
120
  }, []);
121
121
  var onComplete = useCallback(function (response) {
122
- // console.log('upload complete', response); // eslint-disable-line
123
122
  var newValue = null;
124
123
  if (isArray(response)) {
125
124
  if (allowMultipleUploads) {
@@ -139,9 +138,6 @@ function UploadField(_ref) {
139
138
  } else if (newValue !== null) {
140
139
  newValue = mergeData(newValue);
141
140
  }
142
-
143
- // console.log('new upload value', newValue); // eslint-disable-line
144
-
145
141
  if (onChange !== null) {
146
142
  onChange(newValue);
147
143
  }
@@ -284,6 +280,15 @@ function UploadField(_ref) {
284
280
  onListPageChange = _useQuery.onPageChange,
285
281
  onListQueryChange = _useQuery.onQueryChange,
286
282
  onListQueryReset = _useQuery.onQueryReset;
283
+ var finalOnPageChange = useCallback(function (e) {
284
+ var pageNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
285
+ e.preventDefault();
286
+ e.stopPropagation();
287
+ onListPageChange(pageNumber);
288
+ }, [onListPageChange]);
289
+ var finalOnQueryChange = useCallback(function (newQuery) {
290
+ onListQueryChange(newQuery);
291
+ }, [onListQueryChange]);
287
292
  var containerRef = useRef(null);
288
293
 
289
294
  // Keep this stable, uppy doesnt like changes
@@ -428,8 +433,8 @@ function UploadField(_ref) {
428
433
  id: "upload-".concat(name),
429
434
  resource: resource,
430
435
  query: listQuery,
431
- onPageChange: onListPageChange,
432
- onQueryChange: onListQueryChange,
436
+ onPageChange: finalOnPageChange,
437
+ onQueryChange: finalOnQueryChange,
433
438
  onQueryReset: onListQueryReset,
434
439
  baseUrl: null,
435
440
  showActions: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/field-upload",
3
- "version": "4.0.27",
3
+ "version": "4.0.31",
4
4
  "description": "An Upload field",
5
5
  "keywords": [
6
6
  "javascript"
@@ -70,7 +70,7 @@
70
70
  "@panneau/element-button": "^4.0.27",
71
71
  "@panneau/element-label": "^4.0.27",
72
72
  "@panneau/element-media-card": "^4.0.27",
73
- "@panneau/modal-resource-items": "^4.0.27",
73
+ "@panneau/modal-resource-items": "^4.0.31",
74
74
  "@panneau/themes": "^4.0.27",
75
75
  "@panneau/uppy": "^4.0.27",
76
76
  "@uppy/core": "^5.1.1",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "48e48752495d69c6b10ddc2c4fe2319d2cd86ff0"
88
+ "gitHead": "64756359d534e2eb7a3516f8ee0691dc7d7587db"
89
89
  }