@pie-lib/config-ui 13.0.4-next.31 → 13.0.4-next.34

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.
Files changed (190) hide show
  1. package/CHANGELOG.json +32 -0
  2. package/CHANGELOG.md +2419 -0
  3. package/LICENSE.md +5 -0
  4. package/lib/alert-dialog.js +68 -0
  5. package/lib/alert-dialog.js.map +1 -0
  6. package/lib/checkbox.js +84 -0
  7. package/lib/checkbox.js.map +1 -0
  8. package/lib/choice-configuration/feedback-menu.js +129 -0
  9. package/lib/choice-configuration/feedback-menu.js.map +1 -0
  10. package/lib/choice-configuration/index.js +381 -0
  11. package/lib/choice-configuration/index.js.map +1 -0
  12. package/lib/choice-utils.js +42 -0
  13. package/lib/choice-utils.js.map +1 -0
  14. package/lib/feedback-config/feedback-selector.js +155 -0
  15. package/lib/feedback-config/feedback-selector.js.map +1 -0
  16. package/lib/feedback-config/group.js +61 -0
  17. package/lib/feedback-config/group.js.map +1 -0
  18. package/lib/feedback-config/index.js +146 -0
  19. package/lib/feedback-config/index.js.map +1 -0
  20. package/lib/form-section.js +44 -0
  21. package/lib/form-section.js.map +1 -0
  22. package/lib/help.js +106 -0
  23. package/lib/help.js.map +1 -0
  24. package/lib/index.js +186 -0
  25. package/lib/index.js.map +1 -0
  26. package/lib/input.js +106 -0
  27. package/lib/input.js.map +1 -0
  28. package/lib/inputs.js +105 -0
  29. package/lib/inputs.js.map +1 -0
  30. package/lib/langs.js +136 -0
  31. package/lib/langs.js.map +1 -0
  32. package/lib/layout/config-layout.js +137 -0
  33. package/lib/layout/config-layout.js.map +1 -0
  34. package/lib/layout/index.js +21 -0
  35. package/lib/layout/index.js.map +1 -0
  36. package/lib/layout/layout-contents.js +160 -0
  37. package/lib/layout/layout-contents.js.map +1 -0
  38. package/lib/layout/settings-box.js +57 -0
  39. package/lib/layout/settings-box.js.map +1 -0
  40. package/lib/mui-box/index.js +63 -0
  41. package/lib/mui-box/index.js.map +1 -0
  42. package/lib/number-text-field-custom.js +376 -0
  43. package/lib/number-text-field-custom.js.map +1 -0
  44. package/lib/number-text-field.js +229 -0
  45. package/lib/number-text-field.js.map +1 -0
  46. package/lib/radio-with-label.js +48 -0
  47. package/lib/radio-with-label.js.map +1 -0
  48. package/lib/settings/display-size.js +61 -0
  49. package/lib/settings/display-size.js.map +1 -0
  50. package/lib/settings/index.js +110 -0
  51. package/lib/settings/index.js.map +1 -0
  52. package/lib/settings/panel.js +392 -0
  53. package/lib/settings/panel.js.map +1 -0
  54. package/lib/settings/settings-radio-label.js +51 -0
  55. package/lib/settings/settings-radio-label.js.map +1 -0
  56. package/lib/settings/toggle.js +63 -0
  57. package/lib/settings/toggle.js.map +1 -0
  58. package/lib/tabs/index.js +75 -0
  59. package/lib/tabs/index.js.map +1 -0
  60. package/lib/tags-input/index.js +149 -0
  61. package/lib/tags-input/index.js.map +1 -0
  62. package/lib/two-choice.js +136 -0
  63. package/lib/two-choice.js.map +1 -0
  64. package/lib/with-stateful-model.js +61 -0
  65. package/lib/with-stateful-model.js.map +1 -0
  66. package/package.json +19 -33
  67. package/src/__tests__/alert-dialog.test.jsx +183 -0
  68. package/src/__tests__/checkbox.test.jsx +152 -0
  69. package/src/__tests__/choice-utils.test.js +12 -0
  70. package/src/__tests__/form-section.test.jsx +328 -0
  71. package/src/__tests__/help.test.jsx +184 -0
  72. package/src/__tests__/input.test.jsx +156 -0
  73. package/src/__tests__/langs.test.jsx +376 -0
  74. package/src/__tests__/number-text-field-custom.test.jsx +255 -0
  75. package/src/__tests__/number-text-field.test.jsx +263 -0
  76. package/src/__tests__/radio-with-label.test.jsx +155 -0
  77. package/src/__tests__/settings-panel.test.js +187 -0
  78. package/src/__tests__/settings.test.jsx +452 -0
  79. package/src/__tests__/tabs.test.jsx +188 -0
  80. package/src/__tests__/two-choice.test.js +110 -0
  81. package/src/__tests__/with-stateful-model.test.jsx +139 -0
  82. package/src/alert-dialog.jsx +75 -0
  83. package/src/checkbox.jsx +61 -0
  84. package/src/choice-configuration/__tests__/feedback-menu.test.jsx +151 -0
  85. package/src/choice-configuration/__tests__/index.test.jsx +234 -0
  86. package/src/choice-configuration/feedback-menu.jsx +96 -0
  87. package/src/choice-configuration/index.jsx +357 -0
  88. package/src/choice-utils.js +30 -0
  89. package/src/feedback-config/__tests__/feedback-config.test.jsx +141 -0
  90. package/src/feedback-config/__tests__/feedback-selector.test.jsx +97 -0
  91. package/src/feedback-config/feedback-selector.jsx +112 -0
  92. package/src/feedback-config/group.jsx +51 -0
  93. package/src/feedback-config/index.jsx +111 -0
  94. package/src/form-section.jsx +31 -0
  95. package/src/help.jsx +79 -0
  96. package/src/index.js +55 -0
  97. package/src/input.jsx +72 -0
  98. package/src/inputs.jsx +69 -0
  99. package/src/langs.jsx +111 -0
  100. package/src/layout/__tests__/config.layout.test.jsx +59 -0
  101. package/src/layout/__tests__/layout-content.test.jsx +3 -0
  102. package/src/layout/config-layout.jsx +103 -0
  103. package/src/layout/index.js +4 -0
  104. package/src/layout/layout-contents.jsx +117 -0
  105. package/src/layout/settings-box.jsx +32 -0
  106. package/src/mui-box/index.jsx +56 -0
  107. package/src/number-text-field-custom.jsx +333 -0
  108. package/src/number-text-field.jsx +215 -0
  109. package/src/radio-with-label.jsx +30 -0
  110. package/src/settings/display-size.jsx +53 -0
  111. package/src/settings/index.js +83 -0
  112. package/src/settings/panel.jsx +333 -0
  113. package/src/settings/settings-radio-label.jsx +32 -0
  114. package/src/settings/toggle.jsx +46 -0
  115. package/src/tabs/index.jsx +47 -0
  116. package/src/tags-input/__tests__/index.test.jsx +113 -0
  117. package/src/tags-input/index.jsx +116 -0
  118. package/src/two-choice.jsx +90 -0
  119. package/src/with-stateful-model.jsx +36 -0
  120. package/dist/_virtual/_rolldown/runtime.js +0 -11
  121. package/dist/alert-dialog.d.ts +0 -44
  122. package/dist/alert-dialog.js +0 -47
  123. package/dist/checkbox.d.ts +0 -34
  124. package/dist/checkbox.js +0 -57
  125. package/dist/choice-configuration/feedback-menu.d.ts +0 -32
  126. package/dist/choice-configuration/feedback-menu.js +0 -85
  127. package/dist/choice-configuration/index.d.ts +0 -62
  128. package/dist/choice-configuration/index.js +0 -240
  129. package/dist/choice-utils.d.ts +0 -21
  130. package/dist/choice-utils.js +0 -15
  131. package/dist/feedback-config/feedback-selector.d.ts +0 -33
  132. package/dist/feedback-config/feedback-selector.js +0 -92
  133. package/dist/feedback-config/group.d.ts +0 -21
  134. package/dist/feedback-config/group.js +0 -33
  135. package/dist/feedback-config/index.d.ts +0 -48
  136. package/dist/feedback-config/index.js +0 -96
  137. package/dist/form-section.d.ts +0 -25
  138. package/dist/form-section.js +0 -25
  139. package/dist/fraction-to-number.d.ts +0 -7
  140. package/dist/fraction-to-number.js +0 -9
  141. package/dist/help.d.ts +0 -41
  142. package/dist/help.js +0 -61
  143. package/dist/index.d.ts +0 -31
  144. package/dist/index.js +0 -34
  145. package/dist/input.d.ts +0 -29
  146. package/dist/input.js +0 -65
  147. package/dist/inputs.d.ts +0 -63
  148. package/dist/inputs.js +0 -70
  149. package/dist/langs.d.ts +0 -41
  150. package/dist/langs.js +0 -76
  151. package/dist/layout/config-layout.d.ts +0 -10
  152. package/dist/layout/config-layout.js +0 -75
  153. package/dist/layout/index.d.ts +0 -11
  154. package/dist/layout/index.js +0 -10
  155. package/dist/layout/layout-contents.d.ts +0 -21
  156. package/dist/layout/layout-contents.js +0 -70
  157. package/dist/layout/settings-box.d.ts +0 -19
  158. package/dist/layout/settings-box.js +0 -31
  159. package/dist/mui-box/index.d.ts +0 -21
  160. package/dist/mui-box/index.js +0 -47
  161. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/extends.js +0 -12
  162. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -7
  163. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -12
  164. package/dist/node_modules/.bun/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -8
  165. package/dist/node_modules/.bun/react-measure@2.5.2_6dbf9a050bc9aadb/node_modules/react-measure/dist/index.esm.js +0 -122
  166. package/dist/node_modules/.bun/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +0 -276
  167. package/dist/number-text-field-custom.d.ts +0 -51
  168. package/dist/number-text-field-custom.js +0 -192
  169. package/dist/number-text-field.d.ts +0 -47
  170. package/dist/number-text-field.js +0 -122
  171. package/dist/radio-with-label.d.ts +0 -25
  172. package/dist/radio-with-label.js +0 -27
  173. package/dist/settings/display-size.d.ts +0 -26
  174. package/dist/settings/display-size.js +0 -45
  175. package/dist/settings/index.d.ts +0 -45
  176. package/dist/settings/index.js +0 -63
  177. package/dist/settings/panel.d.ts +0 -27
  178. package/dist/settings/panel.js +0 -201
  179. package/dist/settings/settings-radio-label.d.ts +0 -25
  180. package/dist/settings/settings-radio-label.js +0 -29
  181. package/dist/settings/toggle.d.ts +0 -25
  182. package/dist/settings/toggle.js +0 -33
  183. package/dist/tabs/index.d.ts +0 -22
  184. package/dist/tabs/index.js +0 -39
  185. package/dist/tags-input/index.d.ts +0 -21
  186. package/dist/tags-input/index.js +0 -83
  187. package/dist/two-choice.d.ts +0 -43
  188. package/dist/two-choice.js +0 -79
  189. package/dist/with-stateful-model.d.ts +0 -42
  190. package/dist/with-stateful-model.js +0 -32
