@pie-lib/config-ui 11.30.0-mui-update.0 → 11.30.1-beta-1
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 +12 -9
- package/lib/__tests__/choice-utils.test.js +16 -0
- package/lib/__tests__/langs.test.js +55 -0
- package/lib/__tests__/number-text-field.test.js +128 -0
- package/lib/__tests__/settings-panel.test.js +201 -0
- package/lib/__tests__/two-choice.test.js +33 -0
- package/lib/alert-dialog.js +42 -23
- package/lib/alert-dialog.js.map +1 -1
- package/lib/checkbox.js +71 -56
- package/lib/checkbox.js.map +1 -1
- package/lib/choice-configuration/__tests__/feedback-menu.test.js +20 -0
- package/lib/choice-configuration/__tests__/index.test.js +119 -0
- package/lib/choice-configuration/feedback-menu.js +63 -24
- package/lib/choice-configuration/feedback-menu.js.map +1 -1
- package/lib/choice-configuration/index.js +257 -201
- package/lib/choice-configuration/index.js.map +1 -1
- package/lib/choice-utils.js +18 -6
- package/lib/choice-utils.js.map +1 -1
- package/lib/feedback-config/__tests__/feedback-config.test.js +78 -0
- package/lib/feedback-config/__tests__/feedback-selector.test.js +71 -0
- package/lib/feedback-config/feedback-selector.js +114 -77
- package/lib/feedback-config/feedback-selector.js.map +1 -1
- package/lib/feedback-config/group.js +40 -26
- package/lib/feedback-config/group.js.map +1 -1
- package/lib/feedback-config/index.js +90 -38
- package/lib/feedback-config/index.js.map +1 -1
- package/lib/form-section.js +33 -24
- package/lib/form-section.js.map +1 -1
- package/lib/help.js +80 -39
- package/lib/help.js.map +1 -1
- package/lib/index.js +31 -1
- package/lib/index.js.map +1 -1
- package/lib/input.js +54 -21
- package/lib/input.js.map +1 -1
- package/lib/inputs.js +95 -61
- package/lib/inputs.js.map +1 -1
- package/lib/langs.js +100 -56
- package/lib/langs.js.map +1 -1
- package/lib/layout/__tests__/config.layout.test.js +33 -0
- package/lib/layout/__tests__/layout-content.test.js +6 -0
- package/lib/layout/config-layout.js +99 -48
- package/lib/layout/config-layout.js.map +1 -1
- package/lib/layout/index.js +3 -0
- package/lib/layout/index.js.map +1 -1
- package/lib/layout/layout-contents.js +101 -72
- package/lib/layout/layout-contents.js.map +1 -1
- package/lib/layout/settings-box.js +56 -27
- package/lib/layout/settings-box.js.map +1 -1
- package/lib/mui-box/index.js +57 -41
- package/lib/mui-box/index.js.map +1 -1
- package/lib/number-text-field-custom.js +161 -79
- package/lib/number-text-field-custom.js.map +1 -1
- package/lib/number-text-field.js +115 -57
- package/lib/number-text-field.js.map +1 -1
- package/lib/radio-with-label.js +31 -23
- package/lib/radio-with-label.js.map +1 -1
- package/lib/settings/display-size.js +32 -16
- package/lib/settings/display-size.js.map +1 -1
- package/lib/settings/index.js +47 -14
- package/lib/settings/index.js.map +1 -1
- package/lib/settings/panel.js +228 -142
- package/lib/settings/panel.js.map +1 -1
- package/lib/settings/settings-radio-label.js +30 -21
- package/lib/settings/settings-radio-label.js.map +1 -1
- package/lib/settings/toggle.js +46 -34
- package/lib/settings/toggle.js.map +1 -1
- package/lib/tabs/index.js +57 -22
- package/lib/tabs/index.js.map +1 -1
- package/lib/tags-input/__tests__/index.test.js +88 -0
- package/lib/tags-input/index.js +99 -50
- package/lib/tags-input/index.js.map +1 -1
- package/lib/two-choice.js +90 -46
- package/lib/two-choice.js.map +1 -1
- package/lib/with-stateful-model.js +31 -8
- package/lib/with-stateful-model.js.map +1 -1
- package/package.json +10 -12
- package/src/__tests__/number-text-field.test.jsx +1 -1
- package/src/alert-dialog.jsx +18 -14
- package/src/checkbox.jsx +46 -42
- package/src/choice-configuration/feedback-menu.jsx +5 -5
- package/src/choice-configuration/index.jsx +193 -205
- package/src/feedback-config/feedback-selector.jsx +53 -51
- package/src/feedback-config/group.jsx +22 -21
- package/src/feedback-config/index.jsx +29 -27
- package/src/form-section.jsx +18 -18
- package/src/help.jsx +28 -20
- package/src/input.jsx +1 -1
- package/src/inputs.jsx +50 -34
- package/src/langs.jsx +46 -40
- package/src/layout/config-layout.jsx +36 -25
- package/src/layout/layout-contents.jsx +34 -34
- package/src/layout/settings-box.jsx +19 -16
- package/src/mui-box/index.jsx +43 -35
- package/src/number-text-field-custom.jsx +36 -30
- package/src/number-text-field.jsx +30 -22
- package/src/radio-with-label.jsx +13 -17
- package/src/settings/display-size.jsx +11 -12
- package/src/settings/panel.jsx +89 -83
- package/src/settings/settings-radio-label.jsx +13 -17
- package/src/settings/toggle.jsx +29 -29
- package/src/tabs/index.jsx +8 -8
- package/src/tags-input/index.jsx +38 -35
- package/src/two-choice.jsx +19 -15
- package/LICENSE.md +0 -5
- package/NEXT.CHANGELOG.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/with-stateful-model.jsx"],"names":["withStatefulModel","Component","Stateful","props","model","setState","onChange","state","React","PropTypes","object","isRequired","func"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,SAAD,EAAe;AAAA,MACjCC,QADiC;AAAA;;AAAA;;AAOrC,sBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,gCAAMA,KAAN;AADiB,mGAWR,UAACC,KAAD,EAAW;AACpB,cAAKC,QAAL,CAAc;AAAED,UAAAA,KAAK,EAALA;AAAF,SAAd,EAAyB,YAAM;AAC7B,gBAAKD,KAAL,CAAWG,QAAX,CAAoB,MAAKC,KAAL,CAAWH,KAA/B;AACD,SAFD;AAGD,OAfkB;AAEjB,YAAKG,KAAL,GAAa;AACXH,QAAAA,KAAK,EAAED,KAAK,CAACC;AADF,OAAb;AAFiB;AAKlB;;AAZoC;AAAA;AAAA,aAcrC,0CAAiCD,KAAjC,EAAwC;AACtC,aAAKE,QAAL,CAAc;AAAED,UAAAA,KAAK,EAAED,KAAK,CAACC;AAAf,SAAd;AACD;AAhBoC;AAAA;AAAA,aAwBrC,kBAAS;AACP,4BAAO,gCAAC,SAAD;AAAW,UAAA,KAAK,EAAE,KAAKG,KAAL,CAAWH,KAA7B;AAAoC,UAAA,QAAQ,EAAE,KAAKE;AAAnD,UAAP;AACD;AA1BoC;AAAA;AAAA,IAChBE,kBAAMP,SADU;;AAAA,mCACjCC,QADiC,eAElB;AACjBE,IAAAA,KAAK,EAAEK,sBAAUC,MAAV,CAAiBC,UADP;AAEjBL,IAAAA,QAAQ,EAAEG,sBAAUG,IAAV,CAAeD;AAFR,GAFkB;AA6BvC,SAAOT,QAAP;AACD,CA9BD;;eAgCeF,iB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst withStatefulModel = (Component) => {\n class Stateful extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n model: props.model,\n };\n }\n\n UNSAFE_componentWillReceiveProps(props) {\n this.setState({ model: props.model });\n }\n\n onChange = (model) => {\n this.setState({ model }, () => {\n this.props.onChange(this.state.model);\n });\n };\n\n render() {\n return <Component model={this.state.model} onChange={this.onChange} />;\n }\n }\n\n return Stateful;\n};\n\nexport default withStatefulModel;\n"],"file":"with-stateful-model.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/config-ui",
|
|
3
|
-
"version": "11.30.
|
|
3
|
+
"version": "11.30.1-beta-1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "src/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,13 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@
|
|
12
|
-
"@
|
|
13
|
-
"@
|
|
14
|
-
"@
|
|
15
|
-
"@pie-lib/
|
|
16
|
-
"@pie-lib/icons": "^2.25.0-mui-update.0",
|
|
17
|
-
"@pie-lib/render-ui": "^4.36.0-mui-update.0",
|
|
11
|
+
"@material-ui/core": "^3.8.3",
|
|
12
|
+
"@material-ui/icons": "^3.0.2",
|
|
13
|
+
"@pie-lib/editable-html-tip-tap": "^1.0.3",
|
|
14
|
+
"@pie-lib/icons": "^2.24.1",
|
|
15
|
+
"@pie-lib/render-ui": "^4.35.1",
|
|
18
16
|
"assert": "^1.4.1",
|
|
19
17
|
"classnames": "^2.2.6",
|
|
20
18
|
"complex.js": "2.1.1",
|
|
@@ -25,11 +23,11 @@
|
|
|
25
23
|
"react-measure": "^2.2.2"
|
|
26
24
|
},
|
|
27
25
|
"devDependencies": {
|
|
28
|
-
"react": "
|
|
29
|
-
"react-dom": "
|
|
26
|
+
"react": "18.2.0",
|
|
27
|
+
"react-dom": "18.2.0"
|
|
30
28
|
},
|
|
31
29
|
"peerDependencies": {
|
|
32
|
-
"react": "
|
|
30
|
+
"react": "18.2.0"
|
|
33
31
|
},
|
|
34
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "ff5ec2ebe11110b7652812a10c6dc230f08e12cb"
|
|
35
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { shallow } from 'enzyme';
|
|
3
3
|
import { NumberTextField } from '../number-text-field';
|
|
4
|
-
import TextField from '@
|
|
4
|
+
import TextField from '@material-ui/core/TextField';
|
|
5
5
|
|
|
6
6
|
describe('NumberTextField', () => {
|
|
7
7
|
describe('render', () => {
|
package/src/alert-dialog.jsx
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@
|
|
4
|
-
import {
|
|
3
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@material-ui/core';
|
|
4
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
fontSize: 'max(1.25rem, 18px)',
|
|
8
|
-
}));
|
|
9
|
-
|
|
10
|
-
const StyledDialogContentText = styled(DialogContentText)(() => ({
|
|
11
|
-
fontSize: 'max(1rem, 14px)',
|
|
12
|
-
}));
|
|
13
|
-
|
|
14
|
-
const AlertDialog = ({ text, title, onClose, onConfirm, open, onCloseText, onConfirmText }) => (
|
|
6
|
+
const AlertDialog = ({ text, title, onClose, onConfirm, open, onCloseText, onConfirmText, classes }) => (
|
|
15
7
|
<Dialog open={open} onClose={onClose}>
|
|
16
|
-
{title && <
|
|
8
|
+
{title && <DialogTitle className={classes.heading}>{title}</DialogTitle>}
|
|
17
9
|
{text && (
|
|
18
10
|
<DialogContent>
|
|
19
|
-
<
|
|
11
|
+
<DialogContentText className={classes.subheading}>{text}</DialogContentText>
|
|
20
12
|
</DialogContent>
|
|
21
13
|
)}
|
|
22
14
|
<DialogActions>
|
|
@@ -47,6 +39,18 @@ AlertDialog.propTypes = {
|
|
|
47
39
|
open: PropTypes.bool,
|
|
48
40
|
onConfirmText: PropTypes.string,
|
|
49
41
|
onCloseText: PropTypes.string,
|
|
42
|
+
classes: PropTypes.object,
|
|
50
43
|
};
|
|
51
44
|
|
|
52
|
-
|
|
45
|
+
const styles = () => ({
|
|
46
|
+
heading: {
|
|
47
|
+
'& h2': {
|
|
48
|
+
fontSize: 'max(1.25rem, 18px)',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
subheading: {
|
|
52
|
+
fontSize: 'max(1rem, 14px)',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export default withStyles(styles)(AlertDialog);
|
package/src/checkbox.jsx
CHANGED
|
@@ -1,50 +1,27 @@
|
|
|
1
|
-
import FormControlLabel from '@
|
|
2
|
-
import MuiCheckbox from '@
|
|
1
|
+
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
2
|
+
import MuiCheckbox from '@material-ui/core/Checkbox';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import grey from '@material-ui/core/colors/grey';
|
|
6
8
|
import { color } from '@pie-lib/render-ui';
|
|
7
|
-
import { grey } from '@mui/material/colors';
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
transform: 'translate(-4%, 2%)',
|
|
16
|
-
color: 'rgba(0,0,0,1.0)',
|
|
17
|
-
...(mini && {
|
|
18
|
-
marginLeft: theme.spacing(1),
|
|
19
|
-
color: grey[700],
|
|
20
|
-
fontSize: theme.typography.fontSize - 3,
|
|
21
|
-
}),
|
|
22
|
-
},
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
const StyledCheckbox = styled(MuiCheckbox)(({ theme, mini, error }) => ({
|
|
26
|
-
color: `${color.tertiary()} !important`,
|
|
27
|
-
...(mini && {
|
|
28
|
-
margin: 0,
|
|
29
|
-
padding: 0,
|
|
30
|
-
width: theme.spacing(3),
|
|
31
|
-
height: theme.spacing(3),
|
|
32
|
-
}),
|
|
33
|
-
...(error && {
|
|
34
|
-
color: `${theme.palette.error.main} !important`,
|
|
35
|
-
}),
|
|
36
|
-
}));
|
|
37
|
-
|
|
38
|
-
const Checkbox = ({ mini, checked, onChange, value, label, error }) => (
|
|
39
|
-
<StyledFormControlLabel
|
|
40
|
-
mini={mini}
|
|
10
|
+
const Checkbox = ({ mini, checked, onChange, value, label, classes, error }) => (
|
|
11
|
+
<FormControlLabel
|
|
12
|
+
className={classNames(classes.mini)}
|
|
13
|
+
classes={{
|
|
14
|
+
label: classNames(classes.label, { [classes.miniLabel]: mini }),
|
|
15
|
+
}}
|
|
41
16
|
control={
|
|
42
|
-
<
|
|
17
|
+
<MuiCheckbox
|
|
43
18
|
checked={checked}
|
|
44
19
|
onChange={onChange}
|
|
45
20
|
value={value}
|
|
46
|
-
|
|
47
|
-
|
|
21
|
+
className={classNames(classes.customColor, {
|
|
22
|
+
[classes.miniCheckbox]: mini,
|
|
23
|
+
[classes.error]: error,
|
|
24
|
+
})}
|
|
48
25
|
/>
|
|
49
26
|
}
|
|
50
27
|
label={label}
|
|
@@ -53,17 +30,44 @@ const Checkbox = ({ mini, checked, onChange, value, label, error }) => (
|
|
|
53
30
|
|
|
54
31
|
Checkbox.propTypes = {
|
|
55
32
|
mini: PropTypes.bool,
|
|
33
|
+
classes: PropTypes.object.isRequired,
|
|
56
34
|
checked: PropTypes.bool.isRequired,
|
|
57
35
|
onChange: PropTypes.func.isRequired,
|
|
58
36
|
value: PropTypes.string,
|
|
59
37
|
label: PropTypes.string.isRequired,
|
|
60
|
-
error: PropTypes.bool,
|
|
61
38
|
};
|
|
62
39
|
|
|
63
40
|
Checkbox.defaultProps = {
|
|
64
41
|
value: '',
|
|
65
42
|
mini: false,
|
|
66
|
-
error: false,
|
|
67
43
|
};
|
|
68
44
|
|
|
69
|
-
export default
|
|
45
|
+
export default withStyles((theme) => ({
|
|
46
|
+
label: {
|
|
47
|
+
fontSize: theme.typography.fontSize - 1,
|
|
48
|
+
transform: 'translate(-4%, 2%)',
|
|
49
|
+
color: 'rgba(0,0,0,1.0)',
|
|
50
|
+
},
|
|
51
|
+
miniCheckbox: {
|
|
52
|
+
margin: 0,
|
|
53
|
+
padding: 0,
|
|
54
|
+
width: theme.spacing.unit * 3,
|
|
55
|
+
height: theme.spacing.unit * 3,
|
|
56
|
+
},
|
|
57
|
+
miniLabel: {
|
|
58
|
+
marginLeft: theme.spacing.unit,
|
|
59
|
+
color: grey[700],
|
|
60
|
+
fontSize: theme.typography.fontSize - 3,
|
|
61
|
+
},
|
|
62
|
+
mini: {
|
|
63
|
+
margin: 0,
|
|
64
|
+
marginLeft: 0,
|
|
65
|
+
padding: 0,
|
|
66
|
+
},
|
|
67
|
+
error: {
|
|
68
|
+
color: theme.palette.error.main,
|
|
69
|
+
},
|
|
70
|
+
customColor: {
|
|
71
|
+
color: `${color.tertiary()} !important`,
|
|
72
|
+
},
|
|
73
|
+
}))(Checkbox);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Menu from '@
|
|
2
|
-
import MenuItem from '@
|
|
3
|
-
import ActionFeedback from '@
|
|
4
|
-
import IconButton from '@
|
|
1
|
+
import Menu from '@material-ui/core/Menu';
|
|
2
|
+
import MenuItem from '@material-ui/core/MenuItem';
|
|
3
|
+
import ActionFeedback from '@material-ui/icons/Feedback';
|
|
4
|
+
import IconButton from '@material-ui/core/IconButton';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
@@ -70,7 +70,7 @@ export default class FeedbackMenu extends React.Component {
|
|
|
70
70
|
const tooltip = t === 'custom' ? 'Custom Feedback' : t === 'default' ? 'Default Feedback' : 'Feedback disabled';
|
|
71
71
|
|
|
72
72
|
const icon = (
|
|
73
|
-
<IconButton className={classes.icon} aria-label={tooltip}
|
|
73
|
+
<IconButton className={classes.icon} aria-label={tooltip}>
|
|
74
74
|
<ActionFeedback color={iconColor} />
|
|
75
75
|
</IconButton>
|
|
76
76
|
);
|