Skip to content

Commit bba687a

Browse files
committed
fix: fix issue
1 parent 4000bc5 commit bba687a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

scss/adapExpansion.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.expansible {
22
.expansible__content {
3-
@apply relative w-full;
3+
position: relative;
4+
width: 100%;
45
transition: height 1000ms ease-in-out;
56
}
67
}

src/ExpansibleCollection.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
import { PageCollection, IResource } from '@simpli/resource-collection'
2-
import { classToClass, Exclude } from 'class-transformer'
2+
import { classToClass, Exclude, Expose, Type } from 'class-transformer'
33

44
@Exclude()
55
export abstract class ExpansibleCollection<R extends IResource> extends PageCollection<R> {
6+
currentPage: number | null = null
67
queryAsExpansible = this.queryAsPage
78

89
items: R[] = [] // final list
910
protected expandedItems: R[] = [] // anti-clone list
1011

11-
protected abstract addedItems: R[] = []
12+
@Type(options => (options!.newObject as ExpansibleCollection<R>).classType)
13+
@Expose({ name: 'items', toPlainOnly: true })
14+
protected addedItems: R[] = [] // cache list (replaces items from PageCollection)
1215

1316
protected isExpanding = false
1417

18+
get isLastPage() {
19+
return this.currentPage === this.lastPage
20+
}
21+
1522
get maxPerPage() {
1623
const perPage = Number(this.perPage) || 0
1724
return Math.max(this.size(), perPage)

0 commit comments

Comments
 (0)