@bpmn-io/form-js-viewer 0.10.1 → 0.12.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 (69) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +165 -165
  3. package/dist/assets/form-js.css +715 -611
  4. package/dist/index.cjs +953 -691
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.es.js +877 -606
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/types/Form.d.ts +144 -144
  9. package/dist/types/core/ConditionChecker.d.ts +57 -57
  10. package/dist/types/core/EventBus.d.ts +1 -1
  11. package/dist/types/core/FormFieldRegistry.d.ts +17 -17
  12. package/dist/types/core/Validator.d.ts +7 -7
  13. package/dist/types/core/index.d.ts +18 -18
  14. package/dist/types/import/Importer.d.ts +43 -43
  15. package/dist/types/import/index.d.ts +5 -5
  16. package/dist/types/index.d.ts +18 -18
  17. package/dist/types/render/FormFields.d.ts +5 -5
  18. package/dist/types/render/Renderer.d.ts +23 -23
  19. package/dist/types/render/components/Description.d.ts +1 -1
  20. package/dist/types/render/components/Errors.d.ts +1 -1
  21. package/dist/types/render/components/FormComponent.d.ts +1 -1
  22. package/dist/types/render/components/FormField.d.ts +1 -1
  23. package/dist/types/render/components/Label.d.ts +1 -1
  24. package/dist/types/render/components/PoweredBy.d.ts +1 -1
  25. package/dist/types/render/components/Sanitizer.d.ts +8 -8
  26. package/dist/types/render/components/Util.d.ts +17 -17
  27. package/dist/types/render/components/form-fields/Button.d.ts +12 -11
  28. package/dist/types/render/components/form-fields/Checkbox.d.ts +14 -13
  29. package/dist/types/render/components/form-fields/Checklist.d.ts +18 -12
  30. package/dist/types/render/components/form-fields/Datetime.d.ts +13 -11
  31. package/dist/types/render/components/form-fields/Default.d.ts +11 -9
  32. package/dist/types/render/components/form-fields/Image.d.ts +10 -8
  33. package/dist/types/render/components/form-fields/Number.d.ts +15 -14
  34. package/dist/types/render/components/form-fields/Radio.d.ts +18 -12
  35. package/dist/types/render/components/form-fields/Select.d.ts +18 -12
  36. package/dist/types/render/components/form-fields/Taglist.d.ts +18 -12
  37. package/dist/types/render/components/form-fields/Text.d.ts +12 -10
  38. package/dist/types/render/components/form-fields/Textarea.d.ts +14 -13
  39. package/dist/types/render/components/form-fields/Textfield.d.ts +14 -13
  40. package/dist/types/render/components/form-fields/parts/Datepicker.d.ts +1 -1
  41. package/dist/types/render/components/form-fields/parts/DropdownList.d.ts +1 -1
  42. package/dist/types/render/components/form-fields/parts/InputAdorner.d.ts +1 -1
  43. package/dist/types/render/components/form-fields/parts/SearchableSelect.d.ts +1 -0
  44. package/dist/types/render/components/form-fields/parts/SimpleSelect.d.ts +1 -0
  45. package/dist/types/render/components/form-fields/parts/Timepicker.d.ts +1 -1
  46. package/dist/types/render/components/icons/index.d.ts +16 -16
  47. package/dist/types/render/components/index.d.ts +17 -17
  48. package/dist/types/render/components/util/dateTimeUtil.d.ts +12 -12
  49. package/dist/types/render/components/util/numberFieldUtil.d.ts +4 -4
  50. package/dist/types/render/components/util/sanitizerUtil.d.ts +3 -3
  51. package/dist/types/render/context/FormContext.d.ts +12 -12
  52. package/dist/types/render/context/FormRenderContext.d.ts +6 -6
  53. package/dist/types/render/context/index.d.ts +2 -2
  54. package/dist/types/render/hooks/useCondition.d.ts +9 -9
  55. package/dist/types/render/hooks/useEvaluation.d.ts +6 -6
  56. package/dist/types/render/hooks/useExpressionValue.d.ts +5 -5
  57. package/dist/types/render/hooks/useKeyDownAction.d.ts +1 -1
  58. package/dist/types/render/hooks/useService.d.ts +1 -1
  59. package/dist/types/render/hooks/useValuesAsync.d.ts +28 -28
  60. package/dist/types/render/index.d.ts +11 -11
  61. package/dist/types/src/types.d.ts +35 -35
  62. package/dist/types/util/constants/DatetimeConstants.d.ts +24 -24
  63. package/dist/types/util/constants/ValuesSourceConstants.d.ts +18 -15
  64. package/dist/types/util/constants/index.d.ts +2 -2
  65. package/dist/types/util/feel.d.ts +15 -15
  66. package/dist/types/util/form.d.ts +6 -6
  67. package/dist/types/util/index.d.ts +26 -25
  68. package/dist/types/util/injector.d.ts +2 -2
  69. package/package.json +4 -4
