elab_components 0.11.9 → 0.11.12

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/dist/index.esm.js CHANGED
@@ -33595,10 +33595,10 @@ var OkGrid = function (_a) {
33595
33595
  // setResultState({ ...resultState, data: newData });
33596
33596
  }
33597
33597
  };
33598
- var calculateWidth = useCallback(function (field, type) {
33598
+ var calculateWidth = useCallback(function (field, type, data) {
33599
33599
  var width = 0;
33600
- if ((expandedData === null || expandedData === void 0 ? void 0 : expandedData.length) !== 0) {
33601
- expandedData.forEach(function (item) {
33600
+ if ((data === null || data === void 0 ? void 0 : data.length) !== 0) {
33601
+ data.forEach(function (item) {
33602
33602
  var text = String(item[field]).replace(/\s+/g, '');
33603
33603
  var size = _default(text);
33604
33604
  if (size.width > width) {
@@ -33617,17 +33617,17 @@ var OkGrid = function (_a) {
33617
33617
  width = 150;
33618
33618
  }
33619
33619
  return "".concat(width + 30, "px");
33620
- }, [expandedData]);
33620
+ }, []);
33621
33621
  var memoizedColumns = useMemo(function () {
33622
33622
  return columns.map(function (col, index) {
33623
33623
  var _a, _b;
33624
33624
  return (React__default.createElement(GridColumn, { key: col.field || index, width: columnAutoSize
33625
- ? ((_a = col === null || col === void 0 ? void 0 : col.width) !== null && _a !== void 0 ? _a : calculateWidth(col.field, col.editor))
33625
+ ? ((_a = col === null || col === void 0 ? void 0 : col.width) !== null && _a !== void 0 ? _a : calculateWidth(col.field, col.editor, expandedData))
33626
33626
  : ((_b = col === null || col === void 0 ? void 0 : col.width) !== null && _b !== void 0 ? _b : 200), filterable: col.filterable, resizable: col.field === '-' || col.field === '' || col.field === 'selected'
33627
33627
  ? false
33628
33628
  : true, editable: col === null || col === void 0 ? void 0 : col.editable, field: col.field, title: col.title, format: col.format, footerCell: col.footerCell, cells: { data: function (props) { return getCellComponent(props, col); } }, headerSelectionValue: col.headerSelectionValue, editor: col.editor, locked: col.locked }));
33629
33629
  });
33630
- }, [columns, getCellComponent]);
33630
+ }, [columns, getCellComponent, expandedData]);
33631
33631
  var exportedColumnConfigs = columnConfigs.filter(function (col) { return col.title !== 'Select' && col.title !== 'Actions'; });
33632
33632
  useEffect(function () {
33633
33633
  if (setGridAllEditedData) {
package/dist/index.js CHANGED
@@ -33623,10 +33623,10 @@ var OkGrid = function (_a) {
33623
33623
  // setResultState({ ...resultState, data: newData });
33624
33624
  }
33625
33625
  };
33626
- var calculateWidth = React.useCallback(function (field, type) {
33626
+ var calculateWidth = React.useCallback(function (field, type, data) {
33627
33627
  var width = 0;
33628
- if ((expandedData === null || expandedData === void 0 ? void 0 : expandedData.length) !== 0) {
33629
- expandedData.forEach(function (item) {
33628
+ if ((data === null || data === void 0 ? void 0 : data.length) !== 0) {
33629
+ data.forEach(function (item) {
33630
33630
  var text = String(item[field]).replace(/\s+/g, '');
33631
33631
  var size = _default(text);
33632
33632
  if (size.width > width) {
@@ -33645,17 +33645,17 @@ var OkGrid = function (_a) {
33645
33645
  width = 150;
33646
33646
  }
33647
33647
  return "".concat(width + 30, "px");
33648
- }, [expandedData]);
33648
+ }, []);
33649
33649
  var memoizedColumns = React.useMemo(function () {
33650
33650
  return columns.map(function (col, index) {
33651
33651
  var _a, _b;
33652
33652
  return (React__default["default"].createElement(kendoReactGrid.GridColumn, { key: col.field || index, width: columnAutoSize
33653
- ? ((_a = col === null || col === void 0 ? void 0 : col.width) !== null && _a !== void 0 ? _a : calculateWidth(col.field, col.editor))
33653
+ ? ((_a = col === null || col === void 0 ? void 0 : col.width) !== null && _a !== void 0 ? _a : calculateWidth(col.field, col.editor, expandedData))
33654
33654
  : ((_b = col === null || col === void 0 ? void 0 : col.width) !== null && _b !== void 0 ? _b : 200), filterable: col.filterable, resizable: col.field === '-' || col.field === '' || col.field === 'selected'
33655
33655
  ? false
33656
33656
  : true, editable: col === null || col === void 0 ? void 0 : col.editable, field: col.field, title: col.title, format: col.format, footerCell: col.footerCell, cells: { data: function (props) { return getCellComponent(props, col); } }, headerSelectionValue: col.headerSelectionValue, editor: col.editor, locked: col.locked }));
33657
33657
  });
33658
- }, [columns, getCellComponent]);
33658
+ }, [columns, getCellComponent, expandedData]);
33659
33659
  var exportedColumnConfigs = columnConfigs.filter(function (col) { return col.title !== 'Select' && col.title !== 'Actions'; });
33660
33660
  React.useEffect(function () {
33661
33661
  if (setGridAllEditedData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elab_components",
3
- "version": "0.11.9",
3
+ "version": "0.11.12",
4
4
  "private": false,
5
5
  "author": "Amar",
6
6
  "main": "dist/index.js",