@ng-matero/extensions 16.3.2 → 17.1.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.
Files changed (251) hide show
  1. package/_index.scss +26 -13
  2. package/alert/_alert-theme.scss +54 -24
  3. package/alert/alert-module.d.ts +3 -3
  4. package/alert/alert.d.ts +4 -7
  5. package/alert/alert.scss +3 -3
  6. package/button/_button-theme.scss +6 -4
  7. package/button/button-loading.d.ts +5 -10
  8. package/button/button-module.d.ts +5 -5
  9. package/checkbox-group/checkbox-group-module.d.ts +6 -6
  10. package/checkbox-group/checkbox-group.d.ts +5 -10
  11. package/colorpicker/_colorpicker-theme.scss +62 -34
  12. package/colorpicker/colorpicker-input.d.ts +2 -4
  13. package/colorpicker/colorpicker-module.d.ts +10 -10
  14. package/colorpicker/colorpicker-toggle.d.ts +4 -5
  15. package/colorpicker/colorpicker.d.ts +8 -9
  16. package/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
  17. package/column-resize/column-resize-directives/column-resize.d.ts +1 -1
  18. package/column-resize/column-resize-module.d.ts +1 -1
  19. package/core/color/_all-color.scss +7 -18
  20. package/core/datetime/datetime.module.d.ts +4 -1
  21. package/core/density/_all-density.scss +17 -25
  22. package/core/pipes/is-template-ref.pipe.d.ts +1 -1
  23. package/core/pipes/pipes.module.d.ts +4 -4
  24. package/core/pipes/to-observable.pipe.d.ts +1 -1
  25. package/core/style/_sass-utils.scss +13 -1
  26. package/core/theming/_all-theme.scss +32 -17
  27. package/core/tokens/_token-utils.scss +4 -5
  28. package/core/tokens/m2/mdc/_plain-tooltip.scss +21 -29
  29. package/core/tokens/m2/mtx/_alert.scss +14 -15
  30. package/core/tokens/m2/mtx/_colorpicker.scss +8 -11
  31. package/core/tokens/m2/mtx/_datetimepicker.scss +38 -47
  32. package/core/tokens/m2/mtx/_drawer.scss +9 -10
  33. package/core/tokens/m2/mtx/_grid.scss +23 -22
  34. package/core/tokens/m2/mtx/_loader.scss +6 -6
  35. package/core/tokens/m2/mtx/_popover.scss +10 -11
  36. package/core/tokens/m2/mtx/_progress.scss +18 -17
  37. package/core/tokens/m2/mtx/_select.scss +23 -24
  38. package/core/tokens/m2/mtx/_split.scss +8 -11
  39. package/core/typography/_all-typography.scss +40 -0
  40. package/core/typography/_typography.scss +1 -579
  41. package/datetimepicker/_datetimepicker-theme.scss +75 -48
  42. package/datetimepicker/calendar-body.d.ts +1 -1
  43. package/datetimepicker/calendar.d.ts +8 -15
  44. package/datetimepicker/calendar.scss +16 -4
  45. package/datetimepicker/clock.d.ts +2 -3
  46. package/datetimepicker/datetimepicker-content.scss +3 -3
  47. package/datetimepicker/datetimepicker-input.d.ts +2 -3
  48. package/datetimepicker/datetimepicker-module.d.ts +16 -16
  49. package/datetimepicker/datetimepicker-toggle.d.ts +4 -5
  50. package/datetimepicker/datetimepicker.d.ts +16 -27
  51. package/datetimepicker/month-view.d.ts +2 -2
  52. package/datetimepicker/multi-year-view.d.ts +2 -2
  53. package/datetimepicker/time.d.ts +6 -8
  54. package/datetimepicker/time.scss +2 -2
  55. package/datetimepicker/year-view.d.ts +2 -2
  56. package/dialog/dialog-container.d.ts +1 -1
  57. package/dialog/dialog-module.d.ts +7 -7
  58. package/drawer/_drawer-theme.scss +55 -22
  59. package/drawer/drawer-container.d.ts +1 -1
  60. package/drawer/drawer-container.scss +25 -4
  61. package/drawer/drawer-module.d.ts +5 -5
  62. package/esm2022/alert/alert-module.mjs +6 -7
  63. package/esm2022/alert/alert.mjs +11 -18
  64. package/esm2022/button/button-loading.mjs +13 -23
  65. package/esm2022/button/button-module.mjs +6 -7
  66. package/esm2022/checkbox-group/checkbox-group-module.mjs +6 -7
  67. package/esm2022/checkbox-group/checkbox-group.mjs +19 -31
  68. package/esm2022/colorpicker/colorpicker-input.mjs +14 -14
  69. package/esm2022/colorpicker/colorpicker-module.mjs +20 -19
  70. package/esm2022/colorpicker/colorpicker-toggle.mjs +19 -18
  71. package/esm2022/colorpicker/colorpicker.mjs +46 -44
  72. package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +6 -5
  73. package/esm2022/column-resize/column-resize-directives/column-resize.mjs +6 -5
  74. package/esm2022/column-resize/column-resize-module.mjs +6 -6
  75. package/esm2022/column-resize/column-resize-notifier.mjs +7 -7
  76. package/esm2022/column-resize/column-resize.mjs +4 -4
  77. package/esm2022/column-resize/column-size-store.mjs +3 -3
  78. package/esm2022/column-resize/event-dispatcher.mjs +5 -5
  79. package/esm2022/column-resize/overlay-handle.mjs +4 -4
  80. package/esm2022/column-resize/polyfill.mjs +1 -1
  81. package/esm2022/column-resize/resizable.mjs +4 -4
  82. package/esm2022/column-resize/resize-strategy.mjs +14 -14
  83. package/esm2022/core/datetime/datetime-adapter.mjs +1 -1
  84. package/esm2022/core/datetime/datetime.module.mjs +19 -23
  85. package/esm2022/core/datetime/native-datetime-adapter.mjs +6 -6
  86. package/esm2022/core/pipes/is-template-ref.pipe.mjs +5 -5
  87. package/esm2022/core/pipes/pipes.module.mjs +6 -7
  88. package/esm2022/core/pipes/to-observable.pipe.mjs +5 -5
  89. package/esm2022/datetimepicker/calendar-body.mjs +5 -6
  90. package/esm2022/datetimepicker/calendar.mjs +38 -48
  91. package/esm2022/datetimepicker/clock.mjs +11 -11
  92. package/esm2022/datetimepicker/datetimepicker-errors.mjs +4 -3
  93. package/esm2022/datetimepicker/datetimepicker-input.mjs +14 -14
  94. package/esm2022/datetimepicker/datetimepicker-intl.mjs +3 -3
  95. package/esm2022/datetimepicker/datetimepicker-module.mjs +28 -11
  96. package/esm2022/datetimepicker/datetimepicker-toggle.mjs +19 -18
  97. package/esm2022/datetimepicker/datetimepicker.mjs +70 -89
  98. package/esm2022/datetimepicker/month-view.mjs +8 -10
  99. package/esm2022/datetimepicker/multi-year-view.mjs +10 -11
  100. package/esm2022/datetimepicker/time.mjs +19 -24
  101. package/esm2022/datetimepicker/year-view.mjs +10 -11
  102. package/esm2022/dialog/dialog-container.mjs +21 -12
  103. package/esm2022/dialog/dialog-module.mjs +23 -7
  104. package/esm2022/dialog/dialog.mjs +7 -6
  105. package/esm2022/drawer/drawer-container.mjs +7 -8
  106. package/esm2022/drawer/drawer-module.mjs +6 -7
  107. package/esm2022/drawer/drawer-ref.mjs +1 -1
  108. package/esm2022/drawer/drawer.mjs +8 -7
  109. package/esm2022/grid/cell.mjs +36 -14
  110. package/esm2022/grid/column-menu.mjs +31 -15
  111. package/esm2022/grid/column-resize/column-resize-directives/column-resize-flex.mjs +6 -5
  112. package/esm2022/grid/column-resize/column-resize-directives/column-resize.mjs +6 -5
  113. package/esm2022/grid/column-resize/column-resize-module.mjs +14 -14
  114. package/esm2022/grid/column-resize/index.mjs +8 -0
  115. package/esm2022/grid/column-resize/overlay-handle.mjs +7 -6
  116. package/esm2022/grid/column-resize/resizable-directives/resizable.mjs +7 -6
  117. package/esm2022/grid/column-resize/resize-strategy.mjs +5 -5
  118. package/esm2022/grid/expansion-toggle.mjs +6 -5
  119. package/esm2022/grid/grid-module.mjs +39 -37
  120. package/esm2022/grid/grid-pipes.mjs +30 -30
  121. package/esm2022/grid/grid-utils.mjs +7 -6
  122. package/esm2022/grid/grid.mjs +175 -111
  123. package/esm2022/loader/loader-module.mjs +6 -7
  124. package/esm2022/loader/loader.mjs +17 -29
  125. package/esm2022/photoviewer/photoviewer-module.mjs +6 -7
  126. package/esm2022/photoviewer/photoviewer.mjs +8 -7
  127. package/esm2022/popover/popover-content.mjs +10 -9
  128. package/esm2022/popover/popover-module.mjs +22 -7
  129. package/esm2022/popover/popover-target.mjs +6 -5
  130. package/esm2022/popover/popover-trigger.mjs +15 -8
  131. package/esm2022/popover/popover.mjs +54 -139
  132. package/esm2022/progress/progress-module.mjs +6 -7
  133. package/esm2022/progress/progress.mjs +15 -26
  134. package/esm2022/select/option.mjs +12 -17
  135. package/esm2022/select/select-module.mjs +20 -9
  136. package/esm2022/select/select.mjs +19 -19
  137. package/esm2022/select/templates.mjs +56 -56
  138. package/esm2022/split/split-module.mjs +6 -7
  139. package/esm2022/split/split-pane.mjs +6 -5
  140. package/esm2022/split/split.mjs +8 -8
  141. package/esm2022/split/utils.mjs +1 -1
  142. package/esm2022/tooltip/tooltip-module.mjs +24 -7
  143. package/esm2022/tooltip/tooltip.mjs +104 -117
  144. package/fesm2022/mtxAlert.mjs +15 -23
  145. package/fesm2022/mtxAlert.mjs.map +1 -1
  146. package/fesm2022/mtxButton.mjs +17 -28
  147. package/fesm2022/mtxButton.mjs.map +1 -1
  148. package/fesm2022/mtxCheckboxGroup.mjs +22 -37
  149. package/fesm2022/mtxCheckboxGroup.mjs.map +1 -1
  150. package/fesm2022/mtxColorpicker.mjs +479 -474
  151. package/fesm2022/mtxColorpicker.mjs.map +1 -1
  152. package/fesm2022/mtxColumnResize.mjs +51 -49
  153. package/fesm2022/mtxColumnResize.mjs.map +1 -1
  154. package/fesm2022/mtxCore.mjs +36 -41
  155. package/fesm2022/mtxCore.mjs.map +1 -1
  156. package/fesm2022/mtxDatetimepicker.mjs +898 -905
  157. package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
  158. package/fesm2022/mtxDialog.mjs +47 -25
  159. package/fesm2022/mtxDialog.mjs.map +1 -1
  160. package/fesm2022/mtxDrawer.mjs +20 -21
  161. package/fesm2022/mtxDrawer.mjs.map +1 -1
  162. package/fesm2022/mtxGrid.mjs +330 -229
  163. package/fesm2022/mtxGrid.mjs.map +1 -1
  164. package/fesm2022/mtxLoader.mjs +21 -36
  165. package/fesm2022/mtxLoader.mjs.map +1 -1
  166. package/fesm2022/mtxPhotoviewer.mjs +12 -12
  167. package/fesm2022/mtxPhotoviewer.mjs.map +1 -1
  168. package/fesm2022/mtxPopover.mjs +103 -165
  169. package/fesm2022/mtxPopover.mjs.map +1 -1
  170. package/fesm2022/mtxProgress.mjs +19 -32
  171. package/fesm2022/mtxProgress.mjs.map +1 -1
  172. package/fesm2022/mtxSelect.mjs +99 -93
  173. package/fesm2022/mtxSelect.mjs.map +1 -1
  174. package/fesm2022/mtxSplit.mjs +17 -18
  175. package/fesm2022/mtxSplit.mjs.map +1 -1
  176. package/fesm2022/mtxTooltip.mjs +128 -125
  177. package/fesm2022/mtxTooltip.mjs.map +1 -1
  178. package/grid/_grid-theme.scss +58 -29
  179. package/grid/cell.d.ts +1 -1
  180. package/grid/column-menu.d.ts +1 -1
  181. package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
  182. package/grid/column-resize/column-resize-directives/column-resize.d.ts +1 -1
  183. package/grid/column-resize/column-resize-module.d.ts +7 -6
  184. package/grid/column-resize/index.d.ts +7 -0
  185. package/grid/column-resize/overlay-handle.d.ts +1 -1
  186. package/grid/column-resize/resizable-directives/resizable.d.ts +1 -1
  187. package/grid/expansion-toggle.d.ts +1 -1
  188. package/grid/grid-module.d.ts +25 -25
  189. package/grid/grid-pipes.d.ts +7 -7
  190. package/grid/grid.d.ts +57 -25
  191. package/grid/grid.scss +8 -1
  192. package/loader/_loader-theme.scss +55 -22
  193. package/loader/loader-module.d.ts +5 -5
  194. package/loader/loader.d.ts +5 -10
  195. package/loader/loader.scss +1 -1
  196. package/package.json +13 -19
  197. package/photoviewer/photoviewer-module.d.ts +1 -1
  198. package/photoviewer/photoviewer.d.ts +2 -1
  199. package/popover/_popover-theme.scss +55 -22
  200. package/popover/popover-content.d.ts +1 -1
  201. package/popover/popover-module.d.ts +8 -8
  202. package/popover/popover-target.d.ts +1 -1
  203. package/popover/popover-trigger.d.ts +1 -1
  204. package/popover/popover.d.ts +24 -55
  205. package/popover/popover.scss +1 -1
  206. package/prebuilt-themes/deeppurple-amber.css +1 -1
  207. package/prebuilt-themes/indigo-pink.css +1 -1
  208. package/prebuilt-themes/pink-bluegrey.css +1 -1
  209. package/prebuilt-themes/purple-green.css +1 -1
  210. package/progress/_progress-theme.scss +60 -22
  211. package/progress/progress-module.d.ts +3 -3
  212. package/progress/progress.d.ts +5 -10
  213. package/progress/progress.scss +3 -3
  214. package/select/_select-theme.scss +66 -34
  215. package/select/option.d.ts +3 -6
  216. package/select/select-module.d.ts +7 -7
  217. package/select/select.d.ts +2 -4
  218. package/select/select.scss +109 -109
  219. package/select/templates.d.ts +11 -11
  220. package/split/_split-theme.scss +62 -32
  221. package/split/split-module.d.ts +4 -4
  222. package/split/split-pane.d.ts +1 -1
  223. package/split/split.d.ts +1 -1
  224. package/split/split.scss +2 -4
  225. package/tooltip/_tooltip-theme.scss +66 -34
  226. package/tooltip/tooltip-module.d.ts +7 -7
  227. package/tooltip/tooltip.d.ts +30 -44
  228. package/tooltip/tooltip.scss +2 -4
  229. package/_theming.scss +0 -16
  230. package/alert/_alert-theme.import.scss +0 -2
  231. package/button/_button-theme.import.scss +0 -2
  232. package/colorpicker/_colorpicker-theme.import.scss +0 -2
  233. package/core/density/_compatibility.scss +0 -74
  234. package/core/mdc-helpers/_mdc-helpers.scss +0 -242
  235. package/core/style/_elevation.scss +0 -91
  236. package/core/style/_private.scss +0 -32
  237. package/core/style/_variables.scss +0 -44
  238. package/core/style/_vendor-prefixes.scss +0 -46
  239. package/core/theming/_palette.scss +0 -746
  240. package/core/theming/_theming.scss +0 -497
  241. package/core/typography/_typography-utils.scss +0 -101
  242. package/datetimepicker/_datetimepicker-theme.import.scss +0 -4
  243. package/drawer/_drawer-theme.import.scss +0 -2
  244. package/grid/_grid-theme.import.scss +0 -2
  245. package/loader/_loader-theme.import.scss +0 -2
  246. package/popover/_popover-theme.import.scss +0 -2
  247. package/progress/_progress-theme.import.scss +0 -2
  248. package/select/_select-density.scss +0 -68
  249. package/select/_select-theme.import.scss +0 -3
  250. package/split/_split-theme.import.scss +0 -2
  251. package/tooltip/_tooltip-theme.import.scss +0 -1
