jsbox-cview 1.6.5 → 1.6.7
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/README.md +4 -0
- package/dist/components/alert/input-alert.d.ts +22 -0
- package/dist/components/alert/input-alert.js +1 -2
- package/dist/components/alert/login-alert.d.ts +21 -0
- package/dist/components/alert/login-alert.js +1 -2
- package/dist/components/alert/plain-alert.d.ts +15 -0
- package/dist/components/alert/plain-alert.js +1 -2
- package/dist/components/alert/uialert.d.ts +29 -0
- package/{components/base.ts → dist/components/base.d.ts} +9 -28
- package/dist/components/custom-navigation-bar.d.ts +117 -0
- package/dist/components/custom-navigation-bar.js +7 -1
- package/dist/components/dialogs/dialog-sheet.d.ts +46 -0
- package/dist/components/dialogs/dialog-sheet.js +3 -1
- package/dist/components/dialogs/form-dialog.d.ts +15 -0
- package/dist/components/dialogs/form-dialog.js +1 -2
- package/dist/components/dialogs/list-dialog.d.ts +23 -0
- package/dist/components/dialogs/list-dialog.js +2 -3
- package/dist/components/dialogs/text-dialog.d.ts +13 -0
- package/dist/components/dialogs/text-dialog.js +1 -2
- package/dist/components/dynamic-contextmenu-view.d.ts +40 -0
- package/dist/components/dynamic-contextmenu-view.js +5 -1
- package/dist/components/dynamic-itemsize-matrix.d.ts +79 -0
- package/dist/components/dynamic-itemsize-matrix.js +18 -15
- package/dist/components/dynamic-itemsize-section-matrix.d.ts +115 -0
- package/dist/components/dynamic-itemsize-section-matrix.js +293 -0
- package/dist/components/dynamic-preference-listview.d.ts +63 -0
- package/dist/components/dynamic-preference-listview.js +25 -16
- package/dist/components/dynamic-rowheight-list.d.ts +38 -0
- package/dist/components/dynamic-rowheight-list.js +10 -3
- package/dist/components/enhanced-imageview.d.ts +41 -0
- package/dist/components/enhanced-imageview.js +1 -1
- package/dist/components/flowlayout.d.ts +63 -0
- package/dist/components/flowlayout.js +10 -13
- package/dist/components/image-pager.d.ts +49 -0
- package/dist/components/image-pager.js +6 -1
- package/dist/components/oc-webview.d.ts +64 -0
- package/dist/components/oc-webview.js +13 -5
- package/dist/components/page-control.d.ts +45 -0
- package/dist/components/page-control.js +2 -13
- package/dist/components/pageviewer-titlebar.d.ts +48 -0
- package/dist/components/pageviewer-titlebar.js +7 -13
- package/dist/components/pageviewer.d.ts +41 -0
- package/dist/components/pageviewer.js +4 -1
- package/dist/components/refresh-button.d.ts +25 -0
- package/dist/components/refresh-button.js +3 -4
- package/dist/components/rotating-view.d.ts +45 -0
- package/dist/components/rotating-view.js +10 -2
- package/dist/components/searchbar.d.ts +118 -0
- package/dist/components/searchbar.js +8 -1
- package/dist/components/sheet.d.ts +42 -0
- package/dist/components/single-views.d.ts +289 -0
- package/dist/components/single-views.js +11 -4
- package/dist/components/spinners/loading-dual-ring.d.ts +18 -0
- package/dist/components/spinners/loading-wedges.d.ts +15 -0
- package/dist/components/spinners/spinner-androidstyle.d.ts +30 -0
- package/dist/components/spinners/spinner-androidstyle.js +7 -1
- package/dist/components/static-preference-listview.d.ts +389 -0
- package/dist/components/static-preference-listview.js +13 -10
- package/dist/components/symbol-button.d.ts +39 -0
- package/dist/components/symbol-button.js +8 -1
- package/dist/components/tabbar.d.ts +140 -0
- package/dist/components/tabbar.js +8 -1
- package/dist/controller/base-controller.d.ts +125 -0
- package/dist/controller/base-controller.js +11 -11
- package/dist/controller/controller-router.d.ts +48 -0
- package/dist/controller/pageviewer-controller.d.ts +38 -0
- package/dist/controller/pageviewer-controller.js +4 -1
- package/dist/controller/presented-page-controller.d.ts +41 -0
- package/dist/controller/presented-page-controller.js +7 -9
- package/dist/controller/splitview-controller.d.ts +90 -0
- package/dist/controller/splitview-controller.js +27 -11
- package/dist/controller/tabbar-controller.d.ts +49 -0
- package/dist/controller/tabbar-controller.js +12 -15
- package/{index.ts → dist/index.d.ts} +2 -0
- package/dist/index.js +2 -0
- package/dist/utils/colors.d.ts +7 -0
- package/dist/utils/cvid.d.ts +11 -0
- package/dist/utils/l10n.d.ts +1 -0
- package/dist/utils/l10n.js +1 -2
- package/dist/utils/path.d.ts +8 -0
- package/dist/utils/path.js +8 -9
- package/dist/utils/rect.d.ts +38 -0
- package/dist/utils/rect.js +8 -9
- package/dist/utils/uitools.d.ts +75 -0
- package/dist/utils/uitools.js +6 -6
- package/package.json +20 -5
- package/.prettierignore +0 -6
- package/.prettierrc +0 -3
- package/components/alert/input-alert.ts +0 -64
- package/components/alert/login-alert.ts +0 -66
- package/components/alert/plain-alert.ts +0 -39
- package/components/alert/uialert.ts +0 -107
- package/components/custom-navigation-bar.ts +0 -579
- package/components/dialogs/dialog-sheet.ts +0 -111
- package/components/dialogs/form-dialog.ts +0 -63
- package/components/dialogs/list-dialog.ts +0 -119
- package/components/dialogs/text-dialog.ts +0 -44
- package/components/dynamic-contextmenu-view.ts +0 -115
- package/components/dynamic-itemsize-matrix.ts +0 -206
- package/components/dynamic-preference-listview.ts +0 -684
- package/components/dynamic-rowheight-list.ts +0 -77
- package/components/enhanced-imageview.ts +0 -132
- package/components/flowlayout.ts +0 -248
- package/components/image-pager.ts +0 -180
- package/components/oc-webview.ts +0 -177
- package/components/page-control.ts +0 -93
- package/components/pageviewer-titlebar.ts +0 -166
- package/components/pageviewer.ts +0 -125
- package/components/refresh-button.ts +0 -83
- package/components/rotating-view.ts +0 -133
- package/components/searchbar.ts +0 -398
- package/components/sheet.ts +0 -104
- package/components/single-views.ts +0 -956
- package/components/spinners/loading-dual-ring.ts +0 -97
- package/components/spinners/loading-wedges.ts +0 -106
- package/components/spinners/spinner-androidstyle.ts +0 -269
- package/components/static-preference-listview.ts +0 -1282
- package/components/symbol-button.ts +0 -108
- package/components/tabbar.ts +0 -453
- package/controller/base-controller.ts +0 -214
- package/controller/controller-router.ts +0 -73
- package/controller/pageviewer-controller.ts +0 -93
- package/controller/presented-page-controller.ts +0 -76
- package/controller/splitview-controller.ts +0 -359
- package/controller/tabbar-controller.ts +0 -131
- package/dist/test/custom-navigation-bar.js +0 -40
- package/dist/test/dialog-sheet.js +0 -40
- package/dist/test/dynamic-contextmenu-view.js +0 -66
- package/dist/test/dynamic-itemsize-matrix.js +0 -74
- package/dist/test/dynamic-preference-listview.js +0 -150
- package/dist/test/flowlayout.js +0 -76
- package/dist/test/form-dialog.js +0 -51
- package/dist/test/oc-webview.js +0 -195
- package/dist/test/pageviewer-controller.js +0 -20
- package/dist/test/pageviewer-titlebar.js +0 -18
- package/dist/test/pageviewer.js +0 -32
- package/dist/test/refresh-button.js +0 -26
- package/dist/test/searchbar.js +0 -36
- package/dist/test/splitview-controller.js +0 -41
- package/dist/test/static-preference-listview.js +0 -143
- package/dist/test/tabbar-controller.js +0 -48
- package/test/custom-navigation-bar.ts +0 -40
- package/test/dialog-sheet.ts +0 -40
- package/test/dynamic-contextmenu-view.ts +0 -67
- package/test/dynamic-itemsize-matrix.ts +0 -74
- package/test/dynamic-preference-listview.ts +0 -151
- package/test/flowlayout.ts +0 -79
- package/test/form-dialog.ts +0 -48
- package/test/oc-webview.ts +0 -197
- package/test/pageviewer-controller.ts +0 -21
- package/test/pageviewer-titlebar.ts +0 -18
- package/test/pageviewer.ts +0 -31
- package/test/refresh-button.ts +0 -26
- package/test/searchbar.ts +0 -38
- package/test/splitview-controller.ts +0 -42
- package/test/static-preference-listview.ts +0 -142
- package/test/tabbar-controller.ts +0 -49
- package/tsconfig.json +0 -122
- package/utils/colors.ts +0 -17
- package/utils/cvid.ts +0 -32
- package/utils/l10n.ts +0 -42
- package/utils/path.ts +0 -97
- package/utils/rect.ts +0 -90
- package/utils/uitools.ts +0 -122
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Base } from "./base";
|
|
2
|
+
import { Input, Label, ContentView } from "./single-views";
|
|
3
|
+
interface SearchBarProps {
|
|
4
|
+
placeholder: string;
|
|
5
|
+
cancelText: string;
|
|
6
|
+
tintColor: UIColor;
|
|
7
|
+
bgcolor: UIColor;
|
|
8
|
+
style: 0 | 1 | 2;
|
|
9
|
+
accessoryCview?: Base<any, any>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 搜索框
|
|
13
|
+
*
|
|
14
|
+
* 有三种样式可供选择,通过 style 属性设置
|
|
15
|
+
*
|
|
16
|
+
* @method focus() 聚焦
|
|
17
|
+
* @method blur() 失焦
|
|
18
|
+
* @property text: string 文本
|
|
19
|
+
*/
|
|
20
|
+
export declare class SearchBar extends Base<UIView, UiTypes.ViewOptions> {
|
|
21
|
+
_props: SearchBarProps;
|
|
22
|
+
_defineView: () => UiTypes.ViewOptions;
|
|
23
|
+
cviews: {
|
|
24
|
+
input: Input;
|
|
25
|
+
iconInput: ContentView;
|
|
26
|
+
cancelButton: Label;
|
|
27
|
+
bgview: ContentView;
|
|
28
|
+
};
|
|
29
|
+
_layouts: {
|
|
30
|
+
iconInput: {
|
|
31
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
32
|
+
focused?: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
33
|
+
};
|
|
34
|
+
cancelButton: {
|
|
35
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
36
|
+
};
|
|
37
|
+
bgview: {
|
|
38
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
39
|
+
focused?: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
_focused: boolean;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param props 属性
|
|
46
|
+
* - text: string
|
|
47
|
+
* - style: number 搜索框的样式
|
|
48
|
+
* - 0: 取消按钮在输入框内,聚焦时显示取消按钮
|
|
49
|
+
* - 1: 取消按钮在输入框右侧,聚焦时会有左右移动的动画
|
|
50
|
+
* - 2: 取消按钮布局同 1,但是 placeholder 平时显示在中间,聚焦时才会移动到左边。
|
|
51
|
+
* 如果使用此样式,建议每次 blur 的时候都清除 text。
|
|
52
|
+
* - accessoryCview: cview 请通过下面的事件来和 SearchBar 互相操作
|
|
53
|
+
* - placeholder: string
|
|
54
|
+
* - cancelText: string
|
|
55
|
+
* - tintColor: \$color("systemLink")
|
|
56
|
+
* - bgcolor: colors.searchBarBgcolor
|
|
57
|
+
* @param layout 布局
|
|
58
|
+
* @param events 事件
|
|
59
|
+
* - didBeginEditing: cview => void
|
|
60
|
+
* - didEndEditing: cview => void
|
|
61
|
+
* - changed: cview => void
|
|
62
|
+
* - returned: cview => void
|
|
63
|
+
*/
|
|
64
|
+
constructor({ props, layout, events, }: {
|
|
65
|
+
props: Partial<SearchBarProps>;
|
|
66
|
+
layout: (make: MASConstraintMaker, view: UIView) => void;
|
|
67
|
+
events?: {
|
|
68
|
+
didBeginEditing?: (cview: SearchBar) => void;
|
|
69
|
+
didEndEditing?: (cview: SearchBar) => void;
|
|
70
|
+
changed?: (cview: SearchBar) => void;
|
|
71
|
+
returned?: (cview: SearchBar) => void;
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
_defineLayouts(cancelButtonWidth: number, placeholderWidth: number): {
|
|
75
|
+
iconInput: {
|
|
76
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
77
|
+
focused: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
78
|
+
};
|
|
79
|
+
cancelButton: {
|
|
80
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
81
|
+
};
|
|
82
|
+
bgview: {
|
|
83
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
84
|
+
focused?: undefined;
|
|
85
|
+
};
|
|
86
|
+
} | {
|
|
87
|
+
iconInput: {
|
|
88
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
89
|
+
focused?: undefined;
|
|
90
|
+
};
|
|
91
|
+
cancelButton: {
|
|
92
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
93
|
+
};
|
|
94
|
+
bgview: {
|
|
95
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
96
|
+
focused: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
97
|
+
};
|
|
98
|
+
} | {
|
|
99
|
+
iconInput: {
|
|
100
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
101
|
+
focused: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
102
|
+
};
|
|
103
|
+
cancelButton: {
|
|
104
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
105
|
+
};
|
|
106
|
+
bgview: {
|
|
107
|
+
normal: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
108
|
+
focused: (make: MASConstraintMaker, view: AllUIView) => void;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
_onFocused(): void;
|
|
112
|
+
_onBlurred(): void;
|
|
113
|
+
focus(): void;
|
|
114
|
+
blur(): void;
|
|
115
|
+
set text(text: string);
|
|
116
|
+
get text(): string;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
@@ -39,7 +39,14 @@ class SearchBar extends base_1.Base {
|
|
|
39
39
|
*/
|
|
40
40
|
constructor({ props, layout, events = {}, }) {
|
|
41
41
|
super();
|
|
42
|
-
this._props =
|
|
42
|
+
this._props = {
|
|
43
|
+
placeholder: (0, l10n_1.l10n)("SEARCH"),
|
|
44
|
+
cancelText: (0, l10n_1.l10n)("CANCEL"),
|
|
45
|
+
tintColor: $color("systemLink"),
|
|
46
|
+
bgcolor: colors_1.searchBarBgcolor,
|
|
47
|
+
style: 0,
|
|
48
|
+
...props,
|
|
49
|
+
};
|
|
43
50
|
const cancelButtonWidth = (0, uitools_1.getTextWidth)(this._props.cancelText, {
|
|
44
51
|
inset: 20,
|
|
45
52
|
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Base } from "./base";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* 创建新的 UIViewController,主要用于 formSheet 和 pageSheet
|
|
5
|
+
*
|
|
6
|
+
* ## 参数:
|
|
7
|
+
* - presentMode: number, default: 1, pageSheet: 1, formSheet: 2
|
|
8
|
+
* - animated: boolean = true 是否启用动画效果
|
|
9
|
+
* - interactiveDismissalDisabled: boolean = false 是否禁用下拉退出
|
|
10
|
+
* - bgcolor: $color $color("secondarySurface")
|
|
11
|
+
* - cview: Cview
|
|
12
|
+
* - dismissalHandler: function 退出时的回调
|
|
13
|
+
*
|
|
14
|
+
* ## 方法:
|
|
15
|
+
* - present()
|
|
16
|
+
* - dismiss()
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export declare class Sheet<T extends Base<U, R>, U extends AllUIView, R extends UiTypes.AllViewOptions> {
|
|
20
|
+
id: string;
|
|
21
|
+
_animated: boolean;
|
|
22
|
+
_presentMode: number;
|
|
23
|
+
_interactiveDismissalDisabled: boolean;
|
|
24
|
+
_bgcolor: UIColor;
|
|
25
|
+
_cview?: T;
|
|
26
|
+
_dismissalHandler?: () => void;
|
|
27
|
+
_PSViewController: any;
|
|
28
|
+
_PSViewControllerView: any;
|
|
29
|
+
constructor({ presentMode, animated, interactiveDismissalDisabled, bgcolor, cview, dismissalHandler, }: {
|
|
30
|
+
presentMode?: number;
|
|
31
|
+
animated?: boolean;
|
|
32
|
+
interactiveDismissalDisabled?: boolean;
|
|
33
|
+
bgcolor?: UIColor;
|
|
34
|
+
cview?: T;
|
|
35
|
+
dismissalHandler?: () => void;
|
|
36
|
+
});
|
|
37
|
+
_create(): void;
|
|
38
|
+
_define(): void;
|
|
39
|
+
_add(cview: T): void;
|
|
40
|
+
present(): void;
|
|
41
|
+
dismiss(): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 实现单个视图的定义
|
|
3
|
+
*/
|
|
4
|
+
import { Base } from "./base";
|
|
5
|
+
export declare class SingleView<T extends UiTypes.AllViewTypes, V extends UIBaseView, P extends UiTypes.BaseViewProps, E extends UiTypes.BaseViewEvents<V>, O extends UiTypes.AllViewOptions> extends Base<V, O> {
|
|
6
|
+
_type: T;
|
|
7
|
+
_props?: P;
|
|
8
|
+
_layout?: (make: MASConstraintMaker, view: V) => void;
|
|
9
|
+
_events?: E;
|
|
10
|
+
_views?: UiTypes.AllViewOptions[];
|
|
11
|
+
_defineView: () => O;
|
|
12
|
+
constructor({ type, props, layout, events, views, }: {
|
|
13
|
+
type: T;
|
|
14
|
+
props?: P;
|
|
15
|
+
layout?: (make: MASConstraintMaker, view: V) => void;
|
|
16
|
+
events?: E;
|
|
17
|
+
views?: UiTypes.AllViewOptions[];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export declare class ClearView extends SingleView<"view", UIView, UiTypes.ViewProps, UiTypes.BaseViewEvents<UIView>, UiTypes.ViewOptions> {
|
|
21
|
+
constructor({ props, layout, events, views, }: {
|
|
22
|
+
props?: UiTypes.ViewProps;
|
|
23
|
+
layout?: (make: MASConstraintMaker, view: UIView) => void;
|
|
24
|
+
events?: UiTypes.BaseViewEvents<UIView>;
|
|
25
|
+
views?: UiTypes.AllViewOptions[];
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export declare class ContentView extends SingleView<"view", UIView, UiTypes.ViewProps, UiTypes.BaseViewEvents<UIView>, UiTypes.ViewOptions> {
|
|
29
|
+
constructor({ props, layout, events, views, }: {
|
|
30
|
+
props?: UiTypes.ViewProps;
|
|
31
|
+
layout?: (make: MASConstraintMaker, view: UIView) => void;
|
|
32
|
+
events?: UiTypes.BaseViewEvents;
|
|
33
|
+
views?: UiTypes.AllViewOptions[];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 遮挡视图,使得下面的view无法操作并且整体变暗。
|
|
38
|
+
* 设计上此视图不单独使用,而是作为一个子视图
|
|
39
|
+
* events:
|
|
40
|
+
* - tapped 点击事件,通常用于dismiss
|
|
41
|
+
*/
|
|
42
|
+
export declare class MaskView extends SingleView<"view", UIView, UiTypes.ViewProps, UiTypes.BaseViewEvents<UIView>, UiTypes.ViewOptions> {
|
|
43
|
+
constructor({ props, layout, events, views, }: {
|
|
44
|
+
props?: UiTypes.ViewProps;
|
|
45
|
+
layout?: (make: MASConstraintMaker, view: UIView) => void;
|
|
46
|
+
events?: UiTypes.BaseViewEvents;
|
|
47
|
+
views?: UiTypes.AllViewOptions[];
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export declare class Label extends SingleView<"label", UILabelView, UiTypes.LabelProps, UiTypes.BaseViewEvents<UILabelView>, UiTypes.LabelOptions> {
|
|
51
|
+
constructor({ props, layout, events, views, }: {
|
|
52
|
+
props?: UiTypes.LabelProps;
|
|
53
|
+
layout?: (make: MASConstraintMaker, view: UILabelView) => void;
|
|
54
|
+
events?: UiTypes.BaseViewEvents<UILabelView>;
|
|
55
|
+
views?: UiTypes.AllViewOptions[];
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export declare class Button extends SingleView<"button", UIButtonView, UiTypes.ButtonProps, UiTypes.BaseViewEvents<UIButtonView>, UiTypes.ButtonOptions> {
|
|
59
|
+
constructor({ props, layout, events, views, }: {
|
|
60
|
+
props?: UiTypes.ButtonProps;
|
|
61
|
+
layout?: (make: MASConstraintMaker, view: UIButtonView) => void;
|
|
62
|
+
events?: UiTypes.BaseViewEvents<UIButtonView>;
|
|
63
|
+
views?: UiTypes.AllViewOptions[];
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
export declare class Input extends SingleView<"input", UIInputView, UiTypes.InputProps, UiTypes.InputEvents, UiTypes.InputOptions> {
|
|
67
|
+
constructor({ props, layout, events, views, }: {
|
|
68
|
+
props?: UiTypes.InputProps;
|
|
69
|
+
layout?: (make: MASConstraintMaker, view: UIInputView) => void;
|
|
70
|
+
events?: UiTypes.InputEvents;
|
|
71
|
+
views?: UiTypes.AllViewOptions[];
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export declare class Slider extends SingleView<"slider", UISliderView, UiTypes.SliderProps, UiTypes.SliderEvents, UiTypes.SliderOptions> {
|
|
75
|
+
constructor({ props, layout, events, views, }: {
|
|
76
|
+
props?: UiTypes.SliderProps;
|
|
77
|
+
layout?: (make: MASConstraintMaker, view: UISliderView) => void;
|
|
78
|
+
events?: UiTypes.SliderEvents;
|
|
79
|
+
views?: UiTypes.AllViewOptions[];
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export declare class Switch extends SingleView<"switch", UISwitchView, UiTypes.SwitchProps, UiTypes.SwitchEvents, UiTypes.SwitchOptions> {
|
|
83
|
+
constructor({ props, layout, events, views, }: {
|
|
84
|
+
props?: UiTypes.SwitchProps;
|
|
85
|
+
layout?: (make: MASConstraintMaker, view: UISwitchView) => void;
|
|
86
|
+
events?: UiTypes.SwitchEvents;
|
|
87
|
+
views?: UiTypes.AllViewOptions[];
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
export declare class Spinner extends SingleView<"spinner", UISpinnerView, UiTypes.SpinnerProps, UiTypes.BaseViewEvents<UISpinnerView>, UiTypes.SpinnerOptions> {
|
|
91
|
+
constructor({ props, layout, events, views, }: {
|
|
92
|
+
props?: UiTypes.SpinnerProps;
|
|
93
|
+
layout?: (make: MASConstraintMaker, view: UISpinnerView) => void;
|
|
94
|
+
events?: UiTypes.BaseViewEvents<UISpinnerView>;
|
|
95
|
+
views?: UiTypes.AllViewOptions[];
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
export declare class Progress extends SingleView<"progress", UIProgressView, UiTypes.ProgressProps, UiTypes.BaseViewEvents<UIProgressView>, UiTypes.ProgressOptions> {
|
|
99
|
+
constructor({ props, layout, events, views, }: {
|
|
100
|
+
props?: UiTypes.ProgressProps;
|
|
101
|
+
layout?: (make: MASConstraintMaker, view: UIProgressView) => void;
|
|
102
|
+
events?: UiTypes.BaseViewEvents<UIProgressView>;
|
|
103
|
+
views?: UiTypes.AllViewOptions[];
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export declare class Gallery extends SingleView<"gallery", UIGalleryView, UiTypes.GalleryProps, UiTypes.GalleryEvents, UiTypes.GalleryOptions> {
|
|
107
|
+
constructor({ props, layout, events, views, }: {
|
|
108
|
+
props?: UiTypes.GalleryProps;
|
|
109
|
+
layout?: (make: MASConstraintMaker, view: UIGalleryView) => void;
|
|
110
|
+
events?: UiTypes.GalleryEvents;
|
|
111
|
+
views?: UiTypes.AllViewOptions[];
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
export declare class Stepper extends SingleView<"stepper", UIStepperView, UiTypes.StepperProps, UiTypes.StepperEvents, UiTypes.StepperOptions> {
|
|
115
|
+
constructor({ props, layout, events, views, }: {
|
|
116
|
+
props?: UiTypes.StepperProps;
|
|
117
|
+
layout?: (make: MASConstraintMaker, view: UIStepperView) => void;
|
|
118
|
+
events?: UiTypes.StepperEvents;
|
|
119
|
+
views?: UiTypes.AllViewOptions[];
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
export declare class Text extends SingleView<"text", UITextView, UiTypes.TextProps, UiTypes.TextEvents, UiTypes.TextOptions> {
|
|
123
|
+
constructor({ props, layout, events, views, }: {
|
|
124
|
+
props?: UiTypes.TextProps;
|
|
125
|
+
layout?: (make: MASConstraintMaker, view: UITextView) => void;
|
|
126
|
+
events?: UiTypes.TextEvents;
|
|
127
|
+
views?: UiTypes.AllViewOptions[];
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
export declare class Image extends SingleView<"image", UIImageView, UiTypes.ImageProps, UiTypes.BaseViewEvents<UIImageView>, UiTypes.ImageOptions> {
|
|
131
|
+
constructor({ props, layout, events, views, }: {
|
|
132
|
+
props?: UiTypes.ImageProps;
|
|
133
|
+
layout?: (make: MASConstraintMaker, view: UIImageView) => void;
|
|
134
|
+
events?: UiTypes.BaseViewEvents<UIImageView>;
|
|
135
|
+
views?: UiTypes.AllViewOptions[];
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
export declare class Video extends SingleView<"video", UIVideoView, UiTypes.VideoProps, UiTypes.BaseViewEvents<UIVideoView>, UiTypes.VideoOptions> {
|
|
139
|
+
constructor({ props, layout, events, views, }: {
|
|
140
|
+
props?: UiTypes.VideoProps;
|
|
141
|
+
layout?: (make: MASConstraintMaker, view: UIVideoView) => void;
|
|
142
|
+
events?: UiTypes.BaseViewEvents<UIVideoView>;
|
|
143
|
+
views?: UiTypes.AllViewOptions[];
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
export declare class Scroll extends SingleView<"scroll", UIScrollView, UiTypes.ScrollProps, UiTypes.ScrollEvents, UiTypes.ScrollOptions> {
|
|
147
|
+
constructor({ props, layout, events, views, }: {
|
|
148
|
+
props?: UiTypes.ScrollProps;
|
|
149
|
+
layout?: (make: MASConstraintMaker, view: UIScrollView) => void;
|
|
150
|
+
events?: UiTypes.ScrollEvents;
|
|
151
|
+
views?: UiTypes.AllViewOptions[];
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
export declare class Stack extends SingleView<"stack", UIStackView, UiTypes.StackProps, UiTypes.BaseViewEvents<UIStackView>, UiTypes.StackOptions> {
|
|
155
|
+
constructor({ props, layout, events, views, }: {
|
|
156
|
+
props?: UiTypes.StackProps;
|
|
157
|
+
layout?: (make: MASConstraintMaker, view: UIStackView) => void;
|
|
158
|
+
events?: UiTypes.BaseViewEvents<UIStackView>;
|
|
159
|
+
views?: UiTypes.AllViewOptions[];
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
export declare class Tab extends SingleView<"tab", UITabView, UiTypes.TabProps, UiTypes.TabEvents, UiTypes.TabOptions> {
|
|
163
|
+
constructor({ props, layout, events, views, }: {
|
|
164
|
+
props?: UiTypes.TabProps;
|
|
165
|
+
layout?: (make: MASConstraintMaker, view: UITabView) => void;
|
|
166
|
+
events?: UiTypes.TabEvents;
|
|
167
|
+
views?: UiTypes.AllViewOptions[];
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
export declare class Menu extends SingleView<"menu", UIMenuView, UiTypes.MenuProps, UiTypes.MenuEvents, UiTypes.MenuOptions> {
|
|
171
|
+
constructor({ props, layout, events, views, }: {
|
|
172
|
+
props?: UiTypes.MenuProps;
|
|
173
|
+
layout?: (make: MASConstraintMaker, view: UIMenuView) => void;
|
|
174
|
+
events?: UiTypes.MenuEvents;
|
|
175
|
+
views?: UiTypes.AllViewOptions[];
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
export declare class Map extends SingleView<"map", UIMapView, UiTypes.MapProps, UiTypes.BaseViewEvents<UIMapView>, UiTypes.MapOptions> {
|
|
179
|
+
constructor({ props, layout, events, views, }: {
|
|
180
|
+
props?: UiTypes.MapProps;
|
|
181
|
+
layout?: (make: MASConstraintMaker, view: UIMapView) => void;
|
|
182
|
+
events?: UiTypes.BaseViewEvents<UIMapView>;
|
|
183
|
+
views?: UiTypes.AllViewOptions[];
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
export declare class Web extends SingleView<"web", UIWebView, UiTypes.WebProps, UiTypes.WebEvents, UiTypes.WebOptions> {
|
|
187
|
+
constructor({ props, layout, events, views, }: {
|
|
188
|
+
props?: UiTypes.WebProps;
|
|
189
|
+
layout?: (make: MASConstraintMaker, view: UIWebView) => void;
|
|
190
|
+
events?: UiTypes.WebEvents;
|
|
191
|
+
views?: UiTypes.AllViewOptions[];
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
export declare class List extends SingleView<"list", UIListView, UiTypes.ListProps, UiTypes.ListEvents, UiTypes.ListOptions> {
|
|
195
|
+
constructor({ props, layout, events, views, }: {
|
|
196
|
+
props?: UiTypes.ListProps;
|
|
197
|
+
layout?: (make: MASConstraintMaker, view: UIListView) => void;
|
|
198
|
+
events?: UiTypes.ListEvents;
|
|
199
|
+
views?: UiTypes.AllViewOptions[];
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
export declare class Matrix extends SingleView<"matrix", UIMatrixView, UiTypes.MatrixProps, UiTypes.MatrixEvents, UiTypes.MatrixOptions> {
|
|
203
|
+
constructor({ props, layout, events, views, }: {
|
|
204
|
+
props?: UiTypes.MatrixProps;
|
|
205
|
+
layout?: (make: MASConstraintMaker, view: UIMatrixView) => void;
|
|
206
|
+
events?: UiTypes.MatrixEvents;
|
|
207
|
+
views?: UiTypes.AllViewOptions[];
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
export declare class Blur extends SingleView<"blur", UIBlurView, UiTypes.BlurProps, UiTypes.BaseViewEvents<UIBlurView>, UiTypes.BlurOptions> {
|
|
211
|
+
constructor({ props, layout, events, views, }: {
|
|
212
|
+
props?: UiTypes.BlurProps;
|
|
213
|
+
layout?: (make: MASConstraintMaker, view: UIBlurView) => void;
|
|
214
|
+
events?: UiTypes.BaseViewEvents<UIBlurView>;
|
|
215
|
+
views?: UiTypes.AllViewOptions[];
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
export declare class Gradient extends SingleView<"gradient", UIGradientView, UiTypes.GradientProps, UiTypes.BaseViewEvents<UIGradientView>, UiTypes.GradientOptions> {
|
|
219
|
+
constructor({ props, layout, events, views, }: {
|
|
220
|
+
props?: UiTypes.GradientProps;
|
|
221
|
+
layout?: (make: MASConstraintMaker, view: UIGradientView) => void;
|
|
222
|
+
events?: UiTypes.BaseViewEvents<UIGradientView>;
|
|
223
|
+
views?: UiTypes.AllViewOptions[];
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
export declare class DatePicker extends SingleView<"date-picker", UIDatePickerView, UiTypes.DatePickerProps, UiTypes.DatePickerEvents, UiTypes.DatePickerOptions> {
|
|
227
|
+
constructor({ props, layout, events, views, }: {
|
|
228
|
+
props?: UiTypes.DatePickerProps;
|
|
229
|
+
layout?: (make: MASConstraintMaker, view: UIDatePickerView) => void;
|
|
230
|
+
events?: UiTypes.DatePickerEvents;
|
|
231
|
+
views?: UiTypes.AllViewOptions[];
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
export declare class Picker extends SingleView<"picker", UIPickerView, UiTypes.PickerProps, UiTypes.PickerEvents, UiTypes.PickerOptions> {
|
|
235
|
+
constructor({ props, layout, events, views, }: {
|
|
236
|
+
props?: UiTypes.PickerProps;
|
|
237
|
+
layout?: (make: MASConstraintMaker, view: UIPickerView) => void;
|
|
238
|
+
events?: UiTypes.PickerEvents;
|
|
239
|
+
views?: UiTypes.AllViewOptions[];
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
export declare class Canvas extends SingleView<"canvas", UICanvasView, UiTypes.CanvasProps, UiTypes.CanvasEvents, UiTypes.CanvasOptions> {
|
|
243
|
+
constructor({ props, layout, events, views, }: {
|
|
244
|
+
props?: UiTypes.CanvasProps;
|
|
245
|
+
layout?: (make: MASConstraintMaker, view: UICanvasView) => void;
|
|
246
|
+
events?: UiTypes.CanvasEvents;
|
|
247
|
+
views?: UiTypes.AllViewOptions[];
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
export declare class Markdown extends SingleView<"markdown", UIMarkdownView, UiTypes.MarkdownProps, UiTypes.BaseViewEvents<UIMarkdownView>, UiTypes.MarkdownOptions> {
|
|
251
|
+
constructor({ props, layout, events, views, }: {
|
|
252
|
+
props?: UiTypes.MarkdownProps;
|
|
253
|
+
layout?: (make: MASConstraintMaker, view: UIMarkdownView) => void;
|
|
254
|
+
events?: UiTypes.BaseViewEvents<UIMarkdownView>;
|
|
255
|
+
views?: UiTypes.AllViewOptions[];
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
export declare class Lottie extends SingleView<"lottie", UILottieView, UiTypes.LottieProps, UiTypes.BaseViewEvents<UILottieView>, UiTypes.LottieOptions> {
|
|
259
|
+
constructor({ props, layout, events, views, }: {
|
|
260
|
+
props?: UiTypes.LottieProps;
|
|
261
|
+
layout?: (make: MASConstraintMaker, view: UILottieView) => void;
|
|
262
|
+
events?: UiTypes.BaseViewEvents<UILottieView>;
|
|
263
|
+
views?: UiTypes.AllViewOptions[];
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
export declare class Chart extends SingleView<"chart", UIChartView, UiTypes.ChartProps, UiTypes.ChartEvents, UiTypes.ChartOptions> {
|
|
267
|
+
constructor({ props, layout, events, views, }: {
|
|
268
|
+
props?: UiTypes.ChartProps;
|
|
269
|
+
layout?: (make: MASConstraintMaker, view: UIChartView) => void;
|
|
270
|
+
events?: UiTypes.ChartEvents;
|
|
271
|
+
views?: UiTypes.AllViewOptions[];
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
export declare class Code extends SingleView<"code", UICodeView, UiTypes.CodeProps, UiTypes.BaseViewEvents<UICodeView>, UiTypes.CodeOptions> {
|
|
275
|
+
constructor({ props, layout, events, views, }: {
|
|
276
|
+
props?: UiTypes.CodeProps;
|
|
277
|
+
layout?: (make: MASConstraintMaker, view: UICodeView) => void;
|
|
278
|
+
events?: UiTypes.BaseViewEvents<UICodeView>;
|
|
279
|
+
views?: UiTypes.AllViewOptions[];
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
export declare class Runtime extends SingleView<"runtime", UIView, UiTypes.RuntimeProps, UiTypes.BaseViewEvents<UIView>, UiTypes.RuntimeOptions> {
|
|
283
|
+
constructor({ props, layout, events, views, }: {
|
|
284
|
+
props?: UiTypes.RuntimeProps;
|
|
285
|
+
layout?: (make: MASConstraintMaker, view: UIView) => void;
|
|
286
|
+
events?: UiTypes.BaseViewEvents<UIView>;
|
|
287
|
+
views?: UiTypes.AllViewOptions[];
|
|
288
|
+
});
|
|
289
|
+
}
|
|
@@ -16,7 +16,10 @@ class SingleView extends base_1.Base {
|
|
|
16
16
|
this._defineView = () => {
|
|
17
17
|
return {
|
|
18
18
|
type: this._type,
|
|
19
|
-
props:
|
|
19
|
+
props: {
|
|
20
|
+
...this._props,
|
|
21
|
+
id: this.id,
|
|
22
|
+
},
|
|
20
23
|
layout: this._layout,
|
|
21
24
|
events: this._events,
|
|
22
25
|
views: this._views,
|
|
@@ -29,7 +32,7 @@ class ClearView extends SingleView {
|
|
|
29
32
|
constructor({ props, layout = $layout.fill, events, views, }) {
|
|
30
33
|
super({
|
|
31
34
|
type: "view",
|
|
32
|
-
props:
|
|
35
|
+
props: { ...props },
|
|
33
36
|
layout,
|
|
34
37
|
events,
|
|
35
38
|
views,
|
|
@@ -41,7 +44,7 @@ class ContentView extends SingleView {
|
|
|
41
44
|
constructor({ props, layout = $layout.fillSafeArea, events = {}, views, }) {
|
|
42
45
|
super({
|
|
43
46
|
type: "view",
|
|
44
|
-
props:
|
|
47
|
+
props: { bgcolor: $color("primarySurface"), ...props },
|
|
45
48
|
layout,
|
|
46
49
|
events,
|
|
47
50
|
views,
|
|
@@ -59,7 +62,11 @@ class MaskView extends SingleView {
|
|
|
59
62
|
constructor({ props, layout = $layout.fill, events, views, }) {
|
|
60
63
|
super({
|
|
61
64
|
type: "view",
|
|
62
|
-
props:
|
|
65
|
+
props: {
|
|
66
|
+
bgcolor: $rgba(0, 0, 0, 0.2),
|
|
67
|
+
...props,
|
|
68
|
+
userInteractionEnabled: true,
|
|
69
|
+
},
|
|
63
70
|
layout,
|
|
64
71
|
events,
|
|
65
72
|
views,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Base } from "../base";
|
|
2
|
+
/**
|
|
3
|
+
* 两个圆环旋转的加载动画
|
|
4
|
+
*
|
|
5
|
+
* 这是一个示例组件,由于帧数有限而且不稳定,不建议在实际项目中使用。
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare class DualRing extends Base<UIView, UiTypes.ViewOptions> {
|
|
9
|
+
_defineView: () => UiTypes.ViewOptions;
|
|
10
|
+
/**
|
|
11
|
+
* @param colors 颜色(必须是2个),默认为 [$color("#f5542e"), $color("#f2c327")]
|
|
12
|
+
* @param layout 布局
|
|
13
|
+
*/
|
|
14
|
+
constructor({ colors, layout, }: {
|
|
15
|
+
colors?: UIColor[];
|
|
16
|
+
layout: (make: MASConstraintMaker, view: UIView) => void;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Base } from "../base";
|
|
2
|
+
/**
|
|
3
|
+
* 饼图加载动画, 4个颜色的饼图以不同的速度旋转,产生华丽的效果
|
|
4
|
+
*/
|
|
5
|
+
export declare class Wedges extends Base<UIView, UiTypes.ViewOptions> {
|
|
6
|
+
_defineView: () => UiTypes.ViewOptions;
|
|
7
|
+
/**
|
|
8
|
+
* @param colors 饼图颜色(必须是4个颜色)
|
|
9
|
+
* @param layout 布局
|
|
10
|
+
*/
|
|
11
|
+
constructor({ colors, layout, }: {
|
|
12
|
+
colors?: UIColor[];
|
|
13
|
+
layout: (make: MASConstraintMaker, view: UIView) => void;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Base } from "../base";
|
|
2
|
+
interface AndroidStyleSpinnerProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
weight: number;
|
|
5
|
+
diameter: number;
|
|
6
|
+
color: UIColor;
|
|
7
|
+
bgcolor: UIColor;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 安卓风格的加载指示器, 基于Lottie实现, 效果是一个圆环一边旋转一边缩放。
|
|
11
|
+
* 由于帧数有限,不建议在大视图上使用。
|
|
12
|
+
*/
|
|
13
|
+
export declare class AndroidStyleSpinner extends Base<UILottieView, UiTypes.LottieOptions> {
|
|
14
|
+
private _props;
|
|
15
|
+
_defineView: () => UiTypes.LottieOptions;
|
|
16
|
+
/**
|
|
17
|
+
* @param props AndroidStyleSpinnerProps
|
|
18
|
+
* - id?: string 可以重新指定 id,以供 list 或者 matrix 的 template 使用
|
|
19
|
+
* - weight: number
|
|
20
|
+
* - diameter: number
|
|
21
|
+
* - color: UIColor, 默认 gray
|
|
22
|
+
* - bgcolor: UIColor, 默认 clear
|
|
23
|
+
* @param layout 可选布局,默认居中
|
|
24
|
+
*/
|
|
25
|
+
constructor({ props, layout, }: {
|
|
26
|
+
props: Partial<AndroidStyleSpinnerProps>;
|
|
27
|
+
layout?: (make: MASConstraintMaker, view: UILottieView) => void;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -18,7 +18,13 @@ class AndroidStyleSpinner extends base_1.Base {
|
|
|
18
18
|
*/
|
|
19
19
|
constructor({ props, layout, }) {
|
|
20
20
|
super();
|
|
21
|
-
this._props =
|
|
21
|
+
this._props = {
|
|
22
|
+
weight: 2,
|
|
23
|
+
diameter: 24,
|
|
24
|
+
color: $color("gray"),
|
|
25
|
+
bgcolor: $color("clear"),
|
|
26
|
+
...props,
|
|
27
|
+
};
|
|
22
28
|
this._defineView = () => {
|
|
23
29
|
const weight = this._props.weight;
|
|
24
30
|
const color = this._props.color;
|