hippo-fw 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.nvmrc +2 -0
- data/.travis.yml +1 -1
- data/client/hippo/access/login-dialog.jsx +3 -5
- data/client/hippo/boot.jsx +2 -2
- data/client/hippo/components/asset.jsx +0 -1
- data/client/hippo/components/data-list.jsx +16 -15
- data/client/hippo/components/data-list/data-list.scss +10 -0
- data/client/hippo/components/data-table.jsx +14 -14
- data/client/hippo/components/data-table/header-cell.jsx +0 -1
- data/client/hippo/components/data-table/table-styles.scss +7 -0
- data/client/hippo/components/date-time.jsx +19 -16
- data/client/hippo/components/date-time/calendar.jsx +5 -7
- data/client/hippo/components/date-time/date-time-drop.jsx +0 -2
- data/client/hippo/components/date-time/time.jsx +0 -1
- data/client/hippo/components/form.jsx +1 -1
- data/client/hippo/components/form/{model.js → api.js} +25 -7
- data/client/hippo/components/form/fields.jsx +12 -11
- data/client/hippo/components/form/fields/date-wrapper.jsx +1 -1
- data/client/hippo/components/form/fields/form-field.scss +9 -1
- data/client/hippo/components/form/fields/label.jsx +14 -0
- data/client/hippo/components/form/fields/select-wrapper.jsx +2 -3
- data/client/hippo/components/form/wrapper.jsx +1 -3
- data/client/hippo/components/icon.jsx +2 -69
- data/client/hippo/components/master-detail.jsx +0 -2
- data/client/hippo/components/network-activity-overlay.jsx +1 -4
- data/client/hippo/components/query-builder.jsx +15 -16
- data/client/hippo/components/record-finder.jsx +2 -5
- data/client/hippo/components/record-finder/query-layer.jsx +1 -5
- data/client/hippo/components/screen.jsx +7 -3
- data/client/hippo/components/text-editor.jsx +2 -8
- data/client/hippo/components/tool-tip.jsx +2 -3
- data/client/hippo/components/warning-notification.jsx +3 -3
- data/client/hippo/lib/date-range.js +28 -0
- data/client/hippo/lib/util.js +6 -0
- data/client/hippo/models/asset.js +6 -3
- data/client/hippo/models/config.js +1 -1
- data/client/hippo/models/pub_sub.js +12 -7
- data/client/hippo/models/pub_sub/channel.js +6 -4
- data/client/hippo/models/query.js +19 -4
- data/client/hippo/models/query/array-result.js +9 -8
- data/client/hippo/models/query/clause.js +21 -13
- data/client/hippo/models/query/field.js +7 -2
- data/client/hippo/models/query/info.js +7 -3
- data/client/hippo/models/sync.js +11 -14
- data/client/hippo/react/Root.jsx +1 -2
- data/client/hippo/react/{DefaultComponentNotFound.jsx → component-not-found.jsx} +1 -3
- data/client/hippo/screens/index.js +6 -2
- data/client/hippo/screens/system-settings.jsx +10 -6
- data/client/hippo/screens/system-settings/mailer-config.jsx +0 -2
- data/client/hippo/screens/system-settings/tenant.jsx +1 -4
- data/client/hippo/screens/user-management.jsx +0 -1
- data/client/hippo/screens/user-management/edit-form.jsx +1 -2
- data/client/hippo/workspace/index.jsx +21 -12
- data/client/hippo/workspace/menu-group.jsx +4 -7
- data/client/hippo/workspace/menu-option.jsx +1 -3
- data/client/hippo/workspace/menu.jsx +29 -11
- data/client/hippo/workspace/navbar.jsx +1 -2
- data/client/hippo/workspace/root-view.jsx +5 -2
- data/client/hippo/workspace/screen.jsx +2 -3
- data/client/hippo/workspace/styles.scss +17 -0
- data/command-reference-files/screen/client/appy-app/screens/ready-set-go.jsx +2 -1
- data/db/migrate/20170530120004_create_users.rb +1 -1
- data/hippo-fw.gemspec +3 -2
- data/lib/hippo/api/cable.rb +13 -13
- data/lib/hippo/api/controller_base.rb +1 -0
- data/lib/hippo/api/handlers/tenant.rb +1 -1
- data/lib/hippo/api/handlers/user_session.rb +2 -1
- data/lib/hippo/api/helper_methods.rb +4 -1
- data/lib/hippo/api/pub_sub.rb +7 -6
- data/lib/hippo/api/to_json.rb +1 -1
- data/lib/hippo/api/updates.rb +2 -0
- data/lib/hippo/command/console.rb +11 -3
- data/lib/hippo/command/jest.rb +2 -0
- data/lib/hippo/configuration.rb +4 -7
- data/lib/hippo/rake_tasks.rb +1 -1
- data/lib/hippo/screen.rb +31 -93
- data/lib/hippo/screen/definition.rb +76 -0
- data/lib/hippo/screen/group.rb +26 -0
- data/lib/hippo/spec_helper.rb +3 -0
- data/lib/hippo/system_settings.rb +6 -0
- data/lib/hippo/user.rb +11 -3
- data/lib/hippo/version.rb +1 -1
- data/package-lock.json +419 -533
- data/package.json +32 -30
- data/spec/client/access/login-dialog.spec.jsx +4 -5
- data/spec/client/components/__snapshots__/query-builder.spec.jsx.snap +1 -1
- data/spec/client/components/__snapshots__/record-finder.spec.jsx.snap +72 -0
- data/spec/client/components/asset.spec.jsx +2 -6
- data/spec/client/components/data-list.spec.jsx +2 -6
- data/spec/client/components/data-table.spec.jsx +3 -5
- data/spec/client/components/date-time.spec.jsx +1 -1
- data/spec/client/components/form.spec.jsx +2 -2
- data/spec/client/components/master-detail.spec.jsx +1 -2
- data/spec/client/components/network-activity-overlay.spec.jsx +2 -3
- data/spec/client/components/query-builder.spec.jsx +3 -6
- data/spec/client/components/record-finder.spec.jsx +4 -4
- data/spec/client/models/pub_sub.spec.js +3 -1
- data/spec/client/models/query.spec.js +4 -9
- data/spec/client/screens/system-settings-tenants.spec.jsx +1 -1
- data/spec/client/screens/system-settings.spec.jsx +1 -4
- data/spec/client/workspace/__snapshots__/menu.spec.jsx.snap +15 -20
- data/spec/client/workspace/menu.spec.jsx +1 -2
- data/spec/server/api/user_sessions_spec.rb +15 -0
- data/templates/client/screens/screen.jsx +2 -1
- data/views/hippo_root_view.erb +1 -0
- metadata +30 -52
- data/client/hippo/components/calendar/Calendar.jsx +0 -25
- data/client/hippo/components/calendar/index.js +0 -3
- data/client/hippo/components/calendar/styles.scss +0 -3
- data/client/hippo/components/shared/AssetsListing.jsx +0 -23
- data/client/hippo/components/shared/Checkbox.jsx +0 -49
- data/client/hippo/components/shared/CountBadge.jsx +0 -13
- data/client/hippo/components/shared/DateTime.jsx +0 -58
- data/client/hippo/components/shared/DisplayValue.jsx +0 -15
- data/client/hippo/components/shared/ErrorDisplay.jsx +0 -37
- data/client/hippo/components/shared/FieldMixin.jsx +0 -254
- data/client/hippo/components/shared/FieldSet.jsx +0 -52
- data/client/hippo/components/shared/FieldWrapper.jsx +0 -94
- data/client/hippo/components/shared/FormGroup.jsx +0 -41
- data/client/hippo/components/shared/GenericField.jsx +0 -7
- data/client/hippo/components/shared/IconButton.jsx +0 -13
- data/client/hippo/components/shared/ImageAsset.jsx +0 -78
- data/client/hippo/components/shared/IndeterminateCheckbox.jsx +0 -31
- data/client/hippo/components/shared/Input.jsx +0 -16
- data/client/hippo/components/shared/InputFieldMixin.jsx +0 -78
- data/client/hippo/components/shared/JobProgress.jsx +0 -46
- data/client/hippo/components/shared/NumberInput.jsx +0 -37
- data/client/hippo/components/shared/PanelHeader.jsx +0 -15
- data/client/hippo/components/shared/RadioField.jsx +0 -33
- data/client/hippo/components/shared/ResizeSensor.jsx +0 -18
- data/client/hippo/components/shared/ScreenWrapper.jsx +0 -17
- data/client/hippo/components/shared/TextArea.jsx +0 -19
- data/client/hippo/components/shared/Throbber.jsx +0 -8
- data/client/hippo/components/shared/ToggleField.jsx +0 -2
- data/client/hippo/components/shared/Tooltip.jsx +0 -23
- data/client/hippo/components/shared/fields.scss +0 -58
- data/client/hippo/components/shared/fieldset.scss +0 -27
- data/client/hippo/components/shared/image-asset.scss +0 -53
- data/client/hippo/components/shared/index.js +0 -5
- data/client/hippo/components/shared/overlay.scss +0 -83
- data/client/hippo/components/shared/resize-sensor.scss +0 -30
- data/client/hippo/components/shared/styles.scss +0 -64
- data/client/hippo/components/shared/throbber.scss +0 -53
- data/client/hippo/fonts/fontawesome-webfont.woff +0 -0
- data/client/hippo/fonts/fontawesome-webfont.woff2 +0 -0
- data/client/hippo/workspace/content.jsx +0 -22
- data/client/hippo/workspace/tabs.jsx +0 -60
- data/client/hippo/workspace/viewport.jsx +0 -82
- data/spec/client/screens/__snapshots__/tabs.spec.jsx.snap +0 -127
- data/spec/client/screens/tabs.spec.jsx +0 -36
@@ -1,41 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export class FormGroup extends React.Component {
|
4
|
-
static mixins = [
|
5
|
-
Hippo.React.Mixins.ReadEditingState,
|
6
|
-
Hippo.React.Mixins.FieldErrors
|
7
|
-
];
|
8
|
-
|
9
|
-
static propTypes = {
|
10
|
-
align: React.PropTypes.oneOf([
|
11
|
-
'right', 'left', 'center'
|
12
|
-
])
|
13
|
-
};
|
14
|
-
bindEvents() {
|
15
|
-
return (
|
16
|
-
{model: `invalid-fields invalid-field:${this.getInvalidFieldName()}`}
|
17
|
-
);
|
18
|
-
}
|
19
|
-
|
20
|
-
render() {
|
21
|
-
var export className = _.classnames(className, this.props.className, "hippo-field",{
|
22
|
-
editing: this.props.editing,
|
23
|
-
[`align-${this.props.align}`]: this.props.align,
|
24
|
-
display: false === this.props.editing,
|
25
|
-
'has-error': this.isFieldValueInvalid()
|
26
|
-
}
|
27
|
-
);
|
28
|
-
const colProps = _.omit(this.props, 'name', 'label', 'type', 'editing', 'display');
|
29
|
-
const valueClassNames = _.export classnames('value', {
|
30
|
-
[`align-${this.props.align}`]: this.props.align
|
31
|
-
});
|
32
|
-
return (
|
33
|
-
React.createElement(BS.Col, Object.assign({}, colProps, {"export className": (className)}),
|
34
|
-
React.createElement(BS.FormGroup, {"export className": (valueClassNames)},
|
35
|
-
React.createElement(BS.ControlLabel, null, (this.props.label)),
|
36
|
-
(this.props.children)
|
37
|
-
)
|
38
|
-
)
|
39
|
-
);
|
40
|
-
}
|
41
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export class IconButton extends BaseComponent {
|
4
|
-
render() {
|
5
|
-
const buttonProps = _.omit(this.props, 'icon', 'iconProps');
|
6
|
-
buttonProps.export className = _.classnames(buttonProps.className, 'flush');
|
7
|
-
return (
|
8
|
-
React.createElement(BS.Button, Object.assign({}, buttonProps),
|
9
|
-
React.createElement(LC.Icon, Object.assign({"type": (this.props.icon), "lg": true}, this.props.iconProps ))
|
10
|
-
)
|
11
|
-
);
|
12
|
-
}
|
13
|
-
}
|
@@ -1,78 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export class ImageAsset extends React.Component {
|
4
|
-
static propTypes = {
|
5
|
-
asset: Hippo.PropTypes.Model.isRequired,
|
6
|
-
label: React.PropTypes.string,
|
7
|
-
size: React.PropTypes.oneOf([
|
8
|
-
'thumb', 'medium', 'original'
|
9
|
-
]).isRequired
|
10
|
-
};
|
11
|
-
|
12
|
-
static modelBindings =
|
13
|
-
{asset: 'props'};
|
14
|
-
|
15
|
-
static listenNetworkEvents = true;
|
16
|
-
|
17
|
-
static mixins = [
|
18
|
-
Hippo.React.Mixins.ReadEditingState
|
19
|
-
];
|
20
|
-
handleImageChange(ev) {
|
21
|
-
ev.preventDefault();
|
22
|
-
return (
|
23
|
-
this.asset.blob = ev.target.files[0]
|
24
|
-
);
|
25
|
-
}
|
26
|
-
|
27
|
-
renderImage() {
|
28
|
-
return (
|
29
|
-
React.createElement("img", {"export className": "preview", "src": (this.asset.thumbnail_url)})
|
30
|
-
);
|
31
|
-
}
|
32
|
-
|
33
|
-
blankImage() {
|
34
|
-
return (
|
35
|
-
null
|
36
|
-
);
|
37
|
-
}
|
38
|
-
|
39
|
-
Label() {
|
40
|
-
if (!this.props.label) { return null; }
|
41
|
-
return (
|
42
|
-
React.createElement("label", null, (this.props.label))
|
43
|
-
);
|
44
|
-
}
|
45
|
-
|
46
|
-
Edit() {
|
47
|
-
if (!this.isEditingRecord()) { return null; }
|
48
|
-
return (
|
49
|
-
React.createElement("form", null,
|
50
|
-
React.createElement("label", {"export className": "selector"},
|
51
|
-
React.createElement("span", null,
|
52
|
-
(this.asset.isPresent ? 'Change' : 'Add')
|
53
|
-
),
|
54
|
-
React.createElement("input", {"id": 'file', "export className": "file", "type": "file",
|
55
|
-
"onChange": (this.handleImageChange)})
|
56
|
-
)
|
57
|
-
)
|
58
|
-
);
|
59
|
-
}
|
60
|
-
|
61
|
-
render() {
|
62
|
-
const Component = this.asset.hasImage ? this.renderImage : this.blankImage;
|
63
|
-
|
64
|
-
const export className = _.classnames('image-asset', this.props.className, {
|
65
|
-
'with-image': this.asset.hasImage
|
66
|
-
});
|
67
|
-
return (
|
68
|
-
React.createElement(BS.Col, Object.assign({},
|
69
|
-
Hippo.u.bsSizes(this.props), {
|
70
|
-
"export className": (className)
|
71
|
-
}),
|
72
|
-
React.createElement(this.Label, null),
|
73
|
-
React.createElement(Component, null),
|
74
|
-
React.createElement(this.Edit, null)
|
75
|
-
)
|
76
|
-
);
|
77
|
-
}
|
78
|
-
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export default class IndeterminateCheckbox extends React.Component {
|
4
|
-
componentDidMount() { return this.updateIndeterminate(); }
|
5
|
-
componentDidUpdate() { return this.updateIndeterminate(); }
|
6
|
-
|
7
|
-
updateIndeterminate() {
|
8
|
-
return (
|
9
|
-
_.dom(this).el.indeterminate =
|
10
|
-
(this.props.checked !== true) && (this.props.checked !== false)
|
11
|
-
);
|
12
|
-
}
|
13
|
-
|
14
|
-
handleCheckboxChange(ev) {
|
15
|
-
if (ev.target.checked) {
|
16
|
-
return (
|
17
|
-
this.fieldMixinSetValue( new FakeInputEvent(this.props.value) )
|
18
|
-
);
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
|
-
render() {
|
23
|
-
return (
|
24
|
-
<input
|
25
|
-
type="checkbox"
|
26
|
-
{...this.props}
|
27
|
-
checked={this.props.checked}
|
28
|
-
onChange={this.props.onChange} />
|
29
|
-
);
|
30
|
-
}
|
31
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export default class Input extends React.Component {
|
4
|
-
static mixins = [
|
5
|
-
Hippo.Components.Form.InputFieldMixin
|
6
|
-
];
|
7
|
-
renderInputField(props, handlers) {
|
8
|
-
return (
|
9
|
-
<BS.FormControl
|
10
|
-
type={this.props.type || 'text'}
|
11
|
-
{...props}
|
12
|
-
{...handlers}
|
13
|
-
onChange={this.fieldMixinSetValue} />
|
14
|
-
);
|
15
|
-
}
|
16
|
-
}
|
@@ -1,78 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
import PropTypes from 'prop-types';
|
4
|
-
|
5
|
-
Hippo.Components.Form.InputFieldMixin = {
|
6
|
-
|
7
|
-
mixins: [
|
8
|
-
Hippo.Components.Form.FieldMixin
|
9
|
-
],
|
10
|
-
|
11
|
-
propTypes: {
|
12
|
-
onlyNumeric: PropTypes.bool,
|
13
|
-
selctOnFocus: PropTypes.bool,
|
14
|
-
onEnter: PropTypes.func
|
15
|
-
},
|
16
|
-
|
17
|
-
focus() {
|
18
|
-
return (
|
19
|
-
_.dom(this, 'input').el.focus()
|
20
|
-
);
|
21
|
-
},
|
22
|
-
|
23
|
-
getDefaultProps() {
|
24
|
-
return (
|
25
|
-
{type: 'text'}
|
26
|
-
);
|
27
|
-
},
|
28
|
-
|
29
|
-
handleKeyDown(ev) {
|
30
|
-
if (ev.key === 'Enter') { return this.props.onEnter(); }
|
31
|
-
},
|
32
|
-
|
33
|
-
selectOnFocus(ev) {
|
34
|
-
return (
|
35
|
-
ev.target.select()
|
36
|
-
);
|
37
|
-
},
|
38
|
-
|
39
|
-
onFieldBlur() {
|
40
|
-
this.onFieldInteraction();
|
41
|
-
return (
|
42
|
-
__guardMethod__(this.props, 'onBlur', o => o.onBlur())
|
43
|
-
);
|
44
|
-
},
|
45
|
-
|
46
|
-
renderEdit(props) {
|
47
|
-
props = _.extend(props, {
|
48
|
-
ref: 'input',
|
49
|
-
name: this.props.name,
|
50
|
-
value: this.fieldMixinGetValue()
|
51
|
-
});
|
52
|
-
|
53
|
-
const handlers = { onBlur: this.onFieldBlur };
|
54
|
-
|
55
|
-
if (this.props.onEnter) { handlers.onKeyDown = this.handleKeyDown; }
|
56
|
-
if (this.props.selectOnFocus) { handlers.onFocus = this.selectOnFocus; }
|
57
|
-
|
58
|
-
props = Hippo.u.cleanBsSizes(props);
|
59
|
-
|
60
|
-
return (
|
61
|
-
|
62
|
-
this.renderInputField(props, handlers)
|
63
|
-
|
64
|
-
);
|
65
|
-
}
|
66
|
-
};
|
67
|
-
|
68
|
-
function __guardMethod__(obj, methodName, transform) {
|
69
|
-
if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') {
|
70
|
-
return (
|
71
|
-
transform(obj, methodName)
|
72
|
-
);
|
73
|
-
} else {
|
74
|
-
return (
|
75
|
-
undefined
|
76
|
-
);
|
77
|
-
}
|
78
|
-
}
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
import PropTypes from 'prop-types';
|
4
|
-
|
5
|
-
export class JobStatus extends React.Component {
|
6
|
-
static registerForPubSub = true;
|
7
|
-
static listenNetworkEvents = true;
|
8
|
-
|
9
|
-
static propTypes = {
|
10
|
-
job: Hippo.PropTypes.State,
|
11
|
-
onlyExecuting: PropTypes.bool,
|
12
|
-
message: PropTypes.string
|
13
|
-
};
|
14
|
-
|
15
|
-
static modelBindings = { job: 'props' }; statusMessage() {
|
16
|
-
if (_.isEmpty(this.job.stepsCompleted)) { return ''; } else {
|
17
|
-
return (
|
18
|
-
`Completed: ${_.toSentence(this.job.stepsCompleted)}`
|
19
|
-
);
|
20
|
-
}
|
21
|
-
}
|
22
|
-
|
23
|
-
progressBar() {
|
24
|
-
if (!this.job.progress) { return null; }
|
25
|
-
return (
|
26
|
-
<BS.ProgressBar now={this.job.progress * 100} />
|
27
|
-
);
|
28
|
-
}
|
29
|
-
|
30
|
-
render() {
|
31
|
-
if (this.props.onlyExecuting && !this.job.isExecuting) { return null; }
|
32
|
-
return (
|
33
|
-
<div export className="job-executing">
|
34
|
-
<h3 export className="message">
|
35
|
-
{this.props.message}
|
36
|
-
</h3>
|
37
|
-
<LC.Throbber />
|
38
|
-
<div export className="status">
|
39
|
-
{this.statusMessage()}
|
40
|
-
</div>
|
41
|
-
{this.progressBar()}
|
42
|
-
{this.props.children}
|
43
|
-
</div>
|
44
|
-
);
|
45
|
-
}
|
46
|
-
}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export class FakeNumberEvent {
|
4
|
-
constructor(value) {
|
5
|
-
value = _.isNull(value) ? 0 : value;
|
6
|
-
this.target = {value};
|
7
|
-
}
|
8
|
-
isDefaultPrevented() { return false; }
|
9
|
-
}
|
10
|
-
|
11
|
-
export class NumberInput extends React.Component {
|
12
|
-
static mixins = [
|
13
|
-
Hippo.Components.Form.InputFieldMixin
|
14
|
-
];
|
15
|
-
handleNumberChange(n) {
|
16
|
-
return (
|
17
|
-
this.fieldMixinSetValue( new FakeNumberEvent(n) )
|
18
|
-
);
|
19
|
-
}
|
20
|
-
|
21
|
-
renderInputField(props, handlers) {
|
22
|
-
|
23
|
-
if (!props.format) { props.format = '#,###.00'; }
|
24
|
-
props = _.omit(props, 'label');
|
25
|
-
|
26
|
-
return (
|
27
|
-
|
28
|
-
<Hippo.Vendor.ReactWidgets.NumberPicker
|
29
|
-
ref="select"
|
30
|
-
{...handlers}
|
31
|
-
{...props}
|
32
|
-
onChange={this.handleNumberChange}
|
33
|
-
value={Number(props.value)} />
|
34
|
-
|
35
|
-
);
|
36
|
-
}
|
37
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export class PanelHeader extends BaseComponent {
|
4
|
-
render() {
|
5
|
-
return (
|
6
|
-
<div export className="hippo-panel-heading">
|
7
|
-
<h3 export className="panel-title">
|
8
|
-
{this.props.title}
|
9
|
-
</h3>
|
10
|
-
<div export className="spacer" />
|
11
|
-
{this.props.children}
|
12
|
-
</div>
|
13
|
-
);
|
14
|
-
}
|
15
|
-
}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export class FakeInputEvent {
|
4
|
-
constructor(value) {
|
5
|
-
this.target = {value};
|
6
|
-
}
|
7
|
-
isDefaultPrevented() { return false; }
|
8
|
-
}
|
9
|
-
|
10
|
-
|
11
|
-
export class RadioField extends React.Component {
|
12
|
-
static mixins = [
|
13
|
-
Hippo.Components.Form.FieldMixin
|
14
|
-
];
|
15
|
-
handleRadioChange(ev) {
|
16
|
-
if (ev.target.checked) {
|
17
|
-
return (
|
18
|
-
this.fieldMixinSetValue( new FakeInputEvent(this.props.value) )
|
19
|
-
);
|
20
|
-
}
|
21
|
-
}
|
22
|
-
|
23
|
-
renderEdit(props, handlers) {
|
24
|
-
return (
|
25
|
-
<BS.FormControl
|
26
|
-
{...props}
|
27
|
-
{...handlers}
|
28
|
-
type="radio"
|
29
|
-
checked={(this.props.checked != null) || (this.props.value === this.model[this.props.name])}
|
30
|
-
onChange={this.handleRadioChange} />
|
31
|
-
);
|
32
|
-
}
|
33
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
import PropTypes from 'prop-types';
|
4
|
-
|
5
|
-
export class ResizeSensor extends BaseComponent {
|
6
|
-
static propTypes =
|
7
|
-
{onResize: PropTypes.func.isRequired};
|
8
|
-
render() {
|
9
|
-
return (
|
10
|
-
<Hippo.Vendor.ComponentResize
|
11
|
-
{...this.props}
|
12
|
-
embedCss={false}
|
13
|
-
export className={_.classnames('hippo-resize-sensor', this.props.className)}>
|
14
|
-
{this.props.children}
|
15
|
-
</Hippo.Vendor.ComponentResize>
|
16
|
-
);
|
17
|
-
}
|
18
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export class ScreenWrapper extends React.Component {
|
4
|
-
static propTypes =
|
5
|
-
{identifier: React.PropTypes.string.isRequired};
|
6
|
-
render() {
|
7
|
-
const export classes = _.classnames(
|
8
|
-
'screen-wrapper', this.props.identifier, this.props.export className,
|
9
|
-
{'flex-vertically': this.props.flexVertical}
|
10
|
-
);
|
11
|
-
return (
|
12
|
-
React.createElement("div", {"export className": (classes), "style": (this.props.style)},
|
13
|
-
(this.props.children)
|
14
|
-
)
|
15
|
-
);
|
16
|
-
}
|
17
|
-
}
|