Skip to content

Commit 56dbaba

Browse files
committed
feat: widgets
1 parent 748af10 commit 56dbaba

42 files changed

Lines changed: 2677 additions & 3 deletions

Some content is hidden

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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- [@nativescript/social-share](packages/social-share/README.md)
3636
- [@nativescript/theme-switcher](packages/theme-switcher/README.md)
3737
- [@nativescript/twitter](packages/twitter/README.md)
38+
- [@nativescript/widgets](packages/widgets/README.md)
3839
- [@nativescript/zip](packages/zip/README.md)
3940

4041
# How to use?

apps/demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"@nativescript/social-share": "file:../../packages/social-share",
4343
"@nativescript/theme-switcher": "file:../../packages/theme-switcher",
4444
"@nativescript/twitter": "file:../../packages/twitter",
45-
"@nativescript/zip": "file:../../packages/zip"
45+
"@nativescript/zip": "file:../../packages/zip",
46+
"@nativescript/widgets": "file:../../packages/widgets"
4647
},
4748
"devDependencies": {
4849
"@nativescript/android": "~9.0.0",

apps/demo/src/main-page.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
<Button text="google-mobile-ads" tap="{{ viewDemo }}" class="btn btn-primary view-demo"/><Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
3+
<Button text="widgets" tap="{{ viewDemo }}" class="btn btn-primary rounded view-demo"/>
34
<Page.actionBar>
45
<ActionBar title="Plugin Demos" icon="" class="action-bar"/>
56
</Page.actionBar>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Observable, EventData, Page } from '@nativescript/core';
2+
import { DemoSharedWidgets } from '@demo/shared';
3+
import {} from '@nativescript/widgets';
4+
5+
export function navigatingTo(args: EventData) {
6+
const page = <Page>args.object;
7+
page.bindingContext = new DemoModel();
8+
}
9+
10+
export class DemoModel extends DemoSharedWidgets {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
2+
<Page.actionBar>
3+
<ActionBar title="widgets" icon="" class="action-bar">
4+
</ActionBar>
5+
</Page.actionBar>
6+
<StackLayout class="p-20">
7+
<ScrollView class="h-full">
8+
<StackLayout>
9+
<Button text="Test widgets" tap="{{ testIt }}" class="btn btn-primary"/>
10+
11+
</StackLayout>
12+
</ScrollView>
13+
</StackLayout>
14+
</Page>

apps/demo/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"@nativescript/google-mobile-ads/angular": ["../../packages/google-mobile-ads/angular/index.ts"],
5252
"@nativescript/google-maps-utils": ["../../packages/google-maps-utils/index.d.ts"],
5353
"@nativescript/keyboard-toolbar": ["../../packages/keyboard-toolbar/index.d.ts"],
54-
"@nativescript/input-accessory": ["../../packages/input-accessory/index.d.ts"]
54+
"@nativescript/input-accessory": ["../../packages/input-accessory/index.d.ts"],
55+
"@nativescript/widgets": ["../../packages/widgets/index.d.ts"]
5556
}
5657
}
5758
}

packages/widgets/.eslintrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*", "node_modules/**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}

0 commit comments

Comments
 (0)