@bpmn-io/form-js-viewer 1.10.1 → 1.11.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 (33) hide show
  1. package/dist/assets/form-js-base.css +22 -3
  2. package/dist/assets/form-js.css +22 -3
  3. package/dist/index.cjs +409 -185
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.es.js +409 -186
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/types/core/FieldFactory.d.ts +1 -1
  8. package/dist/types/index.d.ts +1 -1
  9. package/dist/types/render/components/Util.d.ts +1 -0
  10. package/dist/types/render/components/form-fields/Button.d.ts +2 -1
  11. package/dist/types/render/components/form-fields/Checkbox.d.ts +4 -2
  12. package/dist/types/render/components/form-fields/Checklist.d.ts +2 -3
  13. package/dist/types/render/components/form-fields/Datetime.d.ts +3 -2
  14. package/dist/types/render/components/form-fields/Default.d.ts +1 -0
  15. package/dist/types/render/components/form-fields/DynamicList.d.ts +2 -1
  16. package/dist/types/render/components/form-fields/ExpressionField.d.ts +1 -1
  17. package/dist/types/render/components/form-fields/FilePicker.d.ts +47 -0
  18. package/dist/types/render/components/form-fields/Group.d.ts +2 -1
  19. package/dist/types/render/components/form-fields/Html.d.ts +1 -1
  20. package/dist/types/render/components/form-fields/IFrame.d.ts +2 -1
  21. package/dist/types/render/components/form-fields/Image.d.ts +2 -1
  22. package/dist/types/render/components/form-fields/Number.d.ts +4 -2
  23. package/dist/types/render/components/form-fields/Radio.d.ts +2 -3
  24. package/dist/types/render/components/form-fields/Select.d.ts +2 -3
  25. package/dist/types/render/components/form-fields/Separator.d.ts +1 -1
  26. package/dist/types/render/components/form-fields/Spacer.d.ts +1 -1
  27. package/dist/types/render/components/form-fields/Table.d.ts +2 -1
  28. package/dist/types/render/components/form-fields/Taglist.d.ts +2 -3
  29. package/dist/types/render/components/form-fields/Text.d.ts +2 -1
  30. package/dist/types/render/components/form-fields/Textarea.d.ts +4 -2
  31. package/dist/types/render/components/form-fields/Textfield.d.ts +4 -2
  32. package/dist/types/render/components/index.d.ts +3 -2
  33. package/package.json +5 -5
@@ -9,7 +9,7 @@ export class FieldFactory {
9
9
  _formFieldRegistry: any;
10
10
  _pathRegistry: any;
11
11
  _formFields: any;
12
- create(attrs: any, applyDefaults?: boolean): any;
12
+ create(attrs: any, isNewField?: boolean): any;
13
13
  _ensureId(field: any): void;
14
14
  _ensureKey(field: any): void;
15
15
  _enforceDefaultPath(field: any): void;
@@ -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: 16;
17
+ export const schemaVersion: 17;
18
18
  export { Form };
19
19
  export { FormFieldRegistry, FormLayouter, Importer, FieldFactory, PathRegistry } from "./core";
@@ -4,4 +4,5 @@ export function formFieldClasses(type: any, { errors, disabled, readonly }?: {
4
4
  readonly?: boolean;
5
5
  }): string;
6
6
  export function gridColumnClasses(formField: any): string;
7
+ export function textToLabel(text: any): string;
7
8
  export function prefixId(id: any, formId: any, indexes: any): string;
@@ -3,9 +3,10 @@ export namespace Button {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export function create(options?: {}): {
9
+ label: string;
9
10
  action: string;
10
11
  };
11
12
  }
@@ -3,13 +3,15 @@ export namespace Checkbox {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: boolean;
9
9
  export function sanitizeValue({ value }: {
10
10
  value: any;
11
11
  }): boolean;
12
- export function create(options?: {}): {};
12
+ export function create(options?: {}): {
13
+ label: string;
14
+ };
13
15
  }
14
16
  }
15
17
  declare const type: "checkbox";
@@ -3,14 +3,13 @@ export namespace Checklist {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: any[];
9
9
  export { sanitizeMultiSelectValue as sanitizeValue };
10
- export { createEmptyOptions as create };
10
+ export function create(options?: {}): any;
11
11
  }
12
12
  }
13
13
  declare const type: "checklist";
14
14
  import { sanitizeMultiSelectValue } from '../util/sanitizerUtil';
15
- import { createEmptyOptions } from '../util/optionsUtil';
16
15
  export {};
@@ -3,11 +3,12 @@ export namespace Datetime {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: any;
9
9
  export { sanitizeDateTimePickerValue as sanitizeValue };
10
- export function create(options?: {}): {};
10
+ export function create(options: {}, isNewField: any): {};
11
+ export function getSubheading(field: any): any;
11
12
  }
12
13
  }
13
14
  declare const type: "datetime";
