@kjun-ui/react 0.21.0 → 0.22.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/README.md +19 -5
- package/dist/index.cjs +8405 -3740
- package/dist/index.js +8199 -3512
- package/dist/styles.css +2610 -454
- package/dist/types/packages/react/src/actions.d.cts +21 -16
- package/dist/types/packages/react/src/actions.d.ts +21 -16
- package/dist/types/packages/react/src/app-navigation.d.cts +6 -2
- package/dist/types/packages/react/src/app-navigation.d.ts +6 -2
- package/dist/types/packages/react/src/avatar-group.d.cts +36 -0
- package/dist/types/packages/react/src/avatar-group.d.ts +36 -0
- package/dist/types/packages/react/src/button.d.cts +14 -6
- package/dist/types/packages/react/src/button.d.ts +14 -6
- package/dist/types/packages/react/src/calendar.d.cts +6 -2
- package/dist/types/packages/react/src/calendar.d.ts +6 -2
- package/dist/types/packages/react/src/card.d.cts +10 -3
- package/dist/types/packages/react/src/card.d.ts +10 -3
- package/dist/types/packages/react/src/carousel.d.cts +8 -1
- package/dist/types/packages/react/src/carousel.d.ts +8 -1
- package/dist/types/packages/react/src/choice-controls.d.cts +99 -0
- package/dist/types/packages/react/src/choice-controls.d.ts +99 -0
- package/dist/types/packages/react/src/collapse.d.cts +4 -1
- package/dist/types/packages/react/src/collapse.d.ts +4 -1
- package/dist/types/packages/react/src/color-picker.d.cts +8 -1
- package/dist/types/packages/react/src/color-picker.d.ts +8 -1
- package/dist/types/packages/react/src/combobox.d.cts +18 -5
- package/dist/types/packages/react/src/combobox.d.ts +18 -5
- package/dist/types/packages/react/src/controls.d.cts +7 -74
- package/dist/types/packages/react/src/controls.d.ts +7 -74
- package/dist/types/packages/react/src/data-state.d.cts +19 -6
- package/dist/types/packages/react/src/data-state.d.ts +19 -6
- package/dist/types/packages/react/src/date-picker.d.cts +8 -2
- package/dist/types/packages/react/src/date-picker.d.ts +8 -2
- package/dist/types/packages/react/src/display.d.cts +26 -6
- package/dist/types/packages/react/src/display.d.ts +26 -6
- package/dist/types/packages/react/src/drawer.d.cts +11 -2
- package/dist/types/packages/react/src/drawer.d.ts +11 -2
- package/dist/types/packages/react/src/dropdown.d.cts +19 -5
- package/dist/types/packages/react/src/dropdown.d.ts +19 -5
- package/dist/types/packages/react/src/event-calendar.d.cts +47 -0
- package/dist/types/packages/react/src/event-calendar.d.ts +47 -0
- package/dist/types/packages/react/src/fab.d.cts +2 -0
- package/dist/types/packages/react/src/fab.d.ts +2 -0
- package/dist/types/packages/react/src/file-upload-row.d.cts +23 -0
- package/dist/types/packages/react/src/file-upload-row.d.ts +23 -0
- package/dist/types/packages/react/src/file-upload.d.cts +38 -0
- package/dist/types/packages/react/src/file-upload.d.ts +38 -0
- package/dist/types/packages/react/src/financial-display.d.cts +32 -11
- package/dist/types/packages/react/src/financial-display.d.ts +32 -11
- package/dist/types/packages/react/src/floating-panel.d.cts +6 -2
- package/dist/types/packages/react/src/floating-panel.d.ts +6 -2
- package/dist/types/packages/react/src/index.d.cts +12 -1
- package/dist/types/packages/react/src/index.d.ts +12 -1
- package/dist/types/packages/react/src/input.d.cts +14 -1
- package/dist/types/packages/react/src/input.d.ts +14 -1
- package/dist/types/packages/react/src/kpi-hero.d.cts +2 -0
- package/dist/types/packages/react/src/kpi-hero.d.ts +2 -0
- package/dist/types/packages/react/src/kpi-row.d.cts +5 -0
- package/dist/types/packages/react/src/kpi-row.d.ts +5 -0
- package/dist/types/packages/react/src/layout-primitives.d.cts +71 -139
- package/dist/types/packages/react/src/layout-primitives.d.ts +71 -139
- package/dist/types/packages/react/src/list-context.d.cts +2 -1
- package/dist/types/packages/react/src/list-context.d.ts +2 -1
- package/dist/types/packages/react/src/list.d.cts +39 -8
- package/dist/types/packages/react/src/list.d.ts +39 -8
- package/dist/types/packages/react/src/market-model.d.cts +13 -1
- package/dist/types/packages/react/src/market-model.d.ts +13 -1
- package/dist/types/packages/react/src/market-parts.d.cts +9 -0
- package/dist/types/packages/react/src/market-parts.d.ts +9 -0
- package/dist/types/packages/react/src/market-skeleton.d.cts +7 -1
- package/dist/types/packages/react/src/market-skeleton.d.ts +7 -1
- package/dist/types/packages/react/src/media.d.cts +6 -2
- package/dist/types/packages/react/src/media.d.ts +6 -2
- package/dist/types/packages/react/src/modal.d.cts +11 -2
- package/dist/types/packages/react/src/modal.d.ts +11 -2
- package/dist/types/packages/react/src/navigation.d.cts +34 -5
- package/dist/types/packages/react/src/navigation.d.ts +34 -5
- package/dist/types/packages/react/src/number-display.d.cts +8 -5
- package/dist/types/packages/react/src/number-display.d.ts +8 -5
- package/dist/types/packages/react/src/number-input.d.cts +28 -0
- package/dist/types/packages/react/src/number-input.d.ts +28 -0
- package/dist/types/packages/react/src/popover.d.cts +5 -2
- package/dist/types/packages/react/src/popover.d.ts +5 -2
- package/dist/types/packages/react/src/pressable.d.cts +17 -0
- package/dist/types/packages/react/src/pressable.d.ts +17 -0
- package/dist/types/packages/react/src/quantity-stepper.d.cts +3 -1
- package/dist/types/packages/react/src/quantity-stepper.d.ts +3 -1
- package/dist/types/packages/react/src/range-input.d.cts +15 -3
- package/dist/types/packages/react/src/range-input.d.ts +15 -3
- package/dist/types/packages/react/src/search-input.d.cts +6 -3
- package/dist/types/packages/react/src/search-input.d.ts +6 -3
- package/dist/types/packages/react/src/select-control.d.cts +7 -2
- package/dist/types/packages/react/src/select-control.d.ts +7 -2
- package/dist/types/packages/react/src/side-navigation-layout.d.cts +47 -0
- package/dist/types/packages/react/src/side-navigation-layout.d.ts +47 -0
- package/dist/types/packages/react/src/side-navigation.d.cts +74 -0
- package/dist/types/packages/react/src/side-navigation.d.ts +74 -0
- package/dist/types/packages/react/src/skeletons.d.cts +18 -3
- package/dist/types/packages/react/src/skeletons.d.ts +18 -3
- package/dist/types/packages/react/src/spinner-glyph.d.cts +8 -0
- package/dist/types/packages/react/src/spinner-glyph.d.ts +8 -0
- package/dist/types/packages/react/src/split-pane.d.cts +18 -5
- package/dist/types/packages/react/src/split-pane.d.ts +18 -5
- package/dist/types/packages/react/src/stacked-bar.d.cts +3 -1
- package/dist/types/packages/react/src/stacked-bar.d.ts +3 -1
- package/dist/types/packages/react/src/steps.d.cts +26 -0
- package/dist/types/packages/react/src/steps.d.ts +26 -0
- package/dist/types/packages/react/src/table-cards.d.cts +4 -12
- package/dist/types/packages/react/src/table-cards.d.ts +4 -12
- package/dist/types/packages/react/src/table-grid.d.cts +3 -7
- package/dist/types/packages/react/src/table-grid.d.ts +3 -7
- package/dist/types/packages/react/src/table-groups.d.cts +5 -0
- package/dist/types/packages/react/src/table-groups.d.ts +5 -0
- package/dist/types/packages/react/src/table-list.d.cts +2 -9
- package/dist/types/packages/react/src/table-list.d.ts +2 -9
- package/dist/types/packages/react/src/table-model.d.cts +6 -2
- package/dist/types/packages/react/src/table-model.d.ts +6 -2
- package/dist/types/packages/react/src/tabs.d.cts +3 -1
- package/dist/types/packages/react/src/tabs.d.ts +3 -1
- package/dist/types/packages/react/src/textarea.d.cts +6 -3
- package/dist/types/packages/react/src/textarea.d.ts +6 -3
- package/dist/types/packages/react/src/tiles.d.cts +18 -0
- package/dist/types/packages/react/src/tiles.d.ts +18 -0
- package/dist/types/packages/react/src/time-picker.d.cts +12 -2
- package/dist/types/packages/react/src/time-picker.d.ts +12 -2
- package/dist/types/packages/react/src/time-wheel.d.cts +18 -0
- package/dist/types/packages/react/src/time-wheel.d.ts +18 -0
- package/dist/types/packages/react/src/use-filter-scroll.d.cts +5 -0
- package/dist/types/packages/react/src/use-filter-scroll.d.ts +5 -0
- package/dist/types/shared/package-runtime/accordion-state.d.cts +2 -0
- package/dist/types/shared/package-runtime/accordion-state.d.ts +2 -0
- package/dist/types/shared/package-runtime/action-size.d.cts +4 -0
- package/dist/types/shared/package-runtime/action-size.d.ts +4 -0
- package/dist/types/shared/package-runtime/alert-actions.d.cts +7 -0
- package/dist/types/shared/package-runtime/alert-actions.d.ts +7 -0
- package/dist/types/shared/package-runtime/alert-exit.d.cts +6 -0
- package/dist/types/shared/package-runtime/alert-exit.d.ts +6 -0
- package/dist/types/shared/package-runtime/alert-live.d.cts +2 -0
- package/dist/types/shared/package-runtime/alert-live.d.ts +2 -0
- package/dist/types/shared/package-runtime/avatar-group.d.cts +18 -0
- package/dist/types/shared/package-runtime/avatar-group.d.ts +18 -0
- package/dist/types/shared/package-runtime/badge-tone.d.cts +8 -2
- package/dist/types/shared/package-runtime/badge-tone.d.ts +8 -2
- package/dist/types/shared/package-runtime/bottom-bar.d.cts +1 -1
- package/dist/types/shared/package-runtime/bottom-bar.d.ts +1 -1
- package/dist/types/shared/package-runtime/bottom-navigation.d.cts +5 -0
- package/dist/types/shared/package-runtime/bottom-navigation.d.ts +5 -0
- package/dist/types/shared/package-runtime/calendar.d.cts +21 -7
- package/dist/types/shared/package-runtime/calendar.d.ts +21 -7
- package/dist/types/shared/package-runtime/card-layout.d.cts +8 -0
- package/dist/types/shared/package-runtime/card-layout.d.ts +8 -0
- package/dist/types/shared/package-runtime/carousel-scroll.d.cts +2 -0
- package/dist/types/shared/package-runtime/carousel-scroll.d.ts +2 -0
- package/dist/types/shared/package-runtime/carousel.d.cts +12 -2
- package/dist/types/shared/package-runtime/carousel.d.ts +12 -2
- package/dist/types/shared/package-runtime/chart-skeleton.d.cts +1 -1
- package/dist/types/shared/package-runtime/chart-skeleton.d.ts +1 -1
- package/dist/types/shared/package-runtime/clipboard.d.cts +6 -0
- package/dist/types/shared/package-runtime/clipboard.d.ts +6 -0
- package/dist/types/shared/package-runtime/combobox-options.d.cts +13 -0
- package/dist/types/shared/package-runtime/combobox-options.d.ts +13 -0
- package/dist/types/shared/package-runtime/combobox.d.cts +3 -1
- package/dist/types/shared/package-runtime/combobox.d.ts +3 -1
- package/dist/types/shared/package-runtime/copy-button.d.cts +11 -0
- package/dist/types/shared/package-runtime/copy-button.d.ts +11 -0
- package/dist/types/shared/package-runtime/data-cells.d.cts +36 -0
- package/dist/types/shared/package-runtime/data-cells.d.ts +36 -0
- package/dist/types/shared/package-runtime/development.d.cts +4 -0
- package/dist/types/shared/package-runtime/development.d.ts +4 -0
- package/dist/types/shared/package-runtime/distribution.d.cts +36 -1
- package/dist/types/shared/package-runtime/distribution.d.ts +36 -1
- package/dist/types/shared/package-runtime/drawer-geometry.d.cts +7 -0
- package/dist/types/shared/package-runtime/drawer-geometry.d.ts +7 -0
- package/dist/types/shared/package-runtime/event-calendar.d.cts +81 -0
- package/dist/types/shared/package-runtime/event-calendar.d.ts +81 -0
- package/dist/types/shared/package-runtime/external-link.d.cts +4 -0
- package/dist/types/shared/package-runtime/external-link.d.ts +4 -0
- package/dist/types/shared/package-runtime/file-upload.d.cts +128 -0
- package/dist/types/shared/package-runtime/file-upload.d.ts +128 -0
- package/dist/types/shared/package-runtime/filter-scroll.d.cts +5 -0
- package/dist/types/shared/package-runtime/filter-scroll.d.ts +5 -0
- package/dist/types/shared/package-runtime/filter-value.d.cts +2 -0
- package/dist/types/shared/package-runtime/filter-value.d.ts +2 -0
- package/dist/types/shared/package-runtime/input-field.d.cts +23 -0
- package/dist/types/shared/package-runtime/input-field.d.ts +23 -0
- package/dist/types/shared/package-runtime/input-variant.d.cts +7 -0
- package/dist/types/shared/package-runtime/input-variant.d.ts +7 -0
- package/dist/types/shared/package-runtime/kpi.d.cts +13 -0
- package/dist/types/shared/package-runtime/kpi.d.ts +13 -0
- package/dist/types/shared/package-runtime/layout-primitives.d.cts +115 -6
- package/dist/types/shared/package-runtime/layout-primitives.d.ts +115 -6
- package/dist/types/shared/package-runtime/list-row.d.cts +43 -6
- package/dist/types/shared/package-runtime/list-row.d.ts +43 -6
- package/dist/types/shared/package-runtime/market-layout.d.cts +3 -1
- package/dist/types/shared/package-runtime/market-layout.d.ts +3 -1
- package/dist/types/shared/package-runtime/market-query.d.cts +6 -0
- package/dist/types/shared/package-runtime/market-query.d.ts +6 -0
- package/dist/types/shared/package-runtime/market-table.d.cts +32 -0
- package/dist/types/shared/package-runtime/market-table.d.ts +32 -0
- package/dist/types/shared/package-runtime/menu-button.d.cts +4 -0
- package/dist/types/shared/package-runtime/menu-button.d.ts +4 -0
- package/dist/types/shared/package-runtime/messages/ko.d.cts +74 -1
- package/dist/types/shared/package-runtime/messages/ko.d.ts +74 -1
- package/dist/types/shared/package-runtime/messages-context.d.cts +66 -1
- package/dist/types/shared/package-runtime/messages-context.d.ts +66 -1
- package/dist/types/shared/package-runtime/minimum-loading.d.cts +3 -0
- package/dist/types/shared/package-runtime/minimum-loading.d.ts +3 -0
- package/dist/types/shared/package-runtime/modal-geometry.d.cts +15 -0
- package/dist/types/shared/package-runtime/modal-geometry.d.ts +15 -0
- package/dist/types/shared/package-runtime/navigation.d.cts +9 -2
- package/dist/types/shared/package-runtime/navigation.d.ts +9 -2
- package/dist/types/shared/package-runtime/nested-controls.d.cts +7 -0
- package/dist/types/shared/package-runtime/nested-controls.d.ts +7 -0
- package/dist/types/shared/package-runtime/number-input.d.cts +63 -0
- package/dist/types/shared/package-runtime/number-input.d.ts +63 -0
- package/dist/types/shared/package-runtime/options.d.cts +25 -5
- package/dist/types/shared/package-runtime/options.d.ts +25 -5
- package/dist/types/shared/package-runtime/pagination.d.cts +12 -0
- package/dist/types/shared/package-runtime/pagination.d.ts +12 -0
- package/dist/types/shared/package-runtime/press-repeat.d.cts +13 -0
- package/dist/types/shared/package-runtime/press-repeat.d.ts +13 -0
- package/dist/types/shared/package-runtime/progress-circle.d.cts +5 -0
- package/dist/types/shared/package-runtime/progress-circle.d.ts +5 -0
- package/dist/types/shared/package-runtime/progress-marker.d.cts +7 -0
- package/dist/types/shared/package-runtime/progress-marker.d.ts +7 -0
- package/dist/types/shared/package-runtime/select-trigger.d.cts +23 -0
- package/dist/types/shared/package-runtime/select-trigger.d.ts +23 -0
- package/dist/types/shared/package-runtime/sheet-drag.d.cts +24 -0
- package/dist/types/shared/package-runtime/sheet-drag.d.ts +24 -0
- package/dist/types/shared/package-runtime/side-navigation-keys.d.cts +23 -0
- package/dist/types/shared/package-runtime/side-navigation-keys.d.ts +23 -0
- package/dist/types/shared/package-runtime/side-navigation-scroll.d.cts +7 -0
- package/dist/types/shared/package-runtime/side-navigation-scroll.d.ts +7 -0
- package/dist/types/shared/package-runtime/side-navigation.d.cts +277 -0
- package/dist/types/shared/package-runtime/side-navigation.d.ts +277 -0
- package/dist/types/shared/package-runtime/signed-number.d.cts +33 -0
- package/dist/types/shared/package-runtime/signed-number.d.ts +33 -0
- package/dist/types/shared/package-runtime/skeleton-text.d.cts +4 -0
- package/dist/types/shared/package-runtime/skeleton-text.d.ts +4 -0
- package/dist/types/shared/package-runtime/slider-view.d.cts +17 -2
- package/dist/types/shared/package-runtime/slider-view.d.ts +17 -2
- package/dist/types/shared/package-runtime/sparkline.d.cts +8 -4
- package/dist/types/shared/package-runtime/sparkline.d.ts +8 -4
- package/dist/types/shared/package-runtime/spinner-geometry.d.cts +14 -0
- package/dist/types/shared/package-runtime/spinner-geometry.d.ts +14 -0
- package/dist/types/shared/package-runtime/split-pane.d.cts +40 -1
- package/dist/types/shared/package-runtime/split-pane.d.ts +40 -1
- package/dist/types/shared/package-runtime/steps.d.cts +37 -0
- package/dist/types/shared/package-runtime/steps.d.ts +37 -0
- package/dist/types/shared/package-runtime/tab-keyboard.d.cts +6 -0
- package/dist/types/shared/package-runtime/tab-keyboard.d.ts +6 -0
- package/dist/types/shared/package-runtime/table-columns.d.cts +8 -0
- package/dist/types/shared/package-runtime/table-columns.d.ts +8 -0
- package/dist/types/shared/package-runtime/table-model.d.cts +23 -3
- package/dist/types/shared/package-runtime/table-model.d.ts +23 -3
- package/dist/types/shared/package-runtime/table-presentation.d.cts +11 -2
- package/dist/types/shared/package-runtime/table-presentation.d.ts +11 -2
- package/dist/types/shared/package-runtime/table.d.cts +15 -2
- package/dist/types/shared/package-runtime/table.d.ts +15 -2
- package/dist/types/shared/package-runtime/textarea.d.cts +6 -4
- package/dist/types/shared/package-runtime/textarea.d.ts +6 -4
- package/dist/types/shared/package-runtime/tiles-children.d.cts +7 -0
- package/dist/types/shared/package-runtime/tiles-children.d.ts +7 -0
- package/dist/types/shared/package-runtime/tiles.d.cts +18 -0
- package/dist/types/shared/package-runtime/tiles.d.ts +18 -0
- package/dist/types/shared/package-runtime/time-segments.d.cts +24 -0
- package/dist/types/shared/package-runtime/time-segments.d.ts +24 -0
- package/dist/types/shared/package-runtime/time-wheel.d.cts +54 -0
- package/dist/types/shared/package-runtime/time-wheel.d.ts +54 -0
- package/dist/types/shared/package-runtime/trailing-overflow.d.cts +1 -0
- package/dist/types/shared/package-runtime/trailing-overflow.d.ts +1 -0
- package/dist/types/shared/package-runtime/use-color-picker.d.cts +3 -0
- package/dist/types/shared/package-runtime/use-color-picker.d.ts +3 -0
- package/dist/types/shared/package-runtime/use-copy-feedback.d.cts +10 -0
- package/dist/types/shared/package-runtime/use-copy-feedback.d.ts +10 -0
- package/dist/types/shared/package-runtime/use-open-state.d.cts +5 -0
- package/dist/types/shared/package-runtime/use-open-state.d.ts +5 -0
- package/dist/types/shared/package-runtime/use-pending-action.d.cts +6 -0
- package/dist/types/shared/package-runtime/use-pending-action.d.ts +6 -0
- package/dist/types/shared/package-runtime/use-side-navigation-state.d.cts +25 -0
- package/dist/types/shared/package-runtime/use-side-navigation-state.d.ts +25 -0
- package/dist/types/shared/package-runtime/use-slide.d.cts +3 -0
- package/dist/types/shared/package-runtime/use-slide.d.ts +3 -0
- package/package.json +3 -3
- package/dist/types/packages/react/src/compound-control.d.cts +0 -1
- package/dist/types/packages/react/src/compound-control.d.ts +0 -1
- package/dist/types/shared/package-runtime/center-option.d.cts +0 -1
- package/dist/types/shared/package-runtime/center-option.d.ts +0 -1
|
@@ -12,8 +12,12 @@ export interface SplitLimits {
|
|
|
12
12
|
high: number;
|
|
13
13
|
}
|
|
14
14
|
export type SplitKeyAction = "decrease" | "increase" | "min" | "max" | "reset";
|
|
15
|
+
export type SplitUnit = "ratio" | "px";
|
|
15
16
|
/** Pixels one arrow key press moves the handle. */
|
|
16
|
-
export declare const SPLIT_KEY_STEP
|
|
17
|
+
export declare const SPLIT_KEY_STEP: number;
|
|
18
|
+
/** Two presses on the handle this close in time, and this close in place, are a double press that restores the default size. */
|
|
19
|
+
export declare const SPLIT_DOUBLE_PRESS_MS = 300;
|
|
20
|
+
export declare const SPLIT_PRESS_SLOP = 10;
|
|
17
21
|
/**
|
|
18
22
|
* The first pane's allowed pixels. Minimums beat maximums, and when the container is narrower than both minimums the
|
|
19
23
|
* first pane keeps its minimum (or all the room, if even that does not fit), so panes never overlap or go negative.
|
|
@@ -44,3 +48,38 @@ export declare function splitKeyHeld(event: {
|
|
|
44
48
|
export declare function splitKeyAction(key: string, direction: SplitDirection, rtl: boolean | undefined): SplitKeyAction | null;
|
|
45
49
|
/** The first pane's pixels after a key action; resetPx is the default size in pixels. */
|
|
46
50
|
export declare function splitKeyTarget(action: SplitKeyAction, px: number, limits: SplitLimits, resetPx: number): number;
|
|
51
|
+
/**
|
|
52
|
+
* The wanted size in its unit. A ratio falls back to the default share (or one half); pixels fall back to the default
|
|
53
|
+
* pixels, or to null when there is none, which means half the room once the split is measured.
|
|
54
|
+
*/
|
|
55
|
+
export declare function splitWanted(size: number | undefined, fallback: number | undefined, unit: SplitUnit): number | null;
|
|
56
|
+
/** The first pane's pixels for a wanted size, before the limits. */
|
|
57
|
+
export declare function splitWantedPx(value: number | null, unit: SplitUnit, total: number, handle: number): number;
|
|
58
|
+
/** The size reported to the app: a ratio with four decimals, or whole pixels. */
|
|
59
|
+
export declare function splitReport(px: number, unit: SplitUnit, total: number, handle: number): number;
|
|
60
|
+
/** A collapsed first pane's pixels: collapsedSize, never past the room. */
|
|
61
|
+
export declare function splitFoldedPx(collapsedSize: number | undefined, total: number, handle: number): number;
|
|
62
|
+
/**
|
|
63
|
+
* While dragging a collapsible pane: the pointer collapses it once it passes the midpoint between the collapsed size
|
|
64
|
+
* and the pane's smallest open size, and opens it again on the way back.
|
|
65
|
+
*/
|
|
66
|
+
export declare function splitCollapseAt(px: number, low: number, folded: number): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* What a key does to a collapsible pane, as in the window-splitter pattern: Enter toggles it, Home collapses it, and
|
|
69
|
+
* from collapsed an increase restores the size it had while End opens it to the largest size. move says whether the
|
|
70
|
+
* key then moves the handle as on a pane that does not collapse.
|
|
71
|
+
*/
|
|
72
|
+
export declare function splitKeyCollapse(action: SplitKeyAction, collapsible: boolean, collapsed: boolean): {
|
|
73
|
+
collapse: boolean | null;
|
|
74
|
+
move: boolean;
|
|
75
|
+
};
|
|
76
|
+
/** A second press within the double-press time and slop of the first. */
|
|
77
|
+
export declare function splitDoublePress(previous: {
|
|
78
|
+
at: number;
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
} | null, now: {
|
|
82
|
+
at: number;
|
|
83
|
+
x: number;
|
|
84
|
+
y: number;
|
|
85
|
+
}): boolean;
|
|
@@ -12,8 +12,12 @@ export interface SplitLimits {
|
|
|
12
12
|
high: number;
|
|
13
13
|
}
|
|
14
14
|
export type SplitKeyAction = "decrease" | "increase" | "min" | "max" | "reset";
|
|
15
|
+
export type SplitUnit = "ratio" | "px";
|
|
15
16
|
/** Pixels one arrow key press moves the handle. */
|
|
16
|
-
export declare const SPLIT_KEY_STEP
|
|
17
|
+
export declare const SPLIT_KEY_STEP: number;
|
|
18
|
+
/** Two presses on the handle this close in time, and this close in place, are a double press that restores the default size. */
|
|
19
|
+
export declare const SPLIT_DOUBLE_PRESS_MS = 300;
|
|
20
|
+
export declare const SPLIT_PRESS_SLOP = 10;
|
|
17
21
|
/**
|
|
18
22
|
* The first pane's allowed pixels. Minimums beat maximums, and when the container is narrower than both minimums the
|
|
19
23
|
* first pane keeps its minimum (or all the room, if even that does not fit), so panes never overlap or go negative.
|
|
@@ -44,3 +48,38 @@ export declare function splitKeyHeld(event: {
|
|
|
44
48
|
export declare function splitKeyAction(key: string, direction: SplitDirection, rtl: boolean | undefined): SplitKeyAction | null;
|
|
45
49
|
/** The first pane's pixels after a key action; resetPx is the default size in pixels. */
|
|
46
50
|
export declare function splitKeyTarget(action: SplitKeyAction, px: number, limits: SplitLimits, resetPx: number): number;
|
|
51
|
+
/**
|
|
52
|
+
* The wanted size in its unit. A ratio falls back to the default share (or one half); pixels fall back to the default
|
|
53
|
+
* pixels, or to null when there is none, which means half the room once the split is measured.
|
|
54
|
+
*/
|
|
55
|
+
export declare function splitWanted(size: number | undefined, fallback: number | undefined, unit: SplitUnit): number | null;
|
|
56
|
+
/** The first pane's pixels for a wanted size, before the limits. */
|
|
57
|
+
export declare function splitWantedPx(value: number | null, unit: SplitUnit, total: number, handle: number): number;
|
|
58
|
+
/** The size reported to the app: a ratio with four decimals, or whole pixels. */
|
|
59
|
+
export declare function splitReport(px: number, unit: SplitUnit, total: number, handle: number): number;
|
|
60
|
+
/** A collapsed first pane's pixels: collapsedSize, never past the room. */
|
|
61
|
+
export declare function splitFoldedPx(collapsedSize: number | undefined, total: number, handle: number): number;
|
|
62
|
+
/**
|
|
63
|
+
* While dragging a collapsible pane: the pointer collapses it once it passes the midpoint between the collapsed size
|
|
64
|
+
* and the pane's smallest open size, and opens it again on the way back.
|
|
65
|
+
*/
|
|
66
|
+
export declare function splitCollapseAt(px: number, low: number, folded: number): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* What a key does to a collapsible pane, as in the window-splitter pattern: Enter toggles it, Home collapses it, and
|
|
69
|
+
* from collapsed an increase restores the size it had while End opens it to the largest size. move says whether the
|
|
70
|
+
* key then moves the handle as on a pane that does not collapse.
|
|
71
|
+
*/
|
|
72
|
+
export declare function splitKeyCollapse(action: SplitKeyAction, collapsible: boolean, collapsed: boolean): {
|
|
73
|
+
collapse: boolean | null;
|
|
74
|
+
move: boolean;
|
|
75
|
+
};
|
|
76
|
+
/** A second press within the double-press time and slop of the first. */
|
|
77
|
+
export declare function splitDoublePress(previous: {
|
|
78
|
+
at: number;
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
} | null, now: {
|
|
82
|
+
at: number;
|
|
83
|
+
x: number;
|
|
84
|
+
y: number;
|
|
85
|
+
}): boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { KjunMessages } from "./messages/index.cjs";
|
|
2
|
+
export type KjunStepStatus = "complete" | "current" | "error" | "upcoming";
|
|
3
|
+
export type KjunStepsCurrentStatus = "active" | "error";
|
|
4
|
+
export type KjunStepsLayout = "auto" | "full" | "compact";
|
|
5
|
+
/** Which steps onStepSelect makes buttons: completed ones (default), or every step but the current one (a wizard that may skip ahead). */
|
|
6
|
+
export type KjunStepsSelectable = "complete" | "all";
|
|
7
|
+
export interface KjunStepItem {
|
|
8
|
+
key?: string | number;
|
|
9
|
+
label: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
meta?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Narrowest column a step gets in the wide layout; mirrors `extensions.steps.minColumn`. */
|
|
14
|
+
export declare const STEPS_MIN_COLUMN = 80;
|
|
15
|
+
/** More steps than this always fold to compact. */
|
|
16
|
+
export declare const STEPS_AUTO_MAX = 10;
|
|
17
|
+
/** `current` counts finished steps: floored and kept within 0..count (count means all complete). */
|
|
18
|
+
export declare function clampCurrent(current: number, count: number): number;
|
|
19
|
+
export declare function stepStatus(index: number, current: number, currentStatus: KjunStepsCurrentStatus): KjunStepStatus;
|
|
20
|
+
export declare function stepsRootStatus(current: number, count: number, currentStatus: KjunStepsCurrentStatus): "current" | "error" | "complete";
|
|
21
|
+
export declare function stepsLayout(width: number, count: number): "full" | "compact";
|
|
22
|
+
/** A step is a button when someone listens and it is not the step the user is on. */
|
|
23
|
+
export declare function stepSelectable(status: KjunStepStatus, selectable?: KjunStepsSelectable): boolean;
|
|
24
|
+
type StepMessages = Pick<KjunMessages, "stepComplete" | "stepCurrent" | "stepError" | "stepUpcoming" | "stepPosition" | "stepCount">;
|
|
25
|
+
/** Vertical rows show meta and description under the label; the horizontal row shows the label alone. */
|
|
26
|
+
export declare function stepDetail(item: KjunStepItem, vertical: boolean): string;
|
|
27
|
+
/** One phrase names the step for a screen reader: a button carries it as its name, static copy as hidden text. */
|
|
28
|
+
export declare function stepSpoken(m: StepMessages, index: number, item: KjunStepItem, status: KjunStepStatus, detail: string): string;
|
|
29
|
+
/** The compact heading row: the current step (the last one once every step is complete), the step after it, and "n / N"
|
|
30
|
+
* split so the position can be drawn bold (lead is "" when a locale's count does not start with it). */
|
|
31
|
+
export declare function stepsHead<T extends KjunStepItem>(m: StepMessages, items: readonly T[], at: number): {
|
|
32
|
+
item: T | undefined;
|
|
33
|
+
next: T | undefined;
|
|
34
|
+
lead: string;
|
|
35
|
+
rest: string;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { KjunMessages } from "./messages/index.js";
|
|
2
|
+
export type KjunStepStatus = "complete" | "current" | "error" | "upcoming";
|
|
3
|
+
export type KjunStepsCurrentStatus = "active" | "error";
|
|
4
|
+
export type KjunStepsLayout = "auto" | "full" | "compact";
|
|
5
|
+
/** Which steps onStepSelect makes buttons: completed ones (default), or every step but the current one (a wizard that may skip ahead). */
|
|
6
|
+
export type KjunStepsSelectable = "complete" | "all";
|
|
7
|
+
export interface KjunStepItem {
|
|
8
|
+
key?: string | number;
|
|
9
|
+
label: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
meta?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Narrowest column a step gets in the wide layout; mirrors `extensions.steps.minColumn`. */
|
|
14
|
+
export declare const STEPS_MIN_COLUMN = 80;
|
|
15
|
+
/** More steps than this always fold to compact. */
|
|
16
|
+
export declare const STEPS_AUTO_MAX = 10;
|
|
17
|
+
/** `current` counts finished steps: floored and kept within 0..count (count means all complete). */
|
|
18
|
+
export declare function clampCurrent(current: number, count: number): number;
|
|
19
|
+
export declare function stepStatus(index: number, current: number, currentStatus: KjunStepsCurrentStatus): KjunStepStatus;
|
|
20
|
+
export declare function stepsRootStatus(current: number, count: number, currentStatus: KjunStepsCurrentStatus): "current" | "error" | "complete";
|
|
21
|
+
export declare function stepsLayout(width: number, count: number): "full" | "compact";
|
|
22
|
+
/** A step is a button when someone listens and it is not the step the user is on. */
|
|
23
|
+
export declare function stepSelectable(status: KjunStepStatus, selectable?: KjunStepsSelectable): boolean;
|
|
24
|
+
type StepMessages = Pick<KjunMessages, "stepComplete" | "stepCurrent" | "stepError" | "stepUpcoming" | "stepPosition" | "stepCount">;
|
|
25
|
+
/** Vertical rows show meta and description under the label; the horizontal row shows the label alone. */
|
|
26
|
+
export declare function stepDetail(item: KjunStepItem, vertical: boolean): string;
|
|
27
|
+
/** One phrase names the step for a screen reader: a button carries it as its name, static copy as hidden text. */
|
|
28
|
+
export declare function stepSpoken(m: StepMessages, index: number, item: KjunStepItem, status: KjunStepStatus, detail: string): string;
|
|
29
|
+
/** The compact heading row: the current step (the last one once every step is complete), the step after it, and "n / N"
|
|
30
|
+
* split so the position can be drawn bold (lead is "" when a locale's count does not start with it). */
|
|
31
|
+
export declare function stepsHead<T extends KjunStepItem>(m: StepMessages, items: readonly T[], at: number): {
|
|
32
|
+
item: T | undefined;
|
|
33
|
+
next: T | undefined;
|
|
34
|
+
lead: string;
|
|
35
|
+
rest: string;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export declare function manageTabList(list: HTMLElement, select: (name: string) => void, keyboard?: boolean): () => void;
|
|
2
2
|
export declare function panelNeedsFocus(panel: HTMLElement): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Scrolls the tab track just enough to show a tab clear of the edge fade (pad pixels). Only the track moves: unlike
|
|
5
|
+
* scrollIntoView this never scrolls the page, so a selected tab revealed on the first render keeps the reader's place.
|
|
6
|
+
* The rectangles work in both reading directions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function revealTab(track: HTMLElement, tab: HTMLElement, pad: number, smooth: boolean): void;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export declare function manageTabList(list: HTMLElement, select: (name: string) => void, keyboard?: boolean): () => void;
|
|
2
2
|
export declare function panelNeedsFocus(panel: HTMLElement): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Scrolls the tab track just enough to show a tab clear of the edge fade (pad pixels). Only the track moves: unlike
|
|
5
|
+
* scrollIntoView this never scrolls the page, so a selected tab revealed on the first render keeps the reader's place.
|
|
6
|
+
* The rectangles work in both reading directions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function revealTab(track: HTMLElement, tab: HTMLElement, pad: number, smooth: boolean): void;
|
|
@@ -26,3 +26,11 @@ export declare function tableHeaderRows<Column extends {
|
|
|
26
26
|
* row's end), 0 marks a column a previous cell covers. A span that is not a whole number above one counts as 1.
|
|
27
27
|
*/
|
|
28
28
|
export declare function tableSpans<Column>(columns: readonly Column[], span?: ((column: Column) => number | null | undefined) | null): number[];
|
|
29
|
+
/** A column width given as a share of the table ("30%"), as a fraction; null for any other width. */
|
|
30
|
+
export declare function tablePercentWidth(width: number | string | null | undefined): number | null;
|
|
31
|
+
/**
|
|
32
|
+
* A column's width in px where the platform lays columns out itself (Native): a number or "120px" as given, a
|
|
33
|
+
* percent as that share of the table's own width, like a 100%-wide table on Web, and the fallback for anything else.
|
|
34
|
+
* Until the table has been measured (`viewport` 0) a percent column takes the fallback too.
|
|
35
|
+
*/
|
|
36
|
+
export declare function tableColumnWidth(width: number | string | null | undefined, viewport: number, fallback: number): number;
|
|
@@ -26,3 +26,11 @@ export declare function tableHeaderRows<Column extends {
|
|
|
26
26
|
* row's end), 0 marks a column a previous cell covers. A span that is not a whole number above one counts as 1.
|
|
27
27
|
*/
|
|
28
28
|
export declare function tableSpans<Column>(columns: readonly Column[], span?: ((column: Column) => number | null | undefined) | null): number[];
|
|
29
|
+
/** A column width given as a share of the table ("30%"), as a fraction; null for any other width. */
|
|
30
|
+
export declare function tablePercentWidth(width: number | string | null | undefined): number | null;
|
|
31
|
+
/**
|
|
32
|
+
* A column's width in px where the platform lays columns out itself (Native): a number or "120px" as given, a
|
|
33
|
+
* percent as that share of the table's own width, like a 100%-wide table on Web, and the fallback for anything else.
|
|
34
|
+
* Until the table has been measured (`viewport` 0) a percent column takes the fallback too.
|
|
35
|
+
*/
|
|
36
|
+
export declare function tableColumnWidth(width: number | string | null | undefined, viewport: number, fallback: number): number;
|
|
@@ -16,22 +16,42 @@ export declare function sortTableRows<Row extends object>(data: readonly Row[],
|
|
|
16
16
|
export declare const tableRowKey: (row: object, rowKey: string, index?: number) => string | number;
|
|
17
17
|
/** What tells rows apart for selection: the rowKey value, or the row object itself when it has none. */
|
|
18
18
|
export declare const tableRowIdentity: (row: object, rowKey: string) => unknown;
|
|
19
|
-
|
|
19
|
+
/** Rows the app lets the user select (rowSelectable); without the rule every row can be. */
|
|
20
|
+
export type TableRowSelectable<Row extends object> = ((row: Row) => boolean) | undefined;
|
|
21
|
+
/** all and some count only the rows that can be selected, so a locked row never keeps the header box from filling. */
|
|
22
|
+
export declare function tableSelection<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string, selectable?: TableRowSelectable<Row>): {
|
|
20
23
|
isSelected: (row: Row) => boolean;
|
|
24
|
+
isSelectable: (row: Row) => boolean;
|
|
21
25
|
all: boolean;
|
|
22
26
|
some: boolean;
|
|
27
|
+
selectableCount: number;
|
|
23
28
|
};
|
|
24
29
|
export declare const toggleSelectedRow: <Row extends object>(selected: readonly Row[], row: Row, rowKey: string) => Row[];
|
|
25
30
|
/**
|
|
26
31
|
* The header checkbox: with every shown row selected it clears just those rows, otherwise it adds the shown rows
|
|
27
|
-
* that are missing. Rows selected on other pages or outside the current search stay selected
|
|
32
|
+
* that are missing. Rows selected on other pages or outside the current search stay selected, and a row that cannot
|
|
33
|
+
* be selected is neither added nor removed.
|
|
28
34
|
*/
|
|
29
|
-
export declare function toggleAllRows<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string, all: boolean): Row[];
|
|
35
|
+
export declare function toggleAllRows<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string, all: boolean, selectable?: TableRowSelectable<Row>): Row[];
|
|
36
|
+
/**
|
|
37
|
+
* searchMode="client": the rows whose searched fields contain the query, ignoring case. Fields are searchKeys, or every
|
|
38
|
+
* column's key; a blank query keeps every row.
|
|
39
|
+
*/
|
|
40
|
+
export declare function filterTableRows<Row extends object>(rows: readonly Row[], query: string, keys: readonly string[], locale?: string): readonly Row[];
|
|
30
41
|
/** Each row's position in the sorted rows, so grouped bodies need not search for it. */
|
|
31
42
|
export declare const tableRowIndex: <Row extends object>(rows: readonly Row[]) => (row: Row) => number;
|
|
32
43
|
export declare const toggleExpandedRow: (expanded: readonly (string | number)[], id: string | number, single: boolean) => (string | number)[];
|
|
33
44
|
/** A row's name for its checkbox: the title column's text ("행 선택 한빛테크"), or its position when that is not text. */
|
|
34
45
|
export declare function tableRowLabel(row: object, titleKey: string | undefined, index: number): string | number;
|
|
46
|
+
/** The column that names a row: the card title, or the first column. */
|
|
47
|
+
export declare const tableTitleKey: (props: {
|
|
48
|
+
cardTitle?: string | null;
|
|
49
|
+
columns: readonly {
|
|
50
|
+
key: string;
|
|
51
|
+
}[];
|
|
52
|
+
}) => string;
|
|
53
|
+
/** A group's drawn name without renderGroupLabel: its value, or "-" for an empty one. */
|
|
54
|
+
export declare const tableGroupText: (value: unknown) => string;
|
|
35
55
|
/** The scroller a page-level sticky header sticks under: the nearest scrolling ancestor, or the viewport (null). */
|
|
36
56
|
export declare function stickyScroller(element: Element | null): Element | null;
|
|
37
57
|
/** Whether rows have scrolled under a page-level sticky header, measured against its own scroller. */
|
|
@@ -16,22 +16,42 @@ export declare function sortTableRows<Row extends object>(data: readonly Row[],
|
|
|
16
16
|
export declare const tableRowKey: (row: object, rowKey: string, index?: number) => string | number;
|
|
17
17
|
/** What tells rows apart for selection: the rowKey value, or the row object itself when it has none. */
|
|
18
18
|
export declare const tableRowIdentity: (row: object, rowKey: string) => unknown;
|
|
19
|
-
|
|
19
|
+
/** Rows the app lets the user select (rowSelectable); without the rule every row can be. */
|
|
20
|
+
export type TableRowSelectable<Row extends object> = ((row: Row) => boolean) | undefined;
|
|
21
|
+
/** all and some count only the rows that can be selected, so a locked row never keeps the header box from filling. */
|
|
22
|
+
export declare function tableSelection<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string, selectable?: TableRowSelectable<Row>): {
|
|
20
23
|
isSelected: (row: Row) => boolean;
|
|
24
|
+
isSelectable: (row: Row) => boolean;
|
|
21
25
|
all: boolean;
|
|
22
26
|
some: boolean;
|
|
27
|
+
selectableCount: number;
|
|
23
28
|
};
|
|
24
29
|
export declare const toggleSelectedRow: <Row extends object>(selected: readonly Row[], row: Row, rowKey: string) => Row[];
|
|
25
30
|
/**
|
|
26
31
|
* The header checkbox: with every shown row selected it clears just those rows, otherwise it adds the shown rows
|
|
27
|
-
* that are missing. Rows selected on other pages or outside the current search stay selected
|
|
32
|
+
* that are missing. Rows selected on other pages or outside the current search stay selected, and a row that cannot
|
|
33
|
+
* be selected is neither added nor removed.
|
|
28
34
|
*/
|
|
29
|
-
export declare function toggleAllRows<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string, all: boolean): Row[];
|
|
35
|
+
export declare function toggleAllRows<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string, all: boolean, selectable?: TableRowSelectable<Row>): Row[];
|
|
36
|
+
/**
|
|
37
|
+
* searchMode="client": the rows whose searched fields contain the query, ignoring case. Fields are searchKeys, or every
|
|
38
|
+
* column's key; a blank query keeps every row.
|
|
39
|
+
*/
|
|
40
|
+
export declare function filterTableRows<Row extends object>(rows: readonly Row[], query: string, keys: readonly string[], locale?: string): readonly Row[];
|
|
30
41
|
/** Each row's position in the sorted rows, so grouped bodies need not search for it. */
|
|
31
42
|
export declare const tableRowIndex: <Row extends object>(rows: readonly Row[]) => (row: Row) => number;
|
|
32
43
|
export declare const toggleExpandedRow: (expanded: readonly (string | number)[], id: string | number, single: boolean) => (string | number)[];
|
|
33
44
|
/** A row's name for its checkbox: the title column's text ("행 선택 한빛테크"), or its position when that is not text. */
|
|
34
45
|
export declare function tableRowLabel(row: object, titleKey: string | undefined, index: number): string | number;
|
|
46
|
+
/** The column that names a row: the card title, or the first column. */
|
|
47
|
+
export declare const tableTitleKey: (props: {
|
|
48
|
+
cardTitle?: string | null;
|
|
49
|
+
columns: readonly {
|
|
50
|
+
key: string;
|
|
51
|
+
}[];
|
|
52
|
+
}) => string;
|
|
53
|
+
/** A group's drawn name without renderGroupLabel: its value, or "-" for an empty one. */
|
|
54
|
+
export declare const tableGroupText: (value: unknown) => string;
|
|
35
55
|
/** The scroller a page-level sticky header sticks under: the nearest scrolling ancestor, or the viewport (null). */
|
|
36
56
|
export declare function stickyScroller(element: Element | null): Element | null;
|
|
37
57
|
/** Whether rows have scrolled under a page-level sticky header, measured against its own scroller. */
|
|
@@ -83,7 +83,7 @@ export interface TableRowsProps<Row extends object> {
|
|
|
83
83
|
skeletonRows: number;
|
|
84
84
|
/** A loadingDelay is still running: the skeleton keeps its space but stays out of sight. */
|
|
85
85
|
skeletonHidden?: boolean;
|
|
86
|
-
state: Pick<ReturnType<typeof useTableModel<Row>>, "rows" | "rowIndex" | "key" | "expanded" | "selectedRow">;
|
|
86
|
+
state: Pick<ReturnType<typeof useTableModel<Row>>, "rows" | "rowIndex" | "key" | "expanded" | "selectedRow" | "selectableRow">;
|
|
87
87
|
onRowClick: TableProps<Row>["onRowClick"];
|
|
88
88
|
selectable: boolean;
|
|
89
89
|
expandable: boolean;
|
|
@@ -105,15 +105,23 @@ export interface TableCardsProps<Row extends object> extends TableRowsProps<Row>
|
|
|
105
105
|
toggleGroup?: (key: string) => void;
|
|
106
106
|
groupLabel?: (group: TableRowGroup<Row>) => ReactNode;
|
|
107
107
|
groupTotals?: (rows: Row[]) => TableTotal[];
|
|
108
|
+
/** Native: the list's name (the web layouts take it with TableViewParts). */
|
|
109
|
+
ariaLabel?: string;
|
|
108
110
|
/** The cell's plain text, for a value read out with its label where the label is not drawn (tile highlight on Native). */
|
|
109
111
|
cellText?: (column: TableColumn<Row>, row: Row, index: number) => string | undefined;
|
|
110
112
|
}
|
|
113
|
+
/** The view's own parts that every layout takes: its name, a row's custom class and the row key handler. */
|
|
114
|
+
export interface TableViewParts<Row extends object, KeyEvent> {
|
|
115
|
+
ariaLabel: string;
|
|
116
|
+
customClass: (row: Row, index: number) => string;
|
|
117
|
+
rowKeyDown: (event: KeyEvent, row: Row, index: number) => void;
|
|
118
|
+
}
|
|
111
119
|
export interface TableGridProps<Row extends object, Height> extends TableRowsProps<Row>, TableGroupingProps<Row> {
|
|
112
120
|
/** Labels over runs of columns (TableProps.columnGroups). */
|
|
113
121
|
columnGroups?: TableProps<Row>["columnGroups"];
|
|
114
122
|
/** How many columns a row's cell covers (TableProps.cellSpan). */
|
|
115
123
|
cellSpan?: TableProps<Row>["cellSpan"];
|
|
116
|
-
state: TableRowsProps<Row>["state"] & Pick<ReturnType<typeof useTableModel<Row>>, "all" | "some" | "toggleAll" | "sort" | "sortColumn">;
|
|
124
|
+
state: TableRowsProps<Row>["state"] & Pick<ReturnType<typeof useTableModel<Row>>, "all" | "some" | "selectableCount" | "toggleAll" | "sort" | "sortColumn">;
|
|
117
125
|
visible: TableColumn<Row>[];
|
|
118
126
|
maxHeight?: Height;
|
|
119
127
|
stickyHeader: boolean;
|
|
@@ -122,6 +130,7 @@ export interface TableGridProps<Row extends object, Height> extends TableRowsPro
|
|
|
122
130
|
compact: boolean;
|
|
123
131
|
striped: boolean;
|
|
124
132
|
hoverable: boolean;
|
|
133
|
+
edgeInset?: "default" | "none";
|
|
125
134
|
}
|
|
126
135
|
export interface TableToolbarProps<Row extends object> {
|
|
127
136
|
selectable: boolean;
|
|
@@ -83,7 +83,7 @@ export interface TableRowsProps<Row extends object> {
|
|
|
83
83
|
skeletonRows: number;
|
|
84
84
|
/** A loadingDelay is still running: the skeleton keeps its space but stays out of sight. */
|
|
85
85
|
skeletonHidden?: boolean;
|
|
86
|
-
state: Pick<ReturnType<typeof useTableModel<Row>>, "rows" | "rowIndex" | "key" | "expanded" | "selectedRow">;
|
|
86
|
+
state: Pick<ReturnType<typeof useTableModel<Row>>, "rows" | "rowIndex" | "key" | "expanded" | "selectedRow" | "selectableRow">;
|
|
87
87
|
onRowClick: TableProps<Row>["onRowClick"];
|
|
88
88
|
selectable: boolean;
|
|
89
89
|
expandable: boolean;
|
|
@@ -105,15 +105,23 @@ export interface TableCardsProps<Row extends object> extends TableRowsProps<Row>
|
|
|
105
105
|
toggleGroup?: (key: string) => void;
|
|
106
106
|
groupLabel?: (group: TableRowGroup<Row>) => ReactNode;
|
|
107
107
|
groupTotals?: (rows: Row[]) => TableTotal[];
|
|
108
|
+
/** Native: the list's name (the web layouts take it with TableViewParts). */
|
|
109
|
+
ariaLabel?: string;
|
|
108
110
|
/** The cell's plain text, for a value read out with its label where the label is not drawn (tile highlight on Native). */
|
|
109
111
|
cellText?: (column: TableColumn<Row>, row: Row, index: number) => string | undefined;
|
|
110
112
|
}
|
|
113
|
+
/** The view's own parts that every layout takes: its name, a row's custom class and the row key handler. */
|
|
114
|
+
export interface TableViewParts<Row extends object, KeyEvent> {
|
|
115
|
+
ariaLabel: string;
|
|
116
|
+
customClass: (row: Row, index: number) => string;
|
|
117
|
+
rowKeyDown: (event: KeyEvent, row: Row, index: number) => void;
|
|
118
|
+
}
|
|
111
119
|
export interface TableGridProps<Row extends object, Height> extends TableRowsProps<Row>, TableGroupingProps<Row> {
|
|
112
120
|
/** Labels over runs of columns (TableProps.columnGroups). */
|
|
113
121
|
columnGroups?: TableProps<Row>["columnGroups"];
|
|
114
122
|
/** How many columns a row's cell covers (TableProps.cellSpan). */
|
|
115
123
|
cellSpan?: TableProps<Row>["cellSpan"];
|
|
116
|
-
state: TableRowsProps<Row>["state"] & Pick<ReturnType<typeof useTableModel<Row>>, "all" | "some" | "toggleAll" | "sort" | "sortColumn">;
|
|
124
|
+
state: TableRowsProps<Row>["state"] & Pick<ReturnType<typeof useTableModel<Row>>, "all" | "some" | "selectableCount" | "toggleAll" | "sort" | "sortColumn">;
|
|
117
125
|
visible: TableColumn<Row>[];
|
|
118
126
|
maxHeight?: Height;
|
|
119
127
|
stickyHeader: boolean;
|
|
@@ -122,6 +130,7 @@ export interface TableGridProps<Row extends object, Height> extends TableRowsPro
|
|
|
122
130
|
compact: boolean;
|
|
123
131
|
striped: boolean;
|
|
124
132
|
hoverable: boolean;
|
|
133
|
+
edgeInset?: "default" | "none";
|
|
125
134
|
}
|
|
126
135
|
export interface TableToolbarProps<Row extends object> {
|
|
127
136
|
selectable: boolean;
|
|
@@ -84,6 +84,10 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
84
84
|
hoverable?: boolean;
|
|
85
85
|
searchable?: boolean;
|
|
86
86
|
searchPlaceholder?: string;
|
|
87
|
+
/** "client" filters data by the search box itself (searchKeys, or every column); "server" (default) only reports the query through onSearch. */
|
|
88
|
+
searchMode?: "client" | "server";
|
|
89
|
+
/** Row fields (dot paths) a client search looks in. Default: every column's key. */
|
|
90
|
+
searchKeys?: string[];
|
|
87
91
|
stickyHeader?: boolean;
|
|
88
92
|
/** Without maxHeight a sticky header sticks under the page scroll; this is its distance from the viewport top (px). */
|
|
89
93
|
stickyOffset?: number;
|
|
@@ -91,6 +95,8 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
91
95
|
pagination?: TablePagination | null;
|
|
92
96
|
compact?: boolean;
|
|
93
97
|
striped?: boolean;
|
|
98
|
+
/** "none" drops the first column's start padding and the last column's end padding in the grid, so the table lines up with text around it. For tables without row fills. */
|
|
99
|
+
edgeInset?: "default" | "none";
|
|
94
100
|
ariaLabel?: string;
|
|
95
101
|
responsive?: "card" | "list" | "compact" | "none" | null;
|
|
96
102
|
mobileColumns?: string[];
|
|
@@ -106,7 +112,10 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
106
112
|
expandSingle?: boolean;
|
|
107
113
|
rowClass?: string | ((row: Row, index: number) => string);
|
|
108
114
|
selectable?: boolean;
|
|
115
|
+
/** The selected rows. Leave unset for internal selection; onSelectionChange still reports each change. */
|
|
109
116
|
selected?: Row[];
|
|
117
|
+
/** Rows that can be selected: the others keep a disabled checkbox and are skipped by select all. Row clicks and expansion stay. */
|
|
118
|
+
rowSelectable?: (row: Row) => boolean;
|
|
110
119
|
/** Row field (dot path) whose values split the rows into collapsible groups. */
|
|
111
120
|
groupBy?: string;
|
|
112
121
|
/** Original groupBy values of open groups. undefined: internal state, initially all open; []: all closed. */
|
|
@@ -141,15 +150,19 @@ export declare function useTableModel<Row extends object>(props: TableProps<Row,
|
|
|
141
150
|
key: (row: Row, index?: number) => string | number;
|
|
142
151
|
sort: TableSort;
|
|
143
152
|
search: string;
|
|
153
|
+
selected: Row[];
|
|
144
154
|
all: boolean;
|
|
145
155
|
some: boolean;
|
|
156
|
+
selectableCount: number;
|
|
146
157
|
selectedRow: (row: Row) => boolean;
|
|
158
|
+
selectableRow: (row: Row) => boolean;
|
|
147
159
|
expanded: (string | number)[];
|
|
148
160
|
searchChange: (q: string) => void;
|
|
149
161
|
sortColumn: (col: TableColumn<Row>) => void;
|
|
150
162
|
/** The narrow-screen sort choice: an exact key and order, or { key: "" } for the data's own order. */
|
|
151
163
|
sortTo: (next: TableSort) => void;
|
|
152
|
-
toggleRow: (row: Row) => void
|
|
153
|
-
toggleAll: () => void
|
|
164
|
+
toggleRow: (row: Row) => void;
|
|
165
|
+
toggleAll: () => void;
|
|
166
|
+
clearSelection: () => void;
|
|
154
167
|
toggleExpand: (row: Row, index: number) => void;
|
|
155
168
|
};
|
|
@@ -84,6 +84,10 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
84
84
|
hoverable?: boolean;
|
|
85
85
|
searchable?: boolean;
|
|
86
86
|
searchPlaceholder?: string;
|
|
87
|
+
/** "client" filters data by the search box itself (searchKeys, or every column); "server" (default) only reports the query through onSearch. */
|
|
88
|
+
searchMode?: "client" | "server";
|
|
89
|
+
/** Row fields (dot paths) a client search looks in. Default: every column's key. */
|
|
90
|
+
searchKeys?: string[];
|
|
87
91
|
stickyHeader?: boolean;
|
|
88
92
|
/** Without maxHeight a sticky header sticks under the page scroll; this is its distance from the viewport top (px). */
|
|
89
93
|
stickyOffset?: number;
|
|
@@ -91,6 +95,8 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
91
95
|
pagination?: TablePagination | null;
|
|
92
96
|
compact?: boolean;
|
|
93
97
|
striped?: boolean;
|
|
98
|
+
/** "none" drops the first column's start padding and the last column's end padding in the grid, so the table lines up with text around it. For tables without row fills. */
|
|
99
|
+
edgeInset?: "default" | "none";
|
|
94
100
|
ariaLabel?: string;
|
|
95
101
|
responsive?: "card" | "list" | "compact" | "none" | null;
|
|
96
102
|
mobileColumns?: string[];
|
|
@@ -106,7 +112,10 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
|
|
|
106
112
|
expandSingle?: boolean;
|
|
107
113
|
rowClass?: string | ((row: Row, index: number) => string);
|
|
108
114
|
selectable?: boolean;
|
|
115
|
+
/** The selected rows. Leave unset for internal selection; onSelectionChange still reports each change. */
|
|
109
116
|
selected?: Row[];
|
|
117
|
+
/** Rows that can be selected: the others keep a disabled checkbox and are skipped by select all. Row clicks and expansion stay. */
|
|
118
|
+
rowSelectable?: (row: Row) => boolean;
|
|
110
119
|
/** Row field (dot path) whose values split the rows into collapsible groups. */
|
|
111
120
|
groupBy?: string;
|
|
112
121
|
/** Original groupBy values of open groups. undefined: internal state, initially all open; []: all closed. */
|
|
@@ -141,15 +150,19 @@ export declare function useTableModel<Row extends object>(props: TableProps<Row,
|
|
|
141
150
|
key: (row: Row, index?: number) => string | number;
|
|
142
151
|
sort: TableSort;
|
|
143
152
|
search: string;
|
|
153
|
+
selected: Row[];
|
|
144
154
|
all: boolean;
|
|
145
155
|
some: boolean;
|
|
156
|
+
selectableCount: number;
|
|
146
157
|
selectedRow: (row: Row) => boolean;
|
|
158
|
+
selectableRow: (row: Row) => boolean;
|
|
147
159
|
expanded: (string | number)[];
|
|
148
160
|
searchChange: (q: string) => void;
|
|
149
161
|
sortColumn: (col: TableColumn<Row>) => void;
|
|
150
162
|
/** The narrow-screen sort choice: an exact key and order, or { key: "" } for the data's own order. */
|
|
151
163
|
sortTo: (next: TableSort) => void;
|
|
152
|
-
toggleRow: (row: Row) => void
|
|
153
|
-
toggleAll: () => void
|
|
164
|
+
toggleRow: (row: Row) => void;
|
|
165
|
+
toggleAll: () => void;
|
|
166
|
+
clearSelection: () => void;
|
|
154
167
|
toggleExpand: (row: Row, index: number) => void;
|
|
155
168
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type InputSize } from "@kjun-ui/tokens";
|
|
2
2
|
export declare const textareaMaxRows = 6;
|
|
3
|
+
/** A number of rows, or "none" for a field that grows with all of its text and never scrolls inside (a note, a document body). */
|
|
4
|
+
export type TextareaMaxRows = number | "none";
|
|
3
5
|
/** Border-box height for a number of text rows at a field size. */
|
|
4
6
|
export declare function textareaRowsHeight(size: InputSize, rows: number, footer?: boolean): number;
|
|
5
|
-
/** The [minimum, maximum] border-box height; a maximum below the minimum keeps the field at `rows
|
|
6
|
-
export declare function textareaBounds(size: InputSize, rows: number, maxRows:
|
|
7
|
+
/** The [minimum, maximum] border-box height; a maximum below the minimum keeps the field at `rows`, and "none" has no maximum (Infinity). */
|
|
8
|
+
export declare function textareaBounds(size: InputSize, rows: number, maxRows: TextareaMaxRows, footer?: boolean): readonly [
|
|
7
9
|
number,
|
|
8
10
|
number
|
|
9
11
|
];
|
|
@@ -17,9 +19,9 @@ export type TextareaResize = "none" | "vertical" | "horizontal" | "both";
|
|
|
17
19
|
/** A field the user can drag taller keeps the height they chose, so it does not also grow with its text. */
|
|
18
20
|
export declare const textareaGrows: (minimum: number, maximum: number, resize?: TextareaResize) => boolean;
|
|
19
21
|
/** The text inset: with a footer the wrapper carries the border, so the text keeps the field's own inset. */
|
|
20
|
-
export declare function textareaPadding(size: InputSize, footer: boolean): {
|
|
22
|
+
export declare function textareaPadding(size: InputSize, footer: boolean, plain?: boolean): {
|
|
21
23
|
top: 16 | 12 | 8;
|
|
22
|
-
x:
|
|
24
|
+
x: number;
|
|
23
25
|
bottom: 4;
|
|
24
26
|
} | {
|
|
25
27
|
top: 16 | 12 | 8;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type InputSize } from "@kjun-ui/tokens";
|
|
2
2
|
export declare const textareaMaxRows = 6;
|
|
3
|
+
/** A number of rows, or "none" for a field that grows with all of its text and never scrolls inside (a note, a document body). */
|
|
4
|
+
export type TextareaMaxRows = number | "none";
|
|
3
5
|
/** Border-box height for a number of text rows at a field size. */
|
|
4
6
|
export declare function textareaRowsHeight(size: InputSize, rows: number, footer?: boolean): number;
|
|
5
|
-
/** The [minimum, maximum] border-box height; a maximum below the minimum keeps the field at `rows
|
|
6
|
-
export declare function textareaBounds(size: InputSize, rows: number, maxRows:
|
|
7
|
+
/** The [minimum, maximum] border-box height; a maximum below the minimum keeps the field at `rows`, and "none" has no maximum (Infinity). */
|
|
8
|
+
export declare function textareaBounds(size: InputSize, rows: number, maxRows: TextareaMaxRows, footer?: boolean): readonly [
|
|
7
9
|
number,
|
|
8
10
|
number
|
|
9
11
|
];
|
|
@@ -17,9 +19,9 @@ export type TextareaResize = "none" | "vertical" | "horizontal" | "both";
|
|
|
17
19
|
/** A field the user can drag taller keeps the height they chose, so it does not also grow with its text. */
|
|
18
20
|
export declare const textareaGrows: (minimum: number, maximum: number, resize?: TextareaResize) => boolean;
|
|
19
21
|
/** The text inset: with a footer the wrapper carries the border, so the text keeps the field's own inset. */
|
|
20
|
-
export declare function textareaPadding(size: InputSize, footer: boolean): {
|
|
22
|
+
export declare function textareaPadding(size: InputSize, footer: boolean, plain?: boolean): {
|
|
21
23
|
top: 16 | 12 | 8;
|
|
22
|
-
x:
|
|
24
|
+
x: number;
|
|
23
25
|
bottom: 4;
|
|
24
26
|
} | {
|
|
25
27
|
top: 16 | 12 | 8;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** The cells: every child, fragments opened, with nothing for false, null and blank strings. Keys keep the
|
|
3
|
+
* fragment path so a child inside a fragment never shares a key with one outside it. */
|
|
4
|
+
export declare function tileItems(children: ReactNode, path?: string): [
|
|
5
|
+
string,
|
|
6
|
+
ReactNode
|
|
7
|
+
][];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** The cells: every child, fragments opened, with nothing for false, null and blank strings. Keys keep the
|
|
3
|
+
* fragment path so a child inside a fragment never shares a key with one outside it. */
|
|
4
|
+
export declare function tileItems(children: ReactNode, path?: string): [
|
|
5
|
+
string,
|
|
6
|
+
ReactNode
|
|
7
|
+
][];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** auto is compact in a container narrower than the breakpoint (tokens.responsive.tilesGap) and regular from it. */
|
|
2
|
+
export type TilesGap = "auto" | "compact" | "regular";
|
|
3
|
+
/** A cell's narrowest width before a column is dropped: tokens.extensions.tiles.minItem. */
|
|
4
|
+
export type TilesMinItem = "sm" | "md" | "lg";
|
|
5
|
+
export type TilesMaxColumns = 2 | 3 | 4;
|
|
6
|
+
/** The gap step that applies at a container width. */
|
|
7
|
+
export declare const tilesGapStep: (gap: TilesGap, width: number, breakpoint: number) => "compact" | "regular";
|
|
8
|
+
/** As many columns as keep each cell at least minItem wide, between one and maxColumns. Unmeasured widths get one. */
|
|
9
|
+
export declare function tilesColumns(width: number, minItem: number, gap: number, maxColumns: number): number;
|
|
10
|
+
/** Each cell's share of the width after the gaps, like a grid track; undefined until the container has a width. */
|
|
11
|
+
export declare const tilesCellWidth: (width: number, columns: number, gap: number) => number | undefined;
|
|
12
|
+
/** The props with their defaults; a maxColumns outside 2·3·4 falls back to 4. A Vue template's max-columns="3"
|
|
13
|
+
* arrives as the string "3" and counts as 3. */
|
|
14
|
+
export declare const tilesProps: (gap?: TilesGap, minItem?: TilesMinItem, maxColumns?: number | string) => {
|
|
15
|
+
gap: TilesGap;
|
|
16
|
+
minItem: TilesMinItem;
|
|
17
|
+
maxColumns: TilesMaxColumns;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** auto is compact in a container narrower than the breakpoint (tokens.responsive.tilesGap) and regular from it. */
|
|
2
|
+
export type TilesGap = "auto" | "compact" | "regular";
|
|
3
|
+
/** A cell's narrowest width before a column is dropped: tokens.extensions.tiles.minItem. */
|
|
4
|
+
export type TilesMinItem = "sm" | "md" | "lg";
|
|
5
|
+
export type TilesMaxColumns = 2 | 3 | 4;
|
|
6
|
+
/** The gap step that applies at a container width. */
|
|
7
|
+
export declare const tilesGapStep: (gap: TilesGap, width: number, breakpoint: number) => "compact" | "regular";
|
|
8
|
+
/** As many columns as keep each cell at least minItem wide, between one and maxColumns. Unmeasured widths get one. */
|
|
9
|
+
export declare function tilesColumns(width: number, minItem: number, gap: number, maxColumns: number): number;
|
|
10
|
+
/** Each cell's share of the width after the gaps, like a grid track; undefined until the container has a width. */
|
|
11
|
+
export declare const tilesCellWidth: (width: number, columns: number, gap: number) => number | undefined;
|
|
12
|
+
/** The props with their defaults; a maxColumns outside 2·3·4 falls back to 4. A Vue template's max-columns="3"
|
|
13
|
+
* arrives as the string "3" and counts as 3. */
|
|
14
|
+
export declare const tilesProps: (gap?: TilesGap, minItem?: TilesMinItem, maxColumns?: number | string) => {
|
|
15
|
+
gap: TilesGap;
|
|
16
|
+
minItem: TilesMinItem;
|
|
17
|
+
maxColumns: TilesMaxColumns;
|
|
18
|
+
};
|