@danxbot/ui 20.10.0 → 20.12.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/index.js +12724 -12552
- package/dist/index.js.map +1 -1
- package/dist/types/components/Board.d.ts +1 -14
- package/dist/types/components/DragDrop.d.ts +10 -1
- package/dist/types/components/PagedWindowList.d.ts +4 -4
- package/dist/types/components/paged-window/PageBlock.d.ts +31 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/lib/board/anchor.d.ts +53 -0
- package/dist/types/lib/board/index.d.ts +3 -1
- package/dist/types/lib/board/move.d.ts +9 -0
- package/dist/types/lib/board/position.d.ts +22 -0
- package/dist/types/lib/board/types.d.ts +47 -4
- package/dist/types/lib/dnd/announce.d.ts +1 -1
- package/dist/types/lib/dnd/session.d.ts +12 -0
- package/dist/types/lib/dnd/types.d.ts +9 -0
- package/dist/types/lib/dnd/use-drag.d.ts +4 -0
- package/dist/types/lib/dom/scroll-ancestor.d.ts +15 -0
- package/dist/types/lib/paged-window/index.d.ts +1 -1
- package/dist/types/lib/paged-window/layout.d.ts +21 -0
- package/dist/types/lib/paged-window/store.d.ts +58 -21
- package/dist/types/lib/paged-window/use-measured-pitch.d.ts +34 -0
- package/dist/types/lib/paged-window/use-page-visibility.d.ts +20 -0
- package/dist/types/lib/paged-window/use-paged-window.d.ts +9 -8
- package/dist/types/lib/paged-window/use-scroll-root.d.ts +18 -0
- package/package.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { type PagedWindowOptions, type PagedWindowSnapshot } from "./store";
|
|
1
|
+
import { type PagedWindowMode, type PagedWindowOptions, type PagedWindowSnapshot } from "./store";
|
|
2
2
|
export interface UsePagedWindowOptions<T> extends PagedWindowOptions<T> {
|
|
3
3
|
/**
|
|
4
4
|
* Names WHAT is being listed: the filter, the sort, the time range. When it
|
|
5
5
|
* changes the window forgets every page, returns to the first and the list
|
|
6
|
-
* scrolls back to the top. A change in
|
|
6
|
+
* scrolls back to the top. A change in a loader's identity alone does not:
|
|
7
7
|
* a loader closing over fresh state must not throw away what is held.
|
|
8
8
|
*/
|
|
9
9
|
queryKey: string;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* `"count"` loads no cards, only the list's length (through `loadCount`), and
|
|
12
|
+
* keeps it live: a hidden lane that still needs a true badge. Back to
|
|
13
|
+
* `"pages"`, the window loads again.
|
|
14
|
+
* @default "pages"
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
+
mode?: PagedWindowMode;
|
|
16
17
|
}
|
|
17
18
|
export interface PagedWindow<T> extends PagedWindowSnapshot<T> {
|
|
18
19
|
/** The viewer moved to this page. `PagedWindowList` reports it; a custom view may too. */
|
|
19
20
|
setAnchorPage: (page: number) => void;
|
|
20
21
|
/** Re-read one held page in place — a card on it changed. */
|
|
21
22
|
invalidatePage: (page: number) => void;
|
|
22
|
-
/** Re-read every held page in place — a card was created, moved or removed. */
|
|
23
|
+
/** Re-read every held page in place — a card was created, moved or removed. In `count` mode, re-ask the length. */
|
|
23
24
|
invalidateAll: () => void;
|
|
24
25
|
/**
|
|
25
26
|
* While true the window neither loads nor drops pages. `PagedWindowList`
|
|
@@ -37,4 +38,4 @@ export interface PagedWindow<T> extends PagedWindowSnapshot<T> {
|
|
|
37
38
|
* means every held page is cut differently, which is a different list — give it
|
|
38
39
|
* a new `queryKey` and a new mount instead. It throws rather than guessing.
|
|
39
40
|
*/
|
|
40
|
-
export declare function usePagedWindow<T>({ pageSize, windowPages, loadPage, queryKey,
|
|
41
|
+
export declare function usePagedWindow<T>({ pageSize, windowPages, loadPage, loadCount, queryKey, mode, }: UsePagedWindowOptions<T>): PagedWindow<T>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The element a list scrolls in: `el` is null when the page itself scrolls (the viewport). */
|
|
2
|
+
export interface ScrollRoot {
|
|
3
|
+
el: HTMLElement | null;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Finds the box a list scrolls in, once the list is in the DOM. DX-4540.
|
|
7
|
+
*
|
|
8
|
+
* Returns a ref callback for the list's root and the root it resolved (null
|
|
9
|
+
* until mounted). The list's OWN element counts: a list whose class sets
|
|
10
|
+
* `overflow-y-auto` is its own scroller, and one dropped into a board lane
|
|
11
|
+
* finds the lane's container above it. Resolved on mount only — a list does
|
|
12
|
+
* not change scroller during its life, and re-walking on every render would
|
|
13
|
+
* make the IntersectionObserver rooted at it be torn down and rebuilt.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useScrollRoot(): {
|
|
16
|
+
ref: (el: HTMLElement | null) => void;
|
|
17
|
+
scroller: ScrollRoot | null;
|
|
18
|
+
};
|