@kjun-ui/native 0.0.0-stage → 0.3.1
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/README.md +44 -2
- package/dist/LICENSE +21 -0
- package/dist/Tabler-LICENSE +21 -0
- package/dist/index.cjs +9683 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9818 -0
- package/dist/index.web.cjs +9938 -0
- package/dist/index.web.js +10073 -0
- package/dist/styles.css +7695 -0
- package/dist/types/packages/native/src/a11y.d.cts +7 -0
- package/dist/types/packages/native/src/a11y.d.ts +7 -0
- package/dist/types/packages/native/src/actions.d.cts +58 -0
- package/dist/types/packages/native/src/actions.d.ts +58 -0
- package/dist/types/packages/native/src/alert-actions-context.d.cts +1 -0
- package/dist/types/packages/native/src/alert-actions-context.d.ts +1 -0
- package/dist/types/packages/native/src/app-navigation.d.cts +36 -0
- package/dist/types/packages/native/src/app-navigation.d.ts +36 -0
- package/dist/types/packages/native/src/bottom-action-bar-context.d.cts +1 -0
- package/dist/types/packages/native/src/bottom-action-bar-context.d.ts +1 -0
- package/dist/types/packages/native/src/button-group-motion.d.cts +17 -0
- package/dist/types/packages/native/src/button-group-motion.d.ts +17 -0
- package/dist/types/packages/native/src/button.d.cts +25 -0
- package/dist/types/packages/native/src/button.d.ts +25 -0
- package/dist/types/packages/native/src/card-actions-context.d.cts +1 -0
- package/dist/types/packages/native/src/card-actions-context.d.ts +1 -0
- package/dist/types/packages/native/src/card.d.cts +21 -0
- package/dist/types/packages/native/src/card.d.ts +21 -0
- package/dist/types/packages/native/src/chip.d.cts +10 -0
- package/dist/types/packages/native/src/chip.d.ts +10 -0
- package/dist/types/packages/native/src/choice-accessibility.d.cts +4 -0
- package/dist/types/packages/native/src/choice-accessibility.d.ts +4 -0
- package/dist/types/packages/native/src/choice-controls.d.cts +60 -0
- package/dist/types/packages/native/src/choice-controls.d.ts +60 -0
- package/dist/types/packages/native/src/collapse.d.cts +5 -0
- package/dist/types/packages/native/src/collapse.d.ts +5 -0
- package/dist/types/packages/native/src/combobox.d.cts +48 -0
- package/dist/types/packages/native/src/combobox.d.ts +48 -0
- package/dist/types/packages/native/src/compound-control.d.cts +14 -0
- package/dist/types/packages/native/src/compound-control.d.ts +14 -0
- package/dist/types/packages/native/src/controls.d.cts +6 -0
- package/dist/types/packages/native/src/controls.d.ts +6 -0
- package/dist/types/packages/native/src/data-state-context.d.cts +1 -0
- package/dist/types/packages/native/src/data-state-context.d.ts +1 -0
- package/dist/types/packages/native/src/data-state.d.cts +53 -0
- package/dist/types/packages/native/src/data-state.d.ts +53 -0
- package/dist/types/packages/native/src/date-picker.d.cts +14 -0
- package/dist/types/packages/native/src/date-picker.d.ts +14 -0
- package/dist/types/packages/native/src/display-primitives.d.cts +50 -0
- package/dist/types/packages/native/src/display-primitives.d.ts +50 -0
- package/dist/types/packages/native/src/display.d.cts +6 -0
- package/dist/types/packages/native/src/display.d.ts +6 -0
- package/dist/types/packages/native/src/drawer.d.cts +18 -0
- package/dist/types/packages/native/src/drawer.d.ts +18 -0
- package/dist/types/packages/native/src/dropdown.d.cts +39 -0
- package/dist/types/packages/native/src/dropdown.d.ts +39 -0
- package/dist/types/packages/native/src/feedback-context.d.cts +3 -0
- package/dist/types/packages/native/src/feedback-context.d.ts +3 -0
- package/dist/types/packages/native/src/feedback.d.cts +7 -0
- package/dist/types/packages/native/src/feedback.d.ts +7 -0
- package/dist/types/packages/native/src/field-clear.d.cts +8 -0
- package/dist/types/packages/native/src/field-clear.d.ts +8 -0
- package/dist/types/packages/native/src/field-surface.d.cts +86 -0
- package/dist/types/packages/native/src/field-surface.d.ts +86 -0
- package/dist/types/packages/native/src/financial-display.d.cts +87 -0
- package/dist/types/packages/native/src/financial-display.d.ts +87 -0
- package/dist/types/packages/native/src/financial.d.cts +4 -0
- package/dist/types/packages/native/src/financial.d.ts +4 -0
- package/dist/types/packages/native/src/floating-panel.d.cts +31 -0
- package/dist/types/packages/native/src/floating-panel.d.ts +31 -0
- package/dist/types/packages/native/src/form-actions-context.d.cts +3 -0
- package/dist/types/packages/native/src/form-actions-context.d.ts +3 -0
- package/dist/types/packages/native/src/index.d.cts +39 -0
- package/dist/types/packages/native/src/index.d.ts +39 -0
- package/dist/types/packages/native/src/input.d.cts +44 -0
- package/dist/types/packages/native/src/input.d.ts +44 -0
- package/dist/types/packages/native/src/internal.d.cts +7 -0
- package/dist/types/packages/native/src/internal.d.ts +7 -0
- package/dist/types/packages/native/src/kpi-hero.d.cts +35 -0
- package/dist/types/packages/native/src/kpi-hero.d.ts +35 -0
- package/dist/types/packages/native/src/kpi-number-line.d.cts +12 -0
- package/dist/types/packages/native/src/kpi-number-line.d.ts +12 -0
- package/dist/types/packages/native/src/kpi-row.d.cts +32 -0
- package/dist/types/packages/native/src/kpi-row.d.ts +32 -0
- package/dist/types/packages/native/src/kpi.d.cts +4 -0
- package/dist/types/packages/native/src/kpi.d.ts +4 -0
- package/dist/types/packages/native/src/layer-backdrop.d.cts +6 -0
- package/dist/types/packages/native/src/layer-backdrop.d.ts +6 -0
- package/dist/types/packages/native/src/layers.d.cts +8 -0
- package/dist/types/packages/native/src/layers.d.ts +8 -0
- package/dist/types/packages/native/src/list.d.cts +21 -0
- package/dist/types/packages/native/src/list.d.ts +21 -0
- package/dist/types/packages/native/src/market-cards.d.cts +2 -0
- package/dist/types/packages/native/src/market-cards.d.ts +2 -0
- package/dist/types/packages/native/src/market-layout.d.cts +10 -0
- package/dist/types/packages/native/src/market-layout.d.ts +10 -0
- package/dist/types/packages/native/src/market-list.d.cts +2 -0
- package/dist/types/packages/native/src/market-list.d.ts +2 -0
- package/dist/types/packages/native/src/market-model.d.cts +109 -0
- package/dist/types/packages/native/src/market-model.d.ts +109 -0
- package/dist/types/packages/native/src/market-panel.d.cts +5 -0
- package/dist/types/packages/native/src/market-panel.d.ts +5 -0
- package/dist/types/packages/native/src/market-parts.d.cts +10 -0
- package/dist/types/packages/native/src/market-parts.d.ts +10 -0
- package/dist/types/packages/native/src/market-skeleton.d.cts +11 -0
- package/dist/types/packages/native/src/market-skeleton.d.ts +11 -0
- package/dist/types/packages/native/src/market-table.d.cts +2 -0
- package/dist/types/packages/native/src/market-table.d.ts +2 -0
- package/dist/types/packages/native/src/market.d.cts +7 -0
- package/dist/types/packages/native/src/market.d.ts +7 -0
- package/dist/types/packages/native/src/media.d.cts +27 -0
- package/dist/types/packages/native/src/media.d.ts +27 -0
- package/dist/types/packages/native/src/modal-window.d.cts +5 -0
- package/dist/types/packages/native/src/modal-window.d.ts +5 -0
- package/dist/types/packages/native/src/modal.d.cts +46 -0
- package/dist/types/packages/native/src/modal.d.ts +46 -0
- package/dist/types/packages/native/src/motion.d.cts +18 -0
- package/dist/types/packages/native/src/motion.d.ts +18 -0
- package/dist/types/packages/native/src/navigation.d.cts +45 -0
- package/dist/types/packages/native/src/navigation.d.ts +45 -0
- package/dist/types/packages/native/src/number-display.d.cts +49 -0
- package/dist/types/packages/native/src/number-display.d.ts +49 -0
- package/dist/types/packages/native/src/overlay-host.d.cts +9 -0
- package/dist/types/packages/native/src/overlay-host.d.ts +9 -0
- package/dist/types/packages/native/src/popover.d.cts +24 -0
- package/dist/types/packages/native/src/popover.d.ts +24 -0
- package/dist/types/packages/native/src/provider.d.cts +20 -0
- package/dist/types/packages/native/src/provider.d.ts +20 -0
- package/dist/types/packages/native/src/quantity-stepper.d.cts +18 -0
- package/dist/types/packages/native/src/quantity-stepper.d.ts +18 -0
- package/dist/types/packages/native/src/range-input.d.cts +31 -0
- package/dist/types/packages/native/src/range-input.d.ts +31 -0
- package/dist/types/packages/native/src/search-input.d.cts +21 -0
- package/dist/types/packages/native/src/search-input.d.ts +21 -0
- package/dist/types/packages/native/src/select-control.d.cts +30 -0
- package/dist/types/packages/native/src/select-control.d.ts +30 -0
- package/dist/types/packages/native/src/select-options.d.cts +13 -0
- package/dist/types/packages/native/src/select-options.d.ts +13 -0
- package/dist/types/packages/native/src/select.d.cts +10 -0
- package/dist/types/packages/native/src/select.d.ts +10 -0
- package/dist/types/packages/native/src/selection-groups.d.cts +22 -0
- package/dist/types/packages/native/src/selection-groups.d.ts +22 -0
- package/dist/types/packages/native/src/skeleton-base.d.cts +11 -0
- package/dist/types/packages/native/src/skeleton-base.d.ts +11 -0
- package/dist/types/packages/native/src/skeletons.d.cts +28 -0
- package/dist/types/packages/native/src/skeletons.d.ts +28 -0
- package/dist/types/packages/native/src/table-cards.d.cts +2 -0
- package/dist/types/packages/native/src/table-cards.d.ts +2 -0
- package/dist/types/packages/native/src/table-grid.d.cts +2 -0
- package/dist/types/packages/native/src/table-grid.d.ts +2 -0
- package/dist/types/packages/native/src/table-model.d.cts +20 -0
- package/dist/types/packages/native/src/table-model.d.ts +20 -0
- package/dist/types/packages/native/src/table-toolbar.d.cts +2 -0
- package/dist/types/packages/native/src/table-toolbar.d.ts +2 -0
- package/dist/types/packages/native/src/table-view.d.cts +2 -0
- package/dist/types/packages/native/src/table-view.d.ts +2 -0
- package/dist/types/packages/native/src/table.d.cts +3 -0
- package/dist/types/packages/native/src/table.d.ts +3 -0
- package/dist/types/packages/native/src/tabs-accessibility.d.cts +4 -0
- package/dist/types/packages/native/src/tabs-accessibility.d.ts +4 -0
- package/dist/types/packages/native/src/tabs.d.cts +31 -0
- package/dist/types/packages/native/src/tabs.d.ts +31 -0
- package/dist/types/packages/native/src/textarea.d.cts +12 -0
- package/dist/types/packages/native/src/textarea.d.ts +12 -0
- package/dist/types/packages/native/src/time-picker.d.cts +17 -0
- package/dist/types/packages/native/src/time-picker.d.ts +17 -0
- package/dist/types/packages/native/src/toast-reflow.d.cts +3 -0
- package/dist/types/packages/native/src/toast-reflow.d.ts +3 -0
- package/dist/types/packages/native/src/toast-stack.d.cts +6 -0
- package/dist/types/packages/native/src/toast-stack.d.ts +6 -0
- package/dist/types/packages/native/src/toast.d.cts +5 -0
- package/dist/types/packages/native/src/toast.d.ts +5 -0
- package/dist/types/packages/native/src/top-navigation-context.d.cts +5 -0
- package/dist/types/packages/native/src/top-navigation-context.d.ts +5 -0
- package/dist/types/packages/native/src/typography.d.cts +20 -0
- package/dist/types/packages/native/src/typography.d.ts +20 -0
- package/dist/types/shared/package-runtime/action-size.d.cts +5 -0
- package/dist/types/shared/package-runtime/action-size.d.ts +5 -0
- package/dist/types/shared/package-runtime/alert-action-size.d.cts +5 -0
- package/dist/types/shared/package-runtime/alert-action-size.d.ts +5 -0
- package/dist/types/shared/package-runtime/combobox.d.cts +21 -0
- package/dist/types/shared/package-runtime/combobox.d.ts +21 -0
- package/dist/types/shared/package-runtime/component-icons.d.cts +2 -0
- package/dist/types/shared/package-runtime/component-icons.d.ts +2 -0
- package/dist/types/shared/package-runtime/content-presence.d.cts +3 -0
- package/dist/types/shared/package-runtime/content-presence.d.ts +3 -0
- package/dist/types/shared/package-runtime/elevation.d.cts +10 -0
- package/dist/types/shared/package-runtime/elevation.d.ts +10 -0
- package/dist/types/shared/package-runtime/feedback-dialog.d.cts +10 -0
- package/dist/types/shared/package-runtime/feedback-dialog.d.ts +10 -0
- package/dist/types/shared/package-runtime/feedback-motion.d.cts +11 -0
- package/dist/types/shared/package-runtime/feedback-motion.d.ts +11 -0
- package/dist/types/shared/package-runtime/form-actions.d.cts +3 -0
- package/dist/types/shared/package-runtime/form-actions.d.ts +3 -0
- package/dist/types/shared/package-runtime/icon-context.d.cts +14 -0
- package/dist/types/shared/package-runtime/icon-context.d.ts +14 -0
- package/dist/types/shared/package-runtime/icon-registry.d.cts +10 -0
- package/dist/types/shared/package-runtime/icon-registry.d.ts +10 -0
- package/dist/types/shared/package-runtime/layer-keyboard.d.cts +3 -0
- package/dist/types/shared/package-runtime/layer-keyboard.d.ts +3 -0
- package/dist/types/shared/package-runtime/layer-state.d.cts +40 -0
- package/dist/types/shared/package-runtime/layer-state.d.ts +40 -0
- package/dist/types/shared/package-runtime/market-cards.d.cts +44 -0
- package/dist/types/shared/package-runtime/market-cards.d.ts +44 -0
- package/dist/types/shared/package-runtime/market-layout.d.cts +40 -0
- package/dist/types/shared/package-runtime/market-layout.d.ts +40 -0
- package/dist/types/shared/package-runtime/navigation.d.cts +6 -0
- package/dist/types/shared/package-runtime/navigation.d.ts +6 -0
- package/dist/types/shared/package-runtime/number-motion.d.cts +4 -0
- package/dist/types/shared/package-runtime/number-motion.d.ts +4 -0
- package/dist/types/shared/package-runtime/options.d.cts +34 -0
- package/dist/types/shared/package-runtime/options.d.ts +34 -0
- package/dist/types/shared/package-runtime/relative-time.d.cts +1 -0
- package/dist/types/shared/package-runtime/relative-time.d.ts +1 -0
- package/dist/types/shared/package-runtime/search-input.d.cts +20 -0
- package/dist/types/shared/package-runtime/search-input.d.ts +20 -0
- package/dist/types/shared/package-runtime/select.d.cts +10 -0
- package/dist/types/shared/package-runtime/select.d.ts +10 -0
- package/dist/types/shared/package-runtime/table-presentation.d.cts +56 -0
- package/dist/types/shared/package-runtime/table-presentation.d.ts +56 -0
- package/dist/types/shared/package-runtime/table.d.cts +96 -0
- package/dist/types/shared/package-runtime/table.d.ts +96 -0
- package/dist/types/shared/package-runtime/use-layer.d.cts +64 -0
- package/dist/types/shared/package-runtime/use-layer.d.ts +64 -0
- package/dist/types/shared/package-runtime/use-number-motion.d.cts +1 -0
- package/dist/types/shared/package-runtime/use-number-motion.d.ts +1 -0
- package/package.json +62 -4
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Internal window ownership. Paint order, dismissal and surface appearance are independent. */
|
|
2
|
+
export type LayerKind = 'window' | 'popup' | 'tooltip';
|
|
3
|
+
export interface FocusTarget {
|
|
4
|
+
focus?: (options?: {
|
|
5
|
+
preventScroll?: boolean;
|
|
6
|
+
}) => void;
|
|
7
|
+
isConnected?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface LayerEntry {
|
|
10
|
+
id: string;
|
|
11
|
+
kind: LayerKind;
|
|
12
|
+
parent?: string;
|
|
13
|
+
owner?: string;
|
|
14
|
+
order: number;
|
|
15
|
+
windowOrder: number;
|
|
16
|
+
blocked: boolean;
|
|
17
|
+
closing: boolean;
|
|
18
|
+
closeRequested: boolean;
|
|
19
|
+
dismiss: () => void;
|
|
20
|
+
returnTarget?: FocusTarget | null;
|
|
21
|
+
root?: FocusTarget | null;
|
|
22
|
+
}
|
|
23
|
+
export declare function createLayerState(): {
|
|
24
|
+
entries: Map<string, LayerEntry>;
|
|
25
|
+
topWindow: () => LayerEntry | undefined;
|
|
26
|
+
top: () => LayerEntry | undefined;
|
|
27
|
+
windowOf: (id?: string) => string | undefined;
|
|
28
|
+
isRestoredFocus(target?: FocusTarget | null): boolean;
|
|
29
|
+
clearRestoredFocus(target?: FocusTarget | null): void;
|
|
30
|
+
markClosing(id: string): void;
|
|
31
|
+
subscribe(listener: () => void): () => void;
|
|
32
|
+
snapshot: () => number;
|
|
33
|
+
open(id: string, kind: LayerKind, parent: string | undefined, dismissCallback: () => void, returnTarget?: FocusTarget | null): LayerEntry;
|
|
34
|
+
remove(id: string, focused?: FocusTarget | null): FocusTarget | null | undefined;
|
|
35
|
+
requestClose(id: string): void;
|
|
36
|
+
isActive(id: string): boolean;
|
|
37
|
+
isBlocked(id: string): boolean;
|
|
38
|
+
zIndex(id?: string, role?: "backdrop" | "content" | "popup" | "tooltip" | "toast"): number;
|
|
39
|
+
};
|
|
40
|
+
export type LayerState = ReturnType<typeof createLayerState>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Internal window ownership. Paint order, dismissal and surface appearance are independent. */
|
|
2
|
+
export type LayerKind = 'window' | 'popup' | 'tooltip';
|
|
3
|
+
export interface FocusTarget {
|
|
4
|
+
focus?: (options?: {
|
|
5
|
+
preventScroll?: boolean;
|
|
6
|
+
}) => void;
|
|
7
|
+
isConnected?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface LayerEntry {
|
|
10
|
+
id: string;
|
|
11
|
+
kind: LayerKind;
|
|
12
|
+
parent?: string;
|
|
13
|
+
owner?: string;
|
|
14
|
+
order: number;
|
|
15
|
+
windowOrder: number;
|
|
16
|
+
blocked: boolean;
|
|
17
|
+
closing: boolean;
|
|
18
|
+
closeRequested: boolean;
|
|
19
|
+
dismiss: () => void;
|
|
20
|
+
returnTarget?: FocusTarget | null;
|
|
21
|
+
root?: FocusTarget | null;
|
|
22
|
+
}
|
|
23
|
+
export declare function createLayerState(): {
|
|
24
|
+
entries: Map<string, LayerEntry>;
|
|
25
|
+
topWindow: () => LayerEntry | undefined;
|
|
26
|
+
top: () => LayerEntry | undefined;
|
|
27
|
+
windowOf: (id?: string) => string | undefined;
|
|
28
|
+
isRestoredFocus(target?: FocusTarget | null): boolean;
|
|
29
|
+
clearRestoredFocus(target?: FocusTarget | null): void;
|
|
30
|
+
markClosing(id: string): void;
|
|
31
|
+
subscribe(listener: () => void): () => void;
|
|
32
|
+
snapshot: () => number;
|
|
33
|
+
open(id: string, kind: LayerKind, parent: string | undefined, dismissCallback: () => void, returnTarget?: FocusTarget | null): LayerEntry;
|
|
34
|
+
remove(id: string, focused?: FocusTarget | null): FocusTarget | null | undefined;
|
|
35
|
+
requestClose(id: string): void;
|
|
36
|
+
isActive(id: string): boolean;
|
|
37
|
+
isBlocked(id: string): boolean;
|
|
38
|
+
zIndex(id?: string, role?: "backdrop" | "content" | "popup" | "tooltip" | "toast"): number;
|
|
39
|
+
};
|
|
40
|
+
export type LayerState = ReturnType<typeof createLayerState>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface MarketMetric {
|
|
2
|
+
label: string;
|
|
3
|
+
format?: string;
|
|
4
|
+
sortKey?: string | null;
|
|
5
|
+
formatter?: (value: unknown) => string;
|
|
6
|
+
}
|
|
7
|
+
export interface MetricStorage {
|
|
8
|
+
getItem: (key: string) => string | null;
|
|
9
|
+
setItem: (key: string, value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface MarketCardsModelProps {
|
|
12
|
+
columns: {
|
|
13
|
+
key: string;
|
|
14
|
+
sortable?: boolean;
|
|
15
|
+
defaultSort?: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
metricConfig: Record<string, MarketMetric>;
|
|
18
|
+
excludeKeys?: string[];
|
|
19
|
+
storageNamespace: string;
|
|
20
|
+
storage?: MetricStorage;
|
|
21
|
+
sortKey?: string | null;
|
|
22
|
+
emitSortOnMount?: boolean;
|
|
23
|
+
onSort?: (key: string) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useMarketCardsModel(props: MarketCardsModelProps, persistence: () => MetricStorage | undefined): {
|
|
26
|
+
pills: {
|
|
27
|
+
sortKey: string | null | undefined;
|
|
28
|
+
isDefaultSort: boolean | undefined;
|
|
29
|
+
label: string;
|
|
30
|
+
format?: string;
|
|
31
|
+
formatter?: (value: unknown) => string;
|
|
32
|
+
key: string;
|
|
33
|
+
}[];
|
|
34
|
+
key: string;
|
|
35
|
+
pill: {
|
|
36
|
+
sortKey: string | null | undefined;
|
|
37
|
+
isDefaultSort: boolean | undefined;
|
|
38
|
+
label: string;
|
|
39
|
+
format?: string;
|
|
40
|
+
formatter?: (value: unknown) => string;
|
|
41
|
+
key: string;
|
|
42
|
+
};
|
|
43
|
+
select: (key: string) => void;
|
|
44
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface MarketMetric {
|
|
2
|
+
label: string;
|
|
3
|
+
format?: string;
|
|
4
|
+
sortKey?: string | null;
|
|
5
|
+
formatter?: (value: unknown) => string;
|
|
6
|
+
}
|
|
7
|
+
export interface MetricStorage {
|
|
8
|
+
getItem: (key: string) => string | null;
|
|
9
|
+
setItem: (key: string, value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface MarketCardsModelProps {
|
|
12
|
+
columns: {
|
|
13
|
+
key: string;
|
|
14
|
+
sortable?: boolean;
|
|
15
|
+
defaultSort?: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
metricConfig: Record<string, MarketMetric>;
|
|
18
|
+
excludeKeys?: string[];
|
|
19
|
+
storageNamespace: string;
|
|
20
|
+
storage?: MetricStorage;
|
|
21
|
+
sortKey?: string | null;
|
|
22
|
+
emitSortOnMount?: boolean;
|
|
23
|
+
onSort?: (key: string) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useMarketCardsModel(props: MarketCardsModelProps, persistence: () => MetricStorage | undefined): {
|
|
26
|
+
pills: {
|
|
27
|
+
sortKey: string | null | undefined;
|
|
28
|
+
isDefaultSort: boolean | undefined;
|
|
29
|
+
label: string;
|
|
30
|
+
format?: string;
|
|
31
|
+
formatter?: (value: unknown) => string;
|
|
32
|
+
key: string;
|
|
33
|
+
}[];
|
|
34
|
+
key: string;
|
|
35
|
+
pill: {
|
|
36
|
+
sortKey: string | null | undefined;
|
|
37
|
+
isDefaultSort: boolean | undefined;
|
|
38
|
+
label: string;
|
|
39
|
+
format?: string;
|
|
40
|
+
formatter?: (value: unknown) => string;
|
|
41
|
+
key: string;
|
|
42
|
+
};
|
|
43
|
+
select: (key: string) => void;
|
|
44
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface LayoutColumn {
|
|
2
|
+
key?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
width?: number | string;
|
|
5
|
+
align?: "left" | "right" | "center";
|
|
6
|
+
}
|
|
7
|
+
export declare const marketGeometry: {
|
|
8
|
+
readonly headerHeight: 44;
|
|
9
|
+
readonly rowHeight: 70;
|
|
10
|
+
readonly identityWidth: 240;
|
|
11
|
+
readonly columnWidth: 160;
|
|
12
|
+
readonly actionsWidth: 96;
|
|
13
|
+
readonly sortIconSize: 14;
|
|
14
|
+
readonly sparklineWidth: 72;
|
|
15
|
+
readonly sparklineHeight: 22;
|
|
16
|
+
readonly valueSkeletonWidth: 56;
|
|
17
|
+
readonly valueSkeletonHeight: 16;
|
|
18
|
+
readonly actionSkeletonWidth: 32;
|
|
19
|
+
readonly headerSkeletonHeight: 14;
|
|
20
|
+
};
|
|
21
|
+
export declare const isMarketIdentity: (key?: string) => boolean;
|
|
22
|
+
export declare const normalizeMarketColumns: (columns: (LayoutColumn | string)[]) => LayoutColumn[];
|
|
23
|
+
/** Preserve CSS widths and Vue's historical class-based width overrides. */
|
|
24
|
+
export declare const isCssMarketWidth: (width: unknown) => width is string;
|
|
25
|
+
export declare const legacyMarketWidthClass: (column: LayoutColumn) => string;
|
|
26
|
+
export declare function webMarketLayout(columns: LayoutColumn[], showActions: boolean, widthClass?: (column: LayoutColumn) => string): {
|
|
27
|
+
tableStyle: {
|
|
28
|
+
width: string;
|
|
29
|
+
};
|
|
30
|
+
columns: {
|
|
31
|
+
className: string;
|
|
32
|
+
style: {
|
|
33
|
+
width: string | undefined;
|
|
34
|
+
};
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
export declare function nativeMarketLayout(columns: LayoutColumn[], showActions: boolean, containerWidth: number): {
|
|
38
|
+
widths: number[];
|
|
39
|
+
width: number;
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface LayoutColumn {
|
|
2
|
+
key?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
width?: number | string;
|
|
5
|
+
align?: "left" | "right" | "center";
|
|
6
|
+
}
|
|
7
|
+
export declare const marketGeometry: {
|
|
8
|
+
readonly headerHeight: 44;
|
|
9
|
+
readonly rowHeight: 70;
|
|
10
|
+
readonly identityWidth: 240;
|
|
11
|
+
readonly columnWidth: 160;
|
|
12
|
+
readonly actionsWidth: 96;
|
|
13
|
+
readonly sortIconSize: 14;
|
|
14
|
+
readonly sparklineWidth: 72;
|
|
15
|
+
readonly sparklineHeight: 22;
|
|
16
|
+
readonly valueSkeletonWidth: 56;
|
|
17
|
+
readonly valueSkeletonHeight: 16;
|
|
18
|
+
readonly actionSkeletonWidth: 32;
|
|
19
|
+
readonly headerSkeletonHeight: 14;
|
|
20
|
+
};
|
|
21
|
+
export declare const isMarketIdentity: (key?: string) => boolean;
|
|
22
|
+
export declare const normalizeMarketColumns: (columns: (LayoutColumn | string)[]) => LayoutColumn[];
|
|
23
|
+
/** Preserve CSS widths and Vue's historical class-based width overrides. */
|
|
24
|
+
export declare const isCssMarketWidth: (width: unknown) => width is string;
|
|
25
|
+
export declare const legacyMarketWidthClass: (column: LayoutColumn) => string;
|
|
26
|
+
export declare function webMarketLayout(columns: LayoutColumn[], showActions: boolean, widthClass?: (column: LayoutColumn) => string): {
|
|
27
|
+
tableStyle: {
|
|
28
|
+
width: string;
|
|
29
|
+
};
|
|
30
|
+
columns: {
|
|
31
|
+
className: string;
|
|
32
|
+
style: {
|
|
33
|
+
width: string | undefined;
|
|
34
|
+
};
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
export declare function nativeMarketLayout(columns: LayoutColumn[], showActions: boolean, containerWidth: number): {
|
|
38
|
+
widths: number[];
|
|
39
|
+
width: number;
|
|
40
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function useInitialTab(value: string, candidate: string | undefined, change: (name: string) => void): void;
|
|
2
|
+
export declare function useAccordionState(multiple: boolean): {
|
|
3
|
+
opened: Set<string>;
|
|
4
|
+
toggle: (id: string) => void;
|
|
5
|
+
register: (id: string, defaultOpen: boolean) => () => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function useInitialTab(value: string, candidate: string | undefined, change: (name: string) => void): void;
|
|
2
|
+
export declare function useAccordionState(multiple: boolean): {
|
|
3
|
+
opened: Set<string>;
|
|
4
|
+
toggle: (id: string) => void;
|
|
5
|
+
register: (id: string, defaultOpen: boolean) => () => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type OptionValue = string | number;
|
|
2
|
+
export type SelectOption = OptionValue | {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
export declare const optionValue: (option: SelectOption, key?: string) => OptionValue;
|
|
6
|
+
export declare const optionLabel: (option: SelectOption, key?: string) => string;
|
|
7
|
+
export declare const optionDisabled: (option: SelectOption) => boolean;
|
|
8
|
+
export declare function optionKey(option: SelectOption, key: string, index: number): string;
|
|
9
|
+
export declare function optionSelected(value: OptionValue | OptionValue[] | null, option: SelectOption, key: string): boolean;
|
|
10
|
+
export declare function nextOptionValue(value: OptionValue | OptionValue[] | null, option: SelectOption, key: string, multiple: boolean): OptionValue | OptionValue[];
|
|
11
|
+
export declare function selectOptions<T extends SelectOption>({ options, value, labelKey, valueKey, query, pageSize, limit, loading, multiple, }: {
|
|
12
|
+
options: T[];
|
|
13
|
+
value: OptionValue | OptionValue[] | null;
|
|
14
|
+
labelKey: string;
|
|
15
|
+
valueKey: string;
|
|
16
|
+
query: string;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
limit: number;
|
|
19
|
+
loading: boolean;
|
|
20
|
+
multiple: boolean;
|
|
21
|
+
}): {
|
|
22
|
+
selected: (option: T) => boolean;
|
|
23
|
+
matching: {
|
|
24
|
+
option: T;
|
|
25
|
+
key: string;
|
|
26
|
+
}[];
|
|
27
|
+
visible: {
|
|
28
|
+
option: T;
|
|
29
|
+
key: string;
|
|
30
|
+
}[];
|
|
31
|
+
selectedOption: T | undefined;
|
|
32
|
+
label: string;
|
|
33
|
+
nextValue: (option: T) => OptionValue | OptionValue[];
|
|
34
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type OptionValue = string | number;
|
|
2
|
+
export type SelectOption = OptionValue | {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
export declare const optionValue: (option: SelectOption, key?: string) => OptionValue;
|
|
6
|
+
export declare const optionLabel: (option: SelectOption, key?: string) => string;
|
|
7
|
+
export declare const optionDisabled: (option: SelectOption) => boolean;
|
|
8
|
+
export declare function optionKey(option: SelectOption, key: string, index: number): string;
|
|
9
|
+
export declare function optionSelected(value: OptionValue | OptionValue[] | null, option: SelectOption, key: string): boolean;
|
|
10
|
+
export declare function nextOptionValue(value: OptionValue | OptionValue[] | null, option: SelectOption, key: string, multiple: boolean): OptionValue | OptionValue[];
|
|
11
|
+
export declare function selectOptions<T extends SelectOption>({ options, value, labelKey, valueKey, query, pageSize, limit, loading, multiple, }: {
|
|
12
|
+
options: T[];
|
|
13
|
+
value: OptionValue | OptionValue[] | null;
|
|
14
|
+
labelKey: string;
|
|
15
|
+
valueKey: string;
|
|
16
|
+
query: string;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
limit: number;
|
|
19
|
+
loading: boolean;
|
|
20
|
+
multiple: boolean;
|
|
21
|
+
}): {
|
|
22
|
+
selected: (option: T) => boolean;
|
|
23
|
+
matching: {
|
|
24
|
+
option: T;
|
|
25
|
+
key: string;
|
|
26
|
+
}[];
|
|
27
|
+
visible: {
|
|
28
|
+
option: T;
|
|
29
|
+
key: string;
|
|
30
|
+
}[];
|
|
31
|
+
selectedOption: T | undefined;
|
|
32
|
+
label: string;
|
|
33
|
+
nextValue: (option: T) => OptionValue | OptionValue[];
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatRelativeTime(value: string | number | Date, now?: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatRelativeTime(value: string | number | Date, now?: number): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SearchInputModelProps<T> {
|
|
2
|
+
value: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
debounce?: number;
|
|
5
|
+
loadOptions?: (query: string, context: {
|
|
6
|
+
signal: AbortSignal;
|
|
7
|
+
}) => Promise<T[]>;
|
|
8
|
+
minChars?: number;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
onSearchError?: (error: unknown) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useSearchInputModel<T>({ value, disabled, debounce, loadOptions, minChars, onValueChange, onSearchError, }: SearchInputModelProps<T>, open: boolean): {
|
|
13
|
+
query: string;
|
|
14
|
+
options: T[];
|
|
15
|
+
loading: boolean;
|
|
16
|
+
failed: boolean;
|
|
17
|
+
update: (v: string) => void;
|
|
18
|
+
clear: () => void;
|
|
19
|
+
select: (label: string) => void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SearchInputModelProps<T> {
|
|
2
|
+
value: string;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
debounce?: number;
|
|
5
|
+
loadOptions?: (query: string, context: {
|
|
6
|
+
signal: AbortSignal;
|
|
7
|
+
}) => Promise<T[]>;
|
|
8
|
+
minChars?: number;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
onSearchError?: (error: unknown) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useSearchInputModel<T>({ value, disabled, debounce, loadOptions, minChars, onValueChange, onSearchError, }: SearchInputModelProps<T>, open: boolean): {
|
|
13
|
+
query: string;
|
|
14
|
+
options: T[];
|
|
15
|
+
loading: boolean;
|
|
16
|
+
failed: boolean;
|
|
17
|
+
update: (v: string) => void;
|
|
18
|
+
clear: () => void;
|
|
19
|
+
select: (label: string) => void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A request does not change controlled state. Reset only on logical dismissal. */
|
|
2
|
+
export declare function useSelectState(controlled: boolean | undefined, disabled: boolean, pageSize: number, onOpenChange?: (open: boolean) => void): {
|
|
3
|
+
open: boolean;
|
|
4
|
+
query: string;
|
|
5
|
+
limit: number;
|
|
6
|
+
session: number;
|
|
7
|
+
changeOpen: (next: boolean) => void;
|
|
8
|
+
search: (next: string) => void;
|
|
9
|
+
showMore: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A request does not change controlled state. Reset only on logical dismissal. */
|
|
2
|
+
export declare function useSelectState(controlled: boolean | undefined, disabled: boolean, pageSize: number, onOpenChange?: (open: boolean) => void): {
|
|
3
|
+
open: boolean;
|
|
4
|
+
query: string;
|
|
5
|
+
limit: number;
|
|
6
|
+
session: number;
|
|
7
|
+
changeOpen: (next: boolean) => void;
|
|
8
|
+
search: (next: string) => void;
|
|
9
|
+
showMore: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type TableColumn, type TableCardSection, type TableProps, type useTableModel } from "./table.cjs";
|
|
3
|
+
export declare function tablePresentation<Row extends object>(props: TableProps<Row, unknown>, mobile: boolean): {
|
|
4
|
+
card: boolean;
|
|
5
|
+
visible: TableColumn<Row>[];
|
|
6
|
+
title: TableColumn<Row> | undefined;
|
|
7
|
+
subtitle: TableColumn<Row> | undefined;
|
|
8
|
+
badges: TableColumn<Row>[];
|
|
9
|
+
actions: TableColumn<Row> | undefined;
|
|
10
|
+
inline: TableColumn<Row>[];
|
|
11
|
+
sections: TableCardSection[];
|
|
12
|
+
columnsForSection(row: Row, section: TableCardSection): TableColumn<Row>[];
|
|
13
|
+
};
|
|
14
|
+
export declare function tableCellValue<Row extends object>(props: TableProps<Row, unknown>, column: TableColumn<Row>, row: Row, index: number): {
|
|
15
|
+
value: unknown;
|
|
16
|
+
body: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
export interface TableRowsProps<Row extends object> {
|
|
19
|
+
initialLoading: boolean;
|
|
20
|
+
skeletonRows: number;
|
|
21
|
+
state: Pick<ReturnType<typeof useTableModel<Row>>, "rows" | "key" | "expanded" | "selectedRow">;
|
|
22
|
+
onRowClick: TableProps<Row>["onRowClick"];
|
|
23
|
+
selectable: boolean;
|
|
24
|
+
expandable: boolean;
|
|
25
|
+
checkbox: (row: Row, index: number) => ReactNode;
|
|
26
|
+
expand: (row: Row, index: number) => ReactNode;
|
|
27
|
+
cell: (column: TableColumn<Row>, row: Row, index: number, role?: "title") => ReactNode;
|
|
28
|
+
renderExpand: TableProps<Row>["renderExpand"];
|
|
29
|
+
emptyContent: ReactNode;
|
|
30
|
+
emptyText: string;
|
|
31
|
+
}
|
|
32
|
+
export interface TableCardsProps<Row extends object> extends TableRowsProps<Row> {
|
|
33
|
+
layout: ReturnType<typeof tablePresentation<Row>>;
|
|
34
|
+
}
|
|
35
|
+
export interface TableGridProps<Row extends object, Height> extends TableRowsProps<Row> {
|
|
36
|
+
state: TableRowsProps<Row>["state"] & Pick<ReturnType<typeof useTableModel<Row>>, "all" | "some" | "toggleAll" | "sort" | "sortColumn">;
|
|
37
|
+
visible: TableColumn<Row>[];
|
|
38
|
+
maxHeight?: Height;
|
|
39
|
+
stickyHeader: boolean;
|
|
40
|
+
sortable?: boolean;
|
|
41
|
+
compact: boolean;
|
|
42
|
+
striped: boolean;
|
|
43
|
+
hoverable: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface TableToolbarProps<Row extends object> {
|
|
46
|
+
selectable: boolean;
|
|
47
|
+
selected: Row[];
|
|
48
|
+
toggleAll: () => void;
|
|
49
|
+
clearSelection: () => void;
|
|
50
|
+
renderSelectionToolbar: TableProps<Row>["renderSelectionToolbar"];
|
|
51
|
+
searchable: boolean;
|
|
52
|
+
search: string;
|
|
53
|
+
searchChange: (value: string) => void;
|
|
54
|
+
searchPlaceholder: string;
|
|
55
|
+
toolbar: ReactNode;
|
|
56
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type TableColumn, type TableCardSection, type TableProps, type useTableModel } from "./table.js";
|
|
3
|
+
export declare function tablePresentation<Row extends object>(props: TableProps<Row, unknown>, mobile: boolean): {
|
|
4
|
+
card: boolean;
|
|
5
|
+
visible: TableColumn<Row>[];
|
|
6
|
+
title: TableColumn<Row> | undefined;
|
|
7
|
+
subtitle: TableColumn<Row> | undefined;
|
|
8
|
+
badges: TableColumn<Row>[];
|
|
9
|
+
actions: TableColumn<Row> | undefined;
|
|
10
|
+
inline: TableColumn<Row>[];
|
|
11
|
+
sections: TableCardSection[];
|
|
12
|
+
columnsForSection(row: Row, section: TableCardSection): TableColumn<Row>[];
|
|
13
|
+
};
|
|
14
|
+
export declare function tableCellValue<Row extends object>(props: TableProps<Row, unknown>, column: TableColumn<Row>, row: Row, index: number): {
|
|
15
|
+
value: unknown;
|
|
16
|
+
body: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
export interface TableRowsProps<Row extends object> {
|
|
19
|
+
initialLoading: boolean;
|
|
20
|
+
skeletonRows: number;
|
|
21
|
+
state: Pick<ReturnType<typeof useTableModel<Row>>, "rows" | "key" | "expanded" | "selectedRow">;
|
|
22
|
+
onRowClick: TableProps<Row>["onRowClick"];
|
|
23
|
+
selectable: boolean;
|
|
24
|
+
expandable: boolean;
|
|
25
|
+
checkbox: (row: Row, index: number) => ReactNode;
|
|
26
|
+
expand: (row: Row, index: number) => ReactNode;
|
|
27
|
+
cell: (column: TableColumn<Row>, row: Row, index: number, role?: "title") => ReactNode;
|
|
28
|
+
renderExpand: TableProps<Row>["renderExpand"];
|
|
29
|
+
emptyContent: ReactNode;
|
|
30
|
+
emptyText: string;
|
|
31
|
+
}
|
|
32
|
+
export interface TableCardsProps<Row extends object> extends TableRowsProps<Row> {
|
|
33
|
+
layout: ReturnType<typeof tablePresentation<Row>>;
|
|
34
|
+
}
|
|
35
|
+
export interface TableGridProps<Row extends object, Height> extends TableRowsProps<Row> {
|
|
36
|
+
state: TableRowsProps<Row>["state"] & Pick<ReturnType<typeof useTableModel<Row>>, "all" | "some" | "toggleAll" | "sort" | "sortColumn">;
|
|
37
|
+
visible: TableColumn<Row>[];
|
|
38
|
+
maxHeight?: Height;
|
|
39
|
+
stickyHeader: boolean;
|
|
40
|
+
sortable?: boolean;
|
|
41
|
+
compact: boolean;
|
|
42
|
+
striped: boolean;
|
|
43
|
+
hoverable: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface TableToolbarProps<Row extends object> {
|
|
46
|
+
selectable: boolean;
|
|
47
|
+
selected: Row[];
|
|
48
|
+
toggleAll: () => void;
|
|
49
|
+
clearSelection: () => void;
|
|
50
|
+
renderSelectionToolbar: TableProps<Row>["renderSelectionToolbar"];
|
|
51
|
+
searchable: boolean;
|
|
52
|
+
search: string;
|
|
53
|
+
searchChange: (value: string) => void;
|
|
54
|
+
searchPlaceholder: string;
|
|
55
|
+
toolbar: ReactNode;
|
|
56
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type TableSort, type QueryDisplayProps } from "@kjun-ui/tokens";
|
|
2
|
+
export type { TableSort } from "@kjun-ui/tokens";
|
|
3
|
+
import { type ReactNode } from "react";
|
|
4
|
+
export interface TableColumn<Row extends object = Record<string, unknown>> {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
sortable?: boolean;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
align?: "left" | "center" | "right";
|
|
10
|
+
type?: "number" | "date" | "datetime" | "text";
|
|
11
|
+
format?: (value: unknown, row: Row) => ReactNode;
|
|
12
|
+
render?: (value: unknown, row: Row, index: number) => ReactNode;
|
|
13
|
+
pill?: boolean;
|
|
14
|
+
badge?: boolean;
|
|
15
|
+
inlineInCard?: boolean;
|
|
16
|
+
hideInCard?: boolean;
|
|
17
|
+
hideEmptyInCard?: boolean;
|
|
18
|
+
fullWidthInCard?: boolean;
|
|
19
|
+
secondary?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
headerClass?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TableCardSection {
|
|
24
|
+
key?: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
labelAlign?: "left" | "right";
|
|
27
|
+
layout?: "stack" | "grid" | "metrics";
|
|
28
|
+
columns: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface TablePagination {
|
|
31
|
+
page: number;
|
|
32
|
+
total: number;
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface TableProps<Row extends object = Record<string, unknown>, MaxHeight = number> extends QueryDisplayProps {
|
|
36
|
+
columns: TableColumn<Row>[];
|
|
37
|
+
data?: Row[];
|
|
38
|
+
rowKey?: string;
|
|
39
|
+
skeletonRows?: number;
|
|
40
|
+
emptyText?: string;
|
|
41
|
+
sortable?: boolean;
|
|
42
|
+
sort?: TableSort | null;
|
|
43
|
+
sortMode?: "client" | "server";
|
|
44
|
+
hoverable?: boolean;
|
|
45
|
+
searchable?: boolean;
|
|
46
|
+
searchPlaceholder?: string;
|
|
47
|
+
stickyHeader?: boolean;
|
|
48
|
+
maxHeight?: MaxHeight;
|
|
49
|
+
pagination?: TablePagination | null;
|
|
50
|
+
compact?: boolean;
|
|
51
|
+
striped?: boolean;
|
|
52
|
+
ariaLabel?: string;
|
|
53
|
+
responsive?: "card" | "compact" | "none" | null;
|
|
54
|
+
mobileColumns?: string[];
|
|
55
|
+
cardTitle?: string | null;
|
|
56
|
+
cardSubtitle?: string | null;
|
|
57
|
+
cardSections?: TableCardSection[];
|
|
58
|
+
expandable?: boolean;
|
|
59
|
+
expandedRows?: (string | number)[];
|
|
60
|
+
expandSingle?: boolean;
|
|
61
|
+
rowClass?: string | ((row: Row, index: number) => string);
|
|
62
|
+
selectable?: boolean;
|
|
63
|
+
selected?: Row[];
|
|
64
|
+
toolbar?: ReactNode;
|
|
65
|
+
emptyContent?: ReactNode;
|
|
66
|
+
renderCell?: (value: unknown, column: TableColumn<Row>, row: Row, index: number) => ReactNode;
|
|
67
|
+
formatValue?: (value: unknown, column: TableColumn<Row>, row: Row) => ReactNode;
|
|
68
|
+
renderExpand?: (row: Row, index: number) => ReactNode;
|
|
69
|
+
renderSelectionToolbar?: (selected: Row[]) => ReactNode;
|
|
70
|
+
onSortChange?: (value: {
|
|
71
|
+
key: string;
|
|
72
|
+
order: "asc" | "desc";
|
|
73
|
+
}) => void;
|
|
74
|
+
onSelectionChange?: (selected: Row[]) => void;
|
|
75
|
+
onExpandedRowsChange?: (keys: (string | number)[]) => void;
|
|
76
|
+
onPageChange?: (page: number) => void;
|
|
77
|
+
onRowClick?: (row: Row, index: number) => void;
|
|
78
|
+
onSearch?: (query: string) => void;
|
|
79
|
+
onRetry?: () => void;
|
|
80
|
+
}
|
|
81
|
+
export declare function getValue(row: object, key: string): unknown;
|
|
82
|
+
export declare function useTableModel<Row extends object>(props: TableProps<Row, unknown>): {
|
|
83
|
+
rows: Row[];
|
|
84
|
+
key: (row: Row, index?: number) => string | number;
|
|
85
|
+
sort: TableSort;
|
|
86
|
+
search: string;
|
|
87
|
+
all: boolean;
|
|
88
|
+
some: boolean;
|
|
89
|
+
selectedRow: (row: Row) => boolean;
|
|
90
|
+
expanded: (string | number)[];
|
|
91
|
+
searchChange: (q: string) => void;
|
|
92
|
+
sortColumn: (col: TableColumn<Row>) => void;
|
|
93
|
+
toggleRow: (row: Row) => void | undefined;
|
|
94
|
+
toggleAll: () => void | undefined;
|
|
95
|
+
toggleExpand: (row: Row, index: number) => void;
|
|
96
|
+
};
|