@react-spectrum/table 3.8.1-nightly.3854 → 3.8.1-nightly.3863
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/dist/import.mjs +15 -33
- package/dist/main.css +1 -1
- package/dist/main.js +15 -33
- package/dist/main.js.map +1 -1
- package/dist/module.js +15 -33
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +31 -31
- package/src/DragPreview.tsx +31 -64
- package/src/TableView.tsx +6 -4
- package/src/table.css +6 -0
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AKmIA,oCAAoC,CAAC,CAAE,SAAQ,WAAW,CAAC,CAAC,EAAE,sBAAsB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU;IAC3H;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAC7C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACnC,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,MAAM,IAAI,OAAO,CAAC;IACrC,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACvD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAClD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACrD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB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["packages/@react-spectrum/table/src/packages/@react-spectrum/table/src/InsertionIndicator.tsx","packages/@react-spectrum/table/src/packages/@react-spectrum/table/src/Nubbin.tsx","packages/@react-spectrum/table/src/packages/@react-spectrum/table/src/Resizer.tsx","packages/@react-spectrum/table/src/packages/@react-spectrum/table/src/RootDropIndicator.tsx","packages/@react-spectrum/table/src/packages/@react-spectrum/table/src/DragPreview.tsx","packages/@react-spectrum/table/src/packages/@react-spectrum/table/src/TableView.tsx","packages/@react-spectrum/table/src/packages/@react-spectrum/table/src/index.ts","packages/@react-spectrum/table/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {TableView} from './TableView';\nimport {Column} from '@react-stately/table';\nimport {SpectrumColumnProps} from '@react-types/table';\n\n// Override TS for Column to support spectrum specific props.\nconst SpectrumColumn = Column as <T>(props: SpectrumColumnProps<T>) => JSX.Element;\nexport {SpectrumColumn as Column};\n\nexport {\n TableHeader,\n TableBody,\n Section,\n Row,\n Cell\n} from '@react-stately/table';\n\nexport type {SpectrumColumnProps, TableHeaderProps, TableBodyProps, RowProps, CellProps} from '@react-types/table';\nexport type {SpectrumTableProps} from './TableView';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/table",
|
|
3
|
-
"version": "3.8.1-nightly.
|
|
3
|
+
"version": "3.8.1-nightly.3863+424432c83",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,38 +36,38 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/button": "3.0.0-nightly.
|
|
40
|
-
"@react-aria/focus": "3.0.0-nightly.
|
|
41
|
-
"@react-aria/grid": "3.7.1-nightly.
|
|
42
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
43
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
44
|
-
"@react-aria/table": "3.9.1-nightly.
|
|
45
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
46
|
-
"@react-aria/virtualizer": "3.8.1-nightly.
|
|
47
|
-
"@react-aria/visually-hidden": "3.0.0-nightly.
|
|
48
|
-
"@react-spectrum/button": "3.0.0-nightly.
|
|
49
|
-
"@react-spectrum/checkbox": "3.0.0-nightly.
|
|
50
|
-
"@react-spectrum/dnd": "3.1.2-nightly.
|
|
51
|
-
"@react-spectrum/layout": "3.5.2-nightly.
|
|
52
|
-
"@react-spectrum/menu": "3.11.1-nightly.
|
|
53
|
-
"@react-spectrum/progress": "3.0.0-nightly.
|
|
54
|
-
"@react-spectrum/tooltip": "3.0.0-nightly.
|
|
55
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
|
56
|
-
"@react-stately/collections": "3.0.0-nightly.
|
|
57
|
-
"@react-stately/grid": "3.6.1-nightly.
|
|
58
|
-
"@react-stately/layout": "3.12.1-nightly.
|
|
59
|
-
"@react-stately/table": "3.9.1-nightly.
|
|
60
|
-
"@react-stately/virtualizer": "3.5.2-nightly.
|
|
61
|
-
"@react-types/grid": "3.1.8-nightly.
|
|
62
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
63
|
-
"@react-types/table": "3.6.1-nightly.
|
|
64
|
-
"@spectrum-icons/ui": "3.0.0-nightly.
|
|
39
|
+
"@react-aria/button": "3.0.0-nightly.2161+424432c83",
|
|
40
|
+
"@react-aria/focus": "3.0.0-nightly.2161+424432c83",
|
|
41
|
+
"@react-aria/grid": "3.7.1-nightly.3863+424432c83",
|
|
42
|
+
"@react-aria/i18n": "3.0.0-nightly.2161+424432c83",
|
|
43
|
+
"@react-aria/interactions": "3.0.0-nightly.2161+424432c83",
|
|
44
|
+
"@react-aria/table": "3.9.1-nightly.3863+424432c83",
|
|
45
|
+
"@react-aria/utils": "3.0.0-nightly.2161+424432c83",
|
|
46
|
+
"@react-aria/virtualizer": "3.8.1-nightly.3863+424432c83",
|
|
47
|
+
"@react-aria/visually-hidden": "3.0.0-nightly.2161+424432c83",
|
|
48
|
+
"@react-spectrum/button": "3.0.0-nightly.2161+424432c83",
|
|
49
|
+
"@react-spectrum/checkbox": "3.0.0-nightly.2161+424432c83",
|
|
50
|
+
"@react-spectrum/dnd": "3.1.2-nightly.3863+424432c83",
|
|
51
|
+
"@react-spectrum/layout": "3.5.2-nightly.3863+424432c83",
|
|
52
|
+
"@react-spectrum/menu": "3.11.1-nightly.3863+424432c83",
|
|
53
|
+
"@react-spectrum/progress": "3.0.0-nightly.2161+424432c83",
|
|
54
|
+
"@react-spectrum/tooltip": "3.0.0-nightly.2161+424432c83",
|
|
55
|
+
"@react-spectrum/utils": "3.0.0-nightly.2161+424432c83",
|
|
56
|
+
"@react-stately/collections": "3.0.0-nightly.2161+424432c83",
|
|
57
|
+
"@react-stately/grid": "3.6.1-nightly.3863+424432c83",
|
|
58
|
+
"@react-stately/layout": "3.12.1-nightly.3863+424432c83",
|
|
59
|
+
"@react-stately/table": "3.9.1-nightly.3863+424432c83",
|
|
60
|
+
"@react-stately/virtualizer": "3.5.2-nightly.3863+424432c83",
|
|
61
|
+
"@react-types/grid": "3.1.8-nightly.3863+424432c83",
|
|
62
|
+
"@react-types/shared": "3.0.0-nightly.2161+424432c83",
|
|
63
|
+
"@react-types/table": "3.6.1-nightly.3863+424432c83",
|
|
64
|
+
"@spectrum-icons/ui": "3.0.0-nightly.2161+424432c83",
|
|
65
65
|
"@swc/helpers": "^0.4.14"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
|
69
|
-
"@react-aria/dnd": "3.2.1-nightly.
|
|
70
|
-
"@react-stately/dnd": "3.2.1-nightly.
|
|
68
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.2161+424432c83",
|
|
69
|
+
"@react-aria/dnd": "3.2.1-nightly.3863+424432c83",
|
|
70
|
+
"@react-stately/dnd": "3.2.1-nightly.3863+424432c83"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@react-spectrum/provider": "^3.0.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "424432c832b5e16296e11e2c36aa23165a4812aa"
|
|
81
81
|
}
|
package/src/DragPreview.tsx
CHANGED
|
@@ -11,77 +11,31 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {classNames} from '@react-spectrum/utils';
|
|
14
|
-
import {Direction, Node} from '@react-types/shared';
|
|
15
14
|
import {Flex} from '@react-spectrum/layout';
|
|
16
|
-
import {GridNode} from '@react-types/grid';
|
|
17
15
|
import React from 'react';
|
|
18
|
-
import type {SpectrumTableProps} from './TableView';
|
|
19
16
|
import styles from '@adobe/spectrum-css-temp/components/table/vars.css';
|
|
20
17
|
import stylesOverrides from './table.css';
|
|
21
|
-
import type {TableLayout} from '@react-stately/layout';
|
|
22
18
|
|
|
23
|
-
interface DragPreviewProps
|
|
24
|
-
|
|
25
|
-
children: Iterable<Node<T>>,
|
|
19
|
+
interface DragPreviewProps {
|
|
20
|
+
itemText: string,
|
|
26
21
|
itemCount: number,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
direction: Direction,
|
|
30
|
-
maxWidth: number,
|
|
31
|
-
rowHeaderColumnKeys: Set<React.Key>
|
|
22
|
+
height: number,
|
|
23
|
+
maxWidth: number
|
|
32
24
|
}
|
|
33
25
|
|
|
34
|
-
|
|
35
|
-
cell: GridNode<any>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function TableCellPreview(props: TableCellPreviewProps) {
|
|
39
|
-
let {cell} = props;
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<div
|
|
43
|
-
className={
|
|
44
|
-
classNames(
|
|
45
|
-
styles,
|
|
46
|
-
'spectrum-Table-cell',
|
|
47
|
-
classNames(
|
|
48
|
-
stylesOverrides,
|
|
49
|
-
'react-spectrum-Table-cell'
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
}>
|
|
53
|
-
<span
|
|
54
|
-
className={
|
|
55
|
-
classNames(
|
|
56
|
-
styles,
|
|
57
|
-
'spectrum-Table-cellContents'
|
|
58
|
-
)
|
|
59
|
-
}>
|
|
60
|
-
{cell.rendered}
|
|
61
|
-
</span>
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function DragPreview(props: DragPreviewProps<unknown>) {
|
|
26
|
+
export function DragPreview(props: DragPreviewProps) {
|
|
67
27
|
let {
|
|
68
|
-
|
|
69
|
-
children,
|
|
28
|
+
itemText,
|
|
70
29
|
itemCount,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
maxWidth,
|
|
74
|
-
rowHeaderColumnKeys
|
|
30
|
+
height,
|
|
31
|
+
maxWidth
|
|
75
32
|
} = props;
|
|
76
|
-
let {height} = layout.getLayoutInfo(item.key).rect;
|
|
77
33
|
let isDraggingMultiple = itemCount > 1;
|
|
78
|
-
// @ts-ignore
|
|
79
|
-
let cells = [...children].filter(cell => rowHeaderColumnKeys.has(cell.column.key));
|
|
80
|
-
|
|
81
34
|
return (
|
|
82
35
|
<Flex
|
|
83
36
|
justifyContent="space-between"
|
|
84
|
-
|
|
37
|
+
height={height}
|
|
38
|
+
maxWidth={maxWidth}
|
|
85
39
|
UNSAFE_className={
|
|
86
40
|
classNames(
|
|
87
41
|
styles,
|
|
@@ -90,17 +44,30 @@ export function DragPreview(props: DragPreviewProps<unknown>) {
|
|
|
90
44
|
stylesOverrides,
|
|
91
45
|
'react-spectrum-Table-row',
|
|
92
46
|
'react-spectrum-Table-row-dragPreview',
|
|
93
|
-
{'react-spectrum-Table-row-dragPreview--multiple': isDraggingMultiple}
|
|
94
|
-
|
|
47
|
+
{'react-spectrum-Table-row-dragPreview--multiple': isDraggingMultiple}
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
}>
|
|
51
|
+
<div
|
|
52
|
+
className={
|
|
53
|
+
classNames(
|
|
54
|
+
styles,
|
|
55
|
+
'spectrum-Table-cell',
|
|
56
|
+
classNames(
|
|
57
|
+
stylesOverrides,
|
|
58
|
+
'react-spectrum-Table-cell'
|
|
95
59
|
)
|
|
96
60
|
)
|
|
97
61
|
}>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
62
|
+
<span
|
|
63
|
+
className={
|
|
64
|
+
classNames(
|
|
65
|
+
styles,
|
|
66
|
+
'spectrum-Table-cellContents'
|
|
67
|
+
)
|
|
68
|
+
}>
|
|
69
|
+
{itemText}
|
|
70
|
+
</span>
|
|
104
71
|
</div>
|
|
105
72
|
{isDraggingMultiple &&
|
|
106
73
|
<div className={classNames(stylesOverrides, 'react-spectrum-Table-row-badge')}>{itemCount}</div>
|
package/src/TableView.tsx
CHANGED
|
@@ -562,12 +562,14 @@ function TableView<T extends object>(props: SpectrumTableProps<T>, ref: DOMRef<H
|
|
|
562
562
|
{DragPreview && isTableDraggable &&
|
|
563
563
|
<DragPreview ref={preview}>
|
|
564
564
|
{() => {
|
|
565
|
-
|
|
566
|
-
|
|
565
|
+
if (dragAndDropHooks.renderPreview) {
|
|
566
|
+
return dragAndDropHooks.renderPreview(dragState.draggingKeys, dragState.draggedKey);
|
|
567
|
+
}
|
|
567
568
|
let itemCount = dragState.draggingKeys.size;
|
|
568
569
|
let maxWidth = bodyRef.current.getBoundingClientRect().width;
|
|
569
|
-
let
|
|
570
|
-
|
|
570
|
+
let height = ROW_HEIGHTS[density][scale];
|
|
571
|
+
let itemText = state.collection.getTextValue(dragState.draggedKey);
|
|
572
|
+
return <SpectrumDragPreview itemText={itemText} itemCount={itemCount} height={height} maxWidth={maxWidth} />;
|
|
571
573
|
}}
|
|
572
574
|
</DragPreview>
|
|
573
575
|
}
|
package/src/table.css
CHANGED