jsbox-cview 1.5.21 → 1.5.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/alert/input-alert.ts +5 -7
- package/components/alert/login-alert.ts +7 -7
- package/components/alert/plain-alert.ts +3 -3
- package/components/alert/uialert.ts +14 -6
- package/components/base.ts +12 -8
- package/components/custom-navigation-bar.ts +106 -88
- package/components/dialogs/dialog-sheet.ts +12 -8
- package/components/dialogs/form-dialog.ts +29 -16
- package/components/dialogs/list-dialog.ts +26 -20
- package/components/dialogs/text-dialog.ts +13 -8
- package/components/dynamic-contextmenu-view.ts +57 -25
- package/components/dynamic-itemsize-matrix.ts +45 -40
- package/components/dynamic-preference-listview.ts +135 -117
- package/components/dynamic-rowheight-list.ts +32 -20
- package/components/enhanced-imageview.ts +37 -28
- package/components/flowlayout.ts +61 -42
- package/components/image-pager.ts +33 -29
- package/components/page-control.ts +15 -11
- package/components/pageviewer-titlebar.ts +29 -22
- package/components/pageviewer.ts +33 -23
- package/components/refresh-button.ts +8 -8
- package/components/rotating-view.ts +24 -20
- package/components/searchbar.ts +113 -65
- package/components/sheet.ts +23 -17
- package/components/single-views.ts +228 -72
- package/components/spinners/loading-dual-ring.ts +21 -15
- package/components/spinners/loading-wedges.ts +24 -18
- package/components/spinners/spinner-androidstyle.ts +58 -47
- package/components/static-preference-listview.ts +197 -151
- package/components/symbol-button.ts +23 -22
- package/components/tabbar.ts +80 -64
- package/controller/base-controller.ts +42 -35
- package/controller/controller-router.ts +4 -4
- package/controller/pageviewer-controller.ts +41 -27
- package/controller/presented-page-controller.ts +27 -15
- package/controller/splitview-controller.ts +77 -44
- package/controller/tabbar-controller.ts +33 -23
- package/dist/components/alert/input-alert.js +3 -3
- package/dist/components/alert/login-alert.js +5 -5
- package/dist/components/alert/plain-alert.js +1 -1
- package/dist/components/alert/uialert.js +4 -4
- package/dist/components/base.js +2 -1
- package/dist/components/custom-navigation-bar.js +61 -59
- package/dist/components/dialogs/dialog-sheet.js +5 -5
- package/dist/components/dialogs/form-dialog.js +2 -2
- package/dist/components/dialogs/list-dialog.js +15 -15
- package/dist/components/dialogs/text-dialog.js +6 -6
- package/dist/components/dynamic-contextmenu-view.js +11 -8
- package/dist/components/dynamic-itemsize-matrix.js +15 -13
- package/dist/components/dynamic-preference-listview.js +95 -90
- package/dist/components/dynamic-rowheight-list.js +7 -6
- package/dist/components/enhanced-imageview.js +18 -16
- package/dist/components/flowlayout.js +15 -14
- package/dist/components/image-pager.js +22 -21
- package/dist/components/page-control.js +2 -2
- package/dist/components/pageviewer-titlebar.js +20 -17
- package/dist/components/pageviewer.js +13 -12
- package/dist/components/refresh-button.js +5 -5
- package/dist/components/rotating-view.js +11 -11
- package/dist/components/searchbar.js +53 -41
- package/dist/components/sheet.js +4 -4
- package/dist/components/single-views.js +68 -68
- package/dist/components/spinners/loading-dual-ring.js +10 -10
- package/dist/components/spinners/loading-wedges.js +15 -15
- package/dist/components/spinners/spinner-androidstyle.js +45 -43
- package/dist/components/static-preference-listview.js +101 -102
- package/dist/components/symbol-button.js +14 -13
- package/dist/components/tabbar.js +54 -50
- package/dist/controller/base-controller.js +17 -14
- package/dist/controller/pageviewer-controller.js +13 -11
- package/dist/controller/presented-page-controller.js +6 -4
- package/dist/controller/splitview-controller.js +48 -31
- package/dist/controller/tabbar-controller.js +13 -12
- package/dist/test/custom-navigation-bar.js +11 -9
- package/dist/test/dynamic-contextmenu-view.js +16 -14
- package/dist/test/dynamic-itemsize-matrix.js +18 -17
- package/dist/test/dynamic-preference-listview.js +29 -29
- package/dist/test/flowlayout.js +33 -27
- package/dist/test/form-dialog.js +15 -13
- package/dist/test/pageviewer-controller.js +10 -7
- package/dist/test/pageviewer-titlebar.js +3 -3
- package/dist/test/pageviewer.js +16 -7
- package/dist/test/refresh-button.js +4 -4
- package/dist/test/searchbar.js +7 -7
- package/dist/test/splitview-controller.js +14 -11
- package/dist/test/static-preference-listview.js +29 -30
- package/dist/test/tabbar-controller.js +15 -12
- package/dist/utils/colors.js +1 -2
- package/dist/utils/l10n.js +28 -28
- package/dist/utils/path.js +2 -2
- package/dist/utils/rect.js +30 -8
- package/dist/utils/uitools.js +29 -19
- package/index.ts +43 -43
- package/package.json +2 -2
- package/test/custom-navigation-bar.ts +28 -28
- package/test/dynamic-contextmenu-view.ts +23 -21
- package/test/dynamic-itemsize-matrix.ts +27 -22
- package/test/dynamic-preference-listview.ts +35 -35
- package/test/flowlayout.ts +43 -33
- package/test/form-dialog.ts +44 -43
- package/test/pageviewer-controller.ts +13 -11
- package/test/pageviewer-titlebar.ts +4 -5
- package/test/pageviewer.ts +17 -8
- package/test/refresh-button.ts +5 -5
- package/test/searchbar.ts +8 -8
- package/test/splitview-controller.ts +31 -30
- package/test/static-preference-listview.ts +35 -34
- package/test/tabbar-controller.ts +32 -29
- package/utils/colors.ts +7 -8
- package/utils/cvid.ts +1 -2
- package/utils/l10n.ts +32 -32
- package/utils/path.ts +9 -9
- package/utils/rect.ts +31 -8
- package/utils/uitools.ts +30 -22
package/test/form-dialog.ts
CHANGED
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
import { formDialog } from "../components/dialogs/form-dialog";
|
|
2
2
|
|
|
3
3
|
$ui.render({
|
|
4
|
-
views: [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
views: [
|
|
5
|
+
{
|
|
6
|
+
type: "button",
|
|
7
|
+
props: {
|
|
8
|
+
title: "Show Form Dialog",
|
|
9
|
+
},
|
|
10
|
+
layout: $layout.center,
|
|
11
|
+
events: {
|
|
12
|
+
tapped: async () => {
|
|
13
|
+
const values = await formDialog({
|
|
14
|
+
sections: [
|
|
15
|
+
{
|
|
16
|
+
title: "Section 1",
|
|
17
|
+
rows: [
|
|
18
|
+
{
|
|
19
|
+
type: "boolean",
|
|
20
|
+
title: "Switch",
|
|
21
|
+
key: "switch",
|
|
22
|
+
value: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: "string",
|
|
26
|
+
title: "String",
|
|
27
|
+
key: "string",
|
|
28
|
+
value: "Hello, World!",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
title: "Form Dialog",
|
|
34
|
+
checkHandler: (values) => {
|
|
35
|
+
console.log(values);
|
|
36
|
+
if (values.switch) return true;
|
|
37
|
+
else return false;
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
$ui.alert({
|
|
41
|
+
title: "Values",
|
|
42
|
+
message: JSON.stringify(values, null, 2),
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
},
|
|
8
46
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
tapped: async () => {
|
|
12
|
-
const values = await formDialog({
|
|
13
|
-
sections: [
|
|
14
|
-
{
|
|
15
|
-
title: "Section 1",
|
|
16
|
-
rows: [
|
|
17
|
-
{
|
|
18
|
-
type: "boolean",
|
|
19
|
-
title: "Switch",
|
|
20
|
-
key: "switch",
|
|
21
|
-
value: true
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
type: "string",
|
|
25
|
-
title: "String",
|
|
26
|
-
key: "string",
|
|
27
|
-
value: "Hello, World!"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
title: "Form Dialog",
|
|
33
|
-
checkHandler: values => {
|
|
34
|
-
console.log(values);
|
|
35
|
-
if (values.switch) return true;
|
|
36
|
-
else return false;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
$ui.alert({
|
|
40
|
-
title: "Values",
|
|
41
|
-
message: JSON.stringify(values, null, 2)
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}]
|
|
46
|
-
})
|
|
47
|
-
|
|
47
|
+
],
|
|
48
|
+
});
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { PageViewerController } from "../controller/pageviewer-controller";
|
|
2
2
|
import { BaseController } from "../controller/base-controller";
|
|
3
|
-
import { PageViewer } from "../components/pageviewer";
|
|
4
3
|
|
|
5
|
-
const items = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
4
|
+
const items = [
|
|
5
|
+
{
|
|
6
|
+
controller: new BaseController({ props: { bgcolor: $color("red") } }),
|
|
7
|
+
title: "Page 1",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
controller: new BaseController({ props: { bgcolor: $color("yellow") } }),
|
|
11
|
+
title: "Page 2",
|
|
12
|
+
},
|
|
13
|
+
];
|
|
12
14
|
|
|
13
15
|
const pageViewerController = new PageViewerController({
|
|
14
16
|
props: {
|
|
15
|
-
items
|
|
16
|
-
}
|
|
17
|
+
items,
|
|
18
|
+
},
|
|
17
19
|
});
|
|
18
20
|
|
|
19
|
-
pageViewerController.uirender({});
|
|
21
|
+
pageViewerController.uirender({});
|
|
@@ -3,17 +3,16 @@ import { PageViewerTitleBar } from "../components/pageviewer-titlebar";
|
|
|
3
3
|
const pageViewerTitleBar = new PageViewerTitleBar({
|
|
4
4
|
props: {
|
|
5
5
|
items: ["Page 1", "Page 2", "Page 3"],
|
|
6
|
-
index: 0
|
|
6
|
+
index: 0,
|
|
7
7
|
},
|
|
8
8
|
layout: (make, view) => {
|
|
9
9
|
make.left.right.inset(0);
|
|
10
10
|
make.top.equalTo(view.super.safeAreaTop);
|
|
11
11
|
make.height.equalTo(44);
|
|
12
12
|
},
|
|
13
|
-
events: {
|
|
14
|
-
}
|
|
13
|
+
events: {},
|
|
15
14
|
});
|
|
16
15
|
|
|
17
16
|
$ui.render({
|
|
18
|
-
views: [pageViewerTitleBar.definition]
|
|
19
|
-
});
|
|
17
|
+
views: [pageViewerTitleBar.definition],
|
|
18
|
+
});
|
package/test/pageviewer.ts
CHANGED
|
@@ -4,19 +4,28 @@ const pageViewer = new PageViewer({
|
|
|
4
4
|
props: {
|
|
5
5
|
page: 0,
|
|
6
6
|
cviews: [
|
|
7
|
-
new ContentView({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
new ContentView({
|
|
8
|
+
props: { bgcolor: $color("red") },
|
|
9
|
+
layout: $layout.fill,
|
|
10
|
+
}),
|
|
11
|
+
new ContentView({
|
|
12
|
+
props: { bgcolor: $color("green") },
|
|
13
|
+
layout: $layout.fill,
|
|
14
|
+
}),
|
|
15
|
+
new ContentView({
|
|
16
|
+
props: { bgcolor: $color("blue") },
|
|
17
|
+
layout: $layout.fill,
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
11
20
|
},
|
|
12
21
|
layout: $layout.fill,
|
|
13
22
|
events: {
|
|
14
23
|
floatPageChanged: (cview, floatPage) => {
|
|
15
24
|
console.log(floatPage);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
25
|
+
},
|
|
26
|
+
},
|
|
18
27
|
});
|
|
19
28
|
|
|
20
29
|
$ui.render({
|
|
21
|
-
views: [pageViewer.definition]
|
|
22
|
-
});
|
|
30
|
+
views: [pageViewer.definition],
|
|
31
|
+
});
|
package/test/refresh-button.ts
CHANGED
|
@@ -4,7 +4,7 @@ const refreshButton = new RefreshButton({
|
|
|
4
4
|
props: {
|
|
5
5
|
tintColor: $color("primaryText"),
|
|
6
6
|
enabled: true,
|
|
7
|
-
hidden: false
|
|
7
|
+
hidden: false,
|
|
8
8
|
},
|
|
9
9
|
layout: (make, view) => {
|
|
10
10
|
make.width.equalTo(50);
|
|
@@ -17,10 +17,10 @@ const refreshButton = new RefreshButton({
|
|
|
17
17
|
refreshButton.loading = true;
|
|
18
18
|
await $wait(2);
|
|
19
19
|
refreshButton.loading = false;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
$ui.render({
|
|
25
|
-
views: [refreshButton.definition]
|
|
26
|
-
});
|
|
25
|
+
views: [refreshButton.definition],
|
|
26
|
+
});
|
package/test/searchbar.ts
CHANGED
|
@@ -2,37 +2,37 @@ import { SearchBar } from "../components/searchbar";
|
|
|
2
2
|
|
|
3
3
|
const s0 = new SearchBar({
|
|
4
4
|
props: {
|
|
5
|
-
style: 0
|
|
5
|
+
style: 0,
|
|
6
6
|
},
|
|
7
7
|
layout: (make, view) => {
|
|
8
8
|
make.centerX.equalTo(view.super);
|
|
9
9
|
make.size.equalTo($size(300, 44));
|
|
10
10
|
make.top.equalTo(view.super).inset(50);
|
|
11
|
-
}
|
|
11
|
+
},
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
const s1 = new SearchBar({
|
|
15
15
|
props: {
|
|
16
|
-
style: 1
|
|
16
|
+
style: 1,
|
|
17
17
|
},
|
|
18
18
|
layout: (make, view) => {
|
|
19
19
|
make.centerX.equalTo(view.super);
|
|
20
20
|
make.size.equalTo($size(300, 44));
|
|
21
21
|
make.top.equalTo(view.super).inset(125);
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const s2 = new SearchBar({
|
|
26
26
|
props: {
|
|
27
|
-
style: 2
|
|
27
|
+
style: 2,
|
|
28
28
|
},
|
|
29
29
|
layout: (make, view) => {
|
|
30
30
|
make.centerX.equalTo(view.super);
|
|
31
31
|
make.size.equalTo($size(300, 44));
|
|
32
32
|
make.top.equalTo(view.super).inset(200);
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
$ui.render({
|
|
37
|
-
views: [s0.definition, s1.definition, s2.definition]
|
|
38
|
-
});
|
|
37
|
+
views: [s0.definition, s1.definition, s2.definition],
|
|
38
|
+
});
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { SplitViewController } from "../controller/splitview-controller";
|
|
2
2
|
import { BaseController } from "../controller/base-controller";
|
|
3
3
|
|
|
4
|
-
const items = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const items = [
|
|
5
|
+
{
|
|
6
|
+
controller: new BaseController({
|
|
7
|
+
props: { bgcolor: $color("red") },
|
|
8
|
+
events: {
|
|
9
|
+
didAppear: () => {
|
|
10
|
+
console.log("Page 1 did appear");
|
|
11
|
+
},
|
|
12
|
+
didDisappear: () => {
|
|
13
|
+
console.log("Page 1 did disappear");
|
|
14
|
+
},
|
|
10
15
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
}),
|
|
17
|
+
bgcolor: $color("red"),
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
controller: new BaseController({
|
|
21
|
+
props: { bgcolor: $color("yellow") },
|
|
22
|
+
events: {
|
|
23
|
+
didAppear: () => {
|
|
24
|
+
console.log("Page 2 did appear");
|
|
25
|
+
},
|
|
26
|
+
didDisappear: () => {
|
|
27
|
+
console.log("Page 2 did disappear");
|
|
28
|
+
},
|
|
23
29
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
bgcolor: $color("green")
|
|
30
|
-
}]
|
|
30
|
+
}),
|
|
31
|
+
bgcolor: $color("green"),
|
|
32
|
+
},
|
|
33
|
+
];
|
|
31
34
|
|
|
32
35
|
const pageViewerController = new SplitViewController({
|
|
33
36
|
props: {
|
|
34
|
-
items
|
|
37
|
+
items,
|
|
35
38
|
},
|
|
36
|
-
events: {
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
+
events: {},
|
|
39
40
|
});
|
|
40
41
|
|
|
41
|
-
pageViewerController.uirender();
|
|
42
|
+
pageViewerController.uirender();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
PreferenceListView,
|
|
3
|
+
PreferenceSection,
|
|
4
|
+
} from "../components/static-preference-listview";
|
|
2
5
|
const sections: PreferenceSection[] = [
|
|
3
6
|
{
|
|
4
7
|
title: "Section 1",
|
|
@@ -7,19 +10,19 @@ const sections: PreferenceSection[] = [
|
|
|
7
10
|
type: "string",
|
|
8
11
|
title: "string",
|
|
9
12
|
key: "string",
|
|
10
|
-
value: "测试一号测试二号测试三号测试四号测试五号测试六号"
|
|
13
|
+
value: "测试一号测试二号测试三号测试四号测试五号测试六号",
|
|
11
14
|
},
|
|
12
15
|
{
|
|
13
16
|
type: "number",
|
|
14
17
|
title: "number",
|
|
15
18
|
key: "number",
|
|
16
|
-
value: 1111.1
|
|
19
|
+
value: 1111.1,
|
|
17
20
|
},
|
|
18
21
|
{
|
|
19
22
|
type: "integer",
|
|
20
23
|
title: "integer",
|
|
21
24
|
key: "integer",
|
|
22
|
-
value: 1111
|
|
25
|
+
value: 1111,
|
|
23
26
|
},
|
|
24
27
|
{
|
|
25
28
|
type: "stepper",
|
|
@@ -27,9 +30,9 @@ const sections: PreferenceSection[] = [
|
|
|
27
30
|
key: "stepper",
|
|
28
31
|
value: 2,
|
|
29
32
|
min: 2,
|
|
30
|
-
max: 5
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
+
max: 5,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
33
36
|
},
|
|
34
37
|
{
|
|
35
38
|
title: "Section 2",
|
|
@@ -38,7 +41,7 @@ const sections: PreferenceSection[] = [
|
|
|
38
41
|
type: "boolean",
|
|
39
42
|
title: "boolean",
|
|
40
43
|
key: "boolean",
|
|
41
|
-
value: true
|
|
44
|
+
value: true,
|
|
42
45
|
},
|
|
43
46
|
{
|
|
44
47
|
type: "slider",
|
|
@@ -47,30 +50,30 @@ const sections: PreferenceSection[] = [
|
|
|
47
50
|
value: 1,
|
|
48
51
|
decimal: 0,
|
|
49
52
|
min: 0,
|
|
50
|
-
max: 100
|
|
53
|
+
max: 100,
|
|
51
54
|
},
|
|
52
55
|
{
|
|
53
56
|
type: "list",
|
|
54
57
|
title: "list",
|
|
55
58
|
key: "list",
|
|
56
59
|
items: ["测试一号", "测试bbb"],
|
|
57
|
-
value: 0
|
|
60
|
+
value: 0,
|
|
58
61
|
},
|
|
59
62
|
{
|
|
60
63
|
type: "tab",
|
|
61
64
|
title: "tab",
|
|
62
65
|
key: "tab",
|
|
63
66
|
items: ["测试aaa", "测试bbb"],
|
|
64
|
-
value: 0
|
|
67
|
+
value: 0,
|
|
65
68
|
},
|
|
66
69
|
{
|
|
67
70
|
type: "date",
|
|
68
71
|
title: "date",
|
|
69
72
|
key: "date",
|
|
70
73
|
//value: new Date()
|
|
71
|
-
mode: 1
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
+
mode: 1,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
74
77
|
},
|
|
75
78
|
{
|
|
76
79
|
title: "Section 3",
|
|
@@ -78,19 +81,19 @@ const sections: PreferenceSection[] = [
|
|
|
78
81
|
{
|
|
79
82
|
type: "info",
|
|
80
83
|
title: "info",
|
|
81
|
-
value: "this is info"
|
|
84
|
+
value: "this is info",
|
|
82
85
|
},
|
|
83
86
|
{
|
|
84
87
|
type: "link",
|
|
85
88
|
title: "link",
|
|
86
|
-
value: "https://apple.com"
|
|
89
|
+
value: "https://apple.com",
|
|
87
90
|
},
|
|
88
91
|
{
|
|
89
92
|
type: "action",
|
|
90
93
|
title: "action",
|
|
91
|
-
value: () => console.info(0)
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
+
value: () => console.info(0),
|
|
95
|
+
},
|
|
96
|
+
],
|
|
94
97
|
},
|
|
95
98
|
{
|
|
96
99
|
title: "Section 4",
|
|
@@ -99,25 +102,25 @@ const sections: PreferenceSection[] = [
|
|
|
99
102
|
type: "interactive-info",
|
|
100
103
|
title: "interactive-info",
|
|
101
104
|
key: "interactive-info",
|
|
102
|
-
value: "测试一号测试二号测试三号测试四号测试五号测试六号"
|
|
105
|
+
value: "测试一号测试二号测试三号测试四号测试五号测试六号",
|
|
103
106
|
},
|
|
104
107
|
{
|
|
105
108
|
type: "interactive-info",
|
|
106
109
|
title: "interactive-info2",
|
|
107
110
|
key: "interactive-info2",
|
|
108
111
|
value: "测试一号测试二号测试三号测试四号测试五号测试六号",
|
|
109
|
-
copyable: true
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
]
|
|
112
|
+
copyable: true,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
];
|
|
114
117
|
const v = new PreferenceListView({
|
|
115
|
-
props: {data: []},
|
|
118
|
+
props: { data: [] },
|
|
116
119
|
sections: sections,
|
|
117
120
|
layout: $layout.fill,
|
|
118
121
|
events: {
|
|
119
|
-
changed: (values: any) => console.info(values)
|
|
120
|
-
}
|
|
122
|
+
changed: (values: any) => console.info(values),
|
|
123
|
+
},
|
|
121
124
|
});
|
|
122
125
|
|
|
123
126
|
$ui.render({
|
|
@@ -126,11 +129,9 @@ $ui.render({
|
|
|
126
129
|
navButtons: [
|
|
127
130
|
{
|
|
128
131
|
symbol: "plus",
|
|
129
|
-
handler: () => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
]
|
|
132
|
+
handler: () => {},
|
|
133
|
+
},
|
|
134
|
+
],
|
|
134
135
|
},
|
|
135
|
-
views: [v.definition]
|
|
136
|
+
views: [v.definition],
|
|
136
137
|
});
|
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import { TabBarController } from "../controller/tabbar-controller";
|
|
2
2
|
import { BaseController } from "../controller/base-controller";
|
|
3
3
|
|
|
4
|
-
const items = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const items = [
|
|
5
|
+
{
|
|
6
|
+
controller: new BaseController({
|
|
7
|
+
props: { bgcolor: $color("red") },
|
|
8
|
+
events: {
|
|
9
|
+
didAppear: () => {
|
|
10
|
+
console.log("Page 1 did appear");
|
|
11
|
+
},
|
|
12
|
+
didDisappear: () => {
|
|
13
|
+
console.log("Page 1 did disappear");
|
|
14
|
+
},
|
|
10
15
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
}),
|
|
17
|
+
title: "Page 1",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
controller: new BaseController({
|
|
21
|
+
props: { bgcolor: $color("yellow") },
|
|
22
|
+
events: {
|
|
23
|
+
didAppear: () => {
|
|
24
|
+
console.log("Page 2 did appear");
|
|
25
|
+
},
|
|
26
|
+
didDisappear: () => {
|
|
27
|
+
console.log("Page 2 did disappear");
|
|
28
|
+
},
|
|
23
29
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
title: "Page 2"
|
|
30
|
-
}]
|
|
30
|
+
}),
|
|
31
|
+
title: "Page 2",
|
|
32
|
+
},
|
|
33
|
+
];
|
|
31
34
|
|
|
32
35
|
const pageViewerController = new TabBarController({
|
|
33
36
|
props: {
|
|
34
|
-
items
|
|
37
|
+
items,
|
|
35
38
|
},
|
|
36
39
|
events: {
|
|
37
40
|
changed: (sender, index) => {
|
|
@@ -39,8 +42,8 @@ const pageViewerController = new TabBarController({
|
|
|
39
42
|
},
|
|
40
43
|
doubleTapped: (sender, index) => {
|
|
41
44
|
console.log(`Double tapped on index ${index}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
45
|
+
},
|
|
46
|
+
},
|
|
44
47
|
});
|
|
45
48
|
|
|
46
|
-
pageViewerController.uirender({});
|
|
49
|
+
pageViewerController.uirender({});
|
package/utils/colors.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// 自定义的语义化颜色
|
|
2
2
|
|
|
3
|
-
export const sheetNavBarColor = $color("tint", $color("tertiarySurface"))
|
|
4
|
-
export const footBarDefaultSegmentColor = $color("#b7bec6", "#6e6e6e")
|
|
5
|
-
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const gold = $color("#ffd700")
|
|
3
|
+
export const sheetNavBarColor = $color("tint", $color("tertiarySurface"));
|
|
4
|
+
export const footBarDefaultSegmentColor = $color("#b7bec6", "#6e6e6e");
|
|
5
|
+
export const searchBarSymbolColor = $color("#777", "#aaa");
|
|
6
|
+
export const searchBarBgcolor = $color("backgroundColor", "secondarySurface");
|
|
7
|
+
export const gold = $color("#ffd700");
|
|
9
8
|
export const sectionHeaderColor = $color({
|
|
10
9
|
light: "#666666",
|
|
11
10
|
dark: "#acacac",
|
|
12
|
-
black: "#ababab"
|
|
13
|
-
})
|
|
11
|
+
black: "#ababab",
|
|
12
|
+
});
|
package/utils/cvid.ts
CHANGED
package/utils/l10n.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
// 用于自定义的国际化支持
|
|
2
2
|
|
|
3
|
-
const language = $device.info.language
|
|
3
|
+
const language = $device.info.language;
|
|
4
4
|
|
|
5
5
|
const strings: Record<string, Record<string, string>> = {
|
|
6
6
|
"zh-Hans": {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
DUPLICATE_VALUES: "取值重复",
|
|
8
|
+
DONE: "完成",
|
|
9
|
+
ADD: "添加",
|
|
10
|
+
SEARCH: "搜索",
|
|
11
|
+
PREVIOUS: "上一步",
|
|
12
|
+
NEXT: "下一步",
|
|
13
|
+
REMOVE: "移除",
|
|
14
|
+
EDIT: "编辑",
|
|
15
|
+
FINISHED: "完成",
|
|
16
|
+
INVALID_VALUES: "取值不合法",
|
|
17
|
+
CANCEL: "取消",
|
|
18
|
+
CLIPBOARD: "剪贴板",
|
|
19
|
+
OK: "好的",
|
|
20
20
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
}
|
|
21
|
+
en: {
|
|
22
|
+
DUPLICATE_VALUES: "Duplicate values",
|
|
23
|
+
DONE: "Done",
|
|
24
|
+
ADD: "Add",
|
|
25
|
+
SEARCH: "Search",
|
|
26
|
+
PREVIOUS: "Previous",
|
|
27
|
+
NEXT: "Next",
|
|
28
|
+
REMOVE: "Remove",
|
|
29
|
+
EDIT: "Edit",
|
|
30
|
+
FINISHED: "Finished",
|
|
31
|
+
INVALID_VALUES: "Invalid values",
|
|
32
|
+
CANCEL: "Cancel",
|
|
33
|
+
CLIPBOARD: "Clipboard",
|
|
34
|
+
OK: "OK",
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
37
|
|
|
38
38
|
export function l10n(key: string) {
|
|
39
39
|
if (!strings[language]) return key;
|
|
40
|
-
const value = strings[language][key]
|
|
41
|
-
return value || key
|
|
40
|
+
const value = strings[language][key];
|
|
41
|
+
return value || key;
|
|
42
42
|
}
|