@atlaskit/link-datasource 2.3.0 → 2.3.2
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 +25 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +26 -46
- package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +12 -5
- package/dist/cjs/ui/issue-like-table/index.js +86 -48
- package/dist/cjs/ui/issue-like-table/render-type/richtext/index.js +2 -3
- package/dist/cjs/ui/issue-like-table/styled.js +11 -0
- package/dist/cjs/ui/issue-like-table/utils.js +13 -6
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +2 -2
- package/dist/es2019/hooks/useDatasourceTableState.js +25 -40
- package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +12 -5
- package/dist/es2019/ui/issue-like-table/index.js +50 -17
- package/dist/es2019/ui/issue-like-table/render-type/richtext/index.js +2 -3
- package/dist/es2019/ui/issue-like-table/styled.js +11 -0
- package/dist/es2019/ui/issue-like-table/utils.js +14 -5
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +2 -2
- package/dist/esm/hooks/useDatasourceTableState.js +26 -46
- package/dist/esm/ui/issue-like-table/draggable-table-heading.js +12 -5
- package/dist/esm/ui/issue-like-table/index.js +86 -48
- package/dist/esm/ui/issue-like-table/render-type/richtext/index.js +2 -3
- package/dist/esm/ui/issue-like-table/styled.js +11 -0
- package/dist/esm/ui/issue-like-table/utils.js +13 -6
- package/dist/esm/ui/jira-issues-modal/modal/index.js +2 -2
- package/dist/types/common/utils/adf.d.ts +1 -1
- package/dist/types/hooks/useDatasourceTableState.d.ts +1 -1
- package/dist/types/ui/datasource-table-view/datasourceTableView.d.ts +0 -1
- package/dist/types/ui/datasource-table-view/types.d.ts +1 -2
- package/dist/types/ui/issue-like-table/draggable-table-heading.d.ts +2 -2
- package/dist/types/ui/issue-like-table/index.d.ts +1 -1
- package/dist/types/ui/issue-like-table/utils.d.ts +2 -2
- package/dist/types-ts4.5/common/utils/adf.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useDatasourceTableState.d.ts +1 -1
- package/dist/types-ts4.5/ui/datasource-table-view/datasourceTableView.d.ts +0 -1
- package/dist/types-ts4.5/ui/datasource-table-view/types.d.ts +1 -2
- package/dist/types-ts4.5/ui/issue-like-table/draggable-table-heading.d.ts +2 -2
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/issue-like-table/utils.d.ts +2 -2
- package/package.json +14 -14
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
-
var _styled$
|
|
6
|
+
var _styled$td;
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
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; }
|
|
9
9
|
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) { _defineProperty(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; }
|
|
@@ -11,6 +11,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
12
|
import { css, jsx } from '@emotion/react';
|
|
13
13
|
import styled from '@emotion/styled';
|
|
14
|
+
import debounce from 'lodash/debounce';
|
|
14
15
|
import { useIntl } from 'react-intl-next';
|
|
15
16
|
import invariant from 'tiny-invariant';
|
|
16
17
|
import { Skeleton } from '@atlaskit/linking-common';
|
|
@@ -22,6 +23,7 @@ import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/ad
|
|
|
22
23
|
import { N40 } from '@atlaskit/theme/colors';
|
|
23
24
|
import { fontFallback } from '@atlaskit/theme/typography';
|
|
24
25
|
import Tooltip from '@atlaskit/tooltip';
|
|
26
|
+
import { WidthObserver } from '@atlaskit/width-detector';
|
|
25
27
|
import { startUfoExperience, succeedUfoExperience } from '../../analytics/ufoExperiences';
|
|
26
28
|
import { stickyTableHeadersIndex } from '../../common/zindex';
|
|
27
29
|
import { ColumnPicker } from './column-picker';
|
|
@@ -44,27 +46,30 @@ var truncateTextStyles = css({
|
|
|
44
46
|
textOverflow: 'ellipsis',
|
|
45
47
|
whiteSpace: 'nowrap'
|
|
46
48
|
});
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
+
var columnPickerWidth = 80;
|
|
50
|
+
var ColumnPickerHeader = styled.th(_defineProperty({}, "".concat(withTablePluginHeaderPrefix('&:last-of-type')), {
|
|
51
|
+
boxSizing: 'border-box',
|
|
49
52
|
border: 0,
|
|
50
|
-
width:
|
|
53
|
+
width: "".concat(columnPickerWidth, "px"),
|
|
51
54
|
zIndex: 10,
|
|
52
55
|
position: 'sticky',
|
|
53
56
|
right: "calc(-1 * ".concat(tableSidePadding, ")"),
|
|
54
57
|
backgroundColor: "var(--ds-elevation-surface-current, #FFF)",
|
|
58
|
+
/* It is required to have solid (not half-transparent) color because of this gradient business below */
|
|
55
59
|
borderBottom: "2px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
56
|
-
paddingRight:
|
|
60
|
+
paddingRight: tableSidePadding,
|
|
57
61
|
background: "linear-gradient( 90deg, rgba(255, 255, 255, 0) 0%, ".concat("var(--ds-elevation-surface-current, #FFF)", " 10% )"),
|
|
62
|
+
/* Keeps dropdown button in the middle */
|
|
58
63
|
verticalAlign: 'middle',
|
|
64
|
+
/* In case when TH itself is bigger we want to keep picker at the right side */
|
|
59
65
|
textAlign: 'right'
|
|
60
|
-
})
|
|
61
|
-
paddingRight: tableSidePadding
|
|
62
|
-
}), _styled$th));
|
|
66
|
+
}));
|
|
63
67
|
var truncateStyles = css({
|
|
64
68
|
textOverflow: 'ellipsis',
|
|
65
69
|
whiteSpace: 'nowrap'
|
|
66
70
|
});
|
|
67
71
|
var TableCell = styled.td((_styled$td = {}, _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix()), {
|
|
72
|
+
/* First section here is to override things editor table plugin css defines */
|
|
68
73
|
font: fieldTextFontSize,
|
|
69
74
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)"),
|
|
70
75
|
border: 0,
|
|
@@ -85,7 +90,8 @@ var TableCell = styled.td((_styled$td = {}, _defineProperty(_styled$td, "".conca
|
|
|
85
90
|
var tableContainerStyles = css({
|
|
86
91
|
borderRadius: 'inherit',
|
|
87
92
|
borderBottomLeftRadius: 0,
|
|
88
|
-
borderBottomRightRadius: 0
|
|
93
|
+
borderBottomRightRadius: 0,
|
|
94
|
+
position: 'relative'
|
|
89
95
|
});
|
|
90
96
|
|
|
91
97
|
/**
|
|
@@ -182,7 +188,10 @@ var tableStyles = css({
|
|
|
182
188
|
// These styles are needed to prevent thead bottom border from scrolling away.
|
|
183
189
|
// This happens because it is sticky. https://stackoverflow.com/questions/50361698/border-style-do-not-work-with-sticky-position-element
|
|
184
190
|
borderCollapse: 'separate',
|
|
185
|
-
borderSpacing: 0
|
|
191
|
+
borderSpacing: 0,
|
|
192
|
+
// There is a strange table:first-of-type rule that sets margin-top to 0 coming from container,
|
|
193
|
+
// but because our table is now not the first child (there is an empty div to measure width) we need to set it manually.
|
|
194
|
+
margin: 0
|
|
186
195
|
});
|
|
187
196
|
|
|
188
197
|
// By default tbody and thead have border-bottom: 2px ...
|
|
@@ -294,6 +303,19 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
294
303
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
295
304
|
orderedColumns = _useState6[0],
|
|
296
305
|
setOrderedColumns = _useState6[1];
|
|
306
|
+
|
|
307
|
+
// Table container width is used to know if sum of all column widths is bigger of container or not.
|
|
308
|
+
// When sum of all columns is less than container size we make last column stretchable (width: undefined)
|
|
309
|
+
var _useState7 = useState(),
|
|
310
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
311
|
+
tableContainerWidth = _useState8[0],
|
|
312
|
+
setTableContainerWidth = _useState8[1];
|
|
313
|
+
useEffect(function () {
|
|
314
|
+
var current = containerRef.current;
|
|
315
|
+
if (containerRef && current) {
|
|
316
|
+
setTableContainerWidth(current.getBoundingClientRect().width);
|
|
317
|
+
}
|
|
318
|
+
}, [containerRef]);
|
|
297
319
|
useEffect(function () {
|
|
298
320
|
if (!hasFullSchema) {
|
|
299
321
|
setOrderedColumns(getOrderedColumns(_toConsumableArray(columns), _toConsumableArray(visibleColumnKeys)));
|
|
@@ -320,19 +342,33 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
320
342
|
// or some other combination.
|
|
321
343
|
|
|
322
344
|
var identityColumnKey = 'id';
|
|
323
|
-
var
|
|
324
|
-
return (columnCustomSizes === null || columnCustomSizes === void 0 ? void 0 : columnCustomSizes[key]) || getDefaultColumnWidth(key, type);
|
|
325
|
-
}, [columnCustomSizes]);
|
|
326
|
-
var headerColumns = useMemo(function () {
|
|
345
|
+
var columnsWidthsSum = useMemo(function () {
|
|
327
346
|
return visibleSortedColumns.map(function (_ref7) {
|
|
328
347
|
var key = _ref7.key,
|
|
329
|
-
title = _ref7.title,
|
|
330
348
|
type = _ref7.type;
|
|
349
|
+
return (columnCustomSizes === null || columnCustomSizes === void 0 ? void 0 : columnCustomSizes[key]) || getDefaultColumnWidth(key, type);
|
|
350
|
+
}).reduce(function (sum, width) {
|
|
351
|
+
return width + sum;
|
|
352
|
+
}, 0) + (onVisibleColumnKeysChange ? columnPickerWidth : 0);
|
|
353
|
+
}, [columnCustomSizes, onVisibleColumnKeysChange, visibleSortedColumns]);
|
|
354
|
+
var shouldUseWidth = !!(onColumnResize || columnCustomSizes);
|
|
355
|
+
var getColumnWidth = useCallback(function (key, type, isLastCell) {
|
|
356
|
+
if (isLastCell && shouldUseWidth && (!tableContainerWidth || tableContainerWidth > columnsWidthsSum)) {
|
|
357
|
+
return undefined;
|
|
358
|
+
} else {
|
|
359
|
+
return (columnCustomSizes === null || columnCustomSizes === void 0 ? void 0 : columnCustomSizes[key]) || getDefaultColumnWidth(key, type);
|
|
360
|
+
}
|
|
361
|
+
}, [columnCustomSizes, columnsWidthsSum, shouldUseWidth, tableContainerWidth]);
|
|
362
|
+
var headerColumns = useMemo(function () {
|
|
363
|
+
return visibleSortedColumns.map(function (_ref8, index) {
|
|
364
|
+
var key = _ref8.key,
|
|
365
|
+
title = _ref8.title,
|
|
366
|
+
type = _ref8.type;
|
|
331
367
|
return {
|
|
332
368
|
key: key,
|
|
333
369
|
content: title,
|
|
334
370
|
shouldTruncate: true,
|
|
335
|
-
width: getColumnWidth(key, type)
|
|
371
|
+
width: getColumnWidth(key, type, index === visibleSortedColumns.length - 1)
|
|
336
372
|
};
|
|
337
373
|
});
|
|
338
374
|
}, [getColumnWidth, visibleSortedColumns]);
|
|
@@ -369,9 +405,9 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
369
405
|
return;
|
|
370
406
|
}
|
|
371
407
|
return combine(monitorForElements({
|
|
372
|
-
onDragStart: function onDragStart(
|
|
373
|
-
var location =
|
|
374
|
-
source =
|
|
408
|
+
onDragStart: function onDragStart(_ref9) {
|
|
409
|
+
var location = _ref9.location,
|
|
410
|
+
source = _ref9.source;
|
|
375
411
|
initialAutoScrollerClientY.current = location.current.input.clientY;
|
|
376
412
|
if (source.data.type === 'table-header') {
|
|
377
413
|
var _containerRef$current;
|
|
@@ -387,9 +423,9 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
387
423
|
});
|
|
388
424
|
}
|
|
389
425
|
},
|
|
390
|
-
onDrag: function onDrag(
|
|
391
|
-
var location =
|
|
392
|
-
source =
|
|
426
|
+
onDrag: function onDrag(_ref10) {
|
|
427
|
+
var location = _ref10.location,
|
|
428
|
+
source = _ref10.source;
|
|
393
429
|
if (source.data.type === 'table-header') {
|
|
394
430
|
var _containerRef$current2;
|
|
395
431
|
autoScroller.updateInput({
|
|
@@ -399,9 +435,9 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
399
435
|
});
|
|
400
436
|
}
|
|
401
437
|
},
|
|
402
|
-
onDrop: function onDrop(
|
|
403
|
-
var source =
|
|
404
|
-
location =
|
|
438
|
+
onDrop: function onDrop(_ref11) {
|
|
439
|
+
var source = _ref11.source,
|
|
440
|
+
location = _ref11.location;
|
|
405
441
|
autoScroller.stop();
|
|
406
442
|
if (location.current.dropTargets.length === 0) {
|
|
407
443
|
return;
|
|
@@ -436,10 +472,10 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
436
472
|
return items.map(function (newRowData, rowIndex) {
|
|
437
473
|
return {
|
|
438
474
|
key: "".concat(identityColumnKey && newRowData[identityColumnKey] && newRowData[identityColumnKey].data || rowIndex),
|
|
439
|
-
cells: visibleSortedColumns.map(function (
|
|
475
|
+
cells: visibleSortedColumns.map(function (_ref12, cellIndex) {
|
|
440
476
|
var _newRowData$key;
|
|
441
|
-
var key =
|
|
442
|
-
type =
|
|
477
|
+
var key = _ref12.key,
|
|
478
|
+
type = _ref12.type;
|
|
443
479
|
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
444
480
|
var value = (_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data;
|
|
445
481
|
var values = Array.isArray(value) ? value : [value];
|
|
@@ -463,7 +499,7 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
463
499
|
return {
|
|
464
500
|
key: key,
|
|
465
501
|
content: contentComponent,
|
|
466
|
-
width: getColumnWidth(key, type)
|
|
502
|
+
width: getColumnWidth(key, type, cellIndex === visibleSortedColumns.length - 1)
|
|
467
503
|
};
|
|
468
504
|
}),
|
|
469
505
|
ref: rowIndex === items.length - 1 ? function (el) {
|
|
@@ -529,7 +565,6 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
529
565
|
}
|
|
530
566
|
}, _callee, null, [[3, 9]]);
|
|
531
567
|
})), [parentContainerRenderInstanceId, extensionKey, hasFullSchema, onLoadDatasourceDetails]);
|
|
532
|
-
var shouldUseWidth = !!(onColumnResize || columnCustomSizes);
|
|
533
568
|
var isEditable = onVisibleColumnKeysChange && hasData;
|
|
534
569
|
return jsx("div", {
|
|
535
570
|
/* There is required contentEditable={true} in editor-card-plugin
|
|
@@ -541,8 +576,11 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
541
576
|
css: [tableContainerStyles, scrollableContainerHeight && scrollableContainerStyles],
|
|
542
577
|
style: scrollableContainerHeight ? {
|
|
543
578
|
maxHeight: "".concat(scrollableContainerHeight, "px")
|
|
544
|
-
} : undefined
|
|
545
|
-
|
|
579
|
+
} : undefined,
|
|
580
|
+
"data-testid": 'issue-like-table-container'
|
|
581
|
+
}, jsx(WidthObserver, {
|
|
582
|
+
setWidth: debounce(setTableContainerWidth, 100)
|
|
583
|
+
}), jsx(Table, {
|
|
546
584
|
css: tableStyles,
|
|
547
585
|
"data-testid": testId,
|
|
548
586
|
style: shouldUseWidth ? {
|
|
@@ -554,10 +592,10 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
554
592
|
className: !!onVisibleColumnKeysChange ? 'has-column-picker' : ''
|
|
555
593
|
}, jsx("tr", {
|
|
556
594
|
ref: tableHeaderRowRef
|
|
557
|
-
}, headerColumns.map(function (
|
|
558
|
-
var key =
|
|
559
|
-
content =
|
|
560
|
-
width =
|
|
595
|
+
}, headerColumns.map(function (_ref14, cellIndex) {
|
|
596
|
+
var key = _ref14.key,
|
|
597
|
+
content = _ref14.content,
|
|
598
|
+
width = _ref14.width;
|
|
561
599
|
var heading = jsx(Tooltip, {
|
|
562
600
|
content: content,
|
|
563
601
|
tag: "span",
|
|
@@ -574,10 +612,10 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
574
612
|
}
|
|
575
613
|
if (isEditable) {
|
|
576
614
|
var _containerRef$current3;
|
|
577
|
-
var previewRows = tableRows.map(function (
|
|
578
|
-
var cells =
|
|
579
|
-
var cell = cells.find(function (
|
|
580
|
-
var cellKey =
|
|
615
|
+
var previewRows = tableRows.map(function (_ref15) {
|
|
616
|
+
var cells = _ref15.cells;
|
|
617
|
+
var cell = cells.find(function (_ref16) {
|
|
618
|
+
var cellKey = _ref16.key;
|
|
581
619
|
return cellKey === key;
|
|
582
620
|
});
|
|
583
621
|
if (cell) {
|
|
@@ -619,18 +657,18 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
619
657
|
})))), jsx("tbody", {
|
|
620
658
|
css: noDefaultBorderStyles,
|
|
621
659
|
"data-testid": testId && "".concat(testId, "--body")
|
|
622
|
-
}, rows.map(function (
|
|
623
|
-
var key =
|
|
624
|
-
cells =
|
|
625
|
-
ref =
|
|
660
|
+
}, rows.map(function (_ref17) {
|
|
661
|
+
var key = _ref17.key,
|
|
662
|
+
cells = _ref17.cells,
|
|
663
|
+
ref = _ref17.ref;
|
|
626
664
|
return jsx("tr", {
|
|
627
665
|
key: key,
|
|
628
666
|
"data-testid": testId && "".concat(testId, "--row-").concat(key),
|
|
629
667
|
ref: ref
|
|
630
|
-
}, cells.map(function (
|
|
631
|
-
var cellKey =
|
|
632
|
-
content =
|
|
633
|
-
width =
|
|
668
|
+
}, cells.map(function (_ref18, cellIndex) {
|
|
669
|
+
var cellKey = _ref18.key,
|
|
670
|
+
content = _ref18.content,
|
|
671
|
+
width = _ref18.width;
|
|
634
672
|
var isLastCell = cellIndex === cells.length - 1;
|
|
635
673
|
var loadingRowStyle = getWidthCss({
|
|
636
674
|
shouldUseWidth: shouldUseWidth,
|
|
@@ -8,8 +8,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
8
8
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
9
9
|
import { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
var rootStyles = css({
|
|
11
|
-
position: 'relative'
|
|
12
|
-
display: 'block'
|
|
11
|
+
position: 'relative'
|
|
13
12
|
});
|
|
14
13
|
var smartLinkNodeToUrl = function smartLinkNodeToUrl(node) {
|
|
15
14
|
var _node$attrs$url;
|
|
@@ -46,7 +45,7 @@ var RichTextType = function RichTextType(_ref) {
|
|
|
46
45
|
return parseRichText(value);
|
|
47
46
|
}, [value]);
|
|
48
47
|
if (adfPlainText) {
|
|
49
|
-
return jsx("
|
|
48
|
+
return jsx("span", {
|
|
50
49
|
css: rootStyles,
|
|
51
50
|
"data-testid": "richtext-plaintext"
|
|
52
51
|
}, adfPlainText);
|
|
@@ -26,11 +26,19 @@ export var withTablePluginBodyPrefix = withTablePluginPrefix.bind(null, 'tbody')
|
|
|
26
26
|
export var TableHeading = styled.th((_styled$th = {}, _defineProperty(_styled$th, "".concat(withTablePluginHeaderPrefix()), {
|
|
27
27
|
border: 0,
|
|
28
28
|
position: 'relative',
|
|
29
|
+
/* This makes resizing work with out jumping due to padding + changes overall width for same default values. */
|
|
29
30
|
boxSizing: 'border-box',
|
|
30
31
|
lineHeight: lineHeight,
|
|
31
32
|
padding: "".concat(verticalPadding, " ", "var(--ds-space-050, 4px)"),
|
|
32
33
|
borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
33
34
|
borderBottom: "2px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
35
|
+
/*
|
|
36
|
+
lineHeight * 2 -> Max height of two lined header
|
|
37
|
+
verticalPadding * 2 -> padding for this component itself
|
|
38
|
+
verticalPadding * 2 -> padding inside span (--container)
|
|
39
|
+
2px -> Bottom border
|
|
40
|
+
Last two terms are needed because of border-box box sizing.
|
|
41
|
+
*/
|
|
34
42
|
height: "calc(".concat(lineHeight, " * 2 + ").concat(verticalPadding, " * 4 + 2px)"),
|
|
35
43
|
verticalAlign: 'bottom',
|
|
36
44
|
backgroundColor: "var(--ds-elevation-surface-current, #FFF)"
|
|
@@ -42,6 +50,9 @@ export var TableHeading = styled.th((_styled$th = {}, _defineProperty(_styled$th
|
|
|
42
50
|
borderRight: 0
|
|
43
51
|
}), _defineProperty(_styled$th, "& [data-testid='datasource-header-content--container']", {
|
|
44
52
|
width: '100%',
|
|
53
|
+
/* With Button now being a parent for this component it adds its lineHeight value and spoils
|
|
54
|
+
`height` calculation above. */
|
|
55
|
+
lineHeight: lineHeight,
|
|
45
56
|
padding: "".concat(verticalPadding, " ", "var(--ds-space-050, 4px)"),
|
|
46
57
|
display: '-webkit-box',
|
|
47
58
|
WebkitLineClamp: 2,
|
|
@@ -8,16 +8,23 @@ export var COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 3;
|
|
|
8
8
|
* or rather default width that should be treated as a maximum width. When table inserted initially
|
|
9
9
|
* and no user custom width defined we set this value to `false`. As soon as user changes any of the
|
|
10
10
|
* column widths we treat all width as custom hardcoded widths.
|
|
11
|
-
* @param width
|
|
11
|
+
* @param width Sometimes set to undefined for last column to make it occupy remainder of the table width
|
|
12
12
|
*/
|
|
13
13
|
export var getWidthCss = function getWidthCss(_ref) {
|
|
14
14
|
var shouldUseWidth = _ref.shouldUseWidth,
|
|
15
15
|
width = _ref.width;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
if (!width) {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
if (shouldUseWidth) {
|
|
20
|
+
return {
|
|
21
|
+
width: width
|
|
22
|
+
};
|
|
23
|
+
} else {
|
|
24
|
+
return {
|
|
25
|
+
maxWidth: width
|
|
26
|
+
};
|
|
27
|
+
}
|
|
21
28
|
};
|
|
22
29
|
|
|
23
30
|
/**
|
|
@@ -270,7 +270,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
270
270
|
// During insertion, we want the JQL of the datasource to be whatever is in the search bar,
|
|
271
271
|
// even if the user didn't previously click search
|
|
272
272
|
var upToDateJql = searchBarJql !== null && searchBarJql !== void 0 ? searchBarJql : jql;
|
|
273
|
-
var upToDateJqlUrl = selectedJiraSite && jql && "".concat(selectedJiraSite.url, "/issues/?jql=").concat(
|
|
273
|
+
var upToDateJqlUrl = selectedJiraSite && jql && "".concat(selectedJiraSite.url, "/issues/?jql=").concat(encodeURIComponent(upToDateJql));
|
|
274
274
|
var filterSelectionCount = availableBasicFilterTypes.reduce(function (current, filter) {
|
|
275
275
|
var _basicFilterSelection;
|
|
276
276
|
return _objectSpread(_objectSpread({}, current), {}, _defineProperty({}, "".concat(filter, "BasicFilterSelectionCount"), ((_basicFilterSelection = basicFilterSelectionsSearchedWith.current[filter]) === null || _basicFilterSelection === void 0 ? void 0 : _basicFilterSelection.length) || 0));
|
|
@@ -395,7 +395,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
395
395
|
if (responseItems.length === 1 && retrieveUrlForSmartCardRender()) {
|
|
396
396
|
url = retrieveUrlForSmartCardRender();
|
|
397
397
|
} else {
|
|
398
|
-
url = "".concat(selectedJiraSiteUrl, "/issues/?jql=").concat(
|
|
398
|
+
url = "".concat(selectedJiraSiteUrl, "/issues/?jql=").concat(encodeURIComponent(jql));
|
|
399
399
|
}
|
|
400
400
|
return jsx(SmartLink, {
|
|
401
401
|
url: url
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Datasource, DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
1
|
+
import { type Datasource, type DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
2
2
|
export declare const buildDatasourceAdf: <P extends Record<string, unknown>>(datasource: Datasource<P>, url?: string) => DatasourceAdf<P>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatasourceDataResponseItem, DatasourceMeta, DatasourceParameters, DatasourceResponseSchemaProperty, DatasourceTableStatusType } from '@atlaskit/linking-types';
|
|
1
|
+
import { type DatasourceDataResponseItem, type DatasourceMeta, type DatasourceParameters, type DatasourceResponseSchemaProperty, type DatasourceTableStatusType } from '@atlaskit/linking-types';
|
|
2
2
|
export interface onNextPageProps {
|
|
3
3
|
isSchemaFromData?: boolean;
|
|
4
4
|
shouldRequestFirstPage?: boolean;
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
export declare const DatasourceTableView: import("react").ForwardRefExoticComponent<{
|
|
3
3
|
datasourceId: string;
|
|
4
4
|
parameters: object;
|
|
5
|
-
fields?: string[] | undefined;
|
|
6
5
|
url?: string | undefined;
|
|
7
6
|
} & Partial<Pick<import("../issue-like-table/types").IssueLikeDataTableViewProps, "visibleColumnKeys" | "wrappedColumnKeys" | "columnCustomSizes" | "onVisibleColumnKeysChange" | "onColumnResize" | "onWrappedColumnChange">> & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { IssueLikeDataTableViewProps } from '../issue-like-table/types';
|
|
1
|
+
import { type IssueLikeDataTableViewProps } from '../issue-like-table/types';
|
|
2
2
|
export type DatasourceTableViewProps = {
|
|
3
3
|
/** Unique identifier for which type of datasource is being rendered and for making its requests */
|
|
4
4
|
datasourceId: string;
|
|
5
5
|
/** Parameters for making the data requests necessary to render data within the table */
|
|
6
6
|
parameters: object;
|
|
7
|
-
fields?: string[];
|
|
8
7
|
/** Url for an existing datasource, initially used for displaying to a user unauthorized to query that site */
|
|
9
8
|
url?: string;
|
|
10
9
|
} & Partial<Pick<IssueLikeDataTableViewProps, 'visibleColumnKeys' | 'onVisibleColumnKeysChange' | 'wrappedColumnKeys' | 'onWrappedColumnChange' | 'onColumnResize' | 'columnCustomSizes'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
interface DraggableTableHeadingProps {
|
|
5
5
|
children: ReactNode;
|
|
@@ -8,7 +8,7 @@ interface DraggableTableHeadingProps {
|
|
|
8
8
|
tableId: symbol;
|
|
9
9
|
dndPreviewHeight: number;
|
|
10
10
|
dragPreview: React.ReactNode;
|
|
11
|
-
width
|
|
11
|
+
width?: number;
|
|
12
12
|
onWidthChange?: (width: number) => void;
|
|
13
13
|
isWrapped?: boolean;
|
|
14
14
|
onIsWrappedChange?: (shouldWrap: boolean) => void;
|
|
@@ -4,7 +4,7 @@ export declare const COLUMN_BASE_WIDTH = 8;
|
|
|
4
4
|
export declare const COLUMN_MIN_WIDTH: number;
|
|
5
5
|
export type GetWidthCss = (arg: {
|
|
6
6
|
shouldUseWidth: boolean;
|
|
7
|
-
width
|
|
7
|
+
width?: number;
|
|
8
8
|
}) => React.CSSProperties;
|
|
9
9
|
/**
|
|
10
10
|
* Generate width related portion of css for table cell.
|
|
@@ -13,7 +13,7 @@ export type GetWidthCss = (arg: {
|
|
|
13
13
|
* or rather default width that should be treated as a maximum width. When table inserted initially
|
|
14
14
|
* and no user custom width defined we set this value to `false`. As soon as user changes any of the
|
|
15
15
|
* column widths we treat all width as custom hardcoded widths.
|
|
16
|
-
* @param width
|
|
16
|
+
* @param width Sometimes set to undefined for last column to make it occupy remainder of the table width
|
|
17
17
|
*/
|
|
18
18
|
export declare const getWidthCss: GetWidthCss;
|
|
19
19
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Datasource, DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
1
|
+
import { type Datasource, type DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
2
2
|
export declare const buildDatasourceAdf: <P extends Record<string, unknown>>(datasource: Datasource<P>, url?: string) => DatasourceAdf<P>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatasourceDataResponseItem, DatasourceMeta, DatasourceParameters, DatasourceResponseSchemaProperty, DatasourceTableStatusType } from '@atlaskit/linking-types';
|
|
1
|
+
import { type DatasourceDataResponseItem, type DatasourceMeta, type DatasourceParameters, type DatasourceResponseSchemaProperty, type DatasourceTableStatusType } from '@atlaskit/linking-types';
|
|
2
2
|
export interface onNextPageProps {
|
|
3
3
|
isSchemaFromData?: boolean;
|
|
4
4
|
shouldRequestFirstPage?: boolean;
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
export declare const DatasourceTableView: import("react").ForwardRefExoticComponent<{
|
|
3
3
|
datasourceId: string;
|
|
4
4
|
parameters: object;
|
|
5
|
-
fields?: string[] | undefined;
|
|
6
5
|
url?: string | undefined;
|
|
7
6
|
} & Partial<Pick<import("../issue-like-table/types").IssueLikeDataTableViewProps, "visibleColumnKeys" | "wrappedColumnKeys" | "columnCustomSizes" | "onVisibleColumnKeysChange" | "onColumnResize" | "onWrappedColumnChange">> & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { IssueLikeDataTableViewProps } from '../issue-like-table/types';
|
|
1
|
+
import { type IssueLikeDataTableViewProps } from '../issue-like-table/types';
|
|
2
2
|
export type DatasourceTableViewProps = {
|
|
3
3
|
/** Unique identifier for which type of datasource is being rendered and for making its requests */
|
|
4
4
|
datasourceId: string;
|
|
5
5
|
/** Parameters for making the data requests necessary to render data within the table */
|
|
6
6
|
parameters: object;
|
|
7
|
-
fields?: string[];
|
|
8
7
|
/** Url for an existing datasource, initially used for displaying to a user unauthorized to query that site */
|
|
9
8
|
url?: string;
|
|
10
9
|
} & Partial<Pick<IssueLikeDataTableViewProps, 'visibleColumnKeys' | 'onVisibleColumnKeysChange' | 'wrappedColumnKeys' | 'onWrappedColumnChange' | 'onColumnResize' | 'columnCustomSizes'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
interface DraggableTableHeadingProps {
|
|
5
5
|
children: ReactNode;
|
|
@@ -8,7 +8,7 @@ interface DraggableTableHeadingProps {
|
|
|
8
8
|
tableId: symbol;
|
|
9
9
|
dndPreviewHeight: number;
|
|
10
10
|
dragPreview: React.ReactNode;
|
|
11
|
-
width
|
|
11
|
+
width?: number;
|
|
12
12
|
onWidthChange?: (width: number) => void;
|
|
13
13
|
isWrapped?: boolean;
|
|
14
14
|
onIsWrappedChange?: (shouldWrap: boolean) => void;
|
|
@@ -4,7 +4,7 @@ export declare const COLUMN_BASE_WIDTH = 8;
|
|
|
4
4
|
export declare const COLUMN_MIN_WIDTH: number;
|
|
5
5
|
export type GetWidthCss = (arg: {
|
|
6
6
|
shouldUseWidth: boolean;
|
|
7
|
-
width
|
|
7
|
+
width?: number;
|
|
8
8
|
}) => React.CSSProperties;
|
|
9
9
|
/**
|
|
10
10
|
* Generate width related portion of css for table cell.
|
|
@@ -13,7 +13,7 @@ export type GetWidthCss = (arg: {
|
|
|
13
13
|
* or rather default width that should be treated as a maximum width. When table inserted initially
|
|
14
14
|
* and no user custom width defined we set this value to `false`. As soon as user changes any of the
|
|
15
15
|
* column widths we treat all width as custom hardcoded widths.
|
|
16
|
-
* @param width
|
|
16
|
+
* @param width Sometimes set to undefined for last column to make it occupy remainder of the table width
|
|
17
17
|
*/
|
|
18
18
|
export declare const getWidthCss: GetWidthCss;
|
|
19
19
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,13 +26,16 @@
|
|
|
26
26
|
"team": "Linking Platform",
|
|
27
27
|
"inPublicMirror": false,
|
|
28
28
|
"releaseModel": "continuous",
|
|
29
|
-
"i18n": true
|
|
29
|
+
"i18n": true,
|
|
30
|
+
"website": {
|
|
31
|
+
"name": "Link Datasource"
|
|
32
|
+
}
|
|
30
33
|
},
|
|
31
34
|
"scripts": {
|
|
32
35
|
"analytics:codegen": "yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource --output ./src/analytics/generated"
|
|
33
36
|
},
|
|
34
37
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^36.
|
|
38
|
+
"@atlaskit/adf-schema": "^36.8.0",
|
|
36
39
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
40
|
"@atlaskit/avatar": "^21.8.0",
|
|
38
41
|
"@atlaskit/avatar-group": "^9.6.0",
|
|
@@ -44,7 +47,7 @@
|
|
|
44
47
|
"@atlaskit/empty-state": "^7.8.0",
|
|
45
48
|
"@atlaskit/form": "^10.1.0",
|
|
46
49
|
"@atlaskit/heading": "^2.3.0",
|
|
47
|
-
"@atlaskit/icon": "^22.
|
|
50
|
+
"@atlaskit/icon": "^22.3.0",
|
|
48
51
|
"@atlaskit/icon-object": "^6.4.0",
|
|
49
52
|
"@atlaskit/image": "^1.2.0",
|
|
50
53
|
"@atlaskit/intl-messages-provider": "^1.0.0",
|
|
@@ -52,7 +55,7 @@
|
|
|
52
55
|
"@atlaskit/jql-editor": "^4.3.0",
|
|
53
56
|
"@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
|
|
54
57
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
55
|
-
"@atlaskit/linking-common": "^5.
|
|
58
|
+
"@atlaskit/linking-common": "^5.7.0",
|
|
56
59
|
"@atlaskit/linking-types": "^8.8.0",
|
|
57
60
|
"@atlaskit/logo": "^13.17.0",
|
|
58
61
|
"@atlaskit/lozenge": "^11.7.0",
|
|
@@ -64,15 +67,15 @@
|
|
|
64
67
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
65
68
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^1.1.0",
|
|
66
69
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
67
|
-
"@atlaskit/primitives": "^6.
|
|
70
|
+
"@atlaskit/primitives": "^6.3.0",
|
|
68
71
|
"@atlaskit/select": "^17.9.0",
|
|
69
|
-
"@atlaskit/smart-card": "^26.
|
|
72
|
+
"@atlaskit/smart-card": "^26.69.0",
|
|
70
73
|
"@atlaskit/smart-user-picker": "6.9.3",
|
|
71
74
|
"@atlaskit/spinner": "^16.1.0",
|
|
72
75
|
"@atlaskit/tag": "^12.2.0",
|
|
73
76
|
"@atlaskit/textfield": "6.3.1",
|
|
74
77
|
"@atlaskit/theme": "^12.8.0",
|
|
75
|
-
"@atlaskit/tokens": "^1.
|
|
78
|
+
"@atlaskit/tokens": "^1.49.0",
|
|
76
79
|
"@atlaskit/tooltip": "^18.4.0",
|
|
77
80
|
"@atlaskit/ufo": "^0.2.4",
|
|
78
81
|
"@atlaskit/width-detector": "^4.2.0",
|
|
@@ -138,6 +141,9 @@
|
|
|
138
141
|
"styling": [
|
|
139
142
|
"static",
|
|
140
143
|
"emotion"
|
|
144
|
+
],
|
|
145
|
+
"imports": [
|
|
146
|
+
"import-no-extraneous-disable-for-examples-and-docs"
|
|
141
147
|
]
|
|
142
148
|
}
|
|
143
149
|
},
|
|
@@ -159,12 +165,6 @@
|
|
|
159
165
|
"platform.linking-platform.datasources.enable-sentry-client": {
|
|
160
166
|
"type": "boolean"
|
|
161
167
|
},
|
|
162
|
-
"platform.linking-platform.datasource.enable-abort-controller": {
|
|
163
|
-
"type": "boolean"
|
|
164
|
-
},
|
|
165
|
-
"platform.linking-platform.datasource.enable-stricter-jql-encoding": {
|
|
166
|
-
"type": "boolean"
|
|
167
|
-
},
|
|
168
168
|
"platform.editor-update-tag-link-and-color_x6hcf": {
|
|
169
169
|
"type": "boolean"
|
|
170
170
|
}
|