Skip to content

Commit 5a3353f

Browse files
committed
more cleanup
1 parent 5bf8f17 commit 5a3353f

File tree

8 files changed

+301
-11
lines changed

8 files changed

+301
-11
lines changed

lib/SLDSButton/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ var Button = (function (_React$Component) {
8989
value: function render() {
9090
var props = (0, _lodash.omit)('className', this.props);
9191
var click = (0, _utilsCreateChainedFunction2['default'])(this.props.onClick, this.onClick.bind(this));
92+
if (this.props.disabled) {
93+
props['disabled'] = 'disabled';
94+
};
9295

9396
//If the button is only an icon render this:
9497
if (this.props.variant === 'icon') {
@@ -98,8 +101,8 @@ var Button = (function (_React$Component) {
98101
_react2['default'].createElement(_SLDSIconsJs.Icon, {
99102
name: this.props.iconName,
100103
category: 'utility',
101-
size: this.props.iconSize,
102-
className: 'slds-icon' }),
104+
size: this.props.iconSize
105+
}),
103106
_react2['default'].createElement(
104107
'span',
105108
{ className: 'slds-assistive-text' },
@@ -126,6 +129,7 @@ var Button = (function (_React$Component) {
126129
Button.propTypes = {
127130
label: _react2['default'].PropTypes.string.isRequired,
128131
variant: _react2['default'].PropTypes.oneOf(['base', 'neutral', 'brand', 'icon']),
132+
disabled: _react2['default'].PropTypes.bool,
129133
iconName: _react2['default'].PropTypes.string,
130134
iconSize: _react2['default'].PropTypes.oneOf(['x-small', 'small', 'medium', 'large']),
131135
iconPosition: _react2['default'].PropTypes.oneOf(['left', 'right'])

lib/SLDSModal/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ module.exports = _react2['default'].createClass({
7474
componentDidMount: function componentDidMount() {
7575
var _this = this;
7676

77-
_reactModal2['default'].setAppElement(_SLDSSettings2['default'].getAppElement());
7877
//console.log('!!! window.activeElement !!! ',document.activeElement);
7978
this.setState({ returnFocusTo: document.activeElement });
8079
if (!this.state.revealed) {

lib/SLDSSettings.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1111

1212
'use strict';
1313

14+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
15+
16+
var _reactModal = require('react-modal');
17+
18+
var _reactModal2 = _interopRequireDefault(_reactModal);
19+
1420
var assetsPath = 'assets/';
1521
var appRoot = undefined;
1622
module.exports = {
@@ -25,6 +31,7 @@ module.exports = {
2531
setAppElement: function setAppElement(el) {
2632
if (el) {
2733
appRoot = el;
34+
_reactModal2['default'].setAppElement(el);
2835
}
2936
},
3037
getAppElement: function getAppElement() {

lib/SLDSUtilityIcon/SVG/index.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Copyright (c) 2015, salesforce.com, inc. All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7+
Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8+
9+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10+
*/
11+
12+
'use strict';
13+
14+
var _extends = Object.assign || 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; };
15+
16+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
17+
18+
var _react = require('react');
19+
20+
var _react2 = _interopRequireDefault(_react);
21+
22+
var _sldsIconsUtil = require('./slds-icons-util');
23+
24+
var _sldsIconsUtil2 = _interopRequireDefault(_sldsIconsUtil);
25+
26+
module.exports = _react2['default'].createClass({
27+
displayName: 'exports',
28+
29+
getDefaultProps: function getDefaultProps() {
30+
return {
31+
name: 'announcenent'
32+
};
33+
},
34+
35+
getPaths: function getPaths(data) {
36+
if (data instanceof Array) {
37+
return data.map(function (item) {
38+
return _react2['default'].createElement('path', item);
39+
});
40+
}
41+
return _react2['default'].createElement('path', data);
42+
},
43+
44+
getSVG: function getSVG(name) {
45+
var data = _sldsIconsUtil2['default'][name.toLowerCase()];
46+
return _react2['default'].createElement(
47+
'svg',
48+
_extends({}, this.props, { viewBox: _sldsIconsUtil2['default'].viewBox }),
49+
this.getPaths(data)
50+
);
51+
},
52+
53+
render: function render() {
54+
return this.getSVG(this.props.name);
55+
}
56+
});

0 commit comments

Comments
 (0)