@vuecs/navigation 1.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/LICENSE +21 -0
- package/README.md +267 -0
- package/core/index.cjs +1 -0
- package/core/index.d.ts +2 -0
- package/core/index.mjs +1 -0
- package/core/package.json +5 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/item.d.ts +26 -0
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/items.d.ts +27 -0
- package/dist/components/items.d.ts.map +1 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/core/build.d.ts +4 -0
- package/dist/core/build.d.ts.map +1 -0
- package/dist/core/check.d.ts +3 -0
- package/dist/core/check.d.ts.map +1 -0
- package/dist/core/expansion.d.ts +6 -0
- package/dist/core/expansion.d.ts.map +1 -0
- package/dist/core/flatten.d.ts +3 -0
- package/dist/core/flatten.d.ts.map +1 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/match.d.ts +3 -0
- package/dist/core/match.d.ts.map +1 -0
- package/dist/core/reduce.d.ts +8 -0
- package/dist/core/reduce.d.ts.map +1 -0
- package/dist/core/refresh.d.ts +3 -0
- package/dist/core/refresh.d.ts.map +1 -0
- package/dist/core/replace.d.ts +6 -0
- package/dist/core/replace.d.ts.map +1 -0
- package/dist/core/reset.d.ts +3 -0
- package/dist/core/reset.d.ts.map +1 -0
- package/dist/core/select.d.ts +4 -0
- package/dist/core/select.d.ts.map +1 -0
- package/dist/core/tier.d.ts +7 -0
- package/dist/core/tier.d.ts.map +1 -0
- package/dist/core/toggle.d.ts +4 -0
- package/dist/core/toggle.d.ts.map +1 -0
- package/dist/index.cjs +593 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +579 -0
- package/dist/index.mjs.map +1 -0
- package/dist/module.d.ts +3 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/module.d.ts +5 -0
- package/dist/provider/module.d.ts.map +1 -0
- package/dist/provider/type.d.ts +8 -0
- package/dist/provider/type.d.ts.map +1 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/module.d.ts +7 -0
- package/dist/store/module.d.ts.map +1 -0
- package/dist/store/type.d.ts +16 -0
- package/dist/store/type.d.ts.map +1 -0
- package/dist/type.d.ts +26 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/url.d.ts +2 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/vue.d.ts +8 -0
- package/dist/vue.d.ts.map +1 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2022 Peter Placzek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# @vuecs/navigation ðŸ§
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/@vuecs%2Fnavigation)
|
|
4
|
+
[](https://github.com/Tada5hi/vuecs/actions/workflows/main.yml)
|
|
5
|
+
|
|
6
|
+
A package containing basic components, to build multi level navigation menus.
|
|
7
|
+
|
|
8
|
+
> **Note**
|
|
9
|
+
> The package is still in development and the API is still subject to change.
|
|
10
|
+
> Besides, the documentation still needs to be expanded
|
|
11
|
+
|
|
12
|
+
**Table of Contents**
|
|
13
|
+
|
|
14
|
+
- [Installation](#installation)
|
|
15
|
+
- [Usage](#usage)
|
|
16
|
+
- [Functions](#functions)
|
|
17
|
+
- [buildNavigation](#buildnavigation)
|
|
18
|
+
- [Types](#types)
|
|
19
|
+
- [NavigationBuildContext](#navigationbuildcontext)
|
|
20
|
+
- [NavigationItem](#NavigationItem)
|
|
21
|
+
- [NavigationProvider](#navigationprovider)
|
|
22
|
+
- [Example](#example)
|
|
23
|
+
- [License](#license)
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
$ npm i --save @vuecs/navigation
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
To use the navigation component, a constant must be defined,
|
|
34
|
+
which satisfy the [NavigationProvider](#navigationprovider) type.
|
|
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).
|
|
38
|
+
|
|
39
|
+
`module.ts`
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import {
|
|
43
|
+
NavigationItem,
|
|
44
|
+
createNavigationProvider
|
|
45
|
+
} from "@vuecs/navigation";
|
|
46
|
+
|
|
47
|
+
const primaryItems: NavigationItem[] = [
|
|
48
|
+
{
|
|
49
|
+
name: 'Home',
|
|
50
|
+
url: '/',
|
|
51
|
+
icon: 'fa fa-home'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'About',
|
|
55
|
+
url: '/about',
|
|
56
|
+
icon: 'fa fa-info'
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
export const navigationProvider = createNavigationProvider({
|
|
61
|
+
async getItems(tier: number, itemsActive: NavigationItem[]) {
|
|
62
|
+
// Return elements for a specific tier.
|
|
63
|
+
// The context provides the current active elements for
|
|
64
|
+
// the parent tiers.
|
|
65
|
+
|
|
66
|
+
if(tier === 0) {
|
|
67
|
+
return primaryItems;
|
|
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
|
+
]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The next step is to create the vue entrypoint.
|
|
93
|
+
|
|
94
|
+
`index.ts`
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
import {
|
|
98
|
+
buildNavigation,
|
|
99
|
+
install
|
|
100
|
+
} from '@vuecs/navigation';
|
|
101
|
+
import { createApp } from 'vue';
|
|
102
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
103
|
+
import { navigationProvider } from './module';
|
|
104
|
+
|
|
105
|
+
const app = createApp();
|
|
106
|
+
|
|
107
|
+
app.use(install({
|
|
108
|
+
navigationProvider
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const router = createRouter({
|
|
112
|
+
history: createWebHistory(),
|
|
113
|
+
routes: [
|
|
114
|
+
/* ... */
|
|
115
|
+
],
|
|
116
|
+
});
|
|
117
|
+
app.use(router);
|
|
118
|
+
|
|
119
|
+
(async () => {
|
|
120
|
+
const url = router?.currentRoute?.value?.fullPath;
|
|
121
|
+
await buildNavigation({ url });
|
|
122
|
+
|
|
123
|
+
app.mount('#app');
|
|
124
|
+
})();
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
After those steps are completed, the `VCNavItems` SFC can be placed anywhere,
|
|
130
|
+
if registered globally.
|
|
131
|
+
|
|
132
|
+
```vue
|
|
133
|
+
<template>
|
|
134
|
+
<div>
|
|
135
|
+
<VCNavItems :tier="0" />
|
|
136
|
+
|
|
137
|
+
<VCNavItems :tier="1" />
|
|
138
|
+
</div>
|
|
139
|
+
</template>
|
|
140
|
+
```
|
|
141
|
+
|
|
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
|
+
## Types
|
|
194
|
+
|
|
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
|
+
### NavigationItem
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { ElementType } from '@vuecs/navigation';
|
|
212
|
+
|
|
213
|
+
declare type NavigationItem = {
|
|
214
|
+
id?: string | number,
|
|
215
|
+
tier?: number,
|
|
216
|
+
name?: string,
|
|
217
|
+
|
|
218
|
+
url?: string,
|
|
219
|
+
urlTarget?: '_self' | '_blank' | '_parent' | '_top' | string,
|
|
220
|
+
|
|
221
|
+
default?: boolean,
|
|
222
|
+
// link or separator
|
|
223
|
+
type?: `${ElementType}`,
|
|
224
|
+
|
|
225
|
+
icon?: string,
|
|
226
|
+
|
|
227
|
+
active?: boolean,
|
|
228
|
+
|
|
229
|
+
display?: boolean,
|
|
230
|
+
displayChildren?: boolean,
|
|
231
|
+
|
|
232
|
+
root?: boolean,
|
|
233
|
+
children?: NavigationItem[],
|
|
234
|
+
|
|
235
|
+
requireLoggedIn?: boolean,
|
|
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[]
|
|
255
|
+
};
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Example
|
|
259
|
+
|
|
260
|
+
For an implementation example, on how to use this library, check out the example
|
|
261
|
+
[package](https://github.com/tada5hi/vuecs/tree/master/examples/basic).
|
|
262
|
+
|
|
263
|
+
## License
|
|
264
|
+
|
|
265
|
+
Made with 💚
|
|
266
|
+
|
|
267
|
+
Published under [MIT License](./LICENSE).
|
package/core/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@vue-layout/core');
|
package/core/index.d.ts
ADDED
package/core/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vue-layout/core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import type { NavigationItem } from '../type';
|
|
3
|
+
export declare const VCNavItem: import("vue").DefineComponent<{
|
|
4
|
+
tier: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
component: {
|
|
9
|
+
type: PropType<NavigationItem>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
tier: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
component: {
|
|
20
|
+
type: PropType<NavigationItem>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
}>>, {
|
|
24
|
+
tier: number;
|
|
25
|
+
}, {}>;
|
|
26
|
+
//# sourceMappingURL=item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../src/components/item.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,KAAK,CAAC;AAUrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAQ9C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;MAqKpB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PropType, VNode } from 'vue';
|
|
2
|
+
import type { NavigationItem } from '../type';
|
|
3
|
+
export declare const VCNavItems: import("vue").DefineComponent<{
|
|
4
|
+
tier: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
entities: {
|
|
9
|
+
type: PropType<NavigationItem[]>;
|
|
10
|
+
default: any;
|
|
11
|
+
};
|
|
12
|
+
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
tier: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
entities: {
|
|
20
|
+
type: PropType<NavigationItem[]>;
|
|
21
|
+
default: any;
|
|
22
|
+
};
|
|
23
|
+
}>>, {
|
|
24
|
+
tier: number;
|
|
25
|
+
entities: NavigationItem[];
|
|
26
|
+
}, {}>;
|
|
27
|
+
//# sourceMappingURL=items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../src/components/items.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAc,MAAM,KAAK,CAAC;AAIvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;MA8DrB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum SlotName {
|
|
2
|
+
ITEM = "item",
|
|
3
|
+
SEPARATOR = "separator",
|
|
4
|
+
LINK = "link",
|
|
5
|
+
SUB = "sub",
|
|
6
|
+
SUB_TITLE = "sub-title",
|
|
7
|
+
SUB_ITEMS = "sub-items"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ElementType {
|
|
10
|
+
LINK = "link",
|
|
11
|
+
SEPARATOR = "separator"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAChB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,SAAS,cAAc;IACvB,SAAS,cAAc;CAC1B;AAED,oBAAY,WAAW;IACnB,IAAI,SAAS;IACb,SAAS,cAAc;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/core/build.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK9C,wBAAsB,sBAAsB,CACxC,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,cAAc,EAAE,GAC/B,OAAO,CAAC,OAAO,CAAC,CAoClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/core/check.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAI,KAAK,IAAI,cAAc,CAuGzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expansion.d.ts","sourceRoot":"","sources":["../../src/core/expansion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK9C,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,cAAc,EAAE,EACvB,IAAI,EAAE,cAAc,EACpB,WAAW,UAAQ,GACnB;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAC,CAwC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/core/flatten.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,4BAA4B,CACxC,KAAK,EAAE,cAAc,EAAE,GACvB,cAAc,EAAE,CAiBnB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './build';
|
|
2
|
+
export * from './expansion';
|
|
3
|
+
export * from './flatten';
|
|
4
|
+
export * from './match';
|
|
5
|
+
export * from './reduce';
|
|
6
|
+
export * from './refresh';
|
|
7
|
+
export * from './reset';
|
|
8
|
+
export * from './replace';
|
|
9
|
+
export * from './select';
|
|
10
|
+
export * from './tier';
|
|
11
|
+
export * from './toggle';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../src/core/match.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,qBAAqB,CACjC,GAAG,CAAC,EAAE,cAAc,EACpB,GAAG,CAAC,EAAE,cAAc,GACrB,OAAO,CA4CT"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NavigationItem } from '../type';
|
|
2
|
+
type ComponentRestrictionContext = {
|
|
3
|
+
hasPermission: (name: string) => boolean;
|
|
4
|
+
isLoggedIn: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function reduceNavigationElementsByRestriction<T extends NavigationItem>(items: T[], context: ComponentRestrictionContext): T[];
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=reduce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reduce.d.ts","sourceRoot":"","sources":["../../src/core/reduce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,KAAK,2BAA2B,GAAG;IAC/B,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,UAAU,EAAE,MAAM,OAAO,CAAA;CAC5B,CAAC;AAEF,wBAAgB,qCAAqC,CAAC,CAAC,SAAS,cAAc,EAC1E,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,EAAE,2BAA2B,GACpC,CAAC,EAAE,CAsDN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/core/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,QAW9E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { MaybeRef } from 'vue';
|
|
2
|
+
import type { NavigationStore } from '../store';
|
|
3
|
+
import type { NavigationItem } from '../type';
|
|
4
|
+
export declare function replaceNavigationTierItemActive(store: NavigationStore, tier: number, item: NavigationItem | undefined): void;
|
|
5
|
+
export declare function replaceNavigationTierItems(store: NavigationStore, tier: number, items: MaybeRef<NavigationItem[]>): void;
|
|
6
|
+
//# sourceMappingURL=replace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../../src/core/replace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,wBAAgB,+BAA+B,CAC3C,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,cAAc,GAAG,SAAS,QAcnC;AAED,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,QAAQ,CAAC,cAAc,EAAE,CAAC,QAQpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../src/core/reset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,cAAc,EAAE,EACvB,IAAI,UAAO,oBAed"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/core/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAO9C,wBAAsB,wBAAwB,CAC1C,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,cAAc,iBAyB5B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MaybeRef } from 'vue';
|
|
2
|
+
import type { NavigationItem } from '../type';
|
|
3
|
+
export declare function findNavigationItemsForTier(items: NavigationItem[], tier: number): NavigationItem[];
|
|
4
|
+
export declare function findNavigationItemForTier(items: NavigationItem[], tier: number): NavigationItem | undefined;
|
|
5
|
+
export declare function setTierForNavigationItems(items: MaybeRef<NavigationItem[]>, tier: number): NavigationItem[];
|
|
6
|
+
export declare function removeTierFromNavigationItems(items: MaybeRef<NavigationItem[]>, tier: number): NavigationItem[];
|
|
7
|
+
//# sourceMappingURL=tier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier.d.ts","sourceRoot":"","sources":["../../src/core/tier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,cAAc,EAAE,EACvB,IAAI,EAAE,MAAM,GACZ,cAAc,EAAE,CAMnB;AAED,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,cAAc,EAAE,EACvB,IAAI,EAAE,MAAM,GACZ,cAAc,GAAG,SAAS,CAO7B;AAED,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,QAAQ,CAAC,cAAc,EAAE,CAAC,EACjC,IAAI,EAAE,MAAM,oBAYf;AAED,wBAAgB,6BAA6B,CACzC,KAAK,EAAE,QAAQ,CAAC,cAAc,EAAE,CAAC,EACjC,IAAI,EAAE,MAAM,oBAQf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/core/toggle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAM9C,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,cAAc,QAc5B"}
|