@pie-lib/config-ui 13.0.4-next.3 → 13.0.4-next.31
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 +61 -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 +31 -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.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 +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 +33 -19
- package/CHANGELOG.json +0 -32
- package/CHANGELOG.md +0 -2419
- package/LICENSE.md +0 -5
- 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/__tests__/alert-dialog.test.jsx +0 -183
- package/src/__tests__/checkbox.test.jsx +0 -152
- package/src/__tests__/choice-utils.test.js +0 -12
- package/src/__tests__/form-section.test.jsx +0 -328
- package/src/__tests__/help.test.jsx +0 -184
- package/src/__tests__/input.test.jsx +0 -156
- package/src/__tests__/langs.test.jsx +0 -376
- package/src/__tests__/number-text-field-custom.test.jsx +0 -255
- package/src/__tests__/number-text-field.test.jsx +0 -263
- package/src/__tests__/radio-with-label.test.jsx +0 -155
- package/src/__tests__/settings-panel.test.js +0 -187
- package/src/__tests__/settings.test.jsx +0 -452
- package/src/__tests__/tabs.test.jsx +0 -188
- package/src/__tests__/two-choice.test.js +0 -110
- package/src/__tests__/with-stateful-model.test.jsx +0 -139
- package/src/alert-dialog.jsx +0 -75
- package/src/checkbox.jsx +0 -61
- package/src/choice-configuration/__tests__/feedback-menu.test.jsx +0 -151
- package/src/choice-configuration/__tests__/index.test.jsx +0 -234
- 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/__tests__/feedback-config.test.jsx +0 -141
- package/src/feedback-config/__tests__/feedback-selector.test.jsx +0 -97
- 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/__tests__/config.layout.test.jsx +0 -59
- package/src/layout/__tests__/layout-content.test.jsx +0 -3
- 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/__tests__/index.test.jsx +0 -113
- 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,33 @@
|
|
|
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 { color as i } from "@pie-lib/render-ui";
|
|
6
|
+
import a from "@mui/material/Switch";
|
|
7
|
+
import o from "@mui/material/InputLabel";
|
|
8
|
+
//#region src/settings/toggle.tsx
|
|
9
|
+
var s = t("div")(() => ({
|
|
10
|
+
display: "flex",
|
|
11
|
+
width: "100%",
|
|
12
|
+
justifyContent: "space-between"
|
|
13
|
+
})), c = t(o)(({ theme: e }) => ({
|
|
14
|
+
color: "rgba(0, 0, 0, 0.89)",
|
|
15
|
+
fontSize: e.typography.fontSize,
|
|
16
|
+
paddingTop: e.spacing(2)
|
|
17
|
+
})), l = t(a)(({ checked: e }) => ({
|
|
18
|
+
"&.Mui-checked .MuiSwitch-thumb": { color: `${i.tertiary()} !important` },
|
|
19
|
+
"&.Mui-checked .MuiSwitch-track": { backgroundColor: `${i.tertiaryLight()} !important` },
|
|
20
|
+
"& .MuiSwitch-track": { backgroundColor: e ? `${i.tertiaryLight()} !important` : void 0 }
|
|
21
|
+
})), u = ({ checked: e, disabled: t, label: i, toggle: a }) => /* @__PURE__ */ r(s, { children: [/* @__PURE__ */ n(c, { children: i }), /* @__PURE__ */ n(l, {
|
|
22
|
+
checked: e,
|
|
23
|
+
disabled: t,
|
|
24
|
+
onChange: (e) => a(e.target.checked)
|
|
25
|
+
})] });
|
|
26
|
+
u.propTypes = {
|
|
27
|
+
checked: e.bool,
|
|
28
|
+
disabled: e.bool,
|
|
29
|
+
label: e.string.isRequired,
|
|
30
|
+
toggle: e.func.isRequired
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { u as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/tabs/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 Tabs extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
className: PropTypes.Requireable<string>;
|
|
14
|
+
contentClassName: PropTypes.Requireable<string>;
|
|
15
|
+
contentStyle: PropTypes.Requireable<object>;
|
|
16
|
+
children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
|
|
17
|
+
};
|
|
18
|
+
constructor(props: any);
|
|
19
|
+
handleChange: any;
|
|
20
|
+
render(): React.JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export default Tabs;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 a from "@mui/material/Tabs";
|
|
6
|
+
import o from "@mui/material/Tab";
|
|
7
|
+
//#region src/tabs/index.tsx
|
|
8
|
+
var s = n(o)(() => ({})), c = class extends e.Component {
|
|
9
|
+
static propTypes = {
|
|
10
|
+
className: t.string,
|
|
11
|
+
contentClassName: t.string,
|
|
12
|
+
contentStyle: t.object,
|
|
13
|
+
children: t.oneOfType([t.arrayOf(t.node), t.node]).isRequired
|
|
14
|
+
};
|
|
15
|
+
constructor(e) {
|
|
16
|
+
super(e), this.state = { value: 0 };
|
|
17
|
+
}
|
|
18
|
+
handleChange = (e, t) => {
|
|
19
|
+
this.setState({ value: t });
|
|
20
|
+
};
|
|
21
|
+
render() {
|
|
22
|
+
let { value: t } = this.state, { children: n, className: o, contentClassName: c, contentStyle: l = {} } = this.props;
|
|
23
|
+
return /* @__PURE__ */ i("div", {
|
|
24
|
+
className: o,
|
|
25
|
+
children: [/* @__PURE__ */ r(a, {
|
|
26
|
+
indicatorColor: "primary",
|
|
27
|
+
value: t,
|
|
28
|
+
onChange: this.handleChange,
|
|
29
|
+
children: e.Children.map(n, (e, t) => e && e.props.title ? /* @__PURE__ */ r(s, { label: e.props.title }, t) : null)
|
|
30
|
+
}), /* @__PURE__ */ r("div", {
|
|
31
|
+
className: c,
|
|
32
|
+
style: l,
|
|
33
|
+
children: n[t]
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { c as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/tags-input/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 TagsInput extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
tags: PropTypes.Validator<(string | null | undefined)[]>;
|
|
14
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
15
|
+
};
|
|
16
|
+
constructor(props: any);
|
|
17
|
+
onFocus: any;
|
|
18
|
+
onBlur: any;
|
|
19
|
+
render(): React.JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
export default TagsInput;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import e from "../mui-box/index.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 { uniq as o } from "@pie-element/shared-lodash";
|
|
7
|
+
import s from "@mui/material/Chip";
|
|
8
|
+
//#region src/tags-input/index.tsx
|
|
9
|
+
var c = 13, l = r(s)(() => ({
|
|
10
|
+
padding: "0px",
|
|
11
|
+
margin: "1px"
|
|
12
|
+
})), u = ({ label: e, onDelete: t }) => /* @__PURE__ */ i(l, {
|
|
13
|
+
label: e,
|
|
14
|
+
onDelete: t
|
|
15
|
+
});
|
|
16
|
+
u.propTypes = {
|
|
17
|
+
label: n.string.isRequired,
|
|
18
|
+
onDelete: n.func.isRequired
|
|
19
|
+
};
|
|
20
|
+
var d = r("div")(({ theme: e }) => ({
|
|
21
|
+
border: `0px solid ${e.palette.background.paper}`,
|
|
22
|
+
display: "flex",
|
|
23
|
+
flexWrap: "wrap"
|
|
24
|
+
})), f = r("input")(({ theme: e }) => ({
|
|
25
|
+
padding: "2px",
|
|
26
|
+
margin: "1px",
|
|
27
|
+
minWidth: "30px",
|
|
28
|
+
width: "100%",
|
|
29
|
+
flex: "1",
|
|
30
|
+
border: `0px solid ${e.palette.background.paper}`,
|
|
31
|
+
height: "28px",
|
|
32
|
+
fontSize: e.typography.fontSize,
|
|
33
|
+
fontFamily: e.typography.fontFamily,
|
|
34
|
+
outline: "none",
|
|
35
|
+
"&:focus": { outline: "none" }
|
|
36
|
+
})), p = class extends t.Component {
|
|
37
|
+
static propTypes = {
|
|
38
|
+
tags: n.arrayOf(n.string).isRequired,
|
|
39
|
+
onChange: n.func.isRequired
|
|
40
|
+
};
|
|
41
|
+
constructor(e) {
|
|
42
|
+
super(e), this.state = {
|
|
43
|
+
value: "",
|
|
44
|
+
focused: !1
|
|
45
|
+
}, this.onKeyDown = (e) => {
|
|
46
|
+
if (e.keyCode === c && this.state.value !== "") {
|
|
47
|
+
let e = this.state.value.trim(), t = o(this.props.tags.concat([e]));
|
|
48
|
+
t.length !== this.props.tags.length && (this.props.onChange(t), this.setState({ value: "" }));
|
|
49
|
+
}
|
|
50
|
+
}, this.onChange = (e) => {
|
|
51
|
+
this.setState({ value: e.target.value });
|
|
52
|
+
}, this.deleteTag = (e) => {
|
|
53
|
+
let { tags: t } = this.props, n = t.indexOf(e);
|
|
54
|
+
n !== -1 && (t.splice(n, 1), this.props.onChange(t), this.input.focus());
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
onFocus = () => {
|
|
58
|
+
this.setState({ focused: !0 });
|
|
59
|
+
};
|
|
60
|
+
onBlur = () => {
|
|
61
|
+
this.setState({ focused: !1 });
|
|
62
|
+
};
|
|
63
|
+
render() {
|
|
64
|
+
let { tags: t } = this.props;
|
|
65
|
+
return /* @__PURE__ */ i(e, {
|
|
66
|
+
focused: this.state.focused,
|
|
67
|
+
children: /* @__PURE__ */ a(d, { children: [(t || []).map((e, t) => /* @__PURE__ */ i(u, {
|
|
68
|
+
label: e,
|
|
69
|
+
onDelete: () => this.deleteTag(e)
|
|
70
|
+
}, t)), /* @__PURE__ */ i(f, {
|
|
71
|
+
ref: (e) => this.input = e,
|
|
72
|
+
onKeyDown: this.onKeyDown,
|
|
73
|
+
onChange: this.onChange,
|
|
74
|
+
value: this.state.value,
|
|
75
|
+
onFocus: this.onFocus,
|
|
76
|
+
onBlur: this.onBlur,
|
|
77
|
+
type: "text"
|
|
78
|
+
})] })
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
export { p as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/two-choice.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 class NChoice extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
header: PropTypes.Validator<string>;
|
|
14
|
+
className: PropTypes.Requireable<string>;
|
|
15
|
+
customLabel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
opts: PropTypes.Validator<any[]>;
|
|
17
|
+
value: PropTypes.Requireable<string>;
|
|
18
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
19
|
+
direction: PropTypes.Requireable<string>;
|
|
20
|
+
};
|
|
21
|
+
handleChange: any;
|
|
22
|
+
render(): React.JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export { NChoice };
|
|
25
|
+
declare class TwoChoice extends React.Component {
|
|
26
|
+
static propTypes: {
|
|
27
|
+
header: PropTypes.Validator<string>;
|
|
28
|
+
value: PropTypes.Validator<string>;
|
|
29
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
30
|
+
one: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
31
|
+
label: PropTypes.Requireable<string>;
|
|
32
|
+
value: PropTypes.Requireable<string>;
|
|
33
|
+
}> | null | undefined>>;
|
|
34
|
+
two: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
35
|
+
label: PropTypes.Requireable<string>;
|
|
36
|
+
value: PropTypes.Requireable<string>;
|
|
37
|
+
}> | null | undefined>>;
|
|
38
|
+
className: PropTypes.Requireable<string>;
|
|
39
|
+
customLabel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
|
+
};
|
|
41
|
+
render(): React.JSX.Element;
|
|
42
|
+
}
|
|
43
|
+
export default TwoChoice;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import e from "./radio-with-label.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 } from "react/jsx-runtime";
|
|
6
|
+
import * as a from "@pie-lib/render-ui";
|
|
7
|
+
import { InputContainer as o } from "@pie-lib/render-ui";
|
|
8
|
+
//#region src/two-choice.tsx
|
|
9
|
+
function s(e) {
|
|
10
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
11
|
+
}
|
|
12
|
+
function c(e, t) {
|
|
13
|
+
return !e || s(e) ? e : s(e.default) ? e.default : t && s(e[t]) ? e[t] : t && s(e[t]?.default) ? e[t].default : e;
|
|
14
|
+
}
|
|
15
|
+
var l = c(o, "InputContainer") || c(f.InputContainer, "InputContainer"), u = a, d = u.default, f = d && typeof d == "object" ? d : u, p = r("div")(({ theme: e, direction: t }) => ({
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexWrap: "wrap",
|
|
18
|
+
paddingLeft: 0,
|
|
19
|
+
marginTop: e.spacing(1),
|
|
20
|
+
...t === "vertical" && { flexDirection: "column" }
|
|
21
|
+
})), m = class extends t.Component {
|
|
22
|
+
static propTypes = {
|
|
23
|
+
header: n.string.isRequired,
|
|
24
|
+
className: n.string,
|
|
25
|
+
customLabel: n.func,
|
|
26
|
+
opts: n.array.isRequired,
|
|
27
|
+
value: n.string,
|
|
28
|
+
onChange: n.func.isRequired,
|
|
29
|
+
direction: n.oneOf(["horizontal", "vertical"])
|
|
30
|
+
};
|
|
31
|
+
handleChange = (e) => {
|
|
32
|
+
this.props.onChange(e.currentTarget.value);
|
|
33
|
+
};
|
|
34
|
+
render() {
|
|
35
|
+
let { header: t, className: n, customLabel: r, opts: a, value: o, direction: s } = this.props, c = a.map((e) => typeof e == "string" ? {
|
|
36
|
+
label: e,
|
|
37
|
+
value: e
|
|
38
|
+
} : e), u = r || e;
|
|
39
|
+
return /* @__PURE__ */ i(l, {
|
|
40
|
+
label: t,
|
|
41
|
+
className: n,
|
|
42
|
+
children: /* @__PURE__ */ i(p, {
|
|
43
|
+
direction: s,
|
|
44
|
+
children: c.map((e, t) => /* @__PURE__ */ i(u, {
|
|
45
|
+
value: e.value,
|
|
46
|
+
checked: e.value === o,
|
|
47
|
+
onChange: this.handleChange,
|
|
48
|
+
label: e.label
|
|
49
|
+
}, t))
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, h = n.shape({
|
|
54
|
+
label: n.string,
|
|
55
|
+
value: n.string
|
|
56
|
+
}), g = class extends t.Component {
|
|
57
|
+
static propTypes = {
|
|
58
|
+
header: n.string.isRequired,
|
|
59
|
+
value: n.string.isRequired,
|
|
60
|
+
onChange: n.func.isRequired,
|
|
61
|
+
one: n.oneOfType([h, n.string]),
|
|
62
|
+
two: n.oneOfType([h, n.string]),
|
|
63
|
+
className: n.string,
|
|
64
|
+
customLabel: n.func
|
|
65
|
+
};
|
|
66
|
+
render() {
|
|
67
|
+
let { one: e, two: t, header: n, className: r, customLabel: a, value: o, onChange: s } = this.props;
|
|
68
|
+
return /* @__PURE__ */ i(m, {
|
|
69
|
+
customLabel: a,
|
|
70
|
+
header: n,
|
|
71
|
+
className: r,
|
|
72
|
+
opts: [e, t],
|
|
73
|
+
value: o,
|
|
74
|
+
onChange: s
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { m as NChoice, g as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-lib/packages/config-ui/src/with-stateful-model.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 withStatefulModel: (Component: any) => {
|
|
12
|
+
new (props: any): {
|
|
13
|
+
UNSAFE_componentWillReceiveProps(props: any): void;
|
|
14
|
+
onChange: any;
|
|
15
|
+
render(): React.JSX.Element;
|
|
16
|
+
context: unknown;
|
|
17
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
18
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
19
|
+
readonly props: Readonly<{}>;
|
|
20
|
+
state: Readonly<{}>;
|
|
21
|
+
refs: {
|
|
22
|
+
[key: string]: React.ReactInstance;
|
|
23
|
+
};
|
|
24
|
+
componentDidMount?(): void;
|
|
25
|
+
shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
26
|
+
componentWillUnmount?(): void;
|
|
27
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
28
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
|
|
29
|
+
componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
30
|
+
componentWillMount?(): void;
|
|
31
|
+
UNSAFE_componentWillMount?(): void;
|
|
32
|
+
componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
|
|
33
|
+
componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
34
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
35
|
+
};
|
|
36
|
+
propTypes: {
|
|
37
|
+
model: PropTypes.Validator<object>;
|
|
38
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
39
|
+
};
|
|
40
|
+
contextType?: React.Context<any> | undefined;
|
|
41
|
+
};
|
|
42
|
+
export default withStatefulModel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import t from "prop-types";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/with-stateful-model.tsx
|
|
5
|
+
var r = (r) => {
|
|
6
|
+
class i extends e.Component {
|
|
7
|
+
static propTypes = {
|
|
8
|
+
model: t.object.isRequired,
|
|
9
|
+
onChange: t.func.isRequired
|
|
10
|
+
};
|
|
11
|
+
constructor(e) {
|
|
12
|
+
super(e), this.state = { model: e.model };
|
|
13
|
+
}
|
|
14
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
15
|
+
this.setState({ model: e.model });
|
|
16
|
+
}
|
|
17
|
+
onChange = (e) => {
|
|
18
|
+
this.setState({ model: e }, () => {
|
|
19
|
+
this.props.onChange(this.state.model);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
render() {
|
|
23
|
+
return /* @__PURE__ */ n(r, {
|
|
24
|
+
model: this.state.model,
|
|
25
|
+
onChange: this.onChange
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return i;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { r as default };
|
package/package.json
CHANGED
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/config-ui",
|
|
3
|
-
"version": "13.0.4-next.
|
|
4
|
-
"
|
|
5
|
-
"module": "src/index.js",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {},
|
|
10
|
-
"repository": "pie-framework/pie-lib",
|
|
3
|
+
"version": "13.0.4-next.31",
|
|
4
|
+
"description": "React implementation of @pie-lib/config-ui synced from pie-lib",
|
|
11
5
|
"dependencies": {
|
|
12
6
|
"@emotion/react": "^11.14.0",
|
|
13
7
|
"@emotion/style": "^0.8.0",
|
|
14
8
|
"@mui/icons-material": "^7.3.4",
|
|
15
9
|
"@mui/material": "^7.3.4",
|
|
16
|
-
"@pie-lib/editable-html-tip-tap": "
|
|
17
|
-
"@pie-lib/icons": "
|
|
18
|
-
"@pie-lib/render-ui": "
|
|
10
|
+
"@pie-lib/editable-html-tip-tap": "2.1.2-next.31",
|
|
11
|
+
"@pie-lib/icons": "4.0.2",
|
|
12
|
+
"@pie-lib/render-ui": "6.1.1-next.38",
|
|
19
13
|
"assert": "^1.4.1",
|
|
20
14
|
"debug": "^4.1.1",
|
|
21
|
-
"lodash-es": "^4.17.23",
|
|
22
|
-
"mathjs": "^7.0.1",
|
|
23
15
|
"prop-types": "^15.6.2",
|
|
24
|
-
"react-measure": "^2.2.2"
|
|
16
|
+
"react-measure": "^2.2.2",
|
|
17
|
+
"@pie-element/shared-lodash": "0.1.1-next.1"
|
|
18
|
+
},
|
|
19
|
+
"type": "module",
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "bun x vite build && bun x tsc --emitDeclarationOnly",
|
|
34
|
+
"dev": "bun x vite",
|
|
35
|
+
"test": "bun x vitest run"
|
|
25
36
|
},
|
|
26
37
|
"devDependencies": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
38
|
+
"vite": "^8.0.1",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
41
|
+
"@types/react": "^18.2.0",
|
|
42
|
+
"@types/react-dom": "^18.2.0"
|
|
29
43
|
},
|
|
30
44
|
"peerDependencies": {
|
|
31
|
-
"react": "^18.
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
"react": "^18.0.0",
|
|
46
|
+
"react-dom": "^18.0.0"
|
|
47
|
+
}
|
|
34
48
|
}
|
package/CHANGELOG.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"type": "feat",
|
|
4
|
-
"scope": "layout",
|
|
5
|
-
"subject": "merged develop into master [ch2242]",
|
|
6
|
-
"merge": null,
|
|
7
|
-
"header": "feat(layout): merged develop into master [ch2242]",
|
|
8
|
-
"body": null,
|
|
9
|
-
"footer": null,
|
|
10
|
-
"notes": [],
|
|
11
|
-
"hash": "28f11ba7391c26e99a4fabaec388461b63c4a169",
|
|
12
|
-
"gitTags": "",
|
|
13
|
-
"committerDate": "2019-06-25 21:07:13 -0400",
|
|
14
|
-
"isTagged": true,
|
|
15
|
-
"tag": "@pie-lib/config-ui@10.10.0"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"type": "feat",
|
|
19
|
-
"scope": "mask-markup",
|
|
20
|
-
"subject": "merging with the develop branch",
|
|
21
|
-
"merge": null,
|
|
22
|
-
"header": "feat(mask-markup): merging with the develop branch",
|
|
23
|
-
"body": null,
|
|
24
|
-
"footer": null,
|
|
25
|
-
"notes": [],
|
|
26
|
-
"hash": "0153c1aba8a08ba6c974fcc69476a87b9086f6c5",
|
|
27
|
-
"gitTags": "",
|
|
28
|
-
"committerDate": "2019-05-02 07:12:59 +0300",
|
|
29
|
-
"isTagged": true,
|
|
30
|
-
"tag": "@pie-lib/config-ui@10.1.0"
|
|
31
|
-
}
|
|
32
|
-
]
|