Skip to content

Commit 5bb6a22

Browse files
devongovettLFDanLu
andauthored
S2 table (#6778)
* Add Spectrum 2 docs to storybook * progress on table styles * fix highlight checkbox rendering and add rounded corners to body * fix checkbox styles, update to columns, font family * refactor cell focus ring and add row focus ring row focus ring needs row render function first * wrapping up disabled row styles * empty/loading state brainstorming * Replace empty state with loading spinner * add basic sorting * attempt to add showDivider this will need changes to RAC table as well.... * Fix select all checkbox click * add placeholder for DnD and use new icon for sortable column * update HCM colors * fix DnD story, removed need for sortDescriptor on context, fix drag button focus visible also tested moving the sort descriptor in front of the column text andwithout reserving room * clean up * switch to box shadow on row for grey row underline and selection focus ring * update colors/sizes from table specific tokens * updating lightdark so it works with opacity values * add row visible focus style and fix empty columnheader focus style for drag/checkbox columns * initial setup for resizing support * progress on resizer handle styling and menu icons * fix more resize bugs and some clean up * nubbin and more DnD styling * fix drag indicator so it respects density * got verdaccio working, updating row background style and confirmed resizers are skipped * updating loading more to use rowLoader * use isTableEmpty renderProps from local RAC * Add virtualizer and begin fixing styles * add scale, update to column widths, some updates to reflect new token values * add async loading stories and updates to use background image for table body outline * fix broken empty state story and more debugging with empty state centering * move outline to whole table and fix borders and padding for columns * fix progress circle centering, rows showing up behind column, and scuffed way to curve the last row border * Support showing the resizer when table header is hovered, fix to table outline, get rid of curved row * support sticky column cells * fix sticky positioning for the body loader and row loader * investigations for sticky column/row selection border, fix for sort icon placement * making sticky columns cells properly cover cells scrolled beneith them * fix vertical centering * lint * add full height column resize indicator * hack for show dividers * add text alignment * refactor to pass divider and align to cell directly this avoids us having to expose column props on the cell render props which are tricky to type properly (would need to be a generic). Also fixes some overlapping of the focus rings and the divder and resize indicators * saving some investigations * get rid of blue selection outlines and add column header background * add table focus indicator that is sticky * HCM and nubbin appearance when triggered via menu * fixes to icon sizing, illustrations, props in story, font default, and RTL * adding focus style for empty style and translations * fix typeahead and load more progress circle positioning * only expose sort options when avaialble and align resizing column with colum align * some clean up and notes from investigations * remove DnD for now * add more complex story * fix lint * fixing infinite load issue I was applying the scroll ref onto the wrong element causing useLoadMore to trigger indefinitely because the scroll height and the client height of the provided ref were always equal * increase body focus width, all resizer appears when in resizing mode, fix for premature resizing exit * forgot to remove extra console.log * fix strict error * address review comments and update header background * make links actually clickable and fix focus ring on link * fix scroll padding so rows and cells scroll fully into view * fix dark mode/HCM colors, column min width and tap highlight * review comments * fix width/height when determined by flex * fix lint * fix checkbox appearing above scrollbar and ipad tap highlight issues * review comments * making loader row taller * fix overflow wrap decreasing row height and add menu min width for small viewports * clean up context to try to help performance * update scrollPadding to expected value chrome behavior is strange because of chrome bug, see https://issues.chromium.org/issues/365913982 which I filed * fix slow performance when many rows are provided and isQuiet/densitiy is flipped * add discrete border styles to theme * Revert "fix slow performance when many rows are provided and isQuiet/densitiy is flipped" This reverts commit feb0ada. * fixing lint and tests * update resizer icon * update HCM for resizer and add browser bug info * disable onAction on story by default and add label for single select empty cell * yarn lock update * fix lint * address initial review comments * make popovers inert when they are transitioning out so table resizing doesnt get canceled if the user clicks the resize option and hovers another item while the popover is transitioning out it can cause resizing to be canceled. This prevents that case from happening * add useScale and use it in table instead * ignore warnings in test for invalid attribute and remove items length check warning is a compat one for React 19, items check is uneeded due to user error * forgot the forward ref and add descriptions * Revert "make popovers inert when they are transitioning out so table resizing doesnt get canceled" This reverts commit 9cfb896. * Revert "ignore warnings in test for invalid attribute" This reverts commit 7006a76. # Conflicts: # packages/react-aria-components/test/ComboBox.test.js # packages/react-aria-components/test/Select.test.js * Use pointerEvents: none in popover during exit animation instead of inert * Don't expose ResizableTableContainerContext publicly It has a bunch of internal stuff on it. We don't need the exact height for the resizer, we just need a large enough value that it goes past the end of the table. 100vh should work. * Use VisuallyHidden from react-aria monopackage * Revert border style longhands * lint --------- Co-authored-by: danilu <[email protected]> Co-authored-by: Daniel Lu <[email protected]>
1 parent 2832cf1 commit 5bb6a22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2043
-60
lines changed

packages/@react-aria/utils/src/useLoadMore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function useLoadMore(props: LoadMoreProps, ref: RefObject<HTMLElement | n
7373
}
7474

7575
lastItems.current = items;
76-
}, [isLoading, onLoadMore, props, ref]);
76+
}, [isLoading, onLoadMore, props, ref, items]);
7777

