@atlaskit/dynamic-table 14.8.1 → 14.8.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/dynamic-table
2
2
 
3
+ ## 14.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ba5370e80b4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ba5370e80b4) - Update table row background color on drag to better match design token semantics
8
+
9
+ ## 14.8.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f9cd9e55e43`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f9cd9e55e43) - Update to disabled tokens which slightly affects the opacity in disabled states
14
+
3
15
  ## 14.8.1
4
16
 
5
17
  ### Patch Changes
@@ -258,5 +258,5 @@ exports.default = LoadingContainerAdvanced;
258
258
  (0, _defineProperty2.default)(LoadingContainerAdvanced, "defaultProps", {
259
259
  isLoading: true,
260
260
  spinnerSize: _constants.LARGE,
261
- contentsOpacity: _constants.LOADING_CONTENTS_OPACITY
261
+ contentsOpacity: "var(--ds-opacity-loading, ".concat("".concat(_constants.LOADING_CONTENTS_OPACITY), ")")
262
262
  });
@@ -54,7 +54,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
54
54
  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; } }
55
55
 
56
56
  var packageName = "@atlaskit/dynamic-table";
57
- var packageVersion = "14.8.1";
57
+ var packageVersion = "14.8.3";
58
58
 
59
59
  function toggleSortOrder(currentSortOrder) {
60
60
  switch (currentSortOrder) {
@@ -23,16 +23,10 @@ var _excluded = ["isRanking", "isRankingItem"];
23
23
  var rankingStyles = (0, _react2.css)({
24
24
  display: 'block'
25
25
  });
26
- var elevationStyle = "var(--ds-shadow-overlay, ".concat("0 20px 32px -8px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")");
27
- /**
28
- * TODO: Pass the props here to get particular theme for the table
29
- * Skipping it for now as it may impact migration as util-shared-styles does not support this feature
30
- */
31
-
32
26
  var rankingItemStyles = (0, _react2.css)({
33
- backgroundColor: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
27
+ backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N20, ")"),
34
28
  borderRadius: '2px',
35
- boxShadow: elevationStyle
29
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 20px 32px -8px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")
36
30
  });
37
31
  var draggableStyles = (0, _react2.css)({
38
32
  outlineWidth: '2px',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.8.1",
3
+ "version": "14.8.3",
4
4
  "sideEffects": false
5
5
  }
@@ -213,5 +213,5 @@ export default class LoadingContainerAdvanced extends React.Component {
213
213
  _defineProperty(LoadingContainerAdvanced, "defaultProps", {
214
214
  isLoading: true,
215
215
  spinnerSize: LARGE,
216
- contentsOpacity: LOADING_CONTENTS_OPACITY
216
+ contentsOpacity: `var(--ds-opacity-loading, ${`${LOADING_CONTENTS_OPACITY}`})`
217
217
  });
@@ -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.8.1";
17
+ const packageVersion = "14.8.3";
18
18
 
19
19
  function toggleSortOrder(currentSortOrder) {
20
20
  switch (currentSortOrder) {
@@ -8,16 +8,10 @@ import { TableBodyRow } from '../table-row';
8
8
  const rankingStyles = css({
9
9
  display: 'block'
10
10
  });
11
- const elevationStyle = `var(--ds-shadow-overlay, ${`0 20px 32px -8px ${N50A}, 0 0 1px ${N60A}`})`;
12
- /**
13
- * TODO: Pass the props here to get particular theme for the table
14
- * Skipping it for now as it may impact migration as util-shared-styles does not support this feature
15
- */
16
-
17
11
  const rankingItemStyles = css({
18
- backgroundColor: `var(--ds-background-neutral, ${N20})`,
12
+ backgroundColor: `var(--ds-surface-overlay, ${N20})`,
19
13
  borderRadius: '2px',
20
- boxShadow: elevationStyle
14
+ boxShadow: `var(--ds-shadow-overlay, ${`0 20px 32px -8px ${N50A}, 0 0 1px ${N60A}`})`
21
15
  });
22
16
  const draggableStyles = css({
23
17
  outlineWidth: '2px',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.8.1",
3
+ "version": "14.8.3",
4
4
  "sideEffects": false
5
5
  }
@@ -254,7 +254,7 @@ var LoadingContainerAdvanced = /*#__PURE__*/function (_React$Component) {
254
254
  _defineProperty(LoadingContainerAdvanced, "defaultProps", {
255
255
  isLoading: true,
256
256
  spinnerSize: LARGE,
257
- contentsOpacity: LOADING_CONTENTS_OPACITY
257
+ contentsOpacity: "var(--ds-opacity-loading, ".concat("".concat(LOADING_CONTENTS_OPACITY), ")")
258
258
  });
259
259
 
260
260
  export { LoadingContainerAdvanced as default };
@@ -25,7 +25,7 @@ import ManagedPagination from './managed-pagination';
25
25
  import RankableTableBody from './rankable/body';
26
26
  import TableHead from './table-head';
27
27
  var packageName = "@atlaskit/dynamic-table";
28
- var packageVersion = "14.8.1";
28
+ var packageVersion = "14.8.3";
29
29
 
30
30
  function toggleSortOrder(currentSortOrder) {
31
31
  switch (currentSortOrder) {
@@ -10,16 +10,10 @@ import { TableBodyRow } from '../table-row';
10
10
  var rankingStyles = css({
11
11
  display: 'block'
12
12
  });
13
- var elevationStyle = "var(--ds-shadow-overlay, ".concat("0 20px 32px -8px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")");
14
- /**
15
- * TODO: Pass the props here to get particular theme for the table
16
- * Skipping it for now as it may impact migration as util-shared-styles does not support this feature
17
- */
18
-
19
13
  var rankingItemStyles = css({
20
- backgroundColor: "var(--ds-background-neutral, ".concat(N20, ")"),
14
+ backgroundColor: "var(--ds-surface-overlay, ".concat(N20, ")"),
21
15
  borderRadius: '2px',
22
- boxShadow: elevationStyle
16
+ boxShadow: "var(--ds-shadow-overlay, ".concat("0 20px 32px -8px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")")
23
17
  });
24
18
  var draggableStyles = css({
25
19
  outlineWidth: '2px',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.8.1",
3
+ "version": "14.8.3",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,7 @@ export interface LoadingContainerAdvancedProps {
4
4
  children: React.ReactElement<any>;
5
5
  isLoading?: boolean;
6
6
  spinnerSize?: SpinnerSizeType;
7
- contentsOpacity: number;
7
+ contentsOpacity: number | string;
8
8
  targetRef?: () => HTMLDivElement | undefined;
9
9
  testId?: string;
10
10
  }
@@ -14,7 +14,7 @@ export default class LoadingContainerAdvanced extends React.Component<LoadingCon
14
14
  static defaultProps: {
15
15
  isLoading: boolean;
16
16
  spinnerSize: string;
17
- contentsOpacity: number;
17
+ contentsOpacity: "var(--ds-opacity-loading)";
18
18
  };
19
19
  componentDidMount: () => void;
20
20
  UNSAFE_componentWillReceiveProps: (nextProps: LoadingContainerAdvancedProps) => void;
@@ -4,7 +4,7 @@ export interface LoadingContainerAdvancedProps {
4
4
  children: React.ReactElement<any>;
5
5
  isLoading?: boolean;
6
6
  spinnerSize?: SpinnerSizeType;
7
- contentsOpacity: number;
7
+ contentsOpacity: number | string;
8
8
  targetRef?: () => HTMLDivElement | undefined;
9
9
  testId?: string;
10
10
  }
@@ -14,7 +14,7 @@ export default class LoadingContainerAdvanced extends React.Component<LoadingCon
14
14
  static defaultProps: {
15
15
  isLoading: boolean;
16
16
  spinnerSize: string;
17
- contentsOpacity: number;
17
+ contentsOpacity: "var(--ds-opacity-loading)";
18
18
  };
19
19
  componentDidMount: () => void;
20
20
  UNSAFE_componentWillReceiveProps: (nextProps: LoadingContainerAdvancedProps) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.8.1",
3
+ "version": "14.8.3",
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/"
@@ -47,7 +47,7 @@
47
47
  "react-dom": "^16.8.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@atlaskit/avatar": "^21.0.0",
50
+ "@atlaskit/avatar": "^21.1.0",
51
51
  "@atlaskit/button": "^16.3.0",
52
52
  "@atlaskit/docs": "*",
53
53
  "@atlaskit/dropdown-menu": "^11.5.0",
package/report.api.md CHANGED
@@ -1,8 +1,11 @@
1
- ## API Report File for "@atlaskit/dynamic-table"
1
+ ## API Report File for "@atlaskit/dynamic-table".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ````ts
8
+ import noop from '@atlaskit/ds-lib/noop';
6
9
  import { default as React_2 } from 'react';
7
10
  import { Ref } from 'react';
8
11
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
@@ -41,8 +44,8 @@ declare class DynamicTable extends React_2.Component<StatefulProps, State> {
41
44
  isLoading: boolean;
42
45
  isFixedSize: boolean;
43
46
  isRankable: boolean;
44
- onSetPage: () => void;
45
- onSort: () => void;
47
+ onSetPage: typeof noop;
48
+ onSort: typeof noop;
46
49
  rowsPerPage: number;
47
50
  };
48
51
  state: {
@@ -105,13 +108,13 @@ export declare const DynamicTableStateless: React_2.ForwardRefExoticComponent<
105
108
  isLoading: boolean;
106
109
  isFixedSize: boolean;
107
110
  rowsPerPage: number;
108
- onSetPage: () => void;
109
- onSort: () => void;
111
+ onSetPage: typeof noop;
112
+ onSort: typeof noop;
110
113
  page: number;
111
114
  isRankable: boolean;
112
115
  isRankingDisabled: boolean;
113
- onRankStart: () => void;
114
- onRankEnd: () => void;
116
+ onRankStart: typeof noop;
117
+ onRankEnd: typeof noop;
115
118
  paginationi18n: {
116
119
  prev: string;
117
120
  next: string;
@@ -153,11 +156,17 @@ export declare const DynamicTableStateless: React_2.ForwardRefExoticComponent<
153
156
  >;
154
157
 
155
158
  declare interface HeadCellType extends RowCellType {
156
- /** Whether the column the cell sits above is sortable. */
159
+ /**
160
+ * Whether the column the cell sits above is sortable.
161
+ */
157
162
  isSortable?: boolean;
158
- /** The pixel width of the cell. */
163
+ /**
164
+ * The width of the cell as a percentage.
165
+ */
159
166
  width?: number;
160
- /** Whether the text in the cell will truncate or not if constrained. */
167
+ /**
168
+ * Whether the text in the cell will truncate or not if constrained.
169
+ */
161
170
  shouldTruncate?: boolean;
162
171
  }
163
172
 
@@ -263,12 +272,11 @@ declare interface StatefulProps extends WithAnalyticsEventsProps {
263
272
  */
264
273
  head?: HeadType;
265
274
  /**
266
- * Rows to be placed in the table.
267
- * Each row contains cells which should map to the ones defined in the head.
268
- * Rows accept standard HTML <tr> props in addition to those listed below.
269
-
270
- * Ensure each cell has a unique `key` per column - this is used for both React's reconciliation of lists and column sorting.
271
- */
275
+ * Rows to be placed in the table.
276
+ * Each row contains cells which should map to the ones defined in the head.
277
+ * Rows accept standard HTML <tr> props in addition to those listed below.
278
+ * Ensure each cell has a unique `key` per column - this is used for both React's reconciliation of lists and column sorting.
279
+ */
272
280
  rows?: Array<RowType>;
273
281
  /**
274
282
  * Shown when the table has no content.
@@ -288,7 +296,7 @@ declare interface StatefulProps extends WithAnalyticsEventsProps {
288
296
  */
289
297
  isFixedSize?: boolean;
290
298
  /**
291
- * Controls how many rows should be diplayed per page.
299
+ * Controls how many rows should be displayed per page. If set, also turns on pagination, if there is more than one page to show.
292
300
  */
293
301
  rowsPerPage?: number;
294
302
  /**
@@ -362,20 +370,19 @@ declare interface StatefulProps extends WithAnalyticsEventsProps {
362
370
  */
363
371
  highlightedRowIndex?: number | number[];
364
372
  /**
365
- A `testId` prop is provided for specified elements,
366
- which is a unique string that appears as a data attribute
367
- `data-testid` in the rendered code, serving as a hook for automated tests.
368
-
369
- The value of `testId` is used to prefix `testId` props in given elements.
370
- - `{testId}--table` - Table.
371
- - `{testId}--head` - Table header.
372
- - `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
373
- - `{testId}--row--{index - content of the first cell}` - Table row.
374
- - `{testId}--body` - Table body.
375
- - `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
376
- - `{testId}--loadingSpinner` - The spinner overlaid when loading.
377
- - `{testId}--pagination` - The table pagination.
378
- */
373
+ * A `testId` prop is provided for specified elements,
374
+ * which is a unique string that appears as a data attribute
375
+ * `data-testid` in the rendered code, serving as a hook for automated tests.
376
+ * The value of `testId` is used to prefix `testId` props in given elements.
377
+ * - `{testId}--table` - Table.
378
+ * - `{testId}--head` - Table header.
379
+ * - `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
380
+ * - `{testId}--row--{index - content of the first cell}` - Table row.
381
+ * - `{testId}--body` - Table body.
382
+ * - `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
383
+ * - `{testId}--loadingSpinner` - The spinner overlaid when loading.
384
+ * - `{testId}--pagination` - The table pagination.
385
+ */
379
386
  testId?: string;
380
387
  /**
381
388
  * Used to provide a better description of the table for users with assistive technologies.
@@ -396,11 +403,11 @@ declare interface StatelessProps extends WithAnalyticsEventsProps {
396
403
  */
397
404
  head?: HeadType;
398
405
  /**
399
- * Rows to be placed in the table.
400
- * Each row contains cells which should map to the ones defined in the head.
401
-
402
- * Ensure each cell has a unique `key` per column - this is used for both Reacts reconcilation of lists and column sorting.
403
- */
406
+ * Rows to be placed in the table.
407
+ * Each row contains cells which should map to the ones defined in the head.
408
+ *
409
+ * Ensure each cell has a unique `key` per column - this is used for both Reacts reconcilation of lists and column sorting.
410
+ */
404
411
  rows?: Array<RowType>;
405
412
  /**
406
413
  * Shown when the table has no content.
@@ -442,7 +449,7 @@ declare interface StatelessProps extends WithAnalyticsEventsProps {
442
449
  */
443
450
  onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
444
451
  /**
445
- * Page the table should show.
452
+ * Page the table should show. Set by default to 1, so never undefined.
446
453
  */
447
454
  page?: number;
448
455
  /**
@@ -481,20 +488,20 @@ declare interface StatelessProps extends WithAnalyticsEventsProps {
481
488
  */
482
489
  highlightedRowIndex?: number | number[];
483
490
  /**
484
- A `testId` prop is provided for specified elements,
485
- which is a unique string that appears as a data attribute
486
- `data-testid` in the rendered code, serving as a hook for automated tests.
487
-
488
- The value of `testId` is used to prefix `testId` props in given elements.
489
- - `{testId}--table` - Table.
490
- - `{testId}--head` - Table header.
491
- - `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
492
- - `{testId}--row--{index - content of the first cell}` - Table row.
493
- - `{testId}--body` - Table body.
494
- - `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
495
- - `{testId}--loadingSpinner` - The spinner overlaid when loading.
496
- - `{testId}--pagination` - The table pagination.
497
- */
491
+ * A `testId` prop is provided for specified elements,
492
+ * which is a unique string that appears as a data attribute
493
+ * `data-testid` in the rendered code, serving as a hook for automated tests.
494
+ *
495
+ * The value of `testId` is used to prefix `testId` props in given elements.
496
+ * - `{testId}--table` - Table.
497
+ * - `{testId}--head` - Table header.
498
+ * - `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
499
+ * - `{testId}--row--{index - content of the first cell}` - Table row.
500
+ * - `{testId}--body` - Table body.
501
+ * - `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
502
+ * - `{testId}--loadingSpinner` - The spinner overlaid when loading.
503
+ * - `{testId}--pagination` - The table pagination.
504
+ */
498
505
  testId?: string;
499
506
  /**
500
507
  * Used to provide a better description of the table for users with assistive technologies.