@pisell/materials 1.0.271 → 1.0.273

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.
@@ -10,6 +10,7 @@ export interface CustomHeaderCellProps {
10
10
  style?: any;
11
11
  lock?: 0 | 1;
12
12
  editable?: boolean;
13
+ position: 'start' | 'end' | "";
13
14
  }
14
15
  declare const _default: {
15
16
  Row: React.FC<any>;
@@ -1,6 +1,6 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
  var _excluded = ["index"],
3
- _excluded2 = ["onResize", "width", "field_type", "lock", "editable", "dataIndex"];
3
+ _excluded2 = ["onResize", "width", "field_type", "lock", "editable", "dataIndex", "position"];
4
4
  var _templateObject;
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -29,6 +29,7 @@ var CustomHeaderCell = function CustomHeaderCell(props) {
29
29
  lock = props.lock,
30
30
  editable = props.editable,
31
31
  dataIndex = props.dataIndex,
32
+ position = props.position,
32
33
  restProps = _objectWithoutProperties(props, _excluded2);
33
34
  var isCheckbox = !props.record;
34
35
 
@@ -36,6 +37,11 @@ var CustomHeaderCell = function CustomHeaderCell(props) {
36
37
  if (isCheckbox) {
37
38
  restProps.style = _objectSpread({}, restProps.style);
38
39
  }
40
+
41
+ // 最后一列不增加拖拽功能
42
+ if (position === 'end') {
43
+ return /*#__PURE__*/React.createElement("td", restProps, /*#__PURE__*/React.createElement(CellProvider, props));
44
+ }
39
45
  return /*#__PURE__*/React.createElement(ResizeCellStyle, {
40
46
  width: width || 200,
41
47
  height: 0,
@@ -108,16 +108,27 @@ var useTransColumns = function useTransColumns(params) {
108
108
  position = "end";
109
109
  }
110
110
  var groupObj = {};
111
+ if (groupField) {
112
+ groupObj = {
113
+ render: function render(text, record) {
114
+ var _col$render;
115
+ if (record.__is_group) {
116
+ return null;
117
+ }
118
+ return (col === null || col === void 0 ? void 0 : (_col$render = col.render) === null || _col$render === void 0 ? void 0 : _col$render.call(col, text, record)) || text;
119
+ }
120
+ };
121
+ }
111
122
  if (position === "start" && groupField) {
112
123
  groupObj = {
113
124
  fixed: "left",
114
125
  width: 350,
115
126
  render: function render(text, record) {
116
- var _col$render;
127
+ var _col$render2;
117
128
  if (record.__is_group && groupFieldRender) {
118
129
  return groupFieldRender(text, record);
119
130
  }
120
- return (col === null || col === void 0 ? void 0 : (_col$render = col.render) === null || _col$render === void 0 ? void 0 : _col$render.call(col, text, record)) || text;
131
+ return (col === null || col === void 0 ? void 0 : (_col$render2 = col.render) === null || _col$render2 === void 0 ? void 0 : _col$render2.call(col, text, record)) || text;
121
132
  }
122
133
  };
123
134
  }
@@ -175,7 +186,8 @@ var useTransColumns = function useTransColumns(params) {
175
186
  return _objectSpread(_objectSpread({
176
187
  record: record
177
188
  }, item), {}, {
178
- onResize: handleResize === null || handleResize === void 0 ? void 0 : handleResize(index)
189
+ onResize: handleResize === null || handleResize === void 0 ? void 0 : handleResize(index),
190
+ position: position
179
191
  });
180
192
  }
181
193
  });
@@ -10,6 +10,7 @@ export interface CustomHeaderCellProps {
10
10
  style?: any;
11
11
  lock?: 0 | 1;
12
12
  editable?: boolean;
13
+ position: 'start' | 'end' | "";
13
14
  }
14
15
  declare const _default: {
15
16
  Row: React.FC<any>;
@@ -80,6 +80,7 @@ var CustomHeaderCell = (props) => {
80
80
  lock,
81
81
  editable,
82
82
  dataIndex,
83
+ position,
83
84
  ...restProps
84
85
  } = props;
85
86
  const isCheckbox = !props.record;
@@ -89,6 +90,9 @@ var CustomHeaderCell = (props) => {
89
90
  // paddingInlineStart: 8,
90
91
  };
91
92
  }
93
+ if (position === "end") {
94
+ return /* @__PURE__ */ import_react.default.createElement("td", { ...restProps }, /* @__PURE__ */ import_react.default.createElement(import_CellProvider.default, { ...props }));
95
+ }
92
96
  return /* @__PURE__ */ import_react.default.createElement(
93
97
  ResizeCellStyle,
94
98
  {
@@ -130,6 +130,17 @@ var useTransColumns = (params) => {
130
130
  position = "end";
131
131
  }
132
132
  let groupObj = {};
133
+ if (groupField) {
134
+ groupObj = {
135
+ render: (text, record) => {
136
+ var _a4;
137
+ if (record.__is_group) {
138
+ return null;
139
+ }
140
+ return ((_a4 = col == null ? void 0 : col.render) == null ? void 0 : _a4.call(col, text, record)) || text;
141
+ }
142
+ };
143
+ }
133
144
  if (position === "start" && groupField) {
134
145
  groupObj = {
135
146
  fixed: "left",
@@ -186,7 +197,8 @@ var useTransColumns = (params) => {
186
197
  onHeaderCell: (record) => ({
187
198
  record,
188
199
  ...item,
189
- onResize: handleResize == null ? void 0 : handleResize(index)
200
+ onResize: handleResize == null ? void 0 : handleResize(index),
201
+ position
190
202
  })
191
203
  };
192
204
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.271",
3
+ "version": "1.0.273",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -62,9 +62,9 @@
62
62
  "react-window": "^1.8.10",
63
63
  "react-virtualized-auto-sizer": "^1.0.20",
64
64
  "crypto-js": "^4.2.0",
65
- "@pisell/icon": "0.0.8",
66
65
  "@pisell/utils": "1.0.25",
67
- "@pisell/date-picker": "1.0.72"
66
+ "@pisell/date-picker": "1.0.72",
67
+ "@pisell/icon": "0.0.8"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^18.0.0",