@@ -1,201 +0,0 @@
1
- import e from "../checkbox.js";
2
- import t from "../number-text-field.js";
3
- import { NChoice as n } from "../two-choice.js";
4
- import r from "./toggle.js";
5
- import i from "./settings-radio-label.js";
6
- import a from "react";
7
- import o from "prop-types";
8
- import { styled as s } from "@mui/material/styles";
9
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
10
- import { get as u, set as d } from "@pie-element/shared-lodash";
11
- import f from "@mui/material/Typography";
12
- import p from "@mui/material/Input";
13
- import m from "@mui/material/Select";
14
- import h from "@mui/material/MenuItem";
15
- import g from "debug";
16
- //#region src/settings/panel.tsx
17
- var _ = g("pie-lib:config-ui:settings:panel"), v = {
18
- label: o.string,
19
- value: o.string
20
- }, y = {
21
- label: o.string,
22
- value: o.string,
23
- onChange: o.func
24
- }, b = ({ label: t, value: n, onChange: r }) => /* @__PURE__ */ c(e, {
25
- checked: n,
26
- label: t,
27
- onChange: (e) => {
28
- r(e.target.checked);
29
- }
30
- });
31
- b.propTypes = {
32
- label: o.string,
33
- value: o.bool,
34
- onChange: o.func
35
- };
36
- var x = s(n)(({ theme: e }) => ({
37
- marginTop: e.spacing(.5),
38
- paddingBottom: e.spacing(.5),
39
- width: "100%",
40
- "& > label": {
41
- color: "rgba(0, 0, 0, 0.89)",
42
- transform: "translate(0, 10px) scale(1)",
43
- fontSize: "18px",
44
- marginTop: e.spacing(2.5)
45
- },
46
- "& > div": { marginTop: e.spacing(2.5) }
47
- })), S = ({ label: e, value: t, onChange: n, choices: r }) => /* @__PURE__ */ c(x, {
48
- direction: "horizontal",
49
- customLabel: i,
50
- value: t,
51
- header: e,
52
- opts: r,
53
- onChange: n
54
- });
55
- S.propTypes = {
56
- ...y,
57
- choices: o.arrayOf(o.shape(v))
58
- };
59
- var C = S, w = s("p")(({ theme: e }) => ({
60
- margin: 0,
61
- fontSize: e.typography.fontSize
62
- })), T = s(m)(({ theme: e }) => ({
63
- marginTop: e.spacing(.5),
64
- border: "2px solid lightgrey",
65
- padding: `0 ${e.spacing(1)}`,
66
- borderRadius: "4px"
67
- })), E = ({ label: e, value: t, onChange: n, choices: r = [] }) => {
68
- let i = (e) => typeof e == "string" ? e : e.label, a = (e) => typeof e == "string" ? e : e.value;
69
- return /* @__PURE__ */ l("div", { children: [e && /* @__PURE__ */ c(w, { children: e }), /* @__PURE__ */ c(T, {
70
- value: t || r && r[0],
71
- onChange: ({ target: e }) => n(e.value),
72
- input: /* @__PURE__ */ c(p, { id: `dropdown-${e}` }),
73
- disableUnderline: !0,
74
- MenuProps: { transitionDuration: {
75
- enter: 225,
76
- exit: 195
77
- } },
78
- children: r.map((e, t) => /* @__PURE__ */ c(h, {
79
- value: a(e),
80
- children: i(e)
81
- }, t))
82
- })] });
83
- };
84
- E.propTypes = {
85
- ...y,
86
- choices: o.arrayOf(o.string)
87
- };
88
- var D = s(f)(({ theme: e }) => ({
89
- marginRight: e.spacing(3),
90
- marginTop: e.spacing(1)
91
- })), O = ({ label: e }) => /* @__PURE__ */ c(D, { children: e }), k = s(t)(({ theme: e }) => ({
92
- width: "35%",
93
- marginRight: e.spacing(3),
94
- marginTop: e.spacing(1),
95
- "& .MuiInputBase-root": {
96
- marginTop: e.spacing(.5),
97
- border: "2px solid lightgrey",
98
- borderRadius: "4px",
99
- padding: `0 ${e.spacing(1)}`,
100
- backgroundColor: "transparent"
101
- }
102
- })), A = ({ label: e, value: t, onChange: n = () => {}, suffix: r, min: i, max: a }) => /* @__PURE__ */ c(k, {
103
- variant: "standard",
104
- label: e || "Label",
105
- value: t,
106
- max: a,
107
- min: i,
108
- onChange: (e, t) => n(t),
109
- suffix: r,
110
- showErrorWhenOutsideRange: !0,
111
- disableUnderline: !0
112
- });
113
- A.propTypes = {
114
- ...y,
115
- suffix: o.string,
116
- min: o.number,
117
- max: o.number,
118
- value: o.number
119
- }, O.propTypes = { ...y };
120
- var j = ({ disabled: e, label: t, value: n, onChange: i }) => /* @__PURE__ */ c(r, {
121
- label: t,
122
- checked: !!n,
123
- disabled: !!e,
124
- toggle: i
125
- });
126
- j.propTypes = {
127
- ...y,
128
- value: o.bool
129
- };
130
- var M = {
131
- toggle: j,
132
- radio: C,
133
- dropdown: E,
134
- numberField: A,
135
- checkbox: b,
136
- textField: O
137
- }, N = s("div")(({ theme: e }) => ({ margin: `0 0 ${e.spacing(2)} 0` })), P = s("div")(({ theme: e }) => ({
138
- color: "#495B8F",
139
- fontSize: e.typography.fontSize + 2,
140
- fontWeight: 600,
141
- marginBottom: e.spacing(1)
142
- })), F = s("p")(({ theme: e }) => ({
143
- fontSize: e.typography.fontSize,
144
- marginBottom: 0
145
- })), I = (e) => {
146
- let { model: t, label: n, group: r, configuration: i, onChange: a } = e, o = (e, n, r) => {
147
- let { isConfigProperty: o, ...s } = u(e, r || n), l = u(o ? i : t, n), d = {
148
- ...s,
149
- key: n,
150
- value: l
151
- }, f = M[d.type];
152
- return /* @__PURE__ */ c(f, {
153
- ...d,
154
- onChange: (e) => a(n, e, o)
155
- }, n);
156
- }, s = (e, t) => {
157
- let n = e[t];
158
- if (!n) return null;
159
- let { type: r, label: i, fields: a, choices: s } = n;
160
- return r === "numberFields" ? /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c(F, { children: i }), Object.keys(a).map((n) => o(e, `${t}.${n}`, `${t}.fields.${n}`))] }, `numberField-${i}`) : r === "checkboxes" ? /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("p", { children: i }), Object.keys(s).map((n) => o(e, `${t}.${n}`, `${t}.choices.${n}`))] }, `checkbox-${i}`) : o(e, t);
161
- };
162
- return /* @__PURE__ */ l(N, { children: [/* @__PURE__ */ c(P, { children: n }), Object.keys(r).map((e) => s(r, e))] });
163
- };
164
- I.propTypes = {
165
- model: o.object,
166
- label: o.string,
167
- group: o.object,
168
- configuration: o.object,
169
- onChange: o.func
170
- };
171
- var L = class extends a.Component {
172
- static propTypes = {
173
- model: o.object,
174
- configuration: o.object,
175
- groups: o.object,
176
- onChangeModel: o.func,
177
- onChangeConfiguration: o.func,
178
- modal: o.object
179
- };
180
- static defaultProps = {
181
- onChangeModel: () => {},
182
- onChangeConfiguration: () => {}
183
- };
184
- change = (e, t, n = !1) => {
185
- _("[changeModel]", e, t);
186
- let { onChangeModel: r, onChangeConfiguration: i } = this.props, a = { ...this.props.model }, o = { ...this.props.configuration };
187
- n ? (d(o, e, t), i(o, e)) : (d(a, e, t), r(a, e));
188
- };
189
- render() {
190
- let { groups: e, model: t, configuration: n, modal: r } = this.props;
191
- return _("render:", t), /* @__PURE__ */ l("div", { children: [Object.keys(e || {}).map((r) => Object.entries(e[r]).some(([, e]) => !!e) ? /* @__PURE__ */ c(I, {
192
- label: r,
193
- model: t,
194
- configuration: n,
195
- group: e[r],
196
- onChange: this.change
197
- }, r) : null), r] });
198
- }
199
- };
200
- //#endregion
201
- export { L as default };
@@ -1,25 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/config-ui/src/settings/settings-radio-label.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 SettingsRadioLabel: {
12
- ({ label, value, checked, onChange }: {
13
- label: any;
14
- value: any;
15
- checked: any;
16
- onChange: any;
17
- }): React.JSX.Element;
18
- propTypes: {
19
- label: PropTypes.Requireable<string>;
20
- value: PropTypes.Requireable<string>;
21
- checked: PropTypes.Requireable<boolean>;
22
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
23
- };
24
- };
25
- export default SettingsRadioLabel;
@@ -1,29 +0,0 @@
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/Radio";
8
- //#region src/settings/settings-radio-label.tsx
9
- var o = t(i)(({ theme: e }) => ({ "& .MuiFormControlLabel-label": {
10
- color: "rgba(0, 0, 0, 0.89)",
11
- fontSize: e.typography.fontSize - 2,
12
- left: "-5px",
13
- position: "relative"
14
- } })), s = t(a)(() => ({ color: `${r.tertiary()} !important` })), c = ({ label: e, value: t, checked: r, onChange: i }) => /* @__PURE__ */ n(o, {
15
- value: t,
16
- control: /* @__PURE__ */ n(s, {
17
- checked: r,
18
- onChange: i
19
- }),
20
- label: e
21
- });
22
- c.propTypes = {
23
- label: e.string,
24
- value: e.string,
25
- checked: e.bool,
26
- onChange: e.func
27
- };
28
- //#endregion
29
- export { c as default };
@@ -1,25 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/config-ui/src/settings/toggle.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 Toggle: {
12
- ({ checked, disabled, label, toggle }: {
13
- checked: any;
14
- disabled: any;
15
- label: any;
16
- toggle: any;
17
- }): React.JSX.Element;
18
- propTypes: {
19
- checked: PropTypes.Requireable<boolean>;
20
- disabled: PropTypes.Requireable<boolean>;
21
- label: PropTypes.Validator<string>;
22
- toggle: PropTypes.Validator<(...args: any[]) => any>;
23
- };
24
- };
25
- export default Toggle;
@@ -1,33 +0,0 @@
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 };
@@ -1,22 +0,0 @@
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;
@@ -1,39 +0,0 @@
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 };
@@ -1,21 +0,0 @@
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;
@@ -1,83 +0,0 @@
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 };
@@ -1,43 +0,0 @@
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;
@@ -1,79 +0,0 @@
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 };
@@ -1,42 +0,0 @@
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;
@@ -1,32 +0,0 @@
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 };