@atlaskit/dynamic-table 14.9.3 → 14.10.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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/dynamic-table
2
2
 
3
+ ## 14.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`12d9c63d4c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12d9c63d4c1) - [ux] pass pageLabel to dynamic-table component and updat prev label in examples, add description in the types file, update example files
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 14.9.3
4
14
 
5
15
  ### Patch Changes
@@ -23,6 +23,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
23
23
  // there is a bug with findDOMNode and Suspense in React < 16.9: https://github.com/facebook/react/issues/14188
24
24
  var safeFindDOMNode = function safeFindDOMNode(component) {
25
25
  try {
26
+ // DSP-10519 TODO: ReactDOM.findDOMNode is deprecated in React18, consider using alternative solution
27
+ // https://react.dev/reference/react-dom/findDOMNode#alternatives
28
+ // eslint-disable-next-line react/no-find-dom-node
26
29
  return (0, _reactDom.findDOMNode)(component);
27
30
  } catch (e) {
28
31
  return null;
@@ -52,6 +52,7 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
52
52
  label: i18n === null || i18n === void 0 ? void 0 : i18n.label,
53
53
  nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
54
54
  previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
55
+ pageLabel: i18n === null || i18n === void 0 ? void 0 : i18n.pageLabel,
55
56
  onChange: this.onChange,
56
57
  pages: pages,
57
58
  testId: testId && "".concat(testId, "--pagination")
@@ -29,7 +29,7 @@ var _tableHead = _interopRequireDefault(require("./table-head"));
29
29
  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); }; }
30
30
  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; } }
31
31
  var packageName = "@atlaskit/dynamic-table";
32
- var packageVersion = "14.9.3";
32
+ var packageVersion = "14.10.0";
33
33
  function toggleSortOrder(currentSortOrder) {
34
34
  switch (currentSortOrder) {
35
35
  case _constants.DESC:
@@ -265,9 +265,10 @@ exports.DynamicTableWithoutAnalytics = DynamicTable;
265
265
  onRankStart: _noop.default,
266
266
  onRankEnd: _noop.default,
267
267
  paginationi18n: {
268
- prev: 'Prev',
268
+ prev: 'Previous',
269
269
  next: 'Next',
270
- label: 'Pagination'
270
+ label: 'Pagination',
271
+ pageLabel: 'Page'
271
272
  }
272
273
  });
273
274
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.9.3",
3
+ "version": "14.10.0",
4
4
  "sideEffects": false
5
5
  }
@@ -8,6 +8,9 @@ import { Container, SpinnerBackdrop, SpinnerContainer } from '../styled/loading-
8
8
  // there is a bug with findDOMNode and Suspense in React < 16.9: https://github.com/facebook/react/issues/14188
