@contentful/field-editor-radio 1.4.2 → 1.4.5
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/cjs/RadioEditor.js
CHANGED
|
@@ -35,7 +35,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
35
35
|
if (cache && cache.has(obj)) {
|
|
36
36
|
return cache.get(obj);
|
|
37
37
|
}
|
|
38
|
-
var newObj = {
|
|
38
|
+
var newObj = {
|
|
39
|
+
__proto__: null
|
|
40
|
+
};
|
|
39
41
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
40
42
|
for(var key in obj){
|
|
41
43
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -54,7 +56,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
54
56
|
return newObj;
|
|
55
57
|
}
|
|
56
58
|
function RadioEditor(props) {
|
|
57
|
-
const { field
|
|
59
|
+
const { field, locales } = props;
|
|
58
60
|
const options = (0, _fieldeditordropdown.getOptions)(field);
|
|
59
61
|
const misconfigured = options.length === 0;
|
|
60
62
|
if (misconfigured) {
|
|
@@ -65,7 +67,7 @@ function RadioEditor(props) {
|
|
|
65
67
|
debounce: 0,
|
|
66
68
|
field: field,
|
|
67
69
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
68
|
-
}, ({ disabled
|
|
70
|
+
}, ({ disabled, value, setValue })=>{
|
|
69
71
|
const setOption = (value)=>{
|
|
70
72
|
setValue((0, _fieldeditordropdown.parseValue)(value, field.type));
|
|
71
73
|
};
|
|
@@ -28,7 +28,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
28
28
|
if (cache && cache.has(obj)) {
|
|
29
29
|
return cache.get(obj);
|
|
30
30
|
}
|
|
31
|
-
var newObj = {
|
|
31
|
+
var newObj = {
|
|
32
|
+
__proto__: null
|
|
33
|
+
};
|
|
32
34
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
33
35
|
for(var key in obj){
|
|
34
36
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -58,7 +60,7 @@ describe('RadioEditor', ()=>{
|
|
|
58
60
|
validations: []
|
|
59
61
|
};
|
|
60
62
|
});
|
|
61
|
-
const { getByTestId
|
|
63
|
+
const { getByTestId, queryByTestId } = (0, _react1.render)(_react.createElement(_RadioEditor.RadioEditor, {
|
|
62
64
|
field: field,
|
|
63
65
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
64
66
|
isInitiallyDisabled: false
|
|
@@ -82,7 +84,7 @@ describe('RadioEditor', ()=>{
|
|
|
82
84
|
]
|
|
83
85
|
};
|
|
84
86
|
});
|
|
85
|
-
const { container
|
|
87
|
+
const { container } = (0, _react1.render)(_react.createElement(_RadioEditor.RadioEditor, {
|
|
86
88
|
field: field,
|
|
87
89
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
88
90
|
isInitiallyDisabled: false
|
|
@@ -110,7 +112,7 @@ describe('RadioEditor', ()=>{
|
|
|
110
112
|
]
|
|
111
113
|
};
|
|
112
114
|
});
|
|
113
|
-
const { container
|
|
115
|
+
const { container, queryByText, getByText } = (0, _react1.render)(_react.createElement(_RadioEditor.RadioEditor, {
|
|
114
116
|
field: field,
|
|
115
117
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
116
118
|
isInitiallyDisabled: false
|
|
@@ -145,7 +147,7 @@ describe('RadioEditor', ()=>{
|
|
|
145
147
|
]
|
|
146
148
|
};
|
|
147
149
|
});
|
|
148
|
-
const { container
|
|
150
|
+
const { container, getByText } = (0, _react1.render)(_react.createElement(_RadioEditor.RadioEditor, {
|
|
149
151
|
field: field,
|
|
150
152
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
151
153
|
isInitiallyDisabled: false
|
|
@@ -186,7 +188,7 @@ describe('RadioEditor', ()=>{
|
|
|
186
188
|
]
|
|
187
189
|
};
|
|
188
190
|
});
|
|
189
|
-
const { container
|
|
191
|
+
const { container, getByText } = (0, _react1.render)(_react.createElement(_RadioEditor.RadioEditor, {
|
|
190
192
|
field: field,
|
|
191
193
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
192
194
|
isInitiallyDisabled: false
|
package/dist/cjs/styles.js
CHANGED
|
@@ -9,14 +9,14 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
clearBtn: function() {
|
|
13
|
+
return clearBtn;
|
|
14
|
+
},
|
|
12
15
|
form: function() {
|
|
13
16
|
return form;
|
|
14
17
|
},
|
|
15
18
|
rightToLeft: function() {
|
|
16
19
|
return rightToLeft;
|
|
17
|
-
},
|
|
18
|
-
clearBtn: function() {
|
|
19
|
-
return clearBtn;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
|
package/dist/esm/RadioEditor.js
CHANGED
|
@@ -5,7 +5,7 @@ import { FieldConnector, PredefinedValuesError } from '@contentful/field-editor-
|
|
|
5
5
|
import { cx } from 'emotion';
|
|
6
6
|
import * as styles from './styles';
|
|
7
7
|
export function RadioEditor(props) {
|
|
8
|
-
const { field
|
|
8
|
+
const { field, locales } = props;
|
|
9
9
|
const options = getOptions(field);
|
|
10
10
|
const misconfigured = options.length === 0;
|
|
11
11
|
if (misconfigured) {
|
|
@@ -16,7 +16,7 @@ export function RadioEditor(props) {
|
|
|
16
16
|
debounce: 0,
|
|
17
17
|
field: field,
|
|
18
18
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
19
|
-
}, ({ disabled
|
|
19
|
+
}, ({ disabled, value, setValue })=>{
|
|
20
20
|
const setOption = (value)=>{
|
|
21
21
|
setValue(parseValue(value, field.type));
|
|
22
22
|
};
|
|
@@ -15,7 +15,7 @@ describe('RadioEditor', ()=>{
|
|
|
15
15
|
validations: []
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
|
-
const { getByTestId
|
|
18
|
+
const { getByTestId, queryByTestId } = render(React.createElement(RadioEditor, {
|
|
19
19
|
field: field,
|
|
20
20
|
locales: createFakeLocalesAPI(),
|
|
21
21
|
isInitiallyDisabled: false
|
|
@@ -39,7 +39,7 @@ describe('RadioEditor', ()=>{
|
|
|
39
39
|
]
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
|
-
const { container
|
|
42
|
+
const { container } = render(React.createElement(RadioEditor, {
|
|
43
43
|
field: field,
|
|
44
44
|
locales: createFakeLocalesAPI(),
|
|
45
45
|
isInitiallyDisabled: false
|
|
@@ -67,7 +67,7 @@ describe('RadioEditor', ()=>{
|
|
|
67
67
|
]
|
|
68
68
|
};
|
|
69
69
|
});
|
|
70
|
-
const { container
|
|
70
|
+
const { container, queryByText, getByText } = render(React.createElement(RadioEditor, {
|
|
71
71
|
field: field,
|
|
72
72
|
locales: createFakeLocalesAPI(),
|
|
73
73
|
isInitiallyDisabled: false
|
|
@@ -102,7 +102,7 @@ describe('RadioEditor', ()=>{
|
|
|
102
102
|
]
|
|
103
103
|
};
|
|
104
104
|
});
|
|
105
|
-
const { container
|
|
105
|
+
const { container, getByText } = render(React.createElement(RadioEditor, {
|
|
106
106
|
field: field,
|
|
107
107
|
locales: createFakeLocalesAPI(),
|
|
108
108
|
isInitiallyDisabled: false
|
|
@@ -143,7 +143,7 @@ describe('RadioEditor', ()=>{
|
|
|
143
143
|
]
|
|
144
144
|
};
|
|
145
145
|
});
|
|
146
|
-
const { container
|
|
146
|
+
const { container, getByText } = render(React.createElement(RadioEditor, {
|
|
147
147
|
field: field,
|
|
148
148
|
locales: createFakeLocalesAPI(),
|
|
149
149
|
isInitiallyDisabled: false
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { FieldAPI, LocalesAPI } from '@contentful/field-editor-shared';
|
|
3
3
|
export interface RadioEditorProps {
|
|
4
4
|
/**
|
|
@@ -14,7 +14,7 @@ export interface RadioEditorProps {
|
|
|
14
14
|
*/
|
|
15
15
|
locales: LocalesAPI;
|
|
16
16
|
}
|
|
17
|
-
export declare function RadioEditor(props: RadioEditorProps):
|
|
17
|
+
export declare function RadioEditor(props: RadioEditorProps): JSX.Element;
|
|
18
18
|
export declare namespace RadioEditor {
|
|
19
19
|
var defaultProps: {
|
|
20
20
|
isInitiallyDisabled: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-radio",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -37,18 +37,21 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@contentful/f36-components": "^4.0.27",
|
|
39
39
|
"@contentful/f36-tokens": "^4.0.0",
|
|
40
|
-
"@contentful/field-editor-dropdown": "^1.4.
|
|
41
|
-
"@contentful/field-editor-shared": "^1.4.
|
|
40
|
+
"@contentful/field-editor-dropdown": "^1.4.5",
|
|
41
|
+
"@contentful/field-editor-shared": "^1.4.5",
|
|
42
42
|
"emotion": "^10.0.17",
|
|
43
43
|
"lodash": "^4.17.15",
|
|
44
44
|
"nanoid": "^3.1.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@contentful/field-editor-test-utils": "^1.4.
|
|
47
|
+
"@contentful/field-editor-test-utils": "^1.4.6",
|
|
48
48
|
"contentful-management": "^10.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": ">=16.8.0"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"registry": "https://npm.pkg.github.com/"
|
|
55
|
+
},
|
|
56
|
+
"gitHead": "142d2039f023bf4ced956aae1dd08b27c35fdbaa"
|
|
54
57
|
}
|