@remoteoss/json-schema-form 0.7.7-dev.20240129180839 → 0.8.0-beta.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ #### 0.8.0-beta.0 (2024-02-01)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **fieldset:** Support customProperties with sub-fields clashing with reserved words. ([#64](https://github.com/remoteoss/json-schema-form/pull/64)) ([8340cdea](https://github.com/remoteoss/json-schema-form/commit/8340cdea27b711064079055af939a595d1c38031))
6
+
1
7
  #### 0.7.6-beta.0 (2024-01-23)
2
8
 
3
9
  ##### Chores
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /*!
3
3
  Copyright (c) 2024 Remote Technology, Inc.
4
- NPM Package: @remoteoss/json-schema-form@0.7.7-dev.20240129180839
5
- Generated: Mon, 29 Jan 2024 18:09:02 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.8.0-beta.0
5
+ Generated: Thu, 01 Feb 2024 09:12:18 GMT
6
6
 
7
7
  MIT License
8
8
 
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /*!
3
3
  Copyright (c) 2024 Remote Technology, Inc.
4
- NPM Package: @remoteoss/json-schema-form@0.7.7-dev.20240129180839
5
- Generated: Mon, 29 Jan 2024 18:09:02 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.8.0-beta.0
5
+ Generated: Thu, 01 Feb 2024 09:12:18 GMT
6
6
 
7
7
  MIT License
8
8
 
@@ -1,8 +1,8 @@
1
1
 
2
2
  /*!
3
3
  Copyright (c) 2024 Remote Technology, Inc.
4
- NPM Package: @remoteoss/json-schema-form@0.7.7-dev.20240129180839
5
- Generated: Mon, 29 Jan 2024 18:09:02 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.8.0-beta.0
5
+ Generated: Thu, 01 Feb 2024 09:12:18 GMT
6
6
 
7
7
  MIT License
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remoteoss/json-schema-form",
3
- "version": "0.7.7-dev.20240129180839",
3
+ "version": "0.8.0-beta.0",
4
4
  "description": "Headless UI form powered by JSON Schemas",
5
5
  "author": "Remote.com <engineering@remote.com> (https://remote.com/)",
6
6
  "license": "MIT",
@@ -357,23 +357,21 @@ describe('createHeadlessForm() - custom validations', () => {
357
357
  minimum: 24,
358
358
  maximum: 28,
359
359
  },
360
- second_gen: {
360
+ second_gen: {
361
361
  customProperties: {
362
362
  cub_age: {
363
- minimum: 18,
364
- maximum: 21
365
- },
366
- third_gen: {
367
- customProperties: {
368
- grandcub_age: {
369
- minimum: 10,
370
- maximum: 15,
363
+ minimum: 18,
364
+ maximum: 21,
365
+ },
366
+ third_gen: {
367
+ customProperties: {
368
+ grandcub_age: {
369
+ minimum: 10,
370
+ maximum: 15,
371
+ },
371
372
  },
372
- }
373
-
374
- },
373
+ },
375
374
  },
376
-
377
375
  },
378
376
  },
379
377
  },
@@ -3760,6 +3760,58 @@ describe('createHeadlessForm', () => {
3760
3760
  expect(nestedFieldsetResult.fields[0].fields[1]).not.toHaveProperty('data-field');
3761
3761
  expect(nestedFieldsetResult.fields[0].fields[1]).not.toHaveProperty('data-fieldset');
3762
3762
  });
3763
+ it('should handle custom properties when inside fieldsets for fields name clashing with reserved words', () => {
3764
+ const { fields } = createHeadlessForm(
3765
+ {
3766
+ properties: {
3767
+ dog: {
3768
+ title: 'Dog details',
3769
+ description: 'Fieldset description',
3770
+ 'x-jsf-presentation': {
3771
+ inputType: 'fieldset',
3772
+ },
3773
+ properties: {
3774
+ name: {
3775
+ // This fieldName (name) clashs with the field specs "name"
3776
+ title: 'Dogs name',
3777
+ 'x-jsf-presentation': {
3778
+ inputType: 'text',
3779
+ },
3780
+ type: 'string',
3781
+ },
3782
+ type: {
3783
+ // This field name (type) clashs with the field specs "type"
3784
+ title: 'Breed type',
3785
+ 'x-jsf-presentation': {
3786
+ inputType: 'number',
3787
+ },
3788
+ type: 'string',
3789
+ },
3790
+ },
3791
+ required: ['name'],
3792
+ type: 'object',
3793
+ },
3794
+ },
3795
+ required: ['dog'],
3796
+ },
3797
+ {
3798
+ customProperties: {
3799
+ dog: {
3800
+ customProperties: {
3801
+ name: {
3802
+ description: "What's your dogs name",
3803
+ },
3804
+ },
3805
+ },
3806
+ },
3807
+ }
3808
+ );
3809
+
3810
+ expect(fields.length).toBe(1);
3811
+ expect(fields[0].fields.length).toBe(2);
3812
+ expect(fields[0].fields[0].name).toBe('name');
3813
+ expect(fields[0].fields[0].description).toBe("What's your dogs name");
3814
+ });
3763
3815
  });
3764
3816
 
3765
3817
  describe('presentation (deprecated in favor of x-jsf-presentation)', () => {