@portnet/ui 0.1.47 → 0.1.48

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.
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.weak-map.js");
4
- require("core-js/modules/esnext.iterator.constructor.js");
5
4
  require("core-js/modules/esnext.iterator.filter.js");
6
5
  require("core-js/modules/esnext.iterator.for-each.js");
7
6
  Object.defineProperty(exports, "__esModule", {
8
7
  value: true
9
8
  });
10
9
  exports.default = void 0;
10
+ require("core-js/modules/es.promise.js");
11
+ require("core-js/modules/esnext.iterator.constructor.js");
11
12
  require("core-js/modules/esnext.iterator.map.js");
13
+ require("core-js/modules/esnext.iterator.to-array.js");
12
14
  require("core-js/modules/web.dom-collections.iterator.js");
13
15
  var _react = _interopRequireWildcard(require("react"));
14
16
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -65,7 +67,7 @@ const PuiSearchPage = _ref2 => {
65
67
  onRetour,
66
68
  onReset,
67
69
  onSubmit,
68
- children: _children,
70
+ children,
69
71
  additionalActions,
70
72
  collapsibleSearchSection = true // Collapsible by default
71
73
  } = _ref2;
@@ -73,6 +75,9 @@ const PuiSearchPage = _ref2 => {
73
75
  const toggleSearchSection = () => {
74
76
  setSearchSectionExpanded(prev => !prev);
75
77
  };
78
+
79
+ // Convert children to an array safely
80
+ const childArray = _react.default.Children.toArray(children);
76
81
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
77
82
  title: title,
78
83
  titleIcon: titleIcon,
@@ -110,30 +115,20 @@ const PuiSearchPage = _ref2 => {
110
115
  submitForm
111
116
  } = _ref3;
112
117
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiFormikForm.default, {
113
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
118
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
114
119
  container: true,
115
120
  spacing: 2,
116
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
117
- item: true,
118
- xs: 12,
119
- sm: 4,
120
- children: [_children[0], " "]
121
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
121
+ children: isSearchSectionExpanded ? childArray.map((child, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
122
122
  item: true,
123
123
  xs: 12,
124
124
  sm: 4,
125
- children: [_children[1], " "]
126
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
127
- item: true,
128
- xs: 12,
129
- sm: 4,
130
- children: [_children[2], " "]
131
- }), isSearchSectionExpanded && _children.slice(3).map((child, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
125
+ children: child
126
+ }, index)) : childArray.slice(0, 3).map((child, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
132
127
  item: true,
133
128
  xs: 12,
134
129
  sm: 4,
135
130
  children: child
136
- }, index))]
131
+ }, index))
137
132
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
138
133
  container: true,
139
134
  justifyContent: "end",
@@ -190,7 +185,7 @@ PuiSearchPage.propTypes = {
190
185
  bottomNav: _propTypes.default.bool,
191
186
  loading: _propTypes.default.bool,
192
187
  tableProps: _propTypes.default.shape({
193
- pinnedColumns: _propTypes.default.object
188
+ pinnedColumns: _propTypes.default.object // Added pinnedColumns prop type
194
189
  }),
195
190
  retour: _propTypes.default.bool,
196
191
  onRetour: _propTypes.default.func,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portnet/ui",
3
- "version": "0.1.47",
3
+ "version": "0.1.48",
4
4
  "description": "Portnet UI",
5
5
  "keywords": [
6
6
  "react",