jsbox-cview 1.3.5 → 1.4.0
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 +12 -6
- package/components/alert/login-alert.ts +11 -7
- package/components/alert/plain-alert.ts +9 -6
- package/components/alert/uialert.ts +3 -4
- package/components/base.ts +3 -4
- package/components/custom-navigation-bar.ts +52 -53
- package/components/dialogs/dialog-sheet.ts +10 -15
- package/components/dialogs/form-dialog.ts +5 -7
- package/components/dialogs/list-dialog.ts +9 -6
- package/components/dialogs/text-dialog.ts +7 -6
- package/components/dynamic-itemsize-matrix.ts +25 -26
- package/components/dynamic-preference-listview.ts +29 -31
- package/components/dynamic-rowheight-list.ts +10 -11
- package/components/enhanced-imageview.ts +4 -4
- package/components/flowlayout.ts +233 -0
- package/components/image-pager.ts +16 -10
- package/components/page-control.ts +16 -13
- package/components/pageviewer-titlebar.ts +15 -16
- package/components/pageviewer.ts +16 -15
- package/components/rotating-view.ts +27 -22
- package/components/searchbar.ts +30 -25
- package/components/sheet.ts +16 -17
- package/components/single-views.ts +107 -105
- package/components/spinners/loading-dual-ring.ts +15 -8
- package/components/spinners/loading-wedges.ts +8 -4
- package/components/spinners/spinner-androidstyle.ts +15 -16
- package/components/static-preference-listview.ts +94 -95
- package/components/symbol-button.ts +16 -30
- package/components/tabbar.ts +24 -25
- package/controller/base-controller.ts +57 -58
- package/controller/controller-router.ts +2 -3
- package/controller/pageviewer-controller.ts +16 -15
- package/controller/presented-page-controller.ts +14 -13
- package/controller/splitview-controller.ts +22 -13
- package/controller/tabbar-controller.ts +15 -15
- package/dist/components/alert/input-alert.js +12 -5
- package/dist/components/alert/login-alert.js +10 -5
- package/dist/components/alert/plain-alert.js +9 -5
- package/dist/components/alert/uialert.js +3 -3
- package/dist/components/base.js +4 -4
- package/dist/components/custom-navigation-bar.js +30 -30
- package/dist/components/dialogs/dialog-sheet.js +9 -12
- package/dist/components/dialogs/form-dialog.js +5 -5
- package/dist/components/dialogs/list-dialog.js +9 -5
- package/dist/components/dialogs/text-dialog.js +7 -5
- package/dist/components/dynamic-itemsize-matrix.js +15 -15
- package/dist/components/dynamic-preference-listview.js +4 -4
- package/dist/components/dynamic-rowheight-list.js +3 -3
- package/dist/components/enhanced-imageview.js +3 -3
- package/dist/components/flowlayout.js +184 -0
- package/dist/components/image-pager.js +14 -9
- package/dist/components/page-control.js +21 -18
- package/dist/components/pageviewer-titlebar.js +15 -15
- package/dist/components/pageviewer.js +16 -14
- package/dist/components/rotating-view.js +24 -19
- package/dist/components/searchbar.js +29 -24
- package/dist/components/sheet.js +13 -14
- package/dist/components/single-views.js +5 -5
- package/dist/components/spinners/loading-dual-ring.js +12 -5
- package/dist/components/spinners/loading-wedges.js +7 -3
- package/dist/components/spinners/spinner-androidstyle.js +13 -15
- package/dist/components/static-preference-listview.js +94 -94
- package/dist/components/symbol-button.js +0 -14
- package/dist/components/tabbar.js +24 -24
- package/dist/controller/base-controller.js +36 -36
- package/dist/controller/controller-router.js +2 -2
- package/dist/controller/pageviewer-controller.js +10 -8
- package/dist/controller/presented-page-controller.js +8 -6
- package/dist/controller/splitview-controller.js +19 -12
- package/dist/controller/tabbar-controller.js +3 -3
- package/dist/index.js +1 -2
- package/dist/test/flowlayout.js +74 -0
- package/index.ts +1 -2
- package/package.json +1 -1
- package/test/flowlayout.ts +77 -0
- package/components/artificial-flowlayout.ts +0 -321
- package/components/spinners/loading-double-rings.ts +0 -121
- package/dist/components/artificial-flowlayout.js +0 -258
- package/dist/components/spinners/loading-double-rings.js +0 -104
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* # CView PageViewer
|
|
4
|
-
*
|
|
5
|
-
* props:
|
|
6
|
-
* - 读写 page: number
|
|
7
|
-
* - 只写 cviews: cview[] cview的布局会被自动指定为占用一整页
|
|
8
|
-
*
|
|
9
|
-
* events:
|
|
10
|
-
* - changed: (cview, page) => void 页面改变时回调
|
|
11
|
-
* - floatPageChanged: (cview, floatPage) => void 滚动时回调(用于绑定其他联合滚动的控件)
|
|
12
|
-
*
|
|
13
|
-
* methods:
|
|
14
|
-
* - scrollToPage(page: number) 滚动到某一页(带有动画效果)
|
|
15
|
-
*/
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.PageViewer = void 0;
|
|
18
4
|
const base_1 = require("./base");
|
|
19
5
|
const single_views_1 = require("./single-views");
|
|
6
|
+
/**
|
|
7
|
+
* 与JSBox内置的Gallery功能类似,但是效果更好,可以伴随翻页实现联动效果,参见[pageviewer-titlebar.ts](./pageviewer-titlebar.ts)
|
|
8
|
+
*
|
|
9
|
+
* @property page: number 当前页码(无动画效果)
|
|
10
|
+
* @method scrollToPage(page: number) 滚动到某一页(带有动画效果)
|
|
11
|
+
*/
|
|
20
12
|
class PageViewer extends base_1.Base {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param props 属性
|
|
16
|
+
* - page: number
|
|
17
|
+
* - cviews: Base<any, any>[]
|
|
18
|
+
* @param layout 布局
|
|
19
|
+
* @param events 事件
|
|
20
|
+
* - changed: (cview, page) => void 页面改变时回调
|
|
21
|
+
* - floatPageChanged: (cview, floatPage) => void 滚动时回调(用于绑定其他联合滚动的控件)
|
|
22
|
+
*/
|
|
21
23
|
constructor({ props, layout, events = {} }) {
|
|
22
24
|
super();
|
|
23
25
|
this._props = Object.assign({ page: 0 }, props);
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* 创建一个可以旋转的视图。理论上来说,这个视图的布局必须是方形的。
|
|
4
|
-
*
|
|
5
|
-
* props:
|
|
6
|
-
* - image 图片
|
|
7
|
-
* - tintColor
|
|
8
|
-
* - contentMode = 1
|
|
9
|
-
* - cview 使用自定义的cview,上面两项将失效
|
|
10
|
-
* - rps = 0.5 每秒转多少圈
|
|
11
|
-
* - clockwise = true 是否顺时针旋转
|
|
12
|
-
*
|
|
13
|
-
* events:
|
|
14
|
-
* - ready: cview => void 可以在ready事件中启动旋转
|
|
15
|
-
*
|
|
16
|
-
* methods:
|
|
17
|
-
* - startRotating() 开始旋转
|
|
18
|
-
* - stopRotating() 结束旋转,请注意旋转是不能立即结束的,必须等到动画归位
|
|
19
|
-
*/
|
|
20
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
3
|
exports.RotatingView = void 0;
|
|
22
4
|
const base_1 = require("./base");
|
|
23
5
|
const single_views_1 = require("./single-views");
|
|
6
|
+
/**
|
|
7
|
+
* 创建一个可以旋转的视图。理论上来说,这个视图的布局必须是方形的。
|
|
8
|
+
*
|
|
9
|
+
* @method startRotating() 开始旋转
|
|
10
|
+
* @method stopRotating() 结束旋转,请注意旋转是不能立即结束的,必须等到动画归位
|
|
11
|
+
*/
|
|
24
12
|
class RotatingView extends base_1.Base {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param props 属性
|
|
16
|
+
* - image: UIImage
|
|
17
|
+
* - tintColor: UIColor
|
|
18
|
+
* - contentMode = 1
|
|
19
|
+
* - cview 使用自定义的cview,如果设置上面三项将失效
|
|
20
|
+
* - rps = 0.5 每秒转多少圈
|
|
21
|
+
* - clockwise = true 是否顺时针旋转
|
|
22
|
+
* @param layout 布局
|
|
23
|
+
* @param events 事件
|
|
24
|
+
* - ready?: (cview: RotatingView) => void 默认的ready事件是自动开始旋转;也可以手动指定其他效果
|
|
25
|
+
*/
|
|
25
26
|
constructor({ props, layout, events = {} }) {
|
|
26
27
|
super();
|
|
27
28
|
this._props = Object.assign({ contentMode: 1, rps: 0.5, clockwise: true }, props);
|
|
@@ -50,8 +51,12 @@ class RotatingView extends base_1.Base {
|
|
|
50
51
|
layout,
|
|
51
52
|
events: {
|
|
52
53
|
ready: sender => {
|
|
53
|
-
if (events.ready)
|
|
54
|
+
if (events.ready) {
|
|
54
55
|
events.ready(this);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
this.startRotating();
|
|
59
|
+
}
|
|
55
60
|
}
|
|
56
61
|
},
|
|
57
62
|
views: [this._innerView.definition]
|
|
@@ -1,28 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* # CView SearchBar
|
|
4
|
-
*
|
|
5
|
-
* props
|
|
6
|
-
*
|
|
7
|
-
* - 读写 text: string
|
|
8
|
-
* - style: number 搜索框的样式
|
|
9
|
-
* - 0: 取消按钮在输入框内,聚焦时显示取消按钮
|
|
10
|
-
* - 1: 取消按钮在输入框右侧,聚焦时会有左右移动的动画
|
|
11
|
-
* - 2: 取消按钮布局同 1,但是 placeholder 平时显示在中间,聚焦时才会移动到左边。
|
|
12
|
-
* 如果使用此样式,建议每次 blur 的时候都清除 text
|
|
13
|
-
* - accessoryCview: cview 请通过下面的事件来和 SearchBar 互相操作
|
|
14
|
-
* - placeholder: string
|
|
15
|
-
* - cancelText: string
|
|
16
|
-
* - tintColor: \$color("systemLink")
|
|
17
|
-
* - bgcolor: colors.searchBarBgcolor
|
|
18
|
-
*
|
|
19
|
-
* events
|
|
20
|
-
*
|
|
21
|
-
* - didBeginEditing: cview => void
|
|
22
|
-
* - didEndEditing: cview => void
|
|
23
|
-
* - changed: cview => void
|
|
24
|
-
* - returned: cview => void
|
|
25
|
-
*/
|
|
26
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
3
|
exports.SearchBar = void 0;
|
|
28
4
|
const base_1 = require("./base");
|
|
@@ -30,7 +6,36 @@ const single_views_1 = require("./single-views");
|
|
|
30
6
|
const colors_1 = require("../utils/colors");
|
|
31
7
|
const l10n_1 = require("../utils/l10n");
|
|
32
8
|
const uitools_1 = require("../utils/uitools");
|
|
9
|
+
/**
|
|
10
|
+
* 搜索框
|
|
11
|
+
*
|
|
12
|
+
* 有三种样式可供选择,通过 style 属性设置
|
|
13
|
+
*
|
|
14
|
+
* @method focus() 聚焦
|
|
15
|
+
* @method blur() 失焦
|
|
16
|
+
* @property text: string 文本
|
|
17
|
+
*/
|
|
33
18
|
class SearchBar extends base_1.Base {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param props 属性
|
|
22
|
+
* - text: string
|
|
23
|
+
* - style: number 搜索框的样式
|
|
24
|
+
* - 0: 取消按钮在输入框内,聚焦时显示取消按钮
|
|
25
|
+
* - 1: 取消按钮在输入框右侧,聚焦时会有左右移动的动画
|
|
26
|
+
* - 2: 取消按钮布局同 1,但是 placeholder 平时显示在中间,聚焦时才会移动到左边。如果使用此样式,建议每次 blur 的时候都清除 text。
|
|
27
|
+
* - accessoryCview: cview 请通过下面的事件来和 SearchBar 互相操作
|
|
28
|
+
* - placeholder: string
|
|
29
|
+
* - cancelText: string
|
|
30
|
+
* - tintColor: \$color("systemLink")
|
|
31
|
+
* - bgcolor: colors.searchBarBgcolor
|
|
32
|
+
* @param layout 布局
|
|
33
|
+
* @param events 事件
|
|
34
|
+
* - didBeginEditing: cview => void
|
|
35
|
+
* - didEndEditing: cview => void
|
|
36
|
+
* - changed: cview => void
|
|
37
|
+
* - returned: cview => void
|
|
38
|
+
*/
|
|
34
39
|
constructor({ props, layout, events = {} }) {
|
|
35
40
|
super();
|
|
36
41
|
this._props = Object.assign({ placeholder: (0, l10n_1.l10n)("SEARCH"), cancelText: (0, l10n_1.l10n)("CANCEL"), tintColor: $color("systemLink"), bgcolor: colors_1.searchBarBgcolor, style: 0 }, props);
|
package/dist/components/sheet.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Sheet = void 0;
|
|
4
|
+
const cvid_1 = require("../utils/cvid");
|
|
5
|
+
const UIModalPresentationStyle = {
|
|
6
|
+
automatic: -2,
|
|
7
|
+
pageSheet: 1,
|
|
8
|
+
formSheet: 2,
|
|
9
|
+
fullScreen: 0,
|
|
10
|
+
currentContext: 3,
|
|
11
|
+
custom: 4,
|
|
12
|
+
overFullScreen: 5,
|
|
13
|
+
overCurrentContext: 6,
|
|
14
|
+
popover: 7,
|
|
15
|
+
none: -1
|
|
16
|
+
};
|
|
4
17
|
/**
|
|
5
|
-
* # cview Sheet
|
|
6
18
|
*
|
|
7
19
|
* 创建新的 UIViewController,主要用于 formSheet 和 pageSheet
|
|
8
20
|
*
|
|
@@ -19,19 +31,6 @@ exports.Sheet = void 0;
|
|
|
19
31
|
* - dismiss()
|
|
20
32
|
*
|
|
21
33
|
*/
|
|
22
|
-
const cvid_1 = require("../utils/cvid");
|
|
23
|
-
const UIModalPresentationStyle = {
|
|
24
|
-
automatic: -2,
|
|
25
|
-
pageSheet: 1,
|
|
26
|
-
formSheet: 2,
|
|
27
|
-
fullScreen: 0,
|
|
28
|
-
currentContext: 3,
|
|
29
|
-
custom: 4,
|
|
30
|
-
overFullScreen: 5,
|
|
31
|
-
overCurrentContext: 6,
|
|
32
|
-
popover: 7,
|
|
33
|
-
none: -1
|
|
34
|
-
};
|
|
35
34
|
class Sheet {
|
|
36
35
|
constructor({ presentMode = UIModalPresentationStyle.pageSheet, animated = true, interactiveDismissalDisabled = false, bgcolor = $color("secondarySurface"), cview, dismissalHandler }) {
|
|
37
36
|
this._animated = animated;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 实现单个视图的定义
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Runtime = exports.Code = exports.Chart = exports.Lottie = exports.Markdown = exports.Canvas = exports.Picker = exports.DatePicker = exports.Gradient = exports.Blur = exports.Matrix = exports.List = exports.Web = exports.Map = exports.Menu = exports.Tab = exports.Stack = exports.Scroll = exports.Video = exports.Image = exports.Text = exports.Stepper = exports.Gallery = exports.Progress = exports.Spinner = exports.Switch = exports.Slider = exports.Input = exports.Button = exports.Label = exports.MaskView = exports.ContentView = exports.
|
|
6
|
+
exports.Runtime = exports.Code = exports.Chart = exports.Lottie = exports.Markdown = exports.Canvas = exports.Picker = exports.DatePicker = exports.Gradient = exports.Blur = exports.Matrix = exports.List = exports.Web = exports.Map = exports.Menu = exports.Tab = exports.Stack = exports.Scroll = exports.Video = exports.Image = exports.Text = exports.Stepper = exports.Gallery = exports.Progress = exports.Spinner = exports.Switch = exports.Slider = exports.Input = exports.Button = exports.Label = exports.MaskView = exports.ContentView = exports.ClearView = exports.SingleView = void 0;
|
|
7
7
|
const base_1 = require("./base");
|
|
8
8
|
class SingleView extends base_1.Base {
|
|
9
9
|
constructor({ type, props, layout, events, views }) {
|
|
@@ -25,18 +25,18 @@ class SingleView extends base_1.Base {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
exports.SingleView = SingleView;
|
|
28
|
-
class
|
|
29
|
-
constructor({ layout = $layout.fill, events, views }) {
|
|
28
|
+
class ClearView extends SingleView {
|
|
29
|
+
constructor({ props, layout = $layout.fill, events, views }) {
|
|
30
30
|
super({
|
|
31
31
|
type: "view",
|
|
32
|
-
props: {
|
|
32
|
+
props: Object.assign({}, props),
|
|
33
33
|
layout,
|
|
34
34
|
events,
|
|
35
35
|
views
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
exports.
|
|
39
|
+
exports.ClearView = ClearView;
|
|
40
40
|
class ContentView extends SingleView {
|
|
41
41
|
constructor({ props, layout = $layout.fillSafeArea, events = {}, views }) {
|
|
42
42
|
super({
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* # cview LoadingDualRing
|
|
4
|
-
*/
|
|
5
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -33,7 +30,7 @@ class CanvasComponet extends base_1.Base {
|
|
|
33
30
|
ctx.setLineWidth(20);
|
|
34
31
|
ctx.setLineCap(1);
|
|
35
32
|
ctx.setLineJoin(1);
|
|
36
|
-
ctx.addArc(radius / 2, radius / 2, radius / 2 - 20, this.startAngle, this.startAngle + (Math.PI * 2 * 1) / 4,
|
|
33
|
+
ctx.addArc(radius / 2, radius / 2, radius / 2 - 20, this.startAngle, this.startAngle + (Math.PI * 2 * 1) / 4, false);
|
|
37
34
|
ctx.strokePath();
|
|
38
35
|
}
|
|
39
36
|
}
|
|
@@ -44,14 +41,24 @@ class CanvasComponet extends base_1.Base {
|
|
|
44
41
|
this.view.ocValue().invoke("setNeedsDisplay");
|
|
45
42
|
}
|
|
46
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* 两个圆环旋转的加载动画
|
|
46
|
+
*
|
|
47
|
+
* 这是一个示例组件,由于帧数有限而且不稳定,不建议在实际项目中使用。
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
47
50
|
class DualRing extends base_1.Base {
|
|
51
|
+
/**
|
|
52
|
+
* @param colors 颜色(必须是2个),默认为 [$color("#f5542e"), $color("#f2c327")]
|
|
53
|
+
* @param layout 布局
|
|
54
|
+
*/
|
|
48
55
|
constructor({ colors = [$color("#f5542e"), $color("#f2c327")], layout }) {
|
|
49
56
|
super();
|
|
50
57
|
const interval = 1 / 60;
|
|
51
58
|
this._defineView = () => {
|
|
52
59
|
const canvas1 = new CanvasComponet({
|
|
53
60
|
tintColor: colors[0],
|
|
54
|
-
startAngle:
|
|
61
|
+
startAngle: -Math.PI * 3 / 4
|
|
55
62
|
});
|
|
56
63
|
const canvas2 = new CanvasComponet({
|
|
57
64
|
tintColor: colors[1],
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* # cview LoadingWedges
|
|
4
|
-
*/
|
|
5
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -44,7 +41,14 @@ class CanvasComponet extends base_1.Base {
|
|
|
44
41
|
this.view.ocValue().invoke("setNeedsDisplay");
|
|
45
42
|
}
|
|
46
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* 饼图加载动画, 4个颜色的饼图以不同的速度旋转,产生华丽的效果
|
|
46
|
+
*/
|
|
47
47
|
class Wedges extends base_1.Base {
|
|
48
|
+
/**
|
|
49
|
+
* @param colors 饼图颜色(必须是4个颜色),默认为 [$color("#f5542e"), $color("#f2c327"), $color("#008b6e"), $color("#00aede")]
|
|
50
|
+
* @param layout 布局
|
|
51
|
+
*/
|
|
48
52
|
constructor({ colors = [
|
|
49
53
|
$color("#f5542e"),
|
|
50
54
|
$color("#f2c327"),
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* 安卓风格的加载指示器,基于Lottie实现
|
|
4
|
-
*
|
|
5
|
-
* Props:
|
|
6
|
-
*
|
|
7
|
-
* - id 可以重新指定 id,以供 list 或者 matrix 的 template 使用
|
|
8
|
-
* - weight = 2
|
|
9
|
-
* - diameter = 24
|
|
10
|
-
* - color = $color("gray")
|
|
11
|
-
* - bgcolor = $color("clear")
|
|
12
|
-
*
|
|
13
|
-
* Layout 默认居中
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.AndroidStyleSpinner = void 0;
|
|
18
4
|
const base_1 = require("../base");
|
|
5
|
+
/**
|
|
6
|
+
* 安卓风格的加载指示器, 基于Lottie实现, 效果是一个圆环一边旋转一边缩放。由于帧数有限,不建议在大视图上使用。
|
|
7
|
+
*/
|
|
19
8
|
class AndroidStyleSpinner extends base_1.Base {
|
|
9
|
+
/**
|
|
10
|
+
* @param props AndroidStyleSpinnerProps
|
|
11
|
+
* - id?: string 可以重新指定 id,以供 list 或者 matrix 的 template 使用
|
|
12
|
+
* - weight: number
|
|
13
|
+
* - diameter: number
|
|
14
|
+
* - color: UIColor, 默认 gray
|
|
15
|
+
* - bgcolor: UIColor, 默认 clear
|
|
16
|
+
* @param layout 可选布局,默认居中
|
|
17
|
+
*/
|
|
20
18
|
constructor({ props, layout }) {
|
|
21
19
|
super();
|
|
22
20
|
this._props = Object.assign({ weight: 2, diameter: 24, color: $color("gray"), bgcolor: $color("clear") }, props);
|
|
@@ -232,7 +230,7 @@ class AndroidStyleSpinner extends base_1.Base {
|
|
|
232
230
|
circular: true,
|
|
233
231
|
json,
|
|
234
232
|
bgcolor: this._props.bgcolor,
|
|
235
|
-
id: this.id
|
|
233
|
+
id: this._props.id || this.id
|
|
236
234
|
},
|
|
237
235
|
layout: layout || ((make, view) => {
|
|
238
236
|
make.size.equalTo($size(this._props.diameter, this._props.diameter));
|
|
@@ -1,98 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* # cview PreferenceListView_static
|
|
4
|
-
*
|
|
5
|
-
* 便捷的设置列表实现. 其所有 cell 均为静态 cell, 可以同时使用 list 控件的 props(除了 template, data)和 events(除了 didSelect), 同时具有独特方法 set(key, value), 以及独特方法 changed
|
|
6
|
-
*
|
|
7
|
-
* sections 为 Array, 里面的 section 定义:
|
|
8
|
-
*
|
|
9
|
-
* - title?: string 标题.
|
|
10
|
-
* - rows: {type: string}[] 内容
|
|
11
|
-
*
|
|
12
|
-
* row定义:
|
|
13
|
-
*
|
|
14
|
-
* - 通用:
|
|
15
|
-
*
|
|
16
|
-
* - type: string 类型. 包括'string', 'number', 'integer', 'stepper','boolean', 'slider', 'list', 'tab', 'interactive-info', 'info', 'link', 'action'
|
|
17
|
-
* - key?: string 键. 如没有则不会返回其值.
|
|
18
|
-
* - title?: string 标题
|
|
19
|
-
* - value?: any 在下面专项里详解.
|
|
20
|
-
* - titleColor?: $color = $color("primaryText") 标题颜色
|
|
21
|
-
*
|
|
22
|
-
* - string:
|
|
23
|
-
*
|
|
24
|
-
* - value?: string
|
|
25
|
-
* - placeholder?: string
|
|
26
|
-
* - textColor?: $color = $color("primaryText")
|
|
27
|
-
*
|
|
28
|
-
* - number, integer:
|
|
29
|
-
*
|
|
30
|
-
* - value?: number
|
|
31
|
-
* - placeholder?: string
|
|
32
|
-
* - textColor?: $color = $color("primaryText")
|
|
33
|
-
* - min?: number 最小值
|
|
34
|
-
* - max?: number 最大值
|
|
35
|
-
*
|
|
36
|
-
* - stepper:
|
|
37
|
-
*
|
|
38
|
-
* - value?: number
|
|
39
|
-
* - placeholder?: string
|
|
40
|
-
* - min?: number 最小值
|
|
41
|
-
* - max?: number 最大值
|
|
42
|
-
*
|
|
43
|
-
* - boolean:
|
|
44
|
-
*
|
|
45
|
-
* - value?: boolean
|
|
46
|
-
* - onColor?: $color = $color("#34C85A")
|
|
47
|
-
* - thumbColor
|
|
48
|
-
*
|
|
49
|
-
* - slider:
|
|
50
|
-
*
|
|
51
|
-
* - value?: number 即 slider.value
|
|
52
|
-
* - decimal?: number = 1 精度
|
|
53
|
-
* - min?: number
|
|
54
|
-
* - max?: number
|
|
55
|
-
* - minColor?: $color = $color("systemLink")
|
|
56
|
-
* - maxColor?: $color
|
|
57
|
-
* - thumbColor?: $color
|
|
58
|
-
*
|
|
59
|
-
* - list:
|
|
60
|
-
*
|
|
61
|
-
* - value?: number 即 index, -1 时为不选
|
|
62
|
-
* - items?: string[]
|
|
63
|
-
*
|
|
64
|
-
* - tab:
|
|
65
|
-
*
|
|
66
|
-
* - value?: number 即 index, -1 时为不选
|
|
67
|
-
* - items?: string[]
|
|
68
|
-
*
|
|
69
|
-
* - info:
|
|
70
|
-
*
|
|
71
|
-
* - value?: string
|
|
72
|
-
*
|
|
73
|
-
* - interactive-info:
|
|
74
|
-
*
|
|
75
|
-
* - value?: string
|
|
76
|
-
* - copyable?: boolean = false
|
|
77
|
-
*
|
|
78
|
-
* - link:
|
|
79
|
-
*
|
|
80
|
-
* - value?: string url
|
|
81
|
-
*
|
|
82
|
-
* - action:
|
|
83
|
-
*
|
|
84
|
-
* - value?: function 点击后会执行的函数
|
|
85
|
-
* - destructive?: boolean = false 是否为危险动作,若是则为红色
|
|
86
|
-
*
|
|
87
|
-
* Methods:
|
|
88
|
-
*
|
|
89
|
-
* - set(key, value) 设定 key 对应的 value
|
|
90
|
-
* - cview.values 获取全部的 values
|
|
91
|
-
*
|
|
92
|
-
* Events:
|
|
93
|
-
*
|
|
94
|
-
* - changed: values => {}
|
|
95
|
-
*/
|
|
96
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
97
3
|
exports.PreferenceListView = exports.excludedTypes = exports.selectableTypes = void 0;
|
|
98
4
|
const base_1 = require("./base");
|
|
@@ -695,6 +601,100 @@ class ActionCell extends Cell {
|
|
|
695
601
|
return;
|
|
696
602
|
}
|
|
697
603
|
}
|
|
604
|
+
/**
|
|
605
|
+
* # cview PreferenceListView_static
|
|
606
|
+
*
|
|
607
|
+
* 便捷的设置列表实现. 其所有 cell 均为静态 cell, 可以同时使用 list 控件的 props(除了 template, data)和 events(除了 didSelect), 同时具有独特方法 set(key, value), 以及独特方法 changed
|
|
608
|
+
*
|
|
609
|
+
* sections 为 Array, 里面的 section 定义:
|
|
610
|
+
*
|
|
611
|
+
* - title?: string 标题.
|
|
612
|
+
* - rows: {type: string}[] 内容
|
|
613
|
+
*
|
|
614
|
+
* row定义:
|
|
615
|
+
*
|
|
616
|
+
* - 通用:
|
|
617
|
+
*
|
|
618
|
+
* - type: string 类型. 包括'string', 'number', 'integer', 'stepper','boolean', 'slider', 'list', 'tab', 'interactive-info', 'info', 'link', 'action'
|
|
619
|
+
* - key?: string 键. 如没有则不会返回其值.
|
|
620
|
+
* - title?: string 标题
|
|
621
|
+
* - value?: any 在下面专项里详解.
|
|
622
|
+
* - titleColor?: $color = $color("primaryText") 标题颜色
|
|
623
|
+
*
|
|
624
|
+
* - string:
|
|
625
|
+
*
|
|
626
|
+
* - value?: string
|
|
627
|
+
* - placeholder?: string
|
|
628
|
+
* - textColor?: $color = $color("primaryText")
|
|
629
|
+
*
|
|
630
|
+
* - number, integer:
|
|
631
|
+
*
|
|
632
|
+
* - value?: number
|
|
633
|
+
* - placeholder?: string
|
|
634
|
+
* - textColor?: $color = $color("primaryText")
|
|
635
|
+
* - min?: number 最小值
|
|
636
|
+
* - max?: number 最大值
|
|
637
|
+
*
|
|
638
|
+
* - stepper:
|
|
639
|
+
*
|
|
640
|
+
* - value?: number
|
|
641
|
+
* - placeholder?: string
|
|
642
|
+
* - min?: number 最小值
|
|
643
|
+
* - max?: number 最大值
|
|
644
|
+
*
|
|
645
|
+
* - boolean:
|
|
646
|
+
*
|
|
647
|
+
* - value?: boolean
|
|
648
|
+
* - onColor?: $color = $color("#34C85A")
|
|
649
|
+
* - thumbColor
|
|
650
|
+
*
|
|
651
|
+
* - slider:
|
|
652
|
+
*
|
|
653
|
+
* - value?: number 即 slider.value
|
|
654
|
+
* - decimal?: number = 1 精度
|
|
655
|
+
* - min?: number
|
|
656
|
+
* - max?: number
|
|
657
|
+
* - minColor?: $color = $color("systemLink")
|
|
658
|
+
* - maxColor?: $color
|
|
659
|
+
* - thumbColor?: $color
|
|
660
|
+
*
|
|
661
|
+
* - list:
|
|
662
|
+
*
|
|
663
|
+
* - value?: number 即 index, -1 时为不选
|
|
664
|
+
* - items?: string[]
|
|
665
|
+
*
|
|
666
|
+
* - tab:
|
|
667
|
+
*
|
|
668
|
+
* - value?: number 即 index, -1 时为不选
|
|
669
|
+
* - items?: string[]
|
|
670
|
+
*
|
|
671
|
+
* - info:
|
|
672
|
+
*
|
|
673
|
+
* - value?: string
|
|
674
|
+
*
|
|
675
|
+
* - interactive-info:
|
|
676
|
+
*
|
|
677
|
+
* - value?: string
|
|
678
|
+
* - copyable?: boolean = false
|
|
679
|
+
*
|
|
680
|
+
* - link:
|
|
681
|
+
*
|
|
682
|
+
* - value?: string url
|
|
683
|
+
*
|
|
684
|
+
* - action:
|
|
685
|
+
*
|
|
686
|
+
* - value?: function 点击后会执行的函数
|
|
687
|
+
* - destructive?: boolean = false 是否为危险动作,若是则为红色
|
|
688
|
+
*
|
|
689
|
+
* Methods:
|
|
690
|
+
*
|
|
691
|
+
* - set(key, value) 设定 key 对应的 value
|
|
692
|
+
* - cview.values 获取全部的 values
|
|
693
|
+
*
|
|
694
|
+
* Events:
|
|
695
|
+
*
|
|
696
|
+
* - changed: values => {}
|
|
697
|
+
*/
|
|
698
698
|
class PreferenceListView extends base_1.Base {
|
|
699
699
|
constructor({ sections, props = {}, layout, events = {} }) {
|
|
700
700
|
super();
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* #cview symbolButton
|
|
4
|
-
*
|
|
5
|
-
* 创建可以自动规范symbol大小的button,兼容image,可以设定insets
|
|
6
|
-
*
|
|
7
|
-
* props:
|
|
8
|
-
* - symbol
|
|
9
|
-
* - image
|
|
10
|
-
* - tintColor
|
|
11
|
-
* - insets
|
|
12
|
-
*
|
|
13
|
-
* events:
|
|
14
|
-
* - tapped
|
|
15
|
-
*/
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.SymbolButton = void 0;
|
|
18
4
|
const base_1 = require("./base");
|
|
@@ -1,28 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* 本组件是为了仿制 UITabBar
|
|
4
|
-
* 本组件不能指定布局而是应该指定 height(如果需要的话)
|
|
5
|
-
* 典型的使用方式是添加在布局为$layout.fill的视图中,并指定 items
|
|
6
|
-
*
|
|
7
|
-
* props:
|
|
8
|
-
*
|
|
9
|
-
* - 只写 height: number = 50
|
|
10
|
-
* - 只写 items: {symbol?: string, image?:UIImage, title?: string}[]
|
|
11
|
-
* - 只写 bgcolor?: UIColor 如果不指定则背景使用blur(style 10),若指定则使用纯色视图
|
|
12
|
-
* - 读写 index: number = 0
|
|
13
|
-
* - 只写 selectedSegmentTintColor = $color("tintColor")
|
|
14
|
-
* - 只写 defaultSegmentTintColor = colors.footBarDefaultSegmentColor
|
|
15
|
-
*
|
|
16
|
-
* events:
|
|
17
|
-
*
|
|
18
|
-
* - changed: (cview, index) => void
|
|
19
|
-
* - doubleTapped: (cview, index) => void
|
|
20
|
-
*
|
|
21
|
-
* methods:
|
|
22
|
-
*
|
|
23
|
-
* - hide(animated=true) 隐藏
|
|
24
|
-
* - show(animated=true) 显示
|
|
25
|
-
*/
|
|
26
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
3
|
exports.TabBar = void 0;
|
|
28
4
|
const colors_1 = require("../utils/colors");
|
|
@@ -169,6 +145,30 @@ class ImageCell extends base_1.Base {
|
|
|
169
145
|
this.view.get("image").remakeLayout(this.layouts.image_loosed);
|
|
170
146
|
}
|
|
171
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* 本组件是为了仿制 UITabBar
|
|
150
|
+
* 本组件不能指定布局而是应该指定 height(如果需要的话)
|
|
151
|
+
* 典型的使用方式是添加在布局为$layout.fill的视图中,并指定 items
|
|
152
|
+
*
|
|
153
|
+
* props:
|
|
154
|
+
*
|
|
155
|
+
* - 只写 height: number = 50
|
|
156
|
+
* - 只写 items: {symbol?: string, image?:UIImage, title?: string}[]
|
|
157
|
+
* - 只写 bgcolor?: UIColor 如果不指定则背景使用blur(style 10),若指定则使用纯色视图
|
|
158
|
+
* - 读写 index: number = 0
|
|
159
|
+
* - 只写 selectedSegmentTintColor = $color("tintColor")
|
|
160
|
+
* - 只写 defaultSegmentTintColor = colors.footBarDefaultSegmentColor
|
|
161
|
+
*
|
|
162
|
+
* events:
|
|
163
|
+
*
|
|
164
|
+
* - changed: (cview, index) => void
|
|
165
|
+
* - doubleTapped: (cview, index) => void
|
|
166
|
+
*
|
|
167
|
+
* methods:
|
|
168
|
+
*
|
|
169
|
+
* - hide(animated=true) 隐藏
|
|
170
|
+
* - show(animated=true) 显示
|
|
171
|
+
*/
|
|
172
172
|
class TabBar extends base_1.Base {
|
|
173
173
|
constructor({ props, events = {} }) {
|
|
174
174
|
super();
|