jsbox-cview 1.5.22 → 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.
Files changed (114) hide show
  1. package/components/alert/input-alert.ts +5 -7
  2. package/components/alert/login-alert.ts +7 -7
  3. package/components/alert/plain-alert.ts +3 -3
  4. package/components/alert/uialert.ts +14 -6
  5. package/components/base.ts +12 -8
  6. package/components/custom-navigation-bar.ts +106 -88
  7. package/components/dialogs/dialog-sheet.ts +12 -8
  8. package/components/dialogs/form-dialog.ts +29 -16
  9. package/components/dialogs/list-dialog.ts +26 -20
  10. package/components/dialogs/text-dialog.ts +13 -8
  11. package/components/dynamic-contextmenu-view.ts +57 -25
  12. package/components/dynamic-itemsize-matrix.ts +45 -40
  13. package/components/dynamic-preference-listview.ts +135 -117
  14. package/components/dynamic-rowheight-list.ts +32 -20
  15. package/components/enhanced-imageview.ts +37 -28
  16. package/components/flowlayout.ts +61 -42
  17. package/components/image-pager.ts +33 -29
  18. package/components/page-control.ts +15 -11
  19. package/components/pageviewer-titlebar.ts +29 -22
  20. package/components/pageviewer.ts +33 -23
  21. package/components/refresh-button.ts +8 -8
  22. package/components/rotating-view.ts +24 -20
  23. package/components/searchbar.ts +113 -65
  24. package/components/sheet.ts +23 -17
  25. package/components/single-views.ts +228 -72
  26. package/components/spinners/loading-dual-ring.ts +21 -15
  27. package/components/spinners/loading-wedges.ts +24 -18
  28. package/components/spinners/spinner-androidstyle.ts +58 -47
  29. package/components/static-preference-listview.ts +197 -151
  30. package/components/symbol-button.ts +23 -22
  31. package/components/tabbar.ts +80 -64
  32. package/controller/base-controller.ts +42 -35
  33. package/controller/controller-router.ts +4 -4
  34. package/controller/pageviewer-controller.ts +41 -27
  35. package/controller/presented-page-controller.ts +27 -15
  36. package/controller/splitview-controller.ts +62 -46
  37. package/controller/tabbar-controller.ts +33 -23
  38. package/dist/components/alert/input-alert.js +3 -3
  39. package/dist/components/alert/login-alert.js +5 -5
  40. package/dist/components/alert/plain-alert.js +1 -1
  41. package/dist/components/alert/uialert.js +4 -4
  42. package/dist/components/base.js +2 -1
  43. package/dist/components/custom-navigation-bar.js +61 -59
  44. package/dist/components/dialogs/dialog-sheet.js +5 -5
  45. package/dist/components/dialogs/form-dialog.js +2 -2
  46. package/dist/components/dialogs/list-dialog.js +15 -15
  47. package/dist/components/dialogs/text-dialog.js +6 -6
  48. package/dist/components/dynamic-contextmenu-view.js +11 -8
  49. package/dist/components/dynamic-itemsize-matrix.js +15 -13
  50. package/dist/components/dynamic-preference-listview.js +95 -90
  51. package/dist/components/dynamic-rowheight-list.js +7 -6
  52. package/dist/components/enhanced-imageview.js +18 -16
  53. package/dist/components/flowlayout.js +15 -14
  54. package/dist/components/image-pager.js +22 -21
  55. package/dist/components/page-control.js +2 -2
  56. package/dist/components/pageviewer-titlebar.js +20 -17
  57. package/dist/components/pageviewer.js +13 -12
  58. package/dist/components/refresh-button.js +5 -5
  59. package/dist/components/rotating-view.js +11 -11
  60. package/dist/components/searchbar.js +53 -41
  61. package/dist/components/sheet.js +4 -4
  62. package/dist/components/single-views.js +68 -68
  63. package/dist/components/spinners/loading-dual-ring.js +10 -10
  64. package/dist/components/spinners/loading-wedges.js +15 -15
  65. package/dist/components/spinners/spinner-androidstyle.js +45 -43
  66. package/dist/components/static-preference-listview.js +101 -102
  67. package/dist/components/symbol-button.js +14 -13
  68. package/dist/components/tabbar.js +54 -50
  69. package/dist/controller/base-controller.js +17 -14
  70. package/dist/controller/pageviewer-controller.js +13 -11
  71. package/dist/controller/presented-page-controller.js +6 -4
  72. package/dist/controller/splitview-controller.js +33 -32
  73. package/dist/controller/tabbar-controller.js +13 -12
  74. package/dist/test/custom-navigation-bar.js +11 -9
  75. package/dist/test/dynamic-contextmenu-view.js +16 -14
  76. package/dist/test/dynamic-itemsize-matrix.js +18 -17
  77. package/dist/test/dynamic-preference-listview.js +29 -29
  78. package/dist/test/flowlayout.js +33 -27
  79. package/dist/test/form-dialog.js +15 -13
  80. package/dist/test/pageviewer-controller.js +10 -7
  81. package/dist/test/pageviewer-titlebar.js +3 -3
  82. package/dist/test/pageviewer.js +16 -7
  83. package/dist/test/refresh-button.js +4 -4
  84. package/dist/test/searchbar.js +7 -7
  85. package/dist/test/splitview-controller.js +14 -11
  86. package/dist/test/static-preference-listview.js +29 -30
  87. package/dist/test/tabbar-controller.js +15 -12
  88. package/dist/utils/colors.js +1 -2
  89. package/dist/utils/l10n.js +28 -28
  90. package/dist/utils/path.js +2 -2
  91. package/dist/utils/rect.js +30 -8
  92. package/dist/utils/uitools.js +29 -19
  93. package/index.ts +43 -43
  94. package/package.json +2 -2
  95. package/test/custom-navigation-bar.ts +28 -28
  96. package/test/dynamic-contextmenu-view.ts +23 -21
  97. package/test/dynamic-itemsize-matrix.ts +27 -22
  98. package/test/dynamic-preference-listview.ts +35 -35
  99. package/test/flowlayout.ts +43 -33
  100. package/test/form-dialog.ts +44 -43
  101. package/test/pageviewer-controller.ts +13 -11
  102. package/test/pageviewer-titlebar.ts +4 -5
  103. package/test/pageviewer.ts +17 -8
  104. package/test/refresh-button.ts +5 -5
  105. package/test/searchbar.ts +8 -8
  106. package/test/splitview-controller.ts +31 -30
  107. package/test/static-preference-listview.ts +35 -34
  108. package/test/tabbar-controller.ts +32 -29
  109. package/utils/colors.ts +7 -8
  110. package/utils/cvid.ts +1 -2
  111. package/utils/l10n.ts +32 -32
  112. package/utils/path.ts +9 -9
  113. package/utils/rect.ts +31 -8
  114. package/utils/uitools.ts +30 -22
