@atlaskit/table-tree 12.1.4 → 12.2.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.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/components/internal/chevron.js +10 -3
- package/dist/cjs/components/row.js +5 -4
- package/dist/es2019/components/internal/chevron.js +8 -3
- package/dist/es2019/components/row.js +5 -4
- package/dist/esm/components/internal/chevron.js +10 -3
- package/dist/esm/components/row.js +5 -4
- package/dist/types/components/internal/chevron.d.ts +1 -1
- package/dist/types-ts4.5/components/internal/chevron.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/table-tree
|
|
2
2
|
|
|
3
|
+
## 12.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#170155](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/170155)
|
|
8
|
+
[`62b6d1a1ed9f5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/62b6d1a1ed9f5) -
|
|
9
|
+
Fix expand by chevron when shouldExpandOnClick enabled.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 12.1.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _new = require("@atlaskit/button/new");
|
|
10
11
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
|
-
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/
|
|
12
|
-
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/
|
|
12
|
+
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
|
|
13
|
+
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-right"));
|
|
13
14
|
var _styled = require("./styled");
|
|
14
15
|
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
15
16
|
|
|
@@ -34,7 +35,13 @@ var Chevron = function Chevron(_ref) {
|
|
|
34
35
|
appearance: "subtle",
|
|
35
36
|
onClick: onExpandToggle,
|
|
36
37
|
spacing: "compact",
|
|
37
|
-
icon:
|
|
38
|
+
icon: function icon(iconProps) {
|
|
39
|
+
return isExpanded ? /*#__PURE__*/_react.default.createElement(_chevronDown.default, (0, _extends2.default)({}, iconProps, {
|
|
40
|
+
size: "small"
|
|
41
|
+
})) : /*#__PURE__*/_react.default.createElement(_chevronRight.default, (0, _extends2.default)({}, iconProps, {
|
|
42
|
+
size: "small"
|
|
43
|
+
}));
|
|
44
|
+
},
|
|
38
45
|
"aria-controls": isExpanded ? ariaControls : undefined,
|
|
39
46
|
label: isExpanded ? getLabel(collapseLabel) : getLabel(expandLabel)
|
|
40
47
|
}));
|
|
@@ -61,7 +61,7 @@ function Row(_ref) {
|
|
|
61
61
|
actionSubject: 'tableTree',
|
|
62
62
|
componentName: 'row',
|
|
63
63
|
packageName: "@atlaskit/table-tree",
|
|
64
|
-
packageVersion: "12.
|
|
64
|
+
packageVersion: "12.2.0"
|
|
65
65
|
});
|
|
66
66
|
var onCollapse = (0, _analyticsNext.usePlatformLeafEventHandler)({
|
|
67
67
|
fn: function fn(value) {
|
|
@@ -71,7 +71,7 @@ function Row(_ref) {
|
|
|
71
71
|
actionSubject: 'tableTree',
|
|
72
72
|
componentName: 'row',
|
|
73
73
|
packageName: "@atlaskit/table-tree",
|
|
74
|
-
packageVersion: "12.
|
|
74
|
+
packageVersion: "12.2.0"
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
/**
|
|
@@ -82,7 +82,7 @@ function Row(_ref) {
|
|
|
82
82
|
var _window$getSelection;
|
|
83
83
|
var selection = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.toString()) || '';
|
|
84
84
|
if ((selection === null || selection === void 0 ? void 0 : selection.length) === 0) {
|
|
85
|
-
onExpandToggle();
|
|
85
|
+
onExpandToggle(e);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
var onExpandStateChange = function onExpandStateChange(isExpanded) {
|
|
@@ -94,7 +94,8 @@ function Row(_ref) {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
var onExpandToggle = function onExpandToggle() {
|
|
97
|
+
var onExpandToggle = function onExpandToggle(e) {
|
|
98
|
+
e.stopPropagation();
|
|
98
99
|
if (isProvidedExpanded !== undefined) {
|
|
99
100
|
onExpandStateChange(!isProvidedExpanded);
|
|
100
101
|
} else {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { IconButton } from '@atlaskit/button/new';
|
|
4
5
|
import __noop from '@atlaskit/ds-lib/noop';
|
|
5
|
-
import ChevronDownIcon from '@atlaskit/icon/
|
|
6
|
-
import ChevronRightIcon from '@atlaskit/icon/
|
|
6
|
+
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
7
|
+
import ChevronRightIcon from '@atlaskit/icon/core/migration/chevron-right';
|
|
7
8
|
import { ChevronContainer } from './styled';
|
|
8
9
|
/**
|
|
9
10
|
* Internal chevron component.
|
|
@@ -22,7 +23,11 @@ const Chevron = ({
|
|
|
22
23
|
appearance: "subtle",
|
|
23
24
|
onClick: onExpandToggle,
|
|
24
25
|
spacing: "compact",
|
|
25
|
-
icon: isExpanded ? ChevronDownIcon
|
|
26
|
+
icon: iconProps => isExpanded ? /*#__PURE__*/React.createElement(ChevronDownIcon, _extends({}, iconProps, {
|
|
27
|
+
size: "small"
|
|
28
|
+
})) : /*#__PURE__*/React.createElement(ChevronRightIcon, _extends({}, iconProps, {
|
|
29
|
+
size: "small"
|
|
30
|
+
})),
|
|
26
31
|
"aria-controls": isExpanded ? ariaControls : undefined,
|
|
27
32
|
label: isExpanded ? getLabel(collapseLabel) : getLabel(expandLabel)
|
|
28
33
|
}));
|
|
@@ -47,7 +47,7 @@ function Row({
|
|
|
47
47
|
actionSubject: 'tableTree',
|
|
48
48
|
componentName: 'row',
|
|
49
49
|
packageName: "@atlaskit/table-tree",
|
|
50
|
-
packageVersion: "12.
|
|
50
|
+
packageVersion: "12.2.0"
|
|
51
51
|
});
|
|
52
52
|
const onCollapse = usePlatformLeafEventHandler({
|
|
53
53
|
fn: value => providedOnCollapse && providedOnCollapse(value),
|
|
@@ -55,7 +55,7 @@ function Row({
|
|
|
55
55
|
actionSubject: 'tableTree',
|
|
56
56
|
componentName: 'row',
|
|
57
57
|
packageName: "@atlaskit/table-tree",
|
|
58
|
-
packageVersion: "12.
|
|
58
|
+
packageVersion: "12.2.0"
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -66,7 +66,7 @@ function Row({
|
|
|
66
66
|
var _window$getSelection;
|
|
67
67
|
const selection = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.toString()) || '';
|
|
68
68
|
if ((selection === null || selection === void 0 ? void 0 : selection.length) === 0) {
|
|
69
|
-
onExpandToggle();
|
|
69
|
+
onExpandToggle(e);
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
const onExpandStateChange = isExpanded => {
|
|
@@ -78,7 +78,8 @@ function Row({
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
const onExpandToggle =
|
|
81
|
+
const onExpandToggle = e => {
|
|
82
|
+
e.stopPropagation();
|
|
82
83
|
if (isProvidedExpanded !== undefined) {
|
|
83
84
|
onExpandStateChange(!isProvidedExpanded);
|
|
84
85
|
} else {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { IconButton } from '@atlaskit/button/new';
|
|
4
5
|
import __noop from '@atlaskit/ds-lib/noop';
|
|
5
|
-
import ChevronDownIcon from '@atlaskit/icon/
|
|
6
|
-
import ChevronRightIcon from '@atlaskit/icon/
|
|
6
|
+
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
7
|
+
import ChevronRightIcon from '@atlaskit/icon/core/migration/chevron-right';
|
|
7
8
|
import { ChevronContainer } from './styled';
|
|
8
9
|
/**
|
|
9
10
|
* Internal chevron component.
|
|
@@ -26,7 +27,13 @@ var Chevron = function Chevron(_ref) {
|
|
|
26
27
|
appearance: "subtle",
|
|
27
28
|
onClick: onExpandToggle,
|
|
28
29
|
spacing: "compact",
|
|
29
|
-
icon:
|
|
30
|
+
icon: function icon(iconProps) {
|
|
31
|
+
return isExpanded ? /*#__PURE__*/React.createElement(ChevronDownIcon, _extends({}, iconProps, {
|
|
32
|
+
size: "small"
|
|
33
|
+
})) : /*#__PURE__*/React.createElement(ChevronRightIcon, _extends({}, iconProps, {
|
|
34
|
+
size: "small"
|
|
35
|
+
}));
|
|
36
|
+
},
|
|
30
37
|
"aria-controls": isExpanded ? ariaControls : undefined,
|
|
31
38
|
label: isExpanded ? getLabel(collapseLabel) : getLabel(expandLabel)
|
|
32
39
|
}));
|
|
@@ -52,7 +52,7 @@ function Row(_ref) {
|
|
|
52
52
|
actionSubject: 'tableTree',
|
|
53
53
|
componentName: 'row',
|
|
54
54
|
packageName: "@atlaskit/table-tree",
|
|
55
|
-
packageVersion: "12.
|
|
55
|
+
packageVersion: "12.2.0"
|
|
56
56
|
});
|
|
57
57
|
var onCollapse = usePlatformLeafEventHandler({
|
|
58
58
|
fn: function fn(value) {
|
|
@@ -62,7 +62,7 @@ function Row(_ref) {
|
|
|
62
62
|
actionSubject: 'tableTree',
|
|
63
63
|
componentName: 'row',
|
|
64
64
|
packageName: "@atlaskit/table-tree",
|
|
65
|
-
packageVersion: "12.
|
|
65
|
+
packageVersion: "12.2.0"
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
/**
|
|
@@ -73,7 +73,7 @@ function Row(_ref) {
|
|
|
73
73
|
var _window$getSelection;
|
|
74
74
|
var selection = ((_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.toString()) || '';
|
|
75
75
|
if ((selection === null || selection === void 0 ? void 0 : selection.length) === 0) {
|
|
76
|
-
onExpandToggle();
|
|
76
|
+
onExpandToggle(e);
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
var onExpandStateChange = function onExpandStateChange(isExpanded) {
|
|
@@ -85,7 +85,8 @@ function Row(_ref) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
var onExpandToggle = function onExpandToggle() {
|
|
88
|
+
var onExpandToggle = function onExpandToggle(e) {
|
|
89
|
+
e.stopPropagation();
|
|
89
90
|
if (isProvidedExpanded !== undefined) {
|
|
90
91
|
onExpandStateChange(!isProvidedExpanded);
|
|
91
92
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/table-tree",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.2.0",
|
|
4
4
|
"description": "A table tree is an expandable table for showing nested hierarchies of information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/icon": "^26.4.0",
|
|
32
32
|
"@atlaskit/spinner": "^18.0.0",
|
|
33
33
|
"@atlaskit/theme": "^18.0.0",
|
|
34
|
-
"@atlaskit/tokens": "^5.
|
|
34
|
+
"@atlaskit/tokens": "^5.2.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
36
|
"@compiled/react": "^0.18.3",
|
|
37
37
|
"lodash": "^4.17.21"
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@af/accessibility-testing": "workspace:^",
|
|
44
44
|
"@af/integration-testing": "workspace:^",
|
|
45
45
|
"@af/visual-regression": "workspace:^",
|
|
46
|
-
"@atlaskit/docs": "^
|
|
46
|
+
"@atlaskit/docs": "^11.0.0",
|
|
47
47
|
"@atlaskit/empty-state": "^10.0.0",
|
|
48
48
|
"@atlaskit/form": "^12.0.0",
|
|
49
49
|
"@atlaskit/link": "^3.2.0",
|
|
50
50
|
"@atlaskit/primitives": "^14.8.0",
|
|
51
51
|
"@atlaskit/section-message": "^8.2.0",
|
|
52
|
-
"@atlaskit/select": "^20.
|
|
52
|
+
"@atlaskit/select": "^20.7.0",
|
|
53
53
|
"@atlaskit/ssr": "workspace:^",
|
|
54
54
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
55
55
|
"@atlassian/ssr-tests": "^0.2.0",
|