@atlaskit/table-tree 9.6.5 → 9.6.7

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/table-tree
2
2
 
3
+ ## 9.6.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 9.6.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42271](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42271) [`a2f554b0828`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a2f554b0828) - Remove circular dependency and use type imports
14
+
3
15
  ## 9.6.5
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TableTreeContext = void 0;
7
+ var _react = require("react");
8
+ /**
9
+ *
10
+ * Context provider which maintains the column widths and access methods for use in descendent table cells
11
+ * Enables composed table-tree implementations to e.g. set width on header cells only
12
+ */
13
+ var TableTreeContext = exports.TableTreeContext = /*#__PURE__*/(0, _react.createContext)({
14
+ setColumnWidth: function setColumnWidth() {},
15
+ getColumnWidth: function getColumnWidth() {
16
+ return null;
17
+ }
18
+ });
@@ -9,13 +9,13 @@ exports.default = withColumnWidth;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
- var _tableTree = require("../table-tree");
12
+ var _context = require("./context");
13
13
  var _excluded = ["width", "columnIndex"];
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
16
  function withColumnWidth(Cell) {
17
17
  return function (props) {
18
- var _useContext = (0, _react.useContext)(_tableTree.TableTreeContext),
18
+ var _useContext = (0, _react.useContext)(_context.TableTreeContext),
19
19
  setColumnWidth = _useContext.setColumnWidth,
20
20
  getColumnWidth = _useContext.getColumnWidth;
21
21
  var width = props.width,
@@ -28,7 +28,7 @@ var treeRowClickableStyles = (0, _react2.css)({
28
28
  cursor: 'pointer'
29
29
  });
30
30
  var packageName = "@atlaskit/table-tree";
31
- var packageVersion = "9.6.5";
31
+ var packageVersion = "9.6.7";
32
32
  var Row = exports.RowWithoutAnalytics = /*#__PURE__*/function (_Component) {
33
33
  (0, _inherits2.default)(Row, _Component);
34
34
  var _super = _createSuper(Row);
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.TableTreeContext = void 0;
8
+ exports.default = void 0;
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
11
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
@@ -17,23 +17,13 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var _cell = _interopRequireDefault(require("./cell"));
18
18
  var _header = _interopRequireDefault(require("./header"));
19
19
  var _headers = _interopRequireDefault(require("./headers"));
20
+ var _context = require("./internal/context");
20
21
  var _row = _interopRequireDefault(require("./row"));
21
22
  var _rows = _interopRequireDefault(require("./rows"));
22
23
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
25
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
26
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable react/prop-types */
26
- /**
27
- *
28
- * Context provider which maintains the column widths and access methods for use in descendent table cells
29
- * Enables composed table-tree implementations to e.g. set width on header cells only
30
- */
31
- var TableTreeContext = exports.TableTreeContext = /*#__PURE__*/(0, _react.createContext)({
32
- setColumnWidth: function setColumnWidth() {},
33
- getColumnWidth: function getColumnWidth() {
34
- return null;
35
- }
36
- });
37
27
  var TableTree = exports.default = /*#__PURE__*/function (_Component) {
38
28
  (0, _inherits2.default)(TableTree, _Component);
39
29
  var _super = _createSuper(TableTree);
@@ -121,7 +111,7 @@ var TableTree = exports.default = /*#__PURE__*/function (_Component) {
121
111
  }
122
112
  });
123
113
  }
124
- return /*#__PURE__*/_react.default.createElement(TableTreeContext.Provider, {
114
+ return /*#__PURE__*/_react.default.createElement(_context.TableTreeContext.Provider, {
125
115
  value: {
126
116
  setColumnWidth: this.setColumnWidth,
127
117
  getColumnWidth: this.getColumnWidth
@@ -0,0 +1,10 @@
1
+ import { createContext } from 'react';
2
+ /**
3
+ *
4
+ * Context provider which maintains the column widths and access methods for use in descendent table cells
5
+ * Enables composed table-tree implementations to e.g. set width on header cells only
6
+ */
7
+ export const TableTreeContext = /*#__PURE__*/createContext({
8
+ setColumnWidth: () => {},
9
+ getColumnWidth: () => null
10
+ });
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useContext, useEffect } from 'react';
3
- import { TableTreeContext } from '../table-tree';
3
+ import { TableTreeContext } from './context';
4
4
  export default function withColumnWidth(Cell) {
5
5
  return props => {
6
6
  const {
@@ -12,7 +12,7 @@ const treeRowClickableStyles = css({
12
12
  cursor: 'pointer'
13
13
  });
14
14
  const packageName = "@atlaskit/table-tree";
15
- const packageVersion = "9.6.5";
15
+ const packageVersion = "9.6.7";
16
16
  class Row extends Component {
17
17
  constructor(...args) {
18
18
  super(...args);
@@ -1,20 +1,12 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /* eslint-disable react/prop-types */
3
- import React, { Component, createContext } from 'react';
3
+ import React, { Component } from 'react';
4
4
  import Cell from './cell';
5
5
  import Header from './header';
6
6
  import Headers from './headers';
7
+ import { TableTreeContext } from './internal/context';
7
8
  import Row from './row';
8
9
  import Rows from './rows';
9
- /**
10
- *
11
- * Context provider which maintains the column widths and access methods for use in descendent table cells
12
- * Enables composed table-tree implementations to e.g. set width on header cells only
13
- */
14
- export const TableTreeContext = /*#__PURE__*/createContext({
15
- setColumnWidth: () => {},
16
- getColumnWidth: () => null
17
- });
18
10
  export default class TableTree extends Component {
19
11
  constructor(...args) {
20
12
  super(...args);
@@ -0,0 +1,12 @@
1
+ import { createContext } from 'react';
2
+ /**
3
+ *
4
+ * Context provider which maintains the column widths and access methods for use in descendent table cells
5
+ * Enables composed table-tree implementations to e.g. set width on header cells only
6
+ */
7
+ export var TableTreeContext = /*#__PURE__*/createContext({
8
+ setColumnWidth: function setColumnWidth() {},
9
+ getColumnWidth: function getColumnWidth() {
10
+ return null;
11
+ }
12
+ });
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["width", "columnIndex"];
4
4
  import React, { useContext, useEffect } from 'react';
5
- import { TableTreeContext } from '../table-tree';
5
+ import { TableTreeContext } from './context';
6
6
  export default function withColumnWidth(Cell) {
7
7
  return function (props) {
8
8
  var _useContext = useContext(TableTreeContext),
@@ -20,7 +20,7 @@ var treeRowClickableStyles = css({
20
20
  cursor: 'pointer'
21
21
  });
22
22
  var packageName = "@atlaskit/table-tree";
23
- var packageVersion = "9.6.5";
23
+ var packageVersion = "9.6.7";
24
24
  var Row = /*#__PURE__*/function (_Component) {
25
25
  _inherits(Row, _Component);
26
26
  var _super = _createSuper(Row);
@@ -8,23 +8,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
9
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
10
  /* eslint-disable react/prop-types */
11
- import React, { Component, createContext } from 'react';
11
+ import React, { Component } from 'react';
12
12
  import Cell from './cell';
13
13
  import Header from './header';
14
14
  import Headers from './headers';
15
+ import { TableTreeContext } from './internal/context';
15
16
  import Row from './row';
16
17
  import Rows from './rows';
17
- /**
18
- *
19
- * Context provider which maintains the column widths and access methods for use in descendent table cells
20
- * Enables composed table-tree implementations to e.g. set width on header cells only
21
- */
22
- export var TableTreeContext = /*#__PURE__*/createContext({
23
- setColumnWidth: function setColumnWidth() {},
24
- getColumnWidth: function getColumnWidth() {
25
- return null;
26
- }
27
- });
28
18
  var TableTree = /*#__PURE__*/function (_Component) {
29
19
  _inherits(TableTree, _Component);
30
20
  var _super = _createSuper(TableTree);
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import type { FC, HTMLAttributes, ReactNode } from 'react';
3
3
  interface CommonCellProps {
4
4
  indent?: string;
5
5
  width?: string | number;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export type ColumnWidth = string | number;
3
+ /**
4
+ *
5
+ * Context provider which maintains the column widths and access methods for use in descendent table cells
6
+ * Enables composed table-tree implementations to e.g. set width on header cells only
7
+ */
8
+ export declare const TableTreeContext: import("react").Context<{
9
+ setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
10
+ getColumnWidth: (columnIndex: number) => ColumnWidth | null;
11
+ }>;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import type { FC, HTMLAttributes, ReactNode } from 'react';
3
3
  interface OverflowContainerProps {
4
4
  isSingleLine?: boolean;
5
5
  chilren?: ReactNode;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import type { FC, HTMLAttributes, ReactNode } from 'react';
3
3
  export declare const iconColor: "var(--ds-text)";
4
4
  export declare const indentBase: "var(--ds-space-300)";
5
5
  /**
@@ -1,18 +1,8 @@
1
- import React, { Component } from 'react';
2
- type ColumnWidth = string | number;
1
+ import { Component } from 'react';
2
+ import { type ColumnWidth } from './internal/context';
3
3
  interface State {
4
4
  columnWidths: ColumnWidth[];
5
5
  }
6
- type TableTreeContext = {
7
- setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
8
- getColumnWidth: (columnIndex: number) => ColumnWidth | null;
9
- };
10
- /**
11
- *
12
- * Context provider which maintains the column widths and access methods for use in descendent table cells
13
- * Enables composed table-tree implementations to e.g. set width on header cells only
14
- */
15
- export declare const TableTreeContext: React.Context<TableTreeContext>;
16
6
  export default class TableTree extends Component<any, State> {
17
7
  state: State;
18
8
  componentDidMount(): void;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import type { FC, HTMLAttributes, ReactNode } from 'react';
3
3
  interface CommonCellProps {
4
4
  indent?: string;
5
5
  width?: string | number;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export type ColumnWidth = string | number;
3
+ /**
4
+ *
5
+ * Context provider which maintains the column widths and access methods for use in descendent table cells
6
+ * Enables composed table-tree implementations to e.g. set width on header cells only
7
+ */
8
+ export declare const TableTreeContext: import("react").Context<{
9
+ setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
10
+ getColumnWidth: (columnIndex: number) => ColumnWidth | null;
11
+ }>;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import type { FC, HTMLAttributes, ReactNode } from 'react';
3
3
  interface OverflowContainerProps {
4
4
  isSingleLine?: boolean;
5
5
  chilren?: ReactNode;
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import type { FC, HTMLAttributes, ReactNode } from 'react';
3
3
  export declare const iconColor: "var(--ds-text)";
4
4
  export declare const indentBase: "var(--ds-space-300)";
5
5
  /**
@@ -1,18 +1,8 @@
1
- import React, { Component } from 'react';
2
- type ColumnWidth = string | number;
1
+ import { Component } from 'react';
2
+ import { type ColumnWidth } from './internal/context';
3
3
  interface State {
4
4
  columnWidths: ColumnWidth[];
5
5
  }
6
- type TableTreeContext = {
7
- setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
8
- getColumnWidth: (columnIndex: number) => ColumnWidth | null;
9
- };
10
- /**
11
- *
12
- * Context provider which maintains the column widths and access methods for use in descendent table cells
13
- * Enables composed table-tree implementations to e.g. set width on header cells only
14
- */
15
- export declare const TableTreeContext: React.Context<TableTreeContext>;
16
6
  export default class TableTree extends Component<any, State> {
17
7
  state: State;
18
8
  componentDidMount(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.6.5",
3
+ "version": "9.6.7",
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/"
@@ -24,11 +24,11 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@atlaskit/analytics-next": "^9.1.0",
27
- "@atlaskit/button": "^16.10.0",
27
+ "@atlaskit/button": "^16.16.0",
28
28
  "@atlaskit/icon": "^21.12.0",
29
- "@atlaskit/spinner": "^15.6.0",
29
+ "@atlaskit/spinner": "^16.0.0",
30
30
  "@atlaskit/theme": "^12.6.0",
31
- "@atlaskit/tokens": "^1.26.0",
31
+ "@atlaskit/tokens": "^1.28.0",
32
32
  "@babel/runtime": "^7.0.0",
33
33
  "@emotion/react": "^11.7.1",
34
34
  "lodash": "^4.17.21"
@@ -42,10 +42,12 @@
42
42
  "@atlaskit/ds-lib": "^2.2.0",
43
43
  "@atlaskit/ssr": "*",
44
44
  "@atlaskit/visual-regression": "*",
45
+ "@atlaskit/visually-hidden": "^1.2.4",
45
46
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
46
47
  "@emotion/styled": "^11.0.0",
47
48
  "@testing-library/react": "^12.1.5",
48
49
  "@testing-library/user-event": "^14.4.3",
50
+ "@types/react-redux": "^5.0.0",
49
51
  "exenv": "^1.2.2",
50
52
  "react-dom": "^16.8.0",
51
53
  "react-redux": "^5.1.2",