@ng-matero/extensions 12.7.0 → 13.0.2

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 (537) hide show
  1. package/README.md +2 -16
  2. package/_all-color.scss +1 -1
  3. package/_index.scss +1 -1
  4. package/_theming.scss +1 -1
  5. package/alert/_alert-theme.scss +2 -2
  6. package/alert/alert.component.d.ts +3 -0
  7. package/alert/alert.module.d.ts +6 -0
  8. package/alert/mtxAlert.d.ts +1 -0
  9. package/alert/package.json +5 -6
  10. package/button/button-loading.directive.d.ts +3 -0
  11. package/button/button.module.d.ts +8 -0
  12. package/button/mtxButton.d.ts +1 -0
  13. package/button/package.json +5 -6
  14. package/checkbox-group/checkbox-group.component.d.ts +3 -0
  15. package/checkbox-group/checkbox-group.module.d.ts +9 -0
  16. package/checkbox-group/mtxCheckboxGroup.d.ts +1 -0
  17. package/checkbox-group/package.json +5 -6
  18. package/colorpicker/_colorpicker-theme.scss +2 -2
  19. package/colorpicker/colorpicker-input.d.ts +3 -0
  20. package/colorpicker/colorpicker-module.d.ts +13 -0
  21. package/colorpicker/colorpicker-toggle.d.ts +5 -0
  22. package/colorpicker/colorpicker.d.ts +6 -1
  23. package/colorpicker/mtxColorpicker.d.ts +1 -0
  24. package/colorpicker/package.json +5 -6
  25. package/column-resize/column-resize-directives/column-resize-flex.d.ts +3 -0
  26. package/column-resize/column-resize-directives/column-resize.d.ts +3 -0
  27. package/column-resize/column-resize-module.d.ts +6 -7
  28. package/column-resize/column-resize-notifier.d.ts +5 -7
  29. package/column-resize/column-resize.d.ts +3 -0
  30. package/column-resize/column-size-store.d.ts +3 -7
  31. package/column-resize/event-dispatcher.d.ts +3 -0
  32. package/column-resize/mtxColumnResize.d.ts +1 -0
  33. package/column-resize/overlay-handle.d.ts +3 -0
  34. package/column-resize/package.json +5 -6
  35. package/column-resize/resizable.d.ts +3 -0
  36. package/column-resize/resize-strategy.d.ts +7 -0
  37. package/core/datetime/datetime.module.d.ts +8 -0
  38. package/core/datetime/native-datetime-adapter.d.ts +3 -0
  39. package/core/density/private/_compatibility.scss +74 -0
  40. package/core/mtxCore.d.ts +1 -0
  41. package/core/package.json +5 -6
  42. package/{pipes/public-api.d.ts → core/pipes/index.d.ts} +0 -0
  43. package/core/pipes/pipes.module.d.ts +8 -0
  44. package/{pipes → core/pipes}/to-observable.pipe.d.ts +3 -0
  45. package/core/public-api.d.ts +1 -0
  46. package/core/style/_elevation.scss +197 -0
  47. package/core/style/_private.scss +41 -0
  48. package/core/style/_variables.scss +44 -0
  49. package/core/style/_vendor-prefixes.scss +60 -0
  50. package/core/theming/_palette.scss +746 -0
  51. package/core/theming/_theming.scss +430 -0
  52. package/core/typography/_typography-utils.scss +101 -0
  53. package/core/typography/_typography.scss +273 -0
  54. package/datetimepicker/_datetimepicker-theme.scss +5 -5
  55. package/datetimepicker/calendar-body.d.ts +3 -0
  56. package/datetimepicker/calendar-body.scss +5 -4
  57. package/datetimepicker/calendar.d.ts +4 -1
  58. package/datetimepicker/clock.d.ts +3 -0
  59. package/datetimepicker/datetimepicker-input.d.ts +3 -0
  60. package/datetimepicker/datetimepicker-module.d.ts +18 -0
  61. package/datetimepicker/datetimepicker-toggle.d.ts +5 -0
  62. package/datetimepicker/datetimepicker-types.d.ts +1 -0
  63. package/datetimepicker/datetimepicker.d.ts +7 -2
  64. package/datetimepicker/month-view.d.ts +4 -1
  65. package/datetimepicker/mtxDatetimepicker.d.ts +1 -0
  66. package/datetimepicker/multi-year-view.d.ts +4 -1
  67. package/datetimepicker/package.json +5 -6
  68. package/datetimepicker/public-api.d.ts +1 -0
  69. package/datetimepicker/year-view.d.ts +4 -1
  70. package/dialog/dialog.component.d.ts +3 -0
  71. package/dialog/dialog.d.ts +3 -0
  72. package/dialog/dialog.module.d.ts +10 -0
  73. package/dialog/mtxDialog.d.ts +1 -0
  74. package/dialog/package.json +5 -6
  75. package/esm2020/alert/alert.component.mjs +52 -0
  76. package/esm2020/alert/alert.module.mjs +18 -0
  77. package/{esm2015/alert/mtxAlert.js → esm2020/alert/mtxAlert.mjs} +0 -0
  78. package/{esm2015/alert/public-api.js → esm2020/alert/public-api.mjs} +0 -0
  79. package/esm2020/button/button-loading.directive.mjs +79 -0
  80. package/esm2020/button/button.module.mjs +20 -0
  81. package/{esm2015/button/mtxButton.js → esm2020/button/mtxButton.mjs} +0 -0
  82. package/{esm2015/button/public-api.js → esm2020/button/public-api.mjs} +0 -0
  83. package/esm2020/checkbox-group/checkbox-group.component.mjs +234 -0
  84. package/{esm2015/checkbox-group/checkbox-group.interface.js → esm2020/checkbox-group/checkbox-group.interface.mjs} +0 -0
  85. package/esm2020/checkbox-group/checkbox-group.module.mjs +21 -0
  86. package/{esm2015/checkbox-group/mtxCheckboxGroup.js → esm2020/checkbox-group/mtxCheckboxGroup.mjs} +0 -0
  87. package/{esm2015/checkbox-group/public-api.js → esm2020/checkbox-group/public-api.mjs} +0 -0
  88. package/{esm2015/colorpicker/colorpicker-animations.js → esm2020/colorpicker/colorpicker-animations.mjs} +0 -0
  89. package/esm2020/colorpicker/colorpicker-input.mjs +228 -0
  90. package/esm2020/colorpicker/colorpicker-module.mjs +65 -0
  91. package/esm2020/colorpicker/colorpicker-toggle.mjs +90 -0
  92. package/esm2020/colorpicker/colorpicker.mjs +363 -0
  93. package/{esm2015/colorpicker/mtxColorpicker.js → esm2020/colorpicker/mtxColorpicker.mjs} +0 -0
  94. package/{esm2015/colorpicker/public-api.js → esm2020/colorpicker/public-api.mjs} +0 -0
  95. package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +45 -0
  96. package/esm2020/column-resize/column-resize-directives/column-resize.mjs +45 -0
  97. package/{esm2015/column-resize/column-resize-directives/constants.js → esm2020/column-resize/column-resize-directives/constants.mjs} +0 -0
  98. package/esm2020/column-resize/column-resize-module.mjs +28 -0
  99. package/esm2020/column-resize/column-resize-notifier.mjs +47 -0
  100. package/esm2020/column-resize/column-resize.mjs +82 -0
  101. package/esm2020/column-resize/column-size-store.mjs +20 -0
  102. package/esm2020/column-resize/event-dispatcher.mjs +67 -0
  103. package/{esm2015/column-resize/mtxColumnResize.js → esm2020/column-resize/mtxColumnResize.mjs} +0 -0
  104. package/esm2020/column-resize/overlay-handle.mjs +146 -0
  105. package/{esm2015/column-resize/polyfill.js → esm2020/column-resize/polyfill.mjs} +0 -0
  106. package/{esm2015/column-resize/public-api.js → esm2020/column-resize/public-api.mjs} +0 -0
  107. package/esm2020/column-resize/resizable.mjs +199 -0
  108. package/{esm2015/column-resize/resize-ref.js → esm2020/column-resize/resize-ref.mjs} +0 -0
  109. package/esm2020/column-resize/resize-strategy.mjs +232 -0
  110. package/{esm2015/column-resize/selectors.js → esm2020/column-resize/selectors.mjs} +0 -0
  111. package/{esm2015/core/datetime/datetime-adapter.js → esm2020/core/datetime/datetime-adapter.mjs} +0 -0
  112. package/{esm2015/core/datetime/datetime-formats.js → esm2020/core/datetime/datetime-formats.mjs} +0 -0
  113. package/esm2020/core/datetime/datetime.module.mjs +42 -0
  114. package/{esm2015/core/datetime/index.js → esm2020/core/datetime/index.mjs} +0 -0
  115. package/esm2020/core/datetime/native-datetime-adapter.mjs +138 -0
  116. package/{esm2015/core/datetime/native-datetime-formats.js → esm2020/core/datetime/native-datetime-formats.mjs} +0 -0
  117. package/{esm2015/core/mtxCore.js → esm2020/core/mtxCore.mjs} +0 -0
  118. package/esm2020/core/pipes/index.mjs +3 -0
  119. package/esm2020/core/pipes/pipes.module.mjs +18 -0
  120. package/esm2020/core/pipes/to-observable.pipe.mjs +15 -0
  121. package/{esm2015/core/public-api.js → esm2020/core/public-api.mjs} +2 -1
  122. package/esm2020/datetimepicker/calendar-body.mjs +78 -0
  123. package/esm2020/datetimepicker/calendar.mjs +618 -0
  124. package/esm2020/datetimepicker/clock.mjs +277 -0
  125. package/{esm2015/datetimepicker/datetimepicker-animations.js → esm2020/datetimepicker/datetimepicker-animations.mjs} +0 -0
  126. package/{esm2015/datetimepicker/datetimepicker-errors.js → esm2020/datetimepicker/datetimepicker-errors.mjs} +0 -0
  127. package/{esm2015/datetimepicker/datetimepicker-filtertype.js → esm2020/datetimepicker/datetimepicker-filtertype.mjs} +0 -0
  128. package/esm2020/datetimepicker/datetimepicker-input.mjs +344 -0
  129. package/esm2020/datetimepicker/datetimepicker-module.mjs +75 -0
  130. package/esm2020/datetimepicker/datetimepicker-toggle.mjs +94 -0
  131. package/esm2020/datetimepicker/datetimepicker-types.mjs +2 -0
  132. package/esm2020/datetimepicker/datetimepicker.mjs +492 -0
  133. package/esm2020/datetimepicker/month-view.mjs +148 -0
  134. package/{esm2015/datetimepicker/mtxDatetimepicker.js → esm2020/datetimepicker/mtxDatetimepicker.mjs} +0 -0
  135. package/esm2020/datetimepicker/multi-year-view.mjs +214 -0
  136. package/{esm2015/datetimepicker/public-api.js → esm2020/datetimepicker/public-api.mjs} +2 -1
  137. package/esm2020/datetimepicker/year-view.mjs +138 -0
  138. package/{esm2015/dialog/dialog-config.js → esm2020/dialog/dialog-config.mjs} +0 -0
  139. package/esm2020/dialog/dialog.component.mjs +33 -0
  140. package/esm2020/dialog/dialog.mjs +74 -0
  141. package/esm2020/dialog/dialog.module.mjs +24 -0
  142. package/{esm2015/dialog/mtxDialog.js → esm2020/dialog/mtxDialog.mjs} +0 -0
  143. package/{esm2015/dialog/public-api.js → esm2020/dialog/public-api.mjs} +0 -0
  144. package/esm2020/form-group/form-group.component.mjs +37 -0
  145. package/esm2020/form-group/form-group.module.mjs +18 -0
  146. package/{esm2015/form-group/mtxFormGroup.js → esm2020/form-group/mtxFormGroup.mjs} +0 -0
  147. package/{esm2015/form-group/public-api.js → esm2020/form-group/public-api.mjs} +0 -0
  148. package/esm2020/grid/cell.component.mjs +108 -0
  149. package/esm2020/grid/column-menu.component.mjs +95 -0
  150. package/esm2020/grid/column-resize/column-resize-directives/column-resize-flex.mjs +37 -0
  151. package/esm2020/grid/column-resize/column-resize-directives/column-resize.mjs +37 -0
  152. package/{esm2015/grid/column-resize/column-resize-directives/common.js → esm2020/grid/column-resize/column-resize-directives/common.mjs} +0 -0
  153. package/esm2020/grid/column-resize/column-resize-module.mjs +42 -0
  154. package/esm2020/grid/column-resize/overlay-handle.mjs +60 -0
  155. package/{esm2015/grid/column-resize/resizable-directives/common.js → esm2020/grid/column-resize/resizable-directives/common.mjs} +0 -0
  156. package/esm2020/grid/column-resize/resizable-directives/resizable.mjs +62 -0
  157. package/esm2020/grid/column-resize/resize-strategy.mjs +42 -0
  158. package/esm2020/grid/expansion-toggle.directive.mjs +64 -0
  159. package/esm2020/grid/grid.component.mjs +556 -0
  160. package/{esm2015/grid/grid.interface.js → esm2020/grid/grid.interface.mjs} +0 -0
  161. package/esm2020/grid/grid.module.mjs +117 -0
  162. package/esm2020/grid/grid.service.mjs +44 -0
  163. package/{esm2015/grid/mtxGrid.js → esm2020/grid/mtxGrid.mjs} +0 -0
  164. package/esm2020/grid/public-api.mjs +16 -0
  165. package/esm2020/loader/loader.component.mjs +63 -0
  166. package/esm2020/loader/loader.module.mjs +20 -0
  167. package/{esm2015/loader/mtxLoader.js → esm2020/loader/mtxLoader.mjs} +0 -0
  168. package/{esm2015/loader/public-api.js → esm2020/loader/public-api.mjs} +0 -0
  169. package/esm2020/ng-matero-extensions.mjs +5 -0
  170. package/{esm2015/popover/mtxPopover.js → esm2020/popover/mtxPopover.mjs} +0 -0
  171. package/{esm2015/popover/popover-animations.js → esm2020/popover/popover-animations.mjs} +0 -0
  172. package/{esm2015/popover/popover-errors.js → esm2020/popover/popover-errors.mjs} +0 -0
  173. package/{esm2015/popover/popover-interfaces.js → esm2020/popover/popover-interfaces.mjs} +0 -0
  174. package/esm2020/popover/popover-module.mjs +22 -0
  175. package/esm2020/popover/popover-target.mjs +17 -0
  176. package/esm2020/popover/popover-trigger.mjs +441 -0
  177. package/{esm2015/popover/popover-types.js → esm2020/popover/popover-types.mjs} +0 -0
  178. package/esm2020/popover/popover.mjs +334 -0
  179. package/{esm2015/popover/public-api.js → esm2020/popover/public-api.mjs} +0 -0
  180. package/{esm2015/progress/mtxProgress.js → esm2020/progress/mtxProgress.mjs} +0 -0
  181. package/esm2020/progress/progress.component.mjs +55 -0
  182. package/esm2020/progress/progress.module.mjs +18 -0
  183. package/{esm2015/progress/public-api.js → esm2020/progress/public-api.mjs} +0 -0
  184. package/esm2020/public-api.mjs +5 -0
  185. package/{esm2015/select/mtxSelect.js → esm2020/select/mtxSelect.mjs} +0 -0
  186. package/{esm2015/select/option.component.js → esm2020/select/option.component.mjs} +18 -26
  187. package/{esm2015/select/public-api.js → esm2020/select/public-api.mjs} +0 -0
  188. package/esm2020/select/select.component.mjs +459 -0
  189. package/esm2020/select/select.module.mjs +74 -0
  190. package/esm2020/select/templates.directive.mjs +124 -0
  191. package/{esm2015/slider/mtxSlider.js → esm2020/slider/mtxSlider.mjs} +0 -0
  192. package/{esm2015/slider/public-api.js → esm2020/slider/public-api.mjs} +0 -0
  193. package/esm2020/slider/slider-module.mjs +19 -0
  194. package/esm2020/slider/slider.mjs +1115 -0
  195. package/{esm2015/split/interface.js → esm2020/split/interface.mjs} +0 -0
  196. package/{esm2015/split/mtxSplit.js → esm2020/split/mtxSplit.mjs} +0 -0
  197. package/{esm2015/split/public-api.js → esm2020/split/public-api.mjs} +0 -0
  198. package/esm2020/split/split-pane.directive.mjs +149 -0
  199. package/esm2020/split/split.component.mjs +619 -0
  200. package/esm2020/split/split.module.mjs +19 -0
  201. package/{esm2015/split/utils.js → esm2020/split/utils.mjs} +0 -0
  202. package/{esm2015/text3d/mtxText3d.js → esm2020/text3d/mtxText3d.mjs} +0 -0
  203. package/{esm2015/text3d/public-api.js → esm2020/text3d/public-api.mjs} +0 -0
  204. package/esm2020/text3d/text3d.component.mjs +45 -0
  205. package/esm2020/text3d/text3d.module.mjs +18 -0
  206. package/{esm2015/tooltip/mtxTooltip.js → esm2020/tooltip/mtxTooltip.mjs} +0 -0
  207. package/{esm2015/tooltip/public-api.js → esm2020/tooltip/public-api.mjs} +0 -0
  208. package/{esm2015/tooltip/tooltip-animations.js → esm2020/tooltip/tooltip-animations.mjs} +0 -0
  209. package/esm2020/tooltip/tooltip-module.mjs +23 -0
  210. package/esm2020/tooltip/tooltip.mjs +674 -0
  211. package/fesm2015/mtxAlert.mjs +74 -0
  212. package/fesm2015/mtxAlert.mjs.map +1 -0
  213. package/fesm2015/mtxButton.mjs +102 -0
  214. package/fesm2015/mtxButton.mjs.map +1 -0
  215. package/fesm2015/mtxCheckboxGroup.mjs +257 -0
  216. package/fesm2015/mtxCheckboxGroup.mjs.map +1 -0
  217. package/fesm2015/mtxColorpicker.mjs +754 -0
  218. package/fesm2015/mtxColorpicker.mjs.map +1 -0
  219. package/fesm2015/{mtxColumnResize.js → mtxColumnResize.mjs} +108 -145
  220. package/fesm2015/mtxColumnResize.mjs.map +1 -0
  221. package/fesm2015/mtxCore.mjs +362 -0
  222. package/fesm2015/mtxCore.mjs.map +1 -0
  223. package/fesm2015/mtxDatetimepicker.mjs +2474 -0
  224. package/fesm2015/mtxDatetimepicker.mjs.map +1 -0
  225. package/fesm2015/mtxDialog.mjs +128 -0
  226. package/fesm2015/mtxDialog.mjs.map +1 -0
  227. package/fesm2015/mtxFormGroup.mjs +59 -0
  228. package/fesm2015/mtxFormGroup.mjs.map +1 -0
  229. package/fesm2015/mtxGrid.mjs +1271 -0
  230. package/fesm2015/mtxGrid.mjs.map +1 -0
  231. package/fesm2015/mtxLoader.mjs +87 -0
  232. package/fesm2015/mtxLoader.mjs.map +1 -0
  233. package/fesm2015/mtxPopover.mjs +865 -0
  234. package/fesm2015/mtxPopover.mjs.map +1 -0
  235. package/fesm2015/mtxProgress.mjs +77 -0
  236. package/fesm2015/mtxProgress.mjs.map +1 -0
  237. package/fesm2015/mtxSelect.mjs +713 -0
  238. package/fesm2015/mtxSelect.mjs.map +1 -0
  239. package/fesm2015/mtxSlider.mjs +1139 -0
  240. package/fesm2015/mtxSlider.mjs.map +1 -0
  241. package/fesm2015/{mtxSplit.js → mtxSplit.mjs} +75 -85
  242. package/fesm2015/mtxSplit.mjs.map +1 -0
  243. package/fesm2015/mtxText3d.mjs +67 -0
  244. package/fesm2015/mtxText3d.mjs.map +1 -0
  245. package/fesm2015/{mtxTooltip.js → mtxTooltip.mjs} +83 -86
  246. package/fesm2015/mtxTooltip.mjs.map +1 -0
  247. package/fesm2015/ng-matero-extensions.mjs +9 -0
  248. package/fesm2015/ng-matero-extensions.mjs.map +1 -0
  249. package/fesm2020/mtxAlert.mjs +74 -0
  250. package/fesm2020/mtxAlert.mjs.map +1 -0
  251. package/fesm2020/mtxButton.mjs +102 -0
  252. package/fesm2020/mtxButton.mjs.map +1 -0
  253. package/fesm2020/mtxCheckboxGroup.mjs +257 -0
  254. package/fesm2020/mtxCheckboxGroup.mjs.map +1 -0
  255. package/{fesm2015/mtxColorpicker.js → fesm2020/mtxColorpicker.mjs} +420 -413
  256. package/fesm2020/mtxColorpicker.mjs.map +1 -0
  257. package/fesm2020/mtxColumnResize.mjs +953 -0
  258. package/fesm2020/mtxColumnResize.mjs.map +1 -0
  259. package/{fesm2015/mtxCore.js → fesm2020/mtxCore.mjs} +75 -42
  260. package/fesm2020/mtxCore.mjs.map +1 -0
  261. package/{fesm2015/mtxDatetimepicker.js → fesm2020/mtxDatetimepicker.mjs} +1300 -1306
  262. package/fesm2020/mtxDatetimepicker.mjs.map +1 -0
  263. package/fesm2020/mtxDialog.mjs +129 -0
  264. package/fesm2020/mtxDialog.mjs.map +1 -0
  265. package/fesm2020/mtxFormGroup.mjs +59 -0
  266. package/fesm2020/mtxFormGroup.mjs.map +1 -0
  267. package/fesm2020/mtxGrid.mjs +1259 -0
  268. package/fesm2020/mtxGrid.mjs.map +1 -0
  269. package/fesm2020/mtxLoader.mjs +87 -0
  270. package/fesm2020/mtxLoader.mjs.map +1 -0
  271. package/{fesm2015/mtxPopover.js → fesm2020/mtxPopover.mjs} +120 -111
  272. package/fesm2020/mtxPopover.mjs.map +1 -0
  273. package/fesm2020/mtxProgress.mjs +77 -0
  274. package/fesm2020/mtxProgress.mjs.map +1 -0
  275. package/fesm2020/mtxSelect.mjs +710 -0
  276. package/fesm2020/mtxSelect.mjs.map +1 -0
  277. package/{fesm2015/mtxSlider.js → fesm2020/mtxSlider.mjs} +97 -94
  278. package/fesm2020/mtxSlider.mjs.map +1 -0
  279. package/fesm2020/mtxSplit.mjs +1007 -0
  280. package/fesm2020/mtxSplit.mjs.map +1 -0
  281. package/fesm2020/mtxText3d.mjs +67 -0
  282. package/fesm2020/mtxText3d.mjs.map +1 -0
  283. package/fesm2020/mtxTooltip.mjs +718 -0
  284. package/fesm2020/mtxTooltip.mjs.map +1 -0
  285. package/fesm2020/ng-matero-extensions.mjs +9 -0
  286. package/fesm2020/ng-matero-extensions.mjs.map +1 -0
  287. package/form-group/_form-group-theme.scss +1 -1
  288. package/form-group/form-group.component.d.ts +3 -0
  289. package/form-group/form-group.module.d.ts +6 -0
  290. package/form-group/mtxFormGroup.d.ts +1 -0
  291. package/form-group/package.json +5 -6
  292. package/grid/_grid-theme.scss +1 -1
  293. package/grid/cell.component.d.ts +3 -0
  294. package/grid/column-menu.component.d.ts +3 -0
  295. package/grid/column-menu.component.scss +1 -1
  296. package/grid/column-resize/_column-resize.scss +3 -3
  297. package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +3 -0
  298. package/grid/column-resize/column-resize-directives/column-resize.d.ts +3 -0
  299. package/grid/column-resize/column-resize-module.d.ts +12 -7
  300. package/grid/column-resize/overlay-handle.d.ts +3 -0
  301. package/grid/column-resize/resizable-directives/resizable.d.ts +3 -0
  302. package/grid/column-resize/resize-strategy.d.ts +3 -0
  303. package/grid/expansion-toggle.directive.d.ts +3 -0
  304. package/grid/grid.component.d.ts +20 -1
  305. package/grid/grid.module.d.ts +26 -0
  306. package/grid/grid.service.d.ts +3 -0
  307. package/grid/mtxGrid.d.ts +1 -0
  308. package/grid/package.json +5 -6
  309. package/grid/public-api.d.ts +0 -1
  310. package/loader/_loader-theme.scss +1 -1
  311. package/loader/loader.component.d.ts +3 -0
  312. package/loader/loader.module.d.ts +8 -0
  313. package/loader/mtxLoader.d.ts +1 -0
  314. package/loader/package.json +5 -6
  315. package/{extensions.d.ts → ng-matero-extensions.d.ts} +1 -0
  316. package/package.json +178 -15
  317. package/popover/_popover-theme.scss +1 -1
  318. package/popover/mtxPopover.d.ts +1 -0
  319. package/popover/package.json +5 -6
  320. package/popover/popover-module.d.ts +10 -0
  321. package/popover/popover-target.d.ts +3 -0
  322. package/popover/popover-trigger.d.ts +3 -0
  323. package/popover/popover.d.ts +3 -0
  324. package/progress/_progress-theme.scss +2 -2
  325. package/progress/mtxProgress.d.ts +1 -0
  326. package/progress/package.json +5 -6
  327. package/progress/progress.component.d.ts +3 -0
  328. package/progress/progress.module.d.ts +6 -0
  329. package/public-api.d.ts +2 -19
  330. package/select/_select-theme.scss +1 -1
  331. package/select/mtxSelect.d.ts +1 -0
  332. package/select/option.component.d.ts +3 -0
  333. package/select/package.json +5 -6
  334. package/select/select.component.d.ts +3 -0
  335. package/select/select.component.scss +1 -1
  336. package/select/select.module.d.ts +10 -0
  337. package/select/templates.directive.d.ts +23 -0
  338. package/slider/_slider-theme.scss +4 -4
  339. package/slider/mtxSlider.d.ts +1 -0
  340. package/slider/package.json +5 -6
  341. package/slider/slider-module.d.ts +7 -0
  342. package/slider/slider.d.ts +4 -1
  343. package/slider/slider.scss +7 -7
  344. package/split/_split-theme.scss +1 -1
  345. package/split/mtxSplit.d.ts +1 -0
  346. package/split/package.json +5 -6
  347. package/split/split-pane.directive.d.ts +3 -0
  348. package/split/split.component.d.ts +4 -1
  349. package/split/split.module.d.ts +7 -0
  350. package/text3d/_text3d-theme.scss +2 -2
  351. package/text3d/mtxText3d.d.ts +1 -0
  352. package/text3d/package.json +5 -6
  353. package/text3d/text3d.component.d.ts +3 -0
  354. package/text3d/text3d.module.d.ts +6 -0
  355. package/tooltip/_tooltip-theme.scss +3 -3
  356. package/tooltip/mtxTooltip.d.ts +1 -0
  357. package/tooltip/package.json +5 -6
  358. package/tooltip/tooltip-module.d.ts +10 -0
  359. package/tooltip/tooltip.d.ts +5 -0
  360. package/tooltip/tooltip.scss +1 -1
  361. package/alert/mtxAlert.metadata.json +0 -1
  362. package/bundles/extensions.umd.js +0 -164
  363. package/bundles/extensions.umd.js.map +0 -1
  364. package/bundles/mtxAlert.umd.js +0 -101
  365. package/bundles/mtxAlert.umd.js.map +0 -1
  366. package/bundles/mtxButton.umd.js +0 -119
  367. package/bundles/mtxButton.umd.js.map +0 -1
  368. package/bundles/mtxCheckboxGroup.umd.js +0 -284
  369. package/bundles/mtxCheckboxGroup.umd.js.map +0 -1
  370. package/bundles/mtxColorpicker.umd.js +0 -1123
  371. package/bundles/mtxColorpicker.umd.js.map +0 -1
  372. package/bundles/mtxColumnResize.umd.js +0 -1339
  373. package/bundles/mtxColumnResize.umd.js.map +0 -1
  374. package/bundles/mtxCore.umd.js +0 -670
  375. package/bundles/mtxCore.umd.js.map +0 -1
  376. package/bundles/mtxDatetimepicker.umd.js +0 -3045
  377. package/bundles/mtxDatetimepicker.umd.js.map +0 -1
  378. package/bundles/mtxDialog.umd.js +0 -158
  379. package/bundles/mtxDialog.umd.js.map +0 -1
  380. package/bundles/mtxFormGroup.umd.js +0 -73
  381. package/bundles/mtxFormGroup.umd.js.map +0 -1
  382. package/bundles/mtxGrid.umd.js +0 -1581
  383. package/bundles/mtxGrid.umd.js.map +0 -1
  384. package/bundles/mtxLoader.umd.js +0 -107
  385. package/bundles/mtxLoader.umd.js.map +0 -1
  386. package/bundles/mtxPipes.umd.js +0 -44
  387. package/bundles/mtxPipes.umd.js.map +0 -1
  388. package/bundles/mtxPopover.umd.js +0 -1260
  389. package/bundles/mtxPopover.umd.js.map +0 -1
  390. package/bundles/mtxProgress.umd.js +0 -92
  391. package/bundles/mtxProgress.umd.js.map +0 -1
  392. package/bundles/mtxSelect.umd.js +0 -1097
  393. package/bundles/mtxSelect.umd.js.map +0 -1
  394. package/bundles/mtxSlider.umd.js +0 -1551
  395. package/bundles/mtxSlider.umd.js.map +0 -1
  396. package/bundles/mtxSplit.umd.js +0 -1431
  397. package/bundles/mtxSplit.umd.js.map +0 -1
  398. package/bundles/mtxText3d.umd.js +0 -84
  399. package/bundles/mtxText3d.umd.js.map +0 -1
  400. package/bundles/mtxTooltip.umd.js +0 -1083
  401. package/bundles/mtxTooltip.umd.js.map +0 -1
  402. package/button/mtxButton.metadata.json +0 -1
  403. package/checkbox-group/mtxCheckboxGroup.metadata.json +0 -1
  404. package/colorpicker/mtxColorpicker.metadata.json +0 -1
  405. package/column-resize/mtxColumnResize.metadata.json +0 -1
  406. package/core/mtxCore.metadata.json +0 -1
  407. package/datetimepicker/mtxDatetimepicker.metadata.json +0 -1
  408. package/dialog/mtxDialog.metadata.json +0 -1
  409. package/esm2015/alert/alert.component.js +0 -63
  410. package/esm2015/alert/alert.module.js +0 -14
  411. package/esm2015/button/button-loading.directive.js +0 -89
  412. package/esm2015/button/button.module.js +0 -16
  413. package/esm2015/checkbox-group/checkbox-group.component.js +0 -235
  414. package/esm2015/checkbox-group/checkbox-group.module.js +0 -17
  415. package/esm2015/colorpicker/colorpicker-input.js +0 -228
  416. package/esm2015/colorpicker/colorpicker-module.js +0 -41
  417. package/esm2015/colorpicker/colorpicker-toggle.js +0 -97
  418. package/esm2015/colorpicker/colorpicker.js +0 -372
  419. package/esm2015/column-resize/column-resize-directives/column-resize-flex.js +0 -54
  420. package/esm2015/column-resize/column-resize-directives/column-resize.js +0 -54
  421. package/esm2015/column-resize/column-resize-module.js +0 -24
  422. package/esm2015/column-resize/column-resize-notifier.js +0 -54
  423. package/esm2015/column-resize/column-resize.js +0 -80
  424. package/esm2015/column-resize/column-size-store.js +0 -18
  425. package/esm2015/column-resize/event-dispatcher.js +0 -75
  426. package/esm2015/column-resize/overlay-handle.js +0 -144
  427. package/esm2015/column-resize/resizable.js +0 -197
  428. package/esm2015/column-resize/resize-strategy.js +0 -245
  429. package/esm2015/core/datetime/datetime.module.js +0 -32
  430. package/esm2015/core/datetime/native-datetime-adapter.js +0 -144
  431. package/esm2015/datetimepicker/calendar-body.js +0 -76
  432. package/esm2015/datetimepicker/calendar.js +0 -614
  433. package/esm2015/datetimepicker/clock.js +0 -283
  434. package/esm2015/datetimepicker/datetimepicker-input.js +0 -336
  435. package/esm2015/datetimepicker/datetimepicker-module.js +0 -52
  436. package/esm2015/datetimepicker/datetimepicker-toggle.js +0 -103
  437. package/esm2015/datetimepicker/datetimepicker.js +0 -490
  438. package/esm2015/datetimepicker/month-view.js +0 -150
  439. package/esm2015/datetimepicker/multi-year-view.js +0 -215
  440. package/esm2015/datetimepicker/year-view.js +0 -141
  441. package/esm2015/dialog/dialog.component.js +0 -40
  442. package/esm2015/dialog/dialog.js +0 -81
  443. package/esm2015/dialog/dialog.module.js +0 -21
  444. package/esm2015/extensions-experimental.module.js +0 -13
  445. package/esm2015/extensions.js +0 -5
  446. package/esm2015/extensions.module.js +0 -40
  447. package/esm2015/form-group/form-group.component.js +0 -40
  448. package/esm2015/form-group/form-group.module.js +0 -14
  449. package/esm2015/grid/cell-selection.directive.js +0 -62
  450. package/esm2015/grid/cell.component.js +0 -115
  451. package/esm2015/grid/column-menu.component.js +0 -72
  452. package/esm2015/grid/column-resize/column-resize-directives/column-resize-flex.js +0 -47
  453. package/esm2015/grid/column-resize/column-resize-directives/column-resize.js +0 -47
  454. package/esm2015/grid/column-resize/column-resize-module.js +0 -36
  455. package/esm2015/grid/column-resize/overlay-handle.js +0 -68
  456. package/esm2015/grid/column-resize/resizable-directives/resizable.js +0 -75
  457. package/esm2015/grid/column-resize/resize-strategy.js +0 -45
  458. package/esm2015/grid/expansion-toggle.directive.js +0 -62
  459. package/esm2015/grid/grid.component.js +0 -418
  460. package/esm2015/grid/grid.module.js +0 -69
  461. package/esm2015/grid/grid.service.js +0 -50
  462. package/esm2015/grid/public-api.js +0 -17
  463. package/esm2015/loader/loader.component.js +0 -69
  464. package/esm2015/loader/loader.module.js +0 -16
  465. package/esm2015/pipes/mtxPipes.js +0 -5
  466. package/esm2015/pipes/pipes.module.js +0 -14
  467. package/esm2015/pipes/public-api.js +0 -3
  468. package/esm2015/pipes/to-observable.pipe.js +0 -12
  469. package/esm2015/popover/popover-module.js +0 -18
  470. package/esm2015/popover/popover-target.js +0 -24
  471. package/esm2015/popover/popover-trigger.js +0 -434
  472. package/esm2015/popover/popover.js +0 -326
  473. package/esm2015/progress/progress.component.js +0 -54
  474. package/esm2015/progress/progress.module.js +0 -14
  475. package/esm2015/public-api.js +0 -23
  476. package/esm2015/select/select.component.js +0 -380
  477. package/esm2015/select/select.module.js +0 -46
  478. package/esm2015/select/templates.directive.js +0 -211
  479. package/esm2015/slider/slider-module.js +0 -15
  480. package/esm2015/slider/slider.js +0 -1115
  481. package/esm2015/split/split-pane.directive.js +0 -156
  482. package/esm2015/split/split.component.js +0 -624
  483. package/esm2015/split/split.module.js +0 -15
  484. package/esm2015/text3d/text3d.component.js +0 -45
  485. package/esm2015/text3d/text3d.module.js +0 -14
  486. package/esm2015/tooltip/tooltip-module.js +0 -20
  487. package/esm2015/tooltip/tooltip.js +0 -683
  488. package/extensions-experimental.module.d.ts +0 -2
  489. package/extensions.metadata.json +0 -1
  490. package/extensions.module.d.ts +0 -2
  491. package/fesm2015/extensions.js +0 -80
  492. package/fesm2015/extensions.js.map +0 -1
  493. package/fesm2015/mtxAlert.js +0 -82
  494. package/fesm2015/mtxAlert.js.map +0 -1
  495. package/fesm2015/mtxButton.js +0 -108
  496. package/fesm2015/mtxButton.js.map +0 -1
  497. package/fesm2015/mtxCheckboxGroup.js +0 -255
  498. package/fesm2015/mtxCheckboxGroup.js.map +0 -1
  499. package/fesm2015/mtxColorpicker.js.map +0 -1
  500. package/fesm2015/mtxColumnResize.js.map +0 -1
  501. package/fesm2015/mtxCore.js.map +0 -1
  502. package/fesm2015/mtxDatetimepicker.js.map +0 -1
  503. package/fesm2015/mtxDialog.js +0 -141
  504. package/fesm2015/mtxDialog.js.map +0 -1
  505. package/fesm2015/mtxFormGroup.js +0 -59
  506. package/fesm2015/mtxFormGroup.js.map +0 -1
  507. package/fesm2015/mtxGrid.js +0 -1186
  508. package/fesm2015/mtxGrid.js.map +0 -1
  509. package/fesm2015/mtxLoader.js +0 -90
  510. package/fesm2015/mtxLoader.js.map +0 -1
  511. package/fesm2015/mtxPipes.js +0 -31
  512. package/fesm2015/mtxPipes.js.map +0 -1
  513. package/fesm2015/mtxPopover.js.map +0 -1
  514. package/fesm2015/mtxProgress.js +0 -73
  515. package/fesm2015/mtxProgress.js.map +0 -1
  516. package/fesm2015/mtxSelect.js +0 -700
  517. package/fesm2015/mtxSelect.js.map +0 -1
  518. package/fesm2015/mtxSlider.js.map +0 -1
  519. package/fesm2015/mtxSplit.js.map +0 -1
  520. package/fesm2015/mtxText3d.js +0 -64
  521. package/fesm2015/mtxText3d.js.map +0 -1
  522. package/fesm2015/mtxTooltip.js.map +0 -1
  523. package/form-group/mtxFormGroup.metadata.json +0 -1
  524. package/grid/cell-selection.directive.d.ts +0 -17
  525. package/grid/mtxGrid.metadata.json +0 -1
  526. package/loader/mtxLoader.metadata.json +0 -1
  527. package/pipes/mtxPipes.d.ts +0 -4
  528. package/pipes/mtxPipes.metadata.json +0 -1
  529. package/pipes/package.json +0 -11
  530. package/pipes/pipes.module.d.ts +0 -2
  531. package/popover/mtxPopover.metadata.json +0 -1
  532. package/progress/mtxProgress.metadata.json +0 -1
  533. package/select/mtxSelect.metadata.json +0 -1
  534. package/slider/mtxSlider.metadata.json +0 -1
  535. package/split/mtxSplit.metadata.json +0 -1
  536. package/text3d/mtxText3d.metadata.json +0 -1
  537. package/tooltip/mtxTooltip.metadata.json +0 -1
