@pie-element/complex-rubric 3.7.8-next.74 → 3.7.8-next.80
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/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/CHANGELOG.md +402 -676
- package/configure/node_modules/@pie-element/multi-trait-rubric/README.md +55 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/configure/CHANGELOG.md +366 -574
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js +584 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js +152 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/configure/lib/index.js +89 -63
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js +546 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js +361 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js +556 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js +380 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js +296 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js +118 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/configure/package.json +18 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.json +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/controller/CHANGELOG.md +172 -165
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/controller/lib/defaults.js +8 -5
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js +215 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js +13 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/controller/package.json +15 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json +1628 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json.md +1202 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/docs/demo/config.js +2 -2
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/generate.js +117 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/index.html +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/session.js +6 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json +861 -0
- package/configure/node_modules/@pie-element/{rubric/docs/config-schema.json.md → multi-trait-rubric/docs/pie-schema.json.md} +284 -202
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/lib/index.js +27 -30
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js +164 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js +330 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js.map +1 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js +103 -0
- package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js.map +1 -0
- package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/package.json +10 -12
- package/configure/package.json +5 -5
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/manifest.json +4 -4
- package/module/print.js +1 -1
- package/package.json +4 -4
- package/configure/node_modules/@pie-element/rubric/CHANGELOG.json +0 -257
- package/configure/node_modules/@pie-element/rubric/README.md +0 -3
- package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +0 -197
- package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js +0 -68
- package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/main.js +0 -162
- package/configure/node_modules/@pie-element/rubric/configure/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js +0 -573
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js +0 -24
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js +0 -172
- package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/configure/package.json +0 -17
- package/configure/node_modules/@pie-element/rubric/configure/src/__tests__/index.test.jsx +0 -167
- package/configure/node_modules/@pie-element/rubric/configure/src/defaults.js +0 -42
- package/configure/node_modules/@pie-element/rubric/configure/src/index.js +0 -129
- package/configure/node_modules/@pie-element/rubric/configure/src/main.jsx +0 -89
- package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/authoring.jsx +0 -449
- package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/index.js +0 -9
- package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/point-menu.jsx +0 -94
- package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.json +0 -17
- package/configure/node_modules/@pie-element/rubric/controller/lib/defaults.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +0 -59
- package/configure/node_modules/@pie-element/rubric/controller/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/controller/package.json +0 -13
- package/configure/node_modules/@pie-element/rubric/controller/src/__tests__/index.test.js +0 -33
- package/configure/node_modules/@pie-element/rubric/controller/src/defaults.js +0 -8
- package/configure/node_modules/@pie-element/rubric/controller/src/index.js +0 -41
- package/configure/node_modules/@pie-element/rubric/docs/config-schema.json +0 -712
- package/configure/node_modules/@pie-element/rubric/docs/demo/generate.js +0 -8
- package/configure/node_modules/@pie-element/rubric/docs/demo/index.html +0 -2
- package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json +0 -391
- package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json.md +0 -281
- package/configure/node_modules/@pie-element/rubric/lib/index.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/lib/main.js +0 -270
- package/configure/node_modules/@pie-element/rubric/lib/main.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/lib/print.js +0 -114
- package/configure/node_modules/@pie-element/rubric/lib/print.js.map +0 -1
- package/configure/node_modules/@pie-element/rubric/module/configure.js +0 -42661
- package/configure/node_modules/@pie-element/rubric/module/controller.js +0 -113
- package/configure/node_modules/@pie-element/rubric/module/demo.js +0 -33
- package/configure/node_modules/@pie-element/rubric/module/element.js +0 -7980
- package/configure/node_modules/@pie-element/rubric/module/index.html +0 -21
- package/configure/node_modules/@pie-element/rubric/module/manifest.json +0 -14
- package/configure/node_modules/@pie-element/rubric/module/print-demo.js +0 -71
- package/configure/node_modules/@pie-element/rubric/module/print.html +0 -18
- package/configure/node_modules/@pie-element/rubric/module/print.js +0 -7993
- package/configure/node_modules/@pie-element/rubric/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -1815
- package/configure/node_modules/@pie-element/rubric/src/__tests__/rubric-view.test.jsx +0 -49
- package/configure/node_modules/@pie-element/rubric/src/index.js +0 -37
- package/configure/node_modules/@pie-element/rubric/src/main.jsx +0 -196
- package/configure/node_modules/@pie-element/rubric/src/print.js +0 -63
- /package/configure/node_modules/@pie-element/{rubric → multi-trait-rubric}/LICENSE.md +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.TraitsHeaderTile = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
+
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
+
|
|
22
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
+
|
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
|
25
|
+
|
|
26
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
+
|
|
28
|
+
var _styles = require("@material-ui/core/styles");
|
|
29
|
+
|
|
30
|
+
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
31
|
+
|
|
32
|
+
var _Menu = _interopRequireDefault(require("@material-ui/core/Menu"));
|
|
33
|
+
|
|
34
|
+
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
35
|
+
|
|
36
|
+
var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));
|
|
37
|
+
|
|
38
|
+
var _renderUi = require("@pie-lib/pie-toolbox/render-ui");
|
|
39
|
+
|
|
40
|
+
var _common = require("./common");
|
|
41
|
+
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
43
|
+
|
|
44
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
+
|
|
46
|
+
var styles = function styles(theme) {
|
|
47
|
+
return {
|
|
48
|
+
label: {
|
|
49
|
+
textAlign: 'center',
|
|
50
|
+
width: '140px',
|
|
51
|
+
border: 'none',
|
|
52
|
+
margin: theme.spacing.unit,
|
|
53
|
+
padding: '10px 0',
|
|
54
|
+
display: 'flex',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
justifyContent: 'space-around'
|
|
57
|
+
},
|
|
58
|
+
greyHeader: {
|
|
59
|
+
background: _renderUi.color.secondaryBackground(),
|
|
60
|
+
borderRadius: '4px',
|
|
61
|
+
position: 'relative',
|
|
62
|
+
marginBottom: theme.spacing.unit * 2
|
|
63
|
+
},
|
|
64
|
+
primaryBlockGreyHeader: {
|
|
65
|
+
paddingTop: theme.spacing.unit * 1.5
|
|
66
|
+
},
|
|
67
|
+
scorePointErrorText: {
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
fontSize: theme.typography.fontSize - 2,
|
|
70
|
+
color: theme.palette.error.main,
|
|
71
|
+
paddingTop: theme.spacing.unit / 2
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var TraitsHeaderTile = /*#__PURE__*/function (_React$Component) {
|
|
77
|
+
(0, _inherits2["default"])(TraitsHeaderTile, _React$Component);
|
|
78
|
+
|
|
79
|
+
var _super = _createSuper(TraitsHeaderTile);
|
|
80
|
+
|
|
81
|
+
function TraitsHeaderTile() {
|
|
82
|
+
var _this;
|
|
83
|
+
|
|
84
|
+
(0, _classCallCheck2["default"])(this, TraitsHeaderTile);
|
|
85
|
+
|
|
86
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
87
|
+
args[_key] = arguments[_key];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
91
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
92
|
+
anchorEl: null
|
|
93
|
+
});
|
|
94
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onScorePointLabelChange", function (_ref) {
|
|
95
|
+
var scorePointLabel = _ref.scorePointLabel,
|
|
96
|
+
value = _ref.value;
|
|
97
|
+
var _this$props = _this.props,
|
|
98
|
+
scorePointsLabels = _this$props.scorePointsLabels,
|
|
99
|
+
onScaleChange = _this$props.onScaleChange;
|
|
100
|
+
if (value < 0 || value >= scorePointsLabels.length) return;
|
|
101
|
+
scorePointsLabels[value] = scorePointLabel;
|
|
102
|
+
onScaleChange({
|
|
103
|
+
scorePointsLabels: scorePointsLabels
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClick", function (event) {
|
|
107
|
+
return _this.setState({
|
|
108
|
+
anchorEl: event.currentTarget
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClose", function () {
|
|
112
|
+
return _this.setState({
|
|
113
|
+
anchorEl: null
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "scrollToPosition", function (position) {
|
|
117
|
+
return _this.secondaryBlock.scrollTo({
|
|
118
|
+
left: position
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "openMenu", function () {
|
|
122
|
+
_this.props.showDeleteScaleModal();
|
|
123
|
+
|
|
124
|
+
_this.handleClose();
|
|
125
|
+
});
|
|
126
|
+
return _this;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
(0, _createClass2["default"])(TraitsHeaderTile, [{
|
|
130
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
131
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
132
|
+
if (nextProps.currentPosition !== this.props.currentPosition) {
|
|
133
|
+
this.scrollToPosition(nextProps.currentPosition);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "render",
|
|
138
|
+
value: function render() {
|
|
139
|
+
var _this2 = this;
|
|
140
|
+
|
|
141
|
+
var _this$props2 = this.props,
|
|
142
|
+
scorePointsValues = _this$props2.scorePointsValues,
|
|
143
|
+
scorePointsLabels = _this$props2.scorePointsLabels,
|
|
144
|
+
traitLabel = _this$props2.traitLabel,
|
|
145
|
+
classes = _this$props2.classes,
|
|
146
|
+
currentPosition = _this$props2.currentPosition,
|
|
147
|
+
showStandards = _this$props2.showStandards,
|
|
148
|
+
onTraitLabelChange = _this$props2.onTraitLabelChange,
|
|
149
|
+
showDescription = _this$props2.showDescription,
|
|
150
|
+
showLevelTagInput = _this$props2.showLevelTagInput,
|
|
151
|
+
maxPoints = _this$props2.maxPoints,
|
|
152
|
+
updateMaxPointsFieldValue = _this$props2.updateMaxPointsFieldValue,
|
|
153
|
+
scaleIndex = _this$props2.scaleIndex,
|
|
154
|
+
showScorePointLabels = _this$props2.showScorePointLabels,
|
|
155
|
+
secondaryBlockWidth = _this$props2.secondaryBlockWidth,
|
|
156
|
+
setSecondaryBlockRef = _this$props2.setSecondaryBlockRef,
|
|
157
|
+
spellCheck = _this$props2.spellCheck,
|
|
158
|
+
uploadSoundSupport = _this$props2.uploadSoundSupport,
|
|
159
|
+
maxPointsEnabled = _this$props2.maxPointsEnabled,
|
|
160
|
+
_this$props2$mathMlOp = _this$props2.mathMlOptions,
|
|
161
|
+
mathMlOptions = _this$props2$mathMlOp === void 0 ? {} : _this$props2$mathMlOp,
|
|
162
|
+
_this$props2$errors = _this$props2.errors,
|
|
163
|
+
errors = _this$props2$errors === void 0 ? {} : _this$props2$errors,
|
|
164
|
+
maxMaxPoints = _this$props2.maxMaxPoints,
|
|
165
|
+
_this$props2$labelPlu = _this$props2.labelPluginProps,
|
|
166
|
+
labelPluginProps = _this$props2$labelPlu === void 0 ? {} : _this$props2$labelPlu,
|
|
167
|
+
_this$props2$imageSup = _this$props2.imageSupport,
|
|
168
|
+
imageSupport = _this$props2$imageSup === void 0 ? {} : _this$props2$imageSup;
|
|
169
|
+
var anchorEl = this.state.anchorEl;
|
|
170
|
+
return /*#__PURE__*/_react["default"].createElement(_common.Row, {
|
|
171
|
+
className: classes.greyHeader,
|
|
172
|
+
height: showLevelTagInput ? _common.HeaderHeightLarge : _common.HeaderHeight
|
|
173
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.PrimaryBlock, {
|
|
174
|
+
className: classes.primaryBlockGreyHeader
|
|
175
|
+
}, showLevelTagInput && /*#__PURE__*/_react["default"].createElement(_common.SimpleInput, {
|
|
176
|
+
markup: traitLabel || 'Trait',
|
|
177
|
+
onChange: onTraitLabelChange,
|
|
178
|
+
pluginProps: labelPluginProps,
|
|
179
|
+
spellCheck: spellCheck,
|
|
180
|
+
label: "Level Label",
|
|
181
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
182
|
+
mathMlOptions: mathMlOptions,
|
|
183
|
+
imageSupport: imageSupport
|
|
184
|
+
}), /*#__PURE__*/_react["default"].createElement(_common.ScaleSettings, null, /*#__PURE__*/_react["default"].createElement("div", null, "Scale ", scaleIndex + 1), maxPointsEnabled && /*#__PURE__*/_react["default"].createElement(_common.MaxPointsPicker, {
|
|
185
|
+
maxPoints: maxPoints,
|
|
186
|
+
maxMaxPoints: maxMaxPoints,
|
|
187
|
+
onChange: updateMaxPointsFieldValue
|
|
188
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
189
|
+
"aria-label": "more",
|
|
190
|
+
"aria-controls": "long-menu",
|
|
191
|
+
"aria-haspopup": "true",
|
|
192
|
+
onClick: this.handleClick
|
|
193
|
+
}, /*#__PURE__*/_react["default"].createElement(_MoreVert["default"], null)), /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
|
|
194
|
+
id: "long-menu",
|
|
195
|
+
anchorEl: anchorEl,
|
|
196
|
+
keepMounted: true,
|
|
197
|
+
open: !!anchorEl,
|
|
198
|
+
onClose: this.handleClose
|
|
199
|
+
}, ['Remove Scale'].map(function (option) {
|
|
200
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
201
|
+
key: option,
|
|
202
|
+
onClick: _this2.openMenu
|
|
203
|
+
}, option);
|
|
204
|
+
}))))), /*#__PURE__*/_react["default"].createElement(_common.SecondaryBlock, {
|
|
205
|
+
setRef: function setRef(ref) {
|
|
206
|
+
if (ref) {
|
|
207
|
+
_this2.secondaryBlock = ref;
|
|
208
|
+
setSecondaryBlockRef(ref);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
width: "".concat(secondaryBlockWidth, "px")
|
|
212
|
+
}, showStandards && /*#__PURE__*/_react["default"].createElement(_common.Block, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
213
|
+
className: classes.label
|
|
214
|
+
}, "Standard(s)")), showDescription && /*#__PURE__*/_react["default"].createElement(_common.Block, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
215
|
+
className: classes.label
|
|
216
|
+
}, "Description")), scorePointsValues.map(function (scorePointsValue, index) {
|
|
217
|
+
var adjustedBlockWidth = _common.BlockWidth + 2 * 8; // 8 is padding
|
|
218
|
+
|
|
219
|
+
var remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 128;
|
|
220
|
+
var value = scorePointsValues.length - index - 1;
|
|
221
|
+
var scoreDescriptor;
|
|
222
|
+
var error;
|
|
223
|
+
|
|
224
|
+
try {
|
|
225
|
+
scoreDescriptor = scorePointsLabels[value] || '';
|
|
226
|
+
error = errors[value] || '';
|
|
227
|
+
} catch (e) {
|
|
228
|
+
scoreDescriptor = '';
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return /*#__PURE__*/_react["default"].createElement(_common.Block, {
|
|
232
|
+
key: "secondary-block-part-".concat(index)
|
|
233
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.ScorePoint, {
|
|
234
|
+
scorePointsValue: scorePointsValue,
|
|
235
|
+
error: error,
|
|
236
|
+
scoreDescriptor: scoreDescriptor,
|
|
237
|
+
pluginProps: labelPluginProps,
|
|
238
|
+
showScorePointLabels: showScorePointLabels,
|
|
239
|
+
onChange: function onChange(scorePointLabel) {
|
|
240
|
+
return _this2.onScorePointLabelChange({
|
|
241
|
+
scorePointLabel: scorePointLabel,
|
|
242
|
+
value: value
|
|
243
|
+
});
|
|
244
|
+
},
|
|
245
|
+
alignToRight: remainingSpace < 296 && scorePointsValue < maxPoints // 296 is the space required for the toolbar
|
|
246
|
+
,
|
|
247
|
+
spellCheck: spellCheck,
|
|
248
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
249
|
+
mathMlOptions: mathMlOptions,
|
|
250
|
+
imageSupport: imageSupport
|
|
251
|
+
}), error && /*#__PURE__*/_react["default"].createElement("div", {
|
|
252
|
+
className: classes.scorePointErrorText
|
|
253
|
+
}, error));
|
|
254
|
+
})));
|
|
255
|
+
}
|
|
256
|
+
}]);
|
|
257
|
+
return TraitsHeaderTile;
|
|
258
|
+
}(_react["default"].Component);
|
|
259
|
+
|
|
260
|
+
exports.TraitsHeaderTile = TraitsHeaderTile;
|
|
261
|
+
(0, _defineProperty2["default"])(TraitsHeaderTile, "propTypes", {
|
|
262
|
+
maxPointsEnabled: _propTypes["default"].bool,
|
|
263
|
+
spellCheck: _propTypes["default"].bool,
|
|
264
|
+
errors: _propTypes["default"].object
|
|
265
|
+
});
|
|
266
|
+
TraitsHeaderTile.propTypes = {
|
|
267
|
+
classes: _propTypes["default"].object.isRequired,
|
|
268
|
+
onTraitLabelChange: _propTypes["default"].func,
|
|
269
|
+
onScaleChange: _propTypes["default"].func,
|
|
270
|
+
scorePointsValues: _propTypes["default"].arrayOf(_propTypes["default"].number),
|
|
271
|
+
scorePointsLabels: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
272
|
+
traitLabel: _propTypes["default"].string,
|
|
273
|
+
showStandards: _propTypes["default"].bool,
|
|
274
|
+
showLevelTagInput: _propTypes["default"].bool,
|
|
275
|
+
showDescription: _propTypes["default"].bool,
|
|
276
|
+
maxPoints: _propTypes["default"].number,
|
|
277
|
+
updateMaxPointsFieldValue: _propTypes["default"].func,
|
|
278
|
+
scaleIndex: _propTypes["default"].number,
|
|
279
|
+
currentPosition: _propTypes["default"].number,
|
|
280
|
+
secondaryBlockWidth: _propTypes["default"].number,
|
|
281
|
+
showDeleteScaleModal: _propTypes["default"].func,
|
|
282
|
+
showScorePointLabels: _propTypes["default"].bool,
|
|
283
|
+
setSecondaryBlockRef: _propTypes["default"].func,
|
|
284
|
+
uploadSoundSupport: _propTypes["default"].object,
|
|
285
|
+
maxMaxPoints: _propTypes["default"].number,
|
|
286
|
+
labelPluginProps: _propTypes["default"].object,
|
|
287
|
+
imageSupport: _propTypes["default"].shape({
|
|
288
|
+
add: _propTypes["default"].func.isRequired,
|
|
289
|
+
"delete": _propTypes["default"].func.isRequired
|
|
290
|
+
})
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
var _default = (0, _styles.withStyles)(styles)(TraitsHeaderTile);
|
|
294
|
+
|
|
295
|
+
exports["default"] = _default;
|
|
296
|
+
//# sourceMappingURL=traitsHeader.js.map
|
package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/traitsHeader.jsx"],"names":["styles","theme","label","textAlign","width","border","margin","spacing","unit","padding","display","alignItems","justifyContent","greyHeader","background","color","secondaryBackground","borderRadius","position","marginBottom","primaryBlockGreyHeader","paddingTop","scorePointErrorText","fontSize","typography","palette","error","main","TraitsHeaderTile","anchorEl","scorePointLabel","value","props","scorePointsLabels","onScaleChange","length","event","setState","currentTarget","secondaryBlock","scrollTo","left","showDeleteScaleModal","handleClose","nextProps","currentPosition","scrollToPosition","scorePointsValues","traitLabel","classes","showStandards","onTraitLabelChange","showDescription","showLevelTagInput","maxPoints","updateMaxPointsFieldValue","scaleIndex","showScorePointLabels","secondaryBlockWidth","setSecondaryBlockRef","spellCheck","uploadSoundSupport","maxPointsEnabled","mathMlOptions","errors","maxMaxPoints","labelPluginProps","imageSupport","state","HeaderHeightLarge","HeaderHeight","handleClick","map","option","openMenu","ref","scorePointsValue","index","adjustedBlockWidth","BlockWidth","remainingSpace","scoreDescriptor","e","onScorePointLabelChange","React","Component","PropTypes","bool","object","propTypes","isRequired","func","arrayOf","number","string","shape","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAcA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,SAAS,EAAE,QADN;AAELC,MAAAA,KAAK,EAAE,OAFF;AAGLC,MAAAA,MAAM,EAAE,MAHH;AAILC,MAAAA,MAAM,EAAEL,KAAK,CAACM,OAAN,CAAcC,IAJjB;AAKLC,MAAAA,OAAO,EAAE,QALJ;AAMLC,MAAAA,OAAO,EAAE,MANJ;AAOLC,MAAAA,UAAU,EAAE,QAPP;AAQLC,MAAAA,cAAc,EAAE;AARX,KADkB;AAWzBC,IAAAA,UAAU,EAAE;AACVC,MAAAA,UAAU,EAAEC,gBAAMC,mBAAN,EADF;AAEVC,MAAAA,YAAY,EAAE,KAFJ;AAGVC,MAAAA,QAAQ,EAAE,UAHA;AAIVC,MAAAA,YAAY,EAAElB,KAAK,CAACM,OAAN,CAAcC,IAAd,GAAqB;AAJzB,KAXa;AAiBzBY,IAAAA,sBAAsB,EAAE;AACtBC,MAAAA,UAAU,EAAEpB,KAAK,CAACM,OAAN,CAAcC,IAAd,GAAqB;AADX,KAjBC;AAoBzBc,IAAAA,mBAAmB,EAAE;AACnBJ,MAAAA,QAAQ,EAAE,UADS;AAEnBK,MAAAA,QAAQ,EAAEtB,KAAK,CAACuB,UAAN,CAAiBD,QAAjB,GAA4B,CAFnB;AAGnBR,MAAAA,KAAK,EAAEd,KAAK,CAACwB,OAAN,CAAcC,KAAd,CAAoBC,IAHR;AAInBN,MAAAA,UAAU,EAAEpB,KAAK,CAACM,OAAN,CAAcC,IAAd,GAAqB;AAJd;AApBI,GAAZ;AAA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AoB,EAAE4C,sBAAUK,IAfL;AAgB3BlC,EAAAA,oBAAoB,EAAE6B,sBAAUC,IAhBL;AAiB3B5B,EAAAA,oBAAoB,EAAE2B,sBAAUK,IAjBL;AAkB3B9B,EAAAA,kBAAkB,EAAEyB,sBAAUE,MAlBH;AAmB3BvB,EAAAA,YAAY,EAAEqB,sBAAUO,MAnBG;AAoB3B3B,EAAAA,gBAAgB,EAAEoB,sBAAUE,MApBD;AAqB3BrB,EAAAA,YAAY,EAAEmB,sBAAUS,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEV,sBAAUK,IAAV,CAAeD,UADQ;AAE5B,cAAQJ,sBAAUK,IAAV,CAAeD;AAFK,GAAhB;AArBa,CAA7B;;eA2Be,wBAAW1F,MAAX,EAAmB4B,gBAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { withStyles } from '@material-ui/core/styles';\nimport IconButton from '@material-ui/core/IconButton';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport { color } from '@pie-lib/pie-toolbox/render-ui';\n\nimport {\n Block,\n BlockWidth,\n PrimaryBlock,\n Row,\n SecondaryBlock,\n ScorePoint,\n MaxPointsPicker,\n SimpleInput,\n ScaleSettings,\n HeaderHeight,\n HeaderHeightLarge,\n} from './common';\n\nconst styles = (theme) => ({\n label: {\n textAlign: 'center',\n width: '140px',\n border: 'none',\n margin: theme.spacing.unit,\n padding: '10px 0',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-around',\n },\n greyHeader: {\n background: color.secondaryBackground(),\n borderRadius: '4px',\n position: 'relative',\n marginBottom: theme.spacing.unit * 2,\n },\n primaryBlockGreyHeader: {\n paddingTop: theme.spacing.unit * 1.5,\n },\n scorePointErrorText: {\n position: 'absolute',\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit / 2,\n },\n});\n\nexport class TraitsHeaderTile extends React.Component {\n static propTypes = {\n maxPointsEnabled: PropTypes.bool,\n spellCheck: PropTypes.bool,\n errors: PropTypes.object,\n };\n\n state = {\n anchorEl: null,\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.currentPosition !== this.props.currentPosition) {\n this.scrollToPosition(nextProps.currentPosition);\n }\n }\n\n onScorePointLabelChange = ({ scorePointLabel, value }) => {\n const { scorePointsLabels, onScaleChange } = this.props;\n\n if (value < 0 || value >= scorePointsLabels.length) return;\n\n scorePointsLabels[value] = scorePointLabel;\n\n onScaleChange({ scorePointsLabels });\n };\n\n handleClick = (event) => this.setState({ anchorEl: event.currentTarget });\n\n handleClose = () => this.setState({ anchorEl: null });\n\n scrollToPosition = (position) => this.secondaryBlock.scrollTo({ left: position });\n\n openMenu = () => {\n this.props.showDeleteScaleModal();\n this.handleClose();\n };\n\n render() {\n const {\n scorePointsValues,\n scorePointsLabels,\n traitLabel,\n classes,\n currentPosition,\n showStandards,\n onTraitLabelChange,\n showDescription,\n showLevelTagInput,\n maxPoints,\n updateMaxPointsFieldValue,\n scaleIndex,\n showScorePointLabels,\n secondaryBlockWidth,\n setSecondaryBlockRef,\n spellCheck,\n uploadSoundSupport,\n maxPointsEnabled,\n mathMlOptions = {},\n errors = {},\n maxMaxPoints,\n labelPluginProps = {},\n imageSupport = {},\n } = this.props;\n const { anchorEl } = this.state;\n\n return (\n <Row className={classes.greyHeader} height={showLevelTagInput ? HeaderHeightLarge : HeaderHeight}>\n <PrimaryBlock className={classes.primaryBlockGreyHeader}>\n {showLevelTagInput && (\n <SimpleInput\n markup={traitLabel || 'Trait'}\n onChange={onTraitLabelChange}\n pluginProps={labelPluginProps}\n spellCheck={spellCheck}\n label=\"Level Label\"\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n )}\n\n <ScaleSettings>\n <div>Scale {scaleIndex + 1}</div>\n\n {maxPointsEnabled && (\n <MaxPointsPicker maxPoints={maxPoints} maxMaxPoints={maxMaxPoints} onChange={updateMaxPointsFieldValue} />\n )}\n\n <div>\n <IconButton aria-label=\"more\" aria-controls=\"long-menu\" aria-haspopup=\"true\" onClick={this.handleClick}>\n <MoreVertIcon />\n </IconButton>\n <Menu id=\"long-menu\" anchorEl={anchorEl} keepMounted open={!!anchorEl} onClose={this.handleClose}>\n {['Remove Scale'].map((option) => (\n <MenuItem key={option} onClick={this.openMenu}>\n {option}\n </MenuItem>\n ))}\n </Menu>\n </div>\n </ScaleSettings>\n </PrimaryBlock>\n\n <SecondaryBlock\n setRef={(ref) => {\n if (ref) {\n this.secondaryBlock = ref;\n setSecondaryBlockRef(ref);\n }\n }}\n width={`${secondaryBlockWidth}px`}\n >\n {showStandards && (\n <Block>\n <div className={classes.label}>Standard(s)</div>\n </Block>\n )}\n\n {showDescription && (\n <Block>\n <div className={classes.label}>Description</div>\n </Block>\n )}\n\n {scorePointsValues.map((scorePointsValue, index) => {\n const adjustedBlockWidth = BlockWidth + 2 * 8; // 8 is padding\n const remainingSpace = secondaryBlockWidth - adjustedBlockWidth * index + currentPosition - 128;\n const value = scorePointsValues.length - index - 1;\n let scoreDescriptor;\n let error;\n\n try {\n scoreDescriptor = scorePointsLabels[value] || '';\n error = errors[value] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <Block key={`secondary-block-part-${index}`}>\n <ScorePoint\n scorePointsValue={scorePointsValue}\n error={error}\n scoreDescriptor={scoreDescriptor}\n pluginProps={labelPluginProps}\n showScorePointLabels={showScorePointLabels}\n onChange={(scorePointLabel) => this.onScorePointLabelChange({ scorePointLabel, value })}\n alignToRight={remainingSpace < 296 && scorePointsValue < maxPoints} // 296 is the space required for the toolbar\n spellCheck={spellCheck}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n imageSupport={imageSupport}\n />\n {error && <div className={classes.scorePointErrorText}>{error}</div>}\n </Block>\n );\n })}\n </SecondaryBlock>\n </Row>\n );\n }\n}\n\nTraitsHeaderTile.propTypes = {\n classes: PropTypes.object.isRequired,\n onTraitLabelChange: PropTypes.func,\n onScaleChange: PropTypes.func,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n showStandards: PropTypes.bool,\n showLevelTagInput: PropTypes.bool,\n showDescription: PropTypes.bool,\n maxPoints: PropTypes.number,\n updateMaxPointsFieldValue: PropTypes.func,\n scaleIndex: PropTypes.number,\n currentPosition: PropTypes.number,\n secondaryBlockWidth: PropTypes.number,\n showDeleteScaleModal: PropTypes.func,\n showScorePointLabels: PropTypes.bool,\n setSecondaryBlockRef: PropTypes.func,\n uploadSoundSupport: PropTypes.object,\n maxMaxPoints: PropTypes.number,\n labelPluginProps: PropTypes.object,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n};\n\nexport default withStyles(styles)(TraitsHeaderTile);\n"],"file":"traitsHeader.js"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.filteredDefaultPlugins = exports.addOrRemoveScaleColumn = void 0;
|
|
9
|
+
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _editableHtml = require("@pie-lib/pie-toolbox/editable-html");
|
|
17
|
+
|
|
18
|
+
var _modals = require("./modals");
|
|
19
|
+
|
|
20
|
+
var _excluded = ["scorePointsDescriptors"],
|
|
21
|
+
_excluded2 = ["scorePointsDescriptors"],
|
|
22
|
+
_excluded3 = ["scorePointsDescriptors"],
|
|
23
|
+
_excluded4 = ["scorePointsDescriptors"];
|
|
24
|
+
|
|
25
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
+
|
|
27
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
|
+
|
|
29
|
+
var filteredDefaultPlugins = (_editableHtml.DEFAULT_PLUGINS || []).filter(function (p) {
|
|
30
|
+
return p !== 'table' && p !== 'bulleted-list' && p !== 'numbered-list';
|
|
31
|
+
});
|
|
32
|
+
exports.filteredDefaultPlugins = filteredDefaultPlugins;
|
|
33
|
+
|
|
34
|
+
var addOrRemoveScaleColumn = function addOrRemoveScaleColumn(scales, excludeZeroType) {
|
|
35
|
+
if (!scales || !scales.length) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return scales.reduce(function (acc, scale) {
|
|
40
|
+
var _ref = scale || {},
|
|
41
|
+
scorePointsLabels = _ref.scorePointsLabels,
|
|
42
|
+
traits = _ref.traits;
|
|
43
|
+
|
|
44
|
+
if (scorePointsLabels.length < 1) {
|
|
45
|
+
return acc;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
switch (excludeZeroType) {
|
|
49
|
+
case _modals.excludeZeroTypes.remove0:
|
|
50
|
+
{
|
|
51
|
+
// removes column 0
|
|
52
|
+
scorePointsLabels = scorePointsLabels.slice(1);
|
|
53
|
+
traits = traits.map(function (_ref2) {
|
|
54
|
+
var scorePointsDescriptors = _ref2.scorePointsDescriptors,
|
|
55
|
+
trait = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
|
|
56
|
+
return _objectSpread(_objectSpread({}, trait), {}, {
|
|
57
|
+
scorePointsDescriptors: scorePointsDescriptors.slice(1)
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
case _modals.excludeZeroTypes.add0:
|
|
64
|
+
{
|
|
65
|
+
// adds empty column at start
|
|
66
|
+
scorePointsLabels = [''].concat((0, _toConsumableArray2["default"])(scorePointsLabels));
|
|
67
|
+
traits = traits.map(function (_ref3) {
|
|
68
|
+
var scorePointsDescriptors = _ref3.scorePointsDescriptors,
|
|
69
|
+
trait = (0, _objectWithoutProperties2["default"])(_ref3, _excluded2);
|
|
70
|
+
return _objectSpread(_objectSpread({}, trait), {}, {
|
|
71
|
+
scorePointsDescriptors: [''].concat((0, _toConsumableArray2["default"])(scorePointsDescriptors))
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
case _modals.excludeZeroTypes.shiftLeft:
|
|
78
|
+
{
|
|
79
|
+
// removes last column
|
|
80
|
+
scorePointsLabels = scorePointsLabels.slice(0, -1);
|
|
81
|
+
traits = traits.map(function (_ref4) {
|
|
82
|
+
var scorePointsDescriptors = _ref4.scorePointsDescriptors,
|
|
83
|
+
trait = (0, _objectWithoutProperties2["default"])(_ref4, _excluded3);
|
|
84
|
+
return _objectSpread(_objectSpread({}, trait), {}, {
|
|
85
|
+
scorePointsDescriptors: scorePointsDescriptors.slice(0, -1)
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
case _modals.excludeZeroTypes.shiftRight:
|
|
92
|
+
{
|
|
93
|
+
// adds empty column at end
|
|
94
|
+
scorePointsLabels = [].concat((0, _toConsumableArray2["default"])(scorePointsLabels), ['']);
|
|
95
|
+
traits = traits.map(function (_ref5) {
|
|
96
|
+
var scorePointsDescriptors = _ref5.scorePointsDescriptors,
|
|
97
|
+
trait = (0, _objectWithoutProperties2["default"])(_ref5, _excluded4);
|
|
98
|
+
return _objectSpread(_objectSpread({}, trait), {}, {
|
|
99
|
+
scorePointsDescriptors: [].concat((0, _toConsumableArray2["default"])(scorePointsDescriptors), [''])
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
default:
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
acc.push(_objectSpread(_objectSpread({}, scale), {}, {
|
|
110
|
+
scorePointsLabels: scorePointsLabels,
|
|
111
|
+
traits: traits
|
|
112
|
+
}));
|
|
113
|
+
return acc;
|
|
114
|
+
}, []);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
exports.addOrRemoveScaleColumn = addOrRemoveScaleColumn;
|
|
118
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.js"],"names":["filteredDefaultPlugins","DEFAULT_PLUGINS","filter","p","addOrRemoveScaleColumn","scales","excludeZeroType","length","reduce","acc","scale","scorePointsLabels","traits","excludeZeroTypes","remove0","slice","map","scorePointsDescriptors","trait","add0","shiftLeft","shiftRight","push"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;;;;;;;;;;AAEO,IAAMA,sBAAsB,GAAG,CAACC,iCAAmB,EAApB,EAAwBC,MAAxB,CACpC,UAACC,CAAD;AAAA,SAAOA,CAAC,KAAK,OAAN,IAAiBA,CAAC,KAAK,eAAvB,IAA0CA,C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B,CAAwB,CAAxB,EAA2B,CAAC,CAA5B,CAApB;AACAH,UAAAA,MAAM,GAAGA,MAAM,CAACI,GAAP,CAAW;AAAA,gBAAGC,sBAAH,SAAGA,sBAAH;AAAA,gBAA8BC,KAA9B;AAAA,mDACfA,KADe;AAElBD,cAAAA,sBAAsB,EAAEA,sBAAsB,CAACF,KAAvB,CAA6B,CAA7B,EAAgC,CAAC,CAAjC;AAFN;AAAA,WAAX,CAAT;AAKA;AACD;;AAED,WAAKF,yBAAiBQ,UAAtB;AAAkC;AAChC;AACAV,UAAAA,iBAAiB,iDAAOA,iBAAP,IAA0B,EAA1B,EAAjB;AACAC,UAAAA,MAAM,GAAGA,MAAM,CAACI,GAAP,CAAW;AAAA,gBAAGC,sBAAH,SAAGA,sBAAH;AAAA,gBAA8BC,KAA9B;AAAA,mDACfA,KADe;AAElBD,cAAAA,sBAAsB,gDAAMA,sBAAN,IAA8B,EAA9B;AAFJ;AAAA,WAAX,CAAT;AAKA;AACD;;AAED;AACE;AA9CJ;;AAiDAR,IAAAA,GAAG,CAACa,IAAJ,iCAAcZ,KAAd;AAAqBC,MAAAA,iBAAiB,EAAjBA,iBAArB;AAAwCC,MAAAA,MAAM,EAANA;AAAxC;AAEA,WAAOH,GAAP;AACD,GA3DM,EA2DJ,EA3DI,CAAP;AA4DD,CAjEM","sourcesContent":["import { DEFAULT_PLUGINS } from '@pie-lib/pie-toolbox/editable-html';\nimport { excludeZeroTypes } from './modals';\n\nexport const filteredDefaultPlugins = (DEFAULT_PLUGINS || []).filter(\n (p) => p !== 'table' && p !== 'bulleted-list' && p !== 'numbered-list',\n);\n\nexport const addOrRemoveScaleColumn = (scales, excludeZeroType) => {\n if (!scales || !scales.length) {\n return [];\n }\n\n return scales.reduce((acc, scale) => {\n let { scorePointsLabels, traits } = scale || {};\n\n if (scorePointsLabels.length < 1) {\n return acc;\n }\n\n switch (excludeZeroType) {\n case excludeZeroTypes.remove0: {\n // removes column 0\n scorePointsLabels = scorePointsLabels.slice(1);\n traits = traits.map(({ scorePointsDescriptors, ...trait }) => ({\n ...trait,\n scorePointsDescriptors: scorePointsDescriptors.slice(1),\n }));\n\n break;\n }\n\n case excludeZeroTypes.add0: {\n // adds empty column at start\n scorePointsLabels = ['', ...scorePointsLabels];\n traits = traits.map(({ scorePointsDescriptors, ...trait }) => ({\n ...trait,\n scorePointsDescriptors: ['', ...scorePointsDescriptors],\n }));\n\n break;\n }\n\n case excludeZeroTypes.shiftLeft: {\n // removes last column\n scorePointsLabels = scorePointsLabels.slice(0, -1);\n traits = traits.map(({ scorePointsDescriptors, ...trait }) => ({\n ...trait,\n scorePointsDescriptors: scorePointsDescriptors.slice(0, -1),\n }));\n\n break;\n }\n\n case excludeZeroTypes.shiftRight: {\n // adds empty column at end\n scorePointsLabels = [...scorePointsLabels, ''];\n traits = traits.map(({ scorePointsDescriptors, ...trait }) => ({\n ...trait,\n scorePointsDescriptors: [...scorePointsDescriptors, ''],\n }));\n\n break;\n }\n\n default:\n break;\n }\n\n acc.push({ ...scale, scorePointsLabels, traits });\n\n return acc;\n }, []);\n};\n"],"file":"utils.js"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pie-element/multi-trait-rubric-configure",
|
|
3
|
+
"version": "4.5.9",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"module": "src/index.js",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@material-ui/core": "^3.9.2",
|
|
9
|
+
"@material-ui/icons": "^3.0.1",
|
|
10
|
+
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
11
|
+
"@pie-lib/pie-toolbox": "2.25.2",
|
|
12
|
+
"debug": "^3.1.0",
|
|
13
|
+
"lodash": "^4.17.15",
|
|
14
|
+
"prop-types": "^15.6.2",
|
|
15
|
+
"react": "^16.8.1",
|
|
16
|
+
"react-dom": "^16.8.1"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|