@pie-lib/mask-markup 1.10.20-next.35 → 1.10.21-next.179
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/CHANGELOG.json +45 -0
- package/CHANGELOG.md +19 -100
- package/lib/choices/choice.js +25 -17
- package/lib/choices/choice.js.map +1 -1
- package/lib/choices/index.js +17 -15
- package/lib/choices/index.js.map +1 -1
- package/lib/components/blank.js +32 -22
- package/lib/components/blank.js.map +1 -1
- package/lib/components/correct-input.js +27 -4
- package/lib/components/correct-input.js.map +1 -1
- package/lib/components/dropdown.js +27 -17
- package/lib/components/dropdown.js.map +1 -1
- package/lib/components/input.js +8 -2
- package/lib/components/input.js.map +1 -1
- package/lib/constructed-response.js +10 -4
- package/lib/constructed-response.js.map +1 -1
- package/lib/drag-in-the-blank.js +19 -17
- package/lib/drag-in-the-blank.js.map +1 -1
- package/lib/index.js +12 -12
- package/lib/inline-dropdown.js +1 -1
- package/lib/inline-dropdown.js.map +1 -1
- package/lib/mask.js +47 -26
- package/lib/mask.js.map +1 -1
- package/lib/serialization.js +13 -4
- package/lib/serialization.js.map +1 -1
- package/lib/with-mask.js +19 -15
- package/lib/with-mask.js.map +1 -1
- package/package.json +4 -4
- package/src/choices/choice.jsx +5 -1
- package/src/components/blank.jsx +5 -1
- package/src/components/correct-input.jsx +29 -2
- package/src/components/dropdown.jsx +11 -1
- package/src/components/input.jsx +15 -1
- package/src/constructed-response.jsx +5 -1
- package/src/mask.jsx +14 -1
- package/src/serialization.js +8 -1
package/CHANGELOG.json
CHANGED
|
@@ -838,5 +838,50 @@
|
|
|
838
838
|
"committerDate": "2021-07-02 16:41:08 +0300",
|
|
839
839
|
"isTagged": true,
|
|
840
840
|
"tag": "@pie-lib/mask-markup@1.10.18"
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"type": "feat",
|
|
844
|
+
"scope": "mask-markup",
|
|
845
|
+
"subject": "Made sure that the changes do not affect other components",
|
|
846
|
+
"merge": null,
|
|
847
|
+
"header": "feat(mask-markup): Made sure that the changes do not affect other components",
|
|
848
|
+
"body": null,
|
|
849
|
+
"footer": null,
|
|
850
|
+
"notes": [],
|
|
851
|
+
"hash": "e3c5f8ce419aa9e99d9c5b01367d9ab2ce54dce7",
|
|
852
|
+
"gitTags": " (origin/feat/PD-794)",
|
|
853
|
+
"committerDate": "2021-10-18 12:30:08 +0300",
|
|
854
|
+
"isTagged": true,
|
|
855
|
+
"tag": "@pie-lib/mask-markup@1.11.0"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"type": "feat",
|
|
859
|
+
"scope": "mask-markup",
|
|
860
|
+
"subject": "Added a max limit of characters, adjusted the width and updated design PD-794",
|
|
861
|
+
"merge": null,
|
|
862
|
+
"header": "feat(mask-markup): Added a max limit of characters, adjusted the width and updated design PD-794",
|
|
863
|
+
"body": null,
|
|
864
|
+
"footer": null,
|
|
865
|
+
"notes": [],
|
|
866
|
+
"hash": "f46d544caaf03fc638993670d05ed284e284d93e",
|
|
867
|
+
"gitTags": "",
|
|
868
|
+
"committerDate": "2021-10-05 15:36:43 +0300",
|
|
869
|
+
"isTagged": true,
|
|
870
|
+
"tag": "@pie-lib/mask-markup@1.11.0"
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"type": "fix",
|
|
874
|
+
"scope": "mask-markup",
|
|
875
|
+
"subject": "Fixed border radius in pits",
|
|
876
|
+
"merge": null,
|
|
877
|
+
"header": "fix(mask-markup): Fixed border radius in pits",
|
|
878
|
+
"body": null,
|
|
879
|
+
"footer": null,
|
|
880
|
+
"notes": [],
|
|
881
|
+
"hash": "41c0acd332cbe8bceb3ed9059fee1d52ea73ebec",
|
|
882
|
+
"gitTags": "",
|
|
883
|
+
"committerDate": "2021-10-18 14:06:30 +0300",
|
|
884
|
+
"isTagged": true,
|
|
885
|
+
"tag": "@pie-lib/mask-markup@1.11.1"
|
|
841
886
|
}
|
|
842
887
|
]
|
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [1.10.
|
|
6
|
+
## [1.10.20](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.19...@pie-lib/mask-markup@1.10.20) (2021-08-30)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
9
9
|
|
|
@@ -11,197 +11,116 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
## [1.10.
|
|
14
|
+
## [1.10.19](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.18...@pie-lib/mask-markup@1.10.19) (2021-08-04)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
15
17
|
|
|
16
18
|
|
|
17
|
-
### Bug Fixes
|
|
18
19
|
|
|
19
|
-
* **mask-markup:** Updated serialization PD-859 ([4948f99](https://github.com/pie-framework/pie-lib/commit/4948f99))
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
## [1.10.18](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.17...@pie-lib/mask-markup@1.10.18) (2021-07-23)
|
|
22
23
|
|
|
24
|
+
### Bug Fixes
|
|
23
25
|
|
|
26
|
+
- **mask-markup:** Updated serialization PD-859 ([4948f99](https://github.com/pie-framework/pie-lib/commit/4948f99))
|
|
24
27
|
|
|
25
28
|
## [1.10.17](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.15...@pie-lib/mask-markup@1.10.17) (2021-06-25)
|
|
26
29
|
|
|
27
30
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
32
|
## [1.10.15](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.14...@pie-lib/mask-markup@1.10.15) (2021-06-25)
|
|
34
33
|
|
|
35
|
-
|
|
36
34
|
### Bug Fixes
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
- **mask-markup:** Fixed DITB image-based tokens to be draggable - PD-1120 ([4cf2f4a](https://github.com/pie-framework/pie-lib/commit/4cf2f4a))
|
|
37
|
+
- **mask-markup:** Fixed labels overlapping ([3f7cff2](https://github.com/pie-framework/pie-lib/commit/3f7cff2))
|
|
38
|
+
- **mask-markup:** set max fontSize for dropdown items to fix PD-1142 ([704c291](https://github.com/pie-framework/pie-lib/commit/704c291))
|
|
45
39
|
|
|
46
40
|
## [1.10.14](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.13...@pie-lib/mask-markup@1.10.14) (2021-04-06)
|
|
47
41
|
|
|
48
|
-
|
|
49
42
|
### Bug Fixes
|
|
50
43
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
- **mask-markup:** Changed choice preview design PD-605 ([d4b882e](https://github.com/pie-framework/pie-lib/commit/d4b882e))
|
|
56
45
|
|
|
57
46
|
## [1.10.13](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.12...@pie-lib/mask-markup@1.10.13) (2021-04-02)
|
|
58
47
|
|
|
59
|
-
|
|
60
48
|
### Bug Fixes
|
|
61
49
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
- **mask-markup:** fix dragging issue by overwriting material ui chip height PD-1034 ([f26db36](https://github.com/pie-framework/pie-lib/commit/f26db36))
|
|
67
51
|
|
|
68
52
|
## [1.10.12](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.11...@pie-lib/mask-markup@1.10.12) (2021-03-16)
|
|
69
53
|
|
|
70
|
-
|
|
71
54
|
### Bug Fixes
|
|
72
55
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
56
|
+
- **drag-in-the-blank:** add margin for tokens PD-745 ([2df356f](https://github.com/pie-framework/pie-lib/commit/2df356f))
|
|
57
|
+
- **drag-in-the-blank:** set max width for tokens PD-727 ([b43b630](https://github.com/pie-framework/pie-lib/commit/b43b630))
|
|
79
58
|
|
|
80
59
|
## [1.10.11](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.10...@pie-lib/mask-markup@1.10.11) (2021-03-15)
|
|
81
60
|
|
|
82
|
-
|
|
83
61
|
### Bug Fixes
|
|
84
62
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
63
|
+
- **mask-markup:** increase height for drag-in-the-blank chip PD-726 ([9cb037e](https://github.com/pie-framework/pie-lib/commit/9cb037e))
|
|
90
64
|
|
|
91
65
|
## [1.10.10](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.9...@pie-lib/mask-markup@1.10.10) (2021-03-01)
|
|
92
66
|
|
|
93
67
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
94
68
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
69
|
## [1.10.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.8...@pie-lib/mask-markup@1.10.9) (2021-03-01)
|
|
100
70
|
|
|
101
71
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
102
72
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
73
|
## [1.10.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.7...@pie-lib/mask-markup@1.10.8) (2021-02-15)
|
|
108
74
|
|
|
109
|
-
|
|
110
75
|
### Bug Fixes
|
|
111
76
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
77
|
+
- **inline-dropdown:** remove newline regex - PD-887 ([e9e14c8](https://github.com/pie-framework/pie-lib/commit/e9e14c8))
|
|
117
78
|
|
|
118
79
|
## [1.10.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.5...@pie-lib/mask-markup@1.10.7) (2021-02-15)
|
|
119
80
|
|
|
120
81
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
121
82
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
83
|
## [1.10.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.4...@pie-lib/mask-markup@1.10.5) (2021-02-15)
|
|
127
84
|
|
|
128
85
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
129
86
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
87
|
## [1.10.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.3...@pie-lib/mask-markup@1.10.4) (2021-02-01)
|
|
135
88
|
|
|
136
89
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
137
90
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
91
|
## [1.10.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.2...@pie-lib/mask-markup@1.10.3) (2021-01-28)
|
|
143
92
|
|
|
144
93
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
145
94
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
95
|
## [1.10.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.1...@pie-lib/mask-markup@1.10.2) (2021-01-28)
|
|
151
96
|
|
|
152
97
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
153
98
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
99
|
## [1.10.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.10.0...@pie-lib/mask-markup@1.10.1) (2021-01-25)
|
|
159
100
|
|
|
160
101
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
161
102
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
103
|
# [1.10.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.9.5...@pie-lib/mask-markup@1.10.0) (2021-01-11)
|
|
167
104
|
|
|
168
|
-
|
|
169
105
|
### Features
|
|
170
106
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
107
|
+
- **mask-markup:** inline-dropdown color treatment fixed ([60072de](https://github.com/pie-framework/pie-lib/commit/60072de))
|
|
176
108
|
|
|
177
109
|
## [1.9.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.9.4...@pie-lib/mask-markup@1.9.5) (2020-10-29)
|
|
178
110
|
|
|
179
111
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
180
112
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
113
|
## [1.9.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.9.3...@pie-lib/mask-markup@1.9.4) (2020-10-28)
|
|
186
114
|
|
|
187
|
-
|
|
188
115
|
### Bug Fixes
|
|
189
116
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
117
|
+
- dropdown colors ([143853d](https://github.com/pie-framework/pie-lib/commit/143853d))
|
|
118
|
+
- upgrade react-dnd ([f507025](https://github.com/pie-framework/pie-lib/commit/f507025))
|
|
196
119
|
|
|
197
120
|
## [1.9.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.9.2...@pie-lib/mask-markup@1.9.3) (2020-10-26)
|
|
198
121
|
|
|
199
122
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
|
200
123
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
124
|
## [1.9.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/mask-markup@1.9.1...@pie-lib/mask-markup@1.9.2) (2020-10-26)
|
|
206
125
|
|
|
207
126
|
**Note:** Version bump only for package @pie-lib/mask-markup
|
package/lib/choices/choice.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
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
|
});
|
|
6
|
-
exports["default"] = exports.
|
|
8
|
+
exports["default"] = exports.DRAG_TYPE = exports.BlankContent = void 0;
|
|
7
9
|
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
|
|
@@ -23,38 +25,40 @@ var _mathRendering = require("@pie-lib/math-rendering");
|
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
27
|
|
|
26
|
-
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); }
|
|
27
|
-
|
|
28
28
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
29
|
|
|
30
30
|
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); } }
|
|
31
31
|
|
|
32
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
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); }
|
|
35
35
|
|
|
36
|
-
function
|
|
36
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
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); }; }
|
|
39
39
|
|
|
40
|
-
function
|
|
40
|
+
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); }
|
|
41
41
|
|
|
42
|
-
function
|
|
42
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
+
|
|
44
|
+
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; } }
|
|
45
|
+
|
|
46
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
47
|
|
|
44
48
|
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; }
|
|
45
49
|
|
|
46
50
|
var DRAG_TYPE = 'MaskBlank';
|
|
47
51
|
exports.DRAG_TYPE = DRAG_TYPE;
|
|
48
52
|
|
|
49
|
-
var BlankContentComp =
|
|
50
|
-
/*#__PURE__*/
|
|
51
|
-
function (_React$Component) {
|
|
53
|
+
var BlankContentComp = /*#__PURE__*/function (_React$Component) {
|
|
52
54
|
_inherits(BlankContentComp, _React$Component);
|
|
53
55
|
|
|
56
|
+
var _super = _createSuper(BlankContentComp);
|
|
57
|
+
|
|
54
58
|
function BlankContentComp() {
|
|
55
59
|
_classCallCheck(this, BlankContentComp);
|
|
56
60
|
|
|
57
|
-
return
|
|
61
|
+
return _super.apply(this, arguments);
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
_createClass(BlankContentComp, [{
|
|
@@ -72,15 +76,15 @@ function (_React$Component) {
|
|
|
72
76
|
choice = _this$props.choice,
|
|
73
77
|
classes = _this$props.classes,
|
|
74
78
|
disabled = _this$props.disabled;
|
|
75
|
-
return connectDragSource(_react["default"].createElement("span", {
|
|
79
|
+
return connectDragSource( /*#__PURE__*/_react["default"].createElement("span", {
|
|
76
80
|
className: (0, _classnames["default"])(classes.choice, disabled && classes.disabled)
|
|
77
|
-
}, _react["default"].createElement(_Chip["default"], {
|
|
81
|
+
}, /*#__PURE__*/_react["default"].createElement(_Chip["default"], {
|
|
78
82
|
ref: function ref(_ref2) {
|
|
79
83
|
//eslint-disable-next-line
|
|
80
84
|
_this.rootRef = _reactDom["default"].findDOMNode(_ref2);
|
|
81
85
|
},
|
|
82
86
|
className: classes.chip,
|
|
83
|
-
label: _react["default"].createElement("span", {
|
|
87
|
+
label: /*#__PURE__*/_react["default"].createElement("span", {
|
|
84
88
|
className: classes.chipLabel,
|
|
85
89
|
ref: function ref(_ref) {
|
|
86
90
|
if (_ref) {
|
|
@@ -119,7 +123,11 @@ var BlankContent = (0, _styles.withStyles)(function (theme) {
|
|
|
119
123
|
margin: '4px'
|
|
120
124
|
},
|
|
121
125
|
chipLabel: {
|
|
122
|
-
whiteSpace: 'pre-wrap'
|
|
126
|
+
whiteSpace: 'pre-wrap',
|
|
127
|
+
'& img': {
|
|
128
|
+
display: 'block',
|
|
129
|
+
padding: '2px 0'
|
|
130
|
+
}
|
|
123
131
|
},
|
|
124
132
|
disabled: {}
|
|
125
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/choices/choice.jsx"],"names":["DRAG_TYPE","BlankContentComp","rootRef","props","connectDragSource","choice","classes","disabled","ref","ReactDOM","findDOMNode","chip","chipLabel","innerHTML","value","undefined","React","Component","PropTypes","bool","object","func","BlankContent","theme","border","palette","primary","main","alignItems","display","height","minHeight","fontSize","whiteSpace","maxWidth","margin","tileSource","canDrag","beginDrag","instanceId","DragDropTile","connect","monitor","dragSource","isDragging"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/choices/choice.jsx"],"names":["DRAG_TYPE","BlankContentComp","rootRef","props","connectDragSource","choice","classes","disabled","ref","ReactDOM","findDOMNode","chip","chipLabel","innerHTML","value","undefined","React","Component","PropTypes","bool","object","func","BlankContent","theme","border","palette","primary","main","alignItems","display","height","minHeight","fontSize","whiteSpace","maxWidth","margin","padding","tileSource","canDrag","beginDrag","instanceId","DragDropTile","connect","monitor","dragSource","isDragging"],"mappings":"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","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { DragSource } from '@pie-lib/drag';\nimport { withStyles } from '@material-ui/core/styles';\nimport Chip from '@material-ui/core/Chip';\nimport classnames from 'classnames';\nimport ReactDOM from 'react-dom';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nexport const DRAG_TYPE = 'MaskBlank';\n\nclass BlankContentComp extends React.Component {\n static propTypes = {\n disabled: PropTypes.bool,\n choice: PropTypes.object,\n classes: PropTypes.object,\n connectDragSource: PropTypes.func\n };\n\n componentDidUpdate() {\n renderMath(this.rootRef);\n }\n\n render() {\n const { connectDragSource, choice, classes, disabled } = this.props;\n\n return connectDragSource(\n <span className={classnames(classes.choice, disabled && classes.disabled)}>\n <Chip\n ref={ref => {\n //eslint-disable-next-line\n this.rootRef = ReactDOM.findDOMNode(ref);\n }}\n className={classes.chip}\n label={\n <span\n className={classes.chipLabel}\n ref={ref => {\n if (ref) {\n ref.innerHTML = choice.value || ' ';\n }\n }}\n >\n {' '}\n </span>\n }\n variant={disabled ? 'outlined' : undefined}\n />\n </span>,\n {}\n );\n }\n}\n\nexport const BlankContent = withStyles(theme => ({\n choice: {\n border: `solid 0px ${theme.palette.primary.main}`\n },\n chip: {\n alignItems: 'center',\n display: 'inline-flex',\n height: 'initial',\n minHeight: '32px',\n fontSize: 'inherit',\n whiteSpace: 'pre-wrap',\n maxWidth: '374px',\n margin: '4px'\n },\n chipLabel: {\n whiteSpace: 'pre-wrap',\n '& img': {\n display: 'block',\n padding: '2px 0'\n }\n },\n disabled: {}\n}))(BlankContentComp);\n\nconst tileSource = {\n canDrag(props) {\n return !props.disabled;\n },\n beginDrag(props) {\n return {\n choice: props.choice,\n instanceId: props.instanceId\n };\n }\n};\n\nconst DragDropTile = DragSource(DRAG_TYPE, tileSource, (connect, monitor) => ({\n connectDragSource: connect.dragSource(),\n isDragging: monitor.isDragging()\n}))(BlankContent);\n\nexport default DragDropTile;\n"],"file":"choice.js"}
|
package/lib/choices/index.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
|
});
|
|
@@ -15,34 +17,34 @@ var _choice = _interopRequireDefault(require("./choice"));
|
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
19
|
|
|
18
|
-
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); }
|
|
19
|
-
|
|
20
20
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
21
|
|
|
22
22
|
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); } }
|
|
23
23
|
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
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); }
|
|
27
27
|
|
|
28
|
-
function
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
|
|
30
|
+
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); }; }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
29
33
|
|
|
30
34
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
35
|
|
|
32
|
-
function
|
|
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; } }
|
|
33
37
|
|
|
34
|
-
function
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
39
|
|
|
36
40
|
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; }
|
|
37
41
|
|
|
38
|
-
var Choices =
|
|
39
|
-
/*#__PURE__*/
|
|
40
|
-
function (_React$Component) {
|
|
42
|
+
var Choices = /*#__PURE__*/function (_React$Component) {
|
|
41
43
|
_inherits(Choices, _React$Component);
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
var _getPrototypeOf2;
|
|
45
|
+
var _super = _createSuper(Choices);
|
|
45
46
|
|
|
47
|
+
function Choices() {
|
|
46
48
|
var _this;
|
|
47
49
|
|
|
48
50
|
_classCallCheck(this, Choices);
|
|
@@ -51,7 +53,7 @@ function (_React$Component) {
|
|
|
51
53
|
args[_key] = arguments[_key];
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
_this =
|
|
56
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
55
57
|
|
|
56
58
|
_defineProperty(_assertThisInitialized(_this), "getStyleForWrapper", function () {
|
|
57
59
|
var choicePosition = _this.props.choicePosition;
|
|
@@ -101,10 +103,10 @@ function (_React$Component) {
|
|
|
101
103
|
return foundChoice === undefined;
|
|
102
104
|
});
|
|
103
105
|
var elementStyle = this.getStyleForWrapper();
|
|
104
|
-
return _react["default"].createElement("div", {
|
|
106
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
105
107
|
style: elementStyle
|
|
106
108
|
}, filteredChoices.map(function (c, index) {
|
|
107
|
-
return _react["default"].createElement(_choice["default"], {
|
|
109
|
+
return /*#__PURE__*/_react["default"].createElement(_choice["default"], {
|
|
108
110
|
key: "".concat(c.value, "-").concat(index),
|
|
109
111
|
disabled: disabled,
|
|
110
112
|
choice: c
|
package/lib/choices/index.js.map
CHANGED
|
@@ -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","Component","PropTypes","bool","arrayOf","shape","label","string","object","isRequired"],"mappings":"
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;IAEqBA,O;;;;;;;;;;;;;;;;yEAWE,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,UAAAC,CAAC,EAAI;AAC1C,YAAIL,UAAU,KAAK,IAAnB,EAAyB;AACvB,iBAAO,IAAP;AACD;;AACD,YAAMM,WAAW,GAAG,yBAAQJ,KAAR,EAAe,UAAAK,CAAC;AAAA,iBAAIA,CAAC,KAAKF,CAAC,CAACG,EAAZ;AAAA,SAAhB,CAApB;AACA,eAAOF,WAAW,KAAKG,SAAvB;AACD,OANuB,CAAxB;AAOA,UAAMC,YAAY,GAAG,KAAKC,kBAAL,EAArB;AAEA,0BACE;AAAK,QAAA,KAAK,EAAED;AAAZ,SACGP,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;AAOD;;;;EApDkCS,kBAAMC,S;;;;gBAAtBpB,O,eACA;AACjBI,EAAAA,QAAQ,EAAEiB,sBAAUC,IADH;AAEjBjB,EAAAA,UAAU,EAAEgB,sBAAUC,IAFL;AAGjBhB,EAAAA,OAAO,EAAEe,sBAAUE,OAAV,CACPF,sBAAUG,KAAV,CAAgB;AAAEC,IAAAA,KAAK,EAAEJ,sBAAUK,MAAnB;AAA2BnB,IAAAA,KAAK,EAAEc,sBAAUK;AAA5C,GAAhB,CADO,CAHQ;AAMjBnB,EAAAA,KAAK,EAAEc,sBAAUM,MANA;AAOjB1B,EAAAA,cAAc,EAAEoB,sBAAUK,MAAV,CAAiBE;AAPhB,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(\n PropTypes.shape({ label: PropTypes.string, value: PropTypes.string })\n ),\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"}
|