Skip to content

Commit d68457a

Browse files
committed
Make ColumnMenu component generic
1 parent 425be8b commit d68457a

21 files changed

+432
-880
lines changed

libs/schematic/generators/ng-generate/components/card/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,9 @@ export function generateCard(cardSchema: Schema): Rule {
5151
insertVersionIntoPathRule(),
5252
setTemplateOptionValuesRule(),
5353
...generateGeneralFilesRules(),
54-
...cardSpecificGeneration(),
54+
generateCardComponent(options),
55+
generateExportCardDialog(options),
5556
...addAndUpdateConfigurationFilesRule(),
5657
formatAllFilesRule(),
5758
]);
5859
}
59-
60-
function cardSpecificGeneration(): Array<Rule> {
61-
return [generateCardComponent(options), generateExportCardDialog(options)];
62-
}

libs/schematic/generators/ng-generate/components/shared/generators/components/command-bar/files/__name@dasherize__-command-bar.component.scss.template

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
overflow: hidden;
99
}
1010

11+
.mat-mdc-menu-panel {
12+
max-width: max-content !important;
13+
}
14+
1115
.mat-mdc-form-field {
1216
padding-top: 20px;
1317
margin-right: 8px;
@@ -29,4 +33,70 @@
2933
.padding-40 {
3034
padding:40px;
3135
}
36+
37+
.filter-options-container {
38+
overflow-y: auto;
39+
min-height: 100px;
40+
max-height: 200px;
41+
}
42+
43+
.filter-actions-container {
44+
text-align: right;
45+
padding: 6px;
46+
47+
.filter-apply-btn {
48+
margin-left: 10px;
49+
}
50+
}
51+
52+
::ng-deep {
53+
.advanced-search-option-description {
54+
position: relative;
55+
float: left;
56+
font-size: 10px;
57+
line-height: 1;
58+
top: -12px;
59+
white-space: break-spaces;
60+
}
61+
62+
& .resizing {
63+
-moz-user-select: none;
64+
-ms-user-select: none;
65+
user-select: none;
66+
cursor: e-resize;
67+
}
68+
69+
& .handle {
70+
width: 15px;
71+
position: absolute;
72+
top: 0;
73+
right: 0;
74+
height: 100%;
75+
cursor: col-resize;
76+
opacity: 0;
77+
transition: all 0.2s ease-in;
78+
79+
&:after {
80+
content: '';
81+
display: block;
82+
width: 1px;
83+
height: 100%;
84+
z-index: 1;
85+
background: linear-gradient(0, rgba(255, 255, 255, 1) 0%, rgba(157, 157, 157, 1) 49%, rgba(255, 255, 255, 1) 100%);
86+
transition: all 0.5ms ease-in;
87+
}
88+
}
89+
90+
.mat-mdc-menu-panel {
91+
max-width: max-content !important;
92+
}
93+
94+
.mat-list-item-content {
95+
flex-direction: row !important;
96+
}
97+
98+
.mat-pseudo-checkbox {
99+
margin-right: 10px;
100+
}
101+
}
32102
}
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,3 @@
11
/** <%= options.generationDisclaimerText %> **/
22

