@pie-element/multi-trait-rubric 6.3.4-next.3 → 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/common.js +374 -533
- package/configure/lib/common.js.map +1 -1
- package/configure/lib/defaults.js +35 -6
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +96 -162
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +346 -437
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/modals.js +178 -333
- package/configure/lib/modals.js.map +1 -1
- package/configure/lib/scale.js +358 -463
- package/configure/lib/scale.js.map +1 -1
- package/configure/lib/trait.js +253 -358
- package/configure/lib/trait.js.map +1 -1
- package/configure/lib/traitsHeader.js +199 -264
- package/configure/lib/traitsHeader.js.map +1 -1
- package/configure/lib/utils.js +42 -73
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +12 -9
- package/controller/lib/defaults.js +2 -3
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +66 -123
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js +1 -3
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +1 -1
- package/lib/index.js +40 -77
- package/lib/index.js.map +1 -1
- package/lib/main.js +99 -140
- package/lib/main.js.map +1 -1
- package/lib/scale.js +217 -299
- package/lib/scale.js.map +1 -1
- package/lib/trait.js +51 -71
- package/lib/trait.js.map +1 -1
- package/package.json +10 -8
- package/esm/configure.js +0 -30404
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -176
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -11204
- package/esm/element.js.map +0 -1
- package/esm/package.json +0 -3
package/lib/scale.js
CHANGED
|
@@ -1,330 +1,248 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
7
|
+
exports.default = void 0;
|
|
24
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
9
|
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
-
|
|
30
|
-
var _styles = require("@material-ui/core/styles");
|
|
31
|
-
|
|
11
|
+
var _styles = require("@mui/material/styles");
|
|
32
12
|
var _renderUi = require("@pie-lib/render-ui");
|
|
33
|
-
|
|
34
13
|
var _trait = _interopRequireDefault(require("./trait"));
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
style: _objectSpread({
|
|
109
|
-
height: 'calc(100% - 1px)',
|
|
110
|
-
top: '1px',
|
|
111
|
-
display: show ? 'flex' : 'none',
|
|
112
|
-
width: '50px',
|
|
113
|
-
margin: 'auto',
|
|
114
|
-
position: 'absolute',
|
|
115
|
-
alignItems: 'center',
|
|
116
|
-
justifyContent: 'center',
|
|
117
|
-
cursor: 'pointer'
|
|
118
|
-
}, extraStyles),
|
|
119
|
-
onClick: onClick
|
|
120
|
-
}, children);
|
|
121
|
-
};
|
|
122
|
-
|
|
14
|
+
var _ArrowBackIos = _interopRequireDefault(require("@mui/icons-material/ArrowBackIos"));
|
|
15
|
+
var _ArrowForwardIos = _interopRequireDefault(require("@mui/icons-material/ArrowForwardIos"));
|
|
16
|
+
const Wrapper = (0, _styles.styled)('div')({
|
|
17
|
+
display: 'flex',
|
|
18
|
+
position: 'relative'
|
|
19
|
+
});
|
|
20
|
+
const TableWrapper = (0, _styles.styled)('div')({
|
|
21
|
+
width: '100%',
|
|
22
|
+
overflow: 'auto'
|
|
23
|
+
});
|
|
24
|
+
const Table = (0, _styles.styled)('table')(({
|
|
25
|
+
theme
|
|
26
|
+
}) => ({
|
|
27
|
+
borderSpacing: 0,
|
|
28
|
+
marginBottom: theme.spacing(2),
|
|
29
|
+
borderRadius: '4px',
|
|
30
|
+
color: _renderUi.color.text(),
|
|
31
|
+
fontSize: theme.typography.fontSize,
|
|
32
|
+
lineHeight: '16px',
|
|
33
|
+
overflow: 'unset',
|
|
34
|
+
'& ul, ol': {
|
|
35
|
+
marginBlockStart: 0,
|
|
36
|
+
paddingInlineStart: theme.spacing(2)
|
|
37
|
+
},
|
|
38
|
+
'& th': {
|
|
39
|
+
padding: theme.spacing(2),
|
|
40
|
+
textAlign: 'left',
|
|
41
|
+
backgroundColor: _renderUi.color.secondaryBackground(),
|
|
42
|
+
verticalAlign: 'bottom'
|
|
43
|
+
},
|
|
44
|
+
'& th div': {
|
|
45
|
+
width: '200px'
|
|
46
|
+
},
|
|
47
|
+
'& td': {
|
|
48
|
+
width: '200px',
|
|
49
|
+
padding: `${theme.spacing(2)} ${theme.spacing(1)}`,
|
|
50
|
+
verticalAlign: 'top'
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
const ScorePointHeaderTable = (0, _styles.styled)('table')({
|
|
54
|
+
'& td': {
|
|
55
|
+
border: 0,
|
|
56
|
+
padding: 0,
|
|
57
|
+
textAlign: 'center',
|
|
58
|
+
minWidth: '200px'
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const PointLabel = (0, _styles.styled)('div')({
|
|
62
|
+
marginBottom: '4px'
|
|
63
|
+
});
|
|
64
|
+
const ScorePointValue = (0, _styles.styled)('td')({
|
|
65
|
+
fontWeight: 'normal'
|
|
66
|
+
});
|
|
67
|
+
const ArrowContainer = ({
|
|
68
|
+
show,
|
|
69
|
+
onClick,
|
|
70
|
+
extraStyles,
|
|
71
|
+
children
|
|
72
|
+
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
+
style: {
|
|
74
|
+
height: 'calc(100% - 1px)',
|
|
75
|
+
top: '1px',
|
|
76
|
+
display: show ? 'flex' : 'none',
|
|
77
|
+
width: '50px',
|
|
78
|
+
margin: 'auto',
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'center',
|
|
82
|
+
cursor: 'pointer',
|
|
83
|
+
...extraStyles
|
|
84
|
+
},
|
|
85
|
+
onClick: onClick
|
|
86
|
+
}, children);
|
|
123
87
|
ArrowContainer.propTypes = {
|
|
124
|
-
show: _propTypes
|
|
125
|
-
onClick: _propTypes
|
|
126
|
-
extraStyles: _propTypes
|
|
127
|
-
children: _propTypes
|
|
88
|
+
show: _propTypes.default.bool,
|
|
89
|
+
onClick: _propTypes.default.func,
|
|
90
|
+
extraStyles: _propTypes.default.object,
|
|
91
|
+
children: _propTypes.default.object
|
|
128
92
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
(0, _classCallCheck2["default"])(this, Scale);
|
|
139
|
-
|
|
140
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
141
|
-
args[_key] = arguments[_key];
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
145
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {});
|
|
146
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "scrollLeft", function () {
|
|
147
|
-
_this.tableWrapper.scrollLeft -= _this.tableWrapper.offsetWidth / 2;
|
|
148
|
-
|
|
149
|
-
_this.setState({
|
|
150
|
-
showRight: _this.tableWrapper.scrollLeft < _this.tableWrapper.scrollWidth,
|
|
151
|
-
showLeft: _this.tableWrapper.scrollLeft < _this.tableWrapper.scrollWidth && _this.tableWrapper.scrollLeft > 0
|
|
93
|
+
class Scale extends _react.default.Component {
|
|
94
|
+
constructor(...args) {
|
|
95
|
+
super(...args);
|
|
96
|
+
(0, _defineProperty2.default)(this, "state", {});
|
|
97
|
+
(0, _defineProperty2.default)(this, "scrollLeft", () => {
|
|
98
|
+
this.tableWrapper.scrollLeft -= this.tableWrapper.offsetWidth / 2;
|
|
99
|
+
this.setState({
|
|
100
|
+
showRight: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,
|
|
101
|
+
showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0
|
|
152
102
|
});
|
|
153
103
|
});
|
|
154
|
-
(0, _defineProperty2
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
showLeft: _this.tableWrapper.scrollLeft < _this.tableWrapper.scrollWidth && _this.tableWrapper.scrollLeft > 0
|
|
104
|
+
(0, _defineProperty2.default)(this, "scrollRight", () => {
|
|
105
|
+
const initialScrollLeft = this.tableWrapper.scrollLeft;
|
|
106
|
+
this.tableWrapper.scrollLeft += this.tableWrapper.offsetWidth / 2;
|
|
107
|
+
this.setState({
|
|
108
|
+
showRight: initialScrollLeft !== this.tableWrapper.scrollLeft && this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,
|
|
109
|
+
showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0
|
|
161
110
|
});
|
|
162
111
|
});
|
|
163
|
-
return _this;
|
|
164
112
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
this.setState({
|
|
172
|
-
showRight: true
|
|
173
|
-
});
|
|
174
|
-
}
|
|
113
|
+
componentDidMount() {
|
|
114
|
+
if (this.tableWrapper) {
|
|
115
|
+
if (this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth) {
|
|
116
|
+
this.setState({
|
|
117
|
+
showRight: true
|
|
118
|
+
});
|
|
175
119
|
}
|
|
176
120
|
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
121
|
+
}
|
|
122
|
+
render() {
|
|
123
|
+
const {
|
|
124
|
+
showRight,
|
|
125
|
+
showLeft
|
|
126
|
+
} = this.state;
|
|
127
|
+
const {
|
|
128
|
+
scale,
|
|
129
|
+
scaleIndex,
|
|
130
|
+
showDescription,
|
|
131
|
+
showPointsLabels,
|
|
132
|
+
showStandards,
|
|
133
|
+
arrowsDisabled
|
|
134
|
+
} = this.props;
|
|
135
|
+
const {
|
|
136
|
+
excludeZero,
|
|
137
|
+
maxPoints,
|
|
138
|
+
traitLabel,
|
|
139
|
+
traits,
|
|
140
|
+
scorePointsLabels
|
|
141
|
+
} = scale || {};
|
|
142
|
+
let scorePointsValues = [];
|
|
143
|
+
let descriptions;
|
|
144
|
+
let pointsLabels;
|
|
145
|
+
let standards;
|
|
146
|
+
try {
|
|
147
|
+
// determining the score points values
|
|
148
|
+
for (let pointValue = maxPoints; pointValue >= excludeZero ? 1 : 0; pointValue -= 1) {
|
|
149
|
+
scorePointsValues.push(pointValue);
|
|
150
|
+
}
|
|
151
|
+
const {
|
|
152
|
+
traitStandards,
|
|
153
|
+
traitDescriptions
|
|
154
|
+
} = traits.reduce((tcc, trait) => ({
|
|
155
|
+
traitStandards: [...tcc.traitStandards, ...(trait.standards || [])],
|
|
156
|
+
traitDescriptions: [...tcc.traitDescriptions, ...(trait.description || [])]
|
|
157
|
+
}), {
|
|
158
|
+
traitStandards: [],
|
|
159
|
+
traitDescriptions: []
|
|
160
|
+
});
|
|
161
|
+
descriptions = showDescription && traitDescriptions.length;
|
|
162
|
+
pointsLabels = showPointsLabels && scorePointsLabels.length;
|
|
163
|
+
standards = showStandards && traitStandards.length;
|
|
164
|
+
} catch (e) {
|
|
165
|
+
descriptions = false;
|
|
166
|
+
pointsLabels = false;
|
|
167
|
+
standards = false;
|
|
168
|
+
}
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(ArrowContainer, {
|
|
170
|
+
show: showLeft && !arrowsDisabled,
|
|
171
|
+
onClick: this.scrollLeft,
|
|
172
|
+
extraStyles: {
|
|
173
|
+
left: 0,
|
|
174
|
+
background: `linear-gradient(to right, white, ${_renderUi.color.background()})`
|
|
175
|
+
}
|
|
176
|
+
}, /*#__PURE__*/_react.default.createElement(_ArrowBackIos.default, null)), /*#__PURE__*/_react.default.createElement(TableWrapper, {
|
|
177
|
+
ref: ref => {
|
|
178
|
+
this.tableWrapper = ref;
|
|
179
|
+
},
|
|
180
|
+
onScroll: () => {
|
|
181
|
+
this.setState({
|
|
182
|
+
// 5 is a margin of error
|
|
183
|
+
showRight: this.tableWrapper.scrollLeft + this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth - 5 && this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,
|
|
184
|
+
showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}, arrowsDisabled && (showRight || showLeft) ? /*#__PURE__*/_react.default.createElement("div", null, "The item is too large to fit in print mode.") : null, /*#__PURE__*/_react.default.createElement(Table, {
|
|
188
|
+
key: `scale-${scaleIndex}`
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
+
dangerouslySetInnerHTML: {
|
|
191
|
+
__html: traitLabel
|
|
192
|
+
}
|
|
193
|
+
})), standards ? /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement("div", null, "Standard(s)")) : null, descriptions ? /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement("div", null, "Description")) : null, scorePointsValues && scorePointsValues.map((scorePointValue, index) => {
|
|
194
|
+
let pointLabel = '';
|
|
205
195
|
|
|
196
|
+
// to handle the case when there aren't enough labels
|
|
206
197
|
try {
|
|
207
|
-
|
|
208
|
-
for (var pointValue = maxPoints; pointValue >= excludeZero ? 1 : 0; pointValue -= 1) {
|
|
209
|
-
scorePointsValues.push(pointValue);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
var _traits$reduce = traits.reduce(function (tcc, trait) {
|
|
213
|
-
return {
|
|
214
|
-
traitStandards: [].concat((0, _toConsumableArray2["default"])(tcc.traitStandards), (0, _toConsumableArray2["default"])(trait.standards || [])),
|
|
215
|
-
traitDescriptions: [].concat((0, _toConsumableArray2["default"])(tcc.traitDescriptions), (0, _toConsumableArray2["default"])(trait.description || []))
|
|
216
|
-
};
|
|
217
|
-
}, {
|
|
218
|
-
traitStandards: [],
|
|
219
|
-
traitDescriptions: []
|
|
220
|
-
}),
|
|
221
|
-
traitStandards = _traits$reduce.traitStandards,
|
|
222
|
-
traitDescriptions = _traits$reduce.traitDescriptions;
|
|
223
|
-
|
|
224
|
-
descriptions = showDescription && traitDescriptions.length;
|
|
225
|
-
pointsLabels = showPointsLabels && scorePointsLabels.length;
|
|
226
|
-
standards = showStandards && traitStandards.length;
|
|
198
|
+
pointLabel = scorePointsLabels[scorePointsValues.length - index - 1] || '';
|
|
227
199
|
} catch (e) {
|
|
228
|
-
|
|
229
|
-
pointsLabels = false;
|
|
230
|
-
standards = false;
|
|
200
|
+
pointLabel = '';
|
|
231
201
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}, /*#__PURE__*/_react["default"].createElement(ArrowContainer, {
|
|
236
|
-
show: showLeft && !arrowsDisabled,
|
|
237
|
-
onClick: this.scrollLeft,
|
|
238
|
-
extraStyles: {
|
|
239
|
-
left: 0,
|
|
240
|
-
background: "linear-gradient(to right, white, ".concat(_renderUi.color.background(), ")")
|
|
241
|
-
}
|
|
242
|
-
}, /*#__PURE__*/_react["default"].createElement(_ArrowBackIos["default"], null)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
243
|
-
className: classes.tableWrapper,
|
|
244
|
-
ref: function ref(_ref3) {
|
|
245
|
-
_this2.tableWrapper = _ref3;
|
|
246
|
-
},
|
|
247
|
-
onScroll: function onScroll() {
|
|
248
|
-
_this2.setState({
|
|
249
|
-
// 5 is a margin of error
|
|
250
|
-
showRight: _this2.tableWrapper.scrollLeft + _this2.tableWrapper.offsetWidth < _this2.tableWrapper.scrollWidth - 5 && _this2.tableWrapper.scrollLeft < _this2.tableWrapper.scrollWidth,
|
|
251
|
-
showLeft: _this2.tableWrapper.scrollLeft < _this2.tableWrapper.scrollWidth && _this2.tableWrapper.scrollLeft > 0
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}, arrowsDisabled && (showRight || showLeft) ? /*#__PURE__*/_react["default"].createElement("div", null, "The item is too large to fit in print mode.") : null, /*#__PURE__*/_react["default"].createElement("table", {
|
|
255
|
-
key: "scale-".concat(scaleIndex),
|
|
256
|
-
className: classes.table
|
|
257
|
-
}, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("th", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
202
|
+
return /*#__PURE__*/_react.default.createElement("th", {
|
|
203
|
+
key: `table-header-${index}`
|
|
204
|
+
}, /*#__PURE__*/_react.default.createElement(ScorePointHeaderTable, null, /*#__PURE__*/_react.default.createElement("thead", null, pointsLabels ? /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(PointLabel, {
|
|
258
205
|
dangerouslySetInnerHTML: {
|
|
259
|
-
__html:
|
|
260
|
-
}
|
|
261
|
-
})), standards ? /*#__PURE__*/_react["default"].createElement("th", null, /*#__PURE__*/_react["default"].createElement("div", null, "Standard(s)")) : null, descriptions ? /*#__PURE__*/_react["default"].createElement("th", null, /*#__PURE__*/_react["default"].createElement("div", null, "Description")) : null, scorePointsValues && scorePointsValues.map(function (scorePointValue, index) {
|
|
262
|
-
var pointLabel = ''; // to handle the case when there aren't enough labels
|
|
263
|
-
|
|
264
|
-
try {
|
|
265
|
-
pointLabel = scorePointsLabels[scorePointsValues.length - index - 1] || '';
|
|
266
|
-
} catch (e) {
|
|
267
|
-
pointLabel = '';
|
|
206
|
+
__html: pointLabel
|
|
268
207
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
scaleIndex: scaleIndex,
|
|
290
|
-
scorePointsValues: scorePointsValues,
|
|
291
|
-
excludeZero: excludeZero
|
|
292
|
-
});
|
|
293
|
-
})))), /*#__PURE__*/_react["default"].createElement(ArrowContainer, {
|
|
294
|
-
show: showRight && !arrowsDisabled,
|
|
295
|
-
onClick: this.scrollRight,
|
|
296
|
-
extraStyles: {
|
|
297
|
-
right: 0,
|
|
298
|
-
background: "linear-gradient(to left, white, ".concat(_renderUi.color.background(), ")")
|
|
299
|
-
}
|
|
300
|
-
}, /*#__PURE__*/_react["default"].createElement(_ArrowForwardIos["default"], null)));
|
|
301
|
-
}
|
|
302
|
-
}]);
|
|
303
|
-
return Scale;
|
|
304
|
-
}(_react["default"].Component);
|
|
305
|
-
|
|
208
|
+
}))) : null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement(ScorePointValue, null, scorePointValue === 1 ? `${scorePointValue} point` : `${scorePointValue} points`)))));
|
|
209
|
+
}))), /*#__PURE__*/_react.default.createElement("tbody", null, traits && traits.map((trait, traitIndex) => /*#__PURE__*/_react.default.createElement(_trait.default, {
|
|
210
|
+
key: `trait_${scaleIndex}_${traitIndex}`,
|
|
211
|
+
trait: trait,
|
|
212
|
+
traitIndex: traitIndex,
|
|
213
|
+
showDescription: !!descriptions,
|
|
214
|
+
showStandards: !!standards,
|
|
215
|
+
scaleIndex: scaleIndex,
|
|
216
|
+
scorePointsValues: scorePointsValues,
|
|
217
|
+
excludeZero: excludeZero
|
|
218
|
+
}))))), /*#__PURE__*/_react.default.createElement(ArrowContainer, {
|
|
219
|
+
show: showRight && !arrowsDisabled,
|
|
220
|
+
onClick: this.scrollRight,
|
|
221
|
+
extraStyles: {
|
|
222
|
+
right: 0,
|
|
223
|
+
background: `linear-gradient(to left, white, ${_renderUi.color.background()})`
|
|
224
|
+
}
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement(_ArrowForwardIos.default, null)));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
306
228
|
Scale.propTypes = {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
description: _propTypes["default"].string
|
|
229
|
+
scaleIndex: _propTypes.default.number,
|
|
230
|
+
scale: _propTypes.default.shape({
|
|
231
|
+
excludeZero: _propTypes.default.bool,
|
|
232
|
+
maxPoints: _propTypes.default.number,
|
|
233
|
+
scorePointsLabels: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
234
|
+
traitLabel: _propTypes.default.string,
|
|
235
|
+
traits: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
236
|
+
name: _propTypes.default.string,
|
|
237
|
+
standards: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
238
|
+
scorePointsDescriptors: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
239
|
+
description: _propTypes.default.string
|
|
319
240
|
}))
|
|
320
241
|
}),
|
|
321
|
-
showPointsLabels: _propTypes
|
|
322
|
-
showDescription: _propTypes
|
|
323
|
-
showStandards: _propTypes
|
|
324
|
-
arrowsDisabled: _propTypes
|
|
242
|
+
showPointsLabels: _propTypes.default.bool,
|
|
243
|
+
showDescription: _propTypes.default.bool,
|
|
244
|
+
showStandards: _propTypes.default.bool,
|
|
245
|
+
arrowsDisabled: _propTypes.default.bool
|
|
325
246
|
};
|
|
326
|
-
|
|
327
|
-
var _default = (0, _styles.withStyles)(styles)(Scale);
|
|
328
|
-
|
|
329
|
-
exports["default"] = _default;
|
|
247
|
+
var _default = exports.default = Scale;
|
|
330
248
|
//# sourceMappingURL=scale.js.map
|