Skip to content

Commit

Permalink
feat: moved indicator into it's own package
Browse files Browse the repository at this point in the history
BREAKING CHANGE: You now create a `PagerIndicator`(from `@nativescript-community/ui-pager-indicator) and set `pagerViewId` on it to the id of your Pager.
  • Loading branch information
farfromrefug committed Jan 23, 2023
1 parent 2487f0c commit 631859d
Show file tree
Hide file tree
Showing 36 changed files with 4,874 additions and 592 deletions.
3 changes: 2 additions & 1 deletion demo-snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"version": "0.0.1",
"dependencies": {
"@nativescript-community/ui-pager": "link:../packages/ui-pager"
"@nativescript-community/ui-pager": "link:../packages/ui-pager",
"@nativescript-community/ui-pager-indicator": "link:../packages/ui-pager-indicator"
}
}
9 changes: 5 additions & 4 deletions demo-snippets/vue/Indicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
<Label text="Indicator" />
</ActionBar>

<StackLayout class="page">
<Pager ref="pager" for="item in items" :selectedIndex="selectedIndex" @selectedIndexChange="selectedIndexChange" height="300" indicator="fill" showIndicator="true">
<GridLayout class="page" rows="*,auto">
<Pager ref="pager" id="pager" :items="items" :selectedIndex="selectedIndex" @selectedIndexChange="selectedIndexChange">
<v-template>
<GridLayout :backgroundColor="item.color">
<Label :text="item.title" />
</GridLayout>
</v-template>
</Pager>
<Button text="Reset" @tap="resetPager" />
</StackLayout>
<PagerIndicator pagerViewId="pager" type="fill" verticalAlignment="bottom" horizontalAlignment="center" marginBottom="10"/>
<Button row="1" text="Reset" @tap="resetPager" />
</GridLayout>
</Page>
</template>

Expand Down
1 change: 1 addition & 0 deletions demo-snippets/vue/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import RenderIssue from './RenderIssue.vue';

export function installPlugin() {
Vue.use(Pager);
Vue.registerElement('PagerIndicator', () => require('@nativescript-community/ui-pager-indicator').PagerIndicator);
}

export const demos = [
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
]
},
"dependencies": {
"@nativescript-community/plugin-seed-tools": "file:tools"
"@nativescript-community/plugin-seed-tools": "file:tools",
"@nativescript-community/template-snippet": "file:demo-snippets"
},
"ntl": {
"descriptions": {
Expand Down
8 changes: 8 additions & 0 deletions packages/ui-pager-indicator/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
tsconfig.json
node_modules/
pnpm-global/
CHANGELOG.md
blueprint.md
*.aar
*.jar
Loading

0 comments on commit 631859d

Please sign in to comment.