devextreme-schematics 1.7.3 → 1.8.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/package.json +7 -7
  2. package/src/add-app-template/schema.json +2 -2
  3. package/src/add-layout/files/devextreme.json +30 -1
  4. package/src/add-layout/files/src/app/__name__.component.scss +0 -2
  5. package/src/add-layout/files/src/app/__name__.component.ts +2 -1
  6. package/src/add-layout/files/src/app/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.component.html +1 -1
  7. package/src/add-layout/files/src/app/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.component.scss +0 -6
  8. package/src/add-layout/files/src/app/layouts/side-nav-inner-toolbar/side-nav-inner-toolbar.component.ts +12 -5
  9. package/src/add-layout/files/src/app/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.component.html +1 -1
  10. package/src/add-layout/files/src/app/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.component.scss +1 -1
  11. package/src/add-layout/files/src/app/layouts/side-nav-outer-toolbar/side-nav-outer-toolbar.component.ts +11 -5
  12. package/src/add-layout/files/src/app/layouts/single-card/single-card.component.scss +2 -4
  13. package/src/add-layout/files/src/app/shared/components/create-account-form/create-account-form.component.scss +3 -5
  14. package/src/add-layout/files/src/app/shared/components/footer/footer.component.scss +7 -4
  15. package/src/add-layout/files/src/app/shared/components/header/header.component.html +9 -10
  16. package/src/add-layout/files/src/app/shared/components/header/header.component.scss +4 -7
  17. package/src/add-layout/files/src/app/shared/components/header/header.component.ts +3 -1
  18. package/src/add-layout/files/src/app/shared/components/login-form/login-form.component.scss +1 -4
  19. package/src/add-layout/files/src/app/shared/components/reset-password-form/reset-password-form.component.scss +1 -3
  20. package/src/add-layout/files/src/app/shared/components/side-navigation-menu/side-navigation-menu.component.scss +13 -39
  21. package/src/add-layout/files/src/app/shared/components/theme-switcher/theme-switcher.component.ts +33 -0
  22. package/src/add-layout/files/src/app/shared/components/user-panel/user-panel.component.html +13 -18
  23. package/src/add-layout/files/src/app/shared/components/user-panel/user-panel.component.scss +38 -54
  24. package/src/add-layout/files/src/app/shared/components/user-panel/user-panel.component.ts +3 -7
  25. package/src/add-layout/files/src/app/shared/services/index.ts +1 -0
  26. package/src/add-layout/files/src/app/shared/services/theme.service.ts +49 -0
  27. package/src/add-layout/files/src/dx-styles.scss +76 -52
  28. package/src/add-layout/files/src/themes/metadata.additional.dark.json +11 -0
  29. package/src/add-layout/files/src/themes/metadata.additional.json +1 -1
  30. package/src/add-layout/files/src/themes/metadata.base.dark.json +8 -0
  31. package/src/add-layout/files/src/themes/metadata.base.json +1 -1
  32. package/src/add-layout/files/src/variables.scss +37 -0
  33. package/src/add-layout/index.js +3 -0
  34. package/src/add-layout/index.js.map +1 -1
  35. package/src/add-layout/index.ts +3 -0
  36. package/src/add-layout/index_spec.js +12 -9
  37. package/src/add-layout/index_spec.js.map +1 -1
  38. package/src/add-layout/index_spec.ts +14 -9
  39. package/src/add-layout/schema.json +1 -1
  40. package/src/add-sample-views/files/pages/home/home.component.html +182 -34
  41. package/src/add-sample-views/files/pages/home/home.component.scss +19 -16
  42. package/src/add-sample-views/files/pages/profile/profile.component.html +1 -1
  43. package/src/add-sample-views/files/pages/tasks/tasks.component.html +3 -2
  44. package/src/add-sample-views/files/pages/tasks/tasks.component.scss +3 -0
  45. package/src/add-sample-views/files/pages/tasks/tasks.component.ts +1 -0
  46. package/src/add-sample-views/index_spec.js +2 -1
  47. package/src/add-sample-views/index_spec.js.map +1 -1
  48. package/src/add-sample-views/index_spec.ts +2 -1
  49. package/src/add-view/index.js +38 -11
  50. package/src/add-view/index.js.map +1 -1
  51. package/src/add-view/index.ts +41 -14
  52. package/src/add-view/index_spec.js +7 -4
  53. package/src/add-view/index_spec.js.map +1 -1
  54. package/src/add-view/index_spec.ts +7 -4
  55. package/src/install/index_spec.js +3 -2
  56. package/src/install/index_spec.js.map +1 -1
  57. package/src/install/index_spec.ts +3 -2
  58. package/src/install/schema.json +1 -1
  59. package/src/utility/latest-versions.js +2 -2
  60. package/src/utility/latest-versions.js.map +1 -1
  61. package/src/utility/latest-versions.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devextreme-schematics",