@@ -1,12 +1,12 @@
1
- export default FormContext;
2
- declare const FormContext: import("preact").Context<{
3
- getService: typeof getService;
4
- formId: any;
5
- }>;
6
- /**
7
- * @param {string} type
8
- * @param {boolean} [strict]
9
- *
10
- * @returns {any}
11
- */
12
- declare function getService(type: string, strict?: boolean): any;
1
+ export default FormContext;
2
+ declare const FormContext: import("preact").Context<{
3
+ getService: typeof getService;
4
+ formId: any;
5
+ }>;
6
+ /**
7
+ * @param {string} type
8
+ * @param {boolean} [strict]
9
+ *
10
+ * @returns {any}
11
+ */
12
+ declare function getService(type: string, strict?: boolean): any;
@@ -1,6 +1,6 @@
1
- export default FormRenderContext;
2
- declare const FormRenderContext: import("preact").Context<{
3
- Empty: (props: any) => any;
4
- Children: (props: any) => any;
5
- Element: (props: any) => any;
6
- }>;
1
+ export default FormRenderContext;
2
+ declare const FormRenderContext: import("preact").Context<{
3
+ Empty: (props: any) => any;
4
+ Children: (props: any) => any;
5
+ Element: (props: any) => any;
6
+ }>;
@@ -1,2 +1,2 @@
1
- export { default as FormRenderContext } from "./FormRenderContext";
2
- export { default as FormContext } from "./FormContext";
1
+ export { default as FormRenderContext } from "./FormRenderContext";
2
+ export { default as FormContext } from "./FormContext";
@@ -1,9 +1,9 @@
1
- /**
2
- * Check if condition is met with given variables.
3
- *
4
- * @param {string | undefined} condition
5
- * @param {import('../../types').Data} data
6
- *
7
- * @returns {boolean} true if condition is met or no condition or condition checker exists
8
- */
9
- export function useCondition(condition: string | undefined, data: import('../../types').Data): boolean;
1
+ /**
2
+ * Check if condition is met with given variables.
3
+ *
4
+ * @param {string | undefined} condition
5
+ * @param {import('../../types').Data} data
6
+ *
7
+ * @returns {boolean} true if condition is met or no condition or condition checker exists
8
+ */
9
+ export function useCondition(condition: string | undefined, data: import('../../types').Data): boolean;
@@ -1,6 +1,6 @@
1
- /**
2
- *
3
- * @param {string | undefined} expression
4
- * @param {import('../../types').Data} data
5
- */
6
- export function useEvaluation(expression: string | undefined, data: import('../../types').Data): any;
1
+ /**
2
+ *
3
+ * @param {string | undefined} expression
4
+ * @param {import('../../types').Data} data
5
+ */
6
+ export function useEvaluation(expression: string | undefined, data: import('../../types').Data): any;
@@ -1,5 +1,5 @@
1
- /**
2
- *
3
- * @param {string} value
4
- */
5
- export function useExpressionValue(value: string): any;
1
+ /**
2
+ *
3
+ * @param {string} value
4
+ */
5
+ export function useExpressionValue(value: string): any;
@@ -1 +1 @@
1
- export default function useKeyDownAction(targetKey: any, action: any, listenerElement?: Window & typeof globalThis): void;
1
+ export default function useKeyDownAction(targetKey: any, action: any, listenerElement?: Window & typeof globalThis): void;
@@ -1 +1 @@
1
- export default function _default(type: any, strict: any): any;
1
+ export default function _default(type: any, strict: any): any;
@@ -1,28 +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
- };
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
+ };
@@ -1,11 +1,11 @@
1
- export { FormFields };
2
- export * from "./components";
3
- export * from "./context";
4
- declare namespace _default {
5
- const __init__: string[];
6
- const formFields: (string | typeof FormFields)[];
7
- const renderer: (string | typeof Renderer)[];
8
- }
9
- export default _default;
10
- import FormFields from "./FormFields";
11
- import Renderer from "./Renderer";
1
+ export { FormFields };
2
+ export * from "./components";
3
+ export * from "./context";
4
+ declare namespace _default {
5
+ const __init__: string[];
6
+ const formFields: (string | typeof FormFields)[];
7
+ const renderer: (string | typeof Renderer)[];
8
+ }
9
+ export default _default;
10
+ import FormFields from "./FormFields";
11
+ import Renderer from "./Renderer";
@@ -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' | 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' | 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,24 +1,24 @@
1
- export const MINUTES_IN_DAY: number;
2
- export namespace DATETIME_SUBTYPES {
3
- const DATE: string;
4
- const TIME: string;
5
- const DATETIME: string;
6
- }
7
- export namespace TIME_SERIALISING_FORMATS {
8
- const UTC_OFFSET: string;
9
- const UTC_NORMALIZED: string;
10
- const NO_TIMEZONE: string;
11
- }
12
- export const DATETIME_SUBTYPES_LABELS: {
13
- [x: string]: string;
14
- };
15
- export const TIME_SERIALISINGFORMAT_LABELS: {
16
- [x: string]: string;
17
- };
18
- export const DATETIME_SUBTYPE_PATH: string[];
19
- export const DATE_LABEL_PATH: string[];
20
- export const DATE_DISALLOW_PAST_PATH: string[];
21
- export const TIME_LABEL_PATH: string[];
22
- export const TIME_USE24H_PATH: string[];
23
- export const TIME_INTERVAL_PATH: string[];
24
- export const TIME_SERIALISING_FORMAT_PATH: string[];
1
+ export const MINUTES_IN_DAY: number;
2
+ export namespace DATETIME_SUBTYPES {
3
+ const DATE: string;
4
+ const TIME: string;
5
+ const DATETIME: string;
6
+ }
7
+ export namespace TIME_SERIALISING_FORMATS {
8
+ const UTC_OFFSET: string;
9
+ const UTC_NORMALIZED: string;
10
+ const NO_TIMEZONE: string;
11
+ }
12
+ export const DATETIME_SUBTYPES_LABELS: {
13
+ [x: string]: string;
14
+ };
15
+ export const TIME_SERIALISINGFORMAT_LABELS: {
16
+ [x: string]: string;
17
+ };
18
+ export const DATETIME_SUBTYPE_PATH: string[];
19
+ export const DATE_LABEL_PATH: string[];
20
+ export const DATE_DISALLOW_PAST_PATH: string[];
21
+ export const TIME_LABEL_PATH: string[];
22
+ export const TIME_USE24H_PATH: string[];
23
+ export const TIME_INTERVAL_PATH: string[];
24
+ export const TIME_SERIALISING_FORMAT_PATH: string[];
@@ -1,15 +1,18 @@
1
- export function getValuesSource(field: any): string;
2
- export namespace VALUES_SOURCES {
3
- const STATIC: string;
4
- const INPUT: string;
5
- }
6
- export const VALUES_SOURCE_DEFAULT: string;
7
- export const VALUES_SOURCES_LABELS: {
8
- [x: string]: string;
9
- };
10
- export const VALUES_SOURCES_PATHS: {
11
- [x: string]: string[];
12
- };
13
- export const VALUES_SOURCES_DEFAULTS: {
14
- [x: string]: string | any[];
15
- };
1
+ export function getValuesSource(field: any): string;
2
+ export namespace VALUES_SOURCES {
3
+ const STATIC: string;
4
+ const INPUT: string;
5
+ }
6
+ export const VALUES_SOURCE_DEFAULT: string;
7
+ export const VALUES_SOURCES_LABELS: {
8
+ [x: string]: string;
9
+ };
10
+ export const VALUES_SOURCES_PATHS: {
11
+ [x: string]: string[];
12
+ };
13
+ export const VALUES_SOURCES_DEFAULTS: {
14
+ [x: string]: string | {
15
+ label: string;
16
+ value: string;
17
+ }[];
18
+ };
@@ -1,2 +1,2 @@
1
- export * from "./DatetimeConstants";
2
- export * from "./ValuesSourceConstants";
1
+ export * from "./DatetimeConstants";
2
+ export * from "./ValuesSourceConstants";
@@ -1,15 +1,15 @@
1
- /**
2
- * Retrieve variable names from given FEEL unary test.
3
- *
4
- * @param {string} unaryTest
5
- * @returns {string[]}
6
- */
7
- export function getVariableNames(unaryTest: string): string[];
8
- /**
9
- * Retrieve variable names from given FEEL expression.
10
- *
11
- * @param {string} expression
12
- * @returns {string[]}
13
- */
14
- export function getExpressionVariableNames(expression: string): string[];
15
- export function isExpression(value: any): boolean;
1
+ /**
2
+ * Retrieve variable names from given FEEL unary test.
3
+ *
4
+ * @param {string} unaryTest
5
+ * @returns {string[]}
6
+ */
7
+ export function getVariableNames(unaryTest: string): string[];
8
+ /**
9
+ * Retrieve variable names from given FEEL expression.
10
+ *
11
+ * @param {string} expression
12
+ * @returns {string[]}
13
+ */
14
+ export function getExpressionVariableNames(expression: string): string[];
15
+ export function isExpression(value: any): boolean;
@@ -1,6 +1,6 @@
1
- /**
2
- * @param {string?} prefix
3
- *
4
- * @returns Element
5
- */
6
- export function createFormContainer(prefix?: string | null): HTMLDivElement;
1
+ /**
2
+ * @param {string?} prefix
3
+ *
4
+ * @returns Element
5
+ */
6
+ export function createFormContainer(prefix?: string | null): HTMLDivElement;
@@ -1,25 +1,26 @@
1
- export function findErrors(errors: any, path: any): any;
2
- export function isRequired(field: any): any;
3
- export function pathParse(path: any): any;
4
- export function pathsEqual(a: any, b: any): any;
5
- export function pathStringify(path: any): any;
6
- export function generateIndexForType(type: any): any;
7
- export function generateIdForType(type: any): string;
8
- /**
9
- * @template T
10
- * @param {T} data
11
- * @param {(this: any, key: string, value: any) => any} [replacer]
12
- * @return {T}
13
- */
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[];
23
- export * from "./constants";
24
- export * from "./injector";
25
- export * from "./form";
1
+ export function findErrors(errors: any, path: any): any;
2
+ export function isRequired(field: any): any;
3
+ export function pathParse(path: any): any;
4
+ export function pathsEqual(a: any, b: any): any;
5
+ export function pathStringify(path: any): any;
6
+ export function generateIndexForType(type: any): any;
7
+ export function generateIdForType(type: any): string;
8
+ /**
9
+ * @template T
10
+ * @param {T} data
11
+ * @param {(this: any, key: string, value: any) => any} [replacer]
12
+ * @return {T}
13
+ */
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[];
23
+ export * from "./constants";
24
+ export * from "./injector";
25
+ export * from "./form";
26
+ export * from "./feel";
@@ -1,2 +1,2 @@
1
- export function createInjector(bootstrapModules: any): Injector;
2
- import { Injector } from "didi";
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.10.1",
3
+ "version": "0.12.0",
4
4
  "description": "View forms - powered by bpmn.io",
5
5
  "exports": {
6
6
  ".": {
@@ -21,8 +21,8 @@
21
21
  "all": "run-s test build",
22
22
  "build": "run-p bundle generate-types",
23
23
  "start": "SINGLE_START=basic npm run dev",
24
- "bundle": "rollup -c --failAfterWarnings",
25
- "bundle:watch": "rollup -c -w",
24
+ "bundle": "rollup -c --failAfterWarnings --bundleConfigAsCjs",
25
+ "bundle:watch": "rollup -c -w --bundleConfigAsCjs",
26
26
  "dev": "npm test -- --auto-watch --no-single-run",
27
27
  "generate-types": "tsc --allowJs --skipLibCheck --declaration --emitDeclarationOnly --outDir dist/types src/index.js && copyfiles src/*.d.ts dist/types",
28
28
  "test": "karma start",
@@ -56,5 +56,5 @@
56
56
  "files": [
57
57
  "dist"
58
58
  ],
59
- "gitHead": "96711a75acb05161aad171a8f19f52cd11d11ce4"
59
+ "gitHead": "a0f3d50d21422053ebd8aeb933fb026ccf8d9209"
60
60
  }