@vtx/components 4.0.0-beta.45 → 4.0.0-beta.47

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.
@@ -74,8 +74,8 @@ var VtxCombogrid = /*#__PURE__*/forwardRef(function (props, ref) {
74
74
  ref: comboRef
75
75
  })),
76
76
  trigger: "click",
77
- visible: disabled ? false : visible,
78
- onVisibleChange: function onVisibleChange(visible) {
77
+ open: disabled ? false : visible,
78
+ onOpenChange: function onOpenChange(visible) {
79
79
  return setVisible(visible);
80
80
  },
81
81
  classNames: {
@@ -17,6 +17,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
17
  import { useMergedState } from '@rc-component/util';
18
18
  import request from '@vtx/utils/lib/request';
19
19
  import getSignature from '@vtx/utils/lib/getSignature';
20
+ import VtxEllipsisText from "../../vtx-ellipsis-text";
20
21
  import { createContext, useEffect, useMemo, useRef, useState, useCallback } from 'react';
21
22
  import { useIntl } from "../../vtx-provider";
22
23
  import { message } from 'antd';
@@ -230,7 +231,10 @@ function useContainer() {
230
231
  })
231
232
  });
232
233
  } : 'render' in column ? column.render : function (text) {
233
- return ['', null, undefined].includes(text) ? '-' : text;
234
+ return ['', null, undefined].includes(text) ? '-' : column.ellipse && typeof text === 'string' ? /*#__PURE__*/_jsx(VtxEllipsisText, {
235
+ text: text,
236
+ lineClamp: 2
237
+ }) : text;
234
238
  }
235
239
  });
236
240
  });
@@ -364,9 +364,7 @@ function VtxTable(props) {
364
364
  bordered: true
365
365
  // virtual
366
366
  }, rest), {}, {
367
- dataSource: dataSource
368
- // scroll={{ ...scroll }}
369
- ,
367
+ dataSource: dataSource,
370
368
  scroll: _objectSpread({
371
369
  x: 'max-content'
372
370
  }, scroll),
@@ -380,8 +378,10 @@ function VtxTable(props) {
380
378
  })
381
379
  }, rest.locale),
382
380
  components: _components,
383
- columns: _columns,
384
- tableLayout: 'auto'
381
+ columns: _columns
382
+ // tableLayout={'auto'}
383
+ ,
384
+ tableLayout: "fixed"
385
385
  }))]
386
386
  }));
387
387
  }
@@ -8,12 +8,14 @@ import { useStyle as useAntdStyle } from "../../vtx-provider";
8
8
  var genVtxStyle = function genVtxStyle(token) {
9
9
  var componentCls = token.componentCls,
10
10
  antCls = token.antCls;
11
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty({
11
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty({
12
12
  position: 'relative',
13
13
  // overflow: 'hidden',
14
14
  display: 'flex',
15
15
  flexDirection: 'column'
16
- }, "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "table", {
16
+ }, "".concat(antCls, "-table-cell-ellipsis"), {
17
+ whiteSpace: "normal"
18
+ }), "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "table", {
17
19
  // minWidth: "calc(100% - 2px) !important"
18
20
  }), '.ant-spin', _defineProperty({
19
21
  height: '100%'
@@ -31,7 +31,7 @@ function VtxEllipsisText(props) {
31
31
  wrapSSR = _useStyle.wrapSSR,
32
32
  hashId = _useStyle.hashId;
33
33
  var textStyle = {};
34
- if (lineClamp >= 2) {
34
+ if (lineClamp >= 1) {
35
35
  textStyle['WebkitLineClamp'] = lineClamp;
36
36
  }
37
37
  return wrapSSR( /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
@@ -40,7 +40,7 @@ function VtxEllipsisText(props) {
40
40
  mouseEnterDelay: 0.3
41
41
  }, tooltip), {}, {
42
42
  children: /*#__PURE__*/_jsx("p", {
43
- className: classnames(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 2), "".concat(prefixCls, "--multi"), lineClamp >= 2), className),
43
+ className: classnames(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 1), "".concat(prefixCls, "--multi"), lineClamp >= 1), className),
44
44
  style: _objectSpread(_objectSpread({}, style), textStyle),
45
45
  children: text
46
46
  })
@@ -135,8 +135,9 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
135
135
  });
136
136
  };
137
137
  var newProps = _objectSpread(_objectSpread({
138
- showSearch: true,
139
- optionFilterProp: 'children',
138
+ showSearch: {
139
+ optionFilterProp: 'label'
140
+ },
140
141
  placeholder: TextEnum.defaultPlaceholderText,
141
142
  allowClear: true
142
143
  }, props), {}, {
@@ -83,8 +83,8 @@ var VtxCombogrid = exports.VtxCombogrid = /*#__PURE__*/(0, _react.forwardRef)(fu
83
83
  ref: comboRef
84
84
  })),
