@pie-lib/config-ui 10.10.18 → 10.10.21

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/checkbox.js +2 -2
  3. package/lib/checkbox.js.map +1 -1
  4. package/lib/choice-configuration/feedback-menu.js +25 -21
  5. package/lib/choice-configuration/feedback-menu.js.map +1 -1
  6. package/lib/choice-configuration/index.js +48 -42
  7. package/lib/choice-configuration/index.js.map +1 -1
  8. package/lib/choice-utils.js +4 -4
  9. package/lib/choice-utils.js.map +1 -1
  10. package/lib/feedback-config/feedback-selector.js +26 -24
  11. package/lib/feedback-config/feedback-selector.js.map +1 -1
  12. package/lib/feedback-config/group.js +3 -3
  13. package/lib/feedback-config/group.js.map +1 -1
  14. package/lib/feedback-config/index.js +29 -24
  15. package/lib/feedback-config/index.js.map +1 -1
  16. package/lib/form-section.js +2 -2
  17. package/lib/form-section.js.map +1 -1
  18. package/lib/help.js +22 -18
  19. package/lib/help.js.map +1 -1
  20. package/lib/index.js +53 -48
  21. package/lib/index.js.map +1 -1
  22. package/lib/input.js +23 -15
  23. package/lib/input.js.map +1 -1
  24. package/lib/inputs.js +9 -9
  25. package/lib/inputs.js.map +1 -1
  26. package/lib/langs.js +25 -21
  27. package/lib/langs.js.map +1 -1
  28. package/lib/layout/config-layout.js +19 -15
  29. package/lib/layout/config-layout.js.map +1 -1
  30. package/lib/layout/layout-contents.js +22 -18
  31. package/lib/layout/layout-contents.js.map +1 -1
  32. package/lib/layout/settings-box.js +17 -13
  33. package/lib/layout/settings-box.js.map +1 -1
  34. package/lib/mui-box/index.js +1 -1
  35. package/lib/mui-box/index.js.map +1 -1
  36. package/lib/number-text-field.js +17 -13
  37. package/lib/number-text-field.js.map +1 -1
  38. package/lib/radio-with-label.js +2 -2
  39. package/lib/radio-with-label.js.map +1 -1
  40. package/lib/settings/display-size.js +6 -6
  41. package/lib/settings/display-size.js.map +1 -1
  42. package/lib/settings/index.js +12 -8
  43. package/lib/settings/index.js.map +1 -1
  44. package/lib/settings/panel.js +42 -38
  45. package/lib/settings/panel.js.map +1 -1
  46. package/lib/settings/settings-radio-label.js +2 -2
  47. package/lib/settings/settings-radio-label.js.map +1 -1
  48. package/lib/settings/toggle.js +3 -3
  49. package/lib/settings/toggle.js.map +1 -1
  50. package/lib/tabs/index.js +19 -15
  51. package/lib/tabs/index.js.map +1 -1
  52. package/lib/tags-input/index.js +20 -16
  53. package/lib/tags-input/index.js.map +1 -1
  54. package/lib/two-choice.js +23 -21
  55. package/lib/two-choice.js.map +1 -1
  56. package/lib/with-stateful-model.js +16 -12
  57. package/lib/with-stateful-model.js.map +1 -1
  58. package/package.json +3 -3
  59. package/src/choice-configuration/index.jsx +4 -0
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -19,23 +21,25 @@ var _muiBox = _interopRequireDefault(require("../mui-box"));
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
23
-
24
24
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
25
 
26
26
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
27
27
 
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
29
 
30
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
30
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
31
 
32
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
+
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
+
36
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
33
37
 
34
38
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
39
 
36
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
40
+ 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; } }
37
41
 
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
43
 
40
44
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
45
 
