@gooddata/sdk-ui-kit 11.65.0-alpha.7 → 11.65.0-alpha.9
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/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTable.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTable.js +4 -3
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableBody.d.ts +7 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableBody.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableBody.js +138 -102
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableCheckbox.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableCheckbox.js +3 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableHeader.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableHeader.js +11 -91
- package/esm/@ui/UiAsyncTable/UiAsyncTable/asyncTableGridContext.d.ts +10 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/asyncTableGridContext.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/asyncTableGridContext.js +3 -0
- package/esm/@ui/UiPagedVirtualList/UiPagedVirtualList.d.ts.map +1 -1
- package/esm/@ui/UiPagedVirtualList/UiPagedVirtualList.js +21 -7
- package/esm/@ui/UiSearchableSelect/UiSearchableSelect.d.ts.map +1 -1
- package/esm/@ui/UiSearchableSelect/UiSearchableSelect.js +2 -3
- package/package.json +11 -11
- package/src/@ui/UiAsyncTable/asyncTable.scss +4 -10
- package/src/@ui/UiFloatingPanel/UiFloatingPanel.scss +0 -1
- package/src/@ui/UiSearchableSelect/UiSearchableSelect.scss +0 -2
- package/src/FilterGroupItem/FilterGroupItem.scss +1 -1
- package/styles/css/main.css +9 -14
- package/styles/css/main.css.map +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2024-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState, } from "react";
|
|
4
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
4
|
+
import { defaultRangeExtractor, useVirtualizer } from "@tanstack/react-virtual";
|
|
5
5
|
import { forwardRefWithGenerics } from "@gooddata/sdk-ui";
|
|
6
6
|
import { bem } from "../@utils/bem.js";
|
|
7
7
|
import { makeLinearKeyboardNavigationWithConfirm } from "../@utils/keyboardNavigation.js";
|
|
@@ -73,7 +73,7 @@ function UiPagedVirtualListNotWrapped(props, ref) {
|
|
|
73
73
|
]);
|
|
74
74
|
return (_jsx("div", { className: b({
|
|
75
75
|
hasScroll,
|
|
76
|
-
}), children: _jsx("div", { ref: scrollContainerRef, className: e("scroll-container", { hover: scrollbarHoverEffect ?? false }), style: { height, paddingTop: itemsGap + containerPadding }, onScroll: onScroll, children: _jsx(ListElement, { className: e("list"), style: {
|
|
76
|
+
}), children: _jsx("div", { ref: scrollContainerRef, className: e("scroll-container", { hover: scrollbarHoverEffect ?? false }), style: { height, paddingTop: itemsGap + containerPadding }, onScroll: onScroll, tabIndex: representAs === "grid" && tabIndex < 0 ? -1 : undefined, children: _jsx(ListElement, { className: e("list"), style: {
|
|
77
77
|
height: `${rowVirtualizer.getTotalSize()}px`,
|
|
78
78
|
width: "100%",
|
|
79
79
|
position: "relative",
|
|
@@ -124,7 +124,7 @@ function UiPagedVirtualListNotWrapped(props, ref) {
|
|
|
124
124
|
* @internal
|
|
125
125
|
*/
|
|
126
126
|
export const UiPagedVirtualList = forwardRefWithGenerics(UiPagedVirtualListNotWrapped);
|
|
127
|
-
function useVirtualList({ items, itemHeight, itemHeightGetter, itemsGap, containerPadding = 0, skeletonItemsCount, hasNextPage, loadNextPage, isLoading, maxHeight, scrollToItem, scrollToItemKeyExtractor, scrollToIndex, shouldLoadNextPage: shouldLoadNextPageProps, }) {
|
|
127
|
+
function useVirtualList({ items, itemHeight, itemHeightGetter, itemsGap, containerPadding = 0, skeletonItemsCount, hasNextPage, loadNextPage, isLoading, maxHeight, focusedItem, scrollToItem, scrollToItemKeyExtractor, scrollToIndex, shouldLoadNextPage: shouldLoadNextPageProps, }) {
|
|
128
128
|
const defaultShouldLoadNextPage = useCallback((lastItemIndex, itemsCount, skeletonItemsCount) => lastItemIndex >= itemsCount - 1 - skeletonItemsCount, []);
|
|
129
129
|
const shouldLoadNextPage = useMemo(() => {
|
|
130
130
|
return shouldLoadNextPageProps ?? defaultShouldLoadNextPage;
|
|
@@ -164,20 +164,34 @@ function useVirtualList({ items, itemHeight, itemHeightGetter, itemsGap, contain
|
|
|
164
164
|
scrollContainerRef.current?.getBoundingClientRect().height
|
|
165
165
|
: false;
|
|
166
166
|
const observeElementRect = useVirtualizerRectObserver(scrollContainerRef, height);
|
|
167
|
+
const pinnedIndex = focusedItem === undefined ? -1 : (items?.indexOf(focusedItem) ?? -1);
|
|
168
|
+
const rangeExtractor = useCallback((range) => {
|
|
169
|
+
const indexes = defaultRangeExtractor(range);
|
|
170
|
+
return pinnedIndex < 0 || indexes.includes(pinnedIndex)
|
|
171
|
+
? indexes
|
|
172
|
+
: [...indexes, pinnedIndex].sort((a, b) => a - b);
|
|
173
|
+
}, [pinnedIndex]);
|
|
167
174
|
const rowVirtualizer = useVirtualizer({
|
|
168
175
|
count: renderItemsCount,
|
|
169
176
|
getScrollElement: () => scrollContainerRef.current,
|
|
170
177
|
estimateSize: (index) => getItemSizeWithGap(index),
|
|
171
178
|
observeElementRect,
|
|
172
179
|
overscan: 5,
|
|
180
|
+
rangeExtractor,
|
|
173
181
|
});
|
|
174
182
|
const virtualItems = rowVirtualizer.getVirtualItems();
|
|
183
|
+
// A pinned active row may be far outside the viewport. Only the visible range and its
|
|
184
|
+
// overscan drive scroll pagination; parent-managed keyboard navigation loads its own pages.
|
|
185
|
+
const lastVisibleIndex = rowVirtualizer.range
|
|
186
|
+
? Math.min(rowVirtualizer.range.endIndex + rowVirtualizer.options.overscan, renderItemsCount - 1)
|
|
187
|
+
: -1;
|
|
175
188
|
useEffect(() => {
|
|
176
|
-
|
|
177
|
-
if (!lastItem) {
|
|
189
|
+
if (lastVisibleIndex < 0) {
|
|
178
190
|
return;
|
|
179
191
|
}
|
|
180
|
-
if (shouldLoadNextPage(
|
|
192
|
+
if (shouldLoadNextPage(lastVisibleIndex, itemsCount, skeletonItemsCount) &&
|
|
193
|
+
hasNextPage &&
|
|
194
|
+
!isLoading) {
|
|
181
195
|
loadNextPage?.();
|
|
182
196
|
}
|
|
183
197
|
}, [
|
|
@@ -185,7 +199,7 @@ function useVirtualList({ items, itemHeight, itemHeightGetter, itemsGap, contain
|
|
|
185
199
|
loadNextPage,
|
|
186
200
|
itemsCount,
|
|
187
201
|
isLoading,
|
|
188
|
-
|
|
202
|
+
lastVisibleIndex,
|
|
189
203
|
skeletonItemsCount,
|
|
190
204
|
shouldLoadNextPage,
|
|
191
205
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiSearchableSelect.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"UiSearchableSelect.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiSearchableSelect/UiSearchableSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAc/E;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACvC,mBAAmB,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAClC,mBAAmB,EACnB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,WAAmB,EACnB,KAAK,EACL,QAAQ,GACX,EAAE,wBAAwB,CAAC,CAAC,CAAC,2CA0H7B"}
|
|
@@ -11,7 +11,6 @@ import { UiSearchableSelectContext } from "./UiSearchableSelectContext.js";
|
|
|
11
11
|
import { UiSearchableSelectDivider } from "./UiSearchableSelectDivider.js";
|
|
12
12
|
import { getUiSearchableSelectItemDescriptor } from "./UiSearchableSelectItem.js";
|
|
13
13
|
import { findUiSearchableSelectListRenderItem } from "./UiSearchableSelectList.js";
|
|
14
|
-
const BODY_WIDTH = 300;
|
|
15
14
|
/**
|
|
16
15
|
* @internal
|
|
17
16
|
*/
|
|
@@ -54,10 +53,10 @@ export function UiSearchableSelect({ accessibilityConfig, children, items, filte
|
|
|
54
53
|
})
|
|
55
54
|
: value);
|
|
56
55
|
};
|
|
57
|
-
return (_jsx(UiDropdown, { width:
|
|
56
|
+
return (_jsx(UiDropdown, { width: "same-as-anchor", fullWidthButton: true, autofocusOnOpen: true,
|
|
58
57
|
// like a native <select>, tab closes the popup and moves on from the button: the tab out focuses
|
|
59
58
|
// the button (returnFocusTo) before the browser moves the focus
|
|
60
|
-
enableFocusTrap: false, returnFocusTo: buttonId,
|
|
59
|
+
enableFocusTrap: false, returnFocusTo: buttonId, openOnInit: defaultOpen, accessibilityConfig: { popupRole: "listbox" },
|
|
61
60
|
// a new opening starts with all items, like TimezoneSelect
|
|
62
61
|
onOpen: () => {
|
|
63
62
|
setFocusedItemId(value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-kit",
|
|
3
|
-
"version": "11.65.0-alpha.
|
|
3
|
+
"version": "11.65.0-alpha.9",
|
|
4
4
|
"description": "GoodData SDK - UI Building Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
"unified": "^11.0.5",
|
|
80
80
|
"uuid": "11.1.1",
|
|
81
81
|
"yaml": "2.8.3",
|
|
82
|
-
"@gooddata/sdk-
|
|
83
|
-
"@gooddata/sdk-
|
|
84
|
-
"@gooddata/sdk-ui
|
|
85
|
-
"@gooddata/sdk-ui": "11.65.0-alpha.
|
|
86
|
-
"@gooddata/util": "11.65.0-alpha.
|
|
82
|
+
"@gooddata/sdk-model": "11.65.0-alpha.9",
|
|
83
|
+
"@gooddata/sdk-backend-spi": "11.65.0-alpha.9",
|
|
84
|
+
"@gooddata/sdk-ui": "11.65.0-alpha.9",
|
|
85
|
+
"@gooddata/sdk-ui-theme-provider": "11.65.0-alpha.9",
|
|
86
|
+
"@gooddata/util": "11.65.0-alpha.9"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@microsoft/api-documenter": "7.30.16",
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
"svgo": "2.8.4",
|
|
129
129
|
"typescript": "7.0.2",
|
|
130
130
|
"vitest": "5.0.4",
|
|
131
|
-
"@gooddata/eslint-config": "11.65.0-alpha.
|
|
132
|
-
"@gooddata/oxlint-config": "11.65.0-alpha.
|
|
133
|
-
"@gooddata/reference-workspace": "11.65.0-alpha.
|
|
134
|
-
"@gooddata/sdk-backend-mockingbird": "11.65.0-alpha.
|
|
135
|
-
"@gooddata/stylelint-config": "11.65.0-alpha.
|
|
131
|
+
"@gooddata/eslint-config": "11.65.0-alpha.9",
|
|
132
|
+
"@gooddata/oxlint-config": "11.65.0-alpha.9",
|
|
133
|
+
"@gooddata/reference-workspace": "11.65.0-alpha.9",
|
|
134
|
+
"@gooddata/sdk-backend-mockingbird": "11.65.0-alpha.9",
|
|
135
|
+
"@gooddata/stylelint-config": "11.65.0-alpha.9"
|
|
136
136
|
},
|
|
137
137
|
"peerDependencies": {
|
|
138
138
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -47,15 +47,6 @@
|
|
|
47
47
|
height: var(--gd-table-row-height-small);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
&:focus-visible {
|
|
51
|
-
outline: none;
|
|
52
|
-
|
|
53
|
-
#{$root}__cell--isFocused {
|
|
54
|
-
transition: outline 0s ease-in-out;
|
|
55
|
-
@include mixins.focus-ring;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
50
|
#{$root}__cell {
|
|
60
51
|
transition: color 0.25s ease-in-out;
|
|
61
52
|
border-bottom: 2px solid var(--gd-palette-complementary-3);
|
|
@@ -458,7 +449,10 @@
|
|
|
458
449
|
line-height: 20px;
|
|
459
450
|
}
|
|
460
451
|
|
|
461
|
-
|
|
452
|
+
&__grid:focus-visible {
|
|
453
|
+
outline: none;
|
|
454
|
+
|
|
455
|
+
#{$root}__cell--isFocused,
|
|
462
456
|
#{$root}__row--focused,
|
|
463
457
|
#{$root}__cell--focused {
|
|
464
458
|
@include mixins.focus-ring;
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
.gd-ui-kit-floating-panel {
|
|
8
8
|
position: relative;
|
|
9
9
|
background-color: var(--gd-palette-complementary-0, #fff);
|
|
10
|
-
border: 1px solid var(--gd-palette-complementary-3, #dde4eb);
|
|
11
10
|
border-radius: 3px;
|
|
12
11
|
box-shadow: 0 1px 20px var(--gd-shadow-color, rgba(20, 56, 93, 0.15));
|
|
13
12
|
font-family: var(--gd-font-family), gdcustomfont, Avenir, "Helvetica Neue", arial, sans-serif;
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
padding: 6.5px 10px;
|
|
41
41
|
border-radius: 3px;
|
|
42
42
|
border: 1px solid var(--gd-palette-complementary-4);
|
|
43
|
-
// "Shadow selectbox default" of the Select in Figma; hover and pressed have their own
|
|
44
43
|
box-shadow: 0 1px 1px 0 rgba(48, 52, 66, 0.05);
|
|
45
44
|
|
|
46
45
|
/**
|
|
@@ -91,7 +90,6 @@
|
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
// long values are cut off, so that the icon stays visible
|
|
95
93
|
&__button-title {
|
|
96
94
|
@include mixins.text-overflow;
|
|
97
95
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// added nothing to the output. It did, however, put button.scss in a second module context, and
|
|
6
6
|
// dart-sass (1.80-1.104) then mis-reports button.scss's own `@extend %btn` as unsatisfied for any
|
|
7
7
|
// consumer that compiles main.scss from source with a downstream `@extend .gd-button-link` - which
|
|
8
|
-
// is exactly what the modeler dev server does (see gdc-ldm-modeler
|
|
8
|
+
// is exactly what the modeler dev server does (see gdc-ldm-modeler/src/styles/app.scss).
|
|
9
9
|
@use "../../styles/scss/mixins";
|
|
10
10
|
@use "../../styles/scss/typo-mixins";
|
|
11
11
|
@use "../../styles/scss/variables" as variables;
|
package/styles/css/main.css
CHANGED
|
@@ -2807,15 +2807,6 @@
|
|
|
2807
2807
|
.gd-ui-kit-async-table__header--small {
|
|
2808
2808
|
height: var(--gd-table-row-height-small);
|
|
2809
2809
|
}
|
|
2810
|
-
.gd-ui-kit-async-table__header:focus-visible {
|
|
2811
|
-
outline: none;
|
|
2812
|
-
}
|
|
2813
|
-
.gd-ui-kit-async-table__header:focus-visible .gd-ui-kit-async-table__cell--isFocused {
|
|
2814
|
-
transition: outline 0s ease-in-out;
|
|
2815
|
-
outline-offset: -2px;
|
|
2816
|
-
outline: auto 5px Highlight; /* For Firefox */
|
|
2817
|
-
outline: auto 5px -webkit-focus-ring-color; /* For Chrome */
|
|
2818
|
-
}
|
|
2819
2810
|
.gd-ui-kit-async-table__header .gd-ui-kit-async-table__cell {
|
|
2820
2811
|
transition: color 0.25s ease-in-out;
|
|
2821
2812
|
border-bottom: 2px solid var(--gd-palette-complementary-3);
|
|
@@ -3164,15 +3155,20 @@
|
|
|
3164
3155
|
font-size: 14px;
|
|
3165
3156
|
line-height: 20px;
|
|
3166
3157
|
}
|
|
3167
|
-
.gd-ui-kit-async-
|
|
3168
|
-
|
|
3158
|
+
.gd-ui-kit-async-table__grid:focus-visible {
|
|
3159
|
+
outline: none;
|
|
3160
|
+
}
|
|
3161
|
+
.gd-ui-kit-async-table__grid:focus-visible .gd-ui-kit-async-table__cell--isFocused,
|
|
3162
|
+
.gd-ui-kit-async-table__grid:focus-visible .gd-ui-kit-async-table__row--focused,
|
|
3163
|
+
.gd-ui-kit-async-table__grid:focus-visible .gd-ui-kit-async-table__cell--focused {
|
|
3169
3164
|
outline-offset: -2px;
|
|
3170
3165
|
outline: auto 5px Highlight; /* For Firefox */
|
|
3171
3166
|
outline: auto 5px -webkit-focus-ring-color; /* For Chrome */
|
|
3172
3167
|
}
|
|
3173
3168
|
@supports (-webkit-hyphens: none) {
|
|
3174
|
-
.gd-ui-kit-async-
|
|
3175
|
-
.gd-ui-kit-async-
|
|
3169
|
+
.gd-ui-kit-async-table__grid:focus-visible .gd-ui-kit-async-table__cell--isFocused,
|
|
3170
|
+
.gd-ui-kit-async-table__grid:focus-visible .gd-ui-kit-async-table__row--focused,
|
|
3171
|
+
.gd-ui-kit-async-table__grid:focus-visible .gd-ui-kit-async-table__cell--focused {
|
|
3176
3172
|
outline-offset: -5px;
|
|
3177
3173
|
}
|
|
3178
3174
|
}
|
|
@@ -3655,7 +3651,6 @@
|
|
|
3655
3651
|
.gd-ui-kit-floating-panel {
|
|
3656
3652
|
position: relative;
|
|
3657
3653
|
background-color: var(--gd-palette-complementary-0, #fff);
|
|
3658
|
-
border: 1px solid var(--gd-palette-complementary-3, #dde4eb);
|
|
3659
3654
|
border-radius: 3px;
|
|
3660
3655
|
box-shadow: 0 1px 20px var(--gd-shadow-color, rgba(20, 56, 93, 0.15));
|
|
3661
3656
|
font-family: var(--gd-font-family), gdcustomfont, Avenir, "Helvetica Neue", arial, sans-serif;
|