@bpmn-io/form-js-viewer 1.0.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.
- package/LICENSE +22 -22
- package/README.md +164 -164
- package/dist/assets/form-js-base.css +985 -917
- package/dist/assets/form-js.css +69 -1
- package/dist/index.cjs +1982 -859
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +1977 -860
- package/dist/index.es.js.map +1 -1
- package/dist/types/Form.d.ts +12 -26
- package/dist/types/core/FieldFactory.d.ts +19 -0
- package/dist/types/core/FormFieldRegistry.d.ts +0 -1
- package/dist/types/core/Importer.d.ts +56 -0
- package/dist/types/core/PathRegistry.d.ts +71 -0
- package/dist/types/core/index.d.ts +9 -5
- package/dist/types/features/expression-language/ConditionChecker.d.ts +3 -2
- package/dist/types/features/expression-language/variableExtractionHelpers.d.ts +1 -1
- package/dist/types/features/index.d.ts +2 -0
- package/dist/types/features/viewerCommands/ViewerCommands.d.ts +14 -0
- package/dist/types/features/viewerCommands/cmd/UpdateFieldValidationHandler.d.ts +11 -0
- package/dist/types/features/viewerCommands/index.d.ts +8 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/render/components/form-fields/Checklist.d.ts +2 -6
- package/dist/types/render/components/form-fields/Default.d.ts +3 -3
- package/dist/types/render/components/form-fields/Group.d.ts +14 -0
- package/dist/types/render/components/form-fields/Radio.d.ts +2 -6
- package/dist/types/render/components/form-fields/Select.d.ts +2 -6
- package/dist/types/render/components/form-fields/Spacer.d.ts +14 -0
- package/dist/types/render/components/form-fields/Taglist.d.ts +2 -6
- package/dist/types/render/components/form-fields/parts/Grid.d.ts +1 -0
- package/dist/types/render/components/index.d.ts +4 -2
- package/dist/types/render/components/util/localisationUtil.d.ts +24 -0
- package/dist/types/render/components/util/valuesUtil.d.ts +6 -0
- package/dist/types/render/context/FormRenderContext.d.ts +3 -0
- package/dist/types/types.d.ts +35 -35
- package/dist/types/util/index.d.ts +2 -5
- package/package.json +5 -4
- package/dist/types/import/Importer.d.ts +0 -45
- package/dist/types/import/index.d.ts +0 -5
package/dist/types/Form.d.ts
CHANGED
|
@@ -116,34 +116,16 @@ export default class Form {
|
|
|
116
116
|
*/
|
|
117
117
|
_getModules(): ({
|
|
118
118
|
__init__: string[];
|
|
119
|
-
expressionLanguage: (string | typeof import("./features
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
* @typedef { import('./types').Data } Data
|
|
123
|
-
* @typedef { import('./types').Errors } Errors
|
|
124
|
-
* @typedef { import('./types').Schema } Schema
|
|
125
|
-
* @typedef { import('./types').FormProperties } FormProperties
|
|
126
|
-
* @typedef { import('./types').FormProperty } FormProperty
|
|
127
|
-
* @typedef { import('./types').FormEvent } FormEvent
|
|
128
|
-
* @typedef { import('./types').FormOptions } FormOptions
|
|
129
|
-
*
|
|
130
|
-
* @typedef { {
|
|
131
|
-
* data: Data,
|
|
132
|
-
* initialData: Data,
|
|
133
|
-
* errors: Errors,
|
|
134
|
-
* properties: FormProperties,
|
|
135
|
-
* schema: Schema
|
|
136
|
-
* } } State
|
|
137
|
-
*
|
|
138
|
-
* @typedef { (type:FormEvent, priority:number, handler:Function) => void } OnEventWithPriority
|
|
139
|
-
* @typedef { (type:FormEvent, handler:Function) => void } OnEventWithOutPriority
|
|
140
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
141
|
-
*/
|
|
142
|
-
templating: (string | typeof import("./features/expression-language").FeelersTemplating)[];
|
|
143
|
-
conditionChecker: (string | typeof import("./features/expression-language").ConditionChecker)[];
|
|
119
|
+
expressionLanguage: (string | typeof import("./features").FeelExpressionLanguage)[];
|
|
120
|
+
templating: (string | typeof import("./features").FeelersTemplating)[];
|
|
121
|
+
conditionChecker: (string | typeof import("./features").ConditionChecker)[];
|
|
144
122
|
} | {
|
|
145
123
|
__init__: string[];
|
|
146
|
-
markdownRenderer: (string | typeof import("./features
|
|
124
|
+
markdownRenderer: (string | typeof import("./features").MarkdownRenderer)[];
|
|
125
|
+
} | {
|
|
126
|
+
__depends__: import("didi").ModuleDeclaration[];
|
|
127
|
+
__init__: string[];
|
|
128
|
+
viewerCommands: (string | typeof import("./features").ViewerCommands)[];
|
|
147
129
|
})[];
|
|
148
130
|
/**
|
|
149
131
|
* @internal
|
|
@@ -157,6 +139,10 @@ export default class Form {
|
|
|
157
139
|
* @internal
|
|
158
140
|
*/
|
|
159
141
|
_applyConditions(toFilter: any, data: any): any;
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
145
|
+
_initializeFieldData(data: any): any;
|
|
160
146
|
}
|
|
161
147
|
export type Injector = import('./types').Injector;
|
|
162
148
|
export type Data = import('./types').Data;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare class FieldFactory {
|
|
2
|
+
/**
|
|
3
|
+
* @constructor
|
|
4
|
+
*
|
|
5
|
+
* @param formFieldRegistry
|
|
6
|
+
* @param formFields
|
|
7
|
+
*/
|
|
8
|
+
constructor(formFieldRegistry: any, pathRegistry: any, formFields: any);
|
|
9
|
+
_formFieldRegistry: any;
|
|
10
|
+
_pathRegistry: any;
|
|
11
|
+
_formFields: any;
|
|
12
|
+
create(attrs: any, applyDefaults?: boolean): any;
|
|
13
|
+
_ensureId(field: any): void;
|
|
14
|
+
_ensureKey(field: any): void;
|
|
15
|
+
}
|
|
16
|
+
declare namespace FieldFactory {
|
|
17
|
+
const $inject: string[];
|
|
18
|
+
}
|
|
19
|
+
export default FieldFactory;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
declare class Importer {
|
|
2
|
+
/**
|
|
3
|
+
* @constructor
|
|
4
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
5
|
+
* @param { import('./PathRegistry').default } pathRegistry
|
|
6
|
+
* @param { import('./FieldFactory').default } fieldFactory
|
|
7
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
8
|
+
*/
|
|
9
|
+
constructor(formFieldRegistry: import('./FormFieldRegistry').default, pathRegistry: import('./PathRegistry').default, fieldFactory: import('./FieldFactory').default, formLayouter: import('./FormLayouter').default);
|
|
10
|
+
_formFieldRegistry: import("./FormFieldRegistry").default;
|
|
11
|
+
_pathRegistry: import("./PathRegistry").default;
|
|
12
|
+
_fieldFactory: import("./FieldFactory").default;
|
|
13
|
+
_formLayouter: import("./FormLayouter").default;
|
|
14
|
+
/**
|
|
15
|
+
* Import schema creating rows, fields, attaching additional
|
|
16
|
+
* information to each field and adding fields to the
|
|
17
|
+
* field registry.
|
|
18
|
+
*
|
|
19
|
+
* Additional information attached:
|
|
20
|
+
*
|
|
21
|
+
* * `id` (unless present)
|
|
22
|
+
* * `_parent`
|
|
23
|
+
* * `_path`
|
|
24
|
+
*
|
|
25
|
+
* @param {any} schema
|
|
26
|
+
*
|
|
27
|
+
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
28
|
+
* @returns {ImportResult}
|
|
29
|
+
*/
|
|
30
|
+
importSchema(schema: any): {
|
|
31
|
+
warnings: Error[];
|
|
32
|
+
schema: any;
|
|
33
|
+
};
|
|
34
|
+
_cleanup(): void;
|
|
35
|
+
/**
|
|
36
|
+
* @param {{[x: string]: any}} fieldAttrs
|
|
37
|
+
* @param {String} [parentId]
|
|
38
|
+
* @param {number} [index]
|
|
39
|
+
*
|
|
40
|
+
* @return {any} field
|
|
41
|
+
*/
|
|
42
|
+
importFormField(fieldAttrs: {
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
}, parentId?: string, index?: number): any;
|
|
45
|
+
/**
|
|
46
|
+
* @param {Array<any>} components
|
|
47
|
+
* @param {string} parentId
|
|
48
|
+
*
|
|
49
|
+
* @return {Array<any>} imported components
|
|
50
|
+
*/
|
|
51
|
+
importFormFields(components: Array<any>, parentId: string): Array<any>;
|
|
52
|
+
}
|
|
53
|
+
declare namespace Importer {
|
|
54
|
+
const $inject: string[];
|
|
55
|
+
}
|
|
56
|
+
export default Importer;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The PathRegistry class manages a hierarchical structure of paths associated with form fields.
|
|
3
|
+
* It enables claiming, unclaiming, and validating paths within this structure.
|
|
4
|
+
*
|
|
5
|
+
* Example Tree Structure:
|
|
6
|
+
*
|
|
7
|
+
* [
|
|
8
|
+
* {
|
|
9
|
+
* segment: 'root',
|
|
10
|
+
* claimCount: 1,
|
|
11
|
+
* children: [
|
|
12
|
+
* {
|
|
13
|
+
* segment: 'child1',
|
|
14
|
+
* claimCount: 2,
|
|
15
|
+
* children: null // A leaf node (closed path)
|
|
16
|
+
* },
|
|
17
|
+
* {
|
|
18
|
+
* segment: 'child2',
|
|
19
|
+
* claimCount: 1,
|
|
20
|
+
* children: [
|
|
21
|
+
* {
|
|
22
|
+
* segment: 'subChild1',
|
|
23
|
+
* claimCount: 1,
|
|
24
|
+
* children: [] // An open node (open path)
|
|
25
|
+
* }
|
|
26
|
+
* ]
|
|
27
|
+
* }
|
|
28
|
+
* ]
|
|
29
|
+
* }
|
|
30
|
+
* ]
|
|
31
|
+
*/
|
|
32
|
+
declare class PathRegistry {
|
|
33
|
+
constructor(formFieldRegistry: any, formFields: any);
|
|
34
|
+
_formFieldRegistry: any;
|
|
35
|
+
_formFields: any;
|
|
36
|
+
_dataPaths: any[];
|
|
37
|
+
canClaimPath(path: any, closed?: boolean): boolean;
|
|
38
|
+
claimPath(path: any, closed?: boolean): void;
|
|
39
|
+
unclaimPath(path: any): void;
|
|
40
|
+
/**
|
|
41
|
+
* Applies a function (fn) recursively on a given field and its children.
|
|
42
|
+
*
|
|
43
|
+
* - `field`: Starting field object.
|
|
44
|
+
* - `fn`: Function to apply.
|
|
45
|
+
* - `context`: Optional object for passing data between calls.
|
|
46
|
+
*
|
|
47
|
+
* Stops early if `fn` returns `false`. Useful for traversing the form field tree.
|
|
48
|
+
*
|
|
49
|
+
* @returns {boolean} Success status based on function execution.
|
|
50
|
+
*/
|
|
51
|
+
executeRecursivelyOnFields(field: any, fn: any, context?: {}): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Generates an array representing the binding path to an underlying data object for a form field.
|
|
54
|
+
*
|
|
55
|
+
* @param {Object} field - The field object with properties: `key`, `path`, `id`, and optionally `_parent`.
|
|
56
|
+
* @param {Object} [options={}] - Configuration options.
|
|
57
|
+
* @param {Object} [options.replacements={}] - A map of field IDs to alternative path arrays.
|
|
58
|
+
* @param {Object} [options.cutoffNode] - The ID of the parent field at which to stop generating the path.
|
|
59
|
+
*
|
|
60
|
+
* @returns {(Array<string>|undefined)} An array of strings representing the binding path, or undefined if not determinable.
|
|
61
|
+
*/
|
|
62
|
+
getValuePath(field: any, options?: {
|
|
63
|
+
replacements?: any;
|
|
64
|
+
cutoffNode?: any;
|
|
65
|
+
}): (Array<string> | undefined);
|
|
66
|
+
clear(): void;
|
|
67
|
+
}
|
|
68
|
+
declare namespace PathRegistry {
|
|
69
|
+
const $inject: string[];
|
|
70
|
+
}
|
|
71
|
+
export default PathRegistry;
|
|
@@ -1,19 +1,23 @@
|
|
|
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").FormFields)[];
|
|
7
5
|
renderer: (string | typeof import("../render/Renderer").default)[];
|
|
8
|
-
}
|
|
6
|
+
}[];
|
|
9
7
|
const eventBus: (string | typeof EventBus)[];
|
|
8
|
+
const importer: (string | typeof Importer)[];
|
|
9
|
+
const fieldFactory: (string | typeof FieldFactory)[];
|
|
10
10
|
const formFieldRegistry: (string | typeof FormFieldRegistry)[];
|
|
11
|
+
const pathRegistry: (string | typeof PathRegistry)[];
|
|
11
12
|
const formLayouter: (string | typeof FormLayouter)[];
|
|
12
13
|
const validator: (string | typeof Validator)[];
|
|
13
14
|
}
|
|
14
15
|
export default _default;
|
|
16
|
+
import Importer from './Importer';
|
|
17
|
+
import FieldFactory from './FieldFactory';
|
|
15
18
|
import FormFieldRegistry from './FormFieldRegistry';
|
|
19
|
+
import PathRegistry from './PathRegistry';
|
|
16
20
|
import FormLayouter from './FormLayouter';
|
|
17
21
|
import EventBus from './EventBus';
|
|
18
22
|
import Validator from './Validator';
|
|
19
|
-
export { FormFieldRegistry, FormLayouter };
|
|
23
|
+
export { Importer, FieldFactory, FormFieldRegistry, PathRegistry, FormLayouter };
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* @property {string} [hide]
|
|
4
4
|
*/
|
|
5
5
|
declare class ConditionChecker {
|
|
6
|
-
constructor(formFieldRegistry: any, eventBus: any);
|
|
6
|
+
constructor(formFieldRegistry: any, pathRegistry: any, eventBus: any);
|
|
7
7
|
_formFieldRegistry: any;
|
|
8
|
+
_pathRegistry: any;
|
|
8
9
|
_eventBus: any;
|
|
9
10
|
/**
|
|
10
11
|
* For given data, remove properties based on condition.
|
|
@@ -38,7 +39,7 @@ declare class ConditionChecker {
|
|
|
38
39
|
_checkHideCondition(condition: Condition, data: {
|
|
39
40
|
[x: string]: any;
|
|
40
41
|
}): boolean;
|
|
41
|
-
|
|
42
|
+
_clearObjectValueRecursively(valuePath: any, obj: any): void;
|
|
42
43
|
}
|
|
43
44
|
declare namespace ConditionChecker {
|
|
44
45
|
const $inject: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function getFlavouredFeelVariableNames(feelString: any, feelFlavour
|
|
1
|
+
export function getFlavouredFeelVariableNames(feelString: any, feelFlavour?: string, options?: {}): any[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { default as ExpressionLanguageModule } from "./expression-language";
|
|
2
2
|
export { default as MarkdownModule } from "./markdown";
|
|
3
|
+
export { default as ViewerCommandsModule } from "./viewerCommands";
|
|
3
4
|
export * from "./expression-language";
|
|
4
5
|
export * from "./markdown";
|
|
6
|
+
export * from "./viewerCommands";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare class ViewerCommands {
|
|
2
|
+
constructor(commandStack: any, eventBus: any);
|
|
3
|
+
_commandStack: any;
|
|
4
|
+
registerHandlers(): void;
|
|
5
|
+
getHandlers(): {
|
|
6
|
+
'formField.validation.update': typeof UpdateFieldValidationHandler;
|
|
7
|
+
};
|
|
8
|
+
updateFieldValidation(field: any, value: any): void;
|
|
9
|
+
}
|
|
10
|
+
declare namespace ViewerCommands {
|
|
11
|
+
const $inject: string[];
|
|
12
|
+
}
|
|
13
|
+
export default ViewerCommands;
|
|
14
|
+
import UpdateFieldValidationHandler from './cmd/UpdateFieldValidationHandler';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare class UpdateFieldValidationHandler {
|
|
2
|
+
constructor(form: any, validator: any);
|
|
3
|
+
_form: any;
|
|
4
|
+
_validator: any;
|
|
5
|
+
execute(context: any): void;
|
|
6
|
+
revert(context: any): void;
|
|
7
|
+
}
|
|
8
|
+
declare namespace UpdateFieldValidationHandler {
|
|
9
|
+
const $inject: string[];
|
|
10
|
+
}
|
|
11
|
+
export default UpdateFieldValidationHandler;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
const __depends__: import("didi").ModuleDeclaration[];
|
|
3
|
+
const __init__: string[];
|
|
4
|
+
const viewerCommands: (string | typeof ViewerCommands)[];
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
export { ViewerCommands };
|
|
8
|
+
import ViewerCommands from './ViewerCommands';
|
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: 11;
|
|
18
18
|
export { Form };
|
|
19
|
-
export { FormFieldRegistry, FormLayouter } from "./core";
|
|
19
|
+
export { FormFieldRegistry, FormLayouter, Importer, FieldFactory, PathRegistry } from "./core";
|
|
@@ -7,14 +7,10 @@ declare namespace Checklist {
|
|
|
7
7
|
export const group: string;
|
|
8
8
|
export const emptyValue: any[];
|
|
9
9
|
export { sanitizeMultiSelectValue as sanitizeValue };
|
|
10
|
-
export
|
|
11
|
-
values: {
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
15
|
-
};
|
|
10
|
+
export { createEmptyOptions as create };
|
|
16
11
|
}
|
|
17
12
|
}
|
|
18
13
|
export default Checklist;
|
|
19
14
|
declare const type: "checklist";
|
|
20
15
|
import { sanitizeMultiSelectValue } from '../util/sanitizerUtil';
|
|
16
|
+
import { createEmptyOptions } from '../util/valuesUtil';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
declare namespace
|
|
1
|
+
declare function FormComponent(props: any): import("preact").JSX.Element;
|
|
2
|
+
declare namespace FormComponent {
|
|
3
3
|
namespace config {
|
|
4
4
|
const type: string;
|
|
5
5
|
const keyed: boolean;
|
|
@@ -10,4 +10,4 @@ declare namespace Default {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
export default
|
|
13
|
+
export default FormComponent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare function Group(props: any): import("preact").JSX.Element;
|
|
2
|
+
declare namespace Group {
|
|
3
|
+
namespace config {
|
|
4
|
+
const type: string;
|
|
5
|
+
const pathed: boolean;
|
|
6
|
+
const label: string;
|
|
7
|
+
const group: string;
|
|
8
|
+
function create(options?: {}): {
|
|
9
|
+
components: any[];
|
|
10
|
+
showOutline: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export default Group;
|
|
@@ -7,14 +7,10 @@ declare namespace Radio {
|
|
|
7
7
|
export const group: string;
|
|
8
8
|
export const emptyValue: any;
|
|
9
9
|
export { sanitizeSingleSelectValue as sanitizeValue };
|
|
10
|
-
export
|
|
11
|
-
values: {
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
15
|
-
};
|
|
10
|
+
export { createEmptyOptions as create };
|
|
16
11
|
}
|
|
17
12
|
}
|
|
18
13
|
export default Radio;
|
|
19
14
|
declare const type: "radio";
|
|
20
15
|
import { sanitizeSingleSelectValue } from '../util/sanitizerUtil';
|
|
16
|
+
import { createEmptyOptions } from '../util/valuesUtil';
|
|
@@ -7,14 +7,10 @@ declare namespace Select {
|
|
|
7
7
|
export const group: string;
|
|
8
8
|
export const emptyValue: any;
|
|
9
9
|
export { sanitizeSingleSelectValue as sanitizeValue };
|
|
10
|
-
export
|
|
11
|
-
values: {
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
15
|
-
};
|
|
10
|
+
export { createEmptyOptions as create };
|
|
16
11
|
}
|
|
17
12
|
}
|
|
18
13
|
export default Select;
|
|
19
14
|
declare const type: "select";
|
|
20
15
|
import { sanitizeSingleSelectValue } from '../util/sanitizerUtil';
|
|
16
|
+
import { createEmptyOptions } from '../util/valuesUtil';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare function Spacer(props: any): import("preact").JSX.Element;
|
|
2
|
+
declare namespace Spacer {
|
|
3
|
+
namespace config {
|
|
4
|
+
export { type };
|
|
5
|
+
export const keyed: boolean;
|
|
6
|
+
export const label: string;
|
|
7
|
+
export const group: string;
|
|
8
|
+
export function create(options?: {}): {
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export default Spacer;
|
|
14
|
+
declare const type: "spacer";
|
|
@@ -7,14 +7,10 @@ declare namespace Taglist {
|
|
|
7
7
|
export const group: string;
|
|
8
8
|
export const emptyValue: any[];
|
|
9
9
|
export { sanitizeMultiSelectValue as sanitizeValue };
|
|
10
|
-
export
|
|
11
|
-
values: {
|
|
12
|
-
label: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}[];
|
|
15
|
-
};
|
|
10
|
+
export { createEmptyOptions as create };
|
|
16
11
|
}
|
|
17
12
|
}
|
|
18
13
|
export default Taglist;
|
|
19
14
|
declare const type: "taglist";
|
|
20
15
|
import { sanitizeMultiSelectValue } from '../util/sanitizerUtil';
|
|
16
|
+
import { createEmptyOptions } from '../util/valuesUtil';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Grid(props: any): import("preact").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const formFields: (typeof Default | typeof Image)[];
|
|
1
|
+
export const formFields: (typeof Default | typeof Group | typeof Image)[];
|
|
2
2
|
export * from "./icons";
|
|
3
3
|
import Button from './form-fields/Button';
|
|
4
4
|
import Checkbox from './form-fields/Checkbox';
|
|
@@ -6,12 +6,14 @@ import Checklist from './form-fields/Checklist';
|
|
|
6
6
|
import Default from './form-fields/Default';
|
|
7
7
|
import Datetime from './form-fields/Datetime';
|
|
8
8
|
import FormComponent from './FormComponent';
|
|
9
|
+
import Group from './form-fields/Group';
|
|
9
10
|
import Image from './form-fields/Image';
|
|
10
11
|
import Numberfield from './form-fields/Number';
|
|
11
12
|
import Radio from './form-fields/Radio';
|
|
12
13
|
import Select from './form-fields/Select';
|
|
14
|
+
import Spacer from './form-fields/Spacer';
|
|
13
15
|
import Taglist from './form-fields/Taglist';
|
|
14
16
|
import Text from './form-fields/Text';
|
|
15
17
|
import Textfield from './form-fields/Textfield';
|
|
16
18
|
import Textarea from './form-fields/Textarea';
|
|
17
|
-
export { Button, Checkbox, Checklist, Default, Datetime, FormComponent, Image, Numberfield, Radio, Select, Taglist, Text, Textfield, Textarea };
|
|
19
|
+
export { Button, Checkbox, Checklist, Default, Datetime, FormComponent, Group, Image, Numberfield, Radio, Select, Spacer, Taglist, Text, Textfield, Textarea };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns date format for the provided locale.
|
|
3
|
+
* If the locale is not provided, uses the browser's locale.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} [locale] - The locale to get date format for.
|
|
6
|
+
* @returns {string} The date format for the locale.
|
|
7
|
+
*/
|
|
8
|
+
export function getLocaleDateFormat(locale?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns readable date format for the provided locale.
|
|
11
|
+
* If the locale is not provided, uses the browser's locale.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} [locale] - The locale to get readable date format for.
|
|
14
|
+
* @returns {string} The readable date format for the locale.
|
|
15
|
+
*/
|
|
16
|
+
export function getLocaleReadableDateFormat(locale?: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Returns flatpickr config for the provided locale.
|
|
19
|
+
* If the locale is not provided, uses the browser's locale.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} [locale] - The locale to get flatpickr config for.
|
|
22
|
+
* @returns {object} The flatpickr config for the locale.
|
|
23
|
+
*/
|
|
24
|
+
export function getLocaleDateFlatpickrConfig(locale?: string): object;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export default FormRenderContext;
|
|
2
2
|
declare const FormRenderContext: import("preact").Context<{
|
|
3
|
+
EmptyRoot: (props: any) => any;
|
|
3
4
|
Empty: (props: any) => any;
|
|
4
5
|
Children: (props: any) => import("preact").JSX.Element;
|
|
5
6
|
Element: (props: any) => import("preact").JSX.Element;
|
|
6
7
|
Row: (props: any) => import("preact").JSX.Element;
|
|
7
8
|
Column: (props: any) => any;
|
|
9
|
+
hoveredId: any[];
|
|
10
|
+
setHoveredId: (newValue: any) => void;
|
|
8
11
|
}>;
|
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
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
export function findErrors(errors: any, path: any): any;
|
|
2
1
|
export function isRequired(field: any): any;
|
|
3
2
|
export function pathParse(path: any): any;
|
|
4
3
|
export function pathsEqual(a: any, b: any): any;
|
|
5
|
-
export function pathStringify(path: any): any;
|
|
6
4
|
export function generateIndexForType(type: any): any;
|
|
7
5
|
export function generateIdForType(type: any): string;
|
|
8
6
|
/**
|
|
@@ -19,9 +17,8 @@ export function clone<T>(data: T, replacer?: (this: any, key: string, value: any
|
|
|
19
17
|
*
|
|
20
18
|
* @return {string[]}
|
|
21
19
|
*/
|
|
22
|
-
export function getSchemaVariables(schema: any,
|
|
20
|
+
export function getSchemaVariables(schema: any, options?: {}): string[];
|
|
21
|
+
export function runRecursively(formField: any, fn: any): void;
|
|
23
22
|
export * from "./constants";
|
|
24
23
|
export * from "./injector";
|
|
25
24
|
export * from "./form";
|
|
26
|
-
import FeelExpressionLanguage from '../features/expression-language/FeelExpressionLanguage.js';
|
|
27
|
-
import FeelersTemplating from '../features/expression-language/FeelersTemplating.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpmn-io/form-js-viewer",
|
|
3
|
-
"version": "1.0.0",
|
|
3
|
+
"version": "1.3.0-alpha.0",
|
|
4
4
|
"description": "View forms - powered by bpmn.io",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"all": "run-s test build",
|
|
23
23
|
"build": "run-p bundle bundle:scss generate-types",
|
|
24
24
|
"start": "SINGLE_START=basic npm run dev",
|
|
25
|
+
"start:groups": "SINGLE_START=groups npm run dev",
|
|
25
26
|
"bundle": "rollup -c --failAfterWarnings --bundleConfigAsCjs",
|
|
26
27
|
"bundle:scss": "sass --no-source-map --load-path=\"../../node_modules\" assets/index.scss dist/assets/form-js.css",
|
|
27
28
|
"bundle:watch": "run-p bundle:watch-js bundle:watch-scss",
|
|
@@ -47,8 +48,8 @@
|
|
|
47
48
|
"big.js": "^6.2.1",
|
|
48
49
|
"classnames": "^2.3.1",
|
|
49
50
|
"didi": "^9.0.0",
|
|
50
|
-
"feelers": "^0.1.0
|
|
51
|
-
"feelin": "^0.
|
|
51
|
+
"feelers": "^0.1.0",
|
|
52
|
+
"feelin": "^1.0.0",
|
|
52
53
|
"flatpickr": "^4.6.13",
|
|
53
54
|
"ids": "^1.0.0",
|
|
54
55
|
"min-dash": "^4.0.0",
|
|
@@ -62,5 +63,5 @@
|
|
|
62
63
|
"files": [
|
|
63
64
|
"dist"
|
|
64
65
|
],
|
|
65
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "dd5504e512c13945767159900dc8cf884834b937"
|
|
66
67
|
}
|