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.
Files changed (164) hide show
  1. package/README.md +4 -0
  2. package/dist/components/alert/input-alert.d.ts +22 -0
  3. package/dist/components/alert/input-alert.js +1 -2
  4. package/dist/components/alert/login-alert.d.ts +21 -0
  5. package/dist/components/alert/login-alert.js +1 -2
  6. package/dist/components/alert/plain-alert.d.ts +15 -0
  7. package/dist/components/alert/plain-alert.js +1 -2
  8. package/dist/components/alert/uialert.d.ts +29 -0
  9. package/{components/base.ts → dist/components/base.d.ts} +9 -28
  10. package/dist/components/custom-navigation-bar.d.ts +117 -0
  11. package/dist/components/custom-navigation-bar.js +7 -1
  12. package/dist/components/dialogs/dialog-sheet.d.ts +46 -0
  13. package/dist/components/dialogs/dialog-sheet.js +3 -1
  14. package/dist/components/dialogs/form-dialog.d.ts +15 -0
  15. package/dist/components/dialogs/form-dialog.js +1 -2
  16. package/dist/components/dialogs/list-dialog.d.ts +23 -0
  17. package/dist/components/dialogs/list-dialog.js +2 -3
  18. package/dist/components/dialogs/text-dialog.d.ts +13 -0
  19. package/dist/components/dialogs/text-dialog.js +1 -2
  20. package/dist/components/dynamic-contextmenu-view.d.ts +40 -0
  21. package/dist/components/dynamic-contextmenu-view.js +5 -1
  22. package/dist/components/dynamic-itemsize-matrix.d.ts +79 -0
  23. package/dist/components/dynamic-itemsize-matrix.js +18 -15
  24. package/dist/components/dynamic-itemsize-section-matrix.d.ts +115 -0
  25. package/dist/components/dynamic-itemsize-section-matrix.js +293 -0
  26. package/dist/components/dynamic-preference-listview.d.ts +63 -0
  27. package/dist/components/dynamic-preference-listview.js +25 -16
  28. package/dist/components/dynamic-rowheight-list.d.ts +38 -0
  29. package/dist/components/dynamic-rowheight-list.js +10 -3
  30. package/dist/components/enhanced-imageview.d.ts +41 -0
  31. package/dist/components/enhanced-imageview.js +1 -1
  32. package/dist/components/flowlayout.d.ts +63 -0
  33. package/dist/components/flowlayout.js +10 -13
  34. package/dist/components/image-pager.d.ts +49 -0
  35. package/dist/components/image-pager.js +6 -1
  36. package/dist/components/oc-webview.d.ts +64 -0
  37. package/dist/components/oc-webview.js +13 -5
  38. package/dist/components/page-control.d.ts +45 -0
  39. package/dist/components/page-control.js +2 -13
  40. package/dist/components/pageviewer-titlebar.d.ts +48 -0
  41. package/dist/components/pageviewer-titlebar.js +7 -13
  42. package/dist/components/pageviewer.d.ts +41 -0
  43. package/dist/components/pageviewer.js +4 -1
  44. package/dist/components/refresh-button.d.ts +25 -0
  45. package/dist/components/refresh-button.js +3 -4
  46. package/dist/components/rotating-view.d.ts +45 -0
  47. package/dist/components/rotating-view.js +10 -2
  48. package/dist/components/searchbar.d.ts +118 -0
  49. package/dist/components/searchbar.js +8 -1
  50. package/dist/components/sheet.d.ts +42 -0
  51. package/dist/components/single-views.d.ts +289 -0
  52. package/dist/components/single-views.js +11 -4
  53. package/dist/components/spinners/loading-dual-ring.d.ts +18 -0
  54. package/dist/components/spinners/loading-wedges.d.ts +15 -0
  55. package/dist/components/spinners/spinner-androidstyle.d.ts +30 -0
  56. package/dist/components/spinners/spinner-androidstyle.js +7 -1
  57. package/dist/components/static-preference-listview.d.ts +389 -0
  58. package/dist/components/static-preference-listview.js +13 -10
  59. package/dist/components/symbol-button.d.ts +39 -0
  60. package/dist/components/symbol-button.js +8 -1
  61. package/dist/components/tabbar.d.ts +140 -0
  62. package/dist/components/tabbar.js +8 -1
  63. package/dist/controller/base-controller.d.ts +125 -0
  64. package/dist/controller/base-controller.js +11 -11
  65. package/dist/controller/controller-router.d.ts +48 -0
  66. package/dist/controller/pageviewer-controller.d.ts +38 -0
  67. package/dist/controller/pageviewer-controller.js +4 -1
  68. package/dist/controller/presented-page-controller.d.ts +41 -0
  69. package/dist/controller/presented-page-controller.js +7 -9
  70. package/dist/controller/splitview-controller.d.ts +90 -0
  71. package/dist/controller/splitview-controller.js +27 -11
  72. package/dist/controller/tabbar-controller.d.ts +49 -0
  73. package/dist/controller/tabbar-controller.js +12 -15
  74. package/{index.ts → dist/index.d.ts} +2 -0
  75. package/dist/index.js +2 -0
  76. package/dist/utils/colors.d.ts +7 -0
  77. package/dist/utils/cvid.d.ts +11 -0
  78. package/dist/utils/l10n.d.ts +1 -0
  79. package/dist/utils/l10n.js +1 -2
  80. package/dist/utils/path.d.ts +8 -0
  81. package/dist/utils/path.js +8 -9
  82. package/dist/utils/rect.d.ts +38 -0
  83. package/dist/utils/rect.js +8 -9
  84. package/dist/utils/uitools.d.ts +75 -0
  85. package/dist/utils/uitools.js +6 -6
  86. package/package.json +20 -5
  87. package/.prettierignore +0 -6
  88. package/.prettierrc +0 -3
  89. package/components/alert/input-alert.ts +0 -64
  90. package/components/alert/login-alert.ts +0 -66
  91. package/components/alert/plain-alert.ts +0 -39
  92. package/components/alert/uialert.ts +0 -107
  93. package/components/custom-navigation-bar.ts +0 -579
  94. package/components/dialogs/dialog-sheet.ts +0 -111
  95. package/components/dialogs/form-dialog.ts +0 -63
  96. package/components/dialogs/list-dialog.ts +0 -119
  97. package/components/dialogs/text-dialog.ts +0 -44
  98. package/components/dynamic-contextmenu-view.ts +0 -115
  99. package/components/dynamic-itemsize-matrix.ts +0 -206
  100. package/components/dynamic-preference-listview.ts +0 -684
  101. package/components/dynamic-rowheight-list.ts +0 -77
  102. package/components/enhanced-imageview.ts +0 -132
  103. package/components/flowlayout.ts +0 -248
  104. package/components/image-pager.ts +0 -180
  105. package/components/oc-webview.ts +0 -177
  106. package/components/page-control.ts +0 -93
  107. package/components/pageviewer-titlebar.ts +0 -166
  108. package/components/pageviewer.ts +0 -125
  109. package/components/refresh-button.ts +0 -83
  110. package/components/rotating-view.ts +0 -133
  111. package/components/searchbar.ts +0 -398
  112. package/components/sheet.ts +0 -104
  113. package/components/single-views.ts +0 -956
  114. package/components/spinners/loading-dual-ring.ts +0 -97
  115. package/components/spinners/loading-wedges.ts +0 -106
  116. package/components/spinners/spinner-androidstyle.ts +0 -269
  117. package/components/static-preference-listview.ts +0 -1282
  118. package/components/symbol-button.ts +0 -108
  119. package/components/tabbar.ts +0 -453
  120. package/controller/base-controller.ts +0 -214
  121. package/controller/controller-router.ts +0 -73
  122. package/controller/pageviewer-controller.ts +0 -93
  123. package/controller/presented-page-controller.ts +0 -76
  124. package/controller/splitview-controller.ts +0 -359
  125. package/controller/tabbar-controller.ts +0 -131
  126. package/dist/test/custom-navigation-bar.js +0 -40
  127. package/dist/test/dialog-sheet.js +0 -40
  128. package/dist/test/dynamic-contextmenu-view.js +0 -66
  129. package/dist/test/dynamic-itemsize-matrix.js +0 -74
  130. package/dist/test/dynamic-preference-listview.js +0 -150
  131. package/dist/test/flowlayout.js +0 -76
  132. package/dist/test/form-dialog.js +0 -51
  133. package/dist/test/oc-webview.js +0 -195
  134. package/dist/test/pageviewer-controller.js +0 -20
  135. package/dist/test/pageviewer-titlebar.js +0 -18
  136. package/dist/test/pageviewer.js +0 -32
  137. package/dist/test/refresh-button.js +0 -26
  138. package/dist/test/searchbar.js +0 -36
  139. package/dist/test/splitview-controller.js +0 -41
  140. package/dist/test/static-preference-listview.js +0 -143
  141. package/dist/test/tabbar-controller.js +0 -48
  142. package/test/custom-navigation-bar.ts +0 -40
  143. package/test/dialog-sheet.ts +0 -40
  144. package/test/dynamic-contextmenu-view.ts +0 -67
  145. package/test/dynamic-itemsize-matrix.ts +0 -74
  146. package/test/dynamic-preference-listview.ts +0 -151
  147. package/test/flowlayout.ts +0 -79
  148. package/test/form-dialog.ts +0 -48
  149. package/test/oc-webview.ts +0 -197
  150. package/test/pageviewer-controller.ts +0 -21
  151. package/test/pageviewer-titlebar.ts +0 -18
  152. package/test/pageviewer.ts +0 -31
  153. package/test/refresh-button.ts +0 -26
  154. package/test/searchbar.ts +0 -38
  155. package/test/splitview-controller.ts +0 -42
  156. package/test/static-preference-listview.ts +0 -142
  157. package/test/tabbar-controller.ts +0 -49
  158. package/tsconfig.json +0 -122
  159. package/utils/colors.ts +0 -17
  160. package/utils/cvid.ts +0 -32
  161. package/utils/l10n.ts +0 -42
  162. package/utils/path.ts +0 -97
  163. package/utils/rect.ts +0 -90
  164. package/utils/uitools.ts +0 -122
