Skip to content

Commit 821fe0c

Browse files
committed
Merge branch 'release/4.5.0'
2 parents 8a4df89 + 3420369 commit 821fe0c

File tree

68 files changed

+575
-322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+575
-322
lines changed

projects/truly-ui/src/components/autocomplete/autocomplete.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<div class="ui-autocomplete-box">
2-
32
<tl-label *ngIf="label" [required]="required" [labelTitle]="label" [labelPlacement]="labelPlacement" [labelSize]="labelSize"></tl-label>
43
<div [class]="'ui-autocomplete-wrapper ' + color">
54
<div class="ui-wrapper-filter"
@@ -21,6 +20,7 @@
2120
[iconAfter]="iconAfter"
2221
[textBefore]="textBefore"
2322
[textAfter]="textAfter"
23+
[height]="height"
2424
(clear)="onClickClose()"
2525
(click)="toggleIsOpen()"
2626
(clickAddon)="clickAddon.emit($event)"

projects/truly-ui/src/components/autocomplete/autocomplete.scss

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
width: 18px;
1717
display: flex;
1818
align-items: center;
19-
place-content: center;
19+
justify-content: center;
2020
font-size: 1.6em;
2121
opacity: 0.3;
2222
z-index: 1;
@@ -134,15 +134,13 @@
134134
background: #fff;
135135
cursor: pointer;
136136
outline: none;
137-
border-top: 1px solid #cccccc2e;
138-
color: #000000c4;
137+
border-top: 1px solid rgba(204, 204, 204, 0.3);
138+
color: rgb(87, 86, 86);
139139
> .ui-icon {
140140
padding-right: 5px;
141141
}
142142
&:focus:not(.selected) {
143143
opacity: 1;
144-
background: #d5d5d56b !important;
145-
color: #000000c4 !important;
146144
}
147145

