jsbox-cview 1.6.6 → 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.
Files changed (136) hide show
  1. package/README.md +4 -0
  2. package/dist/components/alert/input-alert.d.ts +22 -0
  3. package/dist/components/alert/login-alert.d.ts +21 -0
  4. package/dist/components/alert/plain-alert.d.ts +15 -0
  5. package/dist/components/alert/uialert.d.ts +29 -0
  6. package/{components/base.ts → dist/components/base.d.ts} +9 -28
  7. package/dist/components/custom-navigation-bar.d.ts +117 -0
  8. package/dist/components/dialogs/dialog-sheet.d.ts +46 -0
  9. package/dist/components/dialogs/dialog-sheet.js +3 -1
  10. package/dist/components/dialogs/form-dialog.d.ts +15 -0
  11. package/dist/components/dialogs/list-dialog.d.ts +23 -0
  12. package/dist/components/dialogs/list-dialog.js +1 -1
  13. package/dist/components/dialogs/text-dialog.d.ts +13 -0
  14. package/dist/components/dynamic-contextmenu-view.d.ts +40 -0
  15. package/dist/components/dynamic-itemsize-matrix.d.ts +79 -0
  16. package/dist/components/dynamic-itemsize-matrix.js +1 -0
  17. package/dist/components/dynamic-itemsize-section-matrix.d.ts +115 -0
  18. package/dist/components/dynamic-preference-listview.d.ts +63 -0
  19. package/dist/components/dynamic-rowheight-list.d.ts +38 -0
  20. package/dist/components/enhanced-imageview.d.ts +41 -0
  21. package/dist/components/flowlayout.d.ts +63 -0
  22. package/dist/components/image-pager.d.ts +49 -0
  23. package/dist/components/oc-webview.d.ts +64 -0
  24. package/dist/components/page-control.d.ts +45 -0
  25. package/dist/components/pageviewer-titlebar.d.ts +48 -0
  26. package/dist/components/pageviewer.d.ts +41 -0
  27. package/dist/components/refresh-button.d.ts +25 -0
  28. package/dist/components/rotating-view.d.ts +45 -0
  29. package/dist/components/searchbar.d.ts +118 -0
  30. package/dist/components/sheet.d.ts +42 -0
  31. package/dist/components/single-views.d.ts +289 -0
  32. package/dist/components/spinners/loading-dual-ring.d.ts +18 -0
  33. package/dist/components/spinners/loading-wedges.d.ts +15 -0
  34. package/dist/components/spinners/spinner-androidstyle.d.ts +30 -0
  35. package/dist/components/static-preference-listview.d.ts +389 -0
  36. package/dist/components/symbol-button.d.ts +39 -0
  37. package/dist/components/tabbar.d.ts +140 -0
  38. package/dist/controller/base-controller.d.ts +125 -0
  39. package/dist/controller/base-controller.js +11 -11
  40. package/dist/controller/controller-router.d.ts +48 -0
  41. package/dist/controller/pageviewer-controller.d.ts +38 -0
  42. package/dist/controller/presented-page-controller.d.ts +41 -0
  43. package/dist/controller/splitview-controller.d.ts +90 -0
  44. package/dist/controller/splitview-controller.js +4 -0
  45. package/dist/controller/tabbar-controller.d.ts +49 -0
  46. package/dist/controller/tabbar-controller.js +0 -2
  47. package/{index.ts → dist/index.d.ts} +1 -0
  48. package/dist/index.js +1 -0
  49. package/dist/utils/colors.d.ts +7 -0
  50. package/dist/utils/cvid.d.ts +11 -0
  51. package/dist/utils/l10n.d.ts +1 -0
  52. package/dist/utils/path.d.ts +8 -0
  53. package/dist/utils/rect.d.ts +38 -0
  54. package/dist/utils/uitools.d.ts +75 -0
  55. package/package.json +20 -6
  56. package/.prettierignore +0 -6
  57. package/.prettierrc +0 -3
  58. package/components/alert/input-alert.ts +0 -64
  59. package/components/alert/login-alert.ts +0 -66
  60. package/components/alert/plain-alert.ts +0 -39
  61. package/components/alert/uialert.ts +0 -107
  62. package/components/custom-navigation-bar.ts +0 -579
  63. package/components/dialogs/dialog-sheet.ts +0 -111
  64. package/components/dialogs/form-dialog.ts +0 -63
  65. package/components/dialogs/list-dialog.ts +0 -119
  66. package/components/dialogs/text-dialog.ts +0 -44
  67. package/components/dynamic-contextmenu-view.ts +0 -115
  68. package/components/dynamic-itemsize-matrix.ts +0 -206
  69. package/components/dynamic-itemsize-section-matrix.ts +0 -363
  70. package/components/dynamic-preference-listview.ts +0 -684
  71. package/components/dynamic-rowheight-list.ts +0 -77
  72. package/components/enhanced-imageview.ts +0 -132
  73. package/components/flowlayout.ts +0 -248
  74. package/components/image-pager.ts +0 -180
  75. package/components/oc-webview.ts +0 -177
  76. package/components/page-control.ts +0 -93
  77. package/components/pageviewer-titlebar.ts +0 -166
  78. package/components/pageviewer.ts +0 -125
  79. package/components/refresh-button.ts +0 -83
  80. package/components/rotating-view.ts +0 -133
  81. package/components/searchbar.ts +0 -398
  82. package/components/sheet.ts +0 -104
  83. package/components/single-views.ts +0 -956
  84. package/components/spinners/loading-dual-ring.ts +0 -97
  85. package/components/spinners/loading-wedges.ts +0 -106
  86. package/components/spinners/spinner-androidstyle.ts +0 -269
  87. package/components/static-preference-listview.ts +0 -1282
  88. package/components/symbol-button.ts +0 -108
  89. package/components/tabbar.ts +0 -453
  90. package/controller/base-controller.ts +0 -214
  91. package/controller/controller-router.ts +0 -73
  92. package/controller/pageviewer-controller.ts +0 -93
  93. package/controller/presented-page-controller.ts +0 -76
  94. package/controller/splitview-controller.ts +0 -359
  95. package/controller/tabbar-controller.ts +0 -131
  96. package/dist/test/custom-navigation-bar.js +0 -40
  97. package/dist/test/dialog-sheet.js +0 -40
  98. package/dist/test/dynamic-contextmenu-view.js +0 -66
  99. package/dist/test/dynamic-itemsize-matrix.js +0 -74
  100. package/dist/test/dynamic-itemsize-section-matrix.js +0 -138
  101. package/dist/test/dynamic-preference-listview.js +0 -150
  102. package/dist/test/flowlayout.js +0 -76
  103. package/dist/test/form-dialog.js +0 -51
  104. package/dist/test/oc-webview.js +0 -195
  105. package/dist/test/pageviewer-controller.js +0 -20
  106. package/dist/test/pageviewer-titlebar.js +0 -18
  107. package/dist/test/pageviewer.js +0 -32
  108. package/dist/test/refresh-button.js +0 -26
  109. package/dist/test/searchbar.js +0 -36
  110. package/dist/test/splitview-controller.js +0 -41
  111. package/dist/test/static-preference-listview.js +0 -143
  112. package/dist/test/tabbar-controller.js +0 -48
  113. package/test/custom-navigation-bar.ts +0 -40
  114. package/test/dialog-sheet.ts +0 -40
  115. package/test/dynamic-contextmenu-view.ts +0 -67
  116. package/test/dynamic-itemsize-matrix.ts +0 -74
  117. package/test/dynamic-itemsize-section-matrix.ts +0 -142
  118. package/test/dynamic-preference-listview.ts +0 -151
  119. package/test/flowlayout.ts +0 -79
  120. package/test/form-dialog.ts +0 -48
  121. package/test/oc-webview.ts +0 -197
  122. package/test/pageviewer-controller.ts +0 -21
  123. package/test/pageviewer-titlebar.ts +0 -18
  124. package/test/pageviewer.ts +0 -31
  125. package/test/refresh-button.ts +0 -26
  126. package/test/searchbar.ts +0 -38
  127. package/test/splitview-controller.ts +0 -42
  128. package/test/static-preference-listview.ts +0 -142
  129. package/test/tabbar-controller.ts +0 -49
  130. package/tsconfig.json +0 -122
  131. package/utils/colors.ts +0 -17
  132. package/utils/cvid.ts +0 -32
  133. package/utils/l10n.ts +0 -42
  134. package/utils/path.ts +0 -97
  135. package/utils/rect.ts +0 -90
  136. package/utils/uitools.ts +0 -122
