@vtx/components 4.0.0-beta.34 → 4.0.0-beta.35

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.
@@ -106,7 +106,7 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
106
106
  return child[key] || '';
107
107
  };
108
108
  return /*#__PURE__*/_jsx("div", {
109
- className: "vtx-all-list",
109
+ className: classnames("".concat(prefixCls, "-all-list"), hashId),
110
110
  children: Array.isArray(value) && value.length ? value.map(function (item, index) {
111
111
  var name = getChildren(child, item);
112
112
  return /*#__PURE__*/_jsx(Tag, {
@@ -213,9 +213,7 @@ var VtxSelect = /*#__PURE__*/forwardRef(function (props, ref) {
213
213
  wrapSSR = _useStyle.wrapSSR,
214
214
  hashId = _useStyle.hashId;
215
215
  return wrapSSR( /*#__PURE__*/_jsx("div", {
216
- className: classnames(prefixCls, hashId, {
217
- 'vtx-multi-select': mode == 'multiple' || mode == 'tags'
218
- }),
216
+ className: classnames(prefixCls, hashId, _defineProperty({}, "".concat(prefixCls, "-multi"), mode == 'multiple' || mode == 'tags')),
219
217
  id: elId.current,
220
218
  ref: elRef,
221
219
  style: _objectSpread(_objectSpread({}, props.style), {}, {
@@ -4,69 +4,25 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { over } from '@umijs/utils/compiled/lodash';
7
8
  import { useStyle as useAntdStyle } from "../../vtx-provider";
8
9
  var genVtxSelectStyle = function genVtxSelectStyle(token) {
9
10
  var componentCls = token.componentCls;
10
- return _defineProperty(_defineProperty({}, componentCls, {
11
- backgroundColor: 'transparent',
12
- position: 'relative',
13
- display: 'inline-block',
14
- width: '100%',
15
- '.vtx-select-count': {
16
- position: 'absolute',
17
- top: '0',
18
- verticalAlign: 'top'
19
- },
20
- '.vtx-all-list': {
21
- position: 'absolute',
22
- zIndex: 999,
23
- boxSizing: 'border-box',
24
- width: '100%',
25
- padding: '5px',
26
- boxShadow: '0 2px 8px #d9d9d9',
27
- backgroundColor: 'red !important'
28
- },
29
- '.ant-select-selection--multiple': {
30
- maxHeight: '32px',
31
- overflow: 'hidden'
32
- }
33
- }), '.vtx-multi-select', {
34
- position: 'relative',
35
- display: 'inline-block',
36
- width: '100%',
37
- maxHeight: '32px !important',
38
- boxSizing: 'border-box',
39
- '.vtx-select-count': {
40
- position: 'absolute',
41
- top: 0,
42
- right: 0,
43
- verticalAlign: 'top',
44
- borderLeft: 'none',
45
- borderTopLeftRadius: 0,
46
- 'border-bottom-left-radius': 0
47
- },
48
- '.vtx-all-list': {
49
- position: 'absolute',
50
- zIndex: 999,
51
- boxSizing: 'border-box',
52
- width: '100%',
53
- padding: '5px',
54
- boxShadow: '0 2px 8px #d9d9d9'
55
- },
56
- '.ant-select-selector': {
57
- 'border-top-right-radius': 0,
58
- 'border-bottom-right-radius': 0,
59
- maxHeight: '32px !important',
60
- overflow: 'hidden'
61
- },
62
- '.ant-select-selection--multiple': {
63
- maxHeight: '32px',
64
- overflow: 'hidden'
11
+ return _defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty({
12
+ width: "100%"
13
+ }, '.ant-select', {
14
+ overflow: "hidden"
15
+ })), "".concat(componentCls, "-multi"), {
16
+ ".ant-select-content": {
17
+ flexWrap: "nowrap"
65
18
  }
19
+ }), "".concat(componentCls, "-all-list"), {
20
+ maxHeight: 300,
21
+ overflowY: "auto"
66
22
  });
67
23
  };
68
24
  export function useStyle(prefixCls) {
69
- return useAntdStyle('VtxSelect', function (token) {
25
+ return useAntdStyle('', function (token) {
70
26
  var vtxSelectToken = _objectSpread(_objectSpread({}, token), {}, {
71
27
  componentCls: ".".concat(prefixCls)
72
28
  });
@@ -142,24 +142,27 @@ var VtxTreeSelect = function VtxTreeSelect(_ref) {
142
142
  },
143
143
  children: intl.getMessage('treeSelect.clearSelectedItems', '清空已选项')
144
144
  })]
145
- }), selectedNodes.length > 0 ? selectedNodes.map(function (item) {
146
- var _item$fieldNames$labe;
147
- return /*#__PURE__*/_jsx(Tag, {
148
- closable: !disabled,
149
- onClose: function onClose(e) {
150
- e.stopPropagation();
151
- clearKey(item[fieldNames.value]);
152
- },
153
- styles: {
154
- root: {
155
- marginBottom: 5,
156
- marginRight: 5
157
- }
158
- },
159
- children: ((_item$fieldNames$labe = item[fieldNames.label]) === null || _item$fieldNames$labe === void 0 ? void 0 : _item$fieldNames$labe.length) > 20 ? "".concat(item[fieldNames.label].slice(0, 20), "...") : item[fieldNames.label]
160
- }, "tab-".concat(item[fieldNames.value]));
161
- }) : /*#__PURE__*/_jsx(Empty, {
162
- image: Empty.PRESENTED_IMAGE_SIMPLE
145
+ }), /*#__PURE__*/_jsx("div", {
146
+ className: classnames("".concat(prefixCls, "-all-list"), hashId),
147
+ children: selectedNodes.length > 0 ? selectedNodes.map(function (item) {
148
+ var _item$fieldNames$labe;
149
+ return /*#__PURE__*/_jsx(Tag, {
150
+ closable: !disabled,
151
+ onClose: function onClose(e) {
152
+ e.stopPropagation();
153
+ clearKey(item[fieldNames.value]);
154
+ },
155
+ styles: {
156
+ root: {
157
+ marginBottom: 5,
158
+ marginRight: 5
159
+ }
160
+ },
161
+ children: ((_item$fieldNames$labe = item[fieldNames.label]) === null || _item$fieldNames$labe === void 0 ? void 0 : _item$fieldNames$labe.length) > 20 ? "".concat(item[fieldNames.label].slice(0, 20), "...") : item[fieldNames.label]
162
+ }, "tab-".concat(item[fieldNames.value]));
163
+ }) : /*#__PURE__*/_jsx(Empty, {
164
+ image: Empty.PRESENTED_IMAGE_SIMPLE
165
+ })
163
166
  })]
164
167
  });
165
168
  var onChangeTreeSelect = function onChangeTreeSelect(value, label, extra) {
@@ -8,7 +8,7 @@ import { useStyle as useAntdStyle } from "../../vtx-provider";
8
8
  var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
9
9
  var componentCls = token.componentCls;
10
10
  console.log('token.controlHeight', token.controlHeight);
11
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
11
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
12
12
  minWidth: '200px',
13
13
  height: '300px',
14
14
  overflow: 'auto',
@@ -48,6 +48,9 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
48
48
  }, '&:hover', {
49
49
  color: '#40a9ff'
50
50
  })
51
+ }), "".concat(componentCls, "-all-list"), {
52
+ maxHeight: 300,
53
+ overflowY: "auto"
51
54
  }), "".concat(componentCls, "-outer"), {
52
55
  position: 'relative',
53
56
  display: 'inline-flex',
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.VtxSelect = void 0;
8
8
  var _antd = require("antd");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _classnames2 = _interopRequireDefault(require("classnames"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var _style = require("./style");
12
12
  var _icons = require("@ant-design/icons");
@@ -114,7 +114,7 @@ var VtxSelect = exports.VtxSelect = /*#__PURE__*/(0, _react.forwardRef)(function
114
114
  return child[key] || '';
115
115
  };
116
116
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
117
- className: "vtx-all-list",
117
+ className: (0, _classnames2.default)("".concat(prefixCls, "-all-list"), hashId),
118
118
  children: Array.isArray(value) && value.length ? value.map(function (item, index) {
119
119
  var name = getChildren(child, item);
120
120
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tag, {
@@ -221,9 +221,7 @@ var VtxSelect = exports.VtxSelect = /*#__PURE__*/(0, _react.forwardRef)(function
221
221
  wrapSSR = _useStyle.wrapSSR,
222
222
  hashId = _useStyle.hashId;
223
223
  return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
224
- className: (0, _classnames.default)(prefixCls, hashId, {
225
- 'vtx-multi-select': mode == 'multiple' || mode == 'tags'
226
- }),
224
+ className: (0, _classnames2.default)(prefixCls, hashId, _defineProperty({}, "".concat(prefixCls, "-multi"), mode == 'multiple' || mode == 'tags')),
227
225
  id: elId.current,
228
226
  ref: elRef,
229
227
  style: _objectSpread(_objectSpread({}, props.style), {}, {
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useStyle = useStyle;
7
+ var _lodash = require("@umijs/utils/compiled/lodash");
7
8
  var _vtxProvider = require("../../vtx-provider");
8
9
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
10
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -13,66 +14,21 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
13
14
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
15
  var genVtxSelectStyle = function genVtxSelectStyle(token) {
15
16
  var componentCls = token.componentCls;
16
- return _defineProperty(_defineProperty({}, componentCls, {
17
- backgroundColor: 'transparent',
18
- position: 'relative',
19
- display: 'inline-block',
20
- width: '100%',
21
- '.vtx-select-count': {
22
- position: 'absolute',
23
- top: '0',
24
- verticalAlign: 'top'
25
- },
26
- '.vtx-all-list': {
27
- position: 'absolute',
28
- zIndex: 999,
29
- boxSizing: 'border-box',
30
- width: '100%',
31
- padding: '5px',
32
- boxShadow: '0 2px 8px #d9d9d9',
33
- backgroundColor: 'red !important'
34
- },
35
- '.ant-select-selection--multiple': {
36
- maxHeight: '32px',
37
- overflow: 'hidden'
38
- }
39
- }), '.vtx-multi-select', {
40
- position: 'relative',
41
- display: 'inline-block',
42
- width: '100%',
43
- maxHeight: '32px !important',
44
- boxSizing: 'border-box',
45
- '.vtx-select-count': {
46
- position: 'absolute',
47
- top: 0,
48
- right: 0,
49
- verticalAlign: 'top',
50
- borderLeft: 'none',
51
- borderTopLeftRadius: 0,
52
- 'border-bottom-left-radius': 0
53
- },
54
- '.vtx-all-list': {
55
- position: 'absolute',
56
- zIndex: 999,
57
- boxSizing: 'border-box',
58
- width: '100%',
59
- padding: '5px',
60
- boxShadow: '0 2px 8px #d9d9d9'
61
- },
62
- '.ant-select-selector': {
63
- 'border-top-right-radius': 0,
64
- 'border-bottom-right-radius': 0,
65
- maxHeight: '32px !important',
66
- overflow: 'hidden'
67
- },
68
- '.ant-select-selection--multiple': {
69
- maxHeight: '32px',
70
- overflow: 'hidden'
17
+ return _defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty({
18
+ width: "100%"
19
+ }, '.ant-select', {
20
+ overflow: "hidden"
21
+ })), "".concat(componentCls, "-multi"), {
22
+ ".ant-select-content": {
23
+ flexWrap: "nowrap"
71
24
  }
25
+ }), "".concat(componentCls, "-all-list"), {
26
+ maxHeight: 300,
27
+ overflowY: "auto"
72
28
  });
73
29
  };
74
30
  function useStyle(prefixCls) {
75
- return (0, _vtxProvider.useStyle)('VtxSelect', function (token) {
31
+ return (0, _vtxProvider.useStyle)('', function (token) {
76
32
  var vtxSelectToken = _objectSpread(_objectSpread({}, token), {}, {
77
33
  componentCls: ".".concat(prefixCls)
78
34
  });
@@ -149,24 +149,27 @@ var VtxTreeSelect = exports.VtxTreeSelect = function VtxTreeSelect(_ref) {
149
149
  },
150
150
  children: intl.getMessage('treeSelect.clearSelectedItems', '清空已选项')
151
151
  })]
152
- }), selectedNodes.length > 0 ? selectedNodes.map(function (item) {
153
- var _item$fieldNames$labe;
154
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tag, {
155
- closable: !disabled,
156
- onClose: function onClose(e) {
157
- e.stopPropagation();
158
- clearKey(item[fieldNames.value]);
159
- },
160
- styles: {
161
- root: {
162
- marginBottom: 5,
163
- marginRight: 5
164
- }
165
- },
166
- children: ((_item$fieldNames$labe = item[fieldNames.label]) === null || _item$fieldNames$labe === void 0 ? void 0 : _item$fieldNames$labe.length) > 20 ? "".concat(item[fieldNames.label].slice(0, 20), "...") : item[fieldNames.label]
167
- }, "tab-".concat(item[fieldNames.value]));
168
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Empty, {
169
- image: _antd.Empty.PRESENTED_IMAGE_SIMPLE
152
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
153
+ className: (0, _classnames.default)("".concat(prefixCls, "-all-list"), hashId),
154
+ children: selectedNodes.length > 0 ? selectedNodes.map(function (item) {
155
+ var _item$fieldNames$labe;
156
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tag, {
157
+ closable: !disabled,
158
+ onClose: function onClose(e) {
159
+ e.stopPropagation();
160
+ clearKey(item[fieldNames.value]);
161
+ },
162
+ styles: {
163
+ root: {
164
+ marginBottom: 5,
165
+ marginRight: 5
166
+ }
167
+ },
168
+ children: ((_item$fieldNames$labe = item[fieldNames.label]) === null || _item$fieldNames$labe === void 0 ? void 0 : _item$fieldNames$labe.length) > 20 ? "".concat(item[fieldNames.label].slice(0, 20), "...") : item[fieldNames.label]
169
+ }, "tab-".concat(item[fieldNames.value]));
170
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Empty, {
171
+ image: _antd.Empty.PRESENTED_IMAGE_SIMPLE
172
+ })
170
173
  })]
171
174
  });
172
175
  var onChangeTreeSelect = function onChangeTreeSelect(value, label, extra) {
@@ -14,7 +14,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
14
14
  var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
15
15
  var componentCls = token.componentCls;
16
16
  console.log('token.controlHeight', token.controlHeight);
17
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
17
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, '&-popover', {
18
18
  minWidth: '200px',
19
19
  height: '300px',
20
20
  overflow: 'auto',
@@ -54,6 +54,9 @@ var genVtxTreeSelectStyle = function genVtxTreeSelectStyle(token) {
54
54
  }, '&:hover', {
55
55
  color: '#40a9ff'
56
56
  })
57
+ }), "".concat(componentCls, "-all-list"), {
58
+ maxHeight: 300,
59
+ overflowY: "auto"
57
60
  }), "".concat(componentCls, "-outer"), {
58
61
  position: 'relative',
59
62
  display: 'inline-flex',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtx/components",
3
- "version": "4.0.0-beta.34",
3
+ "version": "4.0.0-beta.35",
4
4
  "description": "React components for Vortex",
5
5
  "keywords": [
6
6
  "react",