7878
// TODO: maybe this should still just return scroll props?
7979
// Test against case where the ref isn't defined when this is called

packages/@react-aria/virtualizer/src/VirtualizerItem.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ export function layoutInfoToStyle(layoutInfo: LayoutInfo, dir: Direction, parent
5858
}
5959

6060
let rectStyles = {
61-
top: layoutInfo.rect.y - (parent ? parent.rect.y : 0),
62-
[xProperty]: layoutInfo.rect.x - (parent ? parent.rect.x : 0),
61+
// TODO: For layoutInfos that are sticky that have parents with overflow visible, their "top" will be relative to the to the nearest scrolling container
62+
// which WON'T be the parent since the parent has overflow visible. This means we shouldn't offset the height by the parent's position
63+
// Not 100% about this change here since it is quite ambigious what the scrolling container maybe and how its top is positioned with respect to the
64+
// calculated layoutInfo.y here
65+
top: layoutInfo.rect.y - (parent && !(parent.allowOverflow && layoutInfo.isSticky) ? parent.rect.y : 0),
66+
[xProperty]: layoutInfo.rect.x - (parent && !(parent.allowOverflow && layoutInfo.isSticky) ? parent.rect.x : 0),
6367
width: layoutInfo.rect.width,
6468
height: layoutInfo.rect.height
6569
};

packages/@react-spectrum/s2/intl/ar-AE.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"picker.placeholder": "حدد خيارًا...",
1616
"slider.maximum": "أقصى",
1717
"slider.minimum": "أدنى",
18+
"table.loading": "جارٍ التحميل...",
19+
"table.loadingMore": "جارٍ تحميل المزيد...",
20+
"table.resizeColumn": "تغيير حجم العمود",
21+
"table.sortAscending": "فرز بترتيب تصاعدي",
22+
"table.sortDescending": "فرز بترتيب تنازلي",
1823
"tag.actions": "الإجراءات",
1924
"tag.hideButtonLabel": "إظهار أقل",
2025
"tag.noTags": "بدون",

packages/@react-spectrum/s2/intl/bg-BG.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"picker.placeholder": "Изберете опция",
1616
"slider.maximum": "Максимум",
1717
"slider.minimum": "Минимум",
18+
"table.loading": "Зареждане...",
19+
"table.loadingMore": "Зареждане на още...",
20+
"table.resizeColumn": "Преоразмеряване на колона",
21+
"table.sortAscending": "Възходящо сортиране",
22+
"table.sortDescending": "Низходящо сортиране ",
1823
"tag.actions": "Действия",
1924
"tag.hideButtonLabel": "Показване на по-малко",
2025
"tag.noTags": "Нито един",

