@panneau/modal-medias-picker 3.0.130
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 +51 -0
- package/lib/index.js +55 -0
- package/package.json +67 -0
package/es/index.js
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import React, { useCallback } from 'react';
|
4
|
+
import { MediasPicker } from '@panneau/medias';
|
5
|
+
import Dialog from '@panneau/modal-dialog';
|
6
|
+
|
7
|
+
var _excluded = ["title", "onClose", "onChange", "onConfirm", "multiple"];
|
8
|
+
var propTypes = {
|
9
|
+
title: PropTypes.string,
|
10
|
+
multiple: PropTypes.bool,
|
11
|
+
onConfirm: PropTypes.func,
|
12
|
+
onClose: PropTypes.func,
|
13
|
+
onChange: PropTypes.func
|
14
|
+
};
|
15
|
+
var defaultProps = {
|
16
|
+
title: null,
|
17
|
+
multiple: false,
|
18
|
+
onConfirm: null,
|
19
|
+
onClose: null,
|
20
|
+
onChange: null
|
21
|
+
};
|
22
|
+
function MediasPickerModal(_ref) {
|
23
|
+
var title = _ref.title,
|
24
|
+
onClose = _ref.onClose,
|
25
|
+
onChange = _ref.onChange,
|
26
|
+
onConfirm = _ref.onConfirm,
|
27
|
+
multiple = _ref.multiple,
|
28
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
29
|
+
var onSelectionConfirm = useCallback(function () {
|
30
|
+
if (onConfirm !== null) {
|
31
|
+
onConfirm();
|
32
|
+
}
|
33
|
+
if (onClose !== null) {
|
34
|
+
onClose();
|
35
|
+
}
|
36
|
+
}, [onConfirm]);
|
37
|
+
return /*#__PURE__*/React.createElement(Dialog, {
|
38
|
+
size: "lg",
|
39
|
+
onClose: onClose,
|
40
|
+
title: title
|
41
|
+
}, /*#__PURE__*/React.createElement(MediasPicker, Object.assign({}, props, {
|
42
|
+
onChange: onChange,
|
43
|
+
onConfirm: onSelectionConfirm,
|
44
|
+
onClose: onClose,
|
45
|
+
multiple: multiple
|
46
|
+
})));
|
47
|
+
}
|
48
|
+
MediasPickerModal.propTypes = propTypes;
|
49
|
+
MediasPickerModal.defaultProps = defaultProps;
|
50
|
+
|
51
|
+
export { MediasPickerModal as default };
|
package/lib/index.js
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
6
|
+
var PropTypes = require('prop-types');
|
7
|
+
var React = require('react');
|
8
|
+
var medias = require('@panneau/medias');
|
9
|
+
var Dialog = require('@panneau/modal-dialog');
|
10
|
+
|
11
|
+
var _excluded = ["title", "onClose", "onChange", "onConfirm", "multiple"];
|
12
|
+
var propTypes = {
|
13
|
+
title: PropTypes.string,
|
14
|
+
multiple: PropTypes.bool,
|
15
|
+
onConfirm: PropTypes.func,
|
16
|
+
onClose: PropTypes.func,
|
17
|
+
onChange: PropTypes.func
|
18
|
+
};
|
19
|
+
var defaultProps = {
|
20
|
+
title: null,
|
21
|
+
multiple: false,
|
22
|
+
onConfirm: null,
|
23
|
+
onClose: null,
|
24
|
+
onChange: null
|
25
|
+
};
|
26
|
+
function MediasPickerModal(_ref) {
|
27
|
+
var title = _ref.title,
|
28
|
+
onClose = _ref.onClose,
|
29
|
+
onChange = _ref.onChange,
|
30
|
+
onConfirm = _ref.onConfirm,
|
31
|
+
multiple = _ref.multiple,
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
33
|
+
var onSelectionConfirm = React.useCallback(function () {
|
34
|
+
if (onConfirm !== null) {
|
35
|
+
onConfirm();
|
36
|
+
}
|
37
|
+
if (onClose !== null) {
|
38
|
+
onClose();
|
39
|
+
}
|
40
|
+
}, [onConfirm]);
|
41
|
+
return /*#__PURE__*/React.createElement(Dialog, {
|
42
|
+
size: "lg",
|
43
|
+
onClose: onClose,
|
44
|
+
title: title
|
45
|
+
}, /*#__PURE__*/React.createElement(medias.MediasPicker, Object.assign({}, props, {
|
46
|
+
onChange: onChange,
|
47
|
+
onConfirm: onSelectionConfirm,
|
48
|
+
onClose: onClose,
|
49
|
+
multiple: multiple
|
50
|
+
})));
|
51
|
+
}
|
52
|
+
MediasPickerModal.propTypes = propTypes;
|
53
|
+
MediasPickerModal.defaultProps = defaultProps;
|
54
|
+
|
55
|
+
exports.default = MediasPickerModal;
|
package/package.json
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
{
|
2
|
+
"name": "@panneau/modal-medias-picker",
|
3
|
+
"version": "3.0.130",
|
4
|
+
"description": "Medias picker modal",
|
5
|
+
"keywords": [
|
6
|
+
"javascript"
|
7
|
+
],
|
8
|
+
"homepage": "https://github.com/folkloreinc/panneau-js",
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "git+https://github.com/folkloreinc/panneau-js.git"
|
12
|
+
},
|
13
|
+
"author": {
|
14
|
+
"name": "Folklore",
|
15
|
+
"email": "info@folklore.email"
|
16
|
+
},
|
17
|
+
"contributors": [
|
18
|
+
{
|
19
|
+
"name": "David Mongeau-Petitpas",
|
20
|
+
"email": "dmp@folklore.email"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"name": "Nicolas Roy-Bourdages",
|
24
|
+
"email": "nrb@folklore.email"
|
25
|
+
}
|
26
|
+
],
|
27
|
+
"license": "ISC",
|
28
|
+
"main": "lib/index.js",
|
29
|
+
"module": "es/index.js",
|
30
|
+
"files": [
|
31
|
+
"lib",
|
32
|
+
"es",
|
33
|
+
"assets"
|
34
|
+
],
|
35
|
+
"scripts": {
|
36
|
+
"prepublishOnly": "npm run build",
|
37
|
+
"build": "../../scripts/prepare-package.sh"
|
38
|
+
},
|
39
|
+
"devDependencies": {
|
40
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
41
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
42
|
+
},
|
43
|
+
"peerDependencies": {
|
44
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
45
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
46
|
+
},
|
47
|
+
"dependencies": {
|
48
|
+
"@babel/runtime": "^7.12.5",
|
49
|
+
"@panneau/core": "^3.0.130",
|
50
|
+
"@panneau/medias": "^3.0.130",
|
51
|
+
"@panneau/modal-dialog": "^3.0.130",
|
52
|
+
"@uppy/core": "^3.9.1",
|
53
|
+
"@uppy/dashboard": "^3.7.3",
|
54
|
+
"@uppy/drag-drop": "^3.0.3",
|
55
|
+
"@uppy/file-input": "^3.0.4",
|
56
|
+
"@uppy/progress-bar": "^3.0.4",
|
57
|
+
"@uppy/react": "^3.2.1",
|
58
|
+
"@uppy/status-bar": "^3.2.7",
|
59
|
+
"@uppy/utils": "^5.7.2",
|
60
|
+
"lodash": "^4.17.21",
|
61
|
+
"prop-types": "^15.7.2"
|
62
|
+
},
|
63
|
+
"publishConfig": {
|
64
|
+
"access": "public"
|
65
|
+
},
|
66
|
+
"gitHead": "e6070daacb45351ccbef67ae8006f1a293ca8e2b"
|
67
|
+
}
|