@panneau/modal-resource-items 3.0.222 → 3.0.224
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/package.json +11 -8
- package/lib/index.js +0 -96
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@panneau/modal-resource-items",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.224",
|
4
4
|
"description": "Resource items modal",
|
5
5
|
"keywords": [
|
6
6
|
"javascript"
|
@@ -25,8 +25,11 @@
|
|
25
25
|
}
|
26
26
|
],
|
27
27
|
"license": "ISC",
|
28
|
-
"
|
28
|
+
"type": "module",
|
29
29
|
"module": "es/index.js",
|
30
|
+
"exports": {
|
31
|
+
".": "./es/index.js"
|
32
|
+
},
|
30
33
|
"files": [
|
31
34
|
"lib",
|
32
35
|
"es",
|
@@ -46,11 +49,11 @@
|
|
46
49
|
},
|
47
50
|
"dependencies": {
|
48
51
|
"@babel/runtime": "^7.12.5",
|
49
|
-
"@panneau/core": "^3.0.
|
50
|
-
"@panneau/intl": "^3.0.
|
51
|
-
"@panneau/list-resource-items": "^3.0.
|
52
|
-
"@panneau/modal-dialog": "^3.0.
|
53
|
-
"@panneau/themes": "^3.0.
|
52
|
+
"@panneau/core": "^3.0.224",
|
53
|
+
"@panneau/intl": "^3.0.224",
|
54
|
+
"@panneau/list-resource-items": "^3.0.224",
|
55
|
+
"@panneau/modal-dialog": "^3.0.224",
|
56
|
+
"@panneau/themes": "^3.0.224",
|
54
57
|
"classnames": "^2.5.1",
|
55
58
|
"lodash": "^4.17.21",
|
56
59
|
"prop-types": "^15.7.2",
|
@@ -59,5 +62,5 @@
|
|
59
62
|
"publishConfig": {
|
60
63
|
"access": "public"
|
61
64
|
},
|
62
|
-
"gitHead": "
|
65
|
+
"gitHead": "c95bd465867c4c7d112bf0ed66036574cc05c627"
|
63
66
|
}
|
package/lib/index.js
DELETED
@@ -1,96 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
6
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
7
|
-
var PropTypes = require('prop-types');
|
8
|
-
var React = require('react');
|
9
|
-
var reactIntl = require('react-intl');
|
10
|
-
var hooks = require('@panneau/core/hooks');
|
11
|
-
var intl = require('@panneau/intl');
|
12
|
-
var ResourceItemsList = require('@panneau/list-resource-items');
|
13
|
-
var Dialog = require('@panneau/modal-dialog');
|
14
|
-
|
15
|
-
var _excluded = ["id", "resource", "title", "query", "paginated", "onClose", "listProps", "className", "children"];
|
16
|
-
var propTypes = {
|
17
|
-
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
18
|
-
resource: PropTypes.string,
|
19
|
-
title: PropTypes.string,
|
20
|
-
query: PropTypes.shape(),
|
21
|
-
paginated: PropTypes.bool,
|
22
|
-
onQueryChange: PropTypes.func,
|
23
|
-
onQueryReset: PropTypes.func,
|
24
|
-
onPageChange: PropTypes.func,
|
25
|
-
onClose: PropTypes.func,
|
26
|
-
// eslint-disable-next-line react/forbid-prop-types
|
27
|
-
listProps: PropTypes.object,
|
28
|
-
className: PropTypes.string,
|
29
|
-
children: PropTypes.node
|
30
|
-
};
|
31
|
-
var defaultProps = {
|
32
|
-
resource: null,
|
33
|
-
title: null,
|
34
|
-
query: null,
|
35
|
-
paginated: true,
|
36
|
-
onQueryChange: PropTypes.func,
|
37
|
-
onQueryReset: PropTypes.func,
|
38
|
-
onPageChange: PropTypes.func,
|
39
|
-
onClose: null,
|
40
|
-
listProps: null,
|
41
|
-
className: null,
|
42
|
-
children: null
|
43
|
-
};
|
44
|
-
var ModalResourceItems = function ModalResourceItems(_ref) {
|
45
|
-
var id = _ref.id,
|
46
|
-
resource = _ref.resource,
|
47
|
-
title = _ref.title,
|
48
|
-
initialQuery = _ref.query,
|
49
|
-
paginated = _ref.paginated,
|
50
|
-
onClose = _ref.onClose,
|
51
|
-
listProps = _ref.listProps,
|
52
|
-
className = _ref.className,
|
53
|
-
children = _ref.children,
|
54
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
55
|
-
var resourceValues = intl.useResourceValues(resource);
|
56
|
-
var finalQuery = React.useMemo(function () {
|
57
|
-
return _objectSpread({}, initialQuery);
|
58
|
-
}, [initialQuery]);
|
59
|
-
var _useQuery = hooks.useQuery(finalQuery, paginated),
|
60
|
-
query = _useQuery.query,
|
61
|
-
onPageChange = _useQuery.onPageChange,
|
62
|
-
onQueryChange = _useQuery.onQueryChange,
|
63
|
-
onQueryReset = _useQuery.onQueryReset;
|
64
|
-
|
65
|
-
// TODO: add default list props and stuff?
|
66
|
-
|
67
|
-
return /*#__PURE__*/React.createElement(Dialog, {
|
68
|
-
id: id,
|
69
|
-
title: title || /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
70
|
-
values: resourceValues,
|
71
|
-
id: "XLVfN6",
|
72
|
-
defaultMessage: [{
|
73
|
-
"type": 0,
|
74
|
-
"value": "Find "
|
75
|
-
}, {
|
76
|
-
"type": 1,
|
77
|
-
"value": "a_singular"
|
78
|
-
}]
|
79
|
-
}),
|
80
|
-
size: "lg",
|
81
|
-
onClose: onClose,
|
82
|
-
className: className
|
83
|
-
}, /*#__PURE__*/React.createElement(ResourceItemsList, Object.assign({
|
84
|
-
resource: resource,
|
85
|
-
query: query,
|
86
|
-
onPageChange: onPageChange,
|
87
|
-
onQueryChange: onQueryChange,
|
88
|
-
onQueryReset: onQueryReset,
|
89
|
-
listProps: listProps
|
90
|
-
}, props)), children);
|
91
|
-
};
|
92
|
-
ModalResourceItems.propTypes = propTypes;
|
93
|
-
ModalResourceItems.defaultProps = defaultProps;
|
94
|
-
var ResourceItems = ModalResourceItems;
|
95
|
-
|
96
|
-
exports.default = ResourceItems;
|