@@ -0,0 +1,430 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
3
+ @use 'sass:meta';
4
+ @use 'palette';
5
+ @use '../density/private/compatibility';
6
+
7
+ // Whether duplication warnings should be disabled. Warnings enabled by default.
8
+ $theme-ignore-duplication-warnings: false !default;
9
+
10
+ // Whether density should be generated by default.
11
+ $_generate-default-density: true !default;
12
+
13
+ // Warning that will be printed if duplicated styles are generated by a theme.
14
+ $_duplicate-warning: 'Read more about how style duplication can be avoided in a dedicated ' +
15
+ 'guide. https://github.com/angular/components/blob/master/guides/duplicate-theming-styles.md';
16
+
17
+ // These variable are not intended to be overridden externally. They use `!default` to
18
+ // avoid being reset every time this file is imported.
19
+ $_emitted-color: () !default;
20
+ $_emitted-typography: () !default;
21
+ $_emitted-density: () !default;
22
+
23
+ /// For a given hue in a palette, return the contrast color from the map of contrast palettes.
24
+ /// @param {Map} $palette The palette from which to extract a color.
25
+ /// @param {String | Number} $hue The hue for which to get a contrast color.
26
+ /// @returns {Color} The contrast color for the given palette and hue.
27
+ @function get-contrast-color-from-palette($palette, $hue) {
28
+ @return map.get(map.get($palette, contrast), $hue);
29
+ }
30
+
31
+ /// Creates a map of hues to colors for a theme. This is used to define a theme palette in terms
32
+ /// of the Material Design hues.
33
+ /// @param {Map} $base-palette Map of hue keys to color values for the basis for this palette.
34
+ /// @param {String | Number} $default Default hue for this palette.
35
+ /// @param {String | Number} $lighter "lighter" hue for this palette.
36
+ /// @param {String | Number} $darker "darker" hue for this palette.
37
+ /// @param {String | Number} $text "text" hue for this palette.
38
+ /// @returns {Map} A complete Angular Material theming palette.
39
+ @function define-palette($base-palette, $default: 500, $lighter: 100, $darker: 700,
40
+ $text: $default) {
41
+ $result: map.merge(
42
+ $base-palette,
43
+ (
44
+ default: map.get($base-palette, $default),
45
+ lighter: map.get($base-palette, $lighter),
46
+ darker: map.get($base-palette, $darker),
47
+ text: map.get($base-palette, $text),
48
+ default-contrast: get-contrast-color-from-palette($base-palette, $default),
49
+ lighter-contrast: get-contrast-color-from-palette($base-palette, $lighter),
50
+ darker-contrast: get-contrast-color-from-palette($base-palette, $darker)
51
+ )
52
+ );
53
+
54
+ // For each hue in the palette, add a "-contrast" color to the map.
55
+ @each $hue, $color in $base-palette {
56
+ $result: map.merge(
57
+ $result,
58
+ (
59
+ '#{$hue}-contrast': get-contrast-color-from-palette($base-palette, $hue)
60
+ )
61
+ );
62
+ }
63
+
64
+ @return $result;
65
+ }
66
+
67
+ /// Gets a color from a theme palette (the output of mat-palette).
68
+ /// The hue can be one of the standard values (500, A400, etc.), one of the three preconfigured
69
+ /// hues (default, lighter, darker), or any of the aforementioned prefixed with "-contrast".
70
+ ///
71
+ /// @param {Map} $palette The palette from which to extract a color.
72
+ /// @param {String | Number} $hue The hue from the palette to use. If this is a value between 0
73
+ // and 1, it will be treated as opacity.
74
+ /// @param {Number} $opacity The alpha channel value for the color.
75
+ /// @returns {Color} The color for the given palette, hue, and opacity.
76
+ @function get-color-from-palette($palette, $hue: default, $opacity: null) {
77
+ // If hueKey is a number between zero and one, then it actually contains an
78
+ // opacity value, so recall this function with the default hue and that given opacity.
79
+ @if meta.type-of($hue) == number and $hue >= 0 and $hue <= 1 {
80
+ @return get-color-from-palette($palette, default, $hue);
81
+ }
82
+
83
+ // We cast the $hue to a string, because some hues starting with a number, like `700-contrast`,
84
+ // might be inferred as numbers by Sass. Casting them to string fixes the map lookup.
85
+ $color: if(map.has-key($palette, $hue), map.get($palette, $hue), map.get($palette, $hue + ''));
86
+
87
+ @if (meta.type-of($color) != color) {
88
+ // If the $color resolved to something different from a color (e.g. a CSS variable),
89
+ // we can't apply the opacity anyway so we return the value as is, otherwise Sass can
90
+ // throw an error or output something invalid.
91
+ @return $color;
92
+ }
93
+
94
+ @return rgba($color, if($opacity == null, opacity($color), $opacity));
95
+ }
96
+
97
+ // Validates the specified theme by ensuring that the optional color config defines
98
+ // a primary, accent and warn palette. Returns the theme if no failures were found.
99
+ @function _mat-validate-theme($theme) {
100
+ @if map.get($theme, color) {
101
+ $color: map.get($theme, color);
102
+ @if not map.get($color, primary) {
103
+ @error 'Theme does not define a valid "primary" palette.';
104
+ }
105
+ @else if not map.get($color, accent) {
106
+ @error 'Theme does not define a valid "accent" palette.';
107
+ }
108
+ @else if not map.get($color, warn) {
109
+ @error 'Theme does not define a valid "warn" palette.';
110
+ }
111
+ }
112
+ @return $theme;
113
+ }
114
+
115
+ // Creates a light-themed color configuration from the specified
116
+ // primary, accent and warn palettes.
117
+ @function _mat-create-light-color-config($primary, $accent, $warn: null) {
118
+ @return (
119
+ primary: $primary,
120
+ accent: $accent,
121
+ warn: if($warn != null, $warn, define-palette(palette.$red-palette)),
122
+ is-dark: false,
123
+ foreground: palette.$light-theme-foreground-palette,
124
+ background: palette.$light-theme-background-palette,
125
+ );
126
+ }
127
+
128
+ // Creates a dark-themed color configuration from the specified
129
+ // primary, accent and warn palettes.
130
+ @function _mat-create-dark-color-config($primary, $accent, $warn: null) {
131
+ @return (
132
+ primary: $primary,
133
+ accent: $accent,
134
+ warn: if($warn != null, $warn, define-palette(palette.$red-palette)),
135
+ is-dark: true,
136
+ foreground: palette.$dark-theme-foreground-palette,
137
+ background: palette.$dark-theme-background-palette,
138
+ );
139
+ }
140
+
141
+ // TODO: Remove legacy API and rename `$primary` below to `$config`. Currently it cannot be renamed
142
+ // as it would break existing apps that set the parameter by name.
143
+
144
+ /// Creates a container object for a light theme to be given to individual component theme mixins.
145
+ /// @param {Map} $primary The theme configuration object.
146
+ /// @returns {Map} A complete Angular Material theme map.
147
+ @function define-light-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
148
+ // This function creates a container object for the individual component theme mixins. Consumers
149
+ // can construct such an object by calling this function, or by building the object manually.
150
+ // There are two possible ways to invoke this function in order to create such an object:
151
+ //
152
+ // (1) Passing in a map that holds optional configurations for individual parts of the
153
+ // theming system. For `color` configurations, the function only expects the palettes
154
+ // for `primary` and `accent` (and optionally `warn`). The function will expand the
155
+ // shorthand into an actual configuration that can be consumed in `-color` mixins.
156
+ // (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
157
+ // as passing in a configuration map because only the `color` system can be configured.
158
+ //
159
+ // If the legacy pattern is used, we generate a container object only with a light-themed
160
+ // configuration for the `color` theming part.
161
+ @if $accent != null {
162
+ @return private-create-backwards-compatibility-theme(_mat-validate-theme((
163
+ _is-legacy-theme: true,
164
+ color: _mat-create-light-color-config($primary, $accent, $warn),
165
+ )));
166
+ }
167
+ // If the map pattern is used (1), we just pass-through the configurations for individual
168
+ // parts of the theming system, but update the `color` configuration if set. As explained
169
+ // above, the color shorthand will be expanded to an actual light-themed color configuration.
170
+ $result: $primary;
171
+ @if map.get($primary, color) {
172
+ $color-settings: map.get($primary, color);
173
+ $primary: map.get($color-settings, primary);
174
+ $accent: map.get($color-settings, accent);
175
+ $warn: map.get($color-settings, warn);
176
+ $result: map.merge($result, (color: _mat-create-light-color-config($primary, $accent, $warn)));
177
+ }
178
+ @return private-create-backwards-compatibility-theme(_mat-validate-theme($result));
179
+ }
180
+
181
+ // TODO: Remove legacy API and rename below `$primary` to `$config`. Currently it cannot be renamed
182
+ // as it would break existing apps that set the parameter by name.
183
+
184
+ /// Creates a container object for a dark theme to be given to individual component theme mixins.
185
+ /// @param {Map} $primary The theme configuration object.
186
+ /// @returns {Map} A complete Angular Material theme map.
187
+ @function define-dark-theme($primary, $accent: null, $warn: define-palette(palette.$red-palette)) {
188
+ // This function creates a container object for the individual component theme mixins. Consumers
189
+ // can construct such an object by calling this function, or by building the object manually.
190
+ // There are two possible ways to invoke this function in order to create such an object:
191
+ //
192
+ // (1) Passing in a map that holds optional configurations for individual parts of the
193
+ // theming system. For `color` configurations, the function only expects the palettes
194
+ // for `primary` and `accent` (and optionally `warn`). The function will expand the
195
+ // shorthand into an actual configuration that can be consumed in `-color` mixins.
196
+ // (2) Legacy pattern: Passing in the palettes as parameters. This is not as flexible
197
+ // as passing in a configuration map because only the `color` system can be configured.
198
+ //
199
+ // If the legacy pattern is used, we generate a container object only with a dark-themed
200
+ // configuration for the `color` theming part.
201
+ @if $accent != null {
202
+ @return private-create-backwards-compatibility-theme(_mat-validate-theme((
203
+ _is-legacy-theme: true,
204
+ color: _mat-create-dark-color-config($primary, $accent, $warn),
205
+ )));
206
+ }
207
+ // If the map pattern is used (1), we just pass-through the configurations for individual
208
+ // parts of the theming system, but update the `color` configuration if set. As explained
209
+ // above, the color shorthand will be expanded to an actual dark-themed color configuration.
210
+ $result: $primary;
211
+ @if map.get($primary, color) {
212
+ $color-settings: map.get($primary, color);
213
+ $primary: map.get($color-settings, primary);
214
+ $accent: map.get($color-settings, accent);
215
+ $warn: map.get($color-settings, warn);
216
+ $result: map.merge($result, (color: _mat-create-dark-color-config($primary, $accent, $warn)));
217
+ }
218
+ @return private-create-backwards-compatibility-theme(_mat-validate-theme($result));
219
+ }
220
+
221
+ /// Gets the color configuration from the given theme or configuration.
222
+ /// @param {Map} $theme The theme map returned from `define-light-theme` or `define-dark-theme`.
223
+ /// @param {Map} $default The default value returned if the given `$theme` does not include a
224
+ /// `color` configuration.
225
+ /// @returns {Map} Color configuration for a theme.
226
+ @function get-color-config($theme, $default: null) {
227
+ // If a configuration has been passed, return the config directly.
228
+ @if not private-is-theme-object($theme) {
229
+ @return $theme;
230
+ }
231
+ // If the theme has been constructed through the legacy theming API, we use the theme object
232
+ // as color configuration instead of the dedicated `color` property. We do this because for
233
+ // backwards compatibility, we copied the color configuration from `$theme.color` to `$theme`.
234
+ // Hence developers could customize the colors at top-level and want to respect these changes
235
+ // TODO: Remove when legacy theming API is removed.
236
+ @if private-is-legacy-constructed-theme($theme) {
237
+ @return $theme;
238
+ }
239
+ @if map.has-key($theme, color) {
240
+ @return map.get($theme, color);
241
+ }
242
+ @return $default;
243
+ }
244
+
245
+ /// Gets the density configuration from the given theme or configuration.
246
+ /// @param {Map} $theme-or-config The theme map returned from `define-light-theme` or
247
+ /// `define-dark-theme`.
248
+ /// @param {Map} $default The default value returned if the given `$theme` does not include a
249
+ /// `density` configuration.
250
+ /// @returns {Map} Density configuration for a theme.
251
+ @function get-density-config($theme-or-config, $default: 0) {
252
+ // If a configuration has been passed, return the config directly.
253
+ @if not private-is-theme-object($theme-or-config) {
254
+ @return $theme-or-config;
255
+ }
256
+ // In case a theme has been passed, extract the configuration if present,
257
+ // or fall back to the default density config.
258
+ @if map.has-key($theme-or-config, density) {
259
+ @return map.get($theme-or-config, density);
260
+ }
261
+ @return $default;
262
+ }
263
+
264
+ /// Gets the typography configuration from the given theme or configuration.
265
+ /// For backwards compatibility, typography is not included by default.
266
+ /// @param {Map} $theme-or-config The theme map returned from `define-light-theme` or
267
+ /// `define-dark-theme`.
268
+ /// @param {Map} $default The default value returned if the given `$theme` does not include a
269
+ /// `typography` configuration.
270
+ /// @returns {Map} Typography configuration for a theme.
271
+ @function get-typography-config($theme-or-config, $default: null) {
272
+ // If a configuration has been passed, return the config directly.
273
+ @if not private-is-theme-object($theme-or-config) {
274
+ @return $theme-or-config;
275
+ }
276
+ // In case a theme has been passed, extract the configuration if present,
277
+ // or fall back to the default typography config.
278
+ @if (map.has-key($theme-or-config, typography)) {
279
+ @return map.get($theme-or-config, typography);
280
+ }
281
+ @return $default;
282
+ }
283
+
284
+ //
285
+ // Private APIs
286
+ //
287
+
288
+ // Checks if configurations that have been declared in the given theme have been generated
289
+ // before. If so, warnings will be reported. This should notify developers in case duplicate
290
+ // styles are accidentally generated due to wrong usage of the all-theme mixins.
291
+ //
292
+ // Additionally, this mixin controls the default value for the density configuration. By
293
+ // default, density styles are generated at scale zero. If the same density styles would be
294
+ // generated a second time though, the default value will change to avoid duplicate styles.
295
+ //
296
+ // The mixin keeps track of all configurations in a list that is scoped to the specified
297
+ // id. This is necessary because a given theme can be passed to multiple disjoint theme mixins
298
+ // (e.g. `all-component-themes` and `all-mdc-component-themes`) without causing any
299
+ // style duplication.
300
+ @mixin private-check-duplicate-theme-styles($theme-or-color-config, $id) {
301
+ $theme: private-legacy-get-theme($theme-or-color-config);
302
+ $color-config: get-color-config($theme);
303
+ $density-config: get-density-config($theme);
304
+ $typography-config: get-typography-config($theme);
305
+ // Lists of previous `color`, `density` and `typography` configurations.
306
+ $previous-color: map.get($_emitted-color, $id) or ();
307
+ $previous-typography: map.get($_emitted-typography, $id) or ();
308
+ $previous-density: map.get($_emitted-density, $id) or ();
309
+ // Whether duplicate legacy density styles would be generated.
310
+ $duplicate-legacy-density: false;
311
+
312
+ // Check if the color configuration has been generated before.
313
+ @if $color-config != null {
314
+ @if list.index($previous-color, $color-config) != null and
315
+ not $theme-ignore-duplication-warnings {
316
+ @warn 'The same color styles are generated multiple times. ' + $_duplicate-warning;
317
+ }
318
+ $previous-color: list.append($previous-color, $color-config);
319
+ }
320
+
321
+ // Check if the typography configuration has been generated before.
322
+ @if $typography-config != null {
323
+ @if list.index($previous-typography, $typography-config) != null and
324
+ not $theme-ignore-duplication-warnings {
325
+ @warn 'The same typography styles are generated multiple times. ' + $_duplicate-warning;
326
+ }
327
+ $previous-typography: list.append($previous-typography, $typography-config);
328
+ }
329
+
330
+ // Check if the density configuration has been generated before.
331
+ @if $density-config != null {
332
+ @if list.index($previous-density, $density-config) != null {
333
+ // Only report a warning if density styles would be duplicated for non-legacy theme
334
+ // definitions. For legacy themes, we have compatibility logic that avoids duplication
335
+ // of default density styles. We don't want to report a warning in those cases.
336
+ @if private-is-legacy-constructed-theme($theme) {
337
+ $duplicate-legacy-density: true;
338
+ }
339
+ @else if not $theme-ignore-duplication-warnings {
340
+ @warn 'The same density styles are generated multiple times. ' + $_duplicate-warning;
341
+ }
342
+ }
343
+ $previous-density: list.append($previous-density, $density-config);
344
+ }
345
+
346
+ $_emitted-color: map.merge($_emitted-color, ($id: $previous-color)) !global;
347
+ $_emitted-density: map.merge($_emitted-density, ($id: $previous-density)) !global;
348
+ $_emitted-typography: map.merge($_emitted-typography, ($id: $previous-typography)) !global;
349
+
350
+ // Optionally, consumers of this mixin can wrap contents inside so that nested
351
+ // duplicate style checks do not report another warning. e.g. if developers include
352
+ // the `all-component-themes` mixin twice, only the top-level duplicate styles check
353
+ // should report a warning. Not all individual components should report a warning too.
354
+ $orig-mat-theme-ignore-duplication-warnings: $theme-ignore-duplication-warnings;
355
+ $theme-ignore-duplication-warnings: true !global;
356
+
357
+ // If duplicate default density styles would be generated for a legacy constructed theme,
358
+ // we adjust the density generation so that no density styles are generated by default.
359
+ // If no default density styles have been generated yet, we ensure that the styles
360
+ // are generated at root. For legacy themes our goal is to generate default density
361
+ // styles **once** and at root. This matches the old behavior where density styles were
362
+ // part of the base component styles (that did not use view encapsulation).
363
+ // TODO: Remove this compatibility logic when the legacy theming API is removed.
364
+ compatibility.$private-density-generate-at-root: private-is-legacy-constructed-theme($theme);
365
+ compatibility.$private-density-generate-styles: not $duplicate-legacy-density;
366
+
367
+ @content;
368
+ $theme-ignore-duplication-warnings: $orig-mat-theme-ignore-duplication-warnings !global;
369
+
370
+ compatibility.$private-density-generate-at-root: false;
371
+ compatibility.$private-density-generate-styles: true;
372
+ }
373
+
374
+ // Checks whether the given value resolves to a theme object. Theme objects are always
375
+ // of type `map` and can optionally only specify `color`, `density` or `typography`.
376
+ @function private-is-theme-object($value) {
377
+ @return meta.type-of($value) == 'map' and (
378
+ map.has-key($value, color) or
379
+ map.has-key($value, density) or
380
+ map.has-key($value, typography) or
381
+ list.length($value) == 0
382
+ );
383
+ }
384
+
385
+ // Checks whether a given value corresponds to a legacy constructed theme.
386
+ @function private-is-legacy-constructed-theme($value) {
387
+ @return meta.type-of($value) == 'map' and map.get($value, '_is-legacy-theme');
388
+ }
389
+
390
+ // Creates a backwards compatible theme. Previously in Angular Material, theme objects
391
+ // contained the color configuration directly. With the recent refactoring of the theming
392
+ // system to allow for density and typography configurations, this is no longer the case.
393
+ // To ensure that constructed themes which will be passed to custom theme mixins do not break,
394
+ // we copy the color configuration and put its properties at the top-level of the theme object.
395
+ // Here is an example of a pattern that should still work until it's officially marked as a
396
+ // breaking change:
397
+ //
398
+ // @mixin my-custom-component-theme($theme) {
399
+ // .my-comp {
400
+ // background-color: mat.get-color-from-palette(map.get($theme, primary));
401
+ // }
402
+ // }
403
+ //
404
+ // Note that the `$theme.primary` key does usually not exist since the color configuration
405
+ // is stored in `$theme.color` which contains a property for `primary`. This method copies
406
+ // the map from `$theme.color` to `$theme` for backwards compatibility.
407
+ @function private-create-backwards-compatibility-theme($theme) {
408
+ @if not map.get($theme, color) {
409
+ @return $theme;
410
+ }
411
+ $color: map.get($theme, color);
412
+ @return map.merge($theme, $color);
413
+ }
414
+
415
+ // Gets the theme from the given value that is either already a theme, or a color configuration.
416
+ // This handles the legacy case where developers pass a color configuration directly to the
417
+ // theme mixin. Before we introduced the new pattern for constructing a theme, developers passed
418
+ // the color configuration directly to the theme mixins. This can be still the case if developers
419
+ // construct a theme manually and pass it to a theme. We support this for backwards compatibility.
420
+ // TODO(devversion): remove this in the future. Constructing themes manually is rare,
421
+ // and the code can be easily updated to the new API.
422
+ @function private-legacy-get-theme($theme-or-color-config) {
423
+ @if private-is-theme-object($theme-or-color-config) {
424
+ @return $theme-or-color-config;
425
+ }
426
+ @return private-create-backwards-compatibility-theme((
427
+ _is-legacy-theme: true,
428
+ color: $theme-or-color-config
429
+ ));
430
+ }
@@ -0,0 +1,101 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
3
+ @use 'sass:math';
4
+ @use 'sass:meta';
5
+ @use 'sass:string';
6
+
7
+ // Utility for fetching a nested value from a typography config.
8
+ @function _mat-get-type-value($config, $level, $name) {
9
+ @return map.get(map.get($config, $level), $name);
10
+ }
11
+
12
+ /// Gets the font size for a level inside a typography config.
13
+ /// @param {Map} $config A typography config.
14
+ /// @param {Map} $level A typography level.
15
+ @function font-size($config, $level) {
16
+ @return _mat-get-type-value($config, $level, font-size);
17
+ }
18
+
19
+ /// Gets the line height for a level inside a typography config.
20
+ /// @param {Map} $config A typography config.
21
+ /// @param {Map} $level A typography level.
22
+ @function line-height($config, $level) {
23
+ @return _mat-get-type-value($config, $level, line-height);
24
+ }
25
+
26
+ /// Gets the font weight for a level inside a typography config.
27
+ /// @param {Map} $config A typography config.
28
+ /// @param {Map} $level A typography level.
29
+ @function font-weight($config, $level) {
30
+ @return _mat-get-type-value($config, $level, font-weight);
31
+ }
32
+
33
+ /// Gets the letter spacing for a level inside a typography config.
34
+ /// @param {Map} $config A typography config.
35
+ /// @param {Map} $level A typography level.
36
+ @function letter-spacing($config, $level) {
37
+ @return _mat-get-type-value($config, $level, letter-spacing);
38
+ }
39
+
40
+ /// Gets the font-family from a typography config and removes the quotes around it.
41
+ /// @param {Map} $config A typography config.
42
+ /// @param {Map} $level A typography level.
43
+ @function font-family($config, $level: null) {
44
+ $font-family: map.get($config, font-family);
45
+
46
+ @if $level != null {
47
+ $font-family: _mat-get-type-value($config, $level, font-family);
48
+ }
49
+
50
+ // Guard against unquoting non-string values, because it's deprecated.
51
+ @return if(meta.type-of($font-family) == string, string.unquote($font-family), $font-family);
52
+ }
53
+
54
+ /// Outputs the shorthand `font` CSS property, based on a set of typography values. Falls back to
55
+ /// the individual properties if a value that isn't allowed in the shorthand is passed in.
56
+ /// @param {String} $font-size The font-size value.
57
+ /// @param {String | Number} $font-weight The font-weight value.
58
+ /// @param {String | Number} $line-height The line-height value.
59
+ /// @param {String} $font-family The font-family value.
60
+ /// @returns {String} The `font` shorthand value combining the given parts.
61
+ @mixin font-shorthand($font-size, $font-weight, $line-height, $font-family) {
62
+ // If any of the values are set to `inherit`, we can't use the shorthand
63
+ // so we fall back to passing in the individual properties.
64
+ @if ($font-size == inherit or
65
+ $font-weight == inherit or
66
+ $line-height == inherit or
67
+ $font-family == inherit or
68
+ $font-size == null or
69
+ $font-weight == null or
70
+ $line-height == null or
71
+ $font-family == null) {
72
+ font-size: $font-size;
73
+ font-weight: $font-weight;
74
+ line-height: $line-height;
75
+ font-family: $font-family;
76
+ }
77
+ @else {
78
+ // Otherwise use the shorthand `font`, because it's the least amount of bytes.
79
+ font: $font-weight list.slash($font-size, $line-height) $font-family;
80
+ }
81
+ }
82
+
83
+ /// Emits CSS styles for the given typography level.
84
+ /// @param {Map} $config A typography config.
85
+ /// @param {Map} $level A typography level.
86
+ @mixin typography-level($config, $level) {
87
+ $font-size: font-size($config, $level);
88
+ $font-weight: font-weight($config, $level);
89
+ $line-height: line-height($config, $level);
90
+ $font-family: font-family($config, $level);
91
+
92
+ @include font-shorthand($font-size, $font-weight, $line-height, $font-family);
93
+
94
+ letter-spacing: letter-spacing($config, $level);
95
+ }
96
+
97
+ /// Coerce a value to `em` if it is a unitless number, otherwise returns
98
+ /// the value provided.
99
+ @function private-coerce-unitless-to-em($value) {
100
+ @return if(math.is-unitless($value), 1em * $value, $value);
101
+ }