ngx-dev-toolbar 4.1.0 → 4.2.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/components/icon-button/icon-button.component.d.ts +13 -0
- package/components/icons/icon.models.d.ts +1 -1
- package/components/icons/pin-icon.component.d.ts +6 -0
- package/components/list-item/list-item.component.d.ts +24 -1
- package/fesm2022/ngx-dev-toolbar.mjs +747 -173
- package/fesm2022/ngx-dev-toolbar.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/models/tool-view-state.models.d.ts +2 -0
- package/models/toolbar-config.interface.d.ts +24 -0
- package/models/toolbar.interface.d.ts +19 -0
- package/package.json +1 -1
- package/tools/app-features-tool/app-features-internal.service.d.ts +6 -0
- package/tools/app-features-tool/app-features-tool.component.d.ts +5 -0
- package/tools/app-features-tool/app-features.service.d.ts +7 -0
- package/tools/feature-flags-tool/feature-flags-internal.service.d.ts +6 -0
- package/tools/feature-flags-tool/feature-flags-tool.component.d.ts +5 -0
- package/tools/feature-flags-tool/feature-flags.service.d.ts +7 -0
- package/tools/permissions-tool/permissions-internal.service.d.ts +6 -0
- package/tools/permissions-tool/permissions-tool.component.d.ts +5 -0
- package/tools/permissions-tool/permissions.service.d.ts +7 -0
- package/tools/presets-tool/presets-tool.component.d.ts +5 -0
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './components/list-item/list-item.component';
|
|
|
7
7
|
export * from './components/toolbar-tool/toolbar-tool.component';
|
|
8
8
|
export * from './components/toolbar-tool/toolbar-tool.models';
|
|
9
9
|
export * from './components/button/button.component';
|
|
10
|
+
export * from './components/icon-button/icon-button.component';
|
|
10
11
|
export * from './components/input/input.component';
|
|
11
12
|
export * from './components/select/select.component';
|
|
12
13
|
export * from './components/card/card.component';
|
|
@@ -9,4 +9,6 @@ export interface ToolViewState {
|
|
|
9
9
|
filter: string;
|
|
10
10
|
/** Sort order for list items (currently only 'asc' supported, reserved for future use) */
|
|
11
11
|
sortOrder: 'asc' | 'desc';
|
|
12
|
+
/** IDs of pinned items that should appear at the top of the list */
|
|
13
|
+
pinnedIds?: string[];
|
|
12
14
|
}
|
|
@@ -43,4 +43,28 @@ export interface ToolbarConfig {
|
|
|
43
43
|
* @default true
|
|
44
44
|
*/
|
|
45
45
|
showPresetsTool?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Callback to persist a forced feature flag value to the actual source.
|
|
48
|
+
* When provided, an "Apply to source" button appears on each forced flag.
|
|
49
|
+
* @param flagId - The ID of the feature flag
|
|
50
|
+
* @param value - The current forced boolean value
|
|
51
|
+
* @deprecated Use `ToolbarFeatureFlagService.setApplyToSource()` instead. Config callbacks will be removed in v5.
|
|
52
|
+
*/
|
|
53
|
+
onApplyFeatureFlag?: (flagId: string, value: boolean) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Callback to persist a forced permission value to the actual source.
|
|
56
|
+
* When provided, an "Apply to source" button appears on each forced permission.
|
|
57
|
+
* @param permissionId - The ID of the permission
|
|
58
|
+
* @param value - The current forced boolean value (granted = true, denied = false)
|
|
59
|
+
* @deprecated Use `ToolbarPermissionsService.setApplyToSource()` instead. Config callbacks will be removed in v5.
|
|
60
|
+
*/
|
|
61
|
+
onApplyPermission?: (permissionId: string, value: boolean) => Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Callback to persist a forced app feature value to the actual source.
|
|
64
|
+
* When provided, an "Apply to source" button appears on each forced feature.
|
|
65
|
+
* @param featureId - The ID of the app feature
|
|
66
|
+
* @param value - The current forced boolean value
|
|
67
|
+
* @deprecated Use `ToolbarAppFeaturesService.setApplyToSource()` instead. Config callbacks will be removed in v5.
|
|
68
|
+
*/
|
|
69
|
+
onApplyAppFeature?: (featureId: string, value: boolean) => Promise<void>;
|
|
46
70
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* State of an apply-to-source operation for a single item.
|
|
4
|
+
*/
|
|
5
|
+
export type ApplyToSourceState = 'idle' | 'loading' | 'success' | 'error';
|
|
2
6
|
/**
|
|
3
7
|
* Interface that should be implemented by any tool service that is used in the dev toolbar
|
|
4
8
|
*/
|
|
@@ -36,4 +40,19 @@ export interface ToolbarService<OptionType> {
|
|
|
36
40
|
* ```
|
|
37
41
|
*/
|
|
38
42
|
getValues(): Observable<OptionType[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Registers a callback to persist a forced value back to the actual data source.
|
|
45
|
+
* When set, an "apply to source" button appears on each forced item in the toolbar UI.
|
|
46
|
+
*
|
|
47
|
+
* @param callback - Async function that receives the item ID and its forced boolean value.
|
|
48
|
+
* Should persist the value (e.g., via API call) and throw on failure.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* this.toolbarService.setApplyToSource(async (id, value) => {
|
|
53
|
+
* await this.api.updateFlag(id, value);
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
setApplyToSource?(callback: (id: string, value: boolean) => Promise<void>): void;
|
|
39
58
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { ApplyToSourceState } from '../../models/toolbar.interface';
|
|
2
3
|
import { ToolbarAppFeature, ForcedAppFeaturesState } from './app-features.models';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
/**
|
|
@@ -73,6 +74,11 @@ export declare class ToolbarInternalAppFeaturesService {
|
|
|
73
74
|
* @returns Current forced features state
|
|
74
75
|
*/
|
|
75
76
|
getCurrentForcedState(): ForcedAppFeaturesState;
|
|
77
|
+
readonly applyCallback: import("@angular/core").WritableSignal<((id: string, value: boolean) => Promise<void>) | null>;
|
|
78
|
+
readonly applyStates: import("@angular/core").WritableSignal<Record<string, ApplyToSourceState>>;
|
|
79
|
+
readonly hasApplyCallback: import("@angular/core").Signal<boolean>;
|
|
80
|
+
setApplyToSource(callback: (id: string, value: boolean) => Promise<void>): void;
|
|
81
|
+
applyToSource(id: string, value: boolean): Promise<void>;
|
|
76
82
|
/**
|
|
77
83
|
* Merge natural app features with forced state.
|
|
78
84
|
*
|
|
@@ -21,6 +21,7 @@ export declare class ToolbarAppFeaturesToolComponent {
|
|
|
21
21
|
private readonly VIEW_STATE_KEY;
|
|
22
22
|
protected readonly activeFilter: import("@angular/core").WritableSignal<AppFeatureFilter>;
|
|
23
23
|
protected readonly searchQuery: import("@angular/core").WritableSignal<string>;
|
|
24
|
+
protected readonly pinnedIds: import("@angular/core").WritableSignal<Set<string>>;
|
|
24
25
|
constructor();
|
|
25
26
|
private loadViewState;
|
|
26
27
|
protected readonly features: import("@angular/core").Signal<ToolbarAppFeature[]>;
|
|
@@ -37,6 +38,9 @@ export declare class ToolbarAppFeaturesToolComponent {
|
|
|
37
38
|
value: string;
|
|
38
39
|
label: string;
|
|
39
40
|
}[];
|
|
41
|
+
protected readonly hasApplyCallback: import("@angular/core").Signal<boolean>;
|
|
42
|
+
protected getApplyState(featureId: string): 'idle' | 'loading' | 'success' | 'error';
|
|
43
|
+
protected onApplyToSource(featureId: string, value: boolean): void;
|
|
40
44
|
/**
|
|
41
45
|
* Handle filter dropdown change.
|
|
42
46
|
* Updates the active filter to show all/forced/enabled/disabled features.
|
|
@@ -54,6 +58,7 @@ export declare class ToolbarAppFeaturesToolComponent {
|
|
|
54
58
|
* Updates the search query to filter features by name/description.
|
|
55
59
|
*/
|
|
56
60
|
onSearchChange(query: string): void;
|
|
61
|
+
togglePin(featureId: string): void;
|
|
57
62
|
/**
|
|
58
63
|
* Get the dropdown value for a feature's current state.
|
|
59
64
|
* - Returns empty string if not forced (natural state)
|
|
@@ -170,6 +170,13 @@ export declare class ToolbarAppFeaturesService implements ToolbarService<Toolbar
|
|
|
170
170
|
* ```
|
|
171
171
|
*/
|
|
172
172
|
getCurrentForcedState(): ForcedAppFeaturesState;
|
|
173
|
+
/**
|
|
174
|
+
* Registers a callback to persist a forced app feature value back to the actual data source.
|
|
175
|
+
* When set, an "apply to source" button appears on each forced feature in the toolbar UI.
|
|
176
|
+
*
|
|
177
|
+
* @param callback - Async function that receives the feature ID and its forced boolean value
|
|
178
|
+
*/
|
|
179
|
+
setApplyToSource(callback: (id: string, value: boolean) => Promise<void>): void;
|
|
173
180
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarAppFeaturesService, never>;
|
|
174
181
|
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarAppFeaturesService>;
|
|
175
182
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { ApplyToSourceState } from '../../models/toolbar.interface';
|
|
2
3
|
import { ToolbarFlag } from './feature-flags.models';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
interface ForcedFlagsState {
|
|
@@ -31,6 +32,11 @@ export declare class ToolbarInternalFeatureFlagService {
|
|
|
31
32
|
* Returns the raw state of enabled and disabled flag IDs
|
|
32
33
|
*/
|
|
33
34
|
getCurrentForcedState(): ForcedFlagsState;
|
|
35
|
+
readonly applyCallback: import("@angular/core").WritableSignal<((id: string, value: boolean) => Promise<void>) | null>;
|
|
36
|
+
readonly applyStates: import("@angular/core").WritableSignal<Record<string, ApplyToSourceState>>;
|
|
37
|
+
readonly hasApplyCallback: import("@angular/core").Signal<boolean>;
|
|
38
|
+
setApplyToSource(callback: (id: string, value: boolean) => Promise<void>): void;
|
|
39
|
+
applyToSource(id: string, value: boolean): Promise<void>;
|
|
34
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarInternalFeatureFlagService, never>;
|
|
35
41
|
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarInternalFeatureFlagService>;
|
|
36
42
|
}
|
|
@@ -7,6 +7,7 @@ export declare class ToolbarFeatureFlagsToolComponent {
|
|
|
7
7
|
private readonly VIEW_STATE_KEY;
|
|
8
8
|
protected readonly activeFilter: import("@angular/core").WritableSignal<FeatureFlagFilter>;
|
|
9
9
|
protected readonly searchQuery: import("@angular/core").WritableSignal<string>;
|
|
10
|
+
protected readonly pinnedIds: import("@angular/core").WritableSignal<Set<string>>;
|
|
10
11
|
constructor();
|
|
11
12
|
private loadViewState;
|
|
12
13
|
protected readonly flags: import("@angular/core").Signal<ToolbarFlag[]>;
|
|
@@ -23,9 +24,13 @@ export declare class ToolbarFeatureFlagsToolComponent {
|
|
|
23
24
|
value: string;
|
|
24
25
|
label: string;
|
|
25
26
|
}[];
|
|
27
|
+
protected readonly hasApplyCallback: import("@angular/core").Signal<boolean>;
|
|
28
|
+
protected getApplyState(flagId: string): 'idle' | 'loading' | 'success' | 'error';
|
|
29
|
+
protected onApplyToSource(flagId: string, value: boolean): void;
|
|
26
30
|
onFilterChange(value: string | undefined): void;
|
|
27
31
|
onFlagChange(flagId: string, value: string): void;
|
|
28
32
|
onSearchChange(query: string): void;
|
|
33
|
+
togglePin(flagId: string): void;
|
|
29
34
|
protected getFlagValue(flag: ToolbarFlag): string;
|
|
30
35
|
protected getFlagPlaceholder(flag: ToolbarFlag): string;
|
|
31
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarFeatureFlagsToolComponent, never>;
|
|
@@ -38,6 +38,13 @@ export declare class ToolbarFeatureFlagService implements ToolbarService<Toolbar
|
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
40
|
getValues(): Observable<ToolbarFlag[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Registers a callback to persist a forced flag value back to the actual data source.
|
|
43
|
+
* When set, an "apply to source" button appears on each forced flag in the toolbar UI.
|
|
44
|
+
*
|
|
45
|
+
* @param callback - Async function that receives the flag ID and its forced boolean value
|
|
46
|
+
*/
|
|
47
|
+
setApplyToSource(callback: (id: string, value: boolean) => Promise<void>): void;
|
|
41
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarFeatureFlagService, never>;
|
|
42
49
|
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarFeatureFlagService>;
|
|
43
50
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { ApplyToSourceState } from '../../models/toolbar.interface';
|
|
2
3
|
import { ToolbarPermission, ForcedPermissionsState } from './permissions.models';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ToolbarInternalPermissionsService {
|
|
@@ -29,6 +30,11 @@ export declare class ToolbarInternalPermissionsService {
|
|
|
29
30
|
getCurrentForcedState(): ForcedPermissionsState;
|
|
30
31
|
private loadForcedState;
|
|
31
32
|
private isValidForcedState;
|
|
33
|
+
readonly applyCallback: import("@angular/core").WritableSignal<((id: string, value: boolean) => Promise<void>) | null>;
|
|
34
|
+
readonly applyStates: import("@angular/core").WritableSignal<Record<string, ApplyToSourceState>>;
|
|
35
|
+
readonly hasApplyCallback: import("@angular/core").Signal<boolean>;
|
|
36
|
+
setApplyToSource(callback: (id: string, value: boolean) => Promise<void>): void;
|
|
37
|
+
applyToSource(id: string, value: boolean): Promise<void>;
|
|
32
38
|
private validateAndCleanForcedState;
|
|
33
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarInternalPermissionsService, never>;
|
|
34
40
|
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarInternalPermissionsService>;
|
|
@@ -7,6 +7,7 @@ export declare class ToolbarPermissionsToolComponent {
|
|
|
7
7
|
private readonly VIEW_STATE_KEY;
|
|
8
8
|
protected readonly activeFilter: import("@angular/core").WritableSignal<PermissionFilter>;
|
|
9
9
|
protected readonly searchQuery: import("@angular/core").WritableSignal<string>;
|
|
10
|
+
protected readonly pinnedIds: import("@angular/core").WritableSignal<Set<string>>;
|
|
10
11
|
constructor();
|
|
11
12
|
private loadViewState;
|
|
12
13
|
protected readonly permissions: import("@angular/core").Signal<ToolbarPermission[]>;
|
|
@@ -23,9 +24,13 @@ export declare class ToolbarPermissionsToolComponent {
|
|
|
23
24
|
value: string;
|
|
24
25
|
label: string;
|
|
25
26
|
}[];
|
|
27
|
+
protected readonly hasApplyCallback: import("@angular/core").Signal<boolean>;
|
|
28
|
+
protected getApplyState(permissionId: string): 'idle' | 'loading' | 'success' | 'error';
|
|
29
|
+
protected onApplyToSource(permissionId: string, value: boolean): void;
|
|
26
30
|
onFilterChange(value: string | undefined): void;
|
|
27
31
|
onPermissionChange(id: string, value: string): void;
|
|
28
32
|
onSearchChange(query: string): void;
|
|
33
|
+
togglePin(permissionId: string): void;
|
|
29
34
|
protected getPermissionValue(permission: ToolbarPermission): string;
|
|
30
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarPermissionsToolComponent, never>;
|
|
31
36
|
static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarPermissionsToolComponent, "ndt-permissions-tool", never, {}, {}, never, never, true, never>;
|
|
@@ -106,6 +106,13 @@ export declare class ToolbarPermissionsService implements ToolbarService<Toolbar
|
|
|
106
106
|
* @returns Current forced permissions state
|
|
107
107
|
*/
|
|
108
108
|
getCurrentState(): ForcedPermissionsState;
|
|
109
|
+
/**
|
|
110
|
+
* Registers a callback to persist a forced permission value back to the actual data source.
|
|
111
|
+
* When set, an "apply to source" button appears on each forced permission in the toolbar UI.
|
|
112
|
+
*
|
|
113
|
+
* @param callback - Async function that receives the permission ID and its forced boolean value
|
|
114
|
+
*/
|
|
115
|
+
setApplyToSource(callback: (id: string, value: boolean) => Promise<void>): void;
|
|
109
116
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarPermissionsService, never>;
|
|
110
117
|
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarPermissionsService>;
|
|
111
118
|
}
|
|
@@ -5,6 +5,7 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
type ViewMode = 'list' | 'create' | 'edit' | 'import' | 'apply' | 'delete';
|
|
6
6
|
type ToastType = 'success' | 'error';
|
|
7
7
|
export declare class ToolbarPresetsToolComponent {
|
|
8
|
+
onDocumentClick(): void;
|
|
8
9
|
private readonly presetsService;
|
|
9
10
|
private readonly featureFlagsService;
|
|
10
11
|
private readonly permissionsService;
|
|
@@ -12,6 +13,8 @@ export declare class ToolbarPresetsToolComponent {
|
|
|
12
13
|
protected readonly state: ToolbarStateService;
|
|
13
14
|
protected readonly viewMode: import("@angular/core").WritableSignal<ViewMode>;
|
|
14
15
|
protected readonly searchQuery: import("@angular/core").WritableSignal<string>;
|
|
16
|
+
protected readonly expandedPresetId: import("@angular/core").WritableSignal<string | null>;
|
|
17
|
+
protected readonly openMenuId: import("@angular/core").WritableSignal<string | null>;
|
|
15
18
|
protected readonly presetName: import("@angular/core").WritableSignal<string>;
|
|
16
19
|
protected readonly presetDescription: import("@angular/core").WritableSignal<string>;
|
|
17
20
|
protected readonly includeFeatureFlags: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -53,6 +56,8 @@ export declare class ToolbarPresetsToolComponent {
|
|
|
53
56
|
protected readonly options: ToolbarWindowOptions;
|
|
54
57
|
private showToast;
|
|
55
58
|
onSearchChange(query: string): void;
|
|
59
|
+
onToggleExpand(presetId: string): void;
|
|
60
|
+
onToggleMenu(presetId: string): void;
|
|
56
61
|
onSwitchToListMode(): void;
|
|
57
62
|
onSwitchToCreateMode(): void;
|
|
58
63
|
onSwitchToImportMode(): void;
|