@pie-element/match 12.1.2-next.7 → 12.1.2-next.9
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/dist/browser/{Typography-BvyMwfyW.js → Typography-DS6VD63M.js} +703 -701
- package/dist/browser/Typography-DS6VD63M.js.map +1 -0
- package/dist/browser/author/index.js +728 -620
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +34 -26
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/delivery/answer-grid.d.ts +1 -0
- package/dist/delivery/answer-grid.js +33 -25
- package/dist/index.iife.js +21 -21
- package/package.json +6 -6
- package/dist/browser/Typography-BvyMwfyW.js.map +0 -1
|
@@ -23,6 +23,7 @@ export declare class AnswerGrid extends React.Component {
|
|
|
23
23
|
onRowValueChange: (rowId: any, answerIndex: any) => (event: any) => void;
|
|
24
24
|
answerIsCorrect: any;
|
|
25
25
|
answerIsIncorrect: any;
|
|
26
|
+
controlColor: any;
|
|
26
27
|
render(): React.JSX.Element;
|
|
27
28
|
}
|
|
28
29
|
export default AnswerGrid;
|
|
@@ -50,14 +50,18 @@ var l = c("div")(({ theme: e }) => ({
|
|
|
50
50
|
let { correctAnswers: r } = this.props;
|
|
51
51
|
return r[e][n] === !0 && t === !1 || r[e][n] === !1 && t === !0;
|
|
52
52
|
};
|
|
53
|
+
controlColor = (e, t, r) => {
|
|
54
|
+
let { showCorrect: i, disabled: a, view: o } = this.props, s = a && !o;
|
|
55
|
+
return i && t === !0 || s && this.answerIsCorrect(e, t, r) ? n.correct() : s && this.answerIsIncorrect(e, t, r) ? n.incorrect() : t === !0 && !s ? n.primary() : a ? n.disabled() : n.text();
|
|
56
|
+
};
|
|
53
57
|
render() {
|
|
54
|
-
let {
|
|
55
|
-
return !
|
|
58
|
+
let { headers: e, rows: t, choiceMode: s, answers: c, disabled: g } = this.props, _ = s === "radio" ? a : o;
|
|
59
|
+
return !t || t.length === 0 ? /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(d, {
|
|
56
60
|
component: "div",
|
|
57
61
|
children: "There are currently no questions to show."
|
|
58
62
|
}) }) : /* @__PURE__ */ r(l, { children: /* @__PURE__ */ i(h, { children: [
|
|
59
|
-
/* @__PURE__ */ r("colgroup", { children: (
|
|
60
|
-
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: (
|
|
63
|
+
/* @__PURE__ */ r("colgroup", { children: (e || []).map((e, t) => /* @__PURE__ */ r("col", {}, `col-${t}`)) }),
|
|
64
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: (e || []).map((e, t) => /* @__PURE__ */ r(f, {
|
|
61
65
|
"data-colno": `${t}`,
|
|
62
66
|
scope: "row",
|
|
63
67
|
children: /* @__PURE__ */ r(p, {
|
|
@@ -65,33 +69,37 @@ var l = c("div")(({ theme: e }) => ({
|
|
|
65
69
|
dangerouslySetInnerHTML: { __html: e }
|
|
66
70
|
})
|
|
67
71
|
}, `th-${t}`)) }) }),
|
|
68
|
-
(
|
|
72
|
+
(t || []).map((e, t) => /* @__PURE__ */ r("tbody", {
|
|
69
73
|
role: "group",
|
|
70
74
|
children: /* @__PURE__ */ i(m, { children: [/* @__PURE__ */ r("td", {
|
|
71
75
|
"data-colno": "0",
|
|
72
76
|
children: /* @__PURE__ */ r(p, {
|
|
73
77
|
isQuestionText: !0,
|
|
74
|
-
dangerouslySetInnerHTML: { __html:
|
|
78
|
+
dangerouslySetInnerHTML: { __html: e.title }
|
|
75
79
|
})
|
|
76
|
-
}, `td-title-${
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
}, `td-title-${t}`), (c[e.id] || []).map((i, a) => {
|
|
81
|
+
let o = this.controlColor(e.id, i, a);
|
|
82
|
+
return /* @__PURE__ */ r(u, {
|
|
83
|
+
"data-colno": `${a + 1}`,
|
|
84
|
+
children: /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(_, {
|
|
85
|
+
sx: {
|
|
86
|
+
padding: "6px",
|
|
87
|
+
color: o,
|
|
88
|
+
"&&.Mui-checked": { color: o },
|
|
89
|
+
"&&.Mui-disabled": { color: o },
|
|
90
|
+
cursor: g ? "not-allowed" : "pointer",
|
|
91
|
+
pointerEvents: g ? "initial" : "auto",
|
|
92
|
+
opacity: g ? .7 : 1,
|
|
93
|
+
"& input": { width: "100% !important" },
|
|
94
|
+
"&&:hover:not(.Mui-disabled)": { color: n.primaryLight() }
|
|
95
|
+
},
|
|
96
|
+
disabled: g,
|
|
97
|
+
onChange: this.onRowValueChange(e.id, a),
|
|
98
|
+
checked: i === !0
|
|
99
|
+
}) })
|
|
100
|
+
}, `td-${t}-${a}`);
|
|
101
|
+
})] })
|
|
102
|
+
}, `row-${t}`))
|
|
95
103
|
] }) });
|
|
96
104
|
}
|
|
97
105
|
};
|