treege 3.0.0-beta.80 → 3.0.0-beta.81
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/README.md +26 -0
- package/dist/{DefaultSubmitButton-Bk5U_6Qm.js → DefaultSubmitButton-Dg9GPvh-.js} +686 -652
- package/dist/{ThemeContext-DeWmeqHK.js → ThemeContext-BgTIhoK6.js} +18 -11
- package/dist/editor/features/TreegeEditor/inputs/DefaultFileValueField.d.ts +14 -0
- package/dist/{editor-Dw_ODEe1.js → editor-h20-TVM8.js} +1282 -1214
- package/dist/editor.js +2 -2
- package/dist/main.js +6 -6
- package/dist/renderer/utils/file.d.ts +11 -10
- package/dist/{renderer-CN83AtIp.js → renderer-DI6nF4St.js} +18 -18
- package/dist/renderer-native.js +1020 -1019
- package/dist/renderer.js +5 -5
- package/dist/shared/locales/ar.json.d.ts +1 -0
- package/dist/shared/locales/de.json.d.ts +1 -0
- package/dist/shared/locales/en.json.d.ts +1 -0
- package/dist/shared/locales/es.json.d.ts +1 -0
- package/dist/shared/locales/fr.json.d.ts +1 -0
- package/dist/shared/locales/it.json.d.ts +1 -0
- package/dist/shared/locales/pt.json.d.ts +1 -0
- package/dist/shared/types/file.d.ts +14 -0
- package/dist/shared/types/node.d.ts +2 -1
- package/dist/useRenderNode-B1sfwbia.js +527 -0
- package/package.json +1 -1
- package/dist/useRenderNode-BZ7fZJxT.js +0 -527
package/dist/editor.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "./editor-
|
|
2
|
-
import { n as t, t as n } from "./ThemeContext-
|
|
1
|
+
import { t as e } from "./editor-h20-TVM8.js";
|
|
2
|
+
import { n as t, t as n } from "./ThemeContext-BgTIhoK6.js";
|
|
3
3
|
export { n as ThemeProvider, e as TreegeEditor, t as useTheme };
|
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./editor-
|
|
2
|
-
import {
|
|
3
|
-
import { C as
|
|
4
|
-
import { a as
|
|
5
|
-
import { i as
|
|
6
|
-
export {
|
|
1
|
+
import { t as e } from "./editor-h20-TVM8.js";
|
|
2
|
+
import { F as t, G as n, H as r, P as i, U as a, V as o, W as s, _ as c, a as l, c as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, r as v, s as y, t as b, v as x } from "./ThemeContext-BgTIhoK6.js";
|
|
3
|
+
import { C as S, L as C, S as w, _ as T, a as E, b as D, c as O, d as k, g as A, h as j, i as M, m as N, n as P, o as F, r as I, u as L, v as R, x as z, y as B } from "./DefaultSubmitButton-Dg9GPvh-.js";
|
|
4
|
+
import { a as V, c as H, i as U, l as W, n as G, o as K, r as q, s as J } from "./useRenderNode-B1sfwbia.js";
|
|
5
|
+
import { i as Y, n as X, r as Z, t as Q } from "./renderer-DI6nF4St.js";
|
|
6
|
+
export { S as DefaultAddressInput, w as DefaultAutocompleteInput, z as DefaultCheckboxInput, D as DefaultDateInput, B as DefaultDateRangeInput, R as DefaultFileInput, T as DefaultHiddenInput, A as DefaultHttpInput, C as DefaultInputLabel, j as DefaultNumberInput, N as DefaultPasswordInput, k as DefaultRadioInput, L as DefaultSelectInput, O as DefaultSwitchInput, F as DefaultTextAreaInput, E as DefaultTextInput, M as DefaultTimeInput, I as DefaultTimeRangeInput, X as Divider, b as ThemeProvider, Z as Title, e as TreegeEditor, Q as TreegeRenderer, H as TreegeRendererProvider, v as applyReferenceTransformation, p as buildInitialFormValues, l as calculateReferenceFieldUpdates, _ as checkFormFieldHasValue, y as convertFormValuesToNamedFormat, P as defaultInputRenderers, Y as defaultUI, K as evaluateCondition, J as evaluateConditions, h as fileToSerializable, f as filesToSerializable, q as findStartNode, d as formatFileSize, U as getFlowRenderState, o as getStaticTranslations, r as getTranslatedText, u as isFieldEmpty, a as isGroupNode, s as isInputNode, V as isStartNode, n as isUINode, c as normalizeSerializableFiles, m as resolveNodeDefaultValue, i as sanitize, t as sanitizeHttpResponse, x as serializableToFile, g as useTheme, G as useTreegeRenderer, W as useTreegeRendererConfig };
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
export interface SerializableFile {
|
|
5
|
-
name: string;
|
|
6
|
-
size: number;
|
|
7
|
-
type: string;
|
|
8
|
-
lastModified: number;
|
|
9
|
-
data: string;
|
|
10
|
-
}
|
|
1
|
+
import { SerializableFile } from '../../shared/types/file';
|
|
2
|
+
export type { SerializableFile };
|
|
11
3
|
/**
|
|
12
4
|
* Converts a File object to a serializable format with base64 data
|
|
13
5
|
*/
|
|
@@ -20,3 +12,12 @@ export declare const serializableToFile: (serializable: SerializableFile) => Fil
|
|
|
20
12
|
* Converts multiple File objects to serializable format
|
|
21
13
|
*/
|
|
22
14
|
export declare const filesToSerializable: (files: File[]) => Promise<SerializableFile[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Normalizes a file field value into an array of `SerializableFile`.
|
|
17
|
+
* Handles single file, array of files, and empty (`null`/`undefined`) values.
|
|
18
|
+
*/
|
|
19
|
+
export declare const normalizeSerializableFiles: (value: SerializableFile | SerializableFile[] | null | undefined) => SerializableFile[];
|
|
20
|
+
/**
|
|
21
|
+
* Formats a byte size into a human-readable string (B / KB / MB)
|
|
22
|
+
*/
|
|
23
|
+
export declare const formatFileSize: (size: number) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as a, H as o, L as s, R as c, V as l, ct as u, et as d, n as f, t as p, z as m } from "./DefaultSubmitButton-
|
|
3
|
-
import { a as h, l as g, n as _, t as v } from "./useRenderNode-
|
|
1
|
+
import { I as e, L as t, N as n, W as r, t as i } from "./ThemeContext-BgTIhoK6.js";
|
|
2
|
+
import { B as a, H as o, L as s, R as c, V as l, ct as u, et as d, n as f, t as p, z as m } from "./DefaultSubmitButton-Dg9GPvh-.js";
|
|
3
|
+
import { a as h, l as g, n as _, t as v } from "./useRenderNode-B1sfwbia.js";
|
|
4
4
|
import { useCallback as y, useMemo as b, useState as x } from "react";
|
|
5
5
|
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
6
6
|
//#region src/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.tsx
|
|
@@ -10,8 +10,8 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
|
|
|
10
10
|
className: "tg:mx-auto tg:max-w-2xl tg:gap-y-3",
|
|
11
11
|
children: e
|
|
12
12
|
}), T = ({ children: e, missingFields: t = [] }) => {
|
|
13
|
-
let
|
|
14
|
-
return
|
|
13
|
+
let r = t.length > 0, i = n();
|
|
14
|
+
return r ? /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(m, { children: [/* @__PURE__ */ C(o, {
|
|
15
15
|
asChild: !0,
|
|
16
16
|
children: /* @__PURE__ */ C("span", {
|
|
17
17
|
className: "tg:inline-flex",
|
|
@@ -27,8 +27,8 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
|
|
|
27
27
|
children: t.map((e, t) => /* @__PURE__ */ C("li", { children: e }, t))
|
|
28
28
|
})]
|
|
29
29
|
}) })] }) }) : e;
|
|
30
|
-
}, te = ({ step: e, label:
|
|
31
|
-
let f =
|
|
30
|
+
}, te = ({ step: e, label: t, children: i, canGoBack: a, isLastStep: o, canContinue: s, isSubmitting: c, onBack: l, onContinue: u, missingFields: d }) => {
|
|
31
|
+
let f = n(), m = g(), h = m?.components?.submitButton || p, _ = m?.components?.submitButtonWrapper || T, v = !s || c, y = e.nodes.find((e) => r(e) && e.data.type === "submit"), b = y && r(y) ? f(y.data.label) : void 0, x = /* @__PURE__ */ C(h, {
|
|
32
32
|
type: "button",
|
|
33
33
|
onClick: u,
|
|
34
34
|
disabled: v,
|
|
@@ -38,9 +38,9 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
|
|
|
38
38
|
return /* @__PURE__ */ w("section", {
|
|
39
39
|
className: "tg:rounded-lg tg:border tg:p-4",
|
|
40
40
|
children: [
|
|
41
|
-
|
|
41
|
+
t && /* @__PURE__ */ C("h3", {
|
|
42
42
|
className: "tg:mb-4 tg:font-semibold tg:text-lg",
|
|
43
|
-
children:
|
|
43
|
+
children: t
|
|
44
44
|
}),
|
|
45
45
|
i,
|
|
46
46
|
/* @__PURE__ */ w("div", {
|
|
@@ -59,7 +59,7 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
|
|
|
59
59
|
]
|
|
60
60
|
});
|
|
61
61
|
}, E = ({ node: e }) => {
|
|
62
|
-
let t =
|
|
62
|
+
let t = n()(e.data?.label);
|
|
63
63
|
return t ? /* @__PURE__ */ w("div", {
|
|
64
64
|
className: "tg:flex tg:items-center tg:gap-x-3",
|
|
65
65
|
children: [
|
|
@@ -71,11 +71,11 @@ var ee = ({ children: e, id: t, onSubmit: n }) => /* @__PURE__ */ C("form", {
|
|
|
71
71
|
/* @__PURE__ */ C(c, { className: "tg:my-8 tg:flex-1" })
|
|
72
72
|
]
|
|
73
73
|
}) : /* @__PURE__ */ C(c, { className: "tg:my-8" });
|
|
74
|
-
}, D = ({ node:
|
|
75
|
-
let { edges:
|
|
74
|
+
}, D = ({ node: e }) => {
|
|
75
|
+
let { edges: r } = t(), i = n();
|
|
76
76
|
return /* @__PURE__ */ C("h2", {
|
|
77
|
-
className: u("tg:mb-5 tg:font-bold tg:text-2xl", !h(
|
|
78
|
-
children: i(
|
|
77
|
+
className: u("tg:mb-5 tg:font-bold tg:text-2xl", !h(e.id, r) && "tg:mt-10"),
|
|
78
|
+
children: i(e.data?.label)
|
|
79
79
|
});
|
|
80
80
|
}, O = {
|
|
81
81
|
divider: E,
|
|
@@ -125,10 +125,10 @@ var re = () => /* @__PURE__ */ w("section", {
|
|
|
125
125
|
href: "treege-renderer",
|
|
126
126
|
precedence: "default",
|
|
127
127
|
children: A
|
|
128
|
-
}), j = ({ baseUrl:
|
|
128
|
+
}), j = ({ baseUrl: t, components: n, className: r, flow: a, formId: o, googleApiKey: c, headers: l, language: m, onBack: h, onChange: g, onSubmit: S, showPoweredBy: E, theme: D, validate: k, validationMode: A, initialValues: j = {}, isLoading: M = !1, isSubmitting: N = !1 }) => {
|
|
129
129
|
let { canContinueStep: P, canSubmit: ae, clearSubmitMessage: oe, config: F, currentStep: I, currentStepGroupNode: L, currentStepIndex: se, firstErrorFieldId: R, formErrors: z, formValues: B, goToNextStep: V, goToPreviousStep: H, handleSubmit: U, hasSubmitInput: W, inputNodes: G, isFirstStep: K, isLastStep: q, isSubmitting: ce, missingRequiredFields: J, setFieldValue: Y, steps: le, submitMessage: X, t: Z } = _({
|
|
130
|
-
baseUrl:
|
|
131
|
-
components:
|
|
130
|
+
baseUrl: t,
|
|
131
|
+
components: n,
|
|
132
132
|
flow: a,
|
|
133
133
|
googleApiKey: c,
|
|
134
134
|
headers: l,
|
|
@@ -196,7 +196,7 @@ var re = () => /* @__PURE__ */ w("section", {
|
|
|
196
196
|
children: [/* @__PURE__ */ C(ie, {}), /* @__PURE__ */ C(i, {
|
|
197
197
|
theme: F.theme,
|
|
198
198
|
storageKey: "treege-renderer-theme",
|
|
199
|
-
children: M ? /* @__PURE__ */ C(me, {}) : /* @__PURE__ */ w(
|
|
199
|
+
children: M ? /* @__PURE__ */ C(me, {}) : /* @__PURE__ */ w(e, {
|
|
200
200
|
value: {
|
|
201
201
|
baseUrl: F.baseUrl,
|
|
202
202
|
flow: a,
|