@react-stately/layout 3.12.3-nightly.4028 → 3.12.3-nightly.4038
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 +30 -17
- package/dist/main.js +30 -17
- package/dist/main.js.map +1 -1
- package/dist/module.js +30 -17
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/ListLayout.ts +2 -1
- package/src/TableLayout.ts +28 -24
package/dist/import.mjs
CHANGED
|
@@ -527,6 +527,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
527
527
|
layoutNode.layoutInfo.parentKey = "header";
|
|
528
528
|
y = layoutNode.layoutInfo.rect.maxY;
|
|
529
529
|
width = Math.max(width, layoutNode.layoutInfo.rect.width);
|
|
530
|
+
layoutNode.index = children.length;
|
|
530
531
|
children.push(layoutNode);
|
|
531
532
|
}
|
|
532
533
|
rect.width = width;
|
|
@@ -548,6 +549,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
548
549
|
layoutNode.layoutInfo.parentKey = row.key;
|
|
549
550
|
x = layoutNode.layoutInfo.rect.maxX;
|
|
550
551
|
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
552
|
+
layoutNode.index = columns.length;
|
|
551
553
|
columns.push(layoutNode);
|
|
552
554
|
}
|
|
553
555
|
for (let [i, layout] of columns.entries())layout.layoutInfo.zIndex = columns.length - i + 1;
|
|
@@ -623,7 +625,9 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
623
625
|
let skipped = 0;
|
|
624
626
|
let width = 0;
|
|
625
627
|
let children = [];
|
|
626
|
-
for (let node of
|
|
628
|
+
for (let [i, node] of [
|
|
629
|
+
...this.collection
|
|
630
|
+
].entries()){
|
|
627
631
|
var _this_rowHeight;
|
|
628
632
|
let rowHeight = ((_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) + 1;
|
|
629
633
|
// Skip rows before the valid rectangle unless they are already cached.
|
|
@@ -634,6 +638,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
634
638
|
}
|
|
635
639
|
let layoutNode = this.buildChild(node, 0, y);
|
|
636
640
|
layoutNode.layoutInfo.parentKey = "body";
|
|
641
|
+
layoutNode.index = i;
|
|
637
642
|
y = layoutNode.layoutInfo.rect.maxY;
|
|
638
643
|
width = Math.max(width, layoutNode.layoutInfo.rect.width);
|
|
639
644
|
children.push(layoutNode);
|
|
@@ -698,19 +703,24 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
698
703
|
let layoutInfo = new (0, $gtW1T$LayoutInfo)("row", node.key, rect);
|
|
699
704
|
let children = [];
|
|
700
705
|
let height = 0;
|
|
701
|
-
for (let child of
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
706
|
+
for (let [i, child] of [
|
|
707
|
+
...(0, $gtW1T$getChildNodes)(node, this.collection)
|
|
708
|
+
].entries())if (child.type === "cell") {
|
|
709
|
+
if (x > this.validRect.maxX) {
|
|
710
|
+
// Adjust existing cached layoutInfo to ensure that it is out of view.
|
|
711
|
+
// This can happen due to column resizing.
|
|
712
|
+
let layoutNode = this.layoutNodes.get(child.key);
|
|
713
|
+
if (layoutNode) {
|
|
714
|
+
layoutNode.layoutInfo.rect.x = x;
|
|
715
|
+
x += layoutNode.layoutInfo.rect.width;
|
|
716
|
+
}
|
|
717
|
+
} else {
|
|
718
|
+
let layoutNode = this.buildChild(child, x, y);
|
|
719
|
+
x = layoutNode.layoutInfo.rect.maxX;
|
|
720
|
+
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
721
|
+
layoutNode.index = i;
|
|
722
|
+
children.push(layoutNode);
|
|
708
723
|
}
|
|
709
|
-
} else {
|
|
710
|
-
let layoutNode = this.buildChild(child, x, y);
|
|
711
|
-
x = layoutNode.layoutInfo.rect.maxX;
|
|
712
|
-
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
713
|
-
children.push(layoutNode);
|
|
714
724
|
}
|
|
715
725
|
this.setChildHeights(children, height);
|
|
716
726
|
rect.width = this.layoutInfos.get("header").rect.width;
|
|
@@ -847,8 +857,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
847
857
|
] : [];
|
|
848
858
|
this.persistedIndices.set(layoutInfo.parentKey, indices);
|
|
849
859
|
}
|
|
850
|
-
let index =
|
|
851
|
-
if (layoutInfo.parentKey === "body") index -= this.collection.headerRows.length;
|
|
860
|
+
let index = this.layoutNodes.get(layoutInfo.key).index;
|
|
852
861
|
if (!indices.includes(index)) indices.push(index);
|
|
853
862
|
layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);
|
|
854
863
|
}
|
|
@@ -857,8 +866,12 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
857
866
|
}
|
|
858
867
|
getInitialLayoutInfo(layoutInfo) {
|
|
859
868
|
let res = super.getInitialLayoutInfo(layoutInfo);
|
|
860
|
-
|
|
861
|
-
|
|
869
|
+
res.transform = null;
|
|
870
|
+
return res;
|
|
871
|
+
}
|
|
872
|
+
getFinalLayoutInfo(layoutInfo) {
|
|
873
|
+
let res = super.getFinalLayoutInfo(layoutInfo);
|
|
874
|
+
res.transform = null;
|
|
862
875
|
return res;
|
|
863
876
|
}
|
|
864
877
|
// Checks if Chrome version is 105 or greater
|
package/dist/main.js
CHANGED
|
@@ -533,6 +533,7 @@ class $67c493497dcda343$export$62444c3c724b1b20 extends (0, $fe69e47e38ed0ac4$ex
|
|
|
533
533
|
layoutNode.layoutInfo.parentKey = "header";
|
|
534
534
|
y = layoutNode.layoutInfo.rect.maxY;
|
|
535
535
|
width = Math.max(width, layoutNode.layoutInfo.rect.width);
|
|
536
|
+
layoutNode.index = children.length;
|
|
536
537
|
children.push(layoutNode);
|
|
537
538
|
}
|
|
538
539
|
rect.width = width;
|
|
@@ -554,6 +555,7 @@ class $67c493497dcda343$export$62444c3c724b1b20 extends (0, $fe69e47e38ed0ac4$ex
|
|
|
554
555
|
layoutNode.layoutInfo.parentKey = row.key;
|
|
555
556
|
x = layoutNode.layoutInfo.rect.maxX;
|
|
556
557
|
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
558
|
+
layoutNode.index = columns.length;
|
|
557
559
|
columns.push(layoutNode);
|
|
558
560
|
}
|
|
559
561
|
for (let [i, layout] of columns.entries())layout.layoutInfo.zIndex = columns.length - i + 1;
|
|
@@ -629,7 +631,9 @@ class $67c493497dcda343$export$62444c3c724b1b20 extends (0, $fe69e47e38ed0ac4$ex
|
|
|
629
631
|
let skipped = 0;
|
|
630
632
|
let width = 0;
|
|
631
633
|
let children = [];
|
|
632
|
-
for (let node of
|
|
634
|
+
for (let [i, node] of [
|
|
635
|
+
...this.collection
|
|
636
|
+
].entries()){
|
|
633
637
|
var _this_rowHeight;
|
|
634
638
|
let rowHeight = ((_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) + 1;
|
|
635
639
|
// Skip rows before the valid rectangle unless they are already cached.
|
|
@@ -640,6 +644,7 @@ class $67c493497dcda343$export$62444c3c724b1b20 extends (0, $fe69e47e38ed0ac4$ex
|
|
|
640
644
|
}
|
|
641
645
|
let layoutNode = this.buildChild(node, 0, y);
|
|
642
646
|
layoutNode.layoutInfo.parentKey = "body";
|
|
647
|
+
layoutNode.index = i;
|
|
643
648
|
y = layoutNode.layoutInfo.rect.maxY;
|
|
644
649
|
width = Math.max(width, layoutNode.layoutInfo.rect.width);
|
|
645
650
|
children.push(layoutNode);
|
|
@@ -704,19 +709,24 @@ class $67c493497dcda343$export$62444c3c724b1b20 extends (0, $fe69e47e38ed0ac4$ex
|
|
|
704
709
|
let layoutInfo = new (0, $cMJQZ$reactstatelyvirtualizer.LayoutInfo)("row", node.key, rect);
|
|
705
710
|
let children = [];
|
|
706
711
|
let height = 0;
|
|
707
|
-
for (let child of
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
712
|
+
for (let [i, child] of [
|
|
713
|
+
...(0, $cMJQZ$reactstatelycollections.getChildNodes)(node, this.collection)
|
|
714
|
+
].entries())if (child.type === "cell") {
|
|
715
|
+
if (x > this.validRect.maxX) {
|
|
716
|
+
// Adjust existing cached layoutInfo to ensure that it is out of view.
|
|
717
|
+
// This can happen due to column resizing.
|
|
718
|
+
let layoutNode = this.layoutNodes.get(child.key);
|
|
719
|
+
if (layoutNode) {
|
|
720
|
+
layoutNode.layoutInfo.rect.x = x;
|
|
721
|
+
x += layoutNode.layoutInfo.rect.width;
|
|
722
|
+
}
|
|
723
|
+
} else {
|
|
724
|
+
let layoutNode = this.buildChild(child, x, y);
|
|
725
|
+
x = layoutNode.layoutInfo.rect.maxX;
|
|
726
|
+
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
727
|
+
layoutNode.index = i;
|
|
728
|
+
children.push(layoutNode);
|
|
714
729
|
}
|
|
715
|
-
} else {
|
|
716
|
-
let layoutNode = this.buildChild(child, x, y);
|
|
717
|
-
x = layoutNode.layoutInfo.rect.maxX;
|
|
718
|
-
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
719
|
-
children.push(layoutNode);
|
|
720
730
|
}
|
|
721
731
|
this.setChildHeights(children, height);
|
|
722
732
|
rect.width = this.layoutInfos.get("header").rect.width;
|
|
@@ -853,8 +863,7 @@ class $67c493497dcda343$export$62444c3c724b1b20 extends (0, $fe69e47e38ed0ac4$ex
|
|
|
853
863
|
] : [];
|
|
854
864
|
this.persistedIndices.set(layoutInfo.parentKey, indices);
|
|
855
865
|
}
|
|
856
|
-
let index =
|
|
857
|
-
if (layoutInfo.parentKey === "body") index -= this.collection.headerRows.length;
|
|
866
|
+
let index = this.layoutNodes.get(layoutInfo.key).index;
|
|
858
867
|
if (!indices.includes(index)) indices.push(index);
|
|
859
868
|
layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);
|
|
860
869
|
}
|
|
@@ -863,8 +872,12 @@ class $67c493497dcda343$export$62444c3c724b1b20 extends (0, $fe69e47e38ed0ac4$ex
|
|
|
863
872
|
}
|
|
864
873
|
getInitialLayoutInfo(layoutInfo) {
|
|
865
874
|
let res = super.getInitialLayoutInfo(layoutInfo);
|
|
866
|
-
|
|
867
|
-
|
|
875
|
+
res.transform = null;
|
|
876
|
+
return res;
|
|
877
|
+
}
|
|
878
|
+
getFinalLayoutInfo(layoutInfo) {
|
|
879
|
+
let res = super.getFinalLayoutInfo(layoutInfo);
|
|
880
|
+
res.transform = null;
|
|
868
881
|
return res;
|
|
869
882
|
}
|
|
870
883
|
// Checks if Chrome version is 105 or greater
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AA+BD,MAAM,uCAAiB;AAYhB,MAAM,kDAAsB,CAAA,GAAA,qCAAK;IAkDtC,cAAc,GAAQ,EAAE;QACtB,IAAI,MAAM,IAAI,CAAC,YAAY,IAAI;QAE/B,yFAAyF;QACzF,kGAAkG;QAClG,yCAAyC;QACzC,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,OAAO,IAAI,CAAC,YAAY,QAAQ,IAAI,CAAC,gBAAgB;YAC9E,IAAI,CAAC,gBAAgB,IAAI,CAAC;YAC1B,IAAI,CAAC,YAAY,IAAI,CAAA,GAAA,mCAAG,EAAE,GAAG,GAAG,UAAU;YAC1C,IAAI,CAAC,YAAY,IAAI,CAAC;YACtB,IAAI,CAAC,YAAY,IAAI,CAAA,GAAA,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,WAAW;QACtB,IAAI,SAAqB;YACvB,MAAM;YACN,KAAK,WAAW;YAChB,cAAc;QAChB;QAEA,sGAAsG;QACtG,sGAAsG;QACtG,oCAAoC;QACpC,IAAI,CAAC,kBAAkB,SAAS;YAC9B,IAAI,KAAK,KAAK,IAAI,KAAK,SAAS,KAAK,kBAAkB;gBAAC,GAAG,MAAM;gBAAE,cAAc;YAAQ,IACvF,OAAO,eAAe;iBACjB,IAAI,kBAAkB;gBAAC,GAAG,MAAM;gBAAE,cAAc;YAAO,IAC5D,OAAO,eAAe;QAE1B,OAAO,IAAI,KAAK,KAAK,IAAI,MAAM,kBAAkB;YAAC,GAAG,MAAM;YAAE,cAAc;QAAQ,IACjF,OAAO,eAAe;aACjB,IAAI,KAAK,KAAK,OAAO,MAAM,kBAAkB;YAAC,GAAG,MAAM;YAAE,cAAc;QAAO,IACnF,OAAO,eAAe;QAGxB,OAAO;IACT;IA7lBA,YAAY,OAA8B,CAAE;QAC1C,KAAK,CAAC;aAdR,eAAiC,IAAI;aAErC,aAAa;aACb,YAAY;aACZ,oBAA8B;aAC9B,mBAAuC,IAAI;QAUzC,IAAI,CAAC,aAAa,QAAQ;QAC1B,IAAI,CAAC,sBAAsB,EAAE;QAC7B,IAAI,CAAC,gBAAgB,IAAI,CAAC;QAC1B,IAAI,CAAC,eAAe,QAAQ;QAC5B,IAAI,CAAC,mBAAmB,oBAAoB,GAAG,IAAI,CAAC,aAAa,0CAA0C,IAAI,CAAC,WAAW;QAC3H,IAAI,CAAC,oBAAoB;QACzB,IAAI,CAAC,sBAAsB;QAC3B,IAAI,CAAC,qBAAqB,IAAI,CAAC,aAAa,6BAA6B;IAC3E;AAolBF;","sources":["packages/@react-stately/layout/src/index.ts","packages/@react-stately/layout/src/ListLayout.ts","packages/@react-stately/layout/src/TableLayout.ts"],"sourcesContent":["/*\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 */\nexport type {ListLayoutOptions, LayoutNode} from './ListLayout';\nexport {ListLayout} from './ListLayout';\nexport {TableLayout} from './TableLayout';\n","/*\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\nimport {Collection, DropTarget, DropTargetDelegate, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {InvalidationContext, Layout, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {Key} from 'react';\n// import { DragTarget, DropTarget, DropPosition } from '@react-types/shared';\n\nexport type ListLayoutOptions<T> = {\n /** The height of a row in px. */\n rowHeight?: number,\n estimatedRowHeight?: number,\n headingHeight?: number,\n estimatedHeadingHeight?: number,\n padding?: number,\n indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number,\n collator?: Intl.Collator,\n loaderHeight?: number,\n placeholderHeight?: number,\n allowDisabledKeyFocus?: boolean\n};\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>,\n layoutInfo: LayoutInfo,\n header?: LayoutInfo,\n children?: LayoutNode[],\n validRect: Rect\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * The ListLayout class is an implementation of a collection view {@link Layout}\n * it is used for creating lists and lists with indented sub-lists.\n *\n * To configure a ListLayout, you can use the properties to define the\n * layouts and/or use the method for defining indentation.\n * The {@link ListKeyboardDelegate} extends the existing collection view\n * delegate with an additional method to do this (it uses the same delegate object as\n * the collection view itself).\n */\nexport class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate, DropTargetDelegate {\n protected rowHeight: number;\n protected estimatedRowHeight: number;\n protected headingHeight: number;\n protected estimatedHeadingHeight: number;\n protected padding: number;\n protected indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number;\n protected layoutInfos: Map<Key, LayoutInfo>;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n collection: Collection<Node<T>>;\n disabledKeys: Set<Key> = new Set();\n allowDisabledKeyFocus: boolean = false;\n isLoading: boolean;\n protected lastWidth: number;\n protected lastCollection: Collection<Node<T>>;\n protected rootNodes: LayoutNode[];\n protected collator: Intl.Collator;\n protected invalidateEverything: boolean;\n protected loaderHeight: number;\n protected placeholderHeight: number;\n protected lastValidRect: Rect;\n protected validRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions<T> = {}) {\n super();\n this.rowHeight = options.rowHeight;\n this.estimatedRowHeight = options.estimatedRowHeight;\n this.headingHeight = options.headingHeight;\n this.estimatedHeadingHeight = options.estimatedHeadingHeight;\n this.padding = options.padding || 0;\n this.indentationForItem = options.indentationForItem;\n this.collator = options.collator;\n this.loaderHeight = options.loaderHeight;\n this.placeholderHeight = options.placeholderHeight;\n this.layoutInfos = new Map();\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastWidth = 0;\n this.lastCollection = null;\n this.allowDisabledKeyFocus = options.allowDisabledKeyFocus;\n this.lastValidRect = new Rect();\n this.validRect = new Rect();\n this.contentSize = new Size();\n }\n\n getLayoutInfo(key: Key) {\n let res = this.layoutInfos.get(key);\n\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (!res && this.validRect.area < this.contentSize.area && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.validRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n res = this.layoutInfos.get(key);\n }\n\n return res;\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n if (node.header) {\n res.push(node.header);\n }\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n isVisible(node: LayoutNode, rect: Rect) {\n return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || this.virtualizer.isPersistedKey(node.layoutInfo.key);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<Node<T>, unknown>) {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n return invalidationContext.sizeChanged;\n }\n\n validate(invalidationContext: InvalidationContext<Node<T>, unknown>) {\n this.collection = this.virtualizer.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.lastValidRect = this.validRect;\n this.validRect = this.virtualizer.getVisibleRect();\n }\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && this.collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!this.collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutInfos.delete(layoutNode.layoutInfo.key);\n this.layoutInfos.delete(layoutNode.header?.key);\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastWidth = this.virtualizer.visibleRect.width;\n this.lastCollection = this.collection;\n this.invalidateEverything = false;\n }\n\n buildCollection(): LayoutNode[] {\n let y = this.padding;\n let skipped = 0;\n let nodes = [];\n for (let node of this.collection) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (node.type === 'item' && y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n y = layoutNode.layoutInfo.rect.maxY;\n nodes.push(layoutNode);\n\n if (node.type === 'item' && y > this.validRect.maxY) {\n y += (this.collection.size - (nodes.length + skipped)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n let rect = new Rect(0, y, this.virtualizer.visibleRect.width,\n this.loaderHeight ?? this.virtualizer.visibleRect.height);\n let loader = new LayoutInfo('loader', 'loader', rect);\n this.layoutInfos.set('loader', loader);\n nodes.push({layoutInfo: loader});\n y = loader.rect.maxY;\n }\n\n if (nodes.length === 0) {\n let rect = new Rect(0, y, this.virtualizer.visibleRect.width,\n this.placeholderHeight ?? this.virtualizer.visibleRect.height);\n let placeholder = new LayoutInfo('placeholder', 'placeholder', rect);\n this.layoutInfos.set('placeholder', placeholder);\n nodes.push({layoutInfo: placeholder});\n y = placeholder.rect.maxY;\n }\n\n this.contentSize = new Size(this.virtualizer.visibleRect.width, y + this.padding);\n return nodes;\n }\n\n isValid(node: Node<T>, y: number) {\n let cached = this.layoutNodes.get(node.key);\n return (\n !this.invalidateEverything &&\n cached &&\n cached.node === node &&\n y === (cached.header || cached.layoutInfo).rect.y &&\n cached.layoutInfo.rect.intersects(this.lastValidRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.validRect))\n );\n }\n\n buildChild(node: Node<T>, x: number, y: number): LayoutNode {\n if (this.isValid(node, y)) {\n return this.layoutNodes.get(node.key);\n }\n\n let layoutNode = this.buildNode(node, x, y);\n layoutNode.node = node;\n\n layoutNode.layoutInfo.parentKey = node.parentKey ?? null;\n this.layoutInfos.set(layoutNode.layoutInfo.key, layoutNode.layoutInfo);\n if (layoutNode.header) {\n this.layoutInfos.set(layoutNode.header.key, layoutNode.header);\n }\n\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n }\n }\n\n buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer.visibleRect.width;\n let rectHeight = this.headingHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode && previousLayoutNode.header) {\n let curNode = this.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode.header.rect.height;\n isEstimated = width !== this.lastWidth || curNode !== lastNode || previousLayoutNode.header.estimatedSize;\n } else {\n rectHeight = (node.rendered ? this.estimatedHeadingHeight : 0);\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect = new Rect(0, y, width, rectHeight);\n let header = new LayoutInfo('header', node.key + ':header', headerRect);\n header.estimatedSize = isEstimated;\n header.parentKey = node.key;\n y += header.rect.height;\n\n let rect = new Rect(0, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let startY = y;\n let skipped = 0;\n let children = [];\n for (let child of getChildNodes(node, this.collection)) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(child, x, y);\n y = layoutNode.layoutInfo.rect.maxY;\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += ([...getChildNodes(node, this.collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n rect.height = y - startY;\n\n return {\n header,\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer.visibleRect.width;\n let rectHeight = this.rowHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = width !== this.lastWidth || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowHeight;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n if (typeof this.indentationForItem === 'function') {\n x += this.indentationForItem(this.collection, node.key) || 0;\n }\n\n let rect = new Rect(x, y, width - x, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n // allow overflow so the focus ring/selection ring can extend outside to overlap with the adjacent items borders\n layoutInfo.allowOverflow = true;\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutInfo = this.layoutInfos.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutInfo) {\n return false;\n }\n\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect.height !== size.height) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n this.layoutInfos.set(key, newLayoutInfo);\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = this.collection.getItem(layoutInfo.parentKey);\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = this.collection.getItem(node.parentKey);\n }\n\n return true;\n }\n\n return false;\n }\n\n updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by reseting validRect.\n n.validRect = new Rect();\n\n // Replace layout info in LayoutNode\n if (n.header === oldLayoutInfo) {\n n.header = newLayoutInfo;\n } else if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize() {\n return this.contentSize;\n }\n\n getKeyAbove(key: Key): Key | null {\n let collection = this.collection;\n\n key = collection.getKeyBefore(key);\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyBefore(key);\n }\n }\n\n getKeyBelow(key: Key): Key | null {\n let collection = this.collection;\n\n key = collection.getKeyAfter(key);\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyAfter(key);\n }\n }\n\n getKeyPageAbove(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key);\n\n if (layoutInfo) {\n let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);\n while (layoutInfo && layoutInfo.rect.y > pageY) {\n let keyAbove = this.getKeyAbove(layoutInfo.key);\n layoutInfo = this.getLayoutInfo(keyAbove);\n }\n\n if (layoutInfo) {\n return layoutInfo.key;\n }\n }\n\n return this.getFirstKey();\n }\n\n getKeyPageBelow(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key != null ? key : this.getFirstKey());\n\n if (layoutInfo) {\n let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);\n while (layoutInfo && layoutInfo.rect.y < pageY) {\n let keyBelow = this.getKeyBelow(layoutInfo.key);\n layoutInfo = this.getLayoutInfo(keyBelow);\n }\n\n if (layoutInfo) {\n return layoutInfo.key;\n }\n }\n\n return this.getLastKey();\n }\n\n getFirstKey(): Key | null {\n let collection = this.collection;\n let key = collection.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyAfter(key);\n }\n }\n\n getLastKey(): Key | null {\n let collection = this.collection;\n let key = collection.getLastKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyBefore(key);\n }\n }\n\n getKeyForSearch(search: string, fromKey?: Key): Key | null {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey || this.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n let substring = item.textValue.slice(0, search.length);\n if (item.textValue && this.collator.compare(substring, search) === 0) {\n return key;\n }\n\n key = this.getKeyBelow(key);\n }\n\n return null;\n }\n\n getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n layoutInfo.opacity = 0;\n layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';\n return layoutInfo;\n }\n\n getFinalLayoutInfo(layoutInfo: LayoutInfo) {\n layoutInfo.opacity = 0;\n layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';\n return layoutInfo;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n let key = this.virtualizer.keyAtPoint(new Point(x, y));\n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n}\n","/*\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\nimport {ColumnSize, TableCollection} from '@react-types/table';\nimport {DropTarget, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {GridNode} from '@react-types/grid';\nimport {InvalidationContext, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {Key} from 'react';\nimport {LayoutNode, ListLayout, ListLayoutOptions} from './ListLayout';\nimport {TableColumnLayout} from '@react-stately/table';\n\ntype TableLayoutOptions<T> = ListLayoutOptions<T> & {\n columnLayout: TableColumnLayout<T>,\n initialCollection: TableCollection<T>\n}\n\nexport class TableLayout<T> extends ListLayout<T> {\n collection: TableCollection<T>;\n lastCollection: TableCollection<T>;\n columnWidths: Map<Key, number> = new Map();\n stickyColumnIndices: number[];\n wasLoading = false;\n isLoading = false;\n lastPersistedKeys: Set<Key> = null;\n persistedIndices: Map<Key, number[]> = new Map();\n private disableSticky: boolean;\n columnLayout: TableColumnLayout<T>;\n controlledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledWidths: Map<Key, ColumnSize>;\n resizingColumn: Key | null;\n\n constructor(options: TableLayoutOptions<T>) {\n super(options);\n this.collection = options.initialCollection;\n this.stickyColumnIndices = [];\n this.disableSticky = this.checkChrome105();\n this.columnLayout = options.columnLayout;\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n this.uncontrolledWidths = this.columnLayout.getInitialUncontrolledWidths(uncontrolledColumns);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<Node<T>, unknown>): boolean {\n // If columns changed, clear layout cache.\n return super.shouldInvalidateEverything(invalidationContext) || (\n !this.lastCollection ||\n this.collection.columns.length !== this.lastCollection.columns.length ||\n this.collection.columns.some((c, i) =>\n c.key !== this.lastCollection.columns[i].key ||\n c.props.width !== this.lastCollection.columns[i].props.width ||\n c.props.minWidth !== this.lastCollection.columns[i].props.minWidth ||\n c.props.maxWidth !== this.lastCollection.columns[i].props.maxWidth\n )\n );\n }\n\n getResizerPosition(): Key {\n return this.getLayoutInfo(this.resizingColumn)?.rect.maxX;\n }\n\n getColumnWidth(key: Key): number {\n return this.columnLayout.getColumnWidth(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMinWidth(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMaxWidth(key);\n }\n\n // outside, where this is called, should call props.onColumnResizeStart...\n startResize(key: Key): void {\n this.resizingColumn = key;\n }\n\n // only way to call props.onColumnResize with the new size outside of Layout is to send the result back\n updateResizedColumns(key: Key, width: number): Map<Key, ColumnSize> {\n let newControlled = new Map(Array.from(this.controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = this.columnLayout.resizeColumnWidth(this.virtualizer.visibleRect.width, this.collection, newControlled, this.uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(this.uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n this.uncontrolledWidths = map;\n // relayoutNow still uses setState, should happen at the same time the parent\n // component's state is processed as a result of props.onColumnResize\n if (this.uncontrolledWidths.size > 0) {\n this.virtualizer.relayoutNow({sizeChanged: true});\n }\n return newSizes;\n }\n\n endResize(): void {\n this.resizingColumn = null;\n }\n\n buildCollection(): LayoutNode[] {\n // Track whether we were previously loading. This is used to adjust the animations of async loading vs inserts.\n let loadingState = this.collection.body.props.loadingState;\n this.wasLoading = this.isLoading;\n this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n this.stickyColumnIndices = [];\n\n for (let column of this.collection.columns) {\n // The selection cell and any other sticky columns always need to be visible.\n // In addition, row headers need to be in the DOM for accessibility labeling.\n if (column.props.isDragButtonCell || column.props.isSelectionCell || this.collection.rowHeaderColumnKeys.has(column.key)) {\n this.stickyColumnIndices.push(column.index);\n }\n }\n\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n let colWidths = this.columnLayout.recombineColumns(this.collection.columns, this.uncontrolledWidths, uncontrolledColumns, controlledColumns);\n\n this.columnWidths = this.columnLayout.buildColumnWidths(this.virtualizer.visibleRect.width, this.collection, colWidths);\n\n let header = this.buildHeader();\n let body = this.buildBody(0);\n this.lastPersistedKeys = null;\n\n body.layoutInfo.rect.width = Math.max(header.layoutInfo.rect.width, body.layoutInfo.rect.width);\n this.contentSize = new Size(body.layoutInfo.rect.width, body.layoutInfo.rect.maxY);\n return [\n header,\n body\n ];\n }\n\n buildHeader(): LayoutNode {\n let rect = new Rect(0, 0, 0, 0);\n let layoutInfo = new LayoutInfo('header', 'header', rect);\n\n let y = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let headerRow of this.collection.headerRows) {\n let layoutNode = this.buildChild(headerRow, 0, y);\n layoutNode.layoutInfo.parentKey = 'header';\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n }\n\n rect.width = width;\n rect.height = y;\n\n this.layoutInfos.set('header', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect\n };\n }\n\n buildHeaderRow(headerRow: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let row = new LayoutInfo('headerrow', headerRow.key, rect);\n\n let height = 0;\n let columns: LayoutNode[] = [];\n for (let cell of getChildNodes(headerRow, this.collection)) {\n let layoutNode = this.buildChild(cell, x, y);\n layoutNode.layoutInfo.parentKey = row.key;\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n columns.push(layoutNode);\n }\n for (let [i, layout] of columns.entries()) {\n layout.layoutInfo.zIndex = columns.length - i + 1;\n }\n\n this.setChildHeights(columns, height);\n\n rect.height = height;\n rect.width = x;\n\n return {\n layoutInfo: row,\n children: columns,\n validRect: rect\n };\n }\n\n setChildHeights(children: LayoutNode[], height: number) {\n for (let child of children) {\n if (child.layoutInfo.rect.height !== height) {\n // Need to copy the layout info before we mutate it.\n child.layoutInfo = child.layoutInfo.copy();\n this.layoutInfos.set(child.layoutInfo.key, child.layoutInfo);\n\n child.layoutInfo.rect.height = height;\n }\n }\n }\n\n // used to get the column widths when rendering to the DOM\n getRenderedColumnWidth(node: GridNode<T>) {\n let colspan = node.colspan ?? 1;\n let colIndex = node.colIndex ?? node.index;\n let width = 0;\n for (let i = colIndex; i < colIndex + colspan; i++) {\n let column = this.collection.columns[i];\n if (column?.key != null) {\n width += this.columnWidths.get(column.key);\n }\n }\n\n return width;\n }\n\n getEstimatedHeight(node: GridNode<T>, width: number, height: number, estimatedHeight: number) {\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (height == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n height = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = node !== previousLayoutNode.node || width !== previousLayoutNode.layoutInfo.rect.width || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n height = estimatedHeight;\n isEstimated = true;\n }\n }\n\n return {height, isEstimated};\n }\n\n buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.headingHeight, this.estimatedHeadingHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n buildBody(y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let layoutInfo = new LayoutInfo('rowgroup', 'body', rect);\n\n let startY = y;\n let skipped = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let node of this.collection) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight) + 1;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n layoutNode.layoutInfo.parentKey = 'body';\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += (this.collection.size - (skipped + children.length)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n // Add some margin around the loader to ensure that scrollbars don't flicker in and out.\n let rect = new Rect(40, Math.max(y, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60);\n let loader = new LayoutInfo('loader', 'loader', rect);\n loader.parentKey = 'body';\n loader.isSticky = !this.disableSticky && children.length === 0;\n this.layoutInfos.set('loader', loader);\n children.push({layoutInfo: loader, validRect: loader.rect});\n y = loader.rect.maxY;\n width = Math.max(width, rect.width);\n } else if (children.length === 0) {\n let rect = new Rect(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);\n let empty = new LayoutInfo('empty', 'empty', rect);\n empty.parentKey = 'body';\n empty.isSticky = !this.disableSticky;\n this.layoutInfos.set('empty', empty);\n children.push({layoutInfo: empty, validRect: empty.rect});\n y = empty.rect.maxY;\n width = Math.max(width, rect.width);\n }\n\n rect.width = width;\n rect.height = y - startY;\n\n this.layoutInfos.set('body', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildNode(node: GridNode<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'headerrow':\n return this.buildHeaderRow(node, x, y);\n case 'item':\n return this.buildRow(node, x, y);\n case 'column':\n case 'placeholder':\n return this.buildColumn(node, x, y);\n case 'cell':\n return this.buildCell(node, x, y);\n default:\n throw new Error('Unknown node type ' + node.type);\n }\n }\n\n buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, 0, 0);\n let layoutInfo = new LayoutInfo('row', node.key, rect);\n\n let children: LayoutNode[] = [];\n let height = 0;\n for (let child of getChildNodes(node, this.collection)) {\n if (x > this.validRect.maxX) {\n // Adjust existing cached layoutInfo to ensure that it is out of view.\n // This can happen due to column resizing.\n let layoutNode = this.layoutNodes.get(child.key);\n if (layoutNode) {\n layoutNode.layoutInfo.rect.x = x;\n x += layoutNode.layoutInfo.rect.width;\n }\n } else {\n let layoutNode = this.buildChild(child, x, y);\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n children.push(layoutNode);\n }\n }\n\n this.setChildHeights(children, height);\n\n rect.width = this.layoutInfos.get('header').rect.width;\n rect.height = height + 1; // +1 for bottom border\n\n return {\n layoutInfo,\n children,\n validRect: rect.intersection(this.validRect)\n };\n }\n\n buildCell(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.rowHeight, this.estimatedRowHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: rect\n };\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n this.buildPersistedIndices();\n for (let node of this.rootNodes) {\n res.push(node.layoutInfo);\n this.addVisibleLayoutInfos(res, node, rect);\n }\n\n return res;\n }\n\n addVisibleLayoutInfos(res: LayoutInfo[], node: LayoutNode, rect: Rect) {\n if (!node.children || node.children.length === 0) {\n return;\n }\n\n switch (node.layoutInfo.type) {\n case 'header': {\n for (let child of node.children) {\n res.push(child.layoutInfo);\n this.addVisibleLayoutInfos(res, child, rect);\n }\n break;\n }\n case 'rowgroup': {\n let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, 'y');\n let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, 'y');\n\n // Add persisted rows before the visible rows.\n let persistedRowIndices = this.persistedIndices.get(node.layoutInfo.key);\n let persistIndex = 0;\n while (\n persistedRowIndices &&\n persistIndex < persistedRowIndices.length &&\n persistedRowIndices[persistIndex] < firstVisibleRow\n ) {\n let idx = persistedRowIndices[persistIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[idx], rect);\n }\n persistIndex++;\n }\n\n for (let i = firstVisibleRow; i <= lastVisibleRow; i++) {\n // Skip persisted rows that overlap with visible cells.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length && persistedRowIndices[persistIndex] < i) {\n persistIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[i], rect);\n }\n\n // Add persisted rows after the visible rows.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length) {\n let idx = persistedRowIndices[persistIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n case 'headerrow':\n case 'row': {\n let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, 'x');\n let lastVisibleCell = this.binarySearch(node.children, rect.topRight, 'x');\n let stickyIndex = 0;\n\n // Add persisted/sticky cells before the visible cells.\n let persistedCellIndices = this.persistedIndices.get(node.layoutInfo.key) || this.stickyColumnIndices;\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < firstVisibleCell) {\n let idx = persistedCellIndices[stickyIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n stickyIndex++;\n }\n\n for (let i = firstVisibleCell; i <= lastVisibleCell; i++) {\n // Skip sticky cells that overlap with visible cells.\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < i) {\n stickyIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n }\n\n // Add any remaining sticky cells after the visible cells.\n while (stickyIndex < persistedCellIndices.length) {\n let idx = persistedCellIndices[stickyIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n default:\n throw new Error('Unknown node type ' + node.layoutInfo.type);\n }\n }\n\n binarySearch(items: LayoutNode[], point: Point, axis: 'x' | 'y') {\n let low = 0;\n let high = items.length - 1;\n while (low <= high) {\n let mid = (low + high) >> 1;\n let item = items[mid];\n\n if ((axis === 'x' && item.layoutInfo.rect.maxX < point.x) || (axis === 'y' && item.layoutInfo.rect.maxY < point.y)) {\n low = mid + 1;\n } else if ((axis === 'x' && item.layoutInfo.rect.x > point.x) || (axis === 'y' && item.layoutInfo.rect.y > point.y)) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.max(0, Math.min(items.length - 1, low));\n }\n\n buildPersistedIndices() {\n if (this.virtualizer.persistedKeys === this.lastPersistedKeys) {\n return;\n }\n\n this.lastPersistedKeys = this.virtualizer.persistedKeys;\n this.persistedIndices.clear();\n\n // Build a map of parentKey => indices of children to persist.\n for (let key of this.virtualizer.persistedKeys) {\n let layoutInfo = this.layoutInfos.get(key);\n\n // Walk up ancestors so parents are also persisted if children are.\n while (layoutInfo && layoutInfo.parentKey) {\n let collectionNode = this.collection.getItem(layoutInfo.key);\n let indices = this.persistedIndices.get(layoutInfo.parentKey);\n if (!indices) {\n // stickyColumnIndices are always persisted along with any cells from persistedKeys.\n indices = collectionNode.type === 'cell' || collectionNode.type === 'column' ? [...this.stickyColumnIndices] : [];\n this.persistedIndices.set(layoutInfo.parentKey, indices);\n }\n\n let index = collectionNode.index;\n if (layoutInfo.parentKey === 'body') {\n index -= this.collection.headerRows.length;\n }\n\n if (!indices.includes(index)) {\n indices.push(index);\n }\n\n layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);\n }\n }\n\n for (let indices of this.persistedIndices.values()) {\n indices.sort((a, b) => a - b);\n }\n }\n\n getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n let res = super.getInitialLayoutInfo(layoutInfo);\n\n // If this insert was the result of async loading, remove the zoom effect and just keep the fade in.\n if (this.wasLoading) {\n res.transform = null;\n }\n\n return res;\n }\n\n // Checks if Chrome version is 105 or greater\n private checkChrome105() {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n\n let isChrome105;\n if (window.navigator['userAgentData']) {\n isChrome105 = window.navigator['userAgentData']?.brands.some(b => b.brand === 'Chromium' && Number(b.version) === 105);\n } else {\n let regex = /Chrome\\/(\\d+)/;\n let matches = regex.exec(window.navigator.userAgent);\n isChrome105 = matches && matches.length >= 2 && Number(matches[1]) === 105;\n }\n\n return isChrome105;\n }\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n // Offset for height of header row\n y -= this.virtualizer.layout.getVisibleLayoutInfos(new Rect(x, y, 1, 1)).find(info => info.type === 'headerrow')?.rect.height;\n\n // Custom variation of this.virtualizer.keyAtPoint that ignores body\n let key: Key;\n let point = new Point(x, y);\n let rectAtPoint = new Rect(point.x, point.y, 1, 1);\n let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter(info => info.type === 'row');\n\n // Layout may return multiple layout infos in the case of\n // persisted keys, so find the first one that actually intersects.\n for (let layoutInfo of layoutInfos) {\n if (layoutInfo.rect.intersects(rectAtPoint)) {\n key = layoutInfo.key;\n }\n }\n \n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AAgCD,MAAM,uCAAiB;AAYhB,MAAM,kDAAsB,CAAA,GAAA,qCAAK;IAkDtC,cAAc,GAAQ,EAAE;QACtB,IAAI,MAAM,IAAI,CAAC,YAAY,IAAI;QAE/B,yFAAyF;QACzF,kGAAkG;QAClG,yCAAyC;QACzC,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,OAAO,IAAI,CAAC,YAAY,QAAQ,IAAI,CAAC,gBAAgB;YAC9E,IAAI,CAAC,gBAAgB,IAAI,CAAC;YAC1B,IAAI,CAAC,YAAY,IAAI,CAAA,GAAA,mCAAG,EAAE,GAAG,GAAG,UAAU;YAC1C,IAAI,CAAC,YAAY,IAAI,CAAC;YACtB,IAAI,CAAC,YAAY,IAAI,CAAA,GAAA,mCAAG,EAAE,GAAG,GAAG,IAAI,CAAC,YAAY,OAAO,IAAI,CAAC,YAAY;YACzE,MAAM,IAAI,CAAC,YAAY,IAAI;QAC7B;QAEA,OAAO;IACT;IAEA,sBAAsB,IAAU,EAAE;QAChC,mEAAmE;QACnE,wDAAwD;QACxD,IAAI,CAAC,I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I,CAAC,cAAc;QACpC,IAAI,OAAO,WAAW;QACtB,IAAI,SAAqB;YACvB,MAAM;YACN,KAAK,WAAW;YAChB,cAAc;QAChB;QAEA,sGAAsG;QACtG,sGAAsG;QACtG,oCAAoC;QACpC,IAAI,CAAC,kBAAkB,SAAS;YAC9B,IAAI,KAAK,KAAK,IAAI,KAAK,SAAS,KAAK,kBAAkB;gBAAC,GAAG,MAAM;gBAAE,cAAc;YAAQ,IACvF,OAAO,eAAe;iBACjB,IAAI,kBAAkB;gBAAC,GAAG,MAAM;gBAAE,cAAc;YAAO,IAC5D,OAAO,eAAe;QAE1B,OAAO,IAAI,KAAK,KAAK,IAAI,MAAM,kBAAkB;YAAC,GAAG,MAAM;YAAE,cAAc;QAAQ,IACjF,OAAO,eAAe;aACjB,IAAI,KAAK,KAAK,OAAO,MAAM,kBAAkB;YAAC,GAAG,MAAM;YAAE,cAAc;QAAO,IACnF,OAAO,eAAe;QAGxB,OAAO;IACT;IAjmBA,YAAY,OAA8B,CAAE;QAC1C,KAAK,CAAC;aAdR,eAAiC,IAAI;aAErC,aAAa;aACb,YAAY;aACZ,oBAA8B;aAC9B,mBAAuC,IAAI;QAUzC,IAAI,CAAC,aAAa,QAAQ;QAC1B,IAAI,CAAC,sBAAsB,EAAE;QAC7B,IAAI,CAAC,gBAAgB,IAAI,CAAC;QAC1B,IAAI,CAAC,eAAe,QAAQ;QAC5B,IAAI,CAAC,mBAAmB,oBAAoB,GAAG,IAAI,CAAC,aAAa,0CAA0C,IAAI,CAAC,WAAW;QAC3H,IAAI,CAAC,oBAAoB;QACzB,IAAI,CAAC,sBAAsB;QAC3B,IAAI,CAAC,qBAAqB,IAAI,CAAC,aAAa,6BAA6B;IAC3E;AAwlBF;","sources":["packages/@react-stately/layout/src/index.ts","packages/@react-stately/layout/src/ListLayout.ts","packages/@react-stately/layout/src/TableLayout.ts"],"sourcesContent":["/*\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 */\nexport type {ListLayoutOptions, LayoutNode} from './ListLayout';\nexport {ListLayout} from './ListLayout';\nexport {TableLayout} from './TableLayout';\n","/*\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\nimport {Collection, DropTarget, DropTargetDelegate, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {InvalidationContext, Layout, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {Key} from 'react';\n// import { DragTarget, DropTarget, DropPosition } from '@react-types/shared';\n\nexport type ListLayoutOptions<T> = {\n /** The height of a row in px. */\n rowHeight?: number,\n estimatedRowHeight?: number,\n headingHeight?: number,\n estimatedHeadingHeight?: number,\n padding?: number,\n indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number,\n collator?: Intl.Collator,\n loaderHeight?: number,\n placeholderHeight?: number,\n allowDisabledKeyFocus?: boolean\n};\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>,\n layoutInfo: LayoutInfo,\n header?: LayoutInfo,\n children?: LayoutNode[],\n validRect: Rect,\n index?: number\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * The ListLayout class is an implementation of a collection view {@link Layout}\n * it is used for creating lists and lists with indented sub-lists.\n *\n * To configure a ListLayout, you can use the properties to define the\n * layouts and/or use the method for defining indentation.\n * The {@link ListKeyboardDelegate} extends the existing collection view\n * delegate with an additional method to do this (it uses the same delegate object as\n * the collection view itself).\n */\nexport class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate, DropTargetDelegate {\n protected rowHeight: number;\n protected estimatedRowHeight: number;\n protected headingHeight: number;\n protected estimatedHeadingHeight: number;\n protected padding: number;\n protected indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number;\n protected layoutInfos: Map<Key, LayoutInfo>;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n collection: Collection<Node<T>>;\n disabledKeys: Set<Key> = new Set();\n allowDisabledKeyFocus: boolean = false;\n isLoading: boolean;\n protected lastWidth: number;\n protected lastCollection: Collection<Node<T>>;\n protected rootNodes: LayoutNode[];\n protected collator: Intl.Collator;\n protected invalidateEverything: boolean;\n protected loaderHeight: number;\n protected placeholderHeight: number;\n protected lastValidRect: Rect;\n protected validRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions<T> = {}) {\n super();\n this.rowHeight = options.rowHeight;\n this.estimatedRowHeight = options.estimatedRowHeight;\n this.headingHeight = options.headingHeight;\n this.estimatedHeadingHeight = options.estimatedHeadingHeight;\n this.padding = options.padding || 0;\n this.indentationForItem = options.indentationForItem;\n this.collator = options.collator;\n this.loaderHeight = options.loaderHeight;\n this.placeholderHeight = options.placeholderHeight;\n this.layoutInfos = new Map();\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastWidth = 0;\n this.lastCollection = null;\n this.allowDisabledKeyFocus = options.allowDisabledKeyFocus;\n this.lastValidRect = new Rect();\n this.validRect = new Rect();\n this.contentSize = new Size();\n }\n\n getLayoutInfo(key: Key) {\n let res = this.layoutInfos.get(key);\n\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (!res && this.validRect.area < this.contentSize.area && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.validRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n res = this.layoutInfos.get(key);\n }\n\n return res;\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n if (node.header) {\n res.push(node.header);\n }\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n isVisible(node: LayoutNode, rect: Rect) {\n return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || this.virtualizer.isPersistedKey(node.layoutInfo.key);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<Node<T>, unknown>) {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n return invalidationContext.sizeChanged;\n }\n\n validate(invalidationContext: InvalidationContext<Node<T>, unknown>) {\n this.collection = this.virtualizer.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.lastValidRect = this.validRect;\n this.validRect = this.virtualizer.getVisibleRect();\n }\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && this.collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!this.collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutInfos.delete(layoutNode.layoutInfo.key);\n this.layoutInfos.delete(layoutNode.header?.key);\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastWidth = this.virtualizer.visibleRect.width;\n this.lastCollection = this.collection;\n this.invalidateEverything = false;\n }\n\n buildCollection(): LayoutNode[] {\n let y = this.padding;\n let skipped = 0;\n let nodes = [];\n for (let node of this.collection) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (node.type === 'item' && y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n y = layoutNode.layoutInfo.rect.maxY;\n nodes.push(layoutNode);\n\n if (node.type === 'item' && y > this.validRect.maxY) {\n y += (this.collection.size - (nodes.length + skipped)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n let rect = new Rect(0, y, this.virtualizer.visibleRect.width,\n this.loaderHeight ?? this.virtualizer.visibleRect.height);\n let loader = new LayoutInfo('loader', 'loader', rect);\n this.layoutInfos.set('loader', loader);\n nodes.push({layoutInfo: loader});\n y = loader.rect.maxY;\n }\n\n if (nodes.length === 0) {\n let rect = new Rect(0, y, this.virtualizer.visibleRect.width,\n this.placeholderHeight ?? this.virtualizer.visibleRect.height);\n let placeholder = new LayoutInfo('placeholder', 'placeholder', rect);\n this.layoutInfos.set('placeholder', placeholder);\n nodes.push({layoutInfo: placeholder});\n y = placeholder.rect.maxY;\n }\n\n this.contentSize = new Size(this.virtualizer.visibleRect.width, y + this.padding);\n return nodes;\n }\n\n isValid(node: Node<T>, y: number) {\n let cached = this.layoutNodes.get(node.key);\n return (\n !this.invalidateEverything &&\n cached &&\n cached.node === node &&\n y === (cached.header || cached.layoutInfo).rect.y &&\n cached.layoutInfo.rect.intersects(this.lastValidRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.validRect))\n );\n }\n\n buildChild(node: Node<T>, x: number, y: number): LayoutNode {\n if (this.isValid(node, y)) {\n return this.layoutNodes.get(node.key);\n }\n\n let layoutNode = this.buildNode(node, x, y);\n layoutNode.node = node;\n\n layoutNode.layoutInfo.parentKey = node.parentKey ?? null;\n this.layoutInfos.set(layoutNode.layoutInfo.key, layoutNode.layoutInfo);\n if (layoutNode.header) {\n this.layoutInfos.set(layoutNode.header.key, layoutNode.header);\n }\n\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n }\n }\n\n buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer.visibleRect.width;\n let rectHeight = this.headingHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode && previousLayoutNode.header) {\n let curNode = this.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode.header.rect.height;\n isEstimated = width !== this.lastWidth || curNode !== lastNode || previousLayoutNode.header.estimatedSize;\n } else {\n rectHeight = (node.rendered ? this.estimatedHeadingHeight : 0);\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect = new Rect(0, y, width, rectHeight);\n let header = new LayoutInfo('header', node.key + ':header', headerRect);\n header.estimatedSize = isEstimated;\n header.parentKey = node.key;\n y += header.rect.height;\n\n let rect = new Rect(0, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let startY = y;\n let skipped = 0;\n let children = [];\n for (let child of getChildNodes(node, this.collection)) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(child, x, y);\n y = layoutNode.layoutInfo.rect.maxY;\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += ([...getChildNodes(node, this.collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n rect.height = y - startY;\n\n return {\n header,\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer.visibleRect.width;\n let rectHeight = this.rowHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = width !== this.lastWidth || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowHeight;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n if (typeof this.indentationForItem === 'function') {\n x += this.indentationForItem(this.collection, node.key) || 0;\n }\n\n let rect = new Rect(x, y, width - x, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n // allow overflow so the focus ring/selection ring can extend outside to overlap with the adjacent items borders\n layoutInfo.allowOverflow = true;\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutInfo = this.layoutInfos.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutInfo) {\n return false;\n }\n\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect.height !== size.height) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n this.layoutInfos.set(key, newLayoutInfo);\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = this.collection.getItem(layoutInfo.parentKey);\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = this.collection.getItem(node.parentKey);\n }\n\n return true;\n }\n\n return false;\n }\n\n updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by reseting validRect.\n n.validRect = new Rect();\n\n // Replace layout info in LayoutNode\n if (n.header === oldLayoutInfo) {\n n.header = newLayoutInfo;\n } else if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize() {\n return this.contentSize;\n }\n\n getKeyAbove(key: Key): Key | null {\n let collection = this.collection;\n\n key = collection.getKeyBefore(key);\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyBefore(key);\n }\n }\n\n getKeyBelow(key: Key): Key | null {\n let collection = this.collection;\n\n key = collection.getKeyAfter(key);\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyAfter(key);\n }\n }\n\n getKeyPageAbove(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key);\n\n if (layoutInfo) {\n let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);\n while (layoutInfo && layoutInfo.rect.y > pageY) {\n let keyAbove = this.getKeyAbove(layoutInfo.key);\n layoutInfo = this.getLayoutInfo(keyAbove);\n }\n\n if (layoutInfo) {\n return layoutInfo.key;\n }\n }\n\n return this.getFirstKey();\n }\n\n getKeyPageBelow(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key != null ? key : this.getFirstKey());\n\n if (layoutInfo) {\n let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);\n while (layoutInfo && layoutInfo.rect.y < pageY) {\n let keyBelow = this.getKeyBelow(layoutInfo.key);\n layoutInfo = this.getLayoutInfo(keyBelow);\n }\n\n if (layoutInfo) {\n return layoutInfo.key;\n }\n }\n\n return this.getLastKey();\n }\n\n getFirstKey(): Key | null {\n let collection = this.collection;\n let key = collection.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyAfter(key);\n }\n }\n\n getLastKey(): Key | null {\n let collection = this.collection;\n let key = collection.getLastKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyBefore(key);\n }\n }\n\n getKeyForSearch(search: string, fromKey?: Key): Key | null {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey || this.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n let substring = item.textValue.slice(0, search.length);\n if (item.textValue && this.collator.compare(substring, search) === 0) {\n return key;\n }\n\n key = this.getKeyBelow(key);\n }\n\n return null;\n }\n\n getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n layoutInfo.opacity = 0;\n layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';\n return layoutInfo;\n }\n\n getFinalLayoutInfo(layoutInfo: LayoutInfo) {\n layoutInfo.opacity = 0;\n layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';\n return layoutInfo;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n let key = this.virtualizer.keyAtPoint(new Point(x, y));\n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n}\n","/*\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\nimport {ColumnSize, TableCollection} from '@react-types/table';\nimport {DropTarget, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {GridNode} from '@react-types/grid';\nimport {InvalidationContext, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {Key} from 'react';\nimport {LayoutNode, ListLayout, ListLayoutOptions} from './ListLayout';\nimport {TableColumnLayout} from '@react-stately/table';\n\ntype TableLayoutOptions<T> = ListLayoutOptions<T> & {\n columnLayout: TableColumnLayout<T>,\n initialCollection: TableCollection<T>\n}\n\nexport class TableLayout<T> extends ListLayout<T> {\n collection: TableCollection<T>;\n lastCollection: TableCollection<T>;\n columnWidths: Map<Key, number> = new Map();\n stickyColumnIndices: number[];\n wasLoading = false;\n isLoading = false;\n lastPersistedKeys: Set<Key> = null;\n persistedIndices: Map<Key, number[]> = new Map();\n private disableSticky: boolean;\n columnLayout: TableColumnLayout<T>;\n controlledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledWidths: Map<Key, ColumnSize>;\n resizingColumn: Key | null;\n\n constructor(options: TableLayoutOptions<T>) {\n super(options);\n this.collection = options.initialCollection;\n this.stickyColumnIndices = [];\n this.disableSticky = this.checkChrome105();\n this.columnLayout = options.columnLayout;\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n this.uncontrolledWidths = this.columnLayout.getInitialUncontrolledWidths(uncontrolledColumns);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<Node<T>, unknown>): boolean {\n // If columns changed, clear layout cache.\n return super.shouldInvalidateEverything(invalidationContext) || (\n !this.lastCollection ||\n this.collection.columns.length !== this.lastCollection.columns.length ||\n this.collection.columns.some((c, i) =>\n c.key !== this.lastCollection.columns[i].key ||\n c.props.width !== this.lastCollection.columns[i].props.width ||\n c.props.minWidth !== this.lastCollection.columns[i].props.minWidth ||\n c.props.maxWidth !== this.lastCollection.columns[i].props.maxWidth\n )\n );\n }\n\n getResizerPosition(): Key {\n return this.getLayoutInfo(this.resizingColumn)?.rect.maxX;\n }\n\n getColumnWidth(key: Key): number {\n return this.columnLayout.getColumnWidth(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMinWidth(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMaxWidth(key);\n }\n\n // outside, where this is called, should call props.onColumnResizeStart...\n startResize(key: Key): void {\n this.resizingColumn = key;\n }\n\n // only way to call props.onColumnResize with the new size outside of Layout is to send the result back\n updateResizedColumns(key: Key, width: number): Map<Key, ColumnSize> {\n let newControlled = new Map(Array.from(this.controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = this.columnLayout.resizeColumnWidth(this.virtualizer.visibleRect.width, this.collection, newControlled, this.uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(this.uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n this.uncontrolledWidths = map;\n // relayoutNow still uses setState, should happen at the same time the parent\n // component's state is processed as a result of props.onColumnResize\n if (this.uncontrolledWidths.size > 0) {\n this.virtualizer.relayoutNow({sizeChanged: true});\n }\n return newSizes;\n }\n\n endResize(): void {\n this.resizingColumn = null;\n }\n\n buildCollection(): LayoutNode[] {\n // Track whether we were previously loading. This is used to adjust the animations of async loading vs inserts.\n let loadingState = this.collection.body.props.loadingState;\n this.wasLoading = this.isLoading;\n this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n this.stickyColumnIndices = [];\n\n for (let column of this.collection.columns) {\n // The selection cell and any other sticky columns always need to be visible.\n // In addition, row headers need to be in the DOM for accessibility labeling.\n if (column.props.isDragButtonCell || column.props.isSelectionCell || this.collection.rowHeaderColumnKeys.has(column.key)) {\n this.stickyColumnIndices.push(column.index);\n }\n }\n\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n let colWidths = this.columnLayout.recombineColumns(this.collection.columns, this.uncontrolledWidths, uncontrolledColumns, controlledColumns);\n\n this.columnWidths = this.columnLayout.buildColumnWidths(this.virtualizer.visibleRect.width, this.collection, colWidths);\n\n let header = this.buildHeader();\n let body = this.buildBody(0);\n this.lastPersistedKeys = null;\n\n body.layoutInfo.rect.width = Math.max(header.layoutInfo.rect.width, body.layoutInfo.rect.width);\n this.contentSize = new Size(body.layoutInfo.rect.width, body.layoutInfo.rect.maxY);\n return [\n header,\n body\n ];\n }\n\n buildHeader(): LayoutNode {\n let rect = new Rect(0, 0, 0, 0);\n let layoutInfo = new LayoutInfo('header', 'header', rect);\n\n let y = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let headerRow of this.collection.headerRows) {\n let layoutNode = this.buildChild(headerRow, 0, y);\n layoutNode.layoutInfo.parentKey = 'header';\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n layoutNode.index = children.length;\n children.push(layoutNode);\n }\n\n rect.width = width;\n rect.height = y;\n\n this.layoutInfos.set('header', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect\n };\n }\n\n buildHeaderRow(headerRow: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let row = new LayoutInfo('headerrow', headerRow.key, rect);\n\n let height = 0;\n let columns: LayoutNode[] = [];\n for (let cell of getChildNodes(headerRow, this.collection)) {\n let layoutNode = this.buildChild(cell, x, y);\n layoutNode.layoutInfo.parentKey = row.key;\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = columns.length;\n columns.push(layoutNode);\n }\n for (let [i, layout] of columns.entries()) {\n layout.layoutInfo.zIndex = columns.length - i + 1;\n }\n\n this.setChildHeights(columns, height);\n\n rect.height = height;\n rect.width = x;\n\n return {\n layoutInfo: row,\n children: columns,\n validRect: rect\n };\n }\n\n setChildHeights(children: LayoutNode[], height: number) {\n for (let child of children) {\n if (child.layoutInfo.rect.height !== height) {\n // Need to copy the layout info before we mutate it.\n child.layoutInfo = child.layoutInfo.copy();\n this.layoutInfos.set(child.layoutInfo.key, child.layoutInfo);\n\n child.layoutInfo.rect.height = height;\n }\n }\n }\n\n // used to get the column widths when rendering to the DOM\n getRenderedColumnWidth(node: GridNode<T>) {\n let colspan = node.colspan ?? 1;\n let colIndex = node.colIndex ?? node.index;\n let width = 0;\n for (let i = colIndex; i < colIndex + colspan; i++) {\n let column = this.collection.columns[i];\n if (column?.key != null) {\n width += this.columnWidths.get(column.key);\n }\n }\n\n return width;\n }\n\n getEstimatedHeight(node: GridNode<T>, width: number, height: number, estimatedHeight: number) {\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (height == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n height = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = node !== previousLayoutNode.node || width !== previousLayoutNode.layoutInfo.rect.width || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n height = estimatedHeight;\n isEstimated = true;\n }\n }\n\n return {height, isEstimated};\n }\n\n buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.headingHeight, this.estimatedHeadingHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n buildBody(y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let layoutInfo = new LayoutInfo('rowgroup', 'body', rect);\n\n let startY = y;\n let skipped = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let [i, node] of [...this.collection].entries()) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight) + 1;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n layoutNode.layoutInfo.parentKey = 'body';\n layoutNode.index = i;\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += (this.collection.size - (skipped + children.length)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n // Add some margin around the loader to ensure that scrollbars don't flicker in and out.\n let rect = new Rect(40, Math.max(y, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60);\n let loader = new LayoutInfo('loader', 'loader', rect);\n loader.parentKey = 'body';\n loader.isSticky = !this.disableSticky && children.length === 0;\n this.layoutInfos.set('loader', loader);\n children.push({layoutInfo: loader, validRect: loader.rect});\n y = loader.rect.maxY;\n width = Math.max(width, rect.width);\n } else if (children.length === 0) {\n let rect = new Rect(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);\n let empty = new LayoutInfo('empty', 'empty', rect);\n empty.parentKey = 'body';\n empty.isSticky = !this.disableSticky;\n this.layoutInfos.set('empty', empty);\n children.push({layoutInfo: empty, validRect: empty.rect});\n y = empty.rect.maxY;\n width = Math.max(width, rect.width);\n }\n\n rect.width = width;\n rect.height = y - startY;\n\n this.layoutInfos.set('body', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildNode(node: GridNode<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'headerrow':\n return this.buildHeaderRow(node, x, y);\n case 'item':\n return this.buildRow(node, x, y);\n case 'column':\n case 'placeholder':\n return this.buildColumn(node, x, y);\n case 'cell':\n return this.buildCell(node, x, y);\n default:\n throw new Error('Unknown node type ' + node.type);\n }\n }\n\n buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, 0, 0);\n let layoutInfo = new LayoutInfo('row', node.key, rect);\n\n let children: LayoutNode[] = [];\n let height = 0;\n for (let [i, child] of [...getChildNodes(node, this.collection)].entries()) {\n if (child.type === 'cell') {\n if (x > this.validRect.maxX) {\n // Adjust existing cached layoutInfo to ensure that it is out of view.\n // This can happen due to column resizing.\n let layoutNode = this.layoutNodes.get(child.key);\n if (layoutNode) {\n layoutNode.layoutInfo.rect.x = x;\n x += layoutNode.layoutInfo.rect.width;\n }\n } else {\n let layoutNode = this.buildChild(child, x, y);\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = i;\n children.push(layoutNode);\n }\n }\n }\n\n this.setChildHeights(children, height);\n\n rect.width = this.layoutInfos.get('header').rect.width;\n rect.height = height + 1; // +1 for bottom border\n\n return {\n layoutInfo,\n children,\n validRect: rect.intersection(this.validRect)\n };\n }\n\n buildCell(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.rowHeight, this.estimatedRowHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: rect\n };\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n this.buildPersistedIndices();\n for (let node of this.rootNodes) {\n res.push(node.layoutInfo);\n this.addVisibleLayoutInfos(res, node, rect);\n }\n\n return res;\n }\n\n addVisibleLayoutInfos(res: LayoutInfo[], node: LayoutNode, rect: Rect) {\n if (!node.children || node.children.length === 0) {\n return;\n }\n\n switch (node.layoutInfo.type) {\n case 'header': {\n for (let child of node.children) {\n res.push(child.layoutInfo);\n this.addVisibleLayoutInfos(res, child, rect);\n }\n break;\n }\n case 'rowgroup': {\n let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, 'y');\n let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, 'y');\n\n // Add persisted rows before the visible rows.\n let persistedRowIndices = this.persistedIndices.get(node.layoutInfo.key);\n let persistIndex = 0;\n while (\n persistedRowIndices &&\n persistIndex < persistedRowIndices.length &&\n persistedRowIndices[persistIndex] < firstVisibleRow\n ) {\n let idx = persistedRowIndices[persistIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[idx], rect);\n }\n persistIndex++;\n }\n\n for (let i = firstVisibleRow; i <= lastVisibleRow; i++) {\n // Skip persisted rows that overlap with visible cells.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length && persistedRowIndices[persistIndex] < i) {\n persistIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[i], rect);\n }\n\n // Add persisted rows after the visible rows.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length) {\n let idx = persistedRowIndices[persistIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n case 'headerrow':\n case 'row': {\n let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, 'x');\n let lastVisibleCell = this.binarySearch(node.children, rect.topRight, 'x');\n let stickyIndex = 0;\n\n // Add persisted/sticky cells before the visible cells.\n let persistedCellIndices = this.persistedIndices.get(node.layoutInfo.key) || this.stickyColumnIndices;\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < firstVisibleCell) {\n let idx = persistedCellIndices[stickyIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n stickyIndex++;\n }\n\n for (let i = firstVisibleCell; i <= lastVisibleCell; i++) {\n // Skip sticky cells that overlap with visible cells.\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < i) {\n stickyIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n }\n\n // Add any remaining sticky cells after the visible cells.\n while (stickyIndex < persistedCellIndices.length) {\n let idx = persistedCellIndices[stickyIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n default:\n throw new Error('Unknown node type ' + node.layoutInfo.type);\n }\n }\n\n binarySearch(items: LayoutNode[], point: Point, axis: 'x' | 'y') {\n let low = 0;\n let high = items.length - 1;\n while (low <= high) {\n let mid = (low + high) >> 1;\n let item = items[mid];\n\n if ((axis === 'x' && item.layoutInfo.rect.maxX < point.x) || (axis === 'y' && item.layoutInfo.rect.maxY < point.y)) {\n low = mid + 1;\n } else if ((axis === 'x' && item.layoutInfo.rect.x > point.x) || (axis === 'y' && item.layoutInfo.rect.y > point.y)) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.max(0, Math.min(items.length - 1, low));\n }\n\n buildPersistedIndices() {\n if (this.virtualizer.persistedKeys === this.lastPersistedKeys) {\n return;\n }\n\n this.lastPersistedKeys = this.virtualizer.persistedKeys;\n this.persistedIndices.clear();\n\n // Build a map of parentKey => indices of children to persist.\n for (let key of this.virtualizer.persistedKeys) {\n let layoutInfo = this.layoutInfos.get(key);\n\n // Walk up ancestors so parents are also persisted if children are.\n while (layoutInfo && layoutInfo.parentKey) {\n let collectionNode = this.collection.getItem(layoutInfo.key);\n let indices = this.persistedIndices.get(layoutInfo.parentKey);\n if (!indices) {\n // stickyColumnIndices are always persisted along with any cells from persistedKeys.\n indices = collectionNode.type === 'cell' || collectionNode.type === 'column' ? [...this.stickyColumnIndices] : [];\n this.persistedIndices.set(layoutInfo.parentKey, indices);\n }\n\n let index = this.layoutNodes.get(layoutInfo.key).index;\n\n if (!indices.includes(index)) {\n indices.push(index);\n }\n\n layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);\n }\n }\n\n for (let indices of this.persistedIndices.values()) {\n indices.sort((a, b) => a - b);\n }\n }\n\n getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n let res = super.getInitialLayoutInfo(layoutInfo);\n res.transform = null;\n return res;\n }\n\n getFinalLayoutInfo(layoutInfo: LayoutInfo) {\n let res = super.getFinalLayoutInfo(layoutInfo);\n res.transform = null;\n return res;\n }\n\n // Checks if Chrome version is 105 or greater\n private checkChrome105() {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n\n let isChrome105;\n if (window.navigator['userAgentData']) {\n isChrome105 = window.navigator['userAgentData']?.brands.some(b => b.brand === 'Chromium' && Number(b.version) === 105);\n } else {\n let regex = /Chrome\\/(\\d+)/;\n let matches = regex.exec(window.navigator.userAgent);\n isChrome105 = matches && matches.length >= 2 && Number(matches[1]) === 105;\n }\n\n return isChrome105;\n }\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n // Offset for height of header row\n y -= this.virtualizer.layout.getVisibleLayoutInfos(new Rect(x, y, 1, 1)).find(info => info.type === 'headerrow')?.rect.height;\n\n // Custom variation of this.virtualizer.keyAtPoint that ignores body\n let key: Key;\n let point = new Point(x, y);\n let rectAtPoint = new Rect(point.x, point.y, 1, 1);\n let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter(info => info.type === 'row');\n\n // Layout may return multiple layout infos in the case of\n // persisted keys, so find the first one that actually intersects.\n for (let layoutInfo of layoutInfos) {\n if (layoutInfo.rect.intersects(rectAtPoint)) {\n key = layoutInfo.key;\n }\n }\n\n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -527,6 +527,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
527
527
|
layoutNode.layoutInfo.parentKey = "header";
|
|
528
528
|
y = layoutNode.layoutInfo.rect.maxY;
|
|
529
529
|
width = Math.max(width, layoutNode.layoutInfo.rect.width);
|
|
530
|
+
layoutNode.index = children.length;
|
|
530
531
|
children.push(layoutNode);
|
|
531
532
|
}
|
|
532
533
|
rect.width = width;
|
|
@@ -548,6 +549,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
548
549
|
layoutNode.layoutInfo.parentKey = row.key;
|
|
549
550
|
x = layoutNode.layoutInfo.rect.maxX;
|
|
550
551
|
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
552
|
+
layoutNode.index = columns.length;
|
|
551
553
|
columns.push(layoutNode);
|
|
552
554
|
}
|
|
553
555
|
for (let [i, layout] of columns.entries())layout.layoutInfo.zIndex = columns.length - i + 1;
|
|
@@ -623,7 +625,9 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
623
625
|
let skipped = 0;
|
|
624
626
|
let width = 0;
|
|
625
627
|
let children = [];
|
|
626
|
-
for (let node of
|
|
628
|
+
for (let [i, node] of [
|
|
629
|
+
...this.collection
|
|
630
|
+
].entries()){
|
|
627
631
|
var _this_rowHeight;
|
|
628
632
|
let rowHeight = ((_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) + 1;
|
|
629
633
|
// Skip rows before the valid rectangle unless they are already cached.
|
|
@@ -634,6 +638,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
634
638
|
}
|
|
635
639
|
let layoutNode = this.buildChild(node, 0, y);
|
|
636
640
|
layoutNode.layoutInfo.parentKey = "body";
|
|
641
|
+
layoutNode.index = i;
|
|
637
642
|
y = layoutNode.layoutInfo.rect.maxY;
|
|
638
643
|
width = Math.max(width, layoutNode.layoutInfo.rect.width);
|
|
639
644
|
children.push(layoutNode);
|
|
@@ -698,19 +703,24 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
698
703
|
let layoutInfo = new (0, $gtW1T$LayoutInfo)("row", node.key, rect);
|
|
699
704
|
let children = [];
|
|
700
705
|
let height = 0;
|
|
701
|
-
for (let child of
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
706
|
+
for (let [i, child] of [
|
|
707
|
+
...(0, $gtW1T$getChildNodes)(node, this.collection)
|
|
708
|
+
].entries())if (child.type === "cell") {
|
|
709
|
+
if (x > this.validRect.maxX) {
|
|
710
|
+
// Adjust existing cached layoutInfo to ensure that it is out of view.
|
|
711
|
+
// This can happen due to column resizing.
|
|
712
|
+
let layoutNode = this.layoutNodes.get(child.key);
|
|
713
|
+
if (layoutNode) {
|
|
714
|
+
layoutNode.layoutInfo.rect.x = x;
|
|
715
|
+
x += layoutNode.layoutInfo.rect.width;
|
|
716
|
+
}
|
|
717
|
+
} else {
|
|
718
|
+
let layoutNode = this.buildChild(child, x, y);
|
|
719
|
+
x = layoutNode.layoutInfo.rect.maxX;
|
|
720
|
+
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
721
|
+
layoutNode.index = i;
|
|
722
|
+
children.push(layoutNode);
|
|
708
723
|
}
|
|
709
|
-
} else {
|
|
710
|
-
let layoutNode = this.buildChild(child, x, y);
|
|
711
|
-
x = layoutNode.layoutInfo.rect.maxX;
|
|
712
|
-
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
713
|
-
children.push(layoutNode);
|
|
714
724
|
}
|
|
715
725
|
this.setChildHeights(children, height);
|
|
716
726
|
rect.width = this.layoutInfos.get("header").rect.width;
|
|
@@ -847,8 +857,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
847
857
|
] : [];
|
|
848
858
|
this.persistedIndices.set(layoutInfo.parentKey, indices);
|
|
849
859
|
}
|
|
850
|
-
let index =
|
|
851
|
-
if (layoutInfo.parentKey === "body") index -= this.collection.headerRows.length;
|
|
860
|
+
let index = this.layoutNodes.get(layoutInfo.key).index;
|
|
852
861
|
if (!indices.includes(index)) indices.push(index);
|
|
853
862
|
layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);
|
|
854
863
|
}
|
|
@@ -857,8 +866,12 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
|
|
|
857
866
|
}
|
|
858
867
|
getInitialLayoutInfo(layoutInfo) {
|
|
859
868
|
let res = super.getInitialLayoutInfo(layoutInfo);
|
|
860
|
-
|
|
861
|
-
|
|
869
|
+
res.transform = null;
|
|
870
|
+
return res;
|
|
871
|
+
}
|
|
872
|
+
getFinalLayoutInfo(layoutInfo) {
|
|
873
|
+
let res = super.getFinalLayoutInfo(layoutInfo);
|
|
874
|
+
res.transform = null;
|
|
862
875
|
return res;
|
|
863
876
|
}
|
|
864
877
|
// Checks if Chrome version is 105 or greater
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AA+BD,MAAM,uCAAiB;AAYhB,MAAM,kDAAsB,CAAA,GAAA,aAAK;IAkDtC,cAAc,GAAQ,EAAE;QACtB,IAAI,MAAM,IAAI,CAAC,YAAY,IAAI;QAE/B,yFAAyF;QACzF,kGAAkG;QAClG,yCAAyC;QACzC,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,OAAO,IAAI,CAAC,YAAY,QAAQ,IAAI,CAAC,gBAAgB;YAC9E,IAAI,CAAC,gBAAgB,IAAI,CAAC;YAC1B,IAAI,CAAC,YAAY,IAAI,CAAA,GAAA,WAAG,EAAE,GAAG,GAAG,UAAU;YAC1C,IAAI,CAAC,YAAY,IAAI,CAAC;YACtB,IAAI,CAAC,YAAY,IAAI,CAAA,GAAA,WAAG,EAAE,GAAG,GAAG,IAAI,CAAC,YAAY,OAAO,IAAI,CAAC,YAAY;YACzE,MAAM,IAAI,CAAC,YAAY,IAAI;QAC7B;QAEA,OAAO;IACT;IAEA,sBAAsB,IAAU,EAAE;QAChC,mEAAmE;QACnE,wDAAwD;QACxD,IAAI,CAAC,IAAI,CAAC,UAAU,aAAa,SAAS,IAAI,CAAC,gBAAgB;YAC7D,IAAI,CAAC,gBAAgB,IAAI,CAAC;YAC1B,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU,MAAM;YACtC,IAAI,CAAC,YAAY,IAAI,CAAC;QACxB;QAEA,IAAI,MAAoB,EAAE;QAE1B,IAAI,WAAW,CAAC;YACd,KAAK,IAAI,QAAQ,MACf,IAAI,IAAI,CAAC,UAAU,MAAM,OAAO;g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AAO,IACnF,OAAO,eAAe;QAGxB,OAAO;IACT;IA7lBA,YAAY,OAA8B,CAAE;QAC1C,KAAK,CAAC;aAdR,eAAiC,IAAI;aAErC,aAAa;aACb,YAAY;aACZ,oBAA8B;aAC9B,mBAAuC,IAAI;QAUzC,IAAI,CAAC,aAAa,QAAQ;QAC1B,IAAI,CAAC,sBAAsB,EAAE;QAC7B,IAAI,CAAC,gBAAgB,IAAI,CAAC;QAC1B,IAAI,CAAC,eAAe,QAAQ;QAC5B,IAAI,CAAC,mBAAmB,oBAAoB,GAAG,IAAI,CAAC,aAAa,0CAA0C,IAAI,CAAC,WAAW;QAC3H,IAAI,CAAC,oBAAoB;QACzB,IAAI,CAAC,sBAAsB;QAC3B,IAAI,CAAC,qBAAqB,IAAI,CAAC,aAAa,6BAA6B;IAC3E;AAolBF;","sources":["packages/@react-stately/layout/src/index.ts","packages/@react-stately/layout/src/ListLayout.ts","packages/@react-stately/layout/src/TableLayout.ts"],"sourcesContent":["/*\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 */\nexport type {ListLayoutOptions, LayoutNode} from './ListLayout';\nexport {ListLayout} from './ListLayout';\nexport {TableLayout} from './TableLayout';\n","/*\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\nimport {Collection, DropTarget, DropTargetDelegate, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {InvalidationContext, Layout, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {Key} from 'react';\n// import { DragTarget, DropTarget, DropPosition } from '@react-types/shared';\n\nexport type ListLayoutOptions<T> = {\n /** The height of a row in px. */\n rowHeight?: number,\n estimatedRowHeight?: number,\n headingHeight?: number,\n estimatedHeadingHeight?: number,\n padding?: number,\n indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number,\n collator?: Intl.Collator,\n loaderHeight?: number,\n placeholderHeight?: number,\n allowDisabledKeyFocus?: boolean\n};\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>,\n layoutInfo: LayoutInfo,\n header?: LayoutInfo,\n children?: LayoutNode[],\n validRect: Rect\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * The ListLayout class is an implementation of a collection view {@link Layout}\n * it is used for creating lists and lists with indented sub-lists.\n *\n * To configure a ListLayout, you can use the properties to define the\n * layouts and/or use the method for defining indentation.\n * The {@link ListKeyboardDelegate} extends the existing collection view\n * delegate with an additional method to do this (it uses the same delegate object as\n * the collection view itself).\n */\nexport class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate, DropTargetDelegate {\n protected rowHeight: number;\n protected estimatedRowHeight: number;\n protected headingHeight: number;\n protected estimatedHeadingHeight: number;\n protected padding: number;\n protected indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number;\n protected layoutInfos: Map<Key, LayoutInfo>;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n collection: Collection<Node<T>>;\n disabledKeys: Set<Key> = new Set();\n allowDisabledKeyFocus: boolean = false;\n isLoading: boolean;\n protected lastWidth: number;\n protected lastCollection: Collection<Node<T>>;\n protected rootNodes: LayoutNode[];\n protected collator: Intl.Collator;\n protected invalidateEverything: boolean;\n protected loaderHeight: number;\n protected placeholderHeight: number;\n protected lastValidRect: Rect;\n protected validRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions<T> = {}) {\n super();\n this.rowHeight = options.rowHeight;\n this.estimatedRowHeight = options.estimatedRowHeight;\n this.headingHeight = options.headingHeight;\n this.estimatedHeadingHeight = options.estimatedHeadingHeight;\n this.padding = options.padding || 0;\n this.indentationForItem = options.indentationForItem;\n this.collator = options.collator;\n this.loaderHeight = options.loaderHeight;\n this.placeholderHeight = options.placeholderHeight;\n this.layoutInfos = new Map();\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastWidth = 0;\n this.lastCollection = null;\n this.allowDisabledKeyFocus = options.allowDisabledKeyFocus;\n this.lastValidRect = new Rect();\n this.validRect = new Rect();\n this.contentSize = new Size();\n }\n\n getLayoutInfo(key: Key) {\n let res = this.layoutInfos.get(key);\n\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (!res && this.validRect.area < this.contentSize.area && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.validRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n res = this.layoutInfos.get(key);\n }\n\n return res;\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n if (node.header) {\n res.push(node.header);\n }\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n isVisible(node: LayoutNode, rect: Rect) {\n return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || this.virtualizer.isPersistedKey(node.layoutInfo.key);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<Node<T>, unknown>) {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n return invalidationContext.sizeChanged;\n }\n\n validate(invalidationContext: InvalidationContext<Node<T>, unknown>) {\n this.collection = this.virtualizer.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.lastValidRect = this.validRect;\n this.validRect = this.virtualizer.getVisibleRect();\n }\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && this.collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!this.collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutInfos.delete(layoutNode.layoutInfo.key);\n this.layoutInfos.delete(layoutNode.header?.key);\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastWidth = this.virtualizer.visibleRect.width;\n this.lastCollection = this.collection;\n this.invalidateEverything = false;\n }\n\n buildCollection(): LayoutNode[] {\n let y = this.padding;\n let skipped = 0;\n let nodes = [];\n for (let node of this.collection) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (node.type === 'item' && y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n y = layoutNode.layoutInfo.rect.maxY;\n nodes.push(layoutNode);\n\n if (node.type === 'item' && y > this.validRect.maxY) {\n y += (this.collection.size - (nodes.length + skipped)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n let rect = new Rect(0, y, this.virtualizer.visibleRect.width,\n this.loaderHeight ?? this.virtualizer.visibleRect.height);\n let loader = new LayoutInfo('loader', 'loader', rect);\n this.layoutInfos.set('loader', loader);\n nodes.push({layoutInfo: loader});\n y = loader.rect.maxY;\n }\n\n if (nodes.length === 0) {\n let rect = new Rect(0, y, this.virtualizer.visibleRect.width,\n this.placeholderHeight ?? this.virtualizer.visibleRect.height);\n let placeholder = new LayoutInfo('placeholder', 'placeholder', rect);\n this.layoutInfos.set('placeholder', placeholder);\n nodes.push({layoutInfo: placeholder});\n y = placeholder.rect.maxY;\n }\n\n this.contentSize = new Size(this.virtualizer.visibleRect.width, y + this.padding);\n return nodes;\n }\n\n isValid(node: Node<T>, y: number) {\n let cached = this.layoutNodes.get(node.key);\n return (\n !this.invalidateEverything &&\n cached &&\n cached.node === node &&\n y === (cached.header || cached.layoutInfo).rect.y &&\n cached.layoutInfo.rect.intersects(this.lastValidRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.validRect))\n );\n }\n\n buildChild(node: Node<T>, x: number, y: number): LayoutNode {\n if (this.isValid(node, y)) {\n return this.layoutNodes.get(node.key);\n }\n\n let layoutNode = this.buildNode(node, x, y);\n layoutNode.node = node;\n\n layoutNode.layoutInfo.parentKey = node.parentKey ?? null;\n this.layoutInfos.set(layoutNode.layoutInfo.key, layoutNode.layoutInfo);\n if (layoutNode.header) {\n this.layoutInfos.set(layoutNode.header.key, layoutNode.header);\n }\n\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n }\n }\n\n buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer.visibleRect.width;\n let rectHeight = this.headingHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode && previousLayoutNode.header) {\n let curNode = this.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode.header.rect.height;\n isEstimated = width !== this.lastWidth || curNode !== lastNode || previousLayoutNode.header.estimatedSize;\n } else {\n rectHeight = (node.rendered ? this.estimatedHeadingHeight : 0);\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect = new Rect(0, y, width, rectHeight);\n let header = new LayoutInfo('header', node.key + ':header', headerRect);\n header.estimatedSize = isEstimated;\n header.parentKey = node.key;\n y += header.rect.height;\n\n let rect = new Rect(0, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let startY = y;\n let skipped = 0;\n let children = [];\n for (let child of getChildNodes(node, this.collection)) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(child, x, y);\n y = layoutNode.layoutInfo.rect.maxY;\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += ([...getChildNodes(node, this.collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n rect.height = y - startY;\n\n return {\n header,\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer.visibleRect.width;\n let rectHeight = this.rowHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = width !== this.lastWidth || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowHeight;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n if (typeof this.indentationForItem === 'function') {\n x += this.indentationForItem(this.collection, node.key) || 0;\n }\n\n let rect = new Rect(x, y, width - x, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n // allow overflow so the focus ring/selection ring can extend outside to overlap with the adjacent items borders\n layoutInfo.allowOverflow = true;\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutInfo = this.layoutInfos.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutInfo) {\n return false;\n }\n\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect.height !== size.height) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n this.layoutInfos.set(key, newLayoutInfo);\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = this.collection.getItem(layoutInfo.parentKey);\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = this.collection.getItem(node.parentKey);\n }\n\n return true;\n }\n\n return false;\n }\n\n updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by reseting validRect.\n n.validRect = new Rect();\n\n // Replace layout info in LayoutNode\n if (n.header === oldLayoutInfo) {\n n.header = newLayoutInfo;\n } else if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize() {\n return this.contentSize;\n }\n\n getKeyAbove(key: Key): Key | null {\n let collection = this.collection;\n\n key = collection.getKeyBefore(key);\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyBefore(key);\n }\n }\n\n getKeyBelow(key: Key): Key | null {\n let collection = this.collection;\n\n key = collection.getKeyAfter(key);\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyAfter(key);\n }\n }\n\n getKeyPageAbove(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key);\n\n if (layoutInfo) {\n let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);\n while (layoutInfo && layoutInfo.rect.y > pageY) {\n let keyAbove = this.getKeyAbove(layoutInfo.key);\n layoutInfo = this.getLayoutInfo(keyAbove);\n }\n\n if (layoutInfo) {\n return layoutInfo.key;\n }\n }\n\n return this.getFirstKey();\n }\n\n getKeyPageBelow(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key != null ? key : this.getFirstKey());\n\n if (layoutInfo) {\n let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);\n while (layoutInfo && layoutInfo.rect.y < pageY) {\n let keyBelow = this.getKeyBelow(layoutInfo.key);\n layoutInfo = this.getLayoutInfo(keyBelow);\n }\n\n if (layoutInfo) {\n return layoutInfo.key;\n }\n }\n\n return this.getLastKey();\n }\n\n getFirstKey(): Key | null {\n let collection = this.collection;\n let key = collection.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyAfter(key);\n }\n }\n\n getLastKey(): Key | null {\n let collection = this.collection;\n let key = collection.getLastKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyBefore(key);\n }\n }\n\n getKeyForSearch(search: string, fromKey?: Key): Key | null {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey || this.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n let substring = item.textValue.slice(0, search.length);\n if (item.textValue && this.collator.compare(substring, search) === 0) {\n return key;\n }\n\n key = this.getKeyBelow(key);\n }\n\n return null;\n }\n\n getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n layoutInfo.opacity = 0;\n layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';\n return layoutInfo;\n }\n\n getFinalLayoutInfo(layoutInfo: LayoutInfo) {\n layoutInfo.opacity = 0;\n layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';\n return layoutInfo;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n let key = this.virtualizer.keyAtPoint(new Point(x, y));\n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n}\n","/*\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\nimport {ColumnSize, TableCollection} from '@react-types/table';\nimport {DropTarget, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {GridNode} from '@react-types/grid';\nimport {InvalidationContext, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {Key} from 'react';\nimport {LayoutNode, ListLayout, ListLayoutOptions} from './ListLayout';\nimport {TableColumnLayout} from '@react-stately/table';\n\ntype TableLayoutOptions<T> = ListLayoutOptions<T> & {\n columnLayout: TableColumnLayout<T>,\n initialCollection: TableCollection<T>\n}\n\nexport class TableLayout<T> extends ListLayout<T> {\n collection: TableCollection<T>;\n lastCollection: TableCollection<T>;\n columnWidths: Map<Key, number> = new Map();\n stickyColumnIndices: number[];\n wasLoading = false;\n isLoading = false;\n lastPersistedKeys: Set<Key> = null;\n persistedIndices: Map<Key, number[]> = new Map();\n private disableSticky: boolean;\n columnLayout: TableColumnLayout<T>;\n controlledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledWidths: Map<Key, ColumnSize>;\n resizingColumn: Key | null;\n\n constructor(options: TableLayoutOptions<T>) {\n super(options);\n this.collection = options.initialCollection;\n this.stickyColumnIndices = [];\n this.disableSticky = this.checkChrome105();\n this.columnLayout = options.columnLayout;\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n this.uncontrolledWidths = this.columnLayout.getInitialUncontrolledWidths(uncontrolledColumns);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<Node<T>, unknown>): boolean {\n // If columns changed, clear layout cache.\n return super.shouldInvalidateEverything(invalidationContext) || (\n !this.lastCollection ||\n this.collection.columns.length !== this.lastCollection.columns.length ||\n this.collection.columns.some((c, i) =>\n c.key !== this.lastCollection.columns[i].key ||\n c.props.width !== this.lastCollection.columns[i].props.width ||\n c.props.minWidth !== this.lastCollection.columns[i].props.minWidth ||\n c.props.maxWidth !== this.lastCollection.columns[i].props.maxWidth\n )\n );\n }\n\n getResizerPosition(): Key {\n return this.getLayoutInfo(this.resizingColumn)?.rect.maxX;\n }\n\n getColumnWidth(key: Key): number {\n return this.columnLayout.getColumnWidth(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMinWidth(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMaxWidth(key);\n }\n\n // outside, where this is called, should call props.onColumnResizeStart...\n startResize(key: Key): void {\n this.resizingColumn = key;\n }\n\n // only way to call props.onColumnResize with the new size outside of Layout is to send the result back\n updateResizedColumns(key: Key, width: number): Map<Key, ColumnSize> {\n let newControlled = new Map(Array.from(this.controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = this.columnLayout.resizeColumnWidth(this.virtualizer.visibleRect.width, this.collection, newControlled, this.uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(this.uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n this.uncontrolledWidths = map;\n // relayoutNow still uses setState, should happen at the same time the parent\n // component's state is processed as a result of props.onColumnResize\n if (this.uncontrolledWidths.size > 0) {\n this.virtualizer.relayoutNow({sizeChanged: true});\n }\n return newSizes;\n }\n\n endResize(): void {\n this.resizingColumn = null;\n }\n\n buildCollection(): LayoutNode[] {\n // Track whether we were previously loading. This is used to adjust the animations of async loading vs inserts.\n let loadingState = this.collection.body.props.loadingState;\n this.wasLoading = this.isLoading;\n this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n this.stickyColumnIndices = [];\n\n for (let column of this.collection.columns) {\n // The selection cell and any other sticky columns always need to be visible.\n // In addition, row headers need to be in the DOM for accessibility labeling.\n if (column.props.isDragButtonCell || column.props.isSelectionCell || this.collection.rowHeaderColumnKeys.has(column.key)) {\n this.stickyColumnIndices.push(column.index);\n }\n }\n\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n let colWidths = this.columnLayout.recombineColumns(this.collection.columns, this.uncontrolledWidths, uncontrolledColumns, controlledColumns);\n\n this.columnWidths = this.columnLayout.buildColumnWidths(this.virtualizer.visibleRect.width, this.collection, colWidths);\n\n let header = this.buildHeader();\n let body = this.buildBody(0);\n this.lastPersistedKeys = null;\n\n body.layoutInfo.rect.width = Math.max(header.layoutInfo.rect.width, body.layoutInfo.rect.width);\n this.contentSize = new Size(body.layoutInfo.rect.width, body.layoutInfo.rect.maxY);\n return [\n header,\n body\n ];\n }\n\n buildHeader(): LayoutNode {\n let rect = new Rect(0, 0, 0, 0);\n let layoutInfo = new LayoutInfo('header', 'header', rect);\n\n let y = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let headerRow of this.collection.headerRows) {\n let layoutNode = this.buildChild(headerRow, 0, y);\n layoutNode.layoutInfo.parentKey = 'header';\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n }\n\n rect.width = width;\n rect.height = y;\n\n this.layoutInfos.set('header', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect\n };\n }\n\n buildHeaderRow(headerRow: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let row = new LayoutInfo('headerrow', headerRow.key, rect);\n\n let height = 0;\n let columns: LayoutNode[] = [];\n for (let cell of getChildNodes(headerRow, this.collection)) {\n let layoutNode = this.buildChild(cell, x, y);\n layoutNode.layoutInfo.parentKey = row.key;\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n columns.push(layoutNode);\n }\n for (let [i, layout] of columns.entries()) {\n layout.layoutInfo.zIndex = columns.length - i + 1;\n }\n\n this.setChildHeights(columns, height);\n\n rect.height = height;\n rect.width = x;\n\n return {\n layoutInfo: row,\n children: columns,\n validRect: rect\n };\n }\n\n setChildHeights(children: LayoutNode[], height: number) {\n for (let child of children) {\n if (child.layoutInfo.rect.height !== height) {\n // Need to copy the layout info before we mutate it.\n child.layoutInfo = child.layoutInfo.copy();\n this.layoutInfos.set(child.layoutInfo.key, child.layoutInfo);\n\n child.layoutInfo.rect.height = height;\n }\n }\n }\n\n // used to get the column widths when rendering to the DOM\n getRenderedColumnWidth(node: GridNode<T>) {\n let colspan = node.colspan ?? 1;\n let colIndex = node.colIndex ?? node.index;\n let width = 0;\n for (let i = colIndex; i < colIndex + colspan; i++) {\n let column = this.collection.columns[i];\n if (column?.key != null) {\n width += this.columnWidths.get(column.key);\n }\n }\n\n return width;\n }\n\n getEstimatedHeight(node: GridNode<T>, width: number, height: number, estimatedHeight: number) {\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (height == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n height = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = node !== previousLayoutNode.node || width !== previousLayoutNode.layoutInfo.rect.width || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n height = estimatedHeight;\n isEstimated = true;\n }\n }\n\n return {height, isEstimated};\n }\n\n buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.headingHeight, this.estimatedHeadingHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n buildBody(y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let layoutInfo = new LayoutInfo('rowgroup', 'body', rect);\n\n let startY = y;\n let skipped = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let node of this.collection) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight) + 1;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n layoutNode.layoutInfo.parentKey = 'body';\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += (this.collection.size - (skipped + children.length)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n // Add some margin around the loader to ensure that scrollbars don't flicker in and out.\n let rect = new Rect(40, Math.max(y, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60);\n let loader = new LayoutInfo('loader', 'loader', rect);\n loader.parentKey = 'body';\n loader.isSticky = !this.disableSticky && children.length === 0;\n this.layoutInfos.set('loader', loader);\n children.push({layoutInfo: loader, validRect: loader.rect});\n y = loader.rect.maxY;\n width = Math.max(width, rect.width);\n } else if (children.length === 0) {\n let rect = new Rect(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);\n let empty = new LayoutInfo('empty', 'empty', rect);\n empty.parentKey = 'body';\n empty.isSticky = !this.disableSticky;\n this.layoutInfos.set('empty', empty);\n children.push({layoutInfo: empty, validRect: empty.rect});\n y = empty.rect.maxY;\n width = Math.max(width, rect.width);\n }\n\n rect.width = width;\n rect.height = y - startY;\n\n this.layoutInfos.set('body', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildNode(node: GridNode<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'headerrow':\n return this.buildHeaderRow(node, x, y);\n case 'item':\n return this.buildRow(node, x, y);\n case 'column':\n case 'placeholder':\n return this.buildColumn(node, x, y);\n case 'cell':\n return this.buildCell(node, x, y);\n default:\n throw new Error('Unknown node type ' + node.type);\n }\n }\n\n buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, 0, 0);\n let layoutInfo = new LayoutInfo('row', node.key, rect);\n\n let children: LayoutNode[] = [];\n let height = 0;\n for (let child of getChildNodes(node, this.collection)) {\n if (x > this.validRect.maxX) {\n // Adjust existing cached layoutInfo to ensure that it is out of view.\n // This can happen due to column resizing.\n let layoutNode = this.layoutNodes.get(child.key);\n if (layoutNode) {\n layoutNode.layoutInfo.rect.x = x;\n x += layoutNode.layoutInfo.rect.width;\n }\n } else {\n let layoutNode = this.buildChild(child, x, y);\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n children.push(layoutNode);\n }\n }\n\n this.setChildHeights(children, height);\n\n rect.width = this.layoutInfos.get('header').rect.width;\n rect.height = height + 1; // +1 for bottom border\n\n return {\n layoutInfo,\n children,\n validRect: rect.intersection(this.validRect)\n };\n }\n\n buildCell(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.rowHeight, this.estimatedRowHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: rect\n };\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n this.buildPersistedIndices();\n for (let node of this.rootNodes) {\n res.push(node.layoutInfo);\n this.addVisibleLayoutInfos(res, node, rect);\n }\n\n return res;\n }\n\n addVisibleLayoutInfos(res: LayoutInfo[], node: LayoutNode, rect: Rect) {\n if (!node.children || node.children.length === 0) {\n return;\n }\n\n switch (node.layoutInfo.type) {\n case 'header': {\n for (let child of node.children) {\n res.push(child.layoutInfo);\n this.addVisibleLayoutInfos(res, child, rect);\n }\n break;\n }\n case 'rowgroup': {\n let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, 'y');\n let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, 'y');\n\n // Add persisted rows before the visible rows.\n let persistedRowIndices = this.persistedIndices.get(node.layoutInfo.key);\n let persistIndex = 0;\n while (\n persistedRowIndices &&\n persistIndex < persistedRowIndices.length &&\n persistedRowIndices[persistIndex] < firstVisibleRow\n ) {\n let idx = persistedRowIndices[persistIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[idx], rect);\n }\n persistIndex++;\n }\n\n for (let i = firstVisibleRow; i <= lastVisibleRow; i++) {\n // Skip persisted rows that overlap with visible cells.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length && persistedRowIndices[persistIndex] < i) {\n persistIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[i], rect);\n }\n\n // Add persisted rows after the visible rows.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length) {\n let idx = persistedRowIndices[persistIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n case 'headerrow':\n case 'row': {\n let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, 'x');\n let lastVisibleCell = this.binarySearch(node.children, rect.topRight, 'x');\n let stickyIndex = 0;\n\n // Add persisted/sticky cells before the visible cells.\n let persistedCellIndices = this.persistedIndices.get(node.layoutInfo.key) || this.stickyColumnIndices;\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < firstVisibleCell) {\n let idx = persistedCellIndices[stickyIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n stickyIndex++;\n }\n\n for (let i = firstVisibleCell; i <= lastVisibleCell; i++) {\n // Skip sticky cells that overlap with visible cells.\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < i) {\n stickyIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n }\n\n // Add any remaining sticky cells after the visible cells.\n while (stickyIndex < persistedCellIndices.length) {\n let idx = persistedCellIndices[stickyIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n default:\n throw new Error('Unknown node type ' + node.layoutInfo.type);\n }\n }\n\n binarySearch(items: LayoutNode[], point: Point, axis: 'x' | 'y') {\n let low = 0;\n let high = items.length - 1;\n while (low <= high) {\n let mid = (low + high) >> 1;\n let item = items[mid];\n\n if ((axis === 'x' && item.layoutInfo.rect.maxX < point.x) || (axis === 'y' && item.layoutInfo.rect.maxY < point.y)) {\n low = mid + 1;\n } else if ((axis === 'x' && item.layoutInfo.rect.x > point.x) || (axis === 'y' && item.layoutInfo.rect.y > point.y)) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.max(0, Math.min(items.length - 1, low));\n }\n\n buildPersistedIndices() {\n if (this.virtualizer.persistedKeys === this.lastPersistedKeys) {\n return;\n }\n\n this.lastPersistedKeys = this.virtualizer.persistedKeys;\n this.persistedIndices.clear();\n\n // Build a map of parentKey => indices of children to persist.\n for (let key of this.virtualizer.persistedKeys) {\n let layoutInfo = this.layoutInfos.get(key);\n\n // Walk up ancestors so parents are also persisted if children are.\n while (layoutInfo && layoutInfo.parentKey) {\n let collectionNode = this.collection.getItem(layoutInfo.key);\n let indices = this.persistedIndices.get(layoutInfo.parentKey);\n if (!indices) {\n // stickyColumnIndices are always persisted along with any cells from persistedKeys.\n indices = collectionNode.type === 'cell' || collectionNode.type === 'column' ? [...this.stickyColumnIndices] : [];\n this.persistedIndices.set(layoutInfo.parentKey, indices);\n }\n\n let index = collectionNode.index;\n if (layoutInfo.parentKey === 'body') {\n index -= this.collection.headerRows.length;\n }\n\n if (!indices.includes(index)) {\n indices.push(index);\n }\n\n layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);\n }\n }\n\n for (let indices of this.persistedIndices.values()) {\n indices.sort((a, b) => a - b);\n }\n }\n\n getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n let res = super.getInitialLayoutInfo(layoutInfo);\n\n // If this insert was the result of async loading, remove the zoom effect and just keep the fade in.\n if (this.wasLoading) {\n res.transform = null;\n }\n\n return res;\n }\n\n // Checks if Chrome version is 105 or greater\n private checkChrome105() {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n\n let isChrome105;\n if (window.navigator['userAgentData']) {\n isChrome105 = window.navigator['userAgentData']?.brands.some(b => b.brand === 'Chromium' && Number(b.version) === 105);\n } else {\n let regex = /Chrome\\/(\\d+)/;\n let matches = regex.exec(window.navigator.userAgent);\n isChrome105 = matches && matches.length >= 2 && Number(matches[1]) === 105;\n }\n\n return isChrome105;\n }\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n // Offset for height of header row\n y -= this.virtualizer.layout.getVisibleLayoutInfos(new Rect(x, y, 1, 1)).find(info => info.type === 'headerrow')?.rect.height;\n\n // Custom variation of this.virtualizer.keyAtPoint that ignores body\n let key: Key;\n let point = new Point(x, y);\n let rectAtPoint = new Rect(point.x, point.y, 1, 1);\n let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter(info => info.type === 'row');\n\n // Layout may return multiple layout infos in the case of\n // persisted keys, so find the first one that actually intersects.\n for (let layoutInfo of layoutInfos) {\n if (layoutInfo.rect.intersects(rectAtPoint)) {\n key = layoutInfo.key;\n }\n }\n \n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;AAAA;;;;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nF,OAAO,eAAe;QAGxB,OAAO;IACT;IAjmBA,YAAY,OAA8B,CAAE;QAC1C,KAAK,CAAC;aAdR,eAAiC,IAAI;aAErC,aAAa;aACb,YAAY;aACZ,oBAA8B;aAC9B,mBAAuC,IAAI;QAUzC,IAAI,CAAC,aAAa,QAAQ;QAC1B,IAAI,CAAC,sBAAsB,EAAE;QAC7B,IAAI,CAAC,gBAAgB,IAAI,CAAC;QAC1B,IAAI,CAAC,eAAe,QAAQ;QAC5B,IAAI,CAAC,mBAAmB,oBAAoB,GAAG,IAAI,CAAC,aAAa,0CAA0C,IAAI,CAAC,WAAW;QAC3H,IAAI,CAAC,oBAAoB;QACzB,IAAI,CAAC,sBAAsB;QAC3B,IAAI,CAAC,qBAAqB,IAAI,CAAC,aAAa,6BAA6B;IAC3E;AAwlBF;","sources":["packages/@react-stately/layout/src/index.ts","packages/@react-stately/layout/src/ListLayout.ts","packages/@react-stately/layout/src/TableLayout.ts"],"sourcesContent":["/*\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 */\nexport type {ListLayoutOptions, LayoutNode} from './ListLayout';\nexport {ListLayout} from './ListLayout';\nexport {TableLayout} from './TableLayout';\n","/*\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\nimport {Collection, DropTarget, DropTargetDelegate, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {InvalidationContext, Layout, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {Key} from 'react';\n// import { DragTarget, DropTarget, DropPosition } from '@react-types/shared';\n\nexport type ListLayoutOptions<T> = {\n /** The height of a row in px. */\n rowHeight?: number,\n estimatedRowHeight?: number,\n headingHeight?: number,\n estimatedHeadingHeight?: number,\n padding?: number,\n indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number,\n collator?: Intl.Collator,\n loaderHeight?: number,\n placeholderHeight?: number,\n allowDisabledKeyFocus?: boolean\n};\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>,\n layoutInfo: LayoutInfo,\n header?: LayoutInfo,\n children?: LayoutNode[],\n validRect: Rect,\n index?: number\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * The ListLayout class is an implementation of a collection view {@link Layout}\n * it is used for creating lists and lists with indented sub-lists.\n *\n * To configure a ListLayout, you can use the properties to define the\n * layouts and/or use the method for defining indentation.\n * The {@link ListKeyboardDelegate} extends the existing collection view\n * delegate with an additional method to do this (it uses the same delegate object as\n * the collection view itself).\n */\nexport class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate, DropTargetDelegate {\n protected rowHeight: number;\n protected estimatedRowHeight: number;\n protected headingHeight: number;\n protected estimatedHeadingHeight: number;\n protected padding: number;\n protected indentationForItem?: (collection: Collection<Node<T>>, key: Key) => number;\n protected layoutInfos: Map<Key, LayoutInfo>;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n collection: Collection<Node<T>>;\n disabledKeys: Set<Key> = new Set();\n allowDisabledKeyFocus: boolean = false;\n isLoading: boolean;\n protected lastWidth: number;\n protected lastCollection: Collection<Node<T>>;\n protected rootNodes: LayoutNode[];\n protected collator: Intl.Collator;\n protected invalidateEverything: boolean;\n protected loaderHeight: number;\n protected placeholderHeight: number;\n protected lastValidRect: Rect;\n protected validRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions<T> = {}) {\n super();\n this.rowHeight = options.rowHeight;\n this.estimatedRowHeight = options.estimatedRowHeight;\n this.headingHeight = options.headingHeight;\n this.estimatedHeadingHeight = options.estimatedHeadingHeight;\n this.padding = options.padding || 0;\n this.indentationForItem = options.indentationForItem;\n this.collator = options.collator;\n this.loaderHeight = options.loaderHeight;\n this.placeholderHeight = options.placeholderHeight;\n this.layoutInfos = new Map();\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastWidth = 0;\n this.lastCollection = null;\n this.allowDisabledKeyFocus = options.allowDisabledKeyFocus;\n this.lastValidRect = new Rect();\n this.validRect = new Rect();\n this.contentSize = new Size();\n }\n\n getLayoutInfo(key: Key) {\n let res = this.layoutInfos.get(key);\n\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (!res && this.validRect.area < this.contentSize.area && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.validRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n res = this.layoutInfos.get(key);\n }\n\n return res;\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n if (node.header) {\n res.push(node.header);\n }\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n isVisible(node: LayoutNode, rect: Rect) {\n return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || this.virtualizer.isPersistedKey(node.layoutInfo.key);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<Node<T>, unknown>) {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n return invalidationContext.sizeChanged;\n }\n\n validate(invalidationContext: InvalidationContext<Node<T>, unknown>) {\n this.collection = this.virtualizer.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.lastValidRect = this.validRect;\n this.validRect = this.virtualizer.getVisibleRect();\n }\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && this.collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!this.collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutInfos.delete(layoutNode.layoutInfo.key);\n this.layoutInfos.delete(layoutNode.header?.key);\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastWidth = this.virtualizer.visibleRect.width;\n this.lastCollection = this.collection;\n this.invalidateEverything = false;\n }\n\n buildCollection(): LayoutNode[] {\n let y = this.padding;\n let skipped = 0;\n let nodes = [];\n for (let node of this.collection) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (node.type === 'item' && y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n y = layoutNode.layoutInfo.rect.maxY;\n nodes.push(layoutNode);\n\n if (node.type === 'item' && y > this.validRect.maxY) {\n y += (this.collection.size - (nodes.length + skipped)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n let rect = new Rect(0, y, this.virtualizer.visibleRect.width,\n this.loaderHeight ?? this.virtualizer.visibleRect.height);\n let loader = new LayoutInfo('loader', 'loader', rect);\n this.layoutInfos.set('loader', loader);\n nodes.push({layoutInfo: loader});\n y = loader.rect.maxY;\n }\n\n if (nodes.length === 0) {\n let rect = new Rect(0, y, this.virtualizer.visibleRect.width,\n this.placeholderHeight ?? this.virtualizer.visibleRect.height);\n let placeholder = new LayoutInfo('placeholder', 'placeholder', rect);\n this.layoutInfos.set('placeholder', placeholder);\n nodes.push({layoutInfo: placeholder});\n y = placeholder.rect.maxY;\n }\n\n this.contentSize = new Size(this.virtualizer.visibleRect.width, y + this.padding);\n return nodes;\n }\n\n isValid(node: Node<T>, y: number) {\n let cached = this.layoutNodes.get(node.key);\n return (\n !this.invalidateEverything &&\n cached &&\n cached.node === node &&\n y === (cached.header || cached.layoutInfo).rect.y &&\n cached.layoutInfo.rect.intersects(this.lastValidRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.validRect))\n );\n }\n\n buildChild(node: Node<T>, x: number, y: number): LayoutNode {\n if (this.isValid(node, y)) {\n return this.layoutNodes.get(node.key);\n }\n\n let layoutNode = this.buildNode(node, x, y);\n layoutNode.node = node;\n\n layoutNode.layoutInfo.parentKey = node.parentKey ?? null;\n this.layoutInfos.set(layoutNode.layoutInfo.key, layoutNode.layoutInfo);\n if (layoutNode.header) {\n this.layoutInfos.set(layoutNode.header.key, layoutNode.header);\n }\n\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n }\n }\n\n buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer.visibleRect.width;\n let rectHeight = this.headingHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode && previousLayoutNode.header) {\n let curNode = this.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutNode.header.rect.height;\n isEstimated = width !== this.lastWidth || curNode !== lastNode || previousLayoutNode.header.estimatedSize;\n } else {\n rectHeight = (node.rendered ? this.estimatedHeadingHeight : 0);\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect = new Rect(0, y, width, rectHeight);\n let header = new LayoutInfo('header', node.key + ':header', headerRect);\n header.estimatedSize = isEstimated;\n header.parentKey = node.key;\n y += header.rect.height;\n\n let rect = new Rect(0, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let startY = y;\n let skipped = 0;\n let children = [];\n for (let child of getChildNodes(node, this.collection)) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(child, x, y);\n y = layoutNode.layoutInfo.rect.maxY;\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += ([...getChildNodes(node, this.collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n rect.height = y - startY;\n\n return {\n header,\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer.visibleRect.width;\n let rectHeight = this.rowHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = width !== this.lastWidth || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowHeight;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n if (typeof this.indentationForItem === 'function') {\n x += this.indentationForItem(this.collection, node.key) || 0;\n }\n\n let rect = new Rect(x, y, width - x, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n // allow overflow so the focus ring/selection ring can extend outside to overlap with the adjacent items borders\n layoutInfo.allowOverflow = true;\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutInfo = this.layoutInfos.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutInfo) {\n return false;\n }\n\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect.height !== size.height) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n this.layoutInfos.set(key, newLayoutInfo);\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = this.collection.getItem(layoutInfo.parentKey);\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = this.collection.getItem(node.parentKey);\n }\n\n return true;\n }\n\n return false;\n }\n\n updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by reseting validRect.\n n.validRect = new Rect();\n\n // Replace layout info in LayoutNode\n if (n.header === oldLayoutInfo) {\n n.header = newLayoutInfo;\n } else if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize() {\n return this.contentSize;\n }\n\n getKeyAbove(key: Key): Key | null {\n let collection = this.collection;\n\n key = collection.getKeyBefore(key);\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyBefore(key);\n }\n }\n\n getKeyBelow(key: Key): Key | null {\n let collection = this.collection;\n\n key = collection.getKeyAfter(key);\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyAfter(key);\n }\n }\n\n getKeyPageAbove(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key);\n\n if (layoutInfo) {\n let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);\n while (layoutInfo && layoutInfo.rect.y > pageY) {\n let keyAbove = this.getKeyAbove(layoutInfo.key);\n layoutInfo = this.getLayoutInfo(keyAbove);\n }\n\n if (layoutInfo) {\n return layoutInfo.key;\n }\n }\n\n return this.getFirstKey();\n }\n\n getKeyPageBelow(key: Key): Key | null {\n let layoutInfo = this.getLayoutInfo(key != null ? key : this.getFirstKey());\n\n if (layoutInfo) {\n let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);\n while (layoutInfo && layoutInfo.rect.y < pageY) {\n let keyBelow = this.getKeyBelow(layoutInfo.key);\n layoutInfo = this.getLayoutInfo(keyBelow);\n }\n\n if (layoutInfo) {\n return layoutInfo.key;\n }\n }\n\n return this.getLastKey();\n }\n\n getFirstKey(): Key | null {\n let collection = this.collection;\n let key = collection.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyAfter(key);\n }\n }\n\n getLastKey(): Key | null {\n let collection = this.collection;\n let key = collection.getLastKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) {\n return key;\n }\n\n key = collection.getKeyBefore(key);\n }\n }\n\n getKeyForSearch(search: string, fromKey?: Key): Key | null {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey || this.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n let substring = item.textValue.slice(0, search.length);\n if (item.textValue && this.collator.compare(substring, search) === 0) {\n return key;\n }\n\n key = this.getKeyBelow(key);\n }\n\n return null;\n }\n\n getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n layoutInfo.opacity = 0;\n layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';\n return layoutInfo;\n }\n\n getFinalLayoutInfo(layoutInfo: LayoutInfo) {\n layoutInfo.opacity = 0;\n layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';\n return layoutInfo;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n let key = this.virtualizer.keyAtPoint(new Point(x, y));\n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n}\n","/*\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\nimport {ColumnSize, TableCollection} from '@react-types/table';\nimport {DropTarget, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {GridNode} from '@react-types/grid';\nimport {InvalidationContext, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {Key} from 'react';\nimport {LayoutNode, ListLayout, ListLayoutOptions} from './ListLayout';\nimport {TableColumnLayout} from '@react-stately/table';\n\ntype TableLayoutOptions<T> = ListLayoutOptions<T> & {\n columnLayout: TableColumnLayout<T>,\n initialCollection: TableCollection<T>\n}\n\nexport class TableLayout<T> extends ListLayout<T> {\n collection: TableCollection<T>;\n lastCollection: TableCollection<T>;\n columnWidths: Map<Key, number> = new Map();\n stickyColumnIndices: number[];\n wasLoading = false;\n isLoading = false;\n lastPersistedKeys: Set<Key> = null;\n persistedIndices: Map<Key, number[]> = new Map();\n private disableSticky: boolean;\n columnLayout: TableColumnLayout<T>;\n controlledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledWidths: Map<Key, ColumnSize>;\n resizingColumn: Key | null;\n\n constructor(options: TableLayoutOptions<T>) {\n super(options);\n this.collection = options.initialCollection;\n this.stickyColumnIndices = [];\n this.disableSticky = this.checkChrome105();\n this.columnLayout = options.columnLayout;\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n this.uncontrolledWidths = this.columnLayout.getInitialUncontrolledWidths(uncontrolledColumns);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<Node<T>, unknown>): boolean {\n // If columns changed, clear layout cache.\n return super.shouldInvalidateEverything(invalidationContext) || (\n !this.lastCollection ||\n this.collection.columns.length !== this.lastCollection.columns.length ||\n this.collection.columns.some((c, i) =>\n c.key !== this.lastCollection.columns[i].key ||\n c.props.width !== this.lastCollection.columns[i].props.width ||\n c.props.minWidth !== this.lastCollection.columns[i].props.minWidth ||\n c.props.maxWidth !== this.lastCollection.columns[i].props.maxWidth\n )\n );\n }\n\n getResizerPosition(): Key {\n return this.getLayoutInfo(this.resizingColumn)?.rect.maxX;\n }\n\n getColumnWidth(key: Key): number {\n return this.columnLayout.getColumnWidth(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMinWidth(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMaxWidth(key);\n }\n\n // outside, where this is called, should call props.onColumnResizeStart...\n startResize(key: Key): void {\n this.resizingColumn = key;\n }\n\n // only way to call props.onColumnResize with the new size outside of Layout is to send the result back\n updateResizedColumns(key: Key, width: number): Map<Key, ColumnSize> {\n let newControlled = new Map(Array.from(this.controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = this.columnLayout.resizeColumnWidth(this.virtualizer.visibleRect.width, this.collection, newControlled, this.uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(this.uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n this.uncontrolledWidths = map;\n // relayoutNow still uses setState, should happen at the same time the parent\n // component's state is processed as a result of props.onColumnResize\n if (this.uncontrolledWidths.size > 0) {\n this.virtualizer.relayoutNow({sizeChanged: true});\n }\n return newSizes;\n }\n\n endResize(): void {\n this.resizingColumn = null;\n }\n\n buildCollection(): LayoutNode[] {\n // Track whether we were previously loading. This is used to adjust the animations of async loading vs inserts.\n let loadingState = this.collection.body.props.loadingState;\n this.wasLoading = this.isLoading;\n this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n this.stickyColumnIndices = [];\n\n for (let column of this.collection.columns) {\n // The selection cell and any other sticky columns always need to be visible.\n // In addition, row headers need to be in the DOM for accessibility labeling.\n if (column.props.isDragButtonCell || column.props.isSelectionCell || this.collection.rowHeaderColumnKeys.has(column.key)) {\n this.stickyColumnIndices.push(column.index);\n }\n }\n\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n let colWidths = this.columnLayout.recombineColumns(this.collection.columns, this.uncontrolledWidths, uncontrolledColumns, controlledColumns);\n\n this.columnWidths = this.columnLayout.buildColumnWidths(this.virtualizer.visibleRect.width, this.collection, colWidths);\n\n let header = this.buildHeader();\n let body = this.buildBody(0);\n this.lastPersistedKeys = null;\n\n body.layoutInfo.rect.width = Math.max(header.layoutInfo.rect.width, body.layoutInfo.rect.width);\n this.contentSize = new Size(body.layoutInfo.rect.width, body.layoutInfo.rect.maxY);\n return [\n header,\n body\n ];\n }\n\n buildHeader(): LayoutNode {\n let rect = new Rect(0, 0, 0, 0);\n let layoutInfo = new LayoutInfo('header', 'header', rect);\n\n let y = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let headerRow of this.collection.headerRows) {\n let layoutNode = this.buildChild(headerRow, 0, y);\n layoutNode.layoutInfo.parentKey = 'header';\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n layoutNode.index = children.length;\n children.push(layoutNode);\n }\n\n rect.width = width;\n rect.height = y;\n\n this.layoutInfos.set('header', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect\n };\n }\n\n buildHeaderRow(headerRow: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let row = new LayoutInfo('headerrow', headerRow.key, rect);\n\n let height = 0;\n let columns: LayoutNode[] = [];\n for (let cell of getChildNodes(headerRow, this.collection)) {\n let layoutNode = this.buildChild(cell, x, y);\n layoutNode.layoutInfo.parentKey = row.key;\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = columns.length;\n columns.push(layoutNode);\n }\n for (let [i, layout] of columns.entries()) {\n layout.layoutInfo.zIndex = columns.length - i + 1;\n }\n\n this.setChildHeights(columns, height);\n\n rect.height = height;\n rect.width = x;\n\n return {\n layoutInfo: row,\n children: columns,\n validRect: rect\n };\n }\n\n setChildHeights(children: LayoutNode[], height: number) {\n for (let child of children) {\n if (child.layoutInfo.rect.height !== height) {\n // Need to copy the layout info before we mutate it.\n child.layoutInfo = child.layoutInfo.copy();\n this.layoutInfos.set(child.layoutInfo.key, child.layoutInfo);\n\n child.layoutInfo.rect.height = height;\n }\n }\n }\n\n // used to get the column widths when rendering to the DOM\n getRenderedColumnWidth(node: GridNode<T>) {\n let colspan = node.colspan ?? 1;\n let colIndex = node.colIndex ?? node.index;\n let width = 0;\n for (let i = colIndex; i < colIndex + colspan; i++) {\n let column = this.collection.columns[i];\n if (column?.key != null) {\n width += this.columnWidths.get(column.key);\n }\n }\n\n return width;\n }\n\n getEstimatedHeight(node: GridNode<T>, width: number, height: number, estimatedHeight: number) {\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (height == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n height = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = node !== previousLayoutNode.node || width !== previousLayoutNode.layoutInfo.rect.width || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n height = estimatedHeight;\n isEstimated = true;\n }\n }\n\n return {height, isEstimated};\n }\n\n buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.headingHeight, this.estimatedHeadingHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n buildBody(y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let layoutInfo = new LayoutInfo('rowgroup', 'body', rect);\n\n let startY = y;\n let skipped = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let [i, node] of [...this.collection].entries()) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight) + 1;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n layoutNode.layoutInfo.parentKey = 'body';\n layoutNode.index = i;\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += (this.collection.size - (skipped + children.length)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n // Add some margin around the loader to ensure that scrollbars don't flicker in and out.\n let rect = new Rect(40, Math.max(y, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60);\n let loader = new LayoutInfo('loader', 'loader', rect);\n loader.parentKey = 'body';\n loader.isSticky = !this.disableSticky && children.length === 0;\n this.layoutInfos.set('loader', loader);\n children.push({layoutInfo: loader, validRect: loader.rect});\n y = loader.rect.maxY;\n width = Math.max(width, rect.width);\n } else if (children.length === 0) {\n let rect = new Rect(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);\n let empty = new LayoutInfo('empty', 'empty', rect);\n empty.parentKey = 'body';\n empty.isSticky = !this.disableSticky;\n this.layoutInfos.set('empty', empty);\n children.push({layoutInfo: empty, validRect: empty.rect});\n y = empty.rect.maxY;\n width = Math.max(width, rect.width);\n }\n\n rect.width = width;\n rect.height = y - startY;\n\n this.layoutInfos.set('body', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildNode(node: GridNode<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'headerrow':\n return this.buildHeaderRow(node, x, y);\n case 'item':\n return this.buildRow(node, x, y);\n case 'column':\n case 'placeholder':\n return this.buildColumn(node, x, y);\n case 'cell':\n return this.buildCell(node, x, y);\n default:\n throw new Error('Unknown node type ' + node.type);\n }\n }\n\n buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, 0, 0);\n let layoutInfo = new LayoutInfo('row', node.key, rect);\n\n let children: LayoutNode[] = [];\n let height = 0;\n for (let [i, child] of [...getChildNodes(node, this.collection)].entries()) {\n if (child.type === 'cell') {\n if (x > this.validRect.maxX) {\n // Adjust existing cached layoutInfo to ensure that it is out of view.\n // This can happen due to column resizing.\n let layoutNode = this.layoutNodes.get(child.key);\n if (layoutNode) {\n layoutNode.layoutInfo.rect.x = x;\n x += layoutNode.layoutInfo.rect.width;\n }\n } else {\n let layoutNode = this.buildChild(child, x, y);\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = i;\n children.push(layoutNode);\n }\n }\n }\n\n this.setChildHeights(children, height);\n\n rect.width = this.layoutInfos.get('header').rect.width;\n rect.height = height + 1; // +1 for bottom border\n\n return {\n layoutInfo,\n children,\n validRect: rect.intersection(this.validRect)\n };\n }\n\n buildCell(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.rowHeight, this.estimatedRowHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: rect\n };\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n this.buildPersistedIndices();\n for (let node of this.rootNodes) {\n res.push(node.layoutInfo);\n this.addVisibleLayoutInfos(res, node, rect);\n }\n\n return res;\n }\n\n addVisibleLayoutInfos(res: LayoutInfo[], node: LayoutNode, rect: Rect) {\n if (!node.children || node.children.length === 0) {\n return;\n }\n\n switch (node.layoutInfo.type) {\n case 'header': {\n for (let child of node.children) {\n res.push(child.layoutInfo);\n this.addVisibleLayoutInfos(res, child, rect);\n }\n break;\n }\n case 'rowgroup': {\n let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, 'y');\n let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, 'y');\n\n // Add persisted rows before the visible rows.\n let persistedRowIndices = this.persistedIndices.get(node.layoutInfo.key);\n let persistIndex = 0;\n while (\n persistedRowIndices &&\n persistIndex < persistedRowIndices.length &&\n persistedRowIndices[persistIndex] < firstVisibleRow\n ) {\n let idx = persistedRowIndices[persistIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[idx], rect);\n }\n persistIndex++;\n }\n\n for (let i = firstVisibleRow; i <= lastVisibleRow; i++) {\n // Skip persisted rows that overlap with visible cells.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length && persistedRowIndices[persistIndex] < i) {\n persistIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[i], rect);\n }\n\n // Add persisted rows after the visible rows.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length) {\n let idx = persistedRowIndices[persistIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n case 'headerrow':\n case 'row': {\n let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, 'x');\n let lastVisibleCell = this.binarySearch(node.children, rect.topRight, 'x');\n let stickyIndex = 0;\n\n // Add persisted/sticky cells before the visible cells.\n let persistedCellIndices = this.persistedIndices.get(node.layoutInfo.key) || this.stickyColumnIndices;\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < firstVisibleCell) {\n let idx = persistedCellIndices[stickyIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n stickyIndex++;\n }\n\n for (let i = firstVisibleCell; i <= lastVisibleCell; i++) {\n // Skip sticky cells that overlap with visible cells.\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < i) {\n stickyIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n }\n\n // Add any remaining sticky cells after the visible cells.\n while (stickyIndex < persistedCellIndices.length) {\n let idx = persistedCellIndices[stickyIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n default:\n throw new Error('Unknown node type ' + node.layoutInfo.type);\n }\n }\n\n binarySearch(items: LayoutNode[], point: Point, axis: 'x' | 'y') {\n let low = 0;\n let high = items.length - 1;\n while (low <= high) {\n let mid = (low + high) >> 1;\n let item = items[mid];\n\n if ((axis === 'x' && item.layoutInfo.rect.maxX < point.x) || (axis === 'y' && item.layoutInfo.rect.maxY < point.y)) {\n low = mid + 1;\n } else if ((axis === 'x' && item.layoutInfo.rect.x > point.x) || (axis === 'y' && item.layoutInfo.rect.y > point.y)) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.max(0, Math.min(items.length - 1, low));\n }\n\n buildPersistedIndices() {\n if (this.virtualizer.persistedKeys === this.lastPersistedKeys) {\n return;\n }\n\n this.lastPersistedKeys = this.virtualizer.persistedKeys;\n this.persistedIndices.clear();\n\n // Build a map of parentKey => indices of children to persist.\n for (let key of this.virtualizer.persistedKeys) {\n let layoutInfo = this.layoutInfos.get(key);\n\n // Walk up ancestors so parents are also persisted if children are.\n while (layoutInfo && layoutInfo.parentKey) {\n let collectionNode = this.collection.getItem(layoutInfo.key);\n let indices = this.persistedIndices.get(layoutInfo.parentKey);\n if (!indices) {\n // stickyColumnIndices are always persisted along with any cells from persistedKeys.\n indices = collectionNode.type === 'cell' || collectionNode.type === 'column' ? [...this.stickyColumnIndices] : [];\n this.persistedIndices.set(layoutInfo.parentKey, indices);\n }\n\n let index = this.layoutNodes.get(layoutInfo.key).index;\n\n if (!indices.includes(index)) {\n indices.push(index);\n }\n\n layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);\n }\n }\n\n for (let indices of this.persistedIndices.values()) {\n indices.sort((a, b) => a - b);\n }\n }\n\n getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n let res = super.getInitialLayoutInfo(layoutInfo);\n res.transform = null;\n return res;\n }\n\n getFinalLayoutInfo(layoutInfo: LayoutInfo) {\n let res = super.getFinalLayoutInfo(layoutInfo);\n res.transform = null;\n return res;\n }\n\n // Checks if Chrome version is 105 or greater\n private checkChrome105() {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n\n let isChrome105;\n if (window.navigator['userAgentData']) {\n isChrome105 = window.navigator['userAgentData']?.brands.some(b => b.brand === 'Chromium' && Number(b.version) === 105);\n } else {\n let regex = /Chrome\\/(\\d+)/;\n let matches = regex.exec(window.navigator.userAgent);\n isChrome105 = matches && matches.length >= 2 && Number(matches[1]) === 105;\n }\n\n return isChrome105;\n }\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n // Offset for height of header row\n y -= this.virtualizer.layout.getVisibleLayoutInfos(new Rect(x, y, 1, 1)).find(info => info.type === 'headerrow')?.rect.height;\n\n // Custom variation of this.virtualizer.keyAtPoint that ignores body\n let key: Key;\n let point = new Point(x, y);\n let rectAtPoint = new Rect(point.x, point.y, 1, 1);\n let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter(info => info.type === 'row');\n\n // Layout may return multiple layout infos in the case of\n // persisted keys, so find the first one that actually intersects.\n for (let layoutInfo of layoutInfos) {\n if (layoutInfo.rect.intersects(rectAtPoint)) {\n key = layoutInfo.key;\n }\n }\n\n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export interface LayoutNode {
|
|
|
23
23
|
header?: LayoutInfo;
|
|
24
24
|
children?: LayoutNode[];
|
|
25
25
|
validRect: Rect;
|
|
26
|
+
index?: number;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* The ListLayout class is an implementation of a collection view {@link Layout}
|
|
@@ -133,6 +134,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
133
134
|
binarySearch(items: LayoutNode[], point: Point, axis: 'x' | 'y'): number;
|
|
134
135
|
buildPersistedIndices(): void;
|
|
135
136
|
getInitialLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
|
|
137
|
+
getFinalLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
|
|
136
138
|
getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget;
|
|
137
139
|
}
|
|
138
140
|
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAkBA,8BAA8B,CAAC,IAAI;IACjC,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IAC3E,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CACh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M,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU;IAe9D,qBAAqB,CAAC,IAAI,EAAE,IAAI;IAoBhC,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI;IA2FrE,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG;IAmB/D,qBAAqB;IAqCrB,oBAAoB,CAAC,UAAU,EAAE,UAAU;IAM3C,kBAAkB,CAAC,UAAU,EAAE,UAAU;IAuBzC,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,GAAG,UAAU;CAkD7G","sources":["packages/@react-stately/layout/src/packages/@react-stately/layout/src/ListLayout.ts","packages/@react-stately/layout/src/packages/@react-stately/layout/src/TableLayout.ts","packages/@react-stately/layout/src/packages/@react-stately/layout/src/index.ts","packages/@react-stately/layout/src/index.ts"],"sourcesContent":[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 */\nexport type {ListLayoutOptions, LayoutNode} from './ListLayout';\nexport {ListLayout} from './ListLayout';\nexport {TableLayout} from './TableLayout';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/layout",
|
|
3
|
-
"version": "3.12.3-nightly.
|
|
3
|
+
"version": "3.12.3-nightly.4038+d4613f219",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-stately/collections": "3.0.0-nightly.
|
|
26
|
-
"@react-stately/table": "3.10.1-nightly.
|
|
27
|
-
"@react-stately/virtualizer": "3.6.1-nightly.
|
|
28
|
-
"@react-types/grid": "3.1.9-nightly.
|
|
29
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
30
|
-
"@react-types/table": "3.7.1-nightly.
|
|
25
|
+
"@react-stately/collections": "3.0.0-nightly.2333+d4613f219",
|
|
26
|
+
"@react-stately/table": "3.10.1-nightly.4038+d4613f219",
|
|
27
|
+
"@react-stately/virtualizer": "3.6.1-nightly.4038+d4613f219",
|
|
28
|
+
"@react-types/grid": "3.1.9-nightly.4038+d4613f219",
|
|
29
|
+
"@react-types/shared": "3.0.0-nightly.2333+d4613f219",
|
|
30
|
+
"@react-types/table": "3.7.1-nightly.4038+d4613f219",
|
|
31
31
|
"@swc/helpers": "^0.5.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "d4613f219d7dc92ee9f2438572a9e92b1534b47c"
|
|
40
40
|
}
|
package/src/ListLayout.ts
CHANGED
package/src/TableLayout.ts
CHANGED
|
@@ -161,6 +161,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
161
161
|
layoutNode.layoutInfo.parentKey = 'header';
|
|
162
162
|
y = layoutNode.layoutInfo.rect.maxY;
|
|
163
163
|
width = Math.max(width, layoutNode.layoutInfo.rect.width);
|
|
164
|
+
layoutNode.index = children.length;
|
|
164
165
|
children.push(layoutNode);
|
|
165
166
|
}
|
|
166
167
|
|
|
@@ -187,6 +188,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
187
188
|
layoutNode.layoutInfo.parentKey = row.key;
|
|
188
189
|
x = layoutNode.layoutInfo.rect.maxX;
|
|
189
190
|
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
191
|
+
layoutNode.index = columns.length;
|
|
190
192
|
columns.push(layoutNode);
|
|
191
193
|
}
|
|
192
194
|
for (let [i, layout] of columns.entries()) {
|
|
@@ -276,7 +278,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
276
278
|
let skipped = 0;
|
|
277
279
|
let width = 0;
|
|
278
280
|
let children: LayoutNode[] = [];
|
|
279
|
-
for (let node of this.collection) {
|
|
281
|
+
for (let [i, node] of [...this.collection].entries()) {
|
|
280
282
|
let rowHeight = (this.rowHeight ?? this.estimatedRowHeight) + 1;
|
|
281
283
|
|
|
282
284
|
// Skip rows before the valid rectangle unless they are already cached.
|
|
@@ -288,6 +290,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
288
290
|
|
|
289
291
|
let layoutNode = this.buildChild(node, 0, y);
|
|
290
292
|
layoutNode.layoutInfo.parentKey = 'body';
|
|
293
|
+
layoutNode.index = i;
|
|
291
294
|
y = layoutNode.layoutInfo.rect.maxY;
|
|
292
295
|
width = Math.max(width, layoutNode.layoutInfo.rect.width);
|
|
293
296
|
children.push(layoutNode);
|
|
@@ -354,20 +357,23 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
354
357
|
|
|
355
358
|
let children: LayoutNode[] = [];
|
|
356
359
|
let height = 0;
|
|
357
|
-
for (let child of getChildNodes(node, this.collection)) {
|
|
358
|
-
if (
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
layoutNode
|
|
364
|
-
|
|
360
|
+
for (let [i, child] of [...getChildNodes(node, this.collection)].entries()) {
|
|
361
|
+
if (child.type === 'cell') {
|
|
362
|
+
if (x > this.validRect.maxX) {
|
|
363
|
+
// Adjust existing cached layoutInfo to ensure that it is out of view.
|
|
364
|
+
// This can happen due to column resizing.
|
|
365
|
+
let layoutNode = this.layoutNodes.get(child.key);
|
|
366
|
+
if (layoutNode) {
|
|
367
|
+
layoutNode.layoutInfo.rect.x = x;
|
|
368
|
+
x += layoutNode.layoutInfo.rect.width;
|
|
369
|
+
}
|
|
370
|
+
} else {
|
|
371
|
+
let layoutNode = this.buildChild(child, x, y);
|
|
372
|
+
x = layoutNode.layoutInfo.rect.maxX;
|
|
373
|
+
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
374
|
+
layoutNode.index = i;
|
|
375
|
+
children.push(layoutNode);
|
|
365
376
|
}
|
|
366
|
-
} else {
|
|
367
|
-
let layoutNode = this.buildChild(child, x, y);
|
|
368
|
-
x = layoutNode.layoutInfo.rect.maxX;
|
|
369
|
-
height = Math.max(height, layoutNode.layoutInfo.rect.height);
|
|
370
|
-
children.push(layoutNode);
|
|
371
377
|
}
|
|
372
378
|
}
|
|
373
379
|
|
|
@@ -550,10 +556,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
550
556
|
this.persistedIndices.set(layoutInfo.parentKey, indices);
|
|
551
557
|
}
|
|
552
558
|
|
|
553
|
-
let index =
|
|
554
|
-
if (layoutInfo.parentKey === 'body') {
|
|
555
|
-
index -= this.collection.headerRows.length;
|
|
556
|
-
}
|
|
559
|
+
let index = this.layoutNodes.get(layoutInfo.key).index;
|
|
557
560
|
|
|
558
561
|
if (!indices.includes(index)) {
|
|
559
562
|
indices.push(index);
|
|
@@ -570,12 +573,13 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
570
573
|
|
|
571
574
|
getInitialLayoutInfo(layoutInfo: LayoutInfo) {
|
|
572
575
|
let res = super.getInitialLayoutInfo(layoutInfo);
|
|
576
|
+
res.transform = null;
|
|
577
|
+
return res;
|
|
578
|
+
}
|
|
573
579
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
|
|
580
|
+
getFinalLayoutInfo(layoutInfo: LayoutInfo) {
|
|
581
|
+
let res = super.getFinalLayoutInfo(layoutInfo);
|
|
582
|
+
res.transform = null;
|
|
579
583
|
return res;
|
|
580
584
|
}
|
|
581
585
|
|
|
@@ -616,7 +620,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
616
620
|
key = layoutInfo.key;
|
|
617
621
|
}
|
|
618
622
|
}
|
|
619
|
-
|
|
623
|
+
|
|
620
624
|
if (key == null || this.collection.size === 0) {
|
|
621
625
|
return {type: 'root'};
|
|
622
626
|
}
|