@aloudata/aloudata-design 2.14.1 → 2.14.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/AldSelect/BaseSelect.js +7 -2
- package/dist/AldSelect/SelectTrigger.d.ts +1 -0
- package/dist/AldSelect/SelectTrigger.js +12 -4
- package/dist/AldSelect/interface.d.ts +1 -0
- package/dist/AldSelect/style/index.less +6 -0
- package/dist/AldSelect/style/size.less +2 -0
- package/dist/ald.min.css +1 -1
- package/package.json +1 -1
|
@@ -67,7 +67,9 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
67
67
|
_props$popupMatchSele = props.popupMatchSelectWidth,
|
|
68
68
|
popupMatchSelectWidth = _props$popupMatchSele === void 0 ? true : _props$popupMatchSele,
|
|
69
69
|
placement = props.placement,
|
|
70
|
-
popupClassName = props.popupClassName
|
|
70
|
+
popupClassName = props.popupClassName,
|
|
71
|
+
style = props.style,
|
|
72
|
+
listHeight = props.listHeight;
|
|
71
73
|
var setClassNames = prefixCls('select');
|
|
72
74
|
var selectRef = useRef(null);
|
|
73
75
|
var widthStyle = getWidthStyle(width);
|
|
@@ -124,6 +126,7 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
124
126
|
if (!nextOpen) {
|
|
125
127
|
setShowResponsiveSelectedSection(false);
|
|
126
128
|
setInnerSearchValue === null || setInnerSearchValue === void 0 ? void 0 : setInnerSearchValue('');
|
|
129
|
+
setFocus(false);
|
|
127
130
|
}
|
|
128
131
|
if (mergedOpen !== nextOpen && !disabled) {
|
|
129
132
|
setInnerOpen(nextOpen);
|
|
@@ -163,6 +166,7 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
163
166
|
displayMenu === null || displayMenu === void 0 ? void 0 : (_displayMenu$onClick = displayMenu.onClick) === null || _displayMenu$onClick === void 0 ? void 0 : _displayMenu$onClick.call(displayMenu, info);
|
|
164
167
|
if (displayMenu && !isMultipleMode) {
|
|
165
168
|
onToggleOpen(false);
|
|
169
|
+
setFocus(false);
|
|
166
170
|
}
|
|
167
171
|
setIsHover(false);
|
|
168
172
|
onOptionSelect === null || onOptionSelect === void 0 ? void 0 : onOptionSelect(info.key);
|
|
@@ -171,7 +175,7 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
171
175
|
}, [displayMenu, isMultipleMode, onToggleOpen, onOptionSelect]);
|
|
172
176
|
return /*#__PURE__*/React.createElement("div", {
|
|
173
177
|
className: mergedClassName,
|
|
174
|
-
style: widthStyle,
|
|
178
|
+
style: _objectSpread(_objectSpread({}, widthStyle), style),
|
|
175
179
|
ref: selectRef,
|
|
176
180
|
id: id,
|
|
177
181
|
onClick: onClick,
|
|
@@ -192,6 +196,7 @@ var BaseSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
192
196
|
overlayClassName: popupClassName,
|
|
193
197
|
dropdownRender: dropdownRender,
|
|
194
198
|
overlayStyle: overlayStyle || dropdownStyle,
|
|
199
|
+
listHeight: listHeight,
|
|
195
200
|
placement: placement,
|
|
196
201
|
onOpenChange: function onOpenChange(open) {
|
|
197
202
|
if (isResponsiveMode) {
|
|
@@ -18,6 +18,7 @@ export interface SelectTriggerProps extends DropdownProps {
|
|
|
18
18
|
searchValue?: string;
|
|
19
19
|
setInnerSearchValue?: (value: string) => void;
|
|
20
20
|
filterOption?: (inputValue: string, option: SelectOptionType) => boolean;
|
|
21
|
+
listHeight?: number;
|
|
21
22
|
}
|
|
22
23
|
declare const RefSelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<RefTriggerProps>>;
|
|
23
24
|
export default RefSelectTrigger;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var _excluded = ["overlayStyle", "disabled", "open", "children", "dropdownRender", "getPopupContainer", "onOpenChange", "showSearch", "searchValue", "setInnerSearchValue", "menu", "overlayClassName", "popupMatchSelectWidth", "notFoundContent"];
|
|
1
|
+
var _excluded = ["overlayStyle", "disabled", "open", "children", "dropdownRender", "getPopupContainer", "onOpenChange", "showSearch", "searchValue", "setInnerSearchValue", "menu", "overlayClassName", "placement", "popupMatchSelectWidth", "listHeight", "notFoundContent"];
|
|
2
2
|
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); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
import Dropdown from "../Dropdown";
|
|
7
7
|
import classnames from 'classnames';
|
|
8
|
-
import { Empty } from '..';
|
|
9
8
|
import SearchBox from "./components/SearchBox";
|
|
10
9
|
import PopupContent from "./components/PopupContent";
|
|
10
|
+
import Empty from "../Empty";
|
|
11
11
|
var RefSelectTrigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12
12
|
var overlayStyle = props.overlayStyle,
|
|
13
13
|
disabled = props.disabled,
|
|
@@ -21,7 +21,10 @@ var RefSelectTrigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
21
21
|
setInnerSearchValue = props.setInnerSearchValue,
|
|
22
22
|
menuProps = props.menu,
|
|
23
23
|
overlayClassName = props.overlayClassName,
|
|
24
|
+
_props$placement = props.placement,
|
|
25
|
+
placement = _props$placement === void 0 ? 'bottom-start' : _props$placement,
|
|
24
26
|
popupMatchSelectWidth = props.popupMatchSelectWidth,
|
|
27
|
+
listHeight = props.listHeight,
|
|
25
28
|
_props$notFoundConten = props.notFoundContent,
|
|
26
29
|
notFoundContent = _props$notFoundConten === void 0 ? /*#__PURE__*/React.createElement(Empty, {
|
|
27
30
|
size: "small"
|
|
@@ -40,7 +43,11 @@ var RefSelectTrigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
40
43
|
var customDropdownRender = useCallback(function (menu) {
|
|
41
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
45
|
className: "beta-ald-select-popup",
|
|
43
|
-
ref: popupRef
|
|
46
|
+
ref: popupRef,
|
|
47
|
+
style: {
|
|
48
|
+
height: listHeight,
|
|
49
|
+
overflow: 'auto'
|
|
50
|
+
}
|
|
44
51
|
}, /*#__PURE__*/React.createElement(SearchBox, {
|
|
45
52
|
showSearch: showSearch,
|
|
46
53
|
value: searchValue,
|
|
@@ -53,11 +60,12 @@ var RefSelectTrigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
53
60
|
dropdownRender: dropdownRender,
|
|
54
61
|
menuProps: menuProps
|
|
55
62
|
}));
|
|
56
|
-
}, [dropdownRender, menuProps, notFoundContent, searchValue, setInnerSearchValue, showSearch]);
|
|
63
|
+
}, [dropdownRender, listHeight, menuProps, notFoundContent, searchValue, setInnerSearchValue, showSearch]);
|
|
57
64
|
return /*#__PURE__*/React.createElement(Dropdown, _extends({}, restProps, {
|
|
58
65
|
disabled: disabled,
|
|
59
66
|
open: open,
|
|
60
67
|
menu: menuProps,
|
|
68
|
+
placement: placement,
|
|
61
69
|
popupMatchTriggerWidth: popupMatchSelectWidth,
|
|
62
70
|
overlayStyle: overlayStyle,
|
|
63
71
|
overlayClassName: classnames('beta-ald-select-popup-container', overlayClassName),
|
|
@@ -17,6 +17,7 @@ export interface ISelectProps<ValueType = any, OptionType extends BaseOptionType
|
|
|
17
17
|
allowClear?: boolean;
|
|
18
18
|
showArrow?: boolean;
|
|
19
19
|
borderLess?: boolean;
|
|
20
|
+
listHeight?: number;
|
|
20
21
|
width?: 'auto' | 'fill' | number;
|
|
21
22
|
dropdownClassName?: string;
|
|
22
23
|
popupClassName?: string;
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
margin-right: 4px;
|
|
38
38
|
flex-shrink: 0;
|
|
39
39
|
flex-grow: 0;
|
|
40
|
+
min-height: @lineHeight;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.beta-ald-select-placeholder {
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
.beta-ald-select-selector {
|
|
49
|
+
min-height: @lineHeight;
|
|
48
50
|
flex: 1;
|
|
49
51
|
|
|
50
52
|
.beta-ald-select-selector-multiple-responsive-selected-section {
|