@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
package/LICENSE
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
Copyright (c) 2021-present Camunda Services GmbH
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
-
this software and associated documentation files (the "Software"), to deal in the
|
|
5
|
-
Software without restriction, including without limitation the rights to use, copy,
|
|
6
|
-
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
|
7
|
-
and to permit persons to whom the Software is furnished to do so, subject to the
|
|
8
|
-
following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
|
11
|
-
copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
The source code responsible for displaying the bpmn.io project watermark that
|
|
14
|
-
links back to https://bpmn.io as part of rendered diagrams MUST NOT be
|
|
15
|
-
removed or changed. When this software is being used in a website or application,
|
|
16
|
-
the watermark must stay fully visible and not visually overlapped by other elements.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
19
|
-
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
20
|
-
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
21
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
22
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
|
1
|
+
Copyright (c) 2021-present Camunda Services GmbH
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in the
|
|
5
|
+
Software without restriction, including without limitation the rights to use, copy,
|
|
6
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
|
7
|
+
and to permit persons to whom the Software is furnished to do so, subject to the
|
|
8
|
+
following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
The source code responsible for displaying the bpmn.io project watermark that
|
|
14
|
+
links back to https://bpmn.io as part of rendered diagrams MUST NOT be
|
|
15
|
+
removed or changed. When this software is being used in a website or application,
|
|
16
|
+
the watermark must stay fully visible and not visually overlapped by other elements.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
19
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
20
|
+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
21
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
22
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
|
23
23
|
OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
# @bpmn-io/form-js-editor
|
|
2
|
-
|
|
3
|
-
An editor to create forms that can be displayed with the [form-js viewer](../form-js-viewer).
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
```
|
|
9
|
-
npm install @bpmn-io/form-js-editor
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```javascript
|
|
16
|
-
import { FormEditor } from '@bpmn-io/form-js-editor';
|
|
17
|
-
|
|
18
|
-
const schema = {
|
|
19
|
-
components: [
|
|
20
|
-
{
|
|
21
|
-
key: 'creditor',
|
|
22
|
-
label: 'Creditor',
|
|
23
|
-
type: 'textfield',
|
|
24
|
-
validate: {
|
|
25
|
-
required: true
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const formEditor = new FormEditor({
|
|
32
|
-
container: document.querySelector('#form-editor')
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
await formEditor.importSchema(schema);
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Check out [a full example](https://github.com/bpmn-io/form-js-examples).
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## Styling
|
|
42
|
-
|
|
43
|
-
For proper styling include the necessary stylesheets, and font used:
|
|
44
|
-
|
|
45
|
-
```html
|
|
46
|
-
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet">
|
|
47
|
-
|
|
48
|
-
<link rel="stylesheet" href="https://unpkg.com/@bpmn-io/form-js@0.10.0/dist/assets/form-js.css">
|
|
49
|
-
<link rel="stylesheet" href="https://unpkg.com/@bpmn-io/form-js@0.10.0/dist/assets/form-js-editor.css">
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## API
|
|
54
|
-
|
|
55
|
-
### `FormEditor`
|
|
56
|
-
|
|
57
|
-
Create a new form editor with options `{ container?: HTMLElement }`.
|
|
58
|
-
|
|
59
|
-
```javascript
|
|
60
|
-
import { FormEditor } from '@bpmn-io/form-js-editor';
|
|
61
|
-
|
|
62
|
-
const formEditor = new FormEditor({
|
|
63
|
-
container: document.querySelector('#form-editor')
|
|
64
|
-
});
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
### `FormEditor#importSchema(schema: Schema) => Promise<Result, Error>`
|
|
69
|
-
|
|
70
|
-
Display and edit a form represented via a form schema.
|
|
71
|
-
|
|
72
|
-
```javascript
|
|
73
|
-
try {
|
|
74
|
-
await formEditor.importSchema(schema);
|
|
75
|
-
} catch (err) {
|
|
76
|
-
console.log('importing form failed', err);
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### `FormEditor#saveSchema() => Schema`
|
|
82
|
-
|
|
83
|
-
Export the form schema.
|
|
84
|
-
|
|
85
|
-
```javascript
|
|
86
|
-
const schema = formEditor.saveSchema(schema);
|
|
87
|
-
|
|
88
|
-
console.log('exported schema', schema);
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
### `FormEditor#attachTo(parentNode: HTMLElement) => void`
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
Attach the form editor to a parent node.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
### `FormEditor#detach() => void`
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Detach the form editor from its parent node.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
### `FormEditor#on(event, fn) => void`
|
|
105
|
-
|
|
106
|
-
Subscribe to an [event](#events).
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
### `FormEditor#destroy() => void`
|
|
110
|
-
|
|
111
|
-
Remove form from editor the document.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
## License
|
|
115
|
-
|
|
116
|
-
Use under the terms of the [bpmn.io license](http://bpmn.io/license).
|
|
1
|
+
# @bpmn-io/form-js-editor
|
|
2
|
+
|
|
3
|
+
An editor to create forms that can be displayed with the [form-js viewer](../form-js-viewer).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
npm install @bpmn-io/form-js-editor
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
import { FormEditor } from '@bpmn-io/form-js-editor';
|
|
17
|
+
|
|
18
|
+
const schema = {
|
|
19
|
+
components: [
|
|
20
|
+
{
|
|
21
|
+
key: 'creditor',
|
|
22
|
+
label: 'Creditor',
|
|
23
|
+
type: 'textfield',
|
|
24
|
+
validate: {
|
|
25
|
+
required: true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const formEditor = new FormEditor({
|
|
32
|
+
container: document.querySelector('#form-editor')
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
await formEditor.importSchema(schema);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Check out [a full example](https://github.com/bpmn-io/form-js-examples).
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Styling
|
|
42
|
+
|
|
43
|
+
For proper styling include the necessary stylesheets, and font used:
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet">
|
|
47
|
+
|
|
48
|
+
<link rel="stylesheet" href="https://unpkg.com/@bpmn-io/form-js@0.10.0/dist/assets/form-js.css">
|
|
49
|
+
<link rel="stylesheet" href="https://unpkg.com/@bpmn-io/form-js@0.10.0/dist/assets/form-js-editor.css">
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## API
|
|
54
|
+
|
|
55
|
+
### `FormEditor`
|
|
56
|
+
|
|
57
|
+
Create a new form editor with options `{ container?: HTMLElement }`.
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
import { FormEditor } from '@bpmn-io/form-js-editor';
|
|
61
|
+
|
|
62
|
+
const formEditor = new FormEditor({
|
|
63
|
+
container: document.querySelector('#form-editor')
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### `FormEditor#importSchema(schema: Schema) => Promise<Result, Error>`
|
|
69
|
+
|
|
70
|
+
Display and edit a form represented via a form schema.
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
73
|
+
try {
|
|
74
|
+
await formEditor.importSchema(schema);
|
|
75
|
+
} catch (err) {
|
|
76
|
+
console.log('importing form failed', err);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### `FormEditor#saveSchema() => Schema`
|
|
82
|
+
|
|
83
|
+
Export the form schema.
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
const schema = formEditor.saveSchema(schema);
|
|
87
|
+
|
|
88
|
+
console.log('exported schema', schema);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
### `FormEditor#attachTo(parentNode: HTMLElement) => void`
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
Attach the form editor to a parent node.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### `FormEditor#detach() => void`
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
Detach the form editor from its parent node.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### `FormEditor#on(event, fn) => void`
|
|
105
|
+
|
|
106
|
+
Subscribe to an [event](#events).
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### `FormEditor#destroy() => void`
|
|
110
|
+
|
|
111
|
+
Remove form from editor the document.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
Use under the terms of the [bpmn.io license](http://bpmn.io/license).
|