Skip to content

Commit 579776a

Browse files
committed
build: Moved ExpansibleCollection to resource-collection
1 parent 4bc4d37 commit 579776a

File tree

7 files changed

+51
-114
lines changed

7 files changed

+51
-114
lines changed

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A Vue adaptable table, some components to be used to render and control [Page Co
44

55
# Install
66
```
7-
npm i @simpli/vue-adap-table @simpli/resource-collection class-transformer simple-line-icons
7+
npm i @simpli/vue-adap-table @simpli/resource-collection @simpli/vue-await class-transformer simple-line-icons swiper vue-awesome-swiper vue-transition-expand
88
```
99

1010
## Import
@@ -19,6 +19,8 @@ On your Scss:
1919
@import "~@simpli/vue-adap-table/scss/adapOrderby";
2020
@import "~@simpli/vue-adap-table/scss/adapPagination";
2121
@import "~@simpli/vue-adap-table/scss/adapSearchfield";
22+
@import "~@simpli/vue-adap-table/scss/adapExpansion";
23+
@import "~@simpli/vue-adap-table/scss/adapSwiper";
2224
$simple-line-font-path: "~simple-line-icons/fonts/" !default;
2325
@import "~simple-line-icons/scss/simple-line-icons";
2426
```
@@ -66,9 +68,48 @@ export default class MyComponent extends Mixins(MixinAdapRoute) {
6668
// optionally you can use the mixin and initialize it with this method
6769
// so the browser URL will match the search, orderby and pagination properties
6870
this.initAdapRoute(this.collection)
69-
71+
7072
// load the collection content using the mixin
7173
await this.query()
7274
}
7375
}
7476
```
77+
78+
## Usage AdapExpansion
79+
```html
80+
<adap-expansion spinner="customSpinner" :collection="collection">
81+
<template slot="notEmpty">
82+
<!--example using tailwind grid system-->
83+
<div class="grid grid-cols-2 gap-10">
84+
<div v-for="item in collection.items" :key="item.$id">
85+
<div>
86+
{{ item.$tag }}
87+
</div>
88+
</div>
89+
</div>
90+
</template>
91+
92+
<template slot="empty">
93+
<div class="text-center text-xl">
94+
Empty list
95+
</div>
96+
</template>
97+
98+
<template slot="expand" slot-scope="props">
99+
<button @click="props.expandEvent">
100+
Load more
101+
</button>
102+
</template>
103+
</adap-expansion>
104+
```
105+
On Code:
106+
```typescript
107+
@Component
108+
export default class MyComponent extends Vue {
109+
collection = new MyCollection()
110+
111+
async created() {
112+
await this.$await.run('customSpinner', () => this.collection.expand())
113+
}
114+
}
115+
```

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"vue-property-decorator": "^7.2.0"
7070
},
7171
"peerDependencies": {
72-
"@simpli/resource-collection": "1.0.8",
72+
"@simpli/resource-collection": "1.1.0",
7373
"@simpli/vue-await": "^1.0.5",
7474
"class-transformer": "0.2.3",
7575
"simple-line-icons": "^2.4.1",
@@ -78,7 +78,7 @@
7878
"vue-transition-expand": "^0.1.0"
7979
},
8080
"devDependencies": {
81-
"@simpli/resource-collection": "1.0.8",
81+
"@simpli/resource-collection": "1.1.0",
8282
"@simpli/vue-await": "^1.0.5",
8383
"@types/jest": "24.0.11",
8484
"@types/node": "10.11.7",

src/AdapExpansion.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ const template = `
3434

3535
import { Component, Prop, Watch, Vue } from 'vue-property-decorator'
3636
import { ResizeSensor } from 'css-element-queries'
37-
import { IResource } from '@simpli/resource-collection'
38-
import { ExpansibleCollection } from './ExpansibleCollection'
37+
import { ExpansibleCollection, IResource } from '@simpli/resource-collection'
3938

4039
@Component({ template })
4140
export class AdapExpansion extends Vue {

src/AdapSwiper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ const template = `
3434
`
3535

3636
import { Component, Prop, Watch, Mixins } from 'vue-property-decorator'
37-
import { IResource } from '@simpli/resource-collection'
37+
import { ExpansibleCollection, IResource } from '@simpli/resource-collection'
3838
import { SwiperOptions } from 'swiper'
3939
import { MixinAdapScreenSize } from './MixinAdapScreenSize'
40-
import { ExpansibleCollection } from './ExpansibleCollection'
4140
// @ts-ignore
4241
import { SwiperComponent } from 'vue-awesome-swiper'
4342
import AdapTableWrapper from './index'

src/ExpansibleCollection.ts

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

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { AdapOrderby } from './AdapOrderby'
44
import { AdapPagination } from './AdapPagination'
55
import { AdapSearchfield } from './AdapSearchfield'
66
import { AdapSwiper } from './AdapSwiper'
7-
import { ExpansibleCollection } from './ExpansibleCollection'
87
import { MixinAdapRoute } from './MixinAdapRoute'
98
import { MixinAdapScreenSize } from './MixinAdapScreenSize'
109

@@ -54,4 +53,4 @@ export default class AdapTableWrapper {
5453
}
5554
}
5655

57-
export { AdapOrderby, AdapPagination, AdapSearchfield, ExpansibleCollection, MixinAdapRoute, MixinAdapScreenSize }
56+
export { AdapOrderby, AdapPagination, AdapSearchfield, MixinAdapRoute, MixinAdapScreenSize }

0 commit comments

Comments
 (0)