85
85
  trigger: "click",
86
- visible: disabled ? false : visible,
87
- onVisibleChange: function onVisibleChange(visible) {
86
+ open: disabled ? false : visible,
87
+ onOpenChange: function onOpenChange(visible) {
88
88
  return setVisible(visible);
89
89
  },
90
90
  classNames: {
@@ -8,6 +8,7 @@ exports.indexColumnKey = exports.TableContext = exports.Container = void 0;
8
8
  var _util = require("@rc-component/util");
9
9
  var _request = _interopRequireDefault(require("@vtx/utils/lib/request"));
10
10
  var _getSignature = _interopRequireDefault(require("@vtx/utils/lib/getSignature"));
11
+ var _vtxEllipsisText = _interopRequireDefault(require("../../vtx-ellipsis-text"));
11
12
  var _react = require("react");
12
13
  var _vtxProvider = require("../../vtx-provider");
13
14
  var _antd = require("antd");
@@ -237,7 +238,10 @@ function useContainer() {
237
238
  })
238
239
  });
239
240
  } : 'render' in column ? column.render : function (text) {
240
- return ['', null, undefined].includes(text) ? '-' : text;
241
+ return ['', null, undefined].includes(text) ? '-' : column.ellipse && typeof text === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_vtxEllipsisText.default, {
242
+ text: text,
243
+ lineClamp: 2
244
+ }) : text;
241
245
  }
242
246
  });
243
247
  });
@@ -374,9 +374,7 @@ function VtxTable(props) {
374
374
  bordered: true
375
375
  // virtual
376
376
  }, rest), {}, {
377
- dataSource: dataSource
378
- // scroll={{ ...scroll }}
379
- ,
377
+ dataSource: dataSource,
380
378
  scroll: _objectSpread({
381
379
  x: 'max-content'
382
380
  }, scroll),
@@ -390,8 +388,10 @@ function VtxTable(props) {
390
388
  })
391
389
  }, rest.locale),
392
390
  components: _components,
393
- columns: _columns,
394
- tableLayout: 'auto'
391
+ columns: _columns
392
+ // tableLayout={'auto'}
393
+ ,
394
+ tableLayout: "fixed"
395
395
  }))]
396
396
  }));
397
397
  }
@@ -14,12 +14,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
14
14
  var genVtxStyle = function genVtxStyle(token) {
15
15
  var componentCls = token.componentCls,
16
16
  antCls = token.antCls;
17
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty({
17
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty({
18
18
  position: 'relative',
19
19
  // overflow: 'hidden',
20
20
  display: 'flex',
21
21
  flexDirection: 'column'
22
- }, "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "table", {
22
+ }, "".concat(antCls, "-table-cell-ellipsis"), {
23
+ whiteSpace: "normal"
24
+ }), "".concat(antCls, "-table-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "table", {
23
25
  // minWidth: "calc(100% - 2px) !important"
24
26
  }), '.ant-spin', _defineProperty({
25
27
  height: '100%'
@@ -40,7 +40,7 @@ function VtxEllipsisText(props) {
40
40
  wrapSSR = _useStyle.wrapSSR,
41
41
  hashId = _useStyle.hashId;
42
42
  var textStyle = {};
43
- if (lineClamp >= 2) {
43
+ if (lineClamp >= 1) {
44
44
  textStyle['WebkitLineClamp'] = lineClamp;
45
45
  }
46
46
  return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, _objectSpread(_objectSpread({
@@ -49,7 +49,7 @@ function VtxEllipsisText(props) {
49
49
  mouseEnterDelay: 0.3
50
50
  }, tooltip), {}, {
51
51
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
52
- className: (0, _classnames2.default)(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 2), "".concat(prefixCls, "--multi"), lineClamp >= 2), className),
52
+ className: (0, _classnames2.default)(prefixCls, hashId, _defineProperty(_defineProperty({}, "".concat(prefixCls, "--single"), lineClamp < 1), "".concat(prefixCls, "--multi"), lineClamp >= 1), className),
53
53
  style: _objectSpread(_objectSpread({}, style), textStyle),
54
54
  children: text
55
55
  })
@@ -143,8 +143,9 @@ var VtxSelect = exports.VtxSelect = /*#__PURE__*/(0, _react.forwardRef)(function
143
143
  });
144
144
  };
145
145
  var newProps = _objectSpread(_objectSpread({
146
- showSearch: true,
147
- optionFilterProp: 'children',
146
+ showSearch: {
147
+ optionFilterProp: 'label'
148
+ },
148
149
  placeholder: TextEnum.defaultPlaceholderText,
149
150
  allowClear: true
150
151
  }, props), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtx/components",
3
- "version": "4.0.0-beta.45",
3
+ "version": "4.0.0-beta.47",
4
4
  "description": "React components for Vortex",
5
5
  "keywords": [
6
6
  "react",