@pie-element/matrix 4.1.2-next.1 → 4.1.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.
Files changed (117) hide show
  1. package/CHANGELOG.json +1 -0
  2. package/CHANGELOG.md +1415 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +59 -0
  5. package/configure/CHANGELOG.json +1 -0
  6. package/configure/CHANGELOG.md +1341 -0
  7. package/configure/lib/HeaderCommon.js +28 -0
  8. package/configure/lib/HeaderCommon.js.map +1 -0
  9. package/configure/lib/Main.js +179 -0
  10. package/configure/lib/Main.js.map +1 -0
  11. package/configure/lib/MatrixColumnsSizeHeaderInput.js +56 -0
  12. package/configure/lib/MatrixColumnsSizeHeaderInput.js.map +1 -0
  13. package/configure/lib/MatrixLabelEditableButton.js +224 -0
  14. package/configure/lib/MatrixLabelEditableButton.js.map +1 -0
  15. package/configure/lib/MatrixLabelTypeHeaderInput.js +98 -0
  16. package/configure/lib/MatrixLabelTypeHeaderInput.js.map +1 -0
  17. package/configure/lib/MatrixRowsSizeHeaderInput.js +56 -0
  18. package/configure/lib/MatrixRowsSizeHeaderInput.js.map +1 -0
  19. package/configure/lib/MatrixValues.js +217 -0
  20. package/configure/lib/MatrixValues.js.map +1 -0
  21. package/configure/lib/NumberInput.js +77 -0
  22. package/configure/lib/NumberInput.js.map +1 -0
  23. package/configure/lib/columnLabelsGenerator.js +49 -0
  24. package/configure/lib/columnLabelsGenerator.js.map +1 -0
  25. package/configure/lib/defaults.js +86 -0
  26. package/configure/lib/defaults.js.map +1 -0
  27. package/configure/lib/index.js +98 -0
  28. package/configure/lib/index.js.map +1 -0
  29. package/configure/lib/isNumeric.js +11 -0
  30. package/configure/lib/isNumeric.js.map +1 -0
  31. package/configure/lib/matrixEntities.js +16 -0
  32. package/configure/lib/matrixEntities.js.map +1 -0
  33. package/configure/package.json +28 -0
  34. package/controller/CHANGELOG.json +1 -0
  35. package/controller/CHANGELOG.md +88 -0
  36. package/controller/lib/defaults.js +17 -0
  37. package/controller/lib/defaults.js.map +1 -0
  38. package/controller/lib/index.js +96 -0
  39. package/controller/lib/index.js.map +1 -0
  40. package/controller/package.json +17 -0
  41. package/docs/config-schema.json +1475 -0
  42. package/docs/config-schema.json.md +1093 -0
  43. package/docs/demo/config.js +8 -0
  44. package/docs/demo/generate.js +9 -0
  45. package/docs/demo/index.html +1 -0
  46. package/docs/demo/session.js +6 -0
  47. package/docs/pie-schema.json +1 -0
  48. package/docs/pie-schema.json.md +1 -0
  49. package/lib/ChoiceInput.js +59 -0
  50. package/lib/ChoiceInput.js.map +1 -0
  51. package/lib/Main.js +42 -0
  52. package/lib/Main.js.map +1 -0
  53. package/lib/Matrix.js +104 -0
  54. package/lib/Matrix.js.map +1 -0
  55. package/lib/index.js +80 -0
  56. package/lib/index.js.map +1 -0
  57. package/lib/session-updater.js +10 -0
  58. package/lib/session-updater.js.map +1 -0
  59. package/package.json +19 -84
  60. package/configure.js +0 -2
  61. package/controller.js +0 -1
  62. package/dist/author/HeaderCommon.d.ts +0 -12
  63. package/dist/author/HeaderCommon.js +0 -20
  64. package/dist/author/Main.d.ts +0 -27
  65. package/dist/author/Main.js +0 -134
  66. package/dist/author/MatrixColumnsSizeHeaderInput.d.ts +0 -21
  67. package/dist/author/MatrixColumnsSizeHeaderInput.js +0 -39
  68. package/dist/author/MatrixLabelEditableButton.d.ts +0 -27
  69. package/dist/author/MatrixLabelEditableButton.js +0 -191
  70. package/dist/author/MatrixLabelTypeHeaderInput.d.ts +0 -21
  71. package/dist/author/MatrixLabelTypeHeaderInput.js +0 -96
  72. package/dist/author/MatrixRowsSizeHeaderInput.d.ts +0 -21
  73. package/dist/author/MatrixRowsSizeHeaderInput.js +0 -39
  74. package/dist/author/MatrixValues.d.ts +0 -29
  75. package/dist/author/MatrixValues.js +0 -156
  76. package/dist/author/NumberInput.d.ts +0 -20
  77. package/dist/author/NumberInput.js +0 -61
  78. package/dist/author/columnLabelsGenerator.d.ts +0 -11
  79. package/dist/author/columnLabelsGenerator.js +0 -101
  80. package/dist/author/defaults.d.ts +0 -88
  81. package/dist/author/defaults.js +0 -56
  82. package/dist/author/index.d.ts +0 -31
  83. package/dist/author/index.js +0 -66
  84. package/dist/author/isNumeric.d.ts +0 -10
  85. package/dist/author/isNumeric.js +0 -4
  86. package/dist/author/matrixEntities.d.ts +0 -17
  87. package/dist/author/matrixEntities.js +0 -12
  88. package/dist/browser/Radio-DJhIYuTn.js +0 -10138
  89. package/dist/browser/Radio-DJhIYuTn.js.map +0 -1
  90. package/dist/browser/author/index.js +0 -39771
  91. package/dist/browser/author/index.js.map +0 -1
  92. package/dist/browser/controller/index.js +0 -60
  93. package/dist/browser/controller/index.js.map +0 -1
  94. package/dist/browser/delivery/index.js +0 -205
  95. package/dist/browser/delivery/index.js.map +0 -1
  96. package/dist/browser/dist-DHz-aOnW.js +0 -92
  97. package/dist/browser/dist-DHz-aOnW.js.map +0 -1
  98. package/dist/browser/matrix.css +0 -2
  99. package/dist/controller/defaults.d.ts +0 -19
  100. package/dist/controller/defaults.js +0 -17
  101. package/dist/controller/index.d.ts +0 -19
  102. package/dist/controller/index.js +0 -46
  103. package/dist/delivery/ChoiceInput.d.ts +0 -25
  104. package/dist/delivery/ChoiceInput.js +0 -36
  105. package/dist/delivery/Main.d.ts +0 -23
  106. package/dist/delivery/Main.js +0 -37
  107. package/dist/delivery/Matrix.d.ts +0 -29
  108. package/dist/delivery/Matrix.js +0 -81
  109. package/dist/delivery/index.d.ts +0 -22
  110. package/dist/delivery/index.js +0 -45
  111. package/dist/delivery/session-updater.d.ts +0 -9
  112. package/dist/index.d.ts +0 -1
  113. package/dist/index.iife.d.ts +0 -8
  114. package/dist/index.iife.js +0 -164
  115. package/dist/index.js +0 -2
  116. package/dist/runtime-support.d.ts +0 -12
  117. package/dist/runtime-support.js +0 -12
