ropav 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/autocomplete/autocomplete-root.js +3 -1
- package/dist/components/autocomplete/index.d.ts +3 -0
- package/dist/components/breadcrumbs/breadcrumbs-item.js +1 -0
- package/dist/components/breadcrumbs/index.d.ts +1 -0
- package/dist/components/calendar/index.d.ts +5 -3
- package/dist/components/calendar-year-picker/index.d.ts +4 -2
- package/dist/components/checkbox/checkbox-content.js +1 -1
- package/dist/components/color-field/index.d.ts +1 -0
- package/dist/components/color-input-group/color-input-group-root.js +2 -0
- package/dist/components/color-input-group/color-input-group.types.d.ts +2 -0
- package/dist/components/color-input-group/index.d.ts +2 -0
- package/dist/components/combo-box/combo-box-root.js +9 -2
- package/dist/components/combo-box/combo-box.types.d.ts +3 -0
- package/dist/components/combo-box/index.d.ts +3 -0
- package/dist/components/date-field/index.d.ts +1 -0
- package/dist/components/date-input-group/date-input-group-root.js +2 -0
- package/dist/components/date-input-group/date-input-group-segment.js +1 -1
- package/dist/components/date-input-group/date-input-group.types.d.ts +2 -0
- package/dist/{composables → components/date-input-group}/use-date-segment.d.ts +2 -2
- package/dist/{composables → components/date-input-group}/use-date-segment.js +9 -9
- package/dist/components/date-range-picker/date-range-picker-root.js +1 -1
- package/dist/components/date-range-picker/index.d.ts +15 -14
- package/dist/{composables → components/date-range-picker}/use-date-range-picker.d.ts +7 -7
- package/dist/{composables → components/date-range-picker}/use-date-range-picker.js +10 -10
- package/dist/components/drawer/drawer-dialog.js +1 -1
- package/dist/{composables → components/drawer}/use-drawer-drag.d.ts +1 -1
- package/dist/{composables → components/drawer}/use-drawer-drag.js +1 -1
- package/dist/components/dropdown/dropdown-menu.js +1 -0
- package/dist/components/dropdown/dropdown-submenu-trigger.js +1 -1
- package/dist/components/dropdown/index.d.ts +4 -2
- package/dist/{composables → components/dropdown}/use-safely-mouse-to-submenu.js +1 -1
- package/dist/components/icons/icon-overlay-arrow.js +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input-root.js +3 -0
- package/dist/components/input/input.types.d.ts +5 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/input-group/input-group-root.js +3 -0
- package/dist/components/input-group/input-group.types.d.ts +5 -0
- package/dist/components/input-otp/index.d.ts +6 -4
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/link/link-root.js +22 -5
- package/dist/components/link/link.types.d.ts +14 -3
- package/dist/{composables → components/list-box}/drag-collection.d.ts +2 -2
- package/dist/{composables → components/list-box}/drag-collection.js +1 -1
- package/dist/components/list-box/index.d.ts +4 -0
- package/dist/components/list-box/list-box-root.js +53 -32
- package/dist/components/list-box/list-box.types.d.ts +2 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/menu-root.js +5 -1
- package/dist/components/menu/menu.types.d.ts +3 -0
- package/dist/components/number-field/index.d.ts +3 -0
- package/dist/components/number-field/number-field-root.js +2 -0
- package/dist/components/number-field/number-field.types.d.ts +2 -0
- package/dist/components/overlay/overlay-arrow.js +64 -11
- package/dist/components/radio/radio-content.js +1 -1
- package/dist/components/range-calendar/index.d.ts +18 -15
- package/dist/components/router-provider/index.d.ts +5 -0
- package/dist/components/router-provider/index.js +3 -0
- package/dist/components/router-provider/router-provider.context.d.ts +40 -0
- package/dist/components/router-provider/router-provider.context.js +16 -0
- package/dist/components/router-provider/router-provider.d.ts +21 -0
- package/dist/components/router-provider/router-provider.js +22 -0
- package/dist/components/router-provider/router-provider.types.d.ts +23 -0
- package/dist/components/scroll-shadow/use-scroll-shadow.js +25 -1
- package/dist/components/search-field/index.d.ts +2 -0
- package/dist/components/search-field/search-field-root.js +3 -1
- package/dist/components/search-field/search-field.types.d.ts +2 -0
- package/dist/{composables → components/search-field}/use-search-field.d.ts +2 -2
- package/dist/{composables → components/search-field}/use-search-field.js +3 -3
- package/dist/components/segmented-control/index.d.ts +134 -0
- package/dist/components/segmented-control/index.js +15 -0
- package/dist/components/segmented-control/segmented-control-indicator.d.ts +19 -0
- package/dist/components/segmented-control/segmented-control-indicator.js +36 -0
- package/dist/components/segmented-control/segmented-control-item.d.ts +21 -0
- package/dist/components/segmented-control/segmented-control-item.js +96 -0
- package/dist/components/segmented-control/segmented-control-root.d.ts +25 -0
- package/dist/components/segmented-control/segmented-control-root.js +112 -0
- package/dist/components/segmented-control/segmented-control-separator.d.ts +19 -0
- package/dist/components/segmented-control/segmented-control-separator.js +18 -0
- package/dist/components/segmented-control/segmented-control.context.d.ts +17 -0
- package/dist/components/segmented-control/segmented-control.context.js +12 -0
- package/dist/components/segmented-control/segmented-control.types.d.ts +67 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/select-hidden-select.js +1 -1
- package/dist/components/select/select-root.js +2 -0
- package/dist/components/select/select.types.d.ts +2 -0
- package/dist/components/sidebar/index.d.ts +544 -0
- package/dist/components/sidebar/index.js +47 -0
- package/dist/components/sidebar/sidebar-collapsible-trigger.d.ts +21 -0
- package/dist/components/sidebar/sidebar-collapsible-trigger.js +70 -0
- package/dist/components/sidebar/sidebar-collapsible.d.ts +24 -0
- package/dist/components/sidebar/sidebar-collapsible.js +78 -0
- package/dist/components/sidebar/sidebar-content.d.ts +21 -0
- package/dist/components/sidebar/sidebar-content.js +37 -0
- package/dist/components/sidebar/sidebar-footer.d.ts +21 -0
- package/dist/components/sidebar/sidebar-footer.js +24 -0
- package/dist/components/sidebar/sidebar-group-label.d.ts +21 -0
- package/dist/components/sidebar/sidebar-group-label.js +32 -0
- package/dist/components/sidebar/sidebar-group.d.ts +21 -0
- package/dist/components/sidebar/sidebar-group.js +48 -0
- package/dist/components/sidebar/sidebar-header.d.ts +21 -0
- package/dist/components/sidebar/sidebar-header.js +24 -0
- package/dist/components/sidebar/sidebar-inset.d.ts +21 -0
- package/dist/components/sidebar/sidebar-inset.js +24 -0
- package/dist/components/sidebar/sidebar-item-icon.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-icon.js +20 -0
- package/dist/components/sidebar/sidebar-item-indicator.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-indicator.js +48 -0
- package/dist/components/sidebar/sidebar-item-label.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-label.js +28 -0
- package/dist/components/sidebar/sidebar-item-tooltip.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-tooltip.js +38 -0
- package/dist/components/sidebar/sidebar-item-trailing.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-trailing.js +28 -0
- package/dist/components/sidebar/sidebar-item.d.ts +23 -0
- package/dist/components/sidebar/sidebar-item.js +160 -0
- package/dist/components/sidebar/sidebar-panel.d.ts +21 -0
- package/dist/components/sidebar/sidebar-panel.js +88 -0
- package/dist/components/sidebar/sidebar-rail.d.ts +21 -0
- package/dist/components/sidebar/sidebar-rail.js +210 -0
- package/dist/components/sidebar/sidebar-root.d.ts +31 -0
- package/dist/components/sidebar/sidebar-root.js +138 -0
- package/dist/components/sidebar/sidebar-separator.d.ts +19 -0
- package/dist/components/sidebar/sidebar-separator.js +16 -0
- package/dist/components/sidebar/sidebar-sub-menu.d.ts +23 -0
- package/dist/components/sidebar/sidebar-sub-menu.js +40 -0
- package/dist/components/sidebar/sidebar-trigger.d.ts +21 -0
- package/dist/components/sidebar/sidebar-trigger.js +69 -0
- package/dist/components/sidebar/sidebar.context.d.ts +75 -0
- package/dist/components/sidebar/sidebar.context.js +30 -0
- package/dist/components/sidebar/sidebar.state.d.ts +73 -0
- package/dist/components/sidebar/sidebar.state.js +76 -0
- package/dist/components/sidebar/sidebar.storage.d.ts +8 -0
- package/dist/components/sidebar/sidebar.storage.js +45 -0
- package/dist/components/sidebar/sidebar.types.d.ts +259 -0
- package/dist/components/splitter/index.d.ts +143 -0
- package/dist/components/splitter/index.js +13 -0
- package/dist/components/splitter/splitter-handle.d.ts +21 -0
- package/dist/components/splitter/splitter-handle.js +209 -0
- package/dist/components/splitter/splitter-panel.d.ts +21 -0
- package/dist/components/splitter/splitter-panel.js +70 -0
- package/dist/components/splitter/splitter-root.d.ts +31 -0
- package/dist/components/splitter/splitter-root.js +152 -0
- package/dist/components/splitter/splitter.context.d.ts +15 -0
- package/dist/components/splitter/splitter.context.js +5 -0
- package/dist/components/splitter/splitter.state.d.ts +87 -0
- package/dist/components/splitter/splitter.state.js +322 -0
- package/dist/components/splitter/splitter.storage.d.ts +15 -0
- package/dist/components/splitter/splitter.storage.js +56 -0
- package/dist/components/splitter/splitter.types.d.ts +98 -0
- package/dist/components/switch/switch-content.js +1 -1
- package/dist/components/table/index.d.ts +10 -9
- package/dist/components/table/table-body.js +13 -13
- package/dist/components/table/table-cell.js +49 -46
- package/dist/components/table/table-column-resizer.js +1 -1
- package/dist/components/table/table-column.js +1 -1
- package/dist/components/table/table-content.js +37 -18
- package/dist/{composables → components/table}/table-drag-collection.d.ts +1 -1
- package/dist/{composables → components/table}/table-drag-collection.js +1 -1
- package/dist/components/table/table-drop-indicator.js +3 -1
- package/dist/components/table/table-resizable-container.d.ts +4 -5
- package/dist/components/table/table-row.js +45 -14
- package/dist/components/table/table-virtualizer-item.d.ts +2 -7
- package/dist/components/table/table-virtualizer-item.js +20 -9
- package/dist/components/table/table.context.d.ts +11 -3
- package/dist/components/table/table.types.d.ts +1 -1
- package/dist/{composables → components/table}/use-grid-keyboard.d.ts +3 -3
- package/dist/{composables → components/table}/use-grid-keyboard.js +57 -55
- package/dist/{composables → components/table}/use-grid-selection-announcement.d.ts +2 -2
- package/dist/{composables → components/table}/use-grid-selection-announcement.js +2 -2
- package/dist/{composables → components/table}/use-table-collection.d.ts +2 -2
- package/dist/{composables → components/table}/use-table-collection.js +4 -4
- package/dist/{composables → components/table}/use-table-column-layout.d.ts +13 -20
- package/dist/components/table/use-table-column-layout.js +115 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea-root.js +3 -0
- package/dist/components/textarea/textarea.types.d.ts +5 -0
- package/dist/components/textfield/index.d.ts +2 -0
- package/dist/components/textfield/textfield-root.js +5 -1
- package/dist/components/textfield/textfield.context.d.ts +2 -0
- package/dist/components/textfield/textfield.types.d.ts +5 -0
- package/dist/components/time-field/index.d.ts +1 -0
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/toast-default-content.js +1 -1
- package/dist/components/toolbar/index.d.ts +3 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip-root.js +1 -1
- package/dist/components/virtualizer/index.d.ts +3 -1
- package/dist/components/virtualizer/index.js +2 -1
- package/dist/components/virtualizer/use-virtualizer-item.d.ts +23 -0
- package/dist/components/virtualizer/use-virtualizer-item.js +45 -0
- package/dist/components/virtualizer/virtualizer-item.js +7 -41
- package/dist/components/virtualizer/virtualizer-scrollbar-track.d.ts +20 -0
- package/dist/components/virtualizer/virtualizer-scrollbar-track.js +141 -0
- package/dist/components/virtualizer/virtualizer-scrollbar.d.ts +18 -0
- package/dist/components/virtualizer/virtualizer-scrollbar.js +55 -0
- package/dist/components/virtualizer/virtualizer.context.d.ts +17 -1
- package/dist/composables/drag-manager.js +1 -13
- package/dist/composables/index.d.ts +3 -71
- package/dist/composables/use-collection.d.ts +22 -3
- package/dist/composables/use-collection.js +67 -14
- package/dist/composables/use-color-area.js +2 -2
- package/dist/composables/use-color-field.js +1 -1
- package/dist/composables/use-combo-box.js +1 -1
- package/dist/composables/use-date-field.js +1 -1
- package/dist/composables/use-drag-and-drop.js +1 -1
- package/dist/composables/use-drag.d.ts +6 -5
- package/dist/composables/use-draggable-item.d.ts +2 -2
- package/dist/composables/use-droppable-collection.js +2 -2
- package/dist/composables/use-droppable-item.js +1 -1
- package/dist/composables/use-form-reset.d.ts +6 -2
- package/dist/composables/use-form-reset.js +9 -5
- package/dist/composables/use-list-keyboard.js +64 -62
- package/dist/composables/use-number-field.js +1 -1
- package/dist/composables/use-select.js +2 -2
- package/dist/composables/use-selection-manager.js +4 -4
- package/dist/composables/use-single-select-list-state.d.ts +37 -0
- package/dist/composables/use-single-select-list-state.js +110 -0
- package/dist/composables/use-slider-thumb.js +2 -2
- package/dist/composables/use-slider.js +1 -1
- package/dist/composables/use-tab-list-state.d.ts +10 -29
- package/dist/composables/use-tab-list-state.js +10 -99
- package/dist/composables/use-text-field.js +1 -1
- package/dist/composables/use-virtualizer-scroll.d.ts +52 -2
- package/dist/composables/use-virtualizer-scroll.js +79 -13
- package/dist/composables/use-virtualizer.d.ts +24 -4
- package/dist/composables/use-virtualizer.js +40 -6
- package/dist/index.js +52 -80
- package/dist/utils/document-order.d.ts +14 -0
- package/dist/utils/document-order.js +17 -0
- package/dist/utils/flex-sizing.d.ts +41 -0
- package/dist/utils/flex-sizing.js +140 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/open-link.d.ts +31 -0
- package/dist/utils/open-link.js +32 -0
- package/dist/utils/story-truncation.d.ts +20 -0
- package/dist/utils/story-users.d.ts +11 -0
- package/dist/utils/virtualizer-collection.d.ts +14 -4
- package/dist/utils/virtualizer-collection.js +9 -14
- package/dist/utils/virtualizer-layout-info.js +3 -2
- package/dist/utils/virtualizer-list-layout.d.ts +75 -29
- package/dist/utils/virtualizer-list-layout.js +182 -99
- package/dist/utils/virtualizer-offsets.d.ts +111 -0
- package/dist/utils/virtualizer-offsets.js +159 -0
- package/dist/utils/virtualizer-overscan.d.ts +9 -15
- package/dist/utils/virtualizer-overscan.js +14 -33
- package/dist/utils/virtualizer-table-layout.d.ts +50 -21
- package/dist/utils/virtualizer-table-layout.js +130 -89
- package/dist/version.js +1 -1
- package/package.json +19 -3
- package/dist/composables/use-table-column-layout.js +0 -214
- /package/dist/{composables → components/dropdown}/use-safely-mouse-to-submenu.d.ts +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region src/components/sidebar/sidebar.storage.ts
|
|
2
|
+
var VERSION = 1;
|
|
3
|
+
var keyFor = (id) => `ropav:sidebar:${id}`;
|
|
4
|
+
/**
|
|
5
|
+
* Storage can throw rather than merely fail — Safari's private mode raises on access, not only on
|
|
6
|
+
* write — so every call is guarded, and an unreadable store is treated as an empty one.
|
|
7
|
+
*/
|
|
8
|
+
var storage = () => {
|
|
9
|
+
try {
|
|
10
|
+
return typeof window === "undefined" ? null : window.localStorage;
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/** What was stored under `id`, or `null` when there is nothing usable there. */
|
|
16
|
+
var readSidebarLayout = (id) => {
|
|
17
|
+
const store = storage();
|
|
18
|
+
if (!store) return null;
|
|
19
|
+
try {
|
|
20
|
+
const raw = store.getItem(keyFor(id));
|
|
21
|
+
if (!raw) return null;
|
|
22
|
+
const parsed = JSON.parse(raw);
|
|
23
|
+
if (parsed?.v !== VERSION || typeof parsed.e !== "boolean") return null;
|
|
24
|
+
return {
|
|
25
|
+
isExpanded: parsed.e,
|
|
26
|
+
width: typeof parsed.w === "string" ? parsed.w : void 0
|
|
27
|
+
};
|
|
28
|
+
} catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var writeSidebarLayout = (id, isExpanded, width) => {
|
|
33
|
+
const store = storage();
|
|
34
|
+
if (!store) return;
|
|
35
|
+
const layout = {
|
|
36
|
+
e: isExpanded,
|
|
37
|
+
v: VERSION,
|
|
38
|
+
...width ? { w: width } : {}
|
|
39
|
+
};
|
|
40
|
+
try {
|
|
41
|
+
store.setItem(keyFor(id), JSON.stringify(layout));
|
|
42
|
+
} catch {}
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { readSidebarLayout, writeSidebarLayout };
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import type { PressEvent } from "../../composables/use-press.js";
|
|
2
|
+
import type { LinkCurrent } from "../link/link.types.js";
|
|
3
|
+
import type { SidebarCollapsibleMode } from "./sidebar.state.js";
|
|
4
|
+
import type { SidebarVariants } from "@ropav/styles";
|
|
5
|
+
/** Which edge of the page the panel sits on. */
|
|
6
|
+
export type SidebarSide = NonNullable<SidebarVariants["side"]>;
|
|
7
|
+
export interface SidebarRootProps {
|
|
8
|
+
class?: string;
|
|
9
|
+
/** @default "left" */
|
|
10
|
+
side?: SidebarSide;
|
|
11
|
+
/** How the panel gets out of the way. `none` pins it open. @default "icon" */
|
|
12
|
+
collapsible?: SidebarCollapsibleMode;
|
|
13
|
+
/** Whether the panel is expanded. Set, the sidebar reports a toggle rather than acting on it. */
|
|
14
|
+
isExpanded?: boolean;
|
|
15
|
+
/** Whether the panel starts expanded, when the caller is not controlling it. @default true */
|
|
16
|
+
defaultExpanded?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the drawer is showing on a narrow viewport.
|
|
19
|
+
*
|
|
20
|
+
* Held apart from `isExpanded` on purpose: one flag across both widths would open the drawer
|
|
21
|
+
* already collapsed for anyone who had collapsed the sidebar first.
|
|
22
|
+
*/
|
|
23
|
+
isMobileOpen?: boolean;
|
|
24
|
+
/** @default false */
|
|
25
|
+
defaultMobileOpen?: boolean;
|
|
26
|
+
/** The width the expanded panel renders at, as a CSS length. */
|
|
27
|
+
width?: string;
|
|
28
|
+
/** The width it starts at. Unset, the stylesheet decides and nothing is written inline. */
|
|
29
|
+
defaultWidth?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Where the sidebar is remembered between visits, under `ropav:sidebar:<id>` in `localStorage`.
|
|
32
|
+
*
|
|
33
|
+
* The wide-viewport state only: whether the panel was left expanded and how wide it was. What
|
|
34
|
+
* the drawer was doing is not worth restoring — it is opened to be used and closed when it is.
|
|
35
|
+
*/
|
|
36
|
+
autoSaveId?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The viewport at or below which the panel becomes a drawer, as a media query.
|
|
39
|
+
*
|
|
40
|
+
* Written as a query rather than a number so a caller can key it to whatever their layout
|
|
41
|
+
* actually needs — a container, an orientation, a coarse pointer. @default "(max-width: 47.99rem)"
|
|
42
|
+
*/
|
|
43
|
+
breakpoint?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface SidebarRootEmits {
|
|
46
|
+
expandedChange: [isExpanded: boolean];
|
|
47
|
+
"update:isExpanded": [isExpanded: boolean];
|
|
48
|
+
mobileOpenChange: [isOpen: boolean];
|
|
49
|
+
"update:isMobileOpen": [isOpen: boolean];
|
|
50
|
+
"update:width": [width: string];
|
|
51
|
+
}
|
|
52
|
+
export interface SidebarPanelProps {
|
|
53
|
+
class?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Accessible name for the landmark. Declared as `ariaLabel`, not `aria-label`: Vue normalises
|
|
56
|
+
* prop names, so a hyphenated declaration would never be matched. @default "Sidebar"
|
|
57
|
+
*/
|
|
58
|
+
ariaLabel?: string;
|
|
59
|
+
/** Ids of the elements that name the landmark. */
|
|
60
|
+
ariaLabelledby?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SidebarInsetProps {
|
|
63
|
+
class?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface SidebarHeaderProps {
|
|
66
|
+
class?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface SidebarContentProps {
|
|
69
|
+
class?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the scroll region fades at whichever edge has more nav beyond it.
|
|
72
|
+
*
|
|
73
|
+
* On by default, and it costs nothing when there is nothing to say: the fade is a mask keyed on
|
|
74
|
+
* attributes that only appear once the region actually overflows, so a nav short enough to fit is
|
|
75
|
+
* left exactly as it was. @default true
|
|
76
|
+
*/
|
|
77
|
+
showScrollShadow?: boolean;
|
|
78
|
+
/** How deep the fade runs, in pixels. Also how far focus is kept clear of it. @default 40 */
|
|
79
|
+
scrollShadowSize?: number;
|
|
80
|
+
}
|
|
81
|
+
export interface SidebarFooterProps {
|
|
82
|
+
class?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface SidebarGroupProps {
|
|
85
|
+
class?: string;
|
|
86
|
+
/** Names the group where no `Sidebar.GroupLabel` does. */
|
|
87
|
+
ariaLabel?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface SidebarGroupLabelProps {
|
|
90
|
+
class?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface SidebarSeparatorProps {
|
|
93
|
+
class?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface SidebarRailProps {
|
|
96
|
+
class?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Whether dragging the rail resizes the panel. Off, it is a toggle strip and nothing else.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
isResizable?: boolean;
|
|
102
|
+
/** Suppresses both gestures. */
|
|
103
|
+
isDisabled?: boolean;
|
|
104
|
+
/** Narrowest width a drag may reach, in pixels. @default 180 */
|
|
105
|
+
minWidth?: number;
|
|
106
|
+
/** Widest width a drag may reach, in pixels. @default 480 */
|
|
107
|
+
maxWidth?: number;
|
|
108
|
+
/** How far one arrow press moves the edge, in pixels. @default 10 */
|
|
109
|
+
keyboardStep?: number;
|
|
110
|
+
/** How far a shift-arrow press moves it, in pixels. @default 50 */
|
|
111
|
+
keyboardLargeStep?: number;
|
|
112
|
+
/** @default "Resize sidebar" when it resizes, "Toggle sidebar" when it only toggles */
|
|
113
|
+
ariaLabel?: string;
|
|
114
|
+
ariaLabelledby?: string;
|
|
115
|
+
}
|
|
116
|
+
/** State the rail hands to its slot. */
|
|
117
|
+
export interface SidebarRailSlotProps {
|
|
118
|
+
isDragging: boolean;
|
|
119
|
+
isHovered: boolean;
|
|
120
|
+
isFocused: boolean;
|
|
121
|
+
isFocusVisible: boolean;
|
|
122
|
+
isDisabled: boolean;
|
|
123
|
+
isResizable: boolean;
|
|
124
|
+
isCollapsed: boolean;
|
|
125
|
+
}
|
|
126
|
+
export interface SidebarItemProps {
|
|
127
|
+
class?: string;
|
|
128
|
+
/** Where the item goes. Without one it renders as a button, for a nav that acts rather than
|
|
129
|
+
* navigates. */
|
|
130
|
+
href?: string;
|
|
131
|
+
target?: string;
|
|
132
|
+
rel?: string;
|
|
133
|
+
/** Marks the item as the one for the current page. `"auto"` asks the router instead. */
|
|
134
|
+
ariaCurrent?: LinkCurrent;
|
|
135
|
+
/**
|
|
136
|
+
* Passed through to the router's `navigate` alongside the href, for whatever options the
|
|
137
|
+
* application's router accepts. Ignored without a `RouterProvider` above.
|
|
138
|
+
*/
|
|
139
|
+
routerOptions?: unknown;
|
|
140
|
+
isDisabled?: boolean;
|
|
141
|
+
ariaLabel?: string;
|
|
142
|
+
ariaLabelledby?: string;
|
|
143
|
+
ariaDescribedby?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface SidebarItemEmits {
|
|
146
|
+
press: [event: PressEvent];
|
|
147
|
+
}
|
|
148
|
+
export interface SidebarItemIconProps {
|
|
149
|
+
class?: string;
|
|
150
|
+
}
|
|
151
|
+
export interface SidebarItemLabelProps {
|
|
152
|
+
class?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface SidebarItemTrailingProps {
|
|
155
|
+
class?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface SidebarCollapsibleProps {
|
|
158
|
+
class?: string;
|
|
159
|
+
/** Whether the rows under this item are showing. Set, it reports a toggle rather than acting. */
|
|
160
|
+
isExpanded?: boolean;
|
|
161
|
+
/** Whether they start showing, when the caller is not controlling it. @default false */
|
|
162
|
+
defaultExpanded?: boolean;
|
|
163
|
+
isDisabled?: boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface SidebarCollapsibleEmits {
|
|
166
|
+
expandedChange: [isExpanded: boolean];
|
|
167
|
+
"update:isExpanded": [isExpanded: boolean];
|
|
168
|
+
}
|
|
169
|
+
export interface SidebarCollapsibleTriggerProps {
|
|
170
|
+
class?: string;
|
|
171
|
+
isDisabled?: boolean;
|
|
172
|
+
ariaLabel?: string;
|
|
173
|
+
}
|
|
174
|
+
export interface SidebarSubMenuProps {
|
|
175
|
+
class?: string;
|
|
176
|
+
/** Names the list of children. @default the trigger names it */
|
|
177
|
+
ariaLabel?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface SidebarItemIndicatorProps {
|
|
180
|
+
class?: string;
|
|
181
|
+
}
|
|
182
|
+
/** State a collapsible item hands to its slot. */
|
|
183
|
+
export interface SidebarCollapsibleSlotProps {
|
|
184
|
+
isExpanded: boolean;
|
|
185
|
+
isDisabled: boolean;
|
|
186
|
+
/** Whether the sidebar itself has narrowed to its rail, where the children are not rendered. */
|
|
187
|
+
isCollapsed: boolean;
|
|
188
|
+
}
|
|
189
|
+
/** State the trigger hands to its slot. */
|
|
190
|
+
export interface SidebarCollapsibleTriggerSlotProps extends SidebarCollapsibleSlotProps {
|
|
191
|
+
isHovered: boolean;
|
|
192
|
+
isFocused: boolean;
|
|
193
|
+
isFocusVisible: boolean;
|
|
194
|
+
isPressed: boolean;
|
|
195
|
+
}
|
|
196
|
+
export interface SidebarItemTooltipProps {
|
|
197
|
+
class?: string;
|
|
198
|
+
/**
|
|
199
|
+
* What the tooltip says — the item's own label, which the rail has taken out of sight.
|
|
200
|
+
*
|
|
201
|
+
* Restated rather than read off `Sidebar.ItemLabel`, because the label is a slot and its text is
|
|
202
|
+
* whatever a caller rendered into it; reaching into the DOM to find out would tie the tooltip to
|
|
203
|
+
* a markup shape neither part promises.
|
|
204
|
+
*/
|
|
205
|
+
label?: string;
|
|
206
|
+
/**
|
|
207
|
+
* How long the pointer has to rest on the item before the tooltip opens.
|
|
208
|
+
*
|
|
209
|
+
* Left to the theme's `--tooltip-delay` by default, the same as every other tooltip. A rail is a
|
|
210
|
+
* good reason to want this shorter — the label is the only way to read the item, not a hint
|
|
211
|
+
* beside one — but that is a decision about the whole product's tooltips, not about this part.
|
|
212
|
+
*/
|
|
213
|
+
delay?: number;
|
|
214
|
+
/** How long it stays after the pointer leaves. Left to the theme by default. */
|
|
215
|
+
closeDelay?: number;
|
|
216
|
+
}
|
|
217
|
+
/** State an item hands to its slot, matching the link's render props plus the sidebar's shape. */
|
|
218
|
+
export interface SidebarItemSlotProps {
|
|
219
|
+
isCurrent: boolean;
|
|
220
|
+
isDisabled: boolean;
|
|
221
|
+
isHovered: boolean;
|
|
222
|
+
isPressed: boolean;
|
|
223
|
+
isFocused: boolean;
|
|
224
|
+
isFocusVisible: boolean;
|
|
225
|
+
/** Whether the sidebar has narrowed to its rail, so a caller can hang a tooltip off it. */
|
|
226
|
+
isCollapsed: boolean;
|
|
227
|
+
}
|
|
228
|
+
export interface SidebarTriggerProps {
|
|
229
|
+
class?: string;
|
|
230
|
+
isDisabled?: boolean;
|
|
231
|
+
/** @default "Toggle sidebar" */
|
|
232
|
+
ariaLabel?: string;
|
|
233
|
+
}
|
|
234
|
+
/** State the root hands to its slot. */
|
|
235
|
+
export interface SidebarSlotProps {
|
|
236
|
+
side: SidebarSide;
|
|
237
|
+
collapsible: SidebarCollapsibleMode;
|
|
238
|
+
isOpen: boolean;
|
|
239
|
+
isExpanded: boolean;
|
|
240
|
+
/** Narrowed rather than hidden. Always false where the panel is a drawer. */
|
|
241
|
+
isCollapsed: boolean;
|
|
242
|
+
isMobile: boolean;
|
|
243
|
+
}
|
|
244
|
+
/** State a part reading only the sidebar's shape hands to its slot. */
|
|
245
|
+
export interface SidebarPartSlotProps {
|
|
246
|
+
isCollapsed: boolean;
|
|
247
|
+
isOpen: boolean;
|
|
248
|
+
isMobile: boolean;
|
|
249
|
+
}
|
|
250
|
+
/** State the trigger hands to its slot. */
|
|
251
|
+
export interface SidebarTriggerSlotProps {
|
|
252
|
+
isOpen: boolean;
|
|
253
|
+
isCollapsed: boolean;
|
|
254
|
+
isHovered: boolean;
|
|
255
|
+
isFocused: boolean;
|
|
256
|
+
isFocusVisible: boolean;
|
|
257
|
+
isPressed: boolean;
|
|
258
|
+
isDisabled: boolean;
|
|
259
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import SplitterHandle from "./splitter-handle.js";
|
|
2
|
+
import SplitterPanel from "./splitter-panel.js";
|
|
3
|
+
import SplitterRoot from "./splitter-root.js";
|
|
4
|
+
export declare const Splitter: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
5
|
+
attrs: any;
|
|
6
|
+
slots: {
|
|
7
|
+
default?: (props: import("./splitter.types.js").SplitterSlotProps) => unknown;
|
|
8
|
+
};
|
|
9
|
+
emit: ((evt: "collapse", key: import("../../index.js").CollectionKey) => void) & ((evt: "expand", key: import("../../index.js").CollectionKey) => void) & ((evt: "resize", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "resizeEnd", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "resizeStart", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "update:sizes", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void);
|
|
10
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
11
|
+
props: import('vue').PublicProps & {
|
|
12
|
+
class?: string;
|
|
13
|
+
orientation?: import("./splitter.state.js").SplitterOrientation;
|
|
14
|
+
sizes?: import("./splitter.state.js").SplitterSize[];
|
|
15
|
+
defaultSizes?: import("./splitter.state.js").SplitterSize[];
|
|
16
|
+
autoSaveId?: string;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
keyboardStep?: number;
|
|
19
|
+
keyboardLargeStep?: number;
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
ariaLabelledby?: string;
|
|
22
|
+
onCollapse?: ((key: import("../../index.js").CollectionKey) => any) | undefined;
|
|
23
|
+
onExpand?: ((key: import("../../index.js").CollectionKey) => any) | undefined;
|
|
24
|
+
onResize?: ((sizes: import("../../utils/flex-sizing.js").FlexSize[]) => any) | undefined;
|
|
25
|
+
onResizeEnd?: ((sizes: import("../../utils/flex-sizing.js").FlexSize[]) => any) | undefined;
|
|
26
|
+
onResizeStart?: ((sizes: import("../../utils/flex-sizing.js").FlexSize[]) => any) | undefined;
|
|
27
|
+
"onUpdate:sizes"?: ((sizes: import("../../utils/flex-sizing.js").FlexSize[]) => any) | undefined;
|
|
28
|
+
} & (typeof globalThis extends {
|
|
29
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
30
|
+
} ? P : {});
|
|
31
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
32
|
+
measure: () => void;
|
|
33
|
+
}>) => void;
|
|
34
|
+
attrs: any;
|
|
35
|
+
slots: {
|
|
36
|
+
default?: (props: import("./splitter.types.js").SplitterSlotProps) => unknown;
|
|
37
|
+
};
|
|
38
|
+
emit: ((evt: "collapse", key: import("../../index.js").CollectionKey) => void) & ((evt: "expand", key: import("../../index.js").CollectionKey) => void) & ((evt: "resize", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "resizeEnd", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "resizeStart", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "update:sizes", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void);
|
|
39
|
+
}>) => import('vue').VNode & {
|
|
40
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
41
|
+
}) & {
|
|
42
|
+
Handle: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
43
|
+
attrs: any;
|
|
44
|
+
slots: {
|
|
45
|
+
default?: (props: import("./splitter.types.js").SplitterHandleSlotProps) => unknown;
|
|
46
|
+
};
|
|
47
|
+
emit: {};
|
|
48
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
49
|
+
props: import('vue').PublicProps & {
|
|
50
|
+
class?: string;
|
|
51
|
+
id?: import("../../index.js").CollectionKey;
|
|
52
|
+
isDisabled?: boolean;
|
|
53
|
+
resetOnDoubleClick?: boolean;
|
|
54
|
+
showGrip?: boolean;
|
|
55
|
+
ariaLabel?: string;
|
|
56
|
+
ariaLabelledby?: string;
|
|
57
|
+
} & (typeof globalThis extends {
|
|
58
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
59
|
+
} ? P : {});
|
|
60
|
+
expose: (exposed: {}) => void;
|
|
61
|
+
attrs: any;
|
|
62
|
+
slots: {
|
|
63
|
+
default?: (props: import("./splitter.types.js").SplitterHandleSlotProps) => unknown;
|
|
64
|
+
};
|
|
65
|
+
emit: {};
|
|
66
|
+
}>) => import('vue').VNode & {
|
|
67
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
68
|
+
};
|
|
69
|
+
Panel: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
70
|
+
attrs: any;
|
|
71
|
+
slots: {
|
|
72
|
+
default?: (props: import("./splitter.types.js").SplitterPanelSlotProps) => unknown;
|
|
73
|
+
};
|
|
74
|
+
emit: {};
|
|
75
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
76
|
+
props: import('vue').PublicProps & {
|
|
77
|
+
class?: string;
|
|
78
|
+
id?: import("../../index.js").CollectionKey;
|
|
79
|
+
size?: import("./splitter.state.js").SplitterSize;
|
|
80
|
+
defaultSize?: import("./splitter.state.js").SplitterSize;
|
|
81
|
+
minSize?: import("./splitter.state.js").SplitterSize;
|
|
82
|
+
maxSize?: import("./splitter.state.js").SplitterSize;
|
|
83
|
+
isCollapsible?: boolean;
|
|
84
|
+
collapsedSize?: import("./splitter.state.js").SplitterSize;
|
|
85
|
+
} & (typeof globalThis extends {
|
|
86
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
87
|
+
} ? P : {});
|
|
88
|
+
expose: (exposed: {}) => void;
|
|
89
|
+
attrs: any;
|
|
90
|
+
slots: {
|
|
91
|
+
default?: (props: import("./splitter.types.js").SplitterPanelSlotProps) => unknown;
|
|
92
|
+
};
|
|
93
|
+
emit: {};
|
|
94
|
+
}>) => import('vue').VNode & {
|
|
95
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
96
|
+
};
|
|
97
|
+
Root: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
98
|
+
attrs: any;
|
|
99
|
+
slots: {
|
|
100
|
+
default?: (props: import("./splitter.types.js").SplitterSlotProps) => unknown;
|
|
101
|
+
};
|
|
102
|
+
emit: ((evt: "collapse", key: import("../../index.js").CollectionKey) => void) & ((evt: "expand", key: import("../../index.js").CollectionKey) => void) & ((evt: "resize", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "resizeEnd", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "resizeStart", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "update:sizes", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void);
|
|
103
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
104
|
+
props: import('vue').PublicProps & {
|
|
105
|
+
class?: string;
|
|
106
|
+
orientation?: import("./splitter.state.js").SplitterOrientation;
|
|
107
|
+
sizes?: import("./splitter.state.js").SplitterSize[];
|
|
108
|
+
defaultSizes?: import("./splitter.state.js").SplitterSize[];
|
|
109
|
+
autoSaveId?: string;
|
|
110
|
+
isDisabled?: boolean;
|
|
111
|
+
keyboardStep?: number;
|
|
112
|
+
keyboardLargeStep?: number;
|
|
113
|
+
ariaLabel?: string;
|
|
114
|
+
ariaLabelledby?: string;
|
|
115
|
+
onCollapse?: ((key: import("../../index.js").CollectionKey) => any) | undefined;
|
|
116
|
+
onExpand?: ((key: import("../../index.js").CollectionKey) => any) | undefined;
|
|
117
|
+
onResize?: ((sizes: import("../../utils/flex-sizing.js").FlexSize[]) => any) | undefined;
|
|
118
|
+
onResizeEnd?: ((sizes: import("../../utils/flex-sizing.js").FlexSize[]) => any) | undefined;
|
|
119
|
+
onResizeStart?: ((sizes: import("../../utils/flex-sizing.js").FlexSize[]) => any) | undefined;
|
|
120
|
+
"onUpdate:sizes"?: ((sizes: import("../../utils/flex-sizing.js").FlexSize[]) => any) | undefined;
|
|
121
|
+
} & (typeof globalThis extends {
|
|
122
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
123
|
+
} ? P : {});
|
|
124
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
125
|
+
measure: () => void;
|
|
126
|
+
}>) => void;
|
|
127
|
+
attrs: any;
|
|
128
|
+
slots: {
|
|
129
|
+
default?: (props: import("./splitter.types.js").SplitterSlotProps) => unknown;
|
|
130
|
+
};
|
|
131
|
+
emit: ((evt: "collapse", key: import("../../index.js").CollectionKey) => void) & ((evt: "expand", key: import("../../index.js").CollectionKey) => void) & ((evt: "resize", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "resizeEnd", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "resizeStart", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void) & ((evt: "update:sizes", sizes: import("../../utils/flex-sizing.js").FlexSize[]) => void);
|
|
132
|
+
}>) => import('vue').VNode & {
|
|
133
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export { SplitterRoot, SplitterPanel, SplitterHandle };
|
|
137
|
+
export type { SplitterRootProps, SplitterRootProps as SplitterProps, SplitterPanelProps, SplitterHandleProps, SplitterSlotProps, SplitterPanelSlotProps, SplitterHandleSlotProps, } from "./splitter.types.js";
|
|
138
|
+
export type { SplitterOrientation, SplitterSize } from "./splitter.state.js";
|
|
139
|
+
export { useSplitterContext } from "./splitter.context.js";
|
|
140
|
+
export type { SplitterContext } from "./splitter.context.js";
|
|
141
|
+
export type { SplitterState } from "./splitter.state.js";
|
|
142
|
+
export { splitterVariants } from "@ropav/styles";
|
|
143
|
+
export type { SplitterVariants } from "@ropav/styles";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useSplitterContext } from "./splitter.context.js";
|
|
2
|
+
import splitter_handle_default from "./splitter-handle.js";
|
|
3
|
+
import splitter_panel_default from "./splitter-panel.js";
|
|
4
|
+
import splitter_root_default from "./splitter-root.js";
|
|
5
|
+
import { splitterVariants } from "@ropav/styles";
|
|
6
|
+
//#region src/components/splitter/index.ts
|
|
7
|
+
var Splitter = Object.assign(splitter_root_default, {
|
|
8
|
+
Handle: splitter_handle_default,
|
|
9
|
+
Panel: splitter_panel_default,
|
|
10
|
+
Root: splitter_root_default
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Splitter, splitter_handle_default as SplitterHandle, splitter_panel_default as SplitterPanel, splitter_root_default as SplitterRoot, splitterVariants, useSplitterContext };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SplitterHandleProps, SplitterHandleSlotProps } from "./splitter.types.js";
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, 'attrs' | 'emit' | 'slots'>>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<SplitterHandleProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: (props: SplitterHandleSlotProps) => unknown;
|
|
10
|
+
};
|
|
11
|
+
emit: {};
|
|
12
|
+
}>) => import('vue').VNode & {
|
|
13
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} : {
|
|
20
|
+
[K in keyof T as K]: T[K];
|
|
21
|
+
}) & {};
|