@caspeco/casper-ui-library 7.11.0 → 8.0.0
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/components/alert/helper.js +0 -2
- package/dist/components/checkbox/checkbox-icon.js +1 -7
- package/dist/components/menu/helper.js +0 -1
- package/dist/components/stepper/step.js +0 -1
- package/dist/components/table/index.d.ts +4 -0
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/table-cell.js +1 -1
- package/dist/components/table/table-content.d.ts +5 -0
- package/dist/components/table/table-content.d.ts.map +1 -1
- package/dist/components/table/table-row-expand-toggle-button.d.ts.map +1 -1
- package/dist/components/table/table-row-expand-toggle-button.js +23 -24
- package/dist/components/table/table-toolbar-actions.d.ts +17 -0
- package/dist/components/table/table-toolbar-actions.d.ts.map +1 -0
- package/dist/components/table/table-toolbar-actions.js +25 -0
- package/dist/components/table/table-toolbar-add-button.d.ts +13 -0
- package/dist/components/table/table-toolbar-add-button.d.ts.map +1 -0
- package/dist/components/table/table-toolbar-add-button.js +13 -0
- package/dist/components/table/table-toolbar-search.d.ts +11 -0
- package/dist/components/table/table-toolbar-search.d.ts.map +1 -0
- package/dist/components/table/table-toolbar-search.js +19 -0
- package/dist/components/table/table-toolbar-settings.d.ts +7 -0
- package/dist/components/table/table-toolbar-settings.d.ts.map +1 -0
- package/dist/components/table/table-toolbar-settings.js +59 -0
- package/dist/components/table/table-toolbar.d.ts +11 -19
- package/dist/components/table/table-toolbar.d.ts.map +1 -1
- package/dist/components/table/table-toolbar.js +49 -143
- package/dist/components/table/table-toolbar.spec.d.ts +2 -0
- package/dist/components/table/table-toolbar.spec.d.ts.map +1 -0
- package/dist/components/table/table.composition.d.ts.map +1 -1
- package/dist/components/table/table.d.ts +5 -0
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/types.d.ts +4 -1
- package/dist/components/table/types.d.ts.map +1 -1
- package/dist/index.js +63 -55
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +31 -28
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +77 -66
- package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -35
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -1
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -3
- package/dist/node_modules/date-fns/constants.js +1 -1
- package/package.json +10 -10
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { TableData, TableProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Provides context for table components. Wrap TableToolbar and TableContent with this component.
|
|
4
|
+
*
|
|
5
|
+
* @see Docs https://caspeco.github.io/casper-ui-library/components/table
|
|
6
|
+
*/
|
|
2
7
|
export declare function Table<TData extends TableData>({ columns, data, localeString, expandedState, initialExpandedState, initialBreakingContentState, initialColumnVisibilityState, columnVisibilityState, onColumnVisibilityChange, onExpandedChange, onBreakingContentChange, getRowId, getRowActions, id, customRowIndication, onSortingChange, initialSortingState, sortingState, onSelectionChange, initialSelectionState, selectionState, selectionActions, disableSelectionCheckbox, children, }: TableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
3
8
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErD,wBAAgB,KAAK,CAAC,KAAK,SAAS,SAAS,EAAE,EAC9C,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,oBAAyB,EACzB,2BAAgC,EAChC,4BAA4B,EAC5B,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,QAAQ,EACR,aAAa,EACb,EAAE,EACF,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,QAAQ,GACR,EAAE,UAAU,CAAC,KAAK,CAAC,2CA8BnB"}
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,SAAS,SAAS,EAAE,EAC9C,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,oBAAyB,EACzB,2BAAgC,EAChC,4BAA4B,EAC5B,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,QAAQ,EACR,aAAa,EACb,EAAE,EACF,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,QAAQ,GACR,EAAE,UAAU,CAAC,KAAK,CAAC,2CA8BnB"}
|
|
@@ -2,9 +2,12 @@ import { CellContext, ColumnDef, ExpandedState, Row, RowData, RowSelectionState,
|
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import { MenuList } from '../menu/index.js';
|
|
4
4
|
import { TableContentProps } from './table-content.js';
|
|
5
|
+
import { TableToolbarActionsProps } from './table-toolbar-actions.js';
|
|
6
|
+
import { TableToolbarAddButtonProps } from './table-toolbar-add-button.js';
|
|
5
7
|
import { TableToolbarProps } from './table-toolbar.js';
|
|
8
|
+
import { TableToolbarSearchProps } from './table-toolbar-search.js';
|
|
6
9
|
import { Locales } from './translations.js';
|
|
7
|
-
export type { CellContext, ColumnDef, ExpandedState, Row, RowSelectionState, TableContentProps, TableToolbarProps, VisibilityState, };
|
|
10
|
+
export type { CellContext, ColumnDef, ExpandedState, Row, RowSelectionState, TableContentProps, TableToolbarProps, TableToolbarSearchProps, TableToolbarActionsProps, TableToolbarAddButtonProps, VisibilityState, };
|
|
8
11
|
interface BaseRow<TData extends TableData> {
|
|
9
12
|
subRows?: TableRow<TData>[];
|
|
10
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/table/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,GAAG,EACH,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,YAAY,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,GAAG,EACH,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GACf,CAAC;AAEF,UAAU,OAAO,CAAC,KAAK,SAAS,SAAS;IACxC,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;CAC5B;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAEnF,UAAU,cAAc,CAAC,KAAK,SAAS,SAAS;IAC/C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;I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5B,wFAAwF;IACxF,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAEvD,8HAA8H;IAC9H,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IAErC;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,OAAO,CAAC;CAClE;AAED,MAAM,MAAM,UAAU,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,IAAI,iBAAiB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;AAEvG,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,OAAO,QAAQ,uBAAuB,CAAC;IACtC,UAAU,UAAU,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM;QACjD,SAAS,CAAC,EAAE,OAAO,CAAC;QAEpB,WAAW,CAAC,EAAE,KAAK,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;KACtB;IACD,UAAU,SAAS,CAAC,KAAK,SAAS,OAAO;QACxC,KAAK,CAAC,EAAE,KAAK,CAAC;KACd;CACD"}
|
package/dist/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import { useColorMode as e, useDisclosure as t, useRadioGroup as m } from "@chak
|
|
|
2
2
|
import { isTouchScreenDevice as x } from "./theme/theme-helper.js";
|
|
3
3
|
import { ThemeColorModeScript as a, ThemeProvider as i } from "./theme/theme-provider.js";
|
|
4
4
|
import { ThemeProviderContext as l } from "./theme/theme-context.js";
|
|
5
|
-
import { ThemeBorderVariable as
|
|
6
|
-
import { Accordion as
|
|
5
|
+
import { ThemeBorderVariable as d, ThemeBreakPointVariable as b, ThemeColorVariable as u, ThemeFontSizeVariable as c, ThemeFontVariable as s, ThemeIconSizeVariable as h, ThemeRadiusVariable as g, ThemeShadowVariable as M, ThemeSpaceVariable as B } from "./theme/theme-types.js";
|
|
6
|
+
import { Accordion as C } from "./components/accordion/accordion.js";
|
|
7
7
|
import { AccordionItem as k } from "./components/accordion/accordion-item.js";
|
|
8
8
|
import { AccordionPanel as P } from "./components/accordion/accordion-panel.js";
|
|
9
9
|
import { Alert as V } from "./components/alert/alert.js";
|
|
10
|
-
import { Badge as
|
|
11
|
-
import { Box as
|
|
10
|
+
import { Badge as A } from "./components/badge/badge.js";
|
|
11
|
+
import { Box as R } from "./components/box/box.js";
|
|
12
12
|
import { Breadcrumbs as H } from "./components/breadcrumbs/breadcrumbs.js";
|
|
13
13
|
import { Button as N } from "./components/button/button.js";
|
|
14
14
|
import { Checkbox as z } from "./components/checkbox/checkbox.js";
|
|
@@ -25,16 +25,16 @@ import { FormErrorMessage as po } from "./components/form-control/form-error-mes
|
|
|
25
25
|
import { FormHelperText as fo } from "./components/form-control/form-helper-text.js";
|
|
26
26
|
import { FormLabel as io } from "./components/form-control/form-label.js";
|
|
27
27
|
import { Grid as lo } from "./components/grid/grid.js";
|
|
28
|
-
import { GridItem as
|
|
29
|
-
import { Heading as
|
|
28
|
+
import { GridItem as bo } from "./components/grid/grid-item.js";
|
|
29
|
+
import { Heading as co } from "./components/heading/heading.js";
|
|
30
30
|
import { Highlight as ho } from "./components/highlight/highlight.js";
|
|
31
31
|
import { Icon as Mo } from "./components/icon/icon.js";
|
|
32
|
-
import { Icons as
|
|
32
|
+
import { Icons as So } from "./components/icon/types.js";
|
|
33
33
|
import { IconButton as Io } from "./components/icon-button/icon-button.js";
|
|
34
34
|
import { Image as Lo } from "./components/image/image.js";
|
|
35
35
|
import { ImageUpload as Fo } from "./components/image-upload/image-upload.js";
|
|
36
36
|
import { ImageUploadAspectRatio as vo } from "./components/image-upload/types.js";
|
|
37
|
-
import { Input as
|
|
37
|
+
import { Input as Do } from "./components/input/input.js";
|
|
38
38
|
import { Link as Go } from "./components/link/link.js";
|
|
39
39
|
import { List as wo } from "./components/list/list.js";
|
|
40
40
|
import { ListItem as yo } from "./components/list/list-item.js";
|
|
@@ -51,17 +51,17 @@ import { Modal as mr } from "./components/modal/modal.js";
|
|
|
51
51
|
import { ModalBody as xr } from "./components/modal/modal-body.js";
|
|
52
52
|
import { ModalCloseButton as ar } from "./components/modal/modal-close-button.js";
|
|
53
53
|
import { ModalFooter as nr } from "./components/modal/modal-footer.js";
|
|
54
|
-
import { ModalHeader as
|
|
55
|
-
import { NavigationList as
|
|
56
|
-
import { NavigationListButton as
|
|
54
|
+
import { ModalHeader as Tr } from "./components/modal/modal-header.js";
|
|
55
|
+
import { NavigationList as br } from "./components/navigation-list/navigation-list.js";
|
|
56
|
+
import { NavigationListButton as cr, NavigationListLink as sr } from "./components/navigation-list/navigation-list-item.js";
|
|
57
57
|
import { Paginator as gr } from "./components/paginator/paginator.js";
|
|
58
58
|
import { QuantityButton as Br } from "./components/quantity-button/quantity-button.js";
|
|
59
|
-
import { Radio as
|
|
59
|
+
import { Radio as Cr } from "./components/radio/radio.js";
|
|
60
60
|
import { RadioAddon as kr } from "./components/radio/radio-addon.js";
|
|
61
61
|
import { RadioCard as Pr } from "./components/radio/radio-card.js";
|
|
62
62
|
import { RadioGroup as Vr } from "./components/radio-group/radio-group.js";
|
|
63
|
-
import { SegmentedControl as
|
|
64
|
-
import { Select as
|
|
63
|
+
import { SegmentedControl as Ar } from "./components/segmented-control/segmented-control.js";
|
|
64
|
+
import { Select as Rr } from "./components/select/select.js";
|
|
65
65
|
import { Skeleton as Hr } from "./components/skeleton/skeleton.js";
|
|
66
66
|
import { SkeletonText as Nr } from "./components/skeleton/skeleton-text.js";
|
|
67
67
|
import { Stack as zr } from "./components/stack/stack.js";
|
|
@@ -74,24 +74,28 @@ import { TableContent as Zr } from "./components/table/table-content.js";
|
|
|
74
74
|
import { useTableContext as $r } from "./components/table/table-context.js";
|
|
75
75
|
import { TableFilter as re } from "./components/table/table-filter.js";
|
|
76
76
|
import { TableToolbar as te } from "./components/table/table-toolbar.js";
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
77
|
+
import { TableToolbarSearch as pe } from "./components/table/table-toolbar-search.js";
|
|
78
|
+
import { TableToolbarSettings as fe } from "./components/table/table-toolbar-settings.js";
|
|
79
|
+
import { TableToolbarActions as ie } from "./components/table/table-toolbar-actions.js";
|
|
80
|
+
import { TableToolbarAddButton as le } from "./components/table/table-toolbar-add-button.js";
|
|
81
|
+
import { Tab as de } from "./components/tabs/tab.js";
|
|
82
|
+
import { TabList as ue } from "./components/tabs/tab-list.js";
|
|
83
|
+
import { TabPanel as se } from "./components/tabs/tab-panel.js";
|
|
84
|
+
import { TabPanels as ge } from "./components/tabs/tab-panels.js";
|
|
85
|
+
import { Tabs as Be } from "./components/tabs/tabs.js";
|
|
86
|
+
import { Tag as Ce } from "./components/tag/tag.js";
|
|
87
|
+
import { Text as ke } from "./components/text/text.js";
|
|
88
|
+
import { Textarea as Pe } from "./components/textarea/textarea.js";
|
|
89
|
+
import { useToast as Ve } from "./components/toast/toast.js";
|
|
90
|
+
import { ToggleButton as Ae } from "./components/toggle-button/toggle-button.js";
|
|
91
|
+
import { Tooltip as Re } from "./components/tooltip/tooltip.js";
|
|
88
92
|
export {
|
|
89
|
-
|
|
93
|
+
C as Accordion,
|
|
90
94
|
k as AccordionItem,
|
|
91
95
|
P as AccordionPanel,
|
|
92
96
|
V as Alert,
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
A as Badge,
|
|
98
|
+
R as Box,
|
|
95
99
|
H as Breadcrumbs,
|
|
96
100
|
N as Button,
|
|
97
101
|
z as Checkbox,
|
|
@@ -109,16 +113,16 @@ export {
|
|
|
109
113
|
fo as FormHelperText,
|
|
110
114
|
io as FormLabel,
|
|
111
115
|
lo as Grid,
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
bo as GridItem,
|
|
117
|
+
co as Heading,
|
|
114
118
|
ho as Highlight,
|
|
115
119
|
Mo as Icon,
|
|
116
120
|
Io as IconButton,
|
|
117
|
-
|
|
121
|
+
So as Icons,
|
|
118
122
|
Lo as Image,
|
|
119
123
|
Fo as ImageUpload,
|
|
120
124
|
vo as ImageUploadAspectRatio,
|
|
121
|
-
|
|
125
|
+
Do as Input,
|
|
122
126
|
Go as Link,
|
|
123
127
|
wo as List,
|
|
124
128
|
yo as ListItem,
|
|
@@ -135,54 +139,58 @@ export {
|
|
|
135
139
|
xr as ModalBody,
|
|
136
140
|
ar as ModalCloseButton,
|
|
137
141
|
nr as ModalFooter,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
Tr as ModalHeader,
|
|
143
|
+
br as NavigationList,
|
|
144
|
+
cr as NavigationListButton,
|
|
145
|
+
sr as NavigationListLink,
|
|
142
146
|
gr as Paginator,
|
|
143
147
|
Br as QuantityButton,
|
|
144
|
-
|
|
148
|
+
Cr as Radio,
|
|
145
149
|
kr as RadioAddon,
|
|
146
150
|
Pr as RadioCard,
|
|
147
151
|
Vr as RadioGroup,
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
Ar as SegmentedControl,
|
|
153
|
+
Rr as Select,
|
|
150
154
|
Hr as Skeleton,
|
|
151
155
|
Nr as SkeletonText,
|
|
152
156
|
zr as Stack,
|
|
153
157
|
Er as StepContext,
|
|
154
158
|
Wr as Stepper,
|
|
155
159
|
qr as Switch,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
de as Tab,
|
|
161
|
+
ue as TabList,
|
|
162
|
+
se as TabPanel,
|
|
163
|
+
ge as TabPanels,
|
|
160
164
|
Xr as Table,
|
|
161
165
|
Zr as TableContent,
|
|
162
166
|
re as TableFilter,
|
|
163
167
|
te as TableToolbar,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
168
|
+
ie as TableToolbarActions,
|
|
169
|
+
le as TableToolbarAddButton,
|
|
170
|
+
pe as TableToolbarSearch,
|
|
171
|
+
fe as TableToolbarSettings,
|
|
172
|
+
Be as Tabs,
|
|
173
|
+
Ce as Tag,
|
|
174
|
+
ke as Text,
|
|
175
|
+
Pe as Textarea,
|
|
176
|
+
d as ThemeBorderVariable,
|
|
177
|
+
b as ThemeBreakPointVariable,
|
|
178
|
+
u as ThemeColorVariable,
|
|
179
|
+
c as ThemeFontSizeVariable,
|
|
180
|
+
s as ThemeFontVariable,
|
|
173
181
|
h as ThemeIconSizeVariable,
|
|
174
182
|
i as ThemeProvider,
|
|
175
183
|
l as ThemeProviderContext,
|
|
176
184
|
g as ThemeRadiusVariable,
|
|
177
185
|
M as ThemeShadowVariable,
|
|
178
186
|
B as ThemeSpaceVariable,
|
|
179
|
-
|
|
180
|
-
|
|
187
|
+
Ae as ToggleButton,
|
|
188
|
+
Re as Tooltip,
|
|
181
189
|
Kr as createColumnHelper,
|
|
182
190
|
x as isTouchScreenDevice,
|
|
183
191
|
e as useColorMode,
|
|
184
192
|
t as useDisclosure,
|
|
185
193
|
m as useRadioGroup,
|
|
186
194
|
$r as useTableContext,
|
|
187
|
-
|
|
195
|
+
Ve as useToast
|
|
188
196
|
};
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { flushSync as
|
|
3
|
-
import { Virtualizer as
|
|
4
|
-
import { defaultKeyExtractor as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
import { flushSync as f } from "react-dom";
|
|
3
|
+
import { Virtualizer as i, elementScroll as m, observeElementOffset as d, observeElementRect as p } from "../../../virtual-core/dist/esm/index.js";
|
|
4
|
+
import { defaultKeyExtractor as g, defaultRangeExtractor as z, measureElement as O } from "../../../virtual-core/dist/esm/index.js";
|
|
5
|
+
const l = typeof document < "u" ? t.useLayoutEffect : t.useEffect;
|
|
6
|
+
function E({
|
|
7
|
+
useFlushSync: r = !0,
|
|
8
|
+
...n
|
|
9
|
+
}) {
|
|
10
|
+
const o = t.useReducer(() => ({}), {})[1], u = {
|
|
11
|
+
...n,
|
|
12
|
+
onChange: (c, s) => {
|
|
13
|
+
var a;
|
|
14
|
+
r && s ? f(o) : o(), (a = n.onChange) == null || a.call(n, c, s);
|
|
12
15
|
}
|
|
13
|
-
}, [
|
|
14
|
-
() => new
|
|
16
|
+
}, [e] = t.useState(
|
|
17
|
+
() => new i(u)
|
|
15
18
|
);
|
|
16
|
-
return
|
|
19
|
+
return e.setOptions(u), l(() => e._didMount(), []), l(() => e._willUpdate()), e;
|
|
17
20
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
-
observeElementRect:
|
|
21
|
-
observeElementOffset:
|
|
22
|
-
scrollToFn:
|
|
23
|
-
...
|
|
21
|
+
function x(r) {
|
|
22
|
+
return E({
|
|
23
|
+
observeElementRect: p,
|
|
24
|
+
observeElementOffset: d,
|
|
25
|
+
scrollToFn: m,
|
|
26
|
+
...r
|
|
24
27
|
});
|
|
25
28
|
}
|
|
26
29
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
i as Virtualizer,
|
|
31
|
+
g as defaultKeyExtractor,
|
|
32
|
+
z as defaultRangeExtractor,
|
|
33
|
+
m as elementScroll,
|
|
34
|
+
O as measureElement,
|
|
35
|
+
d as observeElementOffset,
|
|
36
|
+
p as observeElementRect,
|
|
37
|
+
x as useVirtualizer
|
|
35
38
|
};
|
|
@@ -2,12 +2,12 @@ import { memo as p, notUndefined as O, approxEqual as I, debounce as A } from ".
|
|
|
2
2
|
const y = (r) => {
|
|
3
3
|
const { offsetWidth: h, offsetHeight: e } = r;
|
|
4
4
|
return { width: h, height: e };
|
|
5
|
-
},
|
|
5
|
+
}, F = (r) => r, R = (r) => {
|
|
6
6
|
const h = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
|
|
7
7
|
for (let t = h; t <= e; t++)
|
|
8
8
|
s.push(t);
|
|
9
9
|
return s;
|
|
10
|
-
},
|
|
10
|
+
}, D = (r, h) => {
|
|
11
11
|
const e = r.scrollElement;
|
|
12
12
|
if (!e)
|
|
13
13
|
return;
|
|
@@ -25,9 +25,9 @@ const y = (r) => {
|
|
|
25
25
|
const o = () => {
|
|
26
26
|
const a = i[0];
|
|
27
27
|
if (a?.borderBoxSize) {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
t({ width:
|
|
28
|
+
const u = a.borderBoxSize[0];
|
|
29
|
+
if (u) {
|
|
30
|
+
t({ width: u.inlineSize, height: u.blockSize });
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -40,7 +40,7 @@ const y = (r) => {
|
|
|
40
40
|
};
|
|
41
41
|
}, M = {
|
|
42
42
|
passive: !0
|
|
43
|
-
}, w = typeof window > "u" ? !0 : "onscrollend" in window,
|
|
43
|
+
}, w = typeof window > "u" ? !0 : "onscrollend" in window, k = (r, h) => {
|
|
44
44
|
const e = r.scrollElement;
|
|
45
45
|
if (!e)
|
|
46
46
|
return;
|
|
@@ -56,13 +56,13 @@ const y = (r) => {
|
|
|
56
56
|
},
|
|
57
57
|
r.options.isScrollingResetDelay
|
|
58
58
|
), i = (c) => () => {
|
|
59
|
-
const { horizontal:
|
|
60
|
-
t =
|
|
59
|
+
const { horizontal: m, isRtl: l } = r.options;
|
|
60
|
+
t = m ? e.scrollLeft * (l && -1 || 1) : e.scrollTop, n(), h(t, c);
|
|
61
61
|
}, o = i(!0), a = i(!1);
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
e.removeEventListener("scroll", o),
|
|
62
|
+
e.addEventListener("scroll", o, M);
|
|
63
|
+
const u = r.options.useScrollendEvent && w;
|
|
64
|
+
return u && e.addEventListener("scrollend", a, M), () => {
|
|
65
|
+
e.removeEventListener("scroll", o), u && e.removeEventListener("scrollend", a);
|
|
66
66
|
};
|
|
67
67
|
}, _ = (r, h, e) => {
|
|
68
68
|
if (h?.borderBoxSize) {
|
|
@@ -73,7 +73,7 @@ const y = (r) => {
|
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
return r[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
76
|
-
},
|
|
76
|
+
}, T = (r, {
|
|
77
77
|
adjustments: h = 0,
|
|
78
78
|
behavior: e
|
|
79
79
|
}, s) => {
|
|
@@ -84,9 +84,9 @@ const y = (r) => {
|
|
|
84
84
|
behavior: e
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
|
-
class
|
|
87
|
+
class L {
|
|
88
88
|
constructor(h) {
|
|
89
|
-
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
89
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.currentScrollToIndex = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
90
90
|
let e = null;
|
|
91
91
|
const s = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((t) => {
|
|
92
92
|
t.forEach((n) => {
|
|
@@ -122,8 +122,8 @@ class T {
|
|
|
122
122
|
scrollPaddingStart: 0,
|
|
123
123
|
scrollPaddingEnd: 0,
|
|
124
124
|
horizontal: !1,
|
|
125
|
-
getItemKey:
|
|
126
|
-
rangeExtractor:
|
|
125
|
+
getItemKey: F,
|
|
126
|
+
rangeExtractor: R,
|
|
127
127
|
onChange: () => {
|
|
128
128
|
},
|
|
129
129
|
measureElement: _,
|
|
@@ -175,9 +175,6 @@ class T {
|
|
|
175
175
|
}
|
|
176
176
|
this.scrollElement = s, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((e = this.scrollElement) == null ? void 0 : e.window) ?? null, this.elementsCache.forEach((t) => {
|
|
177
177
|
this.observer.observe(t);
|
|
178
|
-
}), this._scrollToOffset(this.getScrollOffset(), {
|
|
179
|
-
adjustments: void 0,
|
|
180
|
-
behavior: void 0
|
|
181
178
|
}), this.unsubs.push(
|
|
182
179
|
this.options.observeElementRect(this, (t) => {
|
|
183
180
|
this.scrollRect = t, this.maybeNotify();
|
|
@@ -186,7 +183,10 @@ class T {
|
|
|
186
183
|
this.options.observeElementOffset(this, (t, n) => {
|
|
187
184
|
this.scrollAdjustments = 0, this.scrollDirection = n ? this.getScrollOffset() < t ? "forward" : "backward" : null, this.scrollOffset = t, this.isScrolling = n, this.maybeNotify();
|
|
188
185
|
})
|
|
189
|
-
)
|
|
186
|
+
), this._scrollToOffset(this.getScrollOffset(), {
|
|
187
|
+
adjustments: void 0,
|
|
188
|
+
behavior: void 0
|
|
189
|
+
});
|
|
190
190
|
}
|
|
191
191
|
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, s) => {
|
|
192
192
|
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
@@ -219,11 +219,7 @@ class T {
|
|
|
219
219
|
lanes: o
|
|
220
220
|
}),
|
|
221
221
|
{
|
|
222
|
-
key: !1
|
|
223
|
-
skipInitialOnChange: !0,
|
|
224
|
-
onChange: () => {
|
|
225
|
-
this.notify(this.isScrolling);
|
|
226
|
-
}
|
|
222
|
+
key: !1
|
|
227
223
|
}
|
|
228
224
|
), this.getMeasurements = p(
|
|
229
225
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
@@ -233,38 +229,38 @@ class T {
|
|
|
233
229
|
if (this.laneAssignments.size > e)
|
|
234
230
|
for (const l of this.laneAssignments.keys())
|
|
235
231
|
l >= e && this.laneAssignments.delete(l);
|
|
236
|
-
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
|
|
232
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
|
|
237
233
|
this.itemSizeCache.set(l.key, l.size);
|
|
238
234
|
}));
|
|
239
|
-
const
|
|
235
|
+
const u = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
240
236
|
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
|
|
241
|
-
const c = this.measurementsCache.slice(0,
|
|
237
|
+
const c = this.measurementsCache.slice(0, u), m = new Array(o).fill(
|
|
242
238
|
void 0
|
|
243
239
|
);
|
|
244
|
-
for (let l = 0; l <
|
|
240
|
+
for (let l = 0; l < u; l++) {
|
|
245
241
|
const f = c[l];
|
|
246
|
-
f && (
|
|
242
|
+
f && (m[f.lane] = l);
|
|
247
243
|
}
|
|
248
|
-
for (let l =
|
|
244
|
+
for (let l = u; l < e; l++) {
|
|
249
245
|
const f = n(l), v = this.laneAssignments.get(l);
|
|
250
|
-
let
|
|
246
|
+
let d, b;
|
|
251
247
|
if (v !== void 0 && this.options.lanes > 1) {
|
|
252
|
-
|
|
253
|
-
const
|
|
248
|
+
d = v;
|
|
249
|
+
const g = m[d], x = g !== void 0 ? c[g] : void 0;
|
|
254
250
|
b = x ? x.end + this.options.gap : s + t;
|
|
255
251
|
} else {
|
|
256
|
-
const
|
|
257
|
-
b =
|
|
252
|
+
const g = this.options.lanes === 1 ? c[l - 1] : this.getFurthestMeasurement(c, l);
|
|
253
|
+
b = g ? g.end + this.options.gap : s + t, d = g ? g.lane : l % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(l, d);
|
|
258
254
|
}
|
|
259
|
-
const
|
|
255
|
+
const E = a.get(f), S = typeof E == "number" ? E : this.options.estimateSize(l), C = b + S;
|
|
260
256
|
c[l] = {
|
|
261
257
|
index: l,
|
|
262
258
|
start: b,
|
|
263
|
-
size:
|
|
259
|
+
size: S,
|
|
264
260
|
end: C,
|
|
265
261
|
key: f,
|
|
266
|
-
lane:
|
|
267
|
-
},
|
|
262
|
+
lane: d
|
|
263
|
+
}, m[d] = l;
|
|
268
264
|
}
|
|
269
265
|
return this.measurementsCache = c, c;
|
|
270
266
|
},
|
|
@@ -279,7 +275,7 @@ class T {
|
|
|
279
275
|
this.getScrollOffset(),
|
|
280
276
|
this.options.lanes
|
|
281
277
|
],
|
|
282
|
-
(e, s, t, n) => this.range = e.length > 0 && s > 0 ?
|
|
278
|
+
(e, s, t, n) => this.range = e.length > 0 && s > 0 ? W({
|
|
283
279
|
measurements: e,
|
|
284
280
|
outerSize: s,
|
|
285
281
|
scrollOffset: t,
|
|
@@ -364,10 +360,19 @@ class T {
|
|
|
364
360
|
e
|
|
365
361
|
)]
|
|
366
362
|
);
|
|
363
|
+
}, this.getMaxScrollOffset = () => {
|
|
364
|
+
if (!this.scrollElement) return 0;
|
|
365
|
+
if ("scrollHeight" in this.scrollElement)
|
|
366
|
+
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
367
|
+
{
|
|
368
|
+
const e = this.scrollElement.document.documentElement;
|
|
369
|
+
return this.options.horizontal ? e.scrollWidth - this.scrollElement.innerWidth : e.scrollHeight - this.scrollElement.innerHeight;
|
|
370
|
+
}
|
|
367
371
|
}, this.getOffsetForAlignment = (e, s, t = 0) => {
|
|
372
|
+
if (!this.scrollElement) return 0;
|
|
368
373
|
const n = this.getSize(), i = this.getScrollOffset();
|
|
369
374
|
s === "auto" && (s = e >= i + n ? "end" : "start"), s === "center" ? e += (t - n) / 2 : s === "end" && (e -= n);
|
|
370
|
-
const o = this.
|
|
375
|
+
const o = this.getMaxScrollOffset();
|
|
371
376
|
return Math.max(Math.min(o, e), 0);
|
|
372
377
|
}, this.getOffsetForIndex = (e, s = "auto") => {
|
|
373
378
|
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
@@ -382,6 +387,8 @@ class T {
|
|
|
382
387
|
s = "start";
|
|
383
388
|
else
|
|
384
389
|
return [i, s];
|
|
390
|
+
if (s === "end" && e === this.options.count - 1)
|
|
391
|
+
return [this.getMaxScrollOffset(), s];
|
|
385
392
|
const o = s === "end" ? t.end + this.options.scrollPaddingEnd : t.start - this.options.scrollPaddingStart;
|
|
386
393
|
return [
|
|
387
394
|
this.getOffsetForAlignment(o, s, t.size),
|
|
@@ -397,26 +404,30 @@ class T {
|
|
|
397
404
|
}, this.scrollToIndex = (e, { align: s = "auto", behavior: t } = {}) => {
|
|
398
405
|
t === "smooth" && this.isDynamicMode() && console.warn(
|
|
399
406
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
400
|
-
), e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
407
|
+
), e = Math.max(0, Math.min(e, this.options.count - 1)), this.currentScrollToIndex = e;
|
|
401
408
|
let n = 0;
|
|
402
|
-
const i = 10, o = (
|
|
409
|
+
const i = 10, o = (u) => {
|
|
403
410
|
if (!this.targetWindow) return;
|
|
404
|
-
const c = this.getOffsetForIndex(e,
|
|
411
|
+
const c = this.getOffsetForIndex(e, u);
|
|
405
412
|
if (!c) {
|
|
406
413
|
console.warn("Failed to get offset for index:", e);
|
|
407
414
|
return;
|
|
408
415
|
}
|
|
409
|
-
const [
|
|
410
|
-
this._scrollToOffset(
|
|
411
|
-
const f =
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
416
|
+
const [m, l] = c;
|
|
417
|
+
this._scrollToOffset(m, { adjustments: void 0, behavior: t }), this.targetWindow.requestAnimationFrame(() => {
|
|
418
|
+
const f = () => {
|
|
419
|
+
if (this.currentScrollToIndex !== e) return;
|
|
420
|
+
const v = this.getScrollOffset(), d = this.getOffsetForIndex(e, l);
|
|
421
|
+
if (!d) {
|
|
422
|
+
console.warn("Failed to get offset for index:", e);
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
I(d[0], v) || a(l);
|
|
426
|
+
};
|
|
427
|
+
this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(f) : f();
|
|
417
428
|
});
|
|
418
|
-
}, a = (
|
|
419
|
-
this.targetWindow && (n++, n < i ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", n, i), this.targetWindow.requestAnimationFrame(() => o(
|
|
429
|
+
}, a = (u) => {
|
|
430
|
+
this.targetWindow && this.currentScrollToIndex === e && (n++, n < i ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", n, i), this.targetWindow.requestAnimationFrame(() => o(u))) : console.warn(
|
|
420
431
|
`Failed to scroll to index ${e} after ${i} attempts.`
|
|
421
432
|
));
|
|
422
433
|
};
|
|
@@ -471,7 +482,7 @@ const z = (r, h, e, s) => {
|
|
|
471
482
|
}
|
|
472
483
|
return r > 0 ? r - 1 : 0;
|
|
473
484
|
};
|
|
474
|
-
function
|
|
485
|
+
function W({
|
|
475
486
|
measurements: r,
|
|
476
487
|
outerSize: h,
|
|
477
488
|
scrollOffset: e,
|
|
@@ -498,25 +509,25 @@ function N({
|
|
|
498
509
|
const c = r[o];
|
|
499
510
|
a[c.lane] = c.end, o++;
|
|
500
511
|
}
|
|
501
|
-
const
|
|
502
|
-
for (; i >= 0 &&
|
|
512
|
+
const u = Array(s).fill(e + h);
|
|
513
|
+
for (; i >= 0 && u.some((c) => c >= e); ) {
|
|
503
514
|
const c = r[i];
|
|
504
|
-
|
|
515
|
+
u[c.lane] = c.start, i--;
|
|
505
516
|
}
|
|
506
517
|
i = Math.max(0, i - i % s), o = Math.min(t, o + (s - 1 - o % s));
|
|
507
518
|
}
|
|
508
519
|
return { startIndex: i, endIndex: o };
|
|
509
520
|
}
|
|
510
521
|
export {
|
|
511
|
-
|
|
522
|
+
L as Virtualizer,
|
|
512
523
|
I as approxEqual,
|
|
513
524
|
A as debounce,
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
525
|
+
F as defaultKeyExtractor,
|
|
526
|
+
R as defaultRangeExtractor,
|
|
527
|
+
T as elementScroll,
|
|
517
528
|
_ as measureElement,
|
|
518
529
|
p as memo,
|
|
519
530
|
O as notUndefined,
|
|
520
|
-
|
|
521
|
-
|
|
531
|
+
k as observeElementOffset,
|
|
532
|
+
D as observeElementRect
|
|
522
533
|
};
|