@angular/material-experimental 16.1.0-next.1 → 16.1.0-rc.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 (39) hide show
  1. package/_index.scss +3 -0
  2. package/column-resize/index.d.ts +7 -7
  3. package/esm2022/column-resize/column-resize-directives/column-resize-flex.mjs +5 -6
  4. package/esm2022/column-resize/column-resize-directives/column-resize.mjs +5 -6
  5. package/esm2022/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +5 -6
  6. package/esm2022/column-resize/column-resize-directives/default-enabled-column-resize.mjs +5 -6
  7. package/esm2022/column-resize/column-resize-module.mjs +16 -19
  8. package/esm2022/column-resize/overlay-handle.mjs +5 -6
  9. package/esm2022/column-resize/resizable-directives/default-enabled-resizable.mjs +5 -6
  10. package/esm2022/column-resize/resizable-directives/resizable.mjs +5 -6
  11. package/esm2022/column-resize/resize-strategy.mjs +5 -6
  12. package/esm2022/menubar/menubar-item.mjs +5 -6
  13. package/esm2022/menubar/menubar-module.mjs +6 -7
  14. package/esm2022/menubar/menubar.mjs +5 -6
  15. package/esm2022/popover-edit/lens-directives.mjs +13 -16
  16. package/esm2022/popover-edit/popover-edit-module.mjs +6 -7
  17. package/esm2022/popover-edit/table-directives.mjs +17 -21
  18. package/esm2022/selection/row-selection.mjs +5 -6
  19. package/esm2022/selection/select-all.mjs +5 -6
  20. package/esm2022/selection/selection-column.mjs +5 -6
  21. package/esm2022/selection/selection-module.mjs +6 -7
  22. package/esm2022/selection/selection-toggle.mjs +5 -6
  23. package/esm2022/selection/selection.mjs +6 -6
  24. package/esm2022/version.mjs +1 -1
  25. package/fesm2022/column-resize.mjs +36 -36
  26. package/fesm2022/column-resize.mjs.map +1 -1
  27. package/fesm2022/material-experimental.mjs +1 -1
  28. package/fesm2022/material-experimental.mjs.map +1 -1
  29. package/fesm2022/menubar.mjs +10 -10
  30. package/fesm2022/menubar.mjs.map +1 -1
  31. package/fesm2022/popover-edit.mjs +25 -25
  32. package/fesm2022/popover-edit.mjs.map +1 -1
  33. package/fesm2022/selection.mjs +20 -19
  34. package/fesm2022/selection.mjs.map +1 -1
  35. package/menubar/index.d.ts +2 -2
  36. package/package.json +50 -50
  37. package/popover-edit/index.d.ts +7 -7
  38. package/selection/index.d.ts +5 -5
  39. package/theming/_theming.scss +134 -0
