@contentful/field-editor-dropdown 1.4.4 → 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.
|
@@ -34,7 +34,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
34
34
|
if (cache && cache.has(obj)) {
|
|
35
35
|
return cache.get(obj);
|
|
36
36
|
}
|
|
37
|
-
var newObj = {
|
|
37
|
+
var newObj = {
|
|
38
|
+
__proto__: null
|
|
39
|
+
};
|
|
38
40
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
41
|
for(var key in obj){
|
|
40
42
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -53,7 +55,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
53
55
|
return newObj;
|
|
54
56
|
}
|
|
55
57
|
function DropdownEditor(props) {
|
|
56
|
-
const { field
|
|
58
|
+
const { field, locales } = props;
|
|
57
59
|
const options = (0, _dropdownUtils.getOptions)(field);
|
|
58
60
|
const misconfigured = options.length === 0;
|
|
59
61
|
if (misconfigured) {
|
|
@@ -64,7 +66,7 @@ function DropdownEditor(props) {
|
|
|
64
66
|
debounce: 0,
|
|
65
67
|
field: field,
|
|
66
68
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
67
|
-
}, ({ value
|
|
69
|
+
}, ({ value, errors, disabled, setValue })=>_react.createElement(_f36components.Select, {
|
|
68
70
|
testId: "dropdown-editor",
|
|
69
71
|
isInvalid: errors.length > 0,
|
|
70
72
|
isDisabled: disabled,
|
|
@@ -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('DropdownEditor', ()=>{
|
|
|
58
60
|
validations: []
|
|
59
61
|
};
|
|
60
62
|
});
|
|
61
|
-
const { getByTestId
|
|
63
|
+
const { getByTestId, queryByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
62
64
|
field: field,
|
|
63
65
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
64
66
|
isInitiallyDisabled: false
|
|
@@ -82,7 +84,7 @@ describe('DropdownEditor', ()=>{
|
|
|
82
84
|
]
|
|
83
85
|
};
|
|
84
86
|
});
|
|
85
|
-
const { container
|
|
87
|
+
const { container, getByText } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
86
88
|
field: field,
|
|
87
89
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
88
90
|
isInitiallyDisabled: false
|
|
@@ -108,7 +110,7 @@ describe('DropdownEditor', ()=>{
|
|
|
108
110
|
]
|
|
109
111
|
};
|
|
110
112
|
});
|
|
111
|
-
const { getByTestId
|
|
113
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
112
114
|
field: field,
|
|
113
115
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
114
116
|
isInitiallyDisabled: false
|
|
@@ -138,7 +140,7 @@ describe('DropdownEditor', ()=>{
|
|
|
138
140
|
]
|
|
139
141
|
};
|
|
140
142
|
});
|
|
141
|
-
const { getByTestId
|
|
143
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
142
144
|
field: field,
|
|
143
145
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
144
146
|
isInitiallyDisabled: false
|
|
@@ -171,7 +173,7 @@ describe('DropdownEditor', ()=>{
|
|
|
171
173
|
]
|
|
172
174
|
};
|
|
173
175
|
});
|
|
174
|
-
const { getByTestId
|
|
176
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
175
177
|
field: field,
|
|
176
178
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
177
179
|
isInitiallyDisabled: false
|
|
@@ -208,7 +210,7 @@ describe('DropdownEditor', ()=>{
|
|
|
208
210
|
]
|
|
209
211
|
};
|
|
210
212
|
});
|
|
211
|
-
const { getByTestId
|
|
213
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
212
214
|
field: field,
|
|
213
215
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
214
216
|
isInitiallyDisabled: false
|
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
parseValue: function() {
|
|
13
|
-
return parseValue;
|
|
14
|
-
},
|
|
15
12
|
getOptions: function() {
|
|
16
13
|
return getOptions;
|
|
14
|
+
},
|
|
15
|
+
parseValue: function() {
|
|
16
|
+
return parseValue;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _nanoid = require("nanoid");
|
|
@@ -4,7 +4,7 @@ import { FieldConnector, PredefinedValuesError } from '@contentful/field-editor-
|
|
|
4
4
|
import { getOptions, parseValue } from './dropdownUtils';
|
|
5
5
|
import * as styles from './styles';
|
|
6
6
|
export function DropdownEditor(props) {
|
|
7
|
-
const { field
|
|
7
|
+
const { field, locales } = props;
|
|
8
8
|
const options = getOptions(field);
|
|
9
9
|
const misconfigured = options.length === 0;
|
|
10
10
|
if (misconfigured) {
|
|
@@ -15,7 +15,7 @@ export function DropdownEditor(props) {
|
|
|
15
15
|
debounce: 0,
|
|
16
16
|
field: field,
|
|
17
17
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
18
|
-
}, ({ value
|
|
18
|
+
}, ({ value, errors, disabled, setValue })=>React.createElement(Select, {
|
|
19
19
|
testId: "dropdown-editor",
|
|
20
20
|
isInvalid: errors.length > 0,
|
|
21
21
|
isDisabled: disabled,
|
|
@@ -15,7 +15,7 @@ describe('DropdownEditor', ()=>{
|
|
|
15
15
|
validations: []
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
|
-
const { getByTestId
|
|
18
|
+
const { getByTestId, queryByTestId } = render(React.createElement(DropdownEditor, {
|
|
19
19
|
field: field,
|
|
20
20
|
locales: createFakeLocalesAPI(),
|
|
21
21
|
isInitiallyDisabled: false
|
|
@@ -39,7 +39,7 @@ describe('DropdownEditor', ()=>{
|
|
|
39
39
|
]
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
|
-
const { container
|
|
42
|
+
const { container, getByText } = render(React.createElement(DropdownEditor, {
|
|
43
43
|
field: field,
|
|
44
44
|
locales: createFakeLocalesAPI(),
|
|
45
45
|
isInitiallyDisabled: false
|
|
@@ -65,7 +65,7 @@ describe('DropdownEditor', ()=>{
|
|
|
65
65
|
]
|
|
66
66
|
};
|
|
67
67
|
});
|
|
68
|
-
const { getByTestId
|
|
68
|
+
const { getByTestId } = render(React.createElement(DropdownEditor, {
|
|
69
69
|
field: field,
|
|
70
70
|
locales: createFakeLocalesAPI(),
|
|
71
71
|
isInitiallyDisabled: false
|
|
@@ -95,7 +95,7 @@ describe('DropdownEditor', ()=>{
|
|
|
95
95
|
]
|
|
96
96
|
};
|
|
97
97
|
});
|
|
98
|
-
const { getByTestId
|
|
98
|
+
const { getByTestId } = render(React.createElement(DropdownEditor, {
|
|
99
99
|
field: field,
|
|
100
100
|
locales: createFakeLocalesAPI(),
|
|
101
101
|
isInitiallyDisabled: false
|
|
@@ -128,7 +128,7 @@ describe('DropdownEditor', ()=>{
|
|
|
128
128
|
]
|
|
129
129
|
};
|
|
130
130
|
});
|
|
131
|
-
const { getByTestId
|
|
131
|
+
const { getByTestId } = render(React.createElement(DropdownEditor, {
|
|
132
132
|
field: field,
|
|
133
133
|
locales: createFakeLocalesAPI(),
|
|
134
134
|
isInitiallyDisabled: false
|
|
@@ -165,7 +165,7 @@ describe('DropdownEditor', ()=>{
|
|
|
165
165
|
]
|
|
166
166
|
};
|
|
167
167
|
});
|
|
168
|
-
const { getByTestId
|
|
168
|
+
const { getByTestId } = render(React.createElement(DropdownEditor, {
|
|
169
169
|
field: field,
|
|
170
170
|
locales: createFakeLocalesAPI(),
|
|
171
171
|
isInitiallyDisabled: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-dropdown",
|
|
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,13 +37,13 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@contentful/f36-components": "^4.0.27",
|
|
39
39
|
"@contentful/f36-tokens": "^4.0.0",
|
|
40
|
-
"@contentful/field-editor-shared": "^1.4.
|
|
40
|
+
"@contentful/field-editor-shared": "^1.4.5",
|
|
41
41
|
"emotion": "^10.0.0",
|
|
42
42
|
"lodash": "^4.17.15",
|
|
43
43
|
"nanoid": "^3.1.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@contentful/field-editor-test-utils": "^1.4.
|
|
46
|
+
"@contentful/field-editor-test-utils": "^1.4.6",
|
|
47
47
|
"contentful-management": "^10.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"registry": "https://npm.pkg.github.com/"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "142d2039f023bf4ced956aae1dd08b27c35fdbaa"
|
|
56
56
|
}
|