@pie-lib/mask-markup 1.12.21-next.0 → 1.12.21-next.34

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.
@@ -29,6 +29,8 @@ var _findKey = _interopRequireDefault(require("lodash/findKey"));
29
29
 
30
30
  var _choice = _interopRequireDefault(require("./choice"));
31
31
 
32
+ var _droppablePlaceholder = _interopRequireDefault(require("@pie-lib/drag/lib/droppable-placeholder"));
33
+
32
34
  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
35
 
34
36
  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; } }
@@ -97,13 +99,15 @@ var Choices = /*#__PURE__*/function (_React$Component) {
97
99
  var elementStyle = this.getStyleForWrapper();
98
100
  return /*#__PURE__*/_react["default"].createElement("div", {
99
101
  style: elementStyle
102
+ }, /*#__PURE__*/_react["default"].createElement(_droppablePlaceholder["default"], {
103
+ disabled: disabled
100
104
  }, filteredChoices.map(function (c, index) {
101
105
  return /*#__PURE__*/_react["default"].createElement(_choice["default"], {
102
106
  key: "".concat(c.value, "-").concat(index),
103
107
  disabled: disabled,
104
108
  choice: c
105
109
  });
106
- }));
110
+ })));
107
111
  }
108
112
  }]);
109
113
  return Choices;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/choices/index.jsx"],"names":["Choices","choicePosition","props","margin","disabled","duplicates","choices","value","filteredChoices","filter","c","foundChoice","v","id","undefined","elementStyle","getStyleForWrapper","map","index","React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AoC,UAAA,QAAQ,EAAEd,QAA9C;AAAwD,UAAA,MAAM,EAAEM;AAAhE,UADmB;AAAA,OAApB,CADH,CADF;AAOD;;;EAlDkCS,kBAAMC,S;;;iCAAtBpB,O,eACA;AACjBI,EAAAA,QAAQ,EAAEiB,sBAAUC,IADH;AAEjBjB,EAAAA,UAAU,EAAEgB,sBAAUC,IAFL;AAGjBhB,EAAAA,OAAO,EAAEe,sBAAUE,OAAV,CAAkBF,sBAAUG,KAAV,CAAgB;AAAEC,IAAAA,KAAK,EAAEJ,sBAAUK,MAAnB;AAA2BnB,IAAAA,KAAK,EAAEc,sBAAUK;AAA5C,GAAhB,CAAlB,CAHQ;AAIjBnB,EAAAA,KAAK,EAAEc,sBAAUM,MAJA;AAKjB1B,EAAAA,cAAc,EAAEoB,sBAAUK,MAAV,CAAiBE;AALhB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport findKey from 'lodash/findKey';\nimport Choice from './choice';\n\nexport default class Choices extends React.Component {\n static propTypes = {\n disabled: PropTypes.bool,\n duplicates: PropTypes.bool,\n choices: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string, value: PropTypes.string })),\n value: PropTypes.object,\n choicePosition: PropTypes.string.isRequired,\n };\n\n getStyleForWrapper = () => {\n const { choicePosition } = this.props;\n\n switch (choicePosition) {\n case 'above':\n return {\n margin: '0 0 40px 0',\n };\n case 'below':\n return {\n margin: '40px 0 0 0',\n };\n case 'right':\n return {\n margin: '0 0 0 40px',\n };\n default:\n return {\n margin: '0 40px 0 0',\n };\n }\n };\n\n render() {\n const { disabled, duplicates, choices, value } = this.props;\n const filteredChoices = choices.filter((c) => {\n if (duplicates === true) {\n return true;\n }\n const foundChoice = findKey(value, (v) => v === c.id);\n return foundChoice === undefined;\n });\n const elementStyle = this.getStyleForWrapper();\n\n return (\n <div style={elementStyle}>\n {filteredChoices.map((c, index) => (\n <Choice key={`${c.value}-${index}`} disabled={disabled} choice={c} />\n ))}\n </div>\n );\n }\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/choices/index.jsx"],"names":["Choices","choicePosition","props","margin","disabled","duplicates","choices","value","filteredChoices","filter","c","foundChoice","v","id","undefined","elementStyle","getStyleForWrapper","map","index","React","Component","PropTypes","bool","arrayOf","shape","label","string","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEqBA,O;;;;;;;;;;;;;;;2GASE,YAAM;AACzB,UAAQC,cAAR,GAA2B,MAAKC,KAAhC,CAAQD,cAAR;;AAEA,cAAQA,cAAR;AACE,aAAK,OAAL;AACE,iBAAO;AACLE,YAAAA,MAAM,EAAE;AADH,WAAP;;AAGF,aAAK,OAAL;AACE,iBAAO;AACLA,YAAAA,MAAM,EAAE;AADH,WAAP;;AAGF,aAAK,OAAL;AACE,iBAAO;AACLA,YAAAA,MAAM,EAAE;AADH,WAAP;;AAGF;AACE,iBAAO;AACLA,YAAAA,MAAM,EAAE;AADH,WAAP;AAdJ;AAkBD,K;;;;;;WAED,kBAAS;AACP,wBAAiD,KAAKD,KAAtD;AAAA,UAAQE,QAAR,eAAQA,QAAR;AAAA,UAAkBC,UAAlB,eAAkBA,UAAlB;AAAA,UAA8BC,OAA9B,eAA8BA,OAA9B;AAAA,UAAuCC,KAAvC,eAAuCA,KAAvC;AACA,UAAMC,eAAe,GAAGF,OAAO,CAACG,MAAR,CAAe,UAACC,CAAD,EAAO;AAC5C,YAAIL,UAAU,KAAK,IAAnB,EAAyB;AACvB,iBAAO,IAAP;AACD;;AACD,YAAMM,WAAW,GAAG,yBAAQJ,KAAR,EAAe,UAACK,CAAD;AAAA,iBAAOA,CAAC,KAAKF,CAAC,CAACG,EAAf;AAAA,SAAf,CAApB;AACA,eAAOF,WAAW,KAAKG,SAAvB;AACD,OANuB,CAAxB;AAOA,UAAMC,YAAY,GAAG,KAAKC,kBAAL,EAArB;AAEA,0BACE;AAAK,QAAA,KAAK,EAAED;AAAZ,sBACE,gCAAC,gCAAD;AAAsB,QAAA,QAAQ,EAAEX;AAAhC,SACGI,eAAe,CAACS,GAAhB,CAAoB,UAACP,CAAD,EAAIQ,KAAJ;AAAA,4BACnB,gCAAC,kBAAD;AAAQ,UAAA,GAAG,YAAKR,CAAC,CAACH,KAAP,cAAgBW,KAAhB,CAAX;AAAoC,UAAA,QAAQ,EAAEd,QAA9C;AAAwD,UAAA,MAAM,EAAEM;AAAhE,UADmB;AAAA,OAApB,CADH,CADF,CADF;AASD;;;EApDkCS,kBAAMC,S;;;iCAAtBpB,O,eACA;AACjBI,EAAAA,QAAQ,EAAEiB,sBAAUC,IADH;AAEjBjB,EAAAA,UAAU,EAAEgB,sBAAUC,IAFL;AAGjBhB,EAAAA,OAAO,EAAEe,sBAAUE,OAAV,CAAkBF,sBAAUG,KAAV,CAAgB;AAAEC,IAAAA,KAAK,EAAEJ,sBAAUK,MAAnB;AAA2BnB,IAAAA,KAAK,EAAEc,sBAAUK;AAA5C,GAAhB,CAAlB,CAHQ;AAIjBnB,EAAAA,KAAK,EAAEc,sBAAUM,MAJA;AAKjB1B,EAAAA,cAAc,EAAEoB,sBAAUK,MAAV,CAAiBE;AALhB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport findKey from 'lodash/findKey';\nimport Choice from './choice';\nimport DroppablePlaceholder from '@pie-lib/drag/lib/droppable-placeholder';\n\nexport default class Choices extends React.Component {\n static propTypes = {\n disabled: PropTypes.bool,\n duplicates: PropTypes.bool,\n choices: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string, value: PropTypes.string })),\n value: PropTypes.object,\n choicePosition: PropTypes.string.isRequired,\n };\n\n getStyleForWrapper = () => {\n const { choicePosition } = this.props;\n\n switch (choicePosition) {\n case 'above':\n return {\n margin: '0 0 40px 0',\n };\n case 'below':\n return {\n margin: '40px 0 0 0',\n };\n case 'right':\n return {\n margin: '0 0 0 40px',\n };\n default:\n return {\n margin: '0 40px 0 0',\n };\n }\n };\n\n render() {\n const { disabled, duplicates, choices, value } = this.props;\n const filteredChoices = choices.filter((c) => {\n if (duplicates === true) {\n return true;\n }\n const foundChoice = findKey(value, (v) => v === c.id);\n return foundChoice === undefined;\n });\n const elementStyle = this.getStyleForWrapper();\n\n return (\n <div style={elementStyle}>\n <DroppablePlaceholder disabled={disabled}>\n {filteredChoices.map((c, index) => (\n <Choice key={`${c.value}-${index}`} disabled={disabled} choice={c} />\n ))}\n </DroppablePlaceholder>\n </div>\n );\n }\n}\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/mask-markup",
