Skip to content

Commit 950852c

Browse files
committed
more cleanup plus settings
1 parent 20c8c3d commit 950852c

File tree

1,764 files changed

+174
-3093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,764 files changed

+174
-3093
lines changed

components/SLDSIcons.js

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,75 +6,83 @@ Redistributions in binary form must reproduce the above copyright notice, this l
66
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.
77
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.
88
*/
9+
'use strict';
910

1011
import React from 'react';
1112

12-
export let ButtonIcon = React.createClass({
13+
import SLDSSettings from './SLDSSettings';
14+
15+
16+
export const ButtonIcon = React.createClass({
1317

1418
getDefaultProps() {
19+
1520
return {
16-
category: "utility"
17-
}
21+
category: 'utility',
22+
};
1823
},
1924

25+
2026
render() {
21-
let useTag = '<use xlink:href="assets/icons/' + this.props.category + '-sprite/svg/symbols.svg#' + this.props.name + '" />';
22-
let className = "slds-button__icon";
27+
28+
const useTag = '<use xlink:href="'+SLDSSettings.getAssetsPath()+'/icons/' + this.props.category + '-sprite/svg/symbols.svg#' + this.props.name + '" />';
29+
let className = 'slds-button__icon';
2330
if (this.props.stateful) {
24-
className += "--stateful";
31+
className += '--stateful';
2532
}
2633
if (this.props.position) {
27-
className = className + " slds-button__icon--" + this.props.position;
34+
className = className + ' slds-button__icon--' + this.props.position;
2835
}
2936
if (this.props.size) {
30-
className = className + " slds-button__icon--" + this.props.size;
37+
className = className + ' slds-button__icon--' + this.props.size;
3138
}
3239
if (this.props.inverse) {
33-
className = className + " slds-button__icon--inverse";
40+
className = className + ' slds-button__icon--inverse';
3441
}
3542
if (this.props.hint) {
36-
className = className + " slds-button__icon--hint";
43+
className = className + ' slds-button__icon--hint';
3744
}
38-
return <svg aria-hidden="true" className={className} dangerouslySetInnerHTML={{__html: useTag }} />;
45+
return <svg aria-hidden='true' className={className} dangerouslySetInnerHTML={{__html: useTag }} />;
3946
}
4047

4148
});
4249

43-
export let Icon = React.createClass({
50+
export const Icon = React.createClass({
4451

4552
getDefaultProps() {
4653
return {
47-
category: "standard"
48-
}
54+
category: 'standard',
55+
};
4956
},
5057

5158
render() {
52-
let useTag = '<use xlink:href="assets/icons/' + this.props.category + '-sprite/svg/symbols.svg#' + this.props.name + '" />';
53-
let className = "slds-icon";
59+
60+
const useTag = '<use xlink:href="'+SLDSSettings.getAssetsPath()+'/icons/' + this.props.category + '-sprite/svg/symbols.svg#' + this.props.name + '" />';
61+
let className = 'slds-icon';
5462
if (this.props.stateful) {
55-
className += "--stateful";
63+
className += '--stateful';
5664
}
5765
if (this.props.className) {
58-
className += " " +this.props.className;
66+
className += ' ' +this.props.className;
5967
}
6068
if (this.props.size) {
61-
className += " slds-icon--" + this.props.size;
69+
className += ' slds-icon--' + this.props.size;
6270
}
6371
if (this.props.position) {
64-
className += " slds-icon--" + this.props.position;
72+
className += ' slds-icon--' + this.props.position;
6573
}
66-
className = className + " slds-icon-" + this.props.category + '-' + (this.props.theme || this.props.name);
67-
return <span className="slds-icon__container"><svg aria-hidden="true" className={className} style={this.props.style} dangerouslySetInnerHTML={{__html: useTag }} /></span>;
74+
className = className + ' slds-icon-' + this.props.category + '-' + (this.props.theme || this.props.name);
75+
return <span className='slds-icon__container'><svg aria-hidden='true' className={className} style={this.props.style} dangerouslySetInnerHTML={{__html: useTag }} /></span>;
6876
}
6977

7078
});
7179

72-
export let InputIcon = React.createClass({
80+
export const InputIcon = React.createClass({
7381

7482
render() {
75-
let useTag = '<use xlink:href="assets/icons/utility-sprite/svg/symbols.svg#' + this.props.name + '" />';
76-
let className = "slds-input__icon slds-icon-text-default";
77-
return <svg aria-hidden="true" className={className} dangerouslySetInnerHTML={{__html: useTag }} />;
83+
const useTag = '<use xlink:href="'+SLDSSettings.getAssetsPath()+'icons/utility-sprite/svg/symbols.svg#' + this.props.name + '" />';
84+
const className = 'slds-input__icon slds-icon-text-default';
85+
return <svg aria-hidden='true' className={className} dangerouslySetInnerHTML={{__html: useTag }} />;
7886
}
7987

8088
});

components/SLDSPopover.js

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

1212
import React from "react";
1313
import TetherDrop from "tether-drop";
14-
import { TransitionSpring, Spring } from 'react-motion';
14+
//import { TransitionSpring, Spring } from 'react-motion';
1515

1616
module.exports = React.createClass( {
1717

@@ -80,15 +80,24 @@ module.exports = React.createClass( {
8080
float:'inherit',
8181
position:'inherit',
8282
}}>
83-
83+
{/*
8484
<Spring
8585
defaultValue={{ val:0 }}
8686
endValue={{ val:1, config: [70, 10] }}>
8787
{currentVal => {
88-
return (<div style={{opacity:currentVal.val}}>{this.props.children}</div>);
88+
return (<div style={{opacity:currentVal.val}}>
89+
90+
*/}
91+
{
92+
this.props.children
93+
}
94+
{/*
95+
</div>);
8996
}.bind(this)
9097
}
9198
</Spring>
99+
100+
*/}
92101
</div>
93102
);
94103

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

1212
'use strict';
1313

14-
import DateUtil from './DateUtil';
15-
import EventUtil from './EventUtil';
16-
import KEYS from './KEYS';
14+
let assetsPath = 'assets/';
1715

1816
module.exports = {
19-
DateUtil:DateUtil,
20-
EventUtil:EventUtil,
21-
KEYS:KEYS
17+
setAssetsPath: (path)=>{
18+
if(path){
19+
assetsPath = path;
20+
}
21+
},
22+
getAssetsPath: ()=>{
23+
return String(assetsPath);
24+
}
2225
};

components/index.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
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+
112
import SLDSPicklistBase from './SLDSPicklistBase';
13+
import SLDSSettings from './SLDSSettings';
214

3-
export default {
4-
SLDSPicklistBase: SLDSPicklistBase
15+
module.exports = {
16+
SLDSPicklistBase: SLDSPicklistBase,
17+
SLDSSettings: SLDSSettings
518
};

demo/App.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react';
2-
import SLDSDateInput from './slds/SLDSDateInput/index';
32
import BaseLayout from './layout/base';
43

54
import Router from 'react-router';
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)