ngx-dev-toolbar 4.0.0 → 4.2.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 +5 -5
- package/components/icon-button/icon-button.component.d.ts +13 -0
- package/components/icons/globe-icon.component.d.ts +6 -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/components/select/select.component.d.ts +1 -1
- package/components/tool-button/tool-button.component.d.ts +6 -5
- package/components/toolbar-tool/toolbar-tool.component.d.ts +6 -11
- package/components/window/window.component.d.ts +1 -1
- package/fesm2022/ngx-dev-toolbar.mjs +2229 -698
- package/fesm2022/ngx-dev-toolbar.mjs.map +1 -1
- package/index.d.ts +7 -3
- package/models/tool-view-state.models.d.ts +2 -0
- package/models/toolbar-config.interface.d.ts +32 -2
- package/models/toolbar-position.model.d.ts +3 -0
- package/models/toolbar.interface.d.ts +19 -0
- package/package.json +6 -7
- package/tokens.d.ts +0 -18
- package/toolbar-state.service.d.ts +10 -9
- package/toolbar.component.d.ts +1 -0
- 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/home-tool/home-tool.component.d.ts +3 -0
- package/tools/home-tool/settings.models.d.ts +3 -0
- package/tools/i18n-tool/i18n-formatting.utils.d.ts +10 -0
- package/tools/i18n-tool/i18n-internal.service.d.ts +86 -0
- package/tools/i18n-tool/i18n-tool.component.d.ts +66 -0
- package/tools/i18n-tool/i18n.models.d.ts +55 -0
- package/tools/i18n-tool/i18n.service.d.ts +70 -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-internal.service.d.ts +1 -1
- package/tools/presets-tool/presets-tool.component.d.ts +5 -5
- package/tools/presets-tool/presets.models.d.ts +10 -3
- package/tools/language-tool/language-internal.service.d.ts +0 -30
- package/tools/language-tool/language-tool.component.d.ts +0 -14
- package/tools/language-tool/language.models.d.ts +0 -4
- package/tools/language-tool/language.service.d.ts +0 -26
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ToolbarService } from '../../models/toolbar.interface';
|
|
3
|
+
import { I18nCurrency, I18nDateFormat, I18nFirstDayOfWeek, I18nLocale, I18nNumberFormat, I18nTimezone, I18nToolConfig, I18nUnitSystem } from './i18n.models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ToolbarI18nService implements ToolbarService<I18nLocale> {
|
|
6
|
+
private internalService;
|
|
7
|
+
/**
|
|
8
|
+
* Sets the available locales displayed in the i18n tool
|
|
9
|
+
*/
|
|
10
|
+
setAvailableOptions(locales: I18nLocale[]): void;
|
|
11
|
+
/**
|
|
12
|
+
* Gets the locale that was forced through the i18n tool
|
|
13
|
+
* @returns Observable of forced locale array (single item or empty)
|
|
14
|
+
*/
|
|
15
|
+
getForcedValues(): Observable<I18nLocale[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the forced locale value.
|
|
18
|
+
* For the i18n tool, this returns the same as getForcedValues() since
|
|
19
|
+
* only one locale can be selected at a time.
|
|
20
|
+
*/
|
|
21
|
+
getValues(): Observable<I18nLocale[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the available timezones displayed in the i18n tool.
|
|
24
|
+
* If not called, defaults to a built-in list of common timezones.
|
|
25
|
+
*/
|
|
26
|
+
setAvailableTimezones(timezones: I18nTimezone[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the available currencies displayed in the i18n tool.
|
|
29
|
+
* If not called, defaults to a built-in list of common currencies.
|
|
30
|
+
*/
|
|
31
|
+
setAvailableCurrencies(currencies: I18nCurrency[]): void;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the timezone that was forced through the i18n tool
|
|
34
|
+
*/
|
|
35
|
+
getForcedTimezone(): Observable<I18nTimezone | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Gets the currency that was forced through the i18n tool
|
|
38
|
+
*/
|
|
39
|
+
getForcedCurrency(): Observable<I18nCurrency | null>;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the unit system that was forced through the i18n tool
|
|
42
|
+
*/
|
|
43
|
+
getUnitSystem(): Observable<I18nUnitSystem | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Whether pseudo-localization mode is enabled
|
|
46
|
+
*/
|
|
47
|
+
isPseudoLocalizationEnabled(): Observable<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Whether RTL mirroring is enabled
|
|
50
|
+
*/
|
|
51
|
+
isRtlEnabled(): Observable<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the date format that was forced through the i18n tool
|
|
54
|
+
*/
|
|
55
|
+
getForcedDateFormat(): Observable<I18nDateFormat | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Gets the first day of week that was forced through the i18n tool
|
|
58
|
+
*/
|
|
59
|
+
getForcedFirstDayOfWeek(): Observable<I18nFirstDayOfWeek | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the number format that was forced through the i18n tool
|
|
62
|
+
*/
|
|
63
|
+
getForcedNumberFormat(): Observable<I18nNumberFormat | null>;
|
|
64
|
+
/**
|
|
65
|
+
* Configures which sections are visible in the i18n tool panel
|
|
66
|
+
*/
|
|
67
|
+
configure(config: I18nToolConfig): void;
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarI18nService, never>;
|
|
69
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarI18nService>;
|
|
70
|
+
}
|
|
@@ -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
|
}
|
|
@@ -9,9 +9,9 @@ export declare class ToolbarInternalPresetsService {
|
|
|
9
9
|
private readonly STORAGE_KEY;
|
|
10
10
|
private storageService;
|
|
11
11
|
private featureFlagsService;
|
|
12
|
-
private languageService;
|
|
13
12
|
private permissionsService;
|
|
14
13
|
private appFeaturesService;
|
|
14
|
+
private i18nService;
|
|
15
15
|
private presetsSubject;
|
|
16
16
|
presets$: Observable<ToolbarPreset[]>;
|
|
17
17
|
presets: import("@angular/core").Signal<ToolbarPreset[]>;
|
|
@@ -5,20 +5,21 @@ 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;
|
|
11
12
|
private readonly appFeaturesService;
|
|
12
|
-
private readonly languageService;
|
|
13
13
|
protected readonly state: ToolbarStateService;
|
|
14
14
|
protected readonly viewMode: import("@angular/core").WritableSignal<ViewMode>;
|
|
15
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>;
|
|
16
18
|
protected readonly presetName: import("@angular/core").WritableSignal<string>;
|
|
17
19
|
protected readonly presetDescription: import("@angular/core").WritableSignal<string>;
|
|
18
20
|
protected readonly includeFeatureFlags: import("@angular/core").WritableSignal<boolean>;
|
|
19
21
|
protected readonly includePermissions: import("@angular/core").WritableSignal<boolean>;
|
|
20
22
|
protected readonly includeAppFeatures: import("@angular/core").WritableSignal<boolean>;
|
|
21
|
-
protected readonly includeLanguage: import("@angular/core").WritableSignal<boolean>;
|
|
22
23
|
protected readonly selectedFlagIds: import("@angular/core").WritableSignal<Set<string>>;
|
|
23
24
|
protected readonly selectedPermissionIds: import("@angular/core").WritableSignal<Set<string>>;
|
|
24
25
|
protected readonly selectedFeatureIds: import("@angular/core").WritableSignal<Set<string>>;
|
|
@@ -32,7 +33,6 @@ export declare class ToolbarPresetsToolComponent {
|
|
|
32
33
|
protected readonly applyFeatureFlags: import("@angular/core").WritableSignal<boolean>;
|
|
33
34
|
protected readonly applyPermissions: import("@angular/core").WritableSignal<boolean>;
|
|
34
35
|
protected readonly applyAppFeatures: import("@angular/core").WritableSignal<boolean>;
|
|
35
|
-
protected readonly applyLanguage: import("@angular/core").WritableSignal<boolean>;
|
|
36
36
|
protected readonly deletePresetId: import("@angular/core").WritableSignal<string | null>;
|
|
37
37
|
protected readonly toastMessage: import("@angular/core").WritableSignal<string | null>;
|
|
38
38
|
protected readonly toastType: import("@angular/core").WritableSignal<ToastType>;
|
|
@@ -50,13 +50,14 @@ export declare class ToolbarPresetsToolComponent {
|
|
|
50
50
|
protected readonly isFeatureFlagsEnabled: import("@angular/core").Signal<boolean>;
|
|
51
51
|
protected readonly isPermissionsEnabled: import("@angular/core").Signal<boolean>;
|
|
52
52
|
protected readonly isAppFeaturesEnabled: import("@angular/core").Signal<boolean>;
|
|
53
|
-
protected readonly isLanguageEnabled: import("@angular/core").Signal<boolean>;
|
|
54
53
|
protected readonly forcedFlags: import("@angular/core").Signal<import("ngx-dev-toolbar").ToolbarFlag[]>;
|
|
55
54
|
protected readonly forcedPermissions: import("@angular/core").Signal<import("ngx-dev-toolbar").ToolbarPermission[]>;
|
|
56
55
|
protected readonly forcedAppFeatures: import("@angular/core").Signal<import("ngx-dev-toolbar").ToolbarAppFeature[]>;
|
|
57
56
|
protected readonly options: ToolbarWindowOptions;
|
|
58
57
|
private showToast;
|
|
59
58
|
onSearchChange(query: string): void;
|
|
59
|
+
onToggleExpand(presetId: string): void;
|
|
60
|
+
onToggleMenu(presetId: string): void;
|
|
60
61
|
onSwitchToListMode(): void;
|
|
61
62
|
onSwitchToCreateMode(): void;
|
|
62
63
|
onSwitchToImportMode(): void;
|
|
@@ -83,7 +84,6 @@ export declare class ToolbarPresetsToolComponent {
|
|
|
83
84
|
protected getCurrentFlagsCount(): number;
|
|
84
85
|
protected getCurrentPermissionsCount(): number;
|
|
85
86
|
protected getCurrentAppFeaturesCount(): number;
|
|
86
|
-
protected getCurrentLanguage(): string;
|
|
87
87
|
protected formatDate(isoString: string): string;
|
|
88
88
|
protected getPresetTooltip(preset: ToolbarPreset): string;
|
|
89
89
|
protected toggleItemSelection(signal: typeof this.selectedFlagIds, itemId: string): void;
|
|
@@ -14,7 +14,6 @@ export interface ToolbarPresetConfig {
|
|
|
14
14
|
enabled: string[];
|
|
15
15
|
disabled: string[];
|
|
16
16
|
};
|
|
17
|
-
language: string | null;
|
|
18
17
|
permissions: {
|
|
19
18
|
granted: string[];
|
|
20
19
|
denied: string[];
|
|
@@ -23,13 +22,21 @@ export interface ToolbarPresetConfig {
|
|
|
23
22
|
enabled: string[];
|
|
24
23
|
disabled: string[];
|
|
25
24
|
};
|
|
25
|
+
i18n?: {
|
|
26
|
+
locale?: string | null;
|
|
27
|
+
timezone?: string | null;
|
|
28
|
+
currency?: string | null;
|
|
29
|
+
unitSystem?: string | null;
|
|
30
|
+
pseudoLocEnabled?: boolean;
|
|
31
|
+
rtlEnabled?: boolean;
|
|
32
|
+
};
|
|
26
33
|
}
|
|
27
34
|
export type PresetFilter = 'all' | 'recent' | 'favorites';
|
|
28
35
|
export interface PresetCategoryOptions {
|
|
29
36
|
includeFeatureFlags?: boolean;
|
|
30
37
|
includePermissions?: boolean;
|
|
31
38
|
includeAppFeatures?: boolean;
|
|
32
|
-
|
|
39
|
+
includeI18n?: boolean;
|
|
33
40
|
selectedFlagIds?: string[];
|
|
34
41
|
selectedPermissionIds?: string[];
|
|
35
42
|
selectedFeatureIds?: string[];
|
|
@@ -41,5 +48,5 @@ export interface PartialApplyOptions {
|
|
|
41
48
|
applyFeatureFlags?: boolean;
|
|
42
49
|
applyPermissions?: boolean;
|
|
43
50
|
applyAppFeatures?: boolean;
|
|
44
|
-
|
|
51
|
+
applyI18n?: boolean;
|
|
45
52
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { Language } from './language.models';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ToolbarInternalLanguageService {
|
|
5
|
-
private readonly STORAGE_KEY;
|
|
6
|
-
private readonly storageService;
|
|
7
|
-
private readonly stateService;
|
|
8
|
-
private languages$;
|
|
9
|
-
private forcedLanguage$;
|
|
10
|
-
languages: import("@angular/core").Signal<Language[]>;
|
|
11
|
-
constructor();
|
|
12
|
-
setAppLanguages(languages: Language[]): void;
|
|
13
|
-
getAppLanguages(): Observable<Language[]>;
|
|
14
|
-
setForcedLanguage(language: Language): void;
|
|
15
|
-
getForcedLanguage(): Observable<Language[]>;
|
|
16
|
-
removeForcedLanguage(): void;
|
|
17
|
-
private loadForcedLanguage;
|
|
18
|
-
/**
|
|
19
|
-
* Apply language from a preset (used by Presets Tool)
|
|
20
|
-
* Accepts a language ID and finds the corresponding Language object from available languages
|
|
21
|
-
*/
|
|
22
|
-
applyPresetLanguage(languageId: string | null): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Get current forced language ID for saving to preset
|
|
25
|
-
* Returns the language ID or null if no language is forced
|
|
26
|
-
*/
|
|
27
|
-
getCurrentForcedLanguage(): string | null;
|
|
28
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarInternalLanguageService, never>;
|
|
29
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarInternalLanguageService>;
|
|
30
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ToolbarWindowOptions } from '../../components/toolbar-tool/toolbar-tool.models';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ToolbarLanguageToolComponent {
|
|
4
|
-
private readonly languageService;
|
|
5
|
-
protected readonly options: ToolbarWindowOptions;
|
|
6
|
-
activeLanguage: import("@angular/core").WritableSignal<string>;
|
|
7
|
-
languageOptions: import("@angular/core").Signal<{
|
|
8
|
-
value: string;
|
|
9
|
-
label: string;
|
|
10
|
-
}[]>;
|
|
11
|
-
onLanguageChange(language: string): Promise<void>;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarLanguageToolComponent, never>;
|
|
13
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarLanguageToolComponent, "ndt-language-tool", never, {}, {}, never, never, true, never>;
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ToolbarService } from '../../models/toolbar.interface';
|
|
3
|
-
import { Language } from './language.models';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ToolbarLanguageService implements ToolbarService<Language> {
|
|
6
|
-
private internalService;
|
|
7
|
-
/**
|
|
8
|
-
* Sets the available languages that will be displayed in the tool on the dev toolbar
|
|
9
|
-
* @param languages The languages to be displayed
|
|
10
|
-
*/
|
|
11
|
-
setAvailableOptions(languages: Language[]): void;
|
|
12
|
-
/**
|
|
13
|
-
* Gets the languages that were forced/modified through the tool on the dev toolbar
|
|
14
|
-
* @returns Observable of forced languages array
|
|
15
|
-
*/
|
|
16
|
-
getForcedValues(): Observable<Language[]>;
|
|
17
|
-
/**
|
|
18
|
-
* Gets the forced language value.
|
|
19
|
-
* For the language tool, this returns the same as getForcedValues() since
|
|
20
|
-
* only one language can be selected at a time.
|
|
21
|
-
* @returns Observable of forced language array (single item or empty)
|
|
22
|
-
*/
|
|
23
|
-
getValues(): Observable<Language[]>;
|
|
24
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarLanguageService, never>;
|
|
25
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarLanguageService>;
|
|
26
|
-
}
|