@ng-matero/extensions 16.3.0 → 16.3.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.
- package/core/density/_all-density.scss +22 -0
- package/core/density/_compatibility.scss +74 -0
- package/core/theming/_theming.scss +55 -21
- package/core/tokens/m2/mtx/_grid.scss +12 -1
- package/core/tokens/m2/mtx/_split.scss +1 -1
- package/esm2022/grid/column-menu.mjs +2 -2
- package/esm2022/grid/grid.mjs +3 -3
- package/esm2022/popover/popover.mjs +3 -3
- package/esm2022/select/select.mjs +3 -3
- package/fesm2022/mtxGrid.mjs +4 -4
- package/fesm2022/mtxGrid.mjs.map +1 -1
- package/fesm2022/mtxPopover.mjs +2 -2
- package/fesm2022/mtxPopover.mjs.map +1 -1
- package/fesm2022/mtxSelect.mjs +2 -2
- package/fesm2022/mtxSelect.mjs.map +1 -1
- package/grid/_grid-theme.scss +8 -1
- package/grid/column-menu.scss +32 -3
- package/grid/grid.scss +28 -107
- package/package.json +24 -24
- package/popover/popover.scss +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/select/select.scss +55 -79
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
@use '../theming/theming';
|
|
2
|
+
@use '../../alert/alert-theme';
|
|
3
|
+
@use '../../button/button-theme';
|
|
4
|
+
@use '../../colorpicker/colorpicker-theme';
|
|
5
|
+
@use '../../datetimepicker/datetimepicker-theme';
|
|
6
|
+
@use '../../drawer/drawer-theme';
|
|
7
|
+
@use '../../grid/grid-theme';
|
|
8
|
+
@use '../../loader/loader-theme';
|
|
9
|
+
@use '../../popover/popover-theme';
|
|
10
|
+
@use '../../progress/progress-theme';
|
|
2
11
|
@use '../../select/select-theme';
|
|
12
|
+
@use '../../split/split-theme';
|
|
13
|
+
@use '../../tooltip/tooltip-theme';
|
|
3
14
|
|
|
4
15
|
// Includes all of the density styles.
|
|
5
16
|
@mixin all-component-densities($config-or-theme) {
|
|
@@ -15,7 +26,18 @@
|
|
|
15
26
|
@error 'No density configuration specified.';
|
|
16
27
|
}
|
|
17
28
|
|
|
29
|
+
@include alert-theme.density($config);
|
|
30
|
+
@include button-theme.density($config);
|
|
31
|
+
@include colorpicker-theme.density($config);
|
|
32
|
+
@include datetimepicker-theme.density($config);
|
|
33
|
+
@include drawer-theme.density($config);
|
|
34
|
+
@include grid-theme.density($config);
|
|
35
|
+
@include loader-theme.density($config);
|
|
36
|
+
@include popover-theme.density($config);
|
|
37
|
+
@include progress-theme.density($config);
|
|
18
38
|
@include select-theme.density($config);
|
|
39
|
+
@include split-theme.density($config);
|
|
40
|
+
@include tooltip-theme.density($config);
|
|
19
41
|
}
|
|
20
42
|
|
|
21
43
|
// @deprecated Use `all-component-densities`.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
// Note that this file is called `private`, because the APIs in it aren't public yet.
|
|
5
|
+
// Once they're made available, the code should be moved out into an `index.scss`.
|
|
6
|
+
|
|
7
|
+
// Taken from mat-density with small modifications to not rely on the new Sass module
|
|
8
|
+
// system, and to support arbitrary properties in a density configuration.
|
|
9
|
+
// https://github.com/material-components/material-components-web/blob/master/packages/mdc-density
|
|
10
|
+
|
|
11
|
+
$_density-interval: 4px !default;
|
|
12
|
+
$_minimum-scale: minimum !default;
|
|
13
|
+
$_maximum-scale: maximum !default;
|
|
14
|
+
$_supported-scales: (default, $_minimum-scale, $_maximum-scale) !default;
|
|
15
|
+
$_default-scale: 0 !default;
|
|
16
|
+
|
|
17
|
+
// Whether density should be generated at root. This will be temporarily set to `true`
|
|
18
|
+
// whenever density styles for legacy themes are generated.
|
|
19
|
+
$private-density-generate-at-root: false;
|
|
20
|
+
// Whether density styles should be generated. This will be temporarily set to `false` if
|
|
21
|
+
// duplicate density styles for a legacy theme would be generated. For legacy themes,
|
|
22
|
+
// we always generate the default density **only once** at root.
|
|
23
|
+
$private-density-generate-styles: true;
|
|
24
|
+
|
|
25
|
+
// Mixin that can be used to wrap density styles of given components. The mixin will
|
|
26
|
+
// move the density styles to root if the `$mat-private-density-generate-at-root` global variable
|
|
27
|
+
// is set. If `$mat-private-density-generate-styles` is set to `false`, generation of density
|
|
28
|
+
// styles wrapped in this mixin is skipped. This mixin exists to improve backwards compatibility
|
|
29
|
+
// of the new theming API where density styles are included as part of themes. Previously,
|
|
30
|
+
// density styles of components were part of their base styles. With the new API, they are
|
|
31
|
+
// part of the theming system. The `<..>-theme` mixins generate density by default unless
|
|
32
|
+
// the density configuration is explicitly specified as per new API. This means, that projects
|
|
33
|
+
// using `<..>-theme` mixins for separate themes (like `.dark-theme`) will cause duplicate
|
|
34
|
+
// density styles. This is breaking as it increases specificity of density styles. This mixin
|
|
35
|
+
// provides an API to control generation of density styles so that we can ensure they are only
|
|
36
|
+
// created *once* and at root.
|
|
37
|
+
@mixin private-density-legacy-compatibility() {
|
|
38
|
+
@if $private-density-generate-styles and $private-density-generate-at-root {
|
|
39
|
+
@at-root {
|
|
40
|
+
@content;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
@else if $private-density-generate-styles {
|
|
44
|
+
@content;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@function private-density-prop-value($density-config, $density-scale, $property-name) {
|
|
49
|
+
@if (meta.type-of($density-scale) == 'string' and
|
|
50
|
+
list.index($list: $_supported-scales, $value: $density-scale) == null) {
|
|
51
|
+
@error 'mat-density: Supported density scales #{$_supported-scales}, ' +
|
|
52
|
+
'but received #{$density-scale}.';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
$value: null;
|
|
56
|
+
$property-scale-map: map.get($density-config, $property-name);
|
|
57
|
+
|
|
58
|
+
@if map.has-key($property-scale-map, $density-scale) {
|
|
59
|
+
$value: map.get($property-scale-map, $density-scale);
|
|
60
|
+
}
|
|
61
|
+
@else {
|
|
62
|
+
$value: map.get($property-scale-map, default) + $density-scale * $_density-interval;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
$min-value: map.get($property-scale-map, $_minimum-scale);
|
|
66
|
+
$max-value: map.get($property-scale-map, $_maximum-scale);
|
|
67
|
+
|
|
68
|
+
@if ($value < $min-value or $value > $max-value) {
|
|
69
|
+
@error 'mat-density: #{$property-name} must be between #{$min-value} and ' +
|
|
70
|
+
'#{$max-value} (inclusive), but received #{$value}.';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@return $value;
|
|
74
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@use 'sass:list';
|
|
2
2
|
@use 'sass:map';
|
|
3
|
+
@use 'sass:math';
|
|
3
4
|
@use 'sass:meta';
|
|
4
5
|
@use 'palette';
|
|
6
|
+
@use '../density/compatibility';
|
|
5
7
|
|
|
6
8
|
// Whether duplication warnings should be disabled. Warnings enabled by default.
|
|
7
9
|
$theme-ignore-duplication-warnings: false !default;
|
|
@@ -53,6 +55,7 @@ $_emitted-density: () !default;
|
|
|
53
55
|
@return map.get(map.get($palette, contrast), $hue);
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
|
|
56
59
|
/// Creates a map of hues to colors for a theme. This is used to define a theme palette in terms
|
|
57
60
|
/// of the Material Design hues.
|
|
58
61
|
/// @param {Map} $base-palette Map of hue keys to color values for the basis for this palette.
|
|
@@ -62,33 +65,29 @@ $_emitted-density: () !default;
|
|
|
62
65
|
/// @param {String | Number} $text "text" hue for this palette.
|
|
63
66
|
/// @returns {Map} A complete Angular Material theming palette.
|
|
64
67
|
@function define-palette($base-palette, $default: 500, $lighter: 100, $darker: 700,
|
|
65
|
-
$text: $default) {
|
|
66
|
-
$result: map.merge(
|
|
67
|
-
$base-palette,
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
)
|
|
77
|
-
);
|
|
68
|
+
$text: $default) {
|
|
69
|
+
$result: map.merge($base-palette, (
|
|
70
|
+
default: _get-color-from-palette($base-palette, $default),
|
|
71
|
+
lighter: _get-color-from-palette($base-palette, $lighter),
|
|
72
|
+
darker: _get-color-from-palette($base-palette, $darker),
|
|
73
|
+
text: _get-color-from-palette($base-palette, $text),
|
|
74
|
+
|
|
75
|
+
default-contrast: get-contrast-color-from-palette($base-palette, $default),
|
|
76
|
+
lighter-contrast: get-contrast-color-from-palette($base-palette, $lighter),
|
|
77
|
+
darker-contrast: get-contrast-color-from-palette($base-palette, $darker)
|
|
78
|
+
));
|
|
78
79
|
|
|
79
80
|
// For each hue in the palette, add a "-contrast" color to the map.
|
|
80
81
|
@each $hue, $color in $base-palette {
|
|
81
|
-
$result: map.merge(
|
|
82
|
-
$
|
|
83
|
-
|
|
84
|
-
'#{$hue}-contrast': get-contrast-color-from-palette($base-palette, $hue)
|
|
85
|
-
)
|
|
86
|
-
);
|
|
82
|
+
$result: map.merge($result, (
|
|
83
|
+
'#{$hue}-contrast': get-contrast-color-from-palette($base-palette, $hue)
|
|
84
|
+
));
|
|
87
85
|
}
|
|
88
86
|
|
|
89
87
|
@return $result;
|
|
90
88
|
}
|
|
91
89
|
|
|
90
|
+
|
|
92
91
|
/// Gets a color from a theme palette (the output of mat-palette).
|
|
93
92
|
/// The hue can be one of the standard values (500, A400, etc.), one of the three preconfigured
|
|
94
93
|
/// hues (default, lighter, darker), or any of the aforementioned suffixed with "-contrast".
|
|
@@ -317,6 +316,7 @@ $text: $default) {
|
|
|
317
316
|
@return $default;
|
|
318
317
|
}
|
|
319
318
|
|
|
319
|
+
|
|
320
320
|
//
|
|
321
321
|
// Private APIs
|
|
322
322
|
//
|
|
@@ -348,7 +348,7 @@ $text: $default) {
|
|
|
348
348
|
// Check if the color configuration has been generated before.
|
|
349
349
|
@if $color-config != null {
|
|
350
350
|
@if list.index($previous-color, $color-config) != null and
|
|
351
|
-
|
|
351
|
+
not $theme-ignore-duplication-warnings {
|
|
352
352
|
@warn 'The same color styles are generated multiple times. ' + $_duplicate-warning;
|
|
353
353
|
}
|
|
354
354
|
$previous-color: list.append($previous-color, $color-config);
|
|
@@ -357,7 +357,7 @@ $text: $default) {
|
|
|
357
357
|
// Check if the typography configuration has been generated before.
|
|
358
358
|
@if $typography-config != null {
|
|
359
359
|
@if list.index($previous-typography, $typography-config) != null and
|
|
360
|
-
|
|
360
|
+
not $theme-ignore-duplication-warnings {
|
|
361
361
|
@warn 'The same typography styles are generated multiple times. ' + $_duplicate-warning;
|
|
362
362
|
}
|
|
363
363
|
$previous-typography: list.append($previous-typography, $typography-config);
|
|
@@ -390,8 +390,21 @@ $text: $default) {
|
|
|
390
390
|
$orig-mat-theme-ignore-duplication-warnings: $theme-ignore-duplication-warnings;
|
|
391
391
|
$theme-ignore-duplication-warnings: true !global;
|
|
392
392
|
|
|
393
|
+
// If duplicate default density styles would be generated for a legacy constructed theme,
|
|
394
|
+
// we adjust the density generation so that no density styles are generated by default.
|
|
395
|
+
// If no default density styles have been generated yet, we ensure that the styles
|
|
396
|
+
// are generated at root. For legacy themes our goal is to generate default density
|
|
397
|
+
// styles **once** and at root. This matches the old behavior where density styles were
|
|
398
|
+
// part of the base component styles (that did not use view encapsulation).
|
|
399
|
+
// TODO: Remove this compatibility logic when the legacy theming API is removed.
|
|
400
|
+
compatibility.$private-density-generate-at-root: private-is-legacy-constructed-theme($theme);
|
|
401
|
+
compatibility.$private-density-generate-styles: not $duplicate-legacy-density;
|
|
402
|
+
|
|
393
403
|
@content;
|
|
394
404
|
$theme-ignore-duplication-warnings: $orig-mat-theme-ignore-duplication-warnings !global;
|
|
405
|
+
|
|
406
|
+
compatibility.$private-density-generate-at-root: false;
|
|
407
|
+
compatibility.$private-density-generate-styles: true;
|
|
395
408
|
}
|
|
396
409
|
|
|
397
410
|
// Checks whether the given value resolves to a theme object. Theme objects are always
|
|
@@ -461,3 +474,24 @@ $text: $default) {
|
|
|
461
474
|
// into foreground when mixing the colors together.
|
|
462
475
|
@return mix($background-color, rgba($color, 1), (1 - opacity($color)) * 100%);
|
|
463
476
|
}
|
|
477
|
+
|
|
478
|
+
// Clamps the density scale to a number between the given min and max.
|
|
479
|
+
// 'minimum' and 'maximum' are converted to the given min or max number respectively.
|
|
480
|
+
@function clamp-density($density-scale, $min, $max: 0) {
|
|
481
|
+
@if $density-scale == minimum {
|
|
482
|
+
@return $min;
|
|
483
|
+
}
|
|
484
|
+
@if $density-scale == maximum {
|
|
485
|
+
@return $max;
|
|
486
|
+
}
|
|
487
|
+
@if meta.type-of($density-scale) != 'number' or not math.is-unitless($density-scale) {
|
|
488
|
+
@return 0;
|
|
489
|
+
}
|
|
490
|
+
@if $density-scale < $min {
|
|
491
|
+
@return $min;
|
|
492
|
+
}
|
|
493
|
+
@if $density-scale > $max {
|
|
494
|
+
@return $max;
|
|
495
|
+
}
|
|
496
|
+
@return $density-scale;
|
|
497
|
+
}
|
|
@@ -42,7 +42,18 @@ $prefix: (mtx, grid);
|
|
|
42
42
|
|
|
43
43
|
// Tokens that can be configured through Angular Material's density theming API.
|
|
44
44
|
@function get-density-tokens($config) {
|
|
45
|
-
|
|
45
|
+
$scale: theming.clamp-density($config, -4);
|
|
46
|
+
$expand-button-scale: (
|
|
47
|
+
0: 48px,
|
|
48
|
+
-1: 44px,
|
|
49
|
+
-2: 40px,
|
|
50
|
+
-3: 36px,
|
|
51
|
+
-4: 28px
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
@return (
|
|
55
|
+
row-expand-button-size: map.get($expand-button-scale, $scale),
|
|
56
|
+
);
|
|
46
57
|
}
|
|
47
58
|
|
|
48
59
|
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
@@ -28,7 +28,7 @@ $prefix: (mtx, split);
|
|
|
28
28
|
$gutter-tokens: private-get-color-palette-color-tokens($config, primary);
|
|
29
29
|
|
|
30
30
|
@return sass-utils.merge-all($gutter-tokens, (
|
|
31
|
-
gutter-background-color: theming.get-color-from-palette($foreground, divider
|
|
31
|
+
gutter-background-color: theming.get-color-from-palette($foreground, divider),
|
|
32
32
|
));
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -61,11 +61,11 @@ export class MtxGridColumnMenu {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxGridColumnMenu, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
64
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxGridColumnMenu, selector: "mtx-grid-column-menu", inputs: { columns: "columns", selectable: "selectable", selectableChecked: "selectableChecked", sortable: "sortable", pinnable: "pinnable", buttonText: "buttonText", buttonType: "buttonType", buttonColor: "buttonColor", buttonClass: "buttonClass", buttonIcon: "buttonIcon", showHeader: "showHeader", headerText: "headerText", headerTemplate: "headerTemplate", showFooter: "showFooter", footerText: "footerText", footerTemplate: "footerTemplate", pinOptions: "pinOptions" }, outputs: { columnChange: "columnChange" }, viewQueries: [{ propertyName: "menuPanel", first: true, predicate: ["menu"], descendants: true, static: true }, { propertyName: "menuTrigger", first: true, predicate: MatMenuTrigger, descendants: true }], exportAs: ["mtxGridColumnMenu"], ngImport: i0, template: "<ng-container [ngSwitch]=\"buttonType\">\r\n <ng-container *ngSwitchCase=\"'raised'\">\r\n <button [ngClass]=\"buttonClass\" mat-raised-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'stroked'\">\r\n <button [ngClass]=\"buttonClass\" mat-stroked-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'flat'\">\r\n <button [ngClass]=\"buttonClass\" mat-flat-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'icon'\">\r\n <button [ngClass]=\"buttonClass\" mat-icon-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-fab type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'mini-fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-mini-fab type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <button [ngClass]=\"buttonClass\" mat-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"mtx-grid-column-menu\">\r\n <div class=\"mtx-grid-column-menu-content\"\r\n (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <div class=\"mtx-grid-column-menu-header\" *ngIf=\"showHeader\">\r\n <ng-template [ngIf]=\"headerTemplate\" [ngIfElse]=\"defaultHeaderTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultHeaderTpl>{{headerText}}</ng-template>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-body\">\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"sortable\"\r\n cdkDropList (cdkDropListDropped)=\"_handleDroped($event)\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\"\r\n cdkDrag [cdkDragDisabled]=\"selectableChecked === 'show'? !col.show : col.hide\">\r\n <svg class=\"mtx-grid-icon mtx-grid-column-drag-handle-icon\" viewBox=\"0 0 24 24\"\r\n width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path\r\n d=\"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z\">\r\n </path>\r\n </svg>\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"!sortable\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\">\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-footer\" *ngIf=\"showFooter\">\r\n <ng-template [ngIf]=\"footerTemplate\" [ngIfElse]=\"defaultFooterTpl\">\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultFooterTpl>{{footerText}}</ng-template>\r\n </div>\r\n </div>\r\n</mat-menu>\r\n\r\n<ng-template #checkboxList let-col>\r\n <ng-container *ngIf=\"pinnable\">\r\n <button class=\"mtx-grid-column-pin-button\" mat-icon-button type=\"button\"\r\n [matMenuTriggerFor]=\"pinList\">\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-icon\" *ngIf=\"col.pinned\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path d=\"M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z\" />\r\n </svg>\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-off-icon\" *ngIf=\"!col.pinned\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path\r\n d=\"M2,5.27L3.28,4L20,20.72L18.73,22L12.8,16.07V22H11.2V16H6V14L8,12V11.27L2,5.27M16,12L18,14V16H17.82L8,6.18V4H7V2H17V4H16V12Z\" />\r\n </svg>\r\n </button>\r\n <mat-menu #pinList=\"matMenu\" class=\"mtx-grid-column-pin-list\">\r\n <button class=\"mtx-grid-column-pin-option\" type=\"button\"\r\n *ngFor=\"let item of pinOptions\" mat-menu-item\r\n (click)=\"_handlePinSelect(col, item.value)\">\r\n <span class=\"mtx-grid-column-pin-option-placeholder\">\r\n <!-- eslint-disable-next-line @angular-eslint/template/eqeqeq -->\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-check-icon\" *ngIf=\"col.pinned==item.value\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\" />\r\n </svg>\r\n </span>\r\n <span class=\"mtx-grid-column-pin-option-text\">{{item.label | toObservable | async}}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n\r\n <mat-checkbox class=\"mtx-grid-column-menu-item-label\" *ngIf=\"selectable\"\r\n [(ngModel)]=\"col[selectableChecked]\" [disabled]=\"col.disabled\"\r\n (change)=\"_handleChecked($event)\">\r\n {{col.header | toObservable | async}}\r\n </mat-checkbox>\r\n <span class=\"mtx-grid-column-menu-item-label\" *ngIf=\"!selectable\">\r\n {{col.header | toObservable | async}}\r\n </span>\r\n</ng-template>\r\n", styles: [".mtx-grid-column-menu .mat-menu-content{padding:0}.mtx-grid-column-menu-body{padding:8px 16px}.mtx-grid-column-menu-header,.mtx-grid-column-menu-footer{position:sticky;z-index:1;padding:8px 16px}.mtx-grid-column-menu-header{top:0}.mtx-grid-column-menu-footer{bottom:0}.mtx-grid-column-menu-list{display:block;max-width:100%}.mtx-grid-column-menu-list.cdk-drop-list-dragging .mtx-grid-column-menu-item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-menu-item{display:flex;flex-direction:row;align-items:center}.mtx-grid-column-menu-item.cdk-drag-disabled .cdk-drag-handle{opacity:.35;cursor:no-drop}.mtx-grid-column-menu-item .cdk-drag-handle{cursor:move}.mtx-grid-column-menu-item.cdk-drag-preview{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.mtx-grid-column-menu-item.cdk-drag-placeholder{opacity:0}.mtx-grid-column-menu-item.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-pin-button.mat-mdc-icon-button{width:40px;height:40px;padding:8px}.mtx-grid-column-pin-button.mat-mdc-icon-button .mat-mdc-button-touch-target{width:100%;height:100%}.mtx-grid-column-pin-option.mat-menu-item{display:flex;align-items:center;height:32px}.mtx-grid-column-pin-option-placeholder{display:inline-block;width:20px;height:20px;line-height:20px;vertical-align:middle}.mtx-grid-column-pin-option-text{padding:0 8px;vertical-align:middle}.mtx-grid-column-drag-handle-icon:hover{cursor:move}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatMiniFabButton, selector: "button[mat-mini-fab]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatFabButton, selector: "button[mat-fab]", inputs: ["disabled", "disableRipple", "color", "tabIndex", "extended"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i7.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.MtxToObservablePipe, name: "toObservable" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
64
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: MtxGridColumnMenu, selector: "mtx-grid-column-menu", inputs: { columns: "columns", selectable: "selectable", selectableChecked: "selectableChecked", sortable: "sortable", pinnable: "pinnable", buttonText: "buttonText", buttonType: "buttonType", buttonColor: "buttonColor", buttonClass: "buttonClass", buttonIcon: "buttonIcon", showHeader: "showHeader", headerText: "headerText", headerTemplate: "headerTemplate", showFooter: "showFooter", footerText: "footerText", footerTemplate: "footerTemplate", pinOptions: "pinOptions" }, outputs: { columnChange: "columnChange" }, viewQueries: [{ propertyName: "menuPanel", first: true, predicate: ["menu"], descendants: true, static: true }, { propertyName: "menuTrigger", first: true, predicate: MatMenuTrigger, descendants: true }], exportAs: ["mtxGridColumnMenu"], ngImport: i0, template: "<ng-container [ngSwitch]=\"buttonType\">\r\n <ng-container *ngSwitchCase=\"'raised'\">\r\n <button [ngClass]=\"buttonClass\" mat-raised-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'stroked'\">\r\n <button [ngClass]=\"buttonClass\" mat-stroked-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'flat'\">\r\n <button [ngClass]=\"buttonClass\" mat-flat-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'icon'\">\r\n <button [ngClass]=\"buttonClass\" mat-icon-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-fab type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'mini-fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-mini-fab type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <button [ngClass]=\"buttonClass\" mat-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"mtx-grid-column-menu\">\r\n <div class=\"mtx-grid-column-menu-content\"\r\n (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <div class=\"mtx-grid-column-menu-header\" *ngIf=\"showHeader\">\r\n <ng-template [ngIf]=\"headerTemplate\" [ngIfElse]=\"defaultHeaderTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultHeaderTpl>{{headerText}}</ng-template>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-body\">\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"sortable\"\r\n cdkDropList (cdkDropListDropped)=\"_handleDroped($event)\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\"\r\n cdkDrag [cdkDragDisabled]=\"selectableChecked === 'show'? !col.show : col.hide\">\r\n <svg class=\"mtx-grid-icon mtx-grid-column-drag-handle-icon\" viewBox=\"0 0 24 24\"\r\n width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path\r\n d=\"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z\">\r\n </path>\r\n </svg>\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"!sortable\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\">\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-footer\" *ngIf=\"showFooter\">\r\n <ng-template [ngIf]=\"footerTemplate\" [ngIfElse]=\"defaultFooterTpl\">\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultFooterTpl>{{footerText}}</ng-template>\r\n </div>\r\n </div>\r\n</mat-menu>\r\n\r\n<ng-template #checkboxList let-col>\r\n <ng-container *ngIf=\"pinnable\">\r\n <button class=\"mtx-grid-column-pin-button\" mat-icon-button type=\"button\"\r\n [matMenuTriggerFor]=\"pinList\">\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-icon\" *ngIf=\"col.pinned\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path d=\"M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z\" />\r\n </svg>\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-off-icon\" *ngIf=\"!col.pinned\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path\r\n d=\"M2,5.27L3.28,4L20,20.72L18.73,22L12.8,16.07V22H11.2V16H6V14L8,12V11.27L2,5.27M16,12L18,14V16H17.82L8,6.18V4H7V2H17V4H16V12Z\" />\r\n </svg>\r\n </button>\r\n <mat-menu #pinList=\"matMenu\" class=\"mtx-grid-column-pin-list\">\r\n <button class=\"mtx-grid-column-pin-option\" type=\"button\"\r\n *ngFor=\"let item of pinOptions\" mat-menu-item\r\n (click)=\"_handlePinSelect(col, item.value)\">\r\n <span class=\"mtx-grid-column-pin-option-placeholder\">\r\n <!-- eslint-disable-next-line @angular-eslint/template/eqeqeq -->\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-check-icon\" *ngIf=\"col.pinned==item.value\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\" />\r\n </svg>\r\n </span>\r\n <span class=\"mtx-grid-column-pin-option-text\">{{item.label | toObservable | async}}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n\r\n <mat-checkbox class=\"mtx-grid-column-menu-item-label\" *ngIf=\"selectable\"\r\n [(ngModel)]=\"col[selectableChecked]\" [disabled]=\"col.disabled\"\r\n (change)=\"_handleChecked($event)\">\r\n {{col.header | toObservable | async}}\r\n </mat-checkbox>\r\n <span class=\"mtx-grid-column-menu-item-label\" *ngIf=\"!selectable\">\r\n {{col.header | toObservable | async}}\r\n </span>\r\n</ng-template>\r\n", styles: [".mtx-grid-column-menu{color:var(--mtx-grid-column-menu-text-color)}.mtx-grid-column-menu .mat-mdc-menu-content{padding:0}.mtx-grid-column-menu-body{max-height:65vh;padding:8px 16px;overflow:auto}.mtx-grid-column-menu-header,.mtx-grid-column-menu-footer{position:sticky;z-index:1;padding:8px 16px}.mtx-grid-column-menu-header{top:0;border-bottom:1px solid var(--mtx-grid-column-menu-divider-color)}.mtx-grid-column-menu-footer{bottom:0;border-top:1px solid var(--mtx-grid-column-menu-divider-color)}.mtx-grid-column-menu-list{display:block;max-width:100%}.mtx-grid-column-menu-list.cdk-drop-list-dragging .mtx-grid-column-menu-item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-menu-item{display:flex;flex-direction:row;align-items:center}.mtx-grid-column-menu-item.cdk-drag-disabled .cdk-drag-handle{opacity:.35;cursor:no-drop}.mtx-grid-column-menu-item .cdk-drag-handle{cursor:move}.mtx-grid-column-menu-item.cdk-drag-preview{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.mtx-grid-column-menu-item.cdk-drag-placeholder{opacity:0}.mtx-grid-column-menu-item.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-pin-button.mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 40px;padding:8px}.mtx-grid-column-pin-button.mat-mdc-icon-button .mat-mdc-button-touch-target{width:100%;height:100%}.mtx-grid-column-pin-option.mat-menu-item{display:flex;align-items:center;height:32px}.mtx-grid-column-pin-option-placeholder{display:inline-block;width:20px;height:20px;line-height:20px;vertical-align:middle}.mtx-grid-column-pin-option-text{padding:0 8px;vertical-align:middle}.mtx-grid-column-drag-handle-icon:hover{cursor:move}.mtx-grid-column-menu-item-label.mat-mdc-checkbox .mat-mdc-checkbox-touch-target{width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatMiniFabButton, selector: "button[mat-mini-fab]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatFabButton, selector: "button[mat-fab]", inputs: ["disabled", "disableRipple", "color", "tabIndex", "extended"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i7.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.MtxToObservablePipe, name: "toObservable" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
65
65
|
}
|
|
66
66
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: MtxGridColumnMenu, decorators: [{
|
|
67
67
|
type: Component,
|
|
68
|
-
args: [{ selector: 'mtx-grid-column-menu', exportAs: 'mtxGridColumnMenu', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"buttonType\">\r\n <ng-container *ngSwitchCase=\"'raised'\">\r\n <button [ngClass]=\"buttonClass\" mat-raised-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'stroked'\">\r\n <button [ngClass]=\"buttonClass\" mat-stroked-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'flat'\">\r\n <button [ngClass]=\"buttonClass\" mat-flat-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'icon'\">\r\n <button [ngClass]=\"buttonClass\" mat-icon-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-fab type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'mini-fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-mini-fab type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <button [ngClass]=\"buttonClass\" mat-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"mtx-grid-column-menu\">\r\n <div class=\"mtx-grid-column-menu-content\"\r\n (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <div class=\"mtx-grid-column-menu-header\" *ngIf=\"showHeader\">\r\n <ng-template [ngIf]=\"headerTemplate\" [ngIfElse]=\"defaultHeaderTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultHeaderTpl>{{headerText}}</ng-template>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-body\">\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"sortable\"\r\n cdkDropList (cdkDropListDropped)=\"_handleDroped($event)\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\"\r\n cdkDrag [cdkDragDisabled]=\"selectableChecked === 'show'? !col.show : col.hide\">\r\n <svg class=\"mtx-grid-icon mtx-grid-column-drag-handle-icon\" viewBox=\"0 0 24 24\"\r\n width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path\r\n d=\"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z\">\r\n </path>\r\n </svg>\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"!sortable\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\">\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-footer\" *ngIf=\"showFooter\">\r\n <ng-template [ngIf]=\"footerTemplate\" [ngIfElse]=\"defaultFooterTpl\">\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultFooterTpl>{{footerText}}</ng-template>\r\n </div>\r\n </div>\r\n</mat-menu>\r\n\r\n<ng-template #checkboxList let-col>\r\n <ng-container *ngIf=\"pinnable\">\r\n <button class=\"mtx-grid-column-pin-button\" mat-icon-button type=\"button\"\r\n [matMenuTriggerFor]=\"pinList\">\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-icon\" *ngIf=\"col.pinned\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path d=\"M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z\" />\r\n </svg>\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-off-icon\" *ngIf=\"!col.pinned\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path\r\n d=\"M2,5.27L3.28,4L20,20.72L18.73,22L12.8,16.07V22H11.2V16H6V14L8,12V11.27L2,5.27M16,12L18,14V16H17.82L8,6.18V4H7V2H17V4H16V12Z\" />\r\n </svg>\r\n </button>\r\n <mat-menu #pinList=\"matMenu\" class=\"mtx-grid-column-pin-list\">\r\n <button class=\"mtx-grid-column-pin-option\" type=\"button\"\r\n *ngFor=\"let item of pinOptions\" mat-menu-item\r\n (click)=\"_handlePinSelect(col, item.value)\">\r\n <span class=\"mtx-grid-column-pin-option-placeholder\">\r\n <!-- eslint-disable-next-line @angular-eslint/template/eqeqeq -->\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-check-icon\" *ngIf=\"col.pinned==item.value\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\" />\r\n </svg>\r\n </span>\r\n <span class=\"mtx-grid-column-pin-option-text\">{{item.label | toObservable | async}}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n\r\n <mat-checkbox class=\"mtx-grid-column-menu-item-label\" *ngIf=\"selectable\"\r\n [(ngModel)]=\"col[selectableChecked]\" [disabled]=\"col.disabled\"\r\n (change)=\"_handleChecked($event)\">\r\n {{col.header | toObservable | async}}\r\n </mat-checkbox>\r\n <span class=\"mtx-grid-column-menu-item-label\" *ngIf=\"!selectable\">\r\n {{col.header | toObservable | async}}\r\n </span>\r\n</ng-template>\r\n", styles: [".mtx-grid-column-menu .mat-menu-content{padding:0}.mtx-grid-column-menu-body{padding:8px 16px}.mtx-grid-column-menu-header,.mtx-grid-column-menu-footer{position:sticky;z-index:1;padding:8px 16px}.mtx-grid-column-menu-header{top:0}.mtx-grid-column-menu-footer{bottom:0}.mtx-grid-column-menu-list{display:block;max-width:100%}.mtx-grid-column-menu-list.cdk-drop-list-dragging .mtx-grid-column-menu-item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-menu-item{display:flex;flex-direction:row;align-items:center}.mtx-grid-column-menu-item.cdk-drag-disabled .cdk-drag-handle{opacity:.35;cursor:no-drop}.mtx-grid-column-menu-item .cdk-drag-handle{cursor:move}.mtx-grid-column-menu-item.cdk-drag-preview{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.mtx-grid-column-menu-item.cdk-drag-placeholder{opacity:0}.mtx-grid-column-menu-item.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-pin-button.mat-mdc-icon-button{
|
|
68
|
+
args: [{ selector: 'mtx-grid-column-menu', exportAs: 'mtxGridColumnMenu', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [ngSwitch]=\"buttonType\">\r\n <ng-container *ngSwitchCase=\"'raised'\">\r\n <button [ngClass]=\"buttonClass\" mat-raised-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'stroked'\">\r\n <button [ngClass]=\"buttonClass\" mat-stroked-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'flat'\">\r\n <button [ngClass]=\"buttonClass\" mat-flat-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'icon'\">\r\n <button [ngClass]=\"buttonClass\" mat-icon-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-fab type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'mini-fab'\">\r\n <button [ngClass]=\"buttonClass\" mat-mini-fab type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <button [ngClass]=\"buttonClass\" mat-button type=\"button\" [color]=\"buttonColor\"\r\n [matMenuTriggerFor]=\"menu\">\r\n <mat-icon *ngIf=\"buttonIcon\">{{buttonIcon}}</mat-icon> {{buttonText}}\r\n </button>\r\n </ng-container>\r\n</ng-container>\r\n\r\n<mat-menu #menu=\"matMenu\" class=\"mtx-grid-column-menu\">\r\n <div class=\"mtx-grid-column-menu-content\"\r\n (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\r\n <div class=\"mtx-grid-column-menu-header\" *ngIf=\"showHeader\">\r\n <ng-template [ngIf]=\"headerTemplate\" [ngIfElse]=\"defaultHeaderTpl\">\r\n <ng-template [ngTemplateOutlet]=\"headerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultHeaderTpl>{{headerText}}</ng-template>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-body\">\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"sortable\"\r\n cdkDropList (cdkDropListDropped)=\"_handleDroped($event)\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\"\r\n cdkDrag [cdkDragDisabled]=\"selectableChecked === 'show'? !col.show : col.hide\">\r\n <svg class=\"mtx-grid-icon mtx-grid-column-drag-handle-icon\" viewBox=\"0 0 24 24\"\r\n width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path\r\n d=\"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z\">\r\n </path>\r\n </svg>\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-list\" *ngIf=\"!sortable\">\r\n <div class=\"mtx-grid-column-menu-item\" *ngFor=\"let col of columns\">\r\n <ng-template [ngTemplateOutlet]=\"checkboxList\"\r\n [ngTemplateOutletContext]=\"{ $implicit: col }\">\r\n </ng-template>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mtx-grid-column-menu-footer\" *ngIf=\"showFooter\">\r\n <ng-template [ngIf]=\"footerTemplate\" [ngIfElse]=\"defaultFooterTpl\">\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"></ng-template>\r\n </ng-template>\r\n <ng-template #defaultFooterTpl>{{footerText}}</ng-template>\r\n </div>\r\n </div>\r\n</mat-menu>\r\n\r\n<ng-template #checkboxList let-col>\r\n <ng-container *ngIf=\"pinnable\">\r\n <button class=\"mtx-grid-column-pin-button\" mat-icon-button type=\"button\"\r\n [matMenuTriggerFor]=\"pinList\">\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-icon\" *ngIf=\"col.pinned\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path d=\"M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z\" />\r\n </svg>\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-off-icon\" *ngIf=\"!col.pinned\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path\r\n d=\"M2,5.27L3.28,4L20,20.72L18.73,22L12.8,16.07V22H11.2V16H6V14L8,12V11.27L2,5.27M16,12L18,14V16H17.82L8,6.18V4H7V2H17V4H16V12Z\" />\r\n </svg>\r\n </button>\r\n <mat-menu #pinList=\"matMenu\" class=\"mtx-grid-column-pin-list\">\r\n <button class=\"mtx-grid-column-pin-option\" type=\"button\"\r\n *ngFor=\"let item of pinOptions\" mat-menu-item\r\n (click)=\"_handlePinSelect(col, item.value)\">\r\n <span class=\"mtx-grid-column-pin-option-placeholder\">\r\n <!-- eslint-disable-next-line @angular-eslint/template/eqeqeq -->\r\n <svg class=\"mtx-grid-icon mtx-grid-column-pin-check-icon\" *ngIf=\"col.pinned==item.value\"\r\n viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" fill=\"currentColor\" focusable=\"false\">\r\n <path d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\" />\r\n </svg>\r\n </span>\r\n <span class=\"mtx-grid-column-pin-option-text\">{{item.label | toObservable | async}}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n\r\n <mat-checkbox class=\"mtx-grid-column-menu-item-label\" *ngIf=\"selectable\"\r\n [(ngModel)]=\"col[selectableChecked]\" [disabled]=\"col.disabled\"\r\n (change)=\"_handleChecked($event)\">\r\n {{col.header | toObservable | async}}\r\n </mat-checkbox>\r\n <span class=\"mtx-grid-column-menu-item-label\" *ngIf=\"!selectable\">\r\n {{col.header | toObservable | async}}\r\n </span>\r\n</ng-template>\r\n", styles: [".mtx-grid-column-menu{color:var(--mtx-grid-column-menu-text-color)}.mtx-grid-column-menu .mat-mdc-menu-content{padding:0}.mtx-grid-column-menu-body{max-height:65vh;padding:8px 16px;overflow:auto}.mtx-grid-column-menu-header,.mtx-grid-column-menu-footer{position:sticky;z-index:1;padding:8px 16px}.mtx-grid-column-menu-header{top:0;border-bottom:1px solid var(--mtx-grid-column-menu-divider-color)}.mtx-grid-column-menu-footer{bottom:0;border-top:1px solid var(--mtx-grid-column-menu-divider-color)}.mtx-grid-column-menu-list{display:block;max-width:100%}.mtx-grid-column-menu-list.cdk-drop-list-dragging .mtx-grid-column-menu-item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-menu-item{display:flex;flex-direction:row;align-items:center}.mtx-grid-column-menu-item.cdk-drag-disabled .cdk-drag-handle{opacity:.35;cursor:no-drop}.mtx-grid-column-menu-item .cdk-drag-handle{cursor:move}.mtx-grid-column-menu-item.cdk-drag-preview{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.mtx-grid-column-menu-item.cdk-drag-placeholder{opacity:0}.mtx-grid-column-menu-item.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.mtx-grid-column-pin-button.mat-mdc-icon-button{--mdc-icon-button-state-layer-size: 40px;padding:8px}.mtx-grid-column-pin-button.mat-mdc-icon-button .mat-mdc-button-touch-target{width:100%;height:100%}.mtx-grid-column-pin-option.mat-menu-item{display:flex;align-items:center;height:32px}.mtx-grid-column-pin-option-placeholder{display:inline-block;width:20px;height:20px;line-height:20px;vertical-align:middle}.mtx-grid-column-pin-option-text{padding:0 8px;vertical-align:middle}.mtx-grid-column-drag-handle-icon:hover{cursor:move}.mtx-grid-column-menu-item-label.mat-mdc-checkbox .mat-mdc-checkbox-touch-target{width:100%;height:100%}\n"] }]
|
|
69
69
|
}], propDecorators: { menuPanel: [{
|
|
70
70
|
type: ViewChild,
|
|
71
71
|
args: ['menu', { static: true }]
|