@evoke-platform/ui-components 1.3.0-testing.0 → 1.4.0-dev.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 (42) hide show
  1. package/dist/published/components/core/Alert/Alert.js +1 -1
  2. package/dist/published/components/core/Autocomplete/Autocomplete.js +3 -3
  3. package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.js +2 -18
  4. package/dist/published/components/custom/CriteriaBuilder/PropertyTree.js +2 -2
  5. package/dist/published/components/custom/CriteriaBuilder/ValueEditor.js +23 -8
  6. package/dist/published/components/custom/CriteriaBuilder/index.d.ts +2 -1
  7. package/dist/published/components/custom/CriteriaBuilder/index.js +2 -1
  8. package/dist/published/components/custom/CriteriaBuilder/utils.d.ts +13 -0
  9. package/dist/published/components/custom/CriteriaBuilder/utils.js +58 -1
  10. package/dist/published/components/custom/Form/Common/Form.js +37 -26
  11. package/dist/published/components/custom/Form/Common/FormComponentWrapper.js +2 -1
  12. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.d.ts +2 -0
  13. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.js +75 -26
  14. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectPropertyInput.js +3 -2
  15. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ActionDialog.d.ts +5 -2
  16. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ActionDialog.js +4 -6
  17. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableField.js +4 -2
  18. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableFieldComponent.js +31 -13
  19. package/dist/published/components/custom/Form/tests/Form.test.d.ts +1 -0
  20. package/dist/published/components/custom/Form/tests/Form.test.js +158 -0
  21. package/dist/published/components/custom/Form/tests/test-data.d.ts +13 -0
  22. package/dist/published/components/custom/Form/tests/test-data.js +381 -0
  23. package/dist/published/components/custom/Form/utils.d.ts +10 -4
  24. package/dist/published/components/custom/Form/utils.js +206 -90
  25. package/dist/published/components/custom/FormField/AddressFieldComponent/addressFieldComponent.js +6 -2
  26. package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.js +6 -2
  27. package/dist/published/components/custom/HistoryLog/DisplayedProperty.d.ts +2 -1
  28. package/dist/published/components/custom/HistoryLog/DisplayedProperty.js +5 -2
  29. package/dist/published/components/custom/HistoryLog/HistoryData.d.ts +1 -0
  30. package/dist/published/components/custom/HistoryLog/HistoryData.js +9 -3
  31. package/dist/published/components/custom/HistoryLog/index.js +24 -2
  32. package/dist/published/components/custom/Menubar/Menubar.d.ts +2 -3
  33. package/dist/published/components/custom/Menubar/Menubar.js +15 -12
  34. package/dist/published/components/custom/index.d.ts +1 -1
  35. package/dist/published/components/custom/index.js +1 -1
  36. package/dist/published/index.d.ts +3 -2
  37. package/dist/published/index.js +3 -2
  38. package/dist/published/theme/hooks.d.ts +31 -0
  39. package/dist/published/theme/hooks.js +35 -0
  40. package/dist/published/theme/index.d.ts +3 -0
  41. package/dist/published/theme/index.js +3 -0
  42. package/package.json +4 -5
