@pie-element/multiple-choice 11.0.2-esm.0 → 11.0.3-esm.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/package.json +4 -4
- package/controller/package.json +2 -2
- package/esm/configure.js +318 -2
- package/esm/configure.js.map +1 -1
- package/module/controller.js +15 -15
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +1 -1
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +6 -6
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-configure",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.3-esm.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"@material-ui/core": "^3.9.2",
|
|
9
9
|
"@material-ui/icons": "^3.0.1",
|
|
10
10
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
11
|
-
"@pie-lib/config-ui": "^11.26.
|
|
12
|
-
"@pie-lib/editable-html": "^11.18.
|
|
13
|
-
"@pie-lib/render-ui": "^4.32.
|
|
11
|
+
"@pie-lib/config-ui": "^11.26.3",
|
|
12
|
+
"@pie-lib/editable-html": "^11.18.3",
|
|
13
|
+
"@pie-lib/render-ui": "^4.32.3",
|
|
14
14
|
"debug": "^3.1.0",
|
|
15
15
|
"lodash": "^4.17.15",
|
|
16
16
|
"prop-types": "^15.6.2",
|
package/controller/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "11.0.3-esm.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@pie-lib/controller-utils": "^0.19.
|
|
11
|
+
"@pie-lib/controller-utils": "^0.19.2",
|
|
12
12
|
"debug": "^3.1.0",
|
|
13
13
|
"lodash": "^4.17.15"
|
|
14
14
|
}
|
package/esm/configure.js
CHANGED
|
@@ -10,7 +10,7 @@ import { withStyles } from '@material-ui/core/styles';
|
|
|
10
10
|
import Button from '@material-ui/core/Button';
|
|
11
11
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
12
12
|
import Typography from '@material-ui/core/Typography';
|
|
13
|
-
import
|
|
13
|
+
import require$$3 from '@material-ui/core/SvgIcon';
|
|
14
14
|
import merge from 'lodash/merge';
|
|
15
15
|
import defaults from 'lodash/defaults';
|
|
16
16
|
|
|
@@ -32,6 +32,322 @@ function _extends() {
|
|
|
32
32
|
return _extends.apply(this, arguments);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
var Info = {};
|
|
36
|
+
|
|
37
|
+
var interopRequireDefault = {exports: {}};
|
|
38
|
+
|
|
39
|
+
(function (module) {
|
|
40
|
+
function _interopRequireDefault(obj) {
|
|
41
|
+
return obj && obj.__esModule ? obj : {
|
|
42
|
+
"default": obj
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
47
|
+
}(interopRequireDefault));
|
|
48
|
+
|
|
49
|
+
var createSvgIcon$1 = {};
|
|
50
|
+
|
|
51
|
+
var pure$1 = {};
|
|
52
|
+
|
|
53
|
+
var shouldUpdate$1 = {};
|
|
54
|
+
|
|
55
|
+
var inheritsLoose = {exports: {}};
|
|
56
|
+
|
|
57
|
+
var setPrototypeOf = {exports: {}};
|
|
58
|
+
|
|
59
|
+
(function (module) {
|
|
60
|
+
function _setPrototypeOf(o, p) {
|
|
61
|
+
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
62
|
+
o.__proto__ = p;
|
|
63
|
+
return o;
|
|
64
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
65
|
+
return _setPrototypeOf(o, p);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
69
|
+
}(setPrototypeOf));
|
|
70
|
+
|
|
71
|
+
(function (module) {
|
|
72
|
+
var setPrototypeOf$1 = setPrototypeOf.exports;
|
|
73
|
+
|
|
74
|
+
function _inheritsLoose(subClass, superClass) {
|
|
75
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
76
|
+
subClass.prototype.constructor = subClass;
|
|
77
|
+
setPrototypeOf$1(subClass, superClass);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
module.exports = _inheritsLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
81
|
+
}(inheritsLoose));
|
|
82
|
+
|
|
83
|
+
var setDisplayName$1 = {};
|
|
84
|
+
|
|
85
|
+
var setStatic$1 = {};
|
|
86
|
+
|
|
87
|
+
setStatic$1.__esModule = true;
|
|
88
|
+
setStatic$1.default = void 0;
|
|
89
|
+
|
|
90
|
+
var setStatic = function setStatic(key, value) {
|
|
91
|
+
return function (BaseComponent) {
|
|
92
|
+
/* eslint-disable no-param-reassign */
|
|
93
|
+
BaseComponent[key] = value;
|
|
94
|
+
/* eslint-enable no-param-reassign */
|
|
95
|
+
|
|
96
|
+
return BaseComponent;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
var _default$8 = setStatic;
|
|
101
|
+
setStatic$1.default = _default$8;
|
|
102
|
+
|
|
103
|
+
var _interopRequireDefault$6 = interopRequireDefault.exports;
|
|
104
|
+
|
|
105
|
+
setDisplayName$1.__esModule = true;
|
|
106
|
+
setDisplayName$1.default = void 0;
|
|
107
|
+
|
|
108
|
+
var _setStatic = _interopRequireDefault$6(setStatic$1);
|
|
109
|
+
|
|
110
|
+
var setDisplayName = function setDisplayName(displayName) {
|
|
111
|
+
return (0, _setStatic.default)('displayName', displayName);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var _default$7 = setDisplayName;
|
|
115
|
+
setDisplayName$1.default = _default$7;
|
|
116
|
+
|
|
117
|
+
var wrapDisplayName$1 = {};
|
|
118
|
+
|
|
119
|
+
var getDisplayName$1 = {};
|
|
120
|
+
|
|
121
|
+
getDisplayName$1.__esModule = true;
|
|
122
|
+
getDisplayName$1.default = void 0;
|
|
123
|
+
|
|
124
|
+
var getDisplayName = function getDisplayName(Component) {
|
|
125
|
+
if (typeof Component === 'string') {
|
|
126
|
+
return Component;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (!Component) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return Component.displayName || Component.name || 'Component';
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var _default$6 = getDisplayName;
|
|
137
|
+
getDisplayName$1.default = _default$6;
|
|
138
|
+
|
|
139
|
+
var _interopRequireDefault$5 = interopRequireDefault.exports;
|
|
140
|
+
|
|
141
|
+
wrapDisplayName$1.__esModule = true;
|
|
142
|
+
wrapDisplayName$1.default = void 0;
|
|
143
|
+
|
|
144
|
+
var _getDisplayName = _interopRequireDefault$5(getDisplayName$1);
|
|
145
|
+
|
|
146
|
+
var wrapDisplayName = function wrapDisplayName(BaseComponent, hocName) {
|
|
147
|
+
return hocName + "(" + (0, _getDisplayName.default)(BaseComponent) + ")";
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
var _default$5 = wrapDisplayName;
|
|
151
|
+
wrapDisplayName$1.default = _default$5;
|
|
152
|
+
|
|
153
|
+
var _interopRequireDefault$4 = interopRequireDefault.exports;
|
|
154
|
+
|
|
155
|
+
shouldUpdate$1.__esModule = true;
|
|
156
|
+
shouldUpdate$1.default = void 0;
|
|
157
|
+
|
|
158
|
+
var _inheritsLoose2 = _interopRequireDefault$4(inheritsLoose.exports);
|
|
159
|
+
|
|
160
|
+
var _react$2 = React;
|
|
161
|
+
|
|
162
|
+
var _setDisplayName$1 = _interopRequireDefault$4(setDisplayName$1);
|
|
163
|
+
|
|
164
|
+
var _wrapDisplayName$1 = _interopRequireDefault$4(wrapDisplayName$1);
|
|
165
|
+
|
|
166
|
+
var shouldUpdate = function shouldUpdate(test) {
|
|
167
|
+
return function (BaseComponent) {
|
|
168
|
+
var factory = (0, _react$2.createFactory)(BaseComponent);
|
|
169
|
+
|
|
170
|
+
var ShouldUpdate =
|
|
171
|
+
/*#__PURE__*/
|
|
172
|
+
function (_Component) {
|
|
173
|
+
(0, _inheritsLoose2.default)(ShouldUpdate, _Component);
|
|
174
|
+
|
|
175
|
+
function ShouldUpdate() {
|
|
176
|
+
return _Component.apply(this, arguments) || this;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
var _proto = ShouldUpdate.prototype;
|
|
180
|
+
|
|
181
|
+
_proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
|
|
182
|
+
return test(this.props, nextProps);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
_proto.render = function render() {
|
|
186
|
+
return factory(this.props);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
return ShouldUpdate;
|
|
190
|
+
}(_react$2.Component);
|
|
191
|
+
|
|
192
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
193
|
+
return (0, _setDisplayName$1.default)((0, _wrapDisplayName$1.default)(BaseComponent, 'shouldUpdate'))(ShouldUpdate);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return ShouldUpdate;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
var _default$4 = shouldUpdate;
|
|
201
|
+
shouldUpdate$1.default = _default$4;
|
|
202
|
+
|
|
203
|
+
var shallowEqual$1 = {};
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the MIT license found in the
|
|
209
|
+
* LICENSE file in the root directory of this source tree.
|
|
210
|
+
*
|
|
211
|
+
* @typechecks
|
|
212
|
+
*
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
219
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
220
|
+
*/
|
|
221
|
+
function is(x, y) {
|
|
222
|
+
// SameValue algorithm
|
|
223
|
+
if (x === y) {
|
|
224
|
+
// Steps 1-5, 7-10
|
|
225
|
+
// Steps 6.b-6.e: +0 != -0
|
|
226
|
+
// Added the nonzero y check to make Flow happy, but it is redundant
|
|
227
|
+
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
228
|
+
} else {
|
|
229
|
+
// Step 6.a: NaN == NaN
|
|
230
|
+
return x !== x && y !== y;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Performs equality by iterating through keys on an object and returning false
|
|
236
|
+
* when any key has values which are not strictly equal between the arguments.
|
|
237
|
+
* Returns true when the values of all keys are strictly equal.
|
|
238
|
+
*/
|
|
239
|
+
function shallowEqual(objA, objB) {
|
|
240
|
+
if (is(objA, objB)) {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
var keysA = Object.keys(objA);
|
|
249
|
+
var keysB = Object.keys(objB);
|
|
250
|
+
|
|
251
|
+
if (keysA.length !== keysB.length) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Test for A's keys different from B.
|
|
256
|
+
for (var i = 0; i < keysA.length; i++) {
|
|
257
|
+
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return true;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
var shallowEqual_1 = shallowEqual;
|
|
266
|
+
|
|
267
|
+
var _interopRequireDefault$3 = interopRequireDefault.exports;
|
|
268
|
+
|
|
269
|
+
shallowEqual$1.__esModule = true;
|
|
270
|
+
shallowEqual$1.default = void 0;
|
|
271
|
+
|
|
272
|
+
var _shallowEqual$1 = _interopRequireDefault$3(shallowEqual_1);
|
|
273
|
+
|
|
274
|
+
var _default$3 = _shallowEqual$1.default;
|
|
275
|
+
shallowEqual$1.default = _default$3;
|
|
276
|
+
|
|
277
|
+
var _interopRequireDefault$2 = interopRequireDefault.exports;
|
|
278
|
+
|
|
279
|
+
pure$1.__esModule = true;
|
|
280
|
+
pure$1.default = void 0;
|
|
281
|
+
|
|
282
|
+
var _shouldUpdate = _interopRequireDefault$2(shouldUpdate$1);
|
|
283
|
+
|
|
284
|
+
var _shallowEqual = _interopRequireDefault$2(shallowEqual$1);
|
|
285
|
+
|
|
286
|
+
var _setDisplayName = _interopRequireDefault$2(setDisplayName$1);
|
|
287
|
+
|
|
288
|
+
var _wrapDisplayName = _interopRequireDefault$2(wrapDisplayName$1);
|
|
289
|
+
|
|
290
|
+
var pure = function pure(BaseComponent) {
|
|
291
|
+
var hoc = (0, _shouldUpdate.default)(function (props, nextProps) {
|
|
292
|
+
return !(0, _shallowEqual.default)(props, nextProps);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
296
|
+
return (0, _setDisplayName.default)((0, _wrapDisplayName.default)(BaseComponent, 'pure'))(hoc(BaseComponent));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return hoc(BaseComponent);
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
var _default$2 = pure;
|
|
303
|
+
pure$1.default = _default$2;
|
|
304
|
+
|
|
305
|
+
var _interopRequireDefault$1 = interopRequireDefault.exports;
|
|
306
|
+
|
|
307
|
+
Object.defineProperty(createSvgIcon$1, "__esModule", {
|
|
308
|
+
value: true
|
|
309
|
+
});
|
|
310
|
+
createSvgIcon$1.default = void 0;
|
|
311
|
+
|
|
312
|
+
var _react$1 = _interopRequireDefault$1(React);
|
|
313
|
+
|
|
314
|
+
var _pure = _interopRequireDefault$1(pure$1);
|
|
315
|
+
|
|
316
|
+
var _SvgIcon = _interopRequireDefault$1(require$$3);
|
|
317
|
+
|
|
318
|
+
function createSvgIcon(path, displayName) {
|
|
319
|
+
var Icon = function Icon(props) {
|
|
320
|
+
return _react$1.default.createElement(_SvgIcon.default, props, path);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
Icon.displayName = "".concat(displayName, "Icon");
|
|
324
|
+
Icon = (0, _pure.default)(Icon);
|
|
325
|
+
Icon.muiName = 'SvgIcon';
|
|
326
|
+
return Icon;
|
|
327
|
+
}
|
|
328
|
+
var _default$1 = createSvgIcon;
|
|
329
|
+
createSvgIcon$1.default = _default$1;
|
|
330
|
+
|
|
331
|
+
var _interopRequireDefault = interopRequireDefault.exports;
|
|
332
|
+
|
|
333
|
+
Object.defineProperty(Info, "__esModule", {
|
|
334
|
+
value: true
|
|
335
|
+
});
|
|
336
|
+
var default_1 = Info.default = void 0;
|
|
337
|
+
|
|
338
|
+
var _react = _interopRequireDefault(React);
|
|
339
|
+
|
|
340
|
+
var _createSvgIcon = _interopRequireDefault(createSvgIcon$1);
|
|
341
|
+
|
|
342
|
+
var _default = (0, _createSvgIcon.default)(_react.default.createElement(_react.default.Fragment, null, _react.default.createElement("path", {
|
|
343
|
+
fill: "none",
|
|
344
|
+
d: "M0 0h24v24H0z"
|
|
345
|
+
}), _react.default.createElement("path", {
|
|
346
|
+
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"
|
|
347
|
+
})), 'Info');
|
|
348
|
+
|
|
349
|
+
default_1 = Info.default = _default;
|
|
350
|
+
|
|
35
351
|
const generateValidationMessage = config => {
|
|
36
352
|
const {
|
|
37
353
|
minAnswerChoices,
|
|
@@ -293,7 +609,7 @@ const Design = withStyles(styles)(props => {
|
|
|
293
609
|
disableTouchListener: true,
|
|
294
610
|
placement: 'right',
|
|
295
611
|
title: validationMessage
|
|
296
|
-
}, /*#__PURE__*/React.createElement(
|
|
612
|
+
}, /*#__PURE__*/React.createElement(default_1, {
|
|
297
613
|
fontSize: 'small',
|
|
298
614
|
color: 'primary'
|
|
299
615
|
}))), choices.map((choice, index) => {
|