@pie-lib/config-ui 11.3.13-next.0 → 12.0.0-beta.2
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 +0 -332
- package/lib/alert-dialog.js +1 -1
- package/lib/alert-dialog.js.map +1 -1
- package/lib/checkbox.js +3 -3
- package/lib/checkbox.js.map +1 -1
- package/lib/choice-configuration/feedback-menu.js +1 -1
- package/lib/choice-configuration/feedback-menu.js.map +1 -1
- package/lib/choice-configuration/index.js +10 -24
- package/lib/choice-configuration/index.js.map +1 -1
- package/lib/choice-utils.js +1 -1
- package/lib/choice-utils.js.map +1 -1
- package/lib/feedback-config/feedback-selector.js +6 -12
- package/lib/feedback-config/feedback-selector.js.map +1 -1
- package/lib/feedback-config/group.js +3 -3
- package/lib/feedback-config/group.js.map +1 -1
- package/lib/feedback-config/index.js +1 -1
- package/lib/feedback-config/index.js.map +1 -1
- package/lib/form-section.js +1 -1
- package/lib/form-section.js.map +1 -1
- package/lib/help.js +6 -8
- package/lib/help.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/input.js +1 -1
- package/lib/input.js.map +1 -1
- package/lib/inputs.js +10 -12
- package/lib/inputs.js.map +1 -1
- package/lib/langs.js +1 -1
- package/lib/langs.js.map +1 -1
- package/lib/layout/config-layout.js +16 -28
- package/lib/layout/config-layout.js.map +1 -1
- package/lib/layout/index.js +1 -1
- package/lib/layout/index.js.map +1 -1
- package/lib/layout/layout-contents.js +16 -85
- package/lib/layout/layout-contents.js.map +1 -1
- package/lib/layout/settings-box.js +6 -5
- package/lib/layout/settings-box.js.map +1 -1
- package/lib/mui-box/index.js +1 -1
- package/lib/mui-box/index.js.map +1 -1
- package/lib/number-text-field-custom.js +1 -1
- package/lib/number-text-field-custom.js.map +1 -1
- package/lib/number-text-field.js +1 -1
- package/lib/number-text-field.js.map +1 -1
- package/lib/radio-with-label.js +1 -1
- package/lib/radio-with-label.js.map +1 -1
- package/lib/settings/display-size.js +1 -1
- package/lib/settings/display-size.js.map +1 -1
- package/lib/settings/index.js +1 -1
- package/lib/settings/index.js.map +1 -1
- package/lib/settings/panel.js +58 -78
- package/lib/settings/panel.js.map +1 -1
- package/lib/settings/settings-radio-label.js +8 -10
- package/lib/settings/settings-radio-label.js.map +1 -1
- package/lib/settings/toggle.js +2 -2
- package/lib/settings/toggle.js.map +1 -1
- package/lib/tabs/index.js +2 -6
- package/lib/tabs/index.js.map +1 -1
- package/lib/tags-input/index.js +3 -3
- package/lib/tags-input/index.js.map +1 -1
- package/lib/two-choice.js +1 -1
- package/lib/two-choice.js.map +1 -1
- package/lib/with-stateful-model.js +1 -1
- package/lib/with-stateful-model.js.map +1 -1
- package/package.json +5 -5
- package/src/alert-dialog.jsx +9 -2
- package/src/checkbox.jsx +10 -10
- package/src/choice-configuration/feedback-menu.jsx +23 -10
- package/src/choice-configuration/index.jsx +49 -66
- package/src/choice-utils.js +1 -1
- package/src/feedback-config/feedback-selector.jsx +22 -26
- package/src/feedback-config/group.jsx +12 -10
- package/src/feedback-config/index.jsx +8 -14
- package/src/form-section.jsx +4 -4
- package/src/help.jsx +15 -14
- package/src/index.js +5 -2
- package/src/input.jsx +7 -7
- package/src/inputs.jsx +20 -15
- package/src/langs.jsx +39 -28
- package/src/layout/config-layout.jsx +20 -17
- package/src/layout/layout-contents.jsx +19 -65
- package/src/layout/settings-box.jsx +8 -12
- 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 -12
- package/src/settings/panel.jsx +59 -64
- package/src/settings/settings-radio-label.jsx +5 -5
- package/src/settings/toggle.jsx +7 -7
- package/src/tabs/index.jsx +15 -11
- package/src/tags-input/index.jsx +19 -17
- package/src/two-choice.jsx +8 -8
- package/src/with-stateful-model.jsx +4 -4
- package/LICENSE.md +0 -5
package/src/input.jsx
CHANGED
|
@@ -10,42 +10,42 @@ export default class Input extends React.Component {
|
|
|
10
10
|
label: PropTypes.string,
|
|
11
11
|
type: PropTypes.string.isRequired,
|
|
12
12
|
error: PropTypes.func,
|
|
13
|
-
noModelUpdateOnError: PropTypes.bool
|
|
13
|
+
noModelUpdateOnError: PropTypes.bool
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
static defaultProps = {
|
|
17
17
|
type: 'text',
|
|
18
18
|
error: (value, type) => (type === 'number' ? !value || isNaN(value) : !value),
|
|
19
|
-
noModelUpdateOnError: false
|
|
19
|
+
noModelUpdateOnError: false
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
constructor(props) {
|
|
23
23
|
super(props);
|
|
24
24
|
|
|
25
25
|
this.state = {
|
|
26
|
-
value: props.value
|
|
26
|
+
value: props.value
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
componentWillReceiveProps(newProps) {
|
|
31
31
|
this.setState({
|
|
32
|
-
value: newProps.value
|
|
32
|
+
value: newProps.value
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
onChange =
|
|
36
|
+
onChange = event => {
|
|
37
37
|
const { type, onChange, error } = this.props;
|
|
38
38
|
const value = event.target.value;
|
|
39
39
|
|
|
40
40
|
if (error(value, type)) {
|
|
41
41
|
this.setState({
|
|
42
42
|
error: true,
|
|
43
|
-
value: event.target.value
|
|
43
|
+
value: event.target.value
|
|
44
44
|
});
|
|
45
45
|
} else {
|
|
46
46
|
this.setState({
|
|
47
47
|
error: false,
|
|
48
|
-
value: event.target.value
|
|
48
|
+
value: event.target.value
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
onChange(event);
|
package/src/inputs.jsx
CHANGED
|
@@ -14,13 +14,18 @@ const InputTypes = {
|
|
|
14
14
|
checked: PropTypes.bool,
|
|
15
15
|
onChange: PropTypes.func,
|
|
16
16
|
disabled: PropTypes.bool,
|
|
17
|
-
error: PropTypes.string
|
|
17
|
+
error: PropTypes.string
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const RawInputSwitch = ({ classes, className, label, checked, onChange }) => {
|
|
21
21
|
return (
|
|
22
22
|
<InputContainer className={className} label={label}>
|
|
23
|
-
<Switch
|
|
23
|
+
<Switch
|
|
24
|
+
className={classes.switchRoot}
|
|
25
|
+
checked={checked}
|
|
26
|
+
onChange={onChange}
|
|
27
|
+
aria-label={label}
|
|
28
|
+
/>
|
|
24
29
|
</InputContainer>
|
|
25
30
|
);
|
|
26
31
|
};
|
|
@@ -30,11 +35,11 @@ RawInputSwitch.propTypes = { ...InputTypes };
|
|
|
30
35
|
const InputSwitch = withStyles({
|
|
31
36
|
switchRoot: {
|
|
32
37
|
justifyContent: 'inherit',
|
|
33
|
-
transform: 'translate(-20%, 20%)'
|
|
34
|
-
}
|
|
38
|
+
transform: 'translate(-20%, 20%)'
|
|
39
|
+
}
|
|
35
40
|
})(RawInputSwitch);
|
|
36
41
|
|
|
37
|
-
const RawInputCheckbox =
|
|
42
|
+
const RawInputCheckbox = props => {
|
|
38
43
|
const { classes, className, label, checked, onChange, disabled, error } = props;
|
|
39
44
|
|
|
40
45
|
return (
|
|
@@ -52,7 +57,7 @@ const RawInputCheckbox = (props) => {
|
|
|
52
57
|
|
|
53
58
|
RawInputCheckbox.propTypes = { ...InputTypes };
|
|
54
59
|
|
|
55
|
-
const RawInputRadio =
|
|
60
|
+
const RawInputRadio = props => {
|
|
56
61
|
const { classes, className, label, checked, onChange, disabled, error } = props;
|
|
57
62
|
|
|
58
63
|
return (
|
|
@@ -70,22 +75,22 @@ const RawInputRadio = (props) => {
|
|
|
70
75
|
|
|
71
76
|
RawInputRadio.propTypes = { ...InputTypes };
|
|
72
77
|
|
|
73
|
-
const InputCheckbox = withStyles(
|
|
78
|
+
const InputCheckbox = withStyles({
|
|
74
79
|
checkboxRoot: {
|
|
75
|
-
transform: 'translate(-25%, 20%)'
|
|
80
|
+
transform: 'translate(-25%, 20%)'
|
|
76
81
|
},
|
|
77
82
|
error: {
|
|
78
|
-
color:
|
|
79
|
-
}
|
|
80
|
-
})
|
|
83
|
+
color: 'red'
|
|
84
|
+
}
|
|
85
|
+
})(RawInputCheckbox);
|
|
81
86
|
|
|
82
|
-
const InputRadio = withStyles((
|
|
87
|
+
const InputRadio = withStyles(() => ({
|
|
83
88
|
radioRoot: {
|
|
84
|
-
transform: 'translate(-20%, 20%)'
|
|
89
|
+
transform: 'translate(-20%, 20%)'
|
|
85
90
|
},
|
|
86
91
|
error: {
|
|
87
|
-
color:
|
|
88
|
-
}
|
|
92
|
+
color: 'red'
|
|
93
|
+
}
|
|
89
94
|
}))(RawInputRadio);
|
|
90
95
|
|
|
91
96
|
export { InputSwitch, InputCheckbox, InputRadio };
|
package/src/langs.jsx
CHANGED
|
@@ -11,21 +11,21 @@ import debug from 'debug';
|
|
|
11
11
|
|
|
12
12
|
const log = debug('pie-elements:config-ui:langs');
|
|
13
13
|
|
|
14
|
-
const styles =
|
|
14
|
+
const styles = theme => ({
|
|
15
15
|
root: {
|
|
16
16
|
flexDirection: 'column',
|
|
17
17
|
alignItems: 'start',
|
|
18
18
|
display: 'flex',
|
|
19
19
|
position: 'relative',
|
|
20
20
|
paddingTop: '0px',
|
|
21
|
-
paddingRight: '0px'
|
|
21
|
+
paddingRight: '0px'
|
|
22
22
|
},
|
|
23
23
|
formControl: {
|
|
24
|
-
position: 'initial'
|
|
24
|
+
position: 'initial'
|
|
25
25
|
},
|
|
26
26
|
inputLabel: {
|
|
27
|
-
paddingBottom: theme.spacing.unit
|
|
28
|
-
}
|
|
27
|
+
paddingBottom: theme.spacing.unit
|
|
28
|
+
}
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
export class RawLangs extends React.Component {
|
|
@@ -35,7 +35,7 @@ export class RawLangs extends React.Component {
|
|
|
35
35
|
selected: PropTypes.string,
|
|
36
36
|
label: PropTypes.string,
|
|
37
37
|
classes: PropTypes.object.isRequired,
|
|
38
|
-
uid: PropTypes.string
|
|
38
|
+
uid: PropTypes.string
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
constructor(props) {
|
|
@@ -43,9 +43,8 @@ export class RawLangs extends React.Component {
|
|
|
43
43
|
this.uid = props.uid || (Math.random() * 10000).toFixed();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
choose =
|
|
46
|
+
choose = event => {
|
|
47
47
|
log('[choose] event: ', event);
|
|
48
|
-
|
|
49
48
|
if (this.props.onChange) {
|
|
50
49
|
this.props.onChange(event.target.value);
|
|
51
50
|
}
|
|
@@ -53,16 +52,13 @@ export class RawLangs extends React.Component {
|
|
|
53
52
|
|
|
54
53
|
render() {
|
|
55
54
|
let { langs, selected, label, classes } = this.props;
|
|
56
|
-
|
|
57
55
|
log('[render] selected:', selected);
|
|
58
|
-
|
|
59
56
|
return (
|
|
60
57
|
<div className={classes.root}>
|
|
61
58
|
<FormControl className={classes.formControl}>
|
|
62
59
|
<InputLabel className={classes.inputLabel} htmlFor={this.uid}>
|
|
63
60
|
{label}
|
|
64
61
|
</InputLabel>
|
|
65
|
-
|
|
66
62
|
<Select value={selected} onChange={this.choose} input={<Input id={this.uid} />}>
|
|
67
63
|
{langs.map((l, index) => (
|
|
68
64
|
<MenuItem key={index} value={l}>
|
|
@@ -84,28 +80,43 @@ export const LanguageControls = withStyles({
|
|
|
84
80
|
display: 'grid',
|
|
85
81
|
gridAutoFlow: 'column',
|
|
86
82
|
gridAutoColumns: '1fr',
|
|
87
|
-
gridGap: '8px'
|
|
88
|
-
}
|
|
89
|
-
})(
|
|
90
|
-
|
|
83
|
+
gridGap: '8px'
|
|
84
|
+
}
|
|
85
|
+
})(
|
|
86
|
+
({
|
|
87
|
+
classes,
|
|
88
|
+
langs,
|
|
89
|
+
activeLang,
|
|
90
|
+
defaultLang,
|
|
91
|
+
onActiveLangChange,
|
|
92
|
+
onDefaultLangChange,
|
|
93
|
+
className
|
|
94
|
+
}) => {
|
|
95
|
+
const names = classNames(classes.languageControls, className);
|
|
91
96
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
97
|
+
return (
|
|
98
|
+
<div className={names}>
|
|
99
|
+
<Langs
|
|
100
|
+
label="Choose language to edit"
|
|
101
|
+
langs={langs}
|
|
102
|
+
selected={activeLang}
|
|
103
|
+
onChange={l => onActiveLangChange(l)}
|
|
104
|
+
/>
|
|
105
|
+
<Langs
|
|
106
|
+
label="Default language"
|
|
107
|
+
langs={langs}
|
|
108
|
+
selected={defaultLang}
|
|
109
|
+
onChange={l => onDefaultLangChange(l)}
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
);
|
|
104
115
|
|
|
105
116
|
LanguageControls.propTypes = {
|
|
106
117
|
langs: PropTypes.array,
|
|
107
118
|
activeLang: PropTypes.string.isRequired,
|
|
108
119
|
defaultLang: PropTypes.string.isRequired,
|
|
109
120
|
onActiveLangChange: PropTypes.func.isRequired,
|
|
110
|
-
onDefaultLangChange: PropTypes.func.isRequired
|
|
121
|
+
onDefaultLangChange: PropTypes.func.isRequired
|
|
111
122
|
};
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Measure from 'react-measure';
|
|
3
|
-
import { withContentRect } from 'react-measure';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import LayoutContents from './layout-contents';
|
|
6
5
|
import SettingsBox from './settings-box';
|
|
7
6
|
|
|
8
|
-
class
|
|
7
|
+
class ConfigLayout extends React.Component {
|
|
9
8
|
static propTypes = {
|
|
10
|
-
children: PropTypes.oneOfType([
|
|
9
|
+
children: PropTypes.oneOfType([
|
|
10
|
+
PropTypes.string,
|
|
11
|
+
PropTypes.arrayOf(PropTypes.element),
|
|
12
|
+
PropTypes.element
|
|
13
|
+
]),
|
|
14
|
+
settings: PropTypes.element,
|
|
11
15
|
className: PropTypes.string,
|
|
12
16
|
classes: PropTypes.object,
|
|
13
|
-
|
|
14
|
-
sidePanelMinWidth: PropTypes.number,
|
|
15
|
-
hideSettings: PropTypes.bool,
|
|
17
|
+
sidePanelMinWidth: PropTypes.number
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
static defaultProps = {
|
|
19
|
-
sidePanelMinWidth: 950
|
|
20
|
-
hideSettings: false,
|
|
21
|
+
sidePanelMinWidth: 950
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
constructor(props) {
|
|
24
25
|
super(props);
|
|
25
|
-
this.state = {
|
|
26
|
+
this.state = {
|
|
27
|
+
layoutMode: undefined
|
|
28
|
+
};
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
onResize =
|
|
31
|
+
onResize = contentRect => {
|
|
29
32
|
const { bounds } = contentRect;
|
|
30
33
|
const { sidePanelMinWidth } = this.props;
|
|
31
34
|
const layoutMode = bounds.width >= sidePanelMinWidth ? 'inline' : 'tabbed';
|
|
@@ -37,15 +40,17 @@ class MeasuredConfigLayout extends React.Component {
|
|
|
37
40
|
return (
|
|
38
41
|
<Measure bounds onResize={this.onResize}>
|
|
39
42
|
{({ measureRef }) => {
|
|
40
|
-
const {
|
|
43
|
+
const { settings, children } = this.props;
|
|
41
44
|
const { layoutMode } = this.state;
|
|
42
45
|
|
|
43
|
-
const settingsPanel = layoutMode === 'inline' ? <SettingsBox>{settings}</SettingsBox> : settings;
|
|
44
|
-
const secondaryContent = hideSettings ? null : settingsPanel;
|
|
45
|
-
|
|
46
46
|
return (
|
|
47
47
|
<div ref={measureRef}>
|
|
48
|
-
<LayoutContents
|
|
48
|
+
<LayoutContents
|
|
49
|
+
mode={layoutMode}
|
|
50
|
+
secondary={
|
|
51
|
+
layoutMode === 'inline' ? <SettingsBox>{settings}</SettingsBox> : settings
|
|
52
|
+
}
|
|
53
|
+
>
|
|
49
54
|
{children}
|
|
50
55
|
</LayoutContents>
|
|
51
56
|
</div>
|
|
@@ -56,6 +61,4 @@ class MeasuredConfigLayout extends React.Component {
|
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
const ConfigLayout = withContentRect('bounds')(MeasuredConfigLayout);
|
|
60
|
-
|
|
61
64
|
export default ConfigLayout;
|
|
@@ -1,106 +1,60 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
2
|
import { withStyles } from '@material-ui/core';
|
|
5
3
|
import Tabs from '../tabs';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
6
|
|
|
7
7
|
class RawLayoutContents extends React.Component {
|
|
8
8
|
static propTypes = {
|
|
9
9
|
mode: PropTypes.oneOf(['tabbed', 'inline']),
|
|
10
10
|
secondary: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
|
|
11
11
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
|
|
12
|
-
classes: PropTypes.object
|
|
12
|
+
classes: PropTypes.object
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
getConfiguration = () => {
|
|
16
|
-
const { secondary } = this.props;
|
|
17
|
-
// in config-layout, secondary can be: <SettingsBox>{settings}</SettingsBox>, settings, null
|
|
18
|
-
|
|
19
|
-
return secondary?.props?.configuration || secondary?.props?.children?.props?.configuration || undefined;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// // eslint-disable-next-line no-unused-vars
|
|
23
|
-
// componentDidUpdate(prevProps, prevState, snapshot) {
|
|
24
|
-
// const configuration = this.getConfiguration();
|
|
25
|
-
// const { mode } = this.props;
|
|
26
|
-
//
|
|
27
|
-
// // promptHolder class is used to wrap up inputs:
|
|
28
|
-
// // we don't want inputs to fill the entire scrollable container,
|
|
29
|
-
// // but instead we want inputs to fit in the first view,
|
|
30
|
-
// // so we calculate the maximum space inputs need
|
|
31
|
-
// try {
|
|
32
|
-
// if (
|
|
33
|
-
// configuration?.maxWidth &&
|
|
34
|
-
// getComputedStyle(document.documentElement).getPropertyValue('--pie-prompt-holder-max-width') !==
|
|
35
|
-
// configuration?.maxWidth
|
|
36
|
-
// ) {
|
|
37
|
-
// document.documentElement.style.setProperty(
|
|
38
|
-
// '--pie-prompt-holder-max-width',
|
|
39
|
-
// mode === 'inline' ? `calc(${configuration.maxWidth} - 340px)` : configuration.maxWidth,
|
|
40
|
-
// );
|
|
41
|
-
// }
|
|
42
|
-
// } catch (e) {
|
|
43
|
-
// console.log(e.toString());
|
|
44
|
-
// }
|
|
45
|
-
// }
|
|
46
|
-
|
|
47
15
|
render() {
|
|
48
16
|
const { mode, secondary, children, classes } = this.props;
|
|
49
|
-
const configuration = this.getConfiguration();
|
|
50
|
-
|
|
51
|
-
let hasSettingsPanel = Object.entries(configuration || {}).some(([propName, obj]) => !!obj?.settings);
|
|
52
|
-
// ebsr has configuration.partA and configuration.partB
|
|
53
|
-
// because we might have nested configuration for other item types as well, let's add this simple regex to check values for settings
|
|
54
|
-
|
|
55
|
-
if (!hasSettingsPanel) {
|
|
56
|
-
try {
|
|
57
|
-
hasSettingsPanel = JSON.stringify(configuration)?.match(/settings":true/)?.length;
|
|
58
|
-
} catch (e) {
|
|
59
|
-
console.log(e.toString());
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
17
|
|
|
63
18
|
return (
|
|
64
|
-
<div className={classes.container}>
|
|
19
|
+
<div className={classnames(classes.container)}>
|
|
65
20
|
{mode === 'inline' && (
|
|
66
|
-
<div className={
|
|
21
|
+
<div className={classes.flow}>
|
|
67
22
|
<div className={classes.configContainer}>{children}</div>
|
|
68
|
-
|
|
23
|
+
<div>{secondary}</div>
|
|
69
24
|
</div>
|
|
70
25
|
)}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
26
|
+
{mode === 'tabbed' && (
|
|
27
|
+
<Tabs
|
|
28
|
+
onChange={this.onTabsChange}
|
|
29
|
+
contentClassName={classes.contentContainer}
|
|
30
|
+
indicatorColor="primary"
|
|
31
|
+
>
|
|
74
32
|
<div title="Design">{children}</div>
|
|
75
|
-
<div title="
|
|
33
|
+
<div title="settings">{secondary}</div>
|
|
76
34
|
</Tabs>
|
|
77
35
|
)}
|
|
78
|
-
|
|
79
|
-
{mode === 'tabbed' && !hasSettingsPanel && <div className={classes.contentContainer}>{children}</div>}
|
|
80
36
|
</div>
|
|
81
37
|
);
|
|
82
38
|
}
|
|
83
39
|
}
|
|
84
40
|
|
|
85
|
-
const styles = (
|
|
41
|
+
const styles = () => ({
|
|
86
42
|
flow: {
|
|
87
43
|
display: 'flex',
|
|
88
|
-
justifyContent: 'space-between'
|
|
44
|
+
justifyContent: 'space-between'
|
|
89
45
|
},
|
|
90
46
|
container: {
|
|
91
47
|
display: 'flex',
|
|
92
48
|
flexDirection: 'column',
|
|
93
|
-
position: 'relative'
|
|
49
|
+
position: 'relative'
|
|
94
50
|
},
|
|
95
51
|
contentContainer: {
|
|
96
|
-
padding:
|
|
52
|
+
padding: '32px 16px 0 16px'
|
|
97
53
|
},
|
|
98
54
|
configContainer: {
|
|
99
55
|
flex: '1',
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
marginLeft: theme.spacing.unit * 2,
|
|
103
|
-
},
|
|
56
|
+
marginRight: '20px'
|
|
57
|
+
}
|
|
104
58
|
});
|
|
105
59
|
|
|
106
60
|
export default withStyles(styles)(RawLayoutContents);
|
|
@@ -2,34 +2,30 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { withStyles } from '@material-ui/core/styles';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
|
|
6
5
|
export class SettingsBox extends React.Component {
|
|
7
6
|
static propTypes = {
|
|
8
7
|
classes: PropTypes.object.isRequired,
|
|
9
8
|
className: PropTypes.string,
|
|
10
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
|
|
9
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired
|
|
11
10
|
};
|
|
12
|
-
|
|
13
11
|
static defaultProps = {};
|
|
14
|
-
|
|
15
12
|
render() {
|
|
16
13
|
const { classes, className, children } = this.props;
|
|
17
|
-
|
|
18
14
|
return <div className={classNames(classes.settingsBox, className)}>{children}</div>;
|
|
19
15
|
}
|
|
20
16
|
}
|
|
21
|
-
const styles = (
|
|
17
|
+
const styles = () => ({
|
|
22
18
|
settingsBox: {
|
|
23
|
-
backgroundColor:
|
|
24
|
-
border:
|
|
19
|
+
backgroundColor: '#FFF',
|
|
20
|
+
border: '2px solid #EEE',
|
|
25
21
|
display: 'flex',
|
|
26
22
|
flexDirection: 'column',
|
|
27
23
|
justifyContent: 'flex-start',
|
|
28
24
|
minWidth: '275px',
|
|
29
25
|
maxWidth: '300px',
|
|
30
|
-
padding: '
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
padding: '24px 8px 24px 24px',
|
|
27
|
+
width: '80%',
|
|
28
|
+
zIndex: 99
|
|
29
|
+
}
|
|
33
30
|
});
|
|
34
|
-
|
|
35
31
|
export default withStyles(styles)(SettingsBox);
|
package/src/mui-box/index.jsx
CHANGED
|
@@ -6,7 +6,7 @@ import classNames from 'classnames';
|
|
|
6
6
|
|
|
7
7
|
const log = debug('pie-elements:config-ui:mui-box');
|
|
8
8
|
|
|
9
|
-
const MuiBox = withStyles(
|
|
9
|
+
const MuiBox = withStyles(theme => {
|
|
10
10
|
const light = theme.palette.type === 'light';
|
|
11
11
|
const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
|
|
12
12
|
|
|
@@ -26,10 +26,10 @@ const MuiBox = withStyles((theme) => {
|
|
|
26
26
|
position: 'absolute',
|
|
27
27
|
transition: 'background-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
|
|
28
28
|
pointerEvents: 'none',
|
|
29
|
-
backgroundColor: bottomLineColor
|
|
29
|
+
backgroundColor: bottomLineColor
|
|
30
30
|
},
|
|
31
31
|
'&:hover:before': {
|
|
32
|
-
height: '2px'
|
|
32
|
+
height: '2px'
|
|
33
33
|
},
|
|
34
34
|
'&:after': {
|
|
35
35
|
left: 0,
|
|
@@ -41,14 +41,14 @@ const MuiBox = withStyles((theme) => {
|
|
|
41
41
|
transform: 'scaleX(0)',
|
|
42
42
|
transition: 'transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms',
|
|
43
43
|
pointerEvents: 'none',
|
|
44
|
-
backgroundColor: theme.palette.primary[theme.palette.type]
|
|
45
|
-
}
|
|
44
|
+
backgroundColor: theme.palette.primary[theme.palette.type] //'#304ffe'
|
|
45
|
+
}
|
|
46
46
|
},
|
|
47
47
|
focused: {
|
|
48
48
|
'&:after': {
|
|
49
|
-
transform: 'scaleX(1)'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
49
|
+
transform: 'scaleX(1)'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
52
|
};
|
|
53
53
|
})(({ children, classes, focused }) => {
|
|
54
54
|
const names = classNames(classes.muiBox, focused && classes.focused);
|
|
@@ -58,7 +58,7 @@ const MuiBox = withStyles((theme) => {
|
|
|
58
58
|
|
|
59
59
|
MuiBox.propTypes = {
|
|
60
60
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
61
|
-
focused: PropTypes.bool.isRequired
|
|
61
|
+
focused: PropTypes.bool.isRequired
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
export default MuiBox;
|