import type { NavItem, NavLinkItem } from './types.js'; /** * Query params that select WHICH surface a model renders (table vs board) and * how it's grouped. They are the *identity* of a view-style nav item: two navs * over the same model/path (e.g. "Board" `?view=kanban&group_by=stage` and * "Issues" `?view=list`) are mutually exclusive, so exactly one may be active. * Kept separate from transient query (page/sort/search) and from `f_` filters. */ export declare const VIEW_PARAMS: Set; export interface SplitHref { path: string; view: string; query: string; filters: string; } /** * Splits a URL into its path and three normalized, sorted query buckets: * - `view` — the `view`/`group_by` surface-identity params (exclusive). * - `filters` — the `f_` filter params (subset/refinement semantics). * - `query` — everything else (transient: page/sort/search). * Sorting each bucket makes equivalent strings compare equal regardless of * param order. * * The split lets the matcher treat each class with the right semantics: `view` * params must match EXACTLY in both directions (so a query-less default item * does NOT stay lit when a sibling board is open, and vice-versa); `f_` params * a base nav item omits are ignored (a manually-filtered table still highlights * its base item) while a per-status entry that DECLARES `f_` uses them as its * identity; transient `query` is ignored unless the item itself declares it. */ export declare function splitHref(url: string): SplitHref; /** * True when every `f_` filter the item declares is present (same value) in the * current href's filters. An item that declares no filters always passes, so it * keeps highlighting regardless of transient table filtering. */ export declare function declaredFiltersMatch(curFilters: string, targetFilters: string): boolean; /** * Active-state matcher for a nav item against the current href. * * View-aware, query-aware AND filter-aware so sibling navs over the same model * light up ONE at a time: * - The `view` surface param is the item's identity, but it is matched on the * EFFECTIVE view: an absent `?view=` resolves to the model's default * `view_type` (`defaultView`, the same fallback `DynamicView` uses to pick a * renderer). So a view-less landing (`/m/x?per_page=15`) lights ONLY the * item whose view equals the model default — the board on a kanban-default * model, the list on a list-default model — and never both. Explicit * `?view=kanban`/`?view=list` URLs match their item directly. `group_by` * only refines a board, so it is not part of the identity. * - Other non-`f_` query params (page/sort/search) must match EXACTLY only * when the item declares them — transient query never un-highlights a plain * link. * - `f_` filter params the item DECLARES in its own URL are its identity: they * must all be present in the current href. An item that declares NO filters * matches on path alone (a manually-filtered table still highlights its base * item), preserving the prior behaviour for plain links. * * `defaultView` is the model's default `view_type` for this path (e.g. * `'kanban'`). Hosts thread it from `metadata.view_type`; when omitted the * absent-view fallback is `''` (a view-less URL then only matches a view-less * item). */ /** * Sibling-aware "most specific wins" resolution over a list of nav items. * * `checkIsActive` is per-item and, by design, keeps a filter-LESS item lit when * the table is filtered (so a MANUALLY filtered table still highlights its base * item). But when a SIBLING declares exactly the active filter (e.g. "Traspasos * completados" `?f_status=eq:completed` next to the bare "Traspasos"), BOTH * match and light up. Here we break that tie: among items that match and share * the same path + view surface, only the most filter-specific ones stay active, * so a per-status entry wins over the bare model entry. Items with no * filter-declaring sibling that matches are unaffected (manual filtering still * lights the base). Returns the set of URLs that should render active. */ /** * Depth-first leaf links across a nav tree (collapsibles unwrap). Used by the * sidebar so "most specific wins" can run ACROSS groups — e.g. Customers' * "Pedidos de venta" and Credit's "Solicitudes pendientes" share `/m/sales_orders` * but live in different NavGroups; a per-group resolver would light both. */ export declare function flattenNavLeaves(items: NavItem[]): NavLinkItem[]; export declare function resolveActiveItemUrls(href: string, items: NavItem[], defaultView?: string): Set; export declare function checkIsActive(href: string, item: NavItem, mainNav?: boolean, defaultView?: string): boolean; //# sourceMappingURL=nav-active.d.ts.map