@bpmn-io/form-js-viewer 0.7.1 → 0.8.0-alpha.1

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.
@@ -27,8 +27,8 @@ export default class Form {
27
27
  * @type {State}
28
28
  */
29
29
  private _state;
30
- get: any;
31
- invoke: any;
30
+ get: <T>(name: string, strict?: boolean) => T;
31
+ invoke: <T_1>(func: (...args: unknown[]) => T_1, context: unknown, locals: import("didi").LocalsMap) => T_1;
32
32
  clear(): void;
33
33
  /**
34
34
  * Destroy the form, removing it from DOM,
@@ -116,7 +116,7 @@ export default class Form {
116
116
  */
117
117
  _onEvent(type: any, priority: any, handler: any): void;
118
118
  }
119
- export type Injector = any;
119
+ export type Injector = import('./types').Injector;
120
120
  export type Data = import('./types').Data;
121
121
  export type Errors = import('./types').Errors;
122
122
  export type Schema = import('./types').Schema;
@@ -14,5 +14,5 @@ export * from "./render";
14
14
  export * from "./util";
15
15
  export type CreateFormOptions = import('./types').CreateFormOptions;
16
16
  import Form from "./Form";
17
- export const schemaVersion: 4;
17
+ export const schemaVersion: 5;
18
18
  export { Form };
@@ -10,7 +10,7 @@
10
10
  * @param {Form} form
11
11
  * @param {Injector} injector
12
12
  */
13
- declare function Renderer(config: Config, eventBus: any, form: Form, injector: any): void;
13
+ declare function Renderer(config: Config, eventBus: any, form: Form, injector: Injector): void;
14
14
  declare namespace Renderer {
15
15
  const $inject: string[];
16
16
  }
@@ -18,6 +18,6 @@ export default Renderer;
18
18
  export type Config = {
19
19
  container;
20
20
  };
21
- export type Injector = any;
21
+ export type Injector = import('didi').Injector;
22
22
  export type EventBus = any;
23
23
  export type Form = import('../Form').default;
@@ -2,3 +2,5 @@ export function formFieldClasses(type: any, errors?: any[]): string;
2
2
  export function prefixId(id: any, formId: any): string;
3
3
  export function markdownToHTML(markdown: any): any;
4
4
  export function safeMarkdown(markdown: any): string;
5
+ export function sanitizeSingleSelectValue(options: any): any;
6
+ export function sanitizeMultiSelectValue(options: any): any;
@@ -5,6 +5,9 @@ declare namespace Checkbox {
5
5
  export const label: string;
6
6
  export const keyed: boolean;
7
7
  export const emptyValue: boolean;
8
+ export function sanitizeValue({ value }: {
9
+ value: any;
10
+ }): boolean;
8
11
  }
9
12
  export default Checkbox;
10
13
  declare const type: "checkbox";
@@ -0,0 +1,12 @@
1
+ declare function Checklist(props: any): import("preact").JSX.Element;
2
+ declare namespace Checklist {
3
+ export function create(options?: {}): {};
4
+ export { type };
5
+ export const label: string;
6
+ export const keyed: boolean;
7
+ export const emptyValue: any[];
8
+ export { sanitizeMultiSelectValue as sanitizeValue };
9
+ }
10
+ export default Checklist;
11
+ declare const type: "checklist";
12
+ import { sanitizeMultiSelectValue } from "../Util";
@@ -1,6 +1,9 @@
1
1
  declare function Number(props: any): import("preact").JSX.Element;
