@ecodev/natural 67.0.0 → 68.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "67.0.0",
3
+ "version": "68.0.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -5,6 +5,7 @@
5
5
  @use './styles/material-scrolling-fixes.scss';
6
6
  @use './styles/table.scss';
7
7
  @use './styles/typography.scss';
8
+ @use './styles/material-overrides.scss';
8
9
  @use './modules/panels/panels.scss';
9
10
  @use './modules/sidenav/sidenav.scss';
10
11
  @use './modules/alert/alert.scss';
@@ -36,21 +37,25 @@
36
37
  white-space: nowrap;
37
38
  }
38
39
 
39
- body {
40
- // Fix a bug where hover on errored form fields show on-error color (white) label on grey background
41
- @include mat.form-field-overrides(
42
- (
43
- filled-error-hover-label-text-color: var(--mat-sys-error),
44
- filled-error-hover-active-indicator-color: var(--mat-sys-error),
45
- )
46
- );
40
+ html,
41
+ body,
42
+ app-root {
43
+ margin: 0;
44
+ height: 100%;
45
+ min-height: 100%;
46
+ }
47
47
 
48
- @include mat.dialog-overrides(
49
- (
50
- container-color: var(--mat-sys-surface-bright),
51
- container-elevation-shadow: var(--mat-sys-level5),
52
- )
53
- );
48
+ app-root {
49
+ display: flex;
50
+ flex-direction: row;
51
+ justify-content: center;
52
+ align-items: center;
53
+ }
54
+
55
+ body {
56
+ background-color: var(--mat-sys-surface-container);
57
+ color: var(--mat-sys-on-surface);
58
+ font: var(--mat-sys-body-medium);
54
59
 
55
60
  --nat-elevation: inset 0 1px rgba(255, 255, 255, 0.3), var(--mat-sys-level1);
56
61
  --nat-gradient-primary: var(--mat-sys-primary-container);
@@ -61,11 +66,16 @@ body {
61
66
  --nat-on-good: white;
62
67
  --nat-gradient-good: var(--nat-good);
63
68
  --nat-gradient-inverse-surface: var(--mat-sys-inverse-surface);
69
+ --nat-dark-fixed: #343434;
70
+ --nat-on-dark-fixed: #f8f8f8;
64
71
  --nat-bad: rgb(200, 11, 11);
65
72
  --nat-on-bad: white;
66
73
  --nat-gradient-bad: var(--nat-bad);
74
+ --nat-link-color: var(--mat-sys-on-surface);
67
75
 
68
76
  @supports (color: color-mix(in srgb, red, blue)) {
77
+ --nat-link-color: color-mix(in srgb, var(--mat-sys-primary-container) 80%, var(--mat-sys-on-surface));
78
+
69
79
  --nat-gradient-primary: linear-gradient(
70
80
  175deg,
71
81
  color-mix(in srgb, var(--mat-sys-primary-container) 95%, white),
@@ -107,6 +117,12 @@ body {
107
117
  color-mix(in srgb, var(--nat-bad) 60%, white),
108
118
  color-mix(in srgb, var(--nat-bad) 90%, black)
109
119
  );
120
+
121
+ --nat-gradient-dark-fixed: linear-gradient(
122
+ 175deg,
123
+ color-mix(in srgb, var(--nat-dark-fixed) 90%, white),
124
+ color-mix(in srgb, var(--nat-dark-fixed) 90%, black)
125
+ );
110
126
  }
111
127
  }
112
128
 
@@ -122,33 +138,38 @@ body {
122
138
  }
123
139
 
124
140
  &-neutral1 {
125
- background-color: var(--mat-sys-neutral10);
126
- color: var(--mat-sys-on-surface);
141
+ background-color: var(--mat-sys-neutral10) !important;
142
+ color: var(--mat-sys-on-surface) !important;
127
143
  }
128
144
 
129
145
  &-neutral2 {
130
- background-color: var(--mat-sys-neutral-variant20);
131
- color: var(--mat-sys-on-surface);
146
+ background-color: var(--mat-sys-neutral-variant20) !important;
147
+ color: var(--mat-sys-on-surface) !important;
132
148
  }
133
149
 
134
150
  &-primary {
135
- background-color: var(--mat-sys-primary-container);
136
- color: var(--mat-sys-on-primary-container);
151
+ background-color: var(--mat-sys-primary-container) !important;
152
+ color: var(--mat-sys-on-primary-container) !important;
137
153
  }
138
154
 
139
155
  &-secondary {
140
- background-color: var(--mat-sys-secondary-container);
141
- color: var(--mat-sys-on-secondary-container);
156
+ background-color: var(--mat-sys-secondary-container) !important;
157
+ color: var(--mat-sys-on-secondary-container) !important;
142
158
  }
143
159
 
144
160
  &-tertiary {
145
- background-color: var(--mat-sys-tertiary-container);
146
- color: var(--mat-sys-on-tertiary-container);
161
+ background-color: var(--mat-sys-tertiary-container) !important;
162
+ color: var(--mat-sys-on-tertiary-container) !important;
147
163
  }
148
164
 
149
165
  &-error {
150
- background-color: var(--mat-sys-error);
151
- color: var(--mat-sys-on-error);
166
+ background-color: var(--mat-sys-error) !important;
167
+ color: var(--mat-sys-on-error) !important;
168
+ }
169
+
170
+ &-dark-fixed {
171
+ background-color: var(--nat-dark-fixed) !important;
172
+ color: var(--nat-on-dark-fixed) !important;
152
173
  }
153
174
  }
154
175
 
@@ -201,6 +222,24 @@ body {
201
222
  background: var(--nat-gradient-inverse-surface) !important;
202
223
  color: var(--mat-sys-inverse-on-surface) !important;
203
224
  }
225
+
226
+ &-dark-fixed {
227
+ background: var(--nat-gradient-dark-fixed) !important;
228
+ color: var(--nat-on-dark-fixed) !important;
229
+ }
230
+ }
231
+
232
+ // Most of our sidenav menus (mainly in admin) use simple nat-gradient-* that applies a contrasted text color
233
+ // that is overridden on child element
234
+ // This instruction activate text color inheritance to simplify html and css for active routes.
235
+ .mat-mdc-list-item {
236
+ &[routerlinkactive*='nat-frame-'],
237
+ &[routerlinkactive*='nat-gradient-'] {
238
+ .mdc-list-item__start,
239
+ .mdc-list-item__primary-text {
240
+ color: inherit !important;
241
+ }
242
+ }
204
243
  }
205
244
 
206
245
  .nat-bold {
@@ -247,3 +286,21 @@ eco-fab-speed-dial .mdc-fab {
247
286
  );
248
287
  }
249
288
  }
