@bpmn-io/form-js-editor 1.1.0 → 1.3.0-alpha.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.
Files changed (34) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +116 -116
  3. package/dist/assets/dragula.css +1 -1
  4. package/dist/assets/form-js-editor-base.css +797 -758
  5. package/dist/assets/form-js-editor.css +365 -10
  6. package/dist/assets/properties-panel.css +322 -2
  7. package/dist/index.cjs +2901 -1904
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.es.js +2901 -1905
  10. package/dist/index.es.js.map +1 -1
  11. package/dist/types/FormEditor.d.ts +1 -0
  12. package/dist/types/core/index.d.ts +7 -5
  13. package/dist/types/features/dragging/Dragging.d.ts +3 -1
  14. package/dist/types/features/modeling/Modeling.d.ts +4 -0
  15. package/dist/types/features/modeling/behavior/KeyBehavior.d.ts +1 -1
  16. package/dist/types/features/modeling/behavior/PathBehavior.d.ts +8 -0
  17. package/dist/types/features/modeling/behavior/index.d.ts +2 -0
  18. package/dist/types/features/modeling/cmd/MoveFormFieldHandler.d.ts +3 -1
  19. package/dist/types/features/modeling/cmd/UpdateKeyClaimHandler.d.ts +3 -3
  20. package/dist/types/features/modeling/cmd/UpdatePathClaimHandler.d.ts +14 -0
  21. package/dist/types/features/modeling/cmd/Util.d.ts +1 -0
  22. package/dist/types/features/modeling/index.d.ts +1 -0
  23. package/dist/types/features/properties-panel/Util.d.ts +1 -0
  24. package/dist/types/features/properties-panel/entries/GroupEntries.d.ts +10 -0
  25. package/dist/types/features/properties-panel/entries/PathEntry.d.ts +9 -0
  26. package/dist/types/features/properties-panel/entries/index.d.ts +2 -0
  27. package/dist/types/features/properties-panel/groups/{CustomValuesGroup.d.ts → CustomPropertiesGroup.d.ts} +2 -1
  28. package/dist/types/features/properties-panel/groups/index.d.ts +1 -1
  29. package/dist/types/render/components/Util.d.ts +1 -2
  30. package/dist/types/types.d.ts +28 -28
  31. package/package.json +5 -5
  32. package/dist/types/core/FieldFactory.d.ts +0 -18
  33. package/dist/types/import/Importer.d.ts +0 -53
  34. 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[];
@@ -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 './FieldFactory';
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';
@@ -1,5 +1,5 @@
1
1
  declare class KeyBehavior extends CommandInterceptor {
2
- constructor(eventBus: any, modeling: any);
2
+ constructor(eventBus: any, modeling: any, formFields: any);
3
3
  }
4
4
  declare namespace KeyBehavior {
5
5
  const $inject: string[];
@@ -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('../../../core/FormFieldRegistry').default } formFieldRegistry
4
+ * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
5
5
  */
6
- constructor(formFieldRegistry: import('../../../core/FormFieldRegistry').default);
7
- _formFieldRegistry: import("../../../core/FormFieldRegistry").default;
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[];
@@ -0,0 +1,10 @@
1
+ export default function GroupEntries(props: any): {
2
+ id: any;
3
+ label: any;
4
+ path: any;
5
+ field: any;
6
+ editField: any;
7
+ description: any;
8
+ component: (props: any) => any;
9
+ isEdited: any;
10
+ }[];
@@ -0,0 +1,9 @@
1
+ export default function PathEntry(props: any): {
2
+ id: string;
3
+ component: typeof Path;
4
+ editField: any;
5
+ field: any;
6
+ isEdited: any;
7
+ }[];
8
+ declare function Path(props: any): any;
9
+ export {};
@@ -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";
@@ -1,4 +1,4 @@
1
- export default function CustomValuesGroup(field: any, editField: any): {
1
+ export default function CustomPropertiesGroup(field: any, editField: any): {
2
2
  add: (event: any) => void;
3
3
  component: any;
4
4
  id: string;
@@ -18,6 +18,7 @@ export default function CustomValuesGroup(field: any, editField: any): {
18
18
  remove: (event: any) => any;
19
19
  }[];
20
20
  label: string;
21
+ tooltip: string;
21
22
  shouldSort: boolean;
22
23
  };
23
24
  /**
@@ -3,7 +3,7 @@ export { default as SerializationGroup } from "./SerializationGroup";
3
3
  export { default as ConstraintsGroup } from "./ConstraintsGroup";
4
4
  export { default as ValidationGroup } from "./ValidationGroup";
5
5
  export { default as ValuesGroups } from "./ValuesGroups";
6
- export { default as CustomValuesGroup } from "./CustomValuesGroup";
6
+ export { default as CustomPropertiesGroup } from "./CustomPropertiesGroup";
7
7
  export { default as AppearanceGroup } from "./AppearanceGroup";
8
8
  export { default as LayoutGroup } from "./LayoutGroup";
9
9
  export { ConditionGroup } from "./ConditionGroup";
@@ -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, dragPreview: Element): Function;
20
+ export function createDragger(fn: Function): Function;
22
21
  /**
23
22
  * Throttle function call according UI update cycle.
24
23
  *
@@ -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.1.0",
3
+ "version": "1.3.0-alpha.0",
4
4
  "description": "Edit forms - powered by bpmn.io",
5
5
  "exports": {
6
6
  ".": {
@@ -46,11 +46,11 @@
46
46
  "url": "https://github.com/bpmn-io"
47
47
  },
48
48
  "dependencies": {
49
- "@bpmn-io/form-js-viewer": "^1.1.0",
50
- "@bpmn-io/properties-panel": "^3.0.0",
49
+ "@bpmn-io/draggle": "^4.0.0",
50
+ "@bpmn-io/form-js-viewer": "^1.3.0-alpha.0",
51
+ "@bpmn-io/properties-panel": "^3.3.1",
51
52
  "array-move": "^3.0.1",
52
53
  "big.js": "^6.2.1",
53
- "dragula": "^3.7.3",
54
54
  "ids": "^1.0.0",
55
55
  "min-dash": "^4.0.0",
56
56
  "min-dom": "^4.0.0",
@@ -62,5 +62,5 @@
62
62
  "files": [
63
63
  "dist"
64
64
  ],
65
- "gitHead": "6bfb194e07fe44d3309744507f9f874cf8e94169"
65
+ "gitHead": "dd5504e512c13945767159900dc8cf884834b937"
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;
@@ -1,5 +0,0 @@
1
- declare namespace _default {
2
- const importer: (string | typeof Importer)[];
3
- }
4
- export default _default;
5
- import Importer from './Importer';