From 32daeef1b2cc04ffaf070a862a661812440df6ec Mon Sep 17 00:00:00 2001 From: Javi Jimenez Villar Date: Thu, 4 Jun 2015 20:17:14 +0200 Subject: [PATCH] Added components --- components/button.cjsx | 43 ++++ components/font_icon.cjsx | 14 ++ {source/components => components}/form.cjsx | 35 ++- {source/components => components}/input.cjsx | 46 ++-- components/ripple.cjsx | 30 +++ dist/assets/img/avatar.jpg | Bin 13304 -> 0 bytes dist/index.html | 23 -- source/app.cjsx | 66 ------ source/components/button.cjsx | 28 --- source/components/header.cjsx | 49 ----- source/components/list.cjsx | 39 ---- source/components/list_item.cjsx | 13 -- source/components/navigation.cjsx | 30 --- source/components/router.cjsx | 44 ---- source/forms/form.session.cjsx | 55 ----- source/models/session.coffee | 33 --- source/modules/constants.coffee | 26 --- source/modules/storage.coffee | 12 -- source/screens/console.cjsx | 14 -- source/screens/form.cjsx | 39 ---- source/styles/__constants.styl | 42 ---- source/styles/app.styl | 21 -- source/styles/components/button.styl | 30 --- source/styles/components/form.styl | 16 -- source/styles/components/header.styl | 60 ------ source/styles/components/input.styl | 65 ------ source/styles/components/list.styl | 2 - source/styles/components/list_item.styl | 16 -- source/styles/components/loading.styl | 35 --- source/styles/components/navigation.styl | 15 -- source/styles/modules/animations.styl | 16 -- source/styles/modules/flexbox.styl | 61 ------ source/styles/normalize.styl | 211 ------------------- source/styles/screens/__init.styl | 12 -- source/styles/screens/console.styl | 1 - source/styles/screens/session.styl | 2 - 36 files changed, 120 insertions(+), 1124 deletions(-) create mode 100644 components/button.cjsx create mode 100644 components/font_icon.cjsx rename {source/components => components}/form.cjsx (52%) rename {source/components => components}/input.cjsx (51%) create mode 100644 components/ripple.cjsx delete mode 100644 dist/assets/img/avatar.jpg delete mode 100644 dist/index.html delete mode 100644 source/app.cjsx delete mode 100644 source/components/button.cjsx delete mode 100644 source/components/header.cjsx delete mode 100644 source/components/list.cjsx delete mode 100644 source/components/list_item.cjsx delete mode 100644 source/components/navigation.cjsx delete mode 100644 source/components/router.cjsx delete mode 100644 source/forms/form.session.cjsx delete mode 100644 source/models/session.coffee delete mode 100644 source/modules/constants.coffee delete mode 100644 source/modules/storage.coffee delete mode 100644 source/screens/console.cjsx delete mode 100644 source/screens/form.cjsx delete mode 100644 source/styles/__constants.styl delete mode 100644 source/styles/app.styl delete mode 100644 source/styles/components/button.styl delete mode 100644 source/styles/components/form.styl delete mode 100644 source/styles/components/header.styl delete mode 100644 source/styles/components/input.styl delete mode 100644 source/styles/components/list.styl delete mode 100644 source/styles/components/list_item.styl delete mode 100644 source/styles/components/loading.styl delete mode 100644 source/styles/components/navigation.styl delete mode 100644 source/styles/modules/animations.styl delete mode 100644 source/styles/modules/flexbox.styl delete mode 100644 source/styles/normalize.styl delete mode 100644 source/styles/screens/__init.styl delete mode 100644 source/styles/screens/console.styl delete mode 100644 source/styles/screens/session.styl diff --git a/components/button.cjsx b/components/button.cjsx new file mode 100644 index 00000000..94a086d6 --- /dev/null +++ b/components/button.cjsx @@ -0,0 +1,43 @@ +### +@todo +### + +FontIcon = require "./font_icon" +Ripple = require "./ripple" + +module.exports = React.createClass + + # -- States & Properties + propTypes: + type : React.PropTypes.string + caption : React.PropTypes.string + icon : React.PropTypes.string + style : React.PropTypes.string + disabled : React.PropTypes.bool + + getDefaultProps: -> + type : "square" + disabled : false + + getInitialState: -> + ripple : undefined + + # -- Events + onClick: (event) -> + event.preventDefault() + @setState ripple: + left : event.pageX - event.target.offsetLeft + top : event.pageY - event.target.offsetTop + @props.onClick? event, @ + + # -- Render + render: -> + diff --git a/components/font_icon.cjsx b/components/font_icon.cjsx new file mode 100644 index 00000000..f90bd82c --- /dev/null +++ b/components/font_icon.cjsx @@ -0,0 +1,14 @@ +### +@todo +### + + +module.exports = React.createClass + + # -- States & Properties + propTypes: + value : React.PropTypes.array.required + + # -- Render + render: -> + diff --git a/source/components/form.cjsx b/components/form.cjsx similarity index 52% rename from source/components/form.cjsx rename to components/form.cjsx index e72b1dbb..f46f98e3 100644 --- a/source/components/form.cjsx +++ b/components/form.cjsx @@ -24,34 +24,27 @@ module.exports = React.createClass # -- Events onSubmit: (event) -> event.preventDefault() - @props.onSubmit? event, @getValue() + @props.onSubmit? event, @ onChange: (event) -> - console.log "form.onChange" is_valid = true - values = @getValue() - # for attr in @props.attributes when attr.required and values[attr.ref].trim() is "" - # console.log attr.ref - # is_valid = false - # break - - console.log "is_valid", is_valid - # @TODO: Handler if have errors - # @props.onChange? event, @getValue() + value = @getValue() + for attr in @props.attributes when attr.required and value[attr.ref]?.trim() is "" + is_valid = false + @refs[attr.ref].setError?() + break + @props[if is_valid then "onValid" else "onError"]? event, @ + @props.onChange? event, @ # -- Render render: -> -
+ { for attribute, index in @props.attributes - + } -
# -- Extends @@ -60,5 +53,5 @@ module.exports = React.createClass value[ref] = el.getValue() for ref, el of @refs value - setValue: -> - @ + setValue: (data) -> + @setState attributes: data diff --git a/source/components/input.cjsx b/components/input.cjsx similarity index 51% rename from source/components/input.cjsx rename to components/input.cjsx index 1b86d102..c9e3335d 100644 --- a/source/components/input.cjsx +++ b/components/input.cjsx @@ -6,49 +6,41 @@ module.exports = React.createClass # -- States & Properties propTypes: + type : React.PropTypes.string.required label : React.PropTypes.string value : React.PropTypes.string - type : React.PropTypes.string + error : React.PropTypes.string required : React.PropTypes.bool disabled : React.PropTypes.bool - # -- Events + multiline : React.PropTypes.bool onChange : React.PropTypes.func - onBlur : React.PropTypes.func - onFocus : React.PropTypes.func getDefaultProps: -> type : "text" disabled : false + multiline : false getInitialState: -> value : @props.value # -- Events onChange: (event) -> - value = event.target.value - @setState value: value - @props.onChange? event, value - - onBlur: (event) -> - console.log "onBlur" - @props.onBlur? event, value - - onFocus: (event) -> - console.log "onFocus" - @props.onFocus? event, value + @setState value: event.target.value + @props.onChange? event, @ # -- Render render: -> -
- + # -- styles + style = "" + style += " error" if @props.error + # -- tag +
+ { + if @props.multiline + + else + + } { if @props.label } { {@props.error} if @props.error } @@ -61,5 +53,5 @@ module.exports = React.createClass setValue: (data) -> @setState value: data - clearValue: -> - @setState "" + setError: (data = "Unknown error") -> + @setState error: data diff --git a/components/ripple.cjsx b/components/ripple.cjsx new file mode 100644 index 00000000..13f4fa37 --- /dev/null +++ b/components/ripple.cjsx @@ -0,0 +1,30 @@ +### +@todo +### + +module.exports = React.createClass + + # -- States & Properties + propTypes: + origin : React.PropTypes.object + colour : React.PropTypes.string + + getDefaultProps: -> + origin : undefined + colour : "#ffffff" + + # -- Lifecycle + componentDidMount: -> + el = @getDOMNode() + for key in ["animationend", "webkitAnimationEnd", "oAnimationEnd", "MSAnimationEnd"] + el.addEventListener key, => + el.classList.remove "active" + , false + + componentDidUpdate: -> + @getDOMNode().classList.add "active" + + # -- Render + render: -> +
diff --git a/dist/assets/img/avatar.jpg b/dist/assets/img/avatar.jpg deleted file mode 100644 index 08bfe41a056a6ddf33c5f9781f2c8ba6ee09ba67..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13304 zcmdsdby%C*(r<7mUMTL`7I!EPEmow^;!YrF@dhUpD-?H!b{8!U4N?dW!QBGE11&Da zA#i){clJK}eCIyjKliVDC(o0acfHB1^{zE*&CGA!`}zA-0GWo0x(WaT0|TJ;`vbUN z1StRG>i>%Vq2&Kc!9V_d-vJ=U$Kb`_#lj#5V3K2Ckz?HV0GI$608Fg^tsL-AB6xs< zhmVVmfr<6|z6u!t0~-?)0}BfSivSyk7y!ToU|?b6;Nm?b$ERQ;pk#f-E+kAvP0OLE zWRO0`DI%)NrL1S@AtoVd^A7wzDFfOtJ@Z=+KSj||GabH84!MmBW9RuU+5 zmfYaqpN-N~o433vKrwA~N7nC0`Gjc30!gTs?h1n|8rc$g4vo-U;jo*DiL+LHE|5ep zOt{&>%M@S61+BU`EYf~l;00hIF`vJx&%B`UT4***YS2Eg01h7nFlmzmQyLq{OkliZ zU1QUstsVf?RSO}eq))R4hnp)X3-bYFLH#*o`QRP^TUtsaBLmgsXiroOi@$?q$W{+N z4A>B-7J!hms~>?`(^F@ni_qcB-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f=M~5C zok3yTuL4_|oC0tVxb#O@%y8P8#cE&H*zcga2JL61tczB2Uf1z9cd&1(Ckx8~i~_X* zq&c76C{hYFR}S_jzLOchM-oKI_QUI`JwS1JxW6lvdAIeqAG&KrV$Om`Zt@B)>g&G~ z4}JBI`?17f9izYHs@5|d;!lk4Lo}V~&NOTpt3Qe~wxT9B@DT)XpArwY#w0cutc|YG=6 zI5Xo{%!PPc&YIZ#j_$)Q7zc1m=FyJVUl$gv2ED2-0K*4c3+SKk1c(s>J5P5FGF)Qrde=D_1cg*pKZm9m%oToQ4^BvDEb%< zUw%+$D)pAk+v(o|w!bcjg@yu&dvZ5FxX3?tG|KzL8rzlrs$+Z4D1P(=QhWZ?&XDIh zlTMOhrMsgES6tOh9qCLL`_+eS`jjegUErhsN7Zva!U?ZYI--ZF^dbX$dJ9Kq93|cZ z_kc%h?cu#D-BSm3o4+{7zYGLt`TdGw>OMr8Hd>d?9Bk%u-rme zCM_s-FNGAp{1b5TH#by8HX;+(PUBRq7f-^E>nCTA8h?R%3q7s5L*oJ-h6Hj7@bh9$ zWDRiZiYu}(sGoj6BWz0xXqj5OOu*s6E;b%w%|R4ay}k85LyAS?iZH=!t8<2}UG6N; z?SJ7CIIWJAtdzt*d?w{Hw~{3BbQwW1)i6@Pq)P zaNpY{Jnw%YW`Em%{}d;r+l$*UQNaA5p(tyM{<^}>b(+ci>^pjMYP2}x1G UY|M){-Ov7n2L6BGVfTpt1%ryR0RR91 diff --git a/dist/index.html b/dist/index.html deleted file mode 100644 index 35125e51..00000000 --- a/dist/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Material Console - - - - - - - - - - - - - - - - - - diff --git a/source/app.cjsx b/source/app.cjsx deleted file mode 100644 index 5d8b4018..00000000 --- a/source/app.cjsx +++ /dev/null @@ -1,66 +0,0 @@ -"use strict" - -SPArouter = require "spa-router" -# -- components - -Router = require "./components/router" -# -- forms -FormSession = require "./forms/form.session" -# -- Screens -ScreenConsole = require "./screens/console" -ScreenForm = require "./screens/form" -# -- Modules -C = require "./modules/constants" - -App = React.createClass - - # -- Lifecycle - componentWillMount: -> - SPArouter.listen - "/session/:context" : (context) => - @setState session: false, context: context - "/:context/:area" : (context, area) => - @setState session: true, context: context, area: area - - # -- Events - onSessionSuccess: (data) -> - header_style = @refs.header.getDOMNode().classList - header_style.add "disabled" - header_style.remove "expanded" - setTimeout => - SPArouter.path "campaigns/list" - , C.ANIMATION.DURATION - setTimeout => - header_style.remove "disabled" - , (C.ANIMATION.DURATION * 2) - - onConsoleScroll: (value) -> @setState scrolling: value - - onLogout: -> SPArouter.path "session/login" - - # -- Render - render: -> - # return - - if @state.session - avatar = "http://soyjavi.com/assets/img/soyjavi.hat.jpg" - else - avatar = "./assets/img/avatar.jpg" - - -
- - { - if @state.session - - else - - } -
- { if @state.session } -
- -React.render , document.body diff --git a/source/components/button.cjsx b/source/components/button.cjsx deleted file mode 100644 index 4ac6f30f..00000000 --- a/source/components/button.cjsx +++ /dev/null @@ -1,28 +0,0 @@ -### -@todo -### - -module.exports = React.createClass - - # -- States & Properties - propTypes: - caption : React.PropTypes.string - icon : React.PropTypes.string - - getDefaultProps: -> - icon : undefined - - # -- Events - onClick: (event) -> - event.preventDefault() - @props.onClick.call @, event - - # -- Render - render: -> - diff --git a/source/components/header.cjsx b/source/components/header.cjsx deleted file mode 100644 index 3718a22a..00000000 --- a/source/components/header.cjsx +++ /dev/null @@ -1,49 +0,0 @@ -### -@todo -### - -Button = require './button' -Navigation = require './navigation' - - -module.exports = React.createClass - - # -- States & Properties - propTypes: - title : React.PropTypes.string.required - routes : React.PropTypes.array.required - subroutes : React.PropTypes.array - - getDefaultProps: -> - routes : [] - title : undefined - subroutes : [] - - getInitialState: -> - expanded : @props.expanded - - # -- Lifecycle - componentDidUpdate: (nextProps) -> - @refs.header.getDOMNode().classList.remove "expanded" - - # -- Events - onProfile: (event) -> - event.preventDefault() - @refs.header.getDOMNode().classList.toggle "expanded" - - # -- Render - render: -> -
- -
- -
-

{@props.title}

-
- { if @props.subroutes } -
- -
diff --git a/source/components/list.cjsx b/source/components/list.cjsx deleted file mode 100644 index 6747c212..00000000 --- a/source/components/list.cjsx +++ /dev/null @@ -1,39 +0,0 @@ -### -@todo -### - -module.exports = React.createClass - - # -- States & Properties - propTypes: - itemFactory : React.PropTypes.func.isRequired - dataSource : React.PropTypes.array.isRequired - - getDefaultProps: -> - itemFactory : (index) ->
- dataSource : [] - - getInitialState: -> - scrolling : false - scroll : 0 - - # -- Lifecycle - componentDidMount: -> - @setState clientHeight: @getDOMNode().clientHeight - - # -- Events - onScroll: (event) -> - scroll = @refs.section.getDOMNode().scrollTop - @props.onScroll? scroll > @state.scroll - @setState scroll: scroll - - # -- Render - render: -> -
-
    - { - for item, index in @props.dataSource -
  • {@props.itemFactory item}
  • - } -
-
diff --git a/source/components/list_item.cjsx b/source/components/list_item.cjsx deleted file mode 100644 index e7172024..00000000 --- a/source/components/list_item.cjsx +++ /dev/null @@ -1,13 +0,0 @@ -### -@todo -### - -module.exports = (data) -> - -
-
- text - lorem ipsum... -
- moment -
diff --git a/source/components/navigation.cjsx b/source/components/navigation.cjsx deleted file mode 100644 index 77f8a515..00000000 --- a/source/components/navigation.cjsx +++ /dev/null @@ -1,30 +0,0 @@ -### -@todo -### - -module.exports = React.createClass - - # -- States & Properties - propTypes: - routes : React.PropTypes.array - - getDefaultProps: -> - routes : [] - - # -- Events - onBack: (event) -> - event.preventDefault() - event.stopPropagation() - window.history.back() - - # -- Render - render: -> - diff --git a/source/components/router.cjsx b/source/components/router.cjsx deleted file mode 100644 index ba68ff4e..00000000 --- a/source/components/router.cjsx +++ /dev/null @@ -1,44 +0,0 @@ -### -@todo -### - -Button = require "./button" -Navigation = require "./navigation" -C = require "../modules/constants" - -module.exports = React.createClass - - # -- States & Properties - propTypes: - routes : React.PropTypes.array.required - - getDefaultProps: -> - routes : [ - label: "Campaigns", route: "/campaigns/list" - , - label: "Creatives", route: "/creatives/list" - , - label: "Users", route: "/users/list" - , - label: "Deals", route: "/deals/list" - , - label: "Analytics", route: "/analytics" - ] - - # -- Render - render: -> - for route in @props.routes - route.className = if route.label.toLowerCase() is @props.context then "active" else "" - for route in subroutes = C.SUBROUTES[@props.context.toUpperCase()] - route.className = if route.label.toLowerCase() is @props.area then "active" else "" -
-
- -

Console

- -
- -
diff --git a/source/forms/form.session.cjsx b/source/forms/form.session.cjsx deleted file mode 100644 index 2fb012ed..00000000 --- a/source/forms/form.session.cjsx +++ /dev/null @@ -1,55 +0,0 @@ -### -@todo -### - -# -- components -Button = require "../components/button" - -module.exports = React.createClass - - # -- States & Properties - propTypes: - active : React.PropTypes.boolean - context : React.PropTypes.string - onSuccess : React.PropTypes.function - - getInitialState: -> - disabled : true - - # -- Events - onKeyUp: (event) -> - values = @_getFormValues() - @setState disabled: not(values.mail and values.password) - - onSign: (event) -> - event.preventDefault() - button = @refs.button.getDOMNode().classList - button.add "loading" - @props.onSuccess.call @props.onSuccess, token: "1" - - - componentDidMount: -> - setTimeout => - @setState active: true - , 450 - - # -- Render - render: -> - label = if @props.context is "login" then "Sign In" else "Sign Up" -
-

Welcome...

- - -