289
+
290
+ app-support a,
291
+ .rich-text a,
292
+ a.app-link {
293
+ cursor: pointer;
294
+ border-bottom-width: 2px;
295
+ border-bottom-style: solid;
296
+ border-color: var(--mat-sys-primary-container);
297
+ color: var(--nat-link-color);
298
+ text-decoration: none;
299
+
300
+ &:hover {
301
+ @supports (color: color-mix(in srgb, red, blue)) {
302
+ border-color: color-mix(in srgb, var(--mat-sys-primary-container) 85%, black);
303
+ color: color-mix(in srgb, var(--mat-sys-primary-container) 85%, black);
304
+ }
305
+ }
306
+ }
@@ -1,6 +1,5 @@
1
1
  @use '@angular/material' as mat;
2
2
 
3
- // TODO angular 21 : replace tonal by m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
4
3
  .mdc-button {
5
4
  @include mat.button-overrides(
6
5
  (
@@ -0,0 +1,114 @@
1
+ @use '@angular/material' as mat;
2
+
3
+ body {
4
+ --nat-components-primary: var(--mat-sys-primary-container);
5
+
6
+ @include mat.dialog-overrides(
7
+ (
8
+ container-color: var(--mat-sys-surface-bright),
9
+ container-elevation-shadow: var(--mat-sys-level5),
10
+ )
11
+ );
12
+
13
+ @include mat.button-overrides(
14
+ (
15
+ outlined-label-text-color: var(--nat-link-color),
16
+ text-label-text-color: var(--nat-link-color),
17
+ filled-container-color: var(--nat-components-primary),
18
+ filled-label-text-color: var(--mat-sys-on-primary-container),
19
+ )
20
+ );
21
+
22
+ @include mat.slide-toggle-overrides(
23
+ (
24
+ selected-track-color: var(--nat-components-primary),
25
+ selected-pressed-track-color: var(--nat-components-primary),
26
+ selected-hover-track-color: var(--nat-components-primary),
27
+ selected-focus-track-color: var(--nat-components-primary),
28
+ selected-handle-color: var(--mat-sys-surface-container-lowest),
29
+ selected-focus-handle-color: var(--mat-sys-surface-container-lowest),
30
+ selected-icon-color: var(--nat-components-primary),
31
+ selected-hover-handle-color: var(--mat-sys-surface-container-lowest),
32
+ selected-pressed-handle-color: var(--mat-sys-surface-container-lowest),
33
+ )
34
+ );
35
+
36
+ @include mat.checkbox-overrides(
37
+ (
38
+ selected-icon-color: var(--nat-components-primary),
39
+ selected-focus-icon-color: var(--nat-components-primary),
40
+ selected-hover-icon-color: var(--nat-components-primary),
41
+ selected-pressed-icon-color: var(--nat-components-primary),
42
+ )
43
+ );
44
+
45
+ @include mat.radio-overrides(
46
+ (
47
+ selected-icon-color: var(--nat-components-primary),
48
+ selected-hover-icon-color: var(--nat-components-primary),
49
+ selected-focus-icon-color: var(--nat-components-primary),
50
+ selected-pressed-icon-color: var(--nat-components-primary),
51
+ )
52
+ );
53
+
54
+ @include mat.table-overrides(
55
+ (
56
+ row-item-outline-color: var(--mat-sys-outline-variant),
57
+ )
58
+ );
59
+
60
+ @include mat.tabs-overrides(
61
+ (
62
+ active-indicator-color: var(--nat-components-primary),
63
+ active-focus-indicator-color: var(--nat-components-primary),
64
+ active-hover-indicator-color: var(--nat-components-primary),
65
+ )
66
+ );
67
+
68
+ @include mat.form-field-overrides(
69
+ (
70
+ filled-focus-active-indicator-color: var(--nat-components-primary),
71
+ filled-focus-label-text-color: var(--mat-sys-on-surface),
72
+ // Fix a bug where hover on errored form fields show on-error color (white) label on grey background
73
+ filled-error-hover-label-text-color: var(--mat-sys-error),
74
+ filled-error-hover-active-indicator-color: var(--mat-sys-error),
75
+ )
76
+ );
77
+
78
+ @include mat.select-overrides(
79
+ (
80
+ focused-arrow-color: var(--mat-sys-on-surface),
81
+ )
82
+ );
83
+
84
+ @include mat.progress-spinner-overrides(
85
+ (
86
+ active-indicator-color: var(--nat-components-primary),
87
+ )
88
+ );
89
+
90
+ @include mat.slider-overrides(
91
+ (
92
+ handle-color: var(--nat-components-primary),
93
+ focus-handle-color: var(--nat-components-primary),
94
+ active-track-color: var(--nat-components-primary),
95
+ inactive-track-color: var(--mat-sys-on-surface),
96
+ label-container-color: var(--mat-sys-on-surface),
97
+ label-label-text-color: var(--mat-sys-surface-container-lowest),
98
+ )
99
+ );
100
+
101
+ @include mat.sidenav-overrides(
102
+ (
103
+ container-background-color: var(--mat-sys-surface-container),
104
+ content-background-color: var(--mat-sys-surface-container),
105
+ )
106
+ );
107
+
108
+ @include mat.fab-overrides(
109
+ (
110
+ container-color: var(--mat-sys-tertiary-container),
111
+ foreground-color: var(--mat-sys-on-tertiary-container),
112
+ )
113
+ );
114
+ }
@@ -13,7 +13,7 @@
13
13
  );
14
14
 
15
15
  .mat-mdc-header-row {
16
- background-color: var(--mat-sys-surface-container-high);
16
+ background: var(--mat-sys-surface-container-high);
17
17
  }
18
18
 
19
19
  .mat-mdc-footer-row {
@@ -22,7 +22,7 @@
22
22
 
23
23
  @include mat.paginator-overrides(
24
24
  (
25
- container-background-color: var(--mat-sys-surface-container-low),
25
+ container-background-color: var(--mat-sys-surface-container-lowest),
26
26
  )
27
27
  );
28
28
  }
@@ -33,6 +33,7 @@
33
33
 
34
34
  [mat-cell] {
35
35
  justify-content: center;
36
+ background: var(--mat-sys-surface-container-lowest);
36
37
  }
37
38
 
38
39
  .mdc-data-table__content .mdc-data-table__row:last-child .mdc-data-table__cell {
@@ -1,112 +1,5 @@
1
- // TODO After angular v21, replace entire file with: body{ @include mat.system-classes();}
1
+ @use '@angular/material' as mat;
2
2
 
3
- // ***********************************************************************************************
4
- // Font - Apply typography styles
5
- // See https://m3.material.io/styles/typography/applying-type for guidance.
6
- // ***********************************************************************************************
7
-
8
- // Sets the font to the body small typeface. Use for small body text, such as captions. In Angular
9
- // Material, this is used for the subscript text in a form field and the text in a paginator.
10
- .mat-font-body-sm {
11
- font: var(--mat-sys-body-small);
12
- letter-spacing: var(--mat-sys-body-small-tracking);
13
- }
14
-
15
- // Sets the font to the body medium typeface. Use for medium body text, this is the default
16
- // body font. In Angular Material, this is used for the text in a table row and the supporting
17
- // text in a dialog.
18
- .mat-font-body-md {
19
- font: var(--mat-sys-body-medium);
20
- letter-spacing: var(--mat-sys-body-medium-tracking);
21
- }
22
-
23
- // Sets the font to the body large typeface. Use for large body text, such as an introductory
24
- // paragraph. In Angular Material, this is used for the text in a list item and the text in a
25
- // select trigger.
26
- .mat-font-body-lg {
27
- font: var(--mat-sys-body-large);
28
- letter-spacing: var(--mat-sys-body-large-tracking);
29
- }
30
-
31
- // Sets the font to the display small typeface. Use for small display text, such as a date.
32
- .mat-font-display-sm {
33
- font: var(--mat-sys-display-small);
34
- letter-spacing: var(--mat-sys-display-small-tracking);
35
- }
36
-
37
- // Sets the font to the display medium typeface. Use for medium display text, such as a hero
38
- // title.
39
- .mat-font-display-md {
40
- font: var(--mat-sys-display-medium);
41
- letter-spacing: var(--mat-sys-display-medium-tracking);
42
- }
43
-
44
- // Sets the font to the display large typeface. Use for large display text, such as a hero title.
45
- .mat-font-display-lg {
46
- font: var(--mat-sys-display-large);
47
- letter-spacing: var(--mat-sys-display-large-tracking);
48
- }
49
-
50
- // Sets the font to the headline small typeface. Use for small headlines, such as a page title. In
51
- // Angular Material, this is used for the headline in a dialog.
52
- .mat-font-headline-sm {
53
- font: var(--mat-sys-headline-small);
54
- letter-spacing: var(--mat-sys-headline-small-tracking);
55
- }
56
-
57
- // Sets the font to the headline medium typeface. Use for medium headlines, such as a section
58
- // title.
59
- .mat-font-headline-md {
60
- font: var(--mat-sys-headline-medium);
61
- letter-spacing: var(--mat-sys-headline-medium-tracking);
62
- }
63
-
64
- // Sets the font to the headline large typeface. Use for large headlines, such as a page title on
65
- // a large screen.
66
- .mat-font-headline-lg {
67
- font: var(--mat-sys-headline-large);
68
- letter-spacing: var(--mat-sys-headline-large-tracking);
69
- }
70
-
71
- // Sets the font to the label small typeface. Use for small labels, such as text in a badge.
72
- .mat-font-label-sm {
73
- font: var(--mat-sys-label-small);
74
- letter-spacing: var(--mat-sys-label-small-tracking);
75
- }
76
-
77
- // Sets the font to the label medium typeface. Use for medium labels. In Angular Material, this
78
- // is used for the slider label.
79
- .mat-font-label-md {
80
- font: var(--mat-sys-label-medium);
81
- letter-spacing: var(--mat-sys-label-medium-tracking);
82
- }
83
-
84
- // Sets the font to the label large typeface. Use for large labels. In Angular Material, this is
85
- // used for buttons, chips, and menu labels.
86
- .mat-font-label-lg {
87
- font: var(--mat-sys-label-large);
88
- letter-spacing: var(--mat-sys-label-large-tracking);
89
- }
90
-
91
- // Sets the font to the title small typeface. Use for small titles, such as a card title. In
92
- // Angular Material, this is used for the header of a table and the label of an option group.
93
- .mat-font-title-sm {
94
- font: var(--mat-sys-title-small);
95
- letter-spacing: var(--mat-sys-title-small-tracking);
96
- }
97
-
98
- // Sets the font to the title medium typeface. Use for medium titles, such as a dialog title
99
- // or the primary text in a list item. In Angular Material, this is used for the subtitle
100
- // of a card and the header of an expansion panel.
101
- .mat-font-title-md {
102
- font: var(--mat-sys-title-medium);
103
- letter-spacing: var(--mat-sys-title-medium-tracking);
104
- }
105
-
106
- // Sets the font to the title large typeface. Use for large titles, such as a page title on a
107
- // small screen. In Angular Material, this is used for the title of a card and the title of a
108
- // toolbar.
109
- .mat-font-title-lg {
110
- font: var(--mat-sys-title-large);
111
- letter-spacing: var(--mat-sys-title-large-tracking);
3
+ body {
4
+ @include mat.system-classes();
112
5
  }
@@ -1927,7 +1927,7 @@ declare class NaturalColumnsPickerComponent implements OnChanges {
1927
1927
  readonly isMobile: rxjs.Observable<boolean>;
1928
1928
  private initColumns;
1929
1929
  updateColumns(): void;
1930
- ngOnChanges(changes: SimpleChanges): void;
1930
+ ngOnChanges(changes: SimpleChanges<this>): void;
1931
1931
  defaultTrue(value: boolean | undefined): boolean;
1932
1932
  color(button: Button): NaturalPalette | null;
1933
1933
  useCheckbox(button: Button): boolean;
@@ -2940,7 +2940,7 @@ declare abstract class NaturalAbstractFile implements OnInit, OnDestroy, OnChang
2940
2940
  private readonly document;
2941
2941
  ngOnDestroy(): void;
2942
2942
  ngOnInit(): void;
2943
- ngOnChanges(changes: SimpleChanges): void;
2943
+ ngOnChanges(changes: SimpleChanges<this>): void;
2944
2944
  private getFileElement;
2945
2945
  private enableSelecting;
2946
2946
  protected handleFiles(files: File[]): void;
@@ -3045,7 +3045,7 @@ declare class NaturalFileComponent implements OnInit, OnChanges {
3045
3045
  readonly modelChange: i0.OutputEmitterRef<FileModel>;
3046
3046
  imagePreview: string;
3047
3047
  filePreview: string | null;
3048
- ngOnChanges(changes: SimpleChanges): void;
3048
+ ngOnChanges(changes: SimpleChanges<this>): void;
3049
3049
  ngOnInit(): void;
3050
3050
  upload(file: File): void;
3051
3051
  getDownloadLink(): null | string;
@@ -3153,7 +3153,7 @@ declare class NaturalHierarchicSelectorComponent implements OnInit, OnChanges {
3153
3153
  /**
3154
3154
  * Angular OnChange implementation
3155
3155
  */
3156
- ngOnChanges(changes: SimpleChanges): void;
3156
+ ngOnChanges(changes: SimpleChanges<this>): void;
3157
3157
  ngOnInit(): void;
3158
3158
  /**
3159
3159
  * Toggle selection of a node, considering if multiple selection is activated or not