-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea8eb90
commit a926724
Showing
11 changed files
with
636 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
libs/database/src/lib/components/data-list/data-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<sio-list | ||
[data]="this.store.selectAll()" | ||
[header]="this.header" | ||
[label]="this.label" | ||
[thumbnail]="this.thumbnail" | ||
[LeftSwipe]="this.LeftSwipe" | ||
[infinite]="this.infinite" | ||
(sioCoreListItemLeftSwipe)="this.sioCoreItemLeftSwipe($event)" | ||
(sioCoreListItemRightSwipe)="this.sioCoreItemRightSwipe($event)" | ||
(sioCoreListInfinite)="this.sioCoreListInfinite($event)" | ||
(sioRefreshList)="(this.re)" | ||
></sio-list> |
Empty file.
106 changes: 106 additions & 0 deletions
106
libs/database/src/lib/components/data-list/data-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | ||
import { SioCoreLoggerService, SioColorType } from '@silicia/core'; | ||
import { AttributeBoolean } from '@angular-ru/cdk/decorators'; | ||
import { InputBoolean } from '@angular-ru/cdk/typings'; | ||
import { | ||
InfiniteScrollCustomEvent, | ||
RefresherCustomEvent, | ||
} from '@ionic/angular'; | ||
import { SioDatabaseState } from '../../store'; | ||
|
||
@Component({ | ||
selector: 'sio-datalist', | ||
templateUrl: './list.component.html', | ||
styleUrls: ['./list.component.scss'], | ||
}) | ||
export class SioDatabaseListComponent implements OnInit { | ||
// input related to this component | ||
@Input() public store: SioDatabaseState<never> | undefined = undefined; | ||
|
||
// Wrapped input for subcomponents | ||
|
||
@Input() public id = 'main'; | ||
@Input() public lines: 'full' | 'inset' | 'none' = 'none'; | ||
//@Input() public shape: 'line' | 'dot' | 'rounded' = 'line'; | ||
@Input() public position: 'side' | 'bottom' | 'top' = 'side'; | ||
@Input() public color: SioColorType; | ||
@Input() public toggleIconSlot: 'start' | 'end' = 'end'; | ||
@Input() public toggleIcon = 'chevron-up-outline'; | ||
@Input() public shape: 'compact' | 'inset' = 'compact'; | ||
@Input() public style: 'default' | 'rounded' | 'custom' = 'default'; | ||
@Input() public desktop = false; | ||
|
||
@AttributeBoolean() | ||
@Input() | ||
public infinite: InputBoolean = false; | ||
|
||
@AttributeBoolean() | ||
@Input() | ||
public enableLeftSwipe: InputBoolean; | ||
|
||
@AttributeBoolean() | ||
@Input() | ||
public enableRightSwipe: InputBoolean = true; | ||
|
||
@Input() public header = 'name'; | ||
@Input() public label = 'description'; | ||
@Input() public icon: string | undefined; | ||
@Input() public avatar: string | undefined; | ||
@Input() public thumbnail: string | undefined; | ||
|
||
@Output() Click = new EventEmitter<Record<string, number | string>>(); | ||
@Output() LeftSwipe = new EventEmitter<Record<string, number | string>>(); | ||
@Output() RightSwipe = new EventEmitter<Record<string, number | string>>(); | ||
@Output() Infinite = new EventEmitter<Record<string, number | string>>(); | ||
@Output() Refresh = new EventEmitter<Record<string, number | string>>(); | ||
|
||
constructor(private sioCoreLoggerService: SioCoreLoggerService) { | ||
this.sioCoreLoggerService.debug('[SioDatabaseListComponent][constructor]'); | ||
} | ||
|
||
ngOnInit(): void { | ||
this.sioCoreLoggerService.debug('[SioDatabaseListComponent][ngOnInit]'); | ||
} | ||
|
||
public onLeftSwipe(data: Record<string, number | string>) { | ||
this.sioCoreLoggerService.debug( | ||
'[SioDatabaseListComponent][onLeftSwipe]', | ||
data, | ||
); | ||
this.LeftSwipe.emit(data); | ||
} | ||
public onRighSwipe(data: Record<string, number | string>) { | ||
this.sioCoreLoggerService.debug( | ||
'[SioDatabaseListComponent][onRightSwipe]', | ||
data, | ||
); | ||
this.RightSwipe.emit(data); | ||
} | ||
|
||
public onRefresh(data: Event) { | ||
this.sioCoreLoggerService.debug( | ||
'[SioDatabaseListComponent][onRefresh]', | ||
data, | ||
); | ||
if (this.store) this.store.load(); | ||
this.Refresh.emit(); | ||
setTimeout(() => { | ||
(data as RefresherCustomEvent).target.complete(); | ||
}, 500); | ||
} | ||
|
||
public onInfinite(data: Event) { | ||
this.sioCoreLoggerService.debug( | ||
'[sioDatabaseListComponent][onInfinite]', | ||
data, | ||
); | ||
this.Infinite.emit({ LastId: this.store!.pop().$id }); | ||
if (this.store) { | ||
this.store.setRemoteIndex(''); | ||
this.store.load(); | ||
} | ||
setTimeout(() => { | ||
(data as InfiniteScrollCustomEvent).target.complete(); | ||
}, 500); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './data-list.component'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.