@panneau/modal-medias-picker 3.0.158 → 3.0.160
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 +15 -4
- package/lib/index.js +14 -3
- package/package.json +5 -5
package/es/index.js
CHANGED
@@ -4,11 +4,12 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import React, { useState, useCallback } from 'react';
|
6
6
|
import { FormattedMessage } from 'react-intl';
|
7
|
-
import {
|
7
|
+
import { MediasResourcePicker, MediasPickerContainer } from '@panneau/medias';
|
8
8
|
import Dialog from '@panneau/modal-dialog';
|
9
9
|
|
10
|
-
var _excluded = ["title", "onClose", "onChange", "onConfirm", "confirmButton", "cancelButton", "multiple"];
|
10
|
+
var _excluded = ["resource", "title", "onClose", "onChange", "onConfirm", "confirmButton", "cancelButton", "multiple"];
|
11
11
|
var propTypes = {
|
12
|
+
resource: PropTypes.string,
|
12
13
|
title: PropTypes.string,
|
13
14
|
multiple: PropTypes.bool,
|
14
15
|
onConfirm: PropTypes.func,
|
@@ -20,6 +21,7 @@ var propTypes = {
|
|
20
21
|
cancelButton: PropTypes.any
|
21
22
|
};
|
22
23
|
var defaultProps = {
|
24
|
+
resource: null,
|
23
25
|
title: null,
|
24
26
|
multiple: false,
|
25
27
|
onConfirm: null,
|
@@ -29,7 +31,8 @@ var defaultProps = {
|
|
29
31
|
cancelButton: null
|
30
32
|
};
|
31
33
|
function MediasPickerModal(_ref) {
|
32
|
-
var
|
34
|
+
var resource = _ref.resource,
|
35
|
+
title = _ref.title,
|
33
36
|
onClose = _ref.onClose,
|
34
37
|
onChange = _ref.onChange,
|
35
38
|
onConfirm = _ref.onConfirm,
|
@@ -85,7 +88,15 @@ function MediasPickerModal(_ref) {
|
|
85
88
|
onClick: onConfirm,
|
86
89
|
disabled: count === null || count < 1
|
87
90
|
}, confirmButton)]
|
88
|
-
}, /*#__PURE__*/React.createElement(
|
91
|
+
}, resource !== null ? /*#__PURE__*/React.createElement(MediasResourcePicker, Object.assign({}, props, {
|
92
|
+
resource: resource,
|
93
|
+
onChange: onSelectionChange,
|
94
|
+
onConfirm: onSelectionConfirm,
|
95
|
+
onClose: onClose,
|
96
|
+
multiple: multiple,
|
97
|
+
withoutButtons: true
|
98
|
+
})) : /*#__PURE__*/React.createElement(MediasPickerContainer, Object.assign({}, props, {
|
99
|
+
resource: resource,
|
89
100
|
onChange: onSelectionChange,
|
90
101
|
onConfirm: onSelectionConfirm,
|
91
102
|
onClose: onClose,
|
package/lib/index.js
CHANGED
@@ -11,8 +11,9 @@ var reactIntl = require('react-intl');
|
|
11
11
|
var medias = require('@panneau/medias');
|
12
12
|
var Dialog = require('@panneau/modal-dialog');
|
13
13
|
|
14
|
-
var _excluded = ["title", "onClose", "onChange", "onConfirm", "confirmButton", "cancelButton", "multiple"];
|
14
|
+
var _excluded = ["resource", "title", "onClose", "onChange", "onConfirm", "confirmButton", "cancelButton", "multiple"];
|
15
15
|
var propTypes = {
|
16
|
+
resource: PropTypes.string,
|
16
17
|
title: PropTypes.string,
|
17
18
|
multiple: PropTypes.bool,
|
18
19
|
onConfirm: PropTypes.func,
|
@@ -24,6 +25,7 @@ var propTypes = {
|
|
24
25
|
cancelButton: PropTypes.any
|
25
26
|
};
|
26
27
|
var defaultProps = {
|
28
|
+
resource: null,
|
27
29
|
title: null,
|
28
30
|
multiple: false,
|
29
31
|
onConfirm: null,
|
@@ -33,7 +35,8 @@ var defaultProps = {
|
|
33
35
|
cancelButton: null
|
34
36
|
};
|
35
37
|
function MediasPickerModal(_ref) {
|
36
|
-
var
|
38
|
+
var resource = _ref.resource,
|
39
|
+
title = _ref.title,
|
37
40
|
onClose = _ref.onClose,
|
38
41
|
onChange = _ref.onChange,
|
39
42
|
onConfirm = _ref.onConfirm,
|
@@ -89,7 +92,15 @@ function MediasPickerModal(_ref) {
|
|
89
92
|
onClick: onConfirm,
|
90
93
|
disabled: count === null || count < 1
|
91
94
|
}, confirmButton)]
|
92
|
-
}, /*#__PURE__*/React.createElement(medias.
|
95
|
+
}, resource !== null ? /*#__PURE__*/React.createElement(medias.MediasResourcePicker, Object.assign({}, props, {
|
96
|
+
resource: resource,
|
97
|
+
onChange: onSelectionChange,
|
98
|
+
onConfirm: onSelectionConfirm,
|
99
|
+
onClose: onClose,
|
100
|
+
multiple: multiple,
|
101
|
+
withoutButtons: true
|
102
|
+
})) : /*#__PURE__*/React.createElement(medias.MediasPickerContainer, Object.assign({}, props, {
|
103
|
+
resource: resource,
|
93
104
|
onChange: onSelectionChange,
|
94
105
|
onConfirm: onSelectionConfirm,
|
95
106
|
onClose: onClose,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@panneau/modal-medias-picker",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.160",
|
4
4
|
"description": "Medias picker modal",
|
5
5
|
"keywords": [
|
6
6
|
"javascript"
|
@@ -46,9 +46,9 @@
|
|
46
46
|
},
|
47
47
|
"dependencies": {
|
48
48
|
"@babel/runtime": "^7.12.5",
|
49
|
-
"@panneau/core": "^3.0.
|
50
|
-
"@panneau/medias": "^3.0.
|
51
|
-
"@panneau/modal-dialog": "^3.0.
|
49
|
+
"@panneau/core": "^3.0.160",
|
50
|
+
"@panneau/medias": "^3.0.160",
|
51
|
+
"@panneau/modal-dialog": "^3.0.160",
|
52
52
|
"@uppy/core": "^3.9.1",
|
53
53
|
"@uppy/dashboard": "^3.7.3",
|
54
54
|
"@uppy/drag-drop": "^3.0.3",
|
@@ -64,5 +64,5 @@
|
|
64
64
|
"publishConfig": {
|
65
65
|
"access": "public"
|
66
66
|
},
|
67
|
-
"gitHead": "
|
67
|
+
"gitHead": "71a2a64cd2e0ed3cc921b0ec3b0a69449a4a978c"
|
68
68
|
}
|