treege 3.0.0-beta.56 → 3.0.0-beta.58
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 +33 -10
- package/dist/DefaultInputs-Dr3R5r53.js +1881 -0
- package/dist/ThemeContext-DrI5HTYl.js +1402 -0
- package/dist/editor/context/TreegeEditorContext.d.ts +8 -1
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +13 -0
- package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +0 -10
- package/dist/editor/types/editor.d.ts +35 -4
- package/dist/editor/utils/cleanNodeConfig.d.ts +5 -0
- package/dist/editor/utils/sensitiveHeaders.d.ts +15 -0
- package/dist/editor-BhL3w_KP.js +6251 -0
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- package/dist/renderer/context/TreegeRendererContext.d.ts +12 -0
- package/dist/renderer/features/TreegeRenderer/InputRendererHost.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/DependencyHint.d.ts +15 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +20 -19
- package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/DependencyHint.d.ts +22 -0
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +2 -2
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +2 -2
- package/dist/renderer/hooks/useRenderNode.d.ts +2 -1
- package/dist/renderer/hooks/useSubmitHandler.d.ts +2 -1
- package/dist/renderer/types/renderer.d.ts +77 -23
- package/dist/renderer/utils/http.d.ts +11 -0
- package/dist/renderer/utils/node.d.ts +11 -0
- package/dist/renderer/utils/submit.d.ts +2 -1
- package/dist/renderer/utils/templateDependencies.d.ts +17 -0
- package/dist/renderer-native.js +1333 -1280
- package/dist/renderer.js +3 -3
- package/dist/shared/constants/inputType.d.ts +5 -0
- package/dist/shared/locales/ar.json.d.ts +15 -2
- package/dist/shared/locales/de.json.d.ts +15 -2
- package/dist/shared/locales/en.json.d.ts +15 -2
- package/dist/shared/locales/es.json.d.ts +15 -2
- package/dist/shared/locales/fr.json.d.ts +15 -2
- package/dist/shared/locales/it.json.d.ts +15 -2
- package/dist/shared/locales/pt.json.d.ts +15 -2
- package/package.json +1 -1
- package/dist/DefaultInputs-DklwwMaZ.js +0 -1807
- package/dist/ThemeContext-DAMkr9gW.js +0 -1362
- package/dist/editor-uMYOjG2i.js +0 -6079
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-BhL3w_KP.js";
|
|
2
|
+
import { n as t, t as n } from "./ThemeContext-DrI5HTYl.js";
|
|
3
3
|
export { n as ThemeProvider, e as TreegeEditor, t as useTheme };
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./editor-
|
|
2
|
-
import { A as t, B as n,
|
|
3
|
-
import { C as E, E as D, S as O, T as k, _ as A, a as j, b as M, d as N, f as P, i as F, l as I, m as L, n as R, p as z, r as B, s as V, t as H, u as U, v as W, w as G, x as K, y as q } from "./DefaultInputs-
|
|
4
|
-
export { D as DefaultAddressInput, k as DefaultAutocompleteInput, G as DefaultCheckboxInput, E as DefaultDateInput, O as DefaultDateRangeInput, K as DefaultFileInput, M as DefaultHiddenInput, q as DefaultHttpInput, W as DefaultNumberInput, A as DefaultPasswordInput, L as DefaultRadioInput, z as DefaultSelectInput, V as DefaultSwitchInput, j as DefaultTextAreaInput, F as DefaultTextInput, B as DefaultTimeInput, R as DefaultTimeRangeInput, U as Divider,
|
|
1
|
+
import { t as e } from "./editor-BhL3w_KP.js";
|
|
2
|
+
import { A as t, B as n, H as r, R as i, V as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, j as m, l as h, m as g, n as _, o as v, p as y, s as b, t as x, u as S, x as C, y as w, z as T } from "./ThemeContext-DrI5HTYl.js";
|
|
3
|
+
import { C as E, E as D, S as O, T as k, _ as A, a as j, b as M, d as N, f as P, i as F, l as I, m as L, n as R, p as z, r as B, s as V, t as H, u as U, v as W, w as G, x as K, y as q } from "./DefaultInputs-Dr3R5r53.js";
|
|
4
|
+
export { D as DefaultAddressInput, k as DefaultAutocompleteInput, G as DefaultCheckboxInput, E as DefaultDateInput, O as DefaultDateRangeInput, K as DefaultFileInput, M as DefaultHiddenInput, q as DefaultHttpInput, W as DefaultNumberInput, A as DefaultPasswordInput, L as DefaultRadioInput, z as DefaultSelectInput, V as DefaultSwitchInput, j as DefaultTextAreaInput, F as DefaultTextInput, B as DefaultTimeInput, R as DefaultTimeRangeInput, U as Divider, x as ThemeProvider, N as Title, S as TreegeConfigProvider, e as TreegeEditor, I as TreegeRenderer, u as applyReferenceTransformation, y as calculateReferenceFieldUpdates, g as checkFormFieldHasValue, f as convertFormValuesToNamedFormat, H as defaultInputRenderers, P as defaultUI, c as evaluateCondition, h as evaluateConditions, w as fileToSerializable, s as filesToSerializable, o as findStartNode, v as getFlowRenderState, i as getStaticTranslations, T as getTranslatedText, d as isFieldEmpty, n as isGroupNode, a as isInputNode, b as isStartNode, r as isUINode, t as sanitize, m as sanitizeHttpResponse, C as serializableToFile, _ as useTheme, l as useTreegeConfig, p as useTreegeRenderer };
|
|
@@ -3,6 +3,12 @@ import { PropsWithChildren } from 'react';
|
|
|
3
3
|
import { FormValues } from '../types/renderer';
|
|
4
4
|
import { Flow, HttpHeader, InputNodeData } from '../../shared/types/node';
|
|
5
5
|
export interface TreegeRendererContextValue {
|
|
6
|
+
/**
|
|
7
|
+
* Base URL prepended to every relative HTTP url issued by inputs. Absolute
|
|
8
|
+
* urls are left untouched. Resolved from the renderer config and applied
|
|
9
|
+
* after template-variable substitution.
|
|
10
|
+
*/
|
|
11
|
+
baseUrl?: string;
|
|
6
12
|
/**
|
|
7
13
|
* The flow currently being rendered. `null` when the renderer has no flow
|
|
8
14
|
* to display yet.
|
|
@@ -68,6 +74,12 @@ export declare const TreegeRendererContext: import('react').Context<TreegeRender
|
|
|
68
74
|
export declare const TreegeRendererProvider: ({ children, value }: TreegeRendererProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
75
|
export declare const useTreegeRendererContext: () => {
|
|
70
76
|
edges: import('@xyflow/react').Edge[];
|
|
77
|
+
/**
|
|
78
|
+
* Base URL prepended to every relative HTTP url issued by inputs. Absolute
|
|
79
|
+
* urls are left untouched. Resolved from the renderer config and applied
|
|
80
|
+
* after template-variable substitution.
|
|
81
|
+
*/
|
|
82
|
+
baseUrl?: string;
|
|
71
83
|
/**
|
|
72
84
|
* The flow currently being rendered. `null` when the renderer has no flow
|
|
73
85
|
* to display yet.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputExtraProps, InputFieldProps, InputRenderer } from '../../types/renderer';
|
|
2
|
+
import { InputType } from '../../../shared/types/node';
|
|
3
|
+
interface InputRendererHostProps<T extends InputType> {
|
|
4
|
+
render: InputRenderer<T>;
|
|
5
|
+
field: InputFieldProps<T>;
|
|
6
|
+
extra: InputExtraProps<T>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders an input renderer (`(field, extra) => ReactNode`) inside a real
|
|
10
|
+
* component boundary so the renderer can safely call hooks. Callers must give
|
|
11
|
+
* this a stable `key` per node (and input type) so each input keeps a
|
|
12
|
+
* consistent hook order across re-renders.
|
|
13
|
+
*/
|
|
14
|
+
declare function InputRendererHost<T extends InputType>({ render, field, extra }: InputRendererHostProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default InputRendererHost;
|
|
@@ -15,7 +15,7 @@ import { default as DefaultTextareaInput } from './inputs/DefaultTextareaInput';
|
|
|
15
15
|
import { default as DefaultTextInput } from './inputs/DefaultTextInput';
|
|
16
16
|
import { default as DefaultTimeInput } from './inputs/DefaultTimeInput';
|
|
17
17
|
import { default as DefaultTimeRangeInput } from './inputs/DefaultTimeRangeInput';
|
|
18
|
-
import {
|
|
18
|
+
import { InputExtraProps, InputFieldProps, InputRenderers } from '../../../../types/renderer';
|
|
19
19
|
export { DefaultAddressInput, DefaultAutocompleteInput, DefaultCheckboxInput, DefaultDateInput, DefaultDateRangeInput, DefaultFileInput, DefaultHiddenInput, DefaultHttpInput, DefaultNumberInput, DefaultPasswordInput, DefaultRadioInput, DefaultSelectInput, DefaultSwitchInput, DefaultTextareaInput, DefaultTextInput, DefaultTimeInput, DefaultTimeRangeInput, };
|
|
20
|
-
export declare const DefaultSubmitInput: (
|
|
20
|
+
export declare const DefaultSubmitInput: (_field: InputFieldProps<"submit">, extra: InputExtraProps<"submit">) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export declare const defaultInputRenderers: InputRenderers;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MissingDependency } from '../../../../types/renderer';
|
|
3
|
+
interface DependencyHintProps {
|
|
4
|
+
/** Unfilled fields the input depends on (from `extra.missingDependencies`). */
|
|
5
|
+
missing: MissingDependency[];
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders an input control followed by an inline caption listing the fields the
|
|
10
|
+
* user must fill before the input's dynamic options can load. Mobile has no
|
|
11
|
+
* hover, so the hint is always-visible text rather than a tooltip. Renders only
|
|
12
|
+
* the children when there are no missing dependencies.
|
|
13
|
+
*/
|
|
14
|
+
declare const DependencyHint: ({ missing, children }: DependencyHintProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default DependencyHint;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultAddressInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultAddressInput: (field: InputFieldProps<"address">, extra: InputExtraProps<"address">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultAddressInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultAutocompleteInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultAutocompleteInput: (field: InputFieldProps<"autocomplete">, extra: InputExtraProps<"autocomplete">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultAutocompleteInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultCheckboxInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultCheckboxInput: (field: InputFieldProps<"checkbox">, extra: InputExtraProps<"checkbox">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultCheckboxInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultDateInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultDateInput: (field: InputFieldProps<"date">, extra: InputExtraProps<"date">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultDateInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultDateRangeInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultDateRangeInput: (field: InputFieldProps<"daterange">, extra: InputExtraProps<"daterange">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultDateRangeInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultFileInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultFileInput: (field: InputFieldProps<"file">, extra: InputExtraProps<"file">) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default DefaultFileInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultHiddenInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultHiddenInput: (_field: InputFieldProps<"hidden">, _extra: InputExtraProps<"hidden">) => null;
|
|
3
3
|
export default DefaultHiddenInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultHttpInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultHttpInput: (field: InputFieldProps<"http">, extra: InputExtraProps<"http">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultHttpInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultNumberInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultNumberInput: (field: InputFieldProps<"number">, extra: InputExtraProps<"number">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultNumberInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultPasswordInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultPasswordInput: (field: InputFieldProps<"password">, extra: InputExtraProps<"password">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultPasswordInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultRadioInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultRadioInput: (field: InputFieldProps<"radio">, extra: InputExtraProps<"radio">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultRadioInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultSelectInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultSelectInput: (field: InputFieldProps<"select">, extra: InputExtraProps<"select">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultSelectInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultSwitchInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultSwitchInput: (field: InputFieldProps<"switch">, extra: InputExtraProps<"switch">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultSwitchInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultTextInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTextInput: (field: InputFieldProps<"text">, extra: InputExtraProps<"text">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultTextInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultTextareaInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTextareaInput: (field: InputFieldProps<"textarea">, extra: InputExtraProps<"textarea">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultTextareaInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultTimeInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTimeInput: (field: InputFieldProps<"time">, extra: InputExtraProps<"time">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultTimeInput;
|
package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultTimeRangeInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTimeRangeInput: (field: InputFieldProps<"timerange">, extra: InputExtraProps<"timerange">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultTimeRangeInput;
|
|
@@ -19,35 +19,36 @@ import { GroupNodeData, TreegeNodeData } from '../../../shared/types/node';
|
|
|
19
19
|
* @param props - Configuration props (flows, initialValues, callbacks, etc.)
|
|
20
20
|
* @returns Complete form state and control methods
|
|
21
21
|
*/
|
|
22
|
-
export declare const useTreegeRenderer: ({ components, flows, googleApiKey, headers, initialValues, language, onChange, onSubmit, theme, validate, validationMode, }: Pick<TreegeRendererProps, "components" | "flows" | "googleApiKey" | "headers" | "initialValues" | "language" | "onChange" | "onSubmit" | "theme" | "validate" | "validationMode">) => {
|
|
22
|
+
export declare const useTreegeRenderer: ({ baseUrl, components, flows, googleApiKey, headers, initialValues, language, onChange, onSubmit, theme, validate, validationMode, }: Pick<TreegeRendererProps, "baseUrl" | "components" | "flows" | "googleApiKey" | "headers" | "initialValues" | "language" | "onChange" | "onSubmit" | "theme" | "validate" | "validationMode">) => {
|
|
23
23
|
canContinueStep: boolean;
|
|
24
24
|
canSubmit: boolean;
|
|
25
25
|
clearSubmitMessage: () => void;
|
|
26
26
|
config: {
|
|
27
|
+
baseUrl: string | undefined;
|
|
27
28
|
components: {
|
|
28
29
|
form: ((props: {
|
|
29
30
|
children: import('react').ReactNode;
|
|
30
31
|
onSubmit: (e: import('react').FormEvent<HTMLFormElement>) => void;
|
|
31
32
|
}) => import('react').ReactNode) | undefined;
|
|
32
33
|
inputs: {
|
|
33
|
-
number?:
|
|
34
|
-
checkbox?:
|
|
35
|
-
radio?:
|
|
36
|
-
switch?:
|
|
37
|
-
address?:
|
|
38
|
-
autocomplete?:
|
|
39
|
-
date?:
|
|
40
|
-
daterange?:
|
|
41
|
-
file?:
|
|
42
|
-
hidden?:
|
|
43
|
-
http?:
|
|
44
|
-
password?:
|
|
45
|
-
select?:
|
|
46
|
-
submit?:
|
|
47
|
-
text?:
|
|
48
|
-
textarea?:
|
|
49
|
-
time?:
|
|
50
|
-
timerange?:
|
|
34
|
+
number?: import('../../types/renderer').InputRenderer<"number"> | undefined;
|
|
35
|
+
checkbox?: import('../../types/renderer').InputRenderer<"checkbox"> | undefined;
|
|
36
|
+
radio?: import('../../types/renderer').InputRenderer<"radio"> | undefined;
|
|
37
|
+
switch?: import('../../types/renderer').InputRenderer<"switch"> | undefined;
|
|
38
|
+
address?: import('../../types/renderer').InputRenderer<"address"> | undefined;
|
|
39
|
+
autocomplete?: import('../../types/renderer').InputRenderer<"autocomplete"> | undefined;
|
|
40
|
+
date?: import('../../types/renderer').InputRenderer<"date"> | undefined;
|
|
41
|
+
daterange?: import('../../types/renderer').InputRenderer<"daterange"> | undefined;
|
|
42
|
+
file?: import('../../types/renderer').InputRenderer<"file"> | undefined;
|
|
43
|
+
hidden?: import('../../types/renderer').InputRenderer<"hidden"> | undefined;
|
|
44
|
+
http?: import('../../types/renderer').InputRenderer<"http"> | undefined;
|
|
45
|
+
password?: import('../../types/renderer').InputRenderer<"password"> | undefined;
|
|
46
|
+
select?: import('../../types/renderer').InputRenderer<"select"> | undefined;
|
|
47
|
+
submit?: import('../../types/renderer').InputRenderer<"submit"> | undefined;
|
|
48
|
+
text?: import('../../types/renderer').InputRenderer<"text"> | undefined;
|
|
49
|
+
textarea?: import('../../types/renderer').InputRenderer<"textarea"> | undefined;
|
|
50
|
+
time?: import('../../types/renderer').InputRenderer<"time"> | undefined;
|
|
51
|
+
timerange?: import('../../types/renderer').InputRenderer<"timerange"> | undefined;
|
|
51
52
|
};
|
|
52
53
|
loadingSkeleton: (() => import('react').ReactNode) | undefined;
|
|
53
54
|
step: ((props: import('../../types/renderer').StepRenderProps) => import('react').ReactNode) | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TreegeRendererProps } from '../../../types/renderer';
|
|
2
|
-
declare const TreegeRenderer: ({ components, className, flows, googleApiKey, headers, language, onChange, onSubmit, theme, validate, validationMode, initialValues, isLoading, }: TreegeRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const TreegeRenderer: ({ baseUrl, components, className, flows, googleApiKey, headers, language, onChange, onSubmit, theme, validate, validationMode, initialValues, isLoading, }: TreegeRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TreegeRenderer;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MissingDependency } from '../../../../types/renderer';
|
|
3
|
+
interface MissingProps {
|
|
4
|
+
/** Unfilled fields the input depends on (from `extra.missingDependencies`). */
|
|
5
|
+
missing: MissingDependency[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Wraps a disabled input control with a tooltip listing the fields the user
|
|
9
|
+
* must fill before the input's dynamic options can load. Renders children
|
|
10
|
+
* untouched when there are no missing dependencies, so it's safe to wrap any
|
|
11
|
+
* trigger-based dynamic input (select, autocomplete, http) unconditionally.
|
|
12
|
+
*/
|
|
13
|
+
declare const DependencyHint: ({ missing, children }: MissingProps & {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Inline variant for inputs that have no single trigger to hover (radio,
|
|
18
|
+
* checkbox): renders the same hint as always-visible muted text. Renders
|
|
19
|
+
* nothing when there are no missing dependencies.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DependencyHintMessage: ({ missing }: MissingProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
export default DependencyHint;
|
package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultAddressInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultAddressInput: (field: InputFieldProps<"address">, extra: InputExtraProps<"address">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultAddressInput;
|
package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultAutocompleteInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultAutocompleteInput: (field: InputFieldProps<"autocomplete">, extra: InputExtraProps<"autocomplete">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultAutocompleteInput;
|
package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultCheckboxInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultCheckboxInput: (field: InputFieldProps<"checkbox">, extra: InputExtraProps<"checkbox">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultCheckboxInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultDateInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultDateInput: (field: InputFieldProps<"date">, extra: InputExtraProps<"date">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultDateInput;
|
package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultDateRangeInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultDateRangeInput: (field: InputFieldProps<"daterange">, extra: InputExtraProps<"daterange">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultDateRangeInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultFileInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultFileInput: (field: InputFieldProps<"file">, extra: InputExtraProps<"file">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultFileInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultHiddenInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultHiddenInput: (field: InputFieldProps<"hidden">, _extra: InputExtraProps<"hidden">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultHiddenInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultHttpInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultHttpInput: (field: InputFieldProps<"http">, extra: InputExtraProps<"http">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultHttpInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultNumberInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultNumberInput: (field: InputFieldProps<"number">, extra: InputExtraProps<"number">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultNumberInput;
|
package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultPasswordInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultPasswordInput: (field: InputFieldProps<"password">, extra: InputExtraProps<"password">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultPasswordInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultRadioInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultRadioInput: (field: InputFieldProps<"radio">, extra: InputExtraProps<"radio">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultRadioInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultSelectInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultSelectInput: (field: InputFieldProps<"select">, extra: InputExtraProps<"select">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultSelectInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultSubmitInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultSubmitInput: (_field: InputFieldProps<"submit">, extra: InputExtraProps<"submit">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultSubmitInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultSwitchInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultSwitchInput: (field: InputFieldProps<"switch">, extra: InputExtraProps<"switch">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultSwitchInput;
|
package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultTextAreaInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTextAreaInput: (field: InputFieldProps<"textarea">, extra: InputExtraProps<"textarea">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultTextAreaInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultTextInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTextInput: (field: InputFieldProps<"text">, extra: InputExtraProps<"text">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultTextInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultTimeInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTimeInput: (field: InputFieldProps<"time">, extra: InputExtraProps<"time">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultTimeInput;
|
package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const DefaultTimeRangeInput: (
|
|
1
|
+
import { InputExtraProps, InputFieldProps } from '../../../../../types/renderer';
|
|
2
|
+
declare const DefaultTimeRangeInput: (field: InputFieldProps<"timerange">, extra: InputExtraProps<"timerange">) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultTimeRangeInput;
|
|
@@ -19,6 +19,7 @@ type UseRenderNodeParams = {
|
|
|
19
19
|
defaultUI: Record<string, AnyComponent>;
|
|
20
20
|
formErrors: Record<string, string>;
|
|
21
21
|
formValues: FormValues;
|
|
22
|
+
inputNodes: Node<InputNodeData>[];
|
|
22
23
|
missingRequiredFields: string[];
|
|
23
24
|
setFieldValue: (fieldId: string, value: unknown) => void;
|
|
24
25
|
};
|
|
@@ -32,7 +33,7 @@ type UseRenderNodeParams = {
|
|
|
32
33
|
* - SubmitButton: Submit button component with fallback
|
|
33
34
|
* - SubmitButtonWrapper: Submit button wrapper component with fallback (web only, undefined for native)
|
|
34
35
|
*/
|
|
35
|
-
export declare const useRenderNode: ({ DefaultFormWrapper, DefaultInputWrapper, DefaultSubmitButton, DefaultSubmitButtonWrapper, config, defaultInputRenderers, defaultUI, formErrors, formValues, missingRequiredFields, setFieldValue, }: UseRenderNodeParams) => {
|
|
36
|
+
export declare const useRenderNode: ({ DefaultFormWrapper, DefaultInputWrapper, DefaultSubmitButton, DefaultSubmitButtonWrapper, config, defaultInputRenderers, defaultUI, formErrors, formValues, inputNodes, missingRequiredFields, setFieldValue, }: UseRenderNodeParams) => {
|
|
36
37
|
FormWrapper: ((props: {
|
|
37
38
|
children: ReactNode;
|
|
38
39
|
onSubmit: (e: import('react').FormEvent<HTMLFormElement>) => void;
|
|
@@ -17,9 +17,10 @@ import { HttpHeader, InputNodeData, TreegeNodeData } from '../../shared/types/no
|
|
|
17
17
|
* @param language - Current language for translations
|
|
18
18
|
* @param inputNodes - All input nodes for form data conversion
|
|
19
19
|
* @param headers
|
|
20
|
+
* @param baseUrl - Base URL prepended to a relative submit url
|
|
20
21
|
* @returns Submit handler state and functions
|
|
21
22
|
*/
|
|
22
|
-
export declare const useSubmitHandler: (visibleNodes: Node<TreegeNodeData>[], formValues: FormValues, language: string, inputNodes: Node<InputNodeData>[], headers?: HttpHeader[]) => {
|
|
23
|
+
export declare const useSubmitHandler: (visibleNodes: Node<TreegeNodeData>[], formValues: FormValues, language: string, inputNodes: Node<InputNodeData>[], headers?: HttpHeader[], baseUrl?: string) => {
|
|
23
24
|
clearSubmitMessage: () => void;
|
|
24
25
|
handleSubmitWithConfig: (onSuccess?: (data: unknown) => void) => Promise<SubmitResult | null>;
|
|
25
26
|
hasSubmitConfig: boolean;
|