@@ -0,0 +1,381 @@
1
+ // Objects
2
+ export const licenseObject = {
3
+ id: 'license',
4
+ name: 'License',
5
+ properties: [
6
+ {
7
+ id: 'name',
8
+ name: 'License Number',
9
+ type: 'string',
10
+ },
11
+ {
12
+ id: 'status',
13
+ name: 'Status',
14
+ type: 'string',
15
+ enum: ['Active', 'Inactive'],
16
+ },
17
+ {
18
+ id: 'licenseType',
19
+ name: 'License Type',
20
+ type: 'object',
21
+ objectId: 'licenseType',
22
+ },
23
+ ],
24
+ actions: [
25
+ {
26
+ id: '_update',
27
+ name: 'Update',
28
+ type: 'update',
29
+ outputEvent: 'License Updated',
30
+ },
31
+ {
32
+ id: '_delete',
33
+ name: 'Delete',
34
+ type: 'delete',
35
+ outputEvent: 'License Deleted',
36
+ },
37
+ {
38
+ id: '_create',
39
+ name: 'Create',
40
+ type: 'create',
41
+ outputEvent: 'License Created',
42
+ },
43
+ ],
44
+ };
45
+ export const licenseTypeObject = {
46
+ id: 'licenseType',
47
+ name: 'License Type',
48
+ properties: [
49
+ {
50
+ id: 'name',
51
+ name: 'Name',
52
+ type: 'string',
53
+ },
54
+ {
55
+ id: 'licenseNumberPrefix',
56
+ name: 'License Number Prefix',
57
+ type: 'string',
58
+ },
59
+ ],
60
+ actions: [
61
+ {
62
+ id: '_update',
63
+ name: 'Update',
64
+ type: 'update',
65
+ outputEvent: 'License Type Updated',
66
+ },
67
+ {
68
+ id: '_delete',
69
+ name: 'Delete',
70
+ type: 'delete',
71
+ outputEvent: 'License Type Deleted',
72
+ },
73
+ {
74
+ id: '_create',
75
+ name: 'Create',
76
+ type: 'create',
77
+ outputEvent: 'License Type Created',
78
+ },
79
+ ],
80
+ };
81
+ export const specialtyObject = {
82
+ id: 'specialty',
83
+ name: 'Specialty',
84
+ properties: [
85
+ {
86
+ id: 'name',
87
+ name: 'Name',
88
+ type: 'string',
89
+ },
90
+ {
91
+ id: 'specialtyType',
92
+ name: 'Specialty Type',
93
+ type: 'object',
94
+ objectId: 'specialtyType',
95
+ },
96
+ {
97
+ id: 'license',
98
+ name: 'License',
99
+ type: 'object',
100
+ objectId: 'license',
101
+ },
102
+ ],
103
+ actions: [
104
+ {
105
+ id: '_update',
106
+ name: 'Update',
107
+ type: 'update',
108
+ outputEvent: 'Specialty Updated',
109
+ },
110
+ {
111
+ id: '_delete',
112
+ name: 'Delete',
113
+ type: 'delete',
114
+ outputEvent: 'Specialty Deleted',
115
+ },
116
+ {
117
+ id: '_create',
118
+ name: 'Create',
119
+ type: 'create',
120
+ outputEvent: 'Specialty Created',
121
+ parameters: [
122
+ {
123
+ id: 'name',
124
+ name: 'Name',
125
+ type: 'string',
126
+ },
127
+ {
128
+ id: 'specialtyType',
129
+ name: 'Specialty Type',
130
+ type: 'object',
131
+ objectId: 'specialtyType',
132
+ validation: {
133
+ criteria: {
134
+ $and: [{ 'licenseType.id': '{{{input.license.licenseType.id}}}' }],
135
+ },
136
+ },
137
+ },
138
+ {
139
+ id: 'license',
140
+ name: 'License',
141
+ type: 'object',
142
+ objectId: 'license',
143
+ },
144
+ ],
145
+ form: {
146
+ entries: [
147
+ {
148
+ parameterId: 'name',
149
+ type: 'input',
150
+ display: {
151
+ label: 'Name',
152
+ },
153
+ },
154
+ {
155
+ parameterId: 'specialtyType',
156
+ type: 'input',
157
+ display: {
158
+ label: 'Specialty Type',
159
+ relatedObjectDisplay: 'dropdown',
160
+ },
161
+ },
162
+ {
163
+ parameterId: 'license',
164
+ type: 'input',
165
+ display: {
166
+ label: 'License',
167
+ relatedObjectDisplay: 'dropdown',
168
+ },
169
+ },
170
+ ],
171
+ },
172
+ },
173
+ {
174
+ id: 'jsonLogicDisplayTest',
175
+ name: 'JsonLogic Display Test',
176
+ type: 'update',
177
+ outputEvent: 'Specialty Updated',
178
+ parameters: [
179
+ {
180
+ id: 'specialtyType',
181
+ name: 'Specialty Type',
182
+ type: 'object',
183
+ objectId: 'specialtyType',
184
+ },
185
+ {
186
+ id: 'license',
187
+ name: 'License',
188
+ type: 'object',
189
+ objectId: 'license',
190
+ },
191
+ ],
192
+ form: {
193
+ entries: [
194
+ {
195
+ parameterId: 'specialtyType',
196
+ type: 'input',
197
+ display: {
198
+ label: 'Specialty Type',
199
+ relatedObjectDisplay: 'dropdown',
200
+ visibility: {
201
+ '===': [
202
+ {
203
+ var: 'instance.name',
204
+ },
205
+ 'Test Specialty Object Instance',
206
+ ],
207
+ },
208
+ },
209
+ },
210
+ {
211
+ parameterId: 'license',
212
+ type: 'input',
213
+ display: {
214
+ label: 'License',
215
+ relatedObjectDisplay: 'dropdown',
216
+ },
217
+ },
218
+ ],
219
+ },
220
+ },
221
+ {
222
+ id: 'simpleConditionDisplayTest',
223
+ name: 'Simple Condition Display Test',
224
+ type: 'update',
225
+ outputEvent: 'Specialty Updated',
226
+ parameters: [
227
+ {
228
+ id: 'specialtyType',
229
+ name: 'Specialty Type',
230
+ type: 'object',
231
+ objectId: 'specialtyType',
232
+ },
233
+ {
234
+ id: 'license',
235
+ name: 'License',
236
+ type: 'object',
237
+ objectId: 'license',
238
+ },
239
+ ],
240
+ form: {
241
+ entries: [
242
+ {
243
+ parameterId: 'specialtyType',
244
+ type: 'input',
245
+ display: {
246
+ label: 'Specialty Type',
247
+ relatedObjectDisplay: 'dropdown',
248
+ visibility: {
249
+ operator: 'all',
250
+ conditions: [
251
+ {
252
+ property: 'name',
253
+ operator: 'eq',
254
+ value: 'Test Specialty Object Instance',
255
+ isInstanceProperty: true,
256
+ },
257
+ ],
258
+ },
259
+ },
260
+ },
261
+ {
262
+ parameterId: 'license',
263
+ type: 'input',
264
+ display: {
265
+ label: 'License',
266
+ relatedObjectDisplay: 'dropdown',
267
+ },
268
+ },
269
+ ],
270
+ },
271
+ },
272
+ ],
273
+ };
274
+ export const specialtyTypeObject = {
275
+ id: 'specialtyType',
276
+ name: 'Specialty Type',
277
+ properties: [
278
+ {
279
+ id: 'name',
280
+ name: 'Name',
281
+ type: 'string',
282
+ },
283
+ {
284
+ id: 'licenseType',
285
+ name: 'License Type',
286
+ type: 'object',
287
+ objectId: 'licenseType',
288
+ },
289
+ ],
290
+ actions: [
291
+ {
292
+ id: '_update',
293
+ name: 'Update',
294
+ type: 'update',
295
+ outputEvent: 'Specialty Type Updated',
296
+ },
297
+ {
298
+ id: '_delete',
299
+ name: 'Delete',
300
+ type: 'delete',
301
+ outputEvent: 'Specialty Type Deleted',
302
+ },
303
+ {
304
+ id: '_create',
305
+ name: 'Create',
306
+ type: 'create',
307
+ outputEvent: 'Specialty Type Created',
308
+ },
309
+ ],
310
+ };
311
+ // Instances
312
+ export const rnLicense = {
313
+ id: 'rnLicense',
314
+ objectId: 'license',
315
+ name: 'RN License',
316
+ licenseType: {
317
+ id: 'rnLicenseType',
318
+ name: 'RN License Type',
319
+ },
320
+ status: 'Active',
321
+ };
322
+ export const npLicense = {
323
+ id: 'npLicense',
324
+ objectId: 'license',
325
+ name: 'NP License',
326
+ licenseType: {
327
+ id: 'npLicenseType',
328
+ name: 'NP License Type',
329
+ },
330
+ status: 'Active',
331
+ };
332
+ export const rnLicenseType = {
333
+ id: 'rnLicenseType',
334
+ objectId: 'licenseType',
335
+ name: 'RN License Type',
336
+ licenseNumberPrefix: 'RN',
337
+ };
338
+ export const npLicesneType = {
339
+ id: 'npLicenseType',
340
+ objectId: 'licenseType',
341
+ name: 'NP License Type',
342
+ licenseNumberPrefix: 'NP',
343
+ };
344
+ export const rnSpecialtyType1 = {
345
+ id: 'specialtyType1',
346
+ objectId: 'specialtyType',
347
+ name: 'RN Specialty Type #1',
348
+ int: 1,
349
+ licenseType: {
350
+ id: 'rnLicenseType',
351
+ name: 'RN License Type',
352
+ },
353
+ };
354
+ export const rnSpecialtyType2 = {
355
+ id: 'specialtyType2',
356
+ objectId: 'specialtyType',
357
+ name: 'RN Specialty Type #2',
358
+ int: 1,
359
+ licenseType: {
360
+ id: 'rnLicenseType',
361
+ name: 'RN License Type',
362
+ },
363
+ };
364
+ export const npSpecialtyType1 = {
365
+ id: 'specialtyType3',
366
+ objectId: 'specialtyType',
367
+ name: 'NP Specialty Type #1',
368
+ licenseType: {
369
+ id: 'npLicenseType',
370
+ name: 'NP License Type',
371
+ },
372
+ };
373
+ export const npSpecialtyType2 = {
374
+ id: 'specialtyType4',
375
+ objectId: 'specialtyType',
376
+ name: 'NP Specialty Type #2',
377
+ licenseType: {
378
+ id: 'npLicenseType',
379
+ name: 'NP License Type',
380
+ },
381
+ };
@@ -1,4 +1,4 @@
1
- import { ActionInput, ActionInputType, ApiServices, FormEntry, InputParameter, InputParameterReference, Obj, ObjectInstance, Property, PropertyType } from '@evoke-platform/context';
1
+ import { ActionInput, ActionInputType, ApiServices, FormEntry, InputParameter, InputParameterReference, Obj, ObjectInstance, Property, PropertyType, UserAccount } from '@evoke-platform/context';
2
2
  import { ReactComponent } from '@formio/react';
