trotl-table 1.0.16 → 1.0.17

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/README.md CHANGED
@@ -26,16 +26,23 @@ yarn add trotl-table
26
26
 
27
27
  ## Versions
28
28
  ```js
29
- 1.0.9 => add search input
30
- 1.0.9 => fix readme, whatever
31
- 1.0.8 => fix readme
32
- 1.0.7 => removed context (better for npm consumers)
33
- 1.0.6 => ...
34
- 1.0.5 => ...
35
- 1.0.4 => fix sorting
36
- 1.0.3 => ...
37
- 1.0.2 => prepare for npm consumers
38
- 1.0.1 => initial release
29
+ 1.0.17 => ...
30
+ 1.0.16 => update/fix when scroll
31
+ 1.0.15 => update add EmptyTableLoader
32
+ 1.0.14 => ...
33
+ 1.0.13 => ...
34
+ 1.0.12 => ...
35
+ 1.0.11 => ...
36
+ 1.0.10 => ...
37
+ 1.0.9 => fix readme, whatever
38
+ 1.0.8 => fix readme
39
+ 1.0.7 => removed context (better for npm consumers)
40
+ 1.0.6 => ...
41
+ 1.0.5 => ...
42
+ 1.0.4 => fix sorting
43
+ 1.0.3 => ...
44
+ 1.0.2 => prepare for npm consumers
45
+ 1.0.1 => initial release
39
46
  ```
40
47
 
41
48
  ## ⚡ Quick Start
package/dist/index.cjs.js CHANGED
@@ -9733,7 +9733,8 @@ function TableInner({
9733
9733
  enableExternalRowDrop = false,
9734
9734
  onExternalRowDrop = () => {},
9735
9735
  useExternalDndContext = false,
9736
- customColumns = []
9736
+ customColumns = [],
9737
+ groupDefaultOpen = false
9737
9738
  }) {
9738
9739
  // Local selection & sorting state (removed TableContext dependency)
9739
9740
  const [selectedRows, setSelectedRows] = React.useState([]);
@@ -9884,11 +9885,11 @@ function TableInner({
9884
9885
  };
9885
9886
  for (const g of normalizedGroups) {
9886
9887
  const gid = g[groupKey] ?? g.groupId ?? g.groupName;
9887
- if (!(gid in next)) next[gid] = true; // default expanded
9888
+ if (!(gid in next)) next[gid] = groupDefaultOpen; // use prop for initial state
9888
9889
  }
9889
9890
  return next;
9890
9891
  });
9891
- }, [normalizedGroups, groupKey]);
9892
+ }, [normalizedGroups, groupKey, groupDefaultOpen]);
9892
9893
  const groupRowsById = React.useMemo(() => {
9893
9894
  const map = {};
9894
9895
  for (const g of sortedGroupedData) {
@@ -10003,14 +10004,23 @@ function TableInner({
10003
10004
  // RENDER CELL
10004
10005
  const highlight = React.useCallback(text => {
10005
10006
  // Use the actual searchTerm (from URL or prop) for highlighting
10006
- if (!searchTerm || typeof text !== "string") return text;
10007
+ if (!searchTerm || typeof text !== "string") return /*#__PURE__*/React.createElement("span", {
10008
+ title: text
10009
+ }, text);
10007
10010
  const lower = text.toLowerCase();
10008
10011
  const query = searchTerm.toLowerCase();
10009
10012
  const idx = lower.indexOf(query);
10010
- if (idx === -1) return text;
10011
- return /*#__PURE__*/React.createElement(React.Fragment, null, text.slice(0, idx), /*#__PURE__*/React.createElement("span", {
10013
+ if (idx === -1) return /*#__PURE__*/React.createElement("span", {
10014
+ title: text
10015
+ }, text);
10016
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
10017
+ title: text
10018
+ }, text.slice(0, idx)), /*#__PURE__*/React.createElement("span", {
10019
+ title: text,
10012
10020
  className: "highlight"
10013
- }, text.slice(idx, idx + query.length)), text.slice(idx + query.length));
10021
+ }, text.slice(idx, idx + query.length)), /*#__PURE__*/React.createElement("span", {
10022
+ title: text
10023
+ }, text.slice(idx + query.length)));
10014
10024
  }, [searchTerm]);
10015
10025
  const renderCell = React.useCallback((v, accessor) => {
10016
10026
  if (accessor === "deadlineISO") {
@@ -10258,6 +10268,7 @@ function TableInner({
10258
10268
  checked: selectedRows.includes(row.id),
10259
10269
  onChange: () => toggleRowSelection(row.id)
10260
10270
  })), showKey && /*#__PURE__*/React.createElement("div", {
10271
+ title: visualIndex,
10261
10272
  className: "table-cell key-cell"
10262
10273
  }, visualIndex), allColumns.map((col, i) => {
10263
10274
  let cellStyle = col.style ? {