@insticc/react-datagrid-2 1.1.15 → 1.1.16
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/build/index.js +7 -0
- package/build/wrapper/ActionButton.js +214 -0
- package/build/wrapper/ColumnFilter.js +105 -0
- package/build/wrapper/ExportActions.js +114 -0
- package/build/wrapper/images/cache.png +0 -0
- package/build/wrapper/images/cacheloading.png +0 -0
- package/build/wrapper/index.js +931 -0
- package/build/wrapper/styles/styles.css +30 -0
- package/build/wrapper/utils/DefaultCellTypes.js +186 -0
- package/build/wrapper/utils/FormatDate.js +74 -0
- package/build/wrapper/utils/GridHelper.js +30 -0
- package/build/wrapper/utils/filters.js +63 -0
- package/build/wrapper/utils/gridFixedHeader.js +48 -0
- package/package.json +50 -50
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.clearFilter {
|
|
2
|
+
background-color: #ffb66c;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
padding: 5px;
|
|
7
|
+
border-radius: .28571429rem;
|
|
8
|
+
transition: opacity 0.2s ease;
|
|
9
|
+
/* box-shadow: 0 0 0 1px rgb(253, 175, 27); */
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.clearFilter:hover {
|
|
13
|
+
background-color: #ff8c18;
|
|
14
|
+
/* box-shadow: 0 0 0 1px rgb(206, 145, 0); */
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.fixed {
|
|
18
|
+
position: fixed !important;
|
|
19
|
+
z-Index: 99 !important;
|
|
20
|
+
width: calc(100% - 50px) !important;
|
|
21
|
+
background-color: white !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.fixed.fixed-100{
|
|
25
|
+
top: 100px !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.fixed.fixed-0 {
|
|
29
|
+
top: 0 !important;
|
|
30
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_CELL_TYPES = void 0;
|
|
7
|
+
var _FormatDate = _interopRequireDefault(require("./FormatDate"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
/**
|
|
10
|
+
* @file DefaultCellTypes.js
|
|
11
|
+
* @description Defines default cell type renderers for table columns.
|
|
12
|
+
* Provides a collection of pre-configured cell formatters for various data types
|
|
13
|
+
* including text, dates, numbers, currency, links, and custom complex types.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {Object} CellContext
|
|
18
|
+
* @property {Object} cell - The cell object containing value and metadata
|
|
19
|
+
* @property {Function} cell.getValue - Returns the current cell value
|
|
20
|
+
* @property {Object} column - Column configuration object
|
|
21
|
+
* @property {string} [column.locale] - Locale string for date/number formatting (e.g., 'pt-PT', 'en-US')
|
|
22
|
+
* @property {boolean} [column.onlyFlag] - Flag to show only country code alongside flag
|
|
23
|
+
* @property {Object} [column.columnDef] - Column definition metadata
|
|
24
|
+
* @property {string} [column.columnDef.header] - Column header text
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @constant {Object} DEFAULT_CELL_TYPES
|
|
29
|
+
* @description Collection of default cell type renderers for table columns.
|
|
30
|
+
* Each property is a function that receives cell context and returns formatted content.
|
|
31
|
+
*
|
|
32
|
+
* @property {Function} text - Renders plain text value
|
|
33
|
+
* @property {Function} textTitle - Renders bold text using <strong> tag
|
|
34
|
+
* @property {Function} textDescription - Renders gray text with color #666
|
|
35
|
+
* @property {Function} textSmall - Renders text in smaller font using <small> tag
|
|
36
|
+
*
|
|
37
|
+
* @property {Function} date - Formats date without time (uses locale from column or defaults to 'pt-PT')
|
|
38
|
+
* @property {Function} datetime - Formats date with time (uses locale from column or defaults to 'pt-PT')
|
|
39
|
+
*
|
|
40
|
+
* @property {Function} number - Renders numeric value as-is
|
|
41
|
+
* @property {Function} integer - Rounds finite numbers to nearest integer
|
|
42
|
+
* @property {Function} currency - Formats number as EUR currency using locale-specific formatting
|
|
43
|
+
* @property {Function} percentage - Converts decimal to percentage with 2 decimal places (e.g., 0.1234 → "12.34%")
|
|
44
|
+
*
|
|
45
|
+
* @property {Function} email - Renders clickable email link with mailto: protocol
|
|
46
|
+
* @property {Function} phone - Renders clickable phone link with tel: protocol
|
|
47
|
+
* @property {Function} link - Renders external link with target="_blank" and security attributes
|
|
48
|
+
*
|
|
49
|
+
* @property {Function} array - Joins array elements with comma separator
|
|
50
|
+
* @property {Function} json - Renders formatted JSON in <pre> tag with 2-space indentation
|
|
51
|
+
*
|
|
52
|
+
* @property {Function} countryFlag - Displays country flag image from flagcdn.com using ISO2 code
|
|
53
|
+
* @property {Function} persons - Displays first person with "et al." if multiple, includes tooltip with full list
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
var DEFAULT_CELL_TYPES = exports.DEFAULT_CELL_TYPES = {
|
|
58
|
+
text: function text(_ref) {
|
|
59
|
+
var cell = _ref.cell;
|
|
60
|
+
return cell.getValue();
|
|
61
|
+
},
|
|
62
|
+
textTitle: function textTitle(_ref2) {
|
|
63
|
+
var cell = _ref2.cell;
|
|
64
|
+
return /*#__PURE__*/React.createElement("strong", null, cell.getValue());
|
|
65
|
+
},
|
|
66
|
+
textDescription: function textDescription(_ref3) {
|
|
67
|
+
var cell = _ref3.cell;
|
|
68
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
69
|
+
style: {
|
|
70
|
+
color: '#666'
|
|
71
|
+
}
|
|
72
|
+
}, cell.getValue());
|
|
73
|
+
},
|
|
74
|
+
textSmall: function textSmall(_ref4) {
|
|
75
|
+
var cell = _ref4.cell;
|
|
76
|
+
return /*#__PURE__*/React.createElement("small", null, cell.getValue());
|
|
77
|
+
},
|
|
78
|
+
date: function date(_ref5) {
|
|
79
|
+
var cell = _ref5.cell,
|
|
80
|
+
column = _ref5.column;
|
|
81
|
+
return (0, _FormatDate["default"])(cell.getValue(), {
|
|
82
|
+
onlyDate: true,
|
|
83
|
+
locale: column.locale || 'pt-PT'
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
datetime: function datetime(_ref6) {
|
|
87
|
+
var cell = _ref6.cell,
|
|
88
|
+
column = _ref6.column;
|
|
89
|
+
return (0, _FormatDate["default"])(cell.getValue(), {
|
|
90
|
+
onlyDate: false,
|
|
91
|
+
locale: column.locale || 'pt-PT'
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
number: function number(_ref7) {
|
|
95
|
+
var cell = _ref7.cell;
|
|
96
|
+
return cell.getValue();
|
|
97
|
+
},
|
|
98
|
+
integer: function integer(_ref8) {
|
|
99
|
+
var cell = _ref8.cell;
|
|
100
|
+
return Number.isFinite(cell.getValue()) ? Math.round(cell.getValue()) : cell.getValue();
|
|
101
|
+
},
|
|
102
|
+
currency: function currency(_ref9) {
|
|
103
|
+
var cell = _ref9.cell;
|
|
104
|
+
var v = cell.getValue();
|
|
105
|
+
return typeof v === 'number' ? v.toLocaleString(undefined, {
|
|
106
|
+
style: 'currency',
|
|
107
|
+
currency: 'EUR'
|
|
108
|
+
}) : v;
|
|
109
|
+
},
|
|
110
|
+
percentage: function percentage(_ref10) {
|
|
111
|
+
var cell = _ref10.cell;
|
|
112
|
+
var v = cell.getValue();
|
|
113
|
+
return typeof v === 'number' ? "".concat((v * 100).toFixed(2), "%") : v;
|
|
114
|
+
},
|
|
115
|
+
email: function email(_ref11) {
|
|
116
|
+
var cell = _ref11.cell;
|
|
117
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
118
|
+
href: "mailto:".concat(cell.getValue())
|
|
119
|
+
}, cell.getValue());
|
|
120
|
+
},
|
|
121
|
+
phone: function phone(_ref12) {
|
|
122
|
+
var cell = _ref12.cell;
|
|
123
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
124
|
+
href: "tel:".concat(cell.getValue())
|
|
125
|
+
}, cell.getValue());
|
|
126
|
+
},
|
|
127
|
+
link: function link(_ref13) {
|
|
128
|
+
var cell = _ref13.cell;
|
|
129
|
+
var value = cell.getValue();
|
|
130
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
131
|
+
title: value
|
|
132
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
133
|
+
href: value,
|
|
134
|
+
target: "_blank",
|
|
135
|
+
rel: "noopener noreferrer"
|
|
136
|
+
}, value));
|
|
137
|
+
},
|
|
138
|
+
array: function array(_ref14) {
|
|
139
|
+
var cell = _ref14.cell;
|
|
140
|
+
var value = cell.getValue();
|
|
141
|
+
var arr = Array.isArray(value) ? value : [];
|
|
142
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
143
|
+
title: arr.join(', ')
|
|
144
|
+
}, arr.join(', '));
|
|
145
|
+
},
|
|
146
|
+
json: function json(_ref15) {
|
|
147
|
+
var cell = _ref15.cell;
|
|
148
|
+
var value = cell.getValue();
|
|
149
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
150
|
+
title: JSON.stringify(value)
|
|
151
|
+
}, /*#__PURE__*/React.createElement("pre", null, JSON.stringify(value, null, 2)));
|
|
152
|
+
},
|
|
153
|
+
countryFlag: function countryFlag(_ref16) {
|
|
154
|
+
var cell = _ref16.cell,
|
|
155
|
+
column = _ref16.column;
|
|
156
|
+
var v = cell.getValue();
|
|
157
|
+
if (!v) return "";
|
|
158
|
+
var iso2 = String(v).toUpperCase();
|
|
159
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
160
|
+
style: {
|
|
161
|
+
display: "flex",
|
|
162
|
+
alignItems: "center",
|
|
163
|
+
gap: 8
|
|
164
|
+
}
|
|
165
|
+
}, (column === null || column === void 0 ? void 0 : column.onlyFlag) && /*#__PURE__*/React.createElement("span", null, iso2), /*#__PURE__*/React.createElement("img", {
|
|
166
|
+
src: "https://flagcdn.com/24x18/".concat(iso2.toLowerCase(), ".png"),
|
|
167
|
+
alt: iso2,
|
|
168
|
+
style: {
|
|
169
|
+
width: 24,
|
|
170
|
+
height: 18,
|
|
171
|
+
borderRadius: 2
|
|
172
|
+
}
|
|
173
|
+
}));
|
|
174
|
+
},
|
|
175
|
+
persons: function persons(_ref17) {
|
|
176
|
+
var cell = _ref17.cell,
|
|
177
|
+
column = _ref17.column;
|
|
178
|
+
var v = cell.getValue();
|
|
179
|
+
var arr = Array.isArray(v) ? v : typeof v === "string" ? v.split(/[,;]\s*/g).filter(Boolean) : [];
|
|
180
|
+
var label = arr[0] ? "".concat(arr[0]).concat(arr.length > 1 ? " et al." : "") : "N/A";
|
|
181
|
+
var tooltip = "".concat(column.columnDef.header, ":\n\u2022 ").concat(arr.join("\n• ") || "N/A");
|
|
182
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
183
|
+
title: tooltip
|
|
184
|
+
}, label);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
13
|
+
/**
|
|
14
|
+
* @file FormatDate.js
|
|
15
|
+
* @description Utility to format dates with locale and custom options.
|
|
16
|
+
*
|
|
17
|
+
* @param {Date|string|number} date
|
|
18
|
+
* @param {FormatDateOptions} [options]
|
|
19
|
+
* @returns {string}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Basic date with default locale (pt-PT)
|
|
23
|
+
* FormatDate('2025-11-18');
|
|
24
|
+
* // → "18/11/2025"
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Date & time with custom locale
|
|
28
|
+
* FormatDate('2025-11-18T14:30:00', { locale: 'en-US' });
|
|
29
|
+
* // → "11/18/2025, 2:30 PM"
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Custom formatting
|
|
33
|
+
* FormatDate('2025-11-18', {
|
|
34
|
+
* locale: 'en-US',
|
|
35
|
+
* dateOptions: { weekday: 'long', month: 'long', day: 'numeric' }
|
|
36
|
+
* });
|
|
37
|
+
* // → "Tuesday, November 18"
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Unix timestamp
|
|
41
|
+
* FormatDate(1700318400000);
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Invalid / empty dates
|
|
45
|
+
* FormatDate(null); // → ""
|
|
46
|
+
* FormatDate('invalid'); // → ""
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
var FormatDate = function FormatDate(date) {
|
|
50
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
51
|
+
if (!date) return '';
|
|
52
|
+
var _options$onlyDate = options.onlyDate,
|
|
53
|
+
onlyDate = _options$onlyDate === void 0 ? false : _options$onlyDate,
|
|
54
|
+
_options$locale = options.locale,
|
|
55
|
+
locale = _options$locale === void 0 ? 'pt-PT' : _options$locale,
|
|
56
|
+
_options$dateOptions = options.dateOptions,
|
|
57
|
+
dateOptions = _options$dateOptions === void 0 ? {} : _options$dateOptions,
|
|
58
|
+
_options$timeOptions = options.timeOptions,
|
|
59
|
+
timeOptions = _options$timeOptions === void 0 ? {} : _options$timeOptions;
|
|
60
|
+
var d = new Date(date);
|
|
61
|
+
if (isNaN(d.getTime())) return '';
|
|
62
|
+
var defaultDateOpts = {
|
|
63
|
+
year: 'numeric',
|
|
64
|
+
month: '2-digit',
|
|
65
|
+
day: '2-digit'
|
|
66
|
+
};
|
|
67
|
+
var defaultTimeOpts = {
|
|
68
|
+
hour: '2-digit',
|
|
69
|
+
minute: '2-digit',
|
|
70
|
+
hour12: false
|
|
71
|
+
};
|
|
72
|
+
return d.toLocaleString(locale, onlyDate ? _objectSpread(_objectSpread({}, defaultDateOpts), dateOptions) : _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, defaultDateOpts), defaultTimeOpts), dateOptions), timeOptions));
|
|
73
|
+
};
|
|
74
|
+
var _default = exports["default"] = FormatDate;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _semanticUiReact = require("semantic-ui-react");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var GridHelper = function GridHelper(_ref) {
|
|
11
|
+
var open = _ref.open,
|
|
12
|
+
content = _ref.content,
|
|
13
|
+
onClose = _ref.onClose,
|
|
14
|
+
title = _ref.title;
|
|
15
|
+
return /*#__PURE__*/_react["default"].createElement(_semanticUiReact.Modal, {
|
|
16
|
+
open: open,
|
|
17
|
+
centered: true,
|
|
18
|
+
style: {
|
|
19
|
+
top: 'auto',
|
|
20
|
+
right: 'auto',
|
|
21
|
+
left: 'auto',
|
|
22
|
+
bottom: 'auto',
|
|
23
|
+
height: 'fit-content'
|
|
24
|
+
}
|
|
25
|
+
}, /*#__PURE__*/_react["default"].createElement(_semanticUiReact.Modal.Header, null, title), /*#__PURE__*/_react["default"].createElement(_semanticUiReact.Modal.Content, null, content), /*#__PURE__*/_react["default"].createElement(_semanticUiReact.Modal.Actions, null, /*#__PURE__*/_react["default"].createElement(_semanticUiReact.Button, {
|
|
26
|
+
primary: true,
|
|
27
|
+
onClick: onClose
|
|
28
|
+
}, "Close")));
|
|
29
|
+
};
|
|
30
|
+
var _default = exports["default"] = GridHelper;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.regexFilterTooltip = exports.logicalFilterTooltip = exports.logicalFilter = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _semanticUiReact = require("semantic-ui-react");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var logicalFilter = exports.logicalFilter = function logicalFilter(row, id, filterValue) {
|
|
11
|
+
var rowValue = row.getValue(id).toLowerCase();
|
|
12
|
+
var contains = function contains(value, term) {
|
|
13
|
+
return value.includes(term.toLowerCase());
|
|
14
|
+
};
|
|
15
|
+
var parseFilter = function parseFilter(filter) {
|
|
16
|
+
var regex = /(\w+|\&\&|\|\||\~)/g;
|
|
17
|
+
return filter.match(regex);
|
|
18
|
+
};
|
|
19
|
+
var analyseParts = function analyseParts(parts) {
|
|
20
|
+
var result = null;
|
|
21
|
+
var currentOperator = null;
|
|
22
|
+
if (parts.includes('&&') || parts.includes('||') || parts.includes('~')) {
|
|
23
|
+
parts.forEach(function (p) {
|
|
24
|
+
if (p === '&&' || p === '||' || p === '~') {
|
|
25
|
+
currentOperator = p;
|
|
26
|
+
} else {
|
|
27
|
+
if (currentOperator === '&&') {
|
|
28
|
+
result = result && contains(rowValue, p);
|
|
29
|
+
currentOperator = null;
|
|
30
|
+
} else if (currentOperator === '||') {
|
|
31
|
+
result = result || contains(rowValue, p);
|
|
32
|
+
currentOperator = null;
|
|
33
|
+
} else if (currentOperator === '~') {
|
|
34
|
+
result = result ? result && !contains(rowValue, p) : !contains(rowValue, p);
|
|
35
|
+
currentOperator = null;
|
|
36
|
+
} else {
|
|
37
|
+
result = contains(rowValue, p);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
result = rowValue.includes(filterValue.toLowerCase());
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
var parts = parseFilter(filterValue);
|
|
47
|
+
if (!parts) return false;
|
|
48
|
+
return analyseParts(parts);
|
|
49
|
+
};
|
|
50
|
+
var logicalFilterTooltip = exports.logicalFilterTooltip = /*#__PURE__*/_react["default"].createElement("div", {
|
|
51
|
+
style: {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
flexDirection: 'column',
|
|
54
|
+
textAlign: 'start'
|
|
55
|
+
}
|
|
56
|
+
}, "This filter admits logical operators such as:", /*#__PURE__*/_react["default"].createElement("ul", null, /*#__PURE__*/_react["default"].createElement("li", null, "'&&' (AND) "), /*#__PURE__*/_react["default"].createElement("li", null, "'||' (OR) "), /*#__PURE__*/_react["default"].createElement("li", null, "'~' (NOT) ")), /*#__PURE__*/_react["default"].createElement("br", null), "These operators can be combined.", /*#__PURE__*/_react["default"].createElement("br", null), "For example, 'John Doe && Smith || James' will return rows that have both 'John Doe' and 'Smith', or 'James'.");
|
|
57
|
+
var regexFilterTooltip = exports.regexFilterTooltip = /*#__PURE__*/_react["default"].createElement("div", {
|
|
58
|
+
style: {
|
|
59
|
+
display: 'flex',
|
|
60
|
+
flexDirection: 'column',
|
|
61
|
+
textAlign: 'start'
|
|
62
|
+
}
|
|
63
|
+
}, "This filter enables the use of regular expression to search for patterns in the row data.", /*#__PURE__*/_react["default"].createElement("br", null), "For example, '^[A-Z]' will find entries that start with a capital letter.");
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = gridFixedHeader;
|
|
7
|
+
/**
|
|
8
|
+
* Makes a MUI-DataGrid header – and optionally its toolbar – stick to the top
|
|
9
|
+
* once the page is scrolled past a given point.
|
|
10
|
+
*
|
|
11
|
+
* @param {string|null} referenceDiv – id of a wrapper element whose top edge defines the sticky offset.
|
|
12
|
+
* @param {boolean} fixedGridActions – if true, also pin the toolbar (class "Mui-ToolbarDropZone").
|
|
13
|
+
*
|
|
14
|
+
* @returns {Function} cleanup – call if you need to remove the scroll listener.
|
|
15
|
+
*/
|
|
16
|
+
function gridFixedHeader(referenceDiv) {
|
|
17
|
+
var fixedGridActions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
18
|
+
var cssFixed = 'fixed';
|
|
19
|
+
var cssFixed0 = 'fixed-0';
|
|
20
|
+
var cssFixed100 = 'fixed-100';
|
|
21
|
+
var gridHeaderRowClassName = 'grid-sticky-header';
|
|
22
|
+
var gridToolbarClassName = 'grid-sticky-actions';
|
|
23
|
+
var handleScroll = function handleScroll() {
|
|
24
|
+
var _refEl$getBoundingCli;
|
|
25
|
+
var refEl = referenceDiv ? document.getElementById(referenceDiv) : null;
|
|
26
|
+
var headerEl = (refEl !== null && refEl !== void 0 ? refEl : document).getElementsByClassName(gridHeaderRowClassName)[0];
|
|
27
|
+
var toolbarEl = fixedGridActions ? (refEl !== null && refEl !== void 0 ? refEl : document).getElementsByClassName(gridToolbarClassName)[0] : null;
|
|
28
|
+
if (!headerEl) return;
|
|
29
|
+
var offset = referenceDiv ? window.scrollY + ((_refEl$getBoundingCli = refEl === null || refEl === void 0 ? void 0 : refEl.getBoundingClientRect().top) !== null && _refEl$getBoundingCli !== void 0 ? _refEl$getBoundingCli : 0) : 270;
|
|
30
|
+
if (window.scrollY > offset) {
|
|
31
|
+
headerEl.classList.add(cssFixed, toolbarEl ? cssFixed100 : cssFixed0);
|
|
32
|
+
toolbarEl === null || toolbarEl === void 0 || toolbarEl.classList.add(cssFixed, cssFixed0);
|
|
33
|
+
var spacer = ((toolbarEl === null || toolbarEl === void 0 ? void 0 : toolbarEl.offsetHeight) || 0) + ((headerEl === null || headerEl === void 0 ? void 0 : headerEl.offsetHeight) || 0);
|
|
34
|
+
(refEl !== null && refEl !== void 0 ? refEl : document.body).style.paddingTop = "".concat(spacer, "px");
|
|
35
|
+
} else {
|
|
36
|
+
headerEl.classList.remove(cssFixed, toolbarEl ? cssFixed100 : cssFixed0);
|
|
37
|
+
toolbarEl === null || toolbarEl === void 0 || toolbarEl.classList.remove(cssFixed, cssFixed0);
|
|
38
|
+
(refEl !== null && refEl !== void 0 ? refEl : document.body).style.paddingTop = '';
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
window.addEventListener('scroll', handleScroll, {
|
|
42
|
+
passive: true
|
|
43
|
+
});
|
|
44
|
+
handleScroll();
|
|
45
|
+
return function () {
|
|
46
|
+
return window.removeEventListener('scroll', handleScroll);
|
|
47
|
+
};
|
|
48
|
+
}
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
2
|
+
"name": "@insticc/react-datagrid-2",
|
|
3
|
+
"version": "1.1.16",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "babel src -d build --copy-files"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://set1.insticc.org/Bonobo.Git.Server/React-Datagrid-2.git"
|
|
12
|
+
},
|
|
13
|
+
"author": "Mário Delgadinho",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"bootstrap": "^5.3.3",
|
|
17
|
+
"prop-types": "^15.6.1",
|
|
18
|
+
"react": "^18.2.0",
|
|
19
|
+
"react-bootstrap": "^2.10.2",
|
|
20
|
+
"react-dom": "^18.2.0",
|
|
21
|
+
"semantic-ui-css": "^2.5.0",
|
|
22
|
+
"semantic-ui-react": "^2.1.5"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@babel/cli": "^7.26.4",
|
|
26
|
+
"@babel/core": "^7.26.0",
|
|
27
|
+
"@babel/preset-env": "^7.26.0",
|
|
28
|
+
"@babel/preset-react": "^7.26.3"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@emotion/react": "^11.11.4",
|
|
32
|
+
"@emotion/styled": "^11.11.5",
|
|
33
|
+
"@mui/icons-material": "^5.15.15",
|
|
34
|
+
"@mui/material": "^5.15.15",
|
|
35
|
+
"@mui/styled-engine-sc": "^6.0.0-alpha.18",
|
|
36
|
+
"@mui/x-data-grid": "^7.1.0",
|
|
37
|
+
"@mui/x-date-pickers": "^7.1.0",
|
|
38
|
+
"babel": "^5.8.38",
|
|
39
|
+
"bootstrap": "^5.3.3",
|
|
40
|
+
"date-fns": "^2.29.3",
|
|
41
|
+
"jspdf": "^2.5.1",
|
|
42
|
+
"jspdf-autotable": "^3.8.2",
|
|
43
|
+
"material-react-table": "^2.12.1",
|
|
44
|
+
"prop-types": "^15.6.1",
|
|
45
|
+
"react": "^18.2.0",
|
|
46
|
+
"react-bootstrap": "^2.10.2",
|
|
47
|
+
"react-dom": "^18.2.0",
|
|
48
|
+
"semantic-ui-css": "^2.5.0",
|
|
49
|
+
"semantic-ui-react": "^2.1.5",
|
|
50
|
+
"xlsx": "^0.18.5"
|
|
51
|
+
}
|
|
52
52
|
}
|