@pie-lib/config-ui 13.1.0-beta.9 → 14.0.0-next.36
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/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/alert-dialog.d.ts +44 -0
- package/dist/alert-dialog.js +47 -0
- package/dist/checkbox.d.ts +34 -0
- package/dist/checkbox.js +57 -0
- package/dist/choice-configuration/feedback-menu.d.ts +32 -0
- package/dist/choice-configuration/feedback-menu.js +85 -0
- package/dist/choice-configuration/index.d.ts +62 -0
- package/dist/choice-configuration/index.js +240 -0
- package/dist/choice-utils.d.ts +21 -0
- package/dist/choice-utils.js +15 -0
- package/dist/feedback-config/feedback-selector.d.ts +33 -0
- package/dist/feedback-config/feedback-selector.js +92 -0
- package/dist/feedback-config/group.d.ts +21 -0
- package/dist/feedback-config/group.js +33 -0
- package/dist/feedback-config/index.d.ts +48 -0
- package/dist/feedback-config/index.js +96 -0
- package/dist/form-section.d.ts +25 -0
- package/dist/form-section.js +25 -0
- package/dist/fraction-to-number.d.ts +7 -0
- package/dist/fraction-to-number.js +9 -0
- package/dist/help.d.ts +41 -0
- package/dist/help.js +62 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +34 -0
- package/dist/input.d.ts +29 -0
- package/dist/input.js +65 -0
- package/dist/inputs.d.ts +63 -0
- package/dist/inputs.js +70 -0
- package/dist/langs.d.ts +41 -0
- package/dist/langs.js +76 -0
- package/dist/layout/config-layout.d.ts +10 -0
- package/dist/layout/config-layout.js +75 -0
- package/dist/layout/index.d.ts +11 -0
- package/dist/layout/index.js +10 -0
- package/dist/layout/layout-contents.d.ts +21 -0
- package/dist/layout/layout-contents.js +70 -0
- package/dist/layout/settings-box.d.ts +19 -0
- package/dist/layout/settings-box.js +32 -0
- package/dist/mui-box/index.d.ts +21 -0
- package/dist/mui-box/index.js +47 -0
- package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
- package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +7 -0
- package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
- package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +8 -0
- package/dist/node_modules/.bun/react-measure@2.5.2_6dbf9a050bc9aadb/node_modules/react-measure/dist/index.esm.js +122 -0
- package/dist/node_modules/.bun/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +276 -0
- package/dist/number-text-field-custom.d.ts +51 -0
- package/dist/number-text-field-custom.js +192 -0
- package/dist/number-text-field.d.ts +47 -0
- package/dist/number-text-field.js +122 -0
- package/dist/radio-with-label.d.ts +25 -0
- package/dist/radio-with-label.js +27 -0
- package/dist/settings/display-size.d.ts +26 -0
- package/dist/settings/display-size.js +45 -0
- package/dist/settings/index.d.ts +45 -0
- package/dist/settings/index.js +63 -0
- package/dist/settings/panel.d.ts +27 -0
- package/dist/settings/panel.js +201 -0
- package/dist/settings/settings-radio-label.d.ts +25 -0
- package/dist/settings/settings-radio-label.js +29 -0
- package/dist/settings/toggle.d.ts +25 -0
- package/dist/settings/toggle.js +33 -0
- package/dist/tabs/index.d.ts +22 -0
- package/dist/tabs/index.js +39 -0
- package/dist/tags-input/index.d.ts +21 -0
- package/dist/tags-input/index.js +83 -0
- package/dist/two-choice.d.ts +43 -0
- package/dist/two-choice.js +79 -0
- package/dist/with-stateful-model.d.ts +42 -0
- package/dist/with-stateful-model.js +32 -0
- package/package.json +31 -19
- package/CHANGELOG.json +0 -32
- package/CHANGELOG.md +0 -2419
- package/lib/alert-dialog.js +0 -68
- package/lib/alert-dialog.js.map +0 -1
- package/lib/checkbox.js +0 -84
- package/lib/checkbox.js.map +0 -1
- package/lib/choice-configuration/feedback-menu.js +0 -129
- package/lib/choice-configuration/feedback-menu.js.map +0 -1
- package/lib/choice-configuration/index.js +0 -381
- package/lib/choice-configuration/index.js.map +0 -1
- package/lib/choice-utils.js +0 -42
- package/lib/choice-utils.js.map +0 -1
- package/lib/feedback-config/feedback-selector.js +0 -155
- package/lib/feedback-config/feedback-selector.js.map +0 -1
- package/lib/feedback-config/group.js +0 -61
- package/lib/feedback-config/group.js.map +0 -1
- package/lib/feedback-config/index.js +0 -146
- package/lib/feedback-config/index.js.map +0 -1
- package/lib/form-section.js +0 -44
- package/lib/form-section.js.map +0 -1
- package/lib/help.js +0 -106
- package/lib/help.js.map +0 -1
- package/lib/index.js +0 -186
- package/lib/index.js.map +0 -1
- package/lib/input.js +0 -106
- package/lib/input.js.map +0 -1
- package/lib/inputs.js +0 -105
- package/lib/inputs.js.map +0 -1
- package/lib/langs.js +0 -136
- package/lib/langs.js.map +0 -1
- package/lib/layout/config-layout.js +0 -137
- package/lib/layout/config-layout.js.map +0 -1
- package/lib/layout/index.js +0 -21
- package/lib/layout/index.js.map +0 -1
- package/lib/layout/layout-contents.js +0 -160
- package/lib/layout/layout-contents.js.map +0 -1
- package/lib/layout/settings-box.js +0 -57
- package/lib/layout/settings-box.js.map +0 -1
- package/lib/mui-box/index.js +0 -63
- package/lib/mui-box/index.js.map +0 -1
- package/lib/number-text-field-custom.js +0 -376
- package/lib/number-text-field-custom.js.map +0 -1
- package/lib/number-text-field.js +0 -229
- package/lib/number-text-field.js.map +0 -1
- package/lib/radio-with-label.js +0 -48
- package/lib/radio-with-label.js.map +0 -1
- package/lib/settings/display-size.js +0 -61
- package/lib/settings/display-size.js.map +0 -1
- package/lib/settings/index.js +0 -110
- package/lib/settings/index.js.map +0 -1
- package/lib/settings/panel.js +0 -392
- package/lib/settings/panel.js.map +0 -1
- package/lib/settings/settings-radio-label.js +0 -51
- package/lib/settings/settings-radio-label.js.map +0 -1
- package/lib/settings/toggle.js +0 -63
- package/lib/settings/toggle.js.map +0 -1
- package/lib/tabs/index.js +0 -75
- package/lib/tabs/index.js.map +0 -1
- package/lib/tags-input/index.js +0 -149
- package/lib/tags-input/index.js.map +0 -1
- package/lib/two-choice.js +0 -136
- package/lib/two-choice.js.map +0 -1
- package/lib/with-stateful-model.js +0 -61
- package/lib/with-stateful-model.js.map +0 -1
- package/src/alert-dialog.jsx +0 -75
- package/src/checkbox.jsx +0 -61
- package/src/choice-configuration/feedback-menu.jsx +0 -96
- package/src/choice-configuration/index.jsx +0 -357
- package/src/choice-utils.js +0 -30
- package/src/feedback-config/feedback-selector.jsx +0 -112
- package/src/feedback-config/group.jsx +0 -51
- package/src/feedback-config/index.jsx +0 -111
- package/src/form-section.jsx +0 -31
- package/src/help.jsx +0 -79
- package/src/index.js +0 -55
- package/src/input.jsx +0 -72
- package/src/inputs.jsx +0 -69
- package/src/langs.jsx +0 -111
- package/src/layout/config-layout.jsx +0 -103
- package/src/layout/index.js +0 -4
- package/src/layout/layout-contents.jsx +0 -117
- package/src/layout/settings-box.jsx +0 -32
- package/src/mui-box/index.jsx +0 -56
- package/src/number-text-field-custom.jsx +0 -333
- package/src/number-text-field.jsx +0 -215
- package/src/radio-with-label.jsx +0 -30
- package/src/settings/display-size.jsx +0 -53
- package/src/settings/index.js +0 -83
- package/src/settings/panel.jsx +0 -333
- package/src/settings/settings-radio-label.jsx +0 -32
- package/src/settings/toggle.jsx +0 -46
- package/src/tabs/index.jsx +0 -47
- package/src/tags-input/index.jsx +0 -116
- package/src/two-choice.jsx +0 -90
- package/src/with-stateful-model.jsx +0 -36
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import e from "./group.js";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import n from "prop-types";
|
|
4
|
+
import { styled as r } from "@mui/material/styles";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import o from "@pie-lib/editable-html-tip-tap";
|
|
7
|
+
import * as s from "@pie-lib/render-ui";
|
|
8
|
+
import { InputContainer as c, color as l } from "@pie-lib/render-ui";
|
|
9
|
+
//#region src/feedback-config/feedback-selector.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(c, "InputContainer") || d(h.InputContainer, "InputContainer"), p = s, m = p.default, h = m && typeof m == "object" ? m : p, g = r(o)(({ theme: e }) => ({ fontFamily: e.typography.fontFamily })), _ = {
|
|
17
|
+
default: "Simple Feedback",
|
|
18
|
+
none: "No Feedback",
|
|
19
|
+
custom: "Customized Feedback"
|
|
20
|
+
}, v = r("div")(({ theme: e }) => ({ marginBottom: e.spacing(1) })), y = r(f)(() => ({ paddingBottom: 0 })), b = r("div")(({ theme: e }) => ({
|
|
21
|
+
marginTop: "0px",
|
|
22
|
+
background: l.backgroundDark(),
|
|
23
|
+
padding: 0,
|
|
24
|
+
marginBottom: e.spacing(2),
|
|
25
|
+
borderRadius: "4px"
|
|
26
|
+
})), x = r("div")(({ theme: e }) => ({
|
|
27
|
+
marginTop: "0px",
|
|
28
|
+
background: l.backgroundDark(),
|
|
29
|
+
padding: e.spacing(2),
|
|
30
|
+
marginBottom: e.spacing(2),
|
|
31
|
+
borderRadius: "4px",
|
|
32
|
+
fontFamily: e.typography.fontFamily,
|
|
33
|
+
cursor: "default"
|
|
34
|
+
})), S = r(e)(({ theme: e }) => ({ paddingTop: e.spacing(1) })), C = {
|
|
35
|
+
type: n.oneOf([
|
|
36
|
+
"default",
|
|
37
|
+
"custom",
|
|
38
|
+
"none"
|
|
39
|
+
]),
|
|
40
|
+
default: n.string,
|
|
41
|
+
custom: n.string
|
|
42
|
+
}, w = class extends t.Component {
|
|
43
|
+
static propTypes = {
|
|
44
|
+
keys: n.arrayOf(n.string),
|
|
45
|
+
label: n.string.isRequired,
|
|
46
|
+
feedback: n.shape(C).isRequired,
|
|
47
|
+
onChange: n.func.isRequired,
|
|
48
|
+
toolbarOpts: n.object,
|
|
49
|
+
mathMlOptions: n.object
|
|
50
|
+
};
|
|
51
|
+
changeType = (e) => {
|
|
52
|
+
let { onChange: t, feedback: n } = this.props;
|
|
53
|
+
t({
|
|
54
|
+
...n,
|
|
55
|
+
type: e
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
changeCustom = (e) => {
|
|
59
|
+
let { onChange: t, feedback: n } = this.props;
|
|
60
|
+
t({
|
|
61
|
+
...n,
|
|
62
|
+
type: "custom",
|
|
63
|
+
custom: e
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
render() {
|
|
67
|
+
let { keys: e, label: t, feedback: n, toolbarOpts: r, mathMlOptions: o = {} } = this.props;
|
|
68
|
+
return /* @__PURE__ */ a(v, { children: [
|
|
69
|
+
/* @__PURE__ */ i(y, {
|
|
70
|
+
label: t,
|
|
71
|
+
extraClasses: { label: { transform: "translateY(-20%)" } },
|
|
72
|
+
children: /* @__PURE__ */ i(S, {
|
|
73
|
+
keys: e || Object.keys(_),
|
|
74
|
+
label: t,
|
|
75
|
+
value: n.type,
|
|
76
|
+
onChange: this.changeType,
|
|
77
|
+
feedbackLabels: _
|
|
78
|
+
})
|
|
79
|
+
}),
|
|
80
|
+
n.type === "custom" && /* @__PURE__ */ i(b, { children: /* @__PURE__ */ i(g, {
|
|
81
|
+
onChange: this.changeCustom,
|
|
82
|
+
markup: n.custom || "",
|
|
83
|
+
toolbarOpts: r,
|
|
84
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
85
|
+
mathMlOptions: o
|
|
86
|
+
}) }),
|
|
87
|
+
n.type === "default" && /* @__PURE__ */ a(x, { children: [" ", n.default] })
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { w as FeedbackSelector, w as default, C as FeedbackType };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/feedback-config/group.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 PropTypes from 'prop-types';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
declare const Group: {
|
|
12
|
+
(props: any): React.JSX.Element;
|
|
13
|
+
propTypes: {
|
|
14
|
+
className: PropTypes.Requireable<string>;
|
|
15
|
+
feedbackLabels: PropTypes.Validator<object>;
|
|
16
|
+
value: PropTypes.Validator<string>;
|
|
17
|
+
keys: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
18
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default Group;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import e from "../radio-with-label.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import t from "prop-types";
|
|
4
|
+
import { styled as n } from "@mui/material/styles";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/feedback-config/group.tsx
|
|
7
|
+
var i = n("div")(() => ({
|
|
8
|
+
display: "flex",
|
|
9
|
+
alignItems: "center"
|
|
10
|
+
})), a = n("div")(() => ({
|
|
11
|
+
display: "flex",
|
|
12
|
+
alignItems: "center"
|
|
13
|
+
})), o = n(e)(({ theme: e }) => ({ "& .MuiFormControlLabel-label": { fontSize: e.typography.fontSize - 2 } })), s = (e) => {
|
|
14
|
+
let { feedbackLabels: t, value: n, className: s, onChange: c, keys: l } = e;
|
|
15
|
+
return /* @__PURE__ */ r(i, {
|
|
16
|
+
className: s,
|
|
17
|
+
children: l.map((e) => /* @__PURE__ */ r(a, { children: /* @__PURE__ */ r(o, {
|
|
18
|
+
value: e,
|
|
19
|
+
checked: n === e,
|
|
20
|
+
onChange: (e) => c(e.currentTarget.value),
|
|
21
|
+
label: t[e]
|
|
22
|
+
}) }, e))
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
s.propTypes = {
|
|
26
|
+
className: t.string,
|
|
27
|
+
feedbackLabels: t.object.isRequired,
|
|
28
|
+
value: t.string.isRequired,
|
|
29
|
+
keys: t.arrayOf(t.string),
|
|
30
|
+
onChange: t.func
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { s as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/feedback-config/index.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 FeedbackSelector from './feedback-selector.js';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
export { FeedbackSelector };
|
|
13
|
+
export declare const buildDefaults: (input: any) => {};
|
|
14
|
+
export declare class FeedbackConfig extends React.Component {
|
|
15
|
+
static propTypes: {
|
|
16
|
+
allowPartial: PropTypes.Requireable<boolean>;
|
|
17
|
+
className: PropTypes.Requireable<string>;
|
|
18
|
+
feedback: PropTypes.Requireable<PropTypes.InferProps<{
|
|
19
|
+
correct: PropTypes.Requireable<PropTypes.InferProps<{
|
|
20
|
+
type: PropTypes.Requireable<string>;
|
|
21
|
+
default: PropTypes.Requireable<string>;
|
|
22
|
+
custom: PropTypes.Requireable<string>;
|
|
23
|
+
}>>;
|
|
24
|
+
incorrect: PropTypes.Requireable<PropTypes.InferProps<{
|
|
25
|
+
type: PropTypes.Requireable<string>;
|
|
26
|
+
default: PropTypes.Requireable<string>;
|
|
27
|
+
custom: PropTypes.Requireable<string>;
|
|
28
|
+
}>>;
|
|
29
|
+
partial: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
|
+
type: PropTypes.Requireable<string>;
|
|
31
|
+
default: PropTypes.Requireable<string>;
|
|
32
|
+
custom: PropTypes.Requireable<string>;
|
|
33
|
+
}>>;
|
|
34
|
+
}>>;
|
|
35
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
36
|
+
toolbarOpts: PropTypes.Requireable<object>;
|
|
37
|
+
};
|
|
38
|
+
static defaultProps: {
|
|
39
|
+
allowPartial: boolean;
|
|
40
|
+
feedback: {};
|
|
41
|
+
};
|
|
42
|
+
onChange(key: any, config: any): void;
|
|
43
|
+
onCorrectChange: (config: any) => void;
|
|
44
|
+
onIncorrectChange: (config: any) => void;
|
|
45
|
+
onPartialChange: (config: any) => void;
|
|
46
|
+
render(): React.JSX.Element;
|
|
47
|
+
}
|
|
48
|
+
export default FeedbackConfig;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { FeedbackSelector as e, FeedbackType as t } from "./feedback-selector.js";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import r from "prop-types";
|
|
4
|
+
import { styled as i } from "@mui/material/styles";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { merge as s } from "@pie-element/shared-lodash";
|
|
7
|
+
import c from "@mui/material/Accordion";
|
|
8
|
+
import l from "@mui/material/AccordionSummary";
|
|
9
|
+
import u from "@mui/material/AccordionDetails";
|
|
10
|
+
import d from "@mui/material/Typography";
|
|
11
|
+
import f from "@mui/icons-material/ExpandMore";
|
|
12
|
+
//#region src/feedback-config/index.tsx
|
|
13
|
+
var p = i("div")(() => ({
|
|
14
|
+
display: "flex",
|
|
15
|
+
flex: 1,
|
|
16
|
+
flexDirection: "column"
|
|
17
|
+
})), m = i(u)(() => ({
|
|
18
|
+
paddingTop: 0,
|
|
19
|
+
paddingBottom: 0
|
|
20
|
+
})), h = (e) => s({}, {
|
|
21
|
+
correct: {
|
|
22
|
+
type: "default",
|
|
23
|
+
default: "Correct"
|
|
24
|
+
},
|
|
25
|
+
incorrect: {
|
|
26
|
+
type: "default",
|
|
27
|
+
default: "Incorrect"
|
|
28
|
+
},
|
|
29
|
+
partial: {
|
|
30
|
+
type: "default",
|
|
31
|
+
default: "Nearly"
|
|
32
|
+
}
|
|
33
|
+
}, e), g = class extends n.Component {
|
|
34
|
+
static propTypes = {
|
|
35
|
+
allowPartial: r.bool,
|
|
36
|
+
className: r.string,
|
|
37
|
+
feedback: r.shape({
|
|
38
|
+
correct: r.shape(t),
|
|
39
|
+
incorrect: r.shape(t),
|
|
40
|
+
partial: r.shape(t)
|
|
41
|
+
}),
|
|
42
|
+
onChange: r.func.isRequired,
|
|
43
|
+
toolbarOpts: r.object
|
|
44
|
+
};
|
|
45
|
+
static defaultProps = {
|
|
46
|
+
allowPartial: !0,
|
|
47
|
+
feedback: h()
|
|
48
|
+
};
|
|
49
|
+
onChange(e, t) {
|
|
50
|
+
let { feedback: n, onChange: r } = this.props;
|
|
51
|
+
r({
|
|
52
|
+
...n,
|
|
53
|
+
[e]: t
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
onCorrectChange = this.onChange.bind(this, "correct");
|
|
57
|
+
onIncorrectChange = this.onChange.bind(this, "incorrect");
|
|
58
|
+
onPartialChange = this.onChange.bind(this, "partial");
|
|
59
|
+
render() {
|
|
60
|
+
let { className: t, allowPartial: n, feedback: r, toolbarOpts: i } = this.props;
|
|
61
|
+
return /* @__PURE__ */ a("div", {
|
|
62
|
+
className: t,
|
|
63
|
+
children: /* @__PURE__ */ o(c, {
|
|
64
|
+
slotProps: { transition: { timeout: {
|
|
65
|
+
enter: 225,
|
|
66
|
+
exit: 195
|
|
67
|
+
} } },
|
|
68
|
+
children: [/* @__PURE__ */ a(l, {
|
|
69
|
+
expandIcon: /* @__PURE__ */ a(f, {}),
|
|
70
|
+
children: /* @__PURE__ */ a(d, { children: "Feedback" })
|
|
71
|
+
}), /* @__PURE__ */ a(m, { children: /* @__PURE__ */ o(p, { children: [
|
|
72
|
+
/* @__PURE__ */ a(e, {
|
|
73
|
+
label: "If correct, show",
|
|
74
|
+
feedback: r.correct,
|
|
75
|
+
onChange: this.onCorrectChange,
|
|
76
|
+
toolbarOpts: i
|
|
77
|
+
}),
|
|
78
|
+
n && /* @__PURE__ */ a(e, {
|
|
79
|
+
label: "If partially correct, show",
|
|
80
|
+
feedback: r.partial,
|
|
81
|
+
onChange: this.onPartialChange,
|
|
82
|
+
toolbarOpts: i
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ a(e, {
|
|
85
|
+
label: "If incorrect, show",
|
|
86
|
+
feedback: r.incorrect,
|
|
87
|
+
onChange: this.onIncorrectChange,
|
|
88
|
+
toolbarOpts: i
|
|
89
|
+
})
|
|
90
|
+
] }) })]
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
export { g as FeedbackConfig, g as default, e as FeedbackSelector, h as buildDefaults };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/form-section.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 FormSection: {
|
|
12
|
+
({ className, label, children, labelExtraStyle }: {
|
|
13
|
+
className: any;
|
|
14
|
+
label: any;
|
|
15
|
+
children: any;
|
|
16
|
+
labelExtraStyle: any;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
propTypes: {
|
|
19
|
+
className: PropTypes.Requireable<string>;
|
|
20
|
+
label: PropTypes.Requireable<string>;
|
|
21
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
22
|
+
labelExtraStyle: PropTypes.Requireable<object>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default FormSection;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import { styled as t } from "@mui/material/styles";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import i from "@mui/material/Typography";
|
|
6
|
+
//#region src/form-section.tsx
|
|
7
|
+
var a = t("div")(({ theme: e }) => ({
|
|
8
|
+
marginTop: e.spacing(2),
|
|
9
|
+
marginBottom: e.spacing(2)
|
|
10
|
+
})), o = t(i)(({ theme: e }) => ({ marginBottom: e.spacing(1) })), s = ({ className: e, label: t, children: i, labelExtraStyle: s }) => /* @__PURE__ */ r(a, {
|
|
11
|
+
className: e,
|
|
12
|
+
children: [/* @__PURE__ */ n(o, {
|
|
13
|
+
variant: "subtitle1",
|
|
14
|
+
style: s,
|
|
15
|
+
children: t
|
|
16
|
+
}), i]
|
|
17
|
+
});
|
|
18
|
+
s.propTypes = {
|
|
19
|
+
className: e.string,
|
|
20
|
+
label: e.string,
|
|
21
|
+
children: e.node,
|
|
22
|
+
labelExtraStyle: e.object
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { s as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/fraction-to-number.ts
|
|
2
|
+
var e = (e) => typeof e == "object" && !!e && typeof e.n == "number" && typeof e.d == "number", t = (t) => {
|
|
3
|
+
if (typeof t == "number") return t;
|
|
4
|
+
if (e(t)) return (t.s ?? 1) * t.n / t.d;
|
|
5
|
+
let n = String(t).trim(), r = n.match(/^([+-]?\d+)\s*\/\s*([+-]?\d+)$/);
|
|
6
|
+
return r ? Number.parseInt(r[1] ?? "0", 10) / Number.parseInt(r[2] ?? "1", 10) : Number(n);
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as fractionToNumber };
|
package/dist/help.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/help.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 PropTypes from 'prop-types';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export declare const HelpButton: {
|
|
12
|
+
({ onClick }: {
|
|
13
|
+
onClick: any;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
propTypes: {
|
|
16
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const HelpDialog: {
|
|
20
|
+
({ open, onClose, children, title }: {
|
|
21
|
+
open: any;
|
|
22
|
+
onClose: any;
|
|
23
|
+
children: any;
|
|
24
|
+
title: any;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
propTypes: {
|
|
27
|
+
open: PropTypes.Requireable<boolean>;
|
|
28
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
+
children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
|
|
30
|
+
title: PropTypes.Validator<string>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
declare class Help extends React.Component {
|
|
34
|
+
static propTypes: {
|
|
35
|
+
children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
|
|
36
|
+
title: PropTypes.Requireable<string>;
|
|
37
|
+
};
|
|
38
|
+
constructor(props: any);
|
|
39
|
+
render(): React.JSX.Element;
|
|
40
|
+
}
|
|
41
|
+
export default Help;
|
package/dist/help.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { styled as n } from "@mui/material/styles";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { color as a } from "@pie-lib/render-ui";
|
|
6
|
+
import o from "@mui/material/Dialog";
|
|
7
|
+
import s from "@mui/material/DialogTitle";
|
|
8
|
+
import c from "@mui/material/DialogContentText";
|
|
9
|
+
import l from "@mui/material/DialogContent";
|
|
10
|
+
import u from "@mui/material/DialogActions";
|
|
11
|
+
import d from "@mui/material/Button";
|
|
12
|
+
import f from "@mui/icons-material/Help";
|
|
13
|
+
import p from "@mui/material/IconButton";
|
|
14
|
+
//#region src/help.tsx
|
|
15
|
+
var m = n(p)(() => ({ "&:hover": { color: a.borderLight() } })), h = ({ onClick: e }) => /* @__PURE__ */ r(m, {
|
|
16
|
+
onClick: e,
|
|
17
|
+
size: "large",
|
|
18
|
+
children: /* @__PURE__ */ r(f, {})
|
|
19
|
+
});
|
|
20
|
+
h.propTypes = { onClick: t.func };
|
|
21
|
+
var g = ({ open: e, onClose: t, children: n, title: a }) => /* @__PURE__ */ i(o, {
|
|
22
|
+
open: e,
|
|
23
|
+
onClose: t,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ r(s, { children: a }),
|
|
26
|
+
/* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(c, { children: n }) }),
|
|
27
|
+
/* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(d, {
|
|
28
|
+
onClick: t,
|
|
29
|
+
color: "primary",
|
|
30
|
+
children: "OK"
|
|
31
|
+
}) })
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
g.propTypes = {
|
|
35
|
+
open: t.bool,
|
|
36
|
+
onClose: t.func,
|
|
37
|
+
children: t.oneOfType([t.arrayOf(t.node), t.node]).isRequired,
|
|
38
|
+
title: t.string.isRequired
|
|
39
|
+
};
|
|
40
|
+
var _ = class extends e.Component {
|
|
41
|
+
static propTypes = {
|
|
42
|
+
children: t.oneOfType([t.arrayOf(t.node), t.node]).isRequired,
|
|
43
|
+
title: t.string
|
|
44
|
+
};
|
|
45
|
+
constructor(e) {
|
|
46
|
+
super(e), this.state = { open: !1 };
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
let { children: e, title: t } = this.props;
|
|
50
|
+
return /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r(h, {
|
|
51
|
+
color: "accent",
|
|
52
|
+
onClick: () => this.setState({ open: !0 })
|
|
53
|
+
}), /* @__PURE__ */ r(g, {
|
|
54
|
+
open: this.state.open,
|
|
55
|
+
title: t,
|
|
56
|
+
onClose: () => this.setState({ open: !1 }),
|
|
57
|
+
children: e
|
|
58
|
+
})] });
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { h as HelpButton, g as HelpDialog, _ as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/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
|
+
import AlertDialog from './alert-dialog.js';
|
|
10
|
+
import FeedbackConfig, { buildDefaults as feedbackConfigDefaults, FeedbackSelector } from './feedback-config/index.js';
|
|
11
|
+
import { InputCheckbox, InputRadio, InputSwitch } from './inputs.js';
|
|
12
|
+
import Langs, { LanguageControls } from './langs.js';
|
|
13
|
+
import Tabs from './tabs/index.js';
|
|
14
|
+
import Checkbox from './checkbox.js';
|
|
15
|
+
import FormSection from './form-section.js';
|
|
16
|
+
import Help from './help.js';
|
|
17
|
+
import Input from './input.js';
|
|
18
|
+
declare const InputContainer: any;
|
|
19
|
+
import NumberTextField from './number-text-field.js';
|
|
20
|
+
import NumberTextFieldCustom from './number-text-field-custom.js';
|
|
21
|
+
import TwoChoice, { NChoice } from './two-choice.js';
|
|
22
|
+
import TagsInput from './tags-input/index.js';
|
|
23
|
+
import MuiBox from './mui-box/index.js';
|
|
24
|
+
import ChoiceConfiguration from './choice-configuration/index.js';
|
|
25
|
+
import * as layout from './layout/index.js';
|
|
26
|
+
import * as choiceUtils from './choice-utils.js';
|
|
27
|
+
import withStatefulModel from './with-stateful-model.js';
|
|
28
|
+
import Toggle from './settings/toggle.js';
|
|
29
|
+
import DisplaySize from './settings/display-size.js';
|
|
30
|
+
import * as settings from './settings/index.js';
|
|
31
|
+
export { AlertDialog, FeedbackConfig, FeedbackSelector, feedbackConfigDefaults, InputCheckbox, InputSwitch, InputRadio, Langs, LanguageControls, Tabs, Checkbox, FormSection, Help, Input, InputContainer, NumberTextField, NumberTextFieldCustom, TwoChoice, NChoice, TagsInput, MuiBox, ChoiceConfiguration, layout, choiceUtils, withStatefulModel, Toggle, DisplaySize, settings, };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import e from "./alert-dialog.js";
|
|
2
|
+
import { FeedbackSelector as t } from "./feedback-config/feedback-selector.js";
|
|
3
|
+
import { FeedbackConfig as n, buildDefaults as r } from "./feedback-config/index.js";
|
|
4
|
+
import { InputCheckbox as i, InputRadio as a, InputSwitch as o } from "./inputs.js";
|
|
5
|
+
import { Langs as s, LanguageControls as c } from "./langs.js";
|
|
6
|
+
import { Tabs as l } from "./tabs/index.js";
|
|
7
|
+
import u from "./checkbox.js";
|
|
8
|
+
import d from "./form-section.js";
|
|
9
|
+
import f from "./help.js";
|
|
10
|
+
import p from "./input.js";
|
|
11
|
+
import { NumberTextField as m } from "./number-text-field.js";
|
|
12
|
+
import { NumberTextFieldCustom as h } from "./number-text-field-custom.js";
|
|
13
|
+
import g, { NChoice as _ } from "./two-choice.js";
|
|
14
|
+
import v from "./mui-box/index.js";
|
|
15
|
+
import { TagsInput as y } from "./tags-input/index.js";
|
|
16
|
+
import { ChoiceConfiguration as b } from "./choice-configuration/index.js";
|
|
17
|
+
import { layout_exports as x } from "./layout/index.js";
|
|
18
|
+
import { choice_utils_exports as S } from "./choice-utils.js";
|
|
19
|
+
import C from "./with-stateful-model.js";
|
|
20
|
+
import w from "./settings/toggle.js";
|
|
21
|
+
import T from "./settings/display-size.js";
|
|
22
|
+
import { settings_exports as E } from "./settings/index.js";
|
|
23
|
+
import * as D from "@pie-lib/render-ui";
|
|
24
|
+
import { InputContainer as O } from "@pie-lib/render-ui";
|
|
25
|
+
//#region src/index.ts
|
|
26
|
+
function k(e) {
|
|
27
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
28
|
+
}
|
|
29
|
+
function A(e, t) {
|
|
30
|
+
return !e || k(e) ? e : k(e.default) ? e.default : t && k(e[t]) ? e[t] : t && k(e[t]?.default) ? e[t].default : e;
|
|
31
|
+
}
|
|
32
|
+
var j = A(O, "InputContainer") || A(P.InputContainer, "InputContainer"), M = D, N = M.default, P = N && typeof N == "object" ? N : M;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { e as AlertDialog, u as Checkbox, b as ChoiceConfiguration, T as DisplaySize, n as FeedbackConfig, t as FeedbackSelector, d as FormSection, f as Help, p as Input, i as InputCheckbox, j as InputContainer, a as InputRadio, o as InputSwitch, s as Langs, c as LanguageControls, v as MuiBox, _ as NChoice, m as NumberTextField, h as NumberTextFieldCustom, l as Tabs, y as TagsInput, w as Toggle, g as TwoChoice, S as choiceUtils, r as feedbackConfigDefaults, x as layout, E as settings, C as withStatefulModel };
|
package/dist/input.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/input.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 * as React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export default class Input extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
14
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
15
|
+
label: PropTypes.Requireable<string>;
|
|
16
|
+
type: PropTypes.Validator<string>;
|
|
17
|
+
error: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
+
noModelUpdateOnError: PropTypes.Requireable<boolean>;
|
|
19
|
+
};
|
|
20
|
+
static defaultProps: {
|
|
21
|
+
type: string;
|
|
22
|
+
error: (value: any, type: any) => boolean;
|
|
23
|
+
noModelUpdateOnError: boolean;
|
|
24
|
+
};
|
|
25
|
+
constructor(props: any);
|
|
26
|
+
UNSAFE_componentWillReceiveProps(newProps: any): void;
|
|
27
|
+
onChange: any;
|
|
28
|
+
render(): React.JSX.Element;
|
|
29
|
+
}
|
package/dist/input.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import * as r from "@pie-lib/render-ui";
|
|
5
|
+
import { InputContainer as i } from "@pie-lib/render-ui";
|
|
6
|
+
import a from "@mui/material/Input";
|
|
7
|
+
//#region src/input.tsx
|
|
8
|
+
function o(e) {
|
|
9
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
10
|
+
}
|
|
11
|
+
function s(e, t) {
|
|
12
|
+
return !e || o(e) ? e : o(e.default) ? e.default : t && o(e[t]) ? e[t] : t && o(e[t]?.default) ? e[t].default : e;
|
|
13
|
+
}
|
|
14
|
+
var c = s(i, "InputContainer") || s(d.InputContainer, "InputContainer"), l = r, u = l.default, d = u && typeof u == "object" ? u : l, f = class extends e.Component {
|
|
15
|
+
static propTypes = {
|
|
16
|
+
value: t.oneOfType([t.string, t.number]),
|
|
17
|
+
onChange: t.func.isRequired,
|
|
18
|
+
label: t.string,
|
|
19
|
+
type: t.string.isRequired,
|
|
20
|
+
error: t.func,
|
|
21
|
+
noModelUpdateOnError: t.bool
|
|
22
|
+
};
|
|
23
|
+
static defaultProps = {
|
|
24
|
+
type: "text",
|
|
25
|
+
error: (e, t) => t === "number" ? !e || isNaN(e) : !e,
|
|
26
|
+
noModelUpdateOnError: !1
|
|
27
|
+
};
|
|
28
|
+
constructor(e) {
|
|
29
|
+
super(e), this.state = { value: e.value };
|
|
30
|
+
}
|
|
31
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
32
|
+
this.setState({ value: e.value });
|
|
33
|
+
}
|
|
34
|
+
onChange = (e) => {
|
|
35
|
+
let { type: t, onChange: n, error: r } = this.props, i = e.target.value;
|
|
36
|
+
r(i, t) ? this.setState({
|
|
37
|
+
error: !0,
|
|
38
|
+
value: e.target.value
|
|
39
|
+
}) : (this.setState({
|
|
40
|
+
error: !1,
|
|
41
|
+
value: e.target.value
|
|
42
|
+
}), n(e));
|
|
43
|
+
};
|
|
44
|
+
render() {
|
|
45
|
+
let { label: e, type: t, noModelUpdateOnError: r, ...i } = this.props, { value: o, error: s } = this.state;
|
|
46
|
+
return e ? /* @__PURE__ */ n(c, {
|
|
47
|
+
label: e,
|
|
48
|
+
children: /* @__PURE__ */ n(a, {
|
|
49
|
+
type: t,
|
|
50
|
+
...i,
|
|
51
|
+
value: o,
|
|
52
|
+
onChange: this.onChange,
|
|
53
|
+
error: s
|
|
54
|
+
})
|
|
55
|
+
}) : /* @__PURE__ */ n(a, {
|
|
56
|
+
type: t,
|
|
57
|
+
...i,
|
|
58
|
+
value: o,
|
|
59
|
+
onChange: this.onChange,
|
|
60
|
+
error: s
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { f as default };
|