@@ -1,134 +0,0 @@
1
- import e from "./MatrixColumnsSizeHeaderInput.js";
2
- import t from "./MatrixRowsSizeHeaderInput.js";
3
- import n from "./MatrixLabelTypeHeaderInput.js";
4
- import r from "./MatrixValues.js";
5
- import i from "react";
6
- import a from "prop-types";
7
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
- import { styled as c } from "@mui/material/styles";
9
- import l from "@pie-lib/editable-html-tip-tap";
10
- import { InputContainer as u, layout as d, settings as f } from "@pie-lib/config-ui";
11
- //#region src/author/Main.tsx
12
- var { Panel: p, toggle: m, radio: h } = f, g = c(u)(({ theme: e }) => ({
13
- width: "100%",
14
- paddingTop: e.spacing(1),
15
- marginTop: e.spacing(2),
16
- marginBottom: e.spacing(2)
17
- })), _ = c("div")(({ theme: e }) => ({
18
- display: "flex",
19
- flexWrap: "wrap",
20
- width: "100%",
21
- paddingBottom: e.spacing(2.5),
22
- justifyContent: "space-around"
23
- })), v = c("div")(({ theme: e }) => ({
24
- fontSize: e.typography.fontSize - 2,
25
- color: e.palette.error.main,
26
- paddingTop: e.spacing(1)
27
- })), y = (i) => {
28
- let { model: a, configuration: c, onPromptChanged: u, imageSupport: f, uploadSoundSupport: y, onChangeModel: b, onConfigurationChanged: x, onTeacherInstructionsChanged: S } = i, { baseInputConfiguration: C = {}, contentDimensions: w = {}, prompt: T = {}, scoringType: E = {}, settingsPanelDisabled: D, spellCheck: O = {}, teacherInstructions: k = {} } = c || {}, { errors: A = {}, extraCSSRules: j, teacherInstructionsEnabled: M, spellCheckEnabled: N } = a || {}, { prompt: P, teacherInstructions: F } = A, I = {
29
- teacherInstructionsEnabled: k.settings && m(k.label),
30
- spellCheckEnabled: O.settings && m(O.label),
31
- scoringType: E.settings && h(E.label, ["auto", "rubric"])
32
- }, L = (e = {}) => ({
33
- ...C,
34
- ...e
35
- });
36
- return /* @__PURE__ */ s(d.ConfigLayout, {
37
- extraCSSRules: j,
38
- dimensions: w,
39
- hideSettings: D,
40
- settings: /* @__PURE__ */ o(p, {
41
- model: a,
42
- onChangeModel: b,
43
- configuration: c,
44
- onChangeConfiguration: x,
45
- groups: { Properties: I }
46
- }),
47
- children: [
48
- M && /* @__PURE__ */ s(g, {
49
- label: k.label,
50
- children: [/* @__PURE__ */ o(l, {
51
- markup: a.teacherInstructions || "",
52
- onChange: S,
53
- imageSupport: f,
54
- error: F,
55
- pluginProps: L(k?.inputConfiguration),
56
- nonEmpty: !1,
57
- spellCheck: N,
58
- uploadSoundSupport: y
59
- }), F && /* @__PURE__ */ o(v, { children: F })]
60
- }),
61
- /* @__PURE__ */ s(g, {
62
- label: T.label,
63
- children: [/* @__PURE__ */ o(l, {
64
- markup: a.prompt,
65
- onChange: u,
66
- imageSupport: f,
67
- error: P,
68
- pluginProps: L(T?.inputConfiguration),
69
- nonEmpty: !T.settings,
70
- spellCheck: N,
71
- uploadSoundSupport: y,
72
- disableUnderline: !0
73
- }), P && /* @__PURE__ */ o(v, { children: P })]
74
- }),
75
- /* @__PURE__ */ s(_, { children: [
76
- /* @__PURE__ */ o(t, {
77
- model: a,
78
- onChangeModel: b
79
- }),
80
- /* @__PURE__ */ o(e, {
81
- model: a,
82
- onChangeModel: b
83
- }),
84
- /* @__PURE__ */ o(n, {
85
- model: a,
86
- onChangeModel: b
87
- })
88
- ] }),
89
- /* @__PURE__ */ o(r, {
90
- model: a,
91
- onChangeModel: b
92
- })
93
- ]
94
- });
95
- }, b = class extends i.Component {
96
- static propTypes = {
97
- model: a.object.isRequired,
98
- disableSidePanel: a.bool,
99
- onModelChanged: a.func.isRequired,
100
- onConfigurationChanged: a.func.isRequired,
101
- imageSupport: a.shape({
102
- add: a.func.isRequired,
103
- delete: a.func.isRequired
104
- })
105
- };
106
- onPromptChanged = (e) => {
107
- this.props.onModelChanged({
108
- ...this.props.model,
109
- prompt: e
110
- });
111
- };
112
- onChangeModel = (e) => {
113
- this.props.onModelChanged({
114
- ...this.props.model,
115
- ...e
116
- });
117
- };
118
- onTeacherInstructionsChanged = (e) => {
119
- this.props.onModelChanged({
120
- ...this.props.model,
121
- teacherInstructions: e
122
- });
123
- };
124
- render() {
125
- return /* @__PURE__ */ o(y, {
126
- ...this.props,
127
- onChangeModel: this.props.onModelChanged,
128
- onPromptChanged: this.onPromptChanged,
129
- onTeacherInstructionsChanged: this.onTeacherInstructionsChanged
130
- });
131
- }
132
- };
133
- //#endregion
134
- export { b as default };
@@ -1,21 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/matrix/configure/src/MatrixColumnsSizeHeaderInput.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- declare const MatrixColumnsSizeHeaderInput: {
12
- ({ model, onChangeModel }: {
13
- model: any;
14
- onChangeModel: any;
15
- }): React.JSX.Element;
16
- propTypes: {
17
- model: PropTypes.Validator<object>;
18
- onChangeModel: PropTypes.Validator<(...args: any[]) => any>;
19
- };
20
- };
21
- export default MatrixColumnsSizeHeaderInput;
@@ -1,39 +0,0 @@
1
- import { ColumnsHeader as e, ColumnsWrapper as t, IconWrapper as n, NumberInputFormGroupWrapper as r } from "./HeaderCommon.js";
2
- import { MATRIX_LABEL_TYPE as i } from "./matrixEntities.js";
3
- import "react";
4
- import a from "prop-types";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import c from "@mui/icons-material/Add";
7
- import l from "@mui/icons-material/Remove";
8
- //#region src/author/MatrixColumnsSizeHeaderInput.tsx
9
- var u = ({ model: a, onChangeModel: u }) => /* @__PURE__ */ s(t, { children: [/* @__PURE__ */ o(e, { children: "Matrix Columns" }), /* @__PURE__ */ s(r, { children: [
10
- /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(l, { onClick: () => {
11
- let e = a.columnLabels.length;
12
- if (e <= 1) return;
13
- let t = [...a.columnLabels];
14
- t.pop();
15
- let n = { ...a.matrixValues };
16
- a.rowLabels.forEach((t, r) => {
17
- delete n[`${r}-${e - 1}`];
18
- }), u({
19
- ...a,
20
- columnLabels: t,
21
- matrixValues: n,
22
- labelType: i.custom
23
- });
24
- } }) }),
25
- /* @__PURE__ */ o("p", { children: a.columnLabels.length }),
26
- /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(c, { onClick: () => {
27
- u({
28
- ...a,
29
- columnLabels: [...a.columnLabels, `COLUMN ${a.columnLabels.length + 1}`],
30
- labelType: i.custom
31
- });
32
- } }) })
33
- ] })] });
34
- u.propTypes = {
35
- model: a.object.isRequired,
36
- onChangeModel: a.func.isRequired
37
- };
38
- //#endregion
39
- export { u as default };
@@ -1,27 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/matrix/configure/src/MatrixLabelEditableButton.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- export declare const ACTION_TYPE: {
12
- clear: string;
13
- sortAscending: string;
14
- sortDescending: string;
15
- set: string;
16
- };
17
- declare const MatrixLabelEditableButton: {
18
- (props: any): React.JSX.Element;
19
- propTypes: {
20
- value: PropTypes.Validator<string>;
21
- resourceIndex: PropTypes.Validator<number>;
22
- onLabelUpdate: PropTypes.Validator<(...args: any[]) => any>;
23
- onAction: PropTypes.Validator<(...args: any[]) => any>;
24
- spellCheck: PropTypes.Requireable<boolean>;
25
- };
26
- };
27
- export default MatrixLabelEditableButton;
@@ -1,191 +0,0 @@
1
- import e from "./NumberInput.js";
2
- import t from "./isNumeric.js";
3
- import n, { useState as r } from "react";
4
- import i from "prop-types";
5
- import * as a from "@pie-lib/render-ui";
6
- import { InlineMenu as o } from "@pie-lib/render-ui";
7
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import l from "styled-components";
9
- import u from "@mui/icons-material/KeyboardArrowDown";
10
- import d from "@mui/material/MenuItem";
11
- //#region src/author/MatrixLabelEditableButton.tsx
12
- function f(e) {
13
- return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
14
- }
15
- function p(e, t) {
16
- return !e || f(e) ? e : f(e.default) ? e.default : t && f(e[t]) ? e[t] : t && f(e[t]?.default) ? e[t].default : e;
17
- }
18
- var m = p(o, "InlineMenu") || p(_.InlineMenu, "InlineMenu"), h = a, g = h.default, _ = g && typeof g == "object" ? g : h, v = l.div`
19
- width: 100%;
20
- height: 50px;
21
- margin: 1px;
22
- background: #04b26e;
23
- border-radius: 5px;
24
- color: white;
25
- font-size: 14px;
26
- white-space: nowrap;
27
- display: flex;
28
- align-items: center;
29
- justify-content: space-between;
30
- `, y = l.div`
31
- padding: 0 5px 0 12px;
32
- width: 100%;
33
- display: flex;
34
- align-items: center;
35
- overflow: hidden;
36
- `, b = l.p`
37
- margin: 0;
38
- padding: 3px 0 3px 4px;
39
- cursor: pointer;
40
- width: 100%;
41
-
42
- white-space: nowrap;
43
- overflow: hidden;
44
- text-overflow: ellipsis;
45
-
46
- :hover {
47
- background: #00985d;
48
- }
49
-
50
- transition: all 0.1s ease-in-out;
51
- `, x = l.div`
52
- padding: 0 3px;
53
- height: 100%;
54
- cursor: pointer;
55
- display: flex;
56
- align-items: center;
57
- border-left: 3px solid #00985d;
58
- :hover {
59
- background: #00985d;
60
- border-top-right-radius: 5px;
61
- border-bottom-right-radius: 5px;
62
- }
63
- transition: all 0.1s ease-in-out;
64
- `, S = l.div`
65
- font-size: 18px;
66
- `, C = l.input`
67
- margin: 0;
68
- padding: 0 0 0 4px;
69
- font-size: 14px;
70
- border: none;
71
- outline: none;
72
- color: white;
73
- width: 50px;
74
- width: 100%;
75
- background: #00985d;
76
- height: 22px;
77
- display: flex;
78
- align-items: center;
79
- `, w = l.div`
80
- display: flex;
81
- align-items: center;
82
- `, T = l.div`
83
- width: 50px;
84
- margin-left: 10px;
85
- `, E = {
86
- clear: "clear",
87
- sortAscending: "sortAscending",
88
- sortDescending: "sortDescending",
89
- set: "set"
90
- }, D = (i) => {
91
- let { onLabelUpdate: a, value: o, resourceIndex: l, onAction: f, spellCheck: p } = i, [h, g] = r(null), [_, D] = r(""), [O, k] = r(!1), [A, j] = n.useState(null), [M] = n.useState(n.createRef()), N = !!A, P = (e) => {
92
- j(e.currentTarget);
93
- }, F = (e) => {
94
- e.stopPropagation(), j(null), D("");
95
- };
96
- return /* @__PURE__ */ c(v, { children: [/* @__PURE__ */ s(y, { children: O ? /* @__PURE__ */ s(C, {
97
- autoFocus: !0,
98
- value: h,
99
- onChange: (e) => g(e.target.value),
100
- onBlur: () => {
101
- let e = h.trim();
102
- e && a(e), g(null), k(!1);
103
- },
104
- spellCheck: p
105
- }) : /* @__PURE__ */ s(b, {
106
- onClick: () => {
107
- k(!0), g(o);
108
- },
109
- children: o
110
- }) }), /* @__PURE__ */ c(x, {
111
- onClick: P,
112
- children: [/* @__PURE__ */ s(S, { children: /* @__PURE__ */ s(u, { fontSize: "inherit" }) }), /* @__PURE__ */ c(m, {
113
- anchorEl: A,
114
- open: N,
115
- onClose: F,
116
- transitionDuration: {
117
- enter: 225,
118
- exit: 195
119
- },
120
- children: [
121
- /* @__PURE__ */ s(d, {
122
- selected: !1,
123
- onClick: (e) => {
124
- F(e), f({
125
- resourceIndex: l,
126
- actionType: E.clear
127
- });
128
- },
129
- children: "Clear Scores"
130
- }, "item1"),
131
- /* @__PURE__ */ s(d, {
132
- selected: !1,
133
- onClick: (e) => {
134
- F(e), f({
135
- resourceIndex: l,
136
- actionType: E.sortAscending
137
- });
138
- },
139
- children: "Set Scores Ascending"
140
- }, "item2"),
141
- /* @__PURE__ */ s(d, {
142
- selected: !1,
143
- onClick: (e) => {
144
- F(e), f({
145
- resourceIndex: l,
146
- actionType: E.sortDescending
147
- });
148
- },
149
- children: "Set Scores Descending"
150
- }, "item3"),
151
- /* @__PURE__ */ s(d, {
152
- selected: !1,
153
- children: /* @__PURE__ */ c(w, { children: [/* @__PURE__ */ s("p", {
154
- onClick: () => {
155
- M.current.focus();
156
- },
157
- children: "Set Scores To"
158
- }), /* @__PURE__ */ s(T, { children: /* @__PURE__ */ s(e, {
159
- onFieldUpdate: (e) => {
160
- if (!t(e)) {
161
- D("");
162
- return;
163
- }
164
- let n = parseInt(e, 10);
165
- D(n), f({
166
- resourceIndex: l,
167
- actionType: E.set,
168
- setValue: n
169
- });
170
- },
171
- name: "setScoreTo",
172
- placeholder: "#",
173
- fieldValue: {
174
- value: _,
175
- ref: M
176
- }
177
- }) })] })
178
- }, "item4")
179
- ]
180
- })]
181
- })] });
182
- };
183
- D.propTypes = {
184
- value: i.string.isRequired,
185
- resourceIndex: i.number.isRequired,
186
- onLabelUpdate: i.func.isRequired,
187
- onAction: i.func.isRequired,
188
- spellCheck: i.bool
189
- };
190
- //#endregion
191
- export { E as ACTION_TYPE, D as default };
@@ -1,21 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/matrix/configure/src/MatrixLabelTypeHeaderInput.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- declare const MatrixLabelTypeHeaderInput: {
12
- ({ model, onChangeModel }: {
13
- model: any;
14
- onChangeModel: any;
15
- }): React.JSX.Element;
16
- propTypes: {
17
- model: PropTypes.Validator<object>;
18
- onChangeModel: PropTypes.Validator<(...args: any[]) => any>;
19
- };
20
- };
21
- export default MatrixLabelTypeHeaderInput;
@@ -1,96 +0,0 @@
1
- import { ColumnsHeader as e, ColumnsWrapper as t } from "./HeaderCommon.js";
2
- import { MATRIX_LABEL_TYPE as n } from "./matrixEntities.js";
3
- import r from "./columnLabelsGenerator.js";
4
- import "react";
5
- import i from "prop-types";
6
- import { color as a } from "@pie-lib/render-ui";
7
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
- import { styled as c } from "@mui/material/styles";
9
- import l from "@mui/material/Radio";
10
- import u from "@mui/material/RadioGroup";
11
- import d from "@mui/material/FormControlLabel";
12
- //#region src/author/MatrixLabelTypeHeaderInput.tsx
13
- var f = c("div")({ display: "flex" }), p = c(l)({ "&.MuiRadio-root": { color: `${a.tertiary()} !important` } }), m = ({ model: i, onChangeModel: a }) => {
14
- let c = (e) => {
15
- let t = e.target.value, o = {
16
- ...i,
17
- labelType: t
18
- };
19
- t !== n.custom && (o.columnLabels = r(t, i.columnLabels.length)), a(o);
20
- }, l = [
21
- 3,
22
- 5,
23
- 7
24
- ].includes(i.columnLabels.length);
25
- return /* @__PURE__ */ s(t, { children: [/* @__PURE__ */ o(e, { children: "Matrix Type" }), /* @__PURE__ */ s(f, { children: [
26
- /* @__PURE__ */ s(u, {
27
- "aria-label": "matrixLabelType",
28
- name: "matrixLabelType",
29
- value: i.labelType,
30
- onChange: c,
31
- children: [
32
- /* @__PURE__ */ o(d, {
33
- disabled: !l,
34
- value: n.agreement,
35
- control: /* @__PURE__ */ o(p, {}),
36
- label: "Agreement"
37
- }),
38
- /* @__PURE__ */ o(d, {
39
- disabled: !l,
40
- value: n.frequency,
41
- control: /* @__PURE__ */ o(p, {}),
42
- label: "Frequency"
43
- }),
44
- /* @__PURE__ */ o(d, {
45
- disabled: !l,
46
- value: n.yesNo,
47
- control: /* @__PURE__ */ o(p, {}),
48
- label: "Yes/No"
49
- })
50
- ]
51
- }),
52
- /* @__PURE__ */ s(u, {
53
- "aria-label": "matrixLabelType",
54
- name: "matrixLabelType",
55
- value: i.labelType,
56
- onChange: c,
57
- children: [
58
- /* @__PURE__ */ o(d, {
59
- disabled: !l,
60
- value: n.importance,
61
- control: /* @__PURE__ */ o(p, {}),
62
- label: "Importance"
63
- }),
64
- /* @__PURE__ */ o(d, {
65
- disabled: !l,
66
- value: n.likelihood,
67
- control: /* @__PURE__ */ o(p, {}),
68
- label: "Likelihood"
69
- }),
70
- /* @__PURE__ */ o(d, {
71
- disabled: !l,
72
- value: n.like,
73
- control: /* @__PURE__ */ o(p, {}),
74
- label: "Like"
75
- })
76
- ]
77
- }),
78
- /* @__PURE__ */ o(u, {
79
- "aria-label": "matrixLabelType",
80
- name: "matrixLabelType",
81
- value: i.labelType,
82
- onChange: c,
83
- children: /* @__PURE__ */ o(d, {
84
- value: n.custom,
85
- control: /* @__PURE__ */ o(p, {}),
86
- label: "Custom"
87
- })
88
- })
89
- ] })] });
90
- };
91
- m.propTypes = {
92
- model: i.object.isRequired,
93
- onChangeModel: i.func.isRequired
94
- };
95
- //#endregion
96
- export { m as default };
@@ -1,21 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/matrix/configure/src/MatrixRowsSizeHeaderInput.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- declare const MatrixColumnsRowInput: {
12
- ({ model, onChangeModel }: {
13
- model: any;
14
- onChangeModel: any;
15
- }): React.JSX.Element;
16
- propTypes: {
17
- model: PropTypes.Validator<object>;
18
- onChangeModel: PropTypes.Validator<(...args: any[]) => any>;
19
- };
20
- };
21
- export default MatrixColumnsRowInput;
@@ -1,39 +0,0 @@
1
- import { ColumnsHeader as e, ColumnsWrapper as t, IconWrapper as n, NumberInputFormGroupWrapper as r } from "./HeaderCommon.js";
2
- import { MATRIX_LABEL_TYPE as i } from "./matrixEntities.js";
3
- import "react";
4
- import a from "prop-types";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import c from "@mui/icons-material/Add";
7
- import l from "@mui/icons-material/Remove";
8
- //#region src/author/MatrixRowsSizeHeaderInput.tsx
9
- var u = ({ model: a, onChangeModel: u }) => /* @__PURE__ */ s(t, { children: [/* @__PURE__ */ o(e, { children: "Matrix Rows" }), /* @__PURE__ */ s(r, { children: [
10
- /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(l, { onClick: () => {
11
- let e = a.rowLabels.length;
12
- if (e <= 1) return;
13
- let t = [...a.rowLabels];
14
- t.pop();
15
- let n = { ...a.matrixValues };
16
- a.columnLabels.forEach((t, r) => {
17
- delete n[`${e - 1}-${r}`];
18
- }), u({
19
- ...a,
20
- rowLabels: t,
21
- matrixValues: n,
22
- labelType: i.custom
23
- });
24
- } }) }),
25
- /* @__PURE__ */ o("p", { children: a.rowLabels.length }),
26
- /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(c, { onClick: () => {
27
- u({
28
- ...a,
29
- rowLabels: [...a.rowLabels, `STATEMENT ${a.rowLabels.length + 1}`],
30
- labelType: i.custom
31
- });
32
- } }) })
33
- ] })] });
34
- u.propTypes = {
35
- model: a.object.isRequired,
36
- onChangeModel: a.func.isRequired
37
- };
38
- //#endregion
39
- export { u as default };
@@ -1,29 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/matrix/configure/src/MatrixValues.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- export declare const ScoringContainer: any;
12
- export declare const MatrixColumns: any;
13
- export declare const ColumnLabelWrapper: any;
14
- export declare const RowLabelWrapper: any;
15
- export declare const ValueRowWrapper: any;
16
- export declare const ValueItemWrapper: any;
17
- export declare const ScoringRows: any;
18
- export declare const ScoringNumberInputWrapper: any;
19
- export declare const GridSeparatorHorizontal: any;
20
- export declare const GridSeparatorVertical: any;
21
- export declare const Content: any;
22
- declare const MatrixValues: {
23
- (props: any): React.JSX.Element;
24
- propTypes: {
25
- model: PropTypes.Validator<object>;
26
- onChangeModel: PropTypes.Validator<(...args: any[]) => any>;
27
- };
28
- };
29
- export default MatrixValues;