@pie-element/complex-rubric 3.8.4-next.12 → 3.8.4-next.14

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 (122) hide show
  1. package/module/configure.js +1 -1
  2. package/module/element.js +1 -1
  3. package/module/index.html +1 -1
  4. package/module/manifest.json +1 -1
  5. package/module/print.html +1 -1
  6. package/module/print.js +1 -1
  7. package/package.json +4 -4
  8. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.json +0 -1
  9. package/configure/node_modules/@pie-element/multi-trait-rubric/CHANGELOG.md +0 -2430
  10. package/configure/node_modules/@pie-element/multi-trait-rubric/LICENSE.md +0 -5
  11. package/configure/node_modules/@pie-element/multi-trait-rubric/README.md +0 -55
  12. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.json +0 -1
  13. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/CHANGELOG.md +0 -2298
  14. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js +0 -584
  15. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/common.js.map +0 -1
  16. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js +0 -152
  17. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/defaults.js.map +0 -1
  18. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js +0 -223
  19. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/index.js.map +0 -1
  20. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js +0 -546
  21. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/main.js.map +0 -1
  22. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js +0 -361
  23. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/modals.js.map +0 -1
  24. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js +0 -556
  25. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/scale.js.map +0 -1
  26. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js +0 -380
  27. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/trait.js.map +0 -1
  28. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js +0 -296
  29. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/traitsHeader.js.map +0 -1
  30. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js +0 -118
  31. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/lib/utils.js.map +0 -1
  32. package/configure/node_modules/@pie-element/multi-trait-rubric/configure/package.json +0 -18
  33. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.json +0 -1
  34. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/CHANGELOG.md +0 -1539
  35. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js +0 -19
  36. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/defaults.js.map +0 -1
  37. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js +0 -215
  38. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/index.js.map +0 -1
  39. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js +0 -13
  40. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/lib/utils.js.map +0 -1
  41. package/configure/node_modules/@pie-element/multi-trait-rubric/controller/package.json +0 -15
  42. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json +0 -1628
  43. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/config-schema.json.md +0 -1202
  44. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/config.js +0 -8
  45. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/generate.js +0 -117
  46. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/index.html +0 -1
  47. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/demo/session.js +0 -6
  48. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json +0 -861
  49. package/configure/node_modules/@pie-element/multi-trait-rubric/docs/pie-schema.json.md +0 -614
  50. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js +0 -91
  51. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/index.js.map +0 -1
  52. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js +0 -164
  53. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/main.js.map +0 -1
  54. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js +0 -330
  55. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/scale.js.map +0 -1
  56. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js +0 -103
  57. package/configure/node_modules/@pie-element/multi-trait-rubric/lib/trait.js.map +0 -1
  58. package/configure/node_modules/@pie-element/multi-trait-rubric/package.json +0 -24
  59. package/configure/node_modules/@pie-element/rubric/CHANGELOG.json +0 -257
  60. package/configure/node_modules/@pie-element/rubric/CHANGELOG.md +0 -2713
  61. package/configure/node_modules/@pie-element/rubric/LICENSE.md +0 -5
  62. package/configure/node_modules/@pie-element/rubric/README.md +0 -3
  63. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.json +0 -197
  64. package/configure/node_modules/@pie-element/rubric/configure/CHANGELOG.md +0 -2506
  65. package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js +0 -68
  66. package/configure/node_modules/@pie-element/rubric/configure/lib/defaults.js.map +0 -1
  67. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js +0 -197
  68. package/configure/node_modules/@pie-element/rubric/configure/lib/index.js.map +0 -1
  69. package/configure/node_modules/@pie-element/rubric/configure/lib/main.js +0 -162
  70. package/configure/node_modules/@pie-element/rubric/configure/lib/main.js.map +0 -1
  71. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js +0 -573
  72. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/authoring.js.map +0 -1
  73. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js +0 -24
  74. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/index.js.map +0 -1
  75. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js +0 -172
  76. package/configure/node_modules/@pie-element/rubric/configure/lib/pie-toolbox-rubric/point-menu.js.map +0 -1
  77. package/configure/node_modules/@pie-element/rubric/configure/package.json +0 -18
  78. package/configure/node_modules/@pie-element/rubric/configure/src/__tests__/index.test.jsx +0 -167
  79. package/configure/node_modules/@pie-element/rubric/configure/src/defaults.js +0 -42
  80. package/configure/node_modules/@pie-element/rubric/configure/src/index.js +0 -129
  81. package/configure/node_modules/@pie-element/rubric/configure/src/main.jsx +0 -89
  82. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/authoring.jsx +0 -449
  83. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/index.js +0 -9
  84. package/configure/node_modules/@pie-element/rubric/configure/src/pie-toolbox-rubric/point-menu.jsx +0 -94
  85. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.json +0 -17
  86. package/configure/node_modules/@pie-element/rubric/controller/CHANGELOG.md +0 -1532
  87. package/configure/node_modules/@pie-element/rubric/controller/lib/defaults.js +0 -16
  88. package/configure/node_modules/@pie-element/rubric/controller/lib/defaults.js.map +0 -1
  89. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js +0 -59
  90. package/configure/node_modules/@pie-element/rubric/controller/lib/index.js.map +0 -1
  91. package/configure/node_modules/@pie-element/rubric/controller/package.json +0 -13
  92. package/configure/node_modules/@pie-element/rubric/controller/src/__tests__/index.test.js +0 -33
  93. package/configure/node_modules/@pie-element/rubric/controller/src/defaults.js +0 -8
  94. package/configure/node_modules/@pie-element/rubric/controller/src/index.js +0 -41
  95. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json +0 -712
  96. package/configure/node_modules/@pie-element/rubric/docs/config-schema.json.md +0 -532
  97. package/configure/node_modules/@pie-element/rubric/docs/demo/config.js +0 -8
  98. package/configure/node_modules/@pie-element/rubric/docs/demo/generate.js +0 -8
  99. package/configure/node_modules/@pie-element/rubric/docs/demo/index.html +0 -2
  100. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json +0 -391
  101. package/configure/node_modules/@pie-element/rubric/docs/pie-schema.json.md +0 -281
  102. package/configure/node_modules/@pie-element/rubric/lib/index.js +0 -94
  103. package/configure/node_modules/@pie-element/rubric/lib/index.js.map +0 -1
  104. package/configure/node_modules/@pie-element/rubric/lib/main.js +0 -270
  105. package/configure/node_modules/@pie-element/rubric/lib/main.js.map +0 -1
  106. package/configure/node_modules/@pie-element/rubric/lib/print.js +0 -114
  107. package/configure/node_modules/@pie-element/rubric/lib/print.js.map +0 -1
  108. package/configure/node_modules/@pie-element/rubric/module/configure.js +0 -1
  109. package/configure/node_modules/@pie-element/rubric/module/controller.js +0 -113
  110. package/configure/node_modules/@pie-element/rubric/module/demo.js +0 -33
  111. package/configure/node_modules/@pie-element/rubric/module/element.js +0 -1
  112. package/configure/node_modules/@pie-element/rubric/module/index.html +0 -21
  113. package/configure/node_modules/@pie-element/rubric/module/manifest.json +0 -10
  114. package/configure/node_modules/@pie-element/rubric/module/print-demo.js +0 -71
  115. package/configure/node_modules/@pie-element/rubric/module/print.html +0 -18
  116. package/configure/node_modules/@pie-element/rubric/module/print.js +0 -1
  117. package/configure/node_modules/@pie-element/rubric/package.json +0 -26
  118. package/configure/node_modules/@pie-element/rubric/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +0 -1815
  119. package/configure/node_modules/@pie-element/rubric/src/__tests__/rubric-view.test.jsx +0 -49
  120. package/configure/node_modules/@pie-element/rubric/src/index.js +0 -37
  121. package/configure/node_modules/@pie-element/rubric/src/main.jsx +0 -219
  122. package/configure/node_modules/@pie-element/rubric/src/print.js +0 -63
