@earthranger/react-native-jsonforms-formatter 1.0.7 → 2.0.0-beta.2

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/README.md CHANGED
@@ -4,7 +4,18 @@
4
4
 
5
5
  [ci-url]: https://github.com/PADAS/react-native-jsonforms-formatter/actions/workflows/npm-build.yml/badge.svg
6
6
 
7
- A Node.js library for validating JSONSchema and generating UISchema for a custom ReactNative JSONForms element.
7
+ A Node.js library for validating JSONSchema and generating UISchema for a custom ReactNative JSONForms element. Supports both v1 (legacy) and v2 (modern) schema formats with full backward compatibility.
8
+
9
+ ## Features
10
+
11
+ - ✅ **JSON Schema Validation**: Validates and sanitizes JSON schema strings
12
+ - 🎨 **UI Schema Generation**: Creates UI schemas compatible with JSONForms
13
+ - 📱 **React Native Ready**: Optimized for React Native applications
14
+ - 🔄 **Dual Version Support**: V1 (legacy) and V2 (modern) schema formats
15
+
16
+ ## Architecture
17
+
18
+ For detailed component information, see [component-diagram.md](./component-diagram.md).
8
19
 
9
20
  ## Installation
10
21
 
@@ -24,26 +35,67 @@ npm install --save react-native-jsonforms-formatter
24
35
 
25
36
  ## Usage
26
37
 
27
- The library provides two main functions: `validateJSONSchema` and `generateUISchema`.
38
+ The library supports two schema formats: **V1 (legacy)** and **V2 (modern)**. Choose the appropriate version based on your schema format.
39
+
40
+ ### Version Support
28
41
 
29
- ### Validating JSONSchema
42
+ - **V1 (Default/Legacy)**: Traditional JSONSchema format with `schema` and `definition` properties
43
+ - **V2 (Modern)**: New format with `json` and `ui` properties, following JSON Schema Draft 2020-12
44
+
45
+ ### Client Integration
46
+
47
+ #### Default Import (V1 - Backward Compatible)
48
+
49
+ ```typescript
50
+ import { validateJSONSchema, generateUISchema } from "react-native-jsonforms-formatter";
51
+ // Uses V1 implementation by default
52
+ ```
30
53
 
31
- You can use the `validateJSONSchema` function to validate a JSONSchema string:
54
+ #### Explicit Version Imports
55
+
56
+ ```typescript
57
+ // V1 specific imports
58
+ import { v1 } from "react-native-jsonforms-formatter";
59
+ const { validateJSONSchema, generateUISchema } = v1;
60
+
61
+ // V2 specific imports
62
+ import { v2 } from "react-native-jsonforms-formatter";
63
+ const { generateUISchema } = v2;
64
+
65
+ // Or direct imports
66
+ import { v1, v2 } from "react-native-jsonforms-formatter";
67
+ ```
68
+
69
+ ## V1 Schema Format (Legacy)
70
+
71
+ ### Validating V1 JSONSchema
32
72
 
33
73
  ```typescript
34
74
  import { validateJSONSchema } from "react-native-jsonforms-formatter";
35
75
 
36
76
  const stringSchema = `
