@pie-lib/config-ui 11.0.24-next.2 → 11.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/lib/alert-dialog.js.map +1 -1
- package/lib/checkbox.js.map +1 -1
- package/lib/choice-configuration/feedback-menu.js.map +1 -1
- package/lib/choice-configuration/index.js.map +1 -1
- package/lib/choice-utils.js.map +1 -1
- package/lib/feedback-config/feedback-selector.js.map +1 -1
- package/lib/feedback-config/group.js.map +1 -1
- package/lib/feedback-config/index.js.map +1 -1
- package/lib/form-section.js.map +1 -1
- package/lib/help.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/input.js.map +1 -1
- package/lib/inputs.js.map +1 -1
- package/lib/langs.js.map +1 -1
- package/lib/layout/config-layout.js.map +1 -1
- package/lib/layout/layout-contents.js.map +1 -1
- package/lib/layout/settings-box.js.map +1 -1
- package/lib/mui-box/index.js.map +1 -1
- package/lib/number-text-field-custom.js.map +1 -1
- package/lib/number-text-field.js.map +1 -1
- package/lib/radio-with-label.js.map +1 -1
- package/lib/settings/display-size.js.map +1 -1
- package/lib/settings/index.js.map +1 -1
- package/lib/settings/panel.js.map +1 -1
- package/lib/settings/settings-radio-label.js.map +1 -1
- package/lib/settings/toggle.js.map +1 -1
- package/lib/tabs/index.js.map +1 -1
- package/lib/tags-input/index.js.map +1 -1
- package/lib/two-choice.js.map +1 -1
- package/lib/with-stateful-model.js.map +1 -1
- package/package.json +5 -5
- package/src/alert-dialog.jsx +2 -9
- package/src/checkbox.jsx +9 -9
- package/src/choice-configuration/feedback-menu.jsx +10 -20
- package/src/choice-configuration/index.jsx +33 -33
- package/src/choice-utils.js +1 -1
- package/src/feedback-config/feedback-selector.jsx +17 -19
- package/src/feedback-config/group.jsx +9 -9
- package/src/feedback-config/index.jsx +8 -8
- package/src/form-section.jsx +4 -4
- package/src/help.jsx +9 -13
- package/src/index.js +2 -5
- package/src/input.jsx +7 -7
- package/src/inputs.jsx +12 -17
- package/src/langs.jsx +24 -39
- package/src/layout/config-layout.jsx +6 -12
- package/src/layout/layout-contents.jsx +7 -11
- package/src/layout/settings-box.jsx +3 -3
- package/src/mui-box/index.jsx +9 -9
- package/src/number-text-field-custom.jsx +25 -25
- package/src/number-text-field.jsx +12 -12
- package/src/radio-with-label.jsx +2 -2
- package/src/settings/display-size.jsx +5 -5
- package/src/settings/index.js +11 -11
- package/src/settings/panel.jsx +30 -32
- package/src/settings/settings-radio-label.jsx +2 -2
- package/src/settings/toggle.jsx +6 -6
- package/src/tabs/index.jsx +5 -7
- package/src/tags-input/index.jsx +15 -17
- package/src/two-choice.jsx +8 -8
- package/src/with-stateful-model.jsx +4 -4
package/src/settings/index.js
CHANGED
|
@@ -5,10 +5,10 @@ export { Panel };
|
|
|
5
5
|
export const toggle = (label, isConfigProperty = false) => ({
|
|
6
6
|
type: 'toggle',
|
|
7
7
|
label,
|
|
8
|
-
isConfigProperty
|
|
8
|
+
isConfigProperty,
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const toChoice = opt => {
|
|
11
|
+
const toChoice = (opt) => {
|
|
12
12
|
if (typeof opt === 'string') {
|
|
13
13
|
return { label: opt, value: opt };
|
|
14
14
|
} else {
|
|
@@ -22,8 +22,8 @@ export const radio = function() {
|
|
|
22
22
|
return {
|
|
23
23
|
type: 'radio',
|
|
24
24
|
label,
|
|
25
|
-
choices: choices && choices.map(o => toChoice(o)),
|
|
26
|
-
isConfigProperty
|
|
25
|
+
choices: choices && choices.map((o) => toChoice(o)),
|
|
26
|
+
isConfigProperty,
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -32,7 +32,7 @@ export const dropdown = (label, choices, isConfigProperty = false) => {
|
|
|
32
32
|
type: 'dropdown',
|
|
33
33
|
label,
|
|
34
34
|
choices,
|
|
35
|
-
isConfigProperty
|
|
35
|
+
isConfigProperty,
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
@@ -40,18 +40,18 @@ export const numberField = (label, options, isConfigProperty = false) => ({
|
|
|
40
40
|
...options,
|
|
41
41
|
label,
|
|
42
42
|
type: 'numberField',
|
|
43
|
-
isConfigProperty
|
|
43
|
+
isConfigProperty,
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
export const numberFields = (label, fields, isConfigProperty = false) => {
|
|
47
|
-
Object.keys(fields).map(key => {
|
|
47
|
+
Object.keys(fields).map((key) => {
|
|
48
48
|
fields[key] = numberField(fields[key].label, fields[key], isConfigProperty);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
return {
|
|
52
52
|
type: 'numberFields',
|
|
53
53
|
label,
|
|
54
|
-
fields
|
|
54
|
+
fields,
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -59,17 +59,17 @@ export const checkbox = (label, settings, isConfigProperty = false) => ({
|
|
|
59
59
|
...settings,
|
|
60
60
|
label,
|
|
61
61
|
type: 'checkbox',
|
|
62
|
-
isConfigProperty
|
|
62
|
+
isConfigProperty,
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
export const checkboxes = (label, choices, isConfigProperty = false) => {
|
|
66
|
-
Object.keys(choices).map(key => {
|
|
66
|
+
Object.keys(choices).map((key) => {
|
|
67
67
|
choices[key] = checkbox(choices[key].label, choices[key], isConfigProperty);
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
return {
|
|
71
71
|
type: 'checkboxes',
|
|
72
72
|
label,
|
|
73
|
-
choices
|
|
73
|
+
choices,
|
|
74
74
|
};
|
|
75
75
|
};
|
package/src/settings/panel.jsx
CHANGED
|
@@ -18,13 +18,13 @@ const log = debug('pie-lib:config-ui:settings:panel');
|
|
|
18
18
|
|
|
19
19
|
const labelValue = {
|
|
20
20
|
label: PropTypes.string,
|
|
21
|
-
value: PropTypes.string
|
|
21
|
+
value: PropTypes.string,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const baseTypes = {
|
|
25
25
|
label: PropTypes.string,
|
|
26
26
|
value: PropTypes.string,
|
|
27
|
-
onChange: PropTypes.func
|
|
27
|
+
onChange: PropTypes.func,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const CheckboxChoice = ({ label, value, onChange }) => {
|
|
@@ -32,7 +32,7 @@ const CheckboxChoice = ({ label, value, onChange }) => {
|
|
|
32
32
|
<Checkbox
|
|
33
33
|
checked={value}
|
|
34
34
|
label={label}
|
|
35
|
-
onChange={event => {
|
|
35
|
+
onChange={(event) => {
|
|
36
36
|
onChange(event.target.checked);
|
|
37
37
|
}}
|
|
38
38
|
/>
|
|
@@ -42,7 +42,7 @@ const CheckboxChoice = ({ label, value, onChange }) => {
|
|
|
42
42
|
CheckboxChoice.propTypes = {
|
|
43
43
|
label: PropTypes.string,
|
|
44
44
|
value: PropTypes.bool,
|
|
45
|
-
onChange: PropTypes.func
|
|
45
|
+
onChange: PropTypes.func,
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const Radio = ({ classes, label, value, onChange, choices }) => {
|
|
@@ -70,28 +70,28 @@ const StyledRadio = withStyles({
|
|
|
70
70
|
'& > label': {
|
|
71
71
|
color: 'rgba(0, 0, 0, 0.89)',
|
|
72
72
|
transform: 'translate(0, 10px) scale(1)',
|
|
73
|
-
fontSize: '14px'
|
|
73
|
+
fontSize: '14px',
|
|
74
74
|
},
|
|
75
75
|
'& > div': {
|
|
76
|
-
marginTop: '20px'
|
|
77
|
-
}
|
|
76
|
+
marginTop: '20px',
|
|
77
|
+
},
|
|
78
78
|
},
|
|
79
79
|
label: {
|
|
80
|
-
display: 'none'
|
|
81
|
-
}
|
|
80
|
+
display: 'none',
|
|
81
|
+
},
|
|
82
82
|
})(Radio);
|
|
83
83
|
|
|
84
84
|
const Dropdown = withStyles({
|
|
85
85
|
label: {
|
|
86
86
|
margin: 0,
|
|
87
|
-
fontSize: '14px'
|
|
87
|
+
fontSize: '14px',
|
|
88
88
|
},
|
|
89
89
|
wrapper: {
|
|
90
90
|
marginTop: '4px',
|
|
91
91
|
border: '2px solid lightgrey',
|
|
92
92
|
borderRadius: '4px',
|
|
93
|
-
padding: '0 8px'
|
|
94
|
-
}
|
|
93
|
+
padding: '0 8px',
|
|
94
|
+
},
|
|
95
95
|
})(({ classes, label, value, onChange, choices = [] }) => {
|
|
96
96
|
return (
|
|
97
97
|
<div>
|
|
@@ -119,14 +119,14 @@ const NumberField = withStyles({
|
|
|
119
119
|
field: {
|
|
120
120
|
width: '35%',
|
|
121
121
|
marginRight: '24px',
|
|
122
|
-
marginTop: '8px'
|
|
122
|
+
marginTop: '8px',
|
|
123
123
|
},
|
|
124
124
|
wrapper: {
|
|
125
125
|
marginTop: '4px',
|
|
126
126
|
border: '2px solid lightgrey',
|
|
127
127
|
borderRadius: '4px',
|
|
128
|
-
padding: '0 8px'
|
|
129
|
-
}
|
|
128
|
+
padding: '0 8px',
|
|
129
|
+
},
|
|
130
130
|
})(({ classes, label, value, onChange = () => {}, suffix, min, max }) => {
|
|
131
131
|
return (
|
|
132
132
|
<NumberTextField
|
|
@@ -150,12 +150,10 @@ NumberField.propTypes = {
|
|
|
150
150
|
suffix: PropTypes.string,
|
|
151
151
|
min: PropTypes.number,
|
|
152
152
|
max: PropTypes.number,
|
|
153
|
-
value: PropTypes.number
|
|
153
|
+
value: PropTypes.number,
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
const ToggleWrapper = ({ label, value, onChange }) =>
|
|
157
|
-
<Toggle label={label} checked={!!value} toggle={onChange} />
|
|
158
|
-
);
|
|
156
|
+
const ToggleWrapper = ({ label, value, onChange }) => <Toggle label={label} checked={!!value} toggle={onChange} />;
|
|
159
157
|
|
|
160
158
|
ToggleWrapper.propTypes = { ...baseTypes, value: PropTypes.bool };
|
|
161
159
|
|
|
@@ -164,24 +162,24 @@ const tagMap = {
|
|
|
164
162
|
radio: StyledRadio,
|
|
165
163
|
dropdown: Dropdown,
|
|
166
164
|
numberField: NumberField,
|
|
167
|
-
checkbox: CheckboxChoice
|
|
165
|
+
checkbox: CheckboxChoice,
|
|
168
166
|
};
|
|
169
167
|
|
|
170
168
|
const Group = withStyles(() => ({
|
|
171
169
|
group: {
|
|
172
|
-
margin: '0 0 25px 0'
|
|
170
|
+
margin: '0 0 25px 0',
|
|
173
171
|
},
|
|
174
172
|
groupHeader: {
|
|
175
173
|
color: '#495B8F',
|
|
176
174
|
fontSize: '16px',
|
|
177
175
|
fontWeight: 600,
|
|
178
|
-
marginBottom: '8px'
|
|
176
|
+
marginBottom: '8px',
|
|
179
177
|
},
|
|
180
178
|
numberFields: {
|
|
181
179
|
fontSize: '0.85rem',
|
|
182
|
-
marginBottom: 0
|
|
183
|
-
}
|
|
184
|
-
}))(props => {
|
|
180
|
+
marginBottom: 0,
|
|
181
|
+
},
|
|
182
|
+
}))((props) => {
|
|
185
183
|
const { classes, model, label, group, configuration, onChange } = props;
|
|
186
184
|
|
|
187
185
|
/**
|
|
@@ -195,7 +193,7 @@ const Group = withStyles(() => ({
|
|
|
195
193
|
const tagProps = { ...properties, key, value };
|
|
196
194
|
const Tag = tagMap[tagProps.type];
|
|
197
195
|
|
|
198
|
-
return <Tag key={key} {...tagProps} onChange={v => onChange(key, v, isConfigProperty)} />;
|
|
196
|
+
return <Tag key={key} {...tagProps} onChange={(v) => onChange(key, v, isConfigProperty)} />;
|
|
199
197
|
};
|
|
200
198
|
|
|
201
199
|
const content = (group, key) => {
|
|
@@ -211,7 +209,7 @@ const Group = withStyles(() => ({
|
|
|
211
209
|
return (
|
|
212
210
|
<div key={`numberField-${label}`}>
|
|
213
211
|
<p className={classes.numberFields}>{label}</p>
|
|
214
|
-
{Object.keys(fields).map(fieldKey => {
|
|
212
|
+
{Object.keys(fields).map((fieldKey) => {
|
|
215
213
|
return getTag(group, `${key}.${fieldKey}`, `${key}.fields.${fieldKey}`);
|
|
216
214
|
})}
|
|
217
215
|
</div>
|
|
@@ -222,7 +220,7 @@ const Group = withStyles(() => ({
|
|
|
222
220
|
return (
|
|
223
221
|
<div key={`checkbox-${label}`}>
|
|
224
222
|
<p>{label}</p>
|
|
225
|
-
{Object.keys(choices).map(choiceKey => {
|
|
223
|
+
{Object.keys(choices).map((choiceKey) => {
|
|
226
224
|
return getTag(group, `${key}.${choiceKey}`, `${key}.choices.${choiceKey}`);
|
|
227
225
|
})}
|
|
228
226
|
</div>
|
|
@@ -237,7 +235,7 @@ const Group = withStyles(() => ({
|
|
|
237
235
|
<div className={classes.group}>
|
|
238
236
|
<div className={classes.groupHeader}>{label}</div>
|
|
239
237
|
|
|
240
|
-
{Object.keys(group).map(key => {
|
|
238
|
+
{Object.keys(group).map((key) => {
|
|
241
239
|
return content(group, key);
|
|
242
240
|
})}
|
|
243
241
|
</div>
|
|
@@ -250,12 +248,12 @@ export class Panel extends React.Component {
|
|
|
250
248
|
configuration: PropTypes.object,
|
|
251
249
|
groups: PropTypes.object,
|
|
252
250
|
onChangeModel: PropTypes.func,
|
|
253
|
-
onChangeConfiguration: PropTypes.func
|
|
251
|
+
onChangeConfiguration: PropTypes.func,
|
|
254
252
|
};
|
|
255
253
|
|
|
256
254
|
static defaultProps = {
|
|
257
255
|
onChangeModel: () => {},
|
|
258
|
-
onChangeConfiguration: () => {}
|
|
256
|
+
onChangeConfiguration: () => {},
|
|
259
257
|
};
|
|
260
258
|
|
|
261
259
|
change = (key, value, isConfigProperty = false) => {
|
|
@@ -279,7 +277,7 @@ export class Panel extends React.Component {
|
|
|
279
277
|
|
|
280
278
|
return (
|
|
281
279
|
<div>
|
|
282
|
-
{Object.keys(groups).map(g => (
|
|
280
|
+
{Object.keys(groups).map((g) => (
|
|
283
281
|
<Group
|
|
284
282
|
label={g}
|
|
285
283
|
key={g}
|
package/src/settings/toggle.jsx
CHANGED
|
@@ -4,28 +4,28 @@ import InputLabel from '@material-ui/core/InputLabel';
|
|
|
4
4
|
import { withStyles } from '@material-ui/core/styles';
|
|
5
5
|
import Switch from '@material-ui/core/Switch';
|
|
6
6
|
|
|
7
|
-
const Toggle = withStyles(theme => ({
|
|
7
|
+
const Toggle = withStyles((theme) => ({
|
|
8
8
|
toggle: {
|
|
9
9
|
display: 'flex',
|
|
10
10
|
width: '100%',
|
|
11
|
-
justifyContent: 'space-between'
|
|
11
|
+
justifyContent: 'space-between',
|
|
12
12
|
},
|
|
13
13
|
label: {
|
|
14
14
|
color: 'rgba(0, 0, 0, 0.89)',
|
|
15
15
|
fontSize: '14px',
|
|
16
|
-
paddingTop: theme.spacing.unit * 2
|
|
17
|
-
}
|
|
16
|
+
paddingTop: theme.spacing.unit * 2,
|
|
17
|
+
},
|
|
18
18
|
}))(({ checked, label, toggle, classes }) => (
|
|
19
19
|
<div className={classes.toggle}>
|
|
20
20
|
<InputLabel className={classes.label}>{label}</InputLabel>
|
|
21
|
-
<Switch checked={checked} onChange={e => toggle(e.target.checked)} />
|
|
21
|
+
<Switch checked={checked} onChange={(e) => toggle(e.target.checked)} />
|
|
22
22
|
</div>
|
|
23
23
|
));
|
|
24
24
|
|
|
25
25
|
Toggle.propTypes = {
|
|
26
26
|
checked: PropTypes.bool,
|
|
27
27
|
label: PropTypes.string.isRequired,
|
|
28
|
-
toggle: PropTypes.func.isRequired
|
|
28
|
+
toggle: PropTypes.func.isRequired,
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export default Toggle;
|
package/src/tabs/index.jsx
CHANGED
|
@@ -10,13 +10,13 @@ export class Tabs extends React.Component {
|
|
|
10
10
|
classes: PropTypes.object,
|
|
11
11
|
className: PropTypes.string,
|
|
12
12
|
contentClassName: PropTypes.string,
|
|
13
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
|
|
13
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
constructor(props) {
|
|
17
17
|
super(props);
|
|
18
18
|
this.state = {
|
|
19
|
-
value: 0
|
|
19
|
+
value: 0,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -29,15 +29,13 @@ export class Tabs extends React.Component {
|
|
|
29
29
|
const { children, className, contentClassName, classes } = this.props;
|
|
30
30
|
|
|
31
31
|
const tabClasses = {
|
|
32
|
-
root: classes.tabRoot
|
|
32
|
+
root: classes.tabRoot,
|
|
33
33
|
};
|
|
34
34
|
return (
|
|
35
35
|
<div className={className}>
|
|
36
36
|
<MuiTabs indicatorColor="primary" value={value} onChange={this.handleChange}>
|
|
37
37
|
{React.Children.map(children, (c, index) =>
|
|
38
|
-
c && c.props.title ?
|
|
39
|
-
<MuiTab classes={tabClasses} key={index} label={c.props.title} />
|
|
40
|
-
) : null
|
|
38
|
+
c && c.props.title ? <MuiTab classes={tabClasses} key={index} label={c.props.title} /> : null,
|
|
41
39
|
)}
|
|
42
40
|
</MuiTabs>
|
|
43
41
|
<div className={contentClassName}>{children[value]}</div>
|
|
@@ -47,5 +45,5 @@ export class Tabs extends React.Component {
|
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
export default withStyles(() => ({
|
|
50
|
-
tabRoot: {}
|
|
48
|
+
tabRoot: {},
|
|
51
49
|
}))(Tabs);
|
package/src/tags-input/index.jsx
CHANGED
|
@@ -10,32 +10,30 @@ const ENTER = 13;
|
|
|
10
10
|
const Tag = withStyles(() => ({
|
|
11
11
|
tag: {
|
|
12
12
|
padding: '0px',
|
|
13
|
-
margin: '1px'
|
|
14
|
-
}
|
|
15
|
-
}))(({ classes, label, onDelete }) =>
|
|
16
|
-
<Chip className={classes.tag} label={label} onDelete={onDelete} />
|
|
17
|
-
));
|
|
13
|
+
margin: '1px',
|
|
14
|
+
},
|
|
15
|
+
}))(({ classes, label, onDelete }) => <Chip className={classes.tag} label={label} onDelete={onDelete} />);
|
|
18
16
|
|
|
19
17
|
Tag.propTypes = {
|
|
20
18
|
label: PropTypes.string.isRequired,
|
|
21
|
-
onDelete: PropTypes.func.isRequired
|
|
19
|
+
onDelete: PropTypes.func.isRequired,
|
|
22
20
|
};
|
|
23
21
|
|
|
24
22
|
export class TagsInput extends React.Component {
|
|
25
23
|
static propTypes = {
|
|
26
24
|
classes: PropTypes.object.isRequired,
|
|
27
25
|
tags: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
28
|
-
onChange: PropTypes.func.isRequired
|
|
26
|
+
onChange: PropTypes.func.isRequired,
|
|
29
27
|
};
|
|
30
28
|
|
|
31
29
|
constructor(props) {
|
|
32
30
|
super(props);
|
|
33
31
|
this.state = {
|
|
34
32
|
value: '',
|
|
35
|
-
focused: false
|
|
33
|
+
focused: false,
|
|
36
34
|
};
|
|
37
35
|
|
|
38
|
-
this.onKeyDown = event => {
|
|
36
|
+
this.onKeyDown = (event) => {
|
|
39
37
|
if (event.keyCode === ENTER && this.state.value !== '') {
|
|
40
38
|
const tag = this.state.value.trim();
|
|
41
39
|
const newTags = uniq(this.props.tags.concat([tag]));
|
|
@@ -47,11 +45,11 @@ export class TagsInput extends React.Component {
|
|
|
47
45
|
}
|
|
48
46
|
};
|
|
49
47
|
|
|
50
|
-
this.onChange = event => {
|
|
48
|
+
this.onChange = (event) => {
|
|
51
49
|
this.setState({ value: event.target.value });
|
|
52
50
|
};
|
|
53
51
|
|
|
54
|
-
this.deleteTag = tag => {
|
|
52
|
+
this.deleteTag = (tag) => {
|
|
55
53
|
const { tags } = this.props;
|
|
56
54
|
|
|
57
55
|
const tagIndex = tags.indexOf(tag);
|
|
@@ -80,7 +78,7 @@ export class TagsInput extends React.Component {
|
|
|
80
78
|
<Tag key={index} label={t} onDelete={() => this.deleteTag(t)} />
|
|
81
79
|
))}
|
|
82
80
|
<input
|
|
83
|
-
ref={r => (this.input = r)}
|
|
81
|
+
ref={(r) => (this.input = r)}
|
|
84
82
|
onKeyDown={this.onKeyDown}
|
|
85
83
|
onChange={this.onChange}
|
|
86
84
|
className={classes.input}
|
|
@@ -95,11 +93,11 @@ export class TagsInput extends React.Component {
|
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
const styles = theme => ({
|
|
96
|
+
const styles = (theme) => ({
|
|
99
97
|
tagsInput: {
|
|
100
98
|
border: 'solid 0px white',
|
|
101
99
|
display: 'flex',
|
|
102
|
-
flexWrap: 'wrap'
|
|
100
|
+
flexWrap: 'wrap',
|
|
103
101
|
},
|
|
104
102
|
input: {
|
|
105
103
|
padding: '2px',
|
|
@@ -113,9 +111,9 @@ const styles = theme => ({
|
|
|
113
111
|
fontFamily: theme.typography.fontFamily,
|
|
114
112
|
outline: 'none',
|
|
115
113
|
'&:focus': {
|
|
116
|
-
outline: 'none'
|
|
117
|
-
}
|
|
118
|
-
}
|
|
114
|
+
outline: 'none',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
119
117
|
});
|
|
120
118
|
|
|
121
119
|
export default withStyles(styles)(TagsInput);
|
package/src/two-choice.jsx
CHANGED
|
@@ -5,16 +5,16 @@ import React from 'react';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { withStyles } from '@material-ui/core/styles';
|
|
7
7
|
|
|
8
|
-
const styles = theme => ({
|
|
8
|
+
const styles = (theme) => ({
|
|
9
9
|
group: {
|
|
10
10
|
display: 'flex',
|
|
11
11
|
flexWrap: 'wrap',
|
|
12
12
|
paddingLeft: 0,
|
|
13
|
-
marginTop: theme.spacing.unit
|
|
13
|
+
marginTop: theme.spacing.unit,
|
|
14
14
|
},
|
|
15
15
|
vertical: {
|
|
16
|
-
flexDirection: 'column'
|
|
17
|
-
}
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
},
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
class RawNChoice extends React.Component {
|
|
@@ -26,17 +26,17 @@ class RawNChoice extends React.Component {
|
|
|
26
26
|
value: PropTypes.string,
|
|
27
27
|
onChange: PropTypes.func.isRequired,
|
|
28
28
|
direction: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
29
|
-
classes: PropTypes.object.isRequired
|
|
29
|
+
classes: PropTypes.object.isRequired,
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
handleChange = event => {
|
|
32
|
+
handleChange = (event) => {
|
|
33
33
|
this.props.onChange(event.currentTarget.value);
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
render() {
|
|
37
37
|
const { header, className, classes, customLabel, opts, value, direction } = this.props;
|
|
38
38
|
|
|
39
|
-
const preppedOpts = opts.map(o => {
|
|
39
|
+
const preppedOpts = opts.map((o) => {
|
|
40
40
|
return typeof o === 'string' ? { label: o, value: o } : o;
|
|
41
41
|
});
|
|
42
42
|
const LabelComponent = customLabel || RadioWithLabel;
|
|
@@ -71,7 +71,7 @@ class TwoChoice extends React.Component {
|
|
|
71
71
|
one: PropTypes.oneOfType([labelValue, PropTypes.string]),
|
|
72
72
|
two: PropTypes.oneOfType([labelValue, PropTypes.string]),
|
|
73
73
|
className: PropTypes.string,
|
|
74
|
-
customLabel: PropTypes.func
|
|
74
|
+
customLabel: PropTypes.func,
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
render() {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
const withStatefulModel = Component => {
|
|
4
|
+
const withStatefulModel = (Component) => {
|
|
5
5
|
class Stateful extends React.Component {
|
|
6
6
|
static propTypes = {
|
|
7
7
|
model: PropTypes.object.isRequired,
|
|
8
|
-
onChange: PropTypes.func.isRequired
|
|
8
|
+
onChange: PropTypes.func.isRequired,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
constructor(props) {
|
|
12
12
|
super(props);
|
|
13
13
|
this.state = {
|
|
14
|
-
model: props.model
|
|
14
|
+
model: props.model,
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ const withStatefulModel = Component => {
|
|
|
19
19
|
this.setState({ model: props.model });
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
onChange = model => {
|
|
22
|
+
onChange = (model) => {
|
|
23
23
|
this.setState({ model }, () => {
|
|
24
24
|
this.props.onChange(this.state.model);
|
|
25
25
|
});
|