elab_components 0.11.7 → 0.11.9

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,5 +1,5 @@
1
1
  declare const props: () => {
2
- activeRangeEnd: "end" | "start";
2
+ activeRangeEnd: "start" | "end";
3
3
  allowReverse: import("@storybook/addon-knobs/dist/type-defs").Mutable<boolean>;
4
4
  bottomView: "month" | "year" | "decade" | "century";
5
5
  defaultActiveView: "month" | "year" | "decade" | "century";
package/dist/index.esm.js CHANGED
@@ -33595,32 +33595,32 @@ var OkGrid = function (_a) {
33595
33595
  // setResultState({ ...resultState, data: newData });
33596
33596
  }
33597
33597
  };
33598
+ var calculateWidth = useCallback(function (field, type) {
33599
+ var width = 0;
33600
+ if ((expandedData === null || expandedData === void 0 ? void 0 : expandedData.length) !== 0) {
33601
+ expandedData.forEach(function (item) {
33602
+ var text = String(item[field]).replace(/\s+/g, '');
33603
+ var size = _default(text);
33604
+ if (size.width > width) {
33605
+ width =
33606
+ (type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'datetime'
33607
+ ? 180
33608
+ : (type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'date'
33609
+ ? 80
33610
+ : text
33611
+ ? size.width
33612
+ : 150;
33613
+ }
33614
+ });
33615
+ }
33616
+ else {
33617
+ width = 150;
33618
+ }
33619
+ return "".concat(width + 30, "px");
33620
+ }, [expandedData]);
33598
33621
  var memoizedColumns = useMemo(function () {
33599
33622
  return columns.map(function (col, index) {
33600
33623
  var _a, _b;
33601
- var calculateWidth = function (field, type) {
33602
- var width = 0;
33603
- if ((expandedData === null || expandedData === void 0 ? void 0 : expandedData.length) !== 0) {
33604
- expandedData.forEach(function (item) {
33605
- var text = String(item[field]).replace(/\s+/g, '');
33606
- var size = _default(text);
33607
- if (size.width > width) {
33608
- width =
33609
- (type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'datetime'
33610
- ? 180
33611
- : (type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'date'
33612
- ? 80
33613
- : text
33614
- ? size.width
33615
- : 150;
33616
- }
33617
- });
33618
- }
33619
- else {
33620
- width = 150;
33621
- }
33622
- return "".concat(width + 30, "px");
33623
- };
33624
33624
  return (React__default.createElement(GridColumn, { key: col.field || index, width: columnAutoSize
33625
33625
  ? ((_a = col === null || col === void 0 ? void 0 : col.width) !== null && _a !== void 0 ? _a : calculateWidth(col.field, col.editor))
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'
package/dist/index.js CHANGED
@@ -33623,32 +33623,32 @@ var OkGrid = function (_a) {
33623
33623
  // setResultState({ ...resultState, data: newData });
33624
33624
  }
33625
33625
  };
33626
+ var calculateWidth = React.useCallback(function (field, type) {
33627
+ var width = 0;
33628
+ if ((expandedData === null || expandedData === void 0 ? void 0 : expandedData.length) !== 0) {
33629
+ expandedData.forEach(function (item) {
33630
+ var text = String(item[field]).replace(/\s+/g, '');
33631
+ var size = _default(text);
33632
+ if (size.width > width) {
33633
+ width =
33634
+ (type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'datetime'
33635
+ ? 180
33636
+ : (type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'date'
33637
+ ? 80
33638
+ : text
33639
+ ? size.width
33640
+ : 150;
33641
+ }
33642
+ });
33643
+ }
33644
+ else {
33645
+ width = 150;
33646
+ }
33647
+ return "".concat(width + 30, "px");
33648
+ }, [expandedData]);
33626
33649
  var memoizedColumns = React.useMemo(function () {
33627
33650
  return columns.map(function (col, index) {
33628
33651
  var _a, _b;
33629
- var calculateWidth = function (field, type) {
33630
- var width = 0;
33631
- if ((expandedData === null || expandedData === void 0 ? void 0 : expandedData.length) !== 0) {
33632
- expandedData.forEach(function (item) {
33633
- var text = String(item[field]).replace(/\s+/g, '');
33634
- var size = _default(text);
33635
- if (size.width > width) {
33636
- width =
33637
- (type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'datetime'
33638
- ? 180
33639
- : (type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'date'
33640
- ? 80
33641
- : text
33642
- ? size.width
33643
- : 150;
33644
- }
33645
- });
33646
- }
33647
- else {
33648
- width = 150;
33649
- }
33650
- return "".concat(width + 30, "px");
33651
- };
33652
33652
  return (React__default["default"].createElement(kendoReactGrid.GridColumn, { key: col.field || index, width: columnAutoSize
33653
33653
  ? ((_a = col === null || col === void 0 ? void 0 : col.width) !== null && _a !== void 0 ? _a : calculateWidth(col.field, col.editor))
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'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elab_components",
3
- "version": "0.11.7",
3
+ "version": "0.11.9",
4
4
  "private": false,
5
5
  "author": "Amar",
6
6
  "main": "dist/index.js",