neo.mjs 6.17.2 → 6.18.1

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 (323) hide show
  1. package/apps/ServiceWorker.mjs +3 -5
  2. package/apps/colors/README.md +8 -0
  3. package/apps/colors/app.mjs +6 -0
  4. package/apps/colors/childapps/widget/app.mjs +7 -0
  5. package/apps/colors/childapps/widget/index.html +11 -0
  6. package/apps/colors/childapps/widget/neo-config.json +10 -0
  7. package/apps/colors/childapps/widget/view/Viewport.mjs +19 -0
  8. package/apps/colors/index.html +11 -0
  9. package/apps/colors/model/Color.mjs +43 -0
  10. package/apps/colors/neo-config.json +10 -0
  11. package/apps/colors/remotes-api.json +13 -0
  12. package/apps/colors/store/Colors.mjs +24 -0
  13. package/apps/colors/view/BarChartComponent.mjs +64 -0
  14. package/apps/colors/view/HeaderToolbar.mjs +95 -0
  15. package/apps/colors/view/PieChartComponent.mjs +58 -0
  16. package/apps/colors/view/TableContainer.mjs +91 -0
  17. package/apps/colors/view/Viewport.mjs +57 -0
  18. package/apps/colors/view/ViewportController.mjs +277 -0
  19. package/apps/colors/view/ViewportModel.mjs +53 -0
  20. package/apps/portal/Util.mjs +11 -0
  21. package/apps/portal/childapps/preview/neo-config.json +2 -2
  22. package/apps/portal/neo-config.json +2 -1
  23. package/apps/portal/remotes-api.json +13 -0
  24. package/apps/portal/view/HeaderToolbar.mjs +1 -1
  25. package/apps/portal/view/ViewportController.mjs +89 -1
  26. package/apps/portal/view/home/MainContainer.mjs +34 -6
  27. package/apps/portal/view/home/parts/AfterMath.mjs +1 -1
  28. package/apps/portal/view/home/parts/Colors.mjs +98 -0
  29. package/apps/portal/view/home/parts/Helix.mjs +114 -0
  30. package/apps/portal/view/home/parts/HelloWorld.mjs +6 -3
  31. package/apps/portal/view/home/parts/How.mjs +66 -0
  32. package/apps/portal/view/home/parts/MainNeo.mjs +4 -3
  33. package/apps/portal/view/learn/LivePreview.mjs +56 -15
  34. package/apps/portal/view/learn/MainContainerController.mjs +10 -90
  35. package/apps/realworld/api/Article.mjs +1 -3
  36. package/apps/realworld/api/Favorite.mjs +1 -3
  37. package/apps/realworld/api/Profile.mjs +1 -3
  38. package/apps/realworld/api/Tag.mjs +1 -3
  39. package/apps/realworld/api/User.mjs +1 -3
  40. package/apps/realworld2/api/Article.mjs +1 -3
  41. package/apps/realworld2/api/Favorite.mjs +1 -3
  42. package/apps/realworld2/api/Profile.mjs +1 -3
  43. package/apps/realworld2/api/Tag.mjs +1 -3
  44. package/apps/realworld2/api/User.mjs +1 -3
  45. package/apps/realworld2/view/article/HelixContainer.mjs +5 -5
  46. package/buildScripts/webpack/json/myApps.template.json +1 -0
  47. package/docs/app/view/MainContainer.mjs +5 -0
  48. package/docs/app/view/classdetails/MembersList.mjs +1 -1
  49. package/examples/ServiceWorker.mjs +3 -5
  50. package/examples/component/helix/Viewport.mjs +309 -0
  51. package/examples/component/helix/ViewportController.mjs +122 -0
  52. package/examples/component/helix/app.mjs +2 -2
  53. package/examples/component/helix/neo-config.json +0 -1
  54. package/examples/component/multiWindowHelix/Viewport.mjs +11 -3
  55. package/examples/component/multiWindowHelix/ViewportController.mjs +21 -9
  56. package/examples/component/multiWindowHelix/neo-config.json +0 -1
  57. package/examples/fieldWithPrefix/MainContainer.mjs +1 -6
  58. package/examples/list/animate/MainContainerController.mjs +1 -1
  59. package/examples/worker/task/MyTasks.mjs +1 -3
  60. package/package.json +2 -2
  61. package/resources/data/deck/learnneo/pages/Events.md +15 -9
  62. package/resources/data/deck/learnneo/pages/GuideEvents.md +254 -0
  63. package/resources/data/deck/learnneo/pages/WhyNeo-Speed.md +1 -1
  64. package/resources/images/logo/neo_logo_primary.svg +6 -0
  65. package/resources/images/logo/neo_logo_text_primary.svg +5 -0
  66. package/resources/scss/src/apps/colors/BarChartComponent.scss +3 -0
  67. package/resources/scss/src/apps/colors/HeaderToolbar.scss +11 -0
  68. package/resources/scss/src/apps/colors/PieChartComponent.scss +3 -0
  69. package/resources/scss/src/apps/colors/TableContainer.scss +64 -0
  70. package/resources/scss/src/apps/colors/Viewport.scss +9 -0
  71. package/resources/scss/src/apps/portal/HeaderToolbar.scss +142 -124
  72. package/resources/scss/src/apps/portal/home/MainContainer.scss +9 -22
  73. package/resources/scss/src/apps/portal/home/parts/MainNeo.scss +22 -0
  74. package/resources/scss/src/apps/portal/home/preview/PageCodeContainer.scss +1 -1
  75. package/resources/scss/src/examples/component/multiWindowHelix/Viewport.scss +3 -0
  76. package/resources/scss/src/form/field/CheckBox.scss +1 -0
  77. package/resources/scss/src/tab/header/Button.scss +2 -1
  78. package/resources/scss/theme-dark/Global.scss +8 -0
  79. package/resources/scss/theme-dark/button/Base.scss +1 -1
  80. package/resources/scss/theme-dark/tab/header/Button.scss +1 -0
  81. package/resources/scss/theme-light/Global.scss +8 -0
  82. package/resources/scss/theme-light/button/Base.scss +1 -1
  83. package/resources/scss/theme-light/tab/header/Button.scss +1 -0
  84. package/resources/scss/theme-neo-light/Global.scss +53 -53
  85. package/resources/scss/theme-neo-light/button/Base.scss +3 -4
  86. package/resources/scss/theme-neo-light/tab/header/Button.scss +6 -8
  87. package/src/DefaultConfig.mjs +2 -2
  88. package/src/Fetch.mjs +1 -3
  89. package/src/Main.mjs +13 -11
  90. package/src/MicroLoader.mjs +2 -2
  91. package/src/Neo.mjs +27 -26
  92. package/src/Xhr.mjs +1 -3
  93. package/src/button/Base.mjs +6 -4
  94. package/src/button/Split.mjs +10 -9
  95. package/src/calendar/view/EditEventContainer.mjs +13 -12
  96. package/src/calendar/view/MainContainer.mjs +40 -40
  97. package/src/calendar/view/MainContainerModel.mjs +5 -5
  98. package/src/calendar/view/SettingsContainer.mjs +11 -11
  99. package/src/calendar/view/YearComponent.mjs +73 -75
  100. package/src/calendar/view/calendars/ColorsList.mjs +2 -2
  101. package/src/calendar/view/calendars/EditContainer.mjs +2 -2
  102. package/src/calendar/view/calendars/List.mjs +12 -13
  103. package/src/calendar/view/month/Component.mjs +72 -73
  104. package/src/calendar/view/settings/GeneralContainer.mjs +5 -5
  105. package/src/calendar/view/settings/MonthContainer.mjs +5 -5
  106. package/src/calendar/view/settings/WeekContainer.mjs +6 -6
  107. package/src/calendar/view/settings/YearContainer.mjs +4 -4
  108. package/src/calendar/view/week/Component.mjs +47 -57
  109. package/src/calendar/view/week/EventDragZone.mjs +43 -50
  110. package/src/calendar/view/week/TimeAxisComponent.mjs +21 -21
  111. package/src/calendar/view/week/plugin/DragDrop.mjs +53 -45
  112. package/src/calendar/view/week/plugin/EventResizable.mjs +8 -3
  113. package/src/collection/Base.mjs +15 -22
  114. package/src/collection/Filter.mjs +4 -9
  115. package/src/collection/Sorter.mjs +6 -7
  116. package/src/component/Base.mjs +73 -41
  117. package/src/component/Canvas.mjs +9 -9
  118. package/src/component/Carousel.mjs +31 -33
  119. package/src/component/Chip.mjs +9 -9
  120. package/src/component/Circle.mjs +84 -91
  121. package/src/component/Clock.mjs +8 -8
  122. package/src/component/DateSelector.mjs +14 -15
  123. package/src/component/Gallery.mjs +82 -80
  124. package/src/component/Helix.mjs +131 -126
  125. package/src/component/Iframe.mjs +1 -1
  126. package/src/component/Label.mjs +1 -1
  127. package/src/component/Legend.mjs +3 -3
  128. package/src/component/Process.mjs +39 -37
  129. package/src/component/Splitter.mjs +9 -11
  130. package/src/component/StatusBadge.mjs +2 -3
  131. package/src/component/Timer.mjs +62 -68
  132. package/src/component/Toast.mjs +11 -11
  133. package/src/component/Video.mjs +7 -8
  134. package/src/component/mwc/Button.mjs +10 -10
  135. package/src/component/mwc/TextField.mjs +17 -17
  136. package/src/component/wrapper/AmChart.mjs +5 -5
  137. package/src/component/wrapper/CesiumJS.mjs +11 -17
  138. package/src/component/wrapper/GoogleMaps.mjs +58 -35
  139. package/src/component/wrapper/MapboxGL.mjs +112 -79
  140. package/src/container/Accordion.mjs +18 -20
  141. package/src/container/AccordionItem.mjs +12 -11
  142. package/src/container/Base.mjs +24 -23
  143. package/src/container/Panel.mjs +9 -9
  144. package/src/controller/Base.mjs +12 -14
  145. package/src/controller/Component.mjs +60 -66
  146. package/src/core/Base.mjs +5 -8
  147. package/src/core/IdGenerator.mjs +1 -3
  148. package/src/core/Observable.mjs +40 -24
  149. package/src/core/Util.mjs +5 -5
  150. package/src/data/Model.mjs +3 -3
  151. package/src/data/RecordFactory.mjs +3 -6
  152. package/src/data/Store.mjs +34 -34
  153. package/src/data/connection/Fetch.mjs +3 -3
  154. package/src/data/connection/WebSocket.mjs +21 -25
  155. package/src/data/connection/Xhr.mjs +31 -28
  156. package/src/date/DayViewComponent.mjs +1 -1
  157. package/src/date/SelectorContainer.mjs +2 -2
  158. package/src/dialog/Base.mjs +27 -25
  159. package/src/dialog/header/Toolbar.mjs +5 -4
  160. package/src/draggable/DragProxyComponent.mjs +7 -4
  161. package/src/draggable/DragZone.mjs +30 -30
  162. package/src/draggable/DropZone.mjs +7 -7
  163. package/src/draggable/list/DragZone.mjs +18 -18
  164. package/src/draggable/tab/header/toolbar/SortZone.mjs +7 -7
  165. package/src/draggable/toolbar/DragZone.mjs +15 -15
  166. package/src/draggable/toolbar/SortZone.mjs +30 -31
  167. package/src/draggable/tree/DragZone.mjs +9 -9
  168. package/src/filter/BooleanContainer.mjs +3 -3
  169. package/src/filter/NumberContainer.mjs +5 -5
  170. package/src/filter/ToggleOperatorsButton.mjs +5 -5
  171. package/src/form/Fieldset.mjs +26 -26
  172. package/src/form/field/Base.mjs +1 -1
  173. package/src/form/field/CheckBox.mjs +15 -16
  174. package/src/form/field/Color.mjs +13 -15
  175. package/src/form/field/ComboBox.mjs +16 -24
  176. package/src/form/field/Country.mjs +1 -1
  177. package/src/form/field/Date.mjs +3 -4
  178. package/src/form/field/Display.mjs +1 -1
  179. package/src/form/field/Email.mjs +2 -2
  180. package/src/form/field/Number.mjs +51 -56
  181. package/src/form/field/Picker.mjs +2 -2
  182. package/src/form/field/Radio.mjs +1 -1
  183. package/src/form/field/Range.mjs +7 -6
  184. package/src/form/field/Text.mjs +29 -36
  185. package/src/form/field/TextArea.mjs +9 -9
  186. package/src/form/field/Time.mjs +30 -30
  187. package/src/form/field/trigger/Base.mjs +19 -13
  188. package/src/form/field/trigger/Clear.mjs +13 -13
  189. package/src/form/field/trigger/CopyToClipboard.mjs +7 -7
  190. package/src/form/field/trigger/Picker.mjs +2 -2
  191. package/src/form/field/trigger/SpinDown.mjs +1 -1
  192. package/src/form/field/trigger/SpinUp.mjs +1 -1
  193. package/src/form/field/trigger/SpinUpDown.mjs +3 -3
  194. package/src/form/field/trigger/Time.mjs +3 -3
  195. package/src/grid/Container.mjs +33 -33
  196. package/src/grid/View.mjs +20 -22
  197. package/src/grid/header/Button.mjs +12 -12
  198. package/src/grid/header/Toolbar.mjs +4 -4
  199. package/src/layout/Base.mjs +5 -4
  200. package/src/layout/Card.mjs +15 -16
  201. package/src/layout/Fit.mjs +22 -8
  202. package/src/layout/Flexbox.mjs +30 -29
  203. package/src/layout/Form.mjs +15 -15
  204. package/src/layout/Grid.mjs +2 -2
  205. package/src/layout/HBox.mjs +3 -2
  206. package/src/layout/VBox.mjs +3 -2
  207. package/src/list/Base.mjs +45 -47
  208. package/src/list/Chip.mjs +4 -4
  209. package/src/list/Circle.mjs +3 -3
  210. package/src/list/Color.mjs +4 -4
  211. package/src/list/Component.mjs +10 -10
  212. package/src/list/plugin/Animate.mjs +18 -13
  213. package/src/main/DomAccess.mjs +92 -56
  214. package/src/main/DomEvents.mjs +38 -39
  215. package/src/main/addon/AmCharts.mjs +37 -37
  216. package/src/main/addon/AnalyticsByGoogle.mjs +4 -4
  217. package/src/main/addon/CesiumJS.mjs +8 -8
  218. package/src/main/addon/CloneNode.mjs +5 -5
  219. package/src/main/addon/Cookie.mjs +4 -4
  220. package/src/main/addon/DragDrop.mjs +35 -34
  221. package/src/main/addon/GoogleMaps.mjs +19 -19
  222. package/src/main/addon/IntersectionObserver.mjs +20 -1
  223. package/src/main/addon/LocalStorage.mjs +3 -3
  224. package/src/main/addon/MapboxGL.mjs +40 -41
  225. package/src/main/addon/MonacoEditor.mjs +5 -5
  226. package/src/main/addon/Mwc.mjs +6 -6
  227. package/src/main/addon/Navigator.mjs +35 -39
  228. package/src/main/addon/Popover.mjs +5 -6
  229. package/src/main/addon/PrefixField.mjs +1 -2
  230. package/src/main/addon/ServiceWorker.mjs +9 -9
  231. package/src/main/addon/Siesta.mjs +3 -2
  232. package/src/main/addon/Stylesheet.mjs +37 -37
  233. package/src/main/addon/WebComponent.mjs +2 -3
  234. package/src/main/addon/WindowPosition.mjs +18 -18
  235. package/src/main/draggable/sensor/Base.mjs +2 -2
  236. package/src/main/draggable/sensor/Mouse.mjs +15 -15
  237. package/src/main/draggable/sensor/Touch.mjs +24 -23
  238. package/src/main/mixin/DeltaUpdates.mjs +10 -12
  239. package/src/main/mixin/TouchDomEvents.mjs +6 -6
  240. package/src/manager/Base.mjs +4 -4
  241. package/src/manager/Component.mjs +41 -41
  242. package/src/manager/DomEvent.mjs +41 -44
  243. package/src/manager/Focus.mjs +14 -16
  244. package/src/manager/Instance.mjs +2 -4
  245. package/src/manager/Store.mjs +4 -8
  246. package/src/manager/Task.mjs +20 -22
  247. package/src/manager/Toast.mjs +14 -16
  248. package/src/manager/rpc/Api.mjs +1 -3
  249. package/src/manager/rpc/Message.mjs +16 -18
  250. package/src/menu/List.mjs +16 -16
  251. package/src/menu/Panel.mjs +4 -4
  252. package/src/model/Component.mjs +16 -14
  253. package/src/plugin/Base.mjs +2 -0
  254. package/src/plugin/Popover.mjs +1 -1
  255. package/src/plugin/PrefixField.mjs +35 -45
  256. package/src/plugin/Resizable.mjs +86 -101
  257. package/src/plugin/Responsive.mjs +1 -1
  258. package/src/remotes/Api.mjs +4 -6
  259. package/src/selection/CircleModel.mjs +12 -16
  260. package/src/selection/DateSelectorModel.mjs +21 -23
  261. package/src/selection/GalleryModel.mjs +49 -63
  262. package/src/selection/HelixModel.mjs +35 -41
  263. package/src/selection/ListModel.mjs +9 -14
  264. package/src/selection/Model.mjs +31 -31
  265. package/src/selection/TreeAccordionModel.mjs +74 -80
  266. package/src/selection/grid/CellColumnModel.mjs +10 -10
  267. package/src/selection/grid/CellColumnRowModel.mjs +10 -10
  268. package/src/selection/grid/CellModel.mjs +26 -28
  269. package/src/selection/grid/CellRowModel.mjs +24 -24
  270. package/src/selection/grid/ColumnModel.mjs +16 -20
  271. package/src/selection/grid/RowModel.mjs +27 -29
  272. package/src/selection/menu/ListModel.mjs +2 -2
  273. package/src/selection/table/CellColumnModel.mjs +12 -12
  274. package/src/selection/table/CellColumnRowModel.mjs +12 -12
  275. package/src/selection/table/CellModel.mjs +26 -29
  276. package/src/selection/table/CellRowModel.mjs +19 -19
  277. package/src/selection/table/ColumnModel.mjs +18 -22
  278. package/src/selection/table/RowModel.mjs +27 -29
  279. package/src/sitemap/Component.mjs +20 -20
  280. package/src/sitemap/Store.mjs +1 -1
  281. package/src/tab/Container.mjs +15 -15
  282. package/src/tab/Strip.mjs +1 -1
  283. package/src/tab/header/Toolbar.mjs +4 -4
  284. package/src/table/Container.mjs +8 -10
  285. package/src/table/View.mjs +29 -34
  286. package/src/table/header/Button.mjs +18 -18
  287. package/src/table/header/Toolbar.mjs +2 -2
  288. package/src/toolbar/Base.mjs +14 -14
  289. package/src/toolbar/Breadcrumb.mjs +11 -11
  290. package/src/toolbar/Paging.mjs +18 -18
  291. package/src/tooltip/Base.mjs +20 -22
  292. package/src/tree/Accordion.mjs +69 -75
  293. package/src/tree/List.mjs +22 -25
  294. package/src/util/Array.mjs +19 -18
  295. package/src/util/ClassSystem.mjs +9 -9
  296. package/src/util/Css.mjs +2 -2
  297. package/src/util/Date.mjs +9 -9
  298. package/src/util/Function.mjs +2 -2
  299. package/src/util/HashHistory.mjs +3 -5
  300. package/src/util/KeyNavigation.mjs +17 -17
  301. package/src/util/Logger.mjs +9 -9
  302. package/src/util/Matrix.mjs +19 -19
  303. package/src/util/String.mjs +9 -9
  304. package/src/util/Style.mjs +11 -11
  305. package/src/util/VDom.mjs +12 -14
  306. package/src/util/VNode.mjs +29 -29
  307. package/src/vdom/Helper.mjs +84 -93
  308. package/src/vdom/VNode.mjs +1 -1
  309. package/src/worker/App.mjs +19 -16
  310. package/src/worker/Base.mjs +14 -15
  311. package/src/worker/Canvas.mjs +1 -3
  312. package/src/worker/Data.mjs +4 -8
  313. package/src/worker/Manager.mjs +27 -32
  314. package/src/worker/Message.mjs +1 -1
  315. package/src/worker/ServiceBase.mjs +38 -42
  316. package/src/worker/Task.mjs +1 -3
  317. package/src/worker/VDom.mjs +2 -4
  318. package/src/worker/mixin/RemoteMethodAccess.mjs +5 -6
  319. package/apps/portal/view/home/parts/CoolStuff.mjs +0 -82
  320. package/examples/component/helix/MainContainer.mjs +0 -340
  321. /package/resources/images/{Neo_Logo_Blue.svg → logo/neo_logo_secondary.svg} +0 -0
  322. /package/resources/images/{Neo_Logo_Text.svg → logo/neo_logo_text_secondary.svg} +0 -0
  323. /package/resources/images/{Neo_Logo_White.svg → logo/neo_logo_white.svg} +0 -0
