ngx-dev-toolbar 1.0.3 → 1.0.5

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.
Files changed (145) hide show
  1. package/components/button/button.component.d.ts +12 -0
  2. package/components/card/card.component.d.ts +8 -0
  3. package/components/clickable-card/clickable-card.component.d.ts +11 -0
  4. package/components/icons/angular-icon.component.d.ts +5 -0
  5. package/components/icons/bolt-icon.component.d.ts +6 -0
  6. package/components/icons/bug-icon.component.d.ts +6 -0
  7. package/components/icons/code-icon.component.d.ts +6 -0
  8. package/components/icons/database-icon.component.d.ts +6 -0
  9. package/components/icons/discord-icon.component.d.ts +6 -0
  10. package/components/icons/docs-icon.component.d.ts +6 -0
  11. package/components/icons/export-icon.component.d.ts +6 -0
  12. package/components/icons/filter-icon.component.d.ts +6 -0
  13. package/components/icons/gauge-icon.component.d.ts +6 -0
  14. package/components/icons/gear-icon.component.d.ts +6 -0
  15. package/components/icons/git-branch-icon.component.d.ts +6 -0
  16. package/components/icons/icon.component.d.ts +9 -0
  17. package/components/icons/icon.models.d.ts +1 -0
  18. package/components/icons/import-icon.component.d.ts +6 -0
  19. package/components/icons/layout-icon.component.d.ts +6 -0
  20. package/components/icons/lightbulb-icon.component.d.ts +6 -0
  21. package/components/icons/lighting-icon.component.d.ts +6 -0
  22. package/components/icons/lock-icon.component.d.ts +6 -0
  23. package/components/icons/moon-icon.component.d.ts +6 -0
  24. package/components/icons/network-icon.component.d.ts +6 -0
  25. package/components/icons/puzzle-icon.component.d.ts +6 -0
  26. package/components/icons/refresh-icon.component.d.ts +6 -0
  27. package/components/icons/star-icon.component.d.ts +6 -0
  28. package/components/icons/sun-icon.component.d.ts +6 -0
  29. package/components/icons/terminal-icon.component.d.ts +6 -0
  30. package/components/icons/toggle-left-icon.component.d.ts +6 -0
  31. package/components/icons/translate-icon.component.d.ts +6 -0
  32. package/components/icons/trash-icon.component.d.ts +6 -0
  33. package/components/icons/users-icon.component.d.ts +6 -0
  34. package/components/input/input.component.d.ts +10 -0
  35. package/components/link-button/link-button.component.d.ts +8 -0
  36. package/components/select/select.component.d.ts +25 -0
  37. package/components/tool-button/tool-button.component.d.ts +23 -0
  38. package/components/toolbar-tool/toolbar-tool.component.d.ts +30 -0
  39. package/components/toolbar-tool/toolbar-tool.models.d.ts +25 -0
  40. package/components/window/window.component.d.ts +16 -0
  41. package/dev-toolbar-state.service.d.ts +21 -0
  42. package/dev-toolbar.component.d.ts +18 -0
  43. package/fesm2022/ngx-dev-toolbar.mjs +4570 -0
  44. package/fesm2022/ngx-dev-toolbar.mjs.map +1 -0
  45. package/index.d.ts +19 -0
  46. package/models/dev-tools.interface.d.ts +17 -0
  47. package/package.json +31 -8
  48. package/tools/app-features-tool/app-features-internal.service.d.ts +102 -0
  49. package/tools/app-features-tool/app-features-tool.component.d.ts +61 -0
  50. package/tools/app-features-tool/app-features.models.d.ts +109 -0
  51. package/tools/app-features-tool/app-features.service.d.ts +151 -0
  52. package/tools/feature-flags-tool/feature-flags-internal.service.d.ts +21 -0
  53. package/tools/feature-flags-tool/feature-flags-tool.component.d.ts +27 -0
  54. package/tools/feature-flags-tool/feature-flags.models.d.ts +9 -0
  55. package/tools/feature-flags-tool/feature-flags.service.d.ts +19 -0
  56. package/tools/home-tool/home-tool.component.d.ts +38 -0
  57. package/{src/tools/home-tool/settings.models.ts → tools/home-tool/settings.models.d.ts} +1 -1
  58. package/tools/home-tool/settings.service.d.ts +10 -0
  59. package/tools/language-tool/language-internal.service.d.ts +19 -0
  60. package/tools/language-tool/language-tool.component.d.ts +14 -0
  61. package/tools/language-tool/language.models.d.ts +4 -0
  62. package/tools/language-tool/language.service.d.ts +19 -0
  63. package/tools/network-mocker-tool/network-mocker-tool.component.d.ts +23 -0
  64. package/tools/network-mocker-tool/network-mocker.models.d.ts +16 -0
  65. package/tools/network-mocker-tool/network-mocker.service.d.ts +16 -0
  66. package/tools/permissions-tool/permissions-internal.service.d.ts +34 -0
  67. package/tools/permissions-tool/permissions-tool.component.d.ts +27 -0
  68. package/tools/permissions-tool/permissions.models.d.ts +34 -0
  69. package/tools/permissions-tool/permissions.service.d.ts +87 -0
  70. package/utils/storage.service.d.ts +18 -0
  71. package/eslint.config.cjs +0 -47
  72. package/ng-package.json +0 -7
  73. package/project.json +0 -37
  74. package/src/components/button/button.component.scss +0 -49
  75. package/src/components/button/button.component.ts +0 -36
  76. package/src/components/card/card.component.scss +0 -18
  77. package/src/components/card/card.component.ts +0 -30
  78. package/src/components/clickable-card/clickable-card.component.scss +0 -39
  79. package/src/components/clickable-card/clickable-card.component.ts +0 -34
  80. package/src/components/icons/angular-icon.component.ts +0 -35
  81. package/src/components/icons/bug-icon.component.ts +0 -23
  82. package/src/components/icons/code-icon.component.ts +0 -24
  83. package/src/components/icons/database-icon.component.ts +0 -27
  84. package/src/components/icons/discord-icon.component.ts +0 -23
  85. package/src/components/icons/docs-icon.component.ts +0 -23
  86. package/src/components/icons/export-icon.component.ts +0 -23
  87. package/src/components/icons/gauge-icon.component.ts +0 -27
  88. package/src/components/icons/gear-icon.component.ts +0 -27
  89. package/src/components/icons/git-branch-icon.component.ts +0 -27
  90. package/src/components/icons/icon.component.ts +0 -129
  91. package/src/components/icons/icon.models.ts +0 -27
  92. package/src/components/icons/import-icon.component.ts +0 -23
  93. package/src/components/icons/layout-icon.component.ts +0 -24
  94. package/src/components/icons/lightbulb-icon.component.ts +0 -23
  95. package/src/components/icons/lighting-icon.component.ts +0 -24
  96. package/src/components/icons/moon-icon.component.ts +0 -27
  97. package/src/components/icons/network-icon.component.ts +0 -27
  98. package/src/components/icons/puzzle-icon.component.ts +0 -27
  99. package/src/components/icons/refresh-icon.component.ts +0 -27
  100. package/src/components/icons/star-icon.component.ts +0 -27
  101. package/src/components/icons/sun-icon.component.ts +0 -27
  102. package/src/components/icons/terminal-icon.component.ts +0 -27
  103. package/src/components/icons/toggle-left-icon.component.ts +0 -27
  104. package/src/components/icons/translate-icon.component.ts +0 -23
  105. package/src/components/icons/trash-icon.component.ts +0 -23
  106. package/src/components/icons/users-icon.component.ts +0 -27
  107. package/src/components/input/input.component.ts +0 -67
  108. package/src/components/link-button/link-button.component.scss +0 -36
  109. package/src/components/link-button/link-button.component.ts +0 -29
  110. package/src/components/select/select.component.scss +0 -162
  111. package/src/components/select/select.component.ts +0 -127
  112. package/src/components/tool-button/tool-button.component.scss +0 -67
  113. package/src/components/tool-button/tool-button.component.ts +0 -126
  114. package/src/components/toolbar-tool/toolbar-tool.component.scss +0 -9
  115. package/src/components/toolbar-tool/toolbar-tool.component.ts +0 -169
  116. package/src/components/toolbar-tool/toolbar-tool.models.ts +0 -33
  117. package/src/components/window/window.component.scss +0 -95
  118. package/src/components/window/window.component.ts +0 -69
  119. package/src/dev-toolbar-state.service.ts +0 -89
  120. package/src/dev-toolbar.component.scss +0 -22
  121. package/src/dev-toolbar.component.ts +0 -105
  122. package/src/index.ts +0 -10
  123. package/src/models/dev-tools.interface.ts +0 -19
  124. package/src/styles.scss +0 -342
  125. package/src/test-setup.ts +0 -12
  126. package/src/tools/feature-flags-tool/feature-flags-internal.service.ts +0 -96
  127. package/src/tools/feature-flags-tool/feature-flags-tool.component.ts +0 -261
  128. package/src/tools/feature-flags-tool/feature-flags.models.ts +0 -10
  129. package/src/tools/feature-flags-tool/feature-flags.service.ts +0 -28
  130. package/src/tools/home-tool/home-tool.component.scss +0 -67
  131. package/src/tools/home-tool/home-tool.component.ts +0 -197
  132. package/src/tools/home-tool/settings.service.spec.ts +0 -59
  133. package/src/tools/home-tool/settings.service.ts +0 -21
  134. package/src/tools/language-tool/language-internal.service.ts +0 -51
  135. package/src/tools/language-tool/language-tool.component.scss +0 -7
  136. package/src/tools/language-tool/language-tool.component.ts +0 -71
  137. package/src/tools/language-tool/language.models.ts +0 -4
  138. package/src/tools/language-tool/language.service.ts +0 -26
  139. package/src/utils/storage.service.spec.ts +0 -179
  140. package/src/utils/storage.service.ts +0 -80
  141. package/tsconfig.json +0 -28
  142. package/tsconfig.lib.json +0 -28
  143. package/tsconfig.lib.prod.json +0 -9
  144. package/tsconfig.spec.json +0 -29
  145. package/vite.config.mts +0 -27
