@genesislcap/foundation-forms 14.12.0 → 14.12.1-web-types.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.
@@ -1,298 +0,0 @@
1
- import { DatasourceOptions } from '@genesislcap/foundation-comms';
2
- import { ErrorObject } from 'ajv';
3
- import { ErrorTranslator } from '@jsonforms/core';
4
- import { Expression } from '@genesislcap/foundation-criteria';
5
- import { FASTElement } from '@microsoft/fast-element';
6
- import { FoundationElement } from '@microsoft/fast-foundation';
7
- import { JsonFormsState } from '@jsonforms/core';
8
- import { JSONSchema7 } from 'json-schema';
9
- import { Logger } from '@genesislcap/foundation-utils';
10
- import { OwnPropsOfControl } from '@jsonforms/core';
11
- import { RankedTester } from '@jsonforms/core';
12
- import { StatePropsOfControl } from '@jsonforms/core';
13
- import { UISchemaElement } from '@jsonforms/core';
14
- import { ViewTemplate } from '@microsoft/fast-element';
15
-
16
- /**
17
- * Creates a expressions/criteria from given payload
18
- * @public
19
- */
20
- export declare const createExpressions: (payload: any) => Expressions;
21
-
22
- declare class DispatchRenderer extends FASTElement {
23
- jsonforms: any;
24
- jsonformsChanged(): void;
25
- props: any;
26
- propsChanged(): void;
27
- touched: any;
28
- submitted: boolean;
29
- submittedChanged(): void;
30
- dispatch: any;
31
- control: any;
32
- renderer: any;
33
- createRenderer: () => void;
34
- onBlur(): void;
35
- get determinedRenderer(): unknown;
36
- disconnectedCallback(): void;
37
- }
38
-
39
- declare type Expressions = {
40
- options: Expression[];
41
- numberOptions: Expression[];
42
- dateOptions: Expression[];
43
- };
44
-
45
- /**
46
- * Foundation filters component for automatically generated filters based on json schema
47
- * obtained from the api, supplied initial data or supplied JSON schema.
48
- * Allowing customisable filters elements using UI schema and set of custom renderers
49
- * @beta
50
- */
51
- export declare class Filters extends FoundationElement {
52
- /**
53
- * Name of the backend resource which will provide metadata
54
- * used to generate filters
55
- * @public
56
- */
57
- resourceName: string;
58
- private resourceNameChanged;
59
- clearFiltersData(): void;
60
- /**
61
- * UI schema used to define configuration of the layout and elements in the filters
62
- * Check {@link UiSchemaElement} for possible options
63
- *
64
- * @remarks
65
- * If not provided will be autogenerated based on json schema or initial data
66
- *
67
- * @example
68
- * Here's a simple example:
69
- * ```
70
- * const sampleUISchema = {
71
- * type: 'VerticalLayout',
72
- * elements: [
73
- * {
74
- * type: 'Control',
75
- * scope: '#/properties/QUANTITY',
76
- * label: 'Quantity',
77
- * },
78
- * {
79
- * type: 'Control',
80
- * scope: '#/properties/INSTRUMENT_ID',
81
- * options: {
82
- * allOptionsResourceName: 'INSTRUMENT',
83
- * valueField: 'INSTRUMENT_ID',
84
- * labelField: 'INSTRUMENT_ID',
85
- * },
86
- * label: 'Instrument',
87
- * },
88
- * {
89
- * type: 'Control',
90
- * scope: '#/properties/SIDE',
91
- * label: 'Side',
92
- * },
93
- * ],
94
- * };
95
- * ```
96
- * @public
97
- */
98
- uischema: UISchemaElement;
99
- /**
100
- * Allows to provide set of renderers used by the filters. If not provided it will default to text-field inputs
101
- * @public
102
- */
103
- renderers: RendererEntry[];
104
- /**
105
- * Alternatively to providing {@link Form.resourceName} you can hardcode the JSON schema on the client.
106
- * @public
107
- * @remarks
108
- * Use this when you want to avoid fetching metadata from the server but
109
- * be aware that it could get out of sync if metadata changes on the server
110
- */
111
- jsonSchema: JSONSchema7;
112
- private connect;
113
- /**
114
- * Initial data for the filters
115
- * @public
116
- */
117
- data: any;
118
- /**
119
- * Created criteria based on the given data that can be used to filter the data
120
- * @public
121
- */
122
- value: string;
123
- valueChanged(): void;
124
- /**
125
- * @internal
126
- */
127
- searchFilters(): void;
128
- /**
129
- * @internal
130
- */
131
- onChange(event: CustomEvent): void;
132
- disconnectedCallback(): void;
133
- }
134
-
135
- /** @internal */
136
- export declare const filtersLogger: Logger;
137
-
138
- /** @public */
139
- export declare const filtersRenderers: any[];
140
-
141
- /**
142
- * Foundation form component for automatically generated forms based on json schema
143
- * obtained from the api, supplied initial data or supplied JSON schema.
144
- * Allowing customisable form elements using UI schema and set of custom renderers
145
- * @beta
146
- */
147
- export declare class Form extends FoundationElement {
148
- /**
149
- * Name of the backend resource which will provide metadata
150
- * used to generate form and later used for submitting data
151
- * @public
152
- */
153
- resourceName: string;
154
- private resourceNameChanged;
155
- private removeDataProperties;
156
- /**
157
- * UI schema used to define configuration of the layout and elements in the form
158
- * Check {@link UiSchemaElement} for possible options
159
- *
160
- * @remarks
161
- * If not provided will be autogenerated based on json schema or initial data
162
- *
163
- * @example
164
- * Here's a simple example:
165
- * ```
166
- * const sampleUISchema = {
167
- * type: 'VerticalLayout',
168
- * elements: [
169
- * {
170
- * type: 'Control',
171
- * scope: '#/properties/QUANTITY',
172
- * label: 'Quantity',
173
- * },
174
- * {
175
- * type: 'Control',
176
- * scope: '#/properties/INSTRUMENT_ID',
177
- * options: {
178
- * allOptionsResourceName: 'INSTRUMENT',
179
- * valueField: 'INSTRUMENT_ID',
180
- * labelField: 'INSTRUMENT_ID',
181
- * },
182
- * label: 'Instrument',
183
- * },
184
- * {
185
- * type: 'Control',
186
- * scope: '#/properties/SIDE',
187
- * label: 'Side',
188
- * },
189
- * ],
190
- * };
191
- * ```
192
- * @public
193
- */
194
- uischema: UISchemaElement;
195
- /**
196
- * Allows to provide set of renderers used by the form. If not provided it will default to text-field inputs
197
- * @public
198
- */
199
- renderers: RendererEntry[];
200
- /**
201
- * Alternatively to providing {@link Form.resourceName} you can hardcode the JSON schema on the client.
202
- * @public
203
- * @remarks
204
- * Use this when you want to avoid fetching metadata from the server but
205
- * be aware that it could get out of sync if metadata changes on the server
206
- */
207
- jsonSchema: JSONSchema7;
208
- private errors;
209
- private connect;
210
- /**
211
- * Initial data for the form
212
- * @public
213
- */
214
- data: any;
215
- /**
216
- * @internal
217
- */
218
- submitting: boolean;
219
- /**
220
- * @internal
221
- */
222
- submitted: boolean;
223
- readonly: boolean;
224
- /**
225
- * @internal
226
- */
227
- _submit(): Promise<void>;
228
- /**
229
- * @internal
230
- */
231
- onChange(event: CustomEvent): void;
232
- disconnectedCallback(): void;
233
- }
234
-
235
- /** @public */
236
- export declare const genesisErrorTranslator: ErrorTranslator;
237
-
238
- /** @internal */
239
- export declare const logger: Logger;
240
-
241
- /**
242
- * Ensures the value of the current field (the one the validator is on) matches the one of the target field.
243
- * @param target - any other field
244
- * @returns a validator function that will be run by the smart form during the client-side validation stage
245
- * @public
246
- */
247
- export declare const mustMatch: (target: string) => (data: any, path: any, label: any) => {
248
- instancePath: string;
249
- message: string;
250
- schemaPath: string;
251
- keyword: string;
252
- params: {};
253
- }[];
254
-
255
- /** @public */
256
- export declare type RendererEntry = {
257
- renderer: ViewTemplate<DispatchRenderer, any>;
258
- tester: RankedTester;
259
- mapper: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControl;
260
- };
261
-
262
- /** @public */
263
- export declare const renderers: any[];
264
-
265
- /** @public */
266
- export declare type UiSchema = {
267
- type: UiSchemaElementType;
268
- elements: UiSchemaElement[];
269
- };
270
-
271
- /** @public */
272
- export declare type UiSchemaElement = {
273
- type: UiSchemaElementType;
274
- scope: string;
275
- label?: string;
276
- options?: UiSchemaElementOptions;
277
- };
278
-
279
- /** @public */
280
- export declare type UiSchemaElementOptions = {
281
- allOptionsResourceName?: string;
282
- datasourceConfig?: DatasourceOptions;
283
- hidden?: boolean;
284
- isPassword?: boolean;
285
- validateFn?: (data: any, path: string, label: string) => ErrorObject[];
286
- valueField?: string;
287
- labelField?: string;
288
- textarea?: boolean;
289
- data?: any[];
290
- i18n?: {
291
- [key: string]: any;
292
- };
293
- };
294
-
295
- /** @public */
296
- export declare type UiSchemaElementType = 'Control' | 'VerticalLayout' | any;
297
-
298
- export { }