Skip to content

Commit 118a98a

Browse files
authored
Merge pull request #97 from ngx-lib/feature/css-flex
CSS with Flex.
2 parents 1b7c5ae + dea5270 commit 118a98a

File tree

6 files changed

+105
-272
lines changed

6 files changed

+105
-272
lines changed
Lines changed: 26 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,44 @@
1-
/* Material CSS start */
1+
/* Common */
22

3-
:host {
4-
width: 100%;
5-
display: block;
3+
.input-search {
4+
display: flex;
5+
flex-grow: 1;
6+
align-items: stretch;
7+
height: 30px;
8+
padding: 2px;
69
}
710

11+
/* Material CSS start */
12+
813
.mat-multiselect :host ::ng-deep .input-search {
9-
width: 100%;
10-
position: relative;
11-
max-height: 35px;
12-
overflow: hidden;
13-
box-sizing: content-box;
14-
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
15-
display: inline-flex;
14+
border-bottom: 1px solid rgba(0,0,0,.12);
1615
}
1716

1817
.mat-multiselect :host ::ng-deep .input-filter {
18+
flex-grow: 1;
1919
font: inherit;
20-
background: 0 0;
21-
color: currentColor;
20+
outline: none;
2221
border: none;
23-
outline: 0;
24-
padding: 0;
25-
margin: 0;
26-
width: 100%;
27-
max-width: 100%;
28-
vertical-align: bottom;
29-
text-align: inherit;
30-
margin-top: -0.0625em;
3122
}
3223

3324
.mat-multiselect :host ::ng-deep .field-infix {
34-
display: block;
35-
position: relative;
36-
padding: 5px 10px;
37-
flex: auto;
38-
min-width: 0;
39-
width: 90%;
40-
position: relative;
25+
padding: 5px;
26+
flex: 1;
27+
display: flex;
4128
}
4229

4330
.mat-multiselect :host ::ng-deep .field-suffix {
44-
width: 20px;
45-
height: 20px;
4631
white-space: nowrap;
47-
flex: none;
48-
position: relative;
49-
top: 5px;
50-
right: 5px;
32+
margin: 3px;
5133
}
5234
.mat-multiselect :host ::ng-deep .field-suffix button {
53-
position: relative;
5435
padding: 0;
5536
border: none;
56-
font-size: 14px;
37+
font-size: inherit;
5738
width: 20px;
5839
height: 20px;
5940
min-width: 20px;
6041
border-radius: 10px;
61-
line-height: 1;
62-
font-weight: 500;
6342
}
6443

6544
/* Material CSS end */
@@ -70,74 +49,40 @@
7049
padding: 0;
7150
min-width: 20px;
7251
max-width: 20px;
73-
border-radius: 50%;
7452
border: none;
7553
cursor: pointer;
76-
}
77-
78-
.bs-multiselect :host ::ng-deep .input-search {
79-
display: flex;
80-
padding: 2px 0px 4px 0px;
81-
max-height: 30px;
82-
overflow: hidden;
83-
box-sizing: content-box;
54+
cursor: pointer;
55+
border-radius: 2px;
56+
color: #666;
57+
background-color: #f1f1f1;
58+
border: none;
59+
font-size: inherit;
8460
}
8561

8662
.bs-multiselect :host ::ng-deep .input-filter {
8763
border-radius: 2px;
8864
height: 30px;
89-
font-size: 14px;
65+
height: 100%;
9066
width: 100%;
67+
font-size: inherit;
9168
padding-left: 7px;
9269
-webkit-box-sizing: border-box;
9370
-moz-box-sizing: border-box;
9471
box-sizing: border-box;
95-
margin: 0px 0px 8px 0px;
9672
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
9773
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
9874
cursor: pointer;
9975
border: 1px solid #ccc;
100-
border-radius: 2px;
101-
color: #666;
102-
}
103-
104-
.bs-multiselect :host ::ng-deep .clear-button {
105-
text-align: center;
106-
cursor: pointer;
107-
border: 1px solid #ccc;
108-
border-radius: 2px;
10976
color: #666;
110-
background-color: #f1f1f1;
11177
}
11278

11379
.bs-multiselect :host ::ng-deep .field-infix {
11480
display: flex;
115-
padding: 2px;
116-
flex: 18;
81+
flex-grow: 1;
11782
}
11883

