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