@bpmn-io/form-js-viewer 1.5.0 → 1.6.1
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/LICENSE +22 -22
- package/README.md +189 -189
- package/dist/assets/form-js-base.css +1244 -1040
- package/dist/assets/form-js.css +219 -16
- package/dist/index.cjs +2305 -1089
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +2299 -1090
- package/dist/index.es.js.map +1 -1
- package/dist/types/Form.d.ts +15 -4
- package/dist/types/core/FieldFactory.d.ts +2 -0
- package/dist/types/core/FormFieldRegistry.d.ts +1 -0
- package/dist/types/core/PathRegistry.d.ts +7 -3
- package/dist/types/features/{expression-language → expressionLanguage}/ConditionChecker.d.ts +8 -4
- package/dist/types/features/index.d.ts +4 -2
- package/dist/types/features/repeatRender/RepeatRenderManager.d.ts +21 -0
- package/dist/types/features/repeatRender/index.d.ts +7 -0
- package/dist/types/features/viewerCommands/ViewerCommands.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/render/components/Label.d.ts +21 -1
- package/dist/types/render/components/Util.d.ts +1 -1
- package/dist/types/render/components/form-fields/DynamicList.d.ts +18 -0
- package/dist/types/render/components/form-fields/Table.d.ts +71 -0
- package/dist/types/render/components/form-fields/parts/ChildrenRenderer.d.ts +1 -0
- package/dist/types/render/components/index.d.ts +3 -1
- package/dist/types/render/context/FormRenderContext.d.ts +4 -3
- package/dist/types/render/context/LocalExpressionContext.d.ts +7 -0
- package/dist/types/render/context/index.d.ts +1 -0
- package/dist/types/render/hooks/index.d.ts +1 -0
- package/dist/types/render/hooks/useExpressionEvaluation.d.ts +3 -3
- package/dist/types/render/hooks/useFilteredFormData.d.ts +1 -0
- package/dist/types/render/hooks/useScrollIntoView.d.ts +18 -0
- package/dist/types/render/hooks/useTemplateEvaluation.d.ts +1 -1
- package/dist/types/types.d.ts +35 -35
- package/dist/types/util/constants/OptionsSourceConstants.d.ts +19 -0
- package/dist/types/util/constants/index.d.ts +1 -1
- package/dist/types/util/getSchemaVariables.d.ts +39 -0
- package/dist/types/util/index.d.ts +3 -52
- package/dist/types/util/simple.d.ts +20 -0
- package/dist/types/util/structure.d.ts +1 -0
- package/package.json +4 -4
- package/dist/types/render/components/form-fields/parts/Grid.d.ts +0 -1
- package/dist/types/util/constants/ValuesSourceConstants.d.ts +0 -19
- /package/dist/types/features/{expression-language → expressionLanguage}/FeelExpressionLanguage.d.ts +0 -0
- /package/dist/types/features/{expression-language → expressionLanguage}/FeelersTemplating.d.ts +0 -0
- /package/dist/types/features/{expression-language → expressionLanguage}/index.d.ts +0 -0
- /package/dist/types/features/{expression-language → expressionLanguage}/variableExtractionHelpers.d.ts +0 -0
package/dist/types/Form.d.ts
CHANGED
|
@@ -27,8 +27,15 @@ export default class Form {
|
|
|
27
27
|
* @type {State}
|
|
28
28
|
*/
|
|
29
29
|
private _state;
|
|
30
|
-
get:
|
|
31
|
-
|
|
30
|
+
get: {
|
|
31
|
+
<T>(name: string): T;
|
|
32
|
+
<T_1>(name: string, strict: true): T_1;
|
|
33
|
+
<T_2>(name: string, strict: boolean): T_2;
|
|
34
|
+
};
|
|
35
|
+
invoke: {
|
|
36
|
+
<T_3>(func: import("didi").FactoryFunction<T_3>, context?: unknown, locals?: import("didi").LocalsMap): T_3;
|
|
37
|
+
<T_4>(func: import("didi").ArrayFunc<T_4>, context?: unknown, locals?: import("didi").LocalsMap): T_4;
|
|
38
|
+
};
|
|
32
39
|
clear(): void;
|
|
33
40
|
/**
|
|
34
41
|
* Destroy the form, removing it from DOM,
|
|
@@ -95,11 +102,12 @@ export default class Form {
|
|
|
95
102
|
/**
|
|
96
103
|
* @internal
|
|
97
104
|
*
|
|
98
|
-
* @param { { add?: boolean, field: any, remove?: number, value?: any } } update
|
|
105
|
+
* @param { { add?: boolean, field: any, indexes: object, remove?: number, value?: any } } update
|
|
99
106
|
*/
|
|
100
107
|
_update(update: {
|
|
101
108
|
add?: boolean;
|
|
102
109
|
field: any;
|
|
110
|
+
indexes: object;
|
|
103
111
|
remove?: number;
|
|
104
112
|
value?: any;
|
|
105
113
|
}): void;
|
|
@@ -126,6 +134,9 @@ export default class Form {
|
|
|
126
134
|
__depends__: import("didi").ModuleDeclaration[];
|
|
127
135
|
__init__: string[];
|
|
128
136
|
viewerCommands: (string | typeof import("./features").ViewerCommands)[];
|
|
137
|
+
} | {
|
|
138
|
+
__init__: string[];
|
|
139
|
+
repeatRenderManager: (string | typeof import("./features").RepeatRenderManager)[];
|
|
129
140
|
})[];
|
|
130
141
|
/**
|
|
131
142
|
* @internal
|
|
@@ -142,7 +153,7 @@ export default class Form {
|
|
|
142
153
|
/**
|
|
143
154
|
* @internal
|
|
144
155
|
*/
|
|
145
|
-
|
|
156
|
+
_getInitializedFieldData(data: any, options?: {}): any;
|
|
146
157
|
}
|
|
147
158
|
export type Injector = import('./types').Injector;
|
|
148
159
|
export type Data = import('./types').Data;
|
|
@@ -12,6 +12,8 @@ declare class FieldFactory {
|
|
|
12
12
|
create(attrs: any, applyDefaults?: boolean): any;
|
|
13
13
|
_ensureId(field: any): void;
|
|
14
14
|
_ensureKey(field: any): void;
|
|
15
|
+
_enforceDefaultPath(field: any): void;
|
|
16
|
+
_getUniqueKeyPath(field: any): string;
|
|
15
17
|
}
|
|
16
18
|
declare namespace FieldFactory {
|
|
17
19
|
let $inject: string[];
|
|
@@ -30,12 +30,13 @@
|
|
|
30
30
|
* ]
|
|
31
31
|
*/
|
|
32
32
|
declare class PathRegistry {
|
|
33
|
-
constructor(formFieldRegistry: any, formFields: any);
|
|
33
|
+
constructor(formFieldRegistry: any, formFields: any, injector: any);
|
|
34
34
|
_formFieldRegistry: any;
|
|
35
35
|
_formFields: any;
|
|
36
|
+
_injector: any;
|
|
36
37
|
_dataPaths: any[];
|
|
37
|
-
canClaimPath(path: any,
|
|
38
|
-
claimPath(path: any,
|
|
38
|
+
canClaimPath(path: any, options?: {}): boolean;
|
|
39
|
+
claimPath(path: any, options?: {}): void;
|
|
39
40
|
unclaimPath(path: any): void;
|
|
40
41
|
/**
|
|
41
42
|
* Applies a function (fn) recursively on a given field and its children.
|
|
@@ -55,15 +56,18 @@ declare class PathRegistry {
|
|
|
55
56
|
* @param {Object} field - The field object with properties: `key`, `path`, `id`, and optionally `_parent`.
|
|
56
57
|
* @param {Object} [options={}] - Configuration options.
|
|
57
58
|
* @param {Object} [options.replacements={}] - A map of field IDs to alternative path arrays.
|
|
59
|
+
* @param {Object} [options.indexes=null] - A map of parent IDs to the index of the field within said parent, leave null to get an unindexed path.
|
|
58
60
|
* @param {Object} [options.cutoffNode] - The ID of the parent field at which to stop generating the path.
|
|
59
61
|
*
|
|
60
62
|
* @returns {(Array<string>|undefined)} An array of strings representing the binding path, or undefined if not determinable.
|
|
61
63
|
*/
|
|
62
64
|
getValuePath(field: any, options?: {
|
|
63
65
|
replacements?: any;
|
|
66
|
+
indexes?: any;
|
|
64
67
|
cutoffNode?: any;
|
|
65
68
|
}): (Array<string> | undefined);
|
|
66
69
|
clear(): void;
|
|
70
|
+
_addIndexes(localValuePath: any, field: any, indexes: any): any;
|
|
67
71
|
}
|
|
68
72
|
declare namespace PathRegistry {
|
|
69
73
|
let $inject: string[];
|
package/dist/types/features/{expression-language → expressionLanguage}/ConditionChecker.d.ts
RENAMED
|
@@ -10,17 +10,19 @@ declare class ConditionChecker {
|
|
|
10
10
|
/**
|
|
11
11
|
* For given data, remove properties based on condition.
|
|
12
12
|
*
|
|
13
|
-
* @param {Object<string, any>} properties
|
|
14
13
|
* @param {Object<string, any>} data
|
|
14
|
+
* @param {Object<string, any>} contextData
|
|
15
15
|
* @param {Object} [options]
|
|
16
16
|
* @param {Function} [options.getFilterPath]
|
|
17
|
+
* @param {boolean} [options.leafNodeDeletionOnly]
|
|
17
18
|
*/
|
|
18
|
-
applyConditions(
|
|
19
|
+
applyConditions(data: {
|
|
19
20
|
[x: string]: any;
|
|
20
|
-
},
|
|
21
|
+
}, contextData?: {
|
|
21
22
|
[x: string]: any;
|
|
22
23
|
}, options?: {
|
|
23
24
|
getFilterPath?: Function;
|
|
25
|
+
leafNodeDeletionOnly?: boolean;
|
|
24
26
|
}): {
|
|
25
27
|
[x: string]: any;
|
|
26
28
|
};
|
|
@@ -43,7 +45,9 @@ declare class ConditionChecker {
|
|
|
43
45
|
_checkHideCondition(condition: Condition, data: {
|
|
44
46
|
[x: string]: any;
|
|
45
47
|
}): boolean;
|
|
46
|
-
|
|
48
|
+
_cleanlyClearDataAtPath(valuePath: any, obj: any): void;
|
|
49
|
+
_isEmptyObject(parentObject: any): boolean;
|
|
50
|
+
_isEmptyArray(parentObject: any): boolean;
|
|
47
51
|
}
|
|
48
52
|
declare namespace ConditionChecker {
|
|
49
53
|
let $inject: string[];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { default as ExpressionLanguageModule } from "./
|
|
1
|
+
export { default as ExpressionLanguageModule } from "./expressionLanguage";
|
|
2
2
|
export { default as MarkdownModule } from "./markdown";
|
|
3
3
|
export { default as ViewerCommandsModule } from "./viewerCommands";
|
|
4
|
-
export
|
|
4
|
+
export { default as RepeatRenderModule } from "./repeatRender";
|
|
5
|
+
export * from "./expressionLanguage";
|
|
5
6
|
export * from "./markdown";
|
|
6
7
|
export * from "./viewerCommands";
|
|
8
|
+
export * from "./repeatRender";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare class RepeatRenderManager {
|
|
2
|
+
constructor(form: any, formFields: any, formFieldRegistry: any, pathRegistry: any);
|
|
3
|
+
_form: any;
|
|
4
|
+
_formFields: any;
|
|
5
|
+
_formFieldRegistry: any;
|
|
6
|
+
_pathRegistry: any;
|
|
7
|
+
Repeater(props: any): import("preact").JSX.Element;
|
|
8
|
+
RepeatFooter(props: any): import("preact").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether a field is currently repeating its children.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} id - The id of the field to check
|
|
13
|
+
* @returns {boolean} - True if repeatable, false otherwise
|
|
14
|
+
*/
|
|
15
|
+
isFieldRepeating(id: string): boolean;
|
|
16
|
+
_getNonCollapsedItems(field: any): any;
|
|
17
|
+
}
|
|
18
|
+
declare namespace RepeatRenderManager {
|
|
19
|
+
let $inject: string[];
|
|
20
|
+
}
|
|
21
|
+
export default RepeatRenderManager;
|
|
@@ -5,7 +5,7 @@ declare class ViewerCommands {
|
|
|
5
5
|
getHandlers(): {
|
|
6
6
|
'formField.validation.update': typeof UpdateFieldValidationHandler;
|
|
7
7
|
};
|
|
8
|
-
updateFieldValidation(field: any, value: any): void;
|
|
8
|
+
updateFieldValidation(field: any, value: any, indexes: any): void;
|
|
9
9
|
}
|
|
10
10
|
declare namespace ViewerCommands {
|
|
11
11
|
let $inject: string[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export * from "./util";
|
|
|
14
14
|
export * from "./features";
|
|
15
15
|
export type CreateFormOptions = import('./types').CreateFormOptions;
|
|
16
16
|
import Form from './Form';
|
|
17
|
-
export const schemaVersion:
|
|
17
|
+
export const schemaVersion: 14;
|
|
18
18
|
export { Form };
|
|
19
19
|
export { FormFieldRegistry, FormLayouter, Importer, FieldFactory, PathRegistry } from "./core";
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @typedef Props
|
|
3
|
+
* @property {string} [id]
|
|
4
|
+
* @property {string|undefined} label
|
|
5
|
+
* @property {string} [class]
|
|
6
|
+
* @property {boolean} [collapseOnEmpty]
|
|
7
|
+
* @property {boolean} [required]
|
|
8
|
+
* @property {import("preact").VNode} [children]
|
|
9
|
+
*
|
|
10
|
+
* @param {Props} props
|
|
11
|
+
* @returns {import("preact").JSX.Element}
|
|
12
|
+
*/
|
|
13
|
+
export default function Label(props: Props): import("preact").JSX.Element;
|
|
14
|
+
export type Props = {
|
|
15
|
+
id?: string;
|
|
16
|
+
label: string | undefined;
|
|
17
|
+
class?: string;
|
|
18
|
+
collapseOnEmpty?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
children?: import("preact").VNode;
|
|
21
|
+
};
|
|
@@ -4,4 +4,4 @@ export function formFieldClasses(type: any, { errors, disabled, readonly }?: {
|
|
|
4
4
|
readonly?: boolean;
|
|
5
5
|
}): any;
|
|
6
6
|
export function gridColumnClasses(formField: any): any;
|
|
7
|
-
export function prefixId(id: any, formId: any): string;
|
|
7
|
+
export function prefixId(id: any, formId: any, indexes: any): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare function DynamicList(props: any): import("preact").JSX.Element;
|
|
2
|
+
declare namespace DynamicList {
|
|
3
|
+
namespace config {
|
|
4
|
+
let type: string;
|
|
5
|
+
let pathed: boolean;
|
|
6
|
+
let repeatable: boolean;
|
|
7
|
+
let label: string;
|
|
8
|
+
let group: string;
|
|
9
|
+
function create(options?: {}): {
|
|
10
|
+
components: any[];
|
|
11
|
+
showOutline: boolean;
|
|
12
|
+
isRepeating: boolean;
|
|
13
|
+
allowAddRemove: boolean;
|
|
14
|
+
defaultRepetitions: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export default DynamicList;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {('asc'|'desc')} Direction
|
|
3
|
+
*
|
|
4
|
+
* @typedef Sorting
|
|
5
|
+
* @property {string} key
|
|
6
|
+
* @property {Direction} direction
|
|
7
|
+
*
|
|
8
|
+
* @typedef Column
|
|
9
|
+
* @property {string} label
|
|
10
|
+
* @property {string} key
|
|
11
|
+
*
|
|
12
|
+
* @typedef Props
|
|
13
|
+
* @property {Object} field
|
|
14
|
+
* @property {string} field.id
|
|
15
|
+
* @property {Array<Column>} [field.columns]
|
|
16
|
+
* @property {string} [field.columnsExpression]
|
|
17
|
+
* @property {string} [field.label]
|
|
18
|
+
* @property {number} [field.rowCount]
|
|
19
|
+
* @property {string} [field.dataSource]
|
|
20
|
+
*
|
|
21
|
+
* @param {Props} props
|
|
22
|
+
* @returns {import("preact").JSX.Element}
|
|
23
|
+
*/
|
|
24
|
+
declare function Table(props: Props): import("preact").JSX.Element;
|
|
25
|
+
declare namespace Table {
|
|
26
|
+
namespace config {
|
|
27
|
+
export { type };
|
|
28
|
+
export let keyed: boolean;
|
|
29
|
+
export let label: string;
|
|
30
|
+
export let group: string;
|
|
31
|
+
export function create(options?: {}): {
|
|
32
|
+
id: any;
|
|
33
|
+
columnsExpression: string;
|
|
34
|
+
} | {
|
|
35
|
+
id: any;
|
|
36
|
+
columns: Column[];
|
|
37
|
+
} | {
|
|
38
|
+
rowCount: number;
|
|
39
|
+
columns: {
|
|
40
|
+
label: string;
|
|
41
|
+
key: string;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
export let initialDemoData: {
|
|
45
|
+
id: number;
|
|
46
|
+
name: string;
|
|
47
|
+
date: string;
|
|
48
|
+
}[];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export default Table;
|
|
52
|
+
export type Direction = ('asc' | 'desc');
|
|
53
|
+
export type Sorting = {
|
|
54
|
+
key: string;
|
|
55
|
+
direction: Direction;
|
|
56
|
+
};
|
|
57
|
+
export type Column = {
|
|
58
|
+
label: string;
|
|
59
|
+
key: string;
|
|
60
|
+
};
|
|
61
|
+
export type Props = {
|
|
62
|
+
field: {
|
|
63
|
+
id: string;
|
|
64
|
+
columns?: Array<Column>;
|
|
65
|
+
columnsExpression?: string;
|
|
66
|
+
label?: string;
|
|
67
|
+
rowCount?: number;
|
|
68
|
+
dataSource?: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
declare const type: "table";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ChildrenRenderer(props: any): import("preact").JSX.Element;
|
|
@@ -13,6 +13,7 @@ import FormComponent from './FormComponent';
|
|
|
13
13
|
import FormField from './FormField';
|
|
14
14
|
import Group from './form-fields/Group';
|
|
15
15
|
import IFrame from './form-fields/IFrame';
|
|
16
|
+
import DynamicList from './form-fields/DynamicList';
|
|
16
17
|
import Image from './form-fields/Image';
|
|
17
18
|
import Numberfield from './form-fields/Number';
|
|
18
19
|
import Radio from './form-fields/Radio';
|
|
@@ -23,4 +24,5 @@ import Taglist from './form-fields/Taglist';
|
|
|
23
24
|
import Text from './form-fields/Text';
|
|
24
25
|
import Textfield from './form-fields/Textfield';
|
|
25
26
|
import Textarea from './form-fields/Textarea';
|
|
26
|
-
|
|
27
|
+
import Table from './form-fields/Table';
|
|
28
|
+
export { Label, Description, Errors, Button, Checkbox, Checklist, Default, Datetime, FormComponent, FormField, Group, IFrame, DynamicList, Image, Numberfield, Radio, Select, Separator, Spacer, Taglist, Text, Textfield, Textarea, Table };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export default FormRenderContext;
|
|
2
2
|
declare const FormRenderContext: import("preact").Context<{
|
|
3
|
-
EmptyRoot: (props: any) => any;
|
|
4
3
|
Empty: (props: any) => any;
|
|
4
|
+
Hidden: (props: any) => any;
|
|
5
5
|
Children: (props: any) => import("preact").JSX.Element;
|
|
6
6
|
Element: (props: any) => import("preact").JSX.Element;
|
|
7
7
|
Row: (props: any) => import("preact").JSX.Element;
|
|
8
8
|
Column: (props: any) => any;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
hoverInfo: {
|
|
10
|
+
cleanup: () => void;
|
|
11
|
+
};
|
|
11
12
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as useCondition } from "./useCondition";
|
|
2
|
+
export { default as useScrollIntoView } from "./useScrollIntoView";
|
|
2
3
|
export { default as useExpressionEvaluation } from "./useExpressionEvaluation";
|
|
3
4
|
export { default as useFilteredFormData } from "./useFilteredFormData";
|
|
4
5
|
export { default as useKeyDownAction } from "./useKeyDownAction";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Evaluate a string reactively based on the expressionLanguage and form data.
|
|
3
3
|
* If the string is not an expression, it is returned as is.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param {string} value
|
|
4
|
+
* The function is memoized to minimize re-renders.
|
|
7
5
|
*
|
|
6
|
+
* @param {string} value - The string to evaluate.
|
|
7
|
+
* @returns {any} - Evaluated value or the original value if not an expression.
|
|
8
8
|
*/
|
|
9
9
|
export default function useExpressionEvaluation(value: string): any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to scroll an element into view only when it is not visible within the viewport.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} targetRef - A ref pointing to the DOM element to scroll into view.
|
|
5
|
+
* @param {Array} deps - An array of dependencies that trigger the effect.
|
|
6
|
+
* @param {Array} flagRefs - An array of refs that are used as flags to control when to scroll.
|
|
7
|
+
* @param {Object} [scrollOptions={}] - Options defining the behavior of the scrolling.
|
|
8
|
+
* @param {String} [scrollOptions.align='center'] - The alignment of the element within the viewport.
|
|
9
|
+
* @param {String} [scrollOptions.behavior='auto'] - The scrolling behavior.
|
|
10
|
+
* @param {Number} [scrollOptions.offset=0] - An offset that is added to the scroll position.
|
|
11
|
+
* @param {Boolean} [scrollOptions.scrollIfVisible=false] - Whether to scroll even if the element is visible.
|
|
12
|
+
*/
|
|
13
|
+
export default function useScrollIntoView(targetRef: any, deps: any[], scrollOptions?: {
|
|
14
|
+
align?: string;
|
|
15
|
+
behavior?: string;
|
|
16
|
+
offset?: number;
|
|
17
|
+
scrollIfVisible?: boolean;
|
|
18
|
+
}, flagRefs?: any[]): void;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @param {Function} [options.buildDebugString]
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
export default function useTemplateEvaluation(value: string, options
|
|
12
|
+
export default function useTemplateEvaluation(value: string, options?: {
|
|
13
13
|
debug?: boolean;
|
|
14
14
|
strict?: boolean;
|
|
15
15
|
buildDebugString?: Function;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { Injector } from 'didi';
|
|
2
|
-
|
|
3
|
-
export type Module = any;
|
|
4
|
-
export type Schema = any;
|
|
5
|
-
|
|
6
|
-
export interface Data {
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface Errors {
|
|
11
|
-
[x: string]: string[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type FormProperty = ('readOnly' | 'disabled' | string);
|
|
15
|
-
export type FormEvent = ('submit' | 'changed' | string);
|
|
16
|
-
|
|
17
|
-
export interface FormProperties {
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface FormOptions {
|
|
22
|
-
additionalModules?: Module[];
|
|
23
|
-
container?: Element | null | string;
|
|
24
|
-
injector?: Injector;
|
|
25
|
-
modules?: Module[];
|
|
26
|
-
properties?: FormProperties;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface CreateFormOptions extends FormOptions {
|
|
30
|
-
data?: Data;
|
|
31
|
-
schema: Schema;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
Injector
|
|
1
|
+
import { Injector } from 'didi';
|
|
2
|
+
|
|
3
|
+
export type Module = any;
|
|
4
|
+
export type Schema = any;
|
|
5
|
+
|
|
6
|
+
export interface Data {
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Errors {
|
|
11
|
+
[x: string]: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type FormProperty = ('readOnly' | 'disabled' | string);
|
|
15
|
+
export type FormEvent = ('submit' | 'changed' | string);
|
|
16
|
+
|
|
17
|
+
export interface FormProperties {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface FormOptions {
|
|
22
|
+
additionalModules?: Module[];
|
|
23
|
+
container?: Element | null | string;
|
|
24
|
+
injector?: Injector;
|
|
25
|
+
modules?: Module[];
|
|
26
|
+
properties?: FormProperties;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface CreateFormOptions extends FormOptions {
|
|
30
|
+
data?: Data;
|
|
31
|
+
schema: Schema;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
Injector
|
|
36
36
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function getOptionsSource(field: any): string;
|
|
2
|
+
export namespace OPTIONS_SOURCES {
|
|
3
|
+
let STATIC: string;
|
|
4
|
+
let INPUT: string;
|
|
5
|
+
let EXPRESSION: string;
|
|
6
|
+
}
|
|
7
|
+
export const OPTIONS_SOURCE_DEFAULT: string;
|
|
8
|
+
export const OPTIONS_SOURCES_LABELS: {
|
|
9
|
+
[x: string]: string;
|
|
10
|
+
};
|
|
11
|
+
export const OPTIONS_SOURCES_PATHS: {
|
|
12
|
+
[x: string]: string[];
|
|
13
|
+
};
|
|
14
|
+
export const OPTIONS_SOURCES_DEFAULTS: {
|
|
15
|
+
[x: string]: string | {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./DatetimeConstants";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./OptionsSourceConstants";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import('../types').Schema } Schema
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Parse the schema for variables a form might make use of.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* // retrieve variables from schema
|
|
10
|
+
* const variables = getSchemaVariables(schema);
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* // retrieve input variables from schema
|
|
15
|
+
* const inputVariables = getSchemaVariables(schema, { outputs: false });
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* // retrieve output variables from schema
|
|
20
|
+
* const outputVariables = getSchemaVariables(schema, { inputs: false });
|
|
21
|
+
*
|
|
22
|
+
* @param {Schema} schema
|
|
23
|
+
* @param {object} [options]
|
|
24
|
+
* @param {any} [options.expressionLanguage]
|
|
25
|
+
* @param {any} [options.templating]
|
|
26
|
+
* @param {any} [options.formFields]
|
|
27
|
+
* @param {boolean} [options.inputs=true]
|
|
28
|
+
* @param {boolean} [options.outputs=true]
|
|
29
|
+
*
|
|
30
|
+
* @return {string[]}
|
|
31
|
+
*/
|
|
32
|
+
export function getSchemaVariables(schema: Schema, options?: {
|
|
33
|
+
expressionLanguage?: any;
|
|
34
|
+
templating?: any;
|
|
35
|
+
formFields?: any;
|
|
36
|
+
inputs?: boolean;
|
|
37
|
+
outputs?: boolean;
|
|
38
|
+
}): string[];
|
|
39
|
+
export type Schema = import('../types').Schema;
|
|
@@ -1,55 +1,6 @@
|
|
|
1
|
-
export function isRequired(field: any): any;
|
|
2
|
-
export function pathParse(path: any): any;
|
|
3
|
-
export function pathsEqual(a: any, b: any): any;
|
|
4
|
-
export function generateIndexForType(type: any): any;
|
|
5
|
-
export function generateIdForType(type: any): string;
|
|
6
|
-
/**
|
|
7
|
-
* @template T
|
|
8
|
-
* @param {T} data
|
|
9
|
-
* @param {(this: any, key: string, value: any) => any} [replacer]
|
|
10
|
-
* @return {T}
|
|
11
|
-
*/
|
|
12
|
-
export function clone<T>(data: T, replacer?: (this: any, key: string, value: any) => any): T;
|
|
13
|
-
/**
|
|
14
|
-
* @typedef { import('../types').Schema } Schema
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Parse the schema for variables a form might make use of.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* // retrieve variables from schema
|
|
22
|
-
* const variables = getSchemaVariables(schema);
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
*
|
|
26
|
-
* // retrieve input variables from schema
|
|
27
|
-
* const inputVariables = getSchemaVariables(schema, { outputs: false });
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
*
|
|
31
|
-
* // retrieve output variables from schema
|
|
32
|
-
* const outputVariables = getSchemaVariables(schema, { inputs: false });
|
|
33
|
-
*
|
|
34
|
-
* @param {Schema} schema
|
|
35
|
-
* @param {object} [options]
|
|
36
|
-
* @param {any} [options.expressionLanguage]
|
|
37
|
-
* @param {any} [options.templating]
|
|
38
|
-
* @param {any} [options.formFields]
|
|
39
|
-
* @param {boolean} [options.inputs=true]
|
|
40
|
-
* @param {boolean} [options.outputs=true]
|
|
41
|
-
*
|
|
42
|
-
* @return {string[]}
|
|
43
|
-
*/
|
|
44
|
-
export function getSchemaVariables(schema: Schema, options?: {
|
|
45
|
-
expressionLanguage?: any;
|
|
46
|
-
templating?: any;
|
|
47
|
-
formFields?: any;
|
|
48
|
-
inputs?: boolean;
|
|
49
|
-
outputs?: boolean;
|
|
50
|
-
}): string[];
|
|
51
|
-
export function runRecursively(formField: any, fn: any): void;
|
|
52
1
|
export * from "./constants";
|
|
53
2
|
export * from "./injector";
|
|
54
3
|
export * from "./form";
|
|
55
|
-
export
|
|
4
|
+
export * from "./getSchemaVariables";
|
|
5
|
+
export * from "./simple";
|
|
6
|
+
export * from "./structure";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function isRequired(field: any): any;
|
|
2
|
+
export function pathParse(path: any): any;
|
|
3
|
+
export function pathsEqual(a: any, b: any): any;
|
|
4
|
+
export function generateIndexForType(type: any): any;
|
|
5
|
+
export function generateIdForType(type: any): string;
|
|
6
|
+
/**
|
|
7
|
+
* @template T
|
|
8
|
+
* @param {T} data
|
|
9
|
+
* @param {(this: any, key: string, value: any) => any} [replacer]
|
|
10
|
+
* @return {T}
|
|
11
|
+
*/
|
|
12
|
+
export function clone<T>(data: T, replacer?: (this: any, key: string, value: any) => any): T;
|
|
13
|
+
/**
|
|
14
|
+
* Transform a LocalExpressionContext object into a usable FEEL context.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} context - The LocalExpressionContext object.
|
|
17
|
+
* @returns {Object} The usable FEEL context.
|
|
18
|
+
*/
|
|
19
|
+
export function buildExpressionContext(context: any): any;
|
|
20
|
+
export function runRecursively(formField: any, fn: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getAncestryList(formFieldId: string, formFieldRegistry: import('../core/FormFieldRegistry').default): Array<string>;
|