@bootkit/ng0 0.0.0-alpha.5 → 0.0.0-alpha.50
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 +2 -2
- package/common/index.d.ts +288 -28
- package/components/accordion/index.d.ts +20 -10
- package/components/button/index.d.ts +7 -10
- package/components/card/index.d.ts +2 -6
- package/components/code/index.d.ts +2 -4
- package/components/collapse/index.d.ts +4 -41
- package/components/confirmation/index.d.ts +14 -16
- package/components/dropdown/index.d.ts +156 -0
- package/components/form-field/index.d.ts +24 -41
- package/components/list/index.d.ts +260 -0
- package/components/modal/index.d.ts +33 -11
- package/components/nav/index.d.ts +34 -32
- package/components/offcanvas/index.d.ts +13 -5
- package/components/pagination/index.d.ts +39 -13
- package/components/popover/index.d.ts +6 -6
- package/components/select/index.d.ts +160 -0
- package/components/sidenav/index.d.ts +122 -0
- package/components/stepper/index.d.ts +3 -4
- package/components/table/index.d.ts +203 -73
- package/components/toast/index.d.ts +14 -8
- package/components/tooltip/index.d.ts +36 -22
- package/components/vertical-menu/index.d.ts +79 -42
- package/data/index.d.ts +98 -38
- package/date/index.d.ts +34 -0
- package/fesm2022/bootkit-ng0-common.mjs +289 -12
- package/fesm2022/bootkit-ng0-common.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-accordion.mjs +38 -33
- package/fesm2022/bootkit-ng0-components-accordion.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-button.mjs +21 -29
- package/fesm2022/bootkit-ng0-components-button.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-card.mjs +18 -26
- package/fesm2022/bootkit-ng0-components-card.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-code.mjs +16 -20
- package/fesm2022/bootkit-ng0-components-code.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-collapse.mjs +20 -132
- package/fesm2022/bootkit-ng0-components-collapse.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-confirmation.mjs +24 -34
- package/fesm2022/bootkit-ng0-components-confirmation.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-dropdown.mjs +308 -0
- package/fesm2022/bootkit-ng0-components-dropdown.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-form-field.mjs +62 -84
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-list.mjs +564 -0
- package/fesm2022/bootkit-ng0-components-list.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-modal.mjs +48 -29
- package/fesm2022/bootkit-ng0-components-modal.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-nav.mjs +60 -68
- package/fesm2022/bootkit-ng0-components-nav.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs +20 -13
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-overlay.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-pagination.mjs +61 -26
- package/fesm2022/bootkit-ng0-components-pagination.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-popover.mjs +12 -12
- package/fesm2022/bootkit-ng0-components-popover.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-select.mjs +448 -0
- package/fesm2022/bootkit-ng0-components-select.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs +296 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs +15 -42
- package/fesm2022/bootkit-ng0-components-stepper.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-table.mjs +304 -167
- package/fesm2022/bootkit-ng0-components-table.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-toast.mjs +62 -84
- package/fesm2022/bootkit-ng0-components-toast.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-tooltip.mjs +87 -74
- package/fesm2022/bootkit-ng0-components-tooltip.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs +171 -114
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-data.mjs +152 -39
- package/fesm2022/bootkit-ng0-data.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-date.mjs +50 -0
- package/fesm2022/bootkit-ng0-date.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-file.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-form.mjs +575 -264
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-http.mjs +61 -34
- package/fesm2022/bootkit-ng0-http.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-layouts-layout1.mjs +317 -0
- package/fesm2022/bootkit-ng0-layouts-layout1.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs +103 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-localization.mjs +431 -105
- package/fesm2022/bootkit-ng0-localization.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-platform-browser.mjs +179 -0
- package/fesm2022/bootkit-ng0-platform-browser.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-routing.mjs +80 -0
- package/fesm2022/bootkit-ng0-routing.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-script.mjs +3 -3
- package/fesm2022/bootkit-ng0-script.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-security.mjs +175 -40
- package/fesm2022/bootkit-ng0-security.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-utils.mjs +122 -0
- package/fesm2022/bootkit-ng0-utils.mjs.map +1 -0
- package/fesm2022/bootkit-ng0.mjs +2 -2
- package/fesm2022/bootkit-ng0.mjs.map +1 -1
- package/form/index.d.ts +153 -56
- package/http/index.d.ts +45 -14
- package/index.d.ts +2 -2
- package/layouts/layout1/index.d.ts +201 -0
- package/localization/index.d.ts +231 -42
- package/localization/locales/index.d.ts +7 -0
- package/package.json +57 -17
- package/platform/browser/index.d.ts +88 -0
- package/routing/index.d.ts +124 -0
- package/security/index.d.ts +76 -11
- package/utils/index.d.ts +63 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ActivatedRouteSnapshot, UrlTree, RouterStateSnapshot, Route as Route$1 } from '@angular/router';
|
|
3
|
+
import { ClaimLike } from '@bootkit/ng0/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A function that resolves a title from the route and router state
|
|
8
|
+
*/
|
|
9
|
+
type RouteTitleResolver = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => string;
|
|
10
|
+
/**
|
|
11
|
+
* A router link value.
|
|
12
|
+
*/
|
|
13
|
+
type RouterLinkValue = any[] | string | UrlTree | null | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* A function that resolves a router link.
|
|
16
|
+
* @param route The activated route snapshot
|
|
17
|
+
* @param state The router state snapshot
|
|
18
|
+
* @returns The resolved link (RouteDataLink)
|
|
19
|
+
*/
|
|
20
|
+
type RouterLinkValueResolver = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => RouterLinkValue;
|
|
21
|
+
/**
|
|
22
|
+
* A function that resolves a meta description.
|
|
23
|
+
* @param route The activated route snapshot
|
|
24
|
+
* @param state The router state snapshot
|
|
25
|
+
* @returns The resolved meta description string
|
|
26
|
+
*/
|
|
27
|
+
type RouteMetaDescriptionResolver = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => string;
|
|
28
|
+
/**
|
|
29
|
+
* A function that resolves meta tags from the route and router state
|
|
30
|
+
*/
|
|
31
|
+
type RouteMetaTagResolver = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => {
|
|
32
|
+
[metaTagName: string]: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Route data
|
|
36
|
+
*/
|
|
37
|
+
interface RouteData {
|
|
38
|
+
/**
|
|
39
|
+
* The title of the route, or a function that resolves the title.
|
|
40
|
+
*/
|
|
41
|
+
title?: string | RouteTitleResolver;
|
|
42
|
+
/**
|
|
43
|
+
* A Router link defined for the route.
|
|
44
|
+
*/
|
|
45
|
+
link?: RouterLinkValue | RouterLinkValueResolver;
|
|
46
|
+
/**
|
|
47
|
+
* linkTarget
|
|
48
|
+
*/
|
|
49
|
+
linkTarget?: '_self' | '_blank' | '_parent' | '_top';
|
|
50
|
+
/**
|
|
51
|
+
* meta
|
|
52
|
+
*/
|
|
53
|
+
meta?: string | RouteMetaTagResolver | RouteMetaDescriptionResolver;
|
|
54
|
+
/**
|
|
55
|
+
* Route security claim.
|
|
56
|
+
*/
|
|
57
|
+
claim?: ClaimLike;
|
|
58
|
+
/**
|
|
59
|
+
* Route childreen.
|
|
60
|
+
*/
|
|
61
|
+
children?: RouteData[];
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Router Activated Route Snapshot.
|
|
66
|
+
* Represents the state of an activated route in the router.
|
|
67
|
+
*/
|
|
68
|
+
interface RouterActivatedRouteSnapshot {
|
|
69
|
+
/**
|
|
70
|
+
* The original ActivatedRouteSnapshot
|
|
71
|
+
*/
|
|
72
|
+
activatedRoute: ActivatedRouteSnapshot;
|
|
73
|
+
/**
|
|
74
|
+
* Resolved title, if any
|
|
75
|
+
*/
|
|
76
|
+
title?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Resolved link, if any
|
|
79
|
+
*/
|
|
80
|
+
link: RouterLinkValue;
|
|
81
|
+
/**
|
|
82
|
+
* Children routes
|
|
83
|
+
*/
|
|
84
|
+
children: RouterActivatedRouteSnapshot[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Extended Angular Route interface with additional data property.
|
|
88
|
+
*/
|
|
89
|
+
interface Route extends Route$1 {
|
|
90
|
+
children?: Routes;
|
|
91
|
+
data?: RouteData;
|
|
92
|
+
}
|
|
93
|
+
type Routes = Route[];
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Service to interact with Angular Router.
|
|
97
|
+
*/
|
|
98
|
+
declare class RouterService {
|
|
99
|
+
private readonly _router;
|
|
100
|
+
/**
|
|
101
|
+
* Get activated route tree.
|
|
102
|
+
* @param outlets List of outlets to include, default is ['primary']
|
|
103
|
+
* @returns Observable of the activated route tree
|
|
104
|
+
*/
|
|
105
|
+
getActivatedRouteTree(outlets?: string[]): Observable<RouterActivatedRouteSnapshot>;
|
|
106
|
+
/**
|
|
107
|
+
* Get activated routes as a flat array from root to the deepest child for a specific outlet.
|
|
108
|
+
* @param outlet The outlet to include, default is 'primary'
|
|
109
|
+
* @returns Observable of the activated routes array
|
|
110
|
+
*/
|
|
111
|
+
getActivatedRoutes(outlet?: string): Observable<RouterActivatedRouteSnapshot[]>;
|
|
112
|
+
/**
|
|
113
|
+
* Map a route to RouterRouteSnapshot
|
|
114
|
+
* @param route The route to map
|
|
115
|
+
* @param outlets The outlets to include
|
|
116
|
+
* @returns The mapped RouterRouteSnapshot
|
|
117
|
+
*/
|
|
118
|
+
private _mapRoute;
|
|
119
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouterService, never>;
|
|
120
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RouterService>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { RouterService };
|
|
124
|
+
export type { Route, RouteData, RouteMetaDescriptionResolver, RouteMetaTagResolver, RouteTitleResolver, RouterActivatedRouteSnapshot, RouterLinkValue, RouterLinkValueResolver, Routes };
|
package/security/index.d.ts
CHANGED
|
@@ -1,31 +1,55 @@
|
|
|
1
|
-
import { ClaimLike } from '@bootkit/ng0/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
2
|
import { TemplateRef, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import { ClaimLike, UserCondition } from '@bootkit/ng0/common';
|
|
4
4
|
|
|
5
5
|
/** User */
|
|
6
6
|
declare class User {
|
|
7
|
-
readonly claims: string[]
|
|
7
|
+
readonly claims: i0.WritableSignal<string[]>;
|
|
8
8
|
constructor(claims: string[]);
|
|
9
|
-
|
|
9
|
+
addClaim(claim: string): boolean;
|
|
10
|
+
removeClaim(claim: string): boolean;
|
|
11
|
+
hasAllClaims(claims: string[]): boolean;
|
|
10
12
|
hasAnyClaim(claims: string[]): boolean;
|
|
11
13
|
hasClaim(claim: ClaimLike): boolean;
|
|
12
14
|
}
|
|
13
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Service to manage the current user state.
|
|
18
|
+
*/
|
|
14
19
|
declare class UserStore<U extends User = User> {
|
|
15
20
|
readonly user: i0.WritableSignal<U | null | undefined>;
|
|
16
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Check if the given condition is met by the current user.
|
|
23
|
+
* If there is no user, only 'false' condition is met.
|
|
24
|
+
* If there is a user, 'true' conditions and claims will be checked.
|
|
25
|
+
* @param condition The user condition to check
|
|
26
|
+
* @returns Whether the condition is met
|
|
27
|
+
*/
|
|
28
|
+
checkCondition(condition: UserCondition): boolean;
|
|
17
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserStore<any>, never>;
|
|
18
30
|
static ɵprov: i0.ɵɵInjectableDeclaration<UserStore<any>>;
|
|
19
31
|
}
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated use *ng0User instead
|
|
35
|
+
*/
|
|
36
|
+
declare class ClaimDirective {
|
|
23
37
|
private _viewCreated;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
private _templateRef;
|
|
39
|
+
private _viewContainer;
|
|
40
|
+
private _userStore;
|
|
41
|
+
/**
|
|
42
|
+
* Claim to check
|
|
43
|
+
*/
|
|
44
|
+
readonly claim: i0.InputSignal<ClaimLike | null | undefined>;
|
|
45
|
+
constructor();
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClaimDirective, never>;
|
|
47
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ClaimDirective, "[ng0Claim]", ["ng0Claim"], { "claim": { "alias": "ng0Claim"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
27
48
|
}
|
|
28
49
|
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated use *ng0User directive instead
|
|
52
|
+
*/
|
|
29
53
|
declare class GuestUserDirective {
|
|
30
54
|
private _created;
|
|
31
55
|
constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, userStore: UserStore);
|
|
@@ -35,8 +59,49 @@ declare class GuestUserDirective {
|
|
|
35
59
|
|
|
36
60
|
declare class SecurityModule {
|
|
37
61
|
static ɵfac: i0.ɵɵFactoryDeclaration<SecurityModule, never>;
|
|
38
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SecurityModule, never, [typeof
|
|
62
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SecurityModule, never, [typeof ClaimDirective, typeof GuestUserDirective], [typeof ClaimDirective, typeof GuestUserDirective]>;
|
|
39
63
|
static ɵinj: i0.ɵɵInjectorDeclaration<SecurityModule>;
|
|
40
64
|
}
|
|
41
65
|
|
|
42
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Directive to conditionally display content based on user claims or conditions.
|
|
68
|
+
* If there is no condition provided, the content is always shown.
|
|
69
|
+
* If a condition is provided, it checks against the current user.
|
|
70
|
+
* @example
|
|
71
|
+
* ```html
|
|
72
|
+
* <ng-container *ng0User="true">
|
|
73
|
+
* This content is shown only if there is a logged-in user, regardless of claims.
|
|
74
|
+
* </ng-container>
|
|
75
|
+
* <ng-container *ng0User="false">
|
|
76
|
+
* This content is shown only if there is no logged-in user.
|
|
77
|
+
* </ng-container>
|
|
78
|
+
* <ng-container *ng0User="'admin'">
|
|
79
|
+
* This content is shown only if the user has the 'admin' claim.
|
|
80
|
+
* </ng-container>
|
|
81
|
+
* <ng-container *ng0User="{ all: ['read', 'write'] }">
|
|
82
|
+
* This content is shown only if the user has both 'read' and 'write' claims.
|
|
83
|
+
* </ng-container>
|
|
84
|
+
* <ng-container *ng0User="{ any: ['editor', 'contributor'] }">
|
|
85
|
+
* This content is shown if the user has either 'editor' or 'contributor' claims.
|
|
86
|
+
* </ng-container>
|
|
87
|
+
* <ng-container *ng0User="null">
|
|
88
|
+
* This content is always shown, regardless of user state.
|
|
89
|
+
* </ng-container>
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
declare class UserDirective {
|
|
93
|
+
private _viewCreated;
|
|
94
|
+
private readonly _templateRef;
|
|
95
|
+
private readonly _viewContainer;
|
|
96
|
+
private readonly _userStore;
|
|
97
|
+
/**
|
|
98
|
+
* Show condition to check
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
readonly condition: i0.InputSignal<UserCondition | null | undefined>;
|
|
102
|
+
constructor();
|
|
103
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserDirective, never>;
|
|
104
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<UserDirective, "[ng0User]", ["ng0User"], { "condition": { "alias": "ng0User"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { ClaimDirective, GuestUserDirective, SecurityModule, User, UserDirective, UserStore };
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Easing function type definition.
|
|
5
|
+
*/
|
|
6
|
+
type EasingFn = (t: number) => number;
|
|
7
|
+
/**
|
|
8
|
+
* A counter that animates a numeric value from a start to an end value over a specified duration using an easing function.
|
|
9
|
+
*/
|
|
10
|
+
declare class Counter {
|
|
11
|
+
readonly from: number;
|
|
12
|
+
readonly to: number;
|
|
13
|
+
readonly duration: number;
|
|
14
|
+
private _subscription?;
|
|
15
|
+
readonly value: _angular_core.WritableSignal<number>;
|
|
16
|
+
readonly running: _angular_core.WritableSignal<boolean>;
|
|
17
|
+
readonly easing: EasingFn;
|
|
18
|
+
constructor(from: number, to: number, duration?: number, easing?: EasingFn, currentValue?: number);
|
|
19
|
+
/**
|
|
20
|
+
* Resets the counter and starts it.
|
|
21
|
+
* This method should be called in a browser environment.
|
|
22
|
+
* @returns void
|
|
23
|
+
*/
|
|
24
|
+
start(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Stops the counter animation.
|
|
27
|
+
*/
|
|
28
|
+
stop(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A collection of common easing functions for animations.
|
|
32
|
+
*/
|
|
33
|
+
declare const easingFunctions: {
|
|
34
|
+
linear: (t: number) => number;
|
|
35
|
+
easeIn: (t: number) => number;
|
|
36
|
+
easeOut: (t: number) => number;
|
|
37
|
+
easeInOut: (t: number) => number;
|
|
38
|
+
smooth: (t: number) => number;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
declare class StyleManager {
|
|
42
|
+
private readonly _rendererFactory;
|
|
43
|
+
private readonly _document;
|
|
44
|
+
private readonly _renderer;
|
|
45
|
+
private readonly _loadedStyles;
|
|
46
|
+
/**
|
|
47
|
+
* Loads a CSS
|
|
48
|
+
* @param url
|
|
49
|
+
* @returns Promise<HTMLLinkElement>
|
|
50
|
+
*/
|
|
51
|
+
load(url: string): Promise<HTMLLinkElement>;
|
|
52
|
+
/**
|
|
53
|
+
* Unloads a CSS from the DOM
|
|
54
|
+
* @param url
|
|
55
|
+
* @returns void
|
|
56
|
+
*/
|
|
57
|
+
unload(url: string): void;
|
|
58
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StyleManager, never>;
|
|
59
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<StyleManager>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Counter, StyleManager, easingFunctions };
|
|
63
|
+
export type { EasingFn };
|