3
- "version": "1.7.3",
3
+ "version": "1.8.0-beta.0",
4
4
  "description": "DevExtreme schematics",
5
5
  "scripts": {
6
6
  "build": "tsc -p tsconfig.json",
@@ -22,18 +22,18 @@
22
22
  ],
23
23
  "schematics": "./src/collection.json",
24
24
  "dependencies": {
25
- "@angular-devkit/core": "^16.2.10",
26
- "@angular-devkit/schematics": "^16.2.10",
27
- "@schematics/angular": "^16.2.10"
25
+ "@angular-devkit/core": "^17.2.1",
26
+ "@angular-devkit/schematics": "^17.2.1",
27
+ "@schematics/angular": "^17.2.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/jasmine": "~3.10.18",
31
- "@types/node": "ts4.9",
31
+ "@types/node": "ts5.2",
32
32
  "@types/semver": "^7.5.7",
33
33
  "jasmine": "^2.99.0",
34
34
  "rxjs": "^6.6.7",
35
35
  "tslint": "^5.20.1",
36
- "typescript": "^4.9.3"
36
+ "typescript": "~5.2.1"
37
37
  },
38
- "gitHead": "48c1b12ef9aef7f6b976971af76b7966a79f3883"
38
+ "gitHead": "afe86ffa75cfe3ee7b9b5a78af5adcb2e3bb28f3"
39
39
  }
@@ -39,11 +39,11 @@
39
39
  "dxversion": {
40
40
  "type": "string",
41
41
  "description": "The DevExtreme version",
42
- "default": "24.1.4"
42
+ "default": "24.2.2-beta"
43
43
  },
44
44
  "globalNgCliVersion": {
45
45
  "type":"string",
46
- "default": "^16.2.0"
46
+ "default": "^17.2.0"
47
47
  },
48
48
  "empty": {
49
49
  "type": "boolean",
@@ -8,13 +8,28 @@
8
8
  "inputFile": "<%= sourcePath %>/themes/metadata.base.json",
9
9
  "outputFile": "<%= sourcePath %>/themes/generated/theme.base.css"
10
10
  }
11
- }, {
11
+ },
12
+ {
13
+ "command": "build-theme",
14
+ "options": {
15
+ "inputFile": "<%= sourcePath %>/themes/metadata.base.dark.json",
16
+ "outputFile": "<%= sourcePath %>/themes/generated/theme.base.dark.css"
17
+ }
18
+ },
19
+ {
12
20
  "command": "build-theme",
13
21
  "options": {
14
22
  "inputFile": "<%= sourcePath %>/themes/metadata.additional.json",
15
23
  "outputFile": "<%= sourcePath %>/themes/generated/theme.additional.css"
16
24
  }
17
25
  },
26
+ {
27
+ "command": "build-theme",
28
+ "options": {
29
+ "inputFile": "<%= sourcePath %>/themes/metadata.additional.dark.json",
30
+ "outputFile": "<%= sourcePath %>/themes/generated/theme.additional.dark.css"
31
+ }
32
+ },
18
33
  {
19
34
  "command": "export-theme-vars",
20
35
  "options": {
@@ -22,12 +37,26 @@
22
37
  "outputFile": "<%= sourcePath %>/themes/generated/variables.base.scss"
23
38
  }
24
39
  },
