@@ -201,6 +201,7 @@ return /******/ (function(modules) { // webpackBootstrap
201
201
202
202
getInitialState: function getInitialState() {
203
203
return {
204
+ triggerId: null,
204
205
isOpen: false,
205
206
isFocused: false,
206
207
highlightedIndex: 0,
@@ -211,6 +212,9 @@ return /******/ (function(modules) { // webpackBootstrap
211
212
},
212
213
213
214
componentDidMount: function componentDidMount() {
215
+ var id = _react2['default'].findDOMNode(this.refs.triggerbutton).getAttribute("data-reactid");
216
+ this.setState({ triggerId: id });
217
+
214
218
if (this.props.initialFocus) {
215
219
this.setFocus();
216
220
}
@@ -275,7 +279,7 @@ return /******/ (function(modules) { // webpackBootstrap
275
279
276
280
setFocus: function setFocus() {
277
281
if (this.isMounted()) {
278
- _react2['default'].findDOMNode(this.refs.button ).focus();
282
+ _react2['default'].findDOMNode(this.refs.triggerbutton ).focus();
279
283
}
280
284
},
281
285
@@ -308,6 +312,7 @@ return /******/ (function(modules) { // webpackBootstrap
308
312
309
313
getPopoverContent: function getPopoverContent() {
310
314
return _react2['default'].createElement(_list2['default'], {
315
+ triggerId: this.state.triggerId,
311
316
ref: 'list',
312
317
options: this.props.options,
313
318
label: this.props.label,
@@ -351,8 +356,8 @@ return /******/ (function(modules) { // webpackBootstrap
351
356
352
357
render: function render() {
353
358
return _react2['default'].createElement('div', { className: "slds-form-element slds-theme--" + this.props.theme }, _react2['default'].createElement('div', { className: "slds-picklist slds-theme--" + this.props.theme }, _react2['default'].createElement('button', {
354
- id: this.props.id ,
355
- ref: 'button ',
359
+ id: this.state.triggerId ,
360
+ ref: 'triggerbutton ',
356
361
className: 'slds-button slds-button--neutral slds-picklist__label ' + this.props.className,
357
362
'aria-haspopup': 'true',
358
363
onBlur: this.handleBlur,
@@ -3411,7 +3416,7 @@ return /******/ (function(modules) { // webpackBootstrap
3411
3416
ref: "scroll",
3412
3417
className: "slds-dropdown__list slds-theme--" + this.props.theme,
3413
3418
role: "menu",
3414
- "aria-labelledby": this.props.label }, this.getItems()));
3419
+ "aria-labelledby": this.props.triggerId }, this.getItems()));
3415
3420
},
3416
3421
3417
3422
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {}
@@ -3501,13 +3506,14 @@ return /******/ (function(modules) { // webpackBootstrap
3501
3506
3502
3507
getDefaultProps: function getDefaultProps() {
3503
3508
return {
3509
+ name: '',
3504
3510
category: 'standard'
3505
3511
};
3506
3512
},
3507
3513
3508
3514
render: function render() {
3509
3515
3510
- var name = this.props.name. replace(/_/g, '-');
3516
+ var name = this.props.name ? this.props.name. replace(/_/g, '-') : '' ;
3511
3517
var iconClassName = 'slds-icon-' + this.props.category + '-' + (this.props.theme || name);
3512
3518
var styles = this.props.category === 'action' ? { padding: '.5rem' } : null;
3513
3519
@@ -6636,15 +6642,14 @@ return /******/ (function(modules) { // webpackBootstrap
6636
6642
className: '',
6637
6643
listClassName: '',
6638
6644
openOn: 'hover',
6639
- listItemLabelRenderer : _listItemLabel2['default'],
6645
+ listItemRenderer : _listItemLabel2['default'],
6640
6646
horizontalAlign: 'left',
6641
6647
hoverCloseDelay: 300
6642
6648
};
6643
6649
},
6644
6650
6645
6651
getInitialState: function getInitialState() {
6646
6652
return {
6647
- triggerId: null,
6648
6653
isOpen: false,
6649
6654
isFocused: false,
6650
6655
isClosing: false,
@@ -6657,8 +6662,6 @@ return /******/ (function(modules) { // webpackBootstrap
6657
6662
},
6658
6663
6659
6664
componentDidMount: function componentDidMount() {
6660
- var id = _react2['default'].findDOMNode(this.refs.button).getAttribute("data-reactid");
6661
- this.setState({ triggerId: id });
6662
6665
if (this.props.initialFocus) {
6663
6666
this.setFocus();
6664
6667
}
@@ -6685,9 +6688,13 @@ return /******/ (function(modules) { // webpackBootstrap
6685
6688
} else if (this.state.isFocused && !prevState.isFocused) {
6686
6689
this.setState({ isOpen: false });
6687
6690
} else if (!this.state.isFocused && prevState.isFocused) {
6688
- if (this.refs.list && this.isMounted()) {
6689
- if (this.refs.list.getDOMNode().contains(document.activeElement)) return;
6690
- this.setState({ isOpen: false });
6691
+ if (this.refs.list) {
6692
+ if (this.isMounted() && this.refs.list) {
6693
+ if (this.refs.list.getDOMNode().contains(document.activeElement)) {
6694
+ return;
6695
+ }
6696
+ this.setState({ isOpen: false });
6697
+ }
6691
6698
}
6692
6699
} else if (this.state.isClosing && !prevState.isClosing) {
6693
6700
setTimeout(function () {
@@ -6819,7 +6826,6 @@ return /******/ (function(modules) { // webpackBootstrap
6819
6826
6820
6827
getPopoverContent: function getPopoverContent() {
6821
6828
return _react2['default'].createElement(_list2['default'], {
6822
- triggerId: this.state.triggerId,
6823
6829
ref: 'list',
6824
6830
options: this.props.options,
6825
6831
className: this.props.listClassName,
@@ -6872,7 +6878,6 @@ return /******/ (function(modules) { // webpackBootstrap
6872
6878
6873
6879
return _react2['default'].createElement(_SLDSButton2['default'], _extends({
6874
6880
ref: 'button',
6875
- id: this.state.triggerId,
6876
6881
'aria-haspopup': 'true',
6877
6882
label: this.props.label,
6878
6883
className: this.props.className,
@@ -7072,8 +7077,8 @@ return /******/ (function(modules) { // webpackBootstrap
7072
7077
}, _react2["default"].createElement("ul", {
7073
7078
ref: "scroll",
7074
7079
className: "slds-dropdown__list slds-theme--" + this.props.theme,
7075
- role: "menu",
7076
- "aria-labelledby": this.props.triggerId }, this.getItems()));
7080
+ role: "menu"
7081
+ }, this.getItems()));
7077
7082
},
7078
7083
7079
7084
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {}
@@ -9758,8 +9763,12 @@ return /******/ (function(modules) { // webpackBootstrap
9758
9763
}
9759
9764
}, {
9760
9765
key: 'handleBlur',
9761
- value: function handleBlur() {
9766
+ value: function handleBlur(event ) {
9762
9767
this.handleClose();
9768
+ if (this.props.onBlur) {
9769
+ var target = event.target || event.currentTarget;
9770
+ this.props.onBlur(target.value);
9771
+ }
9763
9772
}
9764
9773
}, {
9765
9774
key: 'handleFocus',
@@ -9908,7 +9917,7 @@ return /******/ (function(modules) { // webpackBootstrap
9908
9917
key: 'renderSelectedItem',
9909
9918
value: function renderSelectedItem() {
9910
9919
var selectedItem = this.props.items[this.state.selectedIndex].label;
9911
- return _react2['default'].createElement('span', { tabIndex: '0', className: 'slds-pill', ref: 'pill-' + this.state.selectedIndex, onKeyDown: this.handlePillKeyDown.bind(this) }, _react2['default'].createElement('span', { className: 'slds-pill__label' }, _react2['default'].createElement(_SLDSIcons.Icon, { name: this.props.type }), selectedItem), _react2['default'].createElement(_SLDSButton2['default'], {
9920
+ return _react2['default'].createElement('span', { tabIndex: '0', className: 'slds-pill', ref: 'pill-' + this.state.selectedIndex, onKeyDown: this.handlePillKeyDown.bind(this) }, _react2['default'].createElement('span', { className: 'slds-pill__label' }, _react2['default'].createElement(_SLDSIcons.Icon, { category: this.props.iconCategory, name: this.props.iconName ? this.props.iconName : this.props. type, className: this.props.iconClasses }), selectedItem), _react2['default'].createElement(_SLDSButton2['default'], {
9912
9921
label: 'Press delete to remove',
9913
9922
tabIndex: '-1',
9914
9923
variant: 'icon',
@@ -9971,6 +9980,7 @@ return /******/ (function(modules) { // webpackBootstrap
9971
9980
onItemSelect: _react2['default'].PropTypes.func,
9972
9981
onItemUnselect: _react2['default'].PropTypes.func,
9973
9982
onChange: _react2['default'].PropTypes.func,
9983
+ onBlur: _react2['default'].PropTypes.func,
9974
9984
modal: _react2['default'].PropTypes.bool,
9975
9985
disabled: _react2['default'].PropTypes.bool,
9976
9986
hasError: _react2['default'].PropTypes.bool,
@@ -10113,7 +10123,6 @@ return /******/ (function(modules) { // webpackBootstrap
10113
10123
footerActive = false;
10114
10124
isActiveClass = '';
10115
10125
}
10116
-
10117
10126
return _react2['default'].createElement('div', { className: isActiveClass }, this.props.footer);
10118
10127
}
10119
10128
}
@@ -10594,7 +10603,7 @@ return /******/ (function(modules) { // webpackBootstrap
10594
10603
var className = 'slds-button';
10595
10604
if (this.props.isActive) className += ' slds-theme--shade';
10596
10605
10597
- return _react2['default'].createElement('div', { className: 'slds-lookup__item', onClick: this.handleClick.bind(this), onMouseDown: this.handleMouseDown.bind(this) }, _react2['default'].createElement('button', { id: 'newItem', tabIndex: '-1', className: className }, _react2['default'].createElement(_SLDSIcons.Icon, { name: 'add', category: 'utility', size: 'x-small', className: 'slds-icon-text-default' }), 'New ' + this.props.type ));
10606
+ return _react2['default'].createElement('div', { className: 'slds-lookup__item', onClick: this.handleClick.bind(this), onMouseDown: this.handleMouseDown.bind(this) }, _react2['default'].createElement('button', { id: 'newItem', tabIndex: '-1', className: className }, _react2['default'].createElement(_SLDSIcons.Icon, { name: 'add', category: 'utility', size: 'x-small', className: 'slds-icon-text-default' }), this.props.newItemLabel ));
10598
10607
}
10599
10608
}]);
10600
10609
@@ -10709,7 +10718,7 @@ return /******/ (function(modules) { // webpackBootstrap
10709
10718
var className = 'slds-button';
10710
10719
if (this.props.isActive) className += ' slds-theme--shade aaa';
10711
10720
10712
- return _react2['default'].createElement('div', { className: 'slds-lookup__item', onMouseDown: this.handleMouseDown, onClick: this.handleClick.bind(this) }, _react2['default'].createElement('button', { id: 'searchRecords', tabIndex: '-1', className: className }, _react2['default'].createElement(_SLDSIcons.Icon, { name: 'search', category: 'utility', size: 'x-small', className: 'slds-icon-text-default' }), this.props.searchTerm ? '"' + this.props.searchTerm + '"' + ' in ' + this.props.type + 's' : ' in ' + this.props.type + 's' ));
10721
+ return _react2['default'].createElement('div', { className: 'slds-lookup__item', onMouseDown: this.handleMouseDown, onClick: this.handleClick.bind(this) }, _react2['default'].createElement('button', { id: 'searchRecords', tabIndex: '-1', className: className }, _react2['default'].createElement(_SLDSIcons.Icon, { name: 'search', category: 'utility', size: 'x-small', className: 'slds-icon-text-default' }), this.props.searchLabel ));
10713
10722
}
10714
10723
}]);
10715
10724
@@ -10794,11 +10803,11 @@ return /******/ (function(modules) { // webpackBootstrap
10794
10803
getDefaultProps: function getDefaultProps() {
10795
10804
return {
10796
10805
title: '',
10806
+ tagline: '',
10797
10807
isOpen: false,
10798
10808
content: [],
10799
10809
footer: [],
10800
10810
returnFocusTo: null,
10801
- size: 'medium',
10802
10811
prompt: '', //if prompt !== '', it renders modal as prompt
10803
10812
directional: false
10804
10813
};
@@ -10906,6 +10915,12 @@ return /******/ (function(modules) { // webpackBootstrap
10906
10915
return footer;
10907
10916
},
10908
10917
10918
+ renderTagline: function renderTagline() {
10919
+ if (this.props.tagline) {
10920
+ return _react2['default'].createElement('p', { className: 'slds-m-top--x-small' }, this.props.tagline);
10921
+ }
10922
+ },
10923
+
10909
10924
headerComponent: function headerComponent() {
10910
10925
var headingClasses = [],
10911
10926
headerClasses = ['slds-modal__header'];
@@ -10926,7 +10941,7 @@ return /******/ (function(modules) { // webpackBootstrap
10926
10941
onClick: this.closeModal });
10927
10942
}
10928
10943
10929
- return _react2['default'].createElement('div', { className: (0, _classnames2['default'])(headerClasses) }, this.props.toast, _react2['default'].createElement('h2', { className: (0, _classnames2['default'])(headingClasses) }, this.props.title), closeButton);
10944
+ return _react2['default'].createElement('div', { className: (0, _classnames2['default'])(headerClasses) }, this.props.toast, _react2['default'].createElement('h2', { className: (0, _classnames2['default'])(headingClasses) }, this.props.title), this.renderTagline(), closeButton);
10930
10945
},
10931
10946
10932
10947
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {
0 commit comments