@asteby/metacore-ui 2.5.2 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +1 -0
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/nav-active.d.ts +56 -0
- package/dist/layout/nav-active.d.ts.map +1 -0
- package/dist/layout/nav-active.js +143 -0
- package/dist/layout/nav-active.js.map +1 -0
- package/dist/layout/nav-group.d.ts +2 -0
- package/dist/layout/nav-group.d.ts.map +1 -1
- package/dist/layout/nav-group.js +2 -91
- package/dist/layout/nav-group.js.map +1 -1
- package/package.json +9 -7
package/dist/layout/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { AppSidebar, OrganizationCard } from './app-sidebar';
|
|
|
3
3
|
export { Header } from './header';
|
|
4
4
|
export { NavUser } from './nav-user';
|
|
5
5
|
export { NavGroup, type NavLinkComponent, type NavGroupProps } from './nav-group';
|
|
6
|
+
export { checkIsActive, splitHref, declaredFiltersMatch, VIEW_PARAMS, type SplitHref, } from './nav-active';
|
|
6
7
|
export { TeamSwitcher } from './team-switcher';
|
|
7
8
|
export { ProfileDropdown } from './profile-dropdown';
|
|
8
9
|
export { resolveIconName, humanizeNavKey, translateNavTitle, addonGroupToCollapsibleItem, FALLBACK_GROUP_ICON, FALLBACK_ITEM_ICON, type AddonNavItemLike, type AddonNavGroupLike, } from './addon-nav';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM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BAAkB,EAClB,YAAY,EACZ,UAAU,GACX,MAAM,SAAS,CAAA"}
|
package/dist/layout/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { AppSidebar, OrganizationCard } from './app-sidebar';
|
|
|
3
3
|
export { Header } from './header';
|
|
4
4
|
export { NavUser } from './nav-user';
|
|
5
5
|
export { NavGroup } from './nav-group';
|
|
6
|
+
export { checkIsActive, splitHref, declaredFiltersMatch, VIEW_PARAMS, } from './nav-active';
|
|
6
7
|
export { TeamSwitcher } from './team-switcher';
|
|
7
8
|
export { ProfileDropdown } from './profile-dropdown';
|
|
8
9
|
export { resolveIconName, humanizeNavKey, translateNavTitle, addonGroupToCollapsibleItem, FALLBACK_GROUP_ICON, FALLBACK_ITEM_ICON, } from './addon-nav';
|
package/dist/layout/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,QAAQ,EAA6C,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,GAGnB,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,QAAQ,EAA6C,MAAM,aAAa,CAAA;AACjF,OAAO,EACL,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,WAAW,GAEZ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,GAGnB,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { NavItem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Query params that select WHICH surface a model renders (table vs board) and
|
|
4
|
+
* how it's grouped. They are the *identity* of a view-style nav item: two navs
|
|
5
|
+
* over the same model/path (e.g. "Board" `?view=kanban&group_by=stage` and
|
|
6
|
+
* "Issues" `?view=list`) are mutually exclusive, so exactly one may be active.
|
|
7
|
+
* Kept separate from transient query (page/sort/search) and from `f_` filters.
|
|
8
|
+
*/
|
|
9
|
+
export declare const VIEW_PARAMS: Set<string>;
|
|
10
|
+
export interface SplitHref {
|
|
11
|
+
path: string;
|
|
12
|
+
view: string;
|
|
13
|
+
query: string;
|
|
14
|
+
filters: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Splits a URL into its path and three normalized, sorted query buckets:
|
|
18
|
+
* - `view` — the `view`/`group_by` surface-identity params (exclusive).
|
|
19
|
+
* - `filters` — the `f_` filter params (subset/refinement semantics).
|
|
20
|
+
* - `query` — everything else (transient: page/sort/search).
|
|
21
|
+
* Sorting each bucket makes equivalent strings compare equal regardless of
|
|
22
|
+
* param order.
|
|
23
|
+
*
|
|
24
|
+
* The split lets the matcher treat each class with the right semantics: `view`
|
|
25
|
+
* params must match EXACTLY in both directions (so a query-less default item
|
|
26
|
+
* does NOT stay lit when a sibling board is open, and vice-versa); `f_` params
|
|
27
|
+
* a base nav item omits are ignored (a manually-filtered table still highlights
|
|
28
|
+
* its base item) while a per-status entry that DECLARES `f_` uses them as its
|
|
29
|
+
* identity; transient `query` is ignored unless the item itself declares it.
|
|
30
|
+
*/
|
|
31
|
+
export declare function splitHref(url: string): SplitHref;
|
|
32
|
+
/**
|
|
33
|
+
* True when every `f_` filter the item declares is present (same value) in the
|
|
34
|
+
* current href's filters. An item that declares no filters always passes, so it
|
|
35
|
+
* keeps highlighting regardless of transient table filtering.
|
|
36
|
+
*/
|
|
37
|
+
export declare function declaredFiltersMatch(curFilters: string, targetFilters: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Active-state matcher for a nav item against the current href.
|
|
40
|
+
*
|
|
41
|
+
* View-aware, query-aware AND filter-aware so sibling navs over the same model
|
|
42
|
+
* light up ONE at a time:
|
|
43
|
+
* - `view`/`group_by` surface params must match EXACTLY in both directions.
|
|
44
|
+
* This is what keeps "Board" (`?view=kanban&group_by=stage`) and "Issues"
|
|
45
|
+
* (`?view=list`, or a query-less default) mutually exclusive — only the item
|
|
46
|
+
* whose view identity equals the current href stays active.
|
|
47
|
+
* - Other non-`f_` query params (page/sort/search) must match EXACTLY only
|
|
48
|
+
* when the item declares them — transient query never un-highlights a plain
|
|
49
|
+
* link.
|
|
50
|
+
* - `f_` filter params the item DECLARES in its own URL are its identity: they
|
|
51
|
+
* must all be present in the current href. An item that declares NO filters
|
|
52
|
+
* matches on path alone (a manually-filtered table still highlights its base
|
|
53
|
+
* item), preserving the prior behaviour for plain links.
|
|
54
|
+
*/
|
|
55
|
+
export declare function checkIsActive(href: string, item: NavItem, mainNav?: boolean): boolean;
|
|
56
|
+
//# sourceMappingURL=nav-active.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-active.d.ts","sourceRoot":"","sources":["../../src/layout/nav-active.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAmC,MAAM,SAAS,CAAA;AAEvE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,aAAgC,CAAA;AAqBxD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CA0BhD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAIT;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,UAAQ,GAAG,OAAO,CA0DnF"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query params that select WHICH surface a model renders (table vs board) and
|
|
3
|
+
* how it's grouped. They are the *identity* of a view-style nav item: two navs
|
|
4
|
+
* over the same model/path (e.g. "Board" `?view=kanban&group_by=stage` and
|
|
5
|
+
* "Issues" `?view=list`) are mutually exclusive, so exactly one may be active.
|
|
6
|
+
* Kept separate from transient query (page/sort/search) and from `f_` filters.
|
|
7
|
+
*/
|
|
8
|
+
export const VIEW_PARAMS = new Set(['view', 'group_by']);
|
|
9
|
+
/**
|
|
10
|
+
* The view-bucket strings that all denote the SAME default surface a model
|
|
11
|
+
* paints when the current URL declares no explicit `view`. `DynamicView`
|
|
12
|
+
* resolves a missing `?view=` to the model's `metadata.view_type`, whose
|
|
13
|
+
* non-kanban catch-all is the table/list (`resolveViewRenderer`). So a bare
|
|
14
|
+
* landing (`/m/x?per_page=15`, no `view`), an explicit `?view=list` and an
|
|
15
|
+
* explicit `?view=table` are interchangeable identities of the default item.
|
|
16
|
+
*
|
|
17
|
+
* Two view buckets are "default-equivalent" when BOTH are in this set: this is
|
|
18
|
+
* what lets the Issues/list nav light up on the bare default landing while the
|
|
19
|
+
* Board (`?view=kanban`) — never in this set — stays mutually exclusive, so the
|
|
20
|
+
* board is never lit by a view-less URL and vice-versa.
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_VIEW_BUCKETS = new Set(['', 'view=list', 'view=table']);
|
|
23
|
+
function isDefaultViewBucket(view) {
|
|
24
|
+
return DEFAULT_VIEW_BUCKETS.has(view);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Splits a URL into its path and three normalized, sorted query buckets:
|
|
28
|
+
* - `view` — the `view`/`group_by` surface-identity params (exclusive).
|
|
29
|
+
* - `filters` — the `f_` filter params (subset/refinement semantics).
|
|
30
|
+
* - `query` — everything else (transient: page/sort/search).
|
|
31
|
+
* Sorting each bucket makes equivalent strings compare equal regardless of
|
|
32
|
+
* param order.
|
|
33
|
+
*
|
|
34
|
+
* The split lets the matcher treat each class with the right semantics: `view`
|
|
35
|
+
* params must match EXACTLY in both directions (so a query-less default item
|
|
36
|
+
* does NOT stay lit when a sibling board is open, and vice-versa); `f_` params
|
|
37
|
+
* a base nav item omits are ignored (a manually-filtered table still highlights
|
|
38
|
+
* its base item) while a per-status entry that DECLARES `f_` uses them as its
|
|
39
|
+
* identity; transient `query` is ignored unless the item itself declares it.
|
|
40
|
+
*/
|
|
41
|
+
export function splitHref(url) {
|
|
42
|
+
const qIndex = url.indexOf('?');
|
|
43
|
+
if (qIndex === -1)
|
|
44
|
+
return { path: url, view: '', query: '', filters: '' };
|
|
45
|
+
const path = url.slice(0, qIndex);
|
|
46
|
+
const params = new URLSearchParams(url.slice(qIndex + 1));
|
|
47
|
+
const entries = [];
|
|
48
|
+
const viewEntries = [];
|
|
49
|
+
const filterEntries = [];
|
|
50
|
+
for (const [k, v] of params.entries()) {
|
|
51
|
+
if (k.startsWith('f_'))
|
|
52
|
+
filterEntries.push([k, v]);
|
|
53
|
+
else if (VIEW_PARAMS.has(k))
|
|
54
|
+
viewEntries.push([k, v]);
|
|
55
|
+
else
|
|
56
|
+
entries.push([k, v]);
|
|
57
|
+
}
|
|
58
|
+
const norm = (e) => e
|
|
59
|
+
.sort((a, b) => a[0] === b[0] ? (a[1] < b[1] ? -1 : 1) : a[0] < b[0] ? -1 : 1)
|
|
60
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
61
|
+
.join('&');
|
|
62
|
+
return {
|
|
63
|
+
path,
|
|
64
|
+
view: norm(viewEntries),
|
|
65
|
+
query: norm(entries),
|
|
66
|
+
filters: norm(filterEntries),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* True when every `f_` filter the item declares is present (same value) in the
|
|
71
|
+
* current href's filters. An item that declares no filters always passes, so it
|
|
72
|
+
* keeps highlighting regardless of transient table filtering.
|
|
73
|
+
*/
|
|
74
|
+
export function declaredFiltersMatch(curFilters, targetFilters) {
|
|
75
|
+
if (!targetFilters)
|
|
76
|
+
return true;
|
|
77
|
+
const cur = new Set(curFilters ? curFilters.split('&') : []);
|
|
78
|
+
return targetFilters.split('&').every((f) => cur.has(f));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Active-state matcher for a nav item against the current href.
|
|
82
|
+
*
|
|
83
|
+
* View-aware, query-aware AND filter-aware so sibling navs over the same model
|
|
84
|
+
* light up ONE at a time:
|
|
85
|
+
* - `view`/`group_by` surface params must match EXACTLY in both directions.
|
|
86
|
+
* This is what keeps "Board" (`?view=kanban&group_by=stage`) and "Issues"
|
|
87
|
+
* (`?view=list`, or a query-less default) mutually exclusive — only the item
|
|
88
|
+
* whose view identity equals the current href stays active.
|
|
89
|
+
* - Other non-`f_` query params (page/sort/search) must match EXACTLY only
|
|
90
|
+
* when the item declares them — transient query never un-highlights a plain
|
|
91
|
+
* link.
|
|
92
|
+
* - `f_` filter params the item DECLARES in its own URL are its identity: they
|
|
93
|
+
* must all be present in the current href. An item that declares NO filters
|
|
94
|
+
* matches on path alone (a manually-filtered table still highlights its base
|
|
95
|
+
* item), preserving the prior behaviour for plain links.
|
|
96
|
+
*/
|
|
97
|
+
export function checkIsActive(href, item, mainNav = false) {
|
|
98
|
+
const hasItems = 'items' in item && Array.isArray(item.items);
|
|
99
|
+
const cur = splitHref(href);
|
|
100
|
+
const target = splitHref(item.url);
|
|
101
|
+
// Same path: this item matches only when the view-identity (view/group_by)
|
|
102
|
+
// matches exactly (sibling surfaces are mutually exclusive), transient query
|
|
103
|
+
// matches when declared, and declared f_ filters are all present. A same-path
|
|
104
|
+
// item that DOESN'T match falls through (a collapsible parent can still be
|
|
105
|
+
// active via a matching child below) rather than returning early.
|
|
106
|
+
// View-identity match: exact in both directions, OR both buckets are
|
|
107
|
+
// "default-equivalent" (bare/`?view=list`/`?view=table`). The latter is what
|
|
108
|
+
// lights the Issues/list item on the bare default landing (`?per_page=15`, no
|
|
109
|
+
// `view`) without ever lighting the Board (`?view=kanban`), which is not a
|
|
110
|
+
// default bucket — so siblings stay mutually exclusive.
|
|
111
|
+
const viewMatches = cur.view === target.view ||
|
|
112
|
+
(isDefaultViewBucket(cur.view) && isDefaultViewBucket(target.view));
|
|
113
|
+
if (cur.path === target.path &&
|
|
114
|
+
viewMatches &&
|
|
115
|
+
(!target.query || cur.query === target.query) &&
|
|
116
|
+
declaredFiltersMatch(cur.filters, target.filters)) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
if (hasItems &&
|
|
120
|
+
item.items.some((i) => checkIsActive(href, i))) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
if (mainNav) {
|
|
124
|
+
const hrefParts = cur.path.split('/');
|
|
125
|
+
const itemParts = target.path.split('/');
|
|
126
|
+
const depth = hrefParts.length >= 3 && hrefParts[1] === 'm' ? 3 : 2;
|
|
127
|
+
const hrefPrefix = hrefParts.slice(0, depth).join('/');
|
|
128
|
+
const itemPrefix = itemParts.slice(0, depth).join('/');
|
|
129
|
+
if (hrefPrefix !== '' && hrefPrefix === itemPrefix) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
if (hasItems) {
|
|
133
|
+
for (const sub of item.items) {
|
|
134
|
+
const subParts = splitHref(sub.url ?? '').path.split('/');
|
|
135
|
+
if (subParts.slice(0, depth).join('/') === hrefPrefix) {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=nav-active.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-active.js","sourceRoot":"","sources":["../../src/layout/nav-active.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;AAExD;;;;;;;;;;;;GAYG;AACH,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAA;AAErE,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACvC,CAAC;AASD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC/B,IAAI,MAAM,KAAK,CAAC,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;IACzE,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CA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,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;gBACzD,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,UAAU,EAAE,CAAC;oBACtD,OAAO,IAAI,CAAA;gBACb,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { NavGroupData } from './types';
|
|
3
|
+
export { checkIsActive, splitHref, declaredFiltersMatch, VIEW_PARAMS } from './nav-active';
|
|
4
|
+
export type { SplitHref } from './nav-active';
|
|
3
5
|
export type NavLinkComponent = React.ComponentType<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
4
6
|
to: string;
|
|
5
7
|
children?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-group.d.ts","sourceRoot":"","sources":["../../src/layout/nav-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA4B9B,OAAO,KAAK,EAAE,YAAY,EAA4C,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"nav-group.d.ts","sourceRoot":"","sources":["../../src/layout/nav-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA4B9B,OAAO,KAAK,EAAE,YAAY,EAA4C,MAAM,SAAS,CAAA;AAGrF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1F,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAChD,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CACF,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IACzC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,aAAa,EAAE,gBAAgB,CAAA;IAC/B,sEAAsE;IACtE,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC,CAAA;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,GACZ,EAAE,aAAa,4BAgDf"}
|
package/dist/layout/nav-group.js
CHANGED
|
@@ -6,6 +6,8 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../primiti
|
|
|
6
6
|
import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, useSidebar, } from '../primitives/sidebar';
|
|
7
7
|
import { Badge } from '../primitives/badge';
|
|
8
8
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '../primitives/dropdown-menu';
|
|
9
|
+
import { checkIsActive } from './nav-active';
|
|
10
|
+
export { checkIsActive, splitHref, declaredFiltersMatch, VIEW_PARAMS } from './nav-active';
|
|
9
11
|
export function NavGroup({ title, items, currentHref, LinkComponent, onItemHover, }) {
|
|
10
12
|
const { state, isMobile } = useSidebar();
|
|
11
13
|
if (items.length === 0)
|
|
@@ -44,95 +46,4 @@ function SidebarMenuCollapsible({ item, href, LinkComponent, onItemHover, }) {
|
|
|
44
46
|
function SidebarMenuCollapsedDropdown({ item, href, LinkComponent, onItemHover, }) {
|
|
45
47
|
return (_jsx(SidebarMenuItem, { children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { tooltip: item.title, isActive: checkIsActive(href, item), children: [item.icon && _jsx(item.icon, {}), _jsx("span", { children: item.title }), hasBadge(item.badge) && _jsx(NavBadge, { children: item.badge }), _jsx(ChevronRight, { className: 'ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90' })] }) }), _jsxs(DropdownMenuContent, { side: 'right', align: 'start', sideOffset: 4, children: [_jsxs(DropdownMenuLabel, { children: [item.title, " ", item.badge ? `(${item.badge})` : ''] }), _jsx(DropdownMenuSeparator, {}), item.items.map((sub) => (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs(LinkComponent, { to: sub.url, className: `${checkIsActive(href, sub) ? 'bg-secondary' : ''}`, onMouseEnter: () => onItemHover?.(sub.url), children: [sub.icon && _jsx(sub.icon, {}), _jsx("span", { className: 'max-w-52 text-wrap', children: sub.title }), hasBadge(sub.badge) && (_jsx("span", { className: 'ms-auto text-xs', children: sub.badge }))] }) }, `${sub.title}-${sub.url}`)))] })] }) }));
|
|
46
48
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Splits a URL into its path, a normalized non-`f_` query-string, and its
|
|
49
|
-
* normalized `f_` filter params (kept separate). Both query parts are sorted so
|
|
50
|
-
* equivalent strings compare equal regardless of param order.
|
|
51
|
-
*
|
|
52
|
-
* `f_` params are split out rather than discarded: a base nav item (no `f_` in
|
|
53
|
-
* its own URL) still ignores them — so a manually-filtered table highlights its
|
|
54
|
-
* base item — but a per-status nav item that DECLARES `f_` params in its URL
|
|
55
|
-
* (e.g. `/m/orders?f_status=eq:reception`) uses them as its identity so sibling
|
|
56
|
-
* status entries light up one at a time instead of all together.
|
|
57
|
-
*/
|
|
58
|
-
function splitHref(url) {
|
|
59
|
-
const qIndex = url.indexOf('?');
|
|
60
|
-
if (qIndex === -1)
|
|
61
|
-
return { path: url, query: '', filters: '' };
|
|
62
|
-
const path = url.slice(0, qIndex);
|
|
63
|
-
const params = new URLSearchParams(url.slice(qIndex + 1));
|
|
64
|
-
const entries = [];
|
|
65
|
-
const filterEntries = [];
|
|
66
|
-
for (const [k, v] of params.entries()) {
|
|
67
|
-
if (k.startsWith('f_'))
|
|
68
|
-
filterEntries.push([k, v]);
|
|
69
|
-
else
|
|
70
|
-
entries.push([k, v]);
|
|
71
|
-
}
|
|
72
|
-
const norm = (e) => e
|
|
73
|
-
.sort((a, b) => a[0] === b[0] ? (a[1] < b[1] ? -1 : 1) : a[0] < b[0] ? -1 : 1)
|
|
74
|
-
.map(([k, v]) => `${k}=${v}`)
|
|
75
|
-
.join('&');
|
|
76
|
-
return { path, query: norm(entries), filters: norm(filterEntries) };
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* True when every `f_` filter the item declares is present (same value) in the
|
|
80
|
-
* current href's filters. An item that declares no filters always passes, so it
|
|
81
|
-
* keeps highlighting regardless of transient table filtering.
|
|
82
|
-
*/
|
|
83
|
-
function declaredFiltersMatch(curFilters, targetFilters) {
|
|
84
|
-
if (!targetFilters)
|
|
85
|
-
return true;
|
|
86
|
-
const cur = new Set(curFilters ? curFilters.split('&') : []);
|
|
87
|
-
return targetFilters.split('&').every((f) => cur.has(f));
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Active-state matcher for a nav item against the current href.
|
|
91
|
-
*
|
|
92
|
-
* Query-aware AND filter-aware so order-status style items that share a path
|
|
93
|
-
* but differ only by a filter param (`/m/orders?f_status=eq:reception` vs
|
|
94
|
-
* `?f_status=eq:delivered`) light up ONE at a time instead of all together:
|
|
95
|
-
* - Non-`f_` query params (real navigation intent) must match EXACTLY when the
|
|
96
|
-
* item declares them — a different (or absent) query is not a match.
|
|
97
|
-
* - `f_` filter params the item DECLARES in its own URL are its identity: they
|
|
98
|
-
* must all be present in the current href. An item that declares NO filters
|
|
99
|
-
* matches on path alone (a manually-filtered table still highlights its base
|
|
100
|
-
* item), preserving the prior behaviour for plain links.
|
|
101
|
-
*/
|
|
102
|
-
function checkIsActive(href, item, mainNav = false) {
|
|
103
|
-
const hasItems = 'items' in item && Array.isArray(item.items);
|
|
104
|
-
const cur = splitHref(href);
|
|
105
|
-
const target = splitHref(item.url);
|
|
106
|
-
// Same path: real (non-f_) query must match exactly when declared; declared
|
|
107
|
-
// f_ filters must all be present in the current href; an item with neither
|
|
108
|
-
// matches the path regardless of the current href's query/filters.
|
|
109
|
-
if (cur.path === target.path) {
|
|
110
|
-
if (target.query && cur.query !== target.query)
|
|
111
|
-
return false;
|
|
112
|
-
return declaredFiltersMatch(cur.filters, target.filters);
|
|
113
|
-
}
|
|
114
|
-
if (hasItems &&
|
|
115
|
-
item.items.some((i) => checkIsActive(href, i))) {
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
if (mainNav) {
|
|
119
|
-
const hrefParts = cur.path.split('/');
|
|
120
|
-
const itemParts = target.path.split('/');
|
|
121
|
-
const depth = hrefParts.length >= 3 && hrefParts[1] === 'm' ? 3 : 2;
|
|
122
|
-
const hrefPrefix = hrefParts.slice(0, depth).join('/');
|
|
123
|
-
const itemPrefix = itemParts.slice(0, depth).join('/');
|
|
124
|
-
if (hrefPrefix !== '' && hrefPrefix === itemPrefix) {
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
if (hasItems) {
|
|
128
|
-
for (const sub of item.items) {
|
|
129
|
-
const subParts = splitHref(sub.url ?? '').path.split('/');
|
|
130
|
-
if (subParts.slice(0, depth).join('/') === hrefPrefix) {
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
49
|
//# sourceMappingURL=nav-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-group.js","sourceRoot":"","sources":["../../src/layout/nav-group.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,GACX,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"nav-group.js","sourceRoot":"","sources":["../../src/layout/nav-group.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,GACX,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AA0B1F,MAAM,UAAU,QAAQ,CAAC,EACvB,KAAK,EAC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,GAAG,EAAE,CAY7B,CACpB,CAAC,IACkB,IACT,GACC,CACnB,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asteby/metacore-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Metacore UI kit — data-table, layout shell, command-menu, hooks y primitives shadcn reutilizables",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
+
"@tanstack/react-query": ">=5",
|
|
77
|
+
"@tanstack/react-router": ">=1.100",
|
|
78
|
+
"@tanstack/react-table": ">=8",
|
|
79
|
+
"date-fns": ">=3",
|
|
76
80
|
"react": ">=18",
|
|
77
81
|
"react-dom": ">=18",
|
|
78
82
|
"react-hook-form": ">=7",
|
|
79
83
|
"react-i18next": ">=13",
|
|
80
|
-
"@tanstack/react-table": ">=8",
|
|
81
|
-
"@tanstack/react-query": ">=5",
|
|
82
|
-
"@tanstack/react-router": ">=1.100",
|
|
83
|
-
"date-fns": ">=3",
|
|
84
84
|
"tailwindcss": ">=4"
|
|
85
85
|
},
|
|
86
86
|
"peerDependenciesMeta": {
|
|
@@ -130,16 +130,17 @@
|
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@tanstack/react-query": "^5.95.0",
|
|
132
132
|
"@tanstack/react-router": "^1.168.0",
|
|
133
|
-
"date-fns": "^4.1.0",
|
|
134
133
|
"@tanstack/react-table": "^8.20.0",
|
|
135
134
|
"@types/react": "^19.0.0",
|
|
136
135
|
"@types/react-dom": "^19.0.0",
|
|
136
|
+
"date-fns": "^4.1.0",
|
|
137
137
|
"react": "^19.2.4",
|
|
138
138
|
"react-dom": "^19.2.4",
|
|
139
139
|
"react-hook-form": "^7.54.0",
|
|
140
140
|
"react-i18next": "^17.0.0",
|
|
141
141
|
"tsc-alias": "^1.8.10",
|
|
142
|
-
"typescript": "^6.0.0"
|
|
142
|
+
"typescript": "^6.0.0",
|
|
143
|
+
"vitest": "4.1.8"
|
|
143
144
|
},
|
|
144
145
|
"publishConfig": {
|
|
145
146
|
"access": "public"
|
|
@@ -148,6 +149,7 @@
|
|
|
148
149
|
"build": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
|
|
149
150
|
"dev": "tsc -w -p tsconfig.json",
|
|
150
151
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
152
|
+
"test": "vitest run",
|
|
151
153
|
"clean": "rm -rf dist"
|
|
152
154
|
}
|
|
153
155
|
}
|