@pie-element/match 13.0.2-next.20261007003844 → 13.0.2

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.
@@ -6,26 +6,27 @@ import o from "@mui/material/Radio";
6
6
  import s from "@mui/material/Checkbox";
7
7
  import c from "@mui/material/Typography";
8
8
  import { styled as l } from "@mui/material/styles";
9
+ import { sanitizeModelHtml as u } from "@pie-element/shared-utils";
9
10
  //#region src/delivery/answer-grid.tsx
10
- var u = l("div")(({ theme: e }) => ({
11
+ var d = l("div")(({ theme: e }) => ({
11
12
  marginLeft: "auto",
12
13
  marginRight: "auto",
13
14
  marginTop: e.spacing(1),
14
15
  marginBottom: e.spacing(1)
15
- })), d = l("td")({ padding: "5px 0" }), f = l(c)(({ theme: e }) => ({ margin: e.spacing(2) })), p = l("th")({ padding: 0 }), m = l("div")(({ theme: e, isQuestionText: t }) => ({
16
+ })), f = l("td")({ padding: "5px 0" }), p = l(c)(({ theme: e }) => ({ margin: e.spacing(2) })), m = l("th")({ padding: 0 }), h = l("div")(({ theme: e, isQuestionText: t }) => ({
16
17
  padding: e.spacing(1.5),
17
18
  textAlign: t ? "left" : "center"
18
- })), h = l("tr")({
19
+ })), g = l("tr")({
19
20
  border: 0,
20
21
  borderTop: `2.5px solid ${n.primaryLight()}`,
21
22
  width: "100%"
22
- }), g = l("table")({
23
+ }), _ = l("table")({
23
24
  color: n.text(),
24
25
  backgroundColor: n.background(),
25
26
  borderCollapse: "collapse",
26
27
  borderSpacing: 0,
27
28
  marginBottom: 0
28
- }), _ = class extends e.Component {
29
+ }), v = class extends e.Component {
29
30
  static propTypes = {
30
31
  correctAnswers: t.object,
31
32
  view: t.bool.isRequired,
@@ -56,36 +57,36 @@ var u = l("div")(({ theme: e }) => ({
56
57
  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();
57
58
  };
58
59
  render() {
59
- let { headers: e, rows: t, choiceMode: r, answers: c, disabled: l } = this.props, _ = r === "radio" ? o : s, v = (e) => `${this.instanceId}-header-${e}`, y = (e) => `${this.instanceId}-row-${e}`, b = (e) => r === "radio" ? `${this.instanceId}-row-${e}-choice` : void 0;
60
- return !t || t.length === 0 ? /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(f, {
60
+ let { headers: e, rows: t, choiceMode: r, answers: c, disabled: l } = this.props, v = r === "radio" ? o : s, y = (e) => `${this.instanceId}-header-${e}`, b = (e) => `${this.instanceId}-row-${e}`, x = (e) => r === "radio" ? `${this.instanceId}-row-${e}-choice` : void 0;
61
+ return !t || t.length === 0 ? /* @__PURE__ */ i(d, { children: /* @__PURE__ */ i(p, {
61
62
  component: "div",
62
63
  children: "There are currently no questions to show."
63
- }) }) : /* @__PURE__ */ i(u, { children: /* @__PURE__ */ a(g, { children: [
64
+ }) }) : /* @__PURE__ */ i(d, { children: /* @__PURE__ */ a(_, { children: [
64
65
  /* @__PURE__ */ i("colgroup", { children: (e || []).map((e, t) => /* @__PURE__ */ i("col", {}, `col-${t}`)) }),
65
- /* @__PURE__ */ i("thead", { children: /* @__PURE__ */ i("tr", { children: (e || []).map((e, t) => /* @__PURE__ */ i(p, {
66
- id: v(t),
66
+ /* @__PURE__ */ i("thead", { children: /* @__PURE__ */ i("tr", { children: (e || []).map((e, t) => /* @__PURE__ */ i(m, {
67
+ id: y(t),
67
68
  "data-colno": `${t}`,
68
69
  scope: "col",
69
- children: /* @__PURE__ */ i(m, {
70
+ children: /* @__PURE__ */ i(h, {
70
71
  isQuestionText: t === 0,
71
- dangerouslySetInnerHTML: { __html: e }
72
+ dangerouslySetInnerHTML: { __html: u(e) }
72
73
  })
73
74
  }, `th-${t}`)) }) }),
74
75
  (t || []).map((e, t) => /* @__PURE__ */ i("tbody", {
75
76
  role: r === "radio" ? "radiogroup" : "group",
76
- "aria-labelledby": y(t),
77
- children: /* @__PURE__ */ a(h, { children: [/* @__PURE__ */ i("td", {
78
- id: y(t),
77
+ "aria-labelledby": b(t),
78
+ children: /* @__PURE__ */ a(g, { children: [/* @__PURE__ */ i("td", {
79
+ id: b(t),
79
80
  "data-colno": "0",
80
- children: /* @__PURE__ */ i(m, {
81
+ children: /* @__PURE__ */ i(h, {
81
82
  isQuestionText: !0,
82
- dangerouslySetInnerHTML: { __html: e.title }
83
+ dangerouslySetInnerHTML: { __html: u(e.title) }
83
84
  })
84
85
  }, `td-title-${t}`), (c[e.id] || []).map((r, a) => {
85
86
  let o = this.controlColor(e.id, r, a);
86
- return /* @__PURE__ */ i(d, {
87
+ return /* @__PURE__ */ i(f, {
87
88
  "data-colno": `${a + 1}`,
88
- children: /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(_, {
89
+ children: /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(v, {
89
90
  sx: {
90
91
  padding: "6px",
91
92
  color: o,
@@ -97,8 +98,8 @@ var u = l("div")(({ theme: e }) => ({
97
98
  "& input": { width: "100% !important" },
98
99
  "&&:hover:not(.Mui-disabled)": { color: n.primaryLight() }
99
100
  },
100
- slotProps: { input: { "aria-labelledby": `${y(t)} ${v(a + 1)}` } },
101
- name: b(t),
101
+ slotProps: { input: { "aria-labelledby": `${b(t)} ${y(a + 1)}` } },
102
+ name: x(t),
102
103
  disabled: l,
103
104
  onChange: this.onRowValueChange(e.id, a),
104
105
  checked: r === !0
@@ -110,4 +111,4 @@ var u = l("div")(({ theme: e }) => ({
110
111
  }
111
112
  };
112
113
  //#endregion
113
- export { _ as AnswerGrid, _ as default };
114
+ export { v as AnswerGrid, v as default };