treege 3.0.0-beta.56 → 3.0.0-beta.57
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-CoJrOYMe.js +1859 -0
- package/dist/ThemeContext-BhIeqgqN.js +1398 -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/types/editor.d.ts +19 -1
- package/dist/editor/utils/cleanNodeConfig.d.ts +5 -0
- package/dist/editor/utils/sensitiveHeaders.d.ts +15 -0
- package/dist/{editor-uMYOjG2i.js → editor-D3cbfAxI.js} +1951 -1798
- package/dist/editor.js +2 -2
- package/dist/main.js +4 -4
- 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 +18 -18
- 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/types/renderer.d.ts +62 -23
- package/dist/renderer/utils/node.d.ts +11 -0
- package/dist/renderer/utils/templateDependencies.d.ts +17 -0
- package/dist/renderer-native.js +1222 -1190
- package/dist/renderer.js +3 -3
- package/dist/shared/constants/inputType.d.ts +5 -0
- package/dist/shared/locales/ar.json.d.ts +12 -1
- package/dist/shared/locales/de.json.d.ts +12 -1
- package/dist/shared/locales/en.json.d.ts +12 -1
- package/dist/shared/locales/es.json.d.ts +12 -1
- package/dist/shared/locales/fr.json.d.ts +12 -1
- package/dist/shared/locales/it.json.d.ts +12 -1
- package/dist/shared/locales/pt.json.d.ts +12 -1
- package/package.json +1 -1
- package/dist/DefaultInputs-DklwwMaZ.js +0 -1807
- package/dist/ThemeContext-DAMkr9gW.js +0 -1362
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-D3cbfAxI.js";
|
|
2
|
+
import { n as t, t as n } from "./ThemeContext-BhIeqgqN.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, L as r, R as i,
|
|
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-D3cbfAxI.js";
|
|
2
|
+
import { A as t, B as n, L 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, k 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-BhIeqgqN.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-CoJrOYMe.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, r as getStaticTranslations, i as getTranslatedText, d as isFieldEmpty, T as isGroupNode, n as isInputNode, b as isStartNode, a as isUINode, m as sanitize, t as sanitizeHttpResponse, C as serializableToFile, _ as useTheme, l as useTreegeConfig, p as useTreegeRenderer };
|
|
@@ -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;
|
|
@@ -30,24 +30,24 @@ export declare const useTreegeRenderer: ({ components, flows, googleApiKey, head
|
|
|
30
30
|
onSubmit: (e: import('react').FormEvent<HTMLFormElement>) => void;
|
|
31
31
|
}) => import('react').ReactNode) | undefined;
|
|
32
32
|
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?:
|
|
33
|
+
number?: import('../../types/renderer').InputRenderer<"number"> | undefined;
|
|
34
|
+
checkbox?: import('../../types/renderer').InputRenderer<"checkbox"> | undefined;
|
|
35
|
+
radio?: import('../../types/renderer').InputRenderer<"radio"> | undefined;
|
|
36
|
+
switch?: import('../../types/renderer').InputRenderer<"switch"> | undefined;
|
|
37
|
+
address?: import('../../types/renderer').InputRenderer<"address"> | undefined;
|
|
38
|
+
autocomplete?: import('../../types/renderer').InputRenderer<"autocomplete"> | undefined;
|
|
39
|
+
date?: import('../../types/renderer').InputRenderer<"date"> | undefined;
|
|
40
|
+
daterange?: import('../../types/renderer').InputRenderer<"daterange"> | undefined;
|
|
41
|
+
file?: import('../../types/renderer').InputRenderer<"file"> | undefined;
|
|
42
|
+
hidden?: import('../../types/renderer').InputRenderer<"hidden"> | undefined;
|
|
43
|
+
http?: import('../../types/renderer').InputRenderer<"http"> | undefined;
|
|
44
|
+
password?: import('../../types/renderer').InputRenderer<"password"> | undefined;
|
|
45
|
+
select?: import('../../types/renderer').InputRenderer<"select"> | undefined;
|
|
46
|
+
submit?: import('../../types/renderer').InputRenderer<"submit"> | undefined;
|
|
47
|
+
text?: import('../../types/renderer').InputRenderer<"text"> | undefined;
|
|
48
|
+
textarea?: import('../../types/renderer').InputRenderer<"textarea"> | undefined;
|
|
49
|
+
time?: import('../../types/renderer').InputRenderer<"time"> | undefined;
|
|
50
|
+
timerange?: import('../../types/renderer').InputRenderer<"timerange"> | undefined;
|
|
51
51
|
};
|
|
52
52
|
loadingSkeleton: (() => import('react').ReactNode) | undefined;
|
|
53
53
|
step: ((props: import('../../types/renderer').StepRenderProps) => import('react').ReactNode) | undefined;
|
|
@@ -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;
|
|
@@ -38,54 +38,87 @@ export type Meta = {
|
|
|
38
38
|
*/
|
|
39
39
|
export type InputValue = string | number | boolean | string[] | SerializableFile | SerializableFile[] | [string, string] | [string | undefined, string | undefined] | null | undefined;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
* All form state is provided via props for easier custom component implementation
|
|
41
|
+
* A field the input's dynamic options depend on that is not yet filled.
|
|
43
42
|
*/
|
|
44
|
-
export type
|
|
43
|
+
export type MissingDependency = {
|
|
45
44
|
/**
|
|
46
|
-
* The node
|
|
45
|
+
* The referenced node id.
|
|
47
46
|
*/
|
|
48
|
-
|
|
47
|
+
id: string;
|
|
49
48
|
/**
|
|
50
|
-
*
|
|
49
|
+
* The referenced field's translated, end-user-facing label.
|
|
51
50
|
*/
|
|
52
|
-
|
|
51
|
+
label: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* HTML-spreadable props for an input control — safe to spread directly onto a
|
|
55
|
+
* DOM element: `<input {...field} />`. Intentionally excludes `label`,
|
|
56
|
+
* `helperText`, and `error` (not valid DOM attributes); those live in
|
|
57
|
+
* `InputExtraProps`.
|
|
58
|
+
*/
|
|
59
|
+
export type InputFieldProps<T extends InputType = InputType> = {
|
|
53
60
|
/**
|
|
54
|
-
* Unique field
|
|
61
|
+
* Unique field id (nodeId). Use for the element `id`.
|
|
55
62
|
*/
|
|
56
63
|
id: string;
|
|
57
64
|
/**
|
|
58
|
-
* Field name (resolved using priority: name > label > nodeId)
|
|
59
|
-
* Use this for the name and id attributes of the input element
|
|
65
|
+
* Field name (resolved using priority: name > label > nodeId).
|
|
60
66
|
*/
|
|
61
67
|
name: string;
|
|
62
68
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @param value - The new value (typed based on input type when T is specified)
|
|
69
|
+
* Current value of the input (typed by input type when T is specified).
|
|
65
70
|
*/
|
|
66
|
-
|
|
71
|
+
value: InputValueTypeMap[T];
|
|
67
72
|
/**
|
|
68
|
-
*
|
|
73
|
+
* Translated placeholder (already processed with current language).
|
|
69
74
|
*/
|
|
70
|
-
|
|
75
|
+
placeholder?: string;
|
|
71
76
|
/**
|
|
72
|
-
*
|
|
77
|
+
* Whether the field is required.
|
|
73
78
|
*/
|
|
74
|
-
|
|
79
|
+
required?: boolean;
|
|
75
80
|
/**
|
|
76
|
-
*
|
|
81
|
+
* Set when the field has a validation error.
|
|
77
82
|
*/
|
|
78
|
-
|
|
83
|
+
"aria-invalid"?: boolean;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Treege-specific props that are NOT DOM attributes: state setters, resolved
|
|
87
|
+
* translations, validation and runtime metadata. Passed as the second argument
|
|
88
|
+
* of an input renderer so the first one (`InputFieldProps`) stays spreadable.
|
|
89
|
+
*/
|
|
90
|
+
export type InputExtraProps<T extends InputType = InputType> = {
|
|
79
91
|
/**
|
|
80
|
-
*
|
|
92
|
+
* The node data for this input field.
|
|
93
|
+
*/
|
|
94
|
+
node: Node<InputNodeData>;
|
|
95
|
+
/**
|
|
96
|
+
* Function to update the input value.
|
|
97
|
+
* @param value - The new value (typed by input type when T is specified)
|
|
98
|
+
*/
|
|
99
|
+
setValue: (value: InputValueTypeMap[T]) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Validation error message for this field (if any).
|
|
102
|
+
*/
|
|
103
|
+
error?: string;
|
|
104
|
+
/** Translated label (already processed with current language). */
|
|
105
|
+
label?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Translated helper text (already processed with current language).
|
|
81
108
|
*/
|
|
82
109
|
helperText?: string;
|
|
83
110
|
/**
|
|
84
|
-
*
|
|
111
|
+
* Fields this input's dynamic options depend on that are not yet filled
|
|
112
|
+
* (its unresolved `{{nodeId}}` template variables). Empty when none — use it
|
|
113
|
+
* to hint the user which fields to complete before this input can load.
|
|
114
|
+
*/
|
|
115
|
+
missingDependencies: MissingDependency[];
|
|
116
|
+
/**
|
|
117
|
+
* Missing required fields on form submit (for submit inputs).
|
|
85
118
|
*/
|
|
86
119
|
missingRequiredFields?: string[];
|
|
87
120
|
/**
|
|
88
|
-
* Whether the form is currently being submitted (for submit inputs)
|
|
121
|
+
* Whether the form is currently being submitted (for submit inputs).
|
|
89
122
|
*/
|
|
90
123
|
isSubmitting?: boolean;
|
|
91
124
|
/**
|
|
@@ -109,6 +142,12 @@ export type InputRenderProps<T extends InputType = InputType> = {
|
|
|
109
142
|
*/
|
|
110
143
|
compactOptions?: boolean;
|
|
111
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* An input renderer. Receives the spreadable `field` props (DOM-safe) and the
|
|
147
|
+
* Treege `extra` props (state setters, translations, metadata) as two separate
|
|
148
|
+
* arguments, so `field` can be spread onto a control: `<input {...field} />`.
|
|
149
|
+
*/
|
|
150
|
+
export type InputRenderer<T extends InputType = InputType> = (field: InputFieldProps<T>, extra: InputExtraProps<T>) => ReactNode;
|
|
112
151
|
export type UiRenderProps = {
|
|
113
152
|
node: Node<UINodeData>;
|
|
114
153
|
};
|
|
@@ -123,7 +162,7 @@ export type NodeRenderProps = {
|
|
|
123
162
|
* Each input type gets its own properly typed InputRenderProps
|
|
124
163
|
*/
|
|
125
164
|
export type InputRenderers = {
|
|
126
|
-
[K in InputType]?:
|
|
165
|
+
[K in InputType]?: InputRenderer<K>;
|
|
127
166
|
};
|
|
128
167
|
/**
|
|
129
168
|
* Props passed to a step renderer. Steps are derived at runtime from the flow's
|
|
@@ -13,6 +13,17 @@ export declare const getInputNodes: (nodes: Node<TreegeNodeData>[]) => Node<Inpu
|
|
|
13
13
|
* @returns The resolved key (name, label, or node ID)
|
|
14
14
|
*/
|
|
15
15
|
export declare const resolveNodeKey: (node: Node<InputNodeData>) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve a human, end-user-facing label for an input node, preferring the
|
|
18
|
+
* translated `label` for the given language over the technical `name`. Used
|
|
19
|
+
* when surfacing field references to users (e.g. dependency hints). Priority:
|
|
20
|
+
* translated label > name > node id. This differs from `resolveNodeKey`, which
|
|
21
|
+
* prioritizes `name` for form-submission keys.
|
|
22
|
+
* @param node - The input node
|
|
23
|
+
* @param language - The current language code
|
|
24
|
+
* @returns The resolved display label
|
|
25
|
+
*/
|
|
26
|
+
export declare const resolveNodeLabel: (node: Node<InputNodeData>, language: string) => string;
|
|
16
27
|
/**
|
|
17
28
|
* Resolve the placeholder text for an input, falling back to the static
|
|
18
29
|
* "newAnswer" translation for textfield-like types when the user has not
|