@portnet/ui 0.1.50 → 0.1.51

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,13 +1,14 @@
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
- require("core-js/modules/esnext.iterator.filter.js");
6
4
  require("core-js/modules/esnext.iterator.for-each.js");
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.default = void 0;
9
+ require("core-js/modules/es.array.includes.js");
10
+ require("core-js/modules/esnext.iterator.constructor.js");
11
+ require("core-js/modules/esnext.iterator.filter.js");
11
12
  require("core-js/modules/esnext.iterator.map.js");
12
13
  require("core-js/modules/web.dom-collections.iterator.js");
13
14
  var _react = _interopRequireWildcard(require("react"));
@@ -47,7 +48,6 @@ const PuiSearchPage = _ref => {
47
48
  onRetour,
48
49
  onReset,
49
50
  onSubmit,
50
- children,
51
51
  additionalActions,
52
52
  collapsibleSearchSection = true // Collapsible by default
53
53
  } = _ref;
@@ -56,12 +56,13 @@ const PuiSearchPage = _ref => {
56
56
  setSearchSectionExpanded(prev => !prev);
57
57
  };
58
58
 
59
- // Extract the columns from tableProps
59
+ // Extract columns from tableProps
60
60
  const {
61
61
  columns
62
- } = tableProps || [];
63
- const alwaysVisibleFields = columns.slice(0, 3); // First three fields
64
- const additionalFields = columns.slice(3); // Remaining fields
62
+ } = tableProps || {};
63
+ const alwaysVisibleFields = ["numFactura", "tipoFacturaDescripcion", "estadoDescripcion"]; // First-row fields
64
+ const visibleColumns = isSearchSectionExpanded ? columns // Show all columns when expanded
65
+ : columns.filter(col => alwaysVisibleFields.includes(col.field)); // Show only selected columns when collapsed
65
66
 
66
67
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
67
68
  title: title,
@@ -100,20 +101,19 @@ const PuiSearchPage = _ref => {
100
101
  submitForm
101
102
  } = _ref2;
102
103
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiFormikForm.default, {
103
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
104
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
104
105
  container: true,
105
106
  spacing: 2,
106
- children: [alwaysVisibleFields.map((field, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
107
+ children: visibleColumns.map((column, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
107
108
  item: true,
108
109
  xs: 12,
109
110
  sm: 4,
110
- children: field.renderCell || field.headerName
111
- }, index)), isSearchSectionExpanded && additionalFields.map((field, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
112
- item: true,
113
- xs: 12,
114
- sm: 4,
115
- children: field.renderCell || field.headerName
116
- }, index))]
111
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
112
+ children: column.headerName
113
+ }), column.renderCell ? column.renderCell({
114
+ row: {}
115
+ }) : null]
116
+ }, index))
117
117
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
118
118
  container: true,
119
119
  justifyContent: "end",
@@ -155,7 +155,7 @@ const PuiSearchPage = _ref => {
155
155
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread(_objectSpread({
156
156
  paginationMode: "server"
157
157
  }, tableProps), {}, {
158
- pinnedColumns: tableProps.pinnedColumns // Added pinnedColumns
158
+ pinnedColumns: tableProps.pinnedColumns
159
159
  }))]
160
160
  });
161
161
  };
@@ -173,7 +173,7 @@ PuiSearchPage.propTypes = {
173
173
  columns: _propTypes.default.arrayOf(_propTypes.default.shape({
174
174
  field: _propTypes.default.string.isRequired,
175
175
  headerName: _propTypes.default.string.isRequired,
176
- renderCell: _propTypes.default.node
176
+ renderCell: _propTypes.default.func
177
177
  })).isRequired,
178
178
  pinnedColumns: _propTypes.default.object
179
179
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portnet/ui",
3
- "version": "0.1.50",
3
+ "version": "0.1.51",
4
4
  "description": "Portnet UI",
5
5
  "keywords": [
6
6
  "react",