@kjun-ui/react 0.18.0 → 0.20.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.cjs +2285 -1322
- package/dist/index.js +2362 -1397
- package/dist/styles.css +770 -471
- package/dist/types/packages/react/src/app-navigation.d.cts +12 -8
- package/dist/types/packages/react/src/app-navigation.d.ts +12 -8
- package/dist/types/packages/react/src/display.d.cts +8 -2
- package/dist/types/packages/react/src/display.d.ts +8 -2
- package/dist/types/packages/react/src/drawer.d.cts +3 -5
- package/dist/types/packages/react/src/drawer.d.ts +3 -5
- package/dist/types/packages/react/src/fab.d.cts +3 -3
- package/dist/types/packages/react/src/fab.d.ts +3 -3
- package/dist/types/packages/react/src/feedback.d.cts +12 -3
- package/dist/types/packages/react/src/feedback.d.ts +12 -3
- package/dist/types/packages/react/src/index.d.cts +2 -0
- package/dist/types/packages/react/src/index.d.ts +2 -0
- package/dist/types/packages/react/src/layout-primitives.d.cts +24 -24
- package/dist/types/packages/react/src/layout-primitives.d.ts +24 -24
- package/dist/types/packages/react/src/list.d.cts +1 -1
- package/dist/types/packages/react/src/list.d.ts +1 -1
- package/dist/types/packages/react/src/modal.d.cts +3 -1
- package/dist/types/packages/react/src/modal.d.ts +3 -1
- package/dist/types/packages/react/src/provider.d.cts +4 -1
- package/dist/types/packages/react/src/provider.d.ts +4 -1
- package/dist/types/packages/react/src/range-input.d.cts +12 -1
- package/dist/types/packages/react/src/range-input.d.ts +12 -1
- package/dist/types/packages/react/src/skeleton-phase.d.cts +2 -0
- package/dist/types/packages/react/src/skeleton-phase.d.ts +2 -0
- package/dist/types/packages/react/src/skeletons.d.cts +19 -4
- package/dist/types/packages/react/src/skeletons.d.ts +19 -4
- package/dist/types/packages/react/src/table-cards.d.cts +6 -3
- package/dist/types/packages/react/src/table-cards.d.ts +6 -3
- package/dist/types/packages/react/src/table-list.d.cts +2 -6
- package/dist/types/packages/react/src/table-list.d.ts +2 -6
- package/dist/types/packages/react/src/table-model.d.cts +1 -0
- package/dist/types/packages/react/src/table-model.d.ts +1 -0
- package/dist/types/packages/react/src/table-toolbar.d.cts +1 -1
- package/dist/types/packages/react/src/table-toolbar.d.ts +1 -1
- package/dist/types/packages/react/src/table-totals.d.cts +5 -0
- package/dist/types/packages/react/src/table-totals.d.ts +5 -0
- package/dist/types/packages/react/src/toast-stack.d.cts +7 -2
- package/dist/types/packages/react/src/toast-stack.d.ts +7 -2
- package/dist/types/shared/package-runtime/chart-skeleton.d.cts +15 -3
- package/dist/types/shared/package-runtime/chart-skeleton.d.ts +15 -3
- package/dist/types/shared/package-runtime/drawer-geometry.d.cts +2 -3
- package/dist/types/shared/package-runtime/drawer-geometry.d.ts +2 -3
- package/dist/types/shared/package-runtime/feedback-dialog.d.cts +5 -4
- package/dist/types/shared/package-runtime/feedback-dialog.d.ts +5 -4
- package/dist/types/shared/package-runtime/feedback-motion.d.cts +2 -5
- package/dist/types/shared/package-runtime/feedback-motion.d.ts +2 -5
- package/dist/types/shared/package-runtime/feedback-prompt.d.cts +58 -0
- package/dist/types/shared/package-runtime/feedback-prompt.d.ts +58 -0
- package/dist/types/shared/package-runtime/market-layout.d.cts +0 -1
- package/dist/types/shared/package-runtime/market-layout.d.ts +0 -1
- package/dist/types/shared/package-runtime/messages/ko.d.cts +7 -0
- package/dist/types/shared/package-runtime/messages/ko.d.ts +7 -0
- package/dist/types/shared/package-runtime/messages-context.d.cts +7 -0
- package/dist/types/shared/package-runtime/messages-context.d.ts +7 -0
- package/dist/types/shared/package-runtime/safe-area.d.cts +20 -0
- package/dist/types/shared/package-runtime/safe-area.d.ts +20 -0
- package/dist/types/shared/package-runtime/skeleton-text.d.cts +12 -0
- package/dist/types/shared/package-runtime/skeleton-text.d.ts +12 -0
- package/dist/types/shared/package-runtime/slider-view.d.cts +90 -0
- package/dist/types/shared/package-runtime/slider-view.d.ts +90 -0
- package/dist/types/shared/package-runtime/stable-value.d.cts +3 -0
- package/dist/types/shared/package-runtime/stable-value.d.ts +3 -0
- package/dist/types/shared/package-runtime/table-groups.d.cts +9 -0
- package/dist/types/shared/package-runtime/table-groups.d.ts +9 -0
- package/dist/types/shared/package-runtime/table-presentation.d.cts +40 -2
- package/dist/types/shared/package-runtime/table-presentation.d.ts +40 -2
- package/dist/types/shared/package-runtime/table.d.cts +9 -0
- package/dist/types/shared/package-runtime/table.d.ts +9 -0
- package/dist/types/shared/package-runtime/toast-entry.d.cts +3 -0
- package/dist/types/shared/package-runtime/toast-entry.d.ts +3 -0
- package/dist/types/shared/package-runtime/toast-placement.d.cts +4 -0
- package/dist/types/shared/package-runtime/toast-placement.d.ts +4 -0
- package/dist/types/shared/package-runtime/toast-presence.d.cts +12 -0
- package/dist/types/shared/package-runtime/toast-presence.d.ts +12 -0
- package/dist/types/shared/package-runtime/toast-presentation.d.cts +42 -0
- package/dist/types/shared/package-runtime/toast-presentation.d.ts +42 -0
- package/dist/types/shared/package-runtime/toast-swipe.d.cts +20 -0
- package/dist/types/shared/package-runtime/toast-swipe.d.ts +20 -0
- package/dist/types/shared/package-runtime/use-table-group-expansion.d.cts +6 -0
- package/dist/types/shared/package-runtime/use-table-group-expansion.d.ts +6 -0
- package/dist/types/shared/package-runtime/use-toast-stack.d.cts +22 -0
- package/dist/types/shared/package-runtime/use-toast-stack.d.ts +22 -0
- package/package.json +3 -3
|
@@ -4,9 +4,14 @@ export declare const kjunMessagesKo: {
|
|
|
4
4
|
save: string;
|
|
5
5
|
close: string;
|
|
6
6
|
closeNotification: string;
|
|
7
|
+
notifications: string;
|
|
8
|
+
moreNotifications: (count: number) => string;
|
|
9
|
+
showNotifications: string;
|
|
10
|
+
collapseNotifications: string;
|
|
7
11
|
confirmTitle: string;
|
|
8
12
|
promptTitle: string;
|
|
9
13
|
invalidInput: string;
|
|
14
|
+
typeToConfirm: (value: string) => string;
|
|
10
15
|
dialog: string;
|
|
11
16
|
panel: string;
|
|
12
17
|
details: string;
|
|
@@ -101,6 +106,8 @@ export declare const kjunMessagesKo: {
|
|
|
101
106
|
collapse: string;
|
|
102
107
|
showDetails: string;
|
|
103
108
|
ascending: string;
|
|
109
|
+
sortBy: string;
|
|
110
|
+
defaultOrder: string;
|
|
104
111
|
descending: string;
|
|
105
112
|
tabs: string;
|
|
106
113
|
showPath: string;
|
|
@@ -4,9 +4,14 @@ export declare const kjunMessagesKo: {
|
|
|
4
4
|
save: string;
|
|
5
5
|
close: string;
|
|
6
6
|
closeNotification: string;
|
|
7
|
+
notifications: string;
|
|
8
|
+
moreNotifications: (count: number) => string;
|
|
9
|
+
showNotifications: string;
|
|
10
|
+
collapseNotifications: string;
|
|
7
11
|
confirmTitle: string;
|
|
8
12
|
promptTitle: string;
|
|
9
13
|
invalidInput: string;
|
|
14
|
+
typeToConfirm: (value: string) => string;
|
|
10
15
|
dialog: string;
|
|
11
16
|
panel: string;
|
|
12
17
|
details: string;
|
|
@@ -101,6 +106,8 @@ export declare const kjunMessagesKo: {
|
|
|
101
106
|
collapse: string;
|
|
102
107
|
showDetails: string;
|
|
103
108
|
ascending: string;
|
|
109
|
+
sortBy: string;
|
|
110
|
+
defaultOrder: string;
|
|
104
111
|
descending: string;
|
|
105
112
|
tabs: string;
|
|
106
113
|
showPath: string;
|
|
@@ -13,9 +13,14 @@ export declare const useKjunMessages: () => {
|
|
|
13
13
|
save: string;
|
|
14
14
|
close: string;
|
|
15
15
|
closeNotification: string;
|
|
16
|
+
notifications: string;
|
|
17
|
+
moreNotifications: (count: number) => string;
|
|
18
|
+
showNotifications: string;
|
|
19
|
+
collapseNotifications: string;
|
|
16
20
|
confirmTitle: string;
|
|
17
21
|
promptTitle: string;
|
|
18
22
|
invalidInput: string;
|
|
23
|
+
typeToConfirm: (value: string) => string;
|
|
19
24
|
dialog: string;
|
|
20
25
|
panel: string;
|
|
21
26
|
details: string;
|
|
@@ -110,6 +115,8 @@ export declare const useKjunMessages: () => {
|
|
|
110
115
|
collapse: string;
|
|
111
116
|
showDetails: string;
|
|
112
117
|
ascending: string;
|
|
118
|
+
sortBy: string;
|
|
119
|
+
defaultOrder: string;
|
|
113
120
|
descending: string;
|
|
114
121
|
tabs: string;
|
|
115
122
|
showPath: string;
|
|
@@ -13,9 +13,14 @@ export declare const useKjunMessages: () => {
|
|
|
13
13
|
save: string;
|
|
14
14
|
close: string;
|
|
15
15
|
closeNotification: string;
|
|
16
|
+
notifications: string;
|
|
17
|
+
moreNotifications: (count: number) => string;
|
|
18
|
+
showNotifications: string;
|
|
19
|
+
collapseNotifications: string;
|
|
16
20
|
confirmTitle: string;
|
|
17
21
|
promptTitle: string;
|
|
18
22
|
invalidInput: string;
|
|
23
|
+
typeToConfirm: (value: string) => string;
|
|
19
24
|
dialog: string;
|
|
20
25
|
panel: string;
|
|
21
26
|
details: string;
|
|
@@ -110,6 +115,8 @@ export declare const useKjunMessages: () => {
|
|
|
110
115
|
collapse: string;
|
|
111
116
|
showDetails: string;
|
|
112
117
|
ascending: string;
|
|
118
|
+
sortBy: string;
|
|
119
|
+
defaultOrder: string;
|
|
113
120
|
descending: string;
|
|
114
121
|
tabs: string;
|
|
115
122
|
showPath: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface KjunSafeArea {
|
|
2
|
+
/** Top inset in px (status bar, notch). */
|
|
3
|
+
top?: number;
|
|
4
|
+
/** Bottom inset in px (home indicator). */
|
|
5
|
+
bottom?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ResolvedSafeArea {
|
|
8
|
+
top: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
}
|
|
11
|
+
/** A provider's own values, else the parent's, never negative. */
|
|
12
|
+
export declare function resolveSafeArea(area?: KjunSafeArea, parent?: ResolvedSafeArea): ResolvedSafeArea;
|
|
13
|
+
/**
|
|
14
|
+
* Web: a provider that receives a safe area writes it as CSS variables; without one, components fall back to the
|
|
15
|
+
* browser's env(safe-area-inset-*) (which needs viewport-fit=cover). Nested providers inherit their parent's values.
|
|
16
|
+
*/
|
|
17
|
+
export declare function safeAreaVars(area?: KjunSafeArea): Record<string, string>;
|
|
18
|
+
/** The web inset for an edge component; safeArea={false} drops it where the app already reserved the space. */
|
|
19
|
+
export declare const webSafeTop: (on?: boolean) => "var(--_kjun-safe-area-top)" | "0px";
|
|
20
|
+
export declare const webSafeBottom: (on?: boolean) => "0px" | "var(--_kjun-safe-area-bottom)";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface KjunSafeArea {
|
|
2
|
+
/** Top inset in px (status bar, notch). */
|
|
3
|
+
top?: number;
|
|
4
|
+
/** Bottom inset in px (home indicator). */
|
|
5
|
+
bottom?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ResolvedSafeArea {
|
|
8
|
+
top: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
}
|
|
11
|
+
/** A provider's own values, else the parent's, never negative. */
|
|
12
|
+
export declare function resolveSafeArea(area?: KjunSafeArea, parent?: ResolvedSafeArea): ResolvedSafeArea;
|
|
13
|
+
/**
|
|
14
|
+
* Web: a provider that receives a safe area writes it as CSS variables; without one, components fall back to the
|
|
15
|
+
* browser's env(safe-area-inset-*) (which needs viewport-fit=cover). Nested providers inherit their parent's values.
|
|
16
|
+
*/
|
|
17
|
+
export declare function safeAreaVars(area?: KjunSafeArea): Record<string, string>;
|
|
18
|
+
/** The web inset for an edge component; safeArea={false} drops it where the app already reserved the space. */
|
|
19
|
+
export declare const webSafeTop: (on?: boolean) => "var(--_kjun-safe-area-top)" | "0px";
|
|
20
|
+
export declare const webSafeBottom: (on?: boolean) => "0px" | "var(--_kjun-safe-area-bottom)";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TypographyRole } from "@kjun-ui/tokens";
|
|
2
|
+
type Percent = `${number}%`;
|
|
3
|
+
/** A paragraph that does not look like every other one, with a short last line. */
|
|
4
|
+
export declare function skeletonTextWidths(rows: number): Percent[];
|
|
5
|
+
/** The web line box of a type role; without a role the line takes the surrounding text's line height. */
|
|
6
|
+
export declare function skeletonLineBox(role?: TypographyRole): string;
|
|
7
|
+
/**
|
|
8
|
+
* A negative animation delay that puts a skeleton mounted now on the same pulse as every other one,
|
|
9
|
+
* so skeletons that appear at different times still brighten and dim together.
|
|
10
|
+
*/
|
|
11
|
+
export declare function skeletonPhase(now?: number): string;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TypographyRole } from "@kjun-ui/tokens";
|
|
2
|
+
type Percent = `${number}%`;
|
|
3
|
+
/** A paragraph that does not look like every other one, with a short last line. */
|
|
4
|
+
export declare function skeletonTextWidths(rows: number): Percent[];
|
|
5
|
+
/** The web line box of a type role; without a role the line takes the surrounding text's line height. */
|
|
6
|
+
export declare function skeletonLineBox(role?: TypographyRole): string;
|
|
7
|
+
/**
|
|
8
|
+
* A negative animation delay that puts a skeleton mounted now on the same pulse as every other one,
|
|
9
|
+
* so skeletons that appear at different times still brighten and dim together.
|
|
10
|
+
*/
|
|
11
|
+
export declare function skeletonPhase(now?: number): string;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export interface KjunSliderMark {
|
|
2
|
+
value: number;
|
|
3
|
+
/** Drawn beside the rail; leave it out for a dot only. Pressing a label moves the nearer thumb there. */
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export type SliderMarks = boolean | KjunSliderMark[];
|
|
7
|
+
export type SliderOrientation = "horizontal" | "vertical";
|
|
8
|
+
/**
|
|
9
|
+
* Without formatValue the value follows the locale's number grouping with as many decimals as min and step use, so
|
|
10
|
+
* 0.5 steps read 1.0 · 1.5 and the text keeps its width while dragging. Formatters are cached per locale and precision.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sliderFormatter(formatValue: ((value: number) => string) | undefined, locale?: string, min?: number, step?: number): (value: number) => string;
|
|
13
|
+
/** The visible value: formatRange for a range when given, else two equal values read as one. */
|
|
14
|
+
export declare function sliderValueText(values: readonly number[], format: (value: number) => string, formatRange?: (start: number, end: number) => string): string;
|
|
15
|
+
/**
|
|
16
|
+
* marks={true} puts a dot on every step (up to 24 of them); an array places dots, and labels, at the given values.
|
|
17
|
+
* The rail's own ends need no dot, so marks at min and max keep only their labels.
|
|
18
|
+
*/
|
|
19
|
+
export declare function sliderMarks(marks: SliderMarks | undefined, min: number, max: number, step: number, values: readonly number[], layout?: SliderLayout): {
|
|
20
|
+
fraction: number;
|
|
21
|
+
/** Offset from the left (or the top when vertical), like the thumbs. */
|
|
22
|
+
position: number;
|
|
23
|
+
active: boolean;
|
|
24
|
+
dot: boolean;
|
|
25
|
+
edge: "end" | "start" | undefined;
|
|
26
|
+
value: number;
|
|
27
|
+
/** Drawn beside the rail; leave it out for a dot only. Pressing a label moves the nearer thumb there. */
|
|
28
|
+
label?: string;
|
|
29
|
+
}[];
|
|
30
|
+
export interface SliderLayout {
|
|
31
|
+
rtl?: boolean;
|
|
32
|
+
vertical?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function localeIsRtl(locale?: string): boolean;
|
|
35
|
+
/** A fraction as an offset from the left (or the top): right-to-left and vertical sliders run the other way, like React Aria. */
|
|
36
|
+
export declare function sliderAxis(fraction: number, { rtl, vertical }?: SliderLayout): number;
|
|
37
|
+
/**
|
|
38
|
+
* The fill as leading and trailing offsets (percent of the track, from the left/top and from the right/bottom). null is
|
|
39
|
+
* the rail's own end, half a thumb past the track: a single slider fills from there, a range between its thumbs.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sliderFillBox(fractions: readonly number[], layout?: SliderLayout): {
|
|
42
|
+
lead: number | null;
|
|
43
|
+
trail: number | null;
|
|
44
|
+
};
|
|
45
|
+
/** PageUp/PageDown move a tenth of the range, on the step grid and at least one step, like React Aria. */
|
|
46
|
+
export declare function sliderPageSize(min: number, max: number, step: number): number;
|
|
47
|
+
/** The key's next value, or null. Right-to-left layouts swap the meaning of the horizontal arrows. */
|
|
48
|
+
export declare function sliderKeyValue(key: string, value: number, min: number, max: number, step: number, rtl?: boolean): number | null;
|
|
49
|
+
/** The value under a pointer, from its offset along the track (from the left, or the top when vertical). */
|
|
50
|
+
export declare function sliderValueAt(offset: number, length: number, min: number, max: number, { rtl, vertical }?: {
|
|
51
|
+
rtl?: boolean | undefined;
|
|
52
|
+
vertical?: boolean | undefined;
|
|
53
|
+
}): number;
|
|
54
|
+
/** Where each thumb sits (0–1). Invalid settings keep the app's values in view, clamped to the given range when it has one. */
|
|
55
|
+
export declare function sliderFractions(values: readonly number[], min: number, max: number): number[];
|
|
56
|
+
/** Overlapping range thumbs: the one that can still move goes on top (the start thumb near the top end, the end thumb elsewhere). */
|
|
57
|
+
export declare function sliderFrontThumb(values: readonly number[], min: number, max: number): 0 | 1 | null;
|
|
58
|
+
/** The thumb a press moves: the nearer one, or with both on one value, the side of the press ("pending" when on the value itself). */
|
|
59
|
+
export declare function sliderPick(values: readonly number[], number: number, snapped: number): {
|
|
60
|
+
index: 0 | 1;
|
|
61
|
+
pending: boolean;
|
|
62
|
+
};
|
|
63
|
+
export interface SliderSessionOptions {
|
|
64
|
+
min(): number;
|
|
65
|
+
max(): number;
|
|
66
|
+
step(): number;
|
|
67
|
+
snap(value: number): number;
|
|
68
|
+
blocked(): boolean;
|
|
69
|
+
emit(values: number[]): void;
|
|
70
|
+
commit(values: number[]): void;
|
|
71
|
+
/** Moves keyboard focus to the thumb a press or a direction choice picked. */
|
|
72
|
+
focus?(index: number): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* One slider's value changes: clamping against the other thumb, the overlapping-thumb direction choice, and one commit
|
|
76
|
+
* per gesture or key. `sync` takes the app's values between gestures; during a gesture the session leads them.
|
|
77
|
+
*/
|
|
78
|
+
export declare function createSliderSession(initial: readonly number[], options: SliderSessionOptions): {
|
|
79
|
+
readonly values: number[];
|
|
80
|
+
readonly active: number | null;
|
|
81
|
+
sync(values: readonly number[]): void;
|
|
82
|
+
update: (index: number, number: number) => void;
|
|
83
|
+
commit: () => void;
|
|
84
|
+
press(number: number): number | null;
|
|
85
|
+
move(number: number): number | null;
|
|
86
|
+
release(): void;
|
|
87
|
+
cancel(): void;
|
|
88
|
+
key(index: number, key: string, rtl?: boolean): boolean;
|
|
89
|
+
};
|
|
90
|
+
export type SliderSession = ReturnType<typeof createSliderSession>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export interface KjunSliderMark {
|
|
2
|
+
value: number;
|
|
3
|
+
/** Drawn beside the rail; leave it out for a dot only. Pressing a label moves the nearer thumb there. */
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export type SliderMarks = boolean | KjunSliderMark[];
|
|
7
|
+
export type SliderOrientation = "horizontal" | "vertical";
|
|
8
|
+
/**
|
|
9
|
+
* Without formatValue the value follows the locale's number grouping with as many decimals as min and step use, so
|
|
10
|
+
* 0.5 steps read 1.0 · 1.5 and the text keeps its width while dragging. Formatters are cached per locale and precision.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sliderFormatter(formatValue: ((value: number) => string) | undefined, locale?: string, min?: number, step?: number): (value: number) => string;
|
|
13
|
+
/** The visible value: formatRange for a range when given, else two equal values read as one. */
|
|
14
|
+
export declare function sliderValueText(values: readonly number[], format: (value: number) => string, formatRange?: (start: number, end: number) => string): string;
|
|
15
|
+
/**
|
|
16
|
+
* marks={true} puts a dot on every step (up to 24 of them); an array places dots, and labels, at the given values.
|
|
17
|
+
* The rail's own ends need no dot, so marks at min and max keep only their labels.
|
|
18
|
+
*/
|
|
19
|
+
export declare function sliderMarks(marks: SliderMarks | undefined, min: number, max: number, step: number, values: readonly number[], layout?: SliderLayout): {
|
|
20
|
+
fraction: number;
|
|
21
|
+
/** Offset from the left (or the top when vertical), like the thumbs. */
|
|
22
|
+
position: number;
|
|
23
|
+
active: boolean;
|
|
24
|
+
dot: boolean;
|
|
25
|
+
edge: "end" | "start" | undefined;
|
|
26
|
+
value: number;
|
|
27
|
+
/** Drawn beside the rail; leave it out for a dot only. Pressing a label moves the nearer thumb there. */
|
|
28
|
+
label?: string;
|
|
29
|
+
}[];
|
|
30
|
+
export interface SliderLayout {
|
|
31
|
+
rtl?: boolean;
|
|
32
|
+
vertical?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function localeIsRtl(locale?: string): boolean;
|
|
35
|
+
/** A fraction as an offset from the left (or the top): right-to-left and vertical sliders run the other way, like React Aria. */
|
|
36
|
+
export declare function sliderAxis(fraction: number, { rtl, vertical }?: SliderLayout): number;
|
|
37
|
+
/**
|
|
38
|
+
* The fill as leading and trailing offsets (percent of the track, from the left/top and from the right/bottom). null is
|
|
39
|
+
* the rail's own end, half a thumb past the track: a single slider fills from there, a range between its thumbs.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sliderFillBox(fractions: readonly number[], layout?: SliderLayout): {
|
|
42
|
+
lead: number | null;
|
|
43
|
+
trail: number | null;
|
|
44
|
+
};
|
|
45
|
+
/** PageUp/PageDown move a tenth of the range, on the step grid and at least one step, like React Aria. */
|
|
46
|
+
export declare function sliderPageSize(min: number, max: number, step: number): number;
|
|
47
|
+
/** The key's next value, or null. Right-to-left layouts swap the meaning of the horizontal arrows. */
|
|
48
|
+
export declare function sliderKeyValue(key: string, value: number, min: number, max: number, step: number, rtl?: boolean): number | null;
|
|
49
|
+
/** The value under a pointer, from its offset along the track (from the left, or the top when vertical). */
|
|
50
|
+
export declare function sliderValueAt(offset: number, length: number, min: number, max: number, { rtl, vertical }?: {
|
|
51
|
+
rtl?: boolean | undefined;
|
|
52
|
+
vertical?: boolean | undefined;
|
|
53
|
+
}): number;
|
|
54
|
+
/** Where each thumb sits (0–1). Invalid settings keep the app's values in view, clamped to the given range when it has one. */
|
|
55
|
+
export declare function sliderFractions(values: readonly number[], min: number, max: number): number[];
|
|
56
|
+
/** Overlapping range thumbs: the one that can still move goes on top (the start thumb near the top end, the end thumb elsewhere). */
|
|
57
|
+
export declare function sliderFrontThumb(values: readonly number[], min: number, max: number): 0 | 1 | null;
|
|
58
|
+
/** The thumb a press moves: the nearer one, or with both on one value, the side of the press ("pending" when on the value itself). */
|
|
59
|
+
export declare function sliderPick(values: readonly number[], number: number, snapped: number): {
|
|
60
|
+
index: 0 | 1;
|
|
61
|
+
pending: boolean;
|
|
62
|
+
};
|
|
63
|
+
export interface SliderSessionOptions {
|
|
64
|
+
min(): number;
|
|
65
|
+
max(): number;
|
|
66
|
+
step(): number;
|
|
67
|
+
snap(value: number): number;
|
|
68
|
+
blocked(): boolean;
|
|
69
|
+
emit(values: number[]): void;
|
|
70
|
+
commit(values: number[]): void;
|
|
71
|
+
/** Moves keyboard focus to the thumb a press or a direction choice picked. */
|
|
72
|
+
focus?(index: number): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* One slider's value changes: clamping against the other thumb, the overlapping-thumb direction choice, and one commit
|
|
76
|
+
* per gesture or key. `sync` takes the app's values between gestures; during a gesture the session leads them.
|
|
77
|
+
*/
|
|
78
|
+
export declare function createSliderSession(initial: readonly number[], options: SliderSessionOptions): {
|
|
79
|
+
readonly values: number[];
|
|
80
|
+
readonly active: number | null;
|
|
81
|
+
sync(values: readonly number[]): void;
|
|
82
|
+
update: (index: number, number: number) => void;
|
|
83
|
+
commit: () => void;
|
|
84
|
+
press(number: number): number | null;
|
|
85
|
+
move(number: number): number | null;
|
|
86
|
+
release(): void;
|
|
87
|
+
cancel(): void;
|
|
88
|
+
key(index: number, key: string, rtl?: boolean): boolean;
|
|
89
|
+
};
|
|
90
|
+
export type SliderSession = ReturnType<typeof createSliderSession>;
|
|
@@ -4,8 +4,17 @@ export interface TableRowGroup<Row extends object> {
|
|
|
4
4
|
value: unknown;
|
|
5
5
|
rows: Row[];
|
|
6
6
|
}
|
|
7
|
+
export declare const tableGroupKey: (value: unknown) => string;
|
|
7
8
|
/** Groups keep the order their first row appears in, so a sorted table sorts inside each group. */
|
|
8
9
|
export declare function groupTableRows<Row extends object>(rows: readonly Row[], groupBy?: string | null): TableRowGroup<Row>[] | null;
|
|
10
|
+
/** undefined uses internal collapsed keys; a supplied array contains the original groupBy values. */
|
|
11
|
+
export declare function tableGroupExpansion<Row extends object>(groups: TableRowGroup<Row>[] | null, expanded: unknown[] | undefined, internalCollapsed: string[]): {
|
|
12
|
+
collapsed: string[];
|
|
13
|
+
toggle(key: string): {
|
|
14
|
+
expanded: unknown[];
|
|
15
|
+
collapsed: string[];
|
|
16
|
+
} | null;
|
|
17
|
+
};
|
|
9
18
|
/** count counts rows; the other kinds read finite numbers only and give null when a column has none. */
|
|
10
19
|
export declare function summarizeColumn<Row extends object>(rows: readonly Row[], key: string, kind: TableSummaryKind): number | null;
|
|
11
20
|
export declare function formatSummary(value: number | null, kind: TableSummaryKind, locale?: string): string;
|
|
@@ -4,8 +4,17 @@ export interface TableRowGroup<Row extends object> {
|
|
|
4
4
|
value: unknown;
|
|
5
5
|
rows: Row[];
|
|
6
6
|
}
|
|
7
|
+
export declare const tableGroupKey: (value: unknown) => string;
|
|
7
8
|
/** Groups keep the order their first row appears in, so a sorted table sorts inside each group. */
|
|
8
9
|
export declare function groupTableRows<Row extends object>(rows: readonly Row[], groupBy?: string | null): TableRowGroup<Row>[] | null;
|
|
10
|
+
/** undefined uses internal collapsed keys; a supplied array contains the original groupBy values. */
|
|
11
|
+
export declare function tableGroupExpansion<Row extends object>(groups: TableRowGroup<Row>[] | null, expanded: unknown[] | undefined, internalCollapsed: string[]): {
|
|
12
|
+
collapsed: string[];
|
|
13
|
+
toggle(key: string): {
|
|
14
|
+
expanded: unknown[];
|
|
15
|
+
collapsed: string[];
|
|
16
|
+
} | null;
|
|
17
|
+
};
|
|
9
18
|
/** count counts rows; the other kinds read finite numbers only and give null when a column has none. */
|
|
10
19
|
export declare function summarizeColumn<Row extends object>(rows: readonly Row[], key: string, kind: TableSummaryKind): number | null;
|
|
11
20
|
export declare function formatSummary(value: number | null, kind: TableSummaryKind, locale?: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { TableColumn, TableCardSection, TableProps, useTableModel } from "./table.cjs";
|
|
2
|
+
import type { TableColumn, TableCardSection, TableProps, TableSort, useTableModel } from "./table.cjs";
|
|
3
3
|
import { type TableRowGroup } from "./table-groups.cjs";
|
|
4
4
|
export declare function tablePresentation<Row extends object>(props: TableProps<Row, unknown>, mobile: boolean): {
|
|
5
5
|
card: boolean;
|
|
@@ -13,8 +13,28 @@ export declare function tablePresentation<Row extends object>(props: TableProps<
|
|
|
13
13
|
actions: TableColumn<Row> | undefined;
|
|
14
14
|
inline: TableColumn<Row>[];
|
|
15
15
|
sections: TableCardSection[];
|
|
16
|
+
highlight: TableColumn<Row> | undefined;
|
|
17
|
+
cardLayout: "rows" | "stacked" | "tiles";
|
|
18
|
+
tiles: boolean;
|
|
19
|
+
/** The actions column in the card's footer row (an inline one sits in the header instead). */
|
|
20
|
+
footerActions: TableColumn<Row> | undefined;
|
|
21
|
+
/** One footer row holds the expand toggle and the row actions. */
|
|
22
|
+
cardFooter: boolean;
|
|
23
|
+
/** A section's field arrangement: rows cards put every field on a label-value line. */
|
|
24
|
+
cardBody(section: TableCardSection): "metrics" | "grid" | "stack" | "rows";
|
|
16
25
|
columnsForSection(row: Row, section: TableCardSection): TableColumn<Row>[];
|
|
17
26
|
};
|
|
27
|
+
/** Narrow layouts have no header row to sort by, so the toolbar offers each sortable column in both orders. */
|
|
28
|
+
export declare function tableSortOptions<Row extends object>(props: TableProps<Row, unknown>, messages: {
|
|
29
|
+
defaultOrder: string;
|
|
30
|
+
ascending: string;
|
|
31
|
+
descending: string;
|
|
32
|
+
}): {
|
|
33
|
+
value: string;
|
|
34
|
+
label: string;
|
|
35
|
+
}[];
|
|
36
|
+
export declare const tableSortValue: (sort: TableSort) => string;
|
|
37
|
+
export declare function tableSortFromValue(value: unknown): TableSort;
|
|
18
38
|
export declare function columnFormat<Format>(column: {
|
|
19
39
|
key: string;
|
|
20
40
|
format?: Format;
|
|
@@ -33,6 +53,8 @@ export interface TableTotal {
|
|
|
33
53
|
value: ReactNode;
|
|
34
54
|
}
|
|
35
55
|
export declare function tableTotals<Row extends object>(props: TableProps<Row, unknown>, rows: Row[], locale?: string): TableTotal[];
|
|
56
|
+
/** A group's accessible name: its label when that is text, else the grouped value. */
|
|
57
|
+
export declare function tableGroupName<Row extends object>(label: unknown, group: TableRowGroup<Row>): string;
|
|
36
58
|
export interface TableGroupingProps<Row extends object> {
|
|
37
59
|
groups: TableRowGroup<Row>[] | null;
|
|
38
60
|
collapsed: string[];
|
|
@@ -40,7 +62,8 @@ export interface TableGroupingProps<Row extends object> {
|
|
|
40
62
|
groupLabel: (group: TableRowGroup<Row>) => ReactNode;
|
|
41
63
|
summary: ((column: TableColumn<Row>, rows: Row[]) => ReactNode) | null;
|
|
42
64
|
}
|
|
43
|
-
|
|
65
|
+
/** Card parts: a card value starts at its label (cardValue) or ends a label-value line (cardRowValue); tiles use smaller titles and highlights. */
|
|
66
|
+
export type TableCellRole = "title" | "listTitle" | "listMeta" | "listValue" | "cardValue" | "cardRowValue" | "cardSubtitle" | "cardHighlight" | "tileTitle" | "tileHighlight";
|
|
44
67
|
export interface TableRowsProps<Row extends object> {
|
|
45
68
|
initialLoading: boolean;
|
|
46
69
|
skeletonRows: number;
|
|
@@ -60,6 +83,14 @@ export interface TableRowsProps<Row extends object> {
|
|
|
60
83
|
export interface TableCardsProps<Row extends object> extends TableRowsProps<Row> {
|
|
61
84
|
layout: ReturnType<typeof tablePresentation<Row>>;
|
|
62
85
|
totals?: TableTotal[];
|
|
86
|
+
/** groupBy groups: each one opens with a header line (label, count and, with two or more rows, its subtotals) above its cards. */
|
|
87
|
+
groups?: TableRowGroup<Row>[] | null;
|
|
88
|
+
collapsed?: string[];
|
|
89
|
+
toggleGroup?: (key: string) => void;
|
|
90
|
+
groupLabel?: (group: TableRowGroup<Row>) => ReactNode;
|
|
91
|
+
groupTotals?: (rows: Row[]) => TableTotal[];
|
|
92
|
+
/** The cell's plain text, for a value read out with its label where the label is not drawn (tile highlight on Native). */
|
|
93
|
+
cellText?: (column: TableColumn<Row>, row: Row, index: number) => string | undefined;
|
|
63
94
|
}
|
|
64
95
|
export interface TableGridProps<Row extends object, Height> extends TableRowsProps<Row>, TableGroupingProps<Row> {
|
|
65
96
|
state: TableRowsProps<Row>["state"] & Pick<ReturnType<typeof useTableModel<Row>>, "all" | "some" | "toggleAll" | "sort" | "sortColumn">;
|
|
@@ -85,4 +116,11 @@ export interface TableToolbarProps<Row extends object> {
|
|
|
85
116
|
searchChange: (value: string) => void;
|
|
86
117
|
searchPlaceholder: string;
|
|
87
118
|
toolbar: ReactNode;
|
|
119
|
+
/** Narrow layouts only: the sort choices (tableSortOptions), the chosen one and the change. */
|
|
120
|
+
sortOptions?: {
|
|
121
|
+
value: string;
|
|
122
|
+
label: string;
|
|
123
|
+
}[];
|
|
124
|
+
sortValue?: string;
|
|
125
|
+
sortChange?: (value: string) => void;
|
|
88
126
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { TableColumn, TableCardSection, TableProps, useTableModel } from "./table.js";
|
|
2
|
+
import type { TableColumn, TableCardSection, TableProps, TableSort, useTableModel } from "./table.js";
|
|
3
3
|
import { type TableRowGroup } from "./table-groups.js";
|
|
4
4
|
export declare function tablePresentation<Row extends object>(props: TableProps<Row, unknown>, mobile: boolean): {
|
|
5
5
|
card: boolean;
|
|
@@ -13,8 +13,28 @@ export declare function tablePresentation<Row extends object>(props: TableProps<
|
|
|
13
13
|
actions: TableColumn<Row> | undefined;
|
|
14
14
|
inline: TableColumn<Row>[];
|
|
15
15
|
sections: TableCardSection[];
|
|
16
|
+
highlight: TableColumn<Row> | undefined;
|
|
17
|
+
cardLayout: "rows" | "stacked" | "tiles";
|
|
18
|
+
tiles: boolean;
|
|
19
|
+
/** The actions column in the card's footer row (an inline one sits in the header instead). */
|
|
20
|
+
footerActions: TableColumn<Row> | undefined;
|
|
21
|
+
/** One footer row holds the expand toggle and the row actions. */
|
|
22
|
+
cardFooter: boolean;
|
|
23
|
+
/** A section's field arrangement: rows cards put every field on a label-value line. */
|
|
24
|
+
cardBody(section: TableCardSection): "metrics" | "grid" | "stack" | "rows";
|
|
16
25
|
columnsForSection(row: Row, section: TableCardSection): TableColumn<Row>[];
|
|
17
26
|
};
|
|
27
|
+
/** Narrow layouts have no header row to sort by, so the toolbar offers each sortable column in both orders. */
|
|
28
|
+
export declare function tableSortOptions<Row extends object>(props: TableProps<Row, unknown>, messages: {
|
|
29
|
+
defaultOrder: string;
|
|
30
|
+
ascending: string;
|
|
31
|
+
descending: string;
|
|
32
|
+
}): {
|
|
33
|
+
value: string;
|
|
34
|
+
label: string;
|
|
35
|
+
}[];
|
|
36
|
+
export declare const tableSortValue: (sort: TableSort) => string;
|
|
37
|
+
export declare function tableSortFromValue(value: unknown): TableSort;
|
|
18
38
|
export declare function columnFormat<Format>(column: {
|
|
19
39
|
key: string;
|
|
20
40
|
format?: Format;
|
|
@@ -33,6 +53,8 @@ export interface TableTotal {
|
|
|
33
53
|
value: ReactNode;
|
|
34
54
|
}
|
|
35
55
|
export declare function tableTotals<Row extends object>(props: TableProps<Row, unknown>, rows: Row[], locale?: string): TableTotal[];
|
|
56
|
+
/** A group's accessible name: its label when that is text, else the grouped value. */
|
|
57
|
+
export declare function tableGroupName<Row extends object>(label: unknown, group: TableRowGroup<Row>): string;
|
|
36
58
|
export interface TableGroupingProps<Row extends object> {
|
|
37
59
|
groups: TableRowGroup<Row>[] | null;
|
|
38
60
|
collapsed: string[];
|
|
@@ -40,7 +62,8 @@ export interface TableGroupingProps<Row extends object> {
|
|
|
40
62
|
groupLabel: (group: TableRowGroup<Row>) => ReactNode;
|
|
41
63
|
summary: ((column: TableColumn<Row>, rows: Row[]) => ReactNode) | null;
|
|
42
64
|
}
|
|
43
|
-
|
|
65
|
+
/** Card parts: a card value starts at its label (cardValue) or ends a label-value line (cardRowValue); tiles use smaller titles and highlights. */
|
|
66
|
+
export type TableCellRole = "title" | "listTitle" | "listMeta" | "listValue" | "cardValue" | "cardRowValue" | "cardSubtitle" | "cardHighlight" | "tileTitle" | "tileHighlight";
|
|
44
67
|
export interface TableRowsProps<Row extends object> {
|
|
45
68
|
initialLoading: boolean;
|
|
46
69
|
skeletonRows: number;
|
|
@@ -60,6 +83,14 @@ export interface TableRowsProps<Row extends object> {
|
|
|
60
83
|
export interface TableCardsProps<Row extends object> extends TableRowsProps<Row> {
|
|
61
84
|
layout: ReturnType<typeof tablePresentation<Row>>;
|
|
62
85
|
totals?: TableTotal[];
|
|
86
|
+
/** groupBy groups: each one opens with a header line (label, count and, with two or more rows, its subtotals) above its cards. */
|
|
87
|
+
groups?: TableRowGroup<Row>[] | null;
|
|
88
|
+
collapsed?: string[];
|
|
89
|
+
toggleGroup?: (key: string) => void;
|
|
90
|
+
groupLabel?: (group: TableRowGroup<Row>) => ReactNode;
|
|
91
|
+
groupTotals?: (rows: Row[]) => TableTotal[];
|
|
92
|
+
/** The cell's plain text, for a value read out with its label where the label is not drawn (tile highlight on Native). */
|
|
93
|
+
cellText?: (column: TableColumn<Row>, row: Row, index: number) => string | undefined;
|
|
63
94
|
}
|
|
64
95
|
export interface TableGridProps<Row extends object, Height> extends TableRowsProps<Row>, TableGroupingProps<Row> {
|
|
65
96
|
state: TableRowsProps<Row>["state"] & Pick<ReturnType<typeof useTableModel<Row>>, "all" | "some" | "toggleAll" | "sort" | "sortColumn">;
|
|
@@ -85,4 +116,11 @@ export interface TableToolbarProps<Row extends object> {
|
|
|
85
116
|
searchChange: (value: string) => void;
|
|
86
117
|
searchPlaceholder: string;
|
|
87
118
|
toolbar: ReactNode;
|
|
119
|
+
/** Narrow layouts only: the sort choices (tableSortOptions), the chosen one and the change. */
|
|
120
|
+
sortOptions?: {
|
|
121
|
+
value: string;
|
|
122
|
+
label: string;
|
|
123
|
+
}[];
|
|
124
|
+
sortValue?: string;
|
|
125
|
+
sortChange?: (value: string) => void;
|
|
88
126
|
}
|
|
@@ -68,6 +68,10 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
68
68
|
cardTitle?: string | null;
|
|
69
69
|
cardSubtitle?: string | null;
|
|
70
70
|
cardSections?: TableCardSection[];
|
|
71
|
+
/** Card shape on narrow screens: "stacked" (default) field grid, "rows" label-value lines, or "tiles" two small cards a row. */
|
|
72
|
+
cardLayout?: "stacked" | "rows" | "tiles";
|
|
73
|
+
/** Column shown large under the card's title (a total, a balance); tiles show it as their main value. */
|
|
74
|
+
cardHighlight?: string | null;
|
|
71
75
|
expandable?: boolean;
|
|
72
76
|
expandedRows?: (string | number)[];
|
|
73
77
|
expandSingle?: boolean;
|
|
@@ -76,6 +80,8 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
76
80
|
selected?: Row[];
|
|
77
81
|
/** Row field (dot path) whose values split the rows into collapsible groups. */
|
|
78
82
|
groupBy?: string;
|
|
83
|
+
/** Original groupBy values of open groups. undefined: internal state, initially all open; []: all closed. */
|
|
84
|
+
expandedGroups?: unknown[];
|
|
79
85
|
renderGroupLabel?: (value: unknown, rows: Row[]) => ReactNode;
|
|
80
86
|
/** Per column key: a subtotal under each group and a total row at the end. */
|
|
81
87
|
summary?: Partial<Record<string, TableSummaryKind | ((rows: Row[], column: TableColumn<Row>) => ReactNode)>>;
|
|
@@ -93,6 +99,7 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
93
99
|
}) => void;
|
|
94
100
|
onSelectionChange?: (selected: Row[]) => void;
|
|
95
101
|
onExpandedRowsChange?: (keys: (string | number)[]) => void;
|
|
102
|
+
onExpandedGroupsChange?: (values: unknown[]) => void;
|
|
96
103
|
onPageChange?: (page: number) => void;
|
|
97
104
|
onRowClick?: (row: Row, index: number) => void;
|
|
98
105
|
onSearch?: (query: string) => void;
|
|
@@ -111,6 +118,8 @@ export declare function useTableModel<Row extends object>(props: TableProps<Row,
|
|
|
111
118
|
expanded: (string | number)[];
|
|
112
119
|
searchChange: (q: string) => void;
|
|
113
120
|
sortColumn: (col: TableColumn<Row>) => void;
|
|
121
|
+
/** The narrow-screen sort choice: an exact key and order, or { key: "" } for the data's own order. */
|
|
122
|
+
sortTo: (next: TableSort) => void;
|
|
114
123
|
toggleRow: (row: Row) => void | undefined;
|
|
115
124
|
toggleAll: () => void | undefined;
|
|
116
125
|
toggleExpand: (row: Row, index: number) => void;
|
|
@@ -68,6 +68,10 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
68
68
|
cardTitle?: string | null;
|
|
69
69
|
cardSubtitle?: string | null;
|
|
70
70
|
cardSections?: TableCardSection[];
|
|
71
|
+
/** Card shape on narrow screens: "stacked" (default) field grid, "rows" label-value lines, or "tiles" two small cards a row. */
|
|
72
|
+
cardLayout?: "stacked" | "rows" | "tiles";
|
|
73
|
+
/** Column shown large under the card's title (a total, a balance); tiles show it as their main value. */
|
|
74
|
+
cardHighlight?: string | null;
|
|
71
75
|
expandable?: boolean;
|
|
72
76
|
expandedRows?: (string | number)[];
|
|
73
77
|
expandSingle?: boolean;
|
|
@@ -76,6 +80,8 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
76
80
|
selected?: Row[];
|
|
77
81
|
/** Row field (dot path) whose values split the rows into collapsible groups. */
|
|
78
82
|
groupBy?: string;
|
|
83
|
+
/** Original groupBy values of open groups. undefined: internal state, initially all open; []: all closed. */
|
|
84
|
+
expandedGroups?: unknown[];
|
|
79
85
|
renderGroupLabel?: (value: unknown, rows: Row[]) => ReactNode;
|
|
80
86
|
/** Per column key: a subtotal under each group and a total row at the end. */
|
|
81
87
|
summary?: Partial<Record<string, TableSummaryKind | ((rows: Row[], column: TableColumn<Row>) => ReactNode)>>;
|
|
@@ -93,6 +99,7 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
93
99
|
}) => void;
|
|
94
100
|
onSelectionChange?: (selected: Row[]) => void;
|
|
95
101
|
onExpandedRowsChange?: (keys: (string | number)[]) => void;
|
|
102
|
+
onExpandedGroupsChange?: (values: unknown[]) => void;
|
|
96
103
|
onPageChange?: (page: number) => void;
|
|
97
104
|
onRowClick?: (row: Row, index: number) => void;
|
|
98
105
|
onSearch?: (query: string) => void;
|
|
@@ -111,6 +118,8 @@ export declare function useTableModel<Row extends object>(props: TableProps<Row,
|
|
|
111
118
|
expanded: (string | number)[];
|
|
112
119
|
searchChange: (q: string) => void;
|
|
113
120
|
sortColumn: (col: TableColumn<Row>) => void;
|
|
121
|
+
/** The narrow-screen sort choice: an exact key and order, or { key: "" } for the data's own order. */
|
|
122
|
+
sortTo: (next: TableSort) => void;
|
|
114
123
|
toggleRow: (row: Row) => void | undefined;
|
|
115
124
|
toggleAll: () => void | undefined;
|
|
116
125
|
toggleExpand: (row: Row, index: number) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Toasts that arrive within one stack move of the last arrival wait for it to finish, then enter together, so a burst
|
|
2
|
+
* shifts the stack once instead of once per toast. Returns how long the newest arrivals still wait (0 = none). */
|
|
3
|
+
export declare function toastEntryDelay(lastEntry: number, now: number, reduced: boolean): number;
|