@aloudata/aloudata-design 0.4.8-beta.2 → 0.4.8-beta.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.
package/dist/Select/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["mode", "options", "dropdownRender", "onDropdownVisibleChange", "defaultValue", "onChange", "open", "defaultOpen", "prefix", "className", "popupClassName", "notFoundContent", "value", "style"];
|
|
1
|
+
var _excluded = ["mode", "options", "dropdownRender", "onDropdownVisibleChange", "defaultValue", "onChange", "open", "defaultOpen", "prefix", "className", "popupClassName", "listHeight", "listItemHeight", "notFoundContent", "value", "style"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -30,9 +30,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
30
30
|
|
|
31
31
|
import { Select as AntdSelect } from 'antd';
|
|
32
32
|
import classNames from 'classnames';
|
|
33
|
+
import List from 'rc-virtual-list';
|
|
33
34
|
import React, { forwardRef, useEffect, useLayoutEffect, useMemo } from 'react';
|
|
34
35
|
import Empty from "../Empty";
|
|
35
|
-
import
|
|
36
|
+
import MultipleOption from "./components/MultipleOption";
|
|
36
37
|
import SingleOption from "./components/SingleOption";
|
|
37
38
|
|
|
38
39
|
var getSelectedOptionsFromValue = function getSelectedOptionsFromValue(isMultiple, options, value, defaultValue) {
|
|
@@ -90,6 +91,8 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
90
91
|
prefix = props.prefix,
|
|
91
92
|
className = props.className,
|
|
92
93
|
popupClassName = props.popupClassName,
|
|
94
|
+
listHeight = props.listHeight,
|
|
95
|
+
listItemHeight = props.listItemHeight,
|
|
93
96
|
_props$notFoundConten = props.notFoundContent,
|
|
94
97
|
notFoundContent = _props$notFoundConten === void 0 ? /*#__PURE__*/React.createElement(Empty, null) : _props$notFoundConten,
|
|
95
98
|
value = props.value,
|
|
@@ -147,11 +150,17 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
147
150
|
var multipleRender = function multipleRender() {
|
|
148
151
|
return /*#__PURE__*/React.createElement("div", {
|
|
149
152
|
className: "ald-multiple-option-list"
|
|
150
|
-
},
|
|
153
|
+
}, /*#__PURE__*/React.createElement(List, {
|
|
154
|
+
data: options || [],
|
|
155
|
+
"data-id": "list",
|
|
156
|
+
height: listHeight,
|
|
157
|
+
itemHeight: listItemHeight || 36,
|
|
158
|
+
itemKey: "value"
|
|
159
|
+
}, function (option) {
|
|
151
160
|
var isSelected = selectedOptions.some(function (selectedOption) {
|
|
152
161
|
return selectedOption.value === option.value;
|
|
153
162
|
});
|
|
154
|
-
return /*#__PURE__*/React.createElement(
|
|
163
|
+
return /*#__PURE__*/React.createElement(MultipleOption, {
|
|
155
164
|
key: option.value,
|
|
156
165
|
selected: isSelected,
|
|
157
166
|
option: option,
|
|
@@ -178,7 +187,13 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
178
187
|
var singleRender = function singleRender() {
|
|
179
188
|
return /*#__PURE__*/React.createElement("div", {
|
|
180
189
|
className: "ald-single-option-list"
|
|
181
|
-
},
|
|
190
|
+
}, /*#__PURE__*/React.createElement(List, {
|
|
191
|
+
data: options || [],
|
|
192
|
+
"data-id": "list",
|
|
193
|
+
height: listHeight,
|
|
194
|
+
itemHeight: listItemHeight || 36,
|
|
195
|
+
itemKey: "value"
|
|
196
|
+
}, function (option) {
|
|
182
197
|
var isSelected = selectedOptions.some(function (selectedOption) {
|
|
183
198
|
return selectedOption.value === option.value;
|
|
184
199
|
});
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
justify-content: space-between;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
color: @NL0;
|
|
8
|
-
font-size:
|
|
8
|
+
font-size: 13px;
|
|
9
9
|
line-height: 20px;
|
|
10
10
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.ald-multiple-option{
|
|
14
14
|
padding: 8px 14px;
|
|
15
|
-
height: 20px;
|
|
15
|
+
// height: 20px;
|
|
16
16
|
margin-left: 0;
|
|
17
17
|
display: flex;
|
|
18
18
|
|