@pie-element/rubric 6.3.4-next.0 → 7.0.0-beta.0
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/configure/lib/defaults.js +2 -3
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +90 -152
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +90 -149
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +11 -7
- package/configure/src/__tests__/index.test.jsx +12 -2
- package/configure/src/index.js +12 -2
- package/configure/src/main.jsx +11 -13
- package/controller/lib/defaults.js +2 -3
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +15 -28
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/lib/index.js +38 -80
- package/lib/index.js.map +1 -1
- package/lib/main.js +182 -244
- package/lib/main.js.map +1 -1
- package/lib/print.js +41 -84
- package/lib/print.js.map +1 -1
- package/package.json +8 -9
- package/src/__tests__/rubric-view.test.jsx +12 -24
- package/src/index.js +14 -3
- package/src/main.jsx +100 -93
- package/src/print.js +13 -2
- package/configure/lib/pie-toolbox-rubric/authoring.js +0 -573
- package/configure/lib/pie-toolbox-rubric/authoring.js.map +0 -1
- package/configure/lib/pie-toolbox-rubric/index.js +0 -24
- package/configure/lib/pie-toolbox-rubric/index.js.map +0 -1
- package/configure/lib/pie-toolbox-rubric/point-menu.js +0 -172
- package/configure/lib/pie-toolbox-rubric/point-menu.js.map +0 -1
- package/configure/src/pie-toolbox-rubric/authoring.jsx +0 -449
- package/configure/src/pie-toolbox-rubric/index.js +0 -9
- package/configure/src/pie-toolbox-rubric/point-menu.jsx +0 -94
- package/module/configure.js +0 -1
- package/module/controller.js +0 -113
- package/module/demo.js +0 -33
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -71
- package/module/print.html +0 -18
- package/module/print.js +0 -1
- package/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -2521
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import Menu from '@material-ui/core/Menu';
|
|
2
|
-
import MenuItem from '@material-ui/core/MenuItem';
|
|
3
|
-
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
|
4
|
-
import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
|
|
5
|
-
import IconButton from '@material-ui/core/IconButton';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
export class IconMenu extends React.Component {
|
|
10
|
-
static propTypes = {
|
|
11
|
-
opts: PropTypes.object,
|
|
12
|
-
onClick: PropTypes.func.isRequired,
|
|
13
|
-
classes: PropTypes.object.isRequired,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
constructor(props) {
|
|
17
|
-
super(props);
|
|
18
|
-
this.state = {
|
|
19
|
-
anchorEl: undefined,
|
|
20
|
-
open: false,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
handleClick = (event) => this.setState({ open: true, anchorEl: event.currentTarget });
|
|
25
|
-
|
|
26
|
-
handleRequestClose = () => this.setState({ open: false });
|
|
27
|
-
|
|
28
|
-
render() {
|
|
29
|
-
const { opts, onClick, classes } = this.props;
|
|
30
|
-
const { open, anchorEl } = this.state;
|
|
31
|
-
const keys = Object.keys(opts) || [];
|
|
32
|
-
|
|
33
|
-
const handleMenuClick = (key) => () => {
|
|
34
|
-
onClick(key);
|
|
35
|
-
this.handleRequestClose();
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const iconColor = open ? 'inherit' : 'disabled';
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div>
|
|
42
|
-
<div onClick={this.handleClick}>
|
|
43
|
-
<IconButton className={classes.icon}>
|
|
44
|
-
{open ? <MoreVertIcon color={iconColor} /> : <MoreHorizIcon color={iconColor} />}
|
|
45
|
-
</IconButton>
|
|
46
|
-
</div>
|
|
47
|
-
<Menu
|
|
48
|
-
id="point-menu"
|
|
49
|
-
anchorEl={anchorEl}
|
|
50
|
-
open={open}
|
|
51
|
-
onClose={this.handleRequestClose}
|
|
52
|
-
style={{ transform: 'translate(-15px, -15px)' }}
|
|
53
|
-
transformOrigin={{
|
|
54
|
-
vertical: 'center',
|
|
55
|
-
horizontal: 'right',
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
{keys.map((k, index) => (
|
|
59
|
-
<MenuItem key={index} onClick={handleMenuClick(k)}>
|
|
60
|
-
{opts[k]}
|
|
61
|
-
</MenuItem>
|
|
62
|
-
))}
|
|
63
|
-
</Menu>
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default class PointMenu extends React.Component {
|
|
70
|
-
static propTypes = {
|
|
71
|
-
onChange: PropTypes.func.isRequired,
|
|
72
|
-
classes: PropTypes.object.isRequired,
|
|
73
|
-
showSampleAnswer: PropTypes.bool.isRequired,
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
static defaultProps = {
|
|
77
|
-
classes: {},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
render() {
|
|
81
|
-
const { onChange, classes, showSampleAnswer } = this.props;
|
|
82
|
-
const sampleText = showSampleAnswer ? 'Provide Sample Response' : 'Remove Sample Response';
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<IconMenu
|
|
86
|
-
onClick={(key) => onChange(key)}
|
|
87
|
-
opts={{
|
|
88
|
-
sample: sampleText,
|
|
89
|
-
}}
|
|
90
|
-
classes={classes}
|
|
91
|
-
/>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
}
|