@atlaskit/table-tree 11.2.2 → 12.1.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 +30 -0
- package/dist/cjs/components/cell.js +1 -2
- package/dist/cjs/components/header.compiled.css +3 -0
- package/dist/cjs/components/header.js +14 -16
- package/dist/cjs/components/headers.compiled.css +2 -0
- package/dist/cjs/components/headers.js +21 -25
- package/dist/cjs/components/internal/common-cell.compiled.css +10 -0
- package/dist/cjs/components/internal/common-cell.js +18 -25
- package/dist/cjs/components/internal/item.js +6 -10
- package/dist/cjs/components/internal/loader-item.js +1 -1
- package/dist/cjs/components/internal/overflow-container.compiled.css +4 -0
- package/dist/cjs/components/internal/overflow-container.js +11 -15
- package/dist/cjs/components/internal/styled.compiled.css +8 -0
- package/dist/cjs/components/internal/styled.js +32 -43
- package/dist/cjs/components/row.compiled.css +1 -0
- package/dist/cjs/components/row.js +10 -17
- package/dist/cjs/utils/table-tree-data-helper.js +4 -49
- package/dist/es2019/components/cell.js +1 -2
- package/dist/es2019/components/header.compiled.css +3 -0
- package/dist/es2019/components/header.js +8 -15
- package/dist/es2019/components/headers.compiled.css +2 -0
- package/dist/es2019/components/headers.js +9 -17
- package/dist/es2019/components/internal/common-cell.compiled.css +10 -0
- package/dist/es2019/components/internal/common-cell.js +7 -23
- package/dist/es2019/components/internal/item.js +3 -10
- package/dist/es2019/components/internal/loader-item.js +2 -2
- package/dist/es2019/components/internal/overflow-container.compiled.css +4 -0
- package/dist/es2019/components/internal/overflow-container.js +8 -16
- package/dist/es2019/components/internal/styled.compiled.css +8 -0
- package/dist/es2019/components/internal/styled.js +19 -43
- package/dist/es2019/components/row.compiled.css +1 -0
- package/dist/es2019/components/row.js +10 -16
- package/dist/es2019/utils/table-tree-data-helper.js +2 -42
- package/dist/esm/components/cell.js +1 -2
- package/dist/esm/components/header.compiled.css +3 -0
- package/dist/esm/components/header.js +11 -15
- package/dist/esm/components/headers.compiled.css +2 -0
- package/dist/esm/components/headers.js +18 -24
- package/dist/esm/components/internal/common-cell.compiled.css +10 -0
- package/dist/esm/components/internal/common-cell.js +15 -26
- package/dist/esm/components/internal/item.js +3 -10
- package/dist/esm/components/internal/loader-item.js +2 -2
- package/dist/esm/components/internal/overflow-container.compiled.css +4 -0
- package/dist/esm/components/internal/overflow-container.js +8 -16
- package/dist/esm/components/internal/styled.compiled.css +8 -0
- package/dist/esm/components/internal/styled.js +28 -43
- package/dist/esm/components/row.compiled.css +1 -0
- package/dist/esm/components/row.js +10 -16
- package/dist/esm/utils/table-tree-data-helper.js +2 -47
- package/dist/types/components/headers.d.ts +1 -2
- package/dist/types/components/internal/common-cell.d.ts +1 -1
- package/dist/types/components/internal/item.d.ts +2 -6
- package/dist/types/components/internal/overflow-container.d.ts +1 -1
- package/dist/types/components/internal/styled.d.ts +1 -2
- package/dist/types/components/row.d.ts +1 -2
- package/dist/types/utils/table-tree-data-helper.d.ts +2 -4
- package/dist/types-ts4.5/components/headers.d.ts +1 -2
- package/dist/types-ts4.5/components/internal/common-cell.d.ts +1 -1
- package/dist/types-ts4.5/components/internal/item.d.ts +2 -6
- package/dist/types-ts4.5/components/internal/overflow-container.d.ts +1 -1
- package/dist/types-ts4.5/components/internal/styled.d.ts +1 -2
- package/dist/types-ts4.5/components/row.d.ts +1 -2
- package/dist/types-ts4.5/utils/table-tree-data-helper.d.ts +2 -4
- package/package.json +5 -6
|
@@ -4,56 +4,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.default = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
12
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
13
13
|
var _set = _interopRequireDefault(require("lodash/set"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
-
// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore?tab=readme-ov-file#_get
|
|
18
|
-
// https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13126
|
|
19
|
-
var internalGet = exports.internalGet = function internalGet(obj, path) {
|
|
20
|
-
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
21
|
-
var travel = function travel(regexp) {
|
|
22
|
-
return String.prototype.split.call(path, regexp).filter(Boolean).reduce(function (res, key) {
|
|
23
|
-
return res !== null && res !== undefined ? res[key] : res;
|
|
24
|
-
}, obj);
|
|
25
|
-
};
|
|
26
|
-
var result = travel(/[,[\]]+?/) || travel(/[,[\].]+?/);
|
|
27
|
-
return result === undefined || result === obj ? defaultValue : result;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// https://stackoverflow.com/a/54733755/14857724
|
|
31
|
-
// https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13673
|
|
32
|
-
var internalSet = exports.internalSet = function internalSet(obj, providedPath, value) {
|
|
33
|
-
// When obj is not an object, fail gracefully
|
|
34
|
-
if (Object(obj) !== obj) {
|
|
35
|
-
return obj;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// If not yet an array, get the keys from the string-path
|
|
39
|
-
var path = !Array.isArray(providedPath) ? providedPath.toString().match(/[^.[\]]+/g) || [] : providedPath;
|
|
40
|
-
|
|
41
|
-
// Iterate all of them except the last one
|
|
42
|
-
var result = path.slice(0, -1).reduce(function (acc, c, index) {
|
|
43
|
-
// Does the key exist and is its value an object?
|
|
44
|
-
return Object(acc[c]) === acc[c] ? acc[c] // Yes: then follow that path
|
|
45
|
-
:
|
|
46
|
-
// No: create the key. Is the next key a potential array-index?
|
|
47
|
-
acc[c] = Math.abs(parseInt(path[index + 1])) >> 0 === +path[index + 1] ? [] // Yes: assign a new array object
|
|
48
|
-
: {}; // No: assign a new plain object
|
|
49
|
-
}, obj);
|
|
50
|
-
|
|
51
|
-
// Finally assign the value to the last key
|
|
52
|
-
result[path[path.length - 1]] = value;
|
|
53
|
-
|
|
54
|
-
// Return the top-level object to allow chaining
|
|
55
|
-
return obj;
|
|
56
|
-
};
|
|
57
16
|
function updateRootItems(rootItems) {
|
|
58
17
|
var allItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
59
18
|
var _ref = arguments.length > 2 ? arguments[2] : undefined,
|
|
@@ -81,10 +40,6 @@ function updateChildItems(newitems, allTableItems, itemParent, _ref2) {
|
|
|
81
40
|
var key = _ref2.key,
|
|
82
41
|
keysCache = _ref2.keysCache,
|
|
83
42
|
operation = _ref2.operation;
|
|
84
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
85
|
-
var get = (0, _platformFeatureFlags.fg)('dst-a11y-remove-lodash-from-table-tree') ? internalGet : _get.default;
|
|
86
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
87
|
-
var set = (0, _platformFeatureFlags.fg)('dst-a11y-remove-lodash-from-table-tree') ? internalSet : _set.default;
|
|
88
43
|
var newKeysCache = _objectSpread({}, keysCache);
|
|
89
44
|
var parentCacheKey = itemParent[key];
|
|
90
45
|
if (parentCacheKey === undefined) {
|
|
@@ -92,8 +47,8 @@ function updateChildItems(newitems, allTableItems, itemParent, _ref2) {
|
|
|
92
47
|
}
|
|
93
48
|
var parentLocation = newKeysCache[parentCacheKey];
|
|
94
49
|
var allItemsCopy = (0, _toConsumableArray2.default)(allTableItems);
|
|
95
|
-
var objectToChange =
|
|
96
|
-
var baseChildrenOfObjectToChange = operation === 'UPDATE' ? [] :
|
|
50
|
+
var objectToChange = (0, _get.default)(allItemsCopy, parentLocation);
|
|
51
|
+
var baseChildrenOfObjectToChange = operation === 'UPDATE' ? [] : (0, _get.default)(objectToChange, 'children', []);
|
|
97
52
|
objectToChange.children = baseChildrenOfObjectToChange.concat(newitems);
|
|
98
53
|
|
|
99
54
|
// Update cache
|
|
@@ -102,7 +57,7 @@ function updateChildItems(newitems, allTableItems, itemParent, _ref2) {
|
|
|
102
57
|
});
|
|
103
58
|
return {
|
|
104
59
|
keysCache: newKeysCache,
|
|
105
|
-
items:
|
|
60
|
+
items: (0, _set.default)(allItemsCopy, parentLocation, objectToChange)
|
|
106
61
|
};
|
|
107
62
|
}
|
|
108
63
|
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import CommonCell from './internal/common-cell';
|
|
4
4
|
import OverflowContainer from './internal/overflow-container';
|
|
5
|
-
import { indentBase } from './internal/styled';
|
|
6
5
|
import withColumnWidth from './internal/with-column-width';
|
|
7
6
|
const CellComponent = ({
|
|
8
7
|
children,
|
|
@@ -12,7 +11,7 @@ const CellComponent = ({
|
|
|
12
11
|
className,
|
|
13
12
|
...props
|
|
14
13
|
}) => /*#__PURE__*/React.createElement(CommonCell, _extends({
|
|
15
|
-
indent: indentLevel ? `calc(${
|
|
14
|
+
indent: indentLevel ? `calc(${"var(--ds-space-300, 25px)"} * ${indentLevel})` : undefined,
|
|
16
15
|
width: width
|
|
17
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
18
17
|
,
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* header.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./header.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
5
|
import { N300 } from '@atlaskit/theme/colors';
|
|
9
6
|
import CommonCell from './internal/common-cell';
|
|
10
7
|
import withColumnWidth from './internal/with-column-width';
|
|
11
|
-
const headerStyles =
|
|
12
|
-
color: `var(--ds-text-subtle, ${N300})`,
|
|
13
|
-
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
14
|
-
fontWeight: "var(--ds-font-weight-bold, 700)"
|
|
15
|
-
});
|
|
8
|
+
const headerStyles = null;
|
|
16
9
|
|
|
17
10
|
/**
|
|
18
11
|
* This is hard-coded here because our actual <Header /> has no typings
|
|
@@ -32,12 +25,12 @@ const HeaderComponent = ({
|
|
|
32
25
|
}) => {
|
|
33
26
|
// TODO: Determine whether proper `th` elements can be used instead of
|
|
34
27
|
// roles (DSP-11588)
|
|
35
|
-
return
|
|
36
|
-
css: headerStyles,
|
|
28
|
+
return /*#__PURE__*/React.createElement(CommonCell, {
|
|
37
29
|
role: role,
|
|
38
30
|
width: width,
|
|
39
31
|
id: id,
|
|
40
|
-
onClick: onClick
|
|
32
|
+
onClick: onClick,
|
|
33
|
+
className: ax(["_11c8dcr7 _syaz1n3s _k48pmoej"])
|
|
41
34
|
}, children);
|
|
42
35
|
};
|
|
43
36
|
const Header = withColumnWidth(HeaderComponent);
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
/* eslint-disable @repo/internal/react/no-clone-element */
|
|
1
|
+
/* headers.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./headers.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import { Children, cloneElement } from 'react';
|
|
6
|
+
/* eslint-disable @repo/internal/react/no-clone-element */
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
|
-
const containerStyles = css({
|
|
11
|
-
display: 'flex',
|
|
12
|
-
borderBlockEnd: `solid 2px ${"var(--ds-border, #dfe1e6)"}`
|
|
13
|
-
});
|
|
8
|
+
const containerStyles = null;
|
|
14
9
|
/**
|
|
15
10
|
* __Headers__
|
|
16
11
|
*
|
|
@@ -21,12 +16,9 @@ const containerStyles = css({
|
|
|
21
16
|
*/
|
|
22
17
|
const Headers = ({
|
|
23
18
|
children
|
|
24
|
-
}) =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
jsx("div", {
|
|
28
|
-
css: containerStyles,
|
|
29
|
-
role: "row"
|
|
19
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
role: "row",
|
|
21
|
+
className: ax(["_179r17qy _1e0c1txw"])
|
|
30
22
|
}, Children.map(children, (header, index) => /*#__PURE__*/cloneElement(header, {
|
|
31
23
|
key: index,
|
|
32
24
|
columnIndex: index
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._1yt413wy{padding:var(--ds-space-100,10px) var(--ds-space-300,25px) var(--ds-space-100,10px) var(--indent,var(--ds-space-300,25px))}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._1nmz1hna{word-break:break-word}
|
|
5
|
+
._1tke1ylp{min-height:40px}
|
|
6
|
+
._4cvr1h6o{align-items:center}
|
|
7
|
+
._ct361wug{-ms-hyphens:auto;hyphens:auto}
|
|
8
|
+
._kqswh2mm{position:relative}
|
|
9
|
+
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
10
|
+
._vchhusvi{box-sizing:border-box}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
+
/* common-cell.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import "./common-cell.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
6
|
import { N800 } from '@atlaskit/theme/colors';
|
|
10
|
-
|
|
11
|
-
const commonStyles = css({
|
|
12
|
-
display: 'flex',
|
|
13
|
-
boxSizing: 'border-box',
|
|
14
|
-
minHeight: 40,
|
|
15
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
16
|
-
padding: `${"var(--ds-space-100, 10px)"} ${indentBase} ${"var(--ds-space-100, 10px)"} var(--indent, ${indentBase})`,
|
|
17
|
-
position: 'relative',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
color: `var(--ds-text, ${N800})`,
|
|
20
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
21
|
-
hyphens: 'auto',
|
|
22
|
-
wordBreak: 'break-word'
|
|
23
|
-
});
|
|
7
|
+
const commonStyles = null;
|
|
24
8
|
/**
|
|
25
9
|
* __Common cell__
|
|
26
10
|
*/
|
|
@@ -28,7 +12,7 @@ const CommonCell = ({
|
|
|
28
12
|
indent,
|
|
29
13
|
width,
|
|
30
14
|
...props
|
|
31
|
-
}) =>
|
|
15
|
+
}) => /*#__PURE__*/React.createElement("div", _extends({
|
|
32
16
|
role: "gridcell"
|
|
33
17
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
34
18
|
}, props, {
|
|
@@ -37,6 +21,6 @@ const CommonCell = ({
|
|
|
37
21
|
'--indent': indent,
|
|
38
22
|
width
|
|
39
23
|
},
|
|
40
|
-
|
|
24
|
+
className: ax(["_1yt413wy _11c82smr _1e0c1txw _vchhusvi _1tke1ylp _kqswh2mm _4cvr1h6o _syaz1fxt _ct361wug _1nmz1hna"])
|
|
41
25
|
}));
|
|
42
26
|
export default CommonCell;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
1
|
/* eslint-disable @repo/internal/react/no-clone-element */
|
|
6
|
-
import { cloneElement } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
2
|
+
import React, { cloneElement } from 'react';
|
|
10
3
|
import toItemId from '../../utils/to-item-id';
|
|
11
4
|
import Items from './items';
|
|
12
5
|
/**
|
|
@@ -31,9 +24,9 @@ function Item({
|
|
|
31
24
|
depth,
|
|
32
25
|
data,
|
|
33
26
|
loadingLabel,
|
|
34
|
-
renderChildren: () =>
|
|
27
|
+
renderChildren: () => /*#__PURE__*/React.createElement("div", {
|
|
35
28
|
id: !!itemId ? toItemId(itemId) : undefined
|
|
36
|
-
},
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Items, {
|
|
37
30
|
depth: depth,
|
|
38
31
|
items: items,
|
|
39
32
|
render: render,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import Spinner from '@atlaskit/spinner';
|
|
4
4
|
import CommonCell from './common-cell';
|
|
5
|
-
import {
|
|
5
|
+
import { LoaderItemContainer, TreeRowContainer } from './styled';
|
|
6
6
|
const LoaderItem = ({
|
|
7
7
|
depth = 1,
|
|
8
8
|
loadingLabel,
|
|
@@ -19,7 +19,7 @@ const LoaderItem = ({
|
|
|
19
19
|
}
|
|
20
20
|
}, [isCompleting, onComplete, phase]);
|
|
21
21
|
return phase === 'loading' ? /*#__PURE__*/React.createElement(TreeRowContainer, null, /*#__PURE__*/React.createElement(CommonCell, {
|
|
22
|
-
indent: `calc(${
|
|
22
|
+
indent: `calc(${"var(--ds-space-300, 25px)"} * ${depth})`,
|
|
23
23
|
width: "100%"
|
|
24
24
|
}, /*#__PURE__*/React.createElement(LoaderItemContainer, {
|
|
25
25
|
isRoot: depth === 1
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
+
/* overflow-container.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
9
|
-
const overflowContainerStyles = css({
|
|
10
|
-
overflow: 'hidden',
|
|
11
|
-
textOverflow: 'ellipsis',
|
|
12
|
-
whiteSpace: 'nowrap'
|
|
13
|
-
});
|
|
3
|
+
import "./overflow-container.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
const overflowContainerStyles = null;
|
|
14
7
|
|
|
15
8
|
/**
|
|
16
9
|
* __Overflow container__
|
|
@@ -18,8 +11,7 @@ const overflowContainerStyles = css({
|
|
|
18
11
|
const OverflowContainer = ({
|
|
19
12
|
isSingleLine,
|
|
20
13
|
...props
|
|
21
|
-
}) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, props));
|
|
14
|
+
}) => /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
15
|
+
className: ax([isSingleLine && "_1reo15vq _18m915vq _1bto1l2s _o5721q9c"])
|
|
16
|
+
}));
|
|
25
17
|
export default OverflowContainer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
._179r1l7n{border-block-end:1px solid var(--ds-border,#ebecf0)}
|
|
2
|
+
._1bsb1osq{width:100%}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._1pfhj39m{margin-block-start:-3px}
|
|
5
|
+
._4cvr1h6o{align-items:center}
|
|
6
|
+
._ahbqf2s7{margin-inline-start:calc(var(--ds-space-300, 25px)*-1)}
|
|
7
|
+
._bozg1ssb{padding-inline-start:50%}
|
|
8
|
+
._kqswstnw{position:absolute}
|
|
@@ -1,54 +1,31 @@
|
|
|
1
|
+
/* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import "./styled.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
6
|
import { N30 } from '@atlaskit/theme/colors';
|
|
10
|
-
|
|
11
|
-
const treeRowContainerStyles = css({
|
|
12
|
-
display: 'flex',
|
|
13
|
-
borderBlockEnd: `1px solid ${`var(--ds-border, ${N30})`}`
|
|
14
|
-
});
|
|
7
|
+
const treeRowContainerStyles = null;
|
|
15
8
|
|
|
16
9
|
/**
|
|
17
10
|
* __Tree row container__
|
|
18
11
|
*/
|
|
19
|
-
export const TreeRowContainer = props =>
|
|
20
|
-
role: "row"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const commonCellElementStyles =
|
|
25
|
-
|
|
26
|
-
position: 'absolute',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
// indentBase is re-used elsewhere and is primarily used as positive value; we need to negate it here
|
|
29
|
-
marginInlineStart: `calc(${indentBase} * -1)`
|
|
30
|
-
});
|
|
31
|
-
const commonChevronContainerStyles = css({
|
|
32
|
-
// Aligns position:absolute chevron button with the adjacent text. Any future visual breaking changes
|
|
33
|
-
// should consider setting this to `-2px` for better alignment, or refactor completely
|
|
34
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
35
|
-
marginBlockStart: -3
|
|
36
|
-
});
|
|
12
|
+
export const TreeRowContainer = props => /*#__PURE__*/React.createElement("div", _extends({
|
|
13
|
+
role: "row"
|
|
14
|
+
}, props, {
|
|
15
|
+
className: ax(["_179r1l7n _1e0c1txw"])
|
|
16
|
+
}));
|
|
17
|
+
const commonCellElementStyles = null;
|
|
18
|
+
const commonChevronContainerStyles = null;
|
|
37
19
|
/**
|
|
38
20
|
* __Chevron container__
|
|
39
21
|
*
|
|
40
22
|
* A wrapper container around the expand table tree button.
|
|
41
23
|
*/
|
|
42
|
-
export const ChevronContainer = props =>
|
|
43
|
-
|
|
24
|
+
export const ChevronContainer = props => /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
25
|
+
className: ax(["_1e0c1txw _kqswstnw _4cvr1h6o _ahbqf2s7", "_1pfhj39m"])
|
|
44
26
|
}));
|
|
45
|
-
const loadingItemContainerStyles =
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
const paddingLeftStyles = css({
|
|
49
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
50
|
-
paddingInlineStart: '50%'
|
|
51
|
-
});
|
|
27
|
+
const loadingItemContainerStyles = null;
|
|
28
|
+
const paddingLeftStyles = null;
|
|
52
29
|
/**
|
|
53
30
|
* __Loader item container__
|
|
54
31
|
*
|
|
@@ -57,7 +34,6 @@ const paddingLeftStyles = css({
|
|
|
57
34
|
export const LoaderItemContainer = ({
|
|
58
35
|
isRoot,
|
|
59
36
|
...props
|
|
60
|
-
}) =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, props));
|
|
37
|
+
}) => /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
38
|
+
className: ax(["_1e0c1txw _kqswstnw _4cvr1h6o _ahbqf2s7", "_1bsb1osq", isRoot && "_bozg1ssb"])
|
|
39
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._80omtlke{cursor:pointer}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
1
|
+
/* row.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./row.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
import React, { Fragment, useEffect, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
9
5
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
10
6
|
import toItemId from '../utils/to-item-id';
|
|
11
7
|
import Chevron from './internal/chevron';
|
|
12
8
|
import { TreeRowContainer } from './internal/styled';
|
|
13
|
-
const treeRowClickableStyles =
|
|
14
|
-
cursor: 'pointer'
|
|
15
|
-
});
|
|
9
|
+
const treeRowClickableStyles = null;
|
|
16
10
|
const getExtendedLabel = (cellContent, cellIndex, mainColumnForExpandCollapseLabel) => {
|
|
17
11
|
/**
|
|
18
12
|
* First condition - when we pass data via `items` property in `<TableTree />`
|
|
@@ -53,7 +47,7 @@ function Row({
|
|
|
53
47
|
actionSubject: 'tableTree',
|
|
54
48
|
componentName: 'row',
|
|
55
49
|
packageName: "@atlaskit/table-tree",
|
|
56
|
-
packageVersion: "
|
|
50
|
+
packageVersion: "12.1.0"
|
|
57
51
|
});
|
|
58
52
|
const onCollapse = usePlatformLeafEventHandler({
|
|
59
53
|
fn: value => providedOnCollapse && providedOnCollapse(value),
|
|
@@ -61,7 +55,7 @@ function Row({
|
|
|
61
55
|
actionSubject: 'tableTree',
|
|
62
56
|
componentName: 'row',
|
|
63
57
|
packageName: "@atlaskit/table-tree",
|
|
64
|
-
packageVersion: "
|
|
58
|
+
packageVersion: "12.1.0"
|
|
65
59
|
});
|
|
66
60
|
|
|
67
61
|
/**
|
|
@@ -100,7 +94,7 @@ function Row({
|
|
|
100
94
|
let cellContent = cell.props.children || [];
|
|
101
95
|
const extendedLabel = getExtendedLabel(cellContent, cellIndex, mainColumnForExpandCollapseLabel);
|
|
102
96
|
if (isFirstCell && hasChildren) {
|
|
103
|
-
cellContent = [
|
|
97
|
+
cellContent = [/*#__PURE__*/React.createElement(Chevron, {
|
|
104
98
|
key: "chevron",
|
|
105
99
|
expandLabel: expandLabel,
|
|
106
100
|
collapseLabel: collapseLabel,
|
|
@@ -118,11 +112,11 @@ function Row({
|
|
|
118
112
|
indentLevel
|
|
119
113
|
}, cellContent);
|
|
120
114
|
};
|
|
121
|
-
return
|
|
122
|
-
css: hasChildren && shouldExpandOnClick ? treeRowClickableStyles : undefined,
|
|
115
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(TreeRowContainer, {
|
|
123
116
|
onClick: hasChildren && shouldExpandOnClick ? onClickHandler : undefined,
|
|
124
117
|
"aria-expanded": hasChildren ? isExpandedState : undefined,
|
|
125
|
-
"aria-level": depth ? depth : undefined
|
|
118
|
+
"aria-level": depth ? depth : undefined,
|
|
119
|
+
className: ax([hasChildren && shouldExpandOnClick && "_80omtlke"])
|
|
126
120
|
}, React.Children.map(children, (cell, index) => renderCell(cell, index))), hasChildren && (isProvidedExpanded !== undefined ? isProvidedExpanded : isExpandedState) && renderChildren && renderChildren());
|
|
127
121
|
}
|
|
128
122
|
|
|
@@ -1,41 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore?tab=readme-ov-file#_get
|
|
5
|
-
// https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13126
|
|
6
|
-
export const internalGet = (obj, path, defaultValue = undefined) => {
|
|
7
|
-
const travel = regexp => String.prototype.split.call(path, regexp).filter(Boolean).reduce((res, key) => res !== null && res !== undefined ? res[key] : res, obj);
|
|
8
|
-
const result = travel(/[,[\]]+?/) || travel(/[,[\].]+?/);
|
|
9
|
-
return result === undefined || result === obj ? defaultValue : result;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// https://stackoverflow.com/a/54733755/14857724
|
|
13
|
-
// https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13673
|
|
14
|
-
export const internalSet = (obj, providedPath, value) => {
|
|
15
|
-
// When obj is not an object, fail gracefully
|
|
16
|
-
if (Object(obj) !== obj) {
|
|
17
|
-
return obj;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// If not yet an array, get the keys from the string-path
|
|
21
|
-
const path = !Array.isArray(providedPath) ? providedPath.toString().match(/[^.[\]]+/g) || [] : providedPath;
|
|
22
|
-
|
|
23
|
-
// Iterate all of them except the last one
|
|
24
|
-
const result = path.slice(0, -1).reduce((acc, c, index) => {
|
|
25
|
-
// Does the key exist and is its value an object?
|
|
26
|
-
return Object(acc[c]) === acc[c] ? acc[c] // Yes: then follow that path
|
|
27
|
-
:
|
|
28
|
-
// No: create the key. Is the next key a potential array-index?
|
|
29
|
-
acc[c] = Math.abs(parseInt(path[index + 1])) >> 0 === +path[index + 1] ? [] // Yes: assign a new array object
|
|
30
|
-
: {}; // No: assign a new plain object
|
|
31
|
-
}, obj);
|
|
32
|
-
|
|
33
|
-
// Finally assign the value to the last key
|
|
34
|
-
result[path[path.length - 1]] = value;
|
|
35
|
-
|
|
36
|
-
// Return the top-level object to allow chaining
|
|
37
|
-
return obj;
|
|
38
|
-
};
|
|
1
|
+
import get from 'lodash/get';
|
|
2
|
+
import set from 'lodash/set';
|
|
39
3
|
function updateRootItems(rootItems, allItems = [], {
|
|
40
4
|
key,
|
|
41
5
|
keysCache,
|
|
@@ -65,10 +29,6 @@ function updateChildItems(newitems, allTableItems, itemParent, {
|
|
|
65
29
|
keysCache,
|
|
66
30
|
operation
|
|
67
31
|
}) {
|
|
68
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
69
|
-
const get = fg('dst-a11y-remove-lodash-from-table-tree') ? internalGet : lodashGet;
|
|
70
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
71
|
-
const set = fg('dst-a11y-remove-lodash-from-table-tree') ? internalSet : lodashSet;
|
|
72
32
|
const newKeysCache = {
|
|
73
33
|
...keysCache
|
|
74
34
|
};
|
|
@@ -4,7 +4,6 @@ var _excluded = ["children", "singleLine", "indentLevel", "width", "className"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import CommonCell from './internal/common-cell';
|
|
6
6
|
import OverflowContainer from './internal/overflow-container';
|
|
7
|
-
import { indentBase } from './internal/styled';
|
|
8
7
|
import withColumnWidth from './internal/with-column-width';
|
|
9
8
|
var CellComponent = function CellComponent(_ref) {
|
|
10
9
|
var children = _ref.children,
|
|
@@ -14,7 +13,7 @@ var CellComponent = function CellComponent(_ref) {
|
|
|
14
13
|
className = _ref.className,
|
|
15
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
15
|
return /*#__PURE__*/React.createElement(CommonCell, _extends({
|
|
17
|
-
indent: indentLevel ? "calc(".concat(
|
|
16
|
+
indent: indentLevel ? "calc(".concat("var(--ds-space-300, 25px)", " * ", indentLevel, ")") : undefined,
|
|
18
17
|
width: width
|
|
19
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
20
19
|
,
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* header.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./header.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
5
|
import { N300 } from '@atlaskit/theme/colors';
|
|
9
6
|
import CommonCell from './internal/common-cell';
|
|
10
7
|
import withColumnWidth from './internal/with-column-width';
|
|
11
|
-
var headerStyles =
|
|
12
|
-
color: "var(--ds-text-subtle, ".concat(N300, ")"),
|
|
13
|
-
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
14
|
-
fontWeight: "var(--ds-font-weight-bold, 700)"
|
|
15
|
-
});
|
|
8
|
+
var headerStyles = null;
|
|
16
9
|
|
|
17
10
|
/**
|
|
18
11
|
* This is hard-coded here because our actual <Header /> has no typings
|
|
@@ -32,12 +25,15 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
32
25
|
role = _ref$role === void 0 ? 'columnheader' : _ref$role;
|
|
33
26
|
// TODO: Determine whether proper `th` elements can be used instead of
|
|
34
27
|
// roles (DSP-11588)
|
|
35
|
-
return
|
|
36
|
-
css: headerStyles,
|
|
28
|
+
return /*#__PURE__*/React.createElement(CommonCell, {
|
|
37
29
|
role: role,
|
|
38
30
|
width: width,
|
|
39
31
|
id: id,
|
|
40
|
-
onClick: onClick
|
|
32
|
+
onClick: onClick,
|
|
33
|
+
className: ax(["_11c8dcr7 _syaz1vvm _k48pmoej"]),
|
|
34
|
+
style: {
|
|
35
|
+
"--_bbz764": ix("var(--ds-text-subtle, ".concat(N300, ")"))
|
|
36
|
+
}
|
|
41
37
|
}, children);
|
|
42
38
|
};
|
|
43
39
|
var Header = withColumnWidth(HeaderComponent);
|