@atlaskit/inline-edit 12.2.3 → 12.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/inline-edit
2
2
 
3
+ ## 12.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 12.2.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 12.2.3
4
16
 
5
17
  ### Patch Changes
@@ -12,58 +12,56 @@ const commentMessage = `We could not automatically convert this code to the new
12
12
  This file uses \`InlineEdit\` and \`InlineEditStateless\` at the same time. We've merged these two types since version 12.0.0, and please use the merged version instead.
13
13
  `;
14
14
 
15
- const elevateComponentToDefault = (
16
- pkg: string,
17
- toPkg: string,
18
- innerElementName: string,
19
- ) => (j: core.JSCodeshift, root: any) => {
20
- const importDeclarations = root
21
- .find(j.ImportDeclaration)
22
- .filter(
23
- (path: ASTPath<ImportDeclaration>) => path.node.source.value === pkg,
24
- );
15
+ const elevateComponentToDefault =
16
+ (pkg: string, toPkg: string, innerElementName: string) =>
17
+ (j: core.JSCodeshift, root: any) => {
18
+ const importDeclarations = root
19
+ .find(j.ImportDeclaration)
20
+ .filter(
21
+ (path: ASTPath<ImportDeclaration>) => path.node.source.value === pkg,
22
+ );
25
23
 
26
- const defaultSpecifier = importDeclarations
27
- .find(j.ImportDefaultSpecifier)
28
- .nodes();
29
- const otherSpecifier = importDeclarations.find(j.ImportSpecifier).nodes();
24
+ const defaultSpecifier = importDeclarations
25
+ .find(j.ImportDefaultSpecifier)
26
+ .nodes();
27
+ const otherSpecifier = importDeclarations.find(j.ImportSpecifier).nodes();
30
28
 
31
- const isImportingStateless =
32
- otherSpecifier.filter(
33
- (s: ImportSpecifier) =>
34
- s.imported && s.imported.name === innerElementName,
35
- ).length > 0;
29
+ const isImportingStateless =
30
+ otherSpecifier.filter(
31
+ (s: ImportSpecifier) =>
32
+ s.imported && s.imported.name === innerElementName,
33
+ ).length > 0;
36
34
 
37
- if (defaultSpecifier.length > 0 && isImportingStateless) {
38
- addCommentToStartOfFile({ j, base: root, message: commentMessage });
39
- return;
40
- }
35
+ if (defaultSpecifier.length > 0 && isImportingStateless) {
36
+ addCommentToStartOfFile({ j, base: root, message: commentMessage });
37
+ return;
38
+ }
41
39
 
42
- const newDefaultSpecifier = defaultSpecifier.map(
43
- (s: ImportDefaultSpecifier) => {
44
- return j.importDeclaration(
45
- [j.importDefaultSpecifier(s.local)],
46
- j.literal(pkg),
47
- );
48
- },
49
- );
40
+ const newDefaultSpecifier = defaultSpecifier.map(
41
+ (s: ImportDefaultSpecifier) => {
42
+ return j.importDeclaration(
43
+ [j.importDefaultSpecifier(s.local)],
44
+ j.literal(pkg),
45
+ );
46
+ },
47
+ );
50
48
 
51
- const newOtherSpecifiers = otherSpecifier.map((s: ImportSpecifier) => {
52
- if (s.imported.name === innerElementName) {
53
- return j.importDeclaration(
54
- [j.importDefaultSpecifier(s.local)],
55
- j.literal(toPkg),
56
- );
57
- } else {
58
- return j.importDeclaration([s], j.literal(pkg));
59
- }
60
- });
49
+ const newOtherSpecifiers = otherSpecifier.map((s: ImportSpecifier) => {
50
+ if (s.imported.name === innerElementName) {
51
+ return j.importDeclaration(
52
+ [j.importDefaultSpecifier(s.local)],
53
+ j.literal(toPkg),
54
+ );
55
+ } else {
56
+ return j.importDeclaration([s], j.literal(pkg));
57
+ }
58
+ });
61
59
 
62
- importDeclarations.forEach((path: ASTPath<ImportDeclaration>) => {
63
- j(path).replaceWith(newDefaultSpecifier);
64
- j(path).insertBefore(newOtherSpecifiers);
65
- });
66
- };
60
+ importDeclarations.forEach((path: ASTPath<ImportDeclaration>) => {
61
+ j(path).replaceWith(newDefaultSpecifier);
62
+ j(path).insertBefore(newOtherSpecifiers);
63
+ });
64
+ };
67
65
 
