@panneau/modal-resource-items 4.0.26 → 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 +12 -6
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
3
  import isObject from 'lodash/isObject';
4
- import { useMemo } from 'react';
4
+ import { useMemo, useCallback } from 'react';
5
5
  import { FormattedMessage } from 'react-intl';
6
6
  import { usePanneauResource } from '@panneau/core/contexts';
7
7
  import { useQuery } from '@panneau/core/hooks';
@@ -43,9 +43,15 @@ function ModalResourceItems(_ref) {
43
43
  onPageChange = _useQuery.onPageChange,
44
44
  onQueryChange = _useQuery.onQueryChange,
45
45
  onQueryReset = _useQuery.onQueryReset;
46
-
47
- // TODO: add default list props and stuff?
48
-
46
+ var finalOnPageChange = useCallback(function (e) {
47
+ var pageNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
48
+ e.preventDefault();
49
+ e.stopPropagation();
50
+ onPageChange(pageNumber);
51
+ }, [onPageChange]);
52
+ var finalOnQueryChange = useCallback(function (newQuery) {
53
+ onQueryChange(newQuery);
54
+ }, [onQueryChange]);
49
55
  return /*#__PURE__*/jsxs(Dialog, {
50
56
  id: id,
51
57
  title: title || /*#__PURE__*/jsx(FormattedMessage, {
@@ -65,8 +71,8 @@ function ModalResourceItems(_ref) {
65
71
  children: [/*#__PURE__*/jsx(ResourceItemsList, _objectSpread({
66
72
  resource: resource,
67
73
  query: query,
68
- onPageChange: onPageChange,
69
- onQueryChange: onQueryChange,
74
+ onPageChange: finalOnPageChange,
75
+ onQueryChange: finalOnQueryChange,
70
76
  onQueryReset: onQueryReset,
71
77
  listProps: listProps
72
78
  }, props)), children]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/modal-resource-items",
3
- "version": "4.0.26",
3
+ "version": "4.0.31",
4
4
  "description": "Resource items modal",
5
5
  "keywords": [
6
6
  "javascript"
@@ -52,11 +52,11 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@babel/runtime": "^7.28.6",
55
- "@panneau/core": "^4.0.21",
56
- "@panneau/intl": "^4.0.26",
57
- "@panneau/list-resource-items": "^4.0.23",
58
- "@panneau/modal-dialog": "^4.0.21",
59
- "@panneau/themes": "^4.0.21",
55
+ "@panneau/core": "^4.0.27",
56
+ "@panneau/intl": "^4.0.27",
57
+ "@panneau/list-resource-items": "^4.0.31",
58
+ "@panneau/modal-dialog": "^4.0.27",
59
+ "@panneau/themes": "^4.0.27",
60
60
  "classnames": "^2.5.1",
61
61
  "lodash": "^4.17.21",
62
62
  "react-intl": "^6.0.0 || ^7.0.0 || ^8.0.0"
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "50916cc203edf00f8f77cb460f4d1b322cdaf543"
67
+ "gitHead": "64756359d534e2eb7a3516f8ee0691dc7d7587db"
68
68
  }