@ng-matero/extensions 18.0.2 → 18.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 (158) hide show
  1. package/README.md +27 -2
  2. package/alert/alert.scss +13 -16
  3. package/checkbox-group/checkbox-group.d.ts +3 -3
  4. package/colorpicker/colorpicker-toggle.scss +1 -1
  5. package/colorpicker/colorpicker.d.ts +1 -1
  6. package/column-resize/resize-strategy.d.ts +1 -1
  7. package/core/pipes/is-template-ref.pipe.d.ts +2 -2
  8. package/core/tokens/_m3-tokens.scss +3 -0
  9. package/core/tokens/m2/mtx/_alert.scss +17 -9
  10. package/core/tokens/m2/mtx/_grid.scss +0 -2
  11. package/core/tokens/m2/mtx/_popover.scss +3 -0
  12. package/core/tokens/m3/mtx/_alert.scss +19 -9
  13. package/core/tokens/m3/mtx/_grid.scss +0 -2
  14. package/core/tokens/m3/mtx/_popover.scss +3 -0
  15. package/datetimepicker/calendar.d.ts +4 -2
  16. package/datetimepicker/calendar.scss +38 -0
  17. package/datetimepicker/datetimepicker-actions.d.ts +32 -0
  18. package/datetimepicker/datetimepicker-actions.scss +18 -0
  19. package/datetimepicker/datetimepicker-animations.d.ts +1 -1
  20. package/datetimepicker/datetimepicker-content.scss +40 -22
  21. package/datetimepicker/datetimepicker-module.d.ts +2 -1
  22. package/datetimepicker/datetimepicker-toggle.scss +1 -1
  23. package/datetimepicker/datetimepicker.d.ts +33 -3
  24. package/datetimepicker/public-api.d.ts +1 -0
  25. package/datetimepicker/time.d.ts +12 -8
  26. package/datetimepicker/time.scss +6 -6
  27. package/dialog/dialog.d.ts +1 -1
  28. package/drawer/drawer-config.d.ts +8 -6
  29. package/drawer/drawer-container.d.ts +12 -68
  30. package/drawer/drawer-container.scss +4 -6
  31. package/drawer/drawer-module.d.ts +2 -2
  32. package/drawer/drawer-ref.d.ts +13 -4
  33. package/drawer/drawer.d.ts +24 -24
  34. package/esm2022/alert/alert-module.mjs +5 -5
  35. package/esm2022/alert/alert.mjs +6 -5
  36. package/esm2022/button/button-loading.mjs +3 -3
  37. package/esm2022/button/button-module.mjs +4 -4
  38. package/esm2022/checkbox-group/checkbox-group-module.mjs +4 -4
  39. package/esm2022/checkbox-group/checkbox-group.mjs +3 -3
  40. package/esm2022/colorpicker/colorpicker-input.mjs +3 -3
  41. package/esm2022/colorpicker/colorpicker-module.mjs +4 -4
  42. package/esm2022/colorpicker/colorpicker-toggle.mjs +6 -6
  43. package/esm2022/colorpicker/colorpicker.mjs +8 -8
  44. package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
  45. package/esm2022/column-resize/column-resize-directives/column-resize.mjs +3 -3
  46. package/esm2022/column-resize/column-resize-module.mjs +4 -4
  47. package/esm2022/column-resize/column-resize-notifier.mjs +6 -6
  48. package/esm2022/column-resize/column-resize.mjs +3 -3
  49. package/esm2022/column-resize/column-size-store.mjs +3 -3
  50. package/esm2022/column-resize/event-dispatcher.mjs +3 -3
  51. package/esm2022/column-resize/overlay-handle.mjs +3 -3
  52. package/esm2022/column-resize/resizable.mjs +3 -3
  53. package/esm2022/column-resize/resize-strategy.mjs +9 -9
  54. package/esm2022/core/datetime/datetime.module.mjs +8 -8
  55. package/esm2022/core/datetime/native-datetime-adapter.mjs +3 -3
  56. package/esm2022/core/pipes/is-template-ref.pipe.mjs +3 -3
  57. package/esm2022/core/pipes/pipes.module.mjs +4 -4
  58. package/esm2022/core/pipes/to-observable.pipe.mjs +3 -3
  59. package/esm2022/datetimepicker/calendar-body.mjs +3 -3
  60. package/esm2022/datetimepicker/calendar.mjs +10 -6
  61. package/esm2022/datetimepicker/clock.mjs +3 -3
  62. package/esm2022/datetimepicker/datetimepicker-actions.mjs +88 -0
  63. package/esm2022/datetimepicker/datetimepicker-animations.mjs +3 -3
  64. package/esm2022/datetimepicker/datetimepicker-input.mjs +3 -3
  65. package/esm2022/datetimepicker/datetimepicker-intl.mjs +3 -3
  66. package/esm2022/datetimepicker/datetimepicker-module.mjs +24 -7
  67. package/esm2022/datetimepicker/datetimepicker-toggle.mjs +6 -6
  68. package/esm2022/datetimepicker/datetimepicker.mjs +92 -20
  69. package/esm2022/datetimepicker/month-view.mjs +7 -5
  70. package/esm2022/datetimepicker/multi-year-view.mjs +7 -5
  71. package/esm2022/datetimepicker/public-api.mjs +2 -1
  72. package/esm2022/datetimepicker/time.mjs +29 -20
  73. package/esm2022/datetimepicker/year-view.mjs +7 -5
  74. package/esm2022/dialog/dialog-container.mjs +3 -3
  75. package/esm2022/dialog/dialog-module.mjs +4 -4
  76. package/esm2022/dialog/dialog.mjs +3 -3
  77. package/esm2022/drawer/drawer-config.mjs +2 -2
  78. package/esm2022/drawer/drawer-container.mjs +32 -196
  79. package/esm2022/drawer/drawer-module.mjs +7 -7
  80. package/esm2022/drawer/drawer-ref.mjs +27 -18
  81. package/esm2022/drawer/drawer.mjs +98 -121
  82. package/esm2022/grid/cell.mjs +3 -3
  83. package/esm2022/grid/column-menu.mjs +5 -5
  84. package/esm2022/grid/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
  85. package/esm2022/grid/column-resize/column-resize-directives/column-resize.mjs +3 -3
  86. package/esm2022/grid/column-resize/column-resize-module.mjs +8 -8
  87. package/esm2022/grid/column-resize/overlay-handle.mjs +3 -3
  88. package/esm2022/grid/column-resize/resizable-directives/resizable.mjs +3 -3
  89. package/esm2022/grid/column-resize/resize-strategy.mjs +3 -3
  90. package/esm2022/grid/expansion-toggle.mjs +3 -3
  91. package/esm2022/grid/grid-module.mjs +4 -4
  92. package/esm2022/grid/grid-pipes.mjs +21 -21
  93. package/esm2022/grid/grid-utils.mjs +3 -3
  94. package/esm2022/grid/grid.mjs +5 -5
  95. package/esm2022/grid/selectable-cell.mjs +3 -3
  96. package/esm2022/loader/loader-module.mjs +4 -4
  97. package/esm2022/loader/loader.mjs +3 -3
  98. package/esm2022/photoviewer/photoviewer-module.mjs +4 -4
  99. package/esm2022/photoviewer/photoviewer.mjs +3 -3
  100. package/esm2022/popover/popover-content.mjs +6 -6
  101. package/esm2022/popover/popover-interfaces.mjs +1 -1
  102. package/esm2022/popover/popover-module.mjs +4 -4
  103. package/esm2022/popover/popover-target.mjs +3 -3
  104. package/esm2022/popover/popover-trigger.mjs +3 -3
  105. package/esm2022/popover/popover.mjs +29 -19
  106. package/esm2022/progress/progress-module.mjs +4 -4
  107. package/esm2022/progress/progress.mjs +3 -3
  108. package/esm2022/select/option.mjs +3 -3
  109. package/esm2022/select/select-module.mjs +4 -4
  110. package/esm2022/select/select.mjs +3 -3
  111. package/esm2022/select/templates.mjs +33 -33
  112. package/esm2022/split/split-module.mjs +4 -4
  113. package/esm2022/split/split-pane.mjs +6 -4
  114. package/esm2022/split/split.mjs +6 -4
  115. package/esm2022/tooltip/tooltip-module.mjs +4 -4
  116. package/esm2022/tooltip/tooltip.mjs +20 -18
  117. package/fesm2022/mtxAlert.mjs +9 -8
  118. package/fesm2022/mtxAlert.mjs.map +1 -1
  119. package/fesm2022/mtxButton.mjs +7 -7
  120. package/fesm2022/mtxCheckboxGroup.mjs +7 -7
  121. package/fesm2022/mtxColorpicker.mjs +20 -20
  122. package/fesm2022/mtxColorpicker.mjs.map +1 -1
  123. package/fesm2022/mtxColumnResize.mjs +40 -40
  124. package/fesm2022/mtxCore.mjs +21 -21
  125. package/fesm2022/mtxDatetimepicker.mjs +273 -82
  126. package/fesm2022/mtxDatetimepicker.mjs.map +1 -1
  127. package/fesm2022/mtxDialog.mjs +10 -10
  128. package/fesm2022/mtxDrawer.mjs +160 -340
  129. package/fesm2022/mtxDrawer.mjs.map +1 -1
  130. package/fesm2022/mtxGrid.mjs +68 -68
  131. package/fesm2022/mtxGrid.mjs.map +1 -1
  132. package/fesm2022/mtxLoader.mjs +7 -7
  133. package/fesm2022/mtxPhotoviewer.mjs +7 -7
  134. package/fesm2022/mtxPopover.mjs +44 -34
  135. package/fesm2022/mtxPopover.mjs.map +1 -1
  136. package/fesm2022/mtxProgress.mjs +7 -7
  137. package/fesm2022/mtxSelect.mjs +43 -43
  138. package/fesm2022/mtxSplit.mjs +14 -10
  139. package/fesm2022/mtxSplit.mjs.map +1 -1
  140. package/fesm2022/mtxTooltip.mjs +23 -21
  141. package/fesm2022/mtxTooltip.mjs.map +1 -1
  142. package/grid/column-menu.scss +0 -1
  143. package/grid/grid.scss +2 -0
  144. package/package.json +7 -7
  145. package/popover/popover-interfaces.d.ts +0 -1
  146. package/popover/popover.d.ts +2 -5
  147. package/prebuilt-themes/azure-blue.css +1 -1
  148. package/prebuilt-themes/cyan-orange.css +1 -1
  149. package/prebuilt-themes/deeppurple-amber.css +1 -1
  150. package/prebuilt-themes/indigo-pink.css +1 -1
  151. package/prebuilt-themes/magenta-violet.css +1 -1
  152. package/prebuilt-themes/pink-bluegrey.css +1 -1
  153. package/prebuilt-themes/purple-green.css +1 -1
  154. package/prebuilt-themes/rose-red.css +1 -1
  155. package/select/option.d.ts +1 -1
  156. package/select/select.scss +2 -2
  157. package/tooltip/tooltip.d.ts +3 -0
  158. package/tooltip/tooltip.scss +61 -29