40
+ {
41
+ "command": "export-theme-vars",
42
+ "options": {
43
+ "inputFile": "<%= sourcePath %>/themes/metadata.base.dark.json",
44
+ "outputFile": "<%= sourcePath %>/themes/generated/variables.base.dark.scss"
45
+ }
46
+ },
25
47
  {
26
48
  "command": "export-theme-vars",
27
49
  "options": {
28
50
  "inputFile": "<%= sourcePath %>/themes/metadata.additional.json",
29
51
  "outputFile": "<%= sourcePath %>/themes/generated/variables.additional.scss"
30
52
  }
53
+ },
54
+ {
55
+ "command": "export-theme-vars",
56
+ "options": {
57
+ "inputFile": "<%= sourcePath %>/themes/metadata.additional.dark.json",
58
+ "outputFile": "<%= sourcePath %>/themes/generated/variables.additional.dark.scss"
59
+ }
31
60
  }
32
61
  ]
33
62
  }
@@ -1,6 +1,4 @@
1
1
  :host {
2
- @import "../themes/generated/variables.base.scss";
3
- background-color: darken($base-bg, 5.00);
4
2
  display: flex;
5
3
  height: 100%;
6
4
  width: 100%;
@@ -9,7 +9,8 @@ import { AuthService, ScreenService, AppInfoService } from './shared/services';
9
9
  })
10
10
  export class <%= strings.classify(name) %>Component {
11
11
  @HostBinding('class') get getClass() {
12
- return Object.keys(this.screen.sizes).filter(cl => this.screen.sizes[cl]).join(' ');
12
+ const sizeClassName = Object.keys(this.screen.sizes).filter(cl => this.screen.sizes[cl]).join(' ');
13
+ return `${sizeClassName} app` ;
13
14
  }
14
15
 
15
16
  constructor(private authService: AuthService, private screen: ScreenService, public appInfo: AppInfoService) { }
@@ -11,7 +11,7 @@
11
11
  <app-side-navigation-menu
12
12
  [compactMode]="!menuOpened"
13
13
  [selectedItem]="selectedRoute"
14
- class="dx-swatch-additional"
14
+ [ngClass]="swatchClassName"
15
15
  *dxTemplate="let dataMenu of 'panel'"
16
16
  (selectedItemChanged)="navigationChanged($event)"
17
17
  (openMenu)="navigationClick()">
@@ -3,14 +3,8 @@
3
3
  }
4
4
 
5
5
  #navigation-header {
6
- @import "../../../themes/generated/variables.additional.scss";
7
- background-color: $base-accent;
8
6
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
9
7
 
10
- ::ng-deep .menu-button .dx-icon {
11
- color: $base-text-color;
12
- }
13
-
14
8
  :host-context(.screen-x-small) & {
15
9
  padding-left: 20px;
16
10
  }
@@ -1,13 +1,15 @@
1
1
  import { Component, OnInit, NgModule, Input, ViewChild } from '@angular/core';
2
- import { SideNavigationMenuModule, HeaderModule } from '../../shared/components';
3
- import { ScreenService } from '../../shared/services';
2
+ import { Router, NavigationEnd } from '@angular/router';
3
+ import { CommonModule } from '@angular/common';
4
+
4
5
  import { DxTreeViewTypes } from 'devextreme-angular/ui/tree-view';
5
6
  import { DxDrawerModule, DxDrawerTypes } from 'devextreme-angular/ui/drawer';
6
7
  import { DxScrollViewModule, DxScrollViewComponent } from 'devextreme-angular/ui/scroll-view';
7
8
  import { DxToolbarModule, DxToolbarTypes } from 'devextreme-angular/ui/toolbar';
8
- import { CommonModule } from '@angular/common';
9
9
 
10
- import { Router, NavigationEnd } from '@angular/router';
10
+ import { SideNavigationMenuModule, HeaderModule } from '../../shared/components';
11
+ import { ScreenService } from '../../shared/services';
12
+ import { ThemeService } from '../../shared/services/theme.service';
11
13
 
