@pie-element/rubric 6.0.2-esm.0 → 6.2.0-mui-update.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/configure/CHANGELOG.md +19 -0
  3. package/configure/lib/defaults.js +2 -3
  4. package/configure/lib/defaults.js.map +1 -1
  5. package/configure/lib/index.js +90 -152
  6. package/configure/lib/index.js.map +1 -1
  7. package/configure/lib/main.js +90 -149
  8. package/configure/lib/main.js.map +1 -1
  9. package/configure/package.json +10 -7
  10. package/configure/src/index.js +12 -2
  11. package/configure/src/main.jsx +11 -13
  12. package/controller/CHANGELOG.md +16 -0
  13. package/controller/lib/defaults.js +2 -3
  14. package/controller/lib/defaults.js.map +1 -1
  15. package/controller/lib/index.js +15 -28
  16. package/controller/lib/index.js.map +1 -1
  17. package/controller/package.json +1 -1
  18. package/lib/index.js +38 -80
  19. package/lib/index.js.map +1 -1
  20. package/lib/main.js +184 -244
  21. package/lib/main.js.map +1 -1
  22. package/lib/print.js +41 -84
  23. package/lib/print.js.map +1 -1
  24. package/package.json +11 -25
  25. package/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +2350 -1524
  26. package/src/index.js +14 -3
  27. package/src/main.jsx +100 -93
  28. package/src/print.js +13 -2
  29. package/LICENSE.md +0 -5
  30. package/configure/lib/pie-toolbox-rubric/authoring.js +0 -573
  31. package/configure/lib/pie-toolbox-rubric/authoring.js.map +0 -1
  32. package/configure/lib/pie-toolbox-rubric/index.js +0 -24
  33. package/configure/lib/pie-toolbox-rubric/index.js.map +0 -1
  34. package/configure/lib/pie-toolbox-rubric/point-menu.js +0 -172
  35. package/configure/lib/pie-toolbox-rubric/point-menu.js.map +0 -1
  36. package/configure/src/pie-toolbox-rubric/authoring.jsx +0 -449
  37. package/configure/src/pie-toolbox-rubric/index.js +0 -9
  38. package/configure/src/pie-toolbox-rubric/point-menu.jsx +0 -94
  39. package/esm/configure.css +0 -847
  40. package/esm/configure.js +0 -11976
  41. package/esm/configure.js.map +0 -1
  42. package/esm/controller.css +0 -847
  43. package/esm/controller.js +0 -68
  44. package/esm/controller.js.map +0 -1
  45. package/esm/element.css +0 -847
  46. package/esm/element.js +0 -263
  47. package/esm/element.js.map +0 -1
  48. package/esm/print.css +0 -847
  49. package/esm/print.js +0 -298
  50. package/esm/print.js.map +0 -1
  51. package/module/configure.js +0 -1
  52. package/module/controller.js +0 -113
  53. package/module/demo.js +0 -33
  54. package/module/element.js +0 -1
  55. package/module/index.html +0 -21
  56. package/module/manifest.json +0 -10
  57. package/module/print-demo.js +0 -71
  58. package/module/print.html +0 -18
  59. package/module/print.js +0 -1
@@ -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
- }