@contentful/field-editor-dropdown 1.5.16 → 1.6.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.
|
@@ -8,11 +8,11 @@ Object.defineProperty(exports, "DropdownEditor", {
|
|
|
8
8
|
return DropdownEditor;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _react = _interop_require_wildcard(require("react"));
|
|
11
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
12
12
|
const _f36components = require("@contentful/f36-components");
|
|
13
13
|
const _fieldeditorshared = require("@contentful/field-editor-shared");
|
|
14
14
|
const _dropdownUtils = require("./dropdownUtils");
|
|
15
|
-
const _styles = _interop_require_wildcard(require("./styles"));
|
|
15
|
+
const _styles = /*#__PURE__*/ _interop_require_wildcard(require("./styles"));
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) {
|
|
17
17
|
if (typeof WeakMap !== "function") return null;
|
|
18
18
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -55,7 +55,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
55
55
|
return newObj;
|
|
56
56
|
}
|
|
57
57
|
function DropdownEditor(props) {
|
|
58
|
-
const { field, locales } = props;
|
|
58
|
+
const { field, locales, id } = props;
|
|
59
59
|
const options = (0, _dropdownUtils.getOptions)(field);
|
|
60
60
|
const misconfigured = options.length === 0;
|
|
61
61
|
if (misconfigured) {
|
|
@@ -68,6 +68,7 @@ function DropdownEditor(props) {
|
|
|
68
68
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
69
69
|
}, ({ value, errors, disabled, setValue })=>_react.createElement(_f36components.Select, {
|
|
70
70
|
testId: "dropdown-editor",
|
|
71
|
+
id: id,
|
|
71
72
|
isInvalid: errors.length > 0,
|
|
72
73
|
isDisabled: disabled,
|
|
73
74
|
className: direction === 'rtl' ? _styles.rightToLeft : '',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
const _react = _interop_require_wildcard(require("react"));
|
|
5
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
6
6
|
const _fieldeditortestutils = require("@contentful/field-editor-test-utils");
|
|
7
7
|
require("@testing-library/jest-dom/extend-expect");
|
|
8
8
|
const _react1 = require("@testing-library/react");
|
|
@@ -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, locales } = props;
|
|
7
|
+
const { field, locales, id } = props;
|
|
8
8
|
const options = getOptions(field);
|
|
9
9
|
const misconfigured = options.length === 0;
|
|
10
10
|
if (misconfigured) {
|
|
@@ -17,6 +17,7 @@ export function DropdownEditor(props) {
|
|
|
17
17
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
18
18
|
}, ({ value, errors, disabled, setValue })=>React.createElement(Select, {
|
|
19
19
|
testId: "dropdown-editor",
|
|
20
|
+
id: id,
|
|
20
21
|
isInvalid: errors.length > 0,
|
|
21
22
|
isDisabled: disabled,
|
|
22
23
|
className: direction === 'rtl' ? styles.rightToLeft : '',
|
|
@@ -13,6 +13,10 @@ export interface DropdownEditorProps {
|
|
|
13
13
|
* sdk.locales
|
|
14
14
|
*/
|
|
15
15
|
locales: LocalesAPI;
|
|
16
|
+
/**
|
|
17
|
+
* id used for associating the input field with its label
|
|
18
|
+
*/
|
|
19
|
+
id?: string;
|
|
16
20
|
}
|
|
17
21
|
export declare function DropdownEditor(props: DropdownEditorProps): React.JSX.Element;
|
|
18
22
|
export declare namespace DropdownEditor {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-dropdown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@contentful/f36-components": "^4.70.0",
|
|
39
39
|
"@contentful/f36-tokens": "^4.0.5",
|
|
40
|
-
"@contentful/field-editor-shared": "^2.4.
|
|
40
|
+
"@contentful/field-editor-shared": "^2.4.1",
|
|
41
41
|
"emotion": "^10.0.0",
|
|
42
42
|
"lodash": "^4.17.15",
|
|
43
43
|
"nanoid": "^3.1.3"
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"registry": "https://npm.pkg.github.com/"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "7ec565308c8d4da384b8fec6f5d840bdf6d4927d"
|
|
56
56
|
}
|