@@ -2,14 +2,14 @@ import {
2
2
  UIAlertActionStyle,
3
3
  UIAlertControllerStyle,
4
4
  UIAlertAction,
5
- UIAlertController
5
+ UIAlertController,
6
6
  } from "./uialert";
7
7
 
8
8
  import { l10n } from "../../utils/l10n";
9
9
 
10
10
  /**
11
11
  * 显示一个输入框提示
12
- *
12
+ *
13
13
  * @param title 标题
14
14
  * @param message 内容
15
15
  * @param text 输入框默认文字
@@ -27,7 +27,7 @@ export function inputAlert({
27
27
  type = 0,
28
28
  secure = false,
29
29
  cancelText = l10n("CANCEL"),
30
- confirmText = l10n("OK")
30
+ confirmText = l10n("OK"),
31
31
  }: {
32
32
  title?: string;
33
33
  message?: string;
@@ -54,8 +54,8 @@ export function inputAlert({
54
54
  const input = alertVC.getText(0);
55
55
  const isValid = input.length > 0;
56
56
  return isValid;
57
- }
58
- }
57
+ },
58
+ },
59
59
  });
60
60
 
61
61
  alertVC.addAction(
@@ -75,5 +75,3 @@ export function inputAlert({
75
75
  }
76
76
  });
77
77
  }
78
-
79
-
@@ -2,14 +2,14 @@ import {
2
2
  UIAlertActionStyle,
3
3
  UIAlertControllerStyle,
4
4
  UIAlertAction,
5
- UIAlertController
5
+ UIAlertController,
6
6
  } from "./uialert";
7
7
 
8
8
  import { l10n } from "../../utils/l10n";
9
9
 
10
10
  /**
11
11
  * 显示一个登录输入框提示
12
- *
12
+ *
13
13
  * @param title 标题
14
14
  * @param message 内容
15
15
  * @param placeholder1 输入框1的占位符
@@ -23,7 +23,7 @@ export function loginAlert({
23
23
  placeholder1 = "",
24
24
  placeholder2 = "",
25
25
  cancelText = l10n("CANCEL"),
26
- confirmText = l10n("OK")
26
+ confirmText = l10n("OK"),
27
27
  }: {
28
28
  title?: string;
29
29
  message?: string;
@@ -40,7 +40,7 @@ export function loginAlert({
40
40
  );
41
41
 
42
42
  alertVC.addTextField({
43
- placeholder: placeholder1
43
+ placeholder: placeholder1,
44
44
  });
45
45
 
46
46
  alertVC.addTextField({
@@ -52,8 +52,8 @@ export function loginAlert({
52
52
  const password = alertVC.getText(1);
53
53
  const isValid = username.length > 0 && password.length > 0;
54
54
  return isValid;
55
- }
56
- }
55
+ },
56
+ },
57
57
  });
58
58
 
59
59
  alertVC.addAction(
@@ -69,7 +69,7 @@ export function loginAlert({
69
69
  const password = alertVC.getText(1);
70
70
  resolve({
71
71
  username,
72
- password
72
+ password,
73
73
  });
74
74
  }
75
75
  function cancelEvent() {
@@ -2,14 +2,14 @@ import {
2
2
  UIAlertActionStyle,
3
3
  UIAlertControllerStyle,
4
4
  UIAlertAction,
5
- UIAlertController
5
+ UIAlertController,
6
6
  } from "./uialert";
7
7
 
8
8
  import { l10n } from "../../utils/l10n";
9
9
 
10
10
  /**
11
11
  * 显示一个文字提示
12
- *
12
+ *
13
13
  * @param title 标题
14
14
  * @param message 内容
15
15
  * @param cancelText 取消按钮文字
@@ -20,7 +20,7 @@ export function plainAlert({
20
20
  title = "",
21
21
  message = "",
22
22
  cancelText = l10n("CANCEL"),
23
- confirmText = l10n("OK")
23
+ confirmText = l10n("OK"),
24
24
  }: {
25
25
  title?: string;
26
26
  message?: string;
@@ -1,12 +1,12 @@
1
1
  export const UIAlertActionStyle = {
2
2
  Default: 0,
3
3
  Cancel: 1,
4
- Destructive: 2
4
+ Destructive: 2,
5
5
  };
6
6
 
7
7
  export const UIAlertControllerStyle = {
8
8
  ActionSheet: 0,
9
- Alert: 1
9
+ Alert: 1,
10
10
  };
11
11
 
12
12
  export class UIAlertAction {
@@ -14,7 +14,11 @@ export class UIAlertAction {
14
14
  style: number;
15
15
  instance: any;
16
16
 
17
- constructor(title: string, style = UIAlertActionStyle.Default, handler: Function) {
17
+ constructor(
18
+ title: string,
19
+ style = UIAlertActionStyle.Default,
20
+ handler: Function
21
+ ) {
18
22
  this.title = title;
19
23
  this.style = style;
20
24
  this.instance = $objc("UIAlertAction").$actionWithTitle_style_handler(
@@ -37,7 +41,11 @@ export class UIAlertController {
37
41
  message: string;
38
42
  style: number;
39
43
  instance: any;
40
- constructor(title: string, message: string, style = UIAlertControllerStyle.ActionSheet) {
44
+ constructor(
45
+ title: string,
46
+ message: string,
47
+ style = UIAlertControllerStyle.ActionSheet
48
+ ) {
41
49
  this.title = title;
42
50
  this.message = message;
43
51
  this.style = style;
@@ -88,8 +96,8 @@ export class UIAlertController {
88
96
  } else {
89
97
  return true;
90
98
  }
91
- }
92
- }
99
+ },
100
+ },
93
101
  })
94
102
  );
95
103
  }
@@ -1,28 +1,32 @@
1
- import { cvid } from '../utils/cvid';
1
+ import { cvid } from "../utils/cvid";
2
2
 
3
3
  /**
4
- *
4
+ *
5
5
  * 组件 Base 基类,用于创建自定义组件。CView 的所有子类都应该继承自 Base。
6
- *
6
+ *
7
7
  * ## 属性
8
8
  * - id: string 组件的唯一 id
9
9
  * - view: T 通过自动创建的唯一 id 进行查找,获得对应的 UIView 对象
10
10
  * - definition: R 获得对应的 view 的定义
11
- *
11
+ *
12
12
  * ## 方法
13
- * - add(view: UiTypes.AllViewOptions | Base<any, any>): void 添加子 view。其中 `view` 参数可以是 CView,或 view 的定义
14
- *
13
+ * - add(view: UiTypes.AllViewOptions | Base<any, any>): void 添加子 view
14
+ * 其中 `view` 参数可以是 CView,或 view 的定义
15
+ *
15
16
  * ## 说明
16
17
  * 视图是 CView 框架的重点,其名称的含义为“组件化视图”。设计目的是:
17
18
  * - 通过组件化的方式,将JSBox view的定义和实例绑定,使用起来更加方便
18
19
  * - 可以便利地创建自定义组件
19
20
  */
20
- export abstract class Base<T extends AllUIView, R extends UiTypes.AllViewOptions> {
21
+ export abstract class Base<
22
+ T extends AllUIView,
23
+ R extends UiTypes.AllViewOptions
24
+ > {
21
25
  readonly id: string;
22
26
  private _view?: T;
23
27
  abstract _defineView: () => R;
24
28
  _layout?: (make: MASConstraintMaker, view: T) => void;
25
-
29
+
26
30
  constructor() {
27
31
  this.id = cvid.newId;
28
32
  }