148146
&:hover {

projects/truly-ui/src/components/autocomplete/autocomplete.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class TlAutoComplete extends ValueAccessorBase<any> implements OnChanges,
9191

9292
@Input() openFocus = true;
9393

94-
@Input() loading = true;
94+
@Input() loading = false;
9595

9696
@Input() clearButton = true;
9797

@@ -226,16 +226,14 @@ export class TlAutoComplete extends ValueAccessorBase<any> implements OnChanges,
226226
private handleItemSelected() {
227227
if ( this.itemSelectedService.itemSelected ) {
228228
this.scrollToIndex().then( value => {
229-
setTimeout( () => {
230-
this.keyManager.setActiveItem( this.itemSelectedService.itemSelected.indexSelected );
231-
}, 200 );
229+
this.keyManager.setActiveItem( this.itemSelectedService.itemSelected.indexSelected );
232230
} );
233231
}
234232
}
235233

236234

237235
private scrollToIndex() {
238-
return new Promise( ( resolve, reject ) => {
236+
return new Promise( ( resolve ) => {
239237
setTimeout( () => {
240238
if ( this.cdkVirtualScroll ) {
241239
this.cdkVirtualScroll.scrollToIndex( this.lastItemScrolled );
@@ -347,6 +345,10 @@ export class TlAutoComplete extends ValueAccessorBase<any> implements OnChanges,
347345
}
348346

349347
handleKeyArrowDown( $event ) {
348+
if ( this.loading ) {
349+
this.stopEvent($event);
350+
return;
351+
}
350352
this.handleEventOpenList( $event );
351353
if ( !this.keyManager.activeItem ) {
352354
this.keyManager.setFirstItemActive();
@@ -437,7 +439,6 @@ export class TlAutoComplete extends ValueAccessorBase<any> implements OnChanges,
437439
this.listenLoadData();
438440
this.handleModelCached();
439441
}
440-
this.loading = false;
441442
this.dataSource.setData( value );
442443
this.setNotFound( value.length === 0 );
443444
this.setFirstItemActive();
@@ -452,9 +453,6 @@ export class TlAutoComplete extends ValueAccessorBase<any> implements OnChanges,
452453
}
453454

454455
private listenLoadData() {
455-
if ( !this.dataSource ) {
456-
return;
457-
}
458456
this.subscription.add( this.dataSource.loadMoreData.subscribe( ( data: any ) => {
459457
this.lazyLoad.emit( { skip: data.skip, limit: data.limit, ...this.getFilters( this.description ) } );
460458
} ) );

projects/truly-ui/src/components/blockui/blockui.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
.blockui-content {
2222
display: flex;
23-
place-content: start center;
23+
justify-content: start center;
2424
flex-direction: column;
2525
align-items: center;
2626
text-align: center;

projects/truly-ui/src/components/button/button.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $button-text-align: center;
3030
display: flex;
3131
align-items: center;
3232
margin: 0 8px;
33-
place-content: center;
33+
justify-content: center;
3434
width: 100%;
3535
.label {
3636
padding: 0 10px;

projects/truly-ui/src/components/calendar/calendar.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
position: relative;
33
display: flex;
44
align-items: flex-start;
5-
place-content: flex-start;
5+
justify-content: flex-start;
66
flex-flow: column;
77

88
>.ui-calendar-header {
@@ -12,14 +12,14 @@
1212
width: 100%;
1313
height: 50px;
1414
box-sizing: border-box;
15-
place-content: space-between;
15+
justify-content: space-between;
1616
}
1717

1818
>.ui-calendar-week {
1919
height: 25px;
2020
display: flex;
2121
align-items: center;
22-
place-content: center;
22+
justify-content: center;
2323
width: 100%;
2424
>.ui-header-item {
2525
width: 100%;
@@ -34,7 +34,7 @@
3434
>.ui-calendar-body {
3535
display: flex;
3636
align-items: center;
37-
place-content: center;
37+
justify-content: center;
3838
width: 100%;
3939
overflow: hidden;
4040
}

projects/truly-ui/src/components/calendar/parts/calendar-days/calendar-days.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
.ui-calendar-days {
1111
display: flex;
1212
align-items: center;
13-
place-content: center;
13+
justify-content: center;
1414
width: 100%;
1515
height: 100%;
1616
}
@@ -28,7 +28,7 @@
2828
.ui-calendar-cell {
2929
flex: 1;
3030
display: flex;
31-
place-content: center;
31+
justify-content: center;
3232
align-items: center;
3333
font-size: 1em;
3434
font-weight: 500;

projects/truly-ui/src/components/calendar/parts/calendar-months/calendar-months.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
flex: 1;
1919
flex-basis: calc(100% / 3);
2020
align-items: center;
21-
place-content: center;
21+
justify-content: center;
2222
&:hover {
2323
cursor: pointer;
2424
}

projects/truly-ui/src/components/calendar/parts/calendar-years/calendar-years.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
flex-basis: calc(100% / 3);
2020
color: #5a5a5a;
2121
align-items: center;
22-
place-content: center;
22+
justify-content: center;
2323
&:hover {
2424
cursor: pointer;
2525
background: rgba(102, 204, 153, 0.15);

projects/truly-ui/src/components/card/card.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
width: 100%;
44
display: flex;
55
align-items: center;
6-
place-content: flex-start;
6+
justify-content: flex-start;
77
flex-flow: column;
88
border-radius: 5px;
99
transition: border-color, box-shadow 300ms linear;

projects/truly-ui/src/components/chatlist/chatlist.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
display: flex;
66
position: relative;
77
align-items: center;
8-
place-content: space-evenly;
8+
justify-content: space-evenly;
99
height: 35px;
1010
flex-wrap: wrap;
1111
z-index: 1;
@@ -36,7 +36,7 @@
3636
height: 100%;
3737
text-align: center;
3838
display: flex;
39-
place-content: center;
39+
justify-content: center;
4040
align-items: center;
4141
z-index: 0;
4242
cursor: pointer;
@@ -77,7 +77,7 @@
7777
border-radius: 50%;
7878
border-style: solid;
7979
border-width: 2px;
80-
place-content: center;
80+
justify-content: center;
8181
display: flex;
8282
}
8383

@@ -100,7 +100,7 @@
100100
height: 25px;
101101
border-radius: 50%;
102102
display: flex;
103-
place-content: center;
103+
justify-content: center;
104104
align-items: center;
105105
animation: shadow-pulse 1s infinite;
106106
}
@@ -142,7 +142,7 @@
142142
.chat-partner-wrapper {
143143
display: flex;
144144
align-items: center;
145-
place-content: flex-start;
145+
justify-content: flex-start;
146146
width: 100%;
147147
padding: 0 10px;
148148
color: white;
@@ -173,7 +173,7 @@
173173
.chat-without-contacts {
174174
display: flex;
175175
align-items: center;
176-
place-content: center;
176+
justify-content: center;
177177
width: 100%;
178178
height: 100%;
179179
flex-flow: column;

projects/truly-ui/src/components/chatlist/parts/chat-content.scss

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
display: flex;
7575
align-items: flex-end;
7676
flex-flow: column;
77-
place-content: center;
77+
justify-content: center;
7878
word-break: break-all;
7979
background: white;
8080
color: #464646;
@@ -123,13 +123,13 @@
123123

124124
.chat-user {
125125
display: flex;
126-
place-content: flex-end;
126+
justify-content: flex-end;
127127
animation: showIn 200ms ease-in forwards;
128128
> .chat-text-content {
129129
display: flex;
130130
align-items: flex-end;
131131
flex-flow: column;
132-
place-content: center;
132+
justify-content: center;
133133
word-break: break-all;
134134
background: #e3fdf4;
135135
color: #464646;
@@ -187,7 +187,7 @@
187187
color: #66cc99;
188188
display: flex;
189189
align-items: center;
190-
place-content: center;
190+
justify-content: center;
191191
font-size: 1.5em;
192192
background: white;
193193
transition: background, color 400ms ease-in-out;
@@ -204,7 +204,7 @@
204204
height: 100%;
205205
width: 100%;
206206
display: flex;
207-
place-content: center;
207+
justify-content: center;
208208
align-items: center;
209209
flex-flow: column;
210210
> .chat-loader {

projects/truly-ui/src/components/core/classes/datasource-list.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ export class DataSourceList extends DataSource<string | undefined> {
8383
}
8484

8585
public resetPages() {
86-
this.fetchedPages = new Set<number>();
87-
this.fetchedPages.add(0);
86+
this.fetchedPages.clear();
8887
}
8988

9089
private setProprieties(config) {
@@ -102,6 +101,11 @@ export class DataSourceList extends DataSource<string | undefined> {
102101
this.arrayTotal.splice(this.currentPage * this.pageSize, this.pageSize,
103102
...data);
104103
this.dataStream.next( this.arrayTotal );
104+
if ( data.length === this.pageSize) {
105+
if ( !this.fetchedPages.has(0) ) {
106+
this.fetchedPages.add(0);
107+
}
108+
}
105109
}
106110

107111
private getPageForIndex( index: number ): number {

projects/truly-ui/src/components/datepicker/datepicker.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class TlDatePicker extends ValueAccessorBase<Date | string> implements On
237237
}
238238

239239
onCompleteMask() {
240-
setTimeout(() => {
240+
const timeout = setTimeout(() => {
241241
this.handleDateChange();
242242
if (this.isoDate) {
243243
this.value = this.getObjectValues().fullDate.toISOString();
@@ -246,6 +246,7 @@ export class TlDatePicker extends ValueAccessorBase<Date | string> implements On
246246
}
247247
this.changes.detectChanges();
248248
this.completeMask.emit(this.getObjectValues());
249+
clearTimeout(timeout);
249250
}, 500);
250251

251252
}
@@ -276,6 +277,7 @@ export class TlDatePicker extends ValueAccessorBase<Date | string> implements On
276277
}
277278

278279
onClearInput($event) {
280+
this.value = null;
279281
$event.stopPropagation();
280282
}
281283

projects/truly-ui/src/components/dropdownlist/dropdownlist.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="ui-dropdown-box" [ngStyle]="{'line-height' : itemHeight, 'width': width}">
22

3-
<div class="ui-loading-icon" [style.height]="itemHeight">
4-
<tl-loader *ngIf="isLoading"></tl-loader>
3+
<div class="ui-loading-icon" [style.height]="itemHeight" *ngIf="isLoading">
4+
<tl-loader></tl-loader>
55
</div>
66

77
<tl-label *ngIf="label"

projects/truly-ui/src/components/dropdownlist/dropdownlist.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
Optional,
2929
ContentChild,
3030
ViewChild,
31-
ElementRef, OnChanges, EventEmitter, AfterContentInit, OnInit, ChangeDetectorRef
31+
ElementRef, OnChanges, EventEmitter, AfterContentInit, OnInit, ChangeDetectorRef, SimpleChanges
3232
} from '@angular/core';
3333

3434
import * as objectPath from 'object-path';
@@ -365,7 +365,11 @@ export class TlDropDownList extends ValueAccessorBase<any> implements OnChanges,
365365
return String( objectPath.get( item, this.keyText ) ).substring( 0, 1 ).toLowerCase();
366366
}
367367

368-
ngOnChanges( changes ) {
368+
ngOnChanges( { data }: SimpleChanges ) {
369+
if ( data ) {
370+
if (!data.firstChange && data.currentValue.length === 0) {
371+
this.isLoading = false;
372+
}
373+
}
369374
}
370-
371375
}

0 commit comments

Comments
 (0)