@vuecs/navigation 1.1.1 → 2.0.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 +54 -142
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/item/index.d.ts +2 -0
- package/dist/components/item/index.d.ts.map +1 -0
- package/dist/components/item/module.d.ts +16 -0
- package/dist/components/item/module.d.ts.map +1 -0
- package/dist/components/items/index.d.ts +2 -0
- package/dist/components/items/index.d.ts.map +1 -0
- package/dist/components/items/module.d.ts +27 -0
- package/dist/components/items/module.d.ts.map +1 -0
- package/dist/helpers/component/build.d.ts +3 -0
- package/dist/helpers/component/build.d.ts.map +1 -0
- package/dist/helpers/component/index.d.ts +3 -0
- package/dist/helpers/component/index.d.ts.map +1 -0
- package/dist/helpers/component/types.d.ts +17 -0
- package/dist/helpers/component/types.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +8 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/level.d.ts +11 -0
- package/dist/helpers/level.d.ts.map +1 -0
- package/dist/helpers/match.d.ts +7 -0
- package/dist/helpers/match.d.ts.map +1 -0
- package/dist/helpers/normalize.d.ts +8 -0
- package/dist/helpers/normalize.d.ts.map +1 -0
- package/dist/helpers/reset.d.ts +3 -0
- package/dist/helpers/reset.d.ts.map +1 -0
- package/dist/helpers/trace.d.ts +3 -0
- package/dist/helpers/trace.d.ts.map +1 -0
- package/dist/helpers/url.d.ts.map +1 -0
- package/dist/index.cjs +453 -456
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +87 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +452 -452
- package/dist/index.mjs.map +1 -1
- package/dist/manager/index.d.ts +4 -0
- package/dist/manager/index.d.ts.map +1 -0
- package/dist/manager/module.d.ts +19 -0
- package/dist/manager/module.d.ts.map +1 -0
- package/dist/manager/singleton.d.ts +5 -0
- package/dist/manager/singleton.d.ts.map +1 -0
- package/dist/manager/types.d.ts +8 -0
- package/dist/manager/types.d.ts.map +1 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +10 -6
- package/dist/components/item.d.ts +0 -26
- package/dist/components/item.d.ts.map +0 -1
- package/dist/components/items.d.ts +0 -27
- package/dist/components/items.d.ts.map +0 -1
- package/dist/core/build.d.ts +0 -4
- package/dist/core/build.d.ts.map +0 -1
- package/dist/core/check.d.ts +0 -3
- package/dist/core/check.d.ts.map +0 -1
- package/dist/core/expansion.d.ts +0 -6
- package/dist/core/expansion.d.ts.map +0 -1
- package/dist/core/flatten.d.ts +0 -3
- package/dist/core/flatten.d.ts.map +0 -1
- package/dist/core/index.d.ts +0 -12
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/match.d.ts +0 -3
- package/dist/core/match.d.ts.map +0 -1
- package/dist/core/reduce.d.ts +0 -8
- package/dist/core/reduce.d.ts.map +0 -1
- package/dist/core/refresh.d.ts +0 -3
- package/dist/core/refresh.d.ts.map +0 -1
- package/dist/core/replace.d.ts +0 -6
- package/dist/core/replace.d.ts.map +0 -1
- package/dist/core/reset.d.ts +0 -3
- package/dist/core/reset.d.ts.map +0 -1
- package/dist/core/select.d.ts +0 -4
- package/dist/core/select.d.ts.map +0 -1
- package/dist/core/tier.d.ts +0 -7
- package/dist/core/tier.d.ts.map +0 -1
- package/dist/core/toggle.d.ts +0 -4
- package/dist/core/toggle.d.ts.map +0 -1
- package/dist/module.d.ts +0 -3
- package/dist/module.d.ts.map +0 -1
- package/dist/provider/index.d.ts +0 -3
- package/dist/provider/index.d.ts.map +0 -1
- package/dist/provider/module.d.ts +0 -5
- package/dist/provider/module.d.ts.map +0 -1
- package/dist/provider/type.d.ts +0 -8
- package/dist/provider/type.d.ts.map +0 -1
- package/dist/store/index.d.ts +0 -3
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/module.d.ts +0 -7
- package/dist/store/module.d.ts.map +0 -1
- package/dist/store/type.d.ts +0 -16
- package/dist/store/type.d.ts.map +0 -1
- package/dist/type.d.ts +0 -27
- package/dist/type.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/url.d.ts.map +0 -1
- /package/dist/{utils → helpers}/url.d.ts +0 -0
package/README.md
CHANGED
|
@@ -30,63 +30,54 @@ $ npm i --save @vuecs/navigation
|
|
|
30
30
|
|
|
31
31
|
## Usage
|
|
32
32
|
|
|
33
|
-
To use the navigation component, a
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
The implementation will provide different navigation elements for each tier.
|
|
37
|
-
The tier is a numeric value, which can be any positive integer (including 0).
|
|
33
|
+
To use the navigation component, a function must be defined,
|
|
34
|
+
to retrieve a set of elements for a specific level and parent element.
|
|
38
35
|
|
|
39
36
|
`module.ts`
|
|
40
37
|
|
|
41
38
|
```typescript
|
|
42
39
|
import {
|
|
43
|
-
NavigationItem
|
|
44
|
-
createNavigationProvider
|
|
40
|
+
NavigationItem
|
|
45
41
|
} from "@vuecs/navigation";
|
|
46
42
|
|
|
47
|
-
const
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
const topNav: NavigationItem[] = [
|
|
44
|
+
{ name: 'Home', url: '/', icon: 'fa fa-home' },
|
|
45
|
+
{ name: 'Admin', url: '/admin/', activeMatch: '/admin/', icon: 'fas fa-cog' }
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const sideDefaultNav : NavigationItem[] = [
|
|
49
|
+
{ name: 'Home', url: '/', icon: 'fa fa-home' },
|
|
50
|
+
{ name: 'About', url: '/info', icon: 'fa fa-info' }
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const sideAdminNav : NavigatioNitem[] = [
|
|
54
|
+
{ name: 'Home', url: '/admin/', icon: 'fa fa-home' },
|
|
55
|
+
{ name: 'Users', url: '/admin/users', icon: 'fa fa-user' },
|
|
56
|
+
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
export function getNavigationItems(
|
|
60
|
+
level: number,
|
|
61
|
+
parent?: NavigationItem
|
|
62
|
+
) {
|
|
63
|
+
if (level === 0) {
|
|
64
|
+
return topNav;
|
|
57
65
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// tier does not exist
|
|
71
|
-
return undefined;
|
|
72
|
-
},
|
|
73
|
-
async getItemsActiveByURL(url: string) {
|
|
74
|
-
// build element context for url
|
|
75
|
-
if (url === '/') {
|
|
76
|
-
return [
|
|
77
|
-
primaryItems[0]
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (url === '/about') {
|
|
82
|
-
return [
|
|
83
|
-
primaryItems[1]
|
|
84
|
-
]
|
|
66
|
+
|
|
67
|
+
if(parent) {
|
|
68
|
+
if(level === 1) {
|
|
69
|
+
if(parent.name === 'Home') {
|
|
70
|
+
return sideDefaultNav;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if(parent.name === 'Admin') {
|
|
74
|
+
return sideAdminNav;
|
|
75
|
+
}
|
|
85
76
|
}
|
|
86
|
-
|
|
87
|
-
return undefined;
|
|
88
77
|
}
|
|
89
|
-
|
|
78
|
+
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
90
81
|
```
|
|
91
82
|
|
|
92
83
|
The next step is to create the vue entrypoint.
|
|
@@ -95,30 +86,34 @@ The next step is to create the vue entrypoint.
|
|
|
95
86
|
|
|
96
87
|
```typescript
|
|
97
88
|
import {
|
|
98
|
-
|
|
89
|
+
injectNavigationManager,
|
|
99
90
|
install
|
|
100
91
|
} from '@vuecs/navigation';
|
|
101
92
|
import { createApp } from 'vue';
|
|
102
93
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
103
|
-
import {
|
|
94
|
+
import { getNavigationItems } from './module';
|
|
104
95
|
|
|
105
96
|
const app = createApp();
|
|
106
97
|
|
|
107
98
|
app.use(install({
|
|
108
|
-
|
|
99
|
+
items: ({ level, parent }) => {
|
|
100
|
+
return getNavigationItems(level, parent);
|
|
101
|
+
}
|
|
109
102
|
}));
|
|
110
103
|
|
|
111
104
|
const router = createRouter({
|
|
112
105
|
history: createWebHistory(),
|
|
113
106
|
routes: [
|
|
114
|
-
/* ... */
|
|
107
|
+
/* ... */
|
|
115
108
|
],
|
|
116
109
|
});
|
|
117
110
|
app.use(router);
|
|
118
111
|
|
|
119
112
|
(async () => {
|
|
120
|
-
const
|
|
121
|
-
|
|
113
|
+
const path = router?.currentRoute?.value?.fullPath;
|
|
114
|
+
|
|
115
|
+
const navigationManager = injectNavigationManager();
|
|
116
|
+
await navigationManager.build({ path });
|
|
122
117
|
|
|
123
118
|
app.mount('#app');
|
|
124
119
|
})();
|
|
@@ -132,87 +127,22 @@ if registered globally.
|
|
|
132
127
|
```vue
|
|
133
128
|
<template>
|
|
134
129
|
<div>
|
|
135
|
-
<VCNavItems :
|
|
130
|
+
<VCNavItems :level="0" />
|
|
136
131
|
|
|
137
|
-
<VCNavItems :
|
|
132
|
+
<VCNavItems :level="1" />
|
|
138
133
|
</div>
|
|
139
134
|
</template>
|
|
140
135
|
```
|
|
141
136
|
|
|
142
|
-
## Functions
|
|
143
|
-
|
|
144
|
-
### buildNavigation
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
▸ `function` **buildNavigation**(`context?: NavigationBuildContext`): `Promise`<`void`>
|
|
148
|
-
|
|
149
|
-
Build all navigation tiers, by `url` or active `items`.
|
|
150
|
-
|
|
151
|
-
#### Example
|
|
152
|
-
**`URL`**
|
|
153
|
-
```typescript
|
|
154
|
-
import { buildNavigation } from '@vuecs/navigation';
|
|
155
|
-
|
|
156
|
-
await buildNavigation({
|
|
157
|
-
url: '/'
|
|
158
|
-
});
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
This will call the `getItemsActive` method of the `NavigationProvider` implementation,
|
|
162
|
-
to calculate the active items.
|
|
163
|
-
|
|
164
|
-
**`items`**
|
|
165
|
-
```typescript
|
|
166
|
-
import { buildNavigation } from '@vuecs/navigation';
|
|
167
|
-
|
|
168
|
-
await buildNavigation({
|
|
169
|
-
items: [
|
|
170
|
-
{id: 'default', tier: 0, name: 'Home'}
|
|
171
|
-
]
|
|
172
|
-
})
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
The `items` property will be passed as second argument to the `getItems` method of
|
|
176
|
-
the `NavigationProvider` implementation, to build a specific tier navigation.
|
|
177
|
-
|
|
178
|
-
**`route`**
|
|
179
|
-
```typescript
|
|
180
|
-
import { RouteLocation } from 'vue-router';
|
|
181
|
-
import { buildNavigationWithRoute } from '@vuecs/navigation';
|
|
182
|
-
|
|
183
|
-
const route : RouteLocation = {
|
|
184
|
-
fullPath: '/',
|
|
185
|
-
...
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
await buildNavigation({
|
|
189
|
-
route
|
|
190
|
-
})
|
|
191
|
-
```
|
|
192
|
-
|
|
193
137
|
## Types
|
|
194
138
|
|
|
195
|
-
### NavigationBuildContext
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
import { NavigationItem } from '@vuecs/navigation';
|
|
199
|
-
import { RouteLocationNormalized } from 'vue-router';
|
|
200
|
-
|
|
201
|
-
declare type NavigationBuildContext = {
|
|
202
|
-
items?: NavigationItem[],
|
|
203
|
-
route?: RouteLocationNormalized,
|
|
204
|
-
url?: string
|
|
205
|
-
};
|
|
206
|
-
```
|
|
207
|
-
|
|
208
139
|
### NavigationItem
|
|
209
140
|
|
|
210
141
|
```typescript
|
|
211
142
|
import { ElementType } from '@vuecs/navigation';
|
|
212
143
|
|
|
213
144
|
declare type NavigationItem = {
|
|
214
|
-
|
|
215
|
-
tier?: number,
|
|
145
|
+
level?: number,
|
|
216
146
|
name?: string,
|
|
217
147
|
|
|
218
148
|
url?: string,
|
|
@@ -225,6 +155,7 @@ declare type NavigationItem = {
|
|
|
225
155
|
icon?: string,
|
|
226
156
|
|
|
227
157
|
active?: boolean,
|
|
158
|
+
activeMatch?: string,
|
|
228
159
|
|
|
229
160
|
display?: boolean,
|
|
230
161
|
displayChildren?: boolean,
|
|
@@ -232,33 +163,14 @@ declare type NavigationItem = {
|
|
|
232
163
|
root?: boolean,
|
|
233
164
|
children?: NavigationItem[],
|
|
234
165
|
|
|
235
|
-
|
|
236
|
-
requireLoggedOut?: boolean,
|
|
237
|
-
requirePermissions?: string | string[] | ((checker: (name: string) => boolean) => boolean)
|
|
238
|
-
|
|
239
|
-
[key: string]: any
|
|
240
|
-
};
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### NavigationProvider
|
|
244
|
-
|
|
245
|
-
```typescript
|
|
246
|
-
import { NavigationItem } from '@vuecs/navigation';
|
|
247
|
-
|
|
248
|
-
declare type NavigationProvider = {
|
|
249
|
-
getItems: (
|
|
250
|
-
tier: number, items: NavigationItem[]
|
|
251
|
-
) => Promise<NavigationItem[] | undefined> | undefined | NavigationItem[],
|
|
252
|
-
getItemsActive: (
|
|
253
|
-
url: string
|
|
254
|
-
) => Promise<NavigationItem[]> | NavigationItem[]
|
|
166
|
+
meta?: Record<string, any>
|
|
255
167
|
};
|
|
256
168
|
```
|
|
257
169
|
|
|
258
170
|
## Example
|
|
259
171
|
|
|
260
172
|
For an implementation example, on how to use this library, check out the example
|
|
261
|
-
[package](https://github.com/tada5hi/vuecs/tree/master/examples/
|
|
173
|
+
[package](https://github.com/tada5hi/vuecs/tree/master/examples/nuxt).
|
|
262
174
|
|
|
263
175
|
## License
|
|
264
176
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/item/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import type { NavigationItemNormalized } from '../../types';
|
|
3
|
+
export declare const VCNavItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
data: {
|
|
5
|
+
type: PropType<NavigationItemNormalized>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
data: {
|
|
12
|
+
type: PropType<NavigationItemNormalized>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/components/item/module.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,KAAK,CAAC;AAQhD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAI5D,eAAO,MAAM,SAAS;;cAGM,QAAQ,CAAC,wBAAwB,CAAC;;;;;;;cAAlC,QAAQ,CAAC,wBAAwB,CAAC;;;iGAqL5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/items/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import type { NavigationItemNormalized } from '../../types';
|
|
3
|
+
export declare const VCNavItems: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
level: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
data: {
|
|
9
|
+
type: PropType<NavigationItemNormalized[]>;
|
|
10
|
+
default: any;
|
|
11
|
+
};
|
|
12
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
level: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
data: {
|
|
20
|
+
type: PropType<NavigationItemNormalized[]>;
|
|
21
|
+
default: any;
|
|
22
|
+
};
|
|
23
|
+
}>> & Readonly<{}>, {
|
|
24
|
+
level: number;
|
|
25
|
+
data: NavigationItemNormalized[];
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/components/items/module.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,QAAQ,EAGX,MAAM,KAAK,CAAC;AAQb,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAI5D,eAAO,MAAM,UAAU;;;;;;cAOI,QAAQ,CAAC,wBAAwB,EAAE,CAAC;;;;;;;;;;;cAApC,QAAQ,CAAC,wBAAwB,EAAE,CAAC;;;;;;4EA2E7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/helpers/component/build.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,qBAAqB,IAAK,gBAAgB,CAyBzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/component/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { VNodeClass } from '@vuecs/core';
|
|
2
|
+
export type ComponentOptions = {
|
|
3
|
+
groupClass: VNodeClass;
|
|
4
|
+
groupTag: VNodeClass;
|
|
5
|
+
subGroupTitleClass: VNodeClass;
|
|
6
|
+
subGroupItemsClass: VNodeClass;
|
|
7
|
+
itemClass: VNodeClass;
|
|
8
|
+
itemTag: string;
|
|
9
|
+
separatorTag: string;
|
|
10
|
+
separatorClass: VNodeClass;
|
|
11
|
+
iconClass: VNodeClass;
|
|
12
|
+
linkClass: VNodeClass;
|
|
13
|
+
linkRootClass?: VNodeClass;
|
|
14
|
+
linkTextTag: string;
|
|
15
|
+
linkTextClass: VNodeClass;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/helpers/component/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,UAAU,CAAC;IAErB,kBAAkB,EAAE,UAAU,CAAC;IAC/B,kBAAkB,EAAE,UAAU,CAAC;IAE/B,SAAS,EAAE,UAAU,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAEhB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,UAAU,CAAC;IAE3B,SAAS,EAAE,UAAU,CAAA;IAErB,SAAS,EAAE,UAAU,CAAC;IACtB,aAAa,CAAC,EAAE,UAAU,CAAC;IAE3B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,UAAU,CAAC;CAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type LevelRecord = {
|
|
2
|
+
level: number;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
|
+
export declare function findItemsWithLevel<T extends LevelRecord>(items: T[], tier: number): T[];
|
|
6
|
+
export declare function findItemWithLevel<T extends LevelRecord>(tier: number, items: T[]): T | undefined;
|
|
7
|
+
export declare function removeItemsWithLevel<T extends LevelRecord>(tier: number, items: T[]): T[];
|
|
8
|
+
export declare function replaceLevelItem<T extends LevelRecord>(tier: number, input: T[], next: T | undefined): T[];
|
|
9
|
+
export declare function replaceLevelItems<T extends LevelRecord>(tier: number, src: T[], next: T[]): T[];
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=level.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../src/helpers/level.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,EACpD,KAAK,EAAE,CAAC,EAAE,EACV,IAAI,EAAE,MAAM,GACZ,CAAC,EAAE,CAEN;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EACnD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,EAAE,GACV,CAAC,GAAG,SAAS,CAOhB;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,WAAW,EACtD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,EAAE,GACV,CAAC,EAAE,CAEN;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,WAAW,EAClD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,EAAE,EACV,IAAI,EAAE,CAAC,GAAG,SAAS,GACpB,CAAC,EAAE,CAaL;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EACnD,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,CAAC,EAAE,EACR,IAAI,EAAE,CAAC,EAAE,GACT,CAAC,EAAE,CAON"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NavigationItemNormalized } from '../types';
|
|
2
|
+
type ItemMatchesFindOptions = {
|
|
3
|
+
path?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function findBestItemMatches(items: NavigationItemNormalized[], options?: ItemMatchesFindOptions): NavigationItemNormalized[];
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/helpers/match.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAMzD,KAAK,sBAAsB,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC;AAqDF,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,wBAAwB,EAAE,EACjC,OAAO,GAAE,sBAA2B,GACpC,wBAAwB,EAAE,CAU7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NavigationItem, NavigationItemNormalized } from '../types';
|
|
2
|
+
type NormalizeItemOptions = {
|
|
3
|
+
level: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function normalizeItem(item: NavigationItem, defaults: NormalizeItemOptions): NavigationItemNormalized;
|
|
6
|
+
export declare function normalizeItems(items: NavigationItem[], options: NormalizeItemOptions): NavigationItemNormalized[];
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/helpers/normalize.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzE,KAAK,oBAAoB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;CAChB,CAAC;AA4BF,wBAAgB,aAAa,CACzB,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,oBAAoB,GAC9B,wBAAwB,CAE3B;AAED,wBAAgB,cAAc,CAC1B,KAAK,EAAE,cAAc,EAAE,EACvB,OAAO,EAAE,oBAAoB,GAC7B,wBAAwB,EAAE,CAE7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../src/helpers/reset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AA0BzD,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,wBAAwB,EAAE,EACjC,KAAK,EAAE,MAAM,EAAE,8BAGlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/helpers/trace.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CACxB,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,GACZ,OAAO,CAYT;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAQ7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/helpers/url.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGlD"}
|