@contentful/field-editor-dropdown 1.5.17 → 1.6.1

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.
@@ -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 : '',
@@ -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.5.17",
3
+ "version": "1.6.1",
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.1",
40
+ "@contentful/field-editor-shared": "^2.4.2",
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": "1d0dc6dc10cf4ad43aa48b04fa67d29ab7edaee8"
55
+ "gitHead": "6bee4a59a3c19a95d2cadde3ef0c78112788626e"
56
56
  }