@remoteoss/json-schema-form 0.11.7-dev.20241025154552 → 0.11.7-dev.20241029090957

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/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.11.7-dev.20241025154552
5
- Generated: Fri, 25 Oct 2024 15:46:26 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.11.7-dev.20241029090957
5
+ Generated: Tue, 29 Oct 2024 09:10:21 GMT
6
6
 
7
7
  MIT License
8
8
 
@@ -470,7 +470,7 @@ var validateRadioOrSelectOptions = (value, options) => {
470
470
  var yupSchemas = {
471
471
  text: validateOnlyStrings,
472
472
  radioOrSelectString: (options) => {
473
- return (0, import_yup.mixed)().nullable().transform((value) => {
473
+ return (0, import_yup.string)().nullable().transform((value) => {
474
474
  if (value === "") {
475
475
  return void 0;
476
476
  }
@@ -481,11 +481,11 @@ var yupSchemas = {
481
481
  }).test(
482
482
  "matchesOptionOrPattern",
483
483
  ({ value }) => `The option ${JSON.stringify(value)} is not valid.`,
484
- (value) => {
485
- if (value !== void 0 && typeof value !== "string") {
484
+ (castValue, { originalValue }) => {
485
+ if (castValue !== void 0 && typeof originalValue !== "string") {
486
486
  return false;
487
487
  }
488
- return validateRadioOrSelectOptions(value, options);
488
+ return validateRadioOrSelectOptions(castValue, options);
489
489
  }
490
490
  );
491
491
  },
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.11.7-dev.20241025154552
5
- Generated: Fri, 25 Oct 2024 15:46:26 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.11.7-dev.20241029090957
5
+ Generated: Tue, 29 Oct 2024 09:10:21 GMT
6
6
 
7
7
  MIT License
8
8
 
@@ -433,7 +433,7 @@ var validateRadioOrSelectOptions = (value, options) => {
433
433
  var yupSchemas = {
434
434
  text: validateOnlyStrings,
435
435
  radioOrSelectString: (options) => {
436
- return mixed().nullable().transform((value) => {
436
+ return string().nullable().transform((value) => {
437
437
  if (value === "") {
438
438
  return void 0;
439
439
  }
@@ -444,11 +444,11 @@ var yupSchemas = {
444
444
  }).test(
445
445
  "matchesOptionOrPattern",
446
446
  ({ value }) => `The option ${JSON.stringify(value)} is not valid.`,
447
- (value) => {
448
- if (value !== void 0 && typeof value !== "string") {
447
+ (castValue, { originalValue }) => {
448
+ if (castValue !== void 0 && typeof originalValue !== "string") {
449
449
  return false;
450
450
  }
451
- return validateRadioOrSelectOptions(value, options);
451
+ return validateRadioOrSelectOptions(castValue, options);
452
452
  }
453
453
  );
454
454
  },
@@ -1,8 +1,8 @@
1
1
 
2
2
  /*!
3
3
  Copyright (c) 2024 Remote Technology, Inc.
4
- NPM Package: @remoteoss/json-schema-form@0.11.7-dev.20241025154552
5
- Generated: Fri, 25 Oct 2024 15:46:26 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.11.7-dev.20241029090957
5
+ Generated: Tue, 29 Oct 2024 09:10:21 GMT
6
6
 
7
7
  MIT License
8
8
 
@@ -11949,7 +11949,7 @@ var validateRadioOrSelectOptions = (value, options) => {
11949
11949
  var yupSchemas = {
11950
11950
  text: validateOnlyStrings,
11951
11951
  radioOrSelectString: (options) => {
11952
- return SchemaType().nullable().transform((value) => {
11952
+ return StringSchema().nullable().transform((value) => {
11953
11953
  if (value === "") {
11954
11954
  return void 0;
11955
11955
  }
@@ -11960,11 +11960,11 @@ var yupSchemas = {
11960
11960
  }).test(
11961
11961
  "matchesOptionOrPattern",
11962
11962
  ({ value }) => `The option ${JSON.stringify(value)} is not valid.`,
11963
- (value) => {
11964
- if (value !== void 0 && typeof value !== "string") {
11963
+ (castValue, { originalValue }) => {
11964
+ if (castValue !== void 0 && typeof originalValue !== "string") {
11965
11965
  return false;
11966
11966
  }
11967
- return validateRadioOrSelectOptions(value, options);
11967
+ return validateRadioOrSelectOptions(castValue, options);
11968
11968
  }
11969
11969
  );
11970
11970
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remoteoss/json-schema-form",
3
- "version": "0.11.7-dev.20241025154552",
3
+ "version": "0.11.7-dev.20241029090957",
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",
@@ -856,7 +856,7 @@ describe('createHeadlessForm', () => {
856
856
  });
857
857
 
858
858
  expect(validateForm({ has_siblings: false })).toEqual({
859
- has_siblings: 'The option false is not valid.',
859
+ has_siblings: 'The option "false" is not valid.',
860
860
  });
861
861
  });
862
862