12
14
  @Component({
13
15
  selector: 'app-side-nav-inner-toolbar',
@@ -29,8 +31,13 @@ export class SideNavInnerToolbarComponent implements OnInit {
29
31
  menuRevealMode: DxDrawerTypes.RevealMode = 'expand';
30
32
  minMenuSize = 0;
31
33
  shaderEnabled = false;
34
+ swatchClassName = 'dx-swatch-additional';
32
35
 
33
- constructor(private screen: ScreenService, private router: Router) { }
36
+ constructor(protected themeService: ThemeService, private screen: ScreenService, private router: Router) {
37
+ themeService.isDark.subscribe((isDark) => {
38
+ this.swatchClassName = 'dx-swatch-additional' + (isDark ? '-dark' : '');
39
+ })
40
+ }
34
41
 
35
42
  ngOnInit() {
36
43
  this.menuOpened = this.screen.sizes['screen-large'];
@@ -18,7 +18,7 @@
18
18
  <app-side-navigation-menu
19
19
  [compactMode]="!menuOpened"
20
20
  [selectedItem]="selectedRoute"
21
- class="dx-swatch-additional"
21
+ [ngClass]="swatchClassName"
22
22
  *dxTemplate="let dataMenu of 'panel'"
23
23
  (selectedItemChanged)="navigationChanged($event)"
24
24
  (openMenu)="navigationClick()">
@@ -6,5 +6,5 @@
6
6
  }
7
7
 
8
8
  .layout-header {
9
- z-index: 1501;
9
+ z-index: 1505;
10
10
  }
@@ -1,12 +1,13 @@
1
1
  import { Component, OnInit, NgModule, Input, ViewChild } from '@angular/core';
2
- import { SideNavigationMenuModule, HeaderModule } from '../../shared/components';
3
- import { ScreenService } from '../../shared/services';
2
+ import { CommonModule } from '@angular/common';
3
+ import { Router, NavigationEnd } from '@angular/router';
4
+
4
5
  import { DxTreeViewTypes } from 'devextreme-angular/ui/tree-view';
5
6
  import { DxDrawerModule, DxDrawerTypes } from 'devextreme-angular/ui/drawer';
6
7
  import { DxScrollViewModule, DxScrollViewComponent } from 'devextreme-angular/ui/scroll-view';
7
- import { CommonModule } from '@angular/common';
8
8
 
9
- import { Router, NavigationEnd } from '@angular/router';
9
+ import { SideNavigationMenuModule, HeaderModule } from '../../shared/components';
10
+ import { ScreenService, ThemeService } from '../../shared/services';
10
11
 
11
12
  @Component({
12
13
  selector: 'app-side-nav-outer-toolbar',
@@ -28,8 +29,13 @@ export class SideNavOuterToolbarComponent implements OnInit {
28
29
  menuRevealMode: DxDrawerTypes.RevealMode = 'expand';
29
30
  minMenuSize = 0;
30
31
  shaderEnabled = false;
32
+ swatchClassName = 'dx-swatch-additional';
31
33
 
32
- constructor(private screen: ScreenService, private router: Router) { }
34
+ constructor(protected themeService: ThemeService, private screen: ScreenService, private router: Router) {
35
+ themeService.isDark.subscribe((isDark) => {
36
+ this.swatchClassName = 'dx-swatch-additional' + (isDark ? '-dark' : '');
37
+ })
38
+ }
33
39
 
34
40
  ngOnInit() {
35
41
  this.menuOpened = this.screen.sizes['screen-large'];
@@ -1,5 +1,3 @@
1
- @import "../../../themes/generated/variables.base.scss";
2
-
3
1
  :host {
4
2
  width: 100%;
5
3
  height: 100%;
@@ -26,14 +24,14 @@
26
24
  margin-bottom: 30px;
27
25
 
28
26
  .title {
29
- color: $base-text-color;
27
+ color: var(--base-text-color);
30
28
  line-height: 28px;
31
29
  font-weight: 500;
32
30
  font-size: 24px;
33
31
  }
34
32
 
35
33
  .description {
36
- color: rgba($base-text-color, alpha($base-text-color) * 0.7);
34
+ color: var(--base-text-color-alpha-7);
37
35
  line-height: 18px;
38
36
  }
39
37
  }
@@ -1,19 +1,17 @@
1
- @import "../../../../themes/generated/variables.base.scss";
2
-
3
1
  .create-account-form {
4
2
  .policy-info {
5
3
  margin: 10px 0;
6
- color: rgba($base-text-color, alpha($base-text-color) * 0.7);
4
+ color: var(--base-text-color-alpha-7);
7
5
  font-size: 14px;
8
6
  font-style: normal;
9
7
 
10
8
  a {
11
- color: rgba($base-text-color, alpha($base-text-color) * 0.7);
9
+ color: var(--base-text-color-alpha-7);
12
10
  }
13
11
  }
14
12
 
15
13
  .login-link {
16
- color: $base-accent;
14
+ color: var(--base-accent);
17
15
  font-size: 16px;
18
16
  text-align: center;
19
17
  }
@@ -1,9 +1,12 @@
1
- @import "../../../../themes/generated/variables.base.scss";
2
-
3
1
  :host {
4
2
  display: block;
5
- color: rgba($base-text-color, alpha($base-text-color) * 0.7);
6
- border-top: 1px solid rgba(0, 0, 0, 0.1);
3
+ color: var(--base-text-color-alpha-7);
4
+ border-top: 1px solid var(--footer-border-color);
7
5
  padding-top: 20px;
8
6
  padding-bottom: 24px;
7
+ margin: 0 40px;
8
+
9
+ .screen-x-small & {
10
+ margin: 0 20px;
11
+ }
9
12
  }
@@ -17,24 +17,23 @@
17
17
  *ngIf="title"
18
18
  [text]="title">
19
19
  </dxi-item>
20
+ <dxi-item
21
+ location="after"
22
+ >
23
+ <ng-container *dxTemplate>
24
+ <theme-switcher></theme-switcher>
25
+ </ng-container>
26
+ </dxi-item>
20
27
  <dxi-item
21
28
  location="after"
22
29
  locateInMenu="auto"
23
30
  menuItemTemplate="menuItem">
24
31
  <div *dxTemplate="let data of 'item'">
25
- <dx-button
26
- class="user-button authorization"
27
- width="210px"
28
- height="100%"
29
- stylingMode="text">
30
- <div *dxTemplate="let data of 'content'">
31
- <app-user-panel [user]="user" [menuItems]="userMenuItems" menuMode="context"></app-user-panel>
32
- </div>
33
- </dx-button>
32
+ <app-user-panel [menuItems]="userMenuItems"></app-user-panel>
34
33
  </div>
35
34
  </dxi-item>
36
35
  <div *dxTemplate="let data of 'menuItem'">
37
- <app-user-panel [user]="user" [menuItems]="userMenuItems" menuMode="list"></app-user-panel>
36
+ <app-user-panel [menuItems]="userMenuItems" menuMode="list"></app-user-panel>
38
37
  </div>
39
38
  </dx-toolbar>
40
39
  </header>
@@ -1,14 +1,11 @@
1
- @import "../../../../themes/generated/variables.base.scss";
2
- @import "../../../../dx-styles.scss";
3
-
4
1
  :host {
5
2
  flex: 0 0 auto;
6
3
  z-index: 1;
7
4
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
5
+ }
8
6
 
9
- ::ng-deep .dx-toolbar .dx-toolbar-item.menu-button>.dx-toolbar-item-content .dx-icon {
10
- color: $base-accent;
11
- }
7
+ ::ng-deep header {
8
+ background-color: var(--base-bg);
12
9
  }
13
10
 
14
11
  ::ng-deep .dx-toolbar.header-toolbar .dx-toolbar-items-container .dx-toolbar-after {
@@ -20,7 +17,7 @@
20
17
  }
21
18
 
22
19
  ::ng-deep .dx-toolbar .dx-toolbar-item.menu-button {
23
- width: $side-panel-min-width;
20
+ width: var(--side-panel-min-width);
24
21
  text-align: center;
25
22
  padding: 0;
26
23
  }
@@ -7,6 +7,7 @@ import { DxButtonModule } from 'devextreme-angular/ui/button';
7
7
  import { DxToolbarModule } from 'devextreme-angular/ui/toolbar';
8
8
 
9
9
  import { Router } from '@angular/router';
10
+ import {ThemeSwitcherModule} from "../theme-switcher/theme-switcher.component";
10
11
  @Component({
11
12
  selector: 'app-header',
12
13
  templateUrl: 'header.component.html',
@@ -57,7 +58,8 @@ export class HeaderComponent implements OnInit {
57
58
  CommonModule,
58
59
  DxButtonModule,
59
60
  UserPanelModule,
60
- DxToolbarModule
61
+ DxToolbarModule,
62
+ ThemeSwitcherModule,
61
63
  ],
62
64
  declarations: [ HeaderComponent ],
63
65
  exports: [ HeaderComponent ]
@@ -1,6 +1,3 @@
1
- @import "../../../../themes/generated/variables.base.scss";
2
-
3
-
4
1
  .login-form {
5
2
  .link {
6
3
  text-align: center;
@@ -14,6 +11,6 @@
14
11
 
15
12
  ::ng-deep .form-text {
16
13
  margin: 10px 0;
17
- color: rgba($base-text-color, alpha($base-text-color) * 0.7);
14
+ color: var(--base-text-color-alpha-7);
18
15
  }
19
16
  }
@@ -1,12 +1,10 @@
1
- @import "../../../../themes/generated/variables.base.scss";
2
-
3
1
  .reset-password-form {
4
2
  ::ng-deep .submit-button {
5
3
  margin-top: 10px;
6
4
  }
7
5
 
8
6
  .login-link {
9
- color: $base-accent;
7
+ color: var(--base-accent);
10
8
  font-size: 16px;
11
9
  text-align: center;
12
10
  }
@@ -1,19 +1,18 @@
1
- @import "../../../../dx-styles.scss";
2
- @import "../../../../themes/generated/variables.additional.scss";
3
-
4
- :host {
1
+ :host.dx-swatch-additional,
2
+ :host.dx-swatch-additional-dark {
5
3
  display: flex;
6
4
  flex-direction: column;
7
5
  min-height: 100%;
8
6
  height: 100%;
9
7
  width: 250px !important;
8
+ background-color: var(--base-bg);
10
9
 
11
- .menu-container {
10
+ ::ng-deep .menu-container {
12
11
  min-height: 100%;
13
12
  display: flex;
14
13
  flex: 1;
15
14
 
16
- ::ng-deep .dx-treeview {
15
+ .dx-treeview {
17
16
  // ## Long text positioning
18
17
  white-space: nowrap;
19
18
  // ##
@@ -21,15 +20,17 @@
21
20
  // ## Icon width customization
22
21
  .dx-treeview-item {
23
22
  padding-left: 0;
23
+ border-radius: 0;
24
24
  flex-direction: row-reverse;
25
25
 
26
26
  .dx-icon {
27
- width: $side-panel-min-width !important;
27
+ width: var(--side-panel-min-width) !important;
28
28
  margin: 0 !important;
29
29
  }
30
30
  }
31
+
31
32
  // ##
32
-
33
+
33
34
  // ## Arrow customization
34
35
  .dx-treeview-node {
35
36
  padding: 0 0 !important;
@@ -48,43 +49,16 @@
48
49
 
49
50
  // ## Item levels customization
50
51
  .dx-treeview-node {
51
- &[aria-level='1'] {
52
+ &[aria-level="1"] {
52
53
  font-weight: bold;
53
- border-bottom: 1px solid $base-border-color;
54
54
  }
55
-
56
- &[aria-level='2'] .dx-treeview-item-content {
55
+
56
+ &[aria-level="2"] .dx-treeview-item-content {
57
57
  font-weight: normal;
58
- padding: 0 $side-panel-min-width;
58
+ padding: 0 var(--side-panel-min-width);
59
59
  }
60
60
  }
61
61
  // ##
62
62
  }
63
-
64
- // ## Selected & Focuced items customization
65
- ::ng-deep .dx-treeview {
66
- .dx-treeview-node-container {
67
- .dx-treeview-node {
68
- &.dx-state-selected:not(.dx-state-focused)> .dx-treeview-item {
69
- background: transparent;
70
- }
71
-
72
- &.dx-state-selected > .dx-treeview-item * {
73
- color: $base-accent;
74
- }
75
-
76
- &:not(.dx-state-focused)>.dx-treeview-item.dx-state-hover {
77
- background-color: lighten($base-bg, 4.00);
78
- }
79
- }
80
- }
81
- }
82
-
83
- :host-context(.dx-theme-generic) ::ng-deep.dx-treeview {
84
- .dx-treeview-node-container .dx-treeview-node.dx-state-selected.dx-state-focused > .dx-treeview-item * {
85
- color: inherit;
86
- }
87
- }
88
- // ##
89
63
  }
90
64
  }
@@ -0,0 +1,33 @@
1
+ import {
2
+ Component, NgModule,
3
+ } from '@angular/core';
4
+ import { CommonModule } from '@angular/common';
5
+ import { DxButtonModule } from 'devextreme-angular';
6
+ import { ThemeService } from '../../services/theme.service';
7
+
8
+ @Component({
9
+ selector: 'theme-switcher',
10
+ template: `
11
+ <dx-button
12
+ class="theme-button"
13
+ stylingMode="text"
14
+ [icon]="themeService.currentTheme === 'dark' ? 'sun' : 'moon'"
15
+ (onClick)="onButtonClick()"
16
+ ></dx-button>`,
17
+ styleUrls: [],
18
+ standalone: false
19
+ })
20
+ export class ThemeSwitcherComponent {
21
+ constructor(public themeService: ThemeService) {}
22
+
23
+ onButtonClick () {
24
+ this.themeService.switchTheme();
25
+ }
26
+ }
27
+
28
+ @NgModule({
29
+ imports: [CommonModule, DxButtonModule],
30
+ declarations: [ThemeSwitcherComponent],
31
+ exports: [ThemeSwitcherComponent],
32
+ })
33
+ export class ThemeSwitcherModule { }
@@ -1,25 +1,20 @@
1
1
  <div class="user-panel">
2
- <div class="user-info">
3
- <div class="image-container">
4
- <div class="user-image"></div>
5
- </div>
6
- <div class="user-name">{{user?.email}}</div>
7
- </div>
8
- <dx-context-menu
9
- *ngIf="menuMode === 'context'"
2
+ <dx-drop-down-button
3
+ *ngIf="menuMode !== 'list'"
4
+ stylingMode="text"
5
+ [icon]="'https://js.devexpress.com/Demos/WidgetsGallery/JSDemos/images/employees/06.png'"
6
+ [showArrowIcon]="false"
10
7
  [items]="menuItems"
11
- target=".user-button"
12
- showEvent="dxclick"
13
- width="210px"
14
- [position]="{
15
- my: 'top',
16
- at: 'bottom'
17
- }"
18
- cssClass="user-menu">
19
- </dx-context-menu>
8
+ displayExpr="text"
9
+ keyExpr="id"
10
+ [elementAttr]="{class: 'user-button'}"
11
+ [dropDownOptions]="{width: '150px'}">
12
+ </dx-drop-down-button>
20
13
  <dx-list
21
14
  *ngIf="menuMode === 'list'"
22
- class="dx-toolbar-menu-action"
15
+ displayExpr="text"
16
+ keyExpr="id"
17
+ width="130"
23
18
  [items]="menuItems">
24
19
  </dx-list>
25
20
  </div>