@infinite-table/infinite-react 6.0.2 → 6.0.3

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/index.d.ts CHANGED
@@ -2601,6 +2601,7 @@ interface DataSourceApi<T> {
2601
2601
  getIndexByNodePath(nodePath: NodePath$1): number;
2602
2602
  getPrimaryKeyByIndex(id: any): any;
2603
2603
  getNodePathById(id: any): NodePath$1 | null;
2604
+ getNodePathByIndex(index: number): NodePath$1 | null;
2604
2605
  get treeApi(): TreeApi<T>;
2605
2606
  updateData(data: Partial<T>, options?: DataSourceCRUDParam): Promise<any>;
2606
2607
  updateDataByNodePath(data: Partial<T>, nodePath: NodePath$1, options?: DataSourceUpdateParam): Promise<any>;
package/index.dev.js CHANGED
@@ -9206,13 +9206,10 @@ function InfiniteTableColumnCellFn(props) {
9206
9206
  let fn = void 0;
9207
9207
  const renderForNodeOrLeaf = isParentNode ? renderFunctions.renderTreeIconForParentNode : renderFunctions.renderTreeIconForLeafNode;
9208
9208
  fn = renderForNodeOrLeaf || // for parents, fallback to the renderTreeIcon as well
9209
- (isParentNode ? renderFunctions.renderTreeIcon : void 0);
9209
+ typeof renderFunctions.renderTreeIcon === "function" ? renderFunctions.renderTreeIcon : isParentNode && renderFunctions.renderTreeIcon === true ? defaultRenderTreeIcon : void 0;
9210
9210
  if (fn === true) {
9211
9211
  fn = defaultRenderTreeIcon;
9212
9212
  }
9213
- if (!fn) {
9214
- fn = void 0;
9215
- }
9216
9213
  if (fn) {
9217
9214
  renderParam.renderBag.treeIcon = /* @__PURE__ */ React36.createElement(
9218
9215
  RenderCellHookComponent,
@@ -15204,6 +15201,10 @@ var DataSourceApiImpl = class {
15204
15201
  const map2 = this.getState().idToPathMap;
15205
15202
  return map2.get(id) ?? null;
15206
15203
  };
15204
+ this.getNodePathByIndex = (index) => {
15205
+ const rowInfo = this.getRowInfoByIndex(index);
15206
+ return rowInfo && rowInfo.isTreeNode ? rowInfo.nodePath : null;
15207
+ };
15207
15208
  this.getPrimaryKeyByIndex = (index) => {
15208
15209
  const rowInfo = this.getRowInfoByIndex(index);
15209
15210
  return rowInfo ? rowInfo.id : void 0;
@@ -22062,7 +22063,7 @@ var useLicense = (licenseKey = "") => {
22062
22063
  }
22063
22064
  let valid2 = isValidLicense(licenseKey, {
22064
22065
  publishedAt: 1624970570587,
22065
- version: "6.0.2"
22066
+ version: "6.0.3"
22066
22067
  });
22067
22068
  if (!licenseKey && !valid2 && isInsidePlayground) {
22068
22069
  return true;
@@ -26290,8 +26291,8 @@ InfiniteTable.Footer = () => /* @__PURE__ */ React69.createElement(InfiniteTable
26290
26291
  // src/components/TreeGrid/TreeDataSource.tsx
26291
26292
  var React70 = __toESM(require("react"));
26292
26293
  function TreeDataSource(props) {
26293
- const { DataSource: DataSourceComponent } = useDataSourceInternal(props);
26294
- return /* @__PURE__ */ React70.createElement(DataSourceComponent, { nodesKey: props.nodesKey || "children" }, props.children ?? null);
26294
+ const { DataSource: DataSourceComponent } = useDataSourceInternal({ nodesKey: "children", ...props });
26295
+ return /* @__PURE__ */ React70.createElement(DataSourceComponent, null, props.children ?? null);
26295
26296
  }
26296
26297
 
26297
26298
  // src/components/TreeGrid/TreeGrid.tsx
package/index.dev.mjs CHANGED
@@ -9155,13 +9155,10 @@ function InfiniteTableColumnCellFn(props) {
9155
9155
  let fn = void 0;
9156
9156
  const renderForNodeOrLeaf = isParentNode ? renderFunctions.renderTreeIconForParentNode : renderFunctions.renderTreeIconForLeafNode;
9157
9157
  fn = renderForNodeOrLeaf || // for parents, fallback to the renderTreeIcon as well
9158
- (isParentNode ? renderFunctions.renderTreeIcon : void 0);
9158
+ typeof renderFunctions.renderTreeIcon === "function" ? renderFunctions.renderTreeIcon : isParentNode && renderFunctions.renderTreeIcon === true ? defaultRenderTreeIcon : void 0;
9159
9159
  if (fn === true) {
9160
9160
  fn = defaultRenderTreeIcon;
9161
9161
  }
9162
- if (!fn) {
9163
- fn = void 0;
9164
- }
9165
9162
  if (fn) {
9166
9163
  renderParam.renderBag.treeIcon = /* @__PURE__ */ React36.createElement(
9167
9164
  RenderCellHookComponent,
@@ -15153,6 +15150,10 @@ var DataSourceApiImpl = class {
15153
15150
  const map2 = this.getState().idToPathMap;
15154
15151
  return map2.get(id) ?? null;
15155
15152
  };
15153
+ this.getNodePathByIndex = (index) => {
15154
+ const rowInfo = this.getRowInfoByIndex(index);
15155
+ return rowInfo && rowInfo.isTreeNode ? rowInfo.nodePath : null;
15156
+ };
15156
15157
  this.getPrimaryKeyByIndex = (index) => {
15157
15158
  const rowInfo = this.getRowInfoByIndex(index);
15158
15159
  return rowInfo ? rowInfo.id : void 0;
@@ -22020,7 +22021,7 @@ var useLicense = (licenseKey = "") => {
22020
22021
  }
22021
22022
  let valid2 = isValidLicense(licenseKey, {
22022
22023
  publishedAt: 1624970570587,
22023
- version: "6.0.2"
22024
+ version: "6.0.3"
22024
22025
  });
22025
22026
  if (!licenseKey && !valid2 && isInsidePlayground) {
22026
22027
  return true;
@@ -26258,8 +26259,8 @@ InfiniteTable.Footer = () => /* @__PURE__ */ React69.createElement(InfiniteTable
26258
26259
  // src/components/TreeGrid/TreeDataSource.tsx
26259
26260
  import * as React70 from "react";
26260
26261
  function TreeDataSource(props) {
26261
- const { DataSource: DataSourceComponent } = useDataSourceInternal(props);
26262
- return /* @__PURE__ */ React70.createElement(DataSourceComponent, { nodesKey: props.nodesKey || "children" }, props.children ?? null);
26262
+ const { DataSource: DataSourceComponent } = useDataSourceInternal({ nodesKey: "children", ...props });
26263
+ return /* @__PURE__ */ React70.createElement(DataSourceComponent, null, props.children ?? null);
26263
26264
  }
26264
26265
 
26265
26266
  // src/components/TreeGrid/TreeGrid.tsx
package/index.js CHANGED
@@ -9206,13 +9206,10 @@ function InfiniteTableColumnCellFn(props) {
9206
9206
  let fn = void 0;
9207
9207
  const renderForNodeOrLeaf = isParentNode ? renderFunctions.renderTreeIconForParentNode : renderFunctions.renderTreeIconForLeafNode;
9208
9208
  fn = renderForNodeOrLeaf || // for parents, fallback to the renderTreeIcon as well
9209
- (isParentNode ? renderFunctions.renderTreeIcon : void 0);
9209
+ typeof renderFunctions.renderTreeIcon === "function" ? renderFunctions.renderTreeIcon : isParentNode && renderFunctions.renderTreeIcon === true ? defaultRenderTreeIcon : void 0;
9210
9210
  if (fn === true) {
9211
9211
  fn = defaultRenderTreeIcon;
9212
9212
  }
9213
- if (!fn) {
9214
- fn = void 0;
9215
- }
9216
9213
  if (fn) {
9217
9214
  renderParam.renderBag.treeIcon = /* @__PURE__ */ React36.createElement(
9218
9215
  RenderCellHookComponent,
@@ -15204,6 +15201,10 @@ var DataSourceApiImpl = class {
15204
15201
  const map2 = this.getState().idToPathMap;
15205
15202
  return map2.get(id) ?? null;
15206
15203
  };
15204
+ this.getNodePathByIndex = (index) => {
15205
+ const rowInfo = this.getRowInfoByIndex(index);
15206
+ return rowInfo && rowInfo.isTreeNode ? rowInfo.nodePath : null;
15207
+ };
15207
15208
  this.getPrimaryKeyByIndex = (index) => {
15208
15209
  const rowInfo = this.getRowInfoByIndex(index);
15209
15210
  return rowInfo ? rowInfo.id : void 0;
@@ -22062,7 +22063,7 @@ var useLicense = (licenseKey = "") => {
22062
22063
  }
22063
22064
  let valid2 = isValidLicense(licenseKey, {
22064
22065
  publishedAt: 1624970570587,
22065
- version: "6.0.2"
22066
+ version: "6.0.3"
22066
22067
  });
22067
22068
  if (!licenseKey && !valid2 && isInsidePlayground) {
22068
22069
  return true;
@@ -26290,8 +26291,8 @@ InfiniteTable.Footer = () => /* @__PURE__ */ React69.createElement(InfiniteTable
26290
26291
  // src/components/TreeGrid/TreeDataSource.tsx
26291
26292
  var React70 = __toESM(require("react"));
26292
26293
  function TreeDataSource(props) {
26293
- const { DataSource: DataSourceComponent } = useDataSourceInternal(props);
26294
- return /* @__PURE__ */ React70.createElement(DataSourceComponent, { nodesKey: props.nodesKey || "children" }, props.children ?? null);
26294
+ const { DataSource: DataSourceComponent } = useDataSourceInternal({ nodesKey: "children", ...props });
26295
+ return /* @__PURE__ */ React70.createElement(DataSourceComponent, null, props.children ?? null);
26295
26296
  }
26296
26297
 
26297
26298
  // src/components/TreeGrid/TreeGrid.tsx
package/index.mjs CHANGED
@@ -9155,13 +9155,10 @@ function InfiniteTableColumnCellFn(props) {
9155
9155
  let fn = void 0;
9156
9156
  const renderForNodeOrLeaf = isParentNode ? renderFunctions.renderTreeIconForParentNode : renderFunctions.renderTreeIconForLeafNode;
9157
9157
  fn = renderForNodeOrLeaf || // for parents, fallback to the renderTreeIcon as well
9158
- (isParentNode ? renderFunctions.renderTreeIcon : void 0);
9158
+ typeof renderFunctions.renderTreeIcon === "function" ? renderFunctions.renderTreeIcon : isParentNode && renderFunctions.renderTreeIcon === true ? defaultRenderTreeIcon : void 0;
9159
9159
  if (fn === true) {
9160
9160
  fn = defaultRenderTreeIcon;
9161
9161
  }
9162
- if (!fn) {
9163
- fn = void 0;
9164
- }
9165
9162
  if (fn) {
9166
9163
  renderParam.renderBag.treeIcon = /* @__PURE__ */ React36.createElement(
9167
9164
  RenderCellHookComponent,
@@ -15153,6 +15150,10 @@ var DataSourceApiImpl = class {
15153
15150
  const map2 = this.getState().idToPathMap;
15154
15151
  return map2.get(id) ?? null;
15155
15152
  };
15153
+ this.getNodePathByIndex = (index) => {
15154
+ const rowInfo = this.getRowInfoByIndex(index);
15155
+ return rowInfo && rowInfo.isTreeNode ? rowInfo.nodePath : null;
15156
+ };
15156
15157
  this.getPrimaryKeyByIndex = (index) => {
15157
15158
  const rowInfo = this.getRowInfoByIndex(index);
15158
15159
  return rowInfo ? rowInfo.id : void 0;
@@ -22020,7 +22021,7 @@ var useLicense = (licenseKey = "") => {
22020
22021
  }
22021
22022
  let valid2 = isValidLicense(licenseKey, {
22022
22023
  publishedAt: 1624970570587,
22023
- version: "6.0.2"
22024
+ version: "6.0.3"
22024
22025
  });
22025
22026
  if (!licenseKey && !valid2 && isInsidePlayground) {
22026
22027
  return true;
@@ -26258,8 +26259,8 @@ InfiniteTable.Footer = () => /* @__PURE__ */ React69.createElement(InfiniteTable
26258
26259
  // src/components/TreeGrid/TreeDataSource.tsx
26259
26260
  import * as React70 from "react";
26260
26261
  function TreeDataSource(props) {
26261
- const { DataSource: DataSourceComponent } = useDataSourceInternal(props);
26262
- return /* @__PURE__ */ React70.createElement(DataSourceComponent, { nodesKey: props.nodesKey || "children" }, props.children ?? null);
26262
+ const { DataSource: DataSourceComponent } = useDataSourceInternal({ nodesKey: "children", ...props });
26263
+ return /* @__PURE__ */ React70.createElement(DataSourceComponent, null, props.children ?? null);
26263
26264
  }
26264
26265
 
26265
26266
  // src/components/TreeGrid/TreeGrid.tsx
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "bugs": {
26
26
  "url": "https://github.com/infinite-table/infinite-react/issues"
27
27
  },
28
- "version": "6.0.2",
28
+ "version": "6.0.3",
29
29
  "main": "index.js",
30
30
  "module": "index.mjs",
31
31
  "typings": "index.d.ts",
@@ -34,5 +34,5 @@
34
34
  },
35
35
  "license": "Commercial & Open Source",
36
36
  "//": "will be updated at build time",
37
- "publishedAt": 1730121214427
37
+ "publishedAt": 1730129049591
38
38
  }