Skip to content

Commit a6248a9

Browse files
committed
coffee script and cjsx support
1 parent a82f3fd commit a6248a9

File tree

5 files changed

+55
-2
lines changed

5 files changed

+55
-2
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
React = require('react')
2+
SLDS = require('../../../components')
3+
SLDSPicklistBase = SLDS.SLDSPicklistBase
4+
SLDSIcons = SLDS.SLDSIcons
5+
Icon = SLDSIcons.Icon
6+
module.exports = React.createClass(
7+
getDefaultProps: ->
8+
{
9+
index: 0
10+
label: ''
11+
value: null
12+
inverted: false
13+
isSelected: false
14+
isHighlighted: false
15+
data: {}
16+
}
17+
handleMouseOver: (event) ->
18+
console.log 'OVER: ' + @props.label
19+
return
20+
21+
render: ->
22+
icon = null
23+
if(@props.isSelected)
24+
icon = <Icon name='like' position='left' category='utility' />
25+
26+
<section
27+
onMouseOver={@handleMouseOver}
28+
>
29+
{ icon }
30+
{
31+
@props.data.strongLabel
32+
}
33+
</section>
34+
)

demo/pages/HomePage/PicklistBaseCustomSection.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import {SLDSPicklistBase, SLDSIcons} from '../../../components';
1414

1515
import {default as PrismCode} from 'react-prism/lib/PrismCode';
1616

17-
const Icon = SLDSIcons.Icon;
17+
import CustomListItemLabel from './CustomListItemLabel.cjsx';
1818

19+
const Icon = SLDSIcons.Icon;
20+
/*
1921
const CustomListItemLabel = React.createClass( {
2022
getDefaultProps () {
2123
return {
@@ -45,7 +47,7 @@ const CustomListItemLabel = React.createClass( {
4547
</section>;
4648
}
4749
});
48-
50+
*/
4951

5052
module.exports = React.createClass( {
5153

demo/pages/HomePage/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import ButtonSection from './ButtonSection';
1818
import PicklistBaseSection from './PicklistBaseSection';
1919
import PicklistBaseCustomSection from './PicklistBaseCustomSection';
2020

21+
2122
import ModalSection from './ModalSection';
2223
import DatePickerSingleSelectSection from './DatePickerSingleSelectSection';
2324
import LookupBaseSection from './LookupBaseSection';

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
"babel-eslint": "^3.1.9",
4242
"babel-loader": "^5.1.2",
4343
"chai": "^3.3.0",
44+
"coffee-jsx-loader": "^0.1.3",
45+
"coffee-loader": "^0.7.2",
46+
"coffee-script": "^1.10.0",
4447
"css-loader": "^0.9.1",
4548
"eslint-plugin-react": "^2.3.0",
4649
"extract-text-webpack-plugin": "^0.8.2",

webpack.dev.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ module.exports = {
4242
test: /\.css$/,
4343
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
4444
},
45+
/*
46+
{
47+
test: /\.coffee$/,
48+
loader: "coffee-loader"
49+
},
50+
{
51+
test: /\.(coffee\.md|litcoffee)$/,
52+
loader: "coffee-loader?literate"
53+
},
54+
*/
55+
{
56+
test: /\.cjsx$/, loader: "coffee-jsx-loader"
57+
},
4558
/*
4659
{
4760
test: /\.scss$/,

0 commit comments

Comments
 (0)