@atlaskit/inline-edit 12.0.8 → 12.1.3
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 +43 -0
- package/dist/cjs/entry-points/types.js +5 -1
- package/dist/cjs/inline-edit.js +1 -1
- package/dist/cjs/inline-editable-textfield.js +3 -1
- package/dist/cjs/internal/styles.js +9 -23
- package/dist/cjs/types.js +5 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/entry-points/types.js +1 -0
- package/dist/es2019/inline-edit.js +1 -1
- package/dist/es2019/inline-editable-textfield.js +2 -1
- package/dist/es2019/internal/styles.js +8 -15
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/entry-points/types.js +1 -0
- package/dist/esm/inline-edit.js +1 -1
- package/dist/esm/inline-editable-textfield.js +2 -1
- package/dist/esm/internal/styles.js +9 -22
- package/dist/esm/types.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/styles.d.ts +0 -1
- package/dist/types/types.d.ts +34 -34
- package/extract-react-types/inline-editable-textfield-props.tsx +7 -0
- package/package.json +23 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @atlaskit/inline-edit
|
|
2
2
|
|
|
3
|
+
## 12.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 12.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 12.1.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 12.1.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [`5c29b7f70ff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5c29b7f70ff) - Instrumented Inline-edit with the new theming package, `@atlaskit/tokens`.
|
|
26
|
+
|
|
27
|
+
Tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
|
|
28
|
+
These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
|
|
34
|
+
## 12.0.8
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies
|
|
39
|
+
|
|
40
|
+
## 12.0.7
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
45
|
+
|
|
3
46
|
## 12.0.8
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|
package/dist/cjs/inline-edit.js
CHANGED
|
@@ -48,7 +48,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
48
48
|
var analyticsAttributes = {
|
|
49
49
|
componentName: 'inlineEdit',
|
|
50
50
|
packageName: "@atlaskit/inline-edit",
|
|
51
|
-
packageVersion: "12.
|
|
51
|
+
packageVersion: "12.1.3"
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
var noop = function noop() {};
|
|
@@ -21,6 +21,8 @@ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
|
21
21
|
|
|
22
22
|
var _colors = require("@atlaskit/theme/colors");
|
|
23
23
|
|
|
24
|
+
var _tokens = require("@atlaskit/tokens");
|
|
25
|
+
|
|
24
26
|
var _inlineEdit = _interopRequireDefault(require("./inline-edit"));
|
|
25
27
|
|
|
26
28
|
var _styles = require("./internal/styles");
|
|
@@ -49,7 +51,7 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
|
49
51
|
css: _styles.errorIconContainerStyles
|
|
50
52
|
}, (0, _core.jsx)(_error.default, {
|
|
51
53
|
label: "error",
|
|
52
|
-
primaryColor: _colors.R400
|
|
54
|
+
primaryColor: (0, _tokens.token)('color.iconBorder.danger', _colors.R400)
|
|
53
55
|
})),
|
|
54
56
|
testId: testId,
|
|
55
57
|
isCompact: isCompact,
|
|
@@ -1,36 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.readViewWrapperStyles = exports.readViewContainerStyles = exports.readViewForTextFieldStyles = exports.errorIconContainerStyles = exports.editButtonStyles = exports.getButtonWrapperStyles = exports.buttonsContainerStyles = void 0;
|
|
9
7
|
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
9
|
|
|
14
10
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
12
|
+
var _tokens = require("@atlaskit/tokens");
|
|
19
13
|
|
|
20
14
|
var spacingUnit = (0, _constants.gridSize)();
|
|
21
15
|
var fontSizeUnit = (0, _constants.fontSize)();
|
|
22
16
|
var elevations = {
|
|
23
|
-
light:
|
|
24
|
-
dark:
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var getElevationStyleForMode = function getElevationStyleForMode(mode) {
|
|
28
|
-
var colors = elevations[mode];
|
|
29
|
-
return {
|
|
30
|
-
boxShadow: "0 4px 8px -2px ".concat(colors[0], ", 0 0 1px ").concat(colors[1])
|
|
31
|
-
};
|
|
17
|
+
light: (0, _tokens.token)('shadow.overlay', "0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A)),
|
|
18
|
+
dark: (0, _tokens.token)('shadow.overlay', "0 4px 8px -2px ".concat(_colors.DN50A, ", 0 0 1px ").concat(_colors.DN60A))
|
|
32
19
|
};
|
|
33
|
-
|
|
34
20
|
var buttonsContainerStyles = {
|
|
35
21
|
display: 'flex',
|
|
36
22
|
flexShrink: 0,
|
|
@@ -42,8 +28,9 @@ var buttonsContainerStyles = {
|
|
|
42
28
|
exports.buttonsContainerStyles = buttonsContainerStyles;
|
|
43
29
|
|
|
44
30
|
var getButtonWrapperStyles = function getButtonWrapperStyles(mode) {
|
|
45
|
-
return
|
|
46
|
-
|
|
31
|
+
return {
|
|
32
|
+
boxShadow: elevations[mode],
|
|
33
|
+
backgroundColor: (0, _tokens.token)('color.background.overlay', _colors.N0),
|
|
47
34
|
width: spacingUnit * 4,
|
|
48
35
|
zIndex: 200,
|
|
49
36
|
borderRadius: spacingUnit / 2 - 1,
|
|
@@ -52,7 +39,7 @@ var getButtonWrapperStyles = function getButtonWrapperStyles(mode) {
|
|
|
52
39
|
'&:last-child': {
|
|
53
40
|
marginLeft: spacingUnit / 2
|
|
54
41
|
}
|
|
55
|
-
}
|
|
42
|
+
};
|
|
56
43
|
};
|
|
57
44
|
|
|
58
45
|
exports.getButtonWrapperStyles = getButtonWrapperStyles;
|
|
@@ -66,8 +53,7 @@ var editButtonStyles = {
|
|
|
66
53
|
padding: '0',
|
|
67
54
|
outline: '0',
|
|
68
55
|
'&:focus + div': {
|
|
69
|
-
border: "2px solid ".concat(_colors.B100)
|
|
70
|
-
background: _colors.N0
|
|
56
|
+
border: "2px solid ".concat((0, _tokens.token)('color.border.focus', _colors.B100))
|
|
71
57
|
}
|
|
72
58
|
};
|
|
73
59
|
exports.editButtonStyles = editButtonStyles;
|
|
@@ -105,7 +91,7 @@ var readViewWrapperStyles = {
|
|
|
105
91
|
width: '100%'
|
|
106
92
|
},
|
|
107
93
|
'&:hover': {
|
|
108
|
-
background: _colors.N30
|
|
94
|
+
background: (0, _tokens.token)('color.background.transparentNeutral.hover', _colors.N30)
|
|
109
95
|
}
|
|
110
96
|
};
|
|
111
97
|
exports.readViewWrapperStyles = readViewWrapperStyles;
|
package/dist/cjs/types.js
CHANGED
package/dist/cjs/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,6 +6,7 @@ import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
|
6
6
|
import InlineDialog from '@atlaskit/inline-dialog';
|
|
7
7
|
import Textfield from '@atlaskit/textfield';
|
|
8
8
|
import { R400 } from '@atlaskit/theme/colors';
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
9
10
|
import InlineEdit from './inline-edit';
|
|
10
11
|
import { errorIconContainerStyles, readViewForTextFieldStyles } from './internal/styles';
|
|
11
12
|
|
|
@@ -33,7 +34,7 @@ const InlineEditableTextfield = props => {
|
|
|
33
34
|
css: errorIconContainerStyles
|
|
34
35
|
}, jsx(ErrorIcon, {
|
|
35
36
|
label: "error",
|
|
36
|
-
primaryColor: R400
|
|
37
|
+
primaryColor: token('color.iconBorder.danger', R400)
|
|
37
38
|
})),
|
|
38
39
|
testId: testId,
|
|
39
40
|
isCompact: isCompact,
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { B100, DN50A, DN60A, N0, N30, N50A, N60A } from '@atlaskit/theme/colors';
|
|
2
2
|
import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
const spacingUnit = gridSize();
|
|
4
5
|
const fontSizeUnit = fontSize();
|
|
5
6
|
const elevations = {
|
|
6
|
-
light:
|
|
7
|
-
dark:
|
|
7
|
+
light: token('shadow.overlay', `0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`),
|
|
8
|
+
dark: token('shadow.overlay', `0 4px 8px -2px ${DN50A}, 0 0 1px ${DN60A}`)
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
const getElevationStyleForMode = mode => {
|
|
11
|
-
const colors = elevations[mode];
|
|
12
|
-
return {
|
|
13
|
-
boxShadow: `0 4px 8px -2px ${colors[0]}, 0 0 1px ${colors[1]}`
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
|
|
17
10
|
export const buttonsContainerStyles = {
|
|
18
11
|
display: 'flex',
|
|
19
12
|
flexShrink: 0,
|
|
@@ -22,8 +15,9 @@ export const buttonsContainerStyles = {
|
|
|
22
15
|
right: 0,
|
|
23
16
|
top: '100%'
|
|
24
17
|
};
|
|
25
|
-
export const getButtonWrapperStyles = mode => ({
|
|
26
|
-
|
|
18
|
+
export const getButtonWrapperStyles = mode => ({
|
|
19
|
+
boxShadow: elevations[mode],
|
|
20
|
+
backgroundColor: token('color.background.overlay', N0),
|
|
27
21
|
width: spacingUnit * 4,
|
|
28
22
|
zIndex: 200,
|
|
29
23
|
borderRadius: spacingUnit / 2 - 1,
|
|
@@ -43,8 +37,7 @@ export const editButtonStyles = {
|
|
|
43
37
|
padding: '0',
|
|
44
38
|
outline: '0',
|
|
45
39
|
'&:focus + div': {
|
|
46
|
-
border: `2px solid ${B100}
|
|
47
|
-
background: N0
|
|
40
|
+
border: `2px solid ${token('color.border.focus', B100)}`
|
|
48
41
|
}
|
|
49
42
|
};
|
|
50
43
|
export const errorIconContainerStyles = {
|
|
@@ -78,6 +71,6 @@ export const readViewWrapperStyles = {
|
|
|
78
71
|
width: '100%'
|
|
79
72
|
},
|
|
80
73
|
'&:hover': {
|
|
81
|
-
background: N30
|
|
74
|
+
background: token('color.background.transparentNeutral.hover', N30)
|
|
82
75
|
}
|
|
83
76
|
};
|
package/dist/es2019/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2019/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/inline-edit.js
CHANGED
|
@@ -7,6 +7,7 @@ import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
|
7
7
|
import InlineDialog from '@atlaskit/inline-dialog';
|
|
8
8
|
import Textfield from '@atlaskit/textfield';
|
|
9
9
|
import { R400 } from '@atlaskit/theme/colors';
|
|
10
|
+
import { token } from '@atlaskit/tokens';
|
|
10
11
|
import InlineEdit from './inline-edit';
|
|
11
12
|
import { errorIconContainerStyles, readViewForTextFieldStyles } from './internal/styles';
|
|
12
13
|
|
|
@@ -34,7 +35,7 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
|
34
35
|
css: errorIconContainerStyles
|
|
35
36
|
}, jsx(ErrorIcon, {
|
|
36
37
|
label: "error",
|
|
37
|
-
primaryColor: R400
|
|
38
|
+
primaryColor: token('color.iconBorder.danger', R400)
|
|
38
39
|
})),
|
|
39
40
|
testId: testId,
|
|
40
41
|
isCompact: isCompact,
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
-
|
|
7
1
|
import { B100, DN50A, DN60A, N0, N30, N50A, N60A } from '@atlaskit/theme/colors';
|
|
8
2
|
import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
9
4
|
var spacingUnit = gridSize();
|
|
10
5
|
var fontSizeUnit = fontSize();
|
|
11
6
|
var elevations = {
|
|
12
|
-
light:
|
|
13
|
-
dark:
|
|
7
|
+
light: token('shadow.overlay', "0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A)),
|
|
8
|
+
dark: token('shadow.overlay', "0 4px 8px -2px ".concat(DN50A, ", 0 0 1px ").concat(DN60A))
|
|
14
9
|
};
|
|
15
|
-
|
|
16
|
-
var getElevationStyleForMode = function getElevationStyleForMode(mode) {
|
|
17
|
-
var colors = elevations[mode];
|
|
18
|
-
return {
|
|
19
|
-
boxShadow: "0 4px 8px -2px ".concat(colors[0], ", 0 0 1px ").concat(colors[1])
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
10
|
export var buttonsContainerStyles = {
|
|
24
11
|
display: 'flex',
|
|
25
12
|
flexShrink: 0,
|
|
@@ -29,8 +16,9 @@ export var buttonsContainerStyles = {
|
|
|
29
16
|
top: '100%'
|
|
30
17
|
};
|
|
31
18
|
export var getButtonWrapperStyles = function getButtonWrapperStyles(mode) {
|
|
32
|
-
return
|
|
33
|
-
|
|
19
|
+
return {
|
|
20
|
+
boxShadow: elevations[mode],
|
|
21
|
+
backgroundColor: token('color.background.overlay', N0),
|
|
34
22
|
width: spacingUnit * 4,
|
|
35
23
|
zIndex: 200,
|
|
36
24
|
borderRadius: spacingUnit / 2 - 1,
|
|
@@ -39,7 +27,7 @@ export var getButtonWrapperStyles = function getButtonWrapperStyles(mode) {
|
|
|
39
27
|
'&:last-child': {
|
|
40
28
|
marginLeft: spacingUnit / 2
|
|
41
29
|
}
|
|
42
|
-
}
|
|
30
|
+
};
|
|
43
31
|
};
|
|
44
32
|
export var editButtonStyles = {
|
|
45
33
|
appearance: 'none',
|
|
@@ -51,8 +39,7 @@ export var editButtonStyles = {
|
|
|
51
39
|
padding: '0',
|
|
52
40
|
outline: '0',
|
|
53
41
|
'&:focus + div': {
|
|
54
|
-
border: "2px solid ".concat(B100)
|
|
55
|
-
background: N0
|
|
42
|
+
border: "2px solid ".concat(token('color.border.focus', B100))
|
|
56
43
|
}
|
|
57
44
|
};
|
|
58
45
|
export var errorIconContainerStyles = {
|
|
@@ -86,6 +73,6 @@ export var readViewWrapperStyles = {
|
|
|
86
73
|
width: '100%'
|
|
87
74
|
},
|
|
88
75
|
'&:hover': {
|
|
89
|
-
background: N30
|
|
76
|
+
background: token('color.background.transparentNeutral.hover', N30)
|
|
90
77
|
}
|
|
91
78
|
};
|
package/dist/esm/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/version.json
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -2,66 +2,66 @@ import React from 'react';
|
|
|
2
2
|
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import { FieldProps } from '@atlaskit/form';
|
|
4
4
|
interface CommonProps extends WithAnalyticsEventsProps {
|
|
5
|
-
/**
|
|
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. */
|
|
6
14
|
label?: string;
|
|
7
|
-
/**
|
|
15
|
+
/** Displays an inline dialog with a message when the field input is invalid. This is handled by `react-final-form`. */
|
|
8
16
|
validate?: (value: any, formState: {}, fieldState: {}) => string | void | Promise<string | void>;
|
|
9
|
-
/**
|
|
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. */
|
|
10
20
|
keepEditViewOpenOnBlur?: boolean;
|
|
11
|
-
/** Sets whether the
|
|
21
|
+
/** Sets whether the confirm and cancel action buttons are displayed in the bottom right of the field. */
|
|
12
22
|
hideActionButtons?: boolean;
|
|
13
23
|
/** Determines whether the input value can be confirmed as empty. */
|
|
14
24
|
isRequired?: boolean;
|
|
15
|
-
/** Determines whether the
|
|
25
|
+
/** Determines whether the `readView` has 100% width within its container, or whether it fits the content. */
|
|
16
26
|
readViewFitContainerWidth?: boolean;
|
|
17
|
-
/** Accessibility label for button which is used to enter
|
|
27
|
+
/** Accessibility label for button, which is used to enter `editView` from keyboard. */
|
|
18
28
|
editButtonLabel?: string;
|
|
19
|
-
/**
|
|
20
|
-
confirmButtonLabel?: string;
|
|
21
|
-
/** Accessibility label for the cancel action button. */
|
|
22
|
-
cancelButtonLabel?: string;
|
|
23
|
-
/** Handler called when checkmark is clicked. */
|
|
29
|
+
/** Exits `editView` and switches back to `readView`. This is called when the cancel action button (x) is clicked. */
|
|
24
30
|
onCancel?: () => void;
|
|
25
|
-
/**
|
|
26
|
-
|
|
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;
|
|
27
36
|
}
|
|
28
37
|
export interface ExtendedFieldProps<FieldValue> extends FieldProps<FieldValue> {
|
|
29
38
|
errorMessage?: string | undefined;
|
|
30
39
|
}
|
|
31
40
|
export interface InlineEditProps<FieldValue> extends CommonProps {
|
|
32
|
-
/**
|
|
33
|
-
readView: () => React.ReactNode;
|
|
34
|
-
/** Component to be shown when editing. */
|
|
41
|
+
/** The component shown when user is editing (when the inline edit is not in `readView`). */
|
|
35
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;
|
|
36
45
|
/**
|
|
37
|
-
|
|
38
|
-
* Field value is passed as an argument to this function.
|
|
46
|
+
Saves and confirms the value entered into the field. It exits `editView` and returns to `readView`.
|
|
39
47
|
*/
|
|
40
48
|
onConfirm: (value: any, analyticsEvent: UIAnalyticsEvent) => void;
|
|
41
|
-
/** Whether the component shows the readView or the editView. */
|
|
42
|
-
isEditing?: boolean;
|
|
43
|
-
/** The value shown in the editView when it is entered. Should be updated by onConfirm. */
|
|
44
|
-
defaultValue: any;
|
|
45
49
|
/** Handler called when readView is clicked. */
|
|
46
50
|
onEdit?: () => void;
|
|
47
|
-
/**
|
|
48
|
-
|
|
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;
|
|
49
53
|
}
|
|
50
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;
|
|
51
57
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
58
|
+
* Calls the `editView` handler. It confirms the changes.
|
|
59
|
+
* The field value is passed as an argument to this function.
|
|
54
60
|
*/
|
|
55
61
|
onConfirm: (value: string, analyticsEvent: UIAnalyticsEvent) => void;
|
|
56
|
-
/**
|
|
57
|
-
defaultValue: any;
|
|
58
|
-
/** Text shown in read view when value is an empty string. */
|
|
62
|
+
/** Text shown in `readView` when the field value is an empty string. */
|
|
59
63
|
placeholder: string;
|
|
60
|
-
/**
|
|
61
|
-
startWithEditViewOpen?: boolean;
|
|
62
|
-
/** Sets height to compact. */
|
|
63
|
-
isCompact?: boolean;
|
|
64
|
-
/** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
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
65
|
*/
|
|
66
66
|
testId?: string;
|
|
67
67
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-edit",
|
|
3
|
-
"version": "12.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "12.1.3",
|
|
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/"
|
|
7
7
|
},
|
|
@@ -14,24 +14,25 @@
|
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"atlaskit:src": "src/index.ts",
|
|
17
|
-
"
|
|
17
|
+
"homepage": "https://atlassian.design/components/inline-edit/",
|
|
18
18
|
"atlassian": {
|
|
19
19
|
"team": "Design System Team",
|
|
20
20
|
"inPublicMirror": true,
|
|
21
21
|
"releaseModel": "scheduled",
|
|
22
22
|
"website": {
|
|
23
|
-
"name": "Inline
|
|
23
|
+
"name": "Inline edit"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/analytics-next": "^8.
|
|
28
|
-
"@atlaskit/button": "^
|
|
29
|
-
"@atlaskit/codemod-utils": "^3.
|
|
30
|
-
"@atlaskit/form": "^8.
|
|
31
|
-
"@atlaskit/icon": "^21.
|
|
32
|
-
"@atlaskit/inline-dialog": "^13.
|
|
33
|
-
"@atlaskit/textfield": "^5.
|
|
34
|
-
"@atlaskit/theme": "^
|
|
27
|
+
"@atlaskit/analytics-next": "^8.2.0",
|
|
28
|
+
"@atlaskit/button": "^16.1.0",
|
|
29
|
+
"@atlaskit/codemod-utils": "^3.4.0",
|
|
30
|
+
"@atlaskit/form": "^8.4.0",
|
|
31
|
+
"@atlaskit/icon": "^21.9.0",
|
|
32
|
+
"@atlaskit/inline-dialog": "^13.1.0",
|
|
33
|
+
"@atlaskit/textfield": "^5.1.0",
|
|
34
|
+
"@atlaskit/theme": "^12.0.0",
|
|
35
|
+
"@atlaskit/tokens": "^0.3.0",
|
|
35
36
|
"@babel/runtime": "^7.0.0",
|
|
36
37
|
"@emotion/core": "^10.0.9"
|
|
37
38
|
},
|
|
@@ -41,12 +42,13 @@
|
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@atlaskit/build-utils": "*",
|
|
43
44
|
"@atlaskit/docs": "*",
|
|
44
|
-
"@atlaskit/inline-dialog": "^13.
|
|
45
|
-
"@atlaskit/
|
|
45
|
+
"@atlaskit/inline-dialog": "^13.1.0",
|
|
46
|
+
"@atlaskit/section-message": "^6.1.0",
|
|
47
|
+
"@atlaskit/select": "^15.0.0",
|
|
46
48
|
"@atlaskit/ssr": "*",
|
|
47
|
-
"@atlaskit/tag": "^11.
|
|
49
|
+
"@atlaskit/tag": "^11.2.0",
|
|
48
50
|
"@atlaskit/tag-group": "^10.0.0",
|
|
49
|
-
"@atlaskit/textarea": "^4.
|
|
51
|
+
"@atlaskit/textarea": "^4.2.0",
|
|
50
52
|
"@atlaskit/visual-regression": "*",
|
|
51
53
|
"@atlaskit/webdriver-runner": "*",
|
|
52
54
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -54,7 +56,7 @@
|
|
|
54
56
|
"@testing-library/dom": "^7.7.3",
|
|
55
57
|
"@testing-library/react": "^8.0.1",
|
|
56
58
|
"ast-types": "^0.13.3",
|
|
57
|
-
"jscodeshift": "^0.
|
|
59
|
+
"jscodeshift": "^0.13.0",
|
|
58
60
|
"react-dom": "^16.8.0",
|
|
59
61
|
"storybook-addon-performance": "^0.16.0",
|
|
60
62
|
"typescript": "3.9.6",
|
|
@@ -70,18 +72,10 @@
|
|
|
70
72
|
"import-structure": "atlassian-conventions"
|
|
71
73
|
},
|
|
72
74
|
"@repo/internal": {
|
|
73
|
-
"ui-components":
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
"analytics-next"
|
|
78
|
-
],
|
|
79
|
-
"theming": [
|
|
80
|
-
"new-theming-api"
|
|
81
|
-
],
|
|
82
|
-
"deprecation": [
|
|
83
|
-
"no-deprecated-imports"
|
|
84
|
-
]
|
|
75
|
+
"ui-components": "lite-mode",
|
|
76
|
+
"analytics": "analytics-next",
|
|
77
|
+
"theming": "tokens",
|
|
78
|
+
"deprecation": "no-deprecated-imports"
|
|
85
79
|
}
|
|
86
80
|
},
|
|
87
81
|
"af:exports": {
|