initial commit
This commit is contained in:
1
lib/atom-react/components/config-menu.js
Normal file
1
lib/atom-react/components/config-menu.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},n=e(require("react"));module.exports=n.createClass({displayName:"config-menu",getInitialState:function(){return{}},render:function(){var e=this,t=[],a=0;return this.props.data.forEach(function(i){t.push(n.createElement("li",{key:a,name:i,onClick:e.onClick.bind(e,i)},n.createElement("a",{key:a++,className:"icon icon-settings"},i)))}),n.createElement("div",{className:"settings-view pane-item",tabindex:"-1",is:"space-pen-div"},n.createElement("div",{className:"config-menu"},n.createElement("ul",{className:"panels-menu nav nav-pills nav-stacked"},t)),n.createElement("div",{className:"panels"},this.props.activeSection))},onClick:function(e){this.props.onSelect(e)}});
|
||||
1
lib/atom-react/components/float-input-view.js
Normal file
1
lib/atom-react/components/float-input-view.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react")),n=t.createClass({displayName:"FloatInputView",getDefaultProps:function(){return{style:{width:"100%"},tabIndex:-1,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,defaultValue:0,value:0,precision:20,onChange:function(){}}},getInitialState:function(){return{value:this.toPrecision(this.props.value)}},componentWillMount:function(){this.textValue=this.props.value},componentWillReceiveProps:function(e){var t=this.toPrecision(e.value),n=this.getDOMNode().childNodes[0];this.textValue!==t&&(this.textValue=t,n.value=t,this.setState({value:t}))},toPrecision:function(e){return parseFloat(e.toFixed(this.props.precision))},onFocus:function(){this.getDOMNode().childNodes[0].select(),this.becameSelected=!0},onMouseUp:function(e){this.becameSelected===!0&&(this.becameSelected=!1,e.preventDefault(),e.stopPropagation())},render:function(){var e={width:"100%"};return t.createElement("div",{className:"native-key-bindings",tabIndex:-1},t.createElement("input",{onFocus:this.onFocus,onKeyPress:this.onKeyPress,className:"native-key-bindings",style:Object.assign({},e,this.props.style),tabIndex:this.props.tabIndex,type:"number",onMouseUpCapture:this.onMouseUp,onChange:this.onChange,defaultValue:this.state.value,min:this.props.min,max:this.props.max,onKeyDown:this.onKeyDown,step:"any"}))},onKeyDown:function(){},onKeyPress:function(e){13===e.nativeEvent.keyCode&&(this.getDOMNode().childNodes[0].value=this.state.value)},onChange:function(e){var t=e.target.value;0!==t.length&&(t=parseFloat(t),t=Math.max(this.props.min,t),t=Math.min(this.props.max,t),t=this.toPrecision(t),t!==this.state.value&&(this.setState({value:t}),this.textValue=t,this.props.onChange(t)))}});module.exports=n;
|
||||
1
lib/atom-react/components/integer-input-view.js
Normal file
1
lib/atom-react/components/integer-input-view.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react")),n=t.createClass({displayName:"IntegerInputView",getDefaultProps:function(){return{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,tabIndex:-1,defaultValue:0,value:0,precision:0,onChange:function(){}}},getInitialState:function(){return{value:this.toPrecision(this.props.value)}},componentWillMount:function(){this.textValue=this.props.value},componentWillReceiveProps:function(e){var t=this.toPrecision(e.value),n=this.getDOMNode().childNodes[0];this.textValue!==t&&(this.textValue=t,n.value=t,this.setState({value:t}))},toPrecision:function(e){return parseFloat(e.toFixed(this.props.precision))},render:function(){var e={width:"100%"};return t.createElement("div",{className:"native-key-bindings",tabIndex:-1},t.createElement("input",{onKeyPress:this.onKeyPress,className:"native-key-bindings",style:Object.assign({},e,this.props.style),tabIndex:this.props.tabIndex,type:"number",onChange:this.onChange,defaultValue:this.state.value,min:this.props.min,max:this.props.max,step:"any"}))},onKeyPress:function(e){13===e.nativeEvent.keyCode&&(this.getDOMNode().childNodes[0].value=this.state.value)},onChange:function(e){var t=e.target.value;0!==t.length&&(t=parseFloat(t),t=Math.max(this.props.min,t),t=Math.min(this.props.max,t),t=this.toPrecision(t),t!==this.state.value&&(this.setState({value:t}),this.textValue=t,this.props.onChange(t)))}});module.exports=n;
|
||||
1
lib/atom-react/components/jibo-checkbox.js
Normal file
1
lib/atom-react/components/jibo-checkbox.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react"));module.exports=t.createClass({displayName:"jibo-checkbox",getInitialState:function(){return{isVisible:this.props.isVisible}},render:function(){var e={paddingLeft:30},i={"float":"left",marginTop:4},s={marginTop:1};return t.createElement("div",null,t.createElement("div",{className:"settings-view checkbox"},t.createElement("label",{"for":"velocityBoxLabel",style:e},t.createElement("input",{id:"velocityBoxLabel",type:"checkbox",checked:this.state.isVisible,label:this.props.label,style:i,onClick:this.onClick}),t.createElement("div",{className:"setting-title",style:s},this.props.label)),t.createElement("div",{className:"setting-description"})))},onClick:function(){this.props.clickHandler(!this.state.isVisible),this.setState({isVisible:!this.state.isVisible})}});
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=e(require("react")),$=e(require("jquery")),i=t.createClass({displayName:"List",getInitialState:function(){return{hoveredElement:void 0}},onMouseOver:function(e){this.state.hoveredElement=e,this.setState(this.state)},onMouseOut:function(){this.state.hoveredElement=void 0,this.setState(this.state)},onClick:function(e){this.props.onSelect(e)},render:function(){var e=this,i=[];return this.props.data.forEach(function(n,s){var o="list-item";n===e.state.hoveredElement&&(o+=" selected");var l={},r=null;"string"==typeof n.label?(l={marginLeft:0},r=n.label):r=n.label(),i.push(t.createElement("li",{key:s,className:o,onMouseOver:e.onMouseOver.bind(e,n),onMouseOut:e.onMouseOut.bind(e,n),onClick:e.onClick.bind(e,n)},t.createElement("span",{style:l},r)))}),t.createElement("ul",{className:"list-group"},i)}});module.exports=t.createClass({displayName:"jibo-combo-box-unidirectional",getInitialState:function(){return{clickHandler:this.clickHandler.bind(this)}},render:function(){var e=null;if(this.props.current.display)if("function"==typeof this.props.current.display)e=this.props.current.display();else{var i=null;i=this.props.titleDisplay?this.props.titleDisplay:this.props.current.display,e="\xa0\xa0"+i,e=[t.createElement("i",{className:"fa fa-caret-down",style:{fontSize:20}}),e]}var n="combo-box btn";return this.props.hideButton&&(n="combo-box"),t.createElement("div",null,t.createElement("div",{ref:"button",className:n,onClick:this.onClick},e))},removeList:function(){$(document).off("click",this.state.clickHandler),this.node.remove(),this.node=null},onSelect:function(e){this.props.keepFocusAfterClick||this.removeList(),this.props.onSelected(e)},clickHandler:function(e){0===$(e.target).closest(this.node).length&&this.removeList()},onClick:function(e){if(e.preventDefault(),e.stopPropagation(),this.node)this.removeList();else{var n=t.findDOMNode(this.refs.button),s=n.getBoundingClientRect();this.node=$("<div />").addClass("combo-box-list").css({left:s.left+"px",top:s.bottom+"px"}).appendTo(document.body),$(document).on("click",this.state.clickHandler),t.render(t.createElement(i,{data:this.props.data,onSelect:this.onSelect}),this.node[0])}}});
|
||||
1
lib/atom-react/components/jibo-combo-box.js
Normal file
1
lib/atom-react/components/jibo-combo-box.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=t(require("react")),$=t(require("jquery")),s=e.createClass({displayName:"List",getInitialState:function(){return{hoveredElement:void 0}},onMouseOver:function(t){this.state.hoveredElement=t,this.setState(this.state)},onMouseOut:function(){this.state.hoveredElement=void 0,this.setState(this.state)},onClick:function(t){this.props.onSelect(t)},render:function(){var t=this,s=[];return this.props.data.forEach(function(i,n){var o="list-item";i===t.state.hoveredElement&&(o+=" selected");var r={},l=null;"string"==typeof i.label?(r={marginLeft:5},l=i.label):l=i.label(),s.push(e.createElement("li",{key:n,className:o,onMouseOver:t.onMouseOver.bind(t,i),onMouseOut:t.onMouseOut.bind(t,i),onClick:t.onClick.bind(t,i)},e.createElement("span",{style:r},l)))}),e.createElement("ul",{className:"list-group"},s)}});module.exports=e.createClass({displayName:"jibo-combo-box",getInitialState:function(){return{clickHandler:this.clickHandler.bind(this),current:this.props.init}},render:function(){var t=null;if(this.state.current.display)if("function"==typeof this.state.current.display)t=this.state.current.display();else{var s=null;s=this.props.titleDisplay?this.props.titleDisplay:this.state.current.display,t="\xa0\xa0"+s,t=[e.createElement("i",{className:"fa fa-caret-down",style:{fontSize:20}}),t]}var i="combo-box btn";return this.props.hideButton&&(i="combo-box"),e.createElement("div",null,e.createElement("div",{ref:"button",className:i,onClick:this.onClick},t))},removeList:function(){$(document).off("click",this.state.clickHandler),this.node.remove(),this.node=null},onSelect:function(t){this.state.current=t,this.setState(this.state),this.props.keepFocusAfterClick||this.removeList(),this.props.onSelected(t)},clickHandler:function(t){0===$(t.target).closest(this.node).length&&this.removeList()},onClick:function(t){if(t.preventDefault(),t.stopPropagation(),this.node)this.removeList();else{var i=e.findDOMNode(this.refs.button),n=i.getBoundingClientRect();this.node=$("<div />").addClass("combo-box-list").css({left:n.left+"px",top:n.bottom+"px"}).appendTo(document.body),$(document).on("click",this.state.clickHandler),e.render(e.createElement(s,{data:this.props.data,onSelect:this.onSelect}),this.node[0])}}});
|
||||
Reference in New Issue
Block a user