@pie-element/multiple-choice 6.2.7 → 6.3.2

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/module/print.js CHANGED
@@ -1,5 +1,5 @@
1
- import {_dll_prop_types, _dll_react_dom, _dll_react, _dll_material_ui__core_styles, _dll_pie_lib__render_ui, _dll_material_ui__core, _dll_classnames, _dll_pie_lib__correct_answer_toggle, _dll_lodash, _dll_debug} from "../../../@pie-lib/shared-module@^1.4.10/module/index.js";
2
- import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.0.35/module/index.js";
1
+ import {_dll_prop_types, _dll_react_dom, _dll_react, _dll_material_ui__core_styles, _dll_pie_lib__render_ui, _dll_material_ui__core, _dll_classnames, _dll_pie_lib__correct_answer_toggle, _dll_lodash, _dll_debug} from "../../../@pie-lib/shared-module@^1.4.17/module/index.js";
2
+ import {_dll_pie_lib__math_rendering} from "../../../@pie-lib/math-rendering-module@^1.1.5/module/index.js";
3
3
  function getDefaultExportFromCjs(x) {
4
4
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
5
  }
@@ -1259,6 +1259,7 @@ const {color: color$1} = _dll_pie_lib__render_ui;
1259
1259
  const {PreviewPrompt: PreviewPrompt$1} = _dll_pie_lib__render_ui;
1260
1260
  const classNames$3 = _dll_classnames;
1261
1261
  const _jsxFileName$3 = "/home/circleci/repo/packages/multiple-choice/src/choice-input.jsx";
1262
+ const CLASS_NAME = 'multiple-choice-component';
1262
1263
  const styleSheet = () => ({
1263
1264
  row: {
1264
1265
  display: 'flex',
@@ -1273,6 +1274,11 @@ const styleSheet = () => ({
1273
1274
  '& label': {
1274
1275
  color: color$1.text()
1275
1276
  }
1277
+ },
1278
+ horizontalLayout: {
1279
+ [`& .${CLASS_NAME}`]: {
1280
+ paddingRight: '8px'
1281
+ }
1276
1282
  }
1277
1283
  });
1278
1284
  const formStyleSheet = {
@@ -1291,10 +1297,9 @@ const StyledFormControlLabel = withStyles$3(formStyleSheet, {
1291
1297
  __self: undefined,
1292
1298
  __source: {
1293
1299
  fileName: _jsxFileName$3,
1294
- lineNumber: 39
1300
+ lineNumber: 46
1295
1301
  }
1296
1302
  }));
1297
- const CLASS_NAME = 'multiple-choice-component';
1298
1303
  const colorStyle = (varName, fallback) => ({
1299
1304
  [`&.${CLASS_NAME}`]: {
1300
1305
  color: `var(--choice-input-${varName}, ${fallback}) !important`
@@ -1346,7 +1351,7 @@ const StyledCheckbox = withStyles$3(inputStyles)(props => {
1346
1351
  __self: undefined,
1347
1352
  __source: {
1348
1353
  fileName: _jsxFileName$3,
1349
- lineNumber: 92
1354
+ lineNumber: 97
1350
1355
  }
1351
1356
  });
1352
1357
  });
@@ -1375,7 +1380,7 @@ const StyledRadio = withStyles$3(inputStyles)(props => {
1375
1380
  __self: undefined,
1376
1381
  __source: {
1377
1382
  fileName: _jsxFileName$3,
1378
- lineNumber: 125
1383
+ lineNumber: 130
1379
1384
  }
1380
1385
  });
1381
1386
  });
@@ -1396,7 +1401,8 @@ class ChoiceInput extends React$4.Component {
1396
1401
  classes: PropTypes$3.object,
1397
1402
  className: PropTypes$3.string,
1398
1403
  hideTick: PropTypes$3.bool,
1399
- isEvaluateMode: PropTypes$3.bool
1404
+ isEvaluateMode: PropTypes$3.bool,
1405
+ choicesLayout: PropTypes$3.oneOf(['vertical', 'grid', 'horizontal'])
1400
1406
  };
1401
1407
  }