@@ -8,5 +8,6 @@ export namespace Default {
8
8
  function create(options?: {}): {
9
9
  components: any[];
10
10
  };
11
+ function getSubheading(field: any): any;
11
12
  }
12
13
  }
@@ -4,9 +4,10 @@ export namespace DynamicList {
4
4
  let type: string;
5
5
  let pathed: boolean;
6
6
  let repeatable: boolean;
7
- let label: string;
7
+ let name: string;
8
8
  let group: string;
9
9
  function create(options?: {}): {
10
+ label: string;
10
11
  components: any[];
11
12
  showOutline: boolean;
12
13
  isRepeating: boolean;
@@ -2,7 +2,7 @@ export function ExpressionField(props: any): any;
2
2
  export namespace ExpressionField {
3
3
  namespace config {
4
4
  export { type };
5
- export let label: string;
5
+ export let name: string;
6
6
  export let group: string;
7
7
  export let keyed: boolean;
8
8
  export let emptyValue: any;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @typedef Props
3
+ * @property {(props: { value: string }) => void} onChange
4
+ * @property {string} domId
5
+ * @property {string[]} errors
6
+ * @property {boolean} disabled
7
+ * @property {boolean} readonly
8
+ * @property {boolean} required
9
+ * @property {Object} field
10
+ * @property {string} field.id
11
+ * @property {string} [field.label]
12
+ * @property {string} [field.accept]
13
+ * @property {boolean} [field.multiple]
14
+ *
15
+ * @param {Props} props
16
+ * @returns {import("preact").JSX.Element}
17
+ */
18
+ export function FilePicker(props: Props): import("preact").JSX.Element;
19
+ export namespace FilePicker {
20
+ namespace config {
21
+ let type: string;
22
+ let keyed: boolean;
23
+ let label: string;
24
+ let group: string;
25
+ let emptyValue: any;
26
+ function sanitizeValue({ value }: {
27
+ value: any;
28
+ }): any;
29
+ function create(options?: {}): {};
30
+ }
31
+ }
32
+ export type Props = {
33
+ onChange: (props: {
34
+ value: string;
35
+ }) => void;
36
+ domId: string;
37
+ errors: string[];
38
+ disabled: boolean;
39
+ readonly: boolean;
40
+ required: boolean;
41
+ field: {
42
+ id: string;
43
+ label?: string;
44
+ accept?: string;
45
+ multiple?: boolean;
46
+ };
47
+ };
@@ -3,9 +3,10 @@ export namespace Group {
3
3
  namespace config {
4
4
  let type: string;
5
5
  let pathed: boolean;
6
- let label: string;
6
+ let name: string;
7
7
  let group: string;
8
8
  function create(options?: {}): {
9
+ label: string;
9
10
  components: any[];
10
11
  showOutline: boolean;
11
12
  };
@@ -3,7 +3,7 @@ export namespace Html {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export function create(options?: {}): {
9
9
  content: string;
@@ -3,9 +3,10 @@ export namespace IFrame {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export function create(options?: {}): {
9
+ label: string;
9
10
  security: {
10
11
  allowScripts: boolean;
11
12
  };
@@ -3,9 +3,10 @@ export namespace Image {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export function create(options?: {}): {};
9
+ export function getSubheading(field: any): any;
9
10
  }
10
11
  }
11
12
  declare const type: "image";
@@ -3,14 +3,16 @@ export namespace Numberfield {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: any;
9
9
  export function sanitizeValue({ value, formField }: {
10
10
  value: any;
11
11
  formField: any;
12
12
  }): any;
13
- export function create(options?: {}): {};
13
+ export function create(options?: {}): {
14
+ label: string;
15
+ };
14
16
  }
15
17
  }
16
18
  declare const type: "number";
@@ -3,14 +3,13 @@ export namespace Radio {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: any;
9
9
  export { sanitizeSingleSelectValue as sanitizeValue };
10
- export { createEmptyOptions as create };
10
+ export function create(options?: {}): any;
11
11
  }
12
12
  }
13
13
  declare const type: "radio";
14
14
  import { sanitizeSingleSelectValue } from '../util/sanitizerUtil';
15
- import { createEmptyOptions } from '../util/optionsUtil';
16
15
  export {};
@@ -3,14 +3,13 @@ export namespace Select {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: any;
9
9
  export { sanitizeSingleSelectValue as sanitizeValue };
10
- export { createEmptyOptions as create };
10
+ export function create(options?: {}): any;
11
11
  }
12
12
  }
13
13
  declare const type: "select";
14
14
  import { sanitizeSingleSelectValue } from '../util/sanitizerUtil';
15
- import { createEmptyOptions } from '../util/optionsUtil';
16
15
  export {};
@@ -3,7 +3,7 @@ export namespace Separator {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export function create(options?: {}): {};
9
9
  }
@@ -3,7 +3,7 @@ export namespace Spacer {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export function create(options?: {}): {
9
9
  height: number;
@@ -28,7 +28,7 @@ export namespace Table {
28
28
  namespace config {
29
29
  export { type };
30
30
  export let keyed: boolean;
31
- export let label: string;
31
+ export let name: string;
32
32
  export let group: string;
33
33
  export function create(options?: {}): {
34
34
  id: any;
@@ -37,6 +37,7 @@ export namespace Table {
37
37
  id: any;
38
38
  columns: Column[];
39
39
  } | {
40
+ label: string;
40
41
  rowCount: number;
41
42
  columns: {
42
43
  label: string;
@@ -3,14 +3,13 @@ export namespace Taglist {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: any[];
9
9
  export { sanitizeMultiSelectValue as sanitizeValue };
10
- export { createEmptyOptions as create };
10
+ export function create(options?: {}): any;
11
11
  }
12
12
  }
13
13
  declare const type: "taglist";
14
14
  import { sanitizeMultiSelectValue } from '../util/sanitizerUtil';
15
- import { createEmptyOptions } from '../util/optionsUtil';
16
15
  export {};
@@ -3,11 +3,12 @@ export namespace Text {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export function create(options?: {}): {
9
9
  text: string;
10
10
  };
11
+ export function getSubheading(field: any): void;
11
12
  }
12
13
  }
13
14
  declare const type: "text";
@@ -3,13 +3,15 @@ export namespace Textarea {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: string;
9
9
  export function sanitizeValue({ value }: {
10
10
  value: any;
11
11
  }): string;
12
- export function create(options?: {}): {};
12
+ export function create(options?: {}): {
13
+ label: string;
14
+ };
13
15
  }
14
16
  }
15
17
  declare const type: "textarea";
@@ -3,13 +3,15 @@ export namespace Textfield {
3
3
  namespace config {
4
4
  export { type };
5
5
  export let keyed: boolean;
6
- export let label: string;
6
+ export let name: string;
7
7
  export let group: string;
8
8
  export let emptyValue: string;
9
9
  export function sanitizeValue({ value }: {
10
10
  value: any;
11
11
  }): string;
12
- export function create(options?: {}): {};
12
+ export function create(options?: {}): {
13
+ label: string;
14
+ };
13
15
  }
14
16
  }
15
17
  declare const type: "textfield";
@@ -1,4 +1,4 @@
1
- export const formFields: (typeof Default | typeof Group | typeof Image | typeof Radio | typeof ExpressionField)[];
1
+ export const formFields: (typeof Button | typeof Default | typeof Datetime | typeof Group | typeof IFrame | typeof Image | typeof Radio | typeof Separator | typeof Spacer | typeof Html | typeof ExpressionField | typeof Table | typeof FilePicker)[];
2
2
  export * from "./icons";
3
3
  export * from "./Sanitizer";
4
4
  export * from "./util/domUtil";
@@ -29,4 +29,5 @@ import { Html } from './form-fields/Html';
29
29
  import { Textfield } from './form-fields/Textfield';
30
30
  import { Textarea } from './form-fields/Textarea';
31
31
  import { Table } from './form-fields/Table';
32
- export { Label, Description, Errors, Button, Checkbox, Checklist, Default, Datetime, FormComponent, FormField, Group, IFrame, DynamicList, Image, Numberfield, ExpressionField, Radio, Select, Separator, Spacer, Taglist, Text, Html, Textfield, Textarea, Table };
32
+ import { FilePicker } from './form-fields/FilePicker';
33
+ export { Label, Description, Errors, Button, Checkbox, Checklist, Default, Datetime, FormComponent, FormField, Group, IFrame, DynamicList, Image, Numberfield, ExpressionField, Radio, Select, Separator, Spacer, Taglist, Text, Html, Textfield, Textarea, Table, FilePicker };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-viewer",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "description": "View forms - powered by bpmn.io",
5
5
  "exports": {
6
6
  ".": {
@@ -45,8 +45,8 @@
45
45
  "url": "https://github.com/bpmn-io"
46
46
  },
47
47
  "dependencies": {
48
- "@carbon/grid": "^11.26.0",
49
- "big.js": "^6.2.1",
48
+ "@carbon/grid": "^11.27.0",
49
+ "big.js": "^6.2.2",
50
50
  "classnames": "^2.5.1",
51
51
  "didi": "^10.2.2",
52
52
  "dompurify": "^3.1.6",
@@ -57,7 +57,7 @@
57
57
  "lodash": "^4.17.21",
58
58
  "luxon": "^3.5.0",
59
59
  "marked": "^14.1.2",
60
- "min-dash": "^4.2.1",
60
+ "min-dash": "^4.2.2",
61
61
  "preact": "^10.5.14"
62
62
  },
63
63
  "sideEffects": [
@@ -66,5 +66,5 @@
66
66
  "files": [
67
67
  "dist"
68
68
  ],
69
- "gitHead": "4bc566fc163797bfce5df7d6544f271e4d44e1e2"
69
+ "gitHead": "d1731fe95e832b1408564d14dc6d4a139a6a90ab"
70
70
  }