@pie-element/complex-rubric 7.2.2-beta.6 → 7.2.2-beta.8
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/CHANGELOG.md +8 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/lib/defaults.js +271 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +151 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +172 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/package.json +5 -5
- package/controller/CHANGELOG.md +8 -0
- package/controller/lib/defaults.js +42 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +239 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +11 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +1 -1
- package/lib/index.js +141 -0
- package/lib/index.js.map +1 -0
- package/lib/print.js +129 -0
- package/lib/print.js.map +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.2.2-beta.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@7.2.2-beta.7...@pie-element/complex-rubric@7.2.2-beta.8) (2026-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/complex-rubric
|
|
9
|
+
|
|
10
|
+
## [7.2.2-beta.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@7.2.2-beta.6...@pie-element/complex-rubric@7.2.2-beta.7) (2026-09-24)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @pie-element/complex-rubric
|
|
13
|
+
|
|
6
14
|
## [7.2.2-beta.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@7.2.2-beta.5...@pie-element/complex-rubric@7.2.2-beta.6) (2026-09-24)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/complex-rubric
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.4.0-beta.14](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@5.4.0-beta.13...@pie-element/complex-rubric-configure@5.4.0-beta.14) (2026-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
|
9
|
+
|
|
10
|
+
# [5.4.0-beta.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@5.4.0-beta.12...@pie-element/complex-rubric-configure@5.4.0-beta.13) (2026-09-24)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
|
13
|
+
|
|
6
14
|
# [5.4.0-beta.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@5.4.0-beta.11...@pie-element/complex-rubric-configure@5.4.0-beta.12) (2026-09-24)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _rubric = require("@pie-lib/rubric");
|
|
8
|
+
const multiTraitDefaultModel = {
|
|
9
|
+
description: false,
|
|
10
|
+
excludeZero: false,
|
|
11
|
+
halfScoring: false,
|
|
12
|
+
pointLabels: true,
|
|
13
|
+
scales: [],
|
|
14
|
+
standards: false,
|
|
15
|
+
visibleToStudent: true
|
|
16
|
+
};
|
|
17
|
+
const rubricDefaultModel = {
|
|
18
|
+
points: ['', '', '', ''],
|
|
19
|
+
sampleAnswers: [null, null, null, null],
|
|
20
|
+
maxPoints: 3,
|
|
21
|
+
excludeZero: false
|
|
22
|
+
};
|
|
23
|
+
const rubriclessDefaultModel = {
|
|
24
|
+
maxPoints: 100,
|
|
25
|
+
excludeZero: false,
|
|
26
|
+
rubriclessInstructionEnabled: true
|
|
27
|
+
};
|
|
28
|
+
const multiTraitDefaultConfiguration = {
|
|
29
|
+
baseInputConfiguration: {
|
|
30
|
+
h3: {
|
|
31
|
+
disabled: true
|
|
32
|
+
},
|
|
33
|
+
audio: {
|
|
34
|
+
disabled: false
|
|
35
|
+
},
|
|
36
|
+
video: {
|
|
37
|
+
disabled: false
|
|
38
|
+
},
|
|
39
|
+
image: {
|
|
40
|
+
disabled: false
|
|
41
|
+
},
|
|
42
|
+
textAlign: {
|
|
43
|
+
disabled: true
|
|
44
|
+
},
|
|
45
|
+
showParagraphs: {
|
|
46
|
+
disabled: false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
expandedInput: {
|
|
50
|
+
inputConfiguration: {
|
|
51
|
+
math: {
|
|
52
|
+
disabled: true
|
|
53
|
+
},
|
|
54
|
+
audio: {
|
|
55
|
+
disabled: false
|
|
56
|
+
},
|
|
57
|
+
video: {
|
|
58
|
+
disabled: false
|
|
59
|
+
},
|
|
60
|
+
image: {
|
|
61
|
+
disabled: false
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
labelInput: {
|
|
66
|
+
inputConfiguration: {
|
|
67
|
+
math: {
|
|
68
|
+
disabled: true
|
|
69
|
+
},
|
|
70
|
+
audio: {
|
|
71
|
+
disabled: true
|
|
72
|
+
},
|
|
73
|
+
video: {
|
|
74
|
+
disabled: true
|
|
75
|
+
},
|
|
76
|
+
image: {
|
|
77
|
+
disabled: true
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
settingsPanelDisabled: false,
|
|
82
|
+
excludeZeroDialogBoxContent: {
|
|
83
|
+
title: 'Exclude 0 (Zero) from Score Point Values.',
|
|
84
|
+
text: `<div>
|
|
85
|
+
You are about to exclude 0 from score point values.
|
|
86
|
+
<br/>
|
|
87
|
+
Some of the existing data has to be changed.
|
|
88
|
+
<br/>
|
|
89
|
+
Please choose if you want to:
|
|
90
|
+
<ul>
|
|
91
|
+
<li>
|
|
92
|
+
shift Labels and Descriptions to the left
|
|
93
|
+
</li>
|
|
94
|
+
<li>
|
|
95
|
+
remove 0 column with its Label and Description
|
|
96
|
+
</li>
|
|
97
|
+
</ul>
|
|
98
|
+
</div>`
|
|
99
|
+
},
|
|
100
|
+
includeZeroDialogBoxContent: {
|
|
101
|
+
title: 'Include 0 (Zero) in Score Point Values.',
|
|
102
|
+
text: `<div>
|
|
103
|
+
You are about to include 0 in score point values.
|
|
104
|
+
<br/>
|
|
105
|
+
Some of the existing data has to be changed.
|
|
106
|
+
<br/>
|
|
107
|
+
Please choose if you want to:
|
|
108
|
+
<ul>
|
|
109
|
+
<li>
|
|
110
|
+
shift Labels and Descriptions to the right
|
|
111
|
+
</li>
|
|
112
|
+
<li>
|
|
113
|
+
add 0 column with empty Label and Descriptions
|
|
114
|
+
</li>
|
|
115
|
+
</ul>
|
|
116
|
+
</div>`
|
|
117
|
+
},
|
|
118
|
+
deleteScaleDialogBoxContent: {
|
|
119
|
+
title: 'Delete Scale',
|
|
120
|
+
text: 'Are you sure you want to delete this scale?'
|
|
121
|
+
},
|
|
122
|
+
maxPointsDialogBoxContent: {
|
|
123
|
+
title: 'Decreasing Max Points.',
|
|
124
|
+
text: ` You are about to decrease max score point value.
|
|
125
|
+
<br/>
|
|
126
|
+
All the Labels and Descriptions for scores above Max Point will be deleted.`
|
|
127
|
+
},
|
|
128
|
+
spellCheck: {
|
|
129
|
+
label: 'Spellcheck',
|
|
130
|
+
settings: false,
|
|
131
|
+
enabled: true
|
|
132
|
+
},
|
|
133
|
+
showExcludeZero: {
|
|
134
|
+
settings: true,
|
|
135
|
+
label: 'Exclude Zero'
|
|
136
|
+
},
|
|
137
|
+
showScorePointLabels: {
|
|
138
|
+
settings: true,
|
|
139
|
+
label: 'Show Score Point Labels'
|
|
140
|
+
},
|
|
141
|
+
showDescription: {
|
|
142
|
+
settings: true,
|
|
143
|
+
label: 'Show Description'
|
|
144
|
+
},
|
|
145
|
+
showVisibleToStudent: {
|
|
146
|
+
settings: true,
|
|
147
|
+
label: 'Visible to Student'
|
|
148
|
+
},
|
|
149
|
+
showHalfScoring: {
|
|
150
|
+
settings: true,
|
|
151
|
+
label: 'Half Scoring'
|
|
152
|
+
},
|
|
153
|
+
// commenting this in order to use the dynamic width if the width was not set by the client (PD-3203)
|
|
154
|
+
// width: '900px',
|
|
155
|
+
// these should not be set to true (should not be used) for now
|
|
156
|
+
showStandards: {
|
|
157
|
+
settings: false,
|
|
158
|
+
label: 'Show Standards'
|
|
159
|
+
},
|
|
160
|
+
showLevelTagInput: {
|
|
161
|
+
settings: false,
|
|
162
|
+
label: 'Show Level Tag Input',
|
|
163
|
+
enabled: false
|
|
164
|
+
},
|
|
165
|
+
dragAndDrop: {
|
|
166
|
+
settings: true,
|
|
167
|
+
label: 'Enable Drag and Drop',
|
|
168
|
+
enabled: false
|
|
169
|
+
},
|
|
170
|
+
maxMaxPoints: 9
|
|
171
|
+
};
|
|
172
|
+
const rubricDefaultConfiguration = {
|
|
173
|
+
baseInputConfiguration: {
|
|
174
|
+
h3: {
|
|
175
|
+
disabled: true
|
|
176
|
+
},
|
|
177
|
+
audio: {
|
|
178
|
+
disabled: false
|
|
179
|
+
},
|
|
180
|
+
video: {
|
|
181
|
+
disabled: false
|
|
182
|
+
},
|
|
183
|
+
image: {
|
|
184
|
+
disabled: false
|
|
185
|
+
},
|
|
186
|
+
textAlign: {
|
|
187
|
+
disabled: true
|
|
188
|
+
},
|
|
189
|
+
showParagraphs: {
|
|
190
|
+
disabled: false
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
showExcludeZero: {
|
|
194
|
+
settings: true,
|
|
195
|
+
label: 'Ability to exclude zero'
|
|
196
|
+
},
|
|
197
|
+
showMaxPoint: {
|
|
198
|
+
settings: true,
|
|
199
|
+
label: 'Show max points dropdown'
|
|
200
|
+
},
|
|
201
|
+
settingsPanelDisabled: false,
|
|
202
|
+
maxMaxPoints: 9
|
|
203
|
+
};
|
|
204
|
+
const rubriclessDefaultConfiguration = {
|
|
205
|
+
baseInputConfiguration: {
|
|
206
|
+
h3: {
|
|
207
|
+
disabled: true
|
|
208
|
+
},
|
|
209
|
+
audio: {
|
|
210
|
+
disabled: false
|
|
211
|
+
},
|
|
212
|
+
video: {
|
|
213
|
+
disabled: false
|
|
214
|
+
},
|
|
215
|
+
image: {
|
|
216
|
+
disabled: false
|
|
217
|
+
},
|
|
218
|
+
textAlign: {
|
|
219
|
+
disabled: true
|
|
220
|
+
},
|
|
221
|
+
showParagraphs: {
|
|
222
|
+
disabled: false
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
showExcludeZero: {
|
|
226
|
+
settings: true,
|
|
227
|
+
label: 'Ability to exclude zero'
|
|
228
|
+
},
|
|
229
|
+
showMaxPoint: {
|
|
230
|
+
settings: true,
|
|
231
|
+
label: 'Show max points dropdown'
|
|
232
|
+
},
|
|
233
|
+
settingsPanelDisabled: false,
|
|
234
|
+
// shows us if it simple rubric or rubricless(simple rubric with less structure)
|
|
235
|
+
rubricless: true,
|
|
236
|
+
// scoring instruction for rubricless
|
|
237
|
+
rubriclessInstruction: {
|
|
238
|
+
settings: true,
|
|
239
|
+
label: 'Instruction',
|
|
240
|
+
inputConfiguration: {
|
|
241
|
+
audio: {
|
|
242
|
+
disabled: false
|
|
243
|
+
},
|
|
244
|
+
video: {
|
|
245
|
+
disabled: false
|
|
246
|
+
},
|
|
247
|
+
image: {
|
|
248
|
+
disabled: false
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
maxMaxPoints: 100
|
|
253
|
+
};
|
|
254
|
+
var _default = exports.default = {
|
|
255
|
+
model: {
|
|
256
|
+
rubricType: 'simpleRubric',
|
|
257
|
+
rubrics: {
|
|
258
|
+
[_rubric.RUBRIC_TYPES.SIMPLE_RUBRIC]: rubricDefaultModel,
|
|
259
|
+
[_rubric.RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: multiTraitDefaultModel,
|
|
260
|
+
[_rubric.RUBRIC_TYPES.RUBRICLESS]: rubriclessDefaultModel
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
configuration: {
|
|
264
|
+
// width: '770px',
|
|
265
|
+
rubricOptions: ['simpleRubric', 'multiTraitRubric', 'rubricless'],
|
|
266
|
+
[_rubric.RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: multiTraitDefaultConfiguration,
|
|
267
|
+
[_rubric.RUBRIC_TYPES.SIMPLE_RUBRIC]: rubricDefaultConfiguration,
|
|
268
|
+
[_rubric.RUBRIC_TYPES.RUBRICLESS]: rubriclessDefaultConfiguration
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["_rubric","require","multiTraitDefaultModel","description","excludeZero","halfScoring","pointLabels","scales","standards","visibleToStudent","rubricDefaultModel","points","sampleAnswers","maxPoints","rubriclessDefaultModel","rubriclessInstructionEnabled","multiTraitDefaultConfiguration","baseInputConfiguration","h3","disabled","audio","video","image","textAlign","showParagraphs","expandedInput","inputConfiguration","math","labelInput","settingsPanelDisabled","excludeZeroDialogBoxContent","title","text","includeZeroDialogBoxContent","deleteScaleDialogBoxContent","maxPointsDialogBoxContent","spellCheck","label","settings","enabled","showExcludeZero","showScorePointLabels","showDescription","showVisibleToStudent","showHalfScoring","showStandards","showLevelTagInput","dragAndDrop","maxMaxPoints","rubricDefaultConfiguration","showMaxPoint","rubriclessDefaultConfiguration","rubricless","rubriclessInstruction","_default","exports","default","model","rubricType","rubrics","RUBRIC_TYPES","SIMPLE_RUBRIC","MULTI_TRAIT_RUBRIC","RUBRICLESS","configuration","rubricOptions"],"sources":["../src/defaults.js"],"sourcesContent":["import { RUBRIC_TYPES } from '@pie-lib/rubric';\n\nconst multiTraitDefaultModel = {\n description: false,\n excludeZero: false,\n halfScoring: false,\n pointLabels: true,\n scales: [],\n standards: false,\n visibleToStudent: true,\n};\n\nconst rubricDefaultModel = {\n points: ['', '', '', ''],\n sampleAnswers: [null, null, null, null],\n maxPoints: 3,\n excludeZero: false,\n};\n\nconst rubriclessDefaultModel = {\n maxPoints: 100,\n excludeZero: false,\n rubriclessInstructionEnabled: true,\n};\n\nconst multiTraitDefaultConfiguration = {\n baseInputConfiguration: {\n h3: { disabled: true },\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n },\n expandedInput: {\n inputConfiguration: {\n math: { disabled: true },\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n labelInput: {\n inputConfiguration: {\n math: { disabled: true },\n audio: { disabled: true },\n video: { disabled: true },\n image: { disabled: true },\n },\n },\n settingsPanelDisabled: false,\n excludeZeroDialogBoxContent: {\n title: 'Exclude 0 (Zero) from Score Point Values.',\n text: `<div>\n You are about to exclude 0 from score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the left\n </li>\n <li>\n remove 0 column with its Label and Description\n </li>\n </ul>\n </div>`,\n },\n includeZeroDialogBoxContent: {\n title: 'Include 0 (Zero) in Score Point Values.',\n text: `<div>\n You are about to include 0 in score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the right\n </li>\n <li>\n add 0 column with empty Label and Descriptions\n </li>\n </ul>\n </div>`,\n },\n deleteScaleDialogBoxContent: {\n title: 'Delete Scale',\n text: 'Are you sure you want to delete this scale?',\n },\n maxPointsDialogBoxContent: {\n title: 'Decreasing Max Points.',\n text: ` You are about to decrease max score point value.\n <br/>\n All the Labels and Descriptions for scores above Max Point will be deleted.`,\n },\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n showExcludeZero: {\n settings: true,\n label: 'Exclude Zero',\n },\n showScorePointLabels: {\n settings: true,\n label: 'Show Score Point Labels',\n },\n showDescription: {\n settings: true,\n label: 'Show Description',\n },\n showVisibleToStudent: {\n settings: true,\n label: 'Visible to Student',\n },\n showHalfScoring: {\n settings: true,\n label: 'Half Scoring',\n },\n // commenting this in order to use the dynamic width if the width was not set by the client (PD-3203)\n // width: '900px',\n // these should not be set to true (should not be used) for now\n showStandards: {\n settings: false,\n label: 'Show Standards',\n },\n showLevelTagInput: {\n settings: false,\n label: 'Show Level Tag Input',\n enabled: false,\n },\n dragAndDrop: {\n settings: true,\n label: 'Enable Drag and Drop',\n enabled: false,\n },\n maxMaxPoints: 9,\n};\n\nconst rubricDefaultConfiguration = {\n baseInputConfiguration: {\n h3: { disabled: true },\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n },\n showExcludeZero: {\n settings: true,\n label: 'Ability to exclude zero',\n },\n showMaxPoint: {\n settings: true,\n label: 'Show max points dropdown',\n },\n settingsPanelDisabled: false,\n maxMaxPoints: 9,\n};\n\nconst rubriclessDefaultConfiguration = {\n baseInputConfiguration: {\n h3: { disabled: true },\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n },\n showExcludeZero: {\n settings: true,\n label: 'Ability to exclude zero',\n },\n showMaxPoint: {\n settings: true,\n label: 'Show max points dropdown',\n },\n settingsPanelDisabled: false,\n // shows us if it simple rubric or rubricless(simple rubric with less structure)\n rubricless: true,\n // scoring instruction for rubricless\n rubriclessInstruction: {\n settings: true,\n label: 'Instruction',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n maxMaxPoints: 100,\n};\n\nexport default {\n model: {\n rubricType: 'simpleRubric',\n rubrics: {\n [RUBRIC_TYPES.SIMPLE_RUBRIC]: rubricDefaultModel,\n [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: multiTraitDefaultModel,\n [RUBRIC_TYPES.RUBRICLESS]: rubriclessDefaultModel,\n },\n },\n configuration: {\n // width: '770px',\n rubricOptions: ['simpleRubric', 'multiTraitRubric', 'rubricless'],\n [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: multiTraitDefaultConfiguration,\n [RUBRIC_TYPES.SIMPLE_RUBRIC]: rubricDefaultConfiguration,\n [RUBRIC_TYPES.RUBRICLESS]: rubriclessDefaultConfiguration,\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAMC,sBAAsB,GAAG;EAC7BC,WAAW,EAAE,KAAK;EAClBC,WAAW,EAAE,KAAK;EAClBC,WAAW,EAAE,KAAK;EAClBC,WAAW,EAAE,IAAI;EACjBC,MAAM,EAAE,EAAE;EACVC,SAAS,EAAE,KAAK;EAChBC,gBAAgB,EAAE;AACpB,CAAC;AAED,MAAMC,kBAAkB,GAAG;EACzBC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;EACxBC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;EACvCC,SAAS,EAAE,CAAC;EACZT,WAAW,EAAE;AACf,CAAC;AAED,MAAMU,sBAAsB,GAAG;EAC7BD,SAAS,EAAE,GAAG;EACdT,WAAW,EAAE,KAAK;EAClBW,4BAA4B,EAAE;AAChC,CAAC;AAED,MAAMC,8BAA8B,GAAG;EACrCC,sBAAsB,EAAE;IACtBC,EAAE,EAAE;MAAEC,QAAQ,EAAE;IAAK,CAAC;IACtBC,KAAK,EAAE;MAAED,QAAQ,EAAE;IAAM,CAAC;IAC1BE,KAAK,EAAE;MAAE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7B;EACF,CAAC;EACDkD,aAAa,EAAE;IACb;IACAC,aAAa,EAAE,CAAC,cAAc,EAAE,kBAAkB,EAAE,YAAY,CAAC;IACjE,CAACL,oBAAY,CAACE,kBAAkB,GAAG9C,8BAA8B;IACjE,CAAC4C,oBAAY,CAACC,aAAa,GAAGZ,0BAA0B;IACxD,CAACW,oBAAY,CAACG,UAAU,GAAGZ;EAC7B;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _client = require("react-dom/client");
|
|
12
|
+
var _lib = _interopRequireDefault(require("@pie-element/rubric/configure/lib"));
|
|
13
|
+
var _lib2 = _interopRequireDefault(require("@pie-element/multi-trait-rubric/configure/lib"));
|
|
14
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
15
|
+
var _lodashEs = require("lodash-es");
|
|
16
|
+
var _main = _interopRequireDefault(require("./main"));
|
|
17
|
+
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
18
|
+
const MODEL_UPDATED = _pieConfigureEvents.ModelUpdatedEvent.TYPE;
|
|
19
|
+
const RUBRIC_TAG_NAME = 'rubric-configure';
|
|
20
|
+
const MULTI_TRAIT_RUBRIC_TAG_NAME = 'multi-trait-rubric-configure';
|
|
21
|
+
class ComplexSimpleRubricConfigure extends _lib.default {}
|
|
22
|
+
class ComplexMTRConfigure extends _lib2.default {}
|
|
23
|
+
const defineComplexRubric = () => {
|
|
24
|
+
if (!customElements.get(RUBRIC_TAG_NAME)) {
|
|
25
|
+
customElements.define(RUBRIC_TAG_NAME, ComplexSimpleRubricConfigure);
|
|
26
|
+
}
|
|
27
|
+
if (!customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {
|
|
28
|
+
customElements.define(MULTI_TRAIT_RUBRIC_TAG_NAME, ComplexMTRConfigure);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
defineComplexRubric();
|
|
32
|
+
const prepareCustomizationObject = (config, model) => {
|
|
33
|
+
const configuration = (0, _lodashEs.defaults)(config, _defaults.default.configuration);
|
|
34
|
+
return {
|
|
35
|
+
configuration,
|
|
36
|
+
model
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
class ComplexRubricConfigureElement extends HTMLElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
(0, _defineProperty2.default)(this, "onModelChanged", (m, reset) => {
|
|
43
|
+
this._model = ComplexRubricConfigureElement.createDefaultModel(m, this._model);
|
|
44
|
+
this.dispatchModelUpdated(reset);
|
|
45
|
+
this._render();
|
|
46
|
+
});
|
|
47
|
+
(0, _defineProperty2.default)(this, "onModelUpdated", e => {
|
|
48
|
+
if (e.target === this) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
e.stopImmediatePropagation();
|
|
53
|
+
const id = e.target && e.target.getAttribute('id');
|
|
54
|
+
if (id) {
|
|
55
|
+
if (e.update) {
|
|
56
|
+
this._model.rubrics[id] = e.update;
|
|
57
|
+
}
|
|
58
|
+
this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
this._root = null;
|
|
62
|
+
this.canUpdateModel = false;
|
|
63
|
+
_debug.default.log('constructor called');
|
|
64
|
+
this._model = ComplexRubricConfigureElement.createDefaultModel();
|
|
65
|
+
this._configuration = _defaults.default.configuration;
|
|
66
|
+
this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
67
|
+
}
|
|
68
|
+
set model(m) {
|
|
69
|
+
this._model = ComplexRubricConfigureElement.createDefaultModel(m, this._model);
|
|
70
|
+
this.canUpdateModel = true;
|
|
71
|
+
this._render();
|
|
72
|
+
}
|
|
73
|
+
dispatchModelUpdated(reset) {
|
|
74
|
+
const resetValue = !!reset;
|
|
75
|
+
this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, resetValue));
|
|
76
|
+
}
|
|
77
|
+
set configuration(c) {
|
|
78
|
+
const info = prepareCustomizationObject(c, this._model);
|
|
79
|
+
this._configuration = info.configuration;
|
|
80
|
+
this._render();
|
|
81
|
+
}
|
|
82
|
+
onConfigurationChanged(c) {
|
|
83
|
+
this._configuration = prepareCustomizationObject(c, this._model).configuration;
|
|
84
|
+
if (this._model) {
|
|
85
|
+
this.onModelChanged(this._model);
|
|
86
|
+
}
|
|
87
|
+
this._render();
|
|
88
|
+
}
|
|
89
|
+
connectedCallback() {
|
|
90
|
+
this.addEventListener(MODEL_UPDATED, this.onModelUpdated);
|
|
91
|
+
this._render();
|
|
92
|
+
}
|
|
93
|
+
_render() {
|
|
94
|
+
let element = /*#__PURE__*/_react.default.createElement(_main.default, {
|
|
95
|
+
model: this._model,
|
|
96
|
+
configuration: this._configuration,
|
|
97
|
+
onModelChanged: this.onModelChanged,
|
|
98
|
+
onConfigurationChanged: this.onConfigurationChanged,
|
|
99
|
+
canUpdateModel: this.canUpdateModel
|
|
100
|
+
});
|
|
101
|
+
if (!this._root) {
|
|
102
|
+
this._root = (0, _client.createRoot)(this);
|
|
103
|
+
}
|
|
104
|
+
this._root.render(element);
|
|
105
|
+
}
|
|
106
|
+
disconnectedCallback() {
|
|
107
|
+
this.removeEventListener(MODEL_UPDATED, this.onModelUpdated);
|
|
108
|
+
if (this._root) {
|
|
109
|
+
this._root.unmount();
|
|
110
|
+
this._root = null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.default = ComplexRubricConfigureElement;
|
|
115
|
+
(0, _defineProperty2.default)(ComplexRubricConfigureElement, "createDefaultModel", ({
|
|
116
|
+
rubrics: {
|
|
117
|
+
simpleRubric = {},
|
|
118
|
+
rubricless = {},
|
|
119
|
+
multiTraitRubric = {}
|
|
120
|
+
} = {
|
|
121
|
+
simpleRubric: {},
|
|
122
|
+
rubricless: {},
|
|
123
|
+
multiTraitRubric: {}
|
|
124
|
+
},
|
|
125
|
+
...model
|
|
126
|
+
} = {}, currentModel = {}) => {
|
|
127
|
+
const pieDefaults = _defaults.default?.model || {};
|
|
128
|
+
return {
|
|
129
|
+
...pieDefaults,
|
|
130
|
+
...currentModel,
|
|
131
|
+
...model,
|
|
132
|
+
rubrics: {
|
|
133
|
+
simpleRubric: {
|
|
134
|
+
...(_defaults.default?.model?.rubrics || {}).simpleRubric,
|
|
135
|
+
...(currentModel.rubrics || {}).simpleRubric,
|
|
136
|
+
...simpleRubric
|
|
137
|
+
},
|
|
138
|
+
multiTraitRubric: {
|
|
139
|
+
...(_defaults.default?.model?.rubrics || {}).multiTraitRubric,
|
|
140
|
+
...(currentModel.rubrics || {}).multiTraitRubric,
|
|
141
|
+
...multiTraitRubric
|
|
142
|
+
},
|
|
143
|
+
rubricless: {
|
|
144
|
+
...(_defaults.default?.model?.rubrics || {}).rubricless,
|
|
145
|
+
...(currentModel.rubrics || {}).rubricless,
|
|
146
|
+
...rubricless
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_pieConfigureEvents","require","_react","_interopRequireDefault","_client","_lib","_lib2","_debug","_lodashEs","_main","_defaults","MODEL_UPDATED","ModelUpdatedEvent","TYPE","RUBRIC_TAG_NAME","MULTI_TRAIT_RUBRIC_TAG_NAME","ComplexSimpleRubricConfigure","RubricConfigure","ComplexMTRConfigure","MultiTraitRubricConfigure","defineComplexRubric","customElements","get","define","prepareCustomizationObject","config","model","configuration","defaults","sensibleDefaults","ComplexRubricConfigureElement","HTMLElement","constructor","_defineProperty2","default","m","reset","_model","createDefaultModel","dispatchModelUpdated","_render","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","update","rubrics","dispatchEvent","_root","canUpdateModel","debug","log","_configuration","onConfigurationChanged","bind","resetValue","c","info","onModelChanged","connectedCallback","addEventListener","onModelUpdated","element","React","createElement","Main","createRoot","render","disconnectedCallback","removeEventListener","unmount","exports","simpleRubric","rubricless","multiTraitRubric","currentModel","pieDefaults"],"sources":["../src/index.js"],"sourcesContent":["import { ModelUpdatedEvent } from '@pie-framework/pie-configure-events';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport RubricConfigure from '@pie-element/rubric/configure/lib';\nimport MultiTraitRubricConfigure from '@pie-element/multi-trait-rubric/configure/lib';\nimport debug from 'debug';\nimport { defaults } from 'lodash-es';\nimport Main from './main';\nimport sensibleDefaults from './defaults';\n\nconst MODEL_UPDATED = ModelUpdatedEvent.TYPE;\nconst RUBRIC_TAG_NAME = 'rubric-configure';\nconst MULTI_TRAIT_RUBRIC_TAG_NAME = 'multi-trait-rubric-configure';\n\nclass ComplexSimpleRubricConfigure extends RubricConfigure {}\n\nclass ComplexMTRConfigure extends MultiTraitRubricConfigure {\n}\n\nconst defineComplexRubric = () => {\n if (!customElements.get(RUBRIC_TAG_NAME)) {\n customElements.define(RUBRIC_TAG_NAME, ComplexSimpleRubricConfigure);\n }\n if (!customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {\n customElements.define(MULTI_TRAIT_RUBRIC_TAG_NAME, ComplexMTRConfigure);\n }\n};\n\ndefineComplexRubric();\n\nconst prepareCustomizationObject = (config, model) => {\n const configuration = defaults(config, sensibleDefaults.configuration);\n\n return {\n configuration,\n model,\n };\n};\n\nexport default class ComplexRubricConfigureElement extends HTMLElement {\n static createDefaultModel = (\n {\n rubrics: { simpleRubric = {}, rubricless = {}, multiTraitRubric = {} } = { simpleRubric: {}, rubricless: {}, multiTraitRubric: {} },\n ...model\n } = {},\n currentModel = {},\n ) =>\n {\n const pieDefaults = sensibleDefaults?.model || {}\n return {\n ...pieDefaults,\n ...currentModel,\n ...model,\n rubrics: {\n simpleRubric: {\n ...(sensibleDefaults?.model?.rubrics || {}).simpleRubric,\n ...(currentModel.rubrics || {}).simpleRubric,\n ...simpleRubric,\n },\n multiTraitRubric: {\n ...(sensibleDefaults?.model?.rubrics || {}).multiTraitRubric,\n ...(currentModel.rubrics || {}).multiTraitRubric,\n ...multiTraitRubric,\n },\n rubricless: {\n ...(sensibleDefaults?.model?.rubrics || {}).rubricless,\n ...(currentModel.rubrics || {}).rubricless,\n ...rubricless,\n },\n },\n }};\n\n constructor() {\n super();\n this._root = null;\n this.canUpdateModel = false;\n\n debug.log('constructor called');\n\n this._model = ComplexRubricConfigureElement.createDefaultModel();\n this._configuration = sensibleDefaults.configuration;\n\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(m) {\n this._model = ComplexRubricConfigureElement.createDefaultModel(m, this._model);\n\n this.canUpdateModel = true;\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged = (m, reset) => {\n this._model = ComplexRubricConfigureElement.createDefaultModel(m, this._model);\n\n this.dispatchModelUpdated(reset);\n\n this._render();\n };\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n this._configuration = info.configuration;\n\n this._render();\n }\n\n onConfigurationChanged(c) {\n this._configuration = prepareCustomizationObject(c, this._model).configuration;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n onModelUpdated = (e) => {\n if (e.target === this) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const id = e.target && e.target.getAttribute('id');\n\n if (id) {\n if (e.update) {\n this._model.rubrics[id] = e.update;\n }\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n }\n };\n\n connectedCallback() {\n this.addEventListener(MODEL_UPDATED, this.onModelUpdated);\n this._render();\n }\n\n _render() {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n canUpdateModel: this.canUpdateModel\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n }\n\n disconnectedCallback() {\n this.removeEventListener(MODEL_UPDATED, this.onModelUpdated);\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,KAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,SAAA,GAAAP,sBAAA,CAAAF,OAAA;AAEA,MAAMU,aAAa,GAAGC,qCAAiB,CAACC,IAAI;AAC5C,MAAMC,eAAe,GAAG,kBAAkB;AAC1C,MAAMC,2BAA2B,GAAG,8BAA8B;AAElE,MAAMC,4BAA4B,SAASC,YAAe,CAAC;AAE3D,MAAMC,mBAAmB,SAASC,aAAyB,CAAC;AAG5D,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EAChC,IAAI,CAACC,cAAc,CAACC,GAAG,CAACR,eAAe,CAAC,EAAE;IACxCO,cAAc,CAACE,MAAM,CAACT,eAAe,EAAEE,4BAA4B,CAAC;EACtE;EACA,IAAI,CAACK,cAAc,CAACC,GAAG,CAACP,2BAA2B,CAAC,EAAE;IACpDM,cAAc,CAACE,MAAM,CAACR,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MAAMC,WAAW,GAAGjD,iBAAgB,EAAEH,KAAK,IAAI,CAAC,CAAC;EACjD,OAAO;IACL,GAAGoD,WAAW;IACd,GAAGD,YAAY;IACf,GAAGnD,KAAK;IACVsB,OAAO,EAAE;MACP0B,YAAY,EAAE;QACZ,GAAG,CAAC7C,iBAAgB,EAAEH,KAAK,EAAEsB,OAAO,IAAI,CAAC,CAAC,EAAE0B,YAAY;QACxD,GAAG,CAACG,YAAY,CAAC7B,OAAO,IAAI,CAAC,CAAC,EAAE0B,YAAY;QAC5C,GAAGA;MACL,CAAC;MACDE,gBAAgB,EAAE;QAChB,GAAG,CAAC/C,iBAAgB,EAAEH,KAAK,EAAEsB,OAAO,IAAI,CAAC,CAAC,EAAE4B,gBAAgB;QAC5D,GAAG,CAACC,YAAY,CAAC7B,OAAO,IAAI,CAAC,CAAC,EAAE4B,gBAAgB;QAChD,GAAGA;MACL,CAAC;MACDD,UAAU,EAAE;QACV,GAAG,CAAC9C,iBAAgB,EAAEH,KAAK,EAAEsB,OAAO,IAAI,CAAC,CAAC,EAAE2B,UAAU;QACtD,GAAG,CAACE,YAAY,CAAC7B,OAAO,IAAI,CAAC,CAAC,EAAE2B,UAAU;QAC1C,GAAGA;MACL;IACF;EACF,CAAC;AAAA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.Main = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _rubric = require("@pie-lib/rubric");
|
|
12
|
+
var _configUi = require("@pie-lib/config-ui");
|
|
13
|
+
var _Radio = _interopRequireDefault(require("@mui/material/Radio"));
|
|
14
|
+
var _RadioGroup = _interopRequireDefault(require("@mui/material/RadioGroup"));
|
|
15
|
+
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
16
|
+
var _styles = require("@mui/material/styles");
|
|
17
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
18
|
+
const StyledFormControlLabel = (0, _styles.styled)(_FormControlLabel.default)({
|
|
19
|
+
'&.MuiFormControlLabel-root': {
|
|
20
|
+
width: 'fit-content',
|
|
21
|
+
paddingRight: '24px',
|
|
22
|
+
boxSizing: 'border-box',
|
|
23
|
+
'&:hover': {
|
|
24
|
+
background: 'var(--pie-secondary-background, rgba(241,241,241,1))'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const StyledRadio = (0, _styles.styled)(_Radio.default)({
|
|
29
|
+
'&.MuiRadio-root': {
|
|
30
|
+
color: `${_renderUi.color.tertiary()} !important`
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const rubricLabels = {
|
|
34
|
+
[_rubric.RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: 'Multi Trait Rubric',
|
|
35
|
+
[_rubric.RUBRIC_TYPES.SIMPLE_RUBRIC]: 'Simple Rubric',
|
|
36
|
+
[_rubric.RUBRIC_TYPES.RUBRICLESS]: 'Rubricless'
|
|
37
|
+
};
|
|
38
|
+
class Main extends _react.default.Component {
|
|
39
|
+
constructor(...args) {
|
|
40
|
+
super(...args);
|
|
41
|
+
(0, _defineProperty2.default)(this, "onModelChanged", model => {
|
|
42
|
+
const {
|
|
43
|
+
onModelChanged
|
|
44
|
+
} = this.props;
|
|
45
|
+
return onModelChanged(model);
|
|
46
|
+
});
|
|
47
|
+
(0, _defineProperty2.default)(this, "onChangeRubricType", e => {
|
|
48
|
+
const {
|
|
49
|
+
model
|
|
50
|
+
} = this.props;
|
|
51
|
+
const rubricType = e.target.value;
|
|
52
|
+
this.onModelChanged({
|
|
53
|
+
...model,
|
|
54
|
+
rubricType
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
const {
|
|
60
|
+
model,
|
|
61
|
+
configuration,
|
|
62
|
+
canUpdateModel
|
|
63
|
+
} = this.props;
|
|
64
|
+
const {
|
|
65
|
+
extraCSSRules,
|
|
66
|
+
rubrics = {}
|
|
67
|
+
} = model || {};
|
|
68
|
+
let {
|
|
69
|
+
rubricType
|
|
70
|
+
} = model;
|
|
71
|
+
const {
|
|
72
|
+
contentDimensions = {},
|
|
73
|
+
rubricOptions = [],
|
|
74
|
+
multiTraitRubric,
|
|
75
|
+
simpleRubric,
|
|
76
|
+
rubricless,
|
|
77
|
+
width
|
|
78
|
+
} = configuration;
|
|
79
|
+
let rubricTag = '';
|
|
80
|
+
if (!rubricType) {
|
|
81
|
+
rubricType = _rubric.RUBRIC_TYPES.SIMPLE_RUBRIC;
|
|
82
|
+
}
|
|
83
|
+
const isRubricTypeAvailable = rubricOptions.indexOf(rubricType) > -1;
|
|
84
|
+
if (canUpdateModel) {
|
|
85
|
+
switch (rubricType) {
|
|
86
|
+
case _rubric.RUBRIC_TYPES.SIMPLE_RUBRIC:
|
|
87
|
+
default:
|
|
88
|
+
rubricTag = /*#__PURE__*/_react.default.createElement("rubric-configure", {
|
|
89
|
+
id: "simpleRubric",
|
|
90
|
+
key: "simple-rubric",
|
|
91
|
+
ref: ref => {
|
|
92
|
+
if (ref) {
|
|
93
|
+
this.simpleRubric = ref;
|
|
94
|
+
this.simpleRubric.model = {
|
|
95
|
+
...rubrics.simpleRubric,
|
|
96
|
+
errors: model.errors || {}
|
|
97
|
+
};
|
|
98
|
+
this.simpleRubric.configuration = {
|
|
99
|
+
...simpleRubric,
|
|
100
|
+
width
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
case _rubric.RUBRIC_TYPES.MULTI_TRAIT_RUBRIC:
|
|
107
|
+
rubricTag = /*#__PURE__*/_react.default.createElement("multi-trait-rubric-configure", {
|
|
108
|
+
id: "multiTraitRubric",
|
|
109
|
+
key: "multi-trait-rubric",
|
|
110
|
+
ref: ref => {
|
|
111
|
+
if (ref) {
|
|
112
|
+
this.multiTraitRubric = ref;
|
|
113
|
+
this.multiTraitRubric.model = {
|
|
114
|
+
...rubrics.multiTraitRubric,
|
|
115
|
+
errors: model.errors || {}
|
|
116
|
+
};
|
|
117
|
+
this.multiTraitRubric.configuration = {
|
|
118
|
+
...multiTraitRubric,
|
|
119
|
+
width: width || multiTraitRubric.width
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
break;
|
|
125
|
+
case _rubric.RUBRIC_TYPES.RUBRICLESS:
|
|
126
|
+
rubricTag = /*#__PURE__*/_react.default.createElement("rubric-configure", {
|
|
127
|
+
id: "rubricless",
|
|
128
|
+
key: "rubricless",
|
|
129
|
+
ref: ref => {
|
|
130
|
+
if (ref) {
|
|
131
|
+
this.rubricless = ref;
|
|
132
|
+
this.rubricless.model = rubrics.rubricless;
|
|
133
|
+
this.rubricless.configuration = {
|
|
134
|
+
...rubricless,
|
|
135
|
+
width
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement(_configUi.layout.ConfigLayout, {
|
|
144
|
+
extraCSSRules: extraCSSRules,
|
|
145
|
+
dimensions: contentDimensions,
|
|
146
|
+
hideSettings: true,
|
|
147
|
+
settings: null
|
|
148
|
+
}, /*#__PURE__*/_react.default.createElement(_RadioGroup.default, {
|
|
149
|
+
"aria-label": "rubric-type",
|
|
150
|
+
name: "rubricType",
|
|
151
|
+
value: model.rubricType,
|
|
152
|
+
onChange: this.onChangeRubricType
|
|
153
|
+
}, rubricOptions.length > 1 && rubricOptions.map((availableRubric, i) => /*#__PURE__*/_react.default.createElement(StyledFormControlLabel, {
|
|
154
|
+
key: i,
|
|
155
|
+
value: availableRubric,
|
|
156
|
+
control: /*#__PURE__*/_react.default.createElement(StyledRadio, {
|
|
157
|
+
checked: rubricType === availableRubric
|
|
158
|
+
}),
|
|
159
|
+
label: rubricLabels[availableRubric]
|
|
160
|
+
}))), isRubricTypeAvailable && rubricTag);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.Main = Main;
|
|
164
|
+
(0, _defineProperty2.default)(Main, "propTypes", {
|
|
165
|
+
canUpdateModel: _propTypes.default.bool,
|
|
166
|
+
configuration: _propTypes.default.object,
|
|
167
|
+
model: _propTypes.default.object,
|
|
168
|
+
onModelChanged: _propTypes.default.func,
|
|
169
|
+
onConfigurationChanged: _propTypes.default.func
|
|
170
|
+
});
|
|
171
|
+
var _default = exports.default = Main;
|
|
172
|
+
//# sourceMappingURL=main.js.map
|