@ghentcdh/json-forms-vue 1.1.1 → 2.0.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/composables/useFormEvents.d.ts +4 -2
- package/composables/useHttpClient.d.ts +12 -0
- package/forms/FormComponent.properties.d.ts +16 -0
- package/forms/FormComponent.vue.d.ts +28 -1
- package/forms/errorMode.d.ts +1 -0
- package/forms/modal/FormModal.properties.d.ts +11 -0
- package/forms/modal/FormModal.vue.d.ts +83 -5
- package/forms/modal/FormModalService.d.ts +29 -1
- package/forms/renderers/array/ArrayRenderers.d.ts +1 -1
- package/forms/renderers/controls/{composable/UseControlBinding.d.ts → composables/useControlBinding.d.ts} +8 -1
- package/forms/renderers/controls/{composable/UseFetchOption.d.ts → composables/useFetchOption.d.ts} +4 -3
- package/forms/renderers/controls/composables/useReadonlyBinding.d.ts +135 -0
- package/forms/renderers/controls/{composable/UseSelectBinding.d.ts → composables/useSelectBinding.d.ts} +6 -0
- package/forms/renderers/controls/index.d.ts +2 -2
- package/forms/renderers/controls/readonly/ControlReadonlyRenderer.vue.d.ts +7 -0
- package/forms/renderers/controls/readonly/ReadonlyLabel.vue.d.ts +254 -0
- package/forms/renderers/controls/readonly/__tests__/formatDate.spec.d.ts +1 -0
- package/forms/renderers/controls/readonly/constants.d.ts +2 -0
- package/forms/renderers/controls/readonly/displayValue/BooleanValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/DateValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/LinkValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/MarkdownValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/NotSetValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/NumberValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/ObjectValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/StringValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/ViewDetailValue.vue.d.ts +46 -0
- package/forms/renderers/controls/readonly/displayValue/displayValue.properties.d.ts +23 -0
- package/forms/renderers/controls/readonly/displayValue/formatDate.d.ts +25 -0
- package/forms/renderers/controls/readonly/displayValue/index.d.ts +1 -0
- package/forms/renderers/{layout/LayoutRenders.d.ts → controls/readonly/index.d.ts} +4 -4
- package/forms/renderers/controls/readonly/useDisplayValue.d.ts +1 -0
- package/forms/renderers/controls/{composable/resource.d.ts → resource.d.ts} +88 -13
- package/forms/renderers/index.d.ts +42 -2
- package/forms/{renderes.d.ts → renderers/layout/LayoutRenderers.d.ts} +9 -8
- package/forms/renderers/layout/ReadOnlyLayoutRenderer.vue.d.ts +7 -0
- package/http-client.d.ts +14 -0
- package/index.d.ts +15 -8
- package/index.js +1702 -1077
- package/package.json +14 -22
- package/repository/{crud.repository.d.ts → CrudRepository.d.ts} +9 -7
- package/repository/index.d.ts +1 -1
- package/table/TableComponent.properties.d.ts +49 -0
- package/table/TableComponent.vue.d.ts +92 -0
- package/table/TableToolbar.vue.d.ts +36 -0
- package/table/cells/index.d.ts +10 -0
- package/table/filter/{table-filter.vue.d.ts → FilterRowInput.vue.d.ts} +11 -7
- package/table/filter/TableFilter.vue.d.ts +16 -0
- package/table/index.d.ts +6 -2
- package/testers/__tests__/jsonforms-testers.spec.d.ts +1 -0
- package/testers/__tests__/tester.spec.d.ts +1 -0
- package/testers/jsonforms-testers.d.ts +27 -0
- package/testers/tester.d.ts +16 -0
- package/view/modal/ViewModal.properties.d.ts +82 -0
- package/{forms/FormWithActions.vue.d.ts → view/modal/ViewModal.vue.d.ts} +150 -51
- package/form.store.d.ts +0 -8
- package/forms/FormWithActions.properties.d.ts +0 -52
- package/forms/FormWithTable.properties.d.ts +0 -65
- package/forms/FormWithTable.vue.d.ts +0 -90
- package/renderes/tester.d.ts +0 -11
- package/table/table.component.properties.d.ts +0 -34
- package/table/table.component.vue.d.ts +0 -60
- package/table/table.store.d.ts +0 -29
- /package/forms/renderers/controls/{composable/UseInput.d.ts → composables/useInput.d.ts} +0 -0
- /package/forms/{renderer-registry.d.ts → renderers/registry.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghentcdh/json-forms-vue",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"module": "./index.js",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"main": "./index.js",
|
|
5
|
+
"module": "./index.mjs",
|
|
7
6
|
"types": "./index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
10
9
|
"types": "./index.d.ts",
|
|
11
|
-
"import": "./index.
|
|
12
|
-
"require": "./index.
|
|
10
|
+
"import": "./index.mjs",
|
|
11
|
+
"require": "./index.js"
|
|
13
12
|
},
|
|
14
13
|
"./testing": {
|
|
15
14
|
"types": "./testing/index.d.ts",
|
|
16
|
-
"import": "./testing.
|
|
17
|
-
"require": "./testing.
|
|
15
|
+
"import": "./testing.mjs",
|
|
16
|
+
"require": "./testing.js"
|
|
18
17
|
},
|
|
19
18
|
"./index.css": "./index.css"
|
|
20
19
|
},
|
|
@@ -30,28 +29,21 @@
|
|
|
30
29
|
"optional": true
|
|
31
30
|
}
|
|
32
31
|
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"vee-validate": ">=4.0.0",
|
|
34
|
+
"zod": "^4.0.0"
|
|
35
|
+
},
|
|
33
36
|
"peerDependencies": {
|
|
34
37
|
"@playwright/test": ">=1.50.0",
|
|
35
38
|
"@ghentcdh/json-forms-core": ">=0.0.1",
|
|
36
|
-
"@ghentcdh/tools-vue": ">=0.6.0",
|
|
37
39
|
"@ghentcdh/ui": ">=0.6.0",
|
|
38
|
-
"@jsonforms/core": "^3.4.0",
|
|
39
|
-
"@vueuse/core": "^14.0.0",
|
|
40
|
-
"axios": "^1.0.0",
|
|
41
|
-
"lodash-es": "^4.17.0",
|
|
42
40
|
"vue": "^3.5.0",
|
|
43
|
-
"
|
|
44
|
-
"vue-router": "^5.0.0",
|
|
45
|
-
"zod": "^4.0.0"
|
|
41
|
+
"vue-router": "^5.0.0"
|
|
46
42
|
},
|
|
47
43
|
"devDependencies": {
|
|
48
|
-
"@jsonforms/core": "3.
|
|
49
|
-
"@vueuse/core": "14.2.1",
|
|
50
|
-
"axios": "1.13.5",
|
|
51
|
-
"lodash-es": "4.17.23",
|
|
44
|
+
"@jsonforms/core": "^3.4.0",
|
|
52
45
|
"vue": "3.5.29",
|
|
53
|
-
"vue-router": "5.0.3"
|
|
54
|
-
"zod": "4.3.6"
|
|
46
|
+
"vue-router": "5.0.3"
|
|
55
47
|
},
|
|
56
48
|
"publishConfig": {
|
|
57
49
|
"access": "public"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpClient } from '../http-client';
|
|
2
2
|
type RequestOptions = {
|
|
3
3
|
skipAuth?: boolean;
|
|
4
4
|
queryParams?: Record<string, any>;
|
|
5
5
|
contentType?: string;
|
|
6
6
|
};
|
|
7
|
-
export type HttpRequest<T> =
|
|
7
|
+
export type HttpRequest<T> = HttpClient;
|
|
8
8
|
export type NotificationStore = {
|
|
9
9
|
info: (message: string) => void;
|
|
10
10
|
error: (message: string) => void;
|
|
@@ -23,10 +23,12 @@ export declare const createRepository: <T extends {
|
|
|
23
23
|
}>(formSchemaModel: {
|
|
24
24
|
uri: string;
|
|
25
25
|
}, httpRequest: HttpRequest<T>, options?: RepositoryOptions) => {
|
|
26
|
-
create: (object: T, options?: RequestOptions) => any
|
|
27
|
-
patch: (id: string, object: T, options?: RequestOptions) => any
|
|
28
|
-
createMulti: (objects: T[], options?: RequestOptions) => Promise<any>;
|
|
29
|
-
delete: (id: string, options?: RequestOptions) =>
|
|
30
|
-
|
|
26
|
+
create: (object: T, options?: RequestOptions) => Promise<any>;
|
|
27
|
+
patch: (id: string, object: T, options?: RequestOptions) => Promise<any>;
|
|
28
|
+
createMulti: (objects: T[], options?: RequestOptions) => Promise<void | any[]>;
|
|
29
|
+
delete: (id: string, options?: RequestOptions) => Promise<void | {
|
|
30
|
+
data: any;
|
|
31
|
+
}>;
|
|
32
|
+
get: (id: string, options?: RequestOptions) => Promise<any>;
|
|
31
33
|
};
|
|
32
34
|
export {};
|
package/repository/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './CrudRepository';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { JsonSchema, Layout } from '@jsonforms/core';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { TableAction, TablePage, TableSort } from '../../../../ui/src/index.ts';
|
|
4
|
+
import { CellRendererEntry } from './cells';
|
|
5
|
+
export declare const TableComponentProperties: {
|
|
6
|
+
id: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
uiSchema: {
|
|
11
|
+
type: PropType<Layout>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
schema: {
|
|
15
|
+
type: PropType<JsonSchema>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
reload: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
};
|
|
21
|
+
loading: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: false;
|
|
24
|
+
};
|
|
25
|
+
multiselect: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: false;
|
|
28
|
+
};
|
|
29
|
+
actions: {
|
|
30
|
+
type: PropType<TableAction[]>;
|
|
31
|
+
};
|
|
32
|
+
data: {
|
|
33
|
+
type: PropType<any[]>;
|
|
34
|
+
};
|
|
35
|
+
page: {
|
|
36
|
+
type: PropType<TablePage>;
|
|
37
|
+
};
|
|
38
|
+
sort: {
|
|
39
|
+
type: PropType<TableSort>;
|
|
40
|
+
};
|
|
41
|
+
cellRenderers: {
|
|
42
|
+
type: PropType<CellRendererEntry[]>;
|
|
43
|
+
};
|
|
44
|
+
hidePagination: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: false;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare const TableComponentEmits: string[];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
id: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
uiSchema: {
|
|
7
|
+
type: import('vue').PropType<import('@jsonforms/core').Layout>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
schema: {
|
|
11
|
+
type: import('vue').PropType<import('@jsonforms/core').JsonSchema>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
reload: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
};
|
|
17
|
+
loading: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: false;
|
|
20
|
+
};
|
|
21
|
+
multiselect: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: false;
|
|
24
|
+
};
|
|
25
|
+
actions: {
|
|
26
|
+
type: import('vue').PropType<import('../../../../ui/src/index.ts').TableAction[]>;
|
|
27
|
+
};
|
|
28
|
+
data: {
|
|
29
|
+
type: import('vue').PropType<any[]>;
|
|
30
|
+
};
|
|
31
|
+
page: {
|
|
32
|
+
type: import('vue').PropType<import('../../../../ui/src/index.ts').TablePage>;
|
|
33
|
+
};
|
|
34
|
+
sort: {
|
|
35
|
+
type: import('vue').PropType<import('../../../../ui/src/index.ts').TableSort>;
|
|
36
|
+
};
|
|
37
|
+
cellRenderers: {
|
|
38
|
+
type: import('vue').PropType<import('./cells').CellRendererEntry[]>;
|
|
39
|
+
};
|
|
40
|
+
hidePagination: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: false;
|
|
43
|
+
};
|
|
44
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
45
|
+
id: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
uiSchema: {
|
|
50
|
+
type: import('vue').PropType<import('@jsonforms/core').Layout>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
schema: {
|
|
54
|
+
type: import('vue').PropType<import('@jsonforms/core').JsonSchema>;
|
|
55
|
+
required: true;
|
|
56
|
+
};
|
|
57
|
+
reload: {
|
|
58
|
+
type: NumberConstructor;
|
|
59
|
+
};
|
|
60
|
+
loading: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: false;
|
|
63
|
+
};
|
|
64
|
+
multiselect: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: false;
|
|
67
|
+
};
|
|
68
|
+
actions: {
|
|
69
|
+
type: import('vue').PropType<import('../../../../ui/src/index.ts').TableAction[]>;
|
|
70
|
+
};
|
|
71
|
+
data: {
|
|
72
|
+
type: import('vue').PropType<any[]>;
|
|
73
|
+
};
|
|
74
|
+
page: {
|
|
75
|
+
type: import('vue').PropType<import('../../../../ui/src/index.ts').TablePage>;
|
|
76
|
+
};
|
|
77
|
+
sort: {
|
|
78
|
+
type: import('vue').PropType<import('../../../../ui/src/index.ts').TableSort>;
|
|
79
|
+
};
|
|
80
|
+
cellRenderers: {
|
|
81
|
+
type: import('vue').PropType<import('./cells').CellRendererEntry[]>;
|
|
82
|
+
};
|
|
83
|
+
hidePagination: {
|
|
84
|
+
type: BooleanConstructor;
|
|
85
|
+
default: false;
|
|
86
|
+
};
|
|
87
|
+
}>> & Readonly<{}>, {
|
|
88
|
+
multiselect: boolean;
|
|
89
|
+
loading: boolean;
|
|
90
|
+
hidePagination: boolean;
|
|
91
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
92
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
type Action = any;
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** JSON Schema for filterable columns — keys are field ids, titles are labels. */
|
|
4
|
+
filterSchema?: Record<string, any>;
|
|
5
|
+
/** Active filter strings in wire format, e.g. ["title:foo:contains"]. */
|
|
6
|
+
filters?: string[];
|
|
7
|
+
/** Current search query (the `q` lookup param). */
|
|
8
|
+
search?: string;
|
|
9
|
+
actions?: Action[];
|
|
10
|
+
};
|
|
11
|
+
declare function __VLS_template(): {
|
|
12
|
+
attrs: Partial<{}>;
|
|
13
|
+
slots: {
|
|
14
|
+
left?(_: {}): any;
|
|
15
|
+
right?(_: {}): any;
|
|
16
|
+
};
|
|
17
|
+
refs: {};
|
|
18
|
+
rootEl: HTMLDivElement;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
21
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
action: (action: any) => any;
|
|
23
|
+
updateSearch: (q: string) => any;
|
|
24
|
+
updateFilters: (filters: string[]) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
|
+
onAction?: ((action: any) => any) | undefined;
|
|
27
|
+
onUpdateSearch?: ((q: string) => any) | undefined;
|
|
28
|
+
onUpdateFilters?: ((filters: string[]) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { TextCellType } from '../../../../core/src/index.ts';
|
|
3
|
+
export interface CellRendererEntry {
|
|
4
|
+
tester: (element: TextCellType) => number;
|
|
5
|
+
renderer: Component;
|
|
6
|
+
}
|
|
7
|
+
export declare const cellTypeIs: (type: string, rank: number) => CellRendererEntry["tester"];
|
|
8
|
+
export declare const cellFormatIs: (format: string, rank: number) => CellRendererEntry["tester"];
|
|
9
|
+
export declare const findCellRenderer: (registry: CellRendererEntry[], element: TextCellType) => Component | undefined;
|
|
10
|
+
export declare const defaultCellRenderers: CellRendererEntry[];
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { Filter
|
|
1
|
+
import { Filter } from '../../../../core/src/index.ts';
|
|
2
|
+
export type FieldOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
2
6
|
type __VLS_Props = {
|
|
3
|
-
|
|
4
|
-
|
|
7
|
+
modelValue: Filter;
|
|
8
|
+
fields: FieldOption[];
|
|
5
9
|
};
|
|
6
10
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
remove: () => any;
|
|
12
|
+
"update:modelValue": (value: Filter) => any;
|
|
9
13
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
onRemove?: (() => any) | undefined;
|
|
15
|
+
"onUpdate:modelValue"?: ((value: Filter) => any) | undefined;
|
|
12
16
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
17
|
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Active filter strings from the URL, e.g. ["title:foo:contains"] */
|
|
3
|
+
filters: string[];
|
|
4
|
+
/** JSON Schema for filterable columns — keys are field ids, titles are labels */
|
|
5
|
+
filterSchema?: Record<string, any>;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
close: () => any;
|
|
9
|
+
changeFilters: (filters: string[]) => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onClose?: (() => any) | undefined;
|
|
12
|
+
onChangeFilters?: ((filters: string[]) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
14
|
+
containerRef: HTMLDivElement;
|
|
15
|
+
}, HTMLDivElement>;
|
|
16
|
+
export default _default;
|
package/table/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export { default as TableComponent } from './
|
|
2
|
-
export
|
|
1
|
+
export { default as TableComponent } from './TableComponent.vue';
|
|
2
|
+
export { default as TableToolbar } from './TableToolbar.vue';
|
|
3
|
+
export { default as TableFilter } from './filter/TableFilter.vue';
|
|
4
|
+
export { default as FilterRowInput } from './filter/FilterRowInput.vue';
|
|
5
|
+
export * from './TableComponent.properties';
|
|
6
|
+
export * from './cells';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
/**
|
|
3
|
+
* Local re-implementation of the handful of JSON Forms tester combinators this
|
|
4
|
+
* library uses at runtime. JSON Forms is otherwise only needed for its types,
|
|
5
|
+
* so this lets `@jsonforms/core` stay a type-only (dev) dependency.
|
|
6
|
+
*
|
|
7
|
+
* Note: in this library `findRenderer` always invokes testers with the schema
|
|
8
|
+
* already resolved for the control's scope (see `Dispatch.vue`). `schemaTypeIs`
|
|
9
|
+
* therefore compares against the resolved sub-schema directly and does not need
|
|
10
|
+
* to walk `uischema.scope` against a root schema.
|
|
11
|
+
*/
|
|
12
|
+
export type Tester = (uischema: UISchemaElement, schema: JsonSchema, context?: unknown) => boolean;
|
|
13
|
+
export type RankedTester = (uischema: UISchemaElement, schema: JsonSchema, context?: unknown) => number;
|
|
14
|
+
/** Returned by a ranked tester when it does not apply. */
|
|
15
|
+
export declare const NOT_APPLICABLE = -1;
|
|
16
|
+
/** Wrap a boolean tester so it returns `rank` when it matches, `-1` otherwise. */
|
|
17
|
+
export declare const rankWith: (rank: number, tester: Tester) => RankedTester;
|
|
18
|
+
/** Matches only when every supplied tester matches. */
|
|
19
|
+
export declare const and: (...testers: Tester[]) => Tester;
|
|
20
|
+
/** Matches when at least one supplied tester matches. */
|
|
21
|
+
export declare const or: (...testers: Tester[]) => Tester;
|
|
22
|
+
/** Matches when the UI schema element has the given `type`. */
|
|
23
|
+
export declare const uiTypeIs: (expected: string) => Tester;
|
|
24
|
+
/**
|
|
25
|
+
* Matches a control whose (already resolved) schema has the given `type`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const schemaTypeIs: (expected: string) => Tester;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
export declare const optionIsIgnoreCase: (optionName: string, optionValue: string) => (uischema: UISchemaElement) => boolean;
|
|
3
|
+
export declare const isAutoCompleteControl: import('./jsonforms-testers').Tester;
|
|
4
|
+
export declare const isTextAreaControl: import('./jsonforms-testers').Tester;
|
|
5
|
+
export declare const isStringFormat: import('./jsonforms-testers').Tester;
|
|
6
|
+
export declare const isMarkdownControl: import('./jsonforms-testers').Tester;
|
|
7
|
+
export declare const isObjectControl: import('./jsonforms-testers').Tester;
|
|
8
|
+
export declare const isArrayRenderer: import('./jsonforms-testers').Tester;
|
|
9
|
+
export declare const isCustomControl: (customType: string) => import('./jsonforms-testers').Tester;
|
|
10
|
+
export declare const isMultiselectControl: import('./jsonforms-testers').Tester;
|
|
11
|
+
export declare const isSelectControl: import('./jsonforms-testers').Tester;
|
|
12
|
+
export declare const isBooleanControl: import('./jsonforms-testers').Tester;
|
|
13
|
+
export declare const isNumberFormat: import('./jsonforms-testers').Tester;
|
|
14
|
+
export declare const isIntegerFormat: import('./jsonforms-testers').Tester;
|
|
15
|
+
export declare const isDateControl: import('./jsonforms-testers').Tester;
|
|
16
|
+
export declare const isRelationControl: import('./jsonforms-testers').Tester;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ExtractPublicPropTypes, PropType } from 'vue';
|
|
2
|
+
import { SizeType } from '../../../../core/src/index.ts';
|
|
3
|
+
export declare const ViewModalProperties: {
|
|
4
|
+
/** Title displayed in the modal header. */
|
|
5
|
+
modalTitle: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
/** Label for the close button. */
|
|
10
|
+
closeLabel: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
/** Label for the edit button. Only rendered when `canEdit` is true. */
|
|
15
|
+
editLabel: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
/** Label for the delete button. Only rendered when `canDelete` is true. */
|
|
20
|
+
deleteLabel: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
/** JSON schema describing the shape of the form data. */
|
|
25
|
+
schema: {
|
|
26
|
+
type: PropType<any>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
/** UI schema describing the layout and controls. */
|
|
30
|
+
uiSchema: {
|
|
31
|
+
type: PropType<any>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
/** Modal width (`'xs'`, `'sm'`, `'md'`, `'lg'`, `'xl'`). */
|
|
35
|
+
modalSize: {
|
|
36
|
+
type: PropType<SizeType>;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
/** Callback invoked when the modal closes (with result or `null` on cancel). */
|
|
40
|
+
onClose: {
|
|
41
|
+
type: PropType<() => void>;
|
|
42
|
+
default: () => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Show the Edit button.
|
|
46
|
+
* The caller wires the action by listening to the `edit` event via `onEdit`
|
|
47
|
+
* in the props object — Vue's v-bind spread in modalWrapper converts onXxx
|
|
48
|
+
* keys into event handlers automatically.
|
|
49
|
+
*/
|
|
50
|
+
canEdit: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Show the Delete button.
|
|
56
|
+
* The caller wires the action by listening to the `delete` event via `onDelete`
|
|
57
|
+
* in the props object.
|
|
58
|
+
*/
|
|
59
|
+
canDelete: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
63
|
+
/** Initial form data to populate the form with. */
|
|
64
|
+
data: {
|
|
65
|
+
type: PropType<any>;
|
|
66
|
+
required: true;
|
|
67
|
+
};
|
|
68
|
+
/** Custom renderer registry passed to the inner JsonForm. */
|
|
69
|
+
renderers: {
|
|
70
|
+
type: PropType<any[]>;
|
|
71
|
+
default: null;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export type ViewModalProp = ExtractPublicPropTypes<typeof ViewModalProperties>;
|
|
75
|
+
export declare const ViewModalEmits: string[];
|
|
76
|
+
/** Result payload returned when the modal is submitted. */
|
|
77
|
+
export type ViewModalResult<DATA = any> = {
|
|
78
|
+
/** The form data at the time of submission. */
|
|
79
|
+
data: DATA;
|
|
80
|
+
/** Whether the form passed validation. */
|
|
81
|
+
valid: boolean;
|
|
82
|
+
};
|