@jsonforms/examples 3.9.0-alpha.1 → 3.9.0-alpha.3

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,5 +1,6 @@
1
1
  import { convertDateToString, createTranslator, ArrayTranslationEnum, updateErrors, NOT_APPLICABLE } from '@jsonforms/core';
2
2
  import get from 'lodash/get';
3
+ import cloneDeep from 'lodash/cloneDeep';
3
4
  import localize from 'ajv-i18n/localize';
4
5
 
5
6
  const knownExamples = {};
@@ -12,7 +13,7 @@ const getExamples = () => {
12
13
  return examples;
13
14
  };
14
15
 
15
- const schema$W = {
16
+ const schema$X = {
16
17
  type: 'object',
17
18
  required: ['age'],
18
19
  properties: {
@@ -67,7 +68,7 @@ const schema$W = {
67
68
  },
68
69
  },
69
70
  };
70
- const uischema$W = {
71
+ const uischema$X = {
71
72
  type: 'VerticalLayout',
72
73
  elements: [
73
74
  {
@@ -160,7 +161,7 @@ const uischema$W = {
160
161
  },
161
162
  ],
162
163
  };
163
- const data$Y = {
164
+ const data$Z = {
164
165
  firstName: 'Max',
165
166
  lastName: 'Power',
166
167
  committer: false,
@@ -169,20 +170,20 @@ registerExamples([
169
170
  {
170
171
  name: '1884',
171
172
  label: 'Issue 1884 - Nested enable/disable',
172
- data: data$Y,
173
- schema: schema$W,
174
- uischema: uischema$W,
173
+ data: data$Z,
174
+ schema: schema$X,
175
+ uischema: uischema$X,
175
176
  },
176
177
  ]);
177
178
 
178
179
  var _1884 = /*#__PURE__*/Object.freeze({
179
180
  __proto__: null,
180
- schema: schema$W,
181
- uischema: uischema$W,
182
- data: data$Y
181
+ schema: schema$X,
182
+ uischema: uischema$X,
183
+ data: data$Z
183
184
  });
184
185
 
185
- const schema$V = {
186
+ const schema$W = {
186
187
  type: 'object',
187
188
  definitions: {
188
189
  import: {
@@ -213,8 +214,8 @@ const schema$V = {
213
214
  },
214
215
  },
215
216
  };
216
- const uischema$V = undefined;
217
- const data$X = {
217
+ const uischema$W = undefined;
218
+ const data$Y = {
218
219
  import: [
219
220
  {
220
221
  document: 'Document1',
@@ -227,24 +228,24 @@ registerExamples([
227
228
  {
228
229
  name: '1948_with',
229
230
  label: 'Issue 1948 - Array renderer selection (with schema)',
230
- data: data$X,
231
- schema: schema$V,
232
- uischema: uischema$V,
231
+ data: data$Y,
232
+ schema: schema$W,
233
+ uischema: uischema$W,
233
234
  },
234
235
  {
235
236
  name: '1948_without',
236
237
  label: 'Issue 1948 - Array renderer selection (w/o schema)',
237
- data: data$X,
238
+ data: data$Y,
238
239
  schema: undefined,
239
- uischema: uischema$V,
240
+ uischema: uischema$W,
240
241
  },
241
242
  ]);
242
243
 
243
244
  var _1948 = /*#__PURE__*/Object.freeze({
244
245
  __proto__: null,
245
- schema: schema$V,
246
- uischema: uischema$V,
247
- data: data$X
246
+ schema: schema$W,
247
+ uischema: uischema$W,
248
+ data: data$Y
248
249
  });
249
250
 
250
251
  const personCoreSchema = {
@@ -269,7 +270,7 @@ const personCoreSchema = {
269
270
  },
270
271
  },
271
272
  };
272
- const schema$U = {
273
+ const schema$V = {
273
274
  type: 'object',
274
275
  properties: {
275
276
  ...personCoreSchema.properties,
@@ -309,7 +310,7 @@ const schema$U = {
309
310
  },
310
311
  required: ['occupation', 'nationality'],
311
312
  };
312
- const uischema$U = {
313
+ const uischema$V = {
313
314
  type: 'VerticalLayout',
314
315
  elements: [
315
316
  {
@@ -364,7 +365,7 @@ const uischema$U = {
364
365
  },
365
366
  ],
366
367
  };
367
- const data$W = {
368
+ const data$X = {
368
369
  name: 'John Doe',
369
370
  vegetarian: false,
370
371
  birthDate: '1985-06-02',
@@ -377,18 +378,18 @@ registerExamples([
377
378
  {
378
379
  name: 'person',
379
380
  label: 'Person',
380
- data: data$W,
381
- schema: schema$U,
382
- uischema: uischema$U,
381
+ data: data$X,
382
+ schema: schema$V,
383
+ uischema: uischema$V,
383
384
  },
384
385
  ]);
385
386
 
386
387
  var person = /*#__PURE__*/Object.freeze({
387
388
  __proto__: null,
388
389
  personCoreSchema: personCoreSchema,
389
- schema: schema$U,
390
- uischema: uischema$U,
391
- data: data$W
390
+ schema: schema$V,
391
+ uischema: uischema$V,
392
+ data: data$X
392
393
  });
393
394
 
394
395
  const additionalErrors = [];
@@ -414,9 +415,9 @@ registerExamples([
414
415
  {
415
416
  name: 'additional-errors',
416
417
  label: 'Additional errors',
417
- data: data$W,
418
- schema: schema$U,
419
- uischema: uischema$U,
418
+ data: data$X,
419
+ schema: schema$V,
420
+ uischema: uischema$V,
420
421
  actions: actions$7,
421
422
  },
422
423
  ]);
@@ -427,7 +428,7 @@ var additionalErrors$1 = /*#__PURE__*/Object.freeze({
427
428
  actions: actions$7
428
429
  });
429
430
 
430
- const schema$T = {
431
+ const schema$U = {
431
432
  $schema: 'http://json-schema.org/draft-07/schema#',
432
433
  type: 'object',
433
434
  properties: {
@@ -501,11 +502,11 @@ const schema$T = {
501
502
  },
502
503
  maxProperties: 15,
503
504
  };
504
- const uischema$T = {
505
+ const uischema$U = {
505
506
  type: 'Control',
506
507
  scope: '#/',
507
508
  };
508
- const data$V = {
509
+ const data$W = {
509
510
  propertiesString: 'data',
510
511
  string: 'string value',
511
512
  number: 10.2,
@@ -524,16 +525,131 @@ registerExamples([
524
525
  {
525
526
  name: 'additional-properties',
526
527
  label: 'Additional Properties',
528
+ data: data$W,
529
+ schema: schema$U,
530
+ uischema: uischema$U,
531
+ },
532
+ ]);
533
+
534
+ var additionalProperties = /*#__PURE__*/Object.freeze({
535
+ __proto__: null,
536
+ schema: schema$U,
537
+ uischema: uischema$U
538
+ });
539
+
540
+ const schema$T = {
541
+ type: 'object',
542
+ properties: {
543
+ price: {
544
+ type: 'number',
545
+ },
546
+ weight: {
547
+ type: 'number',
548
+ },
549
+ quantity: {
550
+ type: 'integer',
551
+ },
552
+ website: {
553
+ type: 'string',
554
+ },
555
+ username: {
556
+ type: 'string',
557
+ },
558
+ voltage: {
559
+ type: 'string',
560
+ enum: ['110', '230', '400'],
561
+ },
562
+ frequency: {
563
+ type: 'string',
564
+ oneOf: [
565
+ { const: '50', title: '50' },
566
+ { const: '60', title: '60' },
567
+ ],
568
+ },
569
+ },
570
+ };
571
+ const uischema$T = {
572
+ type: 'VerticalLayout',
573
+ elements: [
574
+ {
575
+ type: 'HorizontalLayout',
576
+ elements: [
577
+ {
578
+ type: 'Control',
579
+ scope: '#/properties/price',
580
+ options: { startAdornment: '€' },
581
+ },
582
+ {
583
+ type: 'Control',
584
+ scope: '#/properties/weight',
585
+ options: { endAdornment: 'kg' },
586
+ },
587
+ {
588
+ type: 'Control',
589
+ scope: '#/properties/quantity',
590
+ options: { endAdornment: 'pcs' },
591
+ },
592
+ ],
593
+ },
594
+ {
595
+ type: 'HorizontalLayout',
596
+ elements: [
597
+ {
598
+ type: 'Control',
599
+ scope: '#/properties/website',
600
+ options: { startAdornment: 'https://' },
601
+ },
602
+ {
603
+ type: 'Control',
604
+ scope: '#/properties/username',
605
+ options: { startAdornment: '@', endAdornment: '.example.com' },
606
+ },
607
+ ],
608
+ },
609
+ {
610
+ type: 'HorizontalLayout',
611
+ elements: [
612
+ {
613
+ type: 'Control',
614
+ scope: '#/properties/voltage',
615
+ label: 'Voltage (autocomplete)',
616
+ options: { endAdornment: 'V' },
617
+ },
618
+ {
619
+ type: 'Control',
620
+ scope: '#/properties/voltage',
621
+ label: 'Voltage (select)',
622
+ options: { autocomplete: false, endAdornment: 'V' },
623
+ },
624
+ {
625
+ type: 'Control',
626
+ scope: '#/properties/frequency',
627
+ options: { autocomplete: false, endAdornment: 'Hz' },
628
+ },
629
+ ],
630
+ },
631
+ ],
632
+ };
633
+ const data$V = {
634
+ weight: 12.5,
635
+ username: 'jane',
636
+ voltage: '230',
637
+ };
638
+ registerExamples([
639
+ {
640
+ name: 'adornments',
641
+ label: 'Adornments',
527
642
  data: data$V,
528
643
  schema: schema$T,
529
644
  uischema: uischema$T,
530
645
  },
531
646
  ]);
532
647
 
533
- var additionalProperties = /*#__PURE__*/Object.freeze({
648
+ var adornments = /*#__PURE__*/Object.freeze({
534
649
  __proto__: null,
535
650
  schema: schema$T,
536
- uischema: uischema$T
651
+ uischema: uischema$T,
652
+ data: data$V
537
653
  });
538
654
 
539
655
  const schema$S = {
@@ -1995,6 +2111,62 @@ const uischema_1713 = {
1995
2111
  },
1996
2112
  ],
1997
2113
  };
2114
+ const schema_2343 = {
2115
+ type: 'object',
2116
+ properties: {
2117
+ parc: {
2118
+ type: 'array',
2119
+ items: {
2120
+ type: 'object',
2121
+ properties: {
2122
+ id: {
2123
+ type: 'string',
2124
+ },
2125
+ },
2126
+ },
2127
+ },
2128
+ },
2129
+ };
2130
+ const arrayControl_2343 = {
2131
+ type: 'Control',
2132
+ scope: '#/properties/parc',
2133
+ options: {
2134
+ detail: {
2135
+ type: 'VerticalLayout',
2136
+ elements: [
2137
+ {
2138
+ type: 'HorizontalLayout',
2139
+ elements: [
2140
+ {
2141
+ type: 'Control',
2142
+ scope: '#/properties/id',
2143
+ },
2144
+ ],
2145
+ },
2146
+ ],
2147
+ },
2148
+ },
2149
+ };
2150
+ const uischema_2343 = {
2151
+ type: 'VerticalLayout',
2152
+ elements: [
2153
+ {
2154
+ type: 'Categorization',
2155
+ elements: [
2156
+ {
2157
+ type: 'Category',
2158
+ label: 'A1',
2159
+ elements: [cloneDeep(arrayControl_2343)],
2160
+ },
2161
+ {
2162
+ type: 'Category',
2163
+ label: 'A2',
2164
+ elements: [cloneDeep(arrayControl_2343)],
2165
+ },
2166
+ ],
2167
+ },
2168
+ ],
2169
+ };
1998
2170
  const translations$2 = {
1999
2171
  categoryLabelKey: 'Basic',
2000
2172
  address: {
@@ -2020,6 +2192,13 @@ registerExamples([
2020
2192
  schema: schema_1713,
2021
2193
  uischema: uischema_1713,
2022
2194
  },
2195
+ {
2196
+ name: 'categorization_2343',
2197
+ label: 'Categorization - Issue 2343',
2198
+ data: {},
2199
+ schema: schema_2343,
2200
+ uischema: uischema_2343,
2201
+ },
2023
2202
  ]);
2024
2203
 
2025
2204
  var categorization = /*#__PURE__*/Object.freeze({
@@ -2863,6 +3042,15 @@ const schema$y = {
2863
3042
  enum: ['foo', 'bar', 'foobar'],
2864
3043
  },
2865
3044
  },
3045
+ multiSelect: {
3046
+ type: 'array',
3047
+ title: 'Select Fruits',
3048
+ uniqueItems: true,
3049
+ items: {
3050
+ type: 'string',
3051
+ enum: ['Apple', 'Banana', 'Cherry', 'Date', 'Elderberry'],
3052
+ },
3053
+ },
2866
3054
  },
2867
3055
  };
2868
3056
  const uischema$y = {
@@ -2876,9 +3064,20 @@ const uischema$y = {
2876
3064
  type: 'Control',
2877
3065
  scope: '#/properties/multiEnum',
2878
3066
  },
3067
+ {
3068
+ type: 'Control',
3069
+ scope: '#/properties/multiSelect',
3070
+ options: {
3071
+ format: 'multiselect',
3072
+ },
3073
+ },
2879
3074
  ],
2880
3075
  };
2881
- const data$A = { oneOfMultiEnum: ['foo'], multiEnum: ['bar'] };
3076
+ const data$A = {
3077
+ oneOfMultiEnum: ['foo'],
3078
+ multiEnum: ['bar'],
3079
+ multiSelect: ['Banana', 'Cherry'],
3080
+ };
2882
3081
  registerExamples([
2883
3082
  {
2884
3083
  name: 'multi-enum',
@@ -3118,7 +3317,7 @@ var enumInArray = /*#__PURE__*/Object.freeze({
3118
3317
 
3119
3318
  const schema$u = undefined;
3120
3319
  const uischema$u = undefined;
3121
- const data$w = data$W;
3320
+ const data$w = data$X;
3122
3321
  registerExamples([
3123
3322
  {
3124
3323
  name: 'generate',
@@ -3165,7 +3364,7 @@ var generateDynamic = /*#__PURE__*/Object.freeze({
3165
3364
 
3166
3365
  const schema$t = personCoreSchema;
3167
3366
  const uischema$t = undefined;
3168
- const data$v = data$W;
3367
+ const data$v = data$X;
3169
3368
  registerExamples([
3170
3369
  {
3171
3370
  name: 'generate-ui',
@@ -4631,7 +4830,7 @@ var i18n = /*#__PURE__*/Object.freeze({
4631
4830
  translate: translate
4632
4831
  });
4633
4832
 
4634
- const schema$r = schema$U;
4833
+ const schema$r = schema$V;
4635
4834
  const uischemaVertical = {
4636
4835
  type: 'VerticalLayout',
4637
4836
  elements: [
@@ -4719,7 +4918,7 @@ const uischemaComplex = {
4719
4918
  },
4720
4919
  ],
4721
4920
  };
4722
- const data$s = data$W;
4921
+ const data$s = data$X;
4723
4922
  registerExamples([
4724
4923
  {
4725
4924
  name: 'layout-vertical',
@@ -7733,5 +7932,5 @@ var jsonschema = /*#__PURE__*/Object.freeze({
7733
7932
  uischemas: uischemas
7734
7933
  });
7735
7934
 
7736
- export { additionalErrors$1 as additionalErrors, additionalProperties, allOf, anyOf, anyOfOneOfAllOfResolve, arrays as array, arraysI18n as arrayI18n, arraysWithCustomElementLabel as arrayWithCustomChildLabel, arraysWithDefaults as arrayWithDefaults, arraysWithDetail as arrayWithDetail, arraysWithDetailAndRule as arrayWithDetailAndRule, arraysWithSorting as arrayWithSorting, arraysWithTranslatedCustomElementLabel as arrayWithTranslatedCustomChildLabel, categorization, conditionalSchemaCompositions as conditionalSchemaComposition, config$1 as config, controlOptions, dates, _default as defaultExample, _enum as enumExample, enumI18n, enumInArray, generateDynamic, generate as generateSchema, generateUI as generateUISchema, getExamples, huge, i18n, if_then_else as ifThenElse, _1884 as issue_1884, _1948 as issue_1948, jsonEditor as jsoneditor, jsonschema, layout, listWithDetail, listWithDetailPrimitives, listWithDetailRegistered, login, mixed, mixedObject, enumMulti as multiEnum, enumMultiWithLabelAndDesc as multiEnumWithLabelAndDesc, nestedArrays as nestedArray, nestedCategorization, numbers, object, onChange$1 as onChange, oneOf, oneOfArray, oneOfRecursive, person, prependAppendSlots, radioGroup as radioGroupExample, readonly, registerExamples, rule, ruleInheritance, scope, specialPropertyNames, categorizationStepper as stepper, categorizationStepperNavButtons as steppershownav, string, stringArray, text, validationNestedSameName };
7935
+ export { additionalErrors$1 as additionalErrors, additionalProperties, adornments, allOf, anyOf, anyOfOneOfAllOfResolve, arrays as array, arraysI18n as arrayI18n, arraysWithCustomElementLabel as arrayWithCustomChildLabel, arraysWithDefaults as arrayWithDefaults, arraysWithDetail as arrayWithDetail, arraysWithDetailAndRule as arrayWithDetailAndRule, arraysWithSorting as arrayWithSorting, arraysWithTranslatedCustomElementLabel as arrayWithTranslatedCustomChildLabel, categorization, conditionalSchemaCompositions as conditionalSchemaComposition, config$1 as config, controlOptions, dates, _default as defaultExample, _enum as enumExample, enumI18n, enumInArray, generateDynamic, generate as generateSchema, generateUI as generateUISchema, getExamples, huge, i18n, if_then_else as ifThenElse, _1884 as issue_1884, _1948 as issue_1948, jsonEditor as jsoneditor, jsonschema, layout, listWithDetail, listWithDetailPrimitives, listWithDetailRegistered, login, mixed, mixedObject, enumMulti as multiEnum, enumMultiWithLabelAndDesc as multiEnumWithLabelAndDesc, nestedArrays as nestedArray, nestedCategorization, numbers, object, onChange$1 as onChange, oneOf, oneOfArray, oneOfRecursive, person, prependAppendSlots, radioGroup as radioGroupExample, readonly, registerExamples, rule, ruleInheritance, scope, specialPropertyNames, categorizationStepper as stepper, categorizationStepperNavButtons as steppershownav, string, stringArray, text, validationNestedSameName };
7737
7936
  //# sourceMappingURL=jsonforms-examples.esm.js.map