ngx-dev-toolbar 2.0.0 → 2.0.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/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export * from './components/icons/icon.component';
2
2
  export * from './components/icons/icon.models';
3
+ export * from './components/list/list.component';
4
+ export * from './components/list-item/list-item.component';
3
5
  export * from './components/toolbar-tool/toolbar-tool.component';
4
6
  export * from './components/toolbar-tool/toolbar-tool.models';
5
7
  export * from './dev-toolbar.component';
@@ -14,4 +14,26 @@ export interface DevToolsService<OptionType> {
14
14
  * @returns Observable of forced values array
15
15
  */
16
16
  getForcedValues(): Observable<OptionType[]>;
17
+ /**
18
+ * Gets ALL option values with overrides already applied.
19
+ * Returns the complete set of options where overridden values replace base values.
20
+ * Each option includes an `isForced` property indicating if it was overridden.
21
+ *
22
+ * This method simplifies integration by eliminating the need to manually merge
23
+ * base values with overrides using combineLatest.
24
+ *
25
+ * @returns Observable of all values with overrides applied
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * // Simple integration - no manual merging needed
30
+ * this.devToolbarService.getValues().pipe(
31
+ * map(values => values.find(v => v.id === targetId)),
32
+ * map(value => value?.isEnabled ?? defaultValue)
33
+ * ).subscribe(finalValue => {
34
+ * // Use the final value
35
+ * });
36
+ * ```
37
+ */
38
+ getValues(): Observable<OptionType[]>;
17
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-dev-toolbar",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "keywords": [
5
5
  "devtools",
6
6
  "development-toolbar",
@@ -42,6 +42,11 @@ export interface DevToolbarAppFeature {
42
42
  * - false: State reflects the natural application configuration
43
43
  */
44
44
  isForced: boolean;
45
+ /**
46
+ * Original value before forcing (only present when isForced is true)
47
+ * Used to display what the feature's state was before being overridden
48
+ */
49
+ originalValue?: boolean;
45
50
  }
46
51
  /**
47
52
  * Filter options for displaying features in the toolbar UI.
@@ -97,6 +97,30 @@ export declare class DevToolbarAppFeaturesService implements DevToolsService<Dev
97
97
  * ```
98
98
  */
99
99
  getForcedValues(): Observable<DevToolbarAppFeature[]>;
100
+ /**
101
+ * Gets ALL app feature values with overrides already applied.
102
+ * Returns the complete set of features where overridden values replace base values.
103
+ * Each feature includes an `isForced` property indicating if it was overridden.
104
+ *
105
+ * This method simplifies integration by eliminating the need to manually merge
106
+ * base features with overrides using combineLatest.
107
+ *
108
+ * @returns Observable of all features with overrides applied
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * // Check if a feature is enabled with overrides applied
113
+ * this.appFeaturesService.getValues().pipe(
114
+ * map(features => features.find(f => f.id === 'premium-analytics')),
115
+ * map(feature => feature?.isEnabled ?? false)
116
+ * ).subscribe(isEnabled => {
117
+ * if (isEnabled) {
118
+ * // Enable premium analytics
119
+ * }
120
+ * });
121
+ * ```
122
+ */
123
+ getValues(): Observable<DevToolbarAppFeature[]>;
100
124
  /**
101
125
  * Apply a preset feature configuration (for preset tool integration).
102
126
  *
@@ -5,5 +5,6 @@ export interface DevToolbarFlag {
5
5
  link?: string;
6
6
  isEnabled: boolean;
7
7
  isForced: boolean;
8
+ originalValue?: boolean;
8
9
  }
9
10
  export type FeatureFlagFilter = 'all' | 'forced' | 'enabled' | 'disabled';
@@ -14,6 +14,30 @@ export declare class DevToolbarFeatureFlagService implements DevToolsService<Dev
14
14
  * @returns Observable of forced flags array
15
15
  */
16
16
  getForcedValues(): Observable<DevToolbarFlag[]>;
17
+ /**
18
+ * Gets ALL flag values with overrides already applied.
19
+ * Returns the complete set of flags where overridden values replace base values.
20
+ * Each flag includes an `isForced` property indicating if it was overridden.
21
+ *
22
+ * This method simplifies integration by eliminating the need to manually merge
23
+ * base flags with overrides using combineLatest.
24
+ *
25
+ * @returns Observable of all flags with overrides applied
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * // Get a specific flag value with overrides applied
30
+ * this.featureFlagsService.getValues().pipe(
31
+ * map(flags => flags.find(f => f.id === 'newFeature')),
32
+ * map(flag => flag?.isEnabled ?? false)
33
+ * ).subscribe(isEnabled => {
34
+ * if (isEnabled) {
35
+ * // Enable feature
36
+ * }
37
+ * });
38
+ * ```
39
+ */
40
+ getValues(): Observable<DevToolbarFlag[]>;
17
41
  static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarFeatureFlagService, never>;
18
42
  static ɵprov: i0.ɵɵInjectableDeclaration<DevToolbarFeatureFlagService>;
19
43
  }
@@ -14,6 +14,13 @@ export declare class DevToolbarLanguageService implements DevToolsService<Langua
14
14
  * @returns Observable of forced languages array
15
15
  */
16
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[]>;
17
24
  static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarLanguageService, never>;
18
25
  static ɵprov: i0.ɵɵInjectableDeclaration<DevToolbarLanguageService>;
19
26
  }
@@ -13,6 +13,8 @@ export interface DevToolbarPermission {
13
13
  isGranted: boolean;
14
14
  /** Whether the permission's value has been overridden through the toolbar */
15
15
  isForced: boolean;
16
+ /** Original value before forcing (only present when isForced is true) */
17
+ originalValue?: boolean;
16
18
  }
17
19
  /**
18
20
  * Internal state representing forced permission overrides.
@@ -62,6 +62,30 @@ export declare class DevToolbarPermissionsService implements DevToolsService<Dev
62
62
  * ```
63
63
  */
64
64
  getForcedValues(): Observable<DevToolbarPermission[]>;
65
+ /**
66
+ * Gets ALL permission values with overrides already applied.
67
+ * Returns the complete set of permissions where overridden values replace base values.
68
+ * Each permission includes an `isForced` property indicating if it was overridden.
69
+ *
70
+ * This method simplifies integration by eliminating the need to manually merge
71
+ * base permissions with overrides using combineLatest.
72
+ *
73
+ * @returns Observable of all permissions with overrides applied
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * // Simple permission check with overrides applied
78
+ * this.permissionsService.getValues().pipe(
79
+ * map(permissions => permissions.find(p => p.id === 'can-edit')),
80
+ * map(permission => permission?.isGranted ?? false)
81
+ * ).subscribe(canEdit => {
82
+ * if (canEdit) {
83
+ * // Enable edit functionality
84
+ * }
85
+ * });
86
+ * ```
87
+ */
88
+ getValues(): Observable<DevToolbarPermission[]>;
65
89
  /**
66
90
  * Apply a preset permission state. Useful for automated testing scenarios.
67
91
  *