@@ -1,152 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _default = {
8
- model: {
9
- addScaleEnabled: true,
10
- description: false,
11
- excludeZero: false,
12
- halfScoring: false,
13
- maxPointsEnabled: true,
14
- pointLabels: true,
15
- scales: [],
16
- standards: false,
17
- visibleToStudent: true
18
- },
19
- configuration: {
20
- baseInputConfiguration: {
21
- audio: {
22
- disabled: false
23
- },
24
- video: {
25
- disabled: false
26
- },
27
- image: {
28
- disabled: false
29
- },
30
- textAlign: {
31
- disabled: true
32
- },
33
- showParagraphs: {
34
- disabled: false
35
- },
36
- separateParagraphs: {
37
- disabled: true
38
- }
39
- },
40
- expandedInput: {
41
- inputConfiguration: {
42
- math: {
43
- disabled: true
44
- },
45
- audio: {
46
- disabled: false
47
- },
48
- video: {
49
- disabled: false
50
- },
51
- image: {
52
- disabled: false
53
- }
54
- }
55
- },
56
- labelInput: {
57
- inputConfiguration: {
58
- math: {
59
- disabled: true
60
- },
61
- audio: {
62
- disabled: true
63
- },
64
- video: {
65
- disabled: true
66
- },
67
- image: {
68
- disabled: true
69
- }
70
- }
71
- },
72
- excludeZeroDialogBoxContent: {
73
- title: 'Exclude 0 (Zero) from Score Point Values.',
74
- 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>"
75
- },
76
- includeZeroDialogBoxContent: {
77
- title: 'Include 0 (Zero) in Score Point Values.',
78
- 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>"
79
- },
80
- deleteScaleDialogBoxContent: {
81
- title: 'Delete Scale',
82
- text: 'Are you sure you want to delete this scale?'
83
- },
84
- maxPointsDialogBoxContent: {
85
- title: 'Decreasing Max Points.',
86
- 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."
87
- },
88
- settingsPanelDisabled: false,
89
- spellCheck: {
90
- label: 'Spellcheck',
91
- settings: false,
92
- enabled: true
93
- },
94
- showExcludeZero: {
95
- settings: true,
96
- label: 'Exclude Zero'
97
- },
98
- showScorePointLabels: {
99
- settings: true,
100
- label: 'Show Score Point Labels'
101
- },
102
- showDescription: {
103
- settings: true,
104
- label: 'Show Description'
105
- },
106
- showVisibleToStudent: {
107
- settings: true,
108
- label: 'Visible to Student'
109
- },
110
- showHalfScoring: {
111
- settings: true,
112
- label: 'Half Scoring'
113
- },
114
- // commenting this in order to use the dynamic width if the width was not set by the client (PD-3203)
115
- // width: '900px',
116
- // these should not be set to true (should not be used) for now
117
- showStandards: {
118
- settings: false,
119
- label: 'Show Standards'
120
- },
121
- showLevelTagInput: {
122
- settings: false,
123
- label: 'Show Level Tag Input',
124
- enabled: false
125
- },
126
- dragAndDrop: {
127
- settings: true,
128
- label: 'Enable Drag and Drop',
129
- enabled: false
130
- },
131
- showMaxPoint: {
132
- settings: true,
133
- label: 'Show Max Points Dropdown'
134
- },
135
- addScale: {
136
- settings: true,
137
- label: 'Add Scale Available'
138
- },
139
- minNoOfTraits: 1,
140
- maxNoOfTraits: 10,
141
- minNoOfScales: 1,
142
- maxNoOfScales: 10,
143
- defaultTraitLabel: 'Trait',
144
- mathMlOptions: {
145
- mmlOutput: false,
146
- mmlEditing: false
147
- },
148
- maxMaxPoints: 10
149
- }
150
- };
151
- exports["default"] = _default;
152
- //# sourceMappingURL=defaults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["model","addScaleEnabled","description","excludeZero","halfScoring","maxPointsEnabled","pointLabels","scales","standards","visibleToStudent","configuration","baseInputConfiguration","audio","disabled","video","image","textAlign","showParagraphs","separateParagraphs","expandedInput","inputConfiguration","math","labelInput","excludeZeroDialogBoxContent","title","text","includeZeroDialogBoxContent","deleteScaleDialogBoxContent","maxPointsDialogBoxContent","settingsPanelDisabled","spellCheck","label","settings","enabled","showExcludeZero","showScorePointLabels","showDescription","showVisibleToStudent","showHalfScoring","showStandards","showLevelTagInput","dragAndDrop","showMaxPoint","addScale","minNoOfTraits","maxNoOfTraits","minNoOfScales","maxNoOfScales","defaultTraitLabel","mathMlOptions","mmlOutput","mmlEditing","maxMaxPoints"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,eAAe,EAAE,IADZ;AAELC,IAAAA,WAAW,EAAE,KAFR;AAGLC,IAAAA,WAAW,EAAE,KAHR;AAILC,IAAAA,WAAW,EAAE,KAJR;AAKLC,IAAAA,gBAAgB,EAAE,IALb;AAMLC,IAAAA,WAAW,EAAE,IANR;AAOLC,IAAAA,MAAM,EAAE,EAPH;AAQLC,IAAAA,SAAS,EAAE,KARN;AASLC,IAAAA,gBAAgB,EAAE;AATb,GADM;AAYbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,sBAAsB,EAAE;AACtBC,MAAAA,KAAK,EAAE;AAAEC,QAAAA,QAAQ,EAAE;AAAZ,OADe;AAEtBC,MAAAA,KAAK,EAAE;AAAED,QAAAA,QAAQ,EAAE;AAAZ,OAFe;AAGtBE,MAAAA,KAAK,EAAE;AAAEF,QAAAA,QAAQ,EAAE;AAAZ,OAHe;AAItBG,MAAAA,SAAS,EAAE;AAAEH,QAAAA,QAAQ,EAAE;AAAZ,OAJW;AAKtBI,MAAAA,cAAc,EAAE;AAAEJ,QAAAA,QAAQ,EAAE;AAAZ,OALM;AAMtBK,MAAAA,kBAAkB,EAAE;AAAEL,QAAAA,QAAQ,EAAE;AAAZ;AANE,KADX;AASbM,IAAAA,aAAa,EAAE;AACbC,MAAAA,kBAAkB,EAAE;AAClBC,QAAAA,IAAI,EAAE;AAAER,UAAAA,QAAQ,EAAE;AAAZ,SADY;AAElBD,QAAAA,KAAK,EAA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C,KA/HF;AAmIbC,IAAAA,YAAY,EAAE;AAnID;AAZF,C","sourcesContent":["export default {\n model: {\n addScaleEnabled: true,\n description: false,\n excludeZero: false,\n halfScoring: false,\n maxPointsEnabled: true,\n pointLabels: true,\n scales: [],\n standards: false,\n visibleToStudent: true,\n },\n configuration: {\n baseInputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n separateParagraphs: { disabled: true },\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 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 settingsPanelDisabled: false,\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 showMaxPoint: {\n settings: true,\n label: 'Show Max Points Dropdown',\n },\n addScale: {\n settings: true,\n label: 'Add Scale Available',\n },\n minNoOfTraits: 1,\n maxNoOfTraits: 10,\n minNoOfScales: 1,\n maxNoOfScales: 10,\n defaultTraitLabel: 'Trait',\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n maxMaxPoints: 10,\n },\n};\n"],"file":"defaults.js"}
@@ -1,223 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
-
18
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
-
20
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
-
22
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
-
24
- var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
25
-
26
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
27
-
28
- var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
29
-
30
- var _react = _interopRequireDefault(require("react"));
31
-
32
- var _reactDom = _interopRequireDefault(require("react-dom"));
33
-
34
- var _main = _interopRequireDefault(require("./main"));
35
-
36
- var _defaults = _interopRequireDefault(require("./defaults"));
37
-
38
- var _utils = require("./utils");
39
-
40
- var _modals = require("./modals");
41
-
42
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
43
-
44
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
45
-
46
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
47
-
48
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
49
-
50
- var modelWithDefaults = function modelWithDefaults(m) {
51
- return _objectSpread(_objectSpread({}, _defaults["default"].model), m);
52
- };
53
-
54
- var configurationWithDefaults = function configurationWithDefaults(c) {
55
- return _objectSpread(_objectSpread({}, _defaults["default"].configuration), c);
56
- };
57
-
58
- var MultiTraitRubricElement = /*#__PURE__*/function (_HTMLElement) {
59
- (0, _inherits2["default"])(MultiTraitRubricElement, _HTMLElement);
60
-
61
- var _super = _createSuper(MultiTraitRubricElement);
62
-
63
- function MultiTraitRubricElement() {
64
- var _this;
65
-
66
- (0, _classCallCheck2["default"])(this, MultiTraitRubricElement);
67
- _this = _super.call(this);
68
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateModelAccordingToReceivedProps", function (m) {
69
- var currentModel = _objectSpread({}, _this._model);
70
-
71
- if (!m) {
72
- return currentModel;
73
- }
74
-
75
- var validatedModel = _objectSpread({}, m);
76
-
77
- var _ref = validatedModel || {},
78
- scales = _ref.scales,
79
- excludeZero = _ref.excludeZero;
80
-
81
- (scales || []).forEach(function (scale) {
82
- if (!scale) {
83
- scale = {
84
- scorePointsLabels: [],
85
- traits: []
86
- };
87
- }
88
-
89
- var _ref2 = scale || {},
90
- maxPoints = _ref2.maxPoints;
91
-
92
- scale.scorePointsLabels = (0, _toConsumableArray2["default"])(scale.scorePointsLabels || []);
93
- scale.traits = (0, _toConsumableArray2["default"])(scale.traits || []);
94
- var howManyScorePointLabelsShouldHave = excludeZero ? maxPoints : maxPoints + 1;
95
- var howManyScorePointLabelsItHas = scale.scorePointsLabels.length;
96
-
97
- if (howManyScorePointLabelsItHas !== howManyScorePointLabelsShouldHave) {
98
- if (howManyScorePointLabelsItHas < howManyScorePointLabelsShouldHave) {
99
- for (var i = 0; i < howManyScorePointLabelsShouldHave - howManyScorePointLabelsItHas; i++) {
100
- scale.scorePointsLabels.push('');
101
- }
102
- } else {
103
- scale.scorePointsLabels = scale.scorePointsLabels.slice(0, howManyScorePointLabelsShouldHave);
104
- }
105
- }
106
-
107
- (scale.traits || []).forEach(function (trait) {
108
- if (!trait) {
109
- trait = {
110
- scorePointsDescriptors: []
111
- };
112
- }
113
-
114
- trait.scorePointsDescriptors = (0, _toConsumableArray2["default"])(trait.scorePointsDescriptors || []);
115
- var howManyScorePointDescriptorsItHas = trait.scorePointsDescriptors.length;
116
-
117
- if (howManyScorePointDescriptorsItHas !== howManyScorePointLabelsShouldHave) {
118
- if (howManyScorePointDescriptorsItHas < howManyScorePointLabelsShouldHave) {
119
- for (var _i = 0; _i < howManyScorePointLabelsShouldHave - howManyScorePointDescriptorsItHas; _i++) {
120
- trait.scorePointsDescriptors.push('');
121
- }
122
- } else {
123
- trait.scorePointsDescriptors = trait.scorePointsDescriptors.slice(0, howManyScorePointLabelsShouldHave);
124
- }
125
- }
126
- });
127
- });
128
-
129
- if (validatedModel.excludeZero) {
130
- // check if any scale has maxPoints set to 1
131
- var shouldAddColumn0 = validatedModel.scales.some(function (scale) {
132
- return scale.maxPoints === 1;
133
- });
134
-
135
- if (shouldAddColumn0) {
136
- // excludeZero should be false and disabled when maxPoints is 1
137
- validatedModel.excludeZero = false; // add column 0 for all scales
138
-
139
- validatedModel.scales = (0, _utils.addOrRemoveScaleColumn)(scales, _modals.excludeZeroTypes.add0);
140
- }
141
- }
142
-
143
- return validatedModel;
144
- });
145
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onModelChanged", function (m) {
146
- _this._model = _this.updateModelAccordingToReceivedProps(modelWithDefaults(m));
147
-
148
- _this._render();
149
-
150
- _this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(_this._model, false));
151
- });
152
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onConfigurationChanged", function (c) {
153
- _this._configuration = configurationWithDefaults(c);
154
-
155
- _this._render();
156
- });
157
- _this._model = modelWithDefaults();
158
- _this._configuration = configurationWithDefaults();
159
- return _this;
160
- }
161
-
162
- (0, _createClass2["default"])(MultiTraitRubricElement, [{
163
- key: "model",
164
- set: function set(m) {
165
- this._model = this.updateModelAccordingToReceivedProps(modelWithDefaults(m));
166
-
167
- this._render();
168
- }
169
- }, {
170
- key: "configuration",
171
- set: function set(c) {
172
- this._configuration = configurationWithDefaults(c);
173
-
174
- this._render();
175
- }
176
- }, {
177
- key: "insertSound",
178
- value: function insertSound(handler) {
179
- this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
180
- }
181
- }, {
182
- key: "onDeleteSound",
183
- value: function onDeleteSound(src, done) {
184
- this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
185
- }
186
- }, {
187
- key: "insertImage",
188
- value: function insertImage(handler) {
189
- this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
190
- }
191
- }, {
192
- key: "onDeleteImage",
193
- value: function onDeleteImage(src, done) {
194
- this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
195
- }
196
- }, {
197
- key: "_render",
198
- value: function _render() {
199
- if (this._model) {
200
- var element = /*#__PURE__*/_react["default"].createElement(_main["default"], {
201
- model: this._model,
202
- configuration: this._configuration,
203
- onModelChanged: this.onModelChanged,
204
- onConfigurationChanged: this.onConfigurationChanged,
205
- uploadSoundSupport: {
206
- add: this.insertSound.bind(this),
207
- "delete": this.onDeleteSound.bind(this)
208
- },
209
- imageSupport: {
210
- add: this.insertImage.bind(this),
211
- "delete": this.onDeleteImage.bind(this)
212
- }
213
- });
214
-
215
- _reactDom["default"].render(element, this);
216
- }
217
- }
218
- }]);
219
- return MultiTraitRubricElement;
220
- }( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
221
-
222
- exports["default"] = MultiTraitRubricElement;
223
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["modelWithDefaults","m","defaults","model","configurationWithDefaults","c","configuration","MultiTraitRubricElement","currentModel","_model","validatedModel","scales","excludeZero","forEach","scale","scorePointsLabels","traits","maxPoints","howManyScorePointLabelsShouldHave","howManyScorePointLabelsItHas","length","i","push","slice","trait","scorePointsDescriptors","howManyScorePointDescriptorsItHas","shouldAddColumn0","some","excludeZeroTypes","add0","updateModelAccordingToReceivedProps","_render","dispatchEvent","ModelUpdatedEvent","_configuration","handler","InsertSoundEvent","src","done","DeleteSoundEvent","InsertImageEvent","DeleteImageEvent","element","React","createElement","Main","onModelChanged","onConfigurationChanged","uploadSoundSupport","add","insertSound","bind","onDeleteSound","imageSupport","insertImage","onDeleteImage","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAQA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,CAAD;AAAA,yCAAaC,qBAASC,KAAtB,GAAgCF,CAAhC;AAAA,CAA1B;;AACA,IAAMG,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,CAAD;AAAA,yCAAaH,qBAASI,aAAtB,GAAwCD,CAAxC;AAAA,CAAlC;;IAEqBE,uB;;;;;AACnB,qCAAc;AAAA;;AAAA;AACZ;AADY,4HAMwB,UAACN,CAAD,EAAO;AAC3C,UAAMO,YAAY,qBAAQ,MAAKC,MAAb,CAAlB;;AAEA,UAAI,CAACR,CAAL,EAAQ;AACN,eAAOO,YAAP;AACD;;AAED,UAAME,cAAc,qBAAQT,CAAR,CAApB;;AACA,iBAAgCS,cAAc,IAAI,EAAlD;AAAA,UAAQC,MAAR,QAAQA,MAAR;AAAA,UAAgBC,WAAhB,QAAgBA,WAAhB;;AAEA,OAACD,MAAM,IAAI,EAAX,EAAeE,OAAf,CAAuB,UAACC,KAAD,EAAW;AAChC,YAAI,CAACA,KAAL,EAAY;AACVA,UAAAA,KAAK,GAAG;AAAEC,YAAAA,iBAAiB,EAAE,EAArB;AAAyBC,YAAAA,MAAM,EAAE;AAAjC,WAAR;AACD;;AAED,oBAAsBF,KAAK,IAAI,EAA/B;AAAA,YAAQG,SAAR,SAAQA,SAAR;;AAEAH,QAA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AA1B,CAAd;;AAeAK,6BAASC,MAAT,CAAgBf,OAAhB,EAAyB,IAAzB;AACD;AACF;;;kDArIkDgB,W","sourcesContent":["import {\n ModelUpdatedEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n InsertImageEvent,\n DeleteImageEvent,\n} from '@pie-framework/pie-configure-events';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport Main from './main';\nimport defaults from './defaults';\nimport { addOrRemoveScaleColumn } from './utils';\nimport { excludeZeroTypes } from './modals';\n\nconst modelWithDefaults = (m) => ({ ...defaults.model, ...m });\nconst configurationWithDefaults = (c) => ({ ...defaults.configuration, ...c });\n\nexport default class MultiTraitRubricElement extends HTMLElement {\n constructor() {\n super();\n this._model = modelWithDefaults();\n this._configuration = configurationWithDefaults();\n }\n\n updateModelAccordingToReceivedProps = (m) => {\n const currentModel = { ...this._model };\n\n if (!m) {\n return currentModel;\n }\n\n const validatedModel = { ...m };\n const { scales, excludeZero } = validatedModel || {};\n\n (scales || []).forEach((scale) => {\n if (!scale) {\n scale = { scorePointsLabels: [], traits: [] };\n }\n\n const { maxPoints } = scale || {};\n\n scale.scorePointsLabels = [...(scale.scorePointsLabels || [])];\n scale.traits = [...(scale.traits || [])];\n\n const howManyScorePointLabelsShouldHave = excludeZero ? maxPoints : maxPoints + 1;\n const howManyScorePointLabelsItHas = scale.scorePointsLabels.length;\n\n if (howManyScorePointLabelsItHas !== howManyScorePointLabelsShouldHave) {\n if (howManyScorePointLabelsItHas < howManyScorePointLabelsShouldHave) {\n for (let i = 0; i < howManyScorePointLabelsShouldHave - howManyScorePointLabelsItHas; i++) {\n scale.scorePointsLabels.push('');\n }\n } else {\n scale.scorePointsLabels = scale.scorePointsLabels.slice(0, howManyScorePointLabelsShouldHave);\n }\n }\n\n (scale.traits || []).forEach((trait) => {\n if (!trait) {\n trait = { scorePointsDescriptors: [] };\n }\n\n trait.scorePointsDescriptors = [...(trait.scorePointsDescriptors || [])];\n\n const howManyScorePointDescriptorsItHas = trait.scorePointsDescriptors.length;\n\n if (howManyScorePointDescriptorsItHas !== howManyScorePointLabelsShouldHave) {\n if (howManyScorePointDescriptorsItHas < howManyScorePointLabelsShouldHave) {\n for (let i = 0; i < howManyScorePointLabelsShouldHave - howManyScorePointDescriptorsItHas; i++) {\n trait.scorePointsDescriptors.push('');\n }\n } else {\n trait.scorePointsDescriptors = trait.scorePointsDescriptors.slice(0, howManyScorePointLabelsShouldHave);\n }\n }\n });\n });\n\n if (validatedModel.excludeZero) {\n // check if any scale has maxPoints set to 1\n const shouldAddColumn0 = validatedModel.scales.some((scale) => scale.maxPoints === 1);\n\n if (shouldAddColumn0) {\n // excludeZero should be false and disabled when maxPoints is 1\n validatedModel.excludeZero = false;\n // add column 0 for all scales\n validatedModel.scales = addOrRemoveScaleColumn(scales, excludeZeroTypes.add0);\n }\n }\n\n return validatedModel;\n };\n\n set model(m) {\n this._model = this.updateModelAccordingToReceivedProps(modelWithDefaults(m));\n this._render();\n }\n\n set configuration(c) {\n this._configuration = configurationWithDefaults(c);\n this._render();\n }\n\n onModelChanged = (m) => {\n this._model = this.updateModelAccordingToReceivedProps(modelWithDefaults(m));\n this._render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n };\n\n onConfigurationChanged = (c) => {\n this._configuration = configurationWithDefaults(c);\n\n this._render();\n };\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n }\n\n _render() {\n if (this._model) {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this),\n },\n });\n\n ReactDOM.render(element, this);\n }\n }\n}\n"],"file":"index.js"}