@remoteoss/json-schema-form 0.7.4-dev.20231107114922 → 0.7.5-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 +14 -2
- package/dist/index.cjs +5 -3
- package/dist/index.js +5 -3
- package/dist/standalone.js +5 -3
- package/package.json +1 -1
- package/src/tests/conditions.test.js +12 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
#### 0.7.5-beta.0 (2023-11-15)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
- Follow-up of #57. Ignore internal attributes from conditional attributes removal (`visibilityCondition`) ([#59](https://github.com/remoteoss/json-schema-form/pull/59)) ([57fe4468](https://github.com/remoteoss/json-schema-form/commit/57fe446834636d727a5da5a91f7e5f3cc4eab8f8))
|
|
6
|
+
|
|
7
|
+
#### 0.7.4-beta.0 (2023-11-07)
|
|
8
|
+
|
|
9
|
+
##### Chores
|
|
10
|
+
|
|
11
|
+
- Follow-up of #57. Ignore internal attributes from conditional attributes removal (`Component`, `calculateDynamicProperties`) ([#58](https://github.com/remoteoss/json-schema-form/pull/58)) ([ee762c2e](https://github.com/remoteoss/json-schema-form/commit/ee762c2e90834a9ec0d7b88af47cefe1e3a03dd1))
|
|
12
|
+
|
|
1
13
|
#### 0.7.3-beta.0 (2023-11-07)
|
|
2
14
|
|
|
3
15
|
##### Bug Fixes
|
|
4
16
|
|
|
5
|
-
|
|
17
|
+
- Remove conditional attributes after the condition is unmatched ([#57](https://github.com/remoteoss/json-schema-form/pull/57)) ([8bac7145](https://github.com/remoteoss/json-schema-form/commit/8bac7145dfdd4136c0613044389666a614eb12f7))
|
|
6
18
|
|
|
7
19
|
#### 0.7.2-beta.0 (2023-11-06)
|
|
8
20
|
|
|
9
21
|
##### Bug Fixes
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
- **select/radio:** Support oneOf[].pattern validation ([#47](https://github.com/remoteoss/json-schema-form/pull/47)) ([5a4bb592](https://github.com/remoteoss/json-schema-form/commit/5a4bb59266ff595a9cb65f5b261a4ae2f3ad279f))
|
|
12
24
|
|
|
13
25
|
#### 0.7.1-beta.0 (2023-10-31)
|
|
14
26
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2023 Remote Technology, Inc.
|
|
4
|
-
NPM Package: @remoteoss/json-schema-form@0.7.
|
|
5
|
-
Generated:
|
|
4
|
+
NPM Package: @remoteoss/json-schema-form@0.7.5-beta.0
|
|
5
|
+
Generated: Wed, 15 Nov 2023 07:53:09 GMT
|
|
6
6
|
|
|
7
7
|
MIT License
|
|
8
8
|
|
|
@@ -1076,8 +1076,10 @@ var dynamicInternalJsfAttrs = [
|
|
|
1076
1076
|
// To be deprecated in favor of json-logic
|
|
1077
1077
|
"scopedJsonSchema",
|
|
1078
1078
|
// The respective JSON Schema
|
|
1079
|
-
"Component"
|
|
1080
1079
|
// HOTFIX/TODO Internal customizations, check test conditions.test.js for more info.
|
|
1080
|
+
"Component",
|
|
1081
|
+
"calculateDynamicProperties",
|
|
1082
|
+
"visibilityCondition"
|
|
1081
1083
|
];
|
|
1082
1084
|
var dynamicInternalJsfAttrsObj = Object.fromEntries(
|
|
1083
1085
|
dynamicInternalJsfAttrs.map((k) => [k, true])
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2023 Remote Technology, Inc.
|
|
4
|
-
NPM Package: @remoteoss/json-schema-form@0.7.
|
|
5
|
-
Generated:
|
|
4
|
+
NPM Package: @remoteoss/json-schema-form@0.7.5-beta.0
|
|
5
|
+
Generated: Wed, 15 Nov 2023 07:53:09 GMT
|
|
6
6
|
|
|
7
7
|
MIT License
|
|
8
8
|
|
|
@@ -1040,8 +1040,10 @@ var dynamicInternalJsfAttrs = [
|
|
|
1040
1040
|
// To be deprecated in favor of json-logic
|
|
1041
1041
|
"scopedJsonSchema",
|
|
1042
1042
|
// The respective JSON Schema
|
|
1043
|
-
"Component"
|
|
1044
1043
|
// HOTFIX/TODO Internal customizations, check test conditions.test.js for more info.
|
|
1044
|
+
"Component",
|
|
1045
|
+
"calculateDynamicProperties",
|
|
1046
|
+
"visibilityCondition"
|
|
1045
1047
|
];
|
|
1046
1048
|
var dynamicInternalJsfAttrsObj = Object.fromEntries(
|
|
1047
1049
|
dynamicInternalJsfAttrs.map((k) => [k, true])
|
package/dist/standalone.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/*!
|
|
3
3
|
Copyright (c) 2023 Remote Technology, Inc.
|
|
4
|
-
NPM Package: @remoteoss/json-schema-form@0.7.
|
|
5
|
-
Generated:
|
|
4
|
+
NPM Package: @remoteoss/json-schema-form@0.7.5-beta.0
|
|
5
|
+
Generated: Wed, 15 Nov 2023 07:53:09 GMT
|
|
6
6
|
|
|
7
7
|
MIT License
|
|
8
8
|
|
|
@@ -12394,8 +12394,10 @@ var dynamicInternalJsfAttrs = [
|
|
|
12394
12394
|
// To be deprecated in favor of json-logic
|
|
12395
12395
|
"scopedJsonSchema",
|
|
12396
12396
|
// The respective JSON Schema
|
|
12397
|
-
"Component"
|
|
12398
12397
|
// HOTFIX/TODO Internal customizations, check test conditions.test.js for more info.
|
|
12398
|
+
"Component",
|
|
12399
|
+
"calculateDynamicProperties",
|
|
12400
|
+
"visibilityCondition"
|
|
12399
12401
|
];
|
|
12400
12402
|
var dynamicInternalJsfAttrsObj = Object.fromEntries(
|
|
12401
12403
|
dynamicInternalJsfAttrs.map((k) => [k, true])
|
package/package.json
CHANGED
|
@@ -293,7 +293,7 @@ describe('Conditional attributes updated', () => {
|
|
|
293
293
|
expect(fields[1].isVisible).toBe(false);
|
|
294
294
|
});
|
|
295
295
|
|
|
296
|
-
it('Keeps internal attributes (
|
|
296
|
+
it('Keeps internal attributes (dynamicInternalJsfAttrs)', () => {
|
|
297
297
|
// This is necessary while we keep supporting "type", even if deprecated
|
|
298
298
|
// otherwise our Remote app will break because it didn't migrate
|
|
299
299
|
// from "type" to "inputType" yet.
|
|
@@ -359,7 +359,7 @@ describe('Conditional attributes updated', () => {
|
|
|
359
359
|
});
|
|
360
360
|
});
|
|
361
361
|
|
|
362
|
-
it('Keeps custom
|
|
362
|
+
it('Keeps custom attributes (dynamicInternalJsfAttrs) (hotfix temporary)', () => {
|
|
363
363
|
// This is necessary as hotfix because we (Remote) use it internally.
|
|
364
364
|
// Not cool, we'll need a better solution asap.
|
|
365
365
|
const { fields, handleValidation } = createHeadlessForm(
|
|
@@ -396,6 +396,7 @@ describe('Conditional attributes updated', () => {
|
|
|
396
396
|
customProperties: {
|
|
397
397
|
salary_period: {
|
|
398
398
|
Component: '<A React Component>',
|
|
399
|
+
calculateDynamicProperties: () => true,
|
|
399
400
|
},
|
|
400
401
|
},
|
|
401
402
|
}
|
|
@@ -403,13 +404,22 @@ describe('Conditional attributes updated', () => {
|
|
|
403
404
|
|
|
404
405
|
// It's there by default
|
|
405
406
|
expect(fields[1].Component).toBe('<A React Component>');
|
|
407
|
+
expect(fields[1].calculateDynamicProperties).toEqual(expect.any(Function));
|
|
406
408
|
|
|
407
409
|
// Given "Yes", it stays there too.
|
|
408
410
|
handleValidation({ is_full_time: 'yes' });
|
|
409
411
|
expect(fields[1].Component).toBe('<A React Component>');
|
|
412
|
+
expect(fields[1].calculateDynamicProperties).toEqual(expect.any(Function));
|
|
410
413
|
|
|
411
414
|
// Given "No", it stays there too.
|
|
412
415
|
handleValidation({ is_full_time: 'no' });
|
|
413
416
|
expect(fields[1].Component).toBe('<A React Component>');
|
|
417
|
+
expect(fields[1].calculateDynamicProperties).toEqual(expect.any(Function));
|
|
418
|
+
|
|
419
|
+
expect(fields[1].visibilityCondition).toEqual(undefined);
|
|
420
|
+
// visibilityCondition can be externally changed/updated/added, it stays there too;
|
|
421
|
+
fields[1].visibilityCondition = () => false;
|
|
422
|
+
handleValidation({ is_full_time: 'no' });
|
|
423
|
+
expect(fields[1].visibilityCondition).toEqual(expect.any(Function));
|
|
414
424
|
});
|
|
415
425
|
});
|