@roqua/quby-frontend 0.4.3 → 0.5.1
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.md +13 -0
- package/lib/components/AnswerPage.js +26 -49
- package/lib/components/AnswerPage.js.map +1 -1
- package/lib/components/MainLabel.js +6 -14
- package/lib/components/MainLabel.js.map +1 -1
- package/lib/components/Paginator.js +29 -53
- package/lib/components/Paginator.js.map +1 -1
- package/lib/components/PanelContent.js +8 -17
- package/lib/components/PanelContent.js.map +1 -1
- package/lib/components/PanelItem.js +8 -15
- package/lib/components/PanelItem.js.map +1 -1
- package/lib/components/ProgressBar.js +10 -18
- package/lib/components/ProgressBar.js.map +1 -1
- package/lib/components/Quby.d.ts +2 -2
- package/lib/components/Quby.d.ts.map +1 -1
- package/lib/components/Quby.js +9 -16
- package/lib/components/Quby.js.map +1 -1
- package/lib/components/QuestionDescription.js +3 -10
- package/lib/components/QuestionDescription.js.map +1 -1
- package/lib/components/QuestionWrapper.js +10 -28
- package/lib/components/QuestionWrapper.js.map +1 -1
- package/lib/components/ValidationErrors.js +10 -30
- package/lib/components/ValidationErrors.js.map +1 -1
- package/lib/components/index.js +2 -14
- package/lib/components/index.js.map +1 -1
- package/lib/components/items/HtmlItem.js +4 -12
- package/lib/components/items/HtmlItem.js.map +1 -1
- package/lib/components/items/QuestionItem.js +34 -42
- package/lib/components/items/QuestionItem.js.map +1 -1
- package/lib/components/items/UnknownItem.js +3 -11
- package/lib/components/items/UnknownItem.js.map +1 -1
- package/lib/components/questions/CheckBoxQuestion.js +33 -43
- package/lib/components/questions/CheckBoxQuestion.js.map +1 -1
- package/lib/components/questions/DatePartsQuestion.js +18 -26
- package/lib/components/questions/DatePartsQuestion.js.map +1 -1
- package/lib/components/questions/FloatQuestion.js +16 -24
- package/lib/components/questions/FloatQuestion.js.map +1 -1
- package/lib/components/questions/IntegerQuestion.js +16 -24
- package/lib/components/questions/IntegerQuestion.js.map +1 -1
- package/lib/components/questions/RadioQuestion.js +32 -42
- package/lib/components/questions/RadioQuestion.js.map +1 -1
- package/lib/components/questions/ScaleQuestion.js +31 -41
- package/lib/components/questions/ScaleQuestion.js.map +1 -1
- package/lib/components/questions/SelectQuestion.js +22 -31
- package/lib/components/questions/SelectQuestion.js.map +1 -1
- package/lib/components/questions/SliderQuestion.js +59 -67
- package/lib/components/questions/SliderQuestion.js.map +1 -1
- package/lib/components/questions/StringQuestion.js +16 -24
- package/lib/components/questions/StringQuestion.js.map +1 -1
- package/lib/components/questions/TextareaQuestion.js +15 -23
- package/lib/components/questions/TextareaQuestion.js.map +1 -1
- package/lib/core/index.d.ts +1 -0
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +5 -16
- package/lib/core/index.js.map +1 -1
- package/lib/core/mock_helpers.js +11 -17
- package/lib/core/mock_helpers.js.map +1 -1
- package/lib/core/questionnaire.js +8 -13
- package/lib/core/questionnaire.js.map +1 -1
- package/lib/core/questionnaire_json.d.ts +5 -3
- package/lib/core/questionnaire_json.d.ts.map +1 -1
- package/lib/core/questionnaire_json.js +2 -2
- package/lib/core/questionnaire_json.js.map +1 -1
- package/lib/core/response.d.ts +13 -5
- package/lib/core/response.d.ts.map +1 -1
- package/lib/core/response.js +72 -78
- package/lib/core/response.js.map +1 -1
- package/lib/core/response_json.d.ts +11 -0
- package/lib/core/response_json.d.ts.map +1 -0
- package/lib/core/response_json.js +68 -0
- package/lib/core/response_json.js.map +1 -0
- package/lib/core/validators.js +56 -169
- package/lib/core/validators.js.map +1 -1
- package/lib/core/visibility_rules.js +37 -90
- package/lib/core/visibility_rules.js.map +1 -1
- package/lib/i18n.js +7 -12
- package/lib/i18n.js.map +1 -1
- package/lib/index.js +3 -15
- package/lib/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionWrapper.js","sourceRoot":"","sources":["../../src/components/QuestionWrapper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionWrapper.js","sourceRoot":"","sources":["../../src/components/QuestionWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAStD,MAAM,CAAC,MAAM,eAAe,GAAmC,KAAK,CAAC,EAAE;IACrE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACvD,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,cAAc,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAE1C,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE;QAC/H,MAAM,EAAE,UAAU,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QAC7D,MAAM,EAAE,UAAU,CAAC,gBAAgB;KACpC,CAAC,CAAC;IAEH,OAAO,CACL,6BAAK,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,EAAC,GAAG,CAAC,UAAU,CAAC,gBAAgB,IAAI,YAAY,CAAC,EAAC;QACpG,oBAAC,gBAAgB,IAAC,UAAU,EAAE,UAAU,GAAI;QAC3C,KAAK,CAAC,QAAQ,CACX,CACP,CAAC;AACJ,CAAC,CAAC;AAGF,MAAM,YAAY,GAAG;IACnB,eAAe,EAAE,SAAS;CAC3B,CAAA"}
|
|
@@ -1,36 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
exports.__esModule = true;
|
|
17
|
-
exports.ValidationErrors = void 0;
|
|
18
|
-
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var classnames_1 = __importDefault(require("classnames"));
|
|
20
|
-
var react_i18next_1 = require("react-i18next");
|
|
21
|
-
var ValidationErrors = function (_a) {
|
|
22
|
-
var fieldState = _a.fieldState;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
export const ValidationErrors = ({ fieldState }) => {
|
|
23
5
|
if (!fieldState.beenActive)
|
|
24
6
|
return null;
|
|
25
|
-
return
|
|
7
|
+
return React.createElement(React.Fragment, null, fieldState.errors.map(error => React.createElement(Error, { key: error.type, error: error })));
|
|
26
8
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var className = (0, classnames_1["default"])("error", error.type);
|
|
32
|
-
var args = __assign({}, error.message);
|
|
9
|
+
const Error = ({ error }) => {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const className = classNames("error", error.type);
|
|
12
|
+
const args = { ...error.message };
|
|
33
13
|
delete args.t;
|
|
34
|
-
return
|
|
14
|
+
return React.createElement("div", { className: className }, t(`validations.${error.message.t}`, args));
|
|
35
15
|
};
|
|
36
16
|
//# sourceMappingURL=ValidationErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationErrors.js","sourceRoot":"","sources":["../../src/components/ValidationErrors.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ValidationErrors.js","sourceRoot":"","sources":["../../src/components/ValidationErrors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAM/C,MAAM,CAAC,MAAM,gBAAgB,GAAmC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IACjF,IAAI,CAAC,UAAU,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAExC,OAAO,0CAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,oBAAC,KAAK,IAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC,CAAI,CAAC;AACzF,CAAC,CAAC;AAEF,MAAM,KAAK,GAA+C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtE,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,IAAI,GAAQ,EAAC,GAAG,KAAK,CAAC,OAAO,EAAC,CAAC;IACrC,OAAO,IAAI,CAAC,CAAC,CAAC;IAEd,OAAO,6BAAK,SAAS,EAAE,SAAS,IAC7B,CAAC,CAAC,eAAe,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CACtC,CAAA;AACR,CAAC,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
exports.__esModule = true;
|
|
13
|
-
__exportStar(require("./AnswerPage"), exports);
|
|
14
|
-
__exportStar(require("./Quby"), exports);
|
|
1
|
+
export * from "./AnswerPage";
|
|
2
|
+
export * from "./Quby";
|
|
15
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const HtmlItem = ({ item }) => {
|
|
3
|
+
return (React.createElement("div", { className: "item" },
|
|
4
|
+
React.createElement("div", { className: "text", dangerouslySetInnerHTML: { __html: item.html } })));
|
|
4
5
|
};
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.HtmlItem = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var HtmlItem = function (_a) {
|
|
9
|
-
var item = _a.item;
|
|
10
|
-
return (react_1["default"].createElement("div", { className: "item" },
|
|
11
|
-
react_1["default"].createElement("div", { className: "text", dangerouslySetInnerHTML: { __html: item.html } })));
|
|
12
|
-
};
|
|
13
|
-
exports.HtmlItem = HtmlItem;
|
|
14
6
|
//# sourceMappingURL=HtmlItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HtmlItem.js","sourceRoot":"","sources":["../../../src/components/items/HtmlItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HtmlItem.js","sourceRoot":"","sources":["../../../src/components/items/HtmlItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,MAAM,QAAQ,GAAmC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACnE,OAAO,CACL,6BAAK,SAAS,EAAC,MAAM;QACnB,6BAAK,SAAS,EAAC,MAAM,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,GAAI,CACpE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,86 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var FloatQuestion_1 = require("../questions/FloatQuestion");
|
|
15
|
-
var SliderQuestion_1 = require("../questions/SliderQuestion");
|
|
16
|
-
var TextareaQuestion_1 = require("../questions/TextareaQuestion");
|
|
17
|
-
var CheckBoxQuestion_1 = require("../questions/CheckBoxQuestion");
|
|
18
|
-
var QuestionItem = function (_a) {
|
|
19
|
-
var questionnaire = _a.questionnaire, response = _a.response, fieldKey = _a.fieldKey, setQuestionRef = _a.setQuestionRef;
|
|
20
|
-
var question = questionnaire.getField(fieldKey);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StringQuestion } from "../questions/StringQuestion";
|
|
3
|
+
import { ScaleQuestion } from "../questions/ScaleQuestion";
|
|
4
|
+
import { RadioQuestion } from "../questions/RadioQuestion";
|
|
5
|
+
import { SelectQuestion } from "../questions/SelectQuestion";
|
|
6
|
+
import { DatePartsQuestion } from "../questions/DatePartsQuestion";
|
|
7
|
+
import { IntegerQuestion } from "../questions/IntegerQuestion";
|
|
8
|
+
import { FloatQuestion } from "../questions/FloatQuestion";
|
|
9
|
+
import { SliderQuestion } from "../questions/SliderQuestion";
|
|
10
|
+
import { TextareaQuestion } from "../questions/TextareaQuestion";
|
|
11
|
+
import { CheckBoxQuestion } from "../questions/CheckBoxQuestion";
|
|
12
|
+
export const QuestionItem = ({ questionnaire, response, fieldKey, setQuestionRef }) => {
|
|
13
|
+
const question = questionnaire.getField(fieldKey);
|
|
21
14
|
switch (question.as) {
|
|
22
15
|
case "string": {
|
|
23
|
-
|
|
16
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
24
17
|
if (fieldState.hidden)
|
|
25
18
|
return null;
|
|
26
|
-
return
|
|
19
|
+
return React.createElement(StringQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
27
20
|
}
|
|
28
21
|
case "scale": {
|
|
29
|
-
|
|
22
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
30
23
|
if (fieldState.hidden)
|
|
31
24
|
return null;
|
|
32
|
-
return
|
|
25
|
+
return React.createElement(ScaleQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
33
26
|
}
|
|
34
27
|
case "radio": {
|
|
35
|
-
|
|
28
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
36
29
|
if (fieldState.hidden)
|
|
37
30
|
return null;
|
|
38
|
-
return
|
|
31
|
+
return React.createElement(RadioQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
39
32
|
}
|
|
40
33
|
case "select": {
|
|
41
|
-
|
|
34
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
42
35
|
if (fieldState.hidden)
|
|
43
36
|
return null;
|
|
44
|
-
return
|
|
37
|
+
return React.createElement(SelectQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
45
38
|
}
|
|
46
39
|
case "date_parts": {
|
|
47
|
-
|
|
40
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
48
41
|
if (fieldState.hidden)
|
|
49
42
|
return null;
|
|
50
|
-
return
|
|
43
|
+
return React.createElement(DatePartsQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
51
44
|
}
|
|
52
45
|
case "integer": {
|
|
53
|
-
|
|
46
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
54
47
|
if (fieldState.hidden)
|
|
55
48
|
return null;
|
|
56
|
-
return
|
|
49
|
+
return React.createElement(IntegerQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
57
50
|
}
|
|
58
51
|
case "float": {
|
|
59
|
-
|
|
52
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
60
53
|
if (fieldState.hidden)
|
|
61
54
|
return null;
|
|
62
|
-
return
|
|
55
|
+
return React.createElement(FloatQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
63
56
|
}
|
|
64
57
|
case "slider": {
|
|
65
|
-
|
|
58
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
66
59
|
if (fieldState.hidden)
|
|
67
60
|
return null;
|
|
68
|
-
return
|
|
61
|
+
return React.createElement(SliderQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
69
62
|
}
|
|
70
63
|
case "textarea": {
|
|
71
|
-
|
|
64
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
72
65
|
if (fieldState.hidden)
|
|
73
66
|
return null;
|
|
74
|
-
return
|
|
67
|
+
return React.createElement(TextareaQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
75
68
|
}
|
|
76
69
|
case "check_box": {
|
|
77
|
-
|
|
70
|
+
const fieldState = response.getFieldState(fieldKey);
|
|
78
71
|
if (fieldState.hidden)
|
|
79
72
|
return null;
|
|
80
|
-
return
|
|
73
|
+
return React.createElement(CheckBoxQuestion, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef });
|
|
81
74
|
}
|
|
82
75
|
}
|
|
83
|
-
throw new Error(
|
|
76
|
+
throw new Error(`unknown question type`);
|
|
84
77
|
};
|
|
85
|
-
exports.QuestionItem = QuestionItem;
|
|
86
78
|
//# sourceMappingURL=QuestionItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionItem.js","sourceRoot":"","sources":["../../../src/components/items/QuestionItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionItem.js","sourceRoot":"","sources":["../../../src/components/items/QuestionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAO,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,MAAM,CAAC,MAAM,YAAY,GAAmC,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE;IAEpH,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAElD,QAAQ,QAAQ,CAAC,EAAE,EAAE;QACnB,KAAK,QAAQ,CAAC,CAAC;YACb,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAS,QAAQ,CAAC,CAAC;YAC5D,IAAI,UAAU,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YAC/B,OAAO,oBAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAA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AG,cAAc,EAAE,cAAc,GAAI,CAAC;SAC9G;KACF;IAED,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;AAC3C,CAAC,CAAC"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (
|
|
4
|
-
};
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.UnknownItem = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var UnknownItem = function (_a) {
|
|
9
|
-
var item = _a.item;
|
|
10
|
-
return (react_1["default"].createElement("div", { className: "item", style: { border: "1px red", background: "yellow" } },
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const UnknownItem = ({ item }) => {
|
|
3
|
+
return (React.createElement("div", { className: "item", style: { border: "1px red", background: "yellow" } },
|
|
11
4
|
"Unknown item type:",
|
|
12
5
|
item.type));
|
|
13
6
|
};
|
|
14
|
-
exports.UnknownItem = UnknownItem;
|
|
15
7
|
//# sourceMappingURL=UnknownItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnknownItem.js","sourceRoot":"","sources":["../../../src/components/items/UnknownItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnknownItem.js","sourceRoot":"","sources":["../../../src/components/items/UnknownItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,CAAC,MAAM,WAAW,GAAmC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACtE,OAAO,CACL,6BAAK,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAC;;QAElE,IAAI,CAAC,IAAI,CACP,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,61 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { MainLabel } from "../MainLabel";
|
|
4
|
+
import { QuestionWrapper } from "../QuestionWrapper";
|
|
5
|
+
import { QuestionDescription } from "../QuestionDescription";
|
|
6
|
+
export const CheckBoxQuestion = ({ question, fieldState, setQuestionRef }) => {
|
|
7
|
+
const fieldsClassNames = classNames("fields", question.presentation !== "horizontal" ? `options${question.children.length}` : null);
|
|
8
|
+
return (React.createElement(QuestionWrapper, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef },
|
|
9
|
+
React.createElement(MainLabel, { question: question }),
|
|
10
|
+
React.createElement("div", { className: "description-and-fields" },
|
|
11
|
+
React.createElement(QuestionDescription, { question: question }),
|
|
12
|
+
React.createElement("div", { className: fieldsClassNames, id: htmlId(question) }, question.children.map((child, index) => (child.type === 'option'
|
|
13
|
+
? React.createElement(Option, { key: child.key, question: question, option: child, index: index, fieldState: fieldState })
|
|
14
|
+
: React.createElement("div", { key: child.key, className: "inner-title", dangerouslySetInnerHTML: { __html: child.html } })))))));
|
|
4
15
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var classnames_1 = __importDefault(require("classnames"));
|
|
9
|
-
var MainLabel_1 = require("../MainLabel");
|
|
10
|
-
var QuestionWrapper_1 = require("../QuestionWrapper");
|
|
11
|
-
var QuestionDescription_1 = require("../QuestionDescription");
|
|
12
|
-
var CheckBoxQuestion = function (_a) {
|
|
13
|
-
var question = _a.question, fieldState = _a.fieldState, setQuestionRef = _a.setQuestionRef;
|
|
14
|
-
var fieldsClassNames = (0, classnames_1["default"])("fields", question.presentation !== "horizontal" ? "options".concat(question.children.length) : null);
|
|
15
|
-
return (react_1["default"].createElement(QuestionWrapper_1.QuestionWrapper, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef },
|
|
16
|
-
react_1["default"].createElement(MainLabel_1.MainLabel, { question: question }),
|
|
17
|
-
react_1["default"].createElement("div", { className: "description-and-fields" },
|
|
18
|
-
react_1["default"].createElement(QuestionDescription_1.QuestionDescription, { question: question }),
|
|
19
|
-
react_1["default"].createElement("div", { className: fieldsClassNames, id: htmlId(question) }, question.children.map(function (child, index) { return (child.type === 'option'
|
|
20
|
-
? react_1["default"].createElement(Option, { key: child.key, question: question, option: child, index: index, fieldState: fieldState })
|
|
21
|
-
: react_1["default"].createElement("div", { key: child.key, className: "inner-title", dangerouslySetInnerHTML: { __html: child.html } })); })))));
|
|
22
|
-
};
|
|
23
|
-
exports.CheckBoxQuestion = CheckBoxQuestion;
|
|
24
|
-
var Option = function (_a) {
|
|
25
|
-
var question = _a.question, option = _a.option, index = _a.index, fieldState = _a.fieldState;
|
|
26
|
-
var divClassNames = (0, classnames_1["default"])("option", {
|
|
16
|
+
const Option = ({ question, option, index, fieldState }) => {
|
|
17
|
+
const divClassNames = classNames("option", {
|
|
27
18
|
show_values: false // TODO
|
|
28
19
|
});
|
|
29
|
-
|
|
20
|
+
const inputClassNames = classNames(question.type, {
|
|
30
21
|
subinput: false,
|
|
31
22
|
deselectable: false // TODO
|
|
32
23
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
const value = fieldState.value || new Set();
|
|
25
|
+
const checked = value.has(option.key) || false;
|
|
26
|
+
const handleChange = (event) => option.key && fieldState.setValue(toggleValue(fieldState, option.key));
|
|
27
|
+
return (React.createElement("div", { className: divClassNames },
|
|
28
|
+
React.createElement("div", { className: "radiocheckwrapper" },
|
|
29
|
+
React.createElement("input", { type: "checkbox", name: question.key, id: option.viewId, className: inputClassNames, checked: checked, onChange: handleChange, onFocus: fieldState.setAsActiveQuestion })),
|
|
30
|
+
React.createElement(ShowValue, { question: question, option: option }),
|
|
31
|
+
React.createElement("div", { className: "labelwrapper" },
|
|
32
|
+
React.createElement("label", { htmlFor: option.viewId },
|
|
33
|
+
React.createElement("span", { dangerouslySetInnerHTML: { __html: option.description } }))),
|
|
34
|
+
React.createElement(SubQuestions, null)));
|
|
44
35
|
};
|
|
45
|
-
|
|
46
|
-
var question = _a.question, option = _a.option;
|
|
36
|
+
const ShowValue = ({ question, option }) => {
|
|
47
37
|
return null; // TODO
|
|
48
38
|
};
|
|
49
|
-
|
|
39
|
+
const SubQuestions = () => {
|
|
50
40
|
return null; // TODO
|
|
51
41
|
};
|
|
52
42
|
function htmlId(question) {
|
|
53
|
-
return
|
|
43
|
+
return `answer_${question.key}_input`;
|
|
54
44
|
}
|
|
55
45
|
function toggleValue(fieldState, optionKey) {
|
|
56
|
-
|
|
46
|
+
const value = fieldState.value || new Set();
|
|
57
47
|
if (value.has(optionKey)) {
|
|
58
|
-
value
|
|
48
|
+
value.delete(optionKey);
|
|
59
49
|
}
|
|
60
50
|
else {
|
|
61
51
|
value.add(optionKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckBoxQuestion.js","sourceRoot":"","sources":["../../../src/components/questions/CheckBoxQuestion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckBoxQuestion.js","sourceRoot":"","sources":["../../../src/components/questions/CheckBoxQuestion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAU7D,MAAM,CAAC,MAAM,gBAAgB,GAAmC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE;IAC3G,MAAM,gBAAgB,GAAG,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC,CAAC,UAAU,QAAQ,CAAC,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C;AACxC,CAAC;AAED,SAAS,WAAW,CAAC,UAA8B,EAAE,SAAiB;IACpE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,IAAI,GAAG,EAAE,CAAC;IAE5C,IAAI,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;QACxB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;KACzB;SAAM;QACL,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KACtB;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,37 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var QuestionWrapper_1 = require("../QuestionWrapper");
|
|
12
|
-
var QuestionDescription_1 = require("../QuestionDescription");
|
|
13
|
-
var DatePartsQuestion = function (_a) {
|
|
14
|
-
var question = _a.question, fieldState = _a.fieldState, setQuestionRef = _a.setQuestionRef;
|
|
15
|
-
var t = (0, react_i18next_1.useTranslation)().t;
|
|
16
|
-
var handleChange = function (event, component) {
|
|
17
|
-
var newValue = new Map(fieldState.value || []);
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { MainLabel } from "../MainLabel";
|
|
5
|
+
import { QuestionWrapper } from "../QuestionWrapper";
|
|
6
|
+
import { QuestionDescription } from "../QuestionDescription";
|
|
7
|
+
export const DatePartsQuestion = ({ question, fieldState, setQuestionRef }) => {
|
|
8
|
+
const { t } = useTranslation();
|
|
9
|
+
const handleChange = (event, component) => {
|
|
10
|
+
const newValue = new Map(fieldState.value || []);
|
|
18
11
|
newValue.set(component, event.target.value.trim());
|
|
19
12
|
fieldState.setValue(newValue);
|
|
20
13
|
};
|
|
21
|
-
|
|
14
|
+
const className = classNames(question.type, {
|
|
22
15
|
subitem: false // TODO
|
|
23
16
|
});
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
return (React.createElement(QuestionWrapper, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef },
|
|
18
|
+
React.createElement(MainLabel, { question: question }),
|
|
19
|
+
React.createElement("div", { className: "description-and-fields" },
|
|
20
|
+
React.createElement(QuestionDescription, { question: question }),
|
|
21
|
+
React.createElement("div", { className: "fields", id: htmlId(question) }, question.dateParts.map((datePart) => {
|
|
29
22
|
var _a;
|
|
30
|
-
return
|
|
23
|
+
return React.createElement("input", { key: datePart.part, type: "text", value: ((_a = fieldState.value) === null || _a === void 0 ? void 0 : _a.get(datePart.part)) || '', placeholder: t(`placeholders.${datePart.part}`), className: className, onChange: event => handleChange(event, datePart.part), size: datePart.part === "year" ? 5 : 3, style: { marginRight: '.5em' }, onFocus: fieldState.setAsActiveQuestion });
|
|
31
24
|
})))));
|
|
32
25
|
};
|
|
33
|
-
exports.DatePartsQuestion = DatePartsQuestion;
|
|
34
26
|
function htmlId(question) {
|
|
35
|
-
return
|
|
27
|
+
return `answer_${question.key}_input`;
|
|
36
28
|
}
|
|
37
29
|
//# sourceMappingURL=DatePartsQuestion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePartsQuestion.js","sourceRoot":"","sources":["../../../src/components/questions/DatePartsQuestion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePartsQuestion.js","sourceRoot":"","sources":["../../../src/components/questions/DatePartsQuestion.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,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AC,gBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,EAC/C,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,EACrD,IAAI,EAAE,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACtC,KAAK,EAAE,EAAC,WAAW,EAAE,MAAM,EAAC,EAC5B,OAAO,EAAE,UAAU,CAAC,mBAAmB,GAGvC,CAAA;aAAA,CACH,CAEC,CACF,CACU,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,MAAM,CAAC,QAAmB;IACjC,OAAO,UAAU,QAAQ,CAAC,GAAG,QAAQ,CAAC;AACxC,CAAC"}
|
|
@@ -1,35 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var classnames_1 = __importDefault(require("classnames"));
|
|
9
|
-
var MainLabel_1 = require("../MainLabel");
|
|
10
|
-
var QuestionWrapper_1 = require("../QuestionWrapper");
|
|
11
|
-
var QuestionDescription_1 = require("../QuestionDescription");
|
|
12
|
-
var FloatQuestion = function (_a) {
|
|
13
|
-
var question = _a.question, fieldState = _a.fieldState, setQuestionRef = _a.setQuestionRef;
|
|
14
|
-
var handleChange = function (event) {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { MainLabel } from "../MainLabel";
|
|
4
|
+
import { QuestionWrapper } from "../QuestionWrapper";
|
|
5
|
+
import { QuestionDescription } from "../QuestionDescription";
|
|
6
|
+
export const FloatQuestion = ({ question, fieldState, setQuestionRef }) => {
|
|
7
|
+
const handleChange = (event) => {
|
|
15
8
|
fieldState.setValue(event.target.value);
|
|
16
9
|
};
|
|
17
|
-
|
|
10
|
+
const className = classNames(question.type, {
|
|
18
11
|
sized: !!question.size,
|
|
19
12
|
subitem: false // TODO
|
|
20
13
|
});
|
|
21
|
-
return (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
question.unit &&
|
|
14
|
+
return (React.createElement(QuestionWrapper, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef },
|
|
15
|
+
React.createElement(MainLabel, { question: question }),
|
|
16
|
+
React.createElement("div", { className: "description-and-fields" },
|
|
17
|
+
React.createElement(QuestionDescription, { question: question }),
|
|
18
|
+
React.createElement("div", { className: "fields", id: htmlId(question) },
|
|
19
|
+
React.createElement("input", { type: "text", className: className, value: fieldState.value || "", size: question.size, onChange: handleChange, onFocus: fieldState.setAsActiveQuestion }),
|
|
20
|
+
question.unit && React.createElement("span", { className: "unit" },
|
|
28
21
|
" ",
|
|
29
22
|
question.unit)))));
|
|
30
23
|
};
|
|
31
|
-
exports.FloatQuestion = FloatQuestion;
|
|
32
24
|
function htmlId(question) {
|
|
33
|
-
return
|
|
25
|
+
return `answer_${question.key}_input`;
|
|
34
26
|
}
|
|
35
27
|
//# sourceMappingURL=FloatQuestion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatQuestion.js","sourceRoot":"","sources":["../../../src/components/questions/FloatQuestion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FloatQuestion.js","sourceRoot":"","sources":["../../../src/components/questions/FloatQuestion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAQ7D,MAAM,CAAC,MAAM,aAAa,GAAmC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,cA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var classnames_1 = __importDefault(require("classnames"));
|
|
9
|
-
var MainLabel_1 = require("../MainLabel");
|
|
10
|
-
var QuestionWrapper_1 = require("../QuestionWrapper");
|
|
11
|
-
var QuestionDescription_1 = require("../QuestionDescription");
|
|
12
|
-
var IntegerQuestion = function (_a) {
|
|
13
|
-
var question = _a.question, fieldState = _a.fieldState, setQuestionRef = _a.setQuestionRef;
|
|
14
|
-
var handleChange = function (event) {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { MainLabel } from "../MainLabel";
|
|
4
|
+
import { QuestionWrapper } from "../QuestionWrapper";
|
|
5
|
+
import { QuestionDescription } from "../QuestionDescription";
|
|
6
|
+
export const IntegerQuestion = ({ question, fieldState, setQuestionRef }) => {
|
|
7
|
+
const handleChange = (event) => {
|
|
15
8
|
fieldState.setValue(event.target.value);
|
|
16
9
|
};
|
|
17
|
-
|
|
10
|
+
const className = classNames(question.type, {
|
|
18
11
|
// sized: !!question.size,
|
|
19
12
|
subitem: false // TODO
|
|
20
13
|
});
|
|
21
|
-
return (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
question.unit &&
|
|
14
|
+
return (React.createElement(QuestionWrapper, { question: question, fieldState: fieldState, setQuestionRef: setQuestionRef },
|
|
15
|
+
React.createElement(MainLabel, { question: question }),
|
|
16
|
+
React.createElement("div", { className: "description-and-fields" },
|
|
17
|
+
React.createElement(QuestionDescription, { question: question }),
|
|
18
|
+
React.createElement("div", { className: "fields", id: htmlId(question) },
|
|
19
|
+
React.createElement("input", { type: "text", className: className, value: fieldState.value || "", size: question.size, onChange: handleChange, onFocus: fieldState.setAsActiveQuestion }),
|
|
20
|
+
question.unit && React.createElement("span", { className: "unit" },
|
|
28
21
|
" ",
|
|
29
22
|
question.unit)))));
|
|
30
23
|
};
|
|
31
|
-
exports.IntegerQuestion = IntegerQuestion;
|
|
32
24
|
function htmlId(question) {
|
|
33
|
-
return
|
|
25
|
+
return `answer_${question.key}_input`;
|
|
34
26
|
}
|
|
35
27
|
//# sourceMappingURL=IntegerQuestion.js.map
|