@@ -1,3 +1,257 @@
1
+ As you read in the <a href="#/learn/Events">Getting Started > Events</a> topic, components, stores, and many other objects fire events.
2
+
3
+
4
+ <pre data-neo>
5
+ import Container from '../../../../src/container/Base.mjs';
6
+ import TextField from '../../../../src/form/field/Text.mjs';
7
+
8
+ class MainView extends Container {
9
+ static config = {
10
+ className: 'Example.view.MainView',
11
+ layout : {ntype:'vbox', align:'start'},
12
+
13
+ itemDefaults: {
14
+ module : TextField,
15
+ listeners: {
16
+ change : data => Neo.Main.log({value:data.value}), // Neo.Main.log logs to the main thread console
17
+ focusEnter: data => Neo.Main.log({value: `Entering ${data.component.labelText}`})
18
+ }
19
+ },
20
+
21
+ items: [{
22
+ labelText: 'First name'
23
+ }, {
24
+ labelText: 'Last name'
25
+ }]
26
+ }
27
+ }
28
+ Neo.setupClass(MainView);
29
+ </pre>
30
+
31
+ ## Event listeners
32
+
33
+ ### In-line
34
+
35
+ The event listener function can be coded in-line. Normally you want event handlers to be in a view's
36
+ controller, but for very simple situation it can be convenient to use this syntax.
37
+
38
+ <pre data-neo>
39
+ import Container from '../../../../src/container/Base.mjs';
40
+ import TextField from '../../../../src/form/field/Text.mjs';
41
+
42
+ class MainView extends Container {
43
+ static config = {
44
+ className: 'Example.view.MainView',
45
+ layout : {ntype:'vbox', align:'start'},
46
+
47
+ items: [{
48
+ module : TextField,
49
+ labelText: 'Name',
50
+ listeners: {
51
+ change: data => Neo.Main.log({value:data.value})
52
+ }
53
+ }]
54
+ }
55
+ }
56
+ Neo.setupClass(MainView);
57
+ </pre>
58
+
59
+ ### As a view method
60
+
61
+ You can also use the `up.` qualifier to specify a method in the component's parent view. Like the
62
+ in-line syntax you saw above, using the `up.` syntax might be convenient for simple classees,
63
+ or when you simply haven't gotten around to defining a view's controller.
64
+
65
+ <pre data-neo>
66
+ import Container from '../../../../src/container/Base.mjs';
67
+ import TextField from '../../../../src/form/field/Text.mjs';
68
+
69
+ class MainView extends Container {
70
+ static config = {
71
+ className: 'Example.view.MainView',
72
+ layout : {ntype:'vbox', align:'start'},
73
+
74
+ items: [{
75
+ module : TextField,
76
+ labelText: 'Name',
77
+ listeners: {
78
+ change: 'up.foo'
79
+ }
80
+ }]
81
+ }
82
+ foo(data){
83
+ Neo.Main.log({value:data.value})
84
+ }
85
+ }
86
+ Neo.setupClass(MainView);
87
+ </pre>
88
+
89
+ ### As a controller method
90
+
91
+ Despite the examples above, the most correct way of setting up event handlers is to use a controller.
92
+ Any view class can specify a controller &mdash; wWhen the view is created a controller instance is
93
+ also created.
94
+
95
+ <pre data-neo>
96
+ import Controller from '../../../../src/controller/Component.mjs';
97
+
98
+ class MainViewController extends Controller {
99
+ static config = {
100
+ className: 'Example.view.MainViewController'
101
+ }
102
+ foo(data){
103
+ Neo.Main.log({value:data.value})
104
+ }
105
+ }
106
+ Neo.setupClass(MainViewController);
107
+
108
+
109
+ import Container from '../../../../src/container/Base.mjs';
110
+ import TextField from '../../../../src/form/field/Text.mjs';
111
+
112
+ class MainView extends Container {
113
+ static config = {
114
+ controller: {
115
+ module: MainViewController
116
+ },
117
+ className: 'Example.view.MainView',
118
+ layout : {ntype:'vbox', align:'start'},
119
+
120
+ items: [{
121
+ module : TextField,
122
+ labelText: 'Name',
123
+ listeners: {
124
+ change: 'foo'
125
+ }
126
+ }]
127
+ }
128
+ }
129
+ Neo.setupClass(MainView);
130
+ </pre>
131
+
132
+ ## Adding listeners procedurally
133
+
134
+ Event listeners are normally specified declaratively, via the `listeners: {}` config. But occasionally you need to add
135
+ a listener proccedurally.
136
+
137
+ Any obversable class has an `addListener` method, along with an easier-to-type version called `on`.
138
+
139
+ <pre data-neo>
140
+ import Controller from '../../../../src/controller/Component.mjs';
141
+
142
+ class MainViewController extends Controller {
143
+ static config = {
144
+ className: 'Example.view.MainViewController'
145
+ }
146
+ foo(data){
147
+ Neo.Main.log({value:data.value})
148
+ }
149
+ onComponentConstructed(){
150
+ debugger
151
+ }
152
+ }
153
+ Neo.setupClass(MainViewController);
154
+
155
+
156
+ import Container from '../../../../src/container/Base.mjs';
157
+ import TextField from '../../../../src/form/field/Text.mjs';
158
+
159
+ class MainView extends Container {
160
+ static config = {
161
+ controller: {
162
+ module: MainViewController
163
+ },
164
+ className: 'Example.view.MainView',
165
+ layout : {ntype:'vbox', align:'start'},
166
+
167
+ items: [{
168
+ module : TextField,
169
+ labelText: 'Name',
170
+ listeners: {
171
+ change: 'foo'
172
+ }
173
+ }]
174
+ }
175
+ }
176
+ Neo.setupClass(MainView);
177
+ </pre>
178
+
179
+ The method specified in `on()` doesn't have to be an arrow function; you can use a controller function.
180
+
181
+ <pre data-neo>
182
+ import Controller from '../../../../src/controller/Component.mjs';
183
+
184
+ class MainViewController extends Controller {
185
+ static config = {
186
+ className: 'Example.view.MainViewController'
187
+ }
188
+ foo(data){
189
+ Neo.Main.log('foo' + {value:data.value}
190
+ }
191
+
192
+ // This is a controller lifecycle method run after the controller's view has been constructed
193
+ onComponentConstructed(){
194
+ // Note the use of this.getReference() -- that's used to get a component reference with the specified name
195
+ this.getReference('nameTextfield').on('change', this.foo, this)
196
+ }
197
+ }
198
+ Neo.setupClass(MainViewController);
199
+
200
+
201
+ import Container from '../../../../src/container/Base.mjs';
202
+ import TextField from '../../../../src/form/field/Text.mjs';
203
+
204
+ class MainView extends Container {
205
+ static config = {
206
+ controller: {
207
+ module: MainViewController
208
+ },
209
+ className: 'Example.view.MainView',
210
+ layout : {ntype:'vbox', align:'start'},
211
+
212
+ items: [{
213
+ module : TextField,
214
+ reference: 'nameTextfield', // This component can be fetched using this.getReference('nameTextfield')
215
+ labelText: 'Name'
216
+ }]
217
+ }
218
+ }
219
+ Neo.setupClass(MainView);
220
+ </pre>
221
+
222
+
223
+
224
+ ## Events versus binding
225
+
226
+ Events and binding are similar concepts &mdash; both are a way to detect, and react to, some kind of action or change.
227
+
228
+ Events are fired for user actions, such as a button click event, a component receiving focus, or a field value changing.
229
+ Non-visual classes can also fire an event; for example, a `Neo.data.Store` fires a `load` event, and other events
230
+ relating to changes to the store. The event handler if a function run when the event fires.
231
+
232
+ A binding detects a changed view model value, and assigns it to a property.
233
+
234
+
235
+ ### When to use an event
236
+
237
+ Events and event handlers are used when you need to run non-trivial logic in response to the event. For example, you
238
+ might have a Save button, and in its click event handler you'd write logic to make a backend call.
239
+
240
+ Events can be fired for a state change, such as an input field's value changing, or something like a user event,
241
+ like a button click or component focus.
242
+
243
+
244
+ ### When to use a binding
245
+
246
+ A binding is a way to keep properties in sync with values in the view model hierarchy. For example, button text,
247
+ field values, or store properties, can simultaneously reflect the same view model property. That's pretty handy,
248
+ but keep in mind that a class can define a property as a _lifecycle property_. That means that updating a property
249
+ can may result in complex logic being triggered. Furthermore, a _two way binding_ meansx
250
+
251
+
252
+
253
+ ##
254
+
1
255
  [Add content on listeners options here]
2
256
 
3
257
  How are events set up? The details don't really matter, but in case you're curious:
@@ -20,7 +20,7 @@ Click on Preview, then use your mouse or trackpad to pan and zoom &mdash; the he
20
20
  If you move quickly, you might reach 20,000 or 30,000 delta updates per second. We've seen some examples that go over 40,000 updates per
21
21
  second &mdash; but we've never actually hit the limit.
22
22
 
23
- <pre data-neo data-read-only>
23
+ <pre data-neo>
24
24
  import Base from '../../../../src/container/Base.mjs';
25
25
  import Helix from '../../../../src/component/Helix.mjs';
26
26
  class Foo extends Base {
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="100%" height="100%" viewBox="0 0 157 157" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;">
4
+ <path d="M8.841,127.508L33.676,144.928L33.675,105.744L33.675,94.343L43.023,100.871L112.335,149.272L135.026,135.569L8.841,46.576L8.841,127.508Z" style="fill:white;fill-rule:nonzero;stroke:#3E63DD;stroke-width:11.89px;"/>
5
+ <path d="M144.867,30.661L120.032,13.241L120.033,52.425L120.034,63.826L110.686,57.298L41.374,8.897L18.682,22.6L144.867,111.593L144.867,30.661Z" style="fill:white;fill-rule:nonzero;stroke:#3E63DD;stroke-width:11.89px;"/>
6
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="696" height="157" viewBox="0 0 696 157" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M210.202 131.678V34.1934H230.813L271.199 104.661V34.1934H288.329V131.678H267.718L227.331 61.3498V131.678H210.202ZM335.196 133.767C314.585 133.767 301.077 119.283 301.077 97.2797C301.077 75.5546 314.725 61.6283 334.361 61.6283C354.972 61.6283 367.505 74.9976 367.505 96.3048C367.505 98.3938 367.505 100.622 367.227 103.407H317.371C318.206 113.713 324.752 119.84 335.336 119.84C342.438 119.84 347.173 116.777 349.401 111.902H366.391C362.213 125.132 351.769 133.767 335.196 133.767ZM317.371 90.595H350.794V90.1773C350.794 81.2644 344.945 74.9976 334.361 74.9976C324.334 74.9976 317.928 81.2644 317.371 90.595ZM409.655 133.767C388.766 133.767 374.283 119.283 374.283 97.6975C374.283 76.1117 388.766 61.6283 409.655 61.6283C430.684 61.6283 445.168 76.1117 445.168 97.6975C445.168 119.283 430.684 133.767 409.655 133.767ZM391.412 97.6975C391.412 110.231 398.654 118.726 409.655 118.726C420.657 118.726 428.038 110.231 428.038 97.6975C428.038 85.1638 420.657 76.6687 409.655 76.6687C398.654 76.6687 391.412 85.1638 391.412 97.6975ZM456.426 131.678V110.51H476.062V131.678H456.426ZM491.419 131.678V63.7172H506.042V71.2374C509.941 64.5528 515.93 61.6283 523.868 61.6283C532.781 61.6283 539.326 65.8062 542.668 72.9086C547.403 65.2491 554.227 61.6283 562.444 61.6283C578.18 61.6283 587.233 71.516 587.233 88.6454V131.678H570.521V89.7595C570.521 81.2644 566.761 76.6687 559.38 76.6687C552.277 76.6687 547.542 82.1 547.542 90.1773V131.678H530.97V89.7595C530.97 81.2644 527.21 76.6687 519.829 76.6687C512.866 76.6687 507.992 82.2392 507.992 90.1773V131.678H491.419ZM588.801 156.745V141.844H598.271C601.753 141.844 602.867 140.312 602.867 135.856V63.7172H619.439V137.945C619.439 151.035 611.919 156.745 600.082 156.745H588.801ZM602.171 51.8798V34.8897H619.996V51.8798H602.171ZM660.026 133.767C641.504 133.767 630.363 126.246 629.666 111.902H646.796C647.353 117.612 652.227 120.397 660.583 120.397C668.103 120.397 672.699 117.194 672.699 112.181C672.699 107.864 669.357 105.635 663.368 105.078L652.506 103.964C639.833 102.572 631.895 95.0515 631.895 83.4926C631.895 69.9841 642.757 61.6283 660.026 61.6283C677.155 61.6283 688.018 68.87 688.853 83.0748H672.281C672.003 77.6436 667.268 75.1368 659.747 75.1368C652.645 75.1368 648.189 77.9221 648.189 82.657C648.189 86.6957 651.392 88.9239 658.215 89.7595L669.217 91.0128C682.03 92.5447 689.41 100.065 689.41 111.345C689.41 124.993 678.13 133.767 660.026 133.767Z" fill="black"/>
3
+ <path d="M8.8412 127.508L33.6763 144.928L33.6753 105.744L33.675 94.3431L43.0227 100.871L112.335 149.272L135.026 135.569L8.8412 46.5755L8.8412 127.508Z" stroke="#3E63DD" stroke-width="11.8883"/>
4
+ <path d="M144.867 30.6613L120.032 13.2409L120.033 52.4246L120.034 63.8259L110.686 57.2982L41.3738 8.89651L18.6823 22.6004L144.867 111.593L144.867 30.6613Z" stroke="#3E63DD" stroke-width="11.8883"/>
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ .colors-bar-chart {
2
+ border: 1px solid #555;
3
+ }
@@ -0,0 +1,11 @@
1
+ .portal-header-toolbar, .neo-toolbar {
2
+ > * {
3
+ &:not(:last-child) {
4
+ margin-right: .5em;
5
+ }
6
+ }
7
+
8
+ .neo-checkboxfield {
9
+ margin-left: 1em;
10
+ }
11
+ }
@@ -0,0 +1,3 @@
1
+ .colors-pie-chart {
2
+ border: 1px solid #555;
3
+ }
@@ -0,0 +1,64 @@
1
+ $base-color: #1c60a0;
2
+
3
+ .colors-table-container.neo-table-container {
4
+ width: 100%;
5
+
6
+ .color-1 {
7
+ background-color: $base-color;
8
+ }
9
+
10
+ .color-2 {
11
+ background-color: lighten($base-color, 5%);
12
+ }
13
+
14
+ .color-3 {
15
+ background-color: lighten($base-color, 10%);
16
+ }
17
+
18
+ .color-4 {
19
+ background-color: lighten($base-color, 15%);
20
+ }
21
+
22
+ .color-5 {
23
+ background-color: lighten($base-color, 20%);
24
+ }
25
+
26
+ .color-6 {
27
+ background-color: lighten($base-color, 25%);
28
+ }
29
+
30
+ .color-7 {
31
+ background-color: lighten($base-color, 30%);
32
+ }
33
+
34
+ .color-8 {
35
+ background-color: lighten($base-color, 35%);
36
+ }
37
+
38
+ .color-9 {
39
+ background-color: lighten($base-color, 40%);
40
+ }
41
+
42
+ .color-10 {
43
+ background-color: lighten($base-color, 45%);
44
+ }
45
+
46
+ .neo-index-column {
47
+ max-width: 40px;
48
+ min-width: 40px;
49
+ width : 40px;
50
+ }
51
+
52
+ .neo-table-view {
53
+ .neo-table-row {
54
+ &:hover .neo-table-cell {
55
+ background-color: #d0aa72;
56
+ color : #2b2b2b;
57
+ }
58
+ }
59
+ }
60
+
61
+ td, th {
62
+ min-width: 10%;
63
+ }
64
+ }
@@ -0,0 +1,9 @@
1
+ .colors-viewport {
2
+ padding: 2em;
3
+
4
+ > * {
5
+ &:not(:first-child) {
6
+ margin-top: 2em;
7
+ }
8
+ }
9
+ }