37
77
  {
38
- "type": "object",
39
- "properties": {
78
+ "schema": {
79
+ "type": "object",
80
+ "properties": {
81
+ "name": {
82
+ "type": "string",
83
+ "title": "Name"
84
+ },
85
+ "age": {
86
+ "type": "integer",
87
+ "title": "Age"
88
+ }
89
+ }
90
+ },
91
+ "definition": {
40
92
  "name": {
41
- "type": "string",
42
- "title": "Name"
93
+ "inputType": "text",
94
+ "placeholder": "Enter your name"
43
95
  },
44
96
  "age": {
45
- "type": "integer",
46
- "title": "Age"
97
+ "inputType": "number",
98
+ "placeholder": "Enter your age"
47
99
  }
48
100
  }
49
101
  }
@@ -52,11 +104,9 @@ const stringSchema = `
52
104
  const jsonSchema = validateJSONSchema(stringSchema);
53
105
  ```
54
106
 
55
- The `validateJSONSchema` function returns a valid JSONSchema object if the input string is a valid JSONSchema. If the input is not valid, it will throw an error.
56
-
57
- ### Generating UISchema
107
+ **Returns**: A validated V1 schema object with normalized decimal separators and cleaned properties.
58
108
 
59
- You can use the `generateUISchema` function to generate a UISchema object from a valid JSONSchema:
109
+ ### Generating V1 UI Schema
60
110
 
61
111
  ```typescript
62
112
  import { generateUISchema } from "react-native-jsonforms-formatter";
@@ -64,11 +114,187 @@ import { generateUISchema } from "react-native-jsonforms-formatter";
64
114
  const uiSchema = generateUISchema(jsonSchema);
65
115
  ```
66
116
 
67
- The `generateUISchema` function returns a `UISchema` object that can be used with the ReactNative JSONForms library.
117
+ **Returns**: JSONForms-compatible UI schema optimized for React Native:
118
+
119
+ ```typescript
120
+ {
121
+ type: "VerticalLayout",
122
+ elements: [
123
+ {
124
+ type: "Control",
125
+ scope: "#/properties/name",
126
+ label: "Name",
127
+ options: {
128
+ placeholder: "Enter your name"
129
+ }
130
+ },
131
+ {
132
+ type: "Control",
133
+ scope: "#/properties/age",
134
+ label: "Age",
135
+ options: {
136
+ format: "number",
137
+ placeholder: "Enter your age"
138
+ }
139
+ }
140
+ ]
141
+ }
142
+ ```
143
+
144
+ ## V2 Schema Format
145
+
146
+ V2 schemas use a new format with `json` and `ui` properties, following JSON Schema Draft 2020-12.
147
+
148
+ ### Generating V2 UI Schema
149
+
150
+ ```typescript
151
+ import { v2 } from "react-native-jsonforms-formatter";
152
+
153
+ const v2Schema = {
154
+ "json": {
155
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
156
+ "additionalProperties": false,
157
+ "properties": {
158
+ "patrol_leader": {
159
+ "deprecated": false,
160
+ "description": "Name of the patrol leader",
161
+ "title": "Patrol Leader",
162
+ "type": "string"
163
+ },
164
+ "patrol_size": {
165
+ "deprecated": false,
166
+ "description": "Number of people in the patrol",
167
+ "title": "Patrol Size",
168
+ "type": "number",
169
+ "minimum": 1,
170
+ "maximum": 20
171
+ },
172
+ "patrol_location": {
173
+ "deprecated": false,
174
+ "description": "GPS coordinates of patrol location",
175
+ "title": "Patrol Location",
176
+ "type": "object",
177
+ "properties": {
178
+ "latitude": { "type": "number", "minimum": -90, "maximum": 90 },
179
+ "longitude": { "type": "number", "minimum": -180, "maximum": 180 }
180
+ }
181
+ }
182
+ },
183
+ "required": ["patrol_leader", "patrol_size"],
184
+ "type": "object"
185
+ },
186
+ "ui": {
187
+ "fields": {
188
+ "patrol_leader": {
189
+ "inputType": "SHORT_TEXT",
190
+ "parent": "section-details",
191
+ "placeholder": "Enter patrol leader name",
192
+ "type": "TEXT"
193
+ },
194
+ "patrol_size": {
195
+ "parent": "section-details",
196
+ "placeholder": "5",
197
+ "type": "NUMERIC"
198
+ },
199
+ "patrol_location": {
200
+ "parent": "section-location",
201
+ "type": "LOCATION"
202
+ }
203
+ },
204
+ "order": ["section-details", "section-location"],
205
+ "sections": {
206
+ "section-details": {
207
+ "columns": 1,
208
+ "isActive": true,
209
+ "label": "Patrol Details",
210
+ "leftColumn": [
211
+ { "name": "patrol_leader", "type": "field" },
212
+ { "name": "patrol_size", "type": "field" }
213
+ ],
214
+ "rightColumn": []
215
+ },
216
+ "section-location": {
217
+ "columns": 1,
218
+ "isActive": true,
219
+ "label": "Location",
220
+ "leftColumn": [
221
+ { "name": "patrol_location", "type": "field" }
222
+ ],
223
+ "rightColumn": []
224
+ }
225
+ }
226
+ }
227
+ };
228
+
229
+ const uiSchema = v2.generateUISchema(v2Schema);
230
+ ```
231
+
232
+ **Returns**: JSONForms-compatible UI schema with advanced field types and section management:
233
+
234
+ ```typescript
235
+ {
236
+ type: "VerticalLayout",
237
+ elements: [
238
+ {
239
+ type: "VerticalLayout",
240
+ label: "Patrol Details",
241
+ elements: [
242
+ {
243
+ type: "Control",
244
+ scope: "#/properties/patrol_leader",
245
+ label: "Patrol Leader",
246
+ options: {
247
+ placeholder: "Enter patrol leader name",
248
+ description: "Name of the patrol leader"
249
+ }
250
+ },
251
+ {
252
+ type: "Control",
253
+ scope: "#/properties/patrol_size",
254
+ label: "Patrol Size",
255
+ options: {
256
+ format: "number",
257
+ placeholder: "5",
258
+ description: "Number of people in the patrol"
259
+ }
260
+ }
261
+ ]
262
+ },
263
+ {
264
+ type: "VerticalLayout",
265
+ label: "Location",
266
+ elements: [
267
+ {
268
+ type: "Control",
269
+ scope: "#/properties/patrol_location",
270
+ label: "Patrol Location",
271
+ options: {
272
+ format: "location",
273
+ display: "map",
274
+ description: "GPS coordinates of patrol location"
275
+ }
276
+ }
277
+ ]
278
+ }
279
+ ]
280
+ }
281
+ ```
282
+
283
+ ### V2 Field Types
284
+
285
+ V2 supports advanced field types:
68
286
 
69
- ## Putting it all together
287
+ - **TEXT**: `SHORT_TEXT`, `LONG_TEXT` (multi-line)
288
+ - **NUMERIC**: Number fields with validation
289
+ - **CHOICE_LIST**: Dropdowns and list selections
290
+ - **DATE_TIME**: Date and time pickers
291
+ - **LOCATION**: GPS coordinate fields with map display
292
+ - **COLLECTION**: Arrays with nested field structures
293
+ - **ATTACHMENT**: File upload fields
70
294
 
71
- Here's an example of how you can use the library in a ReactNative application:
295
+ ## Complete React Native Examples
296
+
297
+ ### V1 Schema Example
72
298
 
73
299
  ```typescript
74
300
  import { JsonForms } from "@jsonforms/react-native";
@@ -79,31 +305,44 @@ import {
79
305
  validateJSONSchema,
80
306
  } from "react-native-jsonforms-formatter";
81
307
 
82
- const stringSchema = `
308
+ const v1StringSchema = `
83
309
  {
84
- "type": "object",
85
- "properties": {
310
+ "schema": {
311
+ "type": "object",
312
+ "properties": {
313
+ "name": {
314
+ "type": "string",
315
+ "title": "Name"
316
+ },
317
+ "age": {
318
+ "type": "integer",
319
+ "title": "Age"
320
+ }
321
+ }
322
+ },
323
+ "definition": {
86
324
  "name": {
87
- "type": "string",
88
- "title": "Name"
325
+ "inputType": "text",
326
+ "placeholder": "Enter your name"
89
327
  },
90
328
  "age": {
91
- "type": "integer",
92
- "title": "Age"
329
+ "inputType": "number",
330
+ "placeholder": "Enter your age"
93
331
  }
94
332
  }
95
333
  }
96
334
  `;
97
335
 
98
- const jsonSchema = validateJSONSchema(stringSchema);
99
- const uiSchema = generateUISchema(jsonSchema);
100
-
101
- const App = () => {
336
+ const V1App = () => {
102
337
  const [data, setData] = React.useState({ name: "John Doe", age: 30 });
338
+
339
+ // Validate and generate UI schema
340
+ const jsonSchema = validateJSONSchema(v1StringSchema);
341
+ const uiSchema = generateUISchema(jsonSchema);
103
342
 
104
343
  return (
105
344
  <JsonForms
106
- schema={jsonSchema}
345
+ schema={jsonSchema.schema}
107
346
  uischema={uiSchema}
108
347
  data={data}
109
348
  renderers={RNRenderers}
@@ -112,18 +351,91 @@ const App = () => {
112
351
  />
113
352
  );
114
353
  };
115
-
116
- export default App;
117
354
  ```
118
355
 
119
- ## Contributors
356
+ ### V2 Schema Example
120
357
 
121
- Contributions are welcome! If you find a bug or have a feature request, please open an issue.
358
+ ```typescript
359
+ import { JsonForms } from "@jsonforms/react-native";
360
+ import { RNCells, RNRenderers } from "@jsonforms/react-native-renderers";
361
+ import React from "react";
362
+ import { v2 } from "react-native-jsonforms-formatter";
363
+
364
+ const v2Schema = {
365
+ "json": {
366
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
367
+ "additionalProperties": false,
368
+ "properties": {
369
+ "patrol_leader": {
370
+ "deprecated": false,
371
+ "description": "Name of the patrol leader",
372
+ "title": "Patrol Leader",
373
+ "type": "string"
374
+ },
375
+ "patrol_size": {
376
+ "deprecated": false,
377
+ "description": "Number of people in the patrol",
378
+ "title": "Patrol Size",
379
+ "type": "number",
380
+ "minimum": 1,
381
+ "maximum": 20
382
+ }
383
+ },
384
+ "required": ["patrol_leader", "patrol_size"],
385
+ "type": "object"
386
+ },
387
+ "ui": {
388
+ "fields": {
389
+ "patrol_leader": {
390
+ "inputType": "SHORT_TEXT",
391
+ "parent": "section-details",
392
+ "placeholder": "Enter patrol leader name",
393
+ "type": "TEXT"
394
+ },
395
+ "patrol_size": {
396
+ "parent": "section-details",
397
+ "placeholder": "5",
398
+ "type": "NUMERIC"
399
+ }
400
+ },
401
+ "order": ["section-details"],
402
+ "sections": {
403
+ "section-details": {
404
+ "columns": 1,
405
+ "isActive": true,
406
+ "label": "Patrol Details",
407
+ "leftColumn": [
408
+ { "name": "patrol_leader", "type": "field" },
409
+ { "name": "patrol_size", "type": "field" }
410
+ ],
411
+ "rightColumn": []
412
+ }
413
+ }
414
+ }
415
+ };
122
416
 
123
- <a href="https://github.com/PADAS/react-native-jsonforms-formatter/graphs/contributors">
124
- <img src="https://contributors-img.web.app/image?repo=PADAS/react-native-jsonforms-formatter" />
125
- </a>
417
+ const V2App = () => {
418
+ const [data, setData] = React.useState({
419
+ patrol_leader: "John Smith",
420
+ patrol_size: 5
421
+ });
422
+
423
+ // Generate UI schema using V2
424
+ const uiSchema = v2.generateUISchema(v2Schema);
126
425
 
426
+ return (
427
+ <JsonForms
428
+ schema={v2Schema.json}
429
+ uischema={uiSchema}
430
+ data={data}
431
+ renderers={RNRenderers}
432
+ cells={RNCells}
433
+ onChange={(event) => setData(event.data)}
434
+ />
435
+ );
436
+ };
437
+ ```
127
438
  ## Licensing
128
439
 
129
440
  A copy of the license is available in the repository's [LICENSE](LICENSE) file.
441
+
package/dist/bundle.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{void 0!==f&&f.toStringTag&&Object.defineProperty(e,f.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{generateUISchema:()=>Ge,v1:()=>r,validateJSONSchema:()=>st});var r={};e.r(r),e.d(r,{generateUISchema:()=>Ge,validateJSONSchema:()=>st});var n=Object.prototype;const i=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)},o=(a=Object.keys,c=Object,function(e){return a(c(e))});var a,c,u=Object.prototype.hasOwnProperty;const s="object"==typeof global&&global&&global.Object===Object&&global;var l="object"==typeof self&&self&&self.Object===Object&&self;const p=s||l||Function("return this")();var f=p.Symbol;const m=f;var d=Object.prototype,h=d.hasOwnProperty,v=d.toString,y=m?m.toStringTag:void 0;var b=Object.prototype.toString;var j=m?m.toStringTag:void 0;const g=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=h.call(e,y),r=e[y];try{e[y]=void 0;var n=!0}catch(e){}var i=v.call(e);return n&&(t?e[y]=r:delete e[y]),i}(e):function(e){return b.call(e)}(e)},O=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!O(e))return!1;var t=g(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},w=p["__core-js_shared__"];var S,x=(S=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"";var A=Function.prototype.toString;const M=function(e){if(null!=e){try{return A.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var _=/^\[object .+?Constructor\]$/,E=Function.prototype,q=Object.prototype,N=E.toString,D=q.hasOwnProperty,F=RegExp("^"+N.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const P=function(e){return!(!O(e)||function(e){return!!x&&x in e}(e))&&(k(e)?F:_).test(M(e))},T=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return P(r)?r:void 0},C=T(p,"DataView"),H=T(p,"Map"),I=T(p,"Promise"),$=T(p,"Set"),R=T(p,"WeakMap");var U="[object Map]",B="[object Promise]",L="[object Set]",J="[object WeakMap]",V="[object DataView]",W=M(C),z=M(H),G=M(I),K=M($),Q=M(R),X=g;(C&&X(new C(new ArrayBuffer(1)))!=V||H&&X(new H)!=U||I&&X(I.resolve())!=B||$&&X(new $)!=L||R&&X(new R)!=J)&&(X=function(e){var t=g(e),r="[object Object]"==t?e.constructor:void 0,n=r?M(r):"";if(n)switch(n){case W:return V;case z:return U;case G:return B;case K:return L;case Q:return J}return t});const Y=X,Z=function(e){return null!=e&&"object"==typeof e},ee=function(e){return Z(e)&&"[object Arguments]"==g(e)};var te=Object.prototype,re=te.hasOwnProperty,ne=te.propertyIsEnumerable;const ie=ee(function(){return arguments}())?ee:function(e){return Z(e)&&re.call(e,"callee")&&!ne.call(e,"callee")},oe=Array.isArray,ae=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ce="object"==typeof exports&&exports&&!exports.nodeType&&exports,ue=ce&&"object"==typeof module&&module&&!module.nodeType&&module,se=ue&&ue.exports===ce?p.Buffer:void 0;const le=(se?se.isBuffer:void 0)||function(){return!1};var pe={};pe["[object Float32Array]"]=pe["[object Float64Array]"]=pe["[object Int8Array]"]=pe["[object Int16Array]"]=pe["[object Int32Array]"]=pe["[object Uint8Array]"]=pe["[object Uint8ClampedArray]"]=pe["[object Uint16Array]"]=pe["[object Uint32Array]"]=!0,pe["[object Arguments]"]=pe["[object Array]"]=pe["[object ArrayBuffer]"]=pe["[object Boolean]"]=pe["[object DataView]"]=pe["[object Date]"]=pe["[object Error]"]=pe["[object Function]"]=pe["[object Map]"]=pe["[object Number]"]=pe["[object Object]"]=pe["[object RegExp]"]=pe["[object Set]"]=pe["[object String]"]=pe["[object WeakMap]"]=!1;var fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=fe&&"object"==typeof module&&module&&!module.nodeType&&module,de=me&&me.exports===fe&&s.process,he=function(){try{return me&&me.require&&me.require("util").types||de&&de.binding&&de.binding("util")}catch(e){}}(),ve=he&&he.isTypedArray;const ye=ve?function(e){return function(t){return e(t)}}(ve):function(e){return Z(e)&&ae(e.length)&&!!pe[g(e)]};var be=Object.prototype.hasOwnProperty;const je=function(e){if(null==e)return!0;if(function(e){return null!=e&&ae(e.length)&&!k(e)}(e)&&(oe(e)||"string"==typeof e||"function"==typeof e.splice||le(e)||ye(e)||ie(e)))return!e.length;var t=Y(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(i(e))return!function(e){if(!i(e))return o(e);var t=[];for(var r in Object(e))u.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e).length;for(var r in e)if(be.call(e,r))return!1;return!0};var ge,Oe,ke,we=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},Se="fieldset",xe="checkboxes",Ae="string";!function(e){e.DateTime="date-time",e.Date="date"}(ge||(ge={})),function(e){e.DateTime="date-time",e.MultiSelect="multiselect",e.RepeatableField="repeatable-field",e.FormLabel="form-label"}(Oe||(Oe={})),function(e){e.Header="header"}(ke||(ke={}));var Me,_e=function(e){var t=e.toLowerCase().replace(/[\s\\/\\%]/gi,"_");return"fieldset__title_".concat(t)},Ee=function(e){return new Set(e).size!==e.length},qe=function(e){return Te(e)&&e.type===xe},Ne=function(e){return null==e||0===e.trim().length},De=function(e){return Te(e)&&e.type===Se&&!je(e.title)},Fe=function(e){return Te(e)&&e.type===Se&&e.items.length>0},Pe=function(e){var t,r;return e.type===Ae&&(null===(t=e.enum)||void 0===t?void 0:t.length)>0&&(null===(r=e.inactive_enum)||void 0===r?void 0:r.length)>0},Te=function(e){return e instanceof Object},Ce=function(e){return!je(e.key)},He=function(e){return 0!==e.length&&void 0!==e.find((function(e){return Te(e)&&e&&(e.type||"")===Se}))},Ie=function(e){return typeof e===Ae},$e=function(e){if("number"==typeof e)return e;if("string"!=typeof e)return e;var t=e.trim();if(""===t)return e;if(/^-?\d+,\d+$/.test(t)){var r=t.replace(",","."),n=parseFloat(r);if(!isNaN(n))return r}return e},Re=function(e,t,r){void 0===r&&(r=[]),"object"==typeof e&&null!==e&&(t(e,r),Array.isArray(e)?e.forEach((function(e,n){return Re(e,t,we(we([],r,!0),[n.toString()],!1))})):Object.entries(e).forEach((function(e){var n=e[0],i=e[1];return Re(i,t,we(we([],r,!0),[n],!1))})))},Ue=function(e){return e.includes(xe)},Be=function(e){return e.includes("inactive_enum")},Le=function(e){return e.includes("inactive_titleMap")},Je=function(e){return e.includes("enum")},Ve=function(){return Ve=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ve.apply(this,arguments)};!function(e){e.Number="number",e.String="string",e.Array="array"}(Me||(Me={}));var We=function(e,t,r){return void 0===r&&(r={}),Ve({type:"Control",scope:"#/properties/".concat(e),label:t},r&&{options:r})},ze=function(e,t,r){void 0===r&&(r=void 0);try{var n=r||t.definition.find((function(t){return t.key===e}));if("date-time-picker json-schema"===n.fieldHtmlClass||n&&"datetime"===(n.type||""))return"date"===t.schema.properties[e].format?ge.Date:ge.DateTime;if("date-picker json-schema"===n.fieldHtmlClass||"date"===t.schema.properties[e].format)return ge.Date}catch(e){return}},Ge=function(e){var t=[];return He(e.definition)?t.push.apply(t,Ke(e)):Object.keys(e.schema.properties).forEach((function(r){var n=Xe(r,e);je(n)||t.push(n)})),{type:"Category",elements:t}},Ke=function(e){var t=[];return e.definition.forEach((function(r){if("string"==typeof r)t.push(We(r,e.schema.properties[r].title||""));else if(r instanceof Object)switch(!0){case function(e){return Te(e)&&e.type===Se&&0===e.items.length&&!je(e.title)}(r):t.push(We(_e(r.title),r.title,Qe(Oe.FormLabel)));break;case Fe(r):r.title&&t.push(We(_e(r.title),r.title,Qe(Oe.FormLabel))),r.items.forEach((function(r){if(r instanceof Object){var n=Xe(r.key||"",e,r);n&&t.push(n)}else if("string"==typeof r){var i=Xe(r,e);i&&t.push(i)}}));break;case Ce(r):var n=Xe(r.key,e);n&&t.push(n)}})),t},Qe=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),je(e))return{};var r={format:e};return je(t)||(r.display=t),r},Xe=function(e,t,r){void 0===r&&(r=void 0);var n={};switch(t.schema.properties[e].type){case Me.Number:return We(e,t.schema.properties[e].title||"");case Me.String:var i=ze(e,t,r);return Ne(i)?t.schema.properties[e].display&&t.schema.properties[e].display===ke.Header&&(n=Qe(Oe.FormLabel)):n=Qe(Oe.DateTime,i),We(e,t.schema.properties[e].title||"",n);case Me.Array:return t.schema.properties[e].items.enum&&t.schema.properties[e].items.enumNames?n=Qe(Oe.MultiSelect):t.schema.properties[e].items&&(n=Qe(Oe.RepeatableField)),We(e,t.schema.properties[e].title||"",n);case void 0:var o=function(e,t){try{var r=t.definition.find((function(t){return t.key===e}));return"json-schema-checkbox-wrapper"===r.fieldHtmlClass||"checkboxes"===r.type?r:void 0}catch(e){return}}(e,t);return o?(n=Qe(Oe.MultiSelect),We(e,o.title||"",n)):(i=ze(e,t,r),Ne(i)?void 0:(n=Qe(Oe.DateTime,i),We(e,t.schema.properties[e].title||"",n)))}},Ye=function(){return Ye=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ye.apply(this,arguments)},Ze=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},et=/[^\w\n\s_"](?=[^:\n\s{}[]]*:[\t\n\s]*(\{|\[)+)/g,tt=/"minimum"(?:[^\\"]|\\\\|\\")*"\d+\.*\d*"/g,rt=/"maximum"(?:[^\\"]|\\\\|\\")*"\d+\.*\d*"/g,nt=/"(?=[^"]*(?:"[^"]*)?$)/g,it=function(e){return{type:"string",readOnly:!0,isHidden:!1,display:ke.Header,title:e}},ot=function(e){return(null==e?void 0:e.isHidden)||!1},at=function(e){return e.enum.filter((function(t){return!e.inactive_enum.includes(t)}))},ct=function(e){return e.titleMap.filter((function(t){return!e.inactive_titleMap.includes(t.value)}))},ut=function(e,t,r,n){var i,o,a,c,u=e.hasCheckboxes,s=e.hasDisabledChoices;if(Ie(t)&&r.schema.properties[t])r.schema.properties[t].isHidden=ot(r.schema.properties[t]);else{if((Te(t)||Ce(t))&&t.key&&r.schema.properties[t.key]&&(r.schema.properties[t.key].isHidden=ot(r.schema.properties[t.key])),s&&function(e){var t,r;return Te(e)&&e.type===xe&&(null===(t=e.inactive_titleMap)||void 0===t?void 0:t.length)>0&&(null===(r=e.titleMap)||void 0===r?void 0:r.length)>0}(t))if(n){var l=r.definition.indexOf(n),p=r.definition[l].items.indexOf(t);r.definition[l].items[p].titleMap=ct(t)}else r.definition[r.definition.indexOf(t)].titleMap=ct(t);u&&qe(t)&&(r.schema.properties[t.key]=(i=t,o=r.schema.properties[t.key].title||"",a=r.schema.properties[t.key].required||!1,c=r.schema.properties[t.key].default||!1,Ye(Ye(Ye({type:"array",uniqueItems:!0,isHidden:!1},a&&{required:a}),{title:o||i.title,items:{enum:i.titleMap.map((function(e){return e.value})),enumNames:i.titleMap.map((function(e){return e.name}))}}),c&&{default:c})))}},st=function(e){var t;e=function(e){if(null!==e.match(et))throw Error("Special characters not supported in JSON Schema");return(e=(e=(e=(e=(e=e.replace(/([“”])/g,'"')).replace(new RegExp('\\"enum\\"\\n*\\s*\\:\\n*\\s*\\[\\n*\\s*\\]',"g"),'"enum": ["0"]')).replace(new RegExp('\\"enumNames\\"\\n*\\s*\\:\\n*\\s*\\{\\n*\\s*\\}',"g"),'"enumNames": {"0":"No Options"}')).replace(new RegExp('\\"titleMap\\"\\n*\\s*\\:\\n*\\s*\\[\\n*\\s*\\]',"g"),'"titleMap": [{"value":"no_option", "name":"No Option"}]')).replace(tt,(function(e){return e.replace(nt,"")}))).replace(rt,(function(e){return e.replace(nt,"")}))}(e);var r=JSON.parse(e);delete r.schema.$schema,delete r.schema.id,function(e){if(e.schema.definition){var t=e.schema.definition;delete e.schema.definition,e.definition=t}}(r);var n=function(e){return{hasCheckboxes:Ue(e),hasInactiveChoices:Be(e),hasDisabledChoices:Le(e),hasEnums:Je(e)}}(e);if(function(e){Re(e,(function(e){"object"===e.type&&e.properties&&Object.entries(e.properties).forEach((function(e){var t=e[1];"number"===t.type&&(void 0!==t.default&&(t.default=$e(t.default)),void 0!==t.minimum&&(t.minimum=$e(t.minimum)),void 0!==t.maximum&&(t.maximum=$e(t.maximum)))}))}))}(r.schema),function(e,t){var r=e.hasInactiveChoices,n=e.hasEnums;if(r)for(var i=0,o=Object.keys(t.schema.properties);i<o.length;i++){var a=o[i],c=t.schema.properties[a];Pe(c)&&(t.schema.properties[a].enum=at(c),je(t.schema.properties[a].enum)&&(t.schema.properties[a].enum=["0"],t.schema.properties[a].enumNames={0:"No Options"}))}if(n)for(var u=0,s=Object.keys(t.schema.properties);u<s.length;u++)if(a=s[u],!je(t.schema.properties[a].enum)&&Ee(t.schema.properties[a].enum))throw new Error("Duplicated enum items")}(n,r),function(e,t){var r;if(He(t.definition))!function(e,t){for(var r=0,n=t.definition;r<n.length;r++){var i=n[r];switch(!0){case Ie(i):break;case De(i):var o=_e(i.title);t.schema.properties[o]=it(i.title);break;case Fe(i):for(var a=0,c=i.items;a<c.length;a++){var u=c[a];ut(e,u,t,i)}break;case qe(i):ut(e,i,t)}}}(e,t);else if((null===(r=t.definition)||void 0===r?void 0:r.length)>0)for(var n=0,i=t.definition;n<i.length;n++){var o=i[n];ut(e,o,t)}}(n,r),e.includes("helpvalue")&&function(e){for(var t={},r=0,n=0,i=e.definition;n<i.length;n++){var o=i[n];if(Ie(o))t[o]=e.schema.properties[o],delete e.schema.properties[o];else if(Te(o))if(o.helpvalue){var a="help_value_".concat(r);r+=1,t[a]=it((o.helpvalue||"").replace(/(<.+?>)/g,""))}else o.key&&(t[o.key]=e.schema.properties[o.key],delete e.schema.properties[o.key])}e.schema.properties=Object.assign(t,e.schema.properties)}(r),e.includes("required")){if((null===(t=r.schema.required)||void 0===t?void 0:t.length)>0&&Ee(r.schema.required))throw new Error("Duplicated required properties");r.schema=function(e){var t=Array.isArray(e.required)?Ze([],e.required,!0):null;return Re(e,(function(e,r){if("object"===e.type&&e.properties){var n=[];if(Object.entries(e.properties).forEach((function(e){var t=e[0],r=e[1];(function(e){return"true"===e.required||e.required>0})(r)&&(n.push(t),delete r.required)})),je(n))r.length>0&&e.required&&delete e.required;else if(0===r.length&&t){var i=Ze(Ze([],t,!0),n,!0);e.required=Array.from(new Set(i))}else e.required=n}})),e}(r.schema)}return r};module.exports=t})();
1
+ (()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{void 0!==m&&m.toStringTag&&Object.defineProperty(e,m.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{generateUISchema:()=>Xe,v1:()=>r,v2:()=>n,validateJSONSchema:()=>pt});var r={};e.r(r),e.d(r,{generateUISchema:()=>Xe,validateJSONSchema:()=>pt});var n={};e.r(n),e.d(n,{generateUISchema:()=>mt});var i=Object.prototype;const o=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)},a=(c=Object.keys,u=Object,function(e){return c(u(e))});var c,u,s=Object.prototype.hasOwnProperty;const p="object"==typeof global&&global&&global.Object===Object&&global;var l="object"==typeof self&&self&&self.Object===Object&&self;const f=p||l||Function("return this")();var m=f.Symbol;const d=m;var h=Object.prototype,y=h.hasOwnProperty,v=h.toString,b=d?d.toStringTag:void 0;var g=Object.prototype.toString;var j=d?d.toStringTag:void 0;const O=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=y.call(e,b),r=e[b];try{e[b]=void 0;var n=!0}catch(e){}var i=v.call(e);return n&&(t?e[b]=r:delete e[b]),i}(e):function(e){return g.call(e)}(e)},k=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},w=function(e){if(!k(e))return!1;var t=O(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},A=f["__core-js_shared__"];var E,x=(E=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"";var S=Function.prototype.toString;const T=function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var C=/^\[object .+?Constructor\]$/,I=Function.prototype,M=Object.prototype,_=I.toString,N=M.hasOwnProperty,F=RegExp("^"+_.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const D=function(e){return!(!k(e)||function(e){return!!x&&x in e}(e))&&(w(e)?F:C).test(T(e))},q=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return D(r)?r:void 0},P=q(f,"DataView"),L=q(f,"Map"),H=q(f,"Promise"),R=q(f,"Set"),U=q(f,"WeakMap");var $="[object Map]",B="[object Promise]",V="[object Set]",z="[object WeakMap]",J="[object DataView]",W=T(P),G=T(L),X=T(H),K=T(R),Q=T(U),Y=O;(P&&Y(new P(new ArrayBuffer(1)))!=J||L&&Y(new L)!=$||H&&Y(H.resolve())!=B||R&&Y(new R)!=V||U&&Y(new U)!=z)&&(Y=function(e){var t=O(e),r="[object Object]"==t?e.constructor:void 0,n=r?T(r):"";if(n)switch(n){case W:return J;case G:return $;case X:return B;case K:return V;case Q:return z}return t});const Z=Y,ee=function(e){return null!=e&&"object"==typeof e},te=function(e){return ee(e)&&"[object Arguments]"==O(e)};var re=Object.prototype,ne=re.hasOwnProperty,ie=re.propertyIsEnumerable;const oe=te(function(){return arguments}())?te:function(e){return ee(e)&&ne.call(e,"callee")&&!ie.call(e,"callee")},ae=Array.isArray,ce=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ue="object"==typeof exports&&exports&&!exports.nodeType&&exports,se=ue&&"object"==typeof module&&module&&!module.nodeType&&module,pe=se&&se.exports===ue?f.Buffer:void 0;const le=(pe?pe.isBuffer:void 0)||function(){return!1};var fe={};fe["[object Float32Array]"]=fe["[object Float64Array]"]=fe["[object Int8Array]"]=fe["[object Int16Array]"]=fe["[object Int32Array]"]=fe["[object Uint8Array]"]=fe["[object Uint8ClampedArray]"]=fe["[object Uint16Array]"]=fe["[object Uint32Array]"]=!0,fe["[object Arguments]"]=fe["[object Array]"]=fe["[object ArrayBuffer]"]=fe["[object Boolean]"]=fe["[object DataView]"]=fe["[object Date]"]=fe["[object Error]"]=fe["[object Function]"]=fe["[object Map]"]=fe["[object Number]"]=fe["[object Object]"]=fe["[object RegExp]"]=fe["[object Set]"]=fe["[object String]"]=fe["[object WeakMap]"]=!1;var me="object"==typeof exports&&exports&&!exports.nodeType&&exports,de=me&&"object"==typeof module&&module&&!module.nodeType&&module,he=de&&de.exports===me&&p.process,ye=function(){try{return de&&de.require&&de.require("util").types||he&&he.binding&&he.binding("util")}catch(e){}}(),ve=ye&&ye.isTypedArray;const be=ve?function(e){return function(t){return e(t)}}(ve):function(e){return ee(e)&&ce(e.length)&&!!fe[O(e)]};var ge=Object.prototype.hasOwnProperty;const je=function(e){if(null==e)return!0;if(function(e){return null!=e&&ce(e.length)&&!w(e)}(e)&&(ae(e)||"string"==typeof e||"function"==typeof e.splice||le(e)||be(e)||oe(e)))return!e.length;var t=Z(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(o(e))return!function(e){if(!o(e))return a(e);var t=[];for(var r in Object(e))s.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e).length;for(var r in e)if(ge.call(e,r))return!1;return!0};var Oe,ke,we,Ae=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},Ee="fieldset",xe="checkboxes",Se="string";!function(e){e.DateTime="date-time",e.Date="date"}(Oe||(Oe={})),function(e){e.DateTime="date-time",e.MultiSelect="multiselect",e.RepeatableField="repeatable-field",e.FormLabel="form-label"}(ke||(ke={})),function(e){e.Header="header"}(we||(we={}));var Te,Ce=function(e){var t=e.toLowerCase().replace(/[\s\\/\\%]/gi,"_");return"fieldset__title_".concat(t)},Ie=function(e){return new Set(e).size!==e.length},Me=function(e){return qe(e)&&e.type===xe},_e=function(e){return null==e||0===e.trim().length},Ne=function(e){return qe(e)&&e.type===Ee&&!je(e.title)},Fe=function(e){return qe(e)&&e.type===Ee&&e.items.length>0},De=function(e){var t,r;return e.type===Se&&(null===(t=e.enum)||void 0===t?void 0:t.length)>0&&(null===(r=e.inactive_enum)||void 0===r?void 0:r.length)>0},qe=function(e){return e instanceof Object},Pe=function(e){return!je(e.key)},Le=function(e){return 0!==e.length&&void 0!==e.find((function(e){return qe(e)&&e&&(e.type||"")===Ee}))},He=function(e){return typeof e===Se},Re=function(e){if("number"==typeof e)return e;if("string"!=typeof e)return e;var t=e.trim();if(""===t)return e;if(/^-?\d+,\d+$/.test(t)){var r=t.replace(",","."),n=parseFloat(r);if(!isNaN(n))return r}return e},Ue=function(e,t,r){void 0===r&&(r=[]),"object"==typeof e&&null!==e&&(t(e,r),Array.isArray(e)?e.forEach((function(e,n){return Ue(e,t,Ae(Ae([],r,!0),[n.toString()],!1))})):Object.entries(e).forEach((function(e){var n=e[0],i=e[1];return Ue(i,t,Ae(Ae([],r,!0),[n],!1))})))},$e=function(e){return e.includes(xe)},Be=function(e){return e.includes("inactive_enum")},Ve=function(e){return e.includes("inactive_titleMap")},ze=function(e){return e.includes("enum")},Je=function(){return Je=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Je.apply(this,arguments)};!function(e){e.Number="number",e.String="string",e.Array="array"}(Te||(Te={}));var We=function(e,t,r){return void 0===r&&(r={}),Je({type:"Control",scope:"#/properties/".concat(e),label:t},r&&{options:r})},Ge=function(e,t,r){void 0===r&&(r=void 0);try{var n=r||t.definition.find((function(t){return t.key===e}));if("date-time-picker json-schema"===n.fieldHtmlClass||n&&"datetime"===(n.type||""))return"date"===t.schema.properties[e].format?Oe.Date:Oe.DateTime;if("date-picker json-schema"===n.fieldHtmlClass||"date"===t.schema.properties[e].format)return Oe.Date}catch(e){return}},Xe=function(e){var t=[];return Le(e.definition)?t.push.apply(t,Ke(e)):Object.keys(e.schema.properties).forEach((function(r){var n=Ye(r,e);je(n)||t.push(n)})),{type:"Category",elements:t}},Ke=function(e){var t=[];return e.definition.forEach((function(r){if("string"==typeof r)t.push(We(r,e.schema.properties[r].title||""));else if(r instanceof Object)switch(!0){case function(e){return qe(e)&&e.type===Ee&&0===e.items.length&&!je(e.title)}(r):t.push(We(Ce(r.title),r.title,Qe(ke.FormLabel)));break;case Fe(r):r.title&&t.push(We(Ce(r.title),r.title,Qe(ke.FormLabel))),r.items.forEach((function(r){if(r instanceof Object){var n=Ye(r.key||"",e,r);n&&t.push(n)}else if("string"==typeof r){var i=Ye(r,e);i&&t.push(i)}}));break;case Pe(r):var n=Ye(r.key,e);n&&t.push(n)}})),t},Qe=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),je(e))return{};var r={format:e};return je(t)||(r.display=t),r},Ye=function(e,t,r){void 0===r&&(r=void 0);var n={};switch(t.schema.properties[e].type){case Te.Number:return We(e,t.schema.properties[e].title||"");case Te.String:var i=Ge(e,t,r);return _e(i)?t.schema.properties[e].display&&t.schema.properties[e].display===we.Header&&(n=Qe(ke.FormLabel)):n=Qe(ke.DateTime,i),We(e,t.schema.properties[e].title||"",n);case Te.Array:return t.schema.properties[e].items.enum&&t.schema.properties[e].items.enumNames?n=Qe(ke.MultiSelect):t.schema.properties[e].items&&(n=Qe(ke.RepeatableField)),We(e,t.schema.properties[e].title||"",n);case void 0:var o=function(e,t){try{var r=t.definition.find((function(t){return t.key===e}));return"json-schema-checkbox-wrapper"===r.fieldHtmlClass||"checkboxes"===r.type?r:void 0}catch(e){return}}(e,t);return o?(n=Qe(ke.MultiSelect),We(e,o.title||"",n)):(i=Ge(e,t,r),_e(i)?void 0:(n=Qe(ke.DateTime,i),We(e,t.schema.properties[e].title||"",n)))}},Ze=function(){return Ze=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ze.apply(this,arguments)},et=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},tt=/[^\w\n\s_"](?=[^:\n\s{}[]]*:[\t\n\s]*(\{|\[)+)/g,rt=/"minimum"(?:[^\\"]|\\\\|\\")*"\d+\.*\d*"/g,nt=/"maximum"(?:[^\\"]|\\\\|\\")*"\d+\.*\d*"/g,it=/"(?=[^"]*(?:"[^"]*)?$)/g,ot=function(e){return{type:"string",readOnly:!0,isHidden:!1,display:we.Header,title:e}},at=function(e){return(null==e?void 0:e.isHidden)||!1},ct=function(e){return e.enum.filter((function(t){return!e.inactive_enum.includes(t)}))},ut=function(e){return e.titleMap.filter((function(t){return!e.inactive_titleMap.includes(t.value)}))},st=function(e,t,r,n){var i,o,a,c,u=e.hasCheckboxes,s=e.hasDisabledChoices;if(He(t)&&r.schema.properties[t])r.schema.properties[t].isHidden=at(r.schema.properties[t]);else{if((qe(t)||Pe(t))&&t.key&&r.schema.properties[t.key]&&(r.schema.properties[t.key].isHidden=at(r.schema.properties[t.key])),s&&function(e){var t,r;return qe(e)&&e.type===xe&&(null===(t=e.inactive_titleMap)||void 0===t?void 0:t.length)>0&&(null===(r=e.titleMap)||void 0===r?void 0:r.length)>0}(t))if(n){var p=r.definition.indexOf(n),l=r.definition[p].items.indexOf(t);r.definition[p].items[l].titleMap=ut(t)}else r.definition[r.definition.indexOf(t)].titleMap=ut(t);u&&Me(t)&&(r.schema.properties[t.key]=(i=t,o=r.schema.properties[t.key].title||"",a=r.schema.properties[t.key].required||!1,c=r.schema.properties[t.key].default||!1,Ze(Ze(Ze({type:"array",uniqueItems:!0,isHidden:!1},a&&{required:a}),{title:o||i.title,items:{enum:i.titleMap.map((function(e){return e.value})),enumNames:i.titleMap.map((function(e){return e.name}))}}),c&&{default:c})))}},pt=function(e){var t;e=function(e){if(null!==e.match(tt))throw Error("Special characters not supported in JSON Schema");return(e=(e=(e=(e=(e=e.replace(/([“”])/g,'"')).replace(new RegExp('\\"enum\\"\\n*\\s*\\:\\n*\\s*\\[\\n*\\s*\\]',"g"),'"enum": ["0"]')).replace(new RegExp('\\"enumNames\\"\\n*\\s*\\:\\n*\\s*\\{\\n*\\s*\\}',"g"),'"enumNames": {"0":"No Options"}')).replace(new RegExp('\\"titleMap\\"\\n*\\s*\\:\\n*\\s*\\[\\n*\\s*\\]',"g"),'"titleMap": [{"value":"no_option", "name":"No Option"}]')).replace(rt,(function(e){return e.replace(it,"")}))).replace(nt,(function(e){return e.replace(it,"")}))}(e);var r=JSON.parse(e);delete r.schema.$schema,delete r.schema.id,function(e){if(e.schema.definition){var t=e.schema.definition;delete e.schema.definition,e.definition=t}}(r);var n=function(e){return{hasCheckboxes:$e(e),hasInactiveChoices:Be(e),hasDisabledChoices:Ve(e),hasEnums:ze(e)}}(e);if(function(e){Ue(e,(function(e){"object"===e.type&&e.properties&&Object.entries(e.properties).forEach((function(e){var t=e[1];"number"===t.type&&(void 0!==t.default&&(t.default=Re(t.default)),void 0!==t.minimum&&(t.minimum=Re(t.minimum)),void 0!==t.maximum&&(t.maximum=Re(t.maximum)))}))}))}(r.schema),function(e,t){var r=e.hasInactiveChoices,n=e.hasEnums;if(r)for(var i=0,o=Object.keys(t.schema.properties);i<o.length;i++){var a=o[i],c=t.schema.properties[a];De(c)&&(t.schema.properties[a].enum=ct(c),je(t.schema.properties[a].enum)&&(t.schema.properties[a].enum=["0"],t.schema.properties[a].enumNames={0:"No Options"}))}if(n)for(var u=0,s=Object.keys(t.schema.properties);u<s.length;u++)if(a=s[u],!je(t.schema.properties[a].enum)&&Ie(t.schema.properties[a].enum))throw new Error("Duplicated enum items")}(n,r),function(e,t){var r;if(Le(t.definition))!function(e,t){for(var r=0,n=t.definition;r<n.length;r++){var i=n[r];switch(!0){case He(i):break;case Ne(i):var o=Ce(i.title);t.schema.properties[o]=ot(i.title);break;case Fe(i):for(var a=0,c=i.items;a<c.length;a++){var u=c[a];st(e,u,t,i)}break;case Me(i):st(e,i,t)}}}(e,t);else if((null===(r=t.definition)||void 0===r?void 0:r.length)>0)for(var n=0,i=t.definition;n<i.length;n++){var o=i[n];st(e,o,t)}}(n,r),e.includes("helpvalue")&&function(e){for(var t={},r=0,n=0,i=e.definition;n<i.length;n++){var o=i[n];if(He(o))t[o]=e.schema.properties[o],delete e.schema.properties[o];else if(qe(o))if(o.helpvalue){var a="help_value_".concat(r);r+=1,t[a]=ot((o.helpvalue||"").replace(/(<.+?>)/g,""))}else o.key&&(t[o.key]=e.schema.properties[o.key],delete e.schema.properties[o.key])}e.schema.properties=Object.assign(t,e.schema.properties)}(r),e.includes("required")){if((null===(t=r.schema.required)||void 0===t?void 0:t.length)>0&&Ie(r.schema.required))throw new Error("Duplicated required properties");r.schema=function(e){var t=Array.isArray(e.required)?et([],e.required,!0):null;return Ue(e,(function(e,r){if("object"===e.type&&e.properties){var n=[];if(Object.entries(e.properties).forEach((function(e){var t=e[0],r=e[1];(function(e){return"true"===e.required||e.required>0})(r)&&(n.push(t),delete r.required)})),je(n))r.length>0&&e.required&&delete e.required;else if(0===r.length&&t){var i=et(et([],t,!0),n,!0);e.required=Array.from(new Set(i))}else e.required=n}})),e}(r.schema)}return r},lt=function(e,t){return{type:"Label",text:t.label,options:{size:t.size}}},ft=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},mt=function(e){var t,r,n,i=function(e){var t=[];return Object.entries(e.json.properties).forEach((function(r){var n=r[0],i=r[1],o=e.ui.fields[n];(function(e){return!e.deprecated})(i)&&o&&t.push({name:n,property:i,uiField:o})})),t}(e),o=(t=i,r=e.ui.sections,n={},t.forEach((function(e){var t=e.uiField.parent;r[t]&&(n[t]||(n[t]=[]),n[t].push(e))})),n),a=[];return e.ui.order.forEach((function(t){var r=e.ui.sections[t],n=o[t]||[],i=n.length>0,c=ft(ft([],r.leftColumn,!0),r.rightColumn,!0).some((function(t){return"header"===t.type&&e.ui.headers[t.name]}));if((null==r?void 0:r.isActive)&&(i||c)){var u=function(e,t,r,n){var i={type:"VerticalLayout",label:t.label,elements:[]},o=[];return t.leftColumn.forEach((function(e){if("field"===e.type){var t=r.find((function(t){return t.scope==="#/properties/".concat(e.name)}));t&&o.push(t)}else if("header"===e.type){var i=n[e.name];if(i){var a=lt(e.name,i);o.push(a)}}})),t.rightColumn.forEach((function(e){if("field"===e.type){var t=r.find((function(t){return t.scope==="#/properties/".concat(e.name)}));t&&o.push(t)}else if("header"===e.type){var i=n[e.name];if(i){var a=lt(e.name,i);o.push(a)}}})),i.elements=o,i}(0,r,n.map((function(e){return function(e,t,r){var n,i={type:"Control",scope:"#/properties/".concat(e),label:t.title,options:{}};switch(r.type){case"TEXT":"LONG_TEXT"===r.inputType&&(i.options.multi=!0),r.placeholder&&(i.options.placeholder=r.placeholder);break;case"NUMERIC":i.options.format="number",r.placeholder&&(i.options.placeholder=r.placeholder);break;case"DATE_TIME":t.format&&(i.options.format=t.format,i.options.display=t.format);break;case"CHOICE_LIST":"DROPDOWN"===r.inputType?(i.options.format="dropdown",r.placeholder&&(i.options.placeholder=r.placeholder)):"LIST"===r.inputType&&(i.options.format="radio"),"array"===t.type&&(i.options.multi=!0);break;case"LOCATION":i.options.format="location",i.options.display="map";break;case"COLLECTION":i.options.format="array",i.options.addButtonText=r.buttonText||"Add Item",r.itemIdentifier&&(i.options.itemIdentifier=r.itemIdentifier),void 0!==t.maxItems&&(i.options.maxItems=t.maxItems),void 0!==t.minItems&&(i.options.minItems=t.minItems),"array"===t.type&&(null===(n=t.items)||void 0===n?void 0:n.properties)&&(i.options.detail=function(e,t){var r;if("array"!==e.type||!(null===(r=e.items)||void 0===r?void 0:r.properties))throw new Error("Collection property must be an array with item properties");var n=e.items.properties,i=[],o=function(e,t){var r={type:"Control",scope:"#/properties/".concat(e),label:t.title||e,options:{}};switch(t.type){case"string":"uri"===t.format&&(r.options.format="file",r.options.accept="image/*");break;case"number":r.options.format="number"}return t.description&&(r.options.description=t.description),r};return t&&(t.leftColumn||t.rightColumn)?(t.leftColumn&&t.leftColumn.forEach((function(e){n[e]&&i.push(o(e,n[e]))})),t.rightColumn&&t.rightColumn.forEach((function(e){n[e]&&i.push(o(e,n[e]))}))):Object.entries(n).forEach((function(e){var t=e[0],r=e[1];i.push(o(t,r))})),{type:"VerticalLayout",elements:i}}(t,r));break;case"ATTACHMENT":i.options.format="file",r.allowableFileTypes&&(i.options.accept=r.allowableFileTypes.join(","))}return t.description&&(i.options.description=t.description),i}(e.name,e.property,e.uiField)})),e.ui.headers);a.push(u)}})),{type:"VerticalLayout",elements:a}};module.exports=t})();
@@ -0,0 +1,127 @@
1
+ export interface ValidationOptions {
2
+ version?: 'v1' | 'v2' | 'auto';
3
+ strictMode?: boolean;
4
+ locale?: string;
5
+ }
6
+ export interface V1Schema {
7
+ schema: {
8
+ type: string;
9
+ properties: Record<string, any>;
10
+ required?: string[];
11
+ [key: string]: any;
12
+ };
13
+ definition: any[];
14
+ }
15
+ export interface V2Schema {
16
+ json: {
17
+ $schema: string;
18
+ additionalProperties: boolean;
19
+ properties: Record<string, V2Property>;
20
+ required: string[];
21
+ type: string;
22
+ };
23
+ ui: {
24
+ fields: Record<string, V2UIField>;
25
+ headers: Record<string, V2Header>;
26
+ order: string[];
27
+ sections: Record<string, V2Section>;
28
+ };
29
+ }
30
+ export interface V2BaseProperty {
31
+ type: 'string' | 'number' | 'array' | 'object';
32
+ description?: string;
33
+ default?: any;
34
+ minimum?: number;
35
+ maximum?: number;
36
+ format?: 'date-time' | 'date' | 'time' | 'uri';
37
+ anyOf?: Array<{
38
+ $ref: string;
39
+ }>;
40
+ items?: V2BaseProperty;
41
+ properties?: Record<string, V2BaseProperty>;
42
+ required?: string[];
43
+ additionalProperties?: boolean;
44
+ unevaluatedItems?: boolean;
45
+ maxItems?: number;
46
+ minItems?: number;
47
+ uniqueItems?: boolean;
48
+ }
49
+ export interface V2Property extends V2BaseProperty {
50
+ deprecated: boolean;
51
+ title: string;
52
+ items?: V2BaseProperty;
53
+ properties?: Record<string, V2BaseProperty>;
54
+ }
55
+ export interface V2UIField {
56
+ type: 'TEXT' | 'NUMERIC' | 'CHOICE_LIST' | 'DATE_TIME' | 'LOCATION' | 'COLLECTION' | 'ATTACHMENT';
57
+ parent: string;
58
+ inputType?: 'SHORT_TEXT' | 'LONG_TEXT' | 'DROPDOWN' | 'LIST';
59
+ placeholder?: string;
60
+ choices?: V2Choices;
61
+ buttonText?: string;
62
+ columns?: number;
63
+ itemIdentifier?: string;
64
+ itemName?: string;
65
+ leftColumn?: string[];
66
+ rightColumn?: string[];
67
+ allowableFileTypes?: string[];
68
+ }
69
+ export interface V2Choices {
70
+ type: 'EXISTING_CHOICE_LIST' | 'MY_DATA';
71
+ eventTypeCategories: string[];
72
+ existingChoiceList: string[];
73
+ featureCategories: string[];
74
+ myDataType: string;
75
+ subjectGroups: string[];
76
+ subjectSubtypes: string[];
77
+ }
78
+ export interface V2Header {
79
+ label: string;
80
+ section: string;
81
+ size: 'LARGE' | 'MEDIUM' | 'SMALL';
82
+ }
83
+ export interface V2Section {
84
+ columns: 1 | 2;
85
+ isActive: boolean;
86
+ label: string;
87
+ leftColumn: V2ColumnItem[];
88
+ rightColumn: V2ColumnItem[];
89
+ }
90
+ export interface V2ColumnItem {
91
+ name: string;
92
+ type: 'field' | 'header';
93
+ }
94
+ export interface JSONFormsUIElement {
95
+ type: string;
96
+ scope?: string;
97
+ label?: string;
98
+ options?: Record<string, any>;
99
+ elements?: JSONFormsUIElement[];
100
+ }
101
+ export interface JSONFormsControl extends JSONFormsUIElement {
102
+ type: 'Control';
103
+ scope: string;
104
+ label: string;
105
+ options?: {
106
+ format?: string;
107
+ display?: string;
108
+ placeholder?: string;
109
+ multi?: boolean;
110
+ [key: string]: any;
111
+ };
112
+ }
113
+ export interface JSONFormsLayout extends JSONFormsUIElement {
114
+ type: 'VerticalLayout' | 'HorizontalLayout' | 'Group' | 'Categorization';
115
+ elements: JSONFormsUIElement[];
116
+ label?: string;
117
+ }
118
+ export interface JSONFormsLabel extends JSONFormsUIElement {
119
+ type: 'Label';
120
+ text: string;
121
+ options?: {
122
+ size?: 'LARGE' | 'MEDIUM' | 'SMALL';
123
+ [key: string]: any;
124
+ };
125
+ }
126
+ export type JSONFormsUISchema = JSONFormsUIElement;
127
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"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"}
@@ -1,3 +1,4 @@
1
1
  export { generateUISchema, validateJSONSchema } from './v1/index';
2
2
  export * as v1 from './v1/index';
3
+ export * as v2 from './v2/index';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGlE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGlE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { V2Schema, JSONFormsUISchema } from '../common/types';
2
+ /**
3
+ * Generates a JSONForms-compatible UI schema from a EarthRanger V2 schema format
4
+ *
5
+ * React Native Optimization:
6
+ * - All layouts are converted to single-column VerticalLayout
7
+ * - Multi-column sections are flattened: leftColumn fields first, then rightColumn fields
8
+ * - Optimized for mobile form rendering
9
+ *
10
+ * @param schema - EarthRanger V2 schema with json and ui properties
11
+ * @returns JSONForms UI schema with single-column VerticalLayout for React Native
12
+ */
13
+ export declare const generateUISchema: (schema: V2Schema) => JSONFormsUISchema;
14
+ //# sourceMappingURL=generateUISchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateUISchema.d.ts","sourceRoot":"","sources":["../../../src/v2/generateUISchema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AASzB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,WAAY,QAAQ,KAAG,iBAoCnD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { generateUISchema } from './generateUISchema';
2
+ export type { V2Schema, V2Property, V2UIField, V2Section, V2Header, JSONFormsUISchema } from '../common/types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v2/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,YAAY,EACV,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,iBAAiB,EAClB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { V2Schema } from '../common/types';
2
+ export declare const mockV2Schema: V2Schema;
3
+ export declare const expectedUISchemaForMockV2: any;
4
+ //# sourceMappingURL=mockData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockData.d.ts","sourceRoot":"","sources":["../../../src/v2/mockData.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,eAAO,MAAM,YAAY,UA2OZ,CAAC;AAEd,eAAO,MAAM,yBAAyB,EAAE,GA+FvC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { V2Schema, V2UIField, V2Property, V2Header, JSONFormsControl, JSONFormsLayout, JSONFormsLabel } from '../common/types';
2
+ /**
3
+ * Determines if a field should be rendered based on deprecation status
4
+ */
5
+ export declare const isFieldVisible: (property: V2Property) => boolean;
6
+ /**
7
+ * Creates a JSONForms control element for a field
8
+ */
9
+ export declare const createControl: (fieldName: string, property: V2Property, uiField: V2UIField) => JSONFormsControl;
10
+ /**
11
+ * Creates a JSONForms label element for a header
12
+ */
13
+ export declare const createHeaderLabel: (headerId: string, header: V2Header) => JSONFormsLabel;
14
+ /**
15
+ * Creates a single-column vertical layout for a section
16
+ */
17
+ export declare const createSectionLayout: (sectionId: string, section: V2Schema['ui']['sections'][string], fieldControls: JSONFormsControl[], headers: Record<string, V2Header>) => JSONFormsLayout;
18
+ /**
19
+ * Gets all fields that should be rendered (non-deprecated, visible)
20
+ */
21
+ export declare const getVisibleFields: (schema: V2Schema) => Array<{
22
+ name: string;
23
+ property: V2Property;
24
+ uiField: V2UIField;
25
+ }>;
26
+ /**
27
+ * Groups fields by their parent section
28
+ */
29
+ export declare const groupFieldsBySection: (fields: Array<{
30
+ name: string;
31
+ property: V2Property;
32
+ uiField: V2UIField;
33
+ }>, sections: V2Schema['ui']['sections']) => Record<string, Array<{
34
+ name: string;
35
+ property: V2Property;
36
+ uiField: V2UIField;
37
+ }>>;
38
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/v2/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EAEV,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,cAAc,EAGf,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,cAAc,aAAc,UAAU,KAAG,OAErD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,cACb,MAAM,YACP,UAAU,WACX,SAAS,KACjB,gBAwFF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,aAClB,MAAM,UACR,QAAQ,KACf,cAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,cACnB,MAAM,WACR,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,iBAC5B,gBAAgB,EAAE,WACxB,OAAO,MAAM,EAAE,QAAQ,CAAC,KAChC,eA4CF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,WAAY,QAAQ,KAAG,MAAM;IAAE,MAAM,MAAM,CAAC;IAAC,QAAQ,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAYnH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,MAAM;IAAE,MAAM,MAAM,CAAC;IAAC,QAAQ,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC,YAC/D,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,KACnC,OAAO,MAAM,EAAE,MAAM;IAAE,MAAM,MAAM,CAAC;IAAC,QAAQ,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC,CAgBlF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earthranger/react-native-jsonforms-formatter",
3
- "version": "1.0.7",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "Converts JTD into JSON Schema ",
5
5
  "main": "./dist/bundle.js",
6
6
  "types": "./dist/src/index.d.ts",