11984
.bs-multiselect :host ::ng-deep .field-suffix {
120-
flex: 2;
12185
display: flex;
122-
align-items: center;
123-
justify-content: center;
124-
}
125-
.bs-multiselect :host ::ng-deep .field-suffix button {
126-
border: none;
127-
padding: 0;
128-
font-size: 20px;
129-
min-width: 25px;
130-
line-height: 1.1;
13186
}
13287

13388
/* Boostrap CSS end */
134-
135-
/* Common */
136-
137-
.mat-multiselect :host ::ng-deep button[disabled],
138-
.mat-multiselect :host ::ng-deep button:disabled,
139-
.bs-multiselect :host ::ng-deep button[disabled],
140-
.bs-multiselect :host ::ng-deep button:disabled {
141-
background: whitesmoke;
142-
color: #dad4d4;
143-
}

projects/multiselect/src/lib/filter-options/filter-options.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
/>
1111
</div>
1212
<div class="field-suffix">
13-
<button type="button" [disabled]="!filterName.value" (click)="clearInputFilter()" class="clear-button">×</button>
13+
<button type="button" [disabled]="!filterName.value" (click)="clearInputFilter()" class="clear-button">X</button>
1414
</div>
1515
</div>
Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,52 @@
1-
/* Material CSS start */
2-
3-
.mat-multiselect :host .helper-buttons {
4-
border-bottom: 1px solid #ddd;
5-
padding: 4px;
6-
}
7-
8-
.mat-multiselect :host .helper-button {
9-
display: inline-block;
1+
.helper-button {
102
font-weight: 400;
11-
color: #444;
12-
text-align: center;
13-
vertical-align: middle;
3+
font-size: .75rem;
4+
max-height: 30px;
5+
white-space: nowrap;
6+
height: 30px;
7+
border-radius: .25rem;
148
-webkit-user-select: none;
159
-moz-user-select: none;
1610
-ms-user-select: none;
1711
user-select: none;
12+
border: 1px solid rgba(0,0,0,.12);
13+
}
14+
15+
fieldset {
16+
padding: 0;
17+
border: none;
18+
}
19+
20+
.helper-buttons {
21+
border-bottom: 1px solid #ddd;
22+
padding: 2px;
23+
}
24+
25+
/* Material CSS start */
26+
27+
.mat-multiselect :host .helper-button {
1828
background-color: transparent;
19-
border: 1px solid transparent;
20-
padding: 0.13rem 0.13rem;
21-
font-size: 0.75rem;
22-
line-height: 1.5;
23-
border-radius: 0.25rem;
24-
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
25-
box-shadow 0.15s ease-in-out;
26-
border-color: rgba(0, 0, 0, 0.12);
29+
color: #444;
2730
}
2831

2932
.mat-multiselect :host .helper-button:not(:last-child) {
30-
margin-right: 4px;
33+
margin: 0 2px;
3134
}
3235

3336
/* Material CSS end */
3437

3538
/* Boostrap CSS start */
3639

37-
.bs-multiselect :host .helper-buttons {
38-
border-bottom: 1px solid #ddd;
39-
padding: 4px 4px 4px;
40-
}
41-
4240
.bs-multiselect :host .helper-button {
43-
max-height: 26px;
44-
height: 26px;
45-
border: 1px solid rgba(0, 0, 0, 0.12) !important;
46-
padding: 0px 4px 0px;
4741
box-sizing: border-box;
48-
position: relative;
49-
-webkit-user-select: none;
50-
-moz-user-select: none;
51-
-ms-user-select: none;
52-
user-select: none;
5342
cursor: pointer;
5443
outline: 0;
55-
border: none;
44+
padding: .25em;
5645
-webkit-tap-highlight-color: transparent;
57-
display: inline-block;
58-
white-space: nowrap;
59-
text-decoration: none;
60-
vertical-align: baseline;
61-
text-align: center;
62-
margin: 0;
63-
min-width: 60px;
64-
line-height: 25px;
65-
border-radius: 4px;
66-
overflow: visible;
6746
}
6847

6948
.bs-multiselect .helper-button:not(:last-child) {
7049
margin-right: 4px;
7150
}
7251

7352
/* Boostrap CSS end */
74-
75-
fieldset {
76-
padding: 0;
77-
border: none;
78-
}

0 commit comments

Comments
 (0)