@@ -51,7 +55,7 @@ var Tag = (0, _styles.withStyles)(function () {
51
55
  var classes = _ref.classes,
52
56
  label = _ref.label,
53
57
  onDelete = _ref.onDelete;
54
- return _react["default"].createElement(_Chip["default"], {
58
+ return /*#__PURE__*/_react["default"].createElement(_Chip["default"], {
55
59
  className: classes.tag,
56
60
  label: label,
57
61
  onDelete: onDelete
@@ -62,17 +66,17 @@ Tag.propTypes = {
62
66
  onDelete: _propTypes["default"].func.isRequired
63
67
  };
64
68
 
65
- var TagsInput =
66
- /*#__PURE__*/
67
- function (_React$Component) {
69
+ var TagsInput = /*#__PURE__*/function (_React$Component) {
68
70
  _inherits(TagsInput, _React$Component);
69
71
 
72
+ var _super = _createSuper(TagsInput);
73
+
70
74
  function TagsInput(props) {
71
75
  var _this;
72
76
 
73
77
  _classCallCheck(this, TagsInput);
74
78
 
75
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TagsInput).call(this, props));
79
+ _this = _super.call(this, props);
76
80
 
77
81
  _defineProperty(_assertThisInitialized(_this), "onFocus", function () {
78
82
  _this.setState({
@@ -137,19 +141,19 @@ function (_React$Component) {
137
141
  var _this$props = this.props,
138
142
  classes = _this$props.classes,
139
143
  tags = _this$props.tags;
140
- return _react["default"].createElement(_muiBox["default"], {
144
+ return /*#__PURE__*/_react["default"].createElement(_muiBox["default"], {
141
145
  focused: this.state.focused
142
- }, _react["default"].createElement("div", {
146
+ }, /*#__PURE__*/_react["default"].createElement("div", {
143
147
  className: classes.tagsInput
144
148
  }, (tags || []).map(function (t, index) {
145
- return _react["default"].createElement(Tag, {
149
+ return /*#__PURE__*/_react["default"].createElement(Tag, {
146
150
  key: index,
147
151
  label: t,
148
152
  onDelete: function onDelete() {
149
153
  return _this2.deleteTag(t);
150
154
  }
151
155
  });
152
- }), _react["default"].createElement("input", {
156
+ }), /*#__PURE__*/_react["default"].createElement("input", {
153
157
  ref: function ref(r) {
154
158
  return _this2.input = r;
155
159
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tags-input/index.jsx"],"names":["ENTER","Tag","tag","padding","margin","classes","label","onDelete","propTypes","PropTypes","string","isRequired","func","TagsInput","props","setState","focused","state","value","onKeyDown","event","keyCode","trim","newTags","tags","concat","length","onChange","target","deleteTag","tagIndex","indexOf","splice","input","focus","tagsInput","map","t","index","r","onFocus","onBlur","React","Component","object","arrayOf","styles","theme","border","display","flexWrap","minWidth","width","flex","height","fontSize","typography","fontFamily","outline"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,KAAK,GAAG,EAAd;AAEA,IAAMC,GAAG,GAAG,wBAAW;AAAA,SAAO;AAC5BC,IAAAA,GAAG,EAAE;AACHC,MAAAA,OAAO,EA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UATxB;AAULC,MAAAA,OAAO,EAAE,MAVJ;AAWL,iBAAW;AACTA,QAAAA,OAAO,EAAE;AADA;AAXN;AANgB,GAAL;AAAA,CAApB;;eAuBe,wBAAWZ,MAAX,EAAmBjC,SAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport uniq from 'lodash/uniq';\nimport Chip from '@material-ui/core/Chip';\nimport MuiBox from '../mui-box';\n\nconst ENTER = 13;\n\nconst Tag = withStyles(() => ({\n tag: {\n padding: '0px',\n margin: '1px'\n }\n}))(({ classes, label, onDelete }) => (\n <Chip className={classes.tag} label={label} onDelete={onDelete} />\n));\n\nTag.propTypes = {\n label: PropTypes.string.isRequired,\n onDelete: PropTypes.func.isRequired\n};\n\nexport class TagsInput extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n tags: PropTypes.arrayOf(PropTypes.string).isRequired,\n onChange: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n focused: false\n };\n\n this.onKeyDown = event => {\n if (event.keyCode === ENTER && this.state.value !== '') {\n const tag = this.state.value.trim();\n const newTags = uniq(this.props.tags.concat([tag]));\n\n if (newTags.length !== this.props.tags.length) {\n this.props.onChange(newTags);\n this.setState({ value: '' });\n }\n }\n };\n\n this.onChange = event => {\n this.setState({ value: event.target.value });\n };\n\n this.deleteTag = tag => {\n const { tags } = this.props;\n\n const tagIndex = tags.indexOf(tag);\n if (tagIndex !== -1) {\n tags.splice(tagIndex, 1);\n this.props.onChange(tags);\n this.input.focus();\n }\n };\n }\n\n onFocus = () => {\n this.setState({ focused: true });\n };\n\n onBlur = () => {\n this.setState({ focused: false });\n };\n\n render() {\n const { classes, tags } = this.props;\n return (\n <MuiBox focused={this.state.focused}>\n <div className={classes.tagsInput}>\n {(tags || []).map((t, index) => (\n <Tag key={index} label={t} onDelete={() => this.deleteTag(t)} />\n ))}\n <input\n ref={r => (this.input = r)}\n onKeyDown={this.onKeyDown}\n onChange={this.onChange}\n className={classes.input}\n value={this.state.value}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n type=\"text\"\n />\n </div>\n </MuiBox>\n );\n }\n}\n\nconst styles = theme => ({\n tagsInput: {\n border: 'solid 0px white',\n display: 'flex',\n flexWrap: 'wrap'\n },\n input: {\n padding: '2px',\n margin: '1px',\n minWidth: '30px',\n width: '100%',\n flex: '1',\n border: 'solid 0px white',\n height: '28px',\n fontSize: theme.typography.fontSize,\n fontFamily: theme.typography.fontFamily,\n outline: 'none',\n '&:focus': {\n outline: 'none'\n }\n }\n});\n\nexport default withStyles(styles)(TagsInput);\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/tags-input/index.jsx"],"names":["ENTER","Tag","tag","padding","margin","classes","label","onDelete","propTypes","PropTypes","string","isRequired","func","TagsInput","props","setState","focused","state","value","onKeyDown","event","keyCode","trim","newTags","tags","concat","length","onChange","target","deleteTag","tagIndex","indexOf","splice","input","focus","tagsInput","map","t","index","r","onFocus","onBlur","React","Component","object","arrayOf","styles","theme","border","display","flexWrap","minWidth","width","flex","height","fontSize","typography","fontFamily","outline"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,KAAK,GAAG,EAAd;AAEA,IAAMC,GAAG,GAAG,wBAAW;AAAA,SAAO;AAC5BC,IAAAA,GAAG,EAAE;AACHC,MAAAA,OAAO,EAAE,KADN;AAEHC,MAAAA,MAAM,EAAE;AAFL;AADuB,GAAP;AAAA,CAAX,EAKR;AAAA,MAAGC,OAAH,QAAGA,OAAH;AAAA,MAAYC,KAAZ,QAAYA,KAAZ;AAAA,MAAmBC,QAAnB,QAAmBA,QAAnB;AAAA,sBACF,gCAAC,gBAAD;AAAM,IAAA,SAAS,EAAEF,OAAO,CAACH,GAAzB;AAA8B,IAAA,KAAK,EAAEI,KAArC;AAA4C,IAAA,QAAQ,EAAEC;AAAt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AAWC,KALpB;AAME,QAAA,OAAO,EAAE,KAAKsB,OANhB;AAOE,QAAA,MAAM,EAAE,KAAKC,MAPf;AAQE,QAAA,IAAI,EAAC;AARP,QAJF,CADF,CADF;AAmBD;;;;EAvE4BC,kBAAMC,S;;;;gBAAxB9B,S,eACQ;AACjBR,EAAAA,OAAO,EAAEI,sBAAUmC,MAAV,CAAiBjC,UADT;AAEjBa,EAAAA,IAAI,EAAEf,sBAAUoC,OAAV,CAAkBpC,sBAAUC,MAA5B,EAAoCC,UAFzB;AAGjBgB,EAAAA,QAAQ,EAAElB,sBAAUG,IAAV,CAAeD;AAHR,C;;AAyErB,IAAMmC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBZ,IAAAA,SAAS,EAAE;AACTa,MAAAA,MAAM,EAAE,iBADC;AAETC,MAAAA,OAAO,EAAE,MAFA;AAGTC,MAAAA,QAAQ,EAAE;AAHD,KADY;AAMvBjB,IAAAA,KAAK,EAAE;AACL9B,MAAAA,OAAO,EAAE,KADJ;AAELC,MAAAA,MAAM,EAAE,KAFH;AAGL+C,MAAAA,QAAQ,EAAE,MAHL;AAILC,MAAAA,KAAK,EAAE,MAJF;AAKLC,MAAAA,IAAI,EAAE,GALD;AAMLL,MAAAA,MAAM,EAAE,iBANH;AAOLM,MAAAA,MAAM,EAAE,MAPH;AAQLC,MAAAA,QAAQ,EAAER,KAAK,CAACS,UAAN,CAAiBD,QARtB;AASLE,MAAAA,UAAU,EAAEV,KAAK,CAACS,UAAN,CAAiBC,UATxB;AAULC,MAAAA,OAAO,EAAE,MAVJ;AAWL,iBAAW;AACTA,QAAAA,OAAO,EAAE;AADA;AAXN;AANgB,GAAL;AAAA,CAApB;;eAuBe,wBAAWZ,MAAX,EAAmBjC,SAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport uniq from 'lodash/uniq';\nimport Chip from '@material-ui/core/Chip';\nimport MuiBox from '../mui-box';\n\nconst ENTER = 13;\n\nconst Tag = withStyles(() => ({\n tag: {\n padding: '0px',\n margin: '1px'\n }\n}))(({ classes, label, onDelete }) => (\n <Chip className={classes.tag} label={label} onDelete={onDelete} />\n));\n\nTag.propTypes = {\n label: PropTypes.string.isRequired,\n onDelete: PropTypes.func.isRequired\n};\n\nexport class TagsInput extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n tags: PropTypes.arrayOf(PropTypes.string).isRequired,\n onChange: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n focused: false\n };\n\n this.onKeyDown = event => {\n if (event.keyCode === ENTER && this.state.value !== '') {\n const tag = this.state.value.trim();\n const newTags = uniq(this.props.tags.concat([tag]));\n\n if (newTags.length !== this.props.tags.length) {\n this.props.onChange(newTags);\n this.setState({ value: '' });\n }\n }\n };\n\n this.onChange = event => {\n this.setState({ value: event.target.value });\n };\n\n this.deleteTag = tag => {\n const { tags } = this.props;\n\n const tagIndex = tags.indexOf(tag);\n if (tagIndex !== -1) {\n tags.splice(tagIndex, 1);\n this.props.onChange(tags);\n this.input.focus();\n }\n };\n }\n\n onFocus = () => {\n this.setState({ focused: true });\n };\n\n onBlur = () => {\n this.setState({ focused: false });\n };\n\n render() {\n const { classes, tags } = this.props;\n return (\n <MuiBox focused={this.state.focused}>\n <div className={classes.tagsInput}>\n {(tags || []).map((t, index) => (\n <Tag key={index} label={t} onDelete={() => this.deleteTag(t)} />\n ))}\n <input\n ref={r => (this.input = r)}\n onKeyDown={this.onKeyDown}\n onChange={this.onChange}\n className={classes.input}\n value={this.state.value}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n type=\"text\"\n />\n </div>\n </MuiBox>\n );\n }\n}\n\nconst styles = theme => ({\n tagsInput: {\n border: 'solid 0px white',\n display: 'flex',\n flexWrap: 'wrap'\n },\n input: {\n padding: '2px',\n margin: '1px',\n minWidth: '30px',\n width: '100%',\n flex: '1',\n border: 'solid 0px white',\n height: '28px',\n fontSize: theme.typography.fontSize,\n fontFamily: theme.typography.fontFamily,\n outline: 'none',\n '&:focus': {\n outline: 'none'\n }\n }\n});\n\nexport default withStyles(styles)(TagsInput);\n"],"file":"index.js"}
package/lib/two-choice.js CHANGED
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -19,23 +21,25 @@ var _styles = require("@material-ui/core/styles");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
23
-
24
24
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
25
 
26
26
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
27
27
 
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
29
 
30
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
30
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
31
 
32
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
+
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
+
36
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
33
37
 
34
38
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
39
 
36
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
40
+ 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; } }
37
41
 
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
43
 
40
44
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
45
 
@@ -53,14 +57,12 @@ var styles = function styles(theme) {
53
57
  };
54
58
  };
55
59
 
56
- var RawNChoice =
57
- /*#__PURE__*/
58
- function (_React$Component) {
60
+ var RawNChoice = /*#__PURE__*/function (_React$Component) {
59
61
  _inherits(RawNChoice, _React$Component);
60
62
 
61
- function RawNChoice() {
62
- var _getPrototypeOf2;
63
+ var _super = _createSuper(RawNChoice);
63
64
 
65
+ function RawNChoice() {
64
66
  var _this;
65
67
 
66
68
  _classCallCheck(this, RawNChoice);
@@ -69,7 +71,7 @@ function (_React$Component) {
69
71
  args[_key] = arguments[_key];
70
72
  }
71
73
 
72
- _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RawNChoice)).call.apply(_getPrototypeOf2, [this].concat(args)));
74
+ _this = _super.call.apply(_super, [this].concat(args));
73
75
 
74
76
  _defineProperty(_assertThisInitialized(_this), "handleChange", function (event) {
75
77
  _this.props.onChange(event.currentTarget.value);
@@ -98,13 +100,13 @@ function (_React$Component) {
98
100
  } : o;
99
101
  });
100
102
  var LabelComponent = customLabel || _radioWithLabel["default"];
101
- return _react["default"].createElement(_renderUi.InputContainer, {
103
+ return /*#__PURE__*/_react["default"].createElement(_renderUi.InputContainer, {
102
104
  label: header,
103
105
  className: className
104
- }, _react["default"].createElement("div", {
106
+ }, /*#__PURE__*/_react["default"].createElement("div", {
105
107
  className: (0, _classnames["default"])(classes.group, classes[direction])
106
108
  }, preppedOpts.map(function (o, index) {
107
- return _react["default"].createElement(LabelComponent, {
109
+ return /*#__PURE__*/_react["default"].createElement(LabelComponent, {
108
110
  value: o.value,
109
111
  key: index,
110
112
  checked: o.value === value,
@@ -137,15 +139,15 @@ var labelValue = _propTypes["default"].shape({
137
139
  value: _propTypes["default"].string
138
140
  });
139
141
 
140
- var TwoChoice =
141
- /*#__PURE__*/
142
- function (_React$Component2) {
142
+ var TwoChoice = /*#__PURE__*/function (_React$Component2) {
143
143
  _inherits(TwoChoice, _React$Component2);
144
144
 
145
+ var _super2 = _createSuper(TwoChoice);
146
+
145
147
  function TwoChoice() {
146
148
  _classCallCheck(this, TwoChoice);
147
149
 
148
- return _possibleConstructorReturn(this, _getPrototypeOf(TwoChoice).apply(this, arguments));
150
+ return _super2.apply(this, arguments);
149
151
  }
150
152
 
151
153
  _createClass(TwoChoice, [{
@@ -160,7 +162,7 @@ function (_React$Component2) {
160
162
  value = _this$props2.value,
161
163
  onChange = _this$props2.onChange;
162
164
  var opts = [one, two];
163
- return _react["default"].createElement(NChoice, {
165
+ return /*#__PURE__*/_react["default"].createElement(NChoice, {
164
166
  customLabel: customLabel,
165
167
  header: header,
166
168
  className: className,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/two-choice.jsx"],"names":["styles","theme","group","display","flexWrap","paddingLeft","marginTop","spacing","unit","vertical","flexDirection","RawNChoice","event","props","onChange","currentTarget","value","header","className","classes","customLabel","opts","direction","preppedOpts","map","o","label","LabelComponent","RadioWithLabel","index","handleChange","React","Component","PropTypes","string","isRequired","func","array","oneOf","object","NChoice","labelValue","shape","TwoChoice","one","two","oneOfType"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,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,UACkDF,QADlD,gBACkDA,QADlD;AAEP,UAAMO,IAAI,GAAG,CAACuB,GAAD,EAAMC,GAAN,CAAb;AAEA,aACE,gCAAC,OAAD;AACE,QAAA,WAAW,EAAEzB,WADf;AAEE,QAAA,MAAM,EAAEH,MAFV;AAGE,QAAA,SAAS,EAAEC,SAHb;AAIE,QAAA,IAAI,EAAEG,IAJR;AAKE,QAAA,KAAK,EAAEL,KALT;AAME,QAAA,QAAQ,EAAEF;AANZ,QADF;AAUD;;;;EAzBqBiB,kBAAMC,S;;gBAAxBW,S,eACe;AACjB1B,EAAAA,MAAM,EAAEgB,sBAAUC,MAAV,CAAiBC,UADR;AAEjBnB,EAAAA,KAAK,EAAEiB,sBAAUC,MAAV,CAAiBC,UAFP;AAGjBrB,EAAAA,QAAQ,EAAEmB,sBAAUG,IAAV,CAAeD,UAHR;AAIjBS,EAAAA,GAAG,EAAEX,sBAAUa,SAAV,CAAoB,CAACL,UAAD,EAAaR,sBAAUC,MAAvB,CAApB,CAJY;AAKjBW,EAAAA,GAAG,EAAEZ,sBAAUa,SAAV,CAAoB,CAACL,UAAD,EAAaR,sBAAUC,MAAvB,CAApB,CALY;AAMjBhB,EAAAA,SAAS,EAAEe,sBAAUC,MANJ;AAOjBd,EAAAA,WAAW,EAAEa,sBAAUG;AAPN,C;;eA2BN,wBAAWpC,MAAX,EAAmB2C,SAAnB,C","sourcesContent":["import { InputContainer } from '@pie-lib/render-ui';\nimport PropTypes from 'prop-types';\nimport RadioWithLabel from './radio-with-label';\nimport React from 'react';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\n\nconst styles = theme => ({\n group: {\n display: 'flex',\n flexWrap: 'wrap',\n paddingLeft: 0,\n marginTop: theme.spacing.unit\n },\n vertical: {\n flexDirection: 'column'\n }\n});\n\nclass RawNChoice extends React.Component {\n static propTypes = {\n header: PropTypes.string.isRequired,\n className: PropTypes.string,\n customLabel: PropTypes.func,\n opts: PropTypes.array.isRequired,\n value: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n direction: PropTypes.oneOf(['horizontal', 'vertical']),\n classes: PropTypes.object.isRequired\n };\n\n handleChange = event => {\n this.props.onChange(event.currentTarget.value);\n };\n\n render() {\n const { header, className, classes, customLabel, opts, value, direction } = this.props;\n\n const preppedOpts = opts.map(o => {\n return typeof o === 'string' ? { label: o, value: o } : o;\n });\n const LabelComponent = customLabel || RadioWithLabel;\n\n return (\n <InputContainer label={header} className={className}>\n <div className={classNames(classes.group, classes[direction])}>\n {preppedOpts.map((o, index) => (\n <LabelComponent\n value={o.value}\n key={index}\n checked={o.value === value}\n onChange={this.handleChange}\n label={o.label}\n />\n ))}\n </div>\n </InputContainer>\n );\n }\n}\n\nexport const NChoice = withStyles(styles)(RawNChoice);\n\nconst labelValue = PropTypes.shape({ label: PropTypes.string, value: PropTypes.string });\n\nclass TwoChoice extends React.Component {\n static propTypes = {\n header: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n one: PropTypes.oneOfType([labelValue, PropTypes.string]),\n two: PropTypes.oneOfType([labelValue, PropTypes.string]),\n className: PropTypes.string,\n customLabel: PropTypes.func\n };\n\n render() {\n const { one, two, header, className, customLabel, value, onChange } = this.props;\n const opts = [one, two];\n\n return (\n <NChoice\n customLabel={customLabel}\n header={header}\n className={className}\n opts={opts}\n value={value}\n onChange={onChange}\n />\n );\n }\n}\n\nexport default withStyles(styles)(TwoChoice);\n"],"file":"two-choice.js"}
1
+ {"version":3,"sources":["../src/two-choice.jsx"],"names":["styles","theme","group","display","flexWrap","paddingLeft","marginTop","spacing","unit","vertical","flexDirection","RawNChoice","event","props","onChange","currentTarget","value","header","className","classes","customLabel","opts","direction","preppedOpts","map","o","label","LabelComponent","RadioWithLabel","index","handleChange","React","Component","PropTypes","string","isRequired","func","array","oneOf","object","NChoice","labelValue","shape","TwoChoice","one","two","oneOfType"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;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GAAb;AAAA,UAAkB5B,MAAlB,gBAAkBA,MAAlB;AAAA,UAA0BC,SAA1B,gBAA0BA,SAA1B;AAAA,UAAqCE,WAArC,gBAAqCA,WAArC;AAAA,UAAkDJ,KAAlD,gBAAkDA,KAAlD;AAAA,UAAyDF,QAAzD,gBAAyDA,QAAzD;AACA,UAAMO,IAAI,GAAG,CAACuB,GAAD,EAAMC,GAAN,CAAb;AAEA,0BACE,gCAAC,OAAD;AACE,QAAA,WAAW,EAAEzB,WADf;AAEE,QAAA,MAAM,EAAEH,MAFV;AAGE,QAAA,SAAS,EAAEC,SAHb;AAIE,QAAA,IAAI,EAAEG,IAJR;AAKE,QAAA,KAAK,EAAEL,KALT;AAME,QAAA,QAAQ,EAAEF;AANZ,QADF;AAUD;;;;EAzBqBiB,kBAAMC,S;;gBAAxBW,S,eACe;AACjB1B,EAAAA,MAAM,EAAEgB,sBAAUC,MAAV,CAAiBC,UADR;AAEjBnB,EAAAA,KAAK,EAAEiB,sBAAUC,MAAV,CAAiBC,UAFP;AAGjBrB,EAAAA,QAAQ,EAAEmB,sBAAUG,IAAV,CAAeD,UAHR;AAIjBS,EAAAA,GAAG,EAAEX,sBAAUa,SAAV,CAAoB,CAACL,UAAD,EAAaR,sBAAUC,MAAvB,CAApB,CAJY;AAKjBW,EAAAA,GAAG,EAAEZ,sBAAUa,SAAV,CAAoB,CAACL,UAAD,EAAaR,sBAAUC,MAAvB,CAApB,CALY;AAMjBhB,EAAAA,SAAS,EAAEe,sBAAUC,MANJ;AAOjBd,EAAAA,WAAW,EAAEa,sBAAUG;AAPN,C;;eA2BN,wBAAWpC,MAAX,EAAmB2C,SAAnB,C","sourcesContent":["import { InputContainer } from '@pie-lib/render-ui';\nimport PropTypes from 'prop-types';\nimport RadioWithLabel from './radio-with-label';\nimport React from 'react';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\n\nconst styles = theme => ({\n group: {\n display: 'flex',\n flexWrap: 'wrap',\n paddingLeft: 0,\n marginTop: theme.spacing.unit\n },\n vertical: {\n flexDirection: 'column'\n }\n});\n\nclass RawNChoice extends React.Component {\n static propTypes = {\n header: PropTypes.string.isRequired,\n className: PropTypes.string,\n customLabel: PropTypes.func,\n opts: PropTypes.array.isRequired,\n value: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n direction: PropTypes.oneOf(['horizontal', 'vertical']),\n classes: PropTypes.object.isRequired\n };\n\n handleChange = event => {\n this.props.onChange(event.currentTarget.value);\n };\n\n render() {\n const { header, className, classes, customLabel, opts, value, direction } = this.props;\n\n const preppedOpts = opts.map(o => {\n return typeof o === 'string' ? { label: o, value: o } : o;\n });\n const LabelComponent = customLabel || RadioWithLabel;\n\n return (\n <InputContainer label={header} className={className}>\n <div className={classNames(classes.group, classes[direction])}>\n {preppedOpts.map((o, index) => (\n <LabelComponent\n value={o.value}\n key={index}\n checked={o.value === value}\n onChange={this.handleChange}\n label={o.label}\n />\n ))}\n </div>\n </InputContainer>\n );\n }\n}\n\nexport const NChoice = withStyles(styles)(RawNChoice);\n\nconst labelValue = PropTypes.shape({ label: PropTypes.string, value: PropTypes.string });\n\nclass TwoChoice extends React.Component {\n static propTypes = {\n header: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n one: PropTypes.oneOfType([labelValue, PropTypes.string]),\n two: PropTypes.oneOfType([labelValue, PropTypes.string]),\n className: PropTypes.string,\n customLabel: PropTypes.func\n };\n\n render() {\n const { one, two, header, className, customLabel, value, onChange } = this.props;\n const opts = [one, two];\n\n return (\n <NChoice\n customLabel={customLabel}\n header={header}\n className={className}\n opts={opts}\n value={value}\n onChange={onChange}\n />\n );\n }\n}\n\nexport default withStyles(styles)(TwoChoice);\n"],"file":"two-choice.js"}
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -11,38 +13,40 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
13
 
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
15
 
14
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
15
-
16
16
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
17
 
18
18
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19
19
 
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
20
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
21
 
22
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
22
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
23
23
 
24
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
+
26
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
27
+
28
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
25
29
 
26
30
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
27
31
 
28
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
32
+ 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; } }
29
33
 
30
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
31
35
 
32
36
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
37
 
34
38
  var withStatefulModel = function withStatefulModel(Component) {
35
- var Stateful =
36
- /*#__PURE__*/
37
- function (_React$Component) {
39
+ var Stateful = /*#__PURE__*/function (_React$Component) {
38
40
  _inherits(Stateful, _React$Component);
39
41
 
42
+ var _super = _createSuper(Stateful);
43
+
40
44
  function Stateful(props) {
41
45
  var _this;
42
46
 
43
47
  _classCallCheck(this, Stateful);
44
48
 
45
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Stateful).call(this, props));
49
+ _this = _super.call(this, props);
46
50
 
47
51
  _defineProperty(_assertThisInitialized(_this), "onChange", function (model) {
48
52
  _this.setState({
@@ -68,7 +72,7 @@ var withStatefulModel = function withStatefulModel(Component) {
68
72
  }, {
69
73
  key: "render",
70
74
  value: function render() {
71
- return _react["default"].createElement(Component, {
75
+ return /*#__PURE__*/_react["default"].createElement(Component, {
72
76
  model: this.state.model,
73
77
  onChange: this.onChange
74
78
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/with-stateful-model.jsx"],"names":["withStatefulModel","Component","Stateful","props","model","setState","onChange","state","React","PropTypes","object","isRequired","func"],"mappings":";;;;;;;AAAA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAAAC,SAAS,EAAI;AAAA,MAC/BC,QAD+B;AAAA;AAAA;AAAA;;AAOnC,sBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,oFAAMA,KAAN;;AADiB,iEAWR,UAAAC,KAAK,EAAI;AAClB,cAAKC,QAAL,CAAc;AAAED,UAAAA,KAAK,EAALA;AAAF,SAAd,EAAyB,YAAM;AAC7B,gBAAKD,KAAL,CAAWG,QAAX,CAAoB,MAAKC,KAAL,CAAWH,KAA/B;AACD,SAFD;AAGD,OAfkB;;AAEjB,YAAKG,KAAL,GAAa;AACXH,QAAAA,KAAK,EAAED,KAAK,CAACC;AADF,OAAb;AAFiB;AAKlB;;AAZkC;AAAA;AAAA,gDAcTD,KAdS,EAcF;AAC/B,aAAKE,QAAL,CAAc;AAAED,UAAAA,KAAK,EAAED,KAAK,CAACC;AAAf,SAAd;AACD;AAhBkC;AAAA;AAAA,+BAwB1B;AACP,eAAO,gCAAC,SAAD;AAAW,UAAA,KAAK,EAAE,KAAKG,KAAL,CAAWH,KAA7B;AAAoC,UAAA,QAAQ,EAAE,KAAKE;AAAnD,UAAP;AACD;AA1BkC;;AAAA;AAAA,IACdE,kBAAMP,SADQ;;AAAA,kBAC/BC,QAD+B,eAEhB;AACjBE,IAAAA,KAAK,EAAEK,sBAAUC,MAAV,CAAiBC,UADP;AAEjBL,IAAAA,QAAQ,EAAEG,sBAAUG,IAAV,CAAeD;AAFR,GAFgB;;AA6BrC,SAAOT,QAAP;AACD,CA9BD;;eAgCeF,iB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst withStatefulModel = Component => {\n class Stateful extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n model: props.model\n };\n }\n\n componentWillReceiveProps(props) {\n this.setState({ model: props.model });\n }\n\n onChange = model => {\n this.setState({ model }, () => {\n this.props.onChange(this.state.model);\n });\n };\n\n render() {\n return <Component model={this.state.model} onChange={this.onChange} />;\n }\n }\n\n return Stateful;\n};\n\nexport default withStatefulModel;\n"],"file":"with-stateful-model.js"}
1
+ {"version":3,"sources":["../src/with-stateful-model.jsx"],"names":["withStatefulModel","Component","Stateful","props","model","setState","onChange","state","React","PropTypes","object","isRequired","func"],"mappings":";;;;;;;;;AAAA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAAAC,SAAS,EAAI;AAAA,MAC/BC,QAD+B;AAAA;;AAAA;;AAOnC,sBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,gCAAMA,KAAN;;AADiB,iEAWR,UAAAC,KAAK,EAAI;AAClB,cAAKC,QAAL,CAAc;AAAED,UAAAA,KAAK,EAALA;AAAF,SAAd,EAAyB,YAAM;AAC7B,gBAAKD,KAAL,CAAWG,QAAX,CAAoB,MAAKC,KAAL,CAAWH,KAA/B;AACD,SAFD;AAGD,OAfkB;;AAEjB,YAAKG,KAAL,GAAa;AACXH,QAAAA,KAAK,EAAED,KAAK,CAACC;AADF,OAAb;AAFiB;AAKlB;;AAZkC;AAAA;AAAA,aAcnC,mCAA0BD,KAA1B,EAAiC;AAC/B,aAAKE,QAAL,CAAc;AAAED,UAAAA,KAAK,EAAED,KAAK,CAACC;AAAf,SAAd;AACD;AAhBkC;AAAA;AAAA,aAwBnC,kBAAS;AACP,4BAAO,gCAAC,SAAD;AAAW,UAAA,KAAK,EAAE,KAAKG,KAAL,CAAWH,KAA7B;AAAoC,UAAA,QAAQ,EAAE,KAAKE;AAAnD,UAAP;AACD;AA1BkC;;AAAA;AAAA,IACdE,kBAAMP,SADQ;;AAAA,kBAC/BC,QAD+B,eAEhB;AACjBE,IAAAA,KAAK,EAAEK,sBAAUC,MAAV,CAAiBC,UADP;AAEjBL,IAAAA,QAAQ,EAAEG,sBAAUG,IAAV,CAAeD;AAFR,GAFgB;;AA6BrC,SAAOT,QAAP;AACD,CA9BD;;eAgCeF,iB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst withStatefulModel = Component => {\n class Stateful extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired\n };\n\n constructor(props) {\n super(props);\n this.state = {\n model: props.model\n };\n }\n\n componentWillReceiveProps(props) {\n this.setState({ model: props.model });\n }\n\n onChange = model => {\n this.setState({ model }, () => {\n this.props.onChange(this.state.model);\n });\n };\n\n render() {\n return <Component model={this.state.model} onChange={this.onChange} />;\n }\n }\n\n return Stateful;\n};\n\nexport default withStatefulModel;\n"],"file":"with-stateful-model.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/config-ui",
3
- "version": "10.10.18",
3
+ "version": "10.10.21",
4
4
  "main": "lib/index.js",
5
5
  "module": "src/index.js",
6
6
  "publishConfig": {
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@material-ui/core": "^3.8.3",
12
12
  "@material-ui/icons": "^3.0.2",
13
- "@pie-lib/editable-html": "^7.17.18",
13
+ "@pie-lib/editable-html": "^7.19.0",
14
14
  "@pie-lib/icons": "^2.4.25",
15
15
  "@pie-lib/render-ui": "^4.12.4",
16
16
  "classnames": "^2.2.6",
@@ -26,5 +26,5 @@
26
26
  "peerDependencies": {
27
27
  "react": "^16.8.1"
28
28
  },
29
- "gitHead": "8c254f4c516c9f4e67109accdb2ad415e1f6cea4"
29
+ "gitHead": "94d3f4ebeac61ccfff87705594a1e80f664d4975"
30
30
  }
@@ -25,6 +25,7 @@ const EditableHtmlContainer = withStyles(theme => ({
25
25
  className,
26
26
  imageSupport,
27
27
  disabled,
28
+ spellCheck,
28
29
  nonEmpty,
29
30
  toolbarOpts
30
31
  }) => {
@@ -36,6 +37,7 @@ const EditableHtmlContainer = withStyles(theme => ({
36
37
  <EditableHtml
37
38
  markup={value || ''}
38
39
  disabled={disabled}
40
+ spellCheck = {spellCheck}
39
41
  nonEmpty={nonEmpty}
40
42
  onChange={onChange}
41
43
  imageSupport={imageSupport}
@@ -183,6 +185,7 @@ export class ChoiceConfiguration extends React.Component {
183
185
  useLetterOrdering,
184
186
  imageSupport,
185
187
  disabled,
188
+ spellCheck,
186
189
  nonEmpty,
187
190
  allowFeedBack,
188
191
  allowDelete,
@@ -212,6 +215,7 @@ export class ChoiceConfiguration extends React.Component {
212
215
  onChange={this.onLabelChange}
213
216
  imageSupport={imageSupport}
214
217
  disabled={disabled}
218
+ spellCheck = {spellCheck}
215
219
  nonEmpty={nonEmpty}
216
220
  toolbarOpts={toolbarOpts}
217
221
  />