packages/@react-spectrum/s2/intl/cs-CZ.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"picker.placeholder": "Vyberte vhodnou možnost...",
1616
"slider.maximum": "Maximum",
1717
"slider.minimum": "Minimum",
18+
"table.loading": "Načítání...",
19+
"table.loadingMore": "Načítání dalších...",
20+
"table.resizeColumn": "Změnit velikost sloupce",
21+
"table.sortAscending": "Seřadit vzestupně",
22+
"table.sortDescending": "Seřadit sestupně",
1823
"tag.actions": "Akce",
1924
"tag.hideButtonLabel": "Zobrazit méně",
2025
"tag.noTags": "Žádný",

packages/@react-spectrum/s2/intl/da-DK.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"picker.placeholder": "Vælg en mulighed ...",
1616
"slider.maximum": "Maksimum",
1717
"slider.minimum": "Minimum",
18+
"table.loading": "Indlæser ...",
19+
"table.loadingMore": "Indlæser flere ...",
20+
"table.resizeColumn": "Tilpas størrelse på kolonne",
21+
"table.sortAscending": "Sorter stigende",
22+
"table.sortDescending": "Sorter faldende",
1823
"tag.actions": "Handlinger",
1924
"tag.hideButtonLabel": "Vis mindre",
2025
"tag.noTags": "Ingen",

packages/@react-spectrum/s2/intl/de-DE.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"picker.placeholder": "Option auswählen...",
1616
"slider.maximum": "Maximum",
1717
"slider.minimum": "Minimum",
18+
"table.loading": "Laden...",
19+
"table.loadingMore": "Mehr laden ...",
20+
"table.resizeColumn": "Spaltengröße ändern",
21+
"table.sortAscending": "Aufsteigend sortieren",
22+
"table.sortDescending": "Absteigend sortieren",
1823
"tag.actions": "Aktionen",
1924
"tag.hideButtonLabel": "Weniger zeigen",
2025
"tag.noTags": "Keine",

packages/@react-spectrum/s2/intl/el-GR.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"picker.placeholder": "Επιλέξτε…",
1616
"slider.maximum": "Μέγιστο",
1717
"slider.minimum": "Ελάχιστο",
18+
"table.loading": "Φόρτωση...",
19+
"table.loadingMore": "Φόρτωση περισσότερων...",
20+
"table.resizeColumn": "Αλλαγή μεγέθους στήλης",
21+
"table.sortAscending": "Ταξινόμηση κατά αύξουσα σειρά",
22+
"table.sortDescending": "Ταξινόμηση κατά φθίνουσα σειρά",
1823
"tag.actions": "Ενέργειες",
1924
"tag.hideButtonLabel": "Εμφάνιση λιγότερων",
2025
"tag.noTags": "Κανένα",

packages/@react-spectrum/s2/intl/en-US.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"picker.placeholder": "Select…",
1616
"slider.minimum": "Minimum",
1717
"slider.maximum": "Maximum",
18+
"table.loading": "Loading…",
19+
"table.loadingMore": "Loading more…",
20+
"table.sortAscending": "Sort Ascending",
21+
"table.sortDescending": "Sort Descending",
22+
"table.resizeColumn": "Resize column",
1823
"tag.showAllButtonLabel": "Show all ({tagCount, number})",
1924
"tag.hideButtonLabel": "Show less",
2025
"tag.actions": "Actions",

packages/@react-spectrum/s2/intl/es-ES.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"picker.placeholder": "Seleccione una opción…",
1616
"slider.maximum": "Máximo",
1717
"slider.minimum": "Mínimo",
18+
"table.loading": "Cargando…",
19+
"table.loadingMore": "Cargando más…",
20+
"table.resizeColumn": "Cambiar el tamaño de la columna",
21+
"table.sortAscending": "Orden de subida",
22+
"table.sortDescending": "Orden de bajada",
1823
"tag.actions": "Acciones",
1924
"tag.hideButtonLabel": "Mostrar menos",
2025
"tag.noTags": "Ninguno",

0 commit comments

Comments
 (0)