1402
1408
  static __initStatic2() {
@@ -1418,36 +1424,39 @@ class ChoiceInput extends React$4.Component {
1418
1424
  });
1419
1425
  }
1420
1426
  render() {
1421
- const {choiceMode, disabled, displayKey, feedback, label, checked, correctness, classes, className, rationale, accessibility, hideTick, isEvaluateMode} = this.props;
1427
+ const {choiceMode, disabled, displayKey, feedback, label, checked, correctness, classes, className, rationale, accessibility, hideTick, isEvaluateMode, choicesLayout} = this.props;
1422
1428
  const Tag = choiceMode === 'checkbox' ? StyledCheckbox : StyledRadio;
1423
1429
  const classSuffix = choiceMode === 'checkbox' ? 'checkbox' : 'radio-button';
1430
+ const holderClassNames = classNames$3(classes.checkboxHolder, {
1431
+ [classes.horizontalLayout]: choicesLayout === 'horizontal'
1432
+ });
1424
1433
  return React$4.createElement('div', {
1425
1434
  className: classNames$3(className, 'corespring-' + classSuffix, 'choice-input'),
1426
1435
  __self: this,
1427
1436
  __source: {
1428
1437
  fileName: _jsxFileName$3,
1429
- lineNumber: 197
1438
+ lineNumber: 208
1430
1439
  }
1431
1440
  }, React$4.createElement('div', {
1432
1441
  className: classes.row,
1433
1442
  __self: this,
1434
1443
  __source: {
1435
1444
  fileName: _jsxFileName$3,
1436
- lineNumber: 198
1445
+ lineNumber: 209
1437
1446
  }
1438
1447
  }, !hideTick && isEvaluateMode && React$4.createElement(FeedbackTick$1, {
1439
1448
  correctness: correctness,
1440
1449
  __self: this,
1441
1450
  __source: {
1442
1451
  fileName: _jsxFileName$3,
1443
- lineNumber: 199
1452
+ lineNumber: 210
1444
1453
  }
1445
1454
  }), React$4.createElement('div', {
1446
- className: classNames$3(classes.checkboxHolder, 'checkbox-holder'),
1455
+ className: classNames$3(holderClassNames, 'checkbox-holder'),
1447
1456
  __self: this,
1448
1457
  __source: {
1449
1458
  fileName: _jsxFileName$3,
1450
- lineNumber: 200
1459
+ lineNumber: 211
1451
1460
  }
1452
1461
  }, React$4.createElement(StyledFormControlLabel, {
1453
1462
  disabled: disabled,
@@ -1460,13 +1469,13 @@ class ChoiceInput extends React$4.Component {
1460
1469
  __self: this,
1461
1470
  __source: {
1462
1471
  fileName: _jsxFileName$3,
1463
- lineNumber: 205
1472
+ lineNumber: 216
1464
1473
  }
1465
1474
  }),
1466
1475
  __self: this,
1467
1476
  __source: {
1468
1477
  fileName: _jsxFileName$3,
1469
- lineNumber: 201
1478
+ lineNumber: 212
1470
1479
  }
1471
1480
  }), React$4.createElement(PreviewPrompt$1, {
1472
1481
  className: "label",
@@ -1476,7 +1485,7 @@ class ChoiceInput extends React$4.Component {
1476
1485
  __self: this,
1477
1486
  __source: {
1478
1487
  fileName: _jsxFileName$3,
1479
- lineNumber: 213
1488
+ lineNumber: 224
1480
1489
  }
1481
1490
  }))), rationale && React$4.createElement(PreviewPrompt$1, {
1482
1491
  className: "rationale",
@@ -1485,7 +1494,7 @@ class ChoiceInput extends React$4.Component {
1485
1494
  __self: this,
1486
1495
  __source: {
1487
1496
  fileName: _jsxFileName$3,
1488
- lineNumber: 222
1497
+ lineNumber: 233
1489
1498
  }
1490
1499
  }), React$4.createElement(Feedback, {
1491
1500
  feedback: feedback,
@@ -1493,7 +1502,7 @@ class ChoiceInput extends React$4.Component {
1493
1502
  __self: this,
1494
1503
  __source: {
1495
1504
  fileName: _jsxFileName$3,
1496
- lineNumber: 224
1505
+ lineNumber: 235
1497
1506
  }
1498
1507
  }));
1499
1508
  }
@@ -1537,7 +1546,8 @@ class Choice extends React$3.Component {
1537
1546
  isEvaluateMode
1538
1547
  };
1539
1548
  const names = classNames$2(classes.choice, {
1540
- [classes.noBorder]: index === choicesLength - 1 || choicesLayout !== 'vertical'
1549
+ [classes.noBorder]: index === choicesLength - 1 || choicesLayout !== 'vertical',
1550
+ [classes.horizontalLayout]: choicesLayout === 'horizontal'
1541
1551
  });
1542
1552
  return React$3.createElement('div', {
1543
1553
  className: choiceClass,
@@ -1545,7 +1555,7 @@ class Choice extends React$3.Component {
1545
1555
  __self: this,
1546
1556
  __source: {
1547
1557
  fileName: _jsxFileName$2,
1548
- lineNumber: 56
1558
+ lineNumber: 57
1549
1559
  }
1550
1560
  }, React$3.createElement(ChoiceInput$1, {
1551
1561
  ...choiceProps,
@@ -1553,7 +1563,7 @@ class Choice extends React$3.Component {
1553
1563
  __self: this,
1554
1564
  __source: {
1555
1565
  fileName: _jsxFileName$2,
1556
- lineNumber: 57
1566
+ lineNumber: 58
1557
1567
  }
1558
1568
  }));
1559
1569
  }
@@ -1582,6 +1592,12 @@ var StyledChoice = withStyles$2({
1582
1592
  },
1583
1593
  noBorder: {
1584
1594
  borderBottom: 'none'
1595
+ },
1596
+ horizontalLayout: {
1597
+ paddingRight: '20px',
1598
+ '& label': {
1599
+ marginRight: '8px'
1600
+ }
1585
1601
  }
1586
1602
  })(Choice);
1587
1603
  const React$2 = _dll_react;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@pie-element/multiple-choice",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "6.2.7",
4
+ "version": "6.3.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "dependencies": {
9
9
  "@material-ui/core": "^3.9.2",
10
- "@pie-lib/config-ui": "^10.11.0",
11
- "@pie-lib/correct-answer-toggle": "^2.3.35",
12
- "@pie-lib/math-rendering": "^2.3.13",
13
- "@pie-lib/render-ui": "^4.12.5",
10
+ "@pie-lib/config-ui": "^10.13.0",
11
+ "@pie-lib/correct-answer-toggle": "^2.3.36",
12
+ "@pie-lib/math-rendering": "^2.4.0",
13
+ "@pie-lib/render-ui": "^4.12.6",
14
14
  "classnames": "^2.2.5",
15
15
  "debug": "^4.1.1",
16
16
  "enzyme-to-json": "^3.3.3",
@@ -21,7 +21,7 @@
21
21
  "react-test-renderer": "^16.3.2",
22
22
  "react-transition-group": "^2.3.1"
23
23
  },
24
- "gitHead": "de8f41ecfc06944b7bc890a167f81818d2bf1845",
24
+ "gitHead": "8ea971e13e74d785cd35a04fd9fe1abe1fa2dabf",
25
25
  "scripts": {
26
26
  "postpublish": "../../scripts/postpublish"
27
27
  },