@@ -1,143 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const static_preference_listview_1 = require("../components/static-preference-listview");
4
- const sections = [
5
- {
6
- title: "Section 1",
7
- rows: [
8
- {
9
- type: "string",
10
- title: "string",
11
- key: "string",
12
- value: "测试一号测试二号测试三号测试四号测试五号测试六号",
13
- },
14
- {
15
- type: "number",
16
- title: "number",
17
- key: "number",
18
- value: 1111.1,
19
- },
20
- {
21
- type: "integer",
22
- title: "integer",
23
- key: "integer",
24
- value: 1111,
25
- },
26
- {
27
- type: "stepper",
28
- title: "stepper",
29
- key: "stepper",
30
- value: 2,
31
- min: 2,
32
- max: 5,
33
- },
34
- ],
35
- },
36
- {
37
- title: "Section 2",
38
- rows: [
39
- {
40
- type: "boolean",
41
- title: "boolean",
42
- key: "boolean",
43
- value: true,
44
- },
45
- {
46
- type: "slider",
47
- title: "slider",
48
- key: "slider",
49
- value: 1,
50
- decimal: 0,
51
- min: 0,
52
- max: 100,
53
- },
54
- {
55
- type: "list",
56
- title: "list",
57
- key: "list",
58
- items: ["测试一号", "测试bbb"],
59
- value: 0,
60
- },
61
- {
62
- type: "tab",
63
- title: "tab",
64
- key: "tab",
65
- items: ["测试aaa", "测试bbb"],
66
- value: 0,
67
- },
68
- {
69
- type: "date",
70
- title: "date",
71
- key: "date",
72
- //value: new Date()
73
- mode: 1,
74
- },
75
- ],
76
- },
77
- {
78
- title: "Section 3",
79
- rows: [
80
- {
81
- type: "info",
82
- title: "info",
83
- value: "this is info",
84
- },
85
- {
86
- type: "link",
87
- title: "link",
88
- value: "https://apple.com",
89
- },
90
- {
91
- type: "symbol-action",
92
- title: "种类1",
93
- symbol: "checkmark",
94
- tintColor: $color("systemLink"),
95
- titleColor: $color("systemLink"),
96
- value: () => console.info(0),
97
- },
98
- {
99
- type: "action",
100
- title: "action",
101
- value: () => console.info(0),
102
- },
103
- ],
104
- },
105
- {
106
- title: "Section 4",
107
- rows: [
108
- {
109
- type: "interactive-info",
110
- title: "interactive-info",
111
- key: "interactive-info",
112
- value: "测试一号测试二号测试三号测试四号测试五号测试六号",
113
- },
114
- {
115
- type: "interactive-info",
116
- title: "interactive-info2",
117
- key: "interactive-info2",
118
- value: "测试一号测试二号测试三号测试四号测试五号测试六号",
119
- copyable: true,
120
- },
121
- ],
122
- },
123
- ];
124
- const v = new static_preference_listview_1.PreferenceListView({
125
- props: { data: [] },
126
- sections: sections,
127
- layout: $layout.fill,
128
- events: {
129
- changed: (values) => console.info(values),
130
- },
131
- });
132
- $ui.render({
133
- props: {
134
- title: "",
135
- navButtons: [
136
- {
137
- symbol: "plus",
138
- handler: () => { },
139
- },
140
- ],
141
- },
142
- views: [v.definition],
143
- });
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tabbar_controller_1 = require("../controller/tabbar-controller");
4
- const base_controller_1 = require("../controller/base-controller");
5
- const items = [
6
- {
7
- controller: new base_controller_1.BaseController({
8
- props: { bgcolor: $color("red") },
9
- events: {
10
- didAppear: () => {
11
- console.log("Page 1 did appear");
12
- },
13
- didDisappear: () => {
14
- console.log("Page 1 did disappear");
15
- },
16
- },
17
- }),
18
- title: "Page 1",
19
- },
20
- {
21
- controller: new base_controller_1.BaseController({
22
- props: { bgcolor: $color("yellow") },
23
- events: {
24
- didAppear: () => {
25
- console.log("Page 2 did appear");
26
- },
27
- didDisappear: () => {
28
- console.log("Page 2 did disappear");
29
- },
30
- },
31
- }),
32
- title: "Page 2",
33
- },
34
- ];
35
- const pageViewerController = new tabbar_controller_1.TabBarController({
36
- props: {
37
- items,
38
- },
39
- events: {
40
- changed: (sender, index) => {
41
- console.log(`Index changed to ${index}`);
42
- },
43
- doubleTapped: (sender, index) => {
44
- console.log(`Double tapped on index ${index}`);
45
- },
46
- },
47
- });
48
- pageViewerController.uirender({});
@@ -1,40 +0,0 @@
1
- import { CustomNavigationBar } from "../components/custom-navigation-bar";
2
-
3
- const navbar = new CustomNavigationBar({
4
- props: {
5
- title: "Custom Navigation Bar",
6
- popButtonEnabled: true,
7
- popButtonTitle: "Back",
8
- rightBarButtonItems: [
9
- {
10
- symbol: "gear",
11
- handler: (sender) => console.log(sender),
12
- },
13
- ],
14
- },
15
- });
16
-
17
- $ui.render({
18
- views: [
19
- {
20
- type: "button",
21
- props: {},
22
- layout: $layout.fill,
23
- events: {
24
- tapped: () => {
25
- $ui.push({
26
- views: [navbar.definition],
27
- });
28
- $delay(1, () => {
29
- navbar.cviews.bgview.view.alpha = 0.5;
30
- navbar.cviews.separator.view.alpha = 0.5;
31
- });
32
- $delay(2, () => {
33
- navbar.cviews.bgview.view.alpha = 0;
34
- navbar.cviews.separator.view.alpha = 0;
35
- });
36
- },
37
- },
38
- },
39
- ],
40
- });
@@ -1,40 +0,0 @@
1
- import { DialogSheet } from "../components/dialogs/dialog-sheet";
2
- import { ContentView } from "../components/single-views";
3
-
4
- const cview = new ContentView({
5
- props: {
6
- bgcolor: $color("lightGray"),
7
- },
8
- layout: $layout.fill,
9
- });
10
-
11
- $ui.render({
12
- views: [
13
- {
14
- type: "button",
15
- props: {
16
- title: "Show Dialog Sheet",
17
- },
18
- layout: $layout.center,
19
- events: {
20
- tapped: async () => {
21
- const sheet = new DialogSheet({
22
- title: "Dialog Sheet",
23
- cview,
24
- doneHandler: () => {
25
- $ui.alert("Done");
26
- },
27
- presentMode: 1,
28
- bgcolor: $color("white"),
29
- doneButtonHidden: false,
30
- doneButtonValidator: () => {
31
- return true;
32
- },
33
- doneButtonTitle: "完成",
34
- });
35
- await sheet.present();
36
- },
37
- },
38
- },
39
- ],
40
- });
@@ -1,67 +0,0 @@
1
- import { DynamicContextMenuView } from "../components/dynamic-contextmenu-view";
2
-
3
- let menuIndex = 0;
4
- const menuList = [
5
- {
6
- title: "菜单1",
7
- items: [
8
- {
9
- title: "变成菜单1",
10
- symbol: "plus",
11
- handler: () => {
12
- menuIndex = 0;
13
- },
14
- },
15
- {
16
- title: "变成菜单2",
17
- symbol: "plus",
18
- destructive: true,
19
- handler: () => {
20
- menuIndex = 1;
21
- },
22
- },
23
- ],
24
- },
25
- {
26
- items: [
27
- {
28
- title: "变成菜单1",
29
- handler: () => {
30
- menuIndex = 0;
31
- },
32
- },
33
- {
34
- title: "变成菜单2",
35
- handler: () => {
36
- menuIndex = 1;
37
- },
38
- },
39
- ],
40
- },
41
- ];
42
-
43
- const view = new DynamicContextMenuView({
44
- generateContextMenu: (sender) => {
45
- return menuList[menuIndex];
46
- },
47
- props: {},
48
- layout: (make, view) => {
49
- make.center.equalTo(view.super);
50
- make.size.equalTo($size(100, 100));
51
- },
52
- views: [
53
- {
54
- type: "label",
55
- props: {
56
- text: "长按我",
57
- textColor: $color("black"),
58
- align: $align.center,
59
- },
60
- layout: $layout.center,
61
- },
62
- ],
63
- });
64
-
65
- $ui.render({
66
- views: [view.definition],
67
- });
@@ -1,74 +0,0 @@
1
- import { DynamicItemSizeMatrix } from "../components/dynamic-itemsize-matrix";
2
-
3
- const matrix = new DynamicItemSizeMatrix({
4
- props: {
5
- spacing: 5,
6
- minItemWidth: $device.isIpad ? 140 : 118,
7
- maxColumns: 10,
8
- template: {
9
- views: [
10
- {
11
- type: "label",
12
- props: {
13
- id: "label",
14
- align: $align.center,
15
- font: $font(13),
16
- },
17
- layout: (make, view) => {
18
- make.left.right.bottom.inset(0);
19
- make.height.equalTo(20);
20
- },
21
- },
22
- {
23
- type: "image",
24
- props: {
25
- symbol: "sun.dust",
26
- bgcolor: $color("backgroundColor", "secondarySurface"),
27
- contentMode: $contentMode.scaleAspectFit,
28
- },
29
- layout: (make, view) => {
30
- make.top.left.right.equalTo(0);
31
- make.bottom.equalTo(view.prev.top);
32
- },
33
- },
34
- ],
35
- },
36
- data: [...Array(100)].map((n, i) => {
37
- return {
38
- label: { text: i + 1 },
39
- };
40
- }),
41
- footer: {
42
- type: "view",
43
- props: {
44
- height: 20,
45
- },
46
- },
47
- },
48
- layout: (make, view) => {
49
- make.left.right.equalTo(view.super.safeArea);
50
- make.top.bottom.equalTo(view.super);
51
- },
52
- events: {
53
- itemHeight: (width) => width * 1.414 + 20,
54
- didSelect: (sender, indexPath, data) => {},
55
- didScroll: (sender) => {
56
- matrix.columns;
57
- console.log(sender.contentOffset.y);
58
- console.log(Math.ceil(sender.contentOffset.y / (matrix.itemSize.height + 5)));
59
- console.log(Math.ceil(sender.contentOffset.y / (matrix.itemSize.height + 5)) * matrix.columns);
60
- },
61
- },
62
- });
63
-
64
- $ui.render({
65
- props: {
66
- navButtons: [
67
- {
68
- symbol: "plus",
69
- handler: () => (matrix.data = [{ label: { text: "New" } }]),
70
- },
71
- ],
72
- },
73
- views: [matrix.definition],
74
- });
@@ -1,151 +0,0 @@
1
- import { DynamicPreferenceListView } from "../components/dynamic-preference-listview";
2
- import { PreferenceSection } from "../components/static-preference-listview";
3
-
4
- const sections: PreferenceSection[] = [
5
- {
6
- title: "Section 1",
7
- rows: [
8
- {
9
- type: "string",
10
- title: "string",
11
- key: "string",
12
- value: "测试一号测试二号测试三号测试四号测试五号测试六号",
13
- },
14
- {
15
- type: "number",
16
- title: "number",
17
- key: "number",
18
- value: 1111.1,
19
- },
20
- {
21
- type: "integer",
22
- title: "integer",
23
- key: "integer",
24
- value: 1111,
25
- },
26
- {
27
- type: "stepper",
28
- title: "stepper",
29
- key: "stepper",
30
- value: 2,
31
- min: 2,
32
- max: 5,
33
- },
34
- ],
35
- },
36
- {
37
- title: "Section 2",
38
- rows: [
39
- {
40
- type: "boolean",
41
- title: "boolean",
42
- key: "boolean",
43
- value: true,
44
- },
45
- {
46
- type: "slider",
47
- title: "slider",
48
- key: "slider",
49
- value: 1,
50
- decimal: 0,
51
- min: 0,
52
- max: 2,
53
- },
54
- {
55
- type: "list",
56
- title: "list",
57
- key: "list",
58
- items: ["测试一号", "测试bbb"],
59
- value: 0,
60
- },
61
- {
62
- type: "tab",
63
- title: "tab",
64
- key: "tab",
65
- items: ["测试aaa", "测试bbb"],
66
- value: 0,
67
- },
68
- {
69
- type: "date",
70
- title: "date",
71
- key: "date",
72
- mode: 1,
73
- },
74
- ],
75
- },
76
- {
77
- title: "Section 3",
78
- rows: [
79
- {
80
- type: "info",
81
- title: "info",
82
- value: "this is info",
83
- },
84
- {
85
- type: "link",
86
- title: "link",
87
- value: "https://apple.com",
88
- },
89
- {
90
- type: "symbol-action",
91
- title: "种类1",
92
- symbol: "checkmark",
93
- tintColor: $color("systemLink"),
94
- titleColor: $color("systemLink"),
95
- value: () => console.info(0),
96
- },
97
- {
98
- type: "action",
99
- title: "action",
100
- value: () => console.info(0),
101
- },
102
- ],
103
- },
104
- ];
105
- const v = new DynamicPreferenceListView({
106
- props: {
107
- data: [],
108
- //symbolSizeForSymbolAction: $size(40, 40)
109
- },
110
- sections: sections,
111
- layout: $layout.fill,
112
- events: {
113
- changed: (values: any) => {
114
- console.info(values);
115
- console.info(values.date);
116
- },
117
- },
118
- });
119
-
120
- $ui.render({
121
- props: {
122
- title: "",
123
- navButtons: [
124
- {
125
- symbol: "plus",
126
- handler: () => {
127
- sections.push({
128
- title: "Section " + (sections.length + 1),
129
- rows: [
130
- {
131
- type: "interactive-info",
132
- title: "interactive-info",
133
- key: "interactive-info",
134
- value: "测试一号测试二号测试三号测试四号测试五号测试六号",
135
- },
136
- {
137
- type: "interactive-info",
138
- title: "interactive-info2",
139
- key: "interactive-info2",
140
- value: "测试一号测试二号测试三号测试四号测试五号测试六号",
141
- copyable: true,
142
- },
143
- ],
144
- });
145
- v.sections = sections;
146
- },
147
- },
148
- ],
149
- },
150
- views: [v.definition],
151
- });
@@ -1,79 +0,0 @@
1
- import { Flowlayout } from "../components/flowlayout";
2
- import { Label } from "../components/single-views";
3
-
4
- class FlowlayoutItem extends Label {
5
- private _text: string;
6
- constructor(text: string) {
7
- super({
8
- props: {
9
- text: text,
10
- borderWidth: 1,
11
- },
12
- layout: $layout.fill,
13
- });
14
- this._text = text;
15
- }
16
-
17
- itemWidth() {
18
- return this._text.length * 10;
19
- }
20
- }
21
-
22
- const flowlayout = new Flowlayout({
23
- props: {
24
- items: [new FlowlayoutItem("Hello"), new FlowlayoutItem("World"), new FlowlayoutItem("Flowlayout")],
25
- spacing: 10,
26
- itemHeight: 30,
27
- fixedRows: 2,
28
- fixedHeight: true,
29
- menu: {
30
- items: [
31
- {
32
- symbol: "plus",
33
- handler: (sender) => console.log("here"),
34
- },
35
- ],
36
- },
37
- },
38
- layout: (make, view) => {
39
- make.left.right.inset(10);
40
- make.top.inset(100);
41
- make.height.equalTo(70);
42
- },
43
- events: {
44
- didSelect: (sender, index, item) => {
45
- $ui.alert(item.view.text);
46
- },
47
- },
48
- });
49
-
50
- $ui.render({
51
- props: {
52
- navButtons: [
53
- {
54
- symbol: "plus",
55
- handler: () => {
56
- flowlayout.items = [
57
- new FlowlayoutItem("Hello"),
58
- new FlowlayoutItem("World"),
59
- new FlowlayoutItem("Flowlayout"),
60
- new FlowlayoutItem("New Item"),
61
- new FlowlayoutItem("Hello"),
62
- new FlowlayoutItem("World"),
63
- new FlowlayoutItem("FlowlayoutFlowlayoutFlowlayout"),
64
- new FlowlayoutItem("New Item"),
65
- new FlowlayoutItem("Hello"),
66
- new FlowlayoutItem("World"),
67
- new FlowlayoutItem("FlowlayoutFlowlayoutFlowlayoutFlowlayoutFlowlayoutFlowlayout"),
68
- new FlowlayoutItem("New Item"),
69
- new FlowlayoutItem("Hello"),
70
- new FlowlayoutItem("World"),
71
- new FlowlayoutItem("FlowlayoutFlowlayoutFlowlayoutFlowlayoutFlowlayoutFlowlayoutFlowlayoutFlowlayout"),
72
- new FlowlayoutItem("New Item"),
73
- ];
74
- },
75
- },
76
- ],
77
- },
78
- views: [flowlayout.definition],
79
- });
@@ -1,48 +0,0 @@
1
- import { formDialog } from "../components/dialogs/form-dialog";
2
-
3
- $ui.render({
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
- },
46
- },
47
- ],
48
- });