@pie-element/multi-trait-rubric 8.1.2-next.2 → 8.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +1 -0
- package/CHANGELOG.md +1590 -0
- package/LICENSE.md +5 -0
- package/README.md +55 -0
- package/configure/CHANGELOG.json +1 -0
- package/configure/CHANGELOG.md +1485 -0
- package/configure/lib/common.js +424 -0
- package/configure/lib/common.js.map +1 -0
- package/configure/lib/defaults.js +184 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +157 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +454 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/lib/modals.js +206 -0
- package/configure/lib/modals.js.map +1 -0
- package/configure/lib/scale.js +478 -0
- package/configure/lib/scale.js.map +1 -0
- package/configure/lib/trait.js +275 -0
- package/configure/lib/trait.js.map +1 -0
- package/configure/lib/traitsHeader.js +235 -0
- package/configure/lib/traitsHeader.js.map +1 -0
- package/configure/lib/utils.js +87 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +24 -0
- package/controller/CHANGELOG.json +1 -0
- package/controller/CHANGELOG.md +911 -0
- package/controller/lib/defaults.js +18 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +158 -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 +14 -0
- package/docs/config-schema.json +1628 -0
- package/docs/config-schema.json.md +1202 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +117 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +6 -0
- package/docs/pie-schema.json +861 -0
- package/docs/pie-schema.json.md +614 -0
- package/lib/index.js +54 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +123 -0
- package/lib/main.js.map +1 -0
- package/lib/scale.js +248 -0
- package/lib/scale.js.map +1 -0
- package/lib/trait.js +83 -0
- package/lib/trait.js.map +1 -0
- package/package.json +15 -84
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/common.d.ts +0 -90
- package/dist/author/common.js +0 -275
- package/dist/author/defaults.d.ts +0 -153
- package/dist/author/defaults.js +0 -113
- package/dist/author/index.d.ts +0 -22
- package/dist/author/index.js +0 -89
- package/dist/author/main.d.ts +0 -43
- package/dist/author/main.js +0 -247
- package/dist/author/modals.d.ts +0 -94
- package/dist/author/modals.js +0 -171
- package/dist/author/scale.d.ts +0 -46
- package/dist/author/scale.js +0 -280
- package/dist/author/trait.d.ts +0 -70
- package/dist/author/trait.js +0 -202
- package/dist/author/traitsHeader.d.ts +0 -28
- package/dist/author/traitsHeader.js +0 -172
- package/dist/author/utils.d.ts +0 -10
- package/dist/author/utils.js +0 -41
- package/dist/browser/Typography-CGQjcqGj.js +0 -9000
- package/dist/browser/Typography-CGQjcqGj.js.map +0 -1
- package/dist/browser/author/index.js +0 -41731
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/controller/index.js +0 -70
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -523
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/multi-trait-rubric.css +0 -2
- package/dist/controller/defaults.d.ts +0 -20
- package/dist/controller/defaults.js +0 -14
- package/dist/controller/index.d.ts +0 -26
- package/dist/controller/index.js +0 -57
- package/dist/controller/utils.d.ts +0 -9
- package/dist/controller/utils.js +0 -4
- package/dist/delivery/index.d.ts +0 -17
- package/dist/delivery/index.js +0 -37
- package/dist/delivery/main.d.ts +0 -15
- package/dist/delivery/main.js +0 -95
- package/dist/delivery/scale.d.ts +0 -17
- package/dist/delivery/scale.js +0 -175
- package/dist/delivery/trait.d.ts +0 -27
- package/dist/delivery/trait.js +0 -44
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -145
- package/dist/index.js +0 -2
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/controller/src/defaults.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
|
-
declare const _default: {
|
|
10
|
-
addScaleEnabled: boolean;
|
|
11
|
-
description: boolean;
|
|
12
|
-
excludeZero: boolean;
|
|
13
|
-
halfScoring: boolean;
|
|
14
|
-
maxPointsEnabled: boolean;
|
|
15
|
-
pointLabels: boolean;
|
|
16
|
-
scales: never[];
|
|
17
|
-
standards: boolean;
|
|
18
|
-
visibleToStudent: boolean;
|
|
19
|
-
};
|
|
20
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/controller/defaults.ts
|
|
2
|
-
var e = {
|
|
3
|
-
addScaleEnabled: !0,
|
|
4
|
-
description: !1,
|
|
5
|
-
excludeZero: !1,
|
|
6
|
-
halfScoring: !1,
|
|
7
|
-
maxPointsEnabled: !0,
|
|
8
|
-
pointLabels: !0,
|
|
9
|
-
scales: [],
|
|
10
|
-
standards: !1,
|
|
11
|
-
visibleToStudent: !0
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
export { e as default };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/controller/src/index.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 function createDefaultModel(model?: {}): Promise<unknown>;
|
|
10
|
-
export declare const normalize: (question: any) => any;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param {*} question
|
|
14
|
-
* @param {*} session
|
|
15
|
-
* @param {*} env
|
|
16
|
-
*/
|
|
17
|
-
export declare function model(question: any, session: any, env: any): Promise<any>;
|
|
18
|
-
export declare const getScore: () => number;
|
|
19
|
-
/**
|
|
20
|
-
* @param {Object} model - the main model
|
|
21
|
-
* @param {*} session
|
|
22
|
-
* @param {Object} env
|
|
23
|
-
*/
|
|
24
|
-
export declare function outcome(): Promise<unknown>;
|
|
25
|
-
export declare const createCorrectResponseSession: (question: any, env: any) => Promise<unknown>;
|
|
26
|
-
export declare const validate: (model: any, config: any) => {};
|
package/dist/controller/index.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import e from "./defaults.js";
|
|
2
|
-
import { markupToText as t } from "./utils.js";
|
|
3
|
-
//#region src/controller/index.ts
|
|
4
|
-
function n(t = {}) {
|
|
5
|
-
return new Promise((n) => n({
|
|
6
|
-
...e,
|
|
7
|
-
...t
|
|
8
|
-
}));
|
|
9
|
-
}
|
|
10
|
-
var r = (t) => ({
|
|
11
|
-
...e,
|
|
12
|
-
...t
|
|
13
|
-
});
|
|
14
|
-
async function i(e, t, n) {
|
|
15
|
-
let i = r(e);
|
|
16
|
-
!n.role || n.role === "student" ? i.visible = i.visibleToStudent : i.visible = !0;
|
|
17
|
-
let { scales: a, excludeZero: o } = i || {}, s = (a || []).map((e) => ({
|
|
18
|
-
...e,
|
|
19
|
-
excludeZero: o
|
|
20
|
-
}));
|
|
21
|
-
return {
|
|
22
|
-
...i,
|
|
23
|
-
scales: s
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
var a = () => 0;
|
|
27
|
-
function o() {
|
|
28
|
-
return new Promise((e) => e({
|
|
29
|
-
score: 0,
|
|
30
|
-
empty: !0
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
var s = (e, t) => new Promise((e) => {
|
|
34
|
-
t.mode !== "evaluate" && t.role === "instructor" ? e({ id: "1" }) : e(null);
|
|
35
|
-
}), c = (e, n) => {
|
|
36
|
-
let { scales: r, description: i = !1, pointLabels: a = !1 } = e, o = {}, s = {}, c = {};
|
|
37
|
-
return (r || []).forEach((e, n) => {
|
|
38
|
-
let { traits: r = [] } = e, { scorePointsLabels: o = [] } = e, l = {}, u = {};
|
|
39
|
-
a && o.forEach((e, n) => {
|
|
40
|
-
!e || e === "<div></div>" ? u[n] = "Points labels should not be empty." : o.slice(n + 1).some((n) => t(n) === t(e)) && (u[n] = "Points labels should be unique.");
|
|
41
|
-
}), Object.keys(u).length > 0 && (c[n] = u), r.forEach((e, n) => {
|
|
42
|
-
if (!e.name || e.name === "<div></div>" ? l[n] = { name: "Trait names should not be empty." } : r.slice(n + 1).some((n) => t(n.name) === t(e.name)) && (l[n] = { name: "Trait names should be unique." }), i && (!e.description || e.description === "<div></div>")) l[n] = {
|
|
43
|
-
...l[n],
|
|
44
|
-
description: "Trait description should not be empty"
|
|
45
|
-
};
|
|
46
|
-
else {
|
|
47
|
-
let a = r.slice(n + 1).some((n) => t(n.description) === t(e.description));
|
|
48
|
-
i && a && (l[n] = {
|
|
49
|
-
...l[n],
|
|
50
|
-
description: "Trait descriptions should be unique."
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}), Object.keys(l).length > 0 && (s[n] = l);
|
|
54
|
-
}), Object.keys(s).length > 0 && (o.traitsErrors = s), Object.keys(c).length > 0 && (o.scorePointsErrors = c), o;
|
|
55
|
-
};
|
|
56
|
-
//#endregion
|
|
57
|
-
export { s as createCorrectResponseSession, n as createDefaultModel, a as getScore, i as model, r as normalize, o as outcome, c as validate };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/controller/src/utils.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 markupToText: (s: any) => any;
|
package/dist/controller/utils.js
DELETED
package/dist/delivery/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/src/index.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 default class MultiTraitRubric extends HTMLElement {
|
|
10
|
-
constructor();
|
|
11
|
-
set model(s: any);
|
|
12
|
-
set session(s: any);
|
|
13
|
-
get session(): any;
|
|
14
|
-
connectedCallback(): void;
|
|
15
|
-
_render(): void;
|
|
16
|
-
disconnectedCallback(): void;
|
|
17
|
-
}
|
package/dist/delivery/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import e from "./main.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import { createRoot as n } from "react-dom/client";
|
|
4
|
-
import { ModelSetEvent as r } from "@pie-element/shared-player-events";
|
|
5
|
-
import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
|
|
6
|
-
//#region src/delivery/index.ts
|
|
7
|
-
var a = class extends HTMLElement {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(), this._model = {}, this._session = null, this._root = null;
|
|
10
|
-
}
|
|
11
|
-
set model(e) {
|
|
12
|
-
this._model = e, this.dispatchEvent(new r(this.tagName.toLowerCase(), this._session, !!this._model)), this._render();
|
|
13
|
-
}
|
|
14
|
-
set session(e) {
|
|
15
|
-
this._session = e;
|
|
16
|
-
}
|
|
17
|
-
get session() {
|
|
18
|
-
return this._session;
|
|
19
|
-
}
|
|
20
|
-
connectedCallback() {
|
|
21
|
-
this._render();
|
|
22
|
-
}
|
|
23
|
-
_render() {
|
|
24
|
-
let r = t.createElement(e, {
|
|
25
|
-
model: this._model,
|
|
26
|
-
session: this._session
|
|
27
|
-
});
|
|
28
|
-
this._root ||= n(this), this._root.render(r), queueMicrotask(() => {
|
|
29
|
-
i(this);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
disconnectedCallback() {
|
|
33
|
-
this._root && this._root.unmount();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
export { a as default };
|
package/dist/delivery/main.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/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
|
-
declare class Main extends React.Component {
|
|
11
|
-
constructor(props: any);
|
|
12
|
-
toggleRubric(): void;
|
|
13
|
-
render(): React.JSX.Element | null;
|
|
14
|
-
}
|
|
15
|
-
export default Main;
|
package/dist/delivery/main.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import e from "./scale.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import n from "prop-types";
|
|
4
|
-
import * as r from "@pie-lib/render-ui";
|
|
5
|
-
import { UiLayout as i, color as a } from "@pie-lib/render-ui";
|
|
6
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
import c from "@mui/material/Link";
|
|
8
|
-
import l from "@mui/material/Collapse";
|
|
9
|
-
//#region src/delivery/main.tsx
|
|
10
|
-
function u(e) {
|
|
11
|
-
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
12
|
-
}
|
|
13
|
-
function d(e, t) {
|
|
14
|
-
return !e || u(e) ? e : u(e.default) ? e.default : t && u(e[t]) ? e[t] : t && u(e[t]?.default) ? e[t].default : e;
|
|
15
|
-
}
|
|
16
|
-
var f = d(i, "UiLayout") || d(h.UiLayout, "UiLayout"), p = r, m = p.default, h = m && typeof m == "object" ? m : p, g = class extends t.Component {
|
|
17
|
-
constructor(e) {
|
|
18
|
-
super(e), this.state = {
|
|
19
|
-
rubricOpen: !1,
|
|
20
|
-
linkPrefix: "Show"
|
|
21
|
-
}, this.toggleRubric = this.toggleRubric.bind(this);
|
|
22
|
-
}
|
|
23
|
-
toggleRubric() {
|
|
24
|
-
this.setState({ rubricOpen: !this.state.rubricOpen }), this.setState({ linkPrefix: this.state.rubricOpen ? "Show" : "Hide" });
|
|
25
|
-
}
|
|
26
|
-
render() {
|
|
27
|
-
let { model: t } = this.props, { animationsDisabled: n } = this.props, { extraCSSRules: r, halfScoring: i, scales: u, visible: d, pointLabels: p, description: m, standards: h, arrowsDisabled: g } = t || {};
|
|
28
|
-
if (n ||= t.animationsDisabled, !u || !d) return null;
|
|
29
|
-
let _ = /* @__PURE__ */ s(f, {
|
|
30
|
-
extraCSSRules: r,
|
|
31
|
-
style: {
|
|
32
|
-
fontFamily: "Cerebri Sans",
|
|
33
|
-
color: a.text(),
|
|
34
|
-
backgroundColor: a.background()
|
|
35
|
-
},
|
|
36
|
-
children: [i ? /* @__PURE__ */ o("div", {
|
|
37
|
-
style: { marginBottom: "16px" },
|
|
38
|
-
children: "* Half-point or in-between scores are permitted under this rubric."
|
|
39
|
-
}) : null, u.map((t, n) => /* @__PURE__ */ o(e, {
|
|
40
|
-
scale: t,
|
|
41
|
-
scaleIndex: n,
|
|
42
|
-
showPointsLabels: p,
|
|
43
|
-
showDescription: m,
|
|
44
|
-
showStandards: h,
|
|
45
|
-
arrowsDisabled: g
|
|
46
|
-
}, `scale_${n}`))]
|
|
47
|
-
});
|
|
48
|
-
return n ? _ : /* @__PURE__ */ s(f, {
|
|
49
|
-
extraCSSRules: r,
|
|
50
|
-
style: {
|
|
51
|
-
color: a.text(),
|
|
52
|
-
backgroundColor: a.background()
|
|
53
|
-
},
|
|
54
|
-
children: [/* @__PURE__ */ s(c, {
|
|
55
|
-
style: { backgroundColor: a.background() },
|
|
56
|
-
href: this.dudUrl,
|
|
57
|
-
onClick: this.toggleRubric,
|
|
58
|
-
children: [this.state.linkPrefix, " Rubric"]
|
|
59
|
-
}), /* @__PURE__ */ o(l, {
|
|
60
|
-
style: { marginTop: "16px" },
|
|
61
|
-
in: this.state.rubricOpen,
|
|
62
|
-
timeout: {
|
|
63
|
-
enter: 225,
|
|
64
|
-
exit: 195
|
|
65
|
-
},
|
|
66
|
-
children: _
|
|
67
|
-
})]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
g.propTypes = {
|
|
72
|
-
model: n.shape({
|
|
73
|
-
halfScoring: n.bool,
|
|
74
|
-
scales: n.arrayOf(n.shape({
|
|
75
|
-
excludeZero: n.bool,
|
|
76
|
-
maxPoints: n.number,
|
|
77
|
-
scorePointsLabels: n.arrayOf(n.string),
|
|
78
|
-
traitLabel: n.string,
|
|
79
|
-
traits: n.arrayOf(n.shape({
|
|
80
|
-
name: n.string,
|
|
81
|
-
description: n.string,
|
|
82
|
-
scorePointsDescriptors: n.arrayOf(n.string),
|
|
83
|
-
standards: n.arrayOf(n.string)
|
|
84
|
-
}))
|
|
85
|
-
})),
|
|
86
|
-
visible: n.bool,
|
|
87
|
-
pointLabels: n.bool,
|
|
88
|
-
description: n.bool,
|
|
89
|
-
standards: n.bool,
|
|
90
|
-
animationsDisabled: n.bool
|
|
91
|
-
}),
|
|
92
|
-
animationsDisabled: n.bool
|
|
93
|
-
};
|
|
94
|
-
//#endregion
|
|
95
|
-
export { g as default };
|
package/dist/delivery/scale.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/src/scale.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
|
-
declare class Scale extends React.Component {
|
|
11
|
-
state: {};
|
|
12
|
-
componentDidMount(): void;
|
|
13
|
-
scrollLeft: any;
|
|
14
|
-
scrollRight: any;
|
|
15
|
-
render(): React.JSX.Element;
|
|
16
|
-
}
|
|
17
|
-
export default Scale;
|
package/dist/delivery/scale.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import e from "./trait.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import n from "prop-types";
|
|
4
|
-
import { styled as r } from "@mui/material/styles";
|
|
5
|
-
import { color as i } from "@pie-lib/render-ui";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
import s from "@mui/icons-material/ArrowBackIos";
|
|
8
|
-
import c from "@mui/icons-material/ArrowForwardIos";
|
|
9
|
-
//#region src/delivery/scale.tsx
|
|
10
|
-
var l = r("div")({
|
|
11
|
-
display: "flex",
|
|
12
|
-
position: "relative"
|
|
13
|
-
}), u = r("div")({
|
|
14
|
-
width: "100%",
|
|
15
|
-
overflow: "auto"
|
|
16
|
-
}), d = r("table")(({ theme: e }) => ({
|
|
17
|
-
borderSpacing: 0,
|
|
18
|
-
marginBottom: e.spacing(2),
|
|
19
|
-
borderRadius: "4px",
|
|
20
|
-
color: i.text(),
|
|
21
|
-
fontSize: e.typography.fontSize,
|
|
22
|
-
lineHeight: "16px",
|
|
23
|
-
overflow: "unset",
|
|
24
|
-
"& ul, ol": {
|
|
25
|
-
marginBlockStart: 0,
|
|
26
|
-
paddingInlineStart: e.spacing(2)
|
|
27
|
-
},
|
|
28
|
-
"& th": {
|
|
29
|
-
padding: e.spacing(2),
|
|
30
|
-
textAlign: "left",
|
|
31
|
-
backgroundColor: i.secondaryBackground(),
|
|
32
|
-
verticalAlign: "bottom"
|
|
33
|
-
},
|
|
34
|
-
"& th div": { width: "200px" },
|
|
35
|
-
"& td": {
|
|
36
|
-
width: "200px",
|
|
37
|
-
padding: `${e.spacing(2)} ${e.spacing(1)}`,
|
|
38
|
-
verticalAlign: "top"
|
|
39
|
-
}
|
|
40
|
-
})), f = r("table")({ "& td": {
|
|
41
|
-
border: 0,
|
|
42
|
-
padding: 0,
|
|
43
|
-
textAlign: "center",
|
|
44
|
-
minWidth: "200px"
|
|
45
|
-
} }), p = r("div")({ marginBottom: "4px" }), m = r("td")({ fontWeight: "normal" }), h = ({ show: e, onClick: t, extraStyles: n, children: r }) => /* @__PURE__ */ a("div", {
|
|
46
|
-
style: {
|
|
47
|
-
height: "calc(100% - 1px)",
|
|
48
|
-
top: "1px",
|
|
49
|
-
display: e ? "flex" : "none",
|
|
50
|
-
width: "50px",
|
|
51
|
-
margin: "auto",
|
|
52
|
-
position: "absolute",
|
|
53
|
-
alignItems: "center",
|
|
54
|
-
justifyContent: "center",
|
|
55
|
-
cursor: "pointer",
|
|
56
|
-
...n
|
|
57
|
-
},
|
|
58
|
-
onClick: t,
|
|
59
|
-
children: r
|
|
60
|
-
});
|
|
61
|
-
h.propTypes = {
|
|
62
|
-
show: n.bool,
|
|
63
|
-
onClick: n.func,
|
|
64
|
-
extraStyles: n.object,
|
|
65
|
-
children: n.object
|
|
66
|
-
};
|
|
67
|
-
var g = class extends t.Component {
|
|
68
|
-
state = {};
|
|
69
|
-
componentDidMount() {
|
|
70
|
-
this.tableWrapper && this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth && this.setState({ showRight: !0 });
|
|
71
|
-
}
|
|
72
|
-
scrollLeft = () => {
|
|
73
|
-
this.tableWrapper.scrollLeft -= this.tableWrapper.offsetWidth / 2, this.setState({
|
|
74
|
-
showRight: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,
|
|
75
|
-
showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
scrollRight = () => {
|
|
79
|
-
let e = this.tableWrapper.scrollLeft;
|
|
80
|
-
this.tableWrapper.scrollLeft += this.tableWrapper.offsetWidth / 2, this.setState({
|
|
81
|
-
showRight: e !== this.tableWrapper.scrollLeft && this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,
|
|
82
|
-
showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
render() {
|
|
86
|
-
let { showRight: t, showLeft: n } = this.state, { scale: r, scaleIndex: g, showDescription: _, showPointsLabels: v, showStandards: y, arrowsDisabled: b } = this.props, { excludeZero: x, maxPoints: S, traitLabel: C, traits: w, scorePointsLabels: T } = r || {}, E = [], D, O, k;
|
|
87
|
-
try {
|
|
88
|
-
for (let e = S; +(e >= x); --e) E.push(e);
|
|
89
|
-
let { traitStandards: e, traitDescriptions: t } = w.reduce((e, t) => ({
|
|
90
|
-
traitStandards: [...e.traitStandards, ...t.standards || []],
|
|
91
|
-
traitDescriptions: [...e.traitDescriptions, ...t.description || []]
|
|
92
|
-
}), {
|
|
93
|
-
traitStandards: [],
|
|
94
|
-
traitDescriptions: []
|
|
95
|
-
});
|
|
96
|
-
D = _ && t.length, O = v && T.length, k = y && e.length;
|
|
97
|
-
} catch {
|
|
98
|
-
D = !1, O = !1, k = !1;
|
|
99
|
-
}
|
|
100
|
-
return /* @__PURE__ */ o(l, { children: [
|
|
101
|
-
/* @__PURE__ */ a(h, {
|
|
102
|
-
show: n && !b,
|
|
103
|
-
onClick: this.scrollLeft,
|
|
104
|
-
extraStyles: {
|
|
105
|
-
left: 0,
|
|
106
|
-
background: `linear-gradient(to right, white, ${i.background()})`
|
|
107
|
-
},
|
|
108
|
-
children: /* @__PURE__ */ a(s, {})
|
|
109
|
-
}),
|
|
110
|
-
/* @__PURE__ */ o(u, {
|
|
111
|
-
ref: (e) => {
|
|
112
|
-
this.tableWrapper = e;
|
|
113
|
-
},
|
|
114
|
-
onScroll: () => {
|
|
115
|
-
this.setState({
|
|
116
|
-
showRight: this.tableWrapper.scrollLeft + this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth - 5 && this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,
|
|
117
|
-
showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0
|
|
118
|
-
});
|
|
119
|
-
},
|
|
120
|
-
children: [b && (t || n) ? /* @__PURE__ */ a("div", { children: "The item is too large to fit in print mode." }) : null, /* @__PURE__ */ o(d, { children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [
|
|
121
|
-
/* @__PURE__ */ a("th", { children: /* @__PURE__ */ a("div", { dangerouslySetInnerHTML: { __html: C } }) }),
|
|
122
|
-
k ? /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a("div", { children: "Standard(s)" }) }) : null,
|
|
123
|
-
D ? /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a("div", { children: "Description" }) }) : null,
|
|
124
|
-
E && E.map((e, t) => {
|
|
125
|
-
let n = "";
|
|
126
|
-
try {
|
|
127
|
-
n = T[E.length - t - 1] || "";
|
|
128
|
-
} catch {
|
|
129
|
-
n = "";
|
|
130
|
-
}
|
|
131
|
-
return /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(f, { children: /* @__PURE__ */ o("thead", { children: [O ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(p, { dangerouslySetInnerHTML: { __html: n } }) }) }) : null, /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(m, { children: e === 1 ? `${e} point` : `${e} points` }) })] }) }) }, `table-header-${t}`);
|
|
132
|
-
})
|
|
133
|
-
] }) }), /* @__PURE__ */ a("tbody", { children: w && w.map((t, n) => /* @__PURE__ */ a(e, {
|
|
134
|
-
trait: t,
|
|
135
|
-
traitIndex: n,
|
|
136
|
-
showDescription: !!D,
|
|
137
|
-
showStandards: !!k,
|
|
138
|
-
scaleIndex: g,
|
|
139
|
-
scorePointsValues: E,
|
|
140
|
-
excludeZero: x
|
|
141
|
-
}, `trait_${g}_${n}`)) })] }, `scale-${g}`)]
|
|
142
|
-
}),
|
|
143
|
-
/* @__PURE__ */ a(h, {
|
|
144
|
-
show: t && !b,
|
|
145
|
-
onClick: this.scrollRight,
|
|
146
|
-
extraStyles: {
|
|
147
|
-
right: 0,
|
|
148
|
-
background: `linear-gradient(to left, white, ${i.background()})`
|
|
149
|
-
},
|
|
150
|
-
children: /* @__PURE__ */ a(c, {})
|
|
151
|
-
})
|
|
152
|
-
] });
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
g.propTypes = {
|
|
156
|
-
scaleIndex: n.number,
|
|
157
|
-
scale: n.shape({
|
|
158
|
-
excludeZero: n.bool,
|
|
159
|
-
maxPoints: n.number,
|
|
160
|
-
scorePointsLabels: n.arrayOf(n.string),
|
|
161
|
-
traitLabel: n.string,
|
|
162
|
-
traits: n.arrayOf(n.shape({
|
|
163
|
-
name: n.string,
|
|
164
|
-
standards: n.arrayOf(n.string),
|
|
165
|
-
scorePointsDescriptors: n.arrayOf(n.string),
|
|
166
|
-
description: n.string
|
|
167
|
-
}))
|
|
168
|
-
}),
|
|
169
|
-
showPointsLabels: n.bool,
|
|
170
|
-
showDescription: n.bool,
|
|
171
|
-
showStandards: n.bool,
|
|
172
|
-
arrowsDisabled: n.bool
|
|
173
|
-
};
|
|
174
|
-
//#endregion
|
|
175
|
-
export { g as default };
|
package/dist/delivery/trait.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/multi-trait-rubric/src/trait.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 Trait: {
|
|
12
|
-
(props: any): React.JSX.Element;
|
|
13
|
-
propTypes: {
|
|
14
|
-
showStandards: PropTypes.Requireable<boolean>;
|
|
15
|
-
showDescription: PropTypes.Requireable<boolean>;
|
|
16
|
-
scorePointsValues: PropTypes.Requireable<(number | null | undefined)[]>;
|
|
17
|
-
scaleIndex: PropTypes.Requireable<number>;
|
|
18
|
-
traitIndex: PropTypes.Requireable<number>;
|
|
19
|
-
trait: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
|
-
name: PropTypes.Requireable<string>;
|
|
21
|
-
standards: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
22
|
-
scorePointsDescriptors: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
23
|
-
description: PropTypes.Requireable<string>;
|
|
24
|
-
}>>;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export default Trait;
|
package/dist/delivery/trait.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import e from "prop-types";
|
|
3
|
-
import { styled as t } from "@mui/material/styles";
|
|
4
|
-
import { color as n } from "@pie-lib/render-ui";
|
|
5
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
-
//#region src/delivery/trait.tsx
|
|
7
|
-
var a = t("td")({
|
|
8
|
-
color: n.primaryDark(),
|
|
9
|
-
verticalAlign: "middle"
|
|
10
|
-
}), o = t("div")({
|
|
11
|
-
color: n.secondaryBackground(),
|
|
12
|
-
textAlign: "center"
|
|
13
|
-
}), s = (e) => {
|
|
14
|
-
let { trait: t, traitIndex: n, scaleIndex: s, showStandards: c, showDescription: l, scorePointsValues: u } = e, { name: d, standards: f, scorePointsDescriptors: p, description: m } = t || {};
|
|
15
|
-
return /* @__PURE__ */ i("tr", { children: [
|
|
16
|
-
/* @__PURE__ */ r(a, { children: /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: d } }) }),
|
|
17
|
-
c ? /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: f.join(",") } }) }) : null,
|
|
18
|
-
l ? /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: m } }) }) : null,
|
|
19
|
-
u && u.map((e, t) => {
|
|
20
|
-
let n;
|
|
21
|
-
try {
|
|
22
|
-
n = p[u.length - t - 1] || "";
|
|
23
|
-
} catch {
|
|
24
|
-
n = "";
|
|
25
|
-
}
|
|
26
|
-
return /* @__PURE__ */ r("td", { children: n ? /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ r(o, { dangerouslySetInnerHTML: { __html: "No Description" } }) }, `table-cell-${t}`);
|
|
27
|
-
})
|
|
28
|
-
] }, `scale-${s}-trait-${n}`);
|
|
29
|
-
};
|
|
30
|
-
s.propTypes = {
|
|
31
|
-
showStandards: e.bool,
|
|
32
|
-
showDescription: e.bool,
|
|
33
|
-
scorePointsValues: e.arrayOf(e.number),
|
|
34
|
-
scaleIndex: e.number,
|
|
35
|
-
traitIndex: e.number,
|
|
36
|
-
trait: e.shape({
|
|
37
|
-
name: e.string,
|
|
38
|
-
standards: e.arrayOf(e.string),
|
|
39
|
-
scorePointsDescriptors: e.arrayOf(e.string),
|
|
40
|
-
description: e.string
|
|
41
|
-
})
|
|
42
|
-
};
|
|
43
|
-
//#endregion
|
|
44
|
-
export { s as default };
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './delivery/index.js';
|
package/dist/index.iife.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IIFE entry point for multi-trait-rubric element
|
|
3
|
-
* This file is only used for IIFE builds and includes auto-registration
|
|
4
|
-
*
|
|
5
|
-
* @sync-generated - Auto-generated during sync from pie-elements
|
|
6
|
-
*/
|
|
7
|
-
import Element from './index.js';
|
|
8
|
-
export default Element;
|