Skip to content

Commit 7e221bb

Browse files
committed
feat: speeddial basic package
1 parent 318177e commit 7e221bb

File tree

17 files changed

+951
-79
lines changed

17 files changed

+951
-79
lines changed

demo-vue/app.webpack.config.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,19 @@ module.exports = (env, params = {}) => {
8787
'@nativescript-community/ui-material-button/button$': '#/button/button.' + platform,
8888
'../button$': '#/button/button.' + platform,
8989

90+
'@nativescript-community/ui-material-speeddial$': '#/speeddial/index',
91+
'@nativescript-community/ui-material-speeddial/vue$': '#/speeddial/vue/index',
92+
9093
'@nativescript-community/ui-material-tabs$': '#/tabs/tabs.' + platform,
9194
'@nativescript-community/ui-material-tabs/vue$': '#/tabs/vue/index',
9295
'@nativescript-community/ui-material-tabs/tabs$': '#/tabs/button.' + platform,
9396
'../tabs$': '#/tabs/tabs.' + platform,
9497

9598
'@nativescript-community/ui-material-textfield$': '#/textfield/textfield',
9699
'@nativescript-community/ui-material-textfield': '#/textfield',
97-
// '@nativescript-community/ui-material-textfield/textfield$': '#/textfield/textfield.' + platform,
98-
// '@nativescript-community/ui-material-textfield/textfield_cssproperties$': '#/textfield/textfield_cssproperties',
99-
// '@nativescript-community/ui-material-textfield/vue$': '#/textfield/vue/index',
100-
// '../textfield$': '#/textfield/textfield.' + platform,
101100

102101
'@nativescript-community/ui-material-textview$': '#/textview/textview',
103102
'@nativescript-community/ui-material-textview': '#/textview',
104-
// '@nativescript-community/ui-material-textview/textview$': '#/textview/textview.' + platform,
105-
// '@nativescript-community/ui-material-textview/textview_cssproperties$': '#/textview/textview_cssproperties',
106-
// '@nativescript-community/ui-material-textview/vue$': '#/textview/vue/index',
107-
// '../textfield$': '#/textview/textview.' + platform,
108103

109104
'@nativescript-community/ui-material-floatingactionbutton$': '#/floatingactionbutton/floatingactionbutton.' + platform,
110105
'@nativescript-community/ui-material-floatingactionbutton/vue$': '#/floatingactionbutton/vue/index',

demo-vue/app/examples/Speeddial.vue

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<template>
2+
<Page>
3+
<ActionBar :title="title">
4+
<NavigationButton text="Back" android.systemIcon="ic_menu_back" @tap="onNavigationButtonTap" />
5+
</ActionBar>
6+
<MDTabs>
7+
<!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
8+
<TabStrip>
9+
<TabStripItem>
10+
<Label text="Home" />
11+
<Image src="font://mdi-home" class="mdi" />
12+
</TabStripItem>
13+
<TabStripItem class="special">
14+
<Label text="Account" />
15+
<Image src="font://mdi-account" class="mdi" />
16+
</TabStripItem>
17+
<TabStripItem class="special">
18+
<Label text="Search" />
19+
<Image src="font://mdi-magnify" class="mdi" />
20+
</TabStripItem>
21+
</TabStrip>
22+
23+
<TabContentItem>
24+
<GridLayout>
25+
<DockLayout width="100%" height="100%">
26+
<MDButton dock="top" text="test" />
27+
<MDButton dock="left" text="test1" />
28+
<MDButton dock="bottom" text="test2" />
29+
<MDButton class="btn" dock="right" text="test3" />
30+
</DockLayout>
31+
<MDSpeedDial buttonFontSize="26" text="mdi-one-up" buttonClass="mdi" buttonBackgroundColor="yellow" @tap="onTap">
32+
<MDSpeedDialItem icon="res://ic_action_add" title="test1" backgroundColor="red" @tap="onTap"/>
33+
<MDSpeedDialItem text="mdi-card-account-mail" title="test2" buttonClass="mdi" backgroundColor="green" @tap="onTap"/>
34+
<MDSpeedDialItem backgroundImage="~/images/iu.jpg" backgroundColor="blue" @tap="onTap"/>
35+
<MDSpeedDialItem icon="res://ic_action_add" title="test4" backgroundColor="orange" @tap="onTap"/>
36+
</MDSpeedDial>
37+
</GridLayout>
38+
</TabContentItem>
39+
<TabContentItem>
40+
<GridLayout backgroundColor="green">
41+
<Label text="Account Page" class="h2 text-center"></Label>
42+
</GridLayout>
43+
</TabContentItem>
44+
<TabContentItem>
45+
<GridLayout backgroundColor="yellow">
46+
<Label text="Search Page" class="h2 text-center"></Label>
47+
</GridLayout>
48+
</TabContentItem>
49+
</MDTabs>
50+
</Page>
51+
</template>
52+
53+
<script lang="ts">
54+
import { Frame } from '@nativescript/core';
55+
import { EventData } from '@nativescript/core';
56+
57+
import Vue from 'vue';
58+
59+
export const title = 'SpeedDial sample';
60+
61+
export default Vue.extend({
62+
name: 'SpeedDial',
63+
data() {
64+
return {
65+
title
66+
};
67+
},
68+
methods: {
69+
onNavigationButtonTap() {
70+
Frame.topmost().goBack();
71+
},
72+
onTap(event) {
73+
console.log('Button tapped', event.object, Date.now());
74+
},
75+
}
76+
});
77+
</script>
78+
79+
<style></style>

demo-vue/app/examples/index.ts

Lines changed: 67 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -11,74 +11,73 @@ import TextFields, { title as textFieldsTitle } from './TextFields.vue';
1111
import TextViews, { title as textViewsTitle } from './TextView.vue';
1212
import ButtonIssue, { title as buttonIssueTitle } from './ButtonIssue.vue';
1313
import BottomSheet, { title as bottomsheetTitle } from './BottomSheet.vue';
14+
import SpeedDial, { title as speeddialTitle } from './Speeddial.vue';
1415
import Tabs, { title as tabsTitle } from './Tabs.vue';
1516
import Mixins, { title as mixinsTitle } from './Mixins.vue';
1617

17-
export const getExamples = () => {
18-
return [
19-
{
20-
title: buttonsTitle,
21-
component: Buttons
22-
},
23-
{
24-
title: buttonIssueTitle,
25-
component: ButtonIssue
26-
},
27-
{
28-
title: bottomNavigationBarTitle,
29-
component: BottomNavigationBar
30-
},
31-
{
32-
title: tabsTitle,
33-
component: Tabs
34-
},
35-
{
36-
title: cardViewsTitle,
37-
component: CardViews
38-
},
39-
{
40-
title: activityIndicatorsTitle,
41-
component: ActivityIndicators
42-
},
43-
{
44-
title: textFieldsTitle,
45-
component: TextFields
46-
},
47-
{
48-
title: textViewsTitle,
49-
component: TextViews
50-
},
51-
{
52-
title: progressBarsTitle,
53-
component: ProgressBars
54-
},
55-
{
56-
title: slidersTitle,
57-
component: Sliders
58-
},
59-
{
60-
title: ripplesTitle,
61-
component: Ripples
62-
},
63-
{
64-
title: dialogsTitle,
65-
component: Dialogs
66-
},
67-
{
68-
title: snackTitle,
69-
component: SnackBar
70-
},
71-
{
72-
title: bottomsheetTitle,
73-
component: BottomSheet
74-
},
75-
{
76-
title: snackTitle,
77-
component: SnackBar
78-
},
79-
{
80-
title: mixinsTitle,
81-
component: Mixins
82-
}
83-
];
84-
};
18+
export const getExamples = () => [
19+
{
20+
title: buttonsTitle,
21+
component: Buttons
22+
},
23+
{
24+
title: speeddialTitle,
25+
component: SpeedDial
26+
},
27+
{
28+
title: bottomNavigationBarTitle,
29+
component: BottomNavigationBar
30+
},
31+
{
32+
title: tabsTitle,
33+
component: Tabs
34+
},
35+
{
36+
title: cardViewsTitle,
37+
component: CardViews
38+
},
39+
{
40+
title: activityIndicatorsTitle,
41+
component: ActivityIndicators
42+
},
43+
{
44+
title: textFieldsTitle,
45+
component: TextFields
46+
},
47+
{
48+
title: textViewsTitle,
49+
component: TextViews
50+
},
51+
{
52+
title: progressBarsTitle,
53+
component: ProgressBars
54+
},
55+
{
56+
title: slidersTitle,
57+
component: Sliders
58+
},
59+
{
60+
title: ripplesTitle,
61+
component: Ripples
62+
},
63+
{
64+
title: dialogsTitle,
65+
component: Dialogs
66+
},
67+
{
68+
title: snackTitle,
69+
component: SnackBar
70+
},
71+
{
72+
title: bottomsheetTitle,
73+
component: BottomSheet
74+
},
75+
{
76+
title: snackTitle,
77+
component: SnackBar
78+
},
79+
{
80+
title: mixinsTitle,
81+
component: Mixins
82+
}
83+
];

demo-vue/app/images/iu.jpg

37.5 KB
Loading

demo-vue/app/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { install as installBottomSheet } from '@nativescript-community/ui-materi
1818
import BottomSheetPlugin from '@nativescript-community/ui-material-bottomsheet/vue';
1919
import BottomNavigationBarPlugin from '@nativescript-community/ui-material-bottomnavigationbar/vue';
2020
import TabsPlugin from '@nativescript-community/ui-material-tabs/vue';
21+
import SpeedDialPlugin from '@nativescript-community/ui-material-speeddial/vue';
2122

2223
installBottomSheet();
2324

@@ -33,6 +34,7 @@ Vue.use(TextFieldPlugin);
3334
Vue.use(BottomSheetPlugin);
3435
Vue.use(BottomNavigationBarPlugin);
3536
Vue.use(TabsPlugin);
37+
Vue.use(SpeedDialPlugin);
3638

3739
// Vue.registerElement('Label', () => require('@nativescript-community/ui-label').Label);
3840
Vue.registerElement('PreviousNextView', () => require('@nativescript/iqkeyboardmanager').PreviousNextView);
@@ -59,7 +61,7 @@ import * as views from './views';
5961

6062
Vue.component(views.Home.name, views.Home);
6163

62-
// Vue.config.silent = true;
64+
Vue.config.silent = true;
6365

6466
Vue.config.errorHandler = (e, vm, info) => {
6567
console.log('vue error', e, e.stack);

demo-vue/app/views/Home.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ export default {
2727
methods: {
2828
goToExample(item) {
2929
console.log('goToExample');
30-
this.$navigateTo(item.component);
30+
try {
31+
this.$navigateTo(item.component);
32+
} catch(err) {
33+
console.error(err);
34+
}
3135
},
3236
goToModalExample(item) {
3337
console.log('goToModalExample');

demo-vue/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"repository": "http://www.github.com/NativeScript/nativescript-ui-sidedrawer.git",
66
"dependencies": {
77
"@mdi/font": "4.9.95",
8-
"@nativescript/core": "7.0.11",
8+
"@nativescript/core": "7.0.13",
9+
"@nativescript-community/text": "1.3.6",
910
"@nativescript-community/ui-material-activityindicator": "file:../packages/activityindicator",
1011
"@nativescript-community/ui-material-bottomnavigationbar": "file:../packages/bottomnavigationbar",
1112
"@nativescript-community/ui-material-bottomsheet": "file:../packages/bottomsheet",
@@ -18,6 +19,7 @@
1819
"@nativescript-community/ui-material-ripple": "file:../packages/ripple",
1920
"@nativescript-community/ui-material-slider": "file:../packages/slider",
2021
"@nativescript-community/ui-material-snackbar": "file:../packages/snackbar",
22+
"@nativescript-community/ui-material-speeddial": "file:../packages/speeddial",
2123
"@nativescript-community/ui-material-tabs": "file:../packages/tabs",
2224
"@nativescript-community/ui-material-textfield": "file:../packages/textfield",
2325
"@nativescript-community/ui-material-textview": "file:../packages/textview",

packages/speeddial/.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
bin/
3+
src/
4+
hooks/
5+
*.ts
6+
*.old
7+
tsconfig.json
8+
!*.d.ts

0 commit comments

Comments
 (0)