@pie-element/matrix 4.1.1 → 4.1.2-next.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.
Files changed (117) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/HeaderCommon.d.ts +12 -0
  4. package/dist/author/HeaderCommon.js +20 -0
  5. package/dist/author/Main.d.ts +27 -0
  6. package/dist/author/Main.js +134 -0
  7. package/dist/author/MatrixColumnsSizeHeaderInput.d.ts +21 -0
  8. package/dist/author/MatrixColumnsSizeHeaderInput.js +39 -0
  9. package/dist/author/MatrixLabelEditableButton.d.ts +27 -0
  10. package/dist/author/MatrixLabelEditableButton.js +191 -0
  11. package/dist/author/MatrixLabelTypeHeaderInput.d.ts +21 -0
  12. package/dist/author/MatrixLabelTypeHeaderInput.js +96 -0
  13. package/dist/author/MatrixRowsSizeHeaderInput.d.ts +21 -0
  14. package/dist/author/MatrixRowsSizeHeaderInput.js +39 -0
  15. package/dist/author/MatrixValues.d.ts +29 -0
  16. package/dist/author/MatrixValues.js +156 -0
  17. package/dist/author/NumberInput.d.ts +20 -0
  18. package/dist/author/NumberInput.js +61 -0
  19. package/dist/author/columnLabelsGenerator.d.ts +11 -0
  20. package/dist/author/columnLabelsGenerator.js +101 -0
  21. package/dist/author/defaults.d.ts +88 -0
  22. package/dist/author/defaults.js +56 -0
  23. package/dist/author/index.d.ts +31 -0
  24. package/dist/author/index.js +66 -0
  25. package/dist/author/isNumeric.d.ts +10 -0
  26. package/dist/author/isNumeric.js +4 -0
  27. package/dist/author/matrixEntities.d.ts +17 -0
  28. package/dist/author/matrixEntities.js +12 -0
  29. package/dist/browser/Radio-DJhIYuTn.js +10138 -0
  30. package/dist/browser/Radio-DJhIYuTn.js.map +1 -0
  31. package/dist/browser/author/index.js +39771 -0
  32. package/dist/browser/author/index.js.map +1 -0
  33. package/dist/browser/controller/index.js +60 -0
  34. package/dist/browser/controller/index.js.map +1 -0
  35. package/dist/browser/delivery/index.js +205 -0
  36. package/dist/browser/delivery/index.js.map +1 -0
  37. package/dist/browser/dist-DHz-aOnW.js +92 -0
  38. package/dist/browser/dist-DHz-aOnW.js.map +1 -0
  39. package/dist/browser/matrix.css +2 -0
  40. package/dist/controller/defaults.d.ts +19 -0
  41. package/dist/controller/defaults.js +17 -0
  42. package/dist/controller/index.d.ts +19 -0
  43. package/dist/controller/index.js +46 -0
  44. package/dist/delivery/ChoiceInput.d.ts +25 -0
  45. package/dist/delivery/ChoiceInput.js +36 -0
  46. package/dist/delivery/Main.d.ts +23 -0
  47. package/dist/delivery/Main.js +37 -0
  48. package/dist/delivery/Matrix.d.ts +29 -0
  49. package/dist/delivery/Matrix.js +81 -0
  50. package/dist/delivery/index.d.ts +22 -0
  51. package/dist/delivery/index.js +45 -0
  52. package/dist/delivery/session-updater.d.ts +9 -0
  53. package/dist/index.d.ts +1 -0
  54. package/dist/index.iife.d.ts +8 -0
  55. package/dist/index.iife.js +164 -0
  56. package/dist/index.js +2 -0
  57. package/dist/runtime-support.d.ts +12 -0
  58. package/dist/runtime-support.js +12 -0
  59. package/package.json +84 -19
  60. package/CHANGELOG.json +0 -1
  61. package/CHANGELOG.md +0 -1409
  62. package/LICENSE.md +0 -5
  63. package/README.md +0 -59
  64. package/configure/CHANGELOG.json +0 -1
  65. package/configure/CHANGELOG.md +0 -1335
  66. package/configure/lib/HeaderCommon.js +0 -28
  67. package/configure/lib/HeaderCommon.js.map +0 -1
  68. package/configure/lib/Main.js +0 -179
  69. package/configure/lib/Main.js.map +0 -1
  70. package/configure/lib/MatrixColumnsSizeHeaderInput.js +0 -56
  71. package/configure/lib/MatrixColumnsSizeHeaderInput.js.map +0 -1
  72. package/configure/lib/MatrixLabelEditableButton.js +0 -224
  73. package/configure/lib/MatrixLabelEditableButton.js.map +0 -1
  74. package/configure/lib/MatrixLabelTypeHeaderInput.js +0 -98
  75. package/configure/lib/MatrixLabelTypeHeaderInput.js.map +0 -1
  76. package/configure/lib/MatrixRowsSizeHeaderInput.js +0 -56
  77. package/configure/lib/MatrixRowsSizeHeaderInput.js.map +0 -1
  78. package/configure/lib/MatrixValues.js +0 -217
  79. package/configure/lib/MatrixValues.js.map +0 -1
  80. package/configure/lib/NumberInput.js +0 -77
  81. package/configure/lib/NumberInput.js.map +0 -1
  82. package/configure/lib/columnLabelsGenerator.js +0 -49
  83. package/configure/lib/columnLabelsGenerator.js.map +0 -1
  84. package/configure/lib/defaults.js +0 -86
  85. package/configure/lib/defaults.js.map +0 -1
  86. package/configure/lib/index.js +0 -98
  87. package/configure/lib/index.js.map +0 -1
  88. package/configure/lib/isNumeric.js +0 -11
  89. package/configure/lib/isNumeric.js.map +0 -1
  90. package/configure/lib/matrixEntities.js +0 -16
  91. package/configure/lib/matrixEntities.js.map +0 -1
  92. package/configure/package.json +0 -28
  93. package/controller/CHANGELOG.json +0 -1
  94. package/controller/CHANGELOG.md +0 -88
  95. package/controller/lib/defaults.js +0 -17
  96. package/controller/lib/defaults.js.map +0 -1
  97. package/controller/lib/index.js +0 -96
  98. package/controller/lib/index.js.map +0 -1
  99. package/controller/package.json +0 -17
  100. package/docs/config-schema.json +0 -1475
  101. package/docs/config-schema.json.md +0 -1093
  102. package/docs/demo/config.js +0 -8
  103. package/docs/demo/generate.js +0 -9
  104. package/docs/demo/index.html +0 -1
  105. package/docs/demo/session.js +0 -6
  106. package/docs/pie-schema.json +0 -1
  107. package/docs/pie-schema.json.md +0 -1
  108. package/lib/ChoiceInput.js +0 -59
  109. package/lib/ChoiceInput.js.map +0 -1
  110. package/lib/Main.js +0 -42
  111. package/lib/Main.js.map +0 -1
  112. package/lib/Matrix.js +0 -104
  113. package/lib/Matrix.js.map +0 -1
  114. package/lib/index.js +0 -80
  115. package/lib/index.js.map +0 -1
  116. package/lib/session-updater.js +0 -10
  117. package/lib/session-updater.js.map +0 -1