3
- "version": "1.12.21-next.0+7f572075",
3
+ "version": "1.12.21-next.34+b73b6af7",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@material-ui/core": "^3.9.3",
12
- "@pie-lib/drag": "^2.0.5-next.0+7f572075",
12
+ "@pie-lib/drag": "^2.0.5-next.34+b73b6af7",
13
13
  "@pie-lib/math-rendering": "^2.5.1",
14
14
  "@pie-lib/render-ui": "^4.13.7",
15
15
  "classnames": "^2.2.6",
@@ -27,5 +27,5 @@
27
27
  "keywords": [],
28
28
  "author": "",
29
29
  "license": "ISC",
30
- "gitHead": "7f5720751281e2019ec8ff9c513703d81bcb1aef"
30
+ "gitHead": "b73b6af7a33de7283cfbbe62c6da66c462ba475f"
31
31
  }
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import findKey from 'lodash/findKey';
4
4
  import Choice from './choice';
5
+ import DroppablePlaceholder from '@pie-lib/drag/lib/droppable-placeholder';
5
6
 
6
7
  export default class Choices extends React.Component {
7
8
  static propTypes = {
@@ -48,9 +49,11 @@ export default class Choices extends React.Component {
48
49
 
49
50
  return (
50
51
  <div style={elementStyle}>
51
- {filteredChoices.map((c, index) => (
52
- <Choice key={`${c.value}-${index}`} disabled={disabled} choice={c} />
53
- ))}
52
+ <DroppablePlaceholder disabled={disabled}>
53
+ {filteredChoices.map((c, index) => (
54
+ <Choice key={`${c.value}-${index}`} disabled={disabled} choice={c} />
55
+ ))}
56
+ </DroppablePlaceholder>
54
57
  </div>
55
58
  );
56
59
  }