@contentful/field-editor-dropdown 3.3.4-canary.23 → 3.3.4-canary.27
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.
|
@@ -60,14 +60,14 @@ function DropdownEditor(props) {
|
|
|
60
60
|
const options = (0, _dropdownUtils.getOptions)(field);
|
|
61
61
|
const misconfigured = options.length === 0;
|
|
62
62
|
if (misconfigured) {
|
|
63
|
-
return
|
|
63
|
+
return _react.createElement(_fieldeditorshared.PredefinedValuesError, null);
|
|
64
64
|
}
|
|
65
65
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
66
|
-
return
|
|
66
|
+
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
67
67
|
debounce: 0,
|
|
68
68
|
field: field,
|
|
69
69
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
70
|
-
}, ({ value, errors, disabled, setValue })
|
|
70
|
+
}, ({ value, errors, disabled, setValue })=>_react.createElement(_f36components.Select, {
|
|
71
71
|
testId: "dropdown-editor",
|
|
72
72
|
id: id,
|
|
73
73
|
isInvalid: errors.length > 0,
|
|
@@ -79,12 +79,12 @@ function DropdownEditor(props) {
|
|
|
79
79
|
const value = e.target.value;
|
|
80
80
|
setValue((0, _dropdownUtils.parseValue)(value, field.type));
|
|
81
81
|
}
|
|
82
|
-
},
|
|
82
|
+
}, _react.createElement(_f36components.Select.Option, {
|
|
83
83
|
value: ""
|
|
84
84
|
}, _core.i18n._({
|
|
85
85
|
id: "FieldEditors.Dropdown.DropdownEditor.ChooseValue",
|
|
86
86
|
message: "Choose a value"
|
|
87
|
-
})), options.map((option)
|
|
87
|
+
})), options.map((option)=>_react.createElement(_f36components.Select.Option, {
|
|
88
88
|
key: option.value,
|
|
89
89
|
value: String(option.value)
|
|
90
90
|
}, option.label))));
|
|
@@ -60,7 +60,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
60
60
|
validations: []
|
|
61
61
|
};
|
|
62
62
|
});
|
|
63
|
-
const { getByTestId, queryByTestId } = (0, _react1.render)(
|
|
63
|
+
const { getByTestId, queryByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
64
64
|
field: field,
|
|
65
65
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
66
66
|
isInitiallyDisabled: false
|
|
@@ -84,7 +84,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
84
84
|
]
|
|
85
85
|
};
|
|
86
86
|
});
|
|
87
|
-
const { container, getByText } = (0, _react1.render)(
|
|
87
|
+
const { container, getByText } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
88
88
|
field: field,
|
|
89
89
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
90
90
|
isInitiallyDisabled: false
|
|
@@ -110,7 +110,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
110
110
|
]
|
|
111
111
|
};
|
|
112
112
|
});
|
|
113
|
-
const { getByTestId } = (0, _react1.render)(
|
|
113
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
114
114
|
field: field,
|
|
115
115
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
116
116
|
isInitiallyDisabled: false
|
|
@@ -140,7 +140,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
140
140
|
]
|
|
141
141
|
};
|
|
142
142
|
});
|
|
143
|
-
const { getByTestId } = (0, _react1.render)(
|
|
143
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
144
144
|
field: field,
|
|
145
145
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
146
146
|
isInitiallyDisabled: false
|
|
@@ -173,7 +173,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
173
173
|
]
|
|
174
174
|
};
|
|
175
175
|
});
|
|
176
|
-
const { getByTestId } = (0, _react1.render)(
|
|
176
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
177
177
|
field: field,
|
|
178
178
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
179
179
|
isInitiallyDisabled: false
|
|
@@ -210,7 +210,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
210
210
|
]
|
|
211
211
|
};
|
|
212
212
|
});
|
|
213
|
-
const { getByTestId } = (0, _react1.render)(
|
|
213
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_DropdownEditor.DropdownEditor, {
|
|
214
214
|
field: field,
|
|
215
215
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
216
216
|
isInitiallyDisabled: false
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getOptions
|
|
12
|
+
get getOptions () {
|
|
13
13
|
return getOptions;
|
|
14
14
|
},
|
|
15
|
-
parseValue
|
|
15
|
+
get parseValue () {
|
|
16
16
|
return parseValue;
|
|
17
17
|
}
|
|
18
18
|
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
DropdownEditor
|
|
12
|
+
get DropdownEditor () {
|
|
13
13
|
return _DropdownEditor.DropdownEditor;
|
|
14
14
|
},
|
|
15
|
-
getOptions
|
|
15
|
+
get getOptions () {
|
|
16
16
|
return _dropdownUtils.getOptions;
|
|
17
17
|
},
|
|
18
|
-
parseValue
|
|
18
|
+
get parseValue () {
|
|
19
19
|
return _dropdownUtils.parseValue;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -9,14 +9,14 @@ export function DropdownEditor(props) {
|
|
|
9
9
|
const options = getOptions(field);
|
|
10
10
|
const misconfigured = options.length === 0;
|
|
11
11
|
if (misconfigured) {
|
|
12
|
-
return
|
|
12
|
+
return React.createElement(PredefinedValuesError, null);
|
|
13
13
|
}
|
|
14
14
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
15
|
-
return
|
|
15
|
+
return React.createElement(FieldConnector, {
|
|
16
16
|
debounce: 0,
|
|
17
17
|
field: field,
|
|
18
18
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
19
|
-
}, ({ value, errors, disabled, setValue })
|
|
19
|
+
}, ({ value, errors, disabled, setValue })=>React.createElement(Select, {
|
|
20
20
|
testId: "dropdown-editor",
|
|
21
21
|
id: id,
|
|
22
22
|
isInvalid: errors.length > 0,
|
|
@@ -28,12 +28,12 @@ export function DropdownEditor(props) {
|
|
|
28
28
|
const value = e.target.value;
|
|
29
29
|
setValue(parseValue(value, field.type));
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, React.createElement(Select.Option, {
|
|
32
32
|
value: ""
|
|
33
33
|
}, $_i18n._({
|
|
34
34
|
id: "FieldEditors.Dropdown.DropdownEditor.ChooseValue",
|
|
35
35
|
message: "Choose a value"
|
|
36
|
-
})), options.map((option)
|
|
36
|
+
})), options.map((option)=>React.createElement(Select.Option, {
|
|
37
37
|
key: option.value,
|
|
38
38
|
value: String(option.value)
|
|
39
39
|
}, option.label))));
|
|
@@ -15,7 +15,7 @@ describe('DropdownEditor', ()=>{
|
|
|
15
15
|
validations: []
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
|
-
const { getByTestId, queryByTestId } = render(
|
|
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, getByText } = render(
|
|
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 } = render(
|
|
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 } = render(
|
|
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 } = render(
|
|
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 } = render(
|
|
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": "3.3.4-canary.
|
|
3
|
+
"version": "3.3.4-canary.27+0e4621f9",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@contentful/f36-components": "^6.7.1",
|
|
42
|
-
"@contentful/field-editor-shared": "^4.6.3-canary.
|
|
42
|
+
"@contentful/field-editor-shared": "^4.6.3-canary.30+0e4621f9",
|
|
43
43
|
"@emotion/css": "^11.13.5",
|
|
44
44
|
"nanoid": "^3.3.20"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@contentful/field-editor-test-utils": "^3.2.1",
|
|
48
|
-
"@lingui/core": "5.
|
|
48
|
+
"@lingui/core": "5.9.5",
|
|
49
49
|
"contentful-management": "^12.3.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"prettier --write"
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "0e4621f97b3a6b65da12df50fa740c00bcd17b1f"
|
|
66
66
|
}
|