@elderbyte/ngx-starter 15.7.2 → 15.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elderbyte/ngx-starter",
3
- "version": "15.7.2",
3
+ "version": "15.8.1",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^15.0.0 || ^16.0.0",
6
6
  "@angular/common": "^15.0.0 || ^16.0.0",
@@ -1,6 +1,10 @@
1
1
  @use 'mat-icon-button-size' as icon-button-size;
2
+ @use '@angular/material' as mat;
2
3
 
3
- @mixin elder-common-styles ($common-sizes) {
4
+ @mixin elder-common-styles ($theme, $common-sizes) {
5
+
6
+ $form-field-density: map-get($theme, elder, density, form-field);
7
+ @include mat.private-form-field-density($form-field-density);
4
8
 
5
9
  /***************************************************************************
6
10
  * *
@@ -110,7 +114,7 @@
110
114
 
111
115
  .mdc-text-field--filled {
112
116
  .mdc-floating-label--float-above {
113
- transform: translateY(-145%) scale(0.75);
117
+ transform: translateY(-100%) scale(0.75);
114
118
  }
115
119
  .mat-mdc-form-field-infix {
116
120
  padding-top: 14px!important; // 16px by default
@@ -1,9 +1,33 @@
1
+ @use '@angular/material' as mat;
1
2
 
2
- @mixin elder-style-fixes {
3
+
4
+ @mixin elder-style-fixes($theme) {
3
5
  @include _ng-style-fixes;
4
- @include _mat-style-fixes;
6
+ @include _mat-style-fixes($theme);
7
+ }
8
+
9
+ @function calc-form-icon-padding($theme) {
10
+ $density: map-get($theme, elder, density, form-field);
11
+ @return calc(12px + #{$density}px * 2);
12
+ }
13
+
14
+ @function calc-form-icon-size($theme) {
15
+ $density: map-get($theme, elder, density, form-field);
16
+
17
+ @if $density > -3 {
18
+ @return 48px;
19
+ } @else {
20
+ @return 40px;
21
+ }
5
22
  }
6
23
 
24
+ @function calc-padding-top-form-field-inflix($density) {
25
+ @if $density > -3 {
26
+ @return 20px;
27
+ } @else {
28
+ @return 14px;
29
+ }
30
+ }
7
31
 
8
32
  @mixin _ng-style-fixes {
9
33
  // Trick to ensure flex functionality within router-outlet
@@ -18,8 +42,10 @@
18
42
  }
19
43
  }
20
44
 
45
+ @mixin _mat-style-fixes($theme) {
21
46
 
22
- @mixin _mat-style-fixes {
47
+ $iconSize: calc-form-icon-size($theme);
48
+ $iconPadding: calc-form-icon-padding($theme);
23
49
 
24
50
  // Globally disable automatic scrolling of Material Drawer Container
25
51
  .mat-drawer-inner-container {
@@ -85,10 +111,71 @@
85
111
  }
86
112
 
87
113
  /******************************
114
+ Fix cut off label
115
+ *******************************/
116
+
117
+
118
+ .mat-mdc-form-field {
119
+
120
+ /******************************
121
+ Fix icon size and placement in mat label
122
+ *******************************/
123
+
124
+ $mat-mdc-form-field-label-transform: 0.75;
125
+ $mat-mdc-form-field-label-offset-x: -16px;
126
+
127
+ a {
128
+ display: flex;
129
+ justify-content: center;
130
+ align-items: center;
131
+ }
132
+
133
+ .mat-mdc-form-field-icon-prefix>.mat-icon, .mat-mdc-form-field-icon-suffix>.mat-icon {
134
+ width: $iconSize !important;
135
+ height: $iconSize !important;
136
+ padding: 0 $iconPadding !important;
137
+ display: flex;
138
+ justify-content: center;
139
+ align-items: center;
140
+ box-sizing: border-box;
141
+ }
142
+
143
+ .mat-mdc-icon-button .mat-mdc-button-touch-target {
144
+ width: $iconSize !important;
145
+ height: $iconSize !important;
146
+ line-height: 0;
147
+ }
148
+
149
+ .mat-mdc-icon-button.mat-mdc-button-base {
150
+ width: $iconSize !important;
151
+ height: $iconSize !important;
152
+ padding: 0 $iconPadding !important;
153
+ line-height: 0;
154
+ }
155
+
156
+ /******************************
157
+ Fix text and hover placement of small filled form fields
158
+ *******************************/
159
+
160
+ $form-field-density: map-get($theme, elder, density, form-field);
161
+
162
+ @if $form-field-density < -1 {
163
+ .mdc-text-field--filled {
164
+ .mdc-floating-label--float-above {
165
+ transform: var( $mat-mdc-form-field-label-transform, translateY(-50%) translateX(calc(1 * (44px + var($mat-mdc-form-field-label-offset-x, 0px))))) !important;
166
+ }
167
+ .mat-mdc-form-field-infix {
168
+ padding-top: calc-padding-top-form-field-inflix($form-field-density) !important;
169
+ padding-bottom: 2px !important;
170
+ min-height: 40px; // (24 + 2*16) = 56px by default
171
+ }
172
+ }
173
+ }
174
+
175
+ /******************************
88
176
  Material Form Field Label stealing clicks
89
177
  *******************************/
90
178
 
91
- .mat-mdc-form-field {
92
179
  .mat-mdc-floating-label.mdc-floating-label {
93
180
  pointer-events: none!important;
94
181
  mat-label {
@@ -110,5 +197,8 @@
110
197
  padding-right: 0;
111
198
  }
112
199
  }
200
+ }
113
201
 
202
+ .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-floating-label {
203
+ display: block !important;
114
204
  }
@@ -2,7 +2,7 @@
2
2
  * Based on https://github.com/btxtiger/mat-icon-button-sizes
3
3
  * The default factor between button and icon size is *= 0.6
4
4
  */
5
- @mixin matIconButtonSize($buttonSize, $iconSize) {
5
+ @mixin matIconButtonSize($buttonSize, $iconSize) {
6
6
  width: $buttonSize !important;
7
7
  height: $buttonSize !important;
8
8
  padding: 0px !important;