3
3
  import { LocalDateTime } from '@js-joda/core';
4
4
  import { AutocompleteOption } from '../../core';
@@ -21,7 +21,11 @@ export declare function getMiddleObject(instance: ObjectInstance, property: Prop
21
21
  } | undefined;
22
22
  export declare function getMiddleInstance(instanceId: string, property: Property, middleObjectInstances: ObjectInstance[]): ObjectInstance | undefined;
23
23
  export declare function getPrefixedUrl(url: string): string;
24
- export declare function addObjectPropertiesToComponentProps(properties: Property[], formComponents: any[], instance?: ObjectInstance, objectPropertyInputProps?: ObjectPropertyInputProps, autoSave?: (data: Record<string, unknown>) => void, readOnly?: boolean, defaultPages?: Record<string, string>, navigateTo?: (path: string) => void, queryAddresses?: (query: string) => Promise<Address[]>, apiServices?: ApiServices, isModal?: boolean, fieldHeight?: 'small' | 'medium', richTextEditor?: typeof ReactComponent): Promise<ActionInput[]>;
24
+ export declare function flattenFormComponents(components?: ActionInput[]): ActionInput[];
25
+ export declare function addObjectPropertiesToComponentProps(properties: Property[], formComponents: any[], allCriteriaInputs?: string[], instance?: ObjectInstance, objectPropertyInputProps?: ObjectPropertyInputProps, associatedObject?: {
26
+ instanceId?: string;
27
+ propertyId?: string;
28
+ }, autoSave?: (data: Record<string, unknown>) => void, readOnly?: boolean, defaultPages?: Record<string, string>, navigateTo?: (path: string) => void, queryAddresses?: (query: string) => Promise<Address[]>, apiServices?: ApiServices, isModal?: boolean, fieldHeight?: 'small' | 'medium', richTextEditor?: typeof ReactComponent): Promise<ActionInput[]>;
25
29
  export declare function getDefaultValue(initialValue: unknown, selectOptions?: AutocompleteOption[]): unknown;