package/configure.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './dist/author/index.js';
2
+ export * from './dist/author/index.js';
package/controller.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/controller/index.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/configure/src/HeaderCommon.js
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
+ export declare const ColumnsWrapper: any;
10
+ export declare const ColumnsHeader: any;
11
+ export declare const NumberInputFormGroupWrapper: any;
12
+ export declare const IconWrapper: any;
@@ -0,0 +1,20 @@
1
+ import e from "styled-components";
2
+ //#region src/author/HeaderCommon.ts
3
+ var t = e.div`
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ `, n = e.p`
8
+ margin: 10px 0;
9
+ color: #c3c3c3;
10
+ font-size: 12px;
11
+ `, r = e.div`
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ width: 110px;
16
+ `, i = e.div`
17
+ cursor: pointer;
18
+ `;
19
+ //#endregion
20
+ export { n as ColumnsHeader, t as ColumnsWrapper, i as IconWrapper, r as NumberInputFormGroupWrapper };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/matrix/configure/src/Main.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 class Main extends React.Component {
12
+ static propTypes: {
13
+ model: PropTypes.Validator<object>;
14
+ disableSidePanel: PropTypes.Requireable<boolean>;
15
+ onModelChanged: PropTypes.Validator<(...args: any[]) => any>;
16
+ onConfigurationChanged: PropTypes.Validator<(...args: any[]) => any>;
17
+ imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
18
+ add: PropTypes.Validator<(...args: any[]) => any>;
19
+ delete: PropTypes.Validator<(...args: any[]) => any>;
20
+ }>>;
21
+ };
22
+ onPromptChanged: any;
23
+ onChangeModel: any;
24
+ onTeacherInstructionsChanged: any;
25
+ render(): React.JSX.Element;
26
+ }
27
+ export default Main;
@@ -0,0 +1,134 @@
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 };
@@ -0,0 +1,21 @@
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;
@@ -0,0 +1,39 @@
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 };
@@ -0,0 +1,27 @@
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;
@@ -0,0 +1,191 @@
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 };
@@ -0,0 +1,21 @@
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;
@@ -0,0 +1,96 @@
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 };
@@ -0,0 +1,21 @@
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;
@@ -0,0 +1,39 @@
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 };