@pie-element/fraction-model 6.1.1 → 6.1.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/author/card-bar.d.ts +20 -0
- package/dist/author/card-bar.js +40 -0
- package/dist/author/defaults.d.ts +113 -0
- package/dist/author/defaults.js +84 -0
- package/dist/author/index.d.ts +44 -0
- package/dist/author/index.js +88 -0
- package/dist/author/main.d.ts +25 -0
- package/dist/author/main.js +156 -0
- package/dist/author/model-options.d.ts +32 -0
- package/dist/author/model-options.js +85 -0
- package/dist/author/number-text-field.d.ts +15 -0
- package/dist/author/number-text-field.js +24 -0
- package/dist/browser/author/index.js +36733 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/controller/index.js +78 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +2 -0
- package/dist/browser/delivery-BwB7hVA6.js +27725 -0
- package/dist/browser/delivery-BwB7hVA6.js.map +1 -0
- package/dist/browser/dist-DSzihwLW.js +85 -0
- package/dist/browser/dist-DSzihwLW.js.map +1 -0
- package/dist/browser/fraction-model.css +2 -0
- package/dist/controller/defaults.d.ts +21 -0
- package/dist/controller/defaults.js +13 -0
- package/dist/controller/index.d.ts +23 -0
- package/dist/controller/index.js +68 -0
- package/dist/delivery/answer-fraction.d.ts +27 -0
- package/dist/delivery/answer-fraction.js +69 -0
- package/dist/delivery/fraction-model-chart.d.ts +11 -0
- package/dist/delivery/fraction-model-chart.js +154 -0
- package/dist/delivery/index.d.ts +22 -0
- package/dist/delivery/index.js +54 -0
- package/dist/delivery/main.d.ts +38 -0
- package/dist/delivery/main.js +136 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +179 -0
- package/dist/index.js +2 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +83 -19
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -588
- package/LICENSE.md +0 -5
- package/README.md +0 -18
- package/configure/CHANGELOG.json +0 -1
- package/configure/CHANGELOG.md +0 -553
- package/configure/lib/card-bar.js +0 -57
- package/configure/lib/card-bar.js.map +0 -1
- package/configure/lib/defaults.js +0 -114
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -163
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -253
- package/configure/lib/main.js.map +0 -1
- package/configure/lib/model-options.js +0 -144
- package/configure/lib/model-options.js.map +0 -1
- package/configure/lib/number-text-field.js +0 -47
- package/configure/lib/number-text-field.js.map +0 -1
- package/configure/package.json +0 -24
- package/controller/CHANGELOG.json +0 -1
- package/controller/CHANGELOG.md +0 -480
- package/controller/lib/defaults.js +0 -20
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -215
- package/controller/lib/index.js.map +0 -1
- package/controller/package.json +0 -15
- package/docs/config-schema.json +0 -1796
- package/docs/config-schema.json.md +0 -1318
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -6
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -6
- package/docs/pie-schema.json +0 -873
- package/docs/pie-schema.json.md +0 -639
- package/lib/answer-fraction.js +0 -109
- package/lib/answer-fraction.js.map +0 -1
- package/lib/fraction-model-chart.js +0 -279
- package/lib/fraction-model-chart.js.map +0 -1
- package/lib/index.js +0 -91
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -203
- package/lib/main.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import e from "./card-bar.js";
|
|
2
|
+
import { MiniField as t } from "./number-text-field.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { Checkbox as s } from "@pie-lib/config-ui";
|
|
8
|
+
import { cloneDeep as c } from "@pie-element/shared-lodash";
|
|
9
|
+
import l from "@mui/material/Select";
|
|
10
|
+
import u from "@mui/material/MenuItem";
|
|
11
|
+
//#region src/author/model-options.tsx
|
|
12
|
+
var d = i("div")({
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
display: "flex",
|
|
15
|
+
gap: "20px"
|
|
16
|
+
}), f = i("div")({ margin: "12px 0" }), p = i("label")({
|
|
17
|
+
display: "block",
|
|
18
|
+
marginBottom: "4px"
|
|
19
|
+
}), m = i(l)({
|
|
20
|
+
width: "80px",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
height: "40px",
|
|
23
|
+
verticalAlign: "top",
|
|
24
|
+
marginBottom: "8px",
|
|
25
|
+
"& .MuiSelect-select": { paddingLeft: "10px" }
|
|
26
|
+
}), h = i("div")({ marginLeft: "-15px" }), g = i("span")({ verticalAlign: "middle" }), _ = class extends n.Component {
|
|
27
|
+
static propTypes = {
|
|
28
|
+
model: r.object.isRequired,
|
|
29
|
+
onChange: r.func,
|
|
30
|
+
modelOptions: r.object.isRequired
|
|
31
|
+
};
|
|
32
|
+
constructor(e) {
|
|
33
|
+
super(e), this.changeMaxModel = this.change.bind(this, "max"), this.changePartModel = this.change.bind(this, "part"), this.studentConfig = this.change.bind(this, "student-config");
|
|
34
|
+
}
|
|
35
|
+
change(e, t, n) {
|
|
36
|
+
let { model: r, onChange: i } = this.props, a = c(r), o = c(r), s = !1;
|
|
37
|
+
e === "max" ? (o.maxModelSelected = n, s = !0) : e === "part" ? (o.partsPerModel = n, s = !0) : e === "student-config" && (o.allowedStudentConfig = n, s = !1), i(a, o, s);
|
|
38
|
+
}
|
|
39
|
+
handleSelect = (e) => {
|
|
40
|
+
let { model: t, onChange: n } = this.props;
|
|
41
|
+
t.modelTypeSelected = e?.target.value, n(t, { ...t }, !1);
|
|
42
|
+
};
|
|
43
|
+
render() {
|
|
44
|
+
let { model: n, modelOptions: r } = this.props, { maxOfModel: i, partsPerModel: c, modelTypeChoices: l } = r;
|
|
45
|
+
return /* @__PURE__ */ o("div", { children: [
|
|
46
|
+
/* @__PURE__ */ a(e, { header: "Configure Fraction Model" }),
|
|
47
|
+
/* @__PURE__ */ a("br", {}),
|
|
48
|
+
/* @__PURE__ */ o(d, { children: [
|
|
49
|
+
/* @__PURE__ */ o(f, { children: [/* @__PURE__ */ a(p, { children: "Model Type" }), /* @__PURE__ */ a(m, {
|
|
50
|
+
onChange: this.handleSelect,
|
|
51
|
+
value: n.modelTypeSelected,
|
|
52
|
+
MenuProps: { transitionDuration: {
|
|
53
|
+
enter: 225,
|
|
54
|
+
exit: 195
|
|
55
|
+
} },
|
|
56
|
+
children: l.map((e, t) => /* @__PURE__ */ a(u, {
|
|
57
|
+
value: e.value,
|
|
58
|
+
children: e.label
|
|
59
|
+
}, "item_" + t))
|
|
60
|
+
})] }),
|
|
61
|
+
/* @__PURE__ */ o(f, { children: [/* @__PURE__ */ a(p, { children: "Max # of Models" }), /* @__PURE__ */ a(t, {
|
|
62
|
+
min: i.min,
|
|
63
|
+
max: i.max,
|
|
64
|
+
value: n.maxModelSelected,
|
|
65
|
+
name: "max-model",
|
|
66
|
+
onChange: this.changeMaxModel
|
|
67
|
+
})] }),
|
|
68
|
+
/* @__PURE__ */ o(f, { children: [/* @__PURE__ */ a(p, { children: "Parts per Model" }), /* @__PURE__ */ a(t, {
|
|
69
|
+
min: c.min,
|
|
70
|
+
max: c.max,
|
|
71
|
+
value: n.partsPerModel,
|
|
72
|
+
name: "model-parts",
|
|
73
|
+
onChange: this.changePartModel
|
|
74
|
+
})] })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ o(h, { children: [/* @__PURE__ */ a(s, {
|
|
77
|
+
onChange: this.studentConfig,
|
|
78
|
+
checked: n.allowedStudentConfig,
|
|
79
|
+
label: ""
|
|
80
|
+
}), /* @__PURE__ */ a(g, { children: "Allow student to configure number of models and parts per model" })] })
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
export { _ as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/fraction-model/configure/src/number-text-field.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
|
+
export declare class NumberTextField extends React.Component {
|
|
11
|
+
static propTypes: {};
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export declare const MiniField: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
15
|
+
export default NumberTextField;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import { styled as t } from "@mui/material/styles";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { NumberTextField as r } from "@pie-lib/config-ui";
|
|
5
|
+
t(r)(({ theme: e }) => ({ marginLeft: e.spacing(1) }));
|
|
6
|
+
//#region src/author/number-text-field.tsx
|
|
7
|
+
var i = t(r)({
|
|
8
|
+
maxWidth: "120px",
|
|
9
|
+
width: "120px",
|
|
10
|
+
marginTop: "0",
|
|
11
|
+
"& [class^=\"MuiInputBase-root\"]": {
|
|
12
|
+
height: 40,
|
|
13
|
+
fontSize: "14px"
|
|
14
|
+
},
|
|
15
|
+
"& [class^=\"MuiInputBase-input\"]": { padding: "18.5px 14px" }
|
|
16
|
+
});
|
|
17
|
+
e.Component;
|
|
18
|
+
var a = e.forwardRef((e, t) => /* @__PURE__ */ n(i, {
|
|
19
|
+
...e,
|
|
20
|
+
ref: t,
|
|
21
|
+
variant: "outlined"
|
|
22
|
+
}));
|
|
23
|
+
//#endregion
|
|
24
|
+
export { a as MiniField };
|