@bpmn-io/form-js-viewer 1.8.3 → 1.8.5
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 +177 -189
- package/dist/assets/form-js-base.css +47 -39
- package/dist/assets/form-js.css +11 -26
- package/dist/index.cjs +450 -292
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +447 -293
- package/dist/index.es.js.map +1 -1
- package/dist/types/Form.d.ts +9 -13
- package/dist/types/core/FormFieldInstanceRegistry.d.ts +15 -0
- package/dist/types/core/Validator.d.ts +16 -1
- package/dist/types/core/index.d.ts +2 -0
- package/dist/types/features/expressionField/ExpressionLoopPreventer.d.ts +18 -0
- package/dist/types/features/expressionField/index.d.ts +6 -0
- package/dist/types/features/expressionLanguage/FeelersTemplating.d.ts +4 -4
- package/dist/types/features/index.d.ts +2 -0
- package/dist/types/features/viewerCommands/ViewerCommands.d.ts +6 -0
- package/dist/types/features/viewerCommands/cmd/UpdateFieldInstanceValidationHandler.d.ts +10 -0
- package/dist/types/features/viewerCommands/cmd/UpdateFieldValidationHandler.d.ts +3 -0
- package/dist/types/types.d.ts +34 -36
- package/dist/types/util/expressions.d.ts +17 -0
- package/dist/types/util/index.d.ts +1 -0
- package/dist/types/util/simple.d.ts +1 -7
- package/package.json +2 -2
package/dist/types/Form.d.ts
CHANGED
|
@@ -103,14 +103,11 @@ export class Form {
|
|
|
103
103
|
/**
|
|
104
104
|
* @internal
|
|
105
105
|
*
|
|
106
|
-
* @param { {
|
|
106
|
+
* @param { { fieldInstance: any, value: any } } update
|
|
107
107
|
*/
|
|
108
108
|
_update(update: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
indexes: object;
|
|
112
|
-
remove?: number;
|
|
113
|
-
value?: any;
|
|
109
|
+
fieldInstance: any;
|
|
110
|
+
value: any;
|
|
114
111
|
}): void;
|
|
115
112
|
/**
|
|
116
113
|
* @internal
|
|
@@ -121,13 +118,16 @@ export class Form {
|
|
|
121
118
|
*/
|
|
122
119
|
_setState(state: any): void;
|
|
123
120
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
* @internal
|
|
122
|
+
*/
|
|
126
123
|
_getModules(): ({
|
|
127
124
|
__init__: string[];
|
|
128
125
|
expressionLanguage: (string | typeof import("./features").FeelExpressionLanguage)[];
|
|
129
126
|
templating: (string | typeof import("./features").FeelersTemplating)[];
|
|
130
127
|
conditionChecker: (string | typeof import("./features").ConditionChecker)[];
|
|
128
|
+
} | {
|
|
129
|
+
__init__: string[];
|
|
130
|
+
expressionLoopPreventer: (string | typeof import("./features").ExpressionLoopPreventer)[];
|
|
131
131
|
} | {
|
|
132
132
|
__init__: string[];
|
|
133
133
|
markdownRenderer: (string | typeof import("./features").MarkdownRenderer)[];
|
|
@@ -146,11 +146,7 @@ export class Form {
|
|
|
146
146
|
/**
|
|
147
147
|
* @internal
|
|
148
148
|
*/
|
|
149
|
-
_getSubmitData():
|
|
150
|
-
/**
|
|
151
|
-
* @internal
|
|
152
|
-
*/
|
|
153
|
-
_applyConditions(toFilter: any, data: any, options?: {}): any;
|
|
149
|
+
_getSubmitData(): {};
|
|
154
150
|
/**
|
|
155
151
|
* @internal
|
|
156
152
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class FormFieldInstanceRegistry {
|
|
2
|
+
constructor(eventBus: any, formFieldRegistry: any, formFields: any);
|
|
3
|
+
_eventBus: any;
|
|
4
|
+
_formFieldRegistry: any;
|
|
5
|
+
_formFields: any;
|
|
6
|
+
_formFieldInstances: {};
|
|
7
|
+
add(instance: any): string;
|
|
8
|
+
remove(instanceId: any): void;
|
|
9
|
+
getAll(): any[];
|
|
10
|
+
getAllKeyed(): any[];
|
|
11
|
+
clear(): void;
|
|
12
|
+
}
|
|
13
|
+
export namespace FormFieldInstanceRegistry {
|
|
14
|
+
let $inject: string[];
|
|
15
|
+
}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
export class Validator {
|
|
2
|
-
constructor(expressionLanguage: any, conditionChecker: any, form: any);
|
|
2
|
+
constructor(expressionLanguage: any, conditionChecker: any, form: any, formFieldRegistry: any);
|
|
3
3
|
_expressionLanguage: any;
|
|
4
4
|
_conditionChecker: any;
|
|
5
5
|
_form: any;
|
|
6
|
+
_formFieldRegistry: any;
|
|
7
|
+
/**
|
|
8
|
+
* Validate against a field definition, does not support proper expression evaluation.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated use validateFieldInstance instead
|
|
11
|
+
*/
|
|
6
12
|
validateField(field: any, value: any): any[];
|
|
13
|
+
/**
|
|
14
|
+
* Validate a field instance.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} fieldInstance
|
|
17
|
+
* @param {string} value
|
|
18
|
+
*
|
|
19
|
+
* @returns {Array<string>}
|
|
20
|
+
*/
|
|
21
|
+
validateFieldInstance(fieldInstance: any, value: string): Array<string>;
|
|
7
22
|
}
|
|
8
23
|
export namespace Validator {
|
|
9
24
|
let $inject: string[];
|
|
@@ -8,6 +8,7 @@ export namespace CoreModule {
|
|
|
8
8
|
let importer: (string | typeof Importer)[];
|
|
9
9
|
let fieldFactory: (string | typeof FieldFactory)[];
|
|
10
10
|
let formFieldRegistry: (string | typeof FormFieldRegistry)[];
|
|
11
|
+
let formFieldInstanceRegistry: (string | typeof FormFieldInstanceRegistry)[];
|
|
11
12
|
let pathRegistry: (string | typeof PathRegistry)[];
|
|
12
13
|
let formLayouter: (string | typeof FormLayouter)[];
|
|
13
14
|
let validator: (string | typeof Validator)[];
|
|
@@ -18,5 +19,6 @@ import { FormFieldRegistry } from './FormFieldRegistry';
|
|
|
18
19
|
import { PathRegistry } from './PathRegistry';
|
|
19
20
|
import { FormLayouter } from './FormLayouter';
|
|
20
21
|
import { EventBus } from './EventBus';
|
|
22
|
+
import { FormFieldInstanceRegistry } from './FormFieldInstanceRegistry';
|
|
21
23
|
import { Validator } from './Validator';
|
|
22
24
|
export { Importer, FieldFactory, FormFieldRegistry, PathRegistry, FormLayouter };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class ExpressionLoopPreventer {
|
|
2
|
+
constructor(eventBus: any);
|
|
3
|
+
_computedExpressions: any[];
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the expression field has already been computed, and registers it if not.
|
|
6
|
+
*
|
|
7
|
+
* @param {any} expressionField
|
|
8
|
+
* @returns {boolean} - whether the expression field has already been computed within the current cycle
|
|
9
|
+
*/
|
|
10
|
+
registerExpressionExecution(expressionField: any): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Resets the list of computed expressions.
|
|
13
|
+
*/
|
|
14
|
+
reset(): void;
|
|
15
|
+
}
|
|
16
|
+
export namespace ExpressionLoopPreventer {
|
|
17
|
+
let $inject: string[];
|
|
18
|
+
}
|
|
@@ -37,10 +37,10 @@ export class FeelersTemplating {
|
|
|
37
37
|
sanitizer?: Function;
|
|
38
38
|
}): any;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
* @typedef {Object} ExpressionWithDepth
|
|
41
|
+
* @property {number} depth - The depth of the expression in the syntax tree.
|
|
42
|
+
* @property {string} expression - The extracted expression
|
|
43
|
+
*/
|
|
44
44
|
/**
|
|
45
45
|
* Extracts all feel expressions in the template along with their depth in the syntax tree.
|
|
46
46
|
* The depth is incremented for child expressions of loops to account for context drilling.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { ExpressionLanguageModule } from "./expressionLanguage";
|
|
2
|
+
export { ExpressionFieldModule } from "./expressionField";
|
|
2
3
|
export { MarkdownRendererModule } from "./markdown";
|
|
3
4
|
export { ViewerCommandsModule } from "./viewerCommands";
|
|
4
5
|
export { RepeatRenderModule } from "./repeatRender";
|
|
5
6
|
export * from "./expressionLanguage";
|
|
7
|
+
export * from "./expressionField";
|
|
6
8
|
export * from "./markdown";
|
|
7
9
|
export * from "./viewerCommands";
|
|
8
10
|
export * from "./repeatRender";
|
|
@@ -4,10 +4,16 @@ export class ViewerCommands {
|
|
|
4
4
|
registerHandlers(): void;
|
|
5
5
|
getHandlers(): {
|
|
6
6
|
'formField.validation.update': typeof UpdateFieldValidationHandler;
|
|
7
|
+
'formFieldInstance.validation.update': typeof UpdateFieldInstanceValidationHandler;
|
|
7
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
8
12
|
updateFieldValidation(field: any, value: any, indexes: any): void;
|
|
13
|
+
updateFieldInstanceValidation(fieldInstance: any, value: any): void;
|
|
9
14
|
}
|
|
10
15
|
export namespace ViewerCommands {
|
|
11
16
|
let $inject: string[];
|
|
12
17
|
}
|
|
13
18
|
import { UpdateFieldValidationHandler } from './cmd/UpdateFieldValidationHandler';
|
|
19
|
+
import { UpdateFieldInstanceValidationHandler } from './cmd/UpdateFieldInstanceValidationHandler';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class UpdateFieldInstanceValidationHandler {
|
|
2
|
+
constructor(form: any, validator: any);
|
|
3
|
+
_form: any;
|
|
4
|
+
_validator: any;
|
|
5
|
+
execute(context: any): void;
|
|
6
|
+
revert(context: any): void;
|
|
7
|
+
}
|
|
8
|
+
export namespace UpdateFieldInstanceValidationHandler {
|
|
9
|
+
let $inject: string[];
|
|
10
|
+
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,36 +1,34 @@
|
|
|
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 =
|
|
15
|
-
export type FormEvent =
|
|
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
|
-
};
|
|
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 { Injector };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform a LocalExpressionContext object into a usable FEEL context.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} context - The LocalExpressionContext object.
|
|
5
|
+
* @returns {Object} The usable FEEL context.
|
|
6
|
+
*/
|
|
7
|
+
export function buildExpressionContext(context: any): any;
|
|
8
|
+
/**
|
|
9
|
+
* Evaluate a string based on the expressionLanguage and context information.
|
|
10
|
+
* If the string is not an expression, it is returned as is.
|
|
11
|
+
*
|
|
12
|
+
* @param {any} expressionLanguage - The expression language to use.
|
|
13
|
+
* @param {string} value - The string to evaluate.
|
|
14
|
+
* @param {Object} expressionContextInfo - The context information to use.
|
|
15
|
+
* @returns {any} - Evaluated value or the original value if not an expression.
|
|
16
|
+
*/
|
|
17
|
+
export function runExpressionEvaluation(expressionLanguage: any, value: string, expressionContextInfo: any): any;
|
|
@@ -10,11 +10,5 @@ export function generateIdForType(type: any): string;
|
|
|
10
10
|
* @return {T}
|
|
11
11
|
*/
|
|
12
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
13
|
export function runRecursively(formField: any, fn: any): void;
|
|
14
|
+
export function wrapObjectKeysWithUnderscores(obj: any): {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpmn-io/form-js-viewer",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"description": "View forms - powered by bpmn.io",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"files": [
|
|
66
66
|
"dist"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "cc2823143bb6974e9c1355e4af494164122fd829"
|
|
69
69
|
}
|