@@ -29,7 +29,7 @@ declare namespace i2 {
29
29
  /** Closes the lens on click. */
30
30
  export declare class MatEditClose<FormValue> extends CdkEditClose<FormValue> {
31
31
  static ɵfac: i0.ɵɵFactoryDeclaration<MatEditClose<any>, never>;
32
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatEditClose<any>, "[matEditClose]", never, {}, {}, never, never, false, never>;
32
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatEditClose<any>, "[matEditClose]", never, {}, {}, never, never, false, never, false>;
33
33
  }
34
34
 
35
35
  /**
@@ -40,7 +40,7 @@ export declare class MatEditClose<FormValue> extends CdkEditClose<FormValue> {
40
40
  */
41
41
  export declare class MatEditLens<FormValue> extends CdkEditControl<FormValue> {
42
42
  static ɵfac: i0.ɵɵFactoryDeclaration<MatEditLens<any>, never>;
43
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatEditLens<any>, "form[matEditLens]", never, { "clickOutBehavior": { "alias": "matEditLensClickOutBehavior"; "required": false; }; "preservedFormValue": { "alias": "matEditLensPreservedFormValue"; "required": false; }; "ignoreSubmitUnlessValid": { "alias": "matEditLensIgnoreSubmitUnlessValid"; "required": false; }; }, { "preservedFormValueChange": "matEditLensPreservedFormValueChange"; }, never, never, false, never>;
43
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatEditLens<any>, "form[matEditLens]", never, { "clickOutBehavior": { "alias": "matEditLensClickOutBehavior"; "required": false; }; "preservedFormValue": { "alias": "matEditLensPreservedFormValue"; "required": false; }; "ignoreSubmitUnlessValid": { "alias": "matEditLensIgnoreSubmitUnlessValid"; "required": false; }; }, { "preservedFormValueChange": "matEditLensPreservedFormValueChange"; }, never, never, false, never, false>;
44
44
  }
45
45
 
46
46
  /**
@@ -49,13 +49,13 @@ export declare class MatEditLens<FormValue> extends CdkEditControl<FormValue> {
49
49
  */
50
50
  export declare class MatEditOpen extends CdkEditOpen {
51
51
  static ɵfac: i0.ɵɵFactoryDeclaration<MatEditOpen, never>;
52
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatEditOpen, "[matEditOpen]", never, {}, {}, never, never, false, never>;
52
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatEditOpen, "[matEditOpen]", never, {}, {}, never, never, false, never, false>;
53
53
  }
54
54
 
55
55
  /** Reverts the form to its initial or previously submitted state on click. */
56
56
  export declare class MatEditRevert<FormValue> extends CdkEditRevert<FormValue> {
57
57
  static ɵfac: i0.ɵɵFactoryDeclaration<MatEditRevert<any>, never>;
58
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatEditRevert<any>, "button[matEditRevert]", never, {}, {}, never, never, false, never>;
58
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatEditRevert<any>, "button[matEditRevert]", never, {}, {}, never, never, false, never, false>;
59
59
  }
60
60
 
61
61
  /**
@@ -66,7 +66,7 @@ export declare class MatEditRevert<FormValue> extends CdkEditRevert<FormValue> {
66
66
  export declare class MatPopoverEdit<C> extends CdkPopoverEdit<C> {
67
67
  protected panelClass(): string;
68
68
  static ɵfac: i0.ɵɵFactoryDeclaration<MatPopoverEdit<any>, never>;
69
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatPopoverEdit<any>, "[matPopoverEdit]:not([matPopoverEditTabOut])", never, { "template": { "alias": "matPopoverEdit"; "required": false; }; "context": { "alias": "matPopoverEditContext"; "required": false; }; "colspan": { "alias": "matPopoverEditColspan"; "required": false; }; "disabled": { "alias": "matPopoverEditDisabled"; "required": false; }; }, {}, never, never, false, never>;
69
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatPopoverEdit<any>, "[matPopoverEdit]:not([matPopoverEditTabOut])", never, { "template": { "alias": "matPopoverEdit"; "required": false; }; "context": { "alias": "matPopoverEditContext"; "required": false; }; "colspan": { "alias": "matPopoverEditColspan"; "required": false; }; "disabled": { "alias": "matPopoverEditDisabled"; "required": false; }; }, {}, never, never, false, never, false>;
70
70
  }
71
71
 
72
72
  export declare class MatPopoverEditModule {
@@ -83,7 +83,7 @@ export declare class MatPopoverEditModule {
83
83
  export declare class MatPopoverEditTabOut<C> extends CdkPopoverEditTabOut<C> {
84
84
  protected panelClass(): string;
85
85
  static ɵfac: i0.ɵɵFactoryDeclaration<MatPopoverEditTabOut<any>, never>;
86
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatPopoverEditTabOut<any>, "[matPopoverEdit][matPopoverEditTabOut]", never, { "template": { "alias": "matPopoverEdit"; "required": false; }; "context": { "alias": "matPopoverEditContext"; "required": false; }; "colspan": { "alias": "matPopoverEditColspan"; "required": false; }; "disabled": { "alias": "matPopoverEditDisabled"; "required": false; }; }, {}, never, never, false, never>;
86
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatPopoverEditTabOut<any>, "[matPopoverEdit][matPopoverEditTabOut]", never, { "template": { "alias": "matPopoverEdit"; "required": false; }; "context": { "alias": "matPopoverEditContext"; "required": false; }; "colspan": { "alias": "matPopoverEditColspan"; "required": false; }; "disabled": { "alias": "matPopoverEditDisabled"; "required": false; }; }, {}, never, never, false, never, false>;
87
87
  }
88
88
 
89
89
  /**
@@ -95,7 +95,7 @@ export declare class MatRowHoverContent extends CdkRowHoverContent {
95
95
  protected makeElementHiddenButFocusable(element: HTMLElement): void;
96
96
  protected makeElementVisible(element: HTMLElement): void;
97
97
  static ɵfac: i0.ɵɵFactoryDeclaration<MatRowHoverContent, never>;
98
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatRowHoverContent, "[matRowHoverContent]", never, {}, {}, never, never, false, never>;
98
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatRowHoverContent, "[matRowHoverContent]", never, {}, {}, never, never, false, never, false>;
99
99
  }
100
100
 
101
101
  export { }
@@ -54,7 +54,7 @@ export declare class MatRowSelection<T> extends CdkRowSelection<T> {
54
54
  /** The value that is associated with the row */
55
55
  value: T;
56
56
  static ɵfac: i0.ɵɵFactoryDeclaration<MatRowSelection<any>, never>;
57
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatRowSelection<any>, "[matRowSelection]", never, { "index": { "alias": "matRowSelectionIndex"; "required": false; }; "value": { "alias": "matRowSelectionValue"; "required": false; }; }, {}, never, never, false, never>;
57
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatRowSelection<any>, "[matRowSelection]", never, { "index": { "alias": "matRowSelectionIndex"; "required": false; }; "value": { "alias": "matRowSelectionValue"; "required": false; }; }, {}, never, never, false, never, false>;
58
58
  }
