Skip to content

Commit 13ac35b

Browse files
committed
rebuild
1 parent e3b80d4 commit 13ac35b

File tree

8 files changed

+48
-26
lines changed

8 files changed

+48
-26
lines changed

dist/design-system-react.js

Lines changed: 22 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/design-system-react.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/design-system-react.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/design-system-react.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/SLDSLookup/Menu/Item/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var Item = (function (_React$Component) {
5858
key: 'handleClick',
5959
value: function handleClick(e) {
6060
_utils.EventUtil.trapImmediate(e);
61-
return this.props.onSelect(this.props.id);
61+
return this.props.onSelect(this.props.id, this.props.data);
6262
}
6363

6464
//Scroll menu item based on up/down mouse keys (assumes all items are the same height)

lib/SLDSLookup/Menu/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var Menu = (function (_React$Component) {
8686
setFocus: _this.props.setFocus,
8787
handleItemFocus: _this.handleItemFocus.bind(_this),
8888
onSelect: _this.props.onSelect,
89-
data: c
89+
data: c.data
9090
},
9191
c
9292
);

lib/SLDSLookup/index.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,24 @@ var SLDSLookup = (function (_React$Component) {
5757
_get(Object.getPrototypeOf(SLDSLookup.prototype), 'constructor', this).call(this, props);
5858

5959
//Dynamically assign ids to list items to reference for focusing and selecting items
60-
this.modifyItems();
6160

6261
this.state = {
6362
searchTerm: '',
6463
isOpen: false,
6564
currentFocus: null,
6665
focusIndex: null,
6766
selectedIndex: null,
68-
listLength: this.props.items.length
67+
listLength: this.props.items.length,
68+
items: []
6969
};
7070
}
7171

7272
_createClass(SLDSLookup, [{
73+
key: 'componentDidMount',
74+
value: function componentDidMount() {
75+
this.modifyItems();
76+
}
77+
}, {
7378
key: 'componentDidUpdate',
7479
value: function componentDidUpdate(prevProps, prevState) {
7580
if (prevState.selectedIndex && !this.state.selectIndex) {
@@ -111,13 +116,13 @@ var SLDSLookup = (function (_React$Component) {
111116
// Select menu item (onClick or on key enter/space)
112117
}, {
113118
key: 'selectItem',
114-
value: function selectItem(itemId) {
119+
value: function selectItem(itemId, data) {
115120
var index = itemId.replace('item-', '');
116121
this.setState({
117122
selectedIndex: index,
118123
searchTerm: null
119124
});
120-
if (this.props.onItemSelect) this.props.onItemSelect(itemId);
125+
if (this.props.onItemSelect) this.props.onItemSelect(data);
121126
}
122127
}, {
123128
key: 'handleDeleteSelected',
@@ -240,7 +245,7 @@ var SLDSLookup = (function (_React$Component) {
240245
type: this.props.type,
241246
focusIndex: this.state.focusIndex,
242247
listLength: this.state.listLength,
243-
items: this.props.items,
248+
items: this.state.items,
244249
filterWith: this.props.filterWith,
245250
getListLength: this.getListLength.bind(this),
246251
setFocus: this.setFocus.bind(this),
@@ -304,9 +309,15 @@ var SLDSLookup = (function (_React$Component) {
304309
}, {
305310
key: 'modifyItems',
306311
value: function modifyItems() {
307-
this.props.items.map(function (item, index) {
308-
return item.id = 'item-' + index;
312+
var items = this.props.items.map(function (item, index) {
313+
return {
314+
id: 'item-' + index,
315+
label: item.label,
316+
data: item
317+
};
309318
});
319+
320+
this.setState({ items: items });
310321
}
311322
}, {
312323
key: 'componentWillReceiveProps',

lib/SLDSPopover.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module.exports = _react2['default'].createClass({
111111
beforeClose: function beforeClose() {},
112112

113113
dropOptions: function dropOptions() {
114-
var target = this.props.targetElement ? this.props.targetElement.getDOMNode() : this.getDOMNode().parentNode;
114+
var target = this.props.targetElement ? _react2['default'].findDOMNode(this.props.targetElement) : _react2['default'].findDOMNode(this).parentNode;
115115
return {
116116
target: target,
117117
content: this.popoverElement,
@@ -164,7 +164,7 @@ module.exports = _react2['default'].createClass({
164164

165165
});
166166
/*
167-
<Spring
167+
<Spring
168168
defaultValue={{ val:0 }}
169169
endValue={{ val:1, config: [70, 10] }}>
170170
{currentVal => {

0 commit comments

Comments
 (0)