@bpmn-io/form-js-editor 1.2.0 → 1.3.0
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 +116 -116
- package/dist/assets/form-js-editor-base.css +797 -758
- package/dist/assets/form-js-editor.css +289 -10
- package/dist/assets/properties-panel.css +245 -1
- package/dist/index.cjs +2585 -1780
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +2585 -1781
- package/dist/index.es.js.map +1 -1
- package/dist/types/FormEditor.d.ts +2 -0
- package/dist/types/core/index.d.ts +7 -5
- package/dist/types/features/dragging/Dragging.d.ts +3 -1
- package/dist/types/features/modeling/Modeling.d.ts +4 -0
- package/dist/types/features/modeling/behavior/KeyBehavior.d.ts +1 -1
- package/dist/types/features/modeling/behavior/PathBehavior.d.ts +8 -0
- package/dist/types/features/modeling/behavior/index.d.ts +2 -0
- package/dist/types/features/modeling/cmd/MoveFormFieldHandler.d.ts +3 -1
- package/dist/types/features/modeling/cmd/UpdateKeyClaimHandler.d.ts +3 -3
- package/dist/types/features/modeling/cmd/UpdatePathClaimHandler.d.ts +14 -0
- package/dist/types/features/modeling/cmd/Util.d.ts +1 -0
- package/dist/types/features/modeling/index.d.ts +1 -0
- package/dist/types/features/properties-panel/Util.d.ts +1 -0
- package/dist/types/features/properties-panel/entries/GroupEntries.d.ts +10 -0
- package/dist/types/features/properties-panel/entries/PathEntry.d.ts +9 -0
- package/dist/types/features/properties-panel/entries/index.d.ts +2 -0
- package/dist/types/features/properties-panel/index.d.ts +1 -0
- package/dist/types/render/components/Util.d.ts +1 -2
- package/dist/types/types.d.ts +28 -28
- package/package.json +4 -4
- package/dist/types/core/FieldFactory.d.ts +0 -18
- package/dist/types/import/Importer.d.ts +0 -53
- package/dist/types/import/index.d.ts +0 -5
|
@@ -120,6 +120,7 @@ export default class FormEditor {
|
|
|
120
120
|
__init__: string[];
|
|
121
121
|
idBehavior: (string | typeof import("./features/modeling/behavior/IdBehavior").default)[];
|
|
122
122
|
keyBehavior: (string | typeof import("./features/modeling/behavior/KeyBehavior").default)[];
|
|
123
|
+
pathBehavior: (string | typeof import("./features/modeling/behavior/PathBehavior").default)[];
|
|
123
124
|
validateBehavior: (string | typeof import("./features/modeling/behavior/ValidateBehavior").default)[];
|
|
124
125
|
})[];
|
|
125
126
|
__init__: string[];
|
|
@@ -146,6 +147,7 @@ export default class FormEditor {
|
|
|
146
147
|
expressionLanguage: (string | typeof import("@bpmn-io/form-js-viewer/dist/types/features/expression-language/FeelExpressionLanguage").default)[];
|
|
147
148
|
templating: (string | typeof import("./features/expression-language/EditorTemplating").default)[];
|
|
148
149
|
} | typeof MarkdownModule | {
|
|
150
|
+
__depends__: any[];
|
|
149
151
|
__init__: string[];
|
|
150
152
|
propertiesPanel: (string | typeof import("./features/properties-panel/PropertiesPanelRenderer").default)[];
|
|
151
153
|
} | {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
const __depends__:
|
|
3
|
-
importer: (string | typeof import("../import/Importer").default)[];
|
|
4
|
-
} | {
|
|
2
|
+
const __depends__: {
|
|
5
3
|
__init__: string[];
|
|
6
4
|
formFields: (string | typeof import("../render/EditorFormFields").default)[];
|
|
7
5
|
renderer: (string | typeof import("../render/Renderer").default)[];
|
|
8
|
-
}
|
|
6
|
+
}[];
|
|
9
7
|
const debounce: (string | typeof DebounceFactory)[];
|
|
10
8
|
const eventBus: (string | typeof EventBus)[];
|
|
9
|
+
const importer: (string | typeof Importer)[];
|
|
11
10
|
const formFieldRegistry: (string | typeof FormFieldRegistry)[];
|
|
11
|
+
const pathRegistry: (string | typeof PathRegistry)[];
|
|
12
12
|
const formLayouter: (string | typeof FormLayouter)[];
|
|
13
13
|
const formLayoutValidator: (string | typeof FormLayoutValidator)[];
|
|
14
14
|
const fieldFactory: (string | typeof FieldFactory)[];
|
|
@@ -16,7 +16,9 @@ declare namespace _default {
|
|
|
16
16
|
export default _default;
|
|
17
17
|
import DebounceFactory from './Debounce';
|
|
18
18
|
import EventBus from './EventBus';
|
|
19
|
+
import { Importer } from '@bpmn-io/form-js-viewer';
|
|
19
20
|
import FormFieldRegistry from './FormFieldRegistry';
|
|
21
|
+
import { PathRegistry } from '@bpmn-io/form-js-viewer';
|
|
20
22
|
import FormLayouter from './FormLayouter';
|
|
21
23
|
import FormLayoutValidator from './FormLayoutValidator';
|
|
22
|
-
import FieldFactory from '
|
|
24
|
+
import { FieldFactory } from '@bpmn-io/form-js-viewer';
|
|
@@ -19,13 +19,15 @@ declare class Dragging {
|
|
|
19
19
|
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
20
20
|
* @param { import('../../core/EventBus').default } eventBus
|
|
21
21
|
* @param { import('../modeling/Modeling').default } modeling
|
|
22
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
22
23
|
*/
|
|
23
|
-
constructor(formFieldRegistry: import('../../core/FormFieldRegistry').default, formLayouter: import('../../core/FormLayouter').default, formLayoutValidator: import('../../core/FormLayoutValidator').default, eventBus: import('../../core/EventBus').default, modeling: import('../modeling/Modeling').default);
|
|
24
|
+
constructor(formFieldRegistry: import('../../core/FormFieldRegistry').default, formLayouter: import('../../core/FormLayouter').default, formLayoutValidator: import('../../core/FormLayoutValidator').default, eventBus: import('../../core/EventBus').default, modeling: import('../modeling/Modeling').default, pathRegistry: import('@bpmn-io/form-js-viewer').PathRegistry);
|
|
24
25
|
_formFieldRegistry: import("../../core/FormFieldRegistry").default;
|
|
25
26
|
_formLayouter: import("@bpmn-io/form-js-viewer/dist/types/core/FormLayouter").default;
|
|
26
27
|
_formLayoutValidator: import("../../core/FormLayoutValidator").default;
|
|
27
28
|
_eventBus: import("diagram-js/lib/core/EventBus").default;
|
|
28
29
|
_modeling: import("../modeling/Modeling").default;
|
|
30
|
+
_pathRegistry: import("@bpmn-io/form-js-viewer/dist/types/core/PathRegistry").default;
|
|
29
31
|
/**
|
|
30
32
|
* Calculcates position in form schema given the dropped place.
|
|
31
33
|
*
|
|
@@ -12,6 +12,7 @@ declare class Modeling {
|
|
|
12
12
|
'formField.remove': typeof RemoveFormFieldHandler;
|
|
13
13
|
'id.updateClaim': typeof UpdateIdClaimHandler;
|
|
14
14
|
'key.updateClaim': typeof UpdateKeyClaimHandler;
|
|
15
|
+
'path.updateClaim': typeof UpdatePathClaimHandler;
|
|
15
16
|
};
|
|
16
17
|
addFormField(attrs: any, targetFormField: any, targetIndex: any): any;
|
|
17
18
|
editFormField(formField: any, properties: any, value: any): void;
|
|
@@ -21,6 +22,8 @@ declare class Modeling {
|
|
|
21
22
|
unclaimId(formField: any, id: any): void;
|
|
22
23
|
claimKey(formField: any, key: any): void;
|
|
23
24
|
unclaimKey(formField: any, key: any): void;
|
|
25
|
+
claimPath(formField: any, path: any): void;
|
|
26
|
+
unclaimPath(formField: any, path: any): void;
|
|
24
27
|
}
|
|
25
28
|
declare namespace Modeling {
|
|
26
29
|
const $inject: string[];
|
|
@@ -32,3 +35,4 @@ import MoveFormFieldHandler from './cmd/MoveFormFieldHandler';
|
|
|
32
35
|
import RemoveFormFieldHandler from './cmd/RemoveFormFieldHandler';
|
|
33
36
|
import UpdateIdClaimHandler from './cmd/UpdateIdClaimHandler';
|
|
34
37
|
import UpdateKeyClaimHandler from './cmd/UpdateKeyClaimHandler';
|
|
38
|
+
import UpdatePathClaimHandler from './cmd/UpdatePathClaimHandler';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare class PathBehavior extends CommandInterceptor {
|
|
2
|
+
constructor(eventBus: any, modeling: any, formFields: any);
|
|
3
|
+
}
|
|
4
|
+
declare namespace PathBehavior {
|
|
5
|
+
const $inject: string[];
|
|
6
|
+
}
|
|
7
|
+
export default PathBehavior;
|
|
8
|
+
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
@@ -2,9 +2,11 @@ declare namespace _default {
|
|
|
2
2
|
const __init__: string[];
|
|
3
3
|
const idBehavior: (string | typeof IdBehavior)[];
|
|
4
4
|
const keyBehavior: (string | typeof KeyBehavior)[];
|
|
5
|
+
const pathBehavior: (string | typeof PathBehavior)[];
|
|
5
6
|
const validateBehavior: (string | typeof ValidateBehavior)[];
|
|
6
7
|
}
|
|
7
8
|
export default _default;
|
|
8
9
|
import IdBehavior from './IdBehavior';
|
|
9
10
|
import KeyBehavior from './KeyBehavior';
|
|
11
|
+
import PathBehavior from './PathBehavior';
|
|
10
12
|
import ValidateBehavior from './ValidateBehavior';
|
|
@@ -3,10 +3,12 @@ declare class MoveFormFieldHandler {
|
|
|
3
3
|
* @constructor
|
|
4
4
|
* @param { import('../../../FormEditor').default } formEditor
|
|
5
5
|
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
6
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
6
7
|
*/
|
|
7
|
-
constructor(formEditor: import('../../../FormEditor').default, formFieldRegistry: import('../../../core/FormFieldRegistry').default);
|
|
8
|
+
constructor(formEditor: import('../../../FormEditor').default, formFieldRegistry: import('../../../core/FormFieldRegistry').default, pathRegistry: import('@bpmn-io/form-js-viewer').PathRegistry);
|
|
8
9
|
_formEditor: import("../../../FormEditor").default;
|
|
9
10
|
_formFieldRegistry: import("../../../core/FormFieldRegistry").default;
|
|
11
|
+
_pathRegistry: import("@bpmn-io/form-js-viewer/dist/types/core/PathRegistry").default;
|
|
10
12
|
execute(context: any): void;
|
|
11
13
|
revert(context: any): void;
|
|
12
14
|
moveFormField(context: any, revert: any): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare class UpdateKeyClaimHandler {
|
|
2
2
|
/**
|
|
3
3
|
* @constructor
|
|
4
|
-
* @param { import('
|
|
4
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
5
5
|
*/
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
6
|
+
constructor(pathRegistry: import('@bpmn-io/form-js-viewer').PathRegistry);
|
|
7
|
+
_pathRegistry: import("@bpmn-io/form-js-viewer/dist/types/core/PathRegistry").default;
|
|
8
8
|
execute(context: any): void;
|
|
9
9
|
revert(context: any): void;
|
|
10
10
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare class UpdatePathClaimHandler {
|
|
2
|
+
/**
|
|
3
|
+
* @constructor
|
|
4
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
5
|
+
*/
|
|
6
|
+
constructor(pathRegistry: import('@bpmn-io/form-js-viewer').PathRegistry);
|
|
7
|
+
_pathRegistry: import("@bpmn-io/form-js-viewer/dist/types/core/PathRegistry").default;
|
|
8
|
+
execute(context: any): void;
|
|
9
|
+
revert(context: any): void;
|
|
10
|
+
}
|
|
11
|
+
declare namespace UpdatePathClaimHandler {
|
|
12
|
+
const $inject: string[];
|
|
13
|
+
}
|
|
14
|
+
export default UpdatePathClaimHandler;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export function arrayAdd(array: any, index: any, item: any): any;
|
|
2
2
|
export function arrayRemove(array: any, index: any): any;
|
|
3
3
|
export function updatePath(formFieldRegistry: any, formField: any, index: any): any;
|
|
4
|
+
export function refreshPathsRecursively(formField: any, path: any): void;
|
|
4
5
|
export function updateRow(formField: any, rowId: any): any;
|
|
5
6
|
export { mutate as arrayMove } from "array-move";
|
|
@@ -3,6 +3,7 @@ declare namespace _default {
|
|
|
3
3
|
__init__: string[];
|
|
4
4
|
idBehavior: (string | typeof import("./behavior/IdBehavior").default)[];
|
|
5
5
|
keyBehavior: (string | typeof import("./behavior/KeyBehavior").default)[];
|
|
6
|
+
pathBehavior: (string | typeof import("./behavior/PathBehavior").default)[];
|
|
6
7
|
validateBehavior: (string | typeof import("./behavior/ValidateBehavior").default)[];
|
|
7
8
|
})[];
|
|
8
9
|
const __init__: string[];
|
|
@@ -5,5 +5,6 @@ export function countDecimals(number: any): any;
|
|
|
5
5
|
export function isValidNumber(value: any): boolean;
|
|
6
6
|
export function stopPropagation(listener: any): (event: any) => void;
|
|
7
7
|
export function textToLabel(text: any): string;
|
|
8
|
+
export function isValidDotPath(path: any): boolean;
|
|
8
9
|
export const INPUTS: string[];
|
|
9
10
|
export const VALUES_INPUTS: string[];
|
|
@@ -6,6 +6,8 @@ export { default as DefaultValueEntry } from "./DefaultValueEntry";
|
|
|
6
6
|
export { default as DisabledEntry } from "./DisabledEntry";
|
|
7
7
|
export { default as IdEntry } from "./IdEntry";
|
|
8
8
|
export { default as KeyEntry } from "./KeyEntry";
|
|
9
|
+
export { default as PathEntry } from "./PathEntry";
|
|
10
|
+
export { default as GroupEntries } from "./GroupEntries";
|
|
9
11
|
export { default as LabelEntry } from "./LabelEntry";
|
|
10
12
|
export { default as ImageSourceEntry } from "./ImageSourceEntry";
|
|
11
13
|
export { default as TextEntry } from "./TextEntry";
|
|
@@ -14,11 +14,10 @@ export function editorFormFieldClasses(type: any, { disabled }?: {
|
|
|
14
14
|
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
15
15
|
*
|
|
16
16
|
* @param {Function} fn
|
|
17
|
-
* @param {Element} dragPreview
|
|
18
17
|
*
|
|
19
18
|
* @return {Function} drag start callback function
|
|
20
19
|
*/
|
|
21
|
-
export function createDragger(fn: Function
|
|
20
|
+
export function createDragger(fn: Function): Function;
|
|
22
21
|
/**
|
|
23
22
|
* Throttle function call according UI update cycle.
|
|
24
23
|
*
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Injector } from 'didi';
|
|
2
|
-
|
|
3
|
-
export type Module = any;
|
|
4
|
-
export type Schema = any;
|
|
5
|
-
|
|
6
|
-
export interface FormEditorProperties {
|
|
7
|
-
[x: string]: any
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface FormEditorOptions {
|
|
11
|
-
additionalModules?: Module[];
|
|
12
|
-
container?: Element | null | string;
|
|
13
|
-
exporter?: {
|
|
14
|
-
name: string,
|
|
15
|
-
version: string
|
|
16
|
-
};
|
|
17
|
-
injector?: Injector;
|
|
18
|
-
modules?: Module[];
|
|
19
|
-
properties?: FormEditorProperties;
|
|
20
|
-
[x:string]: any;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface CreateFormEditorOptions extends FormEditorOptions {
|
|
24
|
-
schema?: Schema
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
Injector
|
|
1
|
+
import { Injector } from 'didi';
|
|
2
|
+
|
|
3
|
+
export type Module = any;
|
|
4
|
+
export type Schema = any;
|
|
5
|
+
|
|
6
|
+
export interface FormEditorProperties {
|
|
7
|
+
[x: string]: any
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface FormEditorOptions {
|
|
11
|
+
additionalModules?: Module[];
|
|
12
|
+
container?: Element | null | string;
|
|
13
|
+
exporter?: {
|
|
14
|
+
name: string,
|
|
15
|
+
version: string
|
|
16
|
+
};
|
|
17
|
+
injector?: Injector;
|
|
18
|
+
modules?: Module[];
|
|
19
|
+
properties?: FormEditorProperties;
|
|
20
|
+
[x:string]: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface CreateFormEditorOptions extends FormEditorOptions {
|
|
24
|
+
schema?: Schema
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
Injector
|
|
29
29
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpmn-io/form-js-editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Edit forms - powered by bpmn.io",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@bpmn-io/draggle": "^4.0.0",
|
|
50
|
-
"@bpmn-io/form-js-viewer": "^1.
|
|
51
|
-
"@bpmn-io/properties-panel": "^3.
|
|
50
|
+
"@bpmn-io/form-js-viewer": "^1.3.0",
|
|
51
|
+
"@bpmn-io/properties-panel": "^3.7.0",
|
|
52
52
|
"array-move": "^3.0.1",
|
|
53
53
|
"big.js": "^6.2.1",
|
|
54
54
|
"ids": "^1.0.0",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"files": [
|
|
63
63
|
"dist"
|
|
64
64
|
],
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "f7cc5395b19de74eb7d9183af38dc462170a6179"
|
|
66
66
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare class FieldFactory {
|
|
2
|
-
/**
|
|
3
|
-
* @constructor
|
|
4
|
-
*
|
|
5
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
6
|
-
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
7
|
-
*/
|
|
8
|
-
constructor(formFieldRegistry: import('./FormFieldRegistry').default, formFields: import('@bpmn-io/form-js-viewer').FormFields);
|
|
9
|
-
_formFieldRegistry: import("./FormFieldRegistry").default;
|
|
10
|
-
_formFields: import("@bpmn-io/form-js-viewer").FormFields;
|
|
11
|
-
create(attrs: any, applyDefaults?: boolean): any;
|
|
12
|
-
_ensureId(field: any): void;
|
|
13
|
-
_ensureKey(field: any, applyDefaults: any): void;
|
|
14
|
-
}
|
|
15
|
-
declare namespace FieldFactory {
|
|
16
|
-
const $inject: string[];
|
|
17
|
-
}
|
|
18
|
-
export default FieldFactory;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
declare class Importer {
|
|
2
|
-
/**
|
|
3
|
-
* @constructor
|
|
4
|
-
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
5
|
-
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
6
|
-
* @param { import('../core/FormLayouter').default } formLayouter
|
|
7
|
-
*/
|
|
8
|
-
constructor(formFieldRegistry: import('../core/FormFieldRegistry').default, fieldFactory: import('../core/FieldFactory').default, formLayouter: import('../core/FormLayouter').default);
|
|
9
|
-
_formFieldRegistry: import("../core/FormFieldRegistry").default;
|
|
10
|
-
_fieldFactory: import("../core/FieldFactory").default;
|
|
11
|
-
_formLayouter: import("@bpmn-io/form-js-viewer/dist/types/core/FormLayouter").default;
|
|
12
|
-
/**
|
|
13
|
-
* Import schema creating rows, fields, attaching additional
|
|
14
|
-
* information to each field and adding fields to the
|
|
15
|
-
* field registry.
|
|
16
|
-
*
|
|
17
|
-
* Additional information attached:
|
|
18
|
-
*
|
|
19
|
-
* * `id` (unless present)
|
|
20
|
-
* * `_parent`
|
|
21
|
-
* * `_path`
|
|
22
|
-
*
|
|
23
|
-
* @param {any} schema
|
|
24
|
-
*
|
|
25
|
-
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
26
|
-
* @returns {ImportResult}
|
|
27
|
-
*/
|
|
28
|
-
importSchema(schema: any): {
|
|
29
|
-
warnings: Error[];
|
|
30
|
-
schema: any;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* @param {{[x: string]: any}} fieldAttrs
|
|
34
|
-
* @param {String} [parentId]
|
|
35
|
-
* @param {number} [index]
|
|
36
|
-
*
|
|
37
|
-
* @return {any} field
|
|
38
|
-
*/
|
|
39
|
-
importFormField(fieldAttrs: {
|
|
40
|
-
[x: string]: any;
|
|
41
|
-
}, parentId?: string, index?: number): any;
|
|
42
|
-
/**
|
|
43
|
-
* @param {Array<any>} components
|
|
44
|
-
* @param {string} parentId
|
|
45
|
-
*
|
|
46
|
-
* @return {Array<any>} imported components
|
|
47
|
-
*/
|
|
48
|
-
importFormFields(components: Array<any>, parentId: string): Array<any>;
|
|
49
|
-
}
|
|
50
|
-
declare namespace Importer {
|
|
51
|
-
const $inject: string[];
|
|
52
|
-
}
|
|
53
|
-
export default Importer;
|