59
59
 
60
60
  /**
@@ -69,7 +69,7 @@ export declare class MatRowSelection<T> extends CdkRowSelection<T> {
69
69
  */
70
70
  export declare class MatSelectAll<T> extends CdkSelectAll<T> {
71
71
  static ɵfac: i0.ɵɵFactoryDeclaration<MatSelectAll<any>, never>;
72
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatSelectAll<any>, "[matSelectAll]", ["matSelectAll"], {}, {}, never, never, false, never>;
72
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatSelectAll<any>, "[matSelectAll]", ["matSelectAll"], {}, {}, never, never, false, never, false>;
73
73
  }
74
74
 
75
75
  /**
@@ -85,7 +85,7 @@ export declare class MatSelection<T> extends CdkSelection<T> {
85
85
  /** Emits when selection changes. */
86
86
  readonly change: EventEmitter<SelectionChange<T>>;
87
87
  static ɵfac: i0.ɵɵFactoryDeclaration<MatSelection<any>, never>;
88
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatSelection<any>, "[matSelection]", ["matSelection"], { "multiple": { "alias": "matSelectionMultiple"; "required": false; }; }, { "change": "matSelectionChange"; }, never, never, false, never>;
88
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatSelection<any>, "[matSelection]", ["matSelection"], { "multiple": { "alias": "matSelectionMultiple"; "required": false; }; }, { "change": "matSelectionChange"; }, never, never, false, never, false>;
89
89
  }
90
90
 
