Skip to content

Commit de60a3a

Browse files
committed
rebuild
1 parent 62b1ce7 commit de60a3a

File tree

14 files changed

+88
-53
lines changed

14 files changed

+88
-53
lines changed

dist/design-system-react.js

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ return /******/ (function(modules) { // webpackBootstrap
201201

202202
getInitialState: function getInitialState() {
203203
return {
204+
triggerId: null,
204205
isOpen: false,
205206
isFocused: false,
206207
highlightedIndex: 0,
@@ -211,6 +212,9 @@ return /******/ (function(modules) { // webpackBootstrap
211212
},
212213

213214
componentDidMount: function componentDidMount() {
215+
var id = _react2['default'].findDOMNode(this.refs.triggerbutton).getAttribute("data-reactid");
216+
this.setState({ triggerId: id });
217+
214218
if (this.props.initialFocus) {
215219
this.setFocus();
216220
}
@@ -275,7 +279,7 @@ return /******/ (function(modules) { // webpackBootstrap
275279

276280
setFocus: function setFocus() {
277281
if (this.isMounted()) {
278-
_react2['default'].findDOMNode(this.refs.button).focus();
282+
_react2['default'].findDOMNode(this.refs.triggerbutton).focus();
279283
}
280284
},
281285

@@ -308,6 +312,7 @@ return /******/ (function(modules) { // webpackBootstrap
308312

309313
getPopoverContent: function getPopoverContent() {
310314
return _react2['default'].createElement(_list2['default'], {
315+
triggerId: this.state.triggerId,
311316
ref: 'list',
312317
options: this.props.options,
313318
label: this.props.label,
@@ -351,8 +356,8 @@ return /******/ (function(modules) { // webpackBootstrap
351356

352357
render: function render() {
353358
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',
356361
className: 'slds-button slds-button--neutral slds-picklist__label ' + this.props.className,
357362
'aria-haspopup': 'true',
358363
onBlur: this.handleBlur,
@@ -3411,7 +3416,7 @@ return /******/ (function(modules) { // webpackBootstrap
34113416
ref: "scroll",
34123417
className: "slds-dropdown__list slds-theme--" + this.props.theme,
34133418
role: "menu",
3414-
"aria-labelledby": this.props.label }, this.getItems()));
3419+
"aria-labelledby": this.props.triggerId }, this.getItems()));
34153420
},
34163421

34173422
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {}
@@ -3501,13 +3506,14 @@ return /******/ (function(modules) { // webpackBootstrap
35013506

35023507
getDefaultProps: function getDefaultProps() {
35033508
return {
3509+
name: '',
35043510
category: 'standard'
35053511
};
35063512
},
35073513

35083514
render: function render() {
35093515

3510-
var name = this.props.name.replace(/_/g, '-');
3516+
var name = this.props.name ? this.props.name.replace(/_/g, '-') : '';
35113517
var iconClassName = 'slds-icon-' + this.props.category + '-' + (this.props.theme || name);
35123518
var styles = this.props.category === 'action' ? { padding: '.5rem' } : null;
35133519

@@ -6636,15 +6642,14 @@ return /******/ (function(modules) { // webpackBootstrap
66366642
className: '',
66376643
listClassName: '',
66386644
openOn: 'hover',
6639-
listItemLabelRenderer: _listItemLabel2['default'],
6645+
listItemRenderer: _listItemLabel2['default'],
66406646
horizontalAlign: 'left',
66416647
hoverCloseDelay: 300
66426648
};
66436649
},
66446650

66456651
getInitialState: function getInitialState() {
66466652
return {
6647-
triggerId: null,
66486653
isOpen: false,
66496654
isFocused: false,
66506655
isClosing: false,
@@ -6657,8 +6662,6 @@ return /******/ (function(modules) { // webpackBootstrap
66576662
},
66586663

66596664
componentDidMount: function componentDidMount() {
6660-
var id = _react2['default'].findDOMNode(this.refs.button).getAttribute("data-reactid");
6661-
this.setState({ triggerId: id });
66626665
if (this.props.initialFocus) {
66636666
this.setFocus();
66646667
}
@@ -6685,9 +6688,13 @@ return /******/ (function(modules) { // webpackBootstrap
66856688
} else if (this.state.isFocused && !prevState.isFocused) {
66866689
this.setState({ isOpen: false });
66876690
} 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+
}
66916698
}
66926699
} else if (this.state.isClosing && !prevState.isClosing) {
66936700
setTimeout(function () {
@@ -6819,7 +6826,6 @@ return /******/ (function(modules) { // webpackBootstrap
68196826

68206827
getPopoverContent: function getPopoverContent() {
68216828
return _react2['default'].createElement(_list2['default'], {
6822-
triggerId: this.state.triggerId,
68236829
ref: 'list',
68246830
options: this.props.options,
68256831
className: this.props.listClassName,
@@ -6872,7 +6878,6 @@ return /******/ (function(modules) { // webpackBootstrap
68726878

68736879
return _react2['default'].createElement(_SLDSButton2['default'], _extends({
68746880
ref: 'button',
6875-
id: this.state.triggerId,
68766881
'aria-haspopup': 'true',
68776882
label: this.props.label,
68786883
className: this.props.className,
@@ -7072,8 +7077,8 @@ return /******/ (function(modules) { // webpackBootstrap
70727077
}, _react2["default"].createElement("ul", {
70737078
ref: "scroll",
70747079
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()));
70777082
},
70787083

70797084
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {}
@@ -9758,8 +9763,12 @@ return /******/ (function(modules) { // webpackBootstrap
97589763
}
97599764
}, {
97609765
key: 'handleBlur',
9761-
value: function handleBlur() {
9766+
value: function handleBlur(event) {
97629767
this.handleClose();
9768+
if (this.props.onBlur) {
9769+
var target = event.target || event.currentTarget;
9770+
this.props.onBlur(target.value);
9771+
}
97639772
}
97649773
}, {
97659774
key: 'handleFocus',
@@ -9908,7 +9917,7 @@ return /******/ (function(modules) { // webpackBootstrap
99089917
key: 'renderSelectedItem',
99099918
value: function renderSelectedItem() {
99109919
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'], {
99129921
label: 'Press delete to remove',
99139922
tabIndex: '-1',
99149923
variant: 'icon',
@@ -9971,6 +9980,7 @@ return /******/ (function(modules) { // webpackBootstrap
99719980
onItemSelect: _react2['default'].PropTypes.func,
99729981
onItemUnselect: _react2['default'].PropTypes.func,
99739982
onChange: _react2['default'].PropTypes.func,
9983+
onBlur: _react2['default'].PropTypes.func,
99749984
modal: _react2['default'].PropTypes.bool,
99759985
disabled: _react2['default'].PropTypes.bool,
99769986
hasError: _react2['default'].PropTypes.bool,
@@ -10113,7 +10123,6 @@ return /******/ (function(modules) { // webpackBootstrap
1011310123
footerActive = false;
1011410124
isActiveClass = '';
1011510125
}
10116-
1011710126
return _react2['default'].createElement('div', { className: isActiveClass }, this.props.footer);
1011810127
}
1011910128
}
@@ -10594,7 +10603,7 @@ return /******/ (function(modules) { // webpackBootstrap
1059410603
var className = 'slds-button';
1059510604
if (this.props.isActive) className += ' slds-theme--shade';
1059610605

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));
1059810607
}
1059910608
}]);
1060010609

@@ -10709,7 +10718,7 @@ return /******/ (function(modules) { // webpackBootstrap
1070910718
var className = 'slds-button';
1071010719
if (this.props.isActive) className += ' slds-theme--shade aaa';
1071110720

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));
1071310722
}
1071410723
}]);
1071510724

@@ -10794,11 +10803,11 @@ return /******/ (function(modules) { // webpackBootstrap
1079410803
getDefaultProps: function getDefaultProps() {
1079510804
return {
1079610805
title: '',
10806+
tagline: '',
1079710807
isOpen: false,
1079810808
content: [],
1079910809
footer: [],
1080010810
returnFocusTo: null,
10801-
size: 'medium',
1080210811
prompt: '', //if prompt !== '', it renders modal as prompt
1080310812
directional: false
1080410813
};
@@ -10906,6 +10915,12 @@ return /******/ (function(modules) { // webpackBootstrap
1090610915
return footer;
1090710916
},
1090810917

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+
1090910924
headerComponent: function headerComponent() {
1091010925
var headingClasses = [],
1091110926
headerClasses = ['slds-modal__header'];
@@ -10926,7 +10941,7 @@ return /******/ (function(modules) { // webpackBootstrap
1092610941
onClick: this.closeModal });
1092710942
}
1092810943

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);
1093010945
},
1093110946

1093210947
componentDidUpdate: function componentDidUpdate(prevProps, prevState) {

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.

0 commit comments

Comments
 (0)