2
2
  declare namespace Number {
3
3
  export function create(options?: {}): {};
4
+ export function sanitizeValue({ value }: {
5
+ value: any;
6
+ }): number;
4
7
  export { type };
5
8
  export const keyed: boolean;
6
9
  export const label: string;
@@ -1,15 +1,12 @@
1
1
  declare function Radio(props: any): import("preact").JSX.Element;
2
2
  declare namespace Radio {
3
- export function create(options?: {}): {
4
- values: {
5
- label: string;
6
- value: string;
7
- }[];
8
- };
3
+ export function create(options?: {}): {};
9
4
  export { type };
10
5
  export const label: string;
11
6
  export const keyed: boolean;
12
7
  export const emptyValue: any;
8
+ export { sanitizeSingleSelectValue as sanitizeValue };
13
9
  }
14
10
  export default Radio;
15
11
  declare const type: "radio";
12
+ import { sanitizeSingleSelectValue } from "../Util";
@@ -1,15 +1,12 @@
1
1
  declare function Select(props: any): import("preact").JSX.Element;
2
2
  declare namespace Select {
3
- export function create(options?: {}): {
4
- values: {
5
- label: string;
6
- value: string;
7
- }[];
8
- };
3
+ export function create(options?: {}): {};
9
4
  export { type };
10
5
  export const label: string;
11
6
  export const keyed: boolean;
12
7
  export const emptyValue: any;
8
+ export { sanitizeSingleSelectValue as sanitizeValue };
13
9
  }
14
10
  export default Select;
15
11
  declare const type: "select";
12
+ import { sanitizeSingleSelectValue } from "../Util";
@@ -0,0 +1,12 @@
1
+ declare function Taglist(props: any): import("preact").JSX.Element;
2
+ declare namespace Taglist {
3
+ export function create(options?: {}): {};
4
+ export { type };
5
+ export const label: string;
6
+ export const keyed: boolean;
7
+ export const emptyValue: any[];
8
+ export { sanitizeMultiSelectValue as sanitizeValue };
9
+ }
10
+ export default Taglist;
11
+ declare const type: "taglist";
12
+ import { sanitizeMultiSelectValue } from "../Util";
@@ -5,6 +5,9 @@ declare namespace Textfield {
5
5
  export const label: string;
6
6
  export const keyed: boolean;
7
7
  export const emptyValue: string;
8
+ export function sanitizeValue({ value }: {
9
+ value: any;
10
+ }): string;
8
11
  }
9
12
  export default Textfield;
10
13
  declare const type: "textfield";
@@ -0,0 +1 @@
1
+ export default function DropdownList(props: any): import("preact").JSX.Element;
@@ -1,11 +1,13 @@
1
- export const formFields: (typeof Button | typeof Default | typeof Number | typeof Text)[];
1
+ export const formFields: (typeof Button | typeof Default | typeof Radio | typeof Text)[];
2
2
  import Button from "./form-fields/Button";
3
3
  import Checkbox from "./form-fields/Checkbox";
4
+ import Checklist from "./form-fields/Checklist";
4
5
  import Default from "./form-fields/Default";
5
6
  import FormComponent from "./FormComponent";
6
7
  import Number from "./form-fields/Number";
7
8
  import Radio from "./form-fields/Radio";
8
9
  import Select from "./form-fields/Select";
10
+ import Taglist from "./form-fields/Taglist";
9
11
  import Text from "./form-fields/Text";
10
12
  import Textfield from "./form-fields/Textfield";
11
- export { Button, Checkbox, Default, FormComponent, Number, Radio, Select, Text, Textfield };
13
+ export { Button, Checkbox, Checklist, Default, FormComponent, Number, Radio, Select, Taglist, Text, Textfield };
@@ -0,0 +1 @@
1
+ export default function useKeyDownAction(targetKey: any, action: any, listenerElement?: Window & typeof globalThis): void;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @typedef {Object} ValuesGetter
3
+ * @property {Object[]} values - The values data
4
+ * @property {(LOAD_STATES)} state - The values data's loading state, to use for conditional rendering
5
+ */
6
+ /**
7
+ * A hook to load values for single and multiselect components.
8
+ *
9
+ * @param {Object} field - The form field to handle values for
10
+ * @return {ValuesGetter} valuesGetter - A values getter object providing loading state and values
11
+ */
12
+ export default function _default(field: any): ValuesGetter;
13
+ export type LOAD_STATES = string;
14
+ export namespace LOAD_STATES {
15
+ const LOADING: string;
16
+ const LOADED: string;
17
+ const ERROR: string;
18
+ }
19
+ export type ValuesGetter = {
20
+ /**
21
+ * - The values data
22
+ */
23
+ values: any[];
24
+ /**
25
+ * - The values data's loading state, to use for conditional rendering
26
+ */
27
+ state: (LOAD_STATES);
28
+ };
@@ -12,5 +12,13 @@ export function generateIdForType(type: any): string;
12
12
  * @return {T}
13
13
  */
14
14
  export function clone<T>(data: T, replacer?: (this: any, key: string, value: any) => any): T;
15
+ /**
16
+ * Parse the schema for input variables a form might make use of
17
+ *
18
+ * @param {any} schema
19
+ *
20
+ * @return {string[]}
21
+ */
22
+ export function getSchemaVariables(schema: any): string[];
15
23
  export * from "./injector";
16
24
  export * from "./form";
@@ -1 +1,2 @@
1
- export function createInjector(bootstrapModules: any): any;
1
+ export function createInjector(bootstrapModules: any): Injector;
2
+ import { Injector } from "didi";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-viewer",
3
- "version": "0.7.1",
3
+ "version": "0.8.0-alpha.1",
4
4
  "description": "View forms - powered by bpmn.io",
5
5
  "exports": {
6
6
  ".": {
@@ -20,7 +20,7 @@
20
20
  "all": "run-s test build",
21
21
  "build": "run-p bundle generate-types",
22
22
  "start": "SINGLE_START=basic npm run dev",
23
- "bundle": "rollup -c",
23
+ "bundle": "rollup -c --failAfterWarnings",
24
24
  "bundle:watch": "rollup -c -w",
25
25
  "dev": "npm test -- --auto-watch --no-single-run",
26
26
  "generate-types": "tsc --allowJs --skipLibCheck --declaration --emitDeclarationOnly --outDir dist/types src/index.js && cp src/*.d.ts dist/types",
@@ -39,7 +39,8 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@bpmn-io/snarkdown": "^2.1.0",
42
- "didi": "^5.2.1",
42
+ "classnames": "^2.3.1",
43
+ "didi": "^8.0.1",
43
44
  "ids": "^1.0.0",
44
45
  "min-dash": "^3.7.0",
45
46
  "preact": "^10.5.14",
@@ -51,5 +52,5 @@
51
52
  "files": [
52
53
  "dist"
53
54
  ],
54
- "gitHead": "75a12520e4a55c2d3b4fcab6464fe86026ba40b2"
55
+ "gitHead": "2be914efeefa050fb4692ac1a644557fc424917f"
55
56
  }