@elice/material-quiz 1.220803.3 → 1.220808.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,17 +9,13 @@ var randomId = require('./randomId.js');
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
function manipulateValue(v) {
|
|
12
|
-
var _a, _b;
|
|
13
|
-
|
|
14
12
|
return Object.assign(Object.assign({}, v), {
|
|
15
13
|
// convert string array to object array
|
|
16
14
|
// - ref: https://github.com/react-hook-form/react-hook-form/issues/7622#issuecomment-1018893318
|
|
17
15
|
optionInfo: Array.isArray(v.optionInfo) ? v.optionInfo.map(option => ({
|
|
18
16
|
id: randomId.createRandomId(),
|
|
19
17
|
value: option
|
|
20
|
-
})) : []
|
|
21
|
-
// remove `"` mark around value
|
|
22
|
-
answerInfo: typeof v.answerInfo === 'string' ? (_b = (_a = /^"?([^"]*)"?$/.exec(v.answerInfo)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '' : v.answerInfo
|
|
18
|
+
})) : []
|
|
23
19
|
});
|
|
24
20
|
}
|
|
25
21
|
/**
|
|
@@ -29,7 +25,7 @@ function manipulateValue(v) {
|
|
|
29
25
|
function restoreValue(v) {
|
|
30
26
|
return Object.assign(Object.assign({}, v), {
|
|
31
27
|
optionInfo: v.optionInfo.length ? v.optionInfo.map(option => option.value) : null,
|
|
32
|
-
answerInfo: Array.isArray(v.answerInfo)
|
|
28
|
+
answerInfo: Array.isArray(v.answerInfo) || typeof v.answerInfo === 'string' ? v.answerInfo : undefined
|
|
33
29
|
});
|
|
34
30
|
}
|
|
35
31
|
|
|
@@ -5,17 +5,13 @@ import { createRandomId } from './randomId.js';
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
function manipulateValue(v) {
|
|
8
|
-
var _a, _b;
|
|
9
|
-
|
|
10
8
|
return Object.assign(Object.assign({}, v), {
|
|
11
9
|
// convert string array to object array
|
|
12
10
|
// - ref: https://github.com/react-hook-form/react-hook-form/issues/7622#issuecomment-1018893318
|
|
13
11
|
optionInfo: Array.isArray(v.optionInfo) ? v.optionInfo.map(option => ({
|
|
14
12
|
id: createRandomId(),
|
|
15
13
|
value: option
|
|
16
|
-
})) : []
|
|
17
|
-
// remove `"` mark around value
|
|
18
|
-
answerInfo: typeof v.answerInfo === 'string' ? (_b = (_a = /^"?([^"]*)"?$/.exec(v.answerInfo)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '' : v.answerInfo
|
|
14
|
+
})) : []
|
|
19
15
|
});
|
|
20
16
|
}
|
|
21
17
|
/**
|
|
@@ -25,7 +21,7 @@ function manipulateValue(v) {
|
|
|
25
21
|
function restoreValue(v) {
|
|
26
22
|
return Object.assign(Object.assign({}, v), {
|
|
27
23
|
optionInfo: v.optionInfo.length ? v.optionInfo.map(option => option.value) : null,
|
|
28
|
-
answerInfo: Array.isArray(v.answerInfo)
|
|
24
|
+
answerInfo: Array.isArray(v.answerInfo) || typeof v.answerInfo === 'string' ? v.answerInfo : undefined
|
|
29
25
|
});
|
|
30
26
|
}
|
|
31
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-quiz",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.220808.0",
|
|
4
4
|
"description": "User view and editing components of Elice material quiz",
|
|
5
5
|
"repository": "https://git.elicer.io/elice/frontend/library/elice-material",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@elice/icons": "^1.220803.0",
|
|
58
58
|
"@elice/icons-legacy": "npm:@elice/icons@0.220803.1",
|
|
59
59
|
"@elice/markdown": "^1.220803.0",
|
|
60
|
-
"@elice/material-shared-types": "1.
|
|
61
|
-
"@elice/material-shared-utils": "1.
|
|
60
|
+
"@elice/material-shared-types": "1.220808.0",
|
|
61
|
+
"@elice/material-shared-utils": "1.220808.0",
|
|
62
62
|
"@elice/types": "^1.220803.0",
|
|
63
63
|
"@types/classnames": "^2.3.1",
|
|
64
64
|
"@types/jquery": "^3.5.13",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react-use": "^17.2.4",
|
|
72
72
|
"styled-components": "^5.3.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "9ed1453798e79b8daa25b3bc92dff0254001e8d7"
|
|
75
75
|
}
|