91
91
  /**
@@ -109,7 +109,7 @@ export declare class MatSelectionColumn<T> implements OnInit, OnDestroy {
109
109
  ngOnDestroy(): void;
110
110
  private _syncColumnDefName;
111
111
  static ɵfac: i0.ɵɵFactoryDeclaration<MatSelectionColumn<any>, [{ optional: true; }, { optional: true; }]>;
112
- static ɵcmp: i0.ɵɵComponentDeclaration<MatSelectionColumn<any>, "mat-selection-column", never, { "name": { "alias": "name"; "required": false; }; }, {}, never, never, false, never>;
112
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatSelectionColumn<any>, "mat-selection-column", never, { "name": { "alias": "name"; "required": false; }; }, {}, never, never, false, never, false>;
113
113
  }
114
114
 
115
115
  export declare class MatSelectionModule {
@@ -132,7 +132,7 @@ export declare class MatSelectionToggle<T> extends CdkSelectionToggle<T> {
132
132
  /** The value that is associated with the toggle */
133
133
  value: T;
134
134
  static ɵfac: i0.ɵɵFactoryDeclaration<MatSelectionToggle<any>, never>;
135
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatSelectionToggle<any>, "[matSelectionToggle]", ["matSelectionToggle"], { "index": { "alias": "matSelectionToggleIndex"; "required": false; }; "value": { "alias": "matSelectionToggleValue"; "required": false; }; }, {}, never, never, false, never>;
135
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatSelectionToggle<any>, "[matSelectionToggle]", ["matSelectionToggle"], { "index": { "alias": "matSelectionToggleIndex"; "required": false; }; "value": { "alias": "matSelectionToggleValue"; "required": false; }; }, {}, never, never, false, never, false>;
136
136
  }
137
137
 
138
138
  export { SelectionChange }