9
9
  const safeFindDOMNode = component => {
10
10
  try {
11
+ // DSP-10519 TODO: ReactDOM.findDOMNode is deprecated in React18, consider using alternative solution
12
+ // https://react.dev/reference/react-dom/findDOMNode#alternatives
13
+ // eslint-disable-next-line react/no-find-dom-node
11
14
  return findDOMNode(component);
12
15
  } catch (e) {
13
16
  return null;
@@ -24,6 +24,7 @@ export default class ManagedPagination extends React.Component {
24
24
  label: i18n === null || i18n === void 0 ? void 0 : i18n.label,
25
25
  nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
26
26
  previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
27
+ pageLabel: i18n === null || i18n === void 0 ? void 0 : i18n.pageLabel,
27
28
  onChange: this.onChange,
28
29
  pages: pages,
29
30
  testId: testId && `${testId}--pagination`
@@ -14,7 +14,7 @@ import ManagedPagination from './managed-pagination';
14
14
  import RankableTableBody from './rankable/body';
15
15
  import TableHead from './table-head';
16
16
  const packageName = "@atlaskit/dynamic-table";
17
- const packageVersion = "14.9.3";
17
+ const packageVersion = "14.10.0";
18
18
  function toggleSortOrder(currentSortOrder) {
19
19
  switch (currentSortOrder) {
20
20
  case DESC:
@@ -236,9 +236,10 @@ _defineProperty(DynamicTable, "defaultProps", {
236
236
  onRankStart: noop,
237
237
  onRankEnd: noop,
238
238
  paginationi18n: {
239
- prev: 'Prev',
239
+ prev: 'Previous',
240
240
  next: 'Next',
241
- label: 'Pagination'
241
+ label: 'Pagination',
242
+ pageLabel: 'Page'
242
243
  }
243
244
  });
244
245
  export { DynamicTable as DynamicTableWithoutAnalytics };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.9.3",
3
+ "version": "14.10.0",
4
4
  "sideEffects": false
5
5
  }
@@ -17,6 +17,9 @@ import { Container, SpinnerBackdrop, SpinnerContainer } from '../styled/loading-
17
17
  // there is a bug with findDOMNode and Suspense in React < 16.9: https://github.com/facebook/react/issues/14188
18
18
  var safeFindDOMNode = function safeFindDOMNode(component) {
19
19
  try {
20
+ // DSP-10519 TODO: ReactDOM.findDOMNode is deprecated in React18, consider using alternative solution
21
+ // https://react.dev/reference/react-dom/findDOMNode#alternatives
22
+ // eslint-disable-next-line react/no-find-dom-node
20
23
  return findDOMNode(component);
21
24
  } catch (e) {
22
25
  return null;
@@ -45,6 +45,7 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
45
45
  label: i18n === null || i18n === void 0 ? void 0 : i18n.label,
46
46
  nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
47
47
  previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
48
+ pageLabel: i18n === null || i18n === void 0 ? void 0 : i18n.pageLabel,
48
49
  onChange: this.onChange,
49
50
  pages: pages,
50
51
  testId: testId && "".concat(testId, "--pagination")
@@ -22,7 +22,7 @@ import ManagedPagination from './managed-pagination';
22
22
  import RankableTableBody from './rankable/body';
23
23
  import TableHead from './table-head';
24
24
  var packageName = "@atlaskit/dynamic-table";
25
- var packageVersion = "14.9.3";
25
+ var packageVersion = "14.10.0";
26
26
  function toggleSortOrder(currentSortOrder) {
27
27
  switch (currentSortOrder) {
28
28
  case DESC:
@@ -257,9 +257,10 @@ _defineProperty(DynamicTable, "defaultProps", {
257
257
  onRankStart: noop,
258
258
  onRankEnd: noop,
259
259
  paginationi18n: {
260
- prev: 'Prev',
260
+ prev: 'Previous',
261
261
  next: 'Next',
262
- label: 'Pagination'
262
+ label: 'Pagination',
263
+ pageLabel: 'Page'
263
264
  }
264
265
  });
265
266
  export { DynamicTable as DynamicTableWithoutAnalytics };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.9.3",
3
+ "version": "14.10.0",
4
4
  "sideEffects": false
5
5
  }
@@ -25,6 +25,7 @@ declare class DynamicTable extends React.Component<Props, State> {
25
25
  prev: string;
26
26
  next: string;
27
27
  label: string;
28
+ pageLabel: string;
28
29
  };
29
30
  };
30
31
  UNSAFE_componentWillMount(): void;
@@ -53,6 +54,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<Props, ke
53
54
  prev: string;
54
55
  next: string;
55
56
  label: string;
57
+ pageLabel: string;
56
58
  };
57
59
  }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "head" | "caption" | "rows" | "emptyView" | "loadingSpinnerSize" | "isLoading" | "isFixedSize" | "rowsPerPage" | "totalRows" | "onSetPage" | "onSort" | "onPageRowsUpdate" | "page" | "sortKey" | "sortOrder" | "isRankable" | "isRankingDisabled" | "onRankStart" | "onRankEnd" | "paginationi18n" | "highlightedRowIndex" | "testId" | "label" | "key" | "analyticsContext"> & React.RefAttributes<any>>;
58
60
  export default _default;
@@ -32,6 +32,13 @@ export interface I18nShape {
32
32
  * Accessible label applied to the current page button in the pagination component.
33
33
  */
34
34
  label: string;
35
+ /**
36
+ * Accessible label for the individual page numbers.
37
+ * The page number is automatically appended to the pageLabel.
38
+ * For Example, pageLabel="página" will render aria-label="página 1"
39
+ * as the label for page 1.
40
+ */
41
+ pageLabel?: string;
35
42
  }
36
43
  export interface StatelessProps extends WithAnalyticsEventsProps {
37
44
  /**
@@ -121,7 +128,7 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
121
128
  onRankEnd?: (rankEnd: RankEnd, uiAnalyticsEvent?: UIAnalyticsEvent) => void;
122
129
  /**
123
130
  * Labels for the pagination wrapper, previous and next buttons used in pagination.
124
- * Defaults to `"pagination"`, `"previous"` and `"next"`.
131
+ * Defaults to `"page"`, `"pagination"`, `"previous"` and `"next"`.
125
132
  */
126
133
  paginationi18n?: I18nShape;
127
134
  /**
@@ -25,6 +25,7 @@ declare class DynamicTable extends React.Component<Props, State> {
25
25
  prev: string;
26
26
  next: string;
27
27
  label: string;
28
+ pageLabel: string;
28
29
  };
29
30
  };
30
31
  UNSAFE_componentWillMount(): void;
@@ -53,6 +54,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<Props, ke
53
54
  prev: string;
54
55
  next: string;
55
56
  label: string;
57
+ pageLabel: string;
56
58
  };
57
59
  }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "head" | "caption" | "rows" | "emptyView" | "loadingSpinnerSize" | "isLoading" | "isFixedSize" | "rowsPerPage" | "totalRows" | "onSetPage" | "onSort" | "onPageRowsUpdate" | "page" | "sortKey" | "sortOrder" | "isRankable" | "isRankingDisabled" | "onRankStart" | "onRankEnd" | "paginationi18n" | "highlightedRowIndex" | "testId" | "label" | "key" | "analyticsContext"> & React.RefAttributes<any>>;
58
60
  export default _default;
@@ -32,6 +32,13 @@ export interface I18nShape {
32
32
  * Accessible label applied to the current page button in the pagination component.
33
33
  */
34
34
  label: string;
35
+ /**
36
+ * Accessible label for the individual page numbers.
37
+ * The page number is automatically appended to the pageLabel.
38
+ * For Example, pageLabel="página" will render aria-label="página 1"
39
+ * as the label for page 1.
40
+ */
41
+ pageLabel?: string;
35
42
  }
36
43
  export interface StatelessProps extends WithAnalyticsEventsProps {
37
44
  /**
@@ -121,7 +128,7 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
121
128
  onRankEnd?: (rankEnd: RankEnd, uiAnalyticsEvent?: UIAnalyticsEvent) => void;
122
129
  /**
123
130
  * Labels for the pagination wrapper, previous and next buttons used in pagination.
124
- * Defaults to `"pagination"`, `"previous"` and `"next"`.
131
+ * Defaults to `"page"`, `"pagination"`, `"previous"` and `"next"`.
125
132
  */
126
133
  paginationi18n?: I18nShape;
127
134
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.9.3",
3
+ "version": "14.10.0",
4
4
  "description": "A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,10 +38,10 @@
38
38
  "dependencies": {
39
39
  "@atlaskit/analytics-next": "^9.1.0",
40
40
  "@atlaskit/ds-lib": "^2.2.0",
41
- "@atlaskit/pagination": "^14.3.0",
41
+ "@atlaskit/pagination": "^14.4.0",
42
42
  "@atlaskit/spinner": "^15.5.0",
43
43
  "@atlaskit/theme": "^12.5.0",
44
- "@atlaskit/tokens": "^1.4.0",
44
+ "@atlaskit/tokens": "^1.5.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@emotion/react": "^11.7.1",
47
47
  "react-beautiful-dnd": "^12.1.1"
package/report.api.md CHANGED
@@ -110,6 +110,7 @@ export const DynamicTableStateless: React_2.ForwardRefExoticComponent<
110
110
  prev: string;
111
111
  next: string;
112
112
  label: string;
113
+ pageLabel: string;
113
114
  };
114
115
  },
115
116
  never
@@ -163,6 +164,7 @@ interface HeadType {
163
164
  interface I18nShape {
164
165
  label: string;
165
166
  next: string;
167
+ pageLabel?: string;
166
168
  prev: string;
167
169
  }
168
170
 
@@ -61,6 +61,7 @@ export const DynamicTableStateless: React_2.ForwardRefExoticComponent<Pick<Pick<
61
61
  prev: string;
62
62
  next: string;
63
63
  label: string;
64
+ pageLabel: string;
64
65
  };
65
66
  }, never>> & React_2.RefAttributes<any> & WithContextProps, "analyticsContext" | "caption" | "emptyView" | "head" | "highlightedRowIndex" | "isFixedSize" | "isLoading" | "isRankable" | "isRankingDisabled" | "key" | "label" | "loadingSpinnerSize" | "onPageRowsUpdate" | "onRankEnd" | "onRankStart" | "onSetPage" | "onSort" | "page" | "paginationi18n" | "rows" | "rowsPerPage" | "sortKey" | "sortOrder" | "testId" | "totalRows"> & React_2.RefAttributes<any>>;
66
67
 
@@ -81,6 +82,7 @@ interface HeadType {
81
82
  interface I18nShape {
82
83
  label: string;
83
84
  next: string;
85
+ pageLabel?: string;
84
86
  prev: string;
85
87
  }
86
88