@portnet/ui 0.1.48 → 0.1.50
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,16 +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");
|
|
4
5
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
5
6
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
6
7
|
Object.defineProperty(exports, "__esModule", {
|
|
7
8
|
value: true
|
|
8
9
|
});
|
|
9
10
|
exports.default = void 0;
|
|
10
|
-
require("core-js/modules/es.promise.js");
|
|
11
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
12
11
|
require("core-js/modules/esnext.iterator.map.js");
|
|
13
|
-
require("core-js/modules/esnext.iterator.to-array.js");
|
|
14
12
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
15
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -32,26 +30,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
32
30
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
31
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
34
32
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
35
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
36
|
-
const
|
|
37
|
-
let {
|
|
38
|
-
actions,
|
|
39
|
-
children
|
|
40
|
-
} = _ref;
|
|
41
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
42
|
-
container: true,
|
|
43
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
44
|
-
item: true,
|
|
45
|
-
xs: 12,
|
|
46
|
-
children: children
|
|
47
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
48
|
-
item: true,
|
|
49
|
-
xs: 12,
|
|
50
|
-
children: actions
|
|
51
|
-
})]
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
const PuiSearchPage = _ref2 => {
|
|
33
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
34
|
+
const PuiSearchPage = _ref => {
|
|
55
35
|
let {
|
|
56
36
|
formik,
|
|
57
37
|
formikProps,
|
|
@@ -70,14 +50,19 @@ const PuiSearchPage = _ref2 => {
|
|
|
70
50
|
children,
|
|
71
51
|
additionalActions,
|
|
72
52
|
collapsibleSearchSection = true // Collapsible by default
|
|
73
|
-
} =
|
|
53
|
+
} = _ref;
|
|
74
54
|
const [isSearchSectionExpanded, setSearchSectionExpanded] = (0, _react.useState)(false);
|
|
75
55
|
const toggleSearchSection = () => {
|
|
76
56
|
setSearchSectionExpanded(prev => !prev);
|
|
77
57
|
};
|
|
78
58
|
|
|
79
|
-
//
|
|
80
|
-
const
|
|
59
|
+
// Extract the columns from tableProps
|
|
60
|
+
const {
|
|
61
|
+
columns
|
|
62
|
+
} = tableProps || [];
|
|
63
|
+
const alwaysVisibleFields = columns.slice(0, 3); // First three fields
|
|
64
|
+
const additionalFields = columns.slice(3); // Remaining fields
|
|
65
|
+
|
|
81
66
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
82
67
|
title: title,
|
|
83
68
|
titleIcon: titleIcon,
|
|
@@ -109,26 +94,26 @@ const PuiSearchPage = _ref2 => {
|
|
|
109
94
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
110
95
|
initialValues: {}
|
|
111
96
|
}, formikProps), {}, {
|
|
112
|
-
children:
|
|
97
|
+
children: _ref2 => {
|
|
113
98
|
let {
|
|
114
99
|
resetForm,
|
|
115
100
|
submitForm
|
|
116
|
-
} =
|
|
101
|
+
} = _ref2;
|
|
117
102
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiFormikForm.default, {
|
|
118
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
103
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
119
104
|
container: true,
|
|
120
105
|
spacing: 2,
|
|
121
|
-
children:
|
|
106
|
+
children: [alwaysVisibleFields.map((field, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
122
107
|
item: true,
|
|
123
108
|
xs: 12,
|
|
124
109
|
sm: 4,
|
|
125
|
-
children:
|
|
126
|
-
}, index))
|
|
110
|
+
children: field.renderCell || field.headerName
|
|
111
|
+
}, index)), isSearchSectionExpanded && additionalFields.map((field, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
127
112
|
item: true,
|
|
128
113
|
xs: 12,
|
|
129
114
|
sm: 4,
|
|
130
|
-
children:
|
|
131
|
-
}, index))
|
|
115
|
+
children: field.renderCell || field.headerName
|
|
116
|
+
}, index))]
|
|
132
117
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
133
118
|
container: true,
|
|
134
119
|
justifyContent: "end",
|
|
@@ -178,14 +163,19 @@ PuiSearchPage.propTypes = {
|
|
|
178
163
|
formik: _propTypes.default.bool,
|
|
179
164
|
formikProps: _propTypes.default.object,
|
|
180
165
|
title: _propTypes.default.string.isRequired,
|
|
181
|
-
titleIcon: _propTypes.default.element
|
|
166
|
+
titleIcon: _propTypes.default.element,
|
|
182
167
|
trace: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
183
168
|
navActions: _propTypes.default.element,
|
|
184
169
|
topNav: _propTypes.default.bool,
|
|
185
170
|
bottomNav: _propTypes.default.bool,
|
|
186
171
|
loading: _propTypes.default.bool,
|
|
187
172
|
tableProps: _propTypes.default.shape({
|
|
188
|
-
|
|
173
|
+
columns: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
174
|
+
field: _propTypes.default.string.isRequired,
|
|
175
|
+
headerName: _propTypes.default.string.isRequired,
|
|
176
|
+
renderCell: _propTypes.default.node
|
|
177
|
+
})).isRequired,
|
|
178
|
+
pinnedColumns: _propTypes.default.object
|
|
189
179
|
}),
|
|
190
180
|
retour: _propTypes.default.bool,
|
|
191
181
|
onRetour: _propTypes.default.func,
|