@panneau/field-upload 2.0.59 → 2.0.61
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 -1
- package/lib/index.js +6 -0
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import isArray from 'lodash/isArray';
|
|
|
10
10
|
import isObject from 'lodash/isObject';
|
|
11
11
|
import prettyBytes from 'pretty-bytes';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
|
-
import React, { useState, useCallback, useMemo } from 'react';
|
|
13
|
+
import React, { useState, useCallback, useMemo, useEffect } from 'react';
|
|
14
14
|
import { FormattedMessage } from 'react-intl';
|
|
15
15
|
import { PropTypes as PropTypes$1 } from '@panneau/core';
|
|
16
16
|
import { useUppy } from '@panneau/core/contexts';
|
|
@@ -167,12 +167,18 @@ var UploadField = function UploadField(_ref) {
|
|
|
167
167
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
168
168
|
modalOpened = _useState4[0],
|
|
169
169
|
setModalOpened = _useState4[1];
|
|
170
|
+
var _useState5 = useState(false),
|
|
171
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
172
|
+
setModalHasOpened = _useState6[1];
|
|
170
173
|
var openModal = useCallback(function () {
|
|
171
174
|
setModalOpened(true);
|
|
172
175
|
}, [setModalOpened]);
|
|
173
176
|
var closeModal = useCallback(function () {
|
|
174
177
|
setModalOpened(false);
|
|
175
178
|
}, [setModalOpened]);
|
|
179
|
+
useEffect(function () {
|
|
180
|
+
setModalHasOpened(modalOpened);
|
|
181
|
+
}, [modalOpened, setModalHasOpened]);
|
|
176
182
|
var values = useMemo(function () {
|
|
177
183
|
if (isArray(value)) {
|
|
178
184
|
return value;
|
package/lib/index.js
CHANGED
|
@@ -186,12 +186,18 @@ var UploadField = function UploadField(_ref) {
|
|
|
186
186
|
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
187
187
|
modalOpened = _useState4[0],
|
|
188
188
|
setModalOpened = _useState4[1];
|
|
189
|
+
var _useState5 = React.useState(false),
|
|
190
|
+
_useState6 = _slicedToArray__default["default"](_useState5, 2),
|
|
191
|
+
setModalHasOpened = _useState6[1];
|
|
189
192
|
var openModal = React.useCallback(function () {
|
|
190
193
|
setModalOpened(true);
|
|
191
194
|
}, [setModalOpened]);
|
|
192
195
|
var closeModal = React.useCallback(function () {
|
|
193
196
|
setModalOpened(false);
|
|
194
197
|
}, [setModalOpened]);
|
|
198
|
+
React.useEffect(function () {
|
|
199
|
+
setModalHasOpened(modalOpened);
|
|
200
|
+
}, [modalOpened, setModalHasOpened]);
|
|
195
201
|
var values = React.useMemo(function () {
|
|
196
202
|
if (isArray__default["default"](value)) {
|
|
197
203
|
return value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/field-upload",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.61",
|
|
4
4
|
"description": "An Upload field",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "d68e86fd0d60bda972ec70fd40d698f82425bca5"
|
|
82
82
|
}
|