package/README.md CHANGED
@@ -43,18 +43,43 @@ export class YourAppModule {
43
43
 
44
44
  After import modules, you must define a theme. [More about theming](https://material.angular.io/guide/theming).
45
45
 
46
+ ### M2 theme
47
+
46
48
  ```scss
49
+ @use '@angular/material' as mat;
47
50
  @use '@ng-matero/extensions' as mtx;
48
51
 
52
+ $theme: mat.define-light-theme(...);
53
+
54
+ @include mat.all-component-themes($theme);
49
55
  @include mtx.all-component-themes($theme);
50
56
  ```
51
57
 
58
+ ### M3 theme
59
+
60
+ ```scss
61
+ @use '@angular/material' as mat;
62
+ @use '@ng-matero/extensions' as mtx;
63
+
64
+ $config: (...);
65
+
66
+ $theme: mat.private-deep-merge-all(
67
+ mat.define-theme($config),
68
+ mtx.define-theme($config)
69
+ );
70
+
71
+ html {
72
+ @include mat.all-component-themes($theme);
73
+ @include mtx.all-component-themes($theme);
74
+ }
75
+ ```
76
+
52
77
  The @use-based Sass API is only available in the version `12.0.0` and above.
53
78
 
54
- You can also [using a pre-built theme](https://material.angular.io/guide/theming#using-a-pre-built-theme) which in the "prebuilt-themes" directory of the npm package (@ng-matero/extensions/prebuilt-themes).
79
+ You can also [using a pre-built theme](https://material.angular.io/guide/theming#pre-built-themes) which in the "prebuilt-themes" directory of the npm package (@ng-matero/extensions/prebuilt-themes).
55
80
 
56
81
  ```scss
57
- @import '@ng-matero/extensions/prebuilt-themes/indigo-pink.css'
82
+ @import '@ng-matero/extensions/prebuilt-themes/azure-blue.css'
58
83
  ```
59
84
 
60
85
  ## Development
package/alert/alert.scss CHANGED
@@ -4,8 +4,9 @@
4
4
  .mtx-alert {
5
5
  position: relative;
6
6
  display: block;
7
- padding: 12px 20px;
8
- margin-bottom: 16px;
7
+ padding: .75rem 1rem;
8
+ margin-bottom: 1rem;
9
+ line-height: 1.5;
9
10
 
10
11
  @include token-utils.use-tokens(tokens-mtx-alert.$prefix, tokens-mtx-alert.get-token-slots()) {
11
12
  $border-color: token-utils.get-token-variable(outline-color);
@@ -17,21 +18,25 @@
17
18
  @include token-utils.create-token-slot(color, text-color);
18
19
 
19
20
  &.mtx-alert-info {
21
+ @include token-utils.create-token-slot(border-color, info-outline-color);
20
22
  @include token-utils.create-token-slot(background-color, info-background-color);
21
23
  @include token-utils.create-token-slot(color, info-text-color);
22
24
  }
23
25
 
24
26
  &.mtx-alert-success {
27
+ @include token-utils.create-token-slot(border-color, success-outline-color);
25
28
  @include token-utils.create-token-slot(background-color, success-background-color);
26
29
  @include token-utils.create-token-slot(color, success-text-color);
27
30
  }
28
31
 
29
32
  &.mtx-alert-warning {
33
+ @include token-utils.create-token-slot(border-color, warning-outline-color);
30
34
  @include token-utils.create-token-slot(background-color, warning-background-color);
31
35
  @include token-utils.create-token-slot(color, warning-text-color);
32
36
  }
33
37
 
34
38
  &.mtx-alert-danger {
39
+ @include token-utils.create-token-slot(border-color, danger-outline-color);
35
40
  @include token-utils.create-token-slot(background-color, danger-background-color);
36
41
  @include token-utils.create-token-slot(color, danger-text-color);
37
42
  }
@@ -41,27 +46,19 @@
41
46
  .mtx-alert-close {
42
47
  position: absolute;
43
48
  top: 0;
44
- bottom: 0;
45
49
  right: 0;
46
- padding: 0 1.25rem;
47
- font-size: 1.5rem;
48
- line-height: 1;
49
- color: inherit;
50
- opacity: .5;
51
- background-color: transparent;
52
- border: 0;
53
- cursor: pointer;
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ width: 3rem;
54
+ height: 3rem;
54
55
 
55
56
  [dir='rtl'] & {
56
57
  right: auto;
57
58
  left: 0;
58
59
  }
59
-
60
- &:hover {
61
- opacity: .75;
62
- }
63
60
  }
64
61
 
65
62
  .mtx-alert-dismissible {
66
- padding-right: 4rem;
63
+ padding-right: 3rem;
67
64
  }
@@ -5,9 +5,9 @@ import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
5
5
  import { MtxCheckboxGroupOption } from './interfaces';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class MtxCheckboxBase {
8
- label?: any;
9
- value?: any;
10
- constructor(label?: any, value?: any);
8
+ label?: any | undefined;
9
+ value?: any | undefined;
10
+ constructor(label?: any | undefined, value?: any | undefined);
11
11
  }
12
12
  export declare class MtxCheckboxGroup implements AfterViewInit, OnDestroy, ControlValueAccessor {
13
13
  private _changeDetectorRef;
@@ -4,7 +4,7 @@
4
4
 
5
5
  $_tokens: tokens-mtx-colorpicker.$prefix, tokens-mtx-colorpicker.get-token-slots();
6
6
 
7
- // We support the case where the form field is disabled, but the datepicker is not.
7
+ // We support the case where the form field is disabled, but the colorpicker is not.
8
8
  // MDC sets `pointer-events: none` on disabled form fields which prevents clicks on the toggle.
9
9
  .mtx-colorpicker-toggle {
10
10
  pointer-events: auto;
@@ -87,7 +87,7 @@ export declare class MtxColorpicker implements OnChanges, OnDestroy {
87
87
  private _backdropHarnessClass;
88
88
  /** The input element this colorpicker is associated with. */
89
89
  pickerInput: MtxColorpickerInput;
90
- /** Emits when the datepicker is disabled. */
90
+ /** Emits when the colorpicker is disabled. */
91
91
  readonly _disabledChange: Subject<boolean>;
92
92
  /** Emits new selected color when selected color changes. */
93
93
  readonly _selectedChanged: Subject<string>;
@@ -65,7 +65,7 @@ export declare class CdkFlexTableResizeStrategy extends ResizeStrategy implement
65
65
  private _indexSequence;
66
66
  protected readonly defaultMinSize = 0;
67
67
  protected readonly defaultMaxSize: number;
68
- constructor(columnResize: ColumnResize, styleScheduler: _CoalescedStyleScheduler, table: CdkTable<unknown>, document: any, _nonce?: string | null | undefined);
68
+ constructor(columnResize: ColumnResize, styleScheduler: _CoalescedStyleScheduler, table: CdkTable<unknown>, document: any, _nonce?: (string | null) | undefined);
69
69
  applyColumnSize(cssFriendlyColumnName: string, columnHeader: HTMLElement, sizeInPx: number, previousSizeInPx?: number): void;
70
70
  applyMinColumnSize(cssFriendlyColumnName: string, _: HTMLElement, sizeInPx: number): void;
71
71
  applyMaxColumnSize(cssFriendlyColumnName: string, _: HTMLElement, sizeInPx: number): void;
@@ -1,7 +1,7 @@
1
- import { PipeTransform } from '@angular/core';
1
+ import { PipeTransform, TemplateRef } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class MtxIsTemplateRefPipe implements PipeTransform {
4
- transform(obj: any): boolean;
4
+ transform(obj: any): obj is TemplateRef<any>;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxIsTemplateRefPipe, never>;
6
6
  static ɵpipe: i0.ɵɵPipeDeclaration<MtxIsTemplateRefPipe, "isTemplateRef", true>;
7
7
  }
@@ -300,6 +300,9 @@ $_cached-token-slots: null;
300
300
  $sys-color: _get-sys-color($type, $ref);
301
301
 
302
302
  @return _generate-tokens(map.merge($ref, (
303
+ // Used to get the theme type
304
+ md-sys-type: $type,
305
+
303
306
  md-sys-color: $sys-color,
304
307
  // Because the elevation values are always combined with color values to create the box shadow,
305
308
  // elevation needs to be part of the color dimension.
@@ -19,16 +19,24 @@ $prefix: (mtx, alert);
19
19
 
20
20
  @return (
21
21
  outline-color: transparent,
22
- background-color: mat.get-theme-color($theme, background, dialog),
22
+ background-color: mat.m2-get-color-from-palette(mat.$m2-gray-palette, if($is-dark, 900, 100)),
23
23
  text-color: mat.get-theme-color($theme, foreground, text),
24
- info-background-color: mat.m2-get-color-from-palette(mat.$m2-blue-palette, if($is-dark, 900, 500)),
25
- info-text-color: white,
26
- success-background-color: mat.m2-get-color-from-palette(mat.$m2-green-palette, if($is-dark, 900, 500)),
27
- success-text-color: white,
28
- warning-background-color: mat.m2-get-color-from-palette(mat.$m2-orange-palette, if($is-dark, 900, 500)),
29
- warning-text-color: white,
30
- danger-background-color: mat.m2-get-color-from-palette(mat.$m2-red-palette, if($is-dark, 900, 500)),
31
- danger-text-color: white,
24
+
25
+ info-outline-color: transparent,
26
+ info-background-color: mat.m2-get-color-from-palette(mat.$m2-blue-palette, if($is-dark, 900, 100)),
27
+ info-text-color: mat.get-theme-color($theme, foreground, text),
28
+
29
+ success-outline-color: transparent,
30
+ success-background-color: mat.m2-get-color-from-palette(mat.$m2-green-palette, if($is-dark, 900, 100)),
31
+ success-text-color: mat.get-theme-color($theme, foreground, text),
32
+
33
+ warning-outline-color: transparent,
34
+ warning-background-color: mat.m2-get-color-from-palette(mat.$m2-amber-palette, if($is-dark, 900, 100)),
35
+ warning-text-color: mat.get-theme-color($theme, foreground, text),
36
+
37
+ danger-outline-color: transparent,
38
+ danger-background-color: mat.m2-get-color-from-palette(mat.$m2-red-palette, if($is-dark, 900, 100)),
39
+ danger-text-color: mat.get-theme-color($theme, foreground, text),
32
40
  );
33
41
  }
34
42
 
@@ -1,6 +1,5 @@
1
1
  @use 'sass:map';
2
2
  @use '@angular/material' as mat;
3
- @use '@material/elevation' as mdc-elevation;
4
3
  @use '../../token-utils';
5
4
 
6
5
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -12,7 +11,6 @@ $prefix: (mtx, grid);
12
11
  @return (
13
12
  container-shape: 0,
14
13
  table-cell-min-width: 80px,
15
- column-menu-elevation-shadow: mdc-elevation.elevation-box-shadow(8),
16
14
  );
17
15
  }
18
16
 
@@ -10,6 +10,9 @@ $prefix: (mtx, popover);
10
10
  @function get-unthemable-tokens() {
11
11
  @return (
12
12
  container-shape: 4px,
13
+ // Note that this uses a value, rather than a computed box-shadow, because we use
14
+ // the value at runtime to determine which shadow to set based on the popover's depth.
15
+ base-elevation-level: 8,
13
16
  );
14
17
  }
15
18
 
@@ -11,20 +11,30 @@ $prefix: (mtx, alert);
11
11
  /// @param {Map} $token-slots Possible token slots
12
12
  /// @return {Map} A set of custom tokens for the mat-badge
13
13
  @function get-tokens($systems, $exclude-hardcoded, $token-slots) {
14
+ $is-dark: map.get($systems, md-sys-type) == dark;
15
+
14
16
  $tokens: (
15
17
  container-shape: map.get($systems, md-sys-shape, corner-small),
16
18
 
17
- outline-color: token-utils.hardcode(transparent, $exclude-hardcoded),
19
+ outline-color: map.get($systems, md-sys-color, outline-variant),
18
20
  background-color: map.get($systems, md-sys-color, surface-container),
19
21
  text-color: map.get($systems, md-sys-color, on-surface),
20
- info-background-color: map.get(mat.$blue-palette, 50),
21
- info-text-color: token-utils.hardcode(white, $exclude-hardcoded),
22
- success-background-color: map.get(mat.$green-palette, 50),
23
- success-text-color: token-utils.hardcode(white, $exclude-hardcoded),
24
- warning-background-color: map.get(mat.$orange-palette, 50),
25
- warning-text-color: token-utils.hardcode(white, $exclude-hardcoded),
26
- danger-background-color: map.get(mat.$red-palette, 50),
27
- danger-text-color: token-utils.hardcode(white, $exclude-hardcoded),
22
+
23
+ info-outline-color: map.get(mat.$azure-palette, if($is-dark, 40, 80)),
24
+ info-background-color: map.get(mat.$azure-palette, if($is-dark, 20, 90)),
25
+ info-text-color: map.get(mat.$azure-palette, if($is-dark, 90, 20)),
26
+
27
+ success-outline-color: map.get(mat.$green-palette, if($is-dark, 40, 80)),
28
+ success-background-color: map.get(mat.$green-palette, if($is-dark, 20, 95)),
29
+ success-text-color: map.get(mat.$green-palette, if($is-dark, 95, 20)),
30
+
31
+ warning-outline-color: map.get(mat.$yellow-palette, if($is-dark, 40, 80)),
32
+ warning-background-color: map.get(mat.$yellow-palette, if($is-dark, 20, 98)),
33
+ warning-text-color: map.get(mat.$yellow-palette, if($is-dark, 98, 20)),
34
+
35
+ danger-outline-color: map.get(mat.$red-palette, if($is-dark, 40, 80)),
36
+ danger-background-color: map.get(mat.$red-palette, if($is-dark, 20, 90)),
37
+ danger-text-color: map.get(mat.$red-palette, if($is-dark, 90, 20)),
28
38
  );
29
39
 
30
40
  @return token-utils.namespace-tokens($prefix, $tokens, $token-slots);
@@ -1,5 +1,4 @@
1
1
  @use 'sass:map';
2
- @use '@material/elevation' as mdc-elevation;
3
2
  @use '../../token-utils';
4
3
 
5
4
  // The prefix used to generate the fully qualified name for tokens in this file.
@@ -18,7 +17,6 @@ $prefix: (mtx, grid);
18
17
  outline-color: map.get($systems, md-sys-color, outline-variant),
19
18
  column-menu-text-color: map.get($systems, md-sys-color, on-surface-variant),
20
19
  column-menu-divider-color: map.get($systems, md-sys-color, outline-variant),
21
- column-menu-elevation-shadow: token-utils.hardcode(mdc-elevation.elevation-box-shadow(2), $exclude-hardcoded),
22
20
  table-footer-background-color: map.get($systems, md-sys-color, surface-container),
23
21
  table-row-striped-background-color: map.get($systems, md-sys-color, surface-container),
24
22
  table-row-hover-background-color: map.get($systems, md-sys-color, secondary-container),
@@ -16,6 +16,9 @@ $prefix: (mtx, popover);
16
16
  outline-color: map.get($systems, md-sys-color, surface-container),
17
17
  background-color: map.get($systems, md-sys-color, surface-container),
18
18
  text-color: map.get($systems, md-sys-color, on-surface),
19
+ // Note that this uses a value, rather than a computed box-shadow, because we use
20
+ // the value at runtime to determine which shadow to set based on the popover's depth.
21
+ base-elevation-level: token-utils.hardcode(2, $exclude-hardcoded),
19
22
  );
20
23
 
21
24
  @return token-utils.namespace-tokens($prefix, $tokens, $token-slots);
@@ -1,4 +1,4 @@
1
- import { ComponentType, Portal } from '@angular/cdk/portal';
1
+ import { ComponentType, Portal, TemplatePortal } from '@angular/cdk/portal';
2
2
  import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy } from '@angular/core';
3
3
  import { DatetimeAdapter, MtxDatetimeFormats } from '@ng-matero/extensions/core';
4
4
  import { MtxClockView } from './clock';
@@ -30,6 +30,8 @@ export declare class MtxCalendar<D> implements AfterContentInit, OnDestroy {
30
30
  preventSameDateTimeSelection: boolean;
31
31
  /** Input for custom header component */
32
32
  headerComponent: ComponentType<any>;
33
+ /** Input for action buttons. */
34
+ actionsPortal: TemplatePortal | null;
33
35
  /** Emits when the currently selected date changes. */
34
36
  selectedChange: EventEmitter<D>;
35
37
  /** Emits when the view has been changed. */
@@ -146,7 +148,7 @@ export declare class MtxCalendar<D> implements AfterContentInit, OnDestroy {
146
148
  private calendarState;
147
149
  private _2digit;
148
150
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxCalendar<any>, [null, null, null, { optional: true; }, { optional: true; }, null]>;
149
- static ɵcmp: i0.ɵɵComponentDeclaration<MtxCalendar<any>, "mtx-calendar", ["mtxCalendar"], { "multiYearSelector": { "alias": "multiYearSelector"; "required": false; }; "twelvehour": { "alias": "twelvehour"; "required": false; }; "startView": { "alias": "startView"; "required": false; }; "timeInterval": { "alias": "timeInterval"; "required": false; }; "dateFilter": { "alias": "dateFilter"; "required": false; }; "preventSameDateTimeSelection": { "alias": "preventSameDateTimeSelection"; "required": false; }; "headerComponent": { "alias": "headerComponent"; "required": false; }; "type": { "alias": "type"; "required": false; }; "startAt": { "alias": "startAt"; "required": false; }; "timeInput": { "alias": "timeInput"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; }, { "selectedChange": "selectedChange"; "viewChanged": "viewChanged"; "_userSelection": "_userSelection"; }, never, never, true, never>;
151
+ static ɵcmp: i0.ɵɵComponentDeclaration<MtxCalendar<any>, "mtx-calendar", ["mtxCalendar"], { "multiYearSelector": { "alias": "multiYearSelector"; "required": false; }; "twelvehour": { "alias": "twelvehour"; "required": false; }; "startView": { "alias": "startView"; "required": false; }; "timeInterval": { "alias": "timeInterval"; "required": false; }; "dateFilter": { "alias": "dateFilter"; "required": false; }; "preventSameDateTimeSelection": { "alias": "preventSameDateTimeSelection"; "required": false; }; "headerComponent": { "alias": "headerComponent"; "required": false; }; "actionsPortal": { "alias": "actionsPortal"; "required": false; }; "type": { "alias": "type"; "required": false; }; "startAt": { "alias": "startAt"; "required": false; }; "timeInput": { "alias": "timeInput"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; }, { "selectedChange": "selectedChange"; "viewChanged": "viewChanged"; "_userSelection": "_userSelection"; }, never, never, true, never>;
150
152
  static ngAcceptInputType_multiYearSelector: unknown;
151
153
  static ngAcceptInputType_twelvehour: unknown;
152
154
  static ngAcceptInputType_timeInput: unknown;
@@ -86,6 +86,42 @@ $_tokens: tokens-mtx-datetimepicker.$prefix, tokens-mtx-datetimepicker.get-token
86
86
  }
87
87
  }
88
88
  }
89
+
90
+ .mtx-datetimepicker-content-container-with-actions .mtx-calendar .mtx-calendar-header {
91
+ border-bottom-left-radius: 0;
92
+ border-bottom-right-radius: 0;
93
+ }
94
+ }
95
+
96
+ @mixin landscape-actions-placeholder {
97
+ .mtx-datetimepicker-actions::before {
98
+ position: absolute;
99
+ top: 0;
100
+ left: 0;
101
+ box-sizing: border-box;
102
+ width: $landscape-calendar-header-width;
103
+ height: 100%;
104
+ content: '';
105
+
106
+ @include token-utils.use-tokens($_tokens...) {
107
+ $border-color: token-utils.get-token-variable(calendar-header-divider-color);
108
+
109
+ border-right: 1px solid var($border-color);
110
+
111
+ @include token-utils.create-token-slot(background-color, calendar-header-background-color);
112
+ @include token-utils.create-token-slot(border-bottom-left-radius, container-shape);
113
+
114
+ [dir='rtl'] & {
115
+ left: auto;
116
+ right: 0;
117
+ border-right-width: 0;
118
+ border-left: 1px solid var($border-color);
119
+ border-bottom-left-radius: 0;
120
+
121
+ @include token-utils.create-token-slot(border-bottom-right-radius, container-shape);
122
+ }
123
+ }
124
+ }
89
125
  }
90
126
 
91
127
  .mtx-calendar {
@@ -190,11 +226,13 @@ $_tokens: tokens-mtx-datetimepicker.$prefix, tokens-mtx-datetimepicker.get-token
190
226
 
191
227
  [mode='landscape'] {
192
228
  @include landscape-calendar-header;
229
+ @include landscape-actions-placeholder;
193
230
  }
194
231
 
195
232
  @media all and (orientation: landscape) {
196
233
  [mode='auto'] {
197
234
  @include landscape-calendar-header;
235
+ @include landscape-actions-placeholder;
198
236
  }
199
237
  }
200
238
 
@@ -0,0 +1,32 @@
1
+ import { AfterViewInit, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { MtxDatetimepicker } from './datetimepicker';
3
+ import * as i0 from "@angular/core";
4
+ export declare class MtxDatetimepickerApply<D> {
5
+ _datetimepicker: MtxDatetimepicker<D>;
6
+ constructor(_datetimepicker: MtxDatetimepicker<D>);
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<MtxDatetimepickerApply<any>, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MtxDatetimepickerApply<any>, "[mtxDatetimepickerApply]", never, {}, {}, never, never, true, never>;
9
+ }
10
+ export declare class MtxDatetimepickerCancel<D> {
11
+ _datetimepicker: MtxDatetimepicker<D>;
12
+ constructor(_datetimepicker: MtxDatetimepicker<D>);
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<MtxDatetimepickerCancel<any>, never>;
14
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MtxDatetimepickerCancel<any>, "[mtxDatetimepickerCancel]", never, {}, {}, never, never, true, never>;
15
+ }
16
+ export declare class MtxDatetimepickerClear<D> {
17
+ _datetimepicker: MtxDatetimepicker<D>;
18
+ constructor(_datetimepicker: MtxDatetimepicker<D>);
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<MtxDatetimepickerClear<any>, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MtxDatetimepickerClear<any>, "[mtxDatetimepickerClear]", never, {}, {}, never, never, true, never>;
21
+ }
22
+ export declare class MtxDatetimepickerActions<D> implements AfterViewInit, OnDestroy {
23
+ private _datetimepicker;
24
+ private _viewContainerRef;
25
+ _template: TemplateRef<unknown>;
26
+ private _portal;
27
+ constructor(_datetimepicker: MtxDatetimepicker<D>, _viewContainerRef: ViewContainerRef);
28
+ ngAfterViewInit(): void;
29
+ ngOnDestroy(): void;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<MtxDatetimepickerActions<any>, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<MtxDatetimepickerActions<any>, "mtx-datetimepicker-actions", never, {}, {}, never, ["*"], true, never>;
32
+ }
@@ -0,0 +1,18 @@
1
+ .mtx-datetimepicker-actions {
2
+ $spacing: 8px;
3
+
4
+ position: relative;
5
+ display: flex;
6
+ justify-content: flex-end;
7
+ align-items: center;
8
+ padding: 0 $spacing $spacing;
9
+
10
+ .mat-mdc-button-base+.mat-mdc-button-base {
11
+ margin-left: $spacing;
12
+
13
+ [dir='rtl'] & {
14
+ margin-left: 0;
15
+ margin-right: $spacing;
16
+ }
17
+ }
18
+ }
@@ -1,6 +1,6 @@
1
1
  import { AnimationTriggerMetadata } from '@angular/animations';
2
2
  /**
3
- * Animations used by the Material datepicker.
3
+ * Animations used by the Material datetimepicker.
4
4
  * @docs-private
5
5
  */
6
6
  export declare const mtxDatetimepickerAnimations: {
@@ -8,8 +8,10 @@ $non-touch-calendar-portrait-width: $non-touch-calendar-cell-size * 7 + $calenda
8
8
  $non-touch-calendar-portrait-height: 424px;
9
9
  $non-touch-calendar-landscape-width: 432px;
10
10
  $non-touch-calendar-landscape-height: 328px;
11
- $non-touch-calendar-with-time-input-portrait-height: 490px;
12
- $non-touch-calendar-with-time-input-landscape-height: 404px;
11
+ $non-touch-calendar-with-time-input-portrait-height: 442px;
12
+ $non-touch-calendar-with-time-input-actions-portrait-height: 490px;
13
+ $non-touch-calendar-with-time-input-landscape-height: 356px;
14
+ $non-touch-calendar-with-time-input-actions-landscape-height: 404px;
13
15
 
14
16
  // Ideally the calendar would have a constant aspect ratio, no matter its size, and we would base
15
17
  // these measurements off the aspect ratio. Unfortunately, the aspect ratio does change a little as
@@ -21,10 +23,10 @@ $touch-landscape-mode-landscape-height: 80vh;
21
23
  $touch-landscape-mode-portrait-width: 90vw;
22
24
  $touch-landscape-mode-portrait-height: 64vw;
23
25
  $touch-portrait-mode-landscape-width: 64vh;
24
- $touch-portrait-mode-landscape-height: 90vh;
26
+ $touch-portrait-mode-landscape-height: 80vh;
25
27
  $touch-portrait-mode-portrait-width: 80vw;
26
28
  $touch-portrait-mode-portrait-height: 120vw;
27
- $touch-portrait-mode-portrait-height-with-actions: 135vw;
29
+ $touch-portrait-mode-portrait-height-with-actions: 124vw;
28
30
  $touch-min-width: 250px;
29
31
  $touch-min-height: 300px;
30
32
  $touch-max-width: 750px;
@@ -36,9 +38,13 @@ $touch-max-height: 850px;
36
38
  height: $non-touch-calendar-landscape-height;
37
39
 
38
40
  &.mtx-calendar-with-time-input {
39
- height: $non-touch-calendar-with-time-input-landscape-height;
41
+ height: $non-touch-calendar-with-time-input-actions-landscape-height;
40
42
  }
41
43
  }
44
+
45
+ .mtx-datetimepicker-content-container-with-actions .mtx-calendar.mtx-calendar-with-time-input {
46
+ height: $non-touch-calendar-with-time-input-landscape-height;
47
+ }
42
48
  }
43
49
 
44
50
  .mtx-datetimepicker-content {
@@ -51,6 +57,19 @@ $touch-max-height: 850px;
51
57
  @include token-utils.create-token-slot(box-shadow, container-elevation-shadow);
52
58
  @include token-utils.create-token-slot(color, container-text-color);
53
59
  }
60
+
61
+ .mtx-calendar {
62
+ width: $non-touch-calendar-portrait-width;
63
+ height: $non-touch-calendar-portrait-height;
64
+
65
+ &.mtx-calendar-with-time-input {
66
+ height: $non-touch-calendar-with-time-input-actions-portrait-height;
67
+ }
68
+ }
69
+
70
+ .mtx-datetimepicker-content-container-with-actions .mtx-calendar.mtx-calendar-with-time-input {
71
+ height: $non-touch-calendar-with-time-input-portrait-height;
72
+ }
54
73
  }
55
74
 
56
75
  .mtx-datetimepicker-content-container {
@@ -61,15 +80,6 @@ $touch-max-height: 850px;
61
80
  justify-content: space-between;
62
81
  }
63
82
 
64
- .mtx-datetimepicker-content .mtx-calendar {
65
- width: $non-touch-calendar-portrait-width;
66
- height: $non-touch-calendar-portrait-height;
67
-
68
- &.mtx-calendar-with-time-input {
69
- height: $non-touch-calendar-with-time-input-portrait-height;
70
- }
71
- }
72
-
73
83
  .mtx-datetimepicker-content[mode='landscape'] {
74
84
  @include landscape-calendar-size;
75
85
  }
@@ -82,7 +92,7 @@ $touch-max-height: 850px;
82
92
 
83
93
  .mtx-datetimepicker-content-touch {
84
94
  display: block;
85
- max-height: 80vh;
95
+ max-height: 84vh;
86
96
 
87
97
  @include token-utils.use-tokens(tokens-mtx-datetimepicker.$prefix,
88
98
  tokens-mtx-datetimepicker.get-token-slots()) {
@@ -107,6 +117,12 @@ $touch-max-height: 850px;
107
117
  width: 100%;
108
118
  height: auto;
109
119
  }
120
+
121
+ .mtx-clock {
122
+ width: 50vh;
123
+ max-width: 80%;
124
+ margin: 12px auto;
125
+ }
110
126
  }
111
127
 
112
128
  @media all and (orientation: landscape) {
@@ -116,7 +132,8 @@ $touch-max-height: 850px;
116
132
  width: $touch-landscape-mode-landscape-width;
117
133
  height: $touch-landscape-mode-landscape-height;
118
134
 
119
- .mtx-calendar {
135
+ .mtx-calendar,
136
+ &.mtx-datetimepicker-content-container-with-actions .mtx-calendar.mtx-calendar-with-time-input {
120
137
  width: auto;
121
138
  height: 100%;
122
139
  }
@@ -145,6 +162,13 @@ $touch-max-height: 850px;
145
162
  width: 100%;
146
163
  height: auto;
147
164
  }
165
+
166
+ // The content needs to be a bit taller when actions have
167
+ // been projected so that it doesn't have to scroll.
168
+ &.mtx-datetimepicker-content-container-with-actions,
169
+ &.mtx-datetimepicker-content-container-with-time-input {
170
+ height: $touch-portrait-mode-portrait-height-with-actions;
171
+ }
148
172
  }
149
173
 
150
174
  .mtx-datetimepicker-content-container[mode='landscape'] {
@@ -156,11 +180,5 @@ $touch-max-height: 850px;
156
180
  height: 100%;
157
181
  }
158
182
  }
159
-
160
- // The content needs to be a bit taller when actions have
161
- // been projected so that it doesn't have to scroll.
162
- .mtx-datetimepicker-content-container-with-actions {
163
- height: $touch-portrait-mode-portrait-height-with-actions;
164
- }
165
183
  }
166
184
  }
@@ -14,8 +14,9 @@ import * as i12 from "./datetimepicker-input";
14
14
  import * as i13 from "./month-view";
15
15
  import * as i14 from "./year-view";
16
16
  import * as i15 from "./multi-year-view";
17
+ import * as i16 from "./datetimepicker-actions";
17
18
  export declare class MtxDatetimepickerModule {
18
19
  static ɵfac: i0.ɵɵFactoryDeclaration<MtxDatetimepickerModule, never>;
19
- static ɵmod: i0.ɵɵNgModuleDeclaration<MtxDatetimepickerModule, never, [typeof i1.CommonModule, typeof i2.OverlayModule, typeof i3.A11yModule, typeof i4.PortalModule, typeof i5.MatButtonModule, typeof i6.MtxCalendar, typeof i7.MtxCalendarBody, typeof i8.MtxClock, typeof i9.MtxTime, typeof i9.MtxTimeInput, typeof i10.MtxDatetimepicker, typeof i11.MtxDatetimepickerToggle, typeof i11.MtxDatetimepickerToggleIcon, typeof i12.MtxDatetimepickerInput, typeof i10.MtxDatetimepickerContent, typeof i13.MtxMonthView, typeof i14.MtxYearView, typeof i15.MtxMultiYearView], [typeof i6.MtxCalendar, typeof i7.MtxCalendarBody, typeof i8.MtxClock, typeof i9.MtxTime, typeof i10.MtxDatetimepicker, typeof i11.MtxDatetimepickerToggle, typeof i11.MtxDatetimepickerToggleIcon, typeof i12.MtxDatetimepickerInput, typeof i10.MtxDatetimepickerContent, typeof i13.MtxMonthView, typeof i14.MtxYearView, typeof i15.MtxMultiYearView]>;
20
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MtxDatetimepickerModule, never, [typeof i1.CommonModule, typeof i2.OverlayModule, typeof i3.A11yModule, typeof i4.PortalModule, typeof i5.MatButtonModule, typeof i6.MtxCalendar, typeof i7.MtxCalendarBody, typeof i8.MtxClock, typeof i9.MtxTime, typeof i9.MtxTimeInput, typeof i10.MtxDatetimepicker, typeof i11.MtxDatetimepickerToggle, typeof i11.MtxDatetimepickerToggleIcon, typeof i12.MtxDatetimepickerInput, typeof i10.MtxDatetimepickerContent, typeof i13.MtxMonthView, typeof i14.MtxYearView, typeof i15.MtxMultiYearView, typeof i16.MtxDatetimepickerApply, typeof i16.MtxDatetimepickerCancel, typeof i16.MtxDatetimepickerClear, typeof i16.MtxDatetimepickerActions], [typeof i6.MtxCalendar, typeof i7.MtxCalendarBody, typeof i8.MtxClock, typeof i9.MtxTime, typeof i10.MtxDatetimepicker, typeof i11.MtxDatetimepickerToggle, typeof i11.MtxDatetimepickerToggleIcon, typeof i12.MtxDatetimepickerInput, typeof i10.MtxDatetimepickerContent, typeof i13.MtxMonthView, typeof i14.MtxYearView, typeof i15.MtxMultiYearView, typeof i16.MtxDatetimepickerApply, typeof i16.MtxDatetimepickerCancel, typeof i16.MtxDatetimepickerClear, typeof i16.MtxDatetimepickerActions]>;
20
21
  static ɵinj: i0.ɵɵInjectorDeclaration<MtxDatetimepickerModule>;
21
22
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  $_tokens: tokens-mtx-datetimepicker.$prefix, tokens-mtx-datetimepicker.get-token-slots();
6
6
 
7
- // We support the case where the form field is disabled, but the datepicker is not.
7
+ // We support the case where the form field is disabled, but the datetimepicker is not.
8
8
  // MDC sets `pointer-events: none` on disabled form fields which prevents clicks on the toggle.
9
9
  .mtx-datetimepicker-toggle {
10
10
  pointer-events: auto;