@pie-lib/config-ui 0.1.0
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.d.ts.map +1 -0
- package/dist/alert-dialog.js +47 -0
- package/dist/checkbox.d.ts +34 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +57 -0
- package/dist/choice-configuration/feedback-menu.d.ts +33 -0
- package/dist/choice-configuration/feedback-menu.d.ts.map +1 -0
- package/dist/choice-configuration/feedback-menu.js +85 -0
- package/dist/choice-configuration/index.d.ts +63 -0
- package/dist/choice-configuration/index.d.ts.map +1 -0
- package/dist/choice-configuration/index.js +240 -0
- package/dist/choice-utils.d.ts +22 -0
- package/dist/choice-utils.d.ts.map +1 -0
- package/dist/choice-utils.js +15 -0
- package/dist/feedback-config/feedback-selector.d.ts +34 -0
- package/dist/feedback-config/feedback-selector.d.ts.map +1 -0
- package/dist/feedback-config/feedback-selector.js +92 -0
- package/dist/feedback-config/group.d.ts +21 -0
- package/dist/feedback-config/group.d.ts.map +1 -0
- package/dist/feedback-config/group.js +33 -0
- package/dist/feedback-config/index.d.ts +49 -0
- package/dist/feedback-config/index.d.ts.map +1 -0
- package/dist/feedback-config/index.js +96 -0
- package/dist/form-section.d.ts +25 -0
- package/dist/form-section.d.ts.map +1 -0
- package/dist/form-section.js +25 -0
- package/dist/help.d.ts +42 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +61 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/input.d.ts +30 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +65 -0
- package/dist/inputs.d.ts +63 -0
- package/dist/inputs.d.ts.map +1 -0
- package/dist/inputs.js +70 -0
- package/dist/langs.d.ts +42 -0
- package/dist/langs.d.ts.map +1 -0
- package/dist/langs.js +76 -0
- package/dist/layout/config-layout.d.ts +11 -0
- package/dist/layout/config-layout.d.ts.map +1 -0
- package/dist/layout/config-layout.js +75 -0
- package/dist/layout/index.d.ts +12 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +10 -0
- package/dist/layout/layout-contents.d.ts +22 -0
- package/dist/layout/layout-contents.d.ts.map +1 -0
- package/dist/layout/layout-contents.js +70 -0
- package/dist/layout/settings-box.d.ts +20 -0
- package/dist/layout/settings-box.d.ts.map +1 -0
- package/dist/layout/settings-box.js +31 -0
- package/dist/mui-box/index.d.ts +21 -0
- package/dist/mui-box/index.d.ts.map +1 -0
- package/dist/mui-box/index.js +47 -0
- package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
- package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +7 -0
- package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
- package/dist/node_modules/.bun/@babel_runtime@7.28.6/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 +52 -0
- package/dist/number-text-field-custom.d.ts.map +1 -0
- package/dist/number-text-field-custom.js +192 -0
- package/dist/number-text-field.d.ts +48 -0
- package/dist/number-text-field.d.ts.map +1 -0
- package/dist/number-text-field.js +122 -0
- package/dist/radio-with-label.d.ts +25 -0
- package/dist/radio-with-label.d.ts.map +1 -0
- package/dist/radio-with-label.js +27 -0
- package/dist/settings/display-size.d.ts +26 -0
- package/dist/settings/display-size.d.ts.map +1 -0
- package/dist/settings/display-size.js +45 -0
- package/dist/settings/index.d.ts +46 -0
- package/dist/settings/index.d.ts.map +1 -0
- package/dist/settings/index.js +63 -0
- package/dist/settings/panel.d.ts +28 -0
- package/dist/settings/panel.d.ts.map +1 -0
- package/dist/settings/panel.js +201 -0
- package/dist/settings/settings-radio-label.d.ts +25 -0
- package/dist/settings/settings-radio-label.d.ts.map +1 -0
- package/dist/settings/settings-radio-label.js +29 -0
- package/dist/settings/toggle.d.ts +25 -0
- package/dist/settings/toggle.d.ts.map +1 -0
- package/dist/settings/toggle.js +33 -0
- package/dist/tabs/index.d.ts +23 -0
- package/dist/tabs/index.d.ts.map +1 -0
- package/dist/tabs/index.js +39 -0
- package/dist/tags-input/index.d.ts +22 -0
- package/dist/tags-input/index.d.ts.map +1 -0
- package/dist/tags-input/index.js +83 -0
- package/dist/two-choice.d.ts +44 -0
- package/dist/two-choice.d.ts.map +1 -0
- package/dist/two-choice.js +79 -0
- package/dist/with-stateful-model.d.ts +22 -0
- package/dist/with-stateful-model.d.ts.map +1 -0
- package/dist/with-stateful-model.js +32 -0
- package/package.json +40 -0
- package/src/alert-dialog.tsx +85 -0
- package/src/checkbox.tsx +71 -0
- package/src/choice-configuration/feedback-menu.tsx +134 -0
- package/src/choice-configuration/index.tsx +400 -0
- package/src/choice-utils.ts +40 -0
- package/src/feedback-config/feedback-selector.tsx +153 -0
- package/src/feedback-config/group.tsx +61 -0
- package/src/feedback-config/index.tsx +121 -0
- package/src/form-section.tsx +41 -0
- package/src/help.tsx +89 -0
- package/src/index.ts +93 -0
- package/src/input.tsx +109 -0
- package/src/inputs.tsx +107 -0
- package/src/langs.tsx +121 -0
- package/src/layout/config-layout.tsx +113 -0
- package/src/layout/index.ts +14 -0
- package/src/layout/layout-contents.tsx +127 -0
- package/src/layout/settings-box.tsx +42 -0
- package/src/mui-box/index.tsx +66 -0
- package/src/number-text-field-custom.tsx +343 -0
- package/src/number-text-field.tsx +229 -0
- package/src/radio-with-label.tsx +40 -0
- package/src/settings/display-size.tsx +63 -0
- package/src/settings/index.ts +93 -0
- package/src/settings/panel.tsx +343 -0
- package/src/settings/settings-radio-label.tsx +42 -0
- package/src/settings/toggle.tsx +56 -0
- package/src/tabs/index.tsx +57 -0
- package/src/tags-input/index.tsx +126 -0
- package/src/two-choice.tsx +128 -0
- package/src/with-stateful-model.tsx +46 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = (t, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as __exportAll };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/alert-dialog.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
|
+
declare const AlertDialog: {
|
|
11
|
+
({ text, title, onClose, onConfirm, open, onCloseText, onConfirmText, disableAutoFocus, disableEnforceFocus, disableRestoreFocus, }: {
|
|
12
|
+
text: any;
|
|
13
|
+
title: any;
|
|
14
|
+
onClose: any;
|
|
15
|
+
onConfirm: any;
|
|
16
|
+
open: any;
|
|
17
|
+
onCloseText: any;
|
|
18
|
+
onConfirmText: any;
|
|
19
|
+
disableAutoFocus: any;
|
|
20
|
+
disableEnforceFocus: any;
|
|
21
|
+
disableRestoreFocus: any;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
defaultProps: {
|
|
24
|
+
onCloseText: string;
|
|
25
|
+
onConfirmText: string;
|
|
26
|
+
disableAutoFocus: boolean;
|
|
27
|
+
disableEnforceFocus: boolean;
|
|
28
|
+
disableRestoreFocus: boolean;
|
|
29
|
+
};
|
|
30
|
+
propTypes: {
|
|
31
|
+
text: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
32
|
+
title: PropTypes.Requireable<string>;
|
|
33
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
|
+
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
|
+
open: PropTypes.Requireable<boolean>;
|
|
36
|
+
onConfirmText: PropTypes.Requireable<string>;
|
|
37
|
+
onCloseText: PropTypes.Requireable<string>;
|
|
38
|
+
disableAutoFocus: PropTypes.Requireable<boolean>;
|
|
39
|
+
disableEnforceFocus: PropTypes.Requireable<boolean>;
|
|
40
|
+
disableRestoreFocus: PropTypes.Requireable<boolean>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export default AlertDialog;
|
|
44
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../src/alert-dialog.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAGH,OAAO,SAAS,MAAM,YAAY,CAAC;AAYnC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsChB,CAAC;AAuBF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import { Button as t, Dialog as n, DialogActions as r, DialogContent as i, DialogContentText as a, DialogTitle as o } from "@mui/material";
|
|
4
|
+
import { styled as s } from "@mui/material/styles";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
//#region src/alert-dialog.tsx
|
|
7
|
+
var u = s(o)(() => ({ fontSize: "max(1.25rem, 18px)" })), d = s(a)(() => ({ fontSize: "max(1rem, 14px)" })), f = ({ text: e, title: a, onClose: o, onConfirm: s, open: f, onCloseText: p, onConfirmText: m, disableAutoFocus: h, disableEnforceFocus: g, disableRestoreFocus: _ }) => /* @__PURE__ */ l(n, {
|
|
8
|
+
open: f,
|
|
9
|
+
disableAutoFocus: h,
|
|
10
|
+
disableEnforceFocus: g,
|
|
11
|
+
disableRestoreFocus: _,
|
|
12
|
+
onClose: o,
|
|
13
|
+
children: [
|
|
14
|
+
a && /* @__PURE__ */ c(u, { children: a }),
|
|
15
|
+
e && /* @__PURE__ */ c(i, { children: /* @__PURE__ */ c(d, { children: e }) }),
|
|
16
|
+
/* @__PURE__ */ l(r, { children: [o && /* @__PURE__ */ c(t, {
|
|
17
|
+
onClick: o,
|
|
18
|
+
color: "primary",
|
|
19
|
+
children: p
|
|
20
|
+
}), s && /* @__PURE__ */ c(t, {
|
|
21
|
+
autoFocus: !0,
|
|
22
|
+
onClick: s,
|
|
23
|
+
color: "primary",
|
|
24
|
+
children: m
|
|
25
|
+
})] })
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
f.defaultProps = {
|
|
29
|
+
onCloseText: "CANCEL",
|
|
30
|
+
onConfirmText: "OK",
|
|
31
|
+
disableAutoFocus: !1,
|
|
32
|
+
disableEnforceFocus: !1,
|
|
33
|
+
disableRestoreFocus: !1
|
|
34
|
+
}, f.propTypes = {
|
|
35
|
+
text: e.oneOfType([e.string, e.object]),
|
|
36
|
+
title: e.string,
|
|
37
|
+
onClose: e.func,
|
|
38
|
+
onConfirm: e.func,
|
|
39
|
+
open: e.bool,
|
|
40
|
+
onConfirmText: e.string,
|
|
41
|
+
onCloseText: e.string,
|
|
42
|
+
disableAutoFocus: e.bool,
|
|
43
|
+
disableEnforceFocus: e.bool,
|
|
44
|
+
disableRestoreFocus: e.bool
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
export { f as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/checkbox.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
|
+
declare const Checkbox: {
|
|
11
|
+
({ mini, checked, onChange, value, label, error }: {
|
|
12
|
+
mini: any;
|
|
13
|
+
checked: any;
|
|
14
|
+
onChange: any;
|
|
15
|
+
value: any;
|
|
16
|
+
label: any;
|
|
17
|
+
error: any;
|
|
18
|
+
}): JSX.Element;
|
|
19
|
+
propTypes: {
|
|
20
|
+
mini: PropTypes.Requireable<boolean>;
|
|
21
|
+
checked: PropTypes.Validator<boolean>;
|
|
22
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
23
|
+
value: PropTypes.Requireable<string>;
|
|
24
|
+
label: PropTypes.Validator<string>;
|
|
25
|
+
error: PropTypes.Requireable<boolean>;
|
|
26
|
+
};
|
|
27
|
+
defaultProps: {
|
|
28
|
+
value: string;
|
|
29
|
+
mini: boolean;
|
|
30
|
+
error: boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default Checkbox;
|
|
34
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../src/checkbox.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAIH,OAAO,SAAS,MAAM,YAAY,CAAC;AAmCnC,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;CAMb,CAAC;AAiBF,eAAe,QAAQ,CAAC"}
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import { styled as t } from "@mui/material/styles";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { color as r } from "@pie-lib/render-ui";
|
|
6
|
+
import i from "@mui/material/FormControlLabel";
|
|
7
|
+
import a from "@mui/material/Checkbox";
|
|
8
|
+
import { grey as o } from "@mui/material/colors";
|
|
9
|
+
//#region src/checkbox.tsx
|
|
10
|
+
var s = t(i)(({ theme: e, mini: t }) => ({
|
|
11
|
+
margin: 0,
|
|
12
|
+
marginLeft: 0,
|
|
13
|
+
padding: 0,
|
|
14
|
+
"& .MuiFormControlLabel-label": {
|
|
15
|
+
fontSize: e.typography.fontSize - 1,
|
|
16
|
+
transform: "translate(-4%, 2%)",
|
|
17
|
+
color: "rgba(0,0,0,1.0)",
|
|
18
|
+
...t && {
|
|
19
|
+
marginLeft: e.spacing(1),
|
|
20
|
+
color: o[700],
|
|
21
|
+
fontSize: e.typography.fontSize - 3
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
})), c = t(a)(({ theme: e, mini: t, error: n }) => ({
|
|
25
|
+
color: `${r.tertiary()} !important`,
|
|
26
|
+
...t && {
|
|
27
|
+
margin: 0,
|
|
28
|
+
padding: 0,
|
|
29
|
+
width: e.spacing(3),
|
|
30
|
+
height: e.spacing(3)
|
|
31
|
+
},
|
|
32
|
+
...n && { color: `${e.palette.error.main} !important` }
|
|
33
|
+
})), l = ({ mini: e, checked: t, onChange: r, value: i, label: a, error: o }) => /* @__PURE__ */ n(s, {
|
|
34
|
+
mini: e,
|
|
35
|
+
control: /* @__PURE__ */ n(c, {
|
|
36
|
+
checked: t,
|
|
37
|
+
onChange: r,
|
|
38
|
+
value: i,
|
|
39
|
+
mini: e,
|
|
40
|
+
error: o
|
|
41
|
+
}),
|
|
42
|
+
label: a
|
|
43
|
+
});
|
|
44
|
+
l.propTypes = {
|
|
45
|
+
mini: e.bool,
|
|
46
|
+
checked: e.bool.isRequired,
|
|
47
|
+
onChange: e.func.isRequired,
|
|
48
|
+
value: e.string,
|
|
49
|
+
label: e.string.isRequired,
|
|
50
|
+
error: e.bool
|
|
51
|
+
}, l.defaultProps = {
|
|
52
|
+
value: "",
|
|
53
|
+
mini: !1,
|
|
54
|
+
error: !1
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { l as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/choice-configuration/feedback-menu.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 class IconMenu extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
opts: PropTypes.Requireable<object>;
|
|
14
|
+
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
15
|
+
iconButtonElement: PropTypes.Requireable<any>;
|
|
16
|
+
};
|
|
17
|
+
constructor(props: any);
|
|
18
|
+
handleClick: any;
|
|
19
|
+
handleRequestClose: any;
|
|
20
|
+
render(): JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export default class FeedbackMenu extends React.Component {
|
|
23
|
+
static propTypes: {
|
|
24
|
+
value: PropTypes.Requireable<object>;
|
|
25
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
26
|
+
classes: PropTypes.Validator<object>;
|
|
27
|
+
};
|
|
28
|
+
static defaultProps: {
|
|
29
|
+
classes: {};
|
|
30
|
+
};
|
|
31
|
+
render(): JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=feedback-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-menu.d.ts","sourceRoot":"","sources":["../../src/choice-configuration/feedback-menu.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAkCH,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS;IAC3C,MAAM,CAAC,SAAS;;;;MAId;gBAEU,KAAK,KAAA;IAQjB,WAAW,EAAE,GAAG,CAEd;IAEF,kBAAkB,EAAE,GAAG,CAErB;IAEF,MAAM;CA4BP;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAS;IACvD,MAAM,CAAC,SAAS;;;;MAId;IAEF,MAAM,CAAC,YAAY;;MAEjB;IAEF,MAAM;CAwBP"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import * as i from "@pie-lib/render-ui";
|
|
5
|
+
import { InlineMenu as a } from "@pie-lib/render-ui";
|
|
6
|
+
import o from "@mui/material/MenuItem";
|
|
7
|
+
import s from "@mui/material/IconButton";
|
|
8
|
+
import c from "@mui/icons-material/Feedback";
|
|
9
|
+
//#region src/choice-configuration/feedback-menu.tsx
|
|
10
|
+
function l(e) {
|
|
11
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
12
|
+
}
|
|
13
|
+
function u(e, t) {
|
|
14
|
+
return !e || l(e) ? e : l(e.default) ? e.default : t && l(e[t]) ? e[t] : t && l(e[t]?.default) ? e[t].default : e;
|
|
15
|
+
}
|
|
16
|
+
var d = u(a, "InlineMenu") || u(m.InlineMenu, "InlineMenu"), f = i, p = f.default, m = p && typeof p == "object" ? p : f, h = class extends e.Component {
|
|
17
|
+
static propTypes = {
|
|
18
|
+
opts: t.object,
|
|
19
|
+
onClick: t.func.isRequired,
|
|
20
|
+
iconButtonElement: t.any
|
|
21
|
+
};
|
|
22
|
+
constructor(e) {
|
|
23
|
+
super(e), this.state = {
|
|
24
|
+
anchorEl: void 0,
|
|
25
|
+
open: !1
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
handleClick = (e) => {
|
|
29
|
+
this.setState({
|
|
30
|
+
open: !0,
|
|
31
|
+
anchorEl: e.currentTarget
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
handleRequestClose = () => {
|
|
35
|
+
this.setState({ open: !1 });
|
|
36
|
+
};
|
|
37
|
+
render() {
|
|
38
|
+
let { opts: e, onClick: t } = this.props, i = Object.keys(e), a = (e) => () => {
|
|
39
|
+
t(e), this.handleRequestClose();
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ n("div", {
|
|
42
|
+
onClick: this.handleClick,
|
|
43
|
+
children: this.props.iconButtonElement
|
|
44
|
+
}), /* @__PURE__ */ n(d, {
|
|
45
|
+
id: "simple-menu",
|
|
46
|
+
anchorEl: this.state.anchorEl,
|
|
47
|
+
open: this.state.open,
|
|
48
|
+
onClose: this.handleRequestClose,
|
|
49
|
+
transitionDuration: {
|
|
50
|
+
enter: 225,
|
|
51
|
+
exit: 195
|
|
52
|
+
},
|
|
53
|
+
children: i.map((t, r) => /* @__PURE__ */ n(o, {
|
|
54
|
+
onClick: a(t),
|
|
55
|
+
children: e[t]
|
|
56
|
+
}, r))
|
|
57
|
+
})] });
|
|
58
|
+
}
|
|
59
|
+
}, g = class extends e.Component {
|
|
60
|
+
static propTypes = {
|
|
61
|
+
value: t.object,
|
|
62
|
+
onChange: t.func.isRequired,
|
|
63
|
+
classes: t.object.isRequired
|
|
64
|
+
};
|
|
65
|
+
static defaultProps = { classes: {} };
|
|
66
|
+
render() {
|
|
67
|
+
let { value: e, onChange: t, classes: r } = this.props, i = e && e.type, a = i === "custom" || i === "default" ? "primary" : "disabled", o = i === "custom" ? "Custom Feedback" : i === "default" ? "Default Feedback" : "Feedback disabled";
|
|
68
|
+
return /* @__PURE__ */ n(h, {
|
|
69
|
+
iconButtonElement: /* @__PURE__ */ n(s, {
|
|
70
|
+
className: r.icon,
|
|
71
|
+
"aria-label": o,
|
|
72
|
+
size: "large",
|
|
73
|
+
children: /* @__PURE__ */ n(c, { color: a })
|
|
74
|
+
}),
|
|
75
|
+
onClick: (e) => t(e),
|
|
76
|
+
opts: {
|
|
77
|
+
none: "No Feedback",
|
|
78
|
+
default: "Default",
|
|
79
|
+
custom: "Custom"
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
export { g as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/choice-configuration/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 React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class ChoiceConfiguration extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
noLabels: PropTypes.Requireable<boolean>;
|
|
14
|
+
useLetterOrdering: PropTypes.Requireable<boolean>;
|
|
15
|
+
className: PropTypes.Requireable<string>;
|
|
16
|
+
error: PropTypes.Requireable<string>;
|
|
17
|
+
mode: PropTypes.Requireable<string>;
|
|
18
|
+
defaultFeedback: PropTypes.Validator<object>;
|
|
19
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
20
|
+
nonEmpty: PropTypes.Requireable<boolean>;
|
|
21
|
+
data: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
|
+
label: PropTypes.Validator<string>;
|
|
23
|
+
value: PropTypes.Validator<string>;
|
|
24
|
+
correct: PropTypes.Requireable<boolean>;
|
|
25
|
+
feedback: PropTypes.Requireable<PropTypes.InferProps<{
|
|
26
|
+
type: PropTypes.Requireable<string>;
|
|
27
|
+
value: PropTypes.Requireable<string>;
|
|
28
|
+
}>>;
|
|
29
|
+
}>>;
|
|
30
|
+
onDelete: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
|
+
index: PropTypes.Requireable<number>;
|
|
33
|
+
imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
|
|
34
|
+
add: PropTypes.Validator<(...args: any[]) => any>;
|
|
35
|
+
delete: PropTypes.Validator<(...args: any[]) => any>;
|
|
36
|
+
}>>;
|
|
37
|
+
disableImageAlignmentButtons: PropTypes.Requireable<boolean>;
|
|
38
|
+
allowFeedBack: PropTypes.Requireable<boolean>;
|
|
39
|
+
allowDelete: PropTypes.Requireable<boolean>;
|
|
40
|
+
noCorrectAnswerError: PropTypes.Requireable<string>;
|
|
41
|
+
spellCheck: PropTypes.Requireable<boolean>;
|
|
42
|
+
pluginOpts: PropTypes.Requireable<object>;
|
|
43
|
+
toolbarOpts: PropTypes.Requireable<object>;
|
|
44
|
+
uploadSoundSupport: PropTypes.Requireable<object>;
|
|
45
|
+
maxImageWidth: PropTypes.Requireable<number>;
|
|
46
|
+
maxImageHeight: PropTypes.Requireable<number>;
|
|
47
|
+
};
|
|
48
|
+
static defaultProps: {
|
|
49
|
+
index: number;
|
|
50
|
+
noLabels: boolean;
|
|
51
|
+
useLetterOrdering: boolean;
|
|
52
|
+
allowFeedBack: boolean;
|
|
53
|
+
allowDelete: boolean;
|
|
54
|
+
};
|
|
55
|
+
_changeFn: (key: any) => (update: any) => void;
|
|
56
|
+
onLabelChange: (update: any) => void;
|
|
57
|
+
onCheckedChange: any;
|
|
58
|
+
onFeedbackValueChange: any;
|
|
59
|
+
onFeedbackTypeChange: any;
|
|
60
|
+
render(): JSX.Element;
|
|
61
|
+
}
|
|
62
|
+
export default ChoiceConfiguration;
|
|
63
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/choice-configuration/index.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAqMnC,qBAAa,mBAAoB,SAAQ,KAAK,CAAC,SAAS;IACtD,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmCd;IAEF,MAAM,CAAC,YAAY;;;;;;MAMjB;IAEF,SAAS,GAAI,QAAG,MAAM,WAAM,UAM1B;IAEF,aAAa,wBAA2B;IAExC,eAAe,EAAE,GAAG,CAOlB;IAEF,qBAAqB,EAAE,GAAG,CAUxB;IAEF,oBAAoB,EAAE,GAAG,CASvB;IAEF,MAAM;CAqGP;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { InputCheckbox as e, InputRadio as t } from "../inputs.js";
|
|
2
|
+
import n from "./feedback-menu.js";
|
|
3
|
+
import r from "react";
|
|
4
|
+
import i from "prop-types";
|
|
5
|
+
import { styled as a } from "@mui/material/styles";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import * as c from "@pie-lib/render-ui";
|
|
8
|
+
import { InputContainer as l } from "@pie-lib/render-ui";
|
|
9
|
+
import u from "@pie-lib/editable-html-tip-tap";
|
|
10
|
+
import d from "@mui/material/IconButton";
|
|
11
|
+
import f from "@mui/material/TextField";
|
|
12
|
+
import p from "@mui/icons-material/Delete";
|
|
13
|
+
import m from "@mui/icons-material/SubdirectoryArrowRight";
|
|
14
|
+
//#region src/choice-configuration/index.tsx
|
|
15
|
+
function h(e) {
|
|
16
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
17
|
+
}
|
|
18
|
+
function g(e, t) {
|
|
19
|
+
return !e || h(e) ? e : h(e.default) ? e.default : t && h(e[t]) ? e[t] : t && h(e[t]?.default) ? e[t].default : e;
|
|
20
|
+
}
|
|
21
|
+
var _ = g(l, "InputContainer") || g(b.InputContainer, "InputContainer"), v = c, y = v.default, b = y && typeof y == "object" ? y : v, x = u, S = a("div")(({ theme: e }) => ({ marginTop: e.spacing(2) })), C = ({ label: e, onChange: t, value: n, className: r, imageSupport: i, disableImageAlignmentButtons: a, disabled: s, spellCheck: c, nonEmpty: l, pluginOpts: u, toolbarOpts: d, error: f, maxImageWidth: p, maxImageHeight: m, uploadSoundSupport: h, mathMlOptions: g = {} }) => /* @__PURE__ */ o(_, {
|
|
22
|
+
label: e,
|
|
23
|
+
className: r,
|
|
24
|
+
children: /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(x, {
|
|
25
|
+
markup: n || "",
|
|
26
|
+
disabled: s,
|
|
27
|
+
spellCheck: c,
|
|
28
|
+
nonEmpty: l,
|
|
29
|
+
onChange: t,
|
|
30
|
+
imageSupport: i,
|
|
31
|
+
disableImageAlignmentButtons: a,
|
|
32
|
+
pluginProps: u || {},
|
|
33
|
+
toolbarOpts: d,
|
|
34
|
+
error: f,
|
|
35
|
+
maxImageWidth: p,
|
|
36
|
+
maxImageHeight: m,
|
|
37
|
+
uploadSoundSupport: h,
|
|
38
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
39
|
+
mathMlOptions: g
|
|
40
|
+
}) })
|
|
41
|
+
}), w = a("div")(() => ({ position: "relative" })), T = a(m)(({ theme: e }) => ({
|
|
42
|
+
fill: e.palette.grey[400],
|
|
43
|
+
left: -56,
|
|
44
|
+
position: "absolute",
|
|
45
|
+
top: 40
|
|
46
|
+
})), E = a(f)(({ theme: e }) => ({
|
|
47
|
+
width: "100%",
|
|
48
|
+
marginTop: e.spacing(2)
|
|
49
|
+
})), D = a(C)(({ theme: e }) => ({
|
|
50
|
+
width: "100%",
|
|
51
|
+
marginTop: e.spacing(2)
|
|
52
|
+
})), O = ({ value: e, onChange: t, type: n, correct: r, defaults: i, toolbarOpts: a, mathMlOptions: c = {} }) => !n || n === "none" ? null : n === "default" ? /* @__PURE__ */ s(w, { children: [/* @__PURE__ */ o(T, {}), /* @__PURE__ */ o(E, {
|
|
53
|
+
label: "Feedback Text",
|
|
54
|
+
value: r ? i.correct : i.incorrect,
|
|
55
|
+
variant: "standard"
|
|
56
|
+
})] }) : /* @__PURE__ */ s(w, { children: [/* @__PURE__ */ o(T, {}), /* @__PURE__ */ o(D, {
|
|
57
|
+
label: "Feedback Text",
|
|
58
|
+
value: e,
|
|
59
|
+
onChange: t,
|
|
60
|
+
toolbarOpts: a,
|
|
61
|
+
mathMlOptions: c
|
|
62
|
+
})] }), k = a("span")(({ theme: e }) => ({
|
|
63
|
+
paddingRight: e.spacing(1),
|
|
64
|
+
paddingTop: e.spacing(3)
|
|
65
|
+
})), A = a("div")(() => ({
|
|
66
|
+
display: "flex",
|
|
67
|
+
alignItems: "center"
|
|
68
|
+
})), j = a("div")(({ theme: e }) => ({
|
|
69
|
+
flex: "0 1 auto",
|
|
70
|
+
paddingTop: e.spacing(.5),
|
|
71
|
+
paddingBottom: 0,
|
|
72
|
+
marginRight: 0,
|
|
73
|
+
marginLeft: e.spacing(1)
|
|
74
|
+
})), M = a("div")(({ theme: e }) => ({
|
|
75
|
+
flex: "0 1 auto",
|
|
76
|
+
paddingTop: e.spacing(2),
|
|
77
|
+
paddingLeft: 0,
|
|
78
|
+
marginLeft: 0,
|
|
79
|
+
marginRight: e.spacing(1)
|
|
80
|
+
})), N = a("div")(() => ({
|
|
81
|
+
margin: 0,
|
|
82
|
+
width: "inherit"
|
|
83
|
+
})), P = a("div")(() => ({
|
|
84
|
+
margin: 0,
|
|
85
|
+
width: "inherit"
|
|
86
|
+
})), F = a("div")(({ theme: e }) => ({
|
|
87
|
+
flex: "0 1 auto",
|
|
88
|
+
paddingTop: e.spacing(2),
|
|
89
|
+
paddingLeft: 0,
|
|
90
|
+
marginLeft: 0
|
|
91
|
+
})), I = a("div")(({ theme: e }) => ({
|
|
92
|
+
display: "flex",
|
|
93
|
+
flex: 1,
|
|
94
|
+
flexDirection: "column",
|
|
95
|
+
marginRight: e.spacing(1)
|
|
96
|
+
})), L = a("div")(({ theme: e }) => ({
|
|
97
|
+
fontSize: e.typography.fontSize - 2,
|
|
98
|
+
color: e.palette.error.main
|
|
99
|
+
})), R = class extends r.Component {
|
|
100
|
+
static propTypes = {
|
|
101
|
+
noLabels: i.bool,
|
|
102
|
+
useLetterOrdering: i.bool,
|
|
103
|
+
className: i.string,
|
|
104
|
+
error: i.string,
|
|
105
|
+
mode: i.oneOf(["checkbox", "radio"]),
|
|
106
|
+
defaultFeedback: i.object.isRequired,
|
|
107
|
+
disabled: i.bool,
|
|
108
|
+
nonEmpty: i.bool,
|
|
109
|
+
data: i.shape({
|
|
110
|
+
label: i.string.isRequired,
|
|
111
|
+
value: i.string.isRequired,
|
|
112
|
+
correct: i.bool,
|
|
113
|
+
feedback: i.shape({
|
|
114
|
+
type: i.string,
|
|
115
|
+
value: i.string
|
|
116
|
+
})
|
|
117
|
+
}),
|
|
118
|
+
onDelete: i.func,
|
|
119
|
+
onChange: i.func,
|
|
120
|
+
index: i.number,
|
|
121
|
+
imageSupport: i.shape({
|
|
122
|
+
add: i.func.isRequired,
|
|
123
|
+
delete: i.func.isRequired
|
|
124
|
+
}),
|
|
125
|
+
disableImageAlignmentButtons: i.bool,
|
|
126
|
+
allowFeedBack: i.bool,
|
|
127
|
+
allowDelete: i.bool,
|
|
128
|
+
noCorrectAnswerError: i.string,
|
|
129
|
+
spellCheck: i.bool,
|
|
130
|
+
pluginOpts: i.object,
|
|
131
|
+
toolbarOpts: i.object,
|
|
132
|
+
uploadSoundSupport: i.object,
|
|
133
|
+
maxImageWidth: i.number,
|
|
134
|
+
maxImageHeight: i.number
|
|
135
|
+
};
|
|
136
|
+
static defaultProps = {
|
|
137
|
+
index: -1,
|
|
138
|
+
noLabels: !1,
|
|
139
|
+
useLetterOrdering: !1,
|
|
140
|
+
allowFeedBack: !0,
|
|
141
|
+
allowDelete: !0
|
|
142
|
+
};
|
|
143
|
+
_changeFn = (e) => (t) => {
|
|
144
|
+
let { data: n, onChange: r } = this.props;
|
|
145
|
+
r && r({
|
|
146
|
+
...n,
|
|
147
|
+
[e]: t
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
onLabelChange = this._changeFn("label");
|
|
151
|
+
onCheckedChange = (e) => {
|
|
152
|
+
let t = e.target.checked, { data: n, onChange: r } = this.props;
|
|
153
|
+
r && r({
|
|
154
|
+
...n,
|
|
155
|
+
correct: t
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
onFeedbackValueChange = (e) => {
|
|
159
|
+
let { data: t, onChange: n } = this.props;
|
|
160
|
+
if (t.feedback.type !== "custom") return;
|
|
161
|
+
let r = {
|
|
162
|
+
...t.feedback,
|
|
163
|
+
value: e
|
|
164
|
+
};
|
|
165
|
+
n && n({
|
|
166
|
+
...t,
|
|
167
|
+
feedback: r
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
onFeedbackTypeChange = (e) => {
|
|
171
|
+
let { data: t, onChange: n } = this.props, r = {
|
|
172
|
+
...t.feedback,
|
|
173
|
+
type: e
|
|
174
|
+
};
|
|
175
|
+
r.type !== "custom" && (r.value = void 0), n && n({
|
|
176
|
+
...t,
|
|
177
|
+
feedback: r
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
render() {
|
|
181
|
+
let { data: r, mode: i, onDelete: a, defaultFeedback: c, index: l, className: u, noLabels: f, useLetterOrdering: m, imageSupport: h, disableImageAlignmentButtons: g, disabled: v, spellCheck: y, nonEmpty: b, allowFeedBack: x, allowDelete: S, pluginOpts: w, toolbarOpts: T, error: E, noCorrectAnswerError: D, uploadSoundSupport: R, maxImageWidth: z, maxImageHeight: B, mathMlOptions: V = {} } = this.props, H = i === "checkbox" ? e : t;
|
|
182
|
+
return /* @__PURE__ */ s(A, { children: [
|
|
183
|
+
l > 0 && /* @__PURE__ */ o(k, {
|
|
184
|
+
type: "title",
|
|
185
|
+
children: m ? String.fromCharCode(96 + l).toUpperCase() : l
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ o(j, { children: /* @__PURE__ */ o(H, {
|
|
188
|
+
onChange: this.onCheckedChange,
|
|
189
|
+
label: f ? "" : "Correct",
|
|
190
|
+
checked: !!r.correct,
|
|
191
|
+
error: D
|
|
192
|
+
}) }),
|
|
193
|
+
/* @__PURE__ */ s(I, { children: [
|
|
194
|
+
/* @__PURE__ */ o(C, {
|
|
195
|
+
label: f ? "" : "Label",
|
|
196
|
+
value: r.label,
|
|
197
|
+
onChange: this.onLabelChange,
|
|
198
|
+
imageSupport: h,
|
|
199
|
+
disableImageAlignmentButtons: g,
|
|
200
|
+
disabled: v,
|
|
201
|
+
spellCheck: y,
|
|
202
|
+
nonEmpty: b,
|
|
203
|
+
pluginOpts: w,
|
|
204
|
+
toolbarOpts: T,
|
|
205
|
+
error: E,
|
|
206
|
+
uploadSoundSupport: R,
|
|
207
|
+
mathMlOptions: V,
|
|
208
|
+
maxImageWidth: z,
|
|
209
|
+
maxImageHeight: B
|
|
210
|
+
}),
|
|
211
|
+
E && /* @__PURE__ */ o(L, { children: E }),
|
|
212
|
+
x && /* @__PURE__ */ o(O, {
|
|
213
|
+
...r.feedback,
|
|
214
|
+
correct: r.correct,
|
|
215
|
+
defaults: c,
|
|
216
|
+
onChange: this.onFeedbackValueChange,
|
|
217
|
+
toolbarOpts: T
|
|
218
|
+
})
|
|
219
|
+
] }),
|
|
220
|
+
x && /* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(_, {
|
|
221
|
+
label: f ? "" : "Feedback",
|
|
222
|
+
children: /* @__PURE__ */ o(N, { children: /* @__PURE__ */ o(n, {
|
|
223
|
+
onChange: this.onFeedbackTypeChange,
|
|
224
|
+
value: r.feedback
|
|
225
|
+
}) })
|
|
226
|
+
}) }),
|
|
227
|
+
S && /* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(_, {
|
|
228
|
+
label: f ? "" : "Delete",
|
|
229
|
+
children: /* @__PURE__ */ o(P, { children: /* @__PURE__ */ o(d, {
|
|
230
|
+
"aria-label": "delete",
|
|
231
|
+
onClick: a,
|
|
232
|
+
size: "large",
|
|
233
|
+
children: /* @__PURE__ */ o(p, {})
|
|
234
|
+
}) })
|
|
235
|
+
}) })
|
|
236
|
+
] });
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
//#endregion
|
|
240
|
+
export { R as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/choice-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
|
+
/**
|
|
10
|
+
* Add value to every model.choices.
|
|
11
|
+
* @param {Object} model the model to normalize
|
|
12
|
+
* @return {Object} the updated model
|
|
13
|
+
*/
|
|
14
|
+
export declare const normalizeChoices: (model: any) => any;
|
|
15
|
+
/**
|
|
16
|
+
* Find the first available index.
|
|
17
|
+
* @param {string[]} values
|
|
18
|
+
* @param {number} index
|
|
19
|
+
* @return {string}
|
|
20
|
+
*/
|
|
21
|
+
export declare const firstAvailableIndex: (values: any, index: any) => any;
|
|
22
|
+
//# sourceMappingURL=choice-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choice-utils.d.ts","sourceRoot":"","sources":["../src/choice-utils.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAIH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAK,QAQrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,WAAM,EAAE,UAAK,QAMhD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __exportAll as e } from "./_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { includes as t } from "lodash-es";
|
|
3
|
+
//#region src/choice-utils.ts
|
|
4
|
+
var n = /* @__PURE__ */ e({
|
|
5
|
+
firstAvailableIndex: () => i,
|
|
6
|
+
normalizeChoices: () => r
|
|
7
|
+
}), r = (e) => {
|
|
8
|
+
let t = e.choices.map((e, t) => (e.value ||= `${t}`, e));
|
|
9
|
+
return {
|
|
10
|
+
...e,
|
|
11
|
+
choices: t
|
|
12
|
+
};
|
|
13
|
+
}, i = (e, n) => t(e, `${n}`) ? i(e, n + 1) : `${n}`;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as choice_utils_exports };
|