@@ -1,27 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'ndt-sun-icon',
5
- standalone: true,
6
- changeDetection: ChangeDetectionStrategy.OnPush,
7
- template: `
8
- <svg
9
- [attr.fill]="fill()"
10
- xmlns="http://www.w3.org/2000/svg"
11
- width="24"
12
- height="24"
13
- viewBox="0 0 256 256"
14
- >
15
- <path
16
- d="M128,60a68,68,0,1,0,68,68A68.07,68.07,0,0,0,128,60Z"
17
- opacity="0.2"
18
- />
19
- <path
20
- d="M128,44a8,8,0,0,0,8-8V16a8,8,0,0,0-16,0V36A8,8,0,0,0,128,44ZM57.31,68.69a8,8,0,0,0,11.32-11.32L54.63,43.37A8,8,0,0,0,43.31,54.69ZM44,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H36A8,8,0,0,0,44,128Zm24.63,59.31-14,14a8,8,0,0,0,11.32,11.32l14-14a8,8,0,0,0-11.32-11.32ZM128,212a8,8,0,0,0-8,8v20a8,8,0,0,0,16,0V220A8,8,0,0,0,128,212Zm70.69-24.69a8,8,0,0,0-11.32,11.32l14,14a8,8,0,0,0,11.32-11.32ZM240,120H220a8,8,0,0,0,0,16h20a8,8,0,0,0,0-16Zm-24.69-62.63-14,14a8,8,0,0,0,11.32,11.32l14-14a8,8,0,0,0-11.32-11.32ZM128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,88a36,36,0,1,1,36-36A36,36,0,0,1,128,164Z"
21
- />
22
- </svg>
23
- `,
24
- })
25
- export class SunIconComponent {
26
- fill = input<string>('#FFFF');
27
- }
@@ -1,27 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'ndt-terminal-icon',
5
- standalone: true,
6
- changeDetection: ChangeDetectionStrategy.OnPush,
7
- template: `
8
- <svg
9
- [attr.fill]="fill()"
10
- xmlns="http://www.w3.org/2000/svg"
11
- width="24"
12
- height="24"
13
- viewBox="0 0 256 256"
14
- >
15
- <path
16
- d="M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z"
17
- opacity="0.2"
18
- ></path>
19
- <path
20
- d="M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"
21
- ></path>
22
- </svg>
23
- `,
24
- })
25
- export class TerminalIconComponent {
26
- fill = input<string>('#FFFF');
27
- }
@@ -1,27 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'ndt-toggle-left-icon',
5
- standalone: true,
6
- changeDetection: ChangeDetectionStrategy.OnPush,
7
- template: `
8
- <svg
9
- [attr.fill]="fill()"
10
- xmlns="http://www.w3.org/2000/svg"
11
- width="24"
12
- height="24"
13
- viewBox="0 0 256 256"
14
- >
15
- <path
16
- d="M112,128A32,32,0,1,1,80,96,32,32,0,0,1,112,128Z"
17
- opacity="0.2"
18
- ></path>
19
- <path
20
- d="M176,56H80a72,72,0,0,0,0,144h96a72,72,0,0,0,0-144Zm0,128H80A56,56,0,0,1,80,72h96a56,56,0,0,1,0,112ZM80,88a40,40,0,1,0,40,40A40,40,0,0,0,80,88Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,80,152Z"
21
- ></path>
22
- </svg>
23
- `,
24
- })
25
- export class ToggleLeftIconComponent {
26
- fill = input<string>('#FFFF');
27
- }
@@ -1,23 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'ndt-translate-icon',
5
- standalone: true,
6
- changeDetection: ChangeDetectionStrategy.OnPush,
7
- template: `
8
- <svg
9
- [attr.fill]="fill()"
10
- xmlns="http://www.w3.org/2000/svg"
11
- width="24"
12
- height="24"
13
- viewBox="0 0 256 256"
14
- >
15
- <path
16
- d="M250.73,210.63l-56-112a12,12,0,0,0-21.46,0l-20.52,41A84.2,84.2,0,0,1,114,126.22,107.48,107.48,0,0,0,139.33,68H160a12,12,0,0,0,0-24H108V32a12,12,0,0,0-24,0V44H32a12,12,0,0,0,0,24h83.13A83.69,83.69,0,0,1,96,110.35,84,84,0,0,1,83.6,91a12,12,0,1,0-21.81,10A107.55,107.55,0,0,0,78,126.24,83.54,83.54,0,0,1,32,140a12,12,0,0,0,0,24,107.47,107.47,0,0,0,64-21.07,108.4,108.4,0,0,0,45.39,19.44l-24.13,48.26a12,12,0,1,0,21.46,10.73L151.41,196h65.17l12.68,25.36a12,12,0,1,0,21.47-10.73ZM163.41,172,184,130.83,204.58,172Z"
17
- ></path>
18
- </svg>
19
- `,
20
- })
21
- export class TranslateIconComponent {
22
- fill = input<string>('#FFFF');
23
- }
@@ -1,23 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'ndt-trash-icon',
5
- standalone: true,
6
- changeDetection: ChangeDetectionStrategy.OnPush,
7
- template: `
8
- <svg
9
- [attr.fill]="fill()"
10
- xmlns="http://www.w3.org/2000/svg"
11
- width="24"
12
- height="24"
13
- viewBox="0 0 256 256"
14
- >
15
- <path
16
- d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"
17
- ></path>
18
- </svg>
19
- `,
20
- })
21
- export class TrashIconComponent {
22
- fill = input<string>('#FFFF');
23
- }
@@ -1,27 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'ndt-users-icon',
5
- standalone: true,
6
- changeDetection: ChangeDetectionStrategy.OnPush,
7
- template: `
8
- <svg
9
- [attr.fill]="fill()"
10
- xmlns="http://www.w3.org/2000/svg"
11
- width="24"
12
- height="24"
13
- viewBox="0 0 256 256"
14
- >
15
- <path
16
- d="M224,128a95.76,95.76,0,0,1-31.8,71.37A72,72,0,0,0,128,160a40,40,0,1,0-40-40,40,40,0,0,0,40,40,72,72,0,0,0-64.2,39.37h0A96,96,0,1,1,224,128Z"
17
- opacity="0.2"
18
- ></path>
19
- <path
20
- d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM74.08,197.5a64,64,0,0,1,107.84,0,87.83,87.83,0,0,1-107.84,0ZM96,120a32,32,0,1,1,32,32A32,32,0,0,1,96,120Zm97.76,66.41a79.66,79.66,0,0,0-36.06-28.75,48,48,0,1,0-59.4,0,79.66,79.66,0,0,0-36.06,28.75,88,88,0,1,1,131.52,0Z"
21
- ></path>
22
- </svg>
23
- `,
24
- })
25
- export class UsersIconComponent {
26
- fill = input<string>('#FFFF');
27
- }
@@ -1,67 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- input,
5
- model,
6
- } from '@angular/core';
7
- import { FormsModule } from '@angular/forms';
8
-
9
- @Component({
10
- selector: 'ndt-input',
11
- standalone: true,
12
- imports: [FormsModule],
13
- template: `
14
- <input
15
- [attr.aria-label]="ariaLabel()"
16
- [type]="type()"
17
- [class]="inputClass()"
18
- [ngModel]="value()"
19
- [placeholder]="placeholder()"
20
- (ngModelChange)="value.set($event)"
21
- />
22
- `,
23
- styles: [
24
- `
25
- :host {
26
- display: block;
27
- }
28
-
29
- .input {
30
- width: 100%;
31
- padding: var(--ndt-spacing-sm) var(--ndt-spacing-md);
32
- border: 1px solid var(--ndt-border-primary);
33
- border-radius: var(--ndt-border-radius-small);
34
- background-color: var(--ndt-bg-primary);
35
- color: var(--ndt-text-primary);
36
- font-size: var(--ndt-font-size-sm);
37
- transition: var(--ndt-transition-default);
38
- box-sizing: border-box;
39
-
40
- &::placeholder {
41
- color: var(--ndt-text-muted);
42
- }
43
-
44
- &:focus {
45
- outline: none;
46
- border-color: var(--ndt-primary);
47
- box-shadow: 0 0 0 2px rgba(var(--ndt-primary-rgb), 0.2);
48
- }
49
-
50
- &:disabled {
51
- background-color: var(--ndt-bg-secondary);
52
- cursor: not-allowed;
53
- color: var(--ndt-text-muted);
54
- }
55
- }
56
- `,
57
- ],
58
- changeDetection: ChangeDetectionStrategy.OnPush,
59
- })
60
- export class DevToolbarInputComponent {
61
- value = model.required<string>();
62
-
63
- type = input<string>('text');
64
- placeholder = input<string>('');
65
- ariaLabel = input<string>('');
66
- inputClass = input<string>('input');
67
- }
@@ -1,36 +0,0 @@
1
- .link-button {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: center;
5
- gap: var(--ndt-spacing-xs);
6
- text-decoration: none;
7
- color: var(--ndt-text-muted);
8
- transition: var(--ndt-transition-default);
9
-
10
- &:hover {
11
- color: var(--ndt-text-primary);
12
-
13
- .link-button__icon {
14
- outline: 2px solid var(--ndt-primary);
15
- outline-offset: 2px;
16
- box-shadow: 0 0 8px var(--ndt-primary);
17
- }
18
- }
19
-
20
- &__icon {
21
- display: flex;
22
- align-items: center;
23
- justify-content: center;
24
- width: 40px;
25
- height: 40px;
26
- border-radius: var(--ndt-border-radius-medium);
27
- background: var(--ndt-hover-bg);
28
- transition: all 0.2s ease-in-out;
29
- }
30
-
31
- &__text {
32
- font-size: var(--ndt-font-size-xs);
33
- text-align: center;
34
- white-space: nowrap;
35
- }
36
- }
@@ -1,29 +0,0 @@
1
- import { Component, input } from '@angular/core';
2
- import { DevToolbarIconComponent } from '../icons/icon.component';
3
- import { IconName } from '../icons/icon.models';
4
-
5
- @Component({
6
- selector: 'ndt-link-button',
7
- standalone: true,
8
- imports: [DevToolbarIconComponent],
9
- template: `
10
- <a
11
- [href]="url()"
12
- target="_blank"
13
- rel="noopener noreferrer"
14
- class="link-button"
15
- >
16
- <div class="link-button__icon">
17
- <ndt-icon [name]="icon()" />
18
- </div>
19
- <span class="link-button__text">
20
- <ng-content></ng-content>
21
- </span>
22
- </a>
23
- `,
24
- styleUrls: ['./link-button.component.scss'],
25
- })
26
- export class DevToolbarLinkButtonComponent {
27
- readonly url = input.required<string>();
28
- readonly icon = input.required<IconName>();
29
- }
@@ -1,162 +0,0 @@
1
- @use '../../styles' as devtools;
2
- @use 'sass:map';
3
-
4
- .select {
5
- position: relative;
6
- width: 100%;
7
- min-width: 120px;
8
- display: flex;
9
- align-items: center;
10
- justify-content: space-between;
11
- padding: var(--ndt-spacing-sm) var(--ndt-spacing-md);
12
- border: 1px solid var(--ndt-border-primary);
13
- border-radius: var(--ndt-border-radius-small);
14
- background-color: var(--ndt-bg-primary);
15
- color: var(--ndt-text-primary);
16
- font-size: var(--ndt-font-size-sm);
17
- cursor: pointer;
18
- user-select: none;
19
- transition: var(--ndt-transition-default);
20
- outline: none;
21
- height: 32px;
22
- box-sizing: border-box;
23
-
24
- &:hover {
25
- background-color: var(--ndt-hover-bg);
26
- border-color: var(--ndt-primary);
27
- }
28
-
29
- &:focus-visible {
30
- outline: none;
31
- border-color: var(--ndt-primary);
32
- box-shadow: 0 0 0 2px rgba(var(--ndt-primary-rgb), 0.2);
33
- }
34
-
35
- &.small {
36
- padding: var(--ndt-spacing-xs) var(--ndt-spacing-sm);
37
- font-size: var(--ndt-font-size-sm);
38
- height: 24px;
39
- }
40
-
41
- &.open {
42
- border-color: var(--ndt-primary);
43
- box-shadow: 0 0 0 2px rgba(var(--ndt-primary-rgb), 0.2);
44
-
45
- .select__arrow {
46
- transform: rotate(180deg);
47
- }
48
- }
49
-
50
- &__value {
51
- flex: 1;
52
- white-space: nowrap;
53
- overflow: hidden;
54
- text-overflow: ellipsis;
55
- line-height: 1;
56
- margin-right: var(--ndt-spacing-sm);
57
- min-width: 0;
58
- }
59
-
60
- &__arrow {
61
- width: 16px;
62
- height: 16px;
63
- flex-shrink: 0;
64
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
65
- background-repeat: no-repeat;
66
- background-position: center;
67
- background-size: contain;
68
- transition: transform 0.2s ease;
69
- opacity: 0.9;
70
- }
71
- }
72
-
73
- .select-menu {
74
- display: inline-flex;
75
- flex-direction: column;
76
- min-width: 180px;
77
- background-color: var(--ndt-bg-primary);
78
- padding: var(--ndt-spacing-xs) 0;
79
- border: 1px solid var(--ndt-border-primary);
80
- border-radius: var(--ndt-border-radius-small);
81
- box-shadow: var(--ndt-shadow-window);
82
- color: var(--ndt-text-primary);
83
- max-height: min(400px, 70vh);
84
- overflow-y: auto;
85
- backdrop-filter: blur(8px);
86
-
87
- /* Scrollbar Styles */
88
- &::-webkit-scrollbar {
89
- width: 8px;
90
- height: 8px;
91
- }
92
-
93
- &::-webkit-scrollbar-track {
94
- background: transparent;
95
- }
96
-
97
- &::-webkit-scrollbar-thumb {
98
- background-color: var(--ndt-border-primary);
99
- border-radius: 4px;
100
- border: 2px solid var(--ndt-bg-primary);
101
- }
102
- }
103
-
104
- .select-menu-item {
105
- background-color: transparent;
106
- cursor: pointer;
107
- border: none;
108
- color: inherit;
109
- user-select: none;
110
- min-width: 64px;
111
- line-height: 36px;
112
- padding: 0 var(--ndt-spacing-md);
113
- display: flex;
114
- align-items: center;
115
- flex-direction: row;
116
- flex: 1;
117
- font-size: var(--ndt-font-size-sm);
118
- font-family: inherit;
119
- position: relative;
120
- white-space: nowrap;
121
- text-overflow: ellipsis;
122
- overflow: hidden;
123
-
124
- &:hover {
125
- background-color: var(--ndt-hover-bg);
126
- }
127
-
128
- &:active {
129
- background-color: rgba(var(--ndt-primary-rgb), 0.15);
130
- }
131
-
132
- &.selected {
133
- color: var(--ndt-primary);
134
- background-color: rgba(var(--ndt-primary-rgb), 0.1);
135
- font-weight: 500;
136
-
137
- &:hover {
138
- background-color: rgba(var(--ndt-primary-rgb), 0.15);
139
- }
140
-
141
- &::before {
142
- content: '';
143
- position: absolute;
144
- left: 0;
145
- top: 8px;
146
- width: 3px;
147
- height: calc(100% - 16px);
148
- background-color: var(--ndt-primary);
149
- border-radius: 2px;
150
- }
151
- }
152
-
153
- &:focus-visible {
154
- outline: none;
155
- background-color: var(--ndt-hover-bg);
156
- }
157
- }
158
-
159
- // Ensure proper theme inheritance in overlay
160
- .select-overlay {
161
- backdrop-filter: blur(8px);
162
- }
@@ -1,127 +0,0 @@
1
- import { CdkMenuModule } from '@angular/cdk/menu';
2
- import { ConnectedPosition, OverlayModule } from '@angular/cdk/overlay';
3
- import { CommonModule } from '@angular/common';
4
- import {
5
- ChangeDetectionStrategy,
6
- Component,
7
- computed,
8
- inject,
9
- input,
10
- model,
11
- signal,
12
- } from '@angular/core';
13
- import { FormsModule } from '@angular/forms';
14
- import { DevToolbarStateService } from '../../dev-toolbar-state.service';
15
-
16
- export interface SelectOption {
17
- value: string;
18
- label: string;
19
- }
20
-
21
- @Component({
22
- selector: 'ndt-select',
23
- standalone: true,
24
- imports: [CommonModule, FormsModule, OverlayModule, CdkMenuModule],
25
- template: `
26
- <div
27
- class="dev-toolbar select"
28
- [class.small]="size() === 'small'"
29
- [class.open]="isOpen()"
30
- [attr.aria-label]="ariaLabel()"
31
- [attr.aria-expanded]="isOpen()"
32
- [attr.aria-controls]="selectMenuId"
33
- [attr.data-theme]="theme()"
34
- cdkOverlayOrigin
35
- #trigger="cdkOverlayOrigin"
36
- (click)="toggle()"
37
- (keydown.enter)="toggle()"
38
- (keydown.space)="toggle()"
39
- tabindex="0"
40
- role="combobox"
41
- >
42
- <span class="select__value">{{ selectedLabel() }}</span>
43
- <span class="select__arrow" aria-hidden="true"></span>
44
- </div>
45
-
46
- <ng-template
47
- cdkConnectedOverlay
48
- [cdkConnectedOverlayOrigin]="trigger"
49
- [cdkConnectedOverlayOpen]="isOpen()"
50
- [cdkConnectedOverlayPositions]="positions"
51
- (overlayOutsideClick)="close()"
52
- >
53
- <div
54
- [id]="selectMenuId"
55
- class="dev-toolbar select-menu"
56
- cdkMenu
57
- role="listbox"
58
- [attr.data-theme]="theme()"
59
- >
60
- @for (option of options(); track option.value) {
61
- <button
62
- class="select-menu-item"
63
- [class.selected]="option.value === value()"
64
- [attr.aria-selected]="option.value === value()"
65
- cdkMenuItem
66
- type="button"
67
- (click)="selectOption(option)"
68
- >
69
- {{ option.label }}
70
- </button>
71
- }
72
- </div>
73
- </ng-template>
74
- `,
75
- styleUrls: ['./select.component.scss'],
76
- changeDetection: ChangeDetectionStrategy.OnPush,
77
- })
78
- export class DevToolbarSelectComponent {
79
- readonly devToolbarStateService = inject(DevToolbarStateService);
80
-
81
- value = model<string>();
82
- options = input.required<SelectOption[]>();
83
- ariaLabel = input<string>('');
84
- label = input<string>('');
85
- size = input<'small' | 'medium'>('medium');
86
- readonly theme = computed(() => this.devToolbarStateService.theme());
87
-
88
- protected readonly selectMenuId = `select-menu-${Math.random()
89
- .toString(36)
90
- .slice(2, 11)}`;
91
- isOpen = signal(false);
92
-
93
- selectedLabel = computed(() => {
94
- const selected = this.options()?.find((opt) => opt.value === this.value());
95
- return selected?.label ?? '';
96
- });
97
-
98
- positions: ConnectedPosition[] = [
99
- {
100
- originX: 'end',
101
- originY: 'bottom',
102
- overlayX: 'end',
103
- overlayY: 'top',
104
- offsetY: 4,
105
- },
106
- {
107
- originX: 'end',
108
- originY: 'top',
109
- overlayX: 'end',
110
- overlayY: 'bottom',
111
- offsetY: -4,
112
- },
113
- ];
114
-
115
- toggle() {
116
- this.isOpen.update((v) => !v);
117
- }
118
-
119
- close() {
120
- this.isOpen.set(false);
121
- }
122
-
123
- selectOption(option: SelectOption) {
124
- this.value.set(option.value);
125
- this.close();
126
- }
127
- }
@@ -1,67 +0,0 @@
1
- @use '../../styles' as devtools;
2
- @use 'sass:map';
3
- $dimensions: devtools.$dimensions;
4
-
5
- .tool-button {
6
- display: flex;
7
- justify-content: center;
8
- align-items: center;
9
- width: map.get($dimensions, toolbar-button-width);
10
- height: map.get($dimensions, toolbar-height);
11
- border: 0;
12
- background: transparent;
13
- color: var(--ndt-text-primary);
14
- transition: var(--ndt-transition-default);
15
- cursor: pointer;
16
- opacity: 0.5;
17
- position: relative;
18
-
19
- &--active {
20
- background: var(--ndt-hover-bg);
21
- opacity: 1;
22
- }
23
-
24
- &:hover {
25
- background: var(--ndt-hover-bg);
26
- opacity: 1;
27
- }
28
-
29
- ::ng-deep svg {
30
- width: 24px;
31
- height: 24px;
32
- display: block;
33
- margin: auto;
34
- }
35
-
36
- &__badge {
37
- position: absolute;
38
- top: -0.25rem;
39
- right: -0.25rem;
40
- background-color: var(--ndt-hover-danger);
41
- color: var(--ndt-text-primary);
42
- border-radius: var(--ndt-border-radius-full);
43
- min-width: 1rem;
44
- height: 1rem;
45
- font-size: 0.75rem;
46
- display: flex;
47
- align-items: center;
48
- justify-content: center;
49
- padding: 0.125rem;
50
- }
51
- }
52
-
53
- .tooltip {
54
- position: absolute;
55
- bottom: calc(100% + 1.2rem);
56
- left: 50%;
57
- transform: translateX(-50%);
58
- background: var(--ndt-bg-primary);
59
- color: var(--ndt-text-primary);
60
- padding: 0.5rem 0.75rem;
61
- border-radius: var(--ndt-border-radius-medium);
62
- font-size: 0.75rem;
63
- white-space: nowrap;
64
- pointer-events: none;
65
- z-index: 1000;
66
- box-shadow: var(--ndt-shadow-tooltip);
67
- }