react-ui-basics 0.0.198 → 0.0.200
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/AutocompleteSelect.js +12 -8
- package/AutocompleteSelect.js.map +1 -1
- package/FilteredList.js +1 -0
- package/FilteredList.js.map +1 -1
- package/bundle.css +650 -650
- package/package.json +1 -1
- package/src/AutocompleteSelect.js +16 -8
- package/src/FilteredList.js +1 -0
package/package.json
CHANGED
|
@@ -78,7 +78,8 @@ function isMultipleSelect(mode) {
|
|
|
78
78
|
class AutocompleteSelect extends PureComponent {
|
|
79
79
|
|
|
80
80
|
static propTypes = {
|
|
81
|
-
mode: PropTypes.oneOf([MODE_DEFAULT, MODE_INLINE, MODE_MULTIPLE, MODE_MULTIPLE_AUTO, MODE_MULTIPLE_MINI, MODE_MULTIPLE_MINI_INLINE, MODE_INLINE_MULTIPLE, MODE_MINI])
|
|
81
|
+
mode: PropTypes.oneOf([MODE_DEFAULT, MODE_INLINE, MODE_MULTIPLE, MODE_MULTIPLE_AUTO, MODE_MULTIPLE_MINI, MODE_MULTIPLE_MINI_INLINE, MODE_INLINE_MULTIPLE, MODE_MINI]),
|
|
82
|
+
listPortalPosition: PropTypes.oneOf('left', 'right'),
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
constructor(props) {
|
|
@@ -121,14 +122,20 @@ class AutocompleteSelect extends PureComponent {
|
|
|
121
122
|
updateListPosition = () => {
|
|
122
123
|
if (__props(this).listPortal && __state(this).isActive) {
|
|
123
124
|
var rect = this.el.getBoundingClientRect();
|
|
125
|
+
let listPortalPosition = __props(this).listPortalPosition;
|
|
126
|
+
let listStyles = {
|
|
127
|
+
position: 'absolute',
|
|
128
|
+
top: rect.bottom + 'px',
|
|
129
|
+
minWidth: __width(rect) + 'px',
|
|
130
|
+
maxHeight: '300px',
|
|
131
|
+
};
|
|
132
|
+
if (listPortalPosition === 'right')
|
|
133
|
+
listStyles.right = rect.right + 'px'
|
|
134
|
+
else
|
|
135
|
+
listStyles.left = __left(rect) + 'px'
|
|
136
|
+
|
|
124
137
|
this.setState({
|
|
125
|
-
listStyles:
|
|
126
|
-
position: 'absolute',
|
|
127
|
-
top: rect.bottom + 'px',
|
|
128
|
-
left: __left(rect) + 'px',
|
|
129
|
-
minWidth: __width(rect) + 'px',
|
|
130
|
-
maxHeight: '300px',
|
|
131
|
-
}
|
|
138
|
+
listStyles: listStyles
|
|
132
139
|
})
|
|
133
140
|
}
|
|
134
141
|
}
|
|
@@ -160,6 +167,7 @@ class AutocompleteSelect extends PureComponent {
|
|
|
160
167
|
scrollToValue: false,
|
|
161
168
|
mode: MODE_DEFAULT,
|
|
162
169
|
selectedMode: 'full',
|
|
170
|
+
listPortalPosition: 'left',
|
|
163
171
|
removeIcon: <MaterialIcon icon="close"/>,
|
|
164
172
|
};
|
|
165
173
|
|
package/src/FilteredList.js
CHANGED
|
@@ -54,6 +54,7 @@ class FilteredList extends PureComponent {
|
|
|
54
54
|
const {data, labels, filter, className, selected, inline, childComponent, childProps, style, scroll} = __props(this);
|
|
55
55
|
return (
|
|
56
56
|
<Scrollable className={classNames('FilteredList', className, inline ? 'inline' : 'popup')}
|
|
57
|
+
autoScrollTop={false}
|
|
57
58
|
ref={ref('el', this)} style={style} scrollBarMode={scroll}>
|
|
58
59
|
{(data || []).filter(id => id !== false && id != null).map(id => <ItemWrapper
|
|
59
60
|
id={id}
|