@pie-element/match 5.5.1-beta.1 → 5.5.1-beta.4
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/add-row.js +60 -0
- package/configure/lib/add-row.js.map +1 -0
- package/configure/lib/answer-config-block.js +294 -0
- package/configure/lib/answer-config-block.js.map +1 -0
- package/configure/lib/common.js +34 -0
- package/configure/lib/common.js.map +1 -0
- package/configure/lib/configure.js +350 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/defaults.js +113 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/general-config-block.js +168 -0
- package/configure/lib/general-config-block.js.map +1 -0
- package/configure/lib/index.js +117 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/row.js +348 -0
- package/configure/lib/row.js.map +1 -0
- package/configure/package.json +3 -3
- package/controller/lib/defaults.js +23 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +351 -0
- package/controller/lib/index.js.map +1 -0
- package/lib/answer-grid.js +223 -0
- package/lib/answer-grid.js.map +1 -0
- package/lib/index.js +98 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +191 -0
- package/lib/main.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.choiceTarget = exports.choiceSource = exports.canDrag = exports.Row = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
+
var _styles = require("@material-ui/core/styles");
|
|
19
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
20
|
+
var _configUi = require("@pie-lib/config-ui");
|
|
21
|
+
var _DragHandle = _interopRequireDefault(require("@material-ui/icons/DragHandle"));
|
|
22
|
+
var _Radio = _interopRequireDefault(require("@material-ui/core/Radio"));
|
|
23
|
+
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
24
|
+
var _Delete = _interopRequireDefault(require("@material-ui/icons/Delete"));
|
|
25
|
+
var _reactDnd = require("react-dnd");
|
|
26
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
27
|
+
var _editableHtml = _interopRequireWildcard(require("@pie-lib/editable-html"));
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
+
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; }
|
|
31
|
+
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; }
|
|
32
|
+
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); }; }
|
|
33
|
+
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; } }
|
|
34
|
+
var log = (0, _debug["default"])('@pie-element:categorize:configure:choice');
|
|
35
|
+
var _canDrag = false;
|
|
36
|
+
exports.canDrag = _canDrag;
|
|
37
|
+
var Row = /*#__PURE__*/function (_React$Component) {
|
|
38
|
+
(0, _inherits2["default"])(Row, _React$Component);
|
|
39
|
+
var _super = _createSuper(Row);
|
|
40
|
+
function Row() {
|
|
41
|
+
var _this;
|
|
42
|
+
(0, _classCallCheck2["default"])(this, Row);
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
args[_key] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
48
|
+
dialog: {
|
|
49
|
+
open: false,
|
|
50
|
+
text: ''
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowTitleChange", function (rowIndex) {
|
|
54
|
+
return function (value) {
|
|
55
|
+
var _this$props = _this.props,
|
|
56
|
+
model = _this$props.model,
|
|
57
|
+
onChange = _this$props.onChange;
|
|
58
|
+
var newModel = _objectSpread({}, model);
|
|
59
|
+
newModel.rows[rowIndex].title = value;
|
|
60
|
+
onChange(newModel);
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRowValueChange", function (rowIndex, rowValueIndex) {
|
|
64
|
+
return function (event) {
|
|
65
|
+
var _this$props2 = _this.props,
|
|
66
|
+
model = _this$props2.model,
|
|
67
|
+
onChange = _this$props2.onChange;
|
|
68
|
+
var newModel = _objectSpread({}, model);
|
|
69
|
+
if (model.choiceMode === 'radio') {
|
|
70
|
+
for (var i = 0; i < newModel.rows[rowIndex].values.length; i++) {
|
|
71
|
+
newModel.rows[rowIndex].values[i] = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
newModel.rows[rowIndex].values[rowValueIndex] = event.target.checked;
|
|
75
|
+
onChange(newModel);
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDeleteRow", function (idx) {
|
|
79
|
+
return function () {
|
|
80
|
+
var _this$props3 = _this.props,
|
|
81
|
+
model = _this$props3.model,
|
|
82
|
+
onDeleteRow = _this$props3.onDeleteRow;
|
|
83
|
+
if (model.rows && model.rows.length === 1) {
|
|
84
|
+
_this.setState({
|
|
85
|
+
dialog: {
|
|
86
|
+
open: true,
|
|
87
|
+
text: 'There has to be at least one question row.'
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
} else {
|
|
91
|
+
onDeleteRow(idx);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMouseDownOnHandle", function () {
|
|
96
|
+
exports.canDrag = _canDrag = true;
|
|
97
|
+
});
|
|
98
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onMouseUpOnHandle", function () {
|
|
99
|
+
exports.canDrag = _canDrag = false;
|
|
100
|
+
});
|
|
101
|
+
return _this;
|
|
102
|
+
}
|
|
103
|
+
(0, _createClass2["default"])(Row, [{
|
|
104
|
+
key: "componentDidMount",
|
|
105
|
+
value: function componentDidMount() {
|
|
106
|
+
document.addEventListener('mouseup', this.onMouseUpOnHandle);
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
key: "render",
|
|
110
|
+
value: function render() {
|
|
111
|
+
var _this2 = this;
|
|
112
|
+
var _this$props4 = this.props,
|
|
113
|
+
classes = _this$props4.classes,
|
|
114
|
+
imageSupport = _this$props4.imageSupport,
|
|
115
|
+
connectDragSource = _this$props4.connectDragSource,
|
|
116
|
+
connectDropTarget = _this$props4.connectDropTarget,
|
|
117
|
+
isDragging = _this$props4.isDragging,
|
|
118
|
+
model = _this$props4.model,
|
|
119
|
+
row = _this$props4.row,
|
|
120
|
+
idx = _this$props4.idx,
|
|
121
|
+
enableImages = _this$props4.enableImages,
|
|
122
|
+
toolbarOpts = _this$props4.toolbarOpts,
|
|
123
|
+
spellCheck = _this$props4.spellCheck,
|
|
124
|
+
error = _this$props4.error,
|
|
125
|
+
maxImageWidth = _this$props4.maxImageWidth,
|
|
126
|
+
maxImageHeight = _this$props4.maxImageHeight,
|
|
127
|
+
uploadSoundSupport = _this$props4.uploadSoundSupport;
|
|
128
|
+
var dialog = this.state.dialog;
|
|
129
|
+
var opacity = isDragging ? 0 : 1;
|
|
130
|
+
var rowPlugins = {
|
|
131
|
+
image: {
|
|
132
|
+
disabled: !enableImages
|
|
133
|
+
},
|
|
134
|
+
audio: {
|
|
135
|
+
disabled: true
|
|
136
|
+
},
|
|
137
|
+
video: {
|
|
138
|
+
disabled: true
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var filteredDefaultPlugins = (_editableHtml.DEFAULT_PLUGINS || []).filter(function (p) {
|
|
142
|
+
return p !== 'bulleted-list' && p !== 'numbered-list';
|
|
143
|
+
});
|
|
144
|
+
var content = /*#__PURE__*/_react["default"].createElement("div", {
|
|
145
|
+
style: {
|
|
146
|
+
opacity: opacity,
|
|
147
|
+
width: 'fit-content'
|
|
148
|
+
}
|
|
149
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
150
|
+
itemID: 'handle',
|
|
151
|
+
className: classes.dragHandle,
|
|
152
|
+
onMouseDown: this.onMouseDownOnHandle
|
|
153
|
+
}, /*#__PURE__*/_react["default"].createElement(_DragHandle["default"], {
|
|
154
|
+
color: 'primary'
|
|
155
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
|
+
className: classes.rowContainer
|
|
157
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
158
|
+
className: (0, _classnames["default"])(classes.rowItem, classes.questionText)
|
|
159
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
160
|
+
imageSupport: imageSupport,
|
|
161
|
+
autoWidthToolbar: true,
|
|
162
|
+
disableUnderline: true,
|
|
163
|
+
label: 'label',
|
|
164
|
+
markup: row.title,
|
|
165
|
+
onChange: this.onRowTitleChange(idx),
|
|
166
|
+
className: classes.editor,
|
|
167
|
+
pluginProps: rowPlugins,
|
|
168
|
+
toolbarOpts: toolbarOpts,
|
|
169
|
+
activePlugins: filteredDefaultPlugins,
|
|
170
|
+
spellCheck: spellCheck,
|
|
171
|
+
maxImageWidth: maxImageWidth,
|
|
172
|
+
maxImageHeight: maxImageHeight,
|
|
173
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
174
|
+
languageCharactersProps: [{
|
|
175
|
+
language: 'spanish'
|
|
176
|
+
}, {
|
|
177
|
+
language: 'special'
|
|
178
|
+
}],
|
|
179
|
+
error: error && error !== 'No correct response defined.'
|
|
180
|
+
})), row.values.map(function (rowValue, rowIdx) {
|
|
181
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
182
|
+
key: rowIdx,
|
|
183
|
+
className: classes.rowItem
|
|
184
|
+
}, model.choiceMode === 'radio' ? /*#__PURE__*/_react["default"].createElement(_Radio["default"], {
|
|
185
|
+
onChange: _this2.onRowValueChange(idx, rowIdx),
|
|
186
|
+
checked: rowValue === true
|
|
187
|
+
}) : /*#__PURE__*/_react["default"].createElement(_configUi.Checkbox, {
|
|
188
|
+
onChange: _this2.onRowValueChange(idx, rowIdx),
|
|
189
|
+
checked: rowValue === true,
|
|
190
|
+
label: ''
|
|
191
|
+
}));
|
|
192
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
193
|
+
className: classes.deleteIcon
|
|
194
|
+
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
195
|
+
onClick: this.onDeleteRow(idx),
|
|
196
|
+
"aria-label": "Delete"
|
|
197
|
+
}, /*#__PURE__*/_react["default"].createElement(_Delete["default"], null)))), error && /*#__PURE__*/_react["default"].createElement("div", {
|
|
198
|
+
className: classes.errorText
|
|
199
|
+
}, error), /*#__PURE__*/_react["default"].createElement("hr", {
|
|
200
|
+
className: classes.separator
|
|
201
|
+
}), /*#__PURE__*/_react["default"].createElement(_configUi.AlertDialog, {
|
|
202
|
+
open: dialog.open,
|
|
203
|
+
title: "Warning",
|
|
204
|
+
text: dialog.text,
|
|
205
|
+
onConfirm: function onConfirm() {
|
|
206
|
+
return _this2.setState({
|
|
207
|
+
dialog: {
|
|
208
|
+
open: false
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}));
|
|
213
|
+
return connectDragSource(connectDropTarget(content));
|
|
214
|
+
}
|
|
215
|
+
}]);
|
|
216
|
+
return Row;
|
|
217
|
+
}(_react["default"].Component);
|
|
218
|
+
exports.Row = Row;
|
|
219
|
+
(0, _defineProperty2["default"])(Row, "propTypes", {
|
|
220
|
+
classes: _propTypes["default"].object.isRequired,
|
|
221
|
+
model: _propTypes["default"].object.isRequired,
|
|
222
|
+
row: _propTypes["default"].object.isRequired,
|
|
223
|
+
idx: _propTypes["default"].number.isRequired,
|
|
224
|
+
isDragging: _propTypes["default"].bool.isRequired,
|
|
225
|
+
onDeleteRow: _propTypes["default"].func.isRequired,
|
|
226
|
+
onChange: _propTypes["default"].func.isRequired,
|
|
227
|
+
connectDragSource: _propTypes["default"].func.isRequired,
|
|
228
|
+
connectDropTarget: _propTypes["default"].func.isRequired,
|
|
229
|
+
onMoveRow: _propTypes["default"].func.isRequired,
|
|
230
|
+
imageSupport: _propTypes["default"].shape({
|
|
231
|
+
add: _propTypes["default"].func.isRequired,
|
|
232
|
+
"delete": _propTypes["default"].func.isRequired
|
|
233
|
+
}),
|
|
234
|
+
uploadSoundSupport: _propTypes["default"].shape({
|
|
235
|
+
add: _propTypes["default"].func.isRequired,
|
|
236
|
+
"delete": _propTypes["default"].func.isRequired
|
|
237
|
+
}),
|
|
238
|
+
enableImages: _propTypes["default"].bool,
|
|
239
|
+
toolbarOpts: _propTypes["default"].object,
|
|
240
|
+
error: _propTypes["default"].string
|
|
241
|
+
});
|
|
242
|
+
(0, _defineProperty2["default"])(Row, "defaultProps", {});
|
|
243
|
+
var styles = function styles(theme) {
|
|
244
|
+
return {
|
|
245
|
+
actions: {
|
|
246
|
+
padding: 0,
|
|
247
|
+
justifyContent: 'space-between'
|
|
248
|
+
},
|
|
249
|
+
choice: {
|
|
250
|
+
padding: theme.spacing.unit,
|
|
251
|
+
overflow: 'visible'
|
|
252
|
+
},
|
|
253
|
+
dragHandle: {
|
|
254
|
+
cursor: 'move'
|
|
255
|
+
},
|
|
256
|
+
dragDisabled: {
|
|
257
|
+
cursor: 'inherit'
|
|
258
|
+
},
|
|
259
|
+
container: {
|
|
260
|
+
marginTop: theme.spacing.unit * 2,
|
|
261
|
+
display: 'flex',
|
|
262
|
+
flexDirection: 'column'
|
|
263
|
+
},
|
|
264
|
+
rowContainer: {
|
|
265
|
+
marginTop: theme.spacing.unit * 2,
|
|
266
|
+
display: 'flex',
|
|
267
|
+
alignItems: 'center',
|
|
268
|
+
flex: 1
|
|
269
|
+
},
|
|
270
|
+
rowItem: {
|
|
271
|
+
flex: 1,
|
|
272
|
+
display: 'flex',
|
|
273
|
+
justifyContent: 'center',
|
|
274
|
+
minWidth: '150px',
|
|
275
|
+
padding: "0 ".concat(theme.spacing.unit, "px")
|
|
276
|
+
},
|
|
277
|
+
deleteIcon: {
|
|
278
|
+
flex: 0.5,
|
|
279
|
+
display: 'flex',
|
|
280
|
+
justifyContent: 'center',
|
|
281
|
+
minWidth: '48px',
|
|
282
|
+
padding: "0 ".concat(theme.spacing.unit, "px")
|
|
283
|
+
},
|
|
284
|
+
questionText: {
|
|
285
|
+
flex: 2,
|
|
286
|
+
display: 'flex',
|
|
287
|
+
justifyContent: 'flex-start',
|
|
288
|
+
padding: 0,
|
|
289
|
+
maxWidth: 'unset',
|
|
290
|
+
textAlign: 'left',
|
|
291
|
+
minWidth: '350px',
|
|
292
|
+
marginRight: theme.spacing.unit,
|
|
293
|
+
'&> div': {
|
|
294
|
+
width: '100%'
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
separator: {
|
|
298
|
+
marginTop: theme.spacing.unit * 2,
|
|
299
|
+
border: 0,
|
|
300
|
+
borderTop: '2px solid lightgray',
|
|
301
|
+
width: '100%'
|
|
302
|
+
},
|
|
303
|
+
errorText: {
|
|
304
|
+
fontSize: theme.typography.fontSize - 2,
|
|
305
|
+
color: 'red',
|
|
306
|
+
paddingTop: theme.spacing.unit
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
var StyledRow = (0, _styles.withStyles)(styles)(Row);
|
|
311
|
+
var NAME = 'row-config';
|
|
312
|
+
var choiceSource = {
|
|
313
|
+
canDrag: function canDrag() {
|
|
314
|
+
return _canDrag;
|
|
315
|
+
},
|
|
316
|
+
beginDrag: function beginDrag(props) {
|
|
317
|
+
return {
|
|
318
|
+
id: props.row.id,
|
|
319
|
+
index: props.idx
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
exports.choiceSource = choiceSource;
|
|
324
|
+
var StyledSource = (0, _reactDnd.DragSource)(NAME, choiceSource, function (connect, monitor) {
|
|
325
|
+
return {
|
|
326
|
+
connectDragSource: connect.dragSource(),
|
|
327
|
+
isDragging: monitor.isDragging()
|
|
328
|
+
};
|
|
329
|
+
})(StyledRow);
|
|
330
|
+
var choiceTarget = {
|
|
331
|
+
hover: function hover() {
|
|
332
|
+
log('[hover]');
|
|
333
|
+
},
|
|
334
|
+
drop: function drop(props, monitor) {
|
|
335
|
+
var item = monitor.getItem();
|
|
336
|
+
log('[drop] item: ', item, 'didDrop?', monitor.didDrop());
|
|
337
|
+
props.onMoveRow(item.index, props.idx);
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
exports.choiceTarget = choiceTarget;
|
|
341
|
+
var StyledSourceAndTarget = (0, _reactDnd.DropTarget)(NAME, choiceTarget, function (connect) {
|
|
342
|
+
return {
|
|
343
|
+
connectDropTarget: connect.dropTarget()
|
|
344
|
+
};
|
|
345
|
+
})(StyledSource);
|
|
346
|
+
var _default = StyledSourceAndTarget;
|
|
347
|
+
exports["default"] = _default;
|
|
348
|
+
//# sourceMappingURL=row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_classnames","_configUi","_DragHandle","_Radio","_IconButton","_Delete","_reactDnd","_debug","_editableHtml","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","_possibleConstructorReturn2","sham","Proxy","Boolean","valueOf","e","log","debug","canDrag","exports","_canDrag","Row","_React$Component","_inherits2","_super","_this","_classCallCheck2","_len","args","Array","_key","concat","_assertThisInitialized2","dialog","open","text","rowIndex","value","_this$props","props","model","onChange","newModel","rows","title","rowValueIndex","event","_this$props2","choiceMode","values","checked","idx","_this$props3","onDeleteRow","setState","_createClass2","componentDidMount","document","addEventListener","onMouseUpOnHandle","render","_this2","_this$props4","classes","imageSupport","connectDragSource","connectDropTarget","isDragging","row","enableImages","toolbarOpts","spellCheck","error","maxImageWidth","maxImageHeight","uploadSoundSupport","state","opacity","rowPlugins","image","disabled","audio","video","filteredDefaultPlugins","DEFAULT_PLUGINS","p","content","createElement","style","width","itemID","className","dragHandle","onMouseDown","onMouseDownOnHandle","color","rowContainer","classNames","rowItem","questionText","autoWidthToolbar","disableUnderline","label","markup","onRowTitleChange","editor","pluginProps","activePlugins","languageCharactersProps","language","map","rowValue","rowIdx","onRowValueChange","Checkbox","deleteIcon","onClick","errorText","separator","AlertDialog","onConfirm","React","Component","PropTypes","isRequired","number","bool","func","onMoveRow","shape","add","string","styles","theme","actions","padding","justifyContent","choice","spacing","unit","overflow","cursor","dragDisabled","container","marginTop","display","flexDirection","alignItems","flex","minWidth","maxWidth","textAlign","marginRight","border","borderTop","fontSize","typography","paddingTop","StyledRow","withStyles","NAME","choiceSource","beginDrag","id","index","StyledSource","DragSource","connect","monitor","dragSource","choiceTarget","hover","drop","item","getItem","didDrop","StyledSourceAndTarget","DropTarget","dropTarget","_default"],"sources":["../src/row.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { AlertDialog, Checkbox } from '@pie-lib/config-ui';\nimport DragHandle from '@material-ui/icons/DragHandle';\nimport Radio from '@material-ui/core/Radio';\nimport IconButton from '@material-ui/core/IconButton';\nimport Delete from '@material-ui/icons/Delete';\nimport { DragSource, DropTarget } from 'react-dnd';\nimport debug from 'debug';\nimport EditableHtml, { DEFAULT_PLUGINS } from '@pie-lib/editable-html';\n\nconst log = debug('@pie-element:categorize:configure:choice');\n\nexport let canDrag = false;\n\nexport class Row extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n row: PropTypes.object.isRequired,\n idx: PropTypes.number.isRequired,\n isDragging: PropTypes.bool.isRequired,\n onDeleteRow: PropTypes.func.isRequired,\n onChange: PropTypes.func.isRequired,\n connectDragSource: PropTypes.func.isRequired,\n connectDropTarget: PropTypes.func.isRequired,\n onMoveRow: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n enableImages: PropTypes.bool,\n toolbarOpts: PropTypes.object,\n error: PropTypes.string,\n };\n\n static defaultProps = {};\n\n state = {\n dialog: {\n open: false,\n text: '',\n },\n };\n\n componentDidMount() {\n document.addEventListener('mouseup', this.onMouseUpOnHandle);\n }\n\n onRowTitleChange = (rowIndex) => (value) => {\n const { model, onChange } = this.props;\n const newModel = { ...model };\n\n newModel.rows[rowIndex].title = value;\n onChange(newModel);\n };\n\n onRowValueChange = (rowIndex, rowValueIndex) => (event) => {\n const { model, onChange } = this.props;\n const newModel = { ...model };\n\n if (model.choiceMode === 'radio') {\n for (let i = 0; i < newModel.rows[rowIndex].values.length; i++) {\n newModel.rows[rowIndex].values[i] = false;\n }\n }\n\n newModel.rows[rowIndex].values[rowValueIndex] = event.target.checked;\n\n onChange(newModel);\n };\n\n onDeleteRow = (idx) => () => {\n const { model, onDeleteRow } = this.props;\n\n if (model.rows && model.rows.length === 1) {\n this.setState({\n dialog: {\n open: true,\n text: 'There has to be at least one question row.',\n },\n });\n } else {\n onDeleteRow(idx);\n }\n };\n\n onMouseDownOnHandle = () => {\n canDrag = true;\n };\n\n onMouseUpOnHandle = () => {\n canDrag = false;\n };\n\n render() {\n const {\n classes,\n imageSupport,\n connectDragSource,\n connectDropTarget,\n isDragging,\n model,\n row,\n idx,\n enableImages,\n toolbarOpts,\n spellCheck,\n error,\n maxImageWidth,\n maxImageHeight,\n uploadSoundSupport,\n } = this.props;\n const { dialog } = this.state;\n const opacity = isDragging ? 0 : 1;\n\n const rowPlugins = {\n image: {\n disabled: !enableImages,\n },\n audio: { disabled: true },\n video: { disabled: true },\n };\n const filteredDefaultPlugins = (DEFAULT_PLUGINS || []).filter(\n (p) => p !== 'bulleted-list' && p !== 'numbered-list',\n );\n\n const content = (\n <div style={{ opacity: opacity, width: 'fit-content' }}>\n <span itemID={'handle'} className={classes.dragHandle} onMouseDown={this.onMouseDownOnHandle}>\n <DragHandle color={'primary'} />\n </span>\n\n <div className={classes.rowContainer}>\n <div className={classNames(classes.rowItem, classes.questionText)}>\n <EditableHtml\n imageSupport={imageSupport}\n autoWidthToolbar\n disableUnderline\n label={'label'}\n markup={row.title}\n onChange={this.onRowTitleChange(idx)}\n className={classes.editor}\n pluginProps={rowPlugins}\n toolbarOpts={toolbarOpts}\n activePlugins={filteredDefaultPlugins}\n spellCheck={spellCheck}\n maxImageWidth={maxImageWidth}\n maxImageHeight={maxImageHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n error={error && error !== 'No correct response defined.'}\n />\n </div>\n\n {row.values.map((rowValue, rowIdx) => (\n <div key={rowIdx} className={classes.rowItem}>\n {model.choiceMode === 'radio' ? (\n <Radio onChange={this.onRowValueChange(idx, rowIdx)} checked={rowValue === true} />\n ) : (\n <Checkbox onChange={this.onRowValueChange(idx, rowIdx)} checked={rowValue === true} label={''} />\n )}\n </div>\n ))}\n\n <div className={classes.deleteIcon}>\n <IconButton onClick={this.onDeleteRow(idx)} aria-label=\"Delete\">\n <Delete />\n </IconButton>\n </div>\n </div>\n\n {error && <div className={classes.errorText}>{error}</div>}\n <hr className={classes.separator} />\n\n <AlertDialog\n open={dialog.open}\n title=\"Warning\"\n text={dialog.text}\n onConfirm={() => this.setState({ dialog: { open: false } })}\n />\n </div>\n );\n\n return connectDragSource(connectDropTarget(content));\n }\n}\n\nconst styles = (theme) => ({\n actions: {\n padding: 0,\n justifyContent: 'space-between',\n },\n choice: {\n padding: theme.spacing.unit,\n overflow: 'visible',\n },\n dragHandle: {\n cursor: 'move',\n },\n dragDisabled: {\n cursor: 'inherit',\n },\n\n container: {\n marginTop: theme.spacing.unit * 2,\n display: 'flex',\n flexDirection: 'column',\n },\n rowContainer: {\n marginTop: theme.spacing.unit * 2,\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n },\n rowItem: {\n flex: 1,\n display: 'flex',\n justifyContent: 'center',\n minWidth: '150px',\n padding: `0 ${theme.spacing.unit}px`,\n },\n deleteIcon: {\n flex: 0.5,\n display: 'flex',\n justifyContent: 'center',\n minWidth: '48px',\n padding: `0 ${theme.spacing.unit}px`,\n },\n questionText: {\n flex: 2,\n display: 'flex',\n justifyContent: 'flex-start',\n padding: 0,\n maxWidth: 'unset',\n textAlign: 'left',\n minWidth: '350px',\n marginRight: theme.spacing.unit,\n '&> div': {\n width: '100%',\n },\n },\n separator: {\n marginTop: theme.spacing.unit * 2,\n border: 0,\n borderTop: '2px solid lightgray',\n width: '100%',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: 'red',\n paddingTop: theme.spacing.unit,\n },\n});\n\nconst StyledRow = withStyles(styles)(Row);\n\nconst NAME = 'row-config';\n\nexport const choiceSource = {\n canDrag() {\n return canDrag;\n },\n beginDrag(props) {\n return {\n id: props.row.id,\n index: props.idx,\n };\n },\n};\n\nconst StyledSource = DragSource(NAME, choiceSource, (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n isDragging: monitor.isDragging(),\n}))(StyledRow);\n\nexport const choiceTarget = {\n hover() {\n log('[hover]');\n },\n drop(props, monitor) {\n const item = monitor.getItem();\n\n log('[drop] item: ', item, 'didDrop?', monitor.didDrop());\n\n props.onMoveRow(item.index, props.idx);\n },\n};\n\nconst StyledSourceAndTarget = DropTarget(NAME, choiceTarget, (connect) => ({\n connectDropTarget: connect.dropTarget(),\n}))(StyledSource);\n\nexport default StyledSourceAndTarget;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,OAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;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CAAC6C,IAAI,CAACT,KAAK,EAAE7H,KAAK,CAACY,GAAG,CAAC;EACxC;AACF,CAAC;AAAChC,OAAA,CAAAuJ,YAAA,GAAAA,YAAA;AAEF,IAAMM,qBAAqB,GAAG,IAAAC,oBAAU,EAACjB,IAAI,EAAEU,YAAY,EAAE,UAACH,OAAO;EAAA,OAAM;IACzErG,iBAAiB,EAAEqG,OAAO,CAACW,UAAU,CAAC;EACxC,CAAC;AAAA,CAAC,CAAC,CAACb,YAAY,CAAC;AAAC,IAAAc,QAAA,GAEHH,qBAAqB;AAAA7J,OAAA,cAAAgK,QAAA"}
|
package/configure/package.json
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@material-ui/icons": "^3.0.1",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
13
|
-
"@pie-lib/config-ui": "12.0.0-beta.
|
|
13
|
+
"@pie-lib/config-ui": "12.0.0-beta.5",
|
|
14
14
|
"@pie-lib/drag": "^2.1.12",
|
|
15
|
-
"@pie-lib/editable-html": "10.0.0-beta.
|
|
16
|
-
"@pie-lib/scoring-config": "4.0.0-beta.
|
|
15
|
+
"@pie-lib/editable-html": "10.0.0-beta.7",
|
|
16
|
+
"@pie-lib/scoring-config": "4.0.0-beta.4",
|
|
17
17
|
"classnames": "^2.2.5",
|
|
18
18
|
"debug": "^3.1.0",
|
|
19
19
|
"prop-types": "^15.6.2",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
config: {
|
|
9
|
+
rows: [{
|
|
10
|
+
id: 1,
|
|
11
|
+
title: 'Question Text 1',
|
|
12
|
+
values: [false, false]
|
|
13
|
+
}, {
|
|
14
|
+
id: 2,
|
|
15
|
+
title: 'Question Text 2',
|
|
16
|
+
values: [false, false]
|
|
17
|
+
}],
|
|
18
|
+
layout: 3,
|
|
19
|
+
headers: ['Column 1', 'Column 2', 'Column 3']
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports["default"] = _default;
|
|
23
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["config","rows","id","title","values","layout","headers","exports","_default"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n config: {\n rows: [\n {\n id: 1,\n title: 'Question Text 1',\n values: [false, false],\n },\n {\n id: 2,\n title: 'Question Text 2',\n values: [false, false],\n },\n ],\n layout: 3,\n headers: ['Column 1', 'Column 2', 'Column 3'],\n },\n};\n"],"mappings":";;;;;;eAAe;EACbA,MAAM,EAAE;IACNC,IAAI,EAAE,CACJ;MACEC,EAAE,EAAE,CAAC;MACLC,KAAK,EAAE,iBAAiB;MACxBC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK;IACvB,CAAC,EACD;MACEF,EAAE,EAAE,CAAC;MACLC,KAAK,EAAE,iBAAiB;MACxBC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK;IACvB,CAAC,CACF;IACDC,MAAM,EAAE,CAAC;IACTC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU;EAC9C;AACF,CAAC;AAAAC,OAAA,cAAAC,QAAA"}
|