@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e } from "../browser-kkT1XVKw.js";
|
|
2
|
-
import { Nt as t, O as n, a as r, d as i, dt as a, f as o, ft as s, ht as c, k as l, n as u, p as d, pt as f, r as p, t as m, u as h, x as g } from "../Typography-
|
|
2
|
+
import { Nt as t, O as n, a as r, d as i, dt as a, f as o, ft as s, ht as c, k as l, n as u, p as d, pt as f, r as p, t as m, u as h, x as g } from "../Typography-DS6VD63M.js";
|
|
3
3
|
import _, { useRef as v } from "react";
|
|
4
4
|
import { createRoot as y } from "react-dom/client";
|
|
5
5
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
@@ -1755,14 +1755,18 @@ var We = Ue(o, "Readable") || Ue(Ke.Readable, "Readable"), Ge = r, K = Ge.defaul
|
|
|
1755
1755
|
let { correctAnswers: r } = this.props;
|
|
1756
1756
|
return r[e][n] === !0 && t === !1 || r[e][n] === !1 && t === !0;
|
|
1757
1757
|
};
|
|
1758
|
+
controlColor = (e, t, n) => {
|
|
1759
|
+
let { showCorrect: r, disabled: i, view: a } = this.props, o = i && !a;
|
|
1760
|
+
return r && t === !0 || o && this.answerIsCorrect(e, t, n) ? s.correct() : o && this.answerIsIncorrect(e, t, n) ? s.incorrect() : t === !0 && !o ? s.primary() : i ? s.disabled() : s.text();
|
|
1761
|
+
};
|
|
1758
1762
|
render() {
|
|
1759
|
-
let {
|
|
1760
|
-
return !
|
|
1763
|
+
let { headers: e, rows: t, choiceMode: n, answers: r, disabled: i } = this.props, a = n === "radio" ? p : u;
|
|
1764
|
+
return !t || t.length === 0 ? /* @__PURE__ */ b(et, { children: /* @__PURE__ */ b(nt, {
|
|
1761
1765
|
component: "div",
|
|
1762
1766
|
children: "There are currently no questions to show."
|
|
1763
1767
|
}) }) : /* @__PURE__ */ b(et, { children: /* @__PURE__ */ x(at, { children: [
|
|
1764
|
-
/* @__PURE__ */ b("colgroup", { children: (
|
|
1765
|
-
/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { children: (
|
|
1768
|
+
/* @__PURE__ */ b("colgroup", { children: (e || []).map((e, t) => /* @__PURE__ */ b("col", {}, `col-${t}`)) }),
|
|
1769
|
+
/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { children: (e || []).map((e, t) => /* @__PURE__ */ b(rt, {
|
|
1766
1770
|
"data-colno": `${t}`,
|
|
1767
1771
|
scope: "row",
|
|
1768
1772
|
children: /* @__PURE__ */ b(J, {
|
|
@@ -1770,33 +1774,37 @@ var We = Ue(o, "Readable") || Ue(Ke.Readable, "Readable"), Ge = r, K = Ge.defaul
|
|
|
1770
1774
|
dangerouslySetInnerHTML: { __html: e }
|
|
1771
1775
|
})
|
|
1772
1776
|
}, `th-${t}`)) }) }),
|
|
1773
|
-
(
|
|
1777
|
+
(t || []).map((e, t) => /* @__PURE__ */ b("tbody", {
|
|
1774
1778
|
role: "group",
|
|
1775
1779
|
children: /* @__PURE__ */ x(it, { children: [/* @__PURE__ */ b("td", {
|
|
1776
1780
|
"data-colno": "0",
|
|
1777
1781
|
children: /* @__PURE__ */ b(J, {
|
|
1778
1782
|
isQuestionText: !0,
|
|
1779
|
-
dangerouslySetInnerHTML: { __html:
|
|
1783
|
+
dangerouslySetInnerHTML: { __html: e.title }
|
|
1780
1784
|
})
|
|
1781
|
-
}, `td-title-${
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1785
|
+
}, `td-title-${t}`), (r[e.id] || []).map((n, r) => {
|
|
1786
|
+
let o = this.controlColor(e.id, n, r);
|
|
1787
|
+
return /* @__PURE__ */ b(tt, {
|
|
1788
|
+
"data-colno": `${r + 1}`,
|
|
1789
|
+
children: /* @__PURE__ */ b(J, { children: /* @__PURE__ */ b(a, {
|
|
1790
|
+
sx: {
|
|
1791
|
+
padding: "6px",
|
|
1792
|
+
color: o,
|
|
1793
|
+
"&&.Mui-checked": { color: o },
|
|
1794
|
+
"&&.Mui-disabled": { color: o },
|
|
1795
|
+
cursor: i ? "not-allowed" : "pointer",
|
|
1796
|
+
pointerEvents: i ? "initial" : "auto",
|
|
1797
|
+
opacity: i ? .7 : 1,
|
|
1798
|
+
"& input": { width: "100% !important" },
|
|
1799
|
+
"&&:hover:not(.Mui-disabled)": { color: s.primaryLight() }
|
|
1800
|
+
},
|
|
1801
|
+
disabled: i,
|
|
1802
|
+
onChange: this.onRowValueChange(e.id, r),
|
|
1803
|
+
checked: n === !0
|
|
1804
|
+
}) })
|
|
1805
|
+
}, `td-${t}-${r}`);
|
|
1806
|
+
})] })
|
|
1807
|
+
}, `row-${t}`))
|
|
1800
1808
|
] }) });
|
|
1801
1809
|
}
|
|
1802
1810
|
};
|