68
66
  export default elevateComponentToDefault(
69
67
  '@atlaskit/inline-edit',
@@ -5,47 +5,45 @@ import core, {
5
5
  ImportSpecifier,
6
6
  } from 'jscodeshift';
7
7
 
8
- const elevateComponentToNewEntryPoint = (
9
- pkg: string,
10
- toPkg: string,
11
- innerElementName: string,
12
- ) => (j: core.JSCodeshift, root: any) => {
13
- const importDeclarations = root
14
- .find(j.ImportDeclaration)
15
- .filter(
16
- (path: ASTPath<ImportDeclaration>) => path.node.source.value === pkg,
17
- );
8
+ const elevateComponentToNewEntryPoint =
9
+ (pkg: string, toPkg: string, innerElementName: string) =>
10
+ (j: core.JSCodeshift, root: any) => {
11
+ const importDeclarations = root
12
+ .find(j.ImportDeclaration)
13
+ .filter(
14
+ (path: ASTPath<ImportDeclaration>) => path.node.source.value === pkg,
15
+ );
18
16
 
19
- const defaultSpecifier = importDeclarations
20
- .find(j.ImportDefaultSpecifier)
21
- .nodes();
22
- const otherSpecifier = importDeclarations.find(j.ImportSpecifier).nodes();
17
+ const defaultSpecifier = importDeclarations
18
+ .find(j.ImportDefaultSpecifier)
19
+ .nodes();
20
+ const otherSpecifier = importDeclarations.find(j.ImportSpecifier).nodes();
23
21
 
24
- const newDefaultSpecifier = defaultSpecifier.map(
25
- (s: ImportDefaultSpecifier) => {
26
- return j.importDeclaration(
27
- [j.importDefaultSpecifier(s.local)],
28
- j.literal(pkg),
29
- );
30
- },
31
- );
22
+ const newDefaultSpecifier = defaultSpecifier.map(
23
+ (s: ImportDefaultSpecifier) => {
24
+ return j.importDeclaration(
25
+ [j.importDefaultSpecifier(s.local)],
26
+ j.literal(pkg),
27
+ );
28
+ },
29
+ );
32
30
 
33
- const newOtherSpecifiers = otherSpecifier.map((s: ImportSpecifier) => {
34
- if (s.imported.name === innerElementName) {
35
- return j.importDeclaration(
36
- [j.importDefaultSpecifier(s.local)],
37
- j.literal(toPkg),
38
- );
39
- } else {
40
- return j.importDeclaration([s], j.literal(pkg));
41
- }
42
- });
31
+ const newOtherSpecifiers = otherSpecifier.map((s: ImportSpecifier) => {
32
+ if (s.imported.name === innerElementName) {
33
+ return j.importDeclaration(
34
+ [j.importDefaultSpecifier(s.local)],
35
+ j.literal(toPkg),
36
+ );
37
+ } else {
38
+ return j.importDeclaration([s], j.literal(pkg));
39
+ }
40
+ });
43
41
 
44
- importDeclarations.forEach((path: ASTPath<ImportDeclaration>) => {
45
- j(path).replaceWith(newDefaultSpecifier);
46
- j(path).insertBefore(newOtherSpecifiers);
47
- });
48
- };
42
+ importDeclarations.forEach((path: ASTPath<ImportDeclaration>) => {
43
+ j(path).replaceWith(newDefaultSpecifier);
44
+ j(path).insertBefore(newOtherSpecifiers);
45
+ });
46
+ };
49
47
 
50
48
  export default elevateComponentToNewEntryPoint(
51
49
  '@atlaskit/inline-edit',
@@ -51,7 +51,7 @@ var buttonStyles = (0, _react2.css)({
51
51
  var analyticsAttributes = {
52
52
  componentName: 'inlineEdit',
53
53
  packageName: "@atlaskit/inline-edit",
54
- packageVersion: "12.2.3"
54
+ packageVersion: "12.2.5"
55
55
  };
56
56
 
57
57
  var noop = function noop() {};
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-edit",
3
- "version": "12.2.3",
3
+ "version": "12.2.5",
4
4
  "sideEffects": false
5
5
  }
@@ -20,7 +20,7 @@ const buttonStyles = css({
20
20
  const analyticsAttributes = {
21
21
  componentName: 'inlineEdit',
22
22
  packageName: "@atlaskit/inline-edit",
23
- packageVersion: "12.2.3"
23
+ packageVersion: "12.2.5"
24
24
  };
25
25
 
26
26
  const noop = () => {};
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-edit",
3
- "version": "12.2.3",
3
+ "version": "12.2.5",
4
4
  "sideEffects": false
5
5
  }
@@ -26,7 +26,7 @@ var buttonStyles = css({
26
26
  var analyticsAttributes = {
27
27
  componentName: 'inlineEdit',
28
28
  packageName: "@atlaskit/inline-edit",
29
- packageVersion: "12.2.3"
29
+ packageVersion: "12.2.5"
30
30
  };
31
31
 
32
32
  var noop = function noop() {};
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-edit",
3
- "version": "12.2.3",
3
+ "version": "12.2.5",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-edit",
3
- "version": "12.2.3",
3
+ "version": "12.2.5",
4
4
  "description": "An inline edit displays a custom input component that switches between reading and editing on the same page.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,14 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.0 <4.5": {
17
- "*": [
18
- "dist/types-ts4.0/*",
19
- "dist/types-ts4.0/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": false,
24
16
  "atlaskit:src": "src/index.ts",
25
17
  "homepage": "https://atlassian.design/components/inline-edit/",
@@ -34,14 +26,14 @@
34
26
  },
35
27
  "dependencies": {
36
28
  "@atlaskit/analytics-next": "^8.2.0",
37
- "@atlaskit/button": "^16.3.0",
29
+ "@atlaskit/button": "^16.5.0",
38
30
  "@atlaskit/codemod-utils": "^4.1.0",
39
- "@atlaskit/form": "^8.6.0",
31
+ "@atlaskit/form": "^8.8.0",
40
32
  "@atlaskit/icon": "^21.11.0",
41
33
  "@atlaskit/inline-dialog": "^13.4.0",
42
34
  "@atlaskit/textfield": "^5.3.0",
43
35
  "@atlaskit/theme": "^12.2.0",
44
- "@atlaskit/tokens": "^0.10.0",
36
+ "@atlaskit/tokens": "^0.12.0",
45
37
  "@babel/runtime": "^7.0.0",
46
38
  "@emotion/react": "^11.7.1"
47
39
  },
@@ -52,7 +44,7 @@
52
44
  "@atlaskit/datetime-picker": "^12.3.0",
53
45
  "@atlaskit/docs": "*",
54
46
  "@atlaskit/section-message": "^6.3.0",
55
- "@atlaskit/select": "^15.7.0",
47
+ "@atlaskit/select": "^16.0.0",
56
48
  "@atlaskit/ssr": "*",
57
49
  "@atlaskit/tag": "^11.4.0",
58
50
  "@atlaskit/tag-group": "^10.1.0",
package/report.api.md CHANGED
@@ -1,8 +1,17 @@
1
- ## API Report File for "@atlaskit/inline-edit".
1
+ <!-- API Report Version: 2.2 -->
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ ## API Report File for "@atlaskit/inline-edit"
4
4
 
5
- [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
9
+
10
+ - [Main Entry Types](#main-entry-types)
11
+
12
+ ### Main Entry Types
13
+
14
+ <!--SECTION START: Main Entry Types-->
6
15
 
7
16
  ```ts
8
17
  import { FieldProps } from '@atlaskit/form';
@@ -11,90 +20,65 @@ import { default as React_2 } from 'react';
11
20
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
12
21
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
13
22
 
14
- declare interface CommonProps extends WithAnalyticsEventsProps {
15
- /** Additional information to be included in the `context` of analytics events that come from button. */
23
+ // @public (undocumented)
24
+ interface CommonProps extends WithAnalyticsEventsProps {
16
25
  analyticsContext?: Record<string, any>;
17
- /** Accessibility label for the cancel action button. */
18
26
  cancelButtonLabel?: string;
19
- /** Accessibility label for the confirm action button, which saves the field value into `editValue`. */
20
27
  confirmButtonLabel?: string;
21
- /** The user input entered into the field during `editView`. This value is updated and saved by `onConfirm`. */
22
28
  defaultValue: any;
23
- /** Label above the input field that communicates what value should be entered. */
29
+ editButtonLabel?: string;
30
+ hideActionButtons?: boolean;
31
+ isRequired?: boolean;
32
+ keepEditViewOpenOnBlur?: boolean;
24
33
  label?: string;
25
- /** Displays an inline dialog with a message when the field input is invalid. This is handled by `react-final-form`. */
34
+ onCancel?: () => void;
35
+ readViewFitContainerWidth?: boolean;
36
+ startWithEditViewOpen?: boolean;
26
37
  validate?: (
27
38
  value: any,
28
39
  formState: {},
29
40
  fieldState: {},
30
- ) => string | void | Promise<string | void>;
31
- /**
32
- * Sets the view when the element blurs and loses focus (this can happen when a user clicks away).
33
- * When set to true, inline edit stays in `editView` when blurred. */
34
- keepEditViewOpenOnBlur?: boolean;
35
- /** Sets whether the confirm and cancel action buttons are displayed in the bottom right of the field. */
36
- hideActionButtons?: boolean;
37
- /** Determines whether the input value can be confirmed as empty. */
38
- isRequired?: boolean;
39
- /** Determines whether the `readView` has 100% width within its container, or whether it fits the content. */
40
- readViewFitContainerWidth?: boolean;
41
- /** Accessibility label for button, which is used to enter `editView` from keyboard. */
42
- editButtonLabel?: string;
43
- /** Exits `editView` and switches back to `readView`. This is called when the cancel action button (x) is clicked. */
44
- onCancel?: () => void;
45
- /**
46
- * Determines whether it begins in `editView` or `readView`. When set to true, `isEditing` begins as true and the inline edit
47
- * starts in `editView`.
48
- */
49
- startWithEditViewOpen?: boolean;
41
+ ) => Promise<string | void> | string | void;
50
42
  }
51
43
 
52
- declare interface ExtendedFieldProps<FieldValue>
53
- extends FieldProps<FieldValue> {
44
+ // @public (undocumented)
45
+ interface ExtendedFieldProps<FieldValue> extends FieldProps<FieldValue> {
46
+ // (undocumented)
54
47
  errorMessage?: string | undefined;
55
48
  }
56
49
 
57
- declare const InlineEdit: <FieldValue extends unknown = string>(
50
+ // @public (undocumented)
51
+ const InlineEdit: <FieldValue extends unknown = string>(
58
52
  props: InlineEditProps<FieldValue>,
59
53
  ) => jsx.JSX.Element;
60
54
  export default InlineEdit;
61
55
 
62
- export declare const InlineEditableTextfield: (
56
+ // @public (undocumented)
57
+ export const InlineEditableTextfield: (
63
58
  props: InlineEditableTextfieldProps,
64
59
  ) => jsx.JSX.Element;
65
60
 
66
- export declare interface InlineEditableTextfieldProps extends CommonProps {
67
- /** Sets height of the text field to compact. The top and bottom padding is decreased. */
61
+ // @public (undocumented)
62
+ export interface InlineEditableTextfieldProps extends CommonProps {
68
63
  isCompact?: boolean;
69
- /**
70
- * Calls the `editView` handler. It confirms the changes.
71
- * The field value is passed as an argument to this function.
72
- */
73
64
  onConfirm: (value: string, analyticsEvent: UIAnalyticsEvent) => void;
74
- /** Text shown in `readView` when the field value is an empty string. */
75
65
  placeholder: string;
76
- /** A `testId` prop is provided for specific elements. This is a unique string that appears as a data attribute `data-testid` in the rendered code and serves as a hook for automated tests.
77
- */
78
66
  testId?: string;
79
67
  }
80
68
 
81
- export declare interface InlineEditProps<FieldValue> extends CommonProps {
82
- /** The component shown when user is editing (when the inline edit is not in `readView`). */
69
+ // @public (undocumented)
70
+ export interface InlineEditProps<FieldValue> extends CommonProps {
83
71
  editView: (
84
72
  fieldProps: ExtendedFieldProps<FieldValue>,
85
73
  ref: React_2.RefObject<any>,
86
74
  ) => React_2.ReactNode;
87
- /** Sets whether the component shows the `readView` or the `editView`. This is used to manage the state of the input in stateless inline edit. */
88
75
  isEditing?: boolean;
89
- /**
90
- Saves and confirms the value entered into the field. It exits `editView` and returns to `readView`.
91
- */
92
76
  onConfirm: (value: any, analyticsEvent: UIAnalyticsEvent) => void;
93
- /** Handler called when readView is clicked. */
94
77
  onEdit?: () => void;
95
- /** The component shown when not in `editView`. This is when the inline edit is read-only and not being edited.*/
96
78
  readView: () => React_2.ReactNode;
97
79
  }
98
80
 
99
- export {};
81
+ // (No @packageDocumentation comment for this package)
100
82
  ```
83
+
84
+ <!--SECTION END: Main Entry Types-->
@@ -1 +0,0 @@
1
- export { default } from '../inline-edit';
@@ -1 +0,0 @@
1
- export { default } from '../inline-editable-textfield';
@@ -1 +0,0 @@
1
- export type { InlineEditableTextfieldProps, InlineEditProps } from '../types';
@@ -1,3 +0,0 @@
1
- export { default } from './inline-edit';
2
- export { default as InlineEditableTextfield } from './inline-editable-textfield';
3
- export type { InlineEditProps, InlineEditableTextfieldProps } from './types';
@@ -1,4 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import { InlineEditProps } from './types';
3
- declare const InlineEdit: <FieldValue extends unknown = string>(props: InlineEditProps<FieldValue>) => jsx.JSX.Element;
4
- export default InlineEdit;
@@ -1,5 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { InlineEditableTextfieldProps } from './types';
4
- declare const InlineEditableTextfield: (props: InlineEditableTextfieldProps) => jsx.JSX.Element;
5
- export default InlineEditableTextfield;
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- /** @jsx jsx */
3
- import { jsx } from '@emotion/react';
4
- import { ThemeModes } from '@atlaskit/theme/types';
5
- interface ButtonsProp {
6
- mode: ThemeModes;
7
- confirmButtonLabel: string;
8
- cancelButtonLabel: string;
9
- onMouseDown: () => void;
10
- onCancelClick: (event: React.MouseEvent<HTMLElement>) => void;
11
- }
12
- declare const Buttons: ({ mode, confirmButtonLabel, cancelButtonLabel, onMouseDown, onCancelClick, }: ButtonsProp) => jsx.JSX.Element;
13
- export default Buttons;
@@ -1,3 +0,0 @@
1
- export declare const gridSize: number;
2
- export declare const fontSize: number;
3
- export declare const borderRadius: number;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- declare const useButtonFocusHook: (isEditing: boolean | undefined, isEditingState: boolean) => {
3
- editButtonRef: import("react").RefObject<HTMLButtonElement>;
4
- editViewRef: import("react").MutableRefObject<HTMLElement | undefined>;
5
- shouldBeEditing: boolean;
6
- doNotFocusOnEditButton: () => boolean;
7
- };
8
- export default useButtonFocusHook;
@@ -1,13 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- interface ReadViewProps {
5
- editButtonLabel: string;
6
- onEditRequested: () => void;
7
- postReadViewClick: () => void;
8
- editButtonRef: React.RefObject<HTMLButtonElement>;
9
- readViewFitContainerWidth?: boolean;
10
- readView: () => React.ReactNode;
11
- }
12
- declare const ReadView: ({ editButtonLabel, onEditRequested, postReadViewClick, editButtonRef, readViewFitContainerWidth, readView, }: ReadViewProps) => jsx.JSX.Element;
13
- export default ReadView;
@@ -1,68 +0,0 @@
1
- import React from 'react';
2
- import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { FieldProps } from '@atlaskit/form';
4
- interface CommonProps extends WithAnalyticsEventsProps {
5
- /** Additional information to be included in the `context` of analytics events that come from button. */
6
- analyticsContext?: Record<string, any>;
7
- /** Accessibility label for the cancel action button. */
8
- cancelButtonLabel?: string;
9
- /** Accessibility label for the confirm action button, which saves the field value into `editValue`. */
10
- confirmButtonLabel?: string;
11
- /** The user input entered into the field during `editView`. This value is updated and saved by `onConfirm`. */
12
- defaultValue: any;
13
- /** Label above the input field that communicates what value should be entered. */
14
- label?: string;
15
- /** Displays an inline dialog with a message when the field input is invalid. This is handled by `react-final-form`. */
16
- validate?: (value: any, formState: {}, fieldState: {}) => string | void | Promise<string | void>;
17
- /**
18
- * Sets the view when the element blurs and loses focus (this can happen when a user clicks away).
19
- * When set to true, inline edit stays in `editView` when blurred. */
20
- keepEditViewOpenOnBlur?: boolean;
21
- /** Sets whether the confirm and cancel action buttons are displayed in the bottom right of the field. */
22
- hideActionButtons?: boolean;
23
- /** Determines whether the input value can be confirmed as empty. */
24
- isRequired?: boolean;
25
- /** Determines whether the `readView` has 100% width within its container, or whether it fits the content. */
26
- readViewFitContainerWidth?: boolean;
27
- /** Accessibility label for button, which is used to enter `editView` from keyboard. */
28
- editButtonLabel?: string;
29
- /** Exits `editView` and switches back to `readView`. This is called when the cancel action button (x) is clicked. */
30
- onCancel?: () => void;
31
- /**
32
- * Determines whether it begins in `editView` or `readView`. When set to true, `isEditing` begins as true and the inline edit
33
- * starts in `editView`.
34
- */
35
- startWithEditViewOpen?: boolean;
36
- }
37
- export interface ExtendedFieldProps<FieldValue> extends FieldProps<FieldValue> {
38
- errorMessage?: string | undefined;
39
- }
40
- export interface InlineEditProps<FieldValue> extends CommonProps {
41
- /** The component shown when user is editing (when the inline edit is not in `readView`). */
42
- editView: (fieldProps: ExtendedFieldProps<FieldValue>, ref: React.RefObject<any>) => React.ReactNode;
43
- /** Sets whether the component shows the `readView` or the `editView`. This is used to manage the state of the input in stateless inline edit. */
44
- isEditing?: boolean;
45
- /**
46
- Saves and confirms the value entered into the field. It exits `editView` and returns to `readView`.
47
- */
48
- onConfirm: (value: any, analyticsEvent: UIAnalyticsEvent) => void;
49
- /** Handler called when readView is clicked. */
50
- onEdit?: () => void;
51
- /** The component shown when not in `editView`. This is when the inline edit is read-only and not being edited.*/
52
- readView: () => React.ReactNode;
53
- }
54
- export interface InlineEditableTextfieldProps extends CommonProps {
55
- /** Sets height of the text field to compact. The top and bottom padding is decreased. */
56
- isCompact?: boolean;
57
- /**
58
- * Calls the `editView` handler. It confirms the changes.
59
- * The field value is passed as an argument to this function.
60
- */
61
- onConfirm: (value: string, analyticsEvent: UIAnalyticsEvent) => void;
62
- /** Text shown in `readView` when the field value is an empty string. */
63
- placeholder: string;
64
- /** A `testId` prop is provided for specific elements. This is a unique string that appears as a data attribute `data-testid` in the rendered code and serves as a hook for automated tests.
65
- */
66
- testId?: string;
67
- }
68
- export {};