nutella_framework 0.4.13 → 0.4.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/framework_components/order.json +2 -1
- data/framework_components/roomcast-bot/data/default/channels-data.json +1 -0
- data/framework_components/roomcast-bot/data/default/channels.json +1 -0
- data/framework_components/roomcast-bot/data/default/configs.json +1 -0
- data/framework_components/roomcast-bot/data/default/mapping.json +1 -0
- data/framework_components/roomcast-bot/roomcast_bot.rb +178 -0
- data/framework_components/roomcast-bot/startup +5 -0
- data/framework_components/roomcast-channel-creator/.gitignore +2 -0
- data/framework_components/roomcast-channel-creator/README.md +9 -0
- data/framework_components/roomcast-channel-creator/dist/app.js +29607 -0
- data/framework_components/roomcast-channel-creator/dist/css/font-awesome.min.css +4 -0
- data/framework_components/roomcast-channel-creator/dist/css/ionicons.min.css +11 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/FontAwesome.otf +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.eot +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.svg +565 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.ttf +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.woff +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.woff2 +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/ionicons.eot +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/ionicons.svg +2230 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/ionicons.ttf +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/ionicons.woff +0 -0
- data/framework_components/roomcast-channel-creator/dist/main.css +3304 -0
- data/framework_components/roomcast-channel-creator/dist/nutella_lib.js +5068 -0
- data/framework_components/roomcast-channel-creator/gulp/config.js +51 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/browserify.js +77 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/build.js +3 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/css.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/default.js +3 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/fonts.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/less.js +16 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/mui-fonts.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/nutella.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/setWatch.js +5 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/svgs.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/watch.js +12 -0
- data/framework_components/roomcast-channel-creator/gulp/util/bundleLogger.js +21 -0
- data/framework_components/roomcast-channel-creator/gulp/util/handleErrors.js +15 -0
- data/framework_components/roomcast-channel-creator/gulpfile.js +16 -0
- data/framework_components/roomcast-channel-creator/index.html +52 -0
- data/framework_components/roomcast-channel-creator/nutella.json +6 -0
- data/framework_components/roomcast-channel-creator/package.json +37 -0
- data/framework_components/roomcast-channel-creator/src/app/app.js +22 -0
- data/framework_components/roomcast-channel-creator/src/app/components/AnimationMixin.js +44 -0
- data/framework_components/roomcast-channel-creator/src/app/components/CataloguePage.js +130 -0
- data/framework_components/roomcast-channel-creator/src/app/components/Channel.js +378 -0
- data/framework_components/roomcast-channel-creator/src/app/components/ColorCell.js +28 -0
- data/framework_components/roomcast-channel-creator/src/app/components/ColorPicker.js +53 -0
- data/framework_components/roomcast-channel-creator/src/app/components/DetailPage.js +66 -0
- data/framework_components/roomcast-channel-creator/src/app/components/NutellaMixin.js +40 -0
- data/framework_components/roomcast-channel-creator/src/app/components/PageSliderMixin.js +68 -0
- data/framework_components/roomcast-channel-creator/src/app/components/Router.js +52 -0
- data/framework_components/roomcast-channel-creator/src/app/components/TopBar.js +86 -0
- data/framework_components/roomcast-channel-creator/src/app/components/main.js +333 -0
- data/framework_components/roomcast-channel-creator/src/css/font-awesome.min.css +4 -0
- data/framework_components/roomcast-channel-creator/src/css/ionicons.min.css +11 -0
- data/framework_components/roomcast-channel-creator/src/fonts/FontAwesome.otf +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.eot +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.svg +565 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.ttf +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.woff +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.woff2 +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/ionicons.eot +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/ionicons.svg +2230 -0
- data/framework_components/roomcast-channel-creator/src/fonts/ionicons.ttf +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/ionicons.woff +0 -0
- data/framework_components/roomcast-channel-creator/src/less/main.less +500 -0
- data/framework_components/roomcast-channel-creator/src/less/my_overrides.less +14 -0
- data/framework_components/roomcast-package-creator/.gitignore +2 -0
- data/framework_components/roomcast-package-creator/README.md +9 -0
- data/framework_components/roomcast-package-creator/dist/app.js +36624 -0
- data/framework_components/roomcast-package-creator/dist/css/font-awesome.min.css +4 -0
- data/framework_components/roomcast-package-creator/dist/css/ionicons.min.css +11 -0
- data/framework_components/roomcast-package-creator/dist/fonts/FontAwesome.otf +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.eot +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.svg +565 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.ttf +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.woff +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.woff2 +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/ionicons.eot +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/ionicons.svg +2230 -0
- data/framework_components/roomcast-package-creator/dist/fonts/ionicons.ttf +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/ionicons.woff +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/material-ui-icons.eot +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/material-ui-icons.svg +14 -0
- data/framework_components/roomcast-package-creator/dist/fonts/material-ui-icons.ttf +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/material-ui-icons.woff +0 -0
- data/framework_components/roomcast-package-creator/dist/main.css +5932 -0
- data/framework_components/roomcast-package-creator/dist/nutella_lib.js +5068 -0
- data/framework_components/roomcast-package-creator/gulp/config.js +51 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/browserify.js +77 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/build.js +3 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/css.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/default.js +3 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/fonts.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/less.js +16 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/mui-fonts.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/nutella.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/setWatch.js +5 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/svgs.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/watch.js +12 -0
- data/framework_components/roomcast-package-creator/gulp/util/bundleLogger.js +21 -0
- data/framework_components/roomcast-package-creator/gulp/util/handleErrors.js +15 -0
- data/framework_components/roomcast-package-creator/gulpfile.js +16 -0
- data/framework_components/roomcast-package-creator/index.html +51 -0
- data/framework_components/roomcast-package-creator/nutella.json +6 -0
- data/framework_components/roomcast-package-creator/package.json +38 -0
- data/framework_components/roomcast-package-creator/src/app/app.js +19 -0
- data/framework_components/roomcast-package-creator/src/app/components/ButtonInteractionsMixin.js +45 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelCard.js +87 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelItem.js +71 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js +64 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelsPanel.js +127 -0
- data/framework_components/roomcast-package-creator/src/app/components/ConfigField.js +50 -0
- data/framework_components/roomcast-package-creator/src/app/components/ConfigurationsPanel.js +114 -0
- data/framework_components/roomcast-package-creator/src/app/components/ContextButton.js +37 -0
- data/framework_components/roomcast-package-creator/src/app/components/GlobalButton.js +26 -0
- data/framework_components/roomcast-package-creator/src/app/components/NutellaMixin.js +23 -0
- data/framework_components/roomcast-package-creator/src/app/components/PoolHeader.js +67 -0
- data/framework_components/roomcast-package-creator/src/app/components/PoolRow.js +160 -0
- data/framework_components/roomcast-package-creator/src/app/components/ResourceFamilyPool.js +168 -0
- data/framework_components/roomcast-package-creator/src/app/components/ResourcesPanel.js +76 -0
- data/framework_components/roomcast-package-creator/src/app/components/main.js +222 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/dialog_.jsx +66 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/drop-down-menu.jsx +163 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/enhanced-textarea.jsx +113 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/floating-action-button_.jsx +73 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/menu-item.jsx +100 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/menu.jsx +209 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/overlay.jsx +21 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/raised-button_.jsx +72 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/right-nav.jsx +108 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/drop-down-arrow.jsx +17 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/navigation-chevron-left.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/navigation-chevron-right.jsx +17 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/navigation-menu.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/svg-icon.jsx +23 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/toggle-check-box-checked.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/toggle-check-box-outline-blank.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/toggle-radio-button-off.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/toggle-radio-button-on.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/text-field.jsx +215 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js +52 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/date-time.js +132 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/dom.js +71 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js +34 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/key-code.js +10 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/key-line.js +13 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/unique-id.js +7 -0
- data/framework_components/roomcast-package-creator/src/css/font-awesome.min.css +4 -0
- data/framework_components/roomcast-package-creator/src/css/ionicons.min.css +11 -0
- data/framework_components/roomcast-package-creator/src/fonts/FontAwesome.otf +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.eot +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.svg +565 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.ttf +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.woff +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.woff2 +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/ionicons.eot +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/ionicons.svg +2230 -0
- data/framework_components/roomcast-package-creator/src/fonts/ionicons.ttf +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/ionicons.woff +0 -0
- data/framework_components/roomcast-package-creator/src/less/drop-down-icon.less +43 -0
- data/framework_components/roomcast-package-creator/src/less/drop-down-menu.less +77 -0
- data/framework_components/roomcast-package-creator/src/less/enhanced-textarea.less +16 -0
- data/framework_components/roomcast-package-creator/src/less/main.less +491 -0
- data/framework_components/roomcast-package-creator/src/less/menu-item.less +69 -0
- data/framework_components/roomcast-package-creator/src/less/menu.less +50 -0
- data/framework_components/roomcast-package-creator/src/less/my_overrides.less +15 -0
- data/framework_components/roomcast-package-creator/src/less/svg-icon.less +11 -0
- data/framework_components/roomcast-package-creator/src/less/text-field.less +168 -0
- data/lib/commands/checkup.rb +1 -1
- data/nutella_lib/framework_net.rb +0 -1
- metadata +173 -4
@@ -0,0 +1,113 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Classable = require('../../../../node_modules/material-ui/src/js/mixins/classable');
|
3
|
+
|
4
|
+
var EnhancedTextarea = React.createClass({
|
5
|
+
|
6
|
+
mixins: [Classable],
|
7
|
+
|
8
|
+
propTypes: {
|
9
|
+
onChange: React.PropTypes.func,
|
10
|
+
onHeightChange: React.PropTypes.func,
|
11
|
+
textareaClassName: React.PropTypes.string,
|
12
|
+
rows: React.PropTypes.number
|
13
|
+
},
|
14
|
+
|
15
|
+
getDefaultProps: function() {
|
16
|
+
return {
|
17
|
+
rows: 1
|
18
|
+
};
|
19
|
+
},
|
20
|
+
|
21
|
+
getInitialState: function() {
|
22
|
+
return {
|
23
|
+
height: this.props.rows * 24
|
24
|
+
};
|
25
|
+
},
|
26
|
+
|
27
|
+
componentDidMount: function() {
|
28
|
+
this._syncHeightWithShadow();
|
29
|
+
},
|
30
|
+
|
31
|
+
render: function() {
|
32
|
+
|
33
|
+
var {
|
34
|
+
className,
|
35
|
+
onChange,
|
36
|
+
onHeightChange,
|
37
|
+
textareaClassName,
|
38
|
+
rows,
|
39
|
+
valueLink,
|
40
|
+
...other,
|
41
|
+
} = this.props;
|
42
|
+
|
43
|
+
var classes = this.getClasses('mui-enhanced-textarea');
|
44
|
+
var textareaClassName = 'mui-enhanced-textarea-input';
|
45
|
+
var style = {
|
46
|
+
height: this.state.height + 'px'
|
47
|
+
};
|
48
|
+
|
49
|
+
if (this.props.textareaClassName) {
|
50
|
+
textareaClassName += ' ' + this.props.textareaClassName;
|
51
|
+
}
|
52
|
+
|
53
|
+
if (this.props.hasOwnProperty('valueLink')) {
|
54
|
+
other.value = this.props.valueLink.value;
|
55
|
+
}
|
56
|
+
|
57
|
+
return (
|
58
|
+
<div className={classes}>
|
59
|
+
<textarea
|
60
|
+
ref="shadow"
|
61
|
+
className="mui-enhanced-textarea-shadow"
|
62
|
+
tabIndex="-1"
|
63
|
+
rows={this.props.rows}
|
64
|
+
defaultValue={this.props.defaultValue}
|
65
|
+
readOnly={true}
|
66
|
+
value={this.props.value} />
|
67
|
+
<textarea
|
68
|
+
{...other}
|
69
|
+
ref="input"
|
70
|
+
className={textareaClassName}
|
71
|
+
rows={this.props.rows}
|
72
|
+
style={style}
|
73
|
+
onChange={this._handleChange} />
|
74
|
+
</div>
|
75
|
+
);
|
76
|
+
},
|
77
|
+
|
78
|
+
getInputNode: function() {
|
79
|
+
return this.refs.input.getDOMNode();
|
80
|
+
},
|
81
|
+
|
82
|
+
_syncHeightWithShadow: function(newValue, e) {
|
83
|
+
var shadow = this.refs.shadow.getDOMNode();
|
84
|
+
var currentHeight = this.state.height;
|
85
|
+
var newHeight;
|
86
|
+
|
87
|
+
if (newValue !== undefined) shadow.value = newValue;
|
88
|
+
newHeight = shadow.scrollHeight;
|
89
|
+
|
90
|
+
if (currentHeight !== newHeight) {
|
91
|
+
this.setState({height: newHeight});
|
92
|
+
if (this.props.onHeightChange) this.props.onHeightChange(e, newHeight);
|
93
|
+
}
|
94
|
+
},
|
95
|
+
|
96
|
+
_handleChange: function(e) {
|
97
|
+
this._syncHeightWithShadow(e.target.value);
|
98
|
+
|
99
|
+
if (this.props.hasOwnProperty('valueLink')) {
|
100
|
+
this.props.valueLink.requestChange(e.target.value);
|
101
|
+
}
|
102
|
+
|
103
|
+
if (this.props.onChange) this.props.onChange(e);
|
104
|
+
},
|
105
|
+
|
106
|
+
componentWillReceiveProps: function(nextProps) {
|
107
|
+
if (nextProps.value != this.props.value) {
|
108
|
+
this._syncHeightWithShadow(nextProps.value);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
});
|
112
|
+
|
113
|
+
module.exports = EnhancedTextarea;
|
@@ -0,0 +1,73 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var CssEvent = require('../../../../node_modules/material-ui/src/js/utils/css-event.js');
|
3
|
+
var Classable = require('../../../../node_modules/material-ui/src/js/mixins/classable.js');
|
4
|
+
var EnhancedButton = require('../../../../node_modules/material-ui/src/js/enhanced-button.jsx');
|
5
|
+
var Icon = require('../../../../node_modules/material-ui/src/js/icon.jsx');
|
6
|
+
var Paper = require('../../../../node_modules/material-ui/src/js/paper.jsx');
|
7
|
+
var Ripple = require('../../../../node_modules/material-ui/src/js/ripple.jsx');
|
8
|
+
|
9
|
+
var FloatingActionButton_ = React.createClass({
|
10
|
+
|
11
|
+
mixins: [Classable],
|
12
|
+
|
13
|
+
propTypes: {
|
14
|
+
className: React.PropTypes.string,
|
15
|
+
icon: React.PropTypes.string.isRequired,
|
16
|
+
mini: React.PropTypes.bool,
|
17
|
+
onTouchTap: React.PropTypes.func,
|
18
|
+
secondary: React.PropTypes.bool
|
19
|
+
},
|
20
|
+
|
21
|
+
getInitialState: function() {
|
22
|
+
var zDepth = 1;
|
23
|
+
return {
|
24
|
+
zDepth: zDepth,
|
25
|
+
initialZDepth: zDepth
|
26
|
+
};
|
27
|
+
},
|
28
|
+
|
29
|
+
render: function() {
|
30
|
+
var {
|
31
|
+
className,
|
32
|
+
icon,
|
33
|
+
mini,
|
34
|
+
onTouchTap,
|
35
|
+
...other } = this.props,
|
36
|
+
classes = this.getClasses('mui-floating-action-button', {
|
37
|
+
'mui-is-mini': this.props.mini,
|
38
|
+
'mui-is-secondary': this.props.secondary
|
39
|
+
});
|
40
|
+
|
41
|
+
return (
|
42
|
+
<Paper className={classes} innerClassName="mui-floating-action-button-inner" zDepth={this.state.zDepth} circle={true}>
|
43
|
+
<EnhancedButton
|
44
|
+
{...other}
|
45
|
+
className="mui-floating-action-button-container"
|
46
|
+
onTouchTap={this._onTouchTap}>
|
47
|
+
|
48
|
+
|
49
|
+
<Ripple className="mui-floating-action-button-focus-ripple" />
|
50
|
+
<Icon className="mui-floating-action-button-icon" icon={this.props.icon} />
|
51
|
+
|
52
|
+
</EnhancedButton>
|
53
|
+
<Ripple ref="ripple" className="mui-floating-action-button-ripple" />
|
54
|
+
</Paper>
|
55
|
+
);
|
56
|
+
},
|
57
|
+
|
58
|
+
_onTouchTap: function(e) {
|
59
|
+
if (!this.props.disabled) this._animateButtonClick(e);
|
60
|
+
if (this.props.onTouchTap) this.props.onTouchTap(e);
|
61
|
+
},
|
62
|
+
|
63
|
+
_animateButtonClick: function(e) {
|
64
|
+
var el = this.getDOMNode();
|
65
|
+
|
66
|
+
//animate the ripple
|
67
|
+
this.refs.ripple.animateFromCenter();
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
});
|
72
|
+
|
73
|
+
module.exports = FloatingActionButton_;
|
data/framework_components/roomcast-package-creator/src/app/components/material-ui/menu-item.jsx
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
|
3
|
+
var MenuItem = React.createClass({
|
4
|
+
|
5
|
+
propTypes: {
|
6
|
+
index: React.PropTypes.number.isRequired,
|
7
|
+
iconClassName: React.PropTypes.string,
|
8
|
+
iconRightClassName: React.PropTypes.string,
|
9
|
+
attribute: React.PropTypes.string,
|
10
|
+
number: React.PropTypes.string,
|
11
|
+
data: React.PropTypes.string,
|
12
|
+
toggle: React.PropTypes.bool,
|
13
|
+
onTouchTap: React.PropTypes.func,
|
14
|
+
onClick: React.PropTypes.func,
|
15
|
+
onToggle: React.PropTypes.func,
|
16
|
+
selected: React.PropTypes.bool
|
17
|
+
},
|
18
|
+
|
19
|
+
getDefaultProps: function() {
|
20
|
+
return {
|
21
|
+
toggle: false
|
22
|
+
};
|
23
|
+
},
|
24
|
+
|
25
|
+
render: function() {
|
26
|
+
var classes = 'mui-menu-item';
|
27
|
+
if(this.props.selected) {
|
28
|
+
classes += ' mui-is-selected';
|
29
|
+
}
|
30
|
+
if(this.props.currentSelected) {
|
31
|
+
classes += ' mui-is-current-selected';
|
32
|
+
}
|
33
|
+
|
34
|
+
var icon;
|
35
|
+
var data;
|
36
|
+
var iconRight;
|
37
|
+
var attribute;
|
38
|
+
var number;
|
39
|
+
|
40
|
+
if (this.props.iconClassName) icon = <FontIcon className={'mui-menu-item-icon ' + this.props.iconClassName} />;
|
41
|
+
if (this.props.iconRightClassName) iconRight = <FontIcon className={'mui-menu-item-icon-right ' + this.props.iconRightClassName} />;
|
42
|
+
if (this.props.data) data = <span className="mui-menu-item-data">{this.props.data}</span>;
|
43
|
+
if (this.props.number !== undefined) number = <span className="mui-menu-item-number">{this.props.number}</span>;
|
44
|
+
if (this.props.attribute !== undefined) attribute = <span className="mui-menu-item-attribute">{this.props.attribute}</span>;
|
45
|
+
|
46
|
+
var useIcon;
|
47
|
+
var deleteIcon;
|
48
|
+
|
49
|
+
var hiddenStyle = {
|
50
|
+
color: 'transparent',
|
51
|
+
cursor: 'default'
|
52
|
+
};
|
53
|
+
|
54
|
+
if(!this.props.lastConfig && !this.props.lastItem) {
|
55
|
+
useIcon = <div className='check-config-icon' onTouchTap={this.handleChangeConfig} > <i className="fa fa-check"></i> </div>;
|
56
|
+
deleteIcon = <div className='delete-config-icon'> <i className="fa fa-times" onTouchTap={this.handleDeleteConfig}></i> </div>;
|
57
|
+
}
|
58
|
+
if(this.props.lastConfig && !this.props.lastItem) {
|
59
|
+
useIcon = <div className='check-config-icon' onTouchTap={this.handleChangeConfig} > <i className="fa fa-check"></i> </div>
|
60
|
+
deleteIcon = <div className='delete-config-icon' style={hiddenStyle} > <i className="fa fa-times" style={hiddenStyle} ></i> </div>;
|
61
|
+
}
|
62
|
+
if(this.props.lastItem) {
|
63
|
+
useIcon = <div className='check-config-icon' onTouchTap={this.handleAddEmptyConfig} > <i className="fa fa-check"></i> </div>
|
64
|
+
deleteIcon = <div className='delete-config-icon' style={hiddenStyle} > <i className="fa fa-times" style={hiddenStyle} ></i> </div>;
|
65
|
+
}
|
66
|
+
|
67
|
+
return (
|
68
|
+
<div
|
69
|
+
key={this.props.index}
|
70
|
+
className={classes} >
|
71
|
+
|
72
|
+
{icon}
|
73
|
+
{this.props.children}
|
74
|
+
{data}
|
75
|
+
{attribute}
|
76
|
+
{number}
|
77
|
+
{iconRight}
|
78
|
+
|
79
|
+
{deleteIcon}
|
80
|
+
{useIcon}
|
81
|
+
|
82
|
+
</div>
|
83
|
+
);
|
84
|
+
},
|
85
|
+
|
86
|
+
handleChangeConfig: function(e) {
|
87
|
+
if (this.props.onTouchTap) this.props.onTouchTap(e, this.props.index, 'change');
|
88
|
+
},
|
89
|
+
|
90
|
+
handleDeleteConfig: function(e) {
|
91
|
+
if (this.props.onTouchTap) this.props.onTouchTap(e, this.props.index, 'delete');
|
92
|
+
},
|
93
|
+
|
94
|
+
handleAddEmptyConfig: function(e) {
|
95
|
+
if (this.props.onTouchTap) this.props.onTouchTap(e, this.props.index, 'add');
|
96
|
+
}
|
97
|
+
|
98
|
+
});
|
99
|
+
|
100
|
+
module.exports = MenuItem;
|
@@ -0,0 +1,209 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = require('material-ui');
|
3
|
+
var Paper = Mui.Paper;
|
4
|
+
var Dom = require('../../../../node_modules/material-ui/src/js/utils/dom');
|
5
|
+
var KeyLine = require('../../../../node_modules/material-ui/src/js/utils/key-line');
|
6
|
+
var MenuItem = require('./menu-item.jsx');
|
7
|
+
var ConfigField = require('../ConfigField');
|
8
|
+
|
9
|
+
var Menu = React.createClass({
|
10
|
+
|
11
|
+
propTypes: {
|
12
|
+
autoWidth: React.PropTypes.bool,
|
13
|
+
onItemTap: React.PropTypes.func,
|
14
|
+
onItemClick: React.PropTypes.func,
|
15
|
+
onToggleClick: React.PropTypes.func,
|
16
|
+
menuItems: React.PropTypes.array.isRequired,
|
17
|
+
selectedIndex: React.PropTypes.number,
|
18
|
+
hideable: React.PropTypes.bool,
|
19
|
+
visible: React.PropTypes.bool,
|
20
|
+
zDepth: React.PropTypes.number
|
21
|
+
},
|
22
|
+
|
23
|
+
getInitialState: function() {
|
24
|
+
return { hasToUpdateValues: false }
|
25
|
+
},
|
26
|
+
|
27
|
+
getDefaultProps: function() {
|
28
|
+
return {
|
29
|
+
autoWidth: true,
|
30
|
+
hideable: false,
|
31
|
+
visible: true,
|
32
|
+
zDepth: 1
|
33
|
+
};
|
34
|
+
},
|
35
|
+
|
36
|
+
componentDidMount: function() {
|
37
|
+
var el = this.getDOMNode();
|
38
|
+
|
39
|
+
//Set the menu with
|
40
|
+
//this._setKeyWidth(el);
|
41
|
+
var menuWidth = document.getElementsByClassName('resources-panel')[0].offsetWidth / 2.4;
|
42
|
+
//Update the menu width
|
43
|
+
el.style.width = menuWidth + 'px';
|
44
|
+
|
45
|
+
//Save the initial menu height and item height for later
|
46
|
+
this._initialMenuHeight = el.offsetHeight + KeyLine.Desktop.GUTTER_LESS;
|
47
|
+
this._itemHeight = el.offsetHeight / (this.props.menuItems.length);
|
48
|
+
|
49
|
+
//Show or Hide the menu according to visibility
|
50
|
+
this._renderVisibility();
|
51
|
+
},
|
52
|
+
|
53
|
+
componentDidUpdate: function(prevProps, prevState) {
|
54
|
+
this.updateHeight(this.props.menuItems.length);
|
55
|
+
if (this.props.visible !== prevProps.visible) this._renderVisibility();
|
56
|
+
},
|
57
|
+
|
58
|
+
updateHeight: function(numItems) {
|
59
|
+
if(this.props.visible) {
|
60
|
+
|
61
|
+
// Compute new height
|
62
|
+
this._initialMenuHeight = this._itemHeight * numItems + KeyLine.Desktop.GUTTER_LESS;
|
63
|
+
|
64
|
+
// Update menu height
|
65
|
+
this.getDOMNode().style.height = this._initialMenuHeight + 'px';
|
66
|
+
|
67
|
+
}
|
68
|
+
},
|
69
|
+
|
70
|
+
render: function() {
|
71
|
+
|
72
|
+
var classes = 'mui-menu';
|
73
|
+
if(this.props.hideable) {
|
74
|
+
classes += ' mui-menu-hideable';
|
75
|
+
}
|
76
|
+
if(this.props.visible) {
|
77
|
+
classes += ' mui-visible';
|
78
|
+
}
|
79
|
+
|
80
|
+
return (
|
81
|
+
<Paper ref="paperContainer" zDepth={this.props.zDepth} className={classes}>
|
82
|
+
{this._getChildren()}
|
83
|
+
</Paper>
|
84
|
+
);
|
85
|
+
|
86
|
+
},
|
87
|
+
|
88
|
+
_getChildren: function() {
|
89
|
+
var children = [],
|
90
|
+
menuItem,
|
91
|
+
itemComponent,
|
92
|
+
isSelected;
|
93
|
+
|
94
|
+
for (var i=0; i < this.props.menuItems.length; i++) {
|
95
|
+
menuItem = this.props.menuItems[i];
|
96
|
+
isSelected = i === this.props.selectedIndex;
|
97
|
+
|
98
|
+
var {
|
99
|
+
icon,
|
100
|
+
data,
|
101
|
+
attribute,
|
102
|
+
number,
|
103
|
+
toggle,
|
104
|
+
onClick,
|
105
|
+
...other
|
106
|
+
} = menuItem;
|
107
|
+
|
108
|
+
var menuContent;
|
109
|
+
|
110
|
+
if(this.props.configMenu) {
|
111
|
+
|
112
|
+
var lastItem = i === this.props.menuItems.length - 1;
|
113
|
+
|
114
|
+
menuContent = ( <ConfigField ref={'configField_' + lastItem}
|
115
|
+
placeholder={menuItem.lastSavedName}
|
116
|
+
value={menuItem.text}
|
117
|
+
configId={menuItem.configId}
|
118
|
+
hasToUpdateValues={this.state.hasToUpdateValues}
|
119
|
+
lastItem={lastItem}
|
120
|
+
onUpdatedValues={this.handleUpdatedValues}
|
121
|
+
onChange={this.handleInputChange} /> );
|
122
|
+
|
123
|
+
} else {
|
124
|
+
menuContent = menuItem.text;
|
125
|
+
}
|
126
|
+
|
127
|
+
itemComponent = (
|
128
|
+
<MenuItem
|
129
|
+
{...other}
|
130
|
+
selected={isSelected}
|
131
|
+
key={i}
|
132
|
+
index={i}
|
133
|
+
icon={menuItem.icon}
|
134
|
+
data={menuItem.data}
|
135
|
+
attribute={menuItem.attribute}
|
136
|
+
number={menuItem.number}
|
137
|
+
toggle={menuItem.toggle}
|
138
|
+
onTouchTap={this._onItemTap}
|
139
|
+
lastItem={lastItem}
|
140
|
+
lastConfig={this.props.menuItems.length === 2} >
|
141
|
+
|
142
|
+
{menuContent}
|
143
|
+
|
144
|
+
</MenuItem>
|
145
|
+
);
|
146
|
+
|
147
|
+
children.push(itemComponent);
|
148
|
+
}
|
149
|
+
|
150
|
+
this._numItems = children.length;
|
151
|
+
return children;
|
152
|
+
},
|
153
|
+
|
154
|
+
_setKeyWidth: function(el) {
|
155
|
+
var menuWidth = this.props.autoWidth ?
|
156
|
+
KeyLine.getIncrementalDim(el.offsetWidth) + 'px' :
|
157
|
+
'100%';
|
158
|
+
|
159
|
+
//Update the menu width
|
160
|
+
Dom.withoutTransition(el, function() {
|
161
|
+
el.style.width = menuWidth;
|
162
|
+
});
|
163
|
+
},
|
164
|
+
|
165
|
+
_renderVisibility: function() {
|
166
|
+
var el;
|
167
|
+
|
168
|
+
if (this.props.hideable) {
|
169
|
+
el = this.getDOMNode();
|
170
|
+
var innerContainer = this.refs.paperContainer.getInnerContainer().getDOMNode();
|
171
|
+
|
172
|
+
if (this.props.visible) {
|
173
|
+
|
174
|
+
//Open the menu
|
175
|
+
el.style.height = this._initialMenuHeight + 'px';
|
176
|
+
//This is to account for fast clicks
|
177
|
+
if (this.props.visible) {
|
178
|
+
innerContainer.style.overflow = 'visible';
|
179
|
+
}
|
180
|
+
|
181
|
+
} else {
|
182
|
+
|
183
|
+
//Close the menu
|
184
|
+
el.style.height = '0px';
|
185
|
+
|
186
|
+
//Set the overflow to hidden so that animation works properly
|
187
|
+
innerContainer.style.overflow = 'hidden';
|
188
|
+
}
|
189
|
+
}
|
190
|
+
},
|
191
|
+
|
192
|
+
handleInputChange: function(id, value) {
|
193
|
+
this.props.onInputChange(id, value);
|
194
|
+
},
|
195
|
+
|
196
|
+
_onItemTap: function(e, index, action) {
|
197
|
+
// if(action === 'delete' || action === 'add') {
|
198
|
+
this.setState({hasToUpdateValues: true});
|
199
|
+
// }
|
200
|
+
if (this.props.onItemTap) this.props.onItemTap(e, index, this.props.menuItems[index], action);
|
201
|
+
},
|
202
|
+
|
203
|
+
handleUpdatedValues: function() {
|
204
|
+
this.setState({hasToUpdateValues: false});
|
205
|
+
}
|
206
|
+
|
207
|
+
});
|
208
|
+
|
209
|
+
module.exports = Menu;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
|
3
|
+
var Overlay = React.createClass({
|
4
|
+
|
5
|
+
render: function() {
|
6
|
+
|
7
|
+
var {...other} = this.props;
|
8
|
+
|
9
|
+
var classes = 'mui-overlay';
|
10
|
+
if (this.props.show) {
|
11
|
+
classes += ' mui-is-shown';
|
12
|
+
}
|
13
|
+
|
14
|
+
return (
|
15
|
+
<div {...other} className={classes} />
|
16
|
+
);
|
17
|
+
}
|
18
|
+
|
19
|
+
});
|
20
|
+
|
21
|
+
module.exports = Overlay;
|
data/framework_components/roomcast-package-creator/src/app/components/material-ui/raised-button_.jsx
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = '../../../../node_modules/material-ui/src/js';
|
3
|
+
var CssEvent = require('../../../../node_modules/material-ui/src/js/utils/css-event');
|
4
|
+
var Classable = require('../../../../node_modules/material-ui/src/js/mixins/classable');
|
5
|
+
var EnhancedButton = require('../../../../node_modules/material-ui/src/js/enhanced-button.jsx');
|
6
|
+
var Paper = require('../../../../node_modules/material-ui/src/js/paper.jsx');
|
7
|
+
var Ripple = require('../../../../node_modules/material-ui/src/js/ripple.jsx');
|
8
|
+
|
9
|
+
var RaisedButton_ = React.createClass({
|
10
|
+
|
11
|
+
mixins: [Classable],
|
12
|
+
|
13
|
+
propTypes: {
|
14
|
+
className: React.PropTypes.string,
|
15
|
+
label: React.PropTypes.string.isRequired,
|
16
|
+
onTouchTap: React.PropTypes.func,
|
17
|
+
primary: React.PropTypes.bool,
|
18
|
+
secondary: React.PropTypes.bool
|
19
|
+
},
|
20
|
+
|
21
|
+
getInitialState: function() {
|
22
|
+
var zDepth = 1;
|
23
|
+
return {
|
24
|
+
zDepth: zDepth,
|
25
|
+
initialZDepth: zDepth
|
26
|
+
};
|
27
|
+
},
|
28
|
+
|
29
|
+
render: function() {
|
30
|
+
var {
|
31
|
+
className,
|
32
|
+
onTouchTap,
|
33
|
+
...other } = this.props,
|
34
|
+
classes = this.getClasses('mui-raised-button', {
|
35
|
+
'mui-is-primary': this.props.primary,
|
36
|
+
'mui-is-secondary': !this.props.primary && this.props.secondary,
|
37
|
+
'mui-is-save-button': !this.props.primary && !this.props.secondary && this.props.saveButton,
|
38
|
+
'mui-is-undo-button': !this.props.primary && !this.props.secondary && !this.props.saveButton && this.props.undoButton
|
39
|
+
});
|
40
|
+
|
41
|
+
return (
|
42
|
+
<Paper className={classes} zDepth={this.state.zDepth}>
|
43
|
+
<EnhancedButton
|
44
|
+
{...other}
|
45
|
+
className="mui-raised-button-container"
|
46
|
+
onTouchTap={this._onTouchTap}>
|
47
|
+
|
48
|
+
<Ripple ref="ripple" className="mui-raised-button-ripple" />
|
49
|
+
<Ripple className="mui-raised-button-focus-ripple" />
|
50
|
+
<span className="mui-raised-button-label">{this.props.label}</span>
|
51
|
+
|
52
|
+
</EnhancedButton>
|
53
|
+
</Paper>
|
54
|
+
);
|
55
|
+
},
|
56
|
+
|
57
|
+
_onTouchTap: function(e) {
|
58
|
+
if (!this.props.disabled) this._animateButtonClick(e);
|
59
|
+
if (this.props.onTouchTap) this.props.onTouchTap(e);
|
60
|
+
},
|
61
|
+
|
62
|
+
_animateButtonClick: function(e) {
|
63
|
+
var el = this.getDOMNode();
|
64
|
+
|
65
|
+
//animate the ripple
|
66
|
+
this.refs.ripple.animate(e);
|
67
|
+
|
68
|
+
}
|
69
|
+
|
70
|
+
});
|
71
|
+
|
72
|
+
module.exports = RaisedButton_;
|
data/framework_components/roomcast-package-creator/src/app/components/material-ui/right-nav.jsx
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
var React = require('react'),
|
2
|
+
Overlay = require('./overlay.jsx'),
|
3
|
+
Mui = require('material-ui'),
|
4
|
+
Paper = Mui.Paper,
|
5
|
+
Menu = require('./menu.jsx');
|
6
|
+
|
7
|
+
var RightNav = React.createClass({
|
8
|
+
|
9
|
+
propTypes: {
|
10
|
+
docked: React.PropTypes.bool,
|
11
|
+
header: React.PropTypes.element,
|
12
|
+
onChange: React.PropTypes.func,
|
13
|
+
menuItems: React.PropTypes.array.isRequired,
|
14
|
+
selectedIndex: React.PropTypes.number
|
15
|
+
},
|
16
|
+
|
17
|
+
getDefaultProps: function() {
|
18
|
+
return {
|
19
|
+
docked: true
|
20
|
+
};
|
21
|
+
},
|
22
|
+
|
23
|
+
getInitialState: function() {
|
24
|
+
return {
|
25
|
+
open: this.props.docked,
|
26
|
+
modal: false
|
27
|
+
};
|
28
|
+
},
|
29
|
+
|
30
|
+
toggle: function() {
|
31
|
+
this.setState({ open: !this.state.open });
|
32
|
+
return this;
|
33
|
+
},
|
34
|
+
|
35
|
+
close: function() {
|
36
|
+
this.setState({ open: false });
|
37
|
+
return this;
|
38
|
+
},
|
39
|
+
|
40
|
+
open: function() {
|
41
|
+
this.setState({ open: true });
|
42
|
+
return this;
|
43
|
+
},
|
44
|
+
|
45
|
+
render: function() {
|
46
|
+
var classes = 'mui-right-nav';
|
47
|
+
if (!this.state.open) {
|
48
|
+
classes += ' mui-closed';
|
49
|
+
}
|
50
|
+
var selectedIndex = this.props.selectedIndex;
|
51
|
+
var overlay;
|
52
|
+
|
53
|
+
if (!this.props.docked) overlay = <Overlay show={this.state.open} onTouchTap={this._onOverlayTouchTap} />;
|
54
|
+
if (this.state.modal) overlay = <Overlay show={this.state.open} onTouchTap={this._onOverlayBlockTouchTap} />;
|
55
|
+
|
56
|
+
return (
|
57
|
+
<div className={classes}>
|
58
|
+
|
59
|
+
{overlay}
|
60
|
+
<Paper
|
61
|
+
ref="clickAwayableElement"
|
62
|
+
className="mui-right-nav-menu"
|
63
|
+
zDepth={2}
|
64
|
+
rounded={false}>
|
65
|
+
|
66
|
+
{this.props.header}
|
67
|
+
<Menu
|
68
|
+
ref="menuItems"
|
69
|
+
zDepth={0}
|
70
|
+
menuItems={this.props.menuItems}
|
71
|
+
selectedIndex={selectedIndex}
|
72
|
+
onItemClick={this._onMenuItemClick}
|
73
|
+
onItemTap={this.handleItemTap}
|
74
|
+
onLogout={this.handleLogout}
|
75
|
+
canLogout={this.props.canLogout} />
|
76
|
+
|
77
|
+
</Paper>
|
78
|
+
</div>
|
79
|
+
);
|
80
|
+
},
|
81
|
+
|
82
|
+
handleLogout: function() {
|
83
|
+
if (!this.props.docked) this.close();
|
84
|
+
this.props.onLogout();
|
85
|
+
},
|
86
|
+
|
87
|
+
_onMenuItemClick: function(e, key, payload) {
|
88
|
+
if (!this.props.docked) this.close();
|
89
|
+
if (this.props.onChange && this.props.selectedIndex !== key) {
|
90
|
+
this.props.onChange(e, key, payload);
|
91
|
+
}
|
92
|
+
},
|
93
|
+
|
94
|
+
_onOverlayTouchTap: function() {
|
95
|
+
this.close();
|
96
|
+
},
|
97
|
+
|
98
|
+
_onOverlayBlockTouchTap: function() {
|
99
|
+
// do nothing
|
100
|
+
},
|
101
|
+
|
102
|
+
handleItemTap: function(e, index, menuItem) {
|
103
|
+
this.props.onItemTap(menuItem);
|
104
|
+
}
|
105
|
+
|
106
|
+
});
|
107
|
+
|
108
|
+
module.exports = RightNav;
|