26
30
  export declare const buildComponentPropsFromObjectProperties: (properties: Property[], objectId: string, instance?: ObjectInstance, objectPropertyInputProps?: ObjectPropertyInputProps, hasActionPermissions?: boolean, autoSave?: ((data: Record<string, unknown>) => void) | undefined, readOnly?: boolean, queryAddresses?: ((query: string) => Promise<Address[]>) | undefined, isModal?: boolean, fieldHeight?: 'small' | 'medium', richTextEditor?: typeof ReactComponent) => unknown[];
27
31
  export declare const buildComponentPropsFromDocumentProperties: (documentProperties: [string, unknown][], readOnly?: boolean, autoSave?: ((data: Record<string, unknown>) => void) | undefined, fieldHeight?: 'small' | 'medium') => {
@@ -35,8 +39,10 @@ export declare const buildComponentPropsFromDocumentProperties: (documentPropert
35
39
  }[];
36
40
  export declare const OPERATOR_MAP: Record<string, string>;
37
41
  export declare function transformToWhere(mongoQuery: object): Record<string, unknown>;
38
- export declare function updateCriteriaInputs(criteria: Record<string, unknown>, field: string, fieldValue: string, isInputField?: boolean): void;
39
- export declare function getAllCriteriaInputs(criteria: Record<string, unknown>): string[];
42
+ export declare function updateCriteriaInputs(criteria: Record<string, unknown>, data: Record<string, unknown>, user?: UserAccount): Record<string, unknown>;
43
+ export declare function getCriteriaInputs(criteria?: Record<string, unknown>): string[];
44
+ export declare function getAllCriteriaInputs(components: ActionInput[] | InputParameter[]): string[];
45
+ export declare function populateInstanceWithNestedData(instanceId: string, objectId: string, paths: string[], apiServices: ApiServices): Promise<ObjectInstance>;
40
46
  export declare function isPropertyVisible(conditional: {
41
47
  when: string;
42
48
  show: boolean;