@@ -0,0 +1,134 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
3
+ @use 'sass:meta';
4
+ @use '@angular/material' as mat;
5
+
6
+ /// Whether to throw an error when a required dep is not configured. If false, the dep will be
7
+ /// automatically configured instead.
8
+ $_error-on-missing-dep: false;
9
+
10
+ /// Applies the theme for the given component configuration.
11
+ /// @param {Map} $tokens A map containing the default values to use for tokens not explicitly
12
+ /// customized in the component config object.
13
+ /// @param {List} $component The component config object to emit theme tokens for.
14
+ /// @output CSS variables representing the theme tokens for this component.
15
+ @mixin _apply-theme($tokens, $component) {
16
+ $id: map.get($component, id);
17
+ $tokens: map.deep-merge($tokens, map.get($component, customizations));
18
+
19
+ // NOTE: for now we use a hardcoded if-chain, but in the future when first-class mixins are
20
+ // supported, the configuration data will contain a reference to its own theme mixin.
21
+ @if $id == 'mat.card' {
22
+ @include mat.private-apply-card-theme-from-tokens($tokens);
23
+ }
24
+ @else if $id == 'mat.checkbox' {
25
+ @include mat.private-apply-checkbox-theme-from-tokens($tokens);
26
+ }
27
+ @else {
28
+ @error 'Unrecognized component theme: #{id}';
29
+ }
30
+ }
31
+
32
+ /// Gets the transitive closure of the given list of component configuration dependencies.
33
+ /// @param {List} $components The list of component config objects to get the transitive deps for.
34
+ /// @param {Map} $configured [()] A map of already configured component IDs. Used for recursion,
35
+ /// should not be passed when calling.
36
+ /// @return {List} The transitive closure of configs for the given $components.
37
+ // TODO(mmalerba): Currently we use the deps to determine if additional tokens, other than the
38
+ // explicitly requested ones need to be emitted, but the deps do not affect the ordering in which
39
+ // the various configs are processed. Before moving out of experimental we should think more about
40
+ // the ordering behavior we want. For the most part the order shouldn't matter, unless we have 2
41
+ // configs trying to set the same token.
42
+ @function _get-transitive-deps($components, $configured: ()) {
43
+ // Mark the given components as configured.
44
+ @each $component in $components {
45
+ $configured: map.set($configured, map.get($component, id), true);
46
+ }
47
+ $new-deps: ();
48
+
49
+ // Check each of the given components for new deps.
50
+ @each $component in $components {
51
+ // Note: Deps are specified as getter functions that return a config object rather than a direct
52
+ // config object. This allows us to only call the getter if the dep has not yet been configured.
53
+ // This can be useful if we have 2 components that want to require each other to be configured.
54
+ // Example: form-field and input. If we used direct config objects in this case, it would cause
55
+ // infinite co-recursion.
56
+ @each $dep-getter in mat.private-coerce-to-list(map.get($component, deps)) {
57
+ $dep: meta.call($dep-getter);
58
+ $dep-id: map.get($dep, id);
59
+ @if not (map.has-key($configured, $dep-id)) {
60
+ @if $_error-on-missing-dep {
61
+ @error 'Missing theme: `#{map.get($component, id)}` depends on `#{$dep-id}`.' +
62
+ ' Please configure the theme for `#{$dep-id}` in your call to `mat.theme`';
63
+ }
64
+ @else {
65
+ $configured: map.set($configured, $dep-id, true);
66
+ $new-deps: list.append($new-deps, $dep);
67
+ }
68
+ }
69
+ }
70
+ }
71
+
72
+ // Append on the new deps to this list of component configurations and return.
73
+ @if list.length($new-deps) > 0 {
74
+ $components: list.join($components, _get-transitive-deps($new-deps, $configured));
75
+ }
76
+ @return $components;
77
+ }
78
+
79
+ /// Apply the themes for the given component configs with the given ste of fallback token values.
80
+ /// @param {Map} $tokens A map of fallback values to use for tokens that are not explicitly
81
+ /// customized by one of the component configs.
82
+ /// @param {List} $components The list of component configurations to emit tokens for.
83
+ /// @output CSS variables representing the theme tokens for the given component configs.
84
+ @mixin _theme($tokens, $components) {
85
+ // Call the theme mixin for each configured component.
86
+ @each $component in $components {
87
+ @include _apply-theme($tokens, $component);
88
+ }
89
+ }
90
+
91
+ /// Takes the full list of tokens and a list of components to configure, and outputs all theme
92
+ /// tokens for the configured components.
93
+ /// @param {Map} $tokens A map of all tokens for the current design system.
94
+ /// @param {List} $components The list of component configurations to emit tokens for.
95
+ /// @output CSS variables representing the theme tokens for the given component configs.
96
+ // TODO(mmalerba): Consider an alternate API where `$tokens` is not a separate argument,
97
+ // but one of the configs in the `$components` list
98
+ @mixin theme($tokens, $components) {
99
+ @include _theme($tokens, _get-transitive-deps(mat.private-coerce-to-list($components)));
100
+ }
101
+
102
+ /// Takes a list of components to configure, and outputs only the theme tokens that are explicitly
103
+ /// customized by the configurations.
104
+ /// @param {List} $components The list of component configurations to emit tokens for.
105
+ /// @output CSS variables representing the theme tokens for the given component configs.
106
+ // TODO(mmalerba): What should we call this?
107
+ // - update-theme
108
+ // - adjust-theme
109
+ // - edit-theme
110
+ // - override-theme
111
+ // - retheme
112
+ @mixin retheme($components) {
113
+ @include _theme((), $components);
114
+ }
115
+
116
+ /// Configure the mat-card's theme.
117
+ /// @param {Map} $customizations [()] A map of custom token values to use when theming mat-card.
118
+ @function card($customizations: ()) {
119
+ @return (
120
+ id: 'mat.card',
121
+ customizations: $customizations,
122
+ deps: (),
123
+ );
124
+ }
125
+
126
+ /// Configure the mat-checkbox's theme.
127
+ /// @param {Map} $customizations [()] A map of custom token values to use when theming mat-checkbox.
128
+ @function checkbox($customizations: ()) {
129
+ @return (
130
+ id: 'mat.checkbox',
131
+ customizations: $customizations,
132
+ deps: (),
133
+ );
134
+ }