@@ -1,66 +0,0 @@
1
- import { UIAlertActionStyle, UIAlertControllerStyle, UIAlertAction, UIAlertController } from "./uialert";
2
-
3
- import { l10n } from "../../utils/l10n";
4
-
5
- /**
6
- * 显示一个登录输入框提示
7
- *
8
- * @param title 标题
9
- * @param message 内容
10
- * @param placeholder1 输入框1的占位符
11
- * @param placeholder2 输入框2的占位符
12
- * @param cancelText 取消按钮文字
13
- * @param confirmText 确认按钮文字
14
- */
15
- export function loginAlert({
16
- title = "",
17
- message = "",
18
- placeholder1 = "",
19
- placeholder2 = "",
20
- cancelText = l10n("CANCEL"),
21
- confirmText = l10n("OK"),
22
- }: {
23
- title?: string;
24
- message?: string;
25
- placeholder1?: string;
26
- placeholder2?: string;
27
- cancelText?: string;
28
- confirmText?: string;
29
- } = {}): Promise<{ username: string; password: string }> {
30
- return new Promise((resolve, reject) => {
31
- const alertVC = new UIAlertController(title, message, UIAlertControllerStyle.Alert);
32
-
33
- alertVC.addTextField({
34
- placeholder: placeholder1,
35
- });
36
-
37
- alertVC.addTextField({
38
- placeholder: placeholder2,
39
- secure: true,
40
- events: {
41
- shouldReturn: () => {
42
- const username = alertVC.getText(0);
43
- const password = alertVC.getText(1);
44
- const isValid = username.length > 0 && password.length > 0;
45
- return isValid;
46
- },
47
- },
48
- });
49
-
50
- alertVC.addAction(new UIAlertAction(cancelText, UIAlertActionStyle.Destructive, cancelEvent));
51
- alertVC.addAction(new UIAlertAction(confirmText, UIAlertActionStyle.Default, confirmEvent));
52
- alertVC.present();
53
-
54
- function confirmEvent() {
55
- const username = alertVC.getText(0);
56
- const password = alertVC.getText(1);
57
- resolve({
58
- username,
59
- password,
60
- });
61
- }
62
- function cancelEvent() {
63
- reject("cancel");
64
- }
65
- });
66
- }
@@ -1,39 +0,0 @@
1
- import { UIAlertActionStyle, UIAlertControllerStyle, UIAlertAction, UIAlertController } from "./uialert";
2
-
3
- import { l10n } from "../../utils/l10n";
4
-
5
- /**
6
- * 显示一个文字提示
7
- *
8
- * @param title 标题
9
- * @param message 内容
10
- * @param cancelText 取消按钮文字
11
- * @param confirmText 确认按钮文字
12
- * @returns Promise
13
- */
14
- export function plainAlert({
15
- title = "",
16
- message = "",
17
- cancelText = l10n("CANCEL"),
18
- confirmText = l10n("OK"),
19
- }: {
20
- title?: string;
21
- message?: string;
22
- cancelText?: string;
23
- confirmText?: string;
24
- } = {}): Promise<string> {
25
- return new Promise((resolve, reject) => {
26
- const alertVC = new UIAlertController(title, message, UIAlertControllerStyle.Alert);
27
-
28
- alertVC.addAction(new UIAlertAction(cancelText, UIAlertActionStyle.Destructive, cancelEvent));
29
- alertVC.addAction(new UIAlertAction(confirmText, UIAlertActionStyle.Default, confirmEvent));
30
- alertVC.present();
31
-
32
- function confirmEvent() {
33
- resolve("ok");
34
- }
35
- function cancelEvent() {
36
- reject("cancel");
37
- }
38
- });
39
- }
@@ -1,107 +0,0 @@
1
- export const UIAlertActionStyle = {
2
- Default: 0,
3
- Cancel: 1,
4
- Destructive: 2,
5
- };
6
-
7
- export const UIAlertControllerStyle = {
8
- ActionSheet: 0,
9
- Alert: 1,
10
- };
11
-
12
- export class UIAlertAction {
13
- title: string;
14
- style: number;
15
- instance: any;
16
-
17
- constructor(title: string, style = UIAlertActionStyle.Default, handler: Function) {
18
- this.title = title;
19
- this.style = style;
20
- this.instance = $objc("UIAlertAction").$actionWithTitle_style_handler(
21
- title,
22
- style,
23
- $block("void, UIAlertAction *", () => {
24
- if (handler) {
25
- handler(this);
26
- }
27
- }),
28
- );
29
- }
30
- }
31
-
32
- /**
33
- * Alert的基础类
34
- */
35
- export class UIAlertController {
36
- title: string;
37
- message: string;
38
- style: number;
39
- instance: any;
40
- constructor(title: string, message: string, style = UIAlertControllerStyle.ActionSheet) {
41
- this.title = title;
42
- this.message = message;
43
- this.style = style;
44
- this.instance = $objc("UIAlertController").$alertControllerWithTitle_message_preferredStyle(title, message, style);
45
- }
46
-
47
- addAction(action: UIAlertAction) {
48
- this.instance.$addAction(action.instance);
49
- }
50
-
51
- addTextField(options: any) {
52
- this.instance.$addTextFieldWithConfigurationHandler(
53
- $block("void, UITextField *", (textField: any) => {
54
- textField.$setClearButtonMode(1);
55
-
56
- if (options.type) {
57
- textField.$setKeyboardType(options.type);
58
- }
59
- if (options.placeholder) {
60
- textField.$setPlaceholder(options.placeholder);
61
- }
62
- if (options.text) {
63
- textField.$setText(options.text);
64
- }
65
- if (options.textColor) {
66
- textField.$setTextColor(options.textColor.ocValue());
67
- }
68
- if (options.font) {
69
- textField.$setFont(options.font.ocValue());
70
- }
71
- if (options.align) {
72
- textField.$setTextAlignment(options.align);
73
- }
74
- if (options.secure) {
75
- textField.$setSecureTextEntry(true);
76
- }
77
- if (options.events) {
78
- const events = options.events;
79
- textField.$setDelegate(
80
- $delegate({
81
- type: "UITextFieldDelegate",
82
- events: {
83
- "textFieldShouldReturn:": (textField: any) => {
84
- if (events.shouldReturn) {
85
- return events.shouldReturn();
86
- } else {
87
- return true;
88
- }
89
- },
90
- },
91
- }),
92
- );
93
- }
94
- }),
95
- );
96
- }
97
-
98
- getText(index: number) {
99
- const textField = this.instance.$textFields().$objectAtIndex(index);
100
- const text = textField.$text();
101
- return text.jsValue();
102
- }
103
-
104
- present() {
105
- this.instance.$show();
106
- }
107
- }