@lemon-fe/components 1.5.7-alpha.2 → 1.5.7-alpha.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.
@@ -1022,7 +1022,7 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
1022
1022
  key: "getFullColumnDef",
1023
1023
  value: function getFullColumnDef(col) {
1024
1024
  if (col.type === undefined) {
1025
- return _objectSpread({}, col);
1025
+ return col;
1026
1026
  }
1027
1027
  var _this$props7 = this.props,
1028
1028
  mColumnTypes = _this$props7.columnTypes,
@@ -1062,6 +1062,7 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
1062
1062
  var map = function map(cols) {
1063
1063
  return cols.map(function (item) {
1064
1064
  if (isColumn(item)) {
1065
+ var _opts$headerName, _opts$sortable;
1065
1066
  var title = item.title,
1066
1067
  dataIndex = item.dataIndex,
1067
1068
  render = item.render,
@@ -1094,9 +1095,6 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
1094
1095
  } else if (title !== undefined) {
1095
1096
  opts.headerName = title.toString();
1096
1097
  }
1097
- if (enableEstimateInitialColumnWidth && opts.headerName && !keepInitialWidthWhenEstimate) {
1098
- opts.initialWidth = Math.min(getTextWidth(opts.headerName) * 14 + 36 + (opts.headerComponentParams !== undefined ? 24 : 0), ESTIMATE_INITIAL_COLUMN_MAX_WIDTH);
1099
- }
1100
1098
 
1101
1099
  // render
1102
1100
  if (render !== undefined) {
@@ -1123,6 +1121,11 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
1123
1121
  opts.sortable = sorter;
1124
1122
  }
1125
1123
  }
1124
+ var headerName = (_opts$headerName = opts.headerName) !== null && _opts$headerName !== void 0 ? _opts$headerName : def.headerName;
1125
+ var sortable = (_opts$sortable = opts.sortable) !== null && _opts$sortable !== void 0 ? _opts$sortable : def.sortable;
1126
+ if (enableEstimateInitialColumnWidth && headerName && !keepInitialWidthWhenEstimate) {
1127
+ opts.initialWidth = Math.min(getTextWidth(headerName) * 14 + 36 + (sortable ? 10 : 0) + (opts.headerComponentParams !== undefined ? 24 : 0), ESTIMATE_INITIAL_COLUMN_MAX_WIDTH);
1128
+ }
1126
1129
 
1127
1130
  // editable
1128
1131
  if (_typeof(editable) === 'object') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "1.5.7-alpha.2",
3
+ "version": "1.5.7-alpha.3",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "registry": "https://registry.npmjs.org"
60
60
  },
61
- "gitHead": "f4344479e739f297b7901b3ed3f3d91e45b5074a"
61
+ "gitHead": "2ac91e3697f76af6883a124f78461e3e119da69f"
62
62
  }