@@ -1,51 +1,81 @@
1
- @use '../core/theming/theming';
1
+ @use '@angular/material' as mat;
2
2
  @use '../core/style/sass-utils';
3
3
  @use '../core/tokens/token-utils';
4
4
  @use '../core/tokens/m2/mtx/split' as tokens-mtx-split;
5
5
 
6
- @mixin color($config-or-theme) {
7
- $config: theming.get-color-config($config-or-theme);
8
-
9
- @include sass-utils.current-selector-or-root() {
10
- @include token-utils.create-token-values(tokens-mtx-split.$prefix,
11
- tokens-mtx-split.get-color-tokens($config));
6
+ @mixin base($theme) {
7
+ @if mat.get-theme-version($theme) == 1 {
8
+ @include _theme-from-tokens(mat.get-theme-tokens($theme, base));
12
9
  }
10
+ @else {
11
+ @include sass-utils.current-selector-or-root() {
12
+ @include token-utils.create-token-values(tokens-mtx-split.$prefix,
13
+ tokens-mtx-split.get-unthemable-tokens());
14
+ }
15
+ }
16
+ }
13
17
 
14
- .mtx-split>.mtx-split-gutter {
15
- &.mat-accent:hover {
16
- $accent-tokens: tokens-mtx-split.private-get-color-palette-color-tokens($config, accent);
17
- @include token-utils.create-token-values(tokens-mtx-split.$prefix, $accent-tokens);
18
+ @mixin color($theme) {
19
+ @if mat.get-theme-version($theme) == 1 {
20
+ @include _theme-from-tokens(mat.get-theme-tokens($theme, color));
21
+ }
22
+ @else {
23
+ @include sass-utils.current-selector-or-root() {
24
+ @include token-utils.create-token-values(tokens-mtx-split.$prefix,
25
+ tokens-mtx-split.get-color-tokens($theme));
18
26
  }
19
27
 
20
- &.mat-warn:hover {
21
- $warn-tokens: tokens-mtx-split.private-get-color-palette-color-tokens($config, warn);
22
- @include token-utils.create-token-values(tokens-mtx-split.$prefix, $warn-tokens);
28
+ .mtx-split>.mtx-split-gutter {
29
+ &.mat-accent:hover {
30
+ $accent-tokens: tokens-mtx-split.private-get-color-palette-color-tokens($theme, accent);
31
+ @include token-utils.create-token-values(tokens-mtx-split.$prefix, $accent-tokens);
32
+ }
33
+
34
+ &.mat-warn:hover {
35
+ $warn-tokens: tokens-mtx-split.private-get-color-palette-color-tokens($theme, warn);
36
+ @include token-utils.create-token-values(tokens-mtx-split.$prefix, $warn-tokens);
37
+ }
23
38
  }
24
39
  }
25
40
  }
26
41
 
27
- @mixin typography($config-or-theme) {}
28
-
29
- @mixin density($config-or-theme) {}
30
-
31
- @mixin theme($theme-or-color-config) {
32
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
42
+ @mixin typography($theme) {
43
+ @if mat.get-theme-version($theme) == 1 {
44
+ @include _theme-from-tokens(mat.get-theme-tokens($theme, typography));
45
+ }
46
+ @else {}
47
+ }
33
48
 
34
- @include theming.private-check-duplicate-theme-styles($theme, 'mtx-split') {
35
- $color: theming.get-color-config($theme);
36
- $density: theming.get-density-config($theme);
37
- $typography: theming.get-typography-config($theme);
49
+ @mixin density($theme) {
50
+ @if mat.get-theme-version($theme) == 1 {
51
+ @include _theme-from-tokens(mat.get-theme-tokens($theme, density));
52
+ }
53
+ @else {}
54
+ }
38
55
 
39
- @if $color !=null {
40
- @include color($color);
56
+ @mixin theme($theme) {
57
+ @include mat.private-check-duplicate-theme-styles($theme, 'mtx-split') {
58
+ @if mat.get-theme-version($theme) == 1 {
59
+ @include _theme-from-tokens(mat.get-theme-tokens($theme));
41
60
  }
42
-
43
- @if $density !=null {
44
- @include density($density);
61
+ @else {
62
+ @include base($theme);
63
+ @if mat.theme-has($theme, color) {
64
+ @include color($theme);
65
+ }
66
+ @if mat.theme-has($theme, density) {
67
+ @include density($theme);
68
+ }
69
+ @if mat.theme-has($theme, typography) {
70
+ @include typography($theme);
71
+ }
45
72
  }
73
+ }
74
+ }
46
75
 
47
- @if $typography !=null {
48
- @include typography($typography);
49
- }
76
+ @mixin _theme-from-tokens($tokens) {
77
+ @if ($tokens != ()) {
78
+ @include token-utils.create-token-values(tokens-mtx-split.$prefix,
79
+ map.get($tokens, tokens-mtx-split.$prefix));
50
80
  }
51
81
  }
@@ -1,9 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "./split";
3
- import * as i2 from "./split-pane";
4
- import * as i3 from "@angular/common";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "./split";
4
+ import * as i3 from "./split-pane";
5
5
  export declare class MtxSplitModule {
6
6
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxSplitModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<MtxSplitModule, [typeof i1.MtxSplit, typeof i2.MtxSplitPane], [typeof i3.CommonModule], [typeof i1.MtxSplit, typeof i2.MtxSplitPane]>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MtxSplitModule, never, [typeof i1.CommonModule, typeof i2.MtxSplit, typeof i3.MtxSplitPane], [typeof i2.MtxSplit, typeof i3.MtxSplitPane]>;
8
8
  static ɵinj: i0.ɵɵInjectorDeclaration<MtxSplitModule>;
9
9
  }
@@ -34,5 +34,5 @@ export declare class MtxSplitPane implements OnInit, OnDestroy {
34
34
  unlockEvents(): void;
35
35
  ngOnDestroy(): void;
36
36
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxSplitPane, never>;
37
- static ɵdir: i0.ɵɵDirectiveDeclaration<MtxSplitPane, "mtx-split-pane, [mtx-split-pane]", ["mtxSplitPane"], { "order": { "alias": "order"; "required": false; }; "size": { "alias": "size"; "required": false; }; "minSize": { "alias": "minSize"; "required": false; }; "maxSize": { "alias": "maxSize"; "required": false; }; "lockSize": { "alias": "lockSize"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; }, {}, never, never, false, never>;
37
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MtxSplitPane, "mtx-split-pane, [mtx-split-pane]", ["mtxSplitPane"], { "order": { "alias": "order"; "required": false; }; "size": { "alias": "size"; "required": false; }; "minSize": { "alias": "minSize"; "required": false; }; "maxSize": { "alias": "maxSize"; "required": false; }; "lockSize": { "alias": "lockSize"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; }, {}, never, never, true, never>;
38
38
  }
package/split/split.d.ts CHANGED
@@ -110,6 +110,6 @@ export declare class MtxSplit extends _MtxSplitBase implements AfterViewInit, On
110
110
  notify(type: 'start' | 'progress' | 'end' | 'click' | 'dblclick' | 'transitionEnd', gutterNum: number): void;
111
111
  ngOnDestroy(): void;
112
112
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxSplit, [null, null, null, null, { optional: true; }]>;
113
- static ɵcmp: i0.ɵɵComponentDeclaration<MtxSplit, "mtx-split", ["mtxSplit"], { "color": { "alias": "color"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "unit": { "alias": "unit"; "required": false; }; "gutterSize": { "alias": "gutterSize"; "required": false; }; "gutterStep": { "alias": "gutterStep"; "required": false; }; "restrictMove": { "alias": "restrictMove"; "required": false; }; "useTransition": { "alias": "useTransition"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "gutterDblClickDuration": { "alias": "gutterDblClickDuration"; "required": false; }; }, { "dragStart": "dragStart"; "dragEnd": "dragEnd"; "gutterClick": "gutterClick"; "gutterDblClick": "gutterDblClick"; "transitionEnd": "transitionEnd"; }, never, ["*"], false, never>;
113
+ static ɵcmp: i0.ɵɵComponentDeclaration<MtxSplit, "mtx-split", ["mtxSplit"], { "color": { "alias": "color"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "unit": { "alias": "unit"; "required": false; }; "gutterSize": { "alias": "gutterSize"; "required": false; }; "gutterStep": { "alias": "gutterStep"; "required": false; }; "restrictMove": { "alias": "restrictMove"; "required": false; }; "useTransition": { "alias": "useTransition"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "gutterDblClickDuration": { "alias": "gutterDblClickDuration"; "required": false; }; }, { "dragStart": "dragStart"; "dragEnd": "dragEnd"; "gutterClick": "gutterClick"; "gutterDblClick": "gutterDblClick"; "transitionEnd": "transitionEnd"; }, never, ["*"], true, never>;
114
114
  }
115
115
  export {};
package/split/split.scss CHANGED
@@ -41,15 +41,13 @@ $_tokens: tokens-mtx-split.$prefix, tokens-mtx-split.get-token-slots();
41
41
  > .mtx-split-pane {
42
42
  flex-grow: 0;
43
43
  flex-shrink: 0;
44
- overflow-x: hidden;
45
- overflow-y: auto;
44
+ overflow: hidden auto;
46
45
 
47
46
  /* When <mtx-split-pane [visible]="false"> force size to 0. */
48
47
 
49
48
  &.mtx-split-pane-hidden {
50
49
  flex: 0 1 0 !important;
51
- overflow-x: hidden;
52
- overflow-y: hidden;
50
+ overflow: hidden hidden;
53
51
  }
54
52
  }
55
53
 
@@ -1,53 +1,85 @@
1
+ @use 'sass:map';
1
2
  @use '@material/tooltip/plain-tooltip-theme' as mdc-plain-tooltip-theme;
2
- @use '../core/theming/theming';
3
- @use '../core/typography/typography';
4
- @use '../core/tokens/m2/mdc/plain-tooltip' as m2-mdc-plain-tooltip;
3
+ @use '@angular/material' as mat;
4
+ @use '../core/style/sass-utils';
5
+ @use '../core/tokens/m2/mdc/plain-tooltip' as tokens-mdc-plain-tooltip;
5
6
 
6
- @mixin color($config-or-theme) {
7
- $config: theming.get-color-config($config-or-theme);
8
- $mdc-tooltip-color-tokens: m2-mdc-plain-tooltip.get-color-tokens($config);
9
-
10
- // Add values for MDC tooltip tokens.
11
- .mtx-mdc-tooltip {
12
- @include mdc-plain-tooltip-theme.theme($mdc-tooltip-color-tokens);
7
+ @mixin base($theme) {
8
+ @if mat.get-theme-version($theme) == 1 {
9
+ @include _theme-from-tokens(mat.get-theme-tokens($theme, base));
10
+ }
11
+ @else {
12
+ // Add default values for tokens not related to color, typography, or density.
13
+ @include sass-utils.current-selector-or-root() {
14
+ @include mdc-plain-tooltip-theme.theme(tokens-mdc-plain-tooltip.get-unthemable-tokens());
15
+ }
13
16
  }
14
17
  }
15
18
 
16
- @mixin typography($config-or-theme) {
17
- $config: typography.private-typography-to-2018-config(theming.get-typography-config($config-or-theme));
18
- $mdc-tooltip-typography-tokens: m2-mdc-plain-tooltip.get-typography-tokens($config);
19
+ @mixin color($theme) {
20
+ @if mat.get-theme-version($theme) == 1 {
21
+ @include _theme-from-tokens(mat.get-theme-tokens($theme, color));
22
+ }
23
+ @else {
24
+ $mdc-tooltip-color-tokens: tokens-mdc-plain-tooltip.get-color-tokens($theme);
19
25
 
20
- // Add values for MDC tooltip tokens.
21
- .mtx-mdc-tooltip {
22
- @include mdc-plain-tooltip-theme.theme($mdc-tooltip-typography-tokens);
26
+ // Add values for MDC tooltip tokens.
27
+ @include sass-utils.current-selector-or-root() {
28
+ @include mdc-plain-tooltip-theme.theme($mdc-tooltip-color-tokens);
29
+ }
23
30
  }
24
31
  }
25
32
 
26
- @mixin density($config-or-theme) {
27
- $density-scale: theming.get-density-config($config-or-theme);
28
- $mdc-tooltip-density-tokens: m2-mdc-plain-tooltip.get-density-tokens($density-scale);
33
+ @mixin typography($theme) {
34
+ @if mat.get-theme-version($theme) == 1 {
35
+ @include _theme-from-tokens(mat.get-theme-tokens($theme, typography));
36
+ }
37
+ @else {
38
+ $mdc-tooltip-typography-tokens: tokens-mdc-plain-tooltip.get-typography-tokens($theme);
29
39
 
30
- // Add values for MDC tooltip tokens.
31
- .mtx-mdc-tooltip {
32
- @include mdc-plain-tooltip-theme.theme($mdc-tooltip-density-tokens);
40
+ // Add values for MDC tooltip tokens.
41
+ @include sass-utils.current-selector-or-root() {
42
+ @include mdc-plain-tooltip-theme.theme($mdc-tooltip-typography-tokens);
43
+ }
33
44
  }
34
45
  }
35
46
 
36
- @mixin theme($theme-or-color-config) {
37
- $theme: theming.private-legacy-get-theme($theme-or-color-config);
38
- @include theming.private-check-duplicate-theme-styles($theme, 'mtx-tooltip') {
39
- $color: theming.get-color-config($theme);
40
- $density: theming.get-density-config($theme);
41
- $typography: theming.get-typography-config($theme);
47
+ @mixin density($theme) {
48
+ @if mat.get-theme-version($theme) == 1 {
49
+ @include _theme-from-tokens(mat.get-theme-tokens($theme, density));
50
+ }
51
+ @else {
52
+ $mdc-tooltip-density-tokens: tokens-mdc-plain-tooltip.get-density-tokens($theme);
42
53
 
43
- @if $color != null {
44
- @include color($color);
54
+ // Add values for MDC tooltip tokens.
55
+ @include sass-utils.current-selector-or-root() {
56
+ @include mdc-plain-tooltip-theme.theme($mdc-tooltip-density-tokens);
45
57
  }
46
- @if $density != null {
47
- @include density($density);
58
+ }
59
+ }
60
+
61
+ @mixin theme($theme) {
62
+ @include mat.private-check-duplicate-theme-styles($theme, 'mtx-tooltip') {
63
+ @if mat.get-theme-version($theme) == 1 {
64
+ @include _theme-from-tokens(mat.get-theme-tokens($theme));
48
65
  }
49
- @if $typography != null {
50
- @include typography($typography);
66
+ @else {
67
+ @include base($theme);
68
+ @if mat.theme-has($theme, color) {
69
+ @include color($theme);
70
+ }
71
+ @if mat.theme-has($theme, density) {
72
+ @include density($theme);
73
+ }
74
+ @if mat.theme-has($theme, typography) {
75
+ @include typography($theme);
76
+ }
51
77
  }
52
78
  }
53
79
  }
80
+
81
+ @mixin _theme-from-tokens($tokens) {
82
+ @if $tokens != () {
83
+ @include mdc-plain-tooltip-theme.theme(map.get($tokens, tokens-mdc-plain-tooltip.$prefix));
84
+ }
85
+ }
@@ -1,13 +1,13 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "./tooltip";
3
- import * as i2 from "@angular/cdk/a11y";
4
- import * as i3 from "@angular/common";
5
- import * as i4 from "@angular/cdk/overlay";
6
- import * as i5 from "@angular/material/core";
7
- import * as i6 from "@ng-matero/extensions/core";
2
+ import * as i1 from "@angular/cdk/a11y";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/cdk/overlay";
5
+ import * as i4 from "@angular/material/core";
6
+ import * as i5 from "@ng-matero/extensions/core";
7
+ import * as i6 from "./tooltip";
8
8
  import * as i7 from "@angular/cdk/scrolling";
9
9
  export declare class MtxTooltipModule {
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxTooltipModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<MtxTooltipModule, [typeof i1.MtxTooltip, typeof i1.TooltipComponent], [typeof i2.A11yModule, typeof i3.CommonModule, typeof i4.OverlayModule, typeof i5.MatCommonModule, typeof i6.MtxPipesModule], [typeof i1.MtxTooltip, typeof i1.TooltipComponent, typeof i5.MatCommonModule, typeof i7.CdkScrollableModule]>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MtxTooltipModule, never, [typeof i1.A11yModule, typeof i2.CommonModule, typeof i3.OverlayModule, typeof i4.MatCommonModule, typeof i5.MtxPipesModule, typeof i6.MtxTooltip, typeof i6.TooltipComponent], [typeof i6.MtxTooltip, typeof i6.TooltipComponent, typeof i4.MatCommonModule, typeof i7.CdkScrollableModule]>;
12
12
  static ɵinj: i0.ɵɵInjectorDeclaration<MtxTooltipModule>;
13
13
  }
@@ -1,7 +1,7 @@
1
1
  import { AriaDescriber, FocusMonitor } from '@angular/cdk/a11y';
2
2
  import { Directionality } from '@angular/cdk/bidi';
3
3
  import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
4
- import { ComponentType, ConnectedPosition, OriginConnectionPosition, Overlay, OverlayConnectionPosition, OverlayRef, ScrollDispatcher, ScrollStrategy } from '@angular/cdk/overlay';
4
+ import { ConnectedPosition, OriginConnectionPosition, Overlay, OverlayConnectionPosition, OverlayRef, ScrollDispatcher, ScrollStrategy } from '@angular/cdk/overlay';
5
5
  import { Platform } from '@angular/cdk/platform';
6
6
  import { AfterViewInit, ChangeDetectorRef, ElementRef, InjectionToken, NgZone, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
7
7
  import { Observable } from 'rxjs';
@@ -62,7 +62,13 @@ export interface MtxTooltipDefaultOptions {
62
62
  * @breaking-change 13.0.0 remove this variable
63
63
  */
64
64
  export declare const TOOLTIP_PANEL_CLASS = "mtx-mdc-tooltip-panel";
65
- export declare abstract class _MtxTooltipBase<T extends _TooltipComponentBase> implements OnDestroy, AfterViewInit {
65
+ /**
66
+ * Directive that attaches a material design tooltip to the host element. Animates the showing and
67
+ * hiding of a tooltip provided position (defaults to below the element).
68
+ *
69
+ * https://material.io/design/components/tooltips.html
70
+ */
71
+ export declare class MtxTooltip implements OnDestroy, AfterViewInit {
66
72
  private _overlay;
67
73
  private _elementRef;
68
74
  private _scrollDispatcher;
@@ -74,7 +80,7 @@ export declare abstract class _MtxTooltipBase<T extends _TooltipComponentBase> i
74
80
  protected _dir: Directionality;
75
81
  private _defaultOptions;
76
82
  _overlayRef: OverlayRef | null;
77
- _tooltipInstance: T | null;
83
+ _tooltipInstance: TooltipComponent | null;
78
84
  private _portal;
79
85
  private _position;
80
86
  private _positionAtOrigin;
@@ -83,13 +89,17 @@ export declare abstract class _MtxTooltipBase<T extends _TooltipComponentBase> i
83
89
  private _scrollStrategy;
84
90
  private _viewInitialized;
85
91
  private _pointerExitEventsInitialized;
86
- protected abstract readonly _tooltipComponent: ComponentType<T>;
87
- protected _viewportMargin: number;
92
+ private readonly _tooltipComponent;
93
+ private _viewportMargin;
88
94
  private _currentPosition;
89
- protected readonly _cssClassPrefix: string;
95
+ private readonly _cssClassPrefix;
90
96
  /** Allows the user to define the position of the tooltip relative to the parent element */
91
97
  get position(): TooltipPosition;
92
98
  set position(value: TooltipPosition);
99
+ /**
100
+ * Whether tooltip should be relative to the click or touch origin
101
+ * instead of outside the element bounding box.
102
+ */
93
103
  get positionAtOrigin(): boolean;
94
104
  set positionAtOrigin(value: BooleanInput);
95
105
  /** Disables the display of the tooltip. */
@@ -201,25 +211,17 @@ export declare abstract class _MtxTooltipBase<T extends _TooltipComponentBase> i
201
211
  private _wheelListener;
202
212
  /** Disables the native browser gestures, based on how the tooltip has been configured. */
203
213
  private _disableNativeGesturesIfNecessary;
204
- static ɵfac: i0.ɵɵFactoryDeclaration<_MtxTooltipBase<any>, never>;
205
- static ɵdir: i0.ɵɵDirectiveDeclaration<_MtxTooltipBase<any>, never, never, { "position": { "alias": "mtxTooltipPosition"; "required": false; }; "positionAtOrigin": { "alias": "mtxTooltipPositionAtOrigin"; "required": false; }; "disabled": { "alias": "mtxTooltipDisabled"; "required": false; }; "showDelay": { "alias": "mtxTooltipShowDelay"; "required": false; }; "hideDelay": { "alias": "mtxTooltipHideDelay"; "required": false; }; "touchGestures": { "alias": "mtxTooltipTouchGestures"; "required": false; }; "message": { "alias": "mtxTooltip"; "required": false; }; "tooltipContext": { "alias": "mtxTooltipContext"; "required": false; }; "tooltipClass": { "alias": "mtxTooltipClass"; "required": false; }; }, {}, never, never, false, never>;
214
+ static ɵfac: i0.ɵɵFactoryDeclaration<MtxTooltip, [null, null, null, null, null, null, null, null, null, null, { optional: true; }, null]>;
215
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MtxTooltip, "[mtxTooltip]", ["mtxTooltip"], { "position": { "alias": "mtxTooltipPosition"; "required": false; }; "positionAtOrigin": { "alias": "mtxTooltipPositionAtOrigin"; "required": false; }; "disabled": { "alias": "mtxTooltipDisabled"; "required": false; }; "showDelay": { "alias": "mtxTooltipShowDelay"; "required": false; }; "hideDelay": { "alias": "mtxTooltipHideDelay"; "required": false; }; "touchGestures": { "alias": "mtxTooltipTouchGestures"; "required": false; }; "message": { "alias": "mtxTooltip"; "required": false; }; "tooltipContext": { "alias": "mtxTooltipContext"; "required": false; }; "tooltipClass": { "alias": "mtxTooltipClass"; "required": false; }; }, {}, never, never, true, never>;
206
216
  }
207
217
  /**
208
- * Directive that attaches a material design tooltip to the host element. Animates the showing and
209
- * hiding of a tooltip provided position (defaults to below the element).
210
- *
211
- * https://material.io/design/components/tooltips.html
218
+ * Internal component that wraps the tooltip's content.
219
+ * @docs-private
212
220
  */
213
- export declare class MtxTooltip extends _MtxTooltipBase<TooltipComponent> {
214
- protected readonly _tooltipComponent: typeof TooltipComponent;
215
- protected readonly _cssClassPrefix = "mtx-mdc";
216
- constructor(overlay: Overlay, elementRef: ElementRef<HTMLElement>, scrollDispatcher: ScrollDispatcher, viewContainerRef: ViewContainerRef, ngZone: NgZone, platform: Platform, ariaDescriber: AriaDescriber, focusMonitor: FocusMonitor, scrollStrategy: any, dir: Directionality, defaultOptions: MtxTooltipDefaultOptions, _document: any);
217
- protected _addOffset(position: ConnectedPosition): ConnectedPosition;
218
- static ɵfac: i0.ɵɵFactoryDeclaration<MtxTooltip, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, null]>;
219
- static ɵdir: i0.ɵɵDirectiveDeclaration<MtxTooltip, "[mtxTooltip]", ["mtxTooltip"], {}, {}, never, never, false, never>;
220
- }
221
- export declare abstract class _TooltipComponentBase implements OnDestroy {
221
+ export declare class TooltipComponent implements OnDestroy {
222
222
  private _changeDetectorRef;
223
+ protected _elementRef: ElementRef<HTMLElement>;
224
+ _isMultiline: boolean;
223
225
  /** Message to display in the tooltip */
224
226
  message: string | TemplateRef<any>;
225
227
  /** Context to be added to the tooltip */
@@ -239,7 +241,7 @@ export declare abstract class _TooltipComponentBase implements OnDestroy {
239
241
  /** Whether animations are currently disabled. */
240
242
  private _animationsDisabled;
241
243
  /** Reference to the internal tooltip element. */
242
- abstract _tooltip: ElementRef<HTMLElement>;
244
+ _tooltip: ElementRef<HTMLElement>;
243
245
  /** Whether interactions on the page should close the tooltip */
244
246
  private _closeOnInteraction;
245
247
  /** Whether the tooltip is currently visible. */
@@ -247,10 +249,10 @@ export declare abstract class _TooltipComponentBase implements OnDestroy {
247
249
  /** Subject for notifying that the tooltip has been hidden from the view */
248
250
  private readonly _onHide;
249
251
  /** Name of the show animation and the class that toggles it. */
250
- protected abstract readonly _showAnimation: string;
252
+ private readonly _showAnimation;
251
253
  /** Name of the hide animation and the class that toggles it. */
252
- protected abstract readonly _hideAnimation: string;
253
- constructor(_changeDetectorRef: ChangeDetectorRef, animationMode?: string);
254
+ private readonly _hideAnimation;
255
+ constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, animationMode?: string);
254
256
  /**
255
257
  * Shows the tooltip with an animation originating from the provided origin
256
258
  * @param delay Amount of milliseconds to the delay showing the tooltip.
@@ -285,6 +287,8 @@ export declare abstract class _TooltipComponentBase implements OnDestroy {
285
287
  * in the mdc-tooltip, not here.
286
288
  */
287
289
  protected _onShow(): void;
290
+ /** Whether the tooltip text has overflown to the next line */
291
+ private _isTooltipMultiline;
288
292
  /** Event listener dispatched when an animation on the tooltip finishes. */
289
293
  _handleAnimationEnd({ animationName }: AnimationEvent): void;
290
294
  /** Cancels any pending animation sequences. */
@@ -293,24 +297,6 @@ export declare abstract class _TooltipComponentBase implements OnDestroy {
293
297
  private _finalizeAnimation;
294
298
  /** Toggles the visibility of the tooltip element. */
295
299
  private _toggleVisibility;
296
- static ɵfac: i0.ɵɵFactoryDeclaration<_TooltipComponentBase, [null, { optional: true; }]>;
297
- static ɵdir: i0.ɵɵDirectiveDeclaration<_TooltipComponentBase, never, never, {}, {}, never, never, false, never>;
298
- }
299
- /**
300
- * Internal component that wraps the tooltip's content.
301
- * @docs-private
302
- */
303
- export declare class TooltipComponent extends _TooltipComponentBase {
304
- private _elementRef;
305
- _isMultiline: boolean;
306
- /** Reference to the internal tooltip element. */
307
- _tooltip: ElementRef<HTMLElement>;
308
- _showAnimation: string;
309
- _hideAnimation: string;
310
- constructor(changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, animationMode?: string);
311
- protected _onShow(): void;
312
- /** Whether the tooltip text has overflown to the next line */
313
- private _isTooltipMultiline;
314
300
  static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, [null, null, { optional: true; }]>;
315
- static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "mtx-tooltip-component", never, {}, {}, never, never, false, never>;
301
+ static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "mtx-tooltip-component", never, {}, {}, never, never, true, never>;
316
302
  }
@@ -12,9 +12,6 @@
12
12
  .mtx-mdc-tooltip {
13
13
  // Add the official slots for the MDC tooltip.
14
14
  @include mdc-plain-tooltip-theme.theme-styles($mdc-tooltip-token-slots);
15
-
16
- // Add default values for MDC tooltip tokens that aren't outputted by the theming API.
17
- @include mdc-plain-tooltip-theme.theme(m2-mdc-plain-tooltip.get-unthemable-tokens());
18
15
  }
19
16
  }
20
17
 
@@ -65,7 +62,8 @@
65
62
  }
66
63
  }
67
64
 
68
- .mtx-mdc-tooltip-panel-non-interactive {
65
+ // We need the additional specificity here, because it can be overridden by `.cdk-overlay-panel`.
66
+ .mtx-mdc-tooltip-panel.mtx-mdc-tooltip-panel-non-interactive {
69
67
  pointer-events: none;
70
68
  }
71
69
 
package/_theming.scss DELETED
@@ -1,16 +0,0 @@
1
- @forward './alert/alert-theme.import';
2
- @forward './button/button-theme.import';
3
- @forward './colorpicker/colorpicker-theme.import';
4
- @forward './datetimepicker/datetimepicker-theme.import';
5
- @forward './drawer/drawer-theme.import';
6
- @forward './grid/grid-theme.import';
7
- @forward './loader/loader-theme.import';
8
- @forward './popover/popover-theme.import';
9
- @forward './progress/progress-theme.import';
10
- @forward './select/select-theme.import';
11
- @forward './split/split-theme.import';
12
- @forward './tooltip/tooltip-theme.import';
13
-
14
- @forward './core/theming/all-theme' show material-extensions-theme;
15
- @forward './core/color/all-color' show material-extensions-color;
16
- @forward './core/density/all-density' show material-extensions-density;
@@ -1,2 +0,0 @@
1
- @forward 'alert-theme' hide color, density, theme, typography;
2
- @forward 'alert-theme' as mtx-alert-*;
@@ -1,2 +0,0 @@
1
- @forward 'button-theme' hide color, density, theme, typography;
2
- @forward 'button-theme' as mtx-button-*;
@@ -1,2 +0,0 @@
1
- @forward 'colorpicker-theme' hide color, density, theme, typography;
2
- @forward 'colorpicker-theme' as mtx-colorpicker-*;
@@ -1,74 +0,0 @@
1
- @use 'sass:list';
2
- @use 'sass:map';
3
- @use 'sass:meta';
4
- // Note that this file is called `private`, because the APIs in it aren't public yet.
5
- // Once they're made available, the code should be moved out into an `index.scss`.
6
-
7
- // Taken from mat-density with small modifications to not rely on the new Sass module
8
- // system, and to support arbitrary properties in a density configuration.
9
- // https://github.com/material-components/material-components-web/blob/master/packages/mdc-density
10
-
11
- $_density-interval: 4px !default;
12
- $_minimum-scale: minimum !default;
13
- $_maximum-scale: maximum !default;
14
- $_supported-scales: (default, $_minimum-scale, $_maximum-scale) !default;
15
- $_default-scale: 0 !default;
16
-
17
- // Whether density should be generated at root. This will be temporarily set to `true`
18
- // whenever density styles for legacy themes are generated.
19
- $private-density-generate-at-root: false;
20
- // Whether density styles should be generated. This will be temporarily set to `false` if
21
- // duplicate density styles for a legacy theme would be generated. For legacy themes,
22
- // we always generate the default density **only once** at root.
23
- $private-density-generate-styles: true;
24
-
25
- // Mixin that can be used to wrap density styles of given components. The mixin will
26
- // move the density styles to root if the `$mat-private-density-generate-at-root` global variable
27
- // is set. If `$mat-private-density-generate-styles` is set to `false`, generation of density
28
- // styles wrapped in this mixin is skipped. This mixin exists to improve backwards compatibility
29
- // of the new theming API where density styles are included as part of themes. Previously,
30
- // density styles of components were part of their base styles. With the new API, they are
31
- // part of the theming system. The `<..>-theme` mixins generate density by default unless
32
- // the density configuration is explicitly specified as per new API. This means, that projects
33
- // using `<..>-theme` mixins for separate themes (like `.dark-theme`) will cause duplicate
34
- // density styles. This is breaking as it increases specificity of density styles. This mixin
35
- // provides an API to control generation of density styles so that we can ensure they are only
36
- // created *once* and at root.
37
- @mixin private-density-legacy-compatibility() {
38
- @if $private-density-generate-styles and $private-density-generate-at-root {
39
- @at-root {
40
- @content;
41
- }
42
- }
43
- @else if $private-density-generate-styles {
44
- @content;
45
- }
46
- }
47
-
48
- @function private-density-prop-value($density-config, $density-scale, $property-name) {
49
- @if (meta.type-of($density-scale) == 'string' and
50
- list.index($list: $_supported-scales, $value: $density-scale) == null) {
51
- @error 'mat-density: Supported density scales #{$_supported-scales}, ' +
52
- 'but received #{$density-scale}.';
53
- }
54
-
55
- $value: null;
56
- $property-scale-map: map.get($density-config, $property-name);
57
-
58
- @if map.has-key($property-scale-map, $density-scale) {
59
- $value: map.get($property-scale-map, $density-scale);
60
- }
61
- @else {
62
- $value: map.get($property-scale-map, default) + $density-scale * $_density-interval;
63
- }
64
-
65
- $min-value: map.get($property-scale-map, $_minimum-scale);
66
- $max-value: map.get($property-scale-map, $_maximum-scale);
67
-
68
- @if ($value < $min-value or $value > $max-value) {
69
- @error 'mat-density: #{$property-name} must be between #{$min-value} and ' +
70
- '#{$max-value} (inclusive), but received #{$value}.';
71
- }
72
-
73
- @return $value;
74
- }