3-
::ng-deep {
4-
.advanced-search-option-description {
5-
position: relative;
6-
float: left;
7-
font-size: 10px;
8-
line-height: 1;
9-
top: -12px;
10-
white-space: break-spaces;
11-
}
12-
13-
& .resizing {
14-
-moz-user-select: none;
15-
-ms-user-select: none;
16-
user-select: none;
17-
cursor: e-resize;
18-
}
19-
20-
& .handle {
21-
width: 15px;
22-
position: absolute;
23-
top: 0;
24-
right: 0;
25-
height: 100%;
26-
cursor: col-resize;
27-
opacity: 0;
28-
transition: all 0.2s ease-in;
29-
30-
&:after {
31-
content: '';
32-
display: block;
33-
width: 1px;
34-
height: 100%;
35-
z-index: 1;
36-
background: linear-gradient(0, rgba(255, 255, 255, 1) 0%, rgba(157, 157, 157, 1) 49%, rgba(255, 255, 255, 1) 100%);
37-
transition: all 0.5ms ease-in;
38-
}
39-
}
40-
41-
.mat-mdc-menu-panel {
42-
max-width: max-content !important;
43-
}
44-
45-
.mat-list-item-content {
46-
flex-direction: row !important;
47-
}
48-
49-
.mat-pseudo-checkbox {
50-
margin-right: 10px;
51-
}
52-
}
53-
54-
.spacer {
55-
flex: 1 1 auto;
56-
}
57-
58-
.selection-title {
59-
padding: 8px 0 16px 16px;
60-
margin: 0;
61-
}
62-
63-
.list-content {
64-
display: flex;
65-
align-items: center;
66-
justify-content: space-between;
67-
padding-left: 8px;
68-
}
69-
70-
.bg-transparent {
71-
background: initial;
72-
}
73-
74-
.filter-options-container {
75-
overflow-y: auto;
76-
min-height: 100px;
77-
max-height: 200px;
78-
}
79-
80-
.filter-actions-container {
81-
text-align: right;
82-
padding: 6px;
83-
84-
.filter-apply-btn {
85-
margin-left: 10px;
86-
}
87-
}
88-
89-
.mat-mdc-menu-panel {
90-
max-width: max-content !important;
91-
}
92-
933
<%= customStyleImports %>

libs/schematic/generators/ng-generate/components/shared/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export function setTemplateOptionValuesRule(): Rule {
233233
export function generateGeneralFilesRules(): Array<Rule> {
234234
return [
235235
generateFilterService(options),
236-
generateGeneralStyle(options),
236+
// TODO remove the method call generateGeneralStyle(options),
237237
generateTranslationFiles(options, false),
238238
wrapBuildComponentExecution(options),
239239
generateCustomService(options),

libs/schematic/generators/ng-generate/components/shared/methods/generation/extended-table.html.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
class="mat-table-menu-button"
150150
[matMenuTriggerFor]="columnMenu"
151151
[matTooltip]="'tableActions.openColumnsMenu' | transloco"
152-
(menuOpened)="initOpenedColumnMenuDialog()">
152+
>
153153
<mat-icon data-test="mat-table-menu-icon" class="material-icons">settings</mat-icon>
154154
</button>
155155
</th>
@@ -164,12 +164,12 @@
164164
</table>
165165

166166
<mat-menu data-test="column-menu" #columnMenu="matMenu" class="column-menu">
167-
<<%= dasherize(name) %>-column-menu (columnsChangedEvent)="setDisplayedColumns($event)"></<%= dasherize(name) %>-column-menu>
167+
<esmf-column-menu [defaultColumns]="customizableColumns" [columns]="columns" (columnsChangedEvent)="setDisplayedColumns($event)"></esmf-column-menu>
168168
</mat-menu>
169169

170170
<% if (options.hasSearchBar) { %>
171171
<mat-menu data-test="column-menu" class="column-menu">
172-
<<%= dasherize(name) %>-config-menu (configChangedEvent)="setConfiguration($event)"></<%= dasherize(name) %>-config-menu>
172+
<esmf-config-menu (configChangedEvent)="setConfiguration($event)"></esmf-config-menu>
173173
</mat-menu>
174174
<% } %>
175175

libs/schematic/generators/ng-generate/components/table/generators/components/column-menu/files/__name@dasherize__-column-menu.component.html.template

Lines changed: 0 additions & 51 deletions
This file was deleted.

libs/schematic/generators/ng-generate/components/table/generators/components/column-menu/files/__name@dasherize__-column-menu.component.scss.template

Lines changed: 0 additions & 4 deletions
This file was deleted.

libs/schematic/generators/ng-generate/components/table/generators/components/column-menu/files/__name@dasherize__-column-menu.component.ts.template

Lines changed: 0 additions & 67 deletions
This file was deleted.

libs/schematic/generators/ng-generate/components/table/generators/components/column-menu/index.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

libs/schematic/generators/ng-generate/components/table/generators/components/table/files/__name@dasherize__.component.scss.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,8 @@ $gray-300: #e0e0e0;
130130
display: block;
131131
}
132132
}
133+
134+
.bg-transparent {
135+
background: initial;
136+
}
133137
}

0 commit comments

Comments
 (0)