neo.mjs 6.9.9 → 6.9.11

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 (242) hide show
  1. package/apps/ServiceWorker.mjs +2 -2
  2. package/apps/learnneo/neo-config.json +5 -1
  3. package/apps/learnneo/store/Content.mjs +1 -1
  4. package/apps/learnneo/view/Viewport.mjs +12 -1
  5. package/apps/learnneo/view/home/ContentTreeList.mjs +53 -34
  6. package/apps/learnneo/view/home/ContentView.mjs +60 -0
  7. package/apps/learnneo/view/home/MainContainer.mjs +36 -9
  8. package/apps/learnneo/view/home/MainContainerController.mjs +57 -18
  9. package/apps/newwebsite/app.mjs +6 -0
  10. package/apps/newwebsite/index.html +10 -0
  11. package/apps/newwebsite/neo-config.json +7 -0
  12. package/apps/newwebsite/view/MainContainer.mjs +59 -0
  13. package/buildScripts/webpack/json/myApps.template.json +1 -0
  14. package/examples/ConfigurationViewport.mjs +12 -9
  15. package/examples/ServiceWorker.mjs +2 -2
  16. package/examples/button/base/neo-config.json +1 -2
  17. package/examples/form/field/textarea/MainContainer.mjs +1 -1
  18. package/package.json +2 -2
  19. package/resources/data/{learnneo → deck/learnneo}/p/2023-10-01T18-29-19-158Z.md +3 -6
  20. package/resources/data/deck/learnneo/p/stylesheet.md +40 -0
  21. package/resources/data/{learnneo → deck/learnneo}/t.json +19 -2
  22. package/resources/data/deck/training/p/2022-12-27T21-54-52-300Z.md +11 -0
  23. package/resources/data/deck/training/p/2022-12-27T21-55-23-144Z.md +43 -0
  24. package/resources/data/deck/training/p/2022-12-27T21-55-30-948Z.md +1 -0
  25. package/resources/data/deck/training/p/2022-12-27T21-55-43-542Z.md +84 -0
  26. package/resources/data/deck/training/p/2022-12-27T22-23-55-083Z.md +1 -0
  27. package/resources/data/deck/training/p/2022-12-27T22-24-07-886Z.md +8 -0
  28. package/resources/data/deck/training/p/2022-12-27T22-24-52-295Z.md +8 -0
  29. package/resources/data/deck/training/p/2022-12-27T22-25-03-853Z.md +5 -0
  30. package/resources/data/deck/training/p/2022-12-27T22-43-58-924Z.md +10 -0
  31. package/resources/data/deck/training/p/2022-12-27T22-44-28-881Z.md +3 -0
  32. package/resources/data/deck/training/p/2022-12-27T22-44-41-791Z.md +4 -0
  33. package/resources/data/deck/training/p/2022-12-27T22-45-21-032Z.md +7 -0
  34. package/resources/data/deck/training/p/2022-12-27T22-49-22-078Z.md +4 -0
  35. package/resources/data/deck/training/p/2022-12-27T22-50-20-626Z.md +4 -0
  36. package/resources/data/deck/training/p/2022-12-28T16-58-47-786Z.md +0 -0
  37. package/resources/data/deck/training/p/2022-12-28T16-58-55-192Z.md +9 -0
  38. package/resources/data/deck/training/p/2022-12-28T17-10-18-058Z.md +15 -0
  39. package/resources/data/deck/training/p/2022-12-28T17-10-42-296Z.md +40 -0
  40. package/resources/data/deck/training/p/2022-12-28T17-11-34-653Z.md +41 -0
  41. package/resources/data/deck/training/p/2022-12-28T17-13-09-994Z.md +0 -0
  42. package/resources/data/deck/training/p/2022-12-28T21-32-14-420Z.md +0 -0
  43. package/resources/data/deck/training/p/2022-12-29T01-43-32-431Z.md +7 -0
  44. package/resources/data/deck/training/p/2022-12-29T15-56-54-485Z.md +7 -0
  45. package/resources/data/deck/training/p/2022-12-29T15-57-11-499Z.md +7 -0
  46. package/resources/data/deck/training/p/2022-12-29T16-00-13-223Z.md +7 -0
  47. package/resources/data/deck/training/p/2022-12-29T18-34-25-826Z.md +4 -0
  48. package/resources/data/deck/training/p/2022-12-29T18-36-08-226Z.md +106 -0
  49. package/resources/data/deck/training/p/2022-12-29T18-36-56-893Z.md +112 -0
  50. package/resources/data/deck/training/p/2022-12-29T19-31-30-507Z.md +31 -0
  51. package/resources/data/deck/training/p/2022-12-29T19-31-55-091Z.md +14 -0
  52. package/resources/data/deck/training/p/2022-12-29T20-03-42-628Z.md +9 -0
  53. package/resources/data/deck/training/p/2022-12-29T20-21-20-669Z.md +7 -0
  54. package/resources/data/deck/training/p/2022-12-29T20-37-08-919Z.md +46 -0
  55. package/resources/data/deck/training/p/2022-12-29T20-37-20-344Z.md +43 -0
  56. package/resources/data/deck/training/p/2022-12-30T19-04-30-990Z.md +8 -0
  57. package/resources/data/deck/training/p/2022-12-31T18-43-56-338Z.md +7 -0
  58. package/resources/data/deck/training/p/2022-12-31T18-51-50-682Z.md +1 -0
  59. package/resources/data/deck/training/p/2022-12-31T18-54-04-176Z.md +4 -0
  60. package/resources/data/deck/training/p/2022-12-31T22-11-55-555Z.md +112 -0
  61. package/resources/data/deck/training/p/2022-12-31T23-00-41-222Z.md +6 -0
  62. package/resources/data/deck/training/p/2022-12-31T23-18-55-655Z.md +69 -0
  63. package/resources/data/deck/training/p/2022-12-31T23-25-40-735Z.md +21 -0
  64. package/resources/data/deck/training/p/2022-12-31T23-25-51-014Z.md +7 -0
  65. package/resources/data/deck/training/p/2023-01-01T17-49-18-429Z.md +3 -0
  66. package/resources/data/deck/training/p/2023-01-01T18-44-07-034Z.md +34 -0
  67. package/resources/data/deck/training/p/2023-01-01T18-47-39-766Z.md +15 -0
  68. package/resources/data/deck/training/p/2023-01-01T19-04-22-830Z.md +4 -0
  69. package/resources/data/deck/training/p/2023-01-01T21-11-58-025Z.md +25 -0
  70. package/resources/data/deck/training/p/2023-01-01T21-12-37-340Z.md +23 -0
  71. package/resources/data/deck/training/p/2023-01-01T21-13-13-880Z.md +8 -0
  72. package/resources/data/deck/training/p/2023-01-01T21-14-45-740Z.md +98 -0
  73. package/resources/data/deck/training/p/2023-01-01T21-18-23-886Z.md +26 -0
  74. package/resources/data/deck/training/p/2023-01-01T21-18-31-316Z.md +19 -0
  75. package/resources/data/deck/training/p/2023-01-01T21-18-42-290Z.md +23 -0
  76. package/resources/data/deck/training/p/2023-01-01T21-19-57-020Z.md +24 -0
  77. package/resources/data/deck/training/p/2023-01-01T21-22-31-184Z.md +13 -0
  78. package/resources/data/deck/training/p/2023-01-01T21-22-38-317Z.md +17 -0
  79. package/resources/data/deck/training/p/2023-01-01T21-22-47-693Z.md +20 -0
  80. package/resources/data/deck/training/p/2023-01-01T21-23-17-716Z.md +39 -0
  81. package/resources/data/deck/training/p/2023-01-01T21-23-28-532Z.md +22 -0
  82. package/resources/data/deck/training/p/2023-01-01T21-25-23-899Z.md +3 -0
  83. package/resources/data/deck/training/p/2023-01-01T21-25-59-742Z.md +1 -0
  84. package/resources/data/deck/training/p/2023-01-01T21-26-53-748Z.md +12 -0
  85. package/resources/data/deck/training/p/2023-01-01T23-38-42-863Z.md +2 -0
  86. package/resources/data/deck/training/p/2023-01-03T02-07-19-014Z.md +143 -0
  87. package/resources/data/deck/training/p/2023-01-04T01-52-23-454Z.md +76 -0
  88. package/resources/data/deck/training/p/2023-01-06T23-21-12-009Z.md +127 -0
  89. package/resources/data/deck/training/p/2023-01-06T23-21-31-685Z.md +81 -0
  90. package/resources/data/deck/training/p/2023-01-06T23-21-59-596Z.md +36 -0
  91. package/resources/data/deck/training/p/2023-01-06T23-34-13-897Z.md +87 -0
  92. package/resources/data/deck/training/p/2023-01-06T23-44-02-340Z.md +0 -0
  93. package/resources/data/deck/training/p/2023-01-06T23-46-36-687Z.md +1 -0
  94. package/resources/data/deck/training/p/2023-01-06T23-46-45-783Z.md +33 -0
  95. package/resources/data/deck/training/p/2023-01-08T00-45-11-144Z.md +50 -0
  96. package/resources/data/deck/training/p/2023-01-08T01-06-31-267Z.md +41 -0
  97. package/resources/data/deck/training/p/2023-01-08T01-24-21-088Z.md +95 -0
  98. package/resources/data/deck/training/p/2023-01-08T01-25-12-557Z.md +11 -0
  99. package/resources/data/deck/training/p/2023-01-08T01-46-50-723Z.md +25 -0
  100. package/resources/data/deck/training/p/2023-01-08T02-09-07-802Z.md +18 -0
  101. package/resources/data/deck/training/p/2023-01-08T02-09-19-678Z.md +66 -0
  102. package/resources/data/deck/training/p/2023-01-08T02-11-26-333Z.md +29 -0
  103. package/resources/data/deck/training/p/2023-01-08T17-22-48-841Z.md +14 -0
  104. package/resources/data/deck/training/p/2023-01-08T20-46-11-806Z.md +5 -0
  105. package/resources/data/deck/training/p/2023-01-08T20-47-23-682Z.md +5 -0
  106. package/resources/data/deck/training/p/2023-01-08T20-47-32-064Z.md +13 -0
  107. package/resources/data/deck/training/p/2023-01-08T20-47-57-045Z.md +0 -0
  108. package/resources/data/deck/training/p/2023-01-08T20-48-03-791Z.md +18 -0
  109. package/resources/data/deck/training/p/2023-01-08T20-48-32-466Z.md +9 -0
  110. package/resources/data/deck/training/p/2023-01-08T20-48-51-322Z.md +20 -0
  111. package/resources/data/deck/training/p/2023-01-08T20-49-52-741Z.md +0 -0
  112. package/resources/data/deck/training/p/2023-01-08T20-52-03-556Z.md +0 -0
  113. package/resources/data/deck/training/p/2023-01-08T20-57-36-333Z.md +2 -0
  114. package/resources/data/deck/training/p/2023-01-08T20-57-51-136Z.md +5 -0
  115. package/resources/data/deck/training/p/2023-01-09T00-07-37-951Z.md +0 -0
  116. package/resources/data/deck/training/p/2023-01-09T00-35-40-671Z.md +3 -0
  117. package/resources/data/deck/training/p/2023-01-10T01-29-38-148Z.md +10 -0
  118. package/resources/data/deck/training/p/2023-01-10T01-43-12-166Z.md +31 -0
  119. package/resources/data/deck/training/p/2023-01-10T02-21-54-303Z.md +10 -0
  120. package/resources/data/deck/training/p/2023-01-12T01-50-54-617Z.md +74 -0
  121. package/resources/data/deck/training/p/2023-01-13T19-55-24-735Z.md +14 -0
  122. package/resources/data/deck/training/p/2023-01-13T20-08-27-068Z.md +28 -0
  123. package/resources/data/deck/training/p/2023-01-13T20-23-38-411Z.md +25 -0
  124. package/resources/data/deck/training/p/2023-01-13T20-37-06-267Z.md +13 -0
  125. package/resources/data/deck/training/p/2023-01-13T21-05-57-708Z.md +8 -0
  126. package/resources/data/deck/training/p/2023-01-13T21-48-17-258Z.md +20 -0
  127. package/resources/data/deck/training/p/2023-01-13T22-05-05-799Z.md +14 -0
  128. package/resources/data/deck/training/p/2023-01-13T22-08-30-863Z.md +17 -0
  129. package/resources/data/deck/training/p/2023-01-13T23-01-50-449Z.md +4 -0
  130. package/resources/data/deck/training/p/2023-01-14T00-33-05-958Z.md +62 -0
  131. package/resources/data/deck/training/p/2023-01-14T00-40-27-784Z.md +229 -0
  132. package/resources/data/deck/training/p/2023-01-14T00-41-59-081Z.md +153 -0
  133. package/resources/data/deck/training/p/2023-01-14T13-50-28-199Z.md +19 -0
  134. package/resources/data/deck/training/p/2023-01-14T13-59-20-275Z.md +6 -0
  135. package/resources/data/deck/training/p/2023-01-14T14-03-29-456Z.md +3 -0
  136. package/resources/data/deck/training/p/2023-01-14T14-27-57-678Z.md +7 -0
  137. package/resources/data/deck/training/p/2023-01-14T17-30-18-228Z.md +33 -0
  138. package/resources/data/deck/training/p/2023-01-14T18-28-39-316Z.md +1 -0
  139. package/resources/data/deck/training/p/2023-01-14T18-28-44-115Z.md +4 -0
  140. package/resources/data/deck/training/p/2023-01-14T18-28-49-548Z.md +18 -0
  141. package/resources/data/deck/training/p/2023-01-14T18-40-13-758Z.md +10 -0
  142. package/resources/data/deck/training/p/2023-01-14T19-29-15-291Z.md +12 -0
  143. package/resources/data/deck/training/p/2023-01-15T18-51-52-134Z.md +83 -0
  144. package/resources/data/deck/training/p/2023-01-15T20-03-30-073Z.md +11 -0
  145. package/resources/data/deck/training/p/2023-01-15T22-07-52-073Z.md +16 -0
  146. package/resources/data/deck/training/p/2023-01-15T22-22-13-517Z.md +12 -0
  147. package/resources/data/deck/training/p/2023-01-15T22-28-57-508Z.md +131 -0
  148. package/resources/data/deck/training/p/2023-01-15T22-36-30-913Z.md +115 -0
  149. package/resources/data/deck/training/p/2023-01-16T16-03-40-770Z.md +12 -0
  150. package/resources/data/deck/training/p/2023-01-16T20-21-56-859Z.md +5 -0
  151. package/resources/data/deck/training/p/2023-01-16T20-24-09-690Z.md +24 -0
  152. package/resources/data/deck/training/p/2023-01-20T12-51-22-646Z.md +21 -0
  153. package/resources/data/deck/training/p/2023-01-20T13-06-46-614Z.md +9 -0
  154. package/resources/data/deck/training/p/2023-01-20T13-08-51-600Z.md +7 -0
  155. package/resources/data/deck/training/p/2023-01-20T15-20-13-363Z.md +26 -0
  156. package/resources/data/deck/training/p/2023-01-20T15-34-58-813Z.md +75 -0
  157. package/resources/data/deck/training/p/2023-01-21T16-33-20-458Z.md +33 -0
  158. package/resources/data/deck/training/p/2023-01-21T16-45-28-263Z.md +28 -0
  159. package/resources/data/deck/training/p/2023-01-21T16-56-25-452Z.md +3 -0
  160. package/resources/data/deck/training/p/2023-01-21T17-28-31-493Z.md +6 -0
  161. package/resources/data/deck/training/p/2023-01-21T19-49-51-918Z.md +13 -0
  162. package/resources/data/deck/training/p/2023-01-21T20-08-24-452Z.md +15 -0
  163. package/resources/data/deck/training/p/2023-01-21T20-35-54-947Z.md +20 -0
  164. package/resources/data/deck/training/p/2023-01-21T20-54-47-603Z.md +39 -0
  165. package/resources/data/deck/training/p/2023-01-21T20-56-28-184Z.md +25 -0
  166. package/resources/data/deck/training/p/2023-01-21T20-57-32-927Z.md +4 -0
  167. package/resources/data/deck/training/p/2023-01-21T23-13-33-394Z.md +6 -0
  168. package/resources/data/deck/training/p/2023-01-28T19-11-37-464Z.md +24 -0
  169. package/resources/data/deck/training/p/2023-01-28T20-43-41-188Z.md +9 -0
  170. package/resources/data/deck/training/p/2023-01-28T20-53-56-476Z.md +8 -0
  171. package/resources/data/deck/training/p/2023-01-28T20-58-43-776Z.md +10 -0
  172. package/resources/data/deck/training/p/2023-01-28T22-18-41-259Z.md +33 -0
  173. package/resources/data/deck/training/p/2023-01-28T22-24-34-808Z.md +24 -0
  174. package/resources/data/deck/training/p/2023-01-29T16-25-24-528Z.md +44 -0
  175. package/resources/data/deck/training/p/2023-01-29T21-14-32-588Z.md +12 -0
  176. package/resources/data/deck/training/p/2023-01-31T19-24-53-504Z.md +8 -0
  177. package/resources/data/deck/training/p/2023-01-31T20-33-55-855Z.md +11 -0
  178. package/resources/data/deck/training/p/2023-01-31T20-34-30-261Z.md +7 -0
  179. package/resources/data/deck/training/p/2023-01-31T20-52-53-367Z.md +43 -0
  180. package/resources/data/deck/training/p/2023-02-04T15-18-35-682Z.md +20 -0
  181. package/resources/data/deck/training/p/2023-02-04T15-49-47-597Z.md +14 -0
  182. package/resources/data/deck/training/p/2023-02-04T18-58-57-808Z.md +1 -0
  183. package/resources/data/deck/training/p/2023-02-04T20-07-11-288Z.md +1 -0
  184. package/resources/data/deck/training/p/2023-02-04T20-09-50-169Z.md +1 -0
  185. package/resources/data/deck/training/p/2023-02-04T20-19-42-740Z.md +8 -0
  186. package/resources/data/deck/training/p/2023-02-04T20-23-56-013Z.md +12 -0
  187. package/resources/data/deck/training/p/2023-02-04T20-28-12-391Z.md +20 -0
  188. package/resources/data/deck/training/p/2023-02-05T00-20-32-554Z.md +16 -0
  189. package/resources/data/deck/training/p/2023-02-05T00-35-56-282Z.md +13 -0
  190. package/resources/data/deck/training/p/2023-02-05T15-36-57-182Z.md +24 -0
  191. package/resources/data/deck/training/p/2023-02-05T17-39-51-712Z.md +70 -0
  192. package/resources/data/deck/training/p/2023-02-05T17-44-53-815Z.md +195 -0
  193. package/resources/data/deck/training/p/2023-02-05T17-45-40-114Z.md +92 -0
  194. package/resources/data/deck/training/p/2023-02-05T18-12-14-489Z.md +60 -0
  195. package/resources/data/deck/training/p/2023-02-06T00-14-54-457Z.md +9 -0
  196. package/resources/data/deck/training/p/2023-06-28T18-03-14-313Z.md +8 -0
  197. package/resources/data/deck/training/p/2023-06-28T18-26-17-290Z.md +7 -0
  198. package/resources/data/deck/training/p/2023-06-28T21-16-24-034Z.md +40 -0
  199. package/resources/data/deck/training/p/2023-06-28T21-16-34-972Z.md +16 -0
  200. package/resources/data/deck/training/p/2023-06-28T21-28-28-379Z.md +4 -0
  201. package/resources/data/deck/training/p/2023-06-29T23-15-10-411Z.md +5 -0
  202. package/resources/data/deck/training/p/2023-07-01T15-42-45-193Z.md +433 -0
  203. package/resources/data/deck/training/p/2023-07-01T21-54-31-329Z.md +6 -0
  204. package/resources/data/deck/training/p/2023-07-02T16-14-06-970Z.md +14 -0
  205. package/resources/data/deck/training/p/2023-07-31T00-26-03-842Z.md +4 -0
  206. package/resources/data/deck/training/p/2023-07-31T00-31-51-933Z.md +10 -0
  207. package/resources/data/deck/training/p/2023-07-31T00-37-21-927Z.md +205 -0
  208. package/resources/data/deck/training/p/2023-10-01T18-29-19-158Z.md +76 -0
  209. package/resources/data/deck/training/p/2023-10-07T19-18-28-517Z.md +102 -0
  210. package/resources/data/deck/training/p/2023-10-08T20-20-07-934Z.md +75 -0
  211. package/resources/data/deck/training/p/2023-10-08T20-20-37-336Z.md +29 -0
  212. package/resources/data/deck/training/p/2023-10-08T20-37-30-658Z.md +0 -0
  213. package/resources/data/deck/training/p/2023-10-08T21-58-25-809Z.md +68 -0
  214. package/resources/data/deck/training/p/2023-10-08T22-22-11-013Z.md +0 -0
  215. package/resources/data/deck/training/p/2023-10-14T19-25-08-153Z.md +119 -0
  216. package/resources/data/deck/training/t.json +1 -0
  217. package/resources/scss/src/apps/learnneo/Viewport.scss +0 -106
  218. package/resources/scss/src/apps/learnneo/home/ContentTreeList.scss +37 -0
  219. package/resources/scss/src/apps/learnneo/home/ContentView.scss +55 -0
  220. package/resources/scss/src/form/field/FileUpload.scss +4 -4
  221. package/resources/scss/src/form/field/TextArea.scss +1 -1
  222. package/resources/scss/theme-neo-light/Global.scss +46 -0
  223. package/resources/scss/theme-neo-light/design-tokens/Core.scss +7 -0
  224. package/resources/scss/theme-neo-light/design-tokens/Semantic.scss +0 -0
  225. package/resources/scss/theme-neo-light/design-tokens/_all.scss +4 -0
  226. package/src/DefaultConfig.mjs +4 -4
  227. package/src/form/field/FileUpload.mjs +9 -2
  228. package/src/form/field/TextArea.mjs +19 -34
  229. package/src/main/DomAccess.mjs +34 -0
  230. package/test/components/files/form/field/Select.mjs +1 -1
  231. /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-07T19-18-28-517Z.md +0 -0
  232. /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T20-20-07-934Z.md +0 -0
  233. /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T20-20-37-336Z.md +0 -0
  234. /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T20-37-30-658Z.md +0 -0
  235. /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T21-58-25-809Z.md +0 -0
  236. /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T22-22-11-013Z.md +0 -0
  237. /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-14T19-25-08-153Z.md +0 -0
  238. /package/resources/data/{learnneo → deck/learnneo}/pages/whyneo.md +0 -0
  239. /package/resources/data/{learnneo → deck/learnneo}/tree.json +0 -0
  240. /package/resources/{deck → data/deck}/whyneo.md +0 -0
  241. /package/resources/scss/src/apps/newwebsite/{MainContainer.css → MainContainer.scss} +0 -0
  242. /package/resources/scss/theme-neo-light/design-tokens/{Components.scss → Component.scss} +0 -0
@@ -0,0 +1,87 @@
1
+ #Introduction
2
+
3
+ In this lab you'll create a class to show the banner.
4
+
5
+ #Steps
6
+
7
+ ??Create the `Banner` class
8
+
9
+ Use a terminal window to navigate to the root of your Neo workspace,
10
+ and run the following command.
11
+
12
+ npm run create-class
13
+
14
+ Name the class `Yelp.view.Banner`. When prompted, choose `component.Base` as the
15
+ base class.
16
+
17
+ ??Stub out the banner
18
+
19
+ Edit the banner and add a single `html` property set to `'This is the new banner'`.
20
+
21
+ <pre class="runnable readonly text 260">
22
+ import Base from '../../../node_modules/neo.mjs/src/component/Base.mjs';
23
+
24
+ class Banner extends Base {
25
+ static config = {
26
+ className: 'Yelp.view.Banner',
27
+
28
+ html: 'This is the banner'
29
+ }
30
+ }
31
+
32
+ Neo.applyClassConfig(Banner);
33
+
34
+ export default Banner;</pre>
35
+
36
+ ??Use the new banner
37
+
38
+ Edit the main view and use the new banner:
39
+
40
+ - Import the banner
41
+ - In the header config for the banner
42
+ - Use the newly imported module
43
+ - Delete the `html: 'banner'`
44
+
45
+ ??Get the Yelp logo
46
+
47
+ Create the file `resources/images/yelp_logo.svg` with this content
48
+
49
+ <pre class="runnable readonly text 200">
50
+ &lt;svg width="1000" height="385" viewBox="0 0 1000 385" fill="none" xmlns="http://www.w3.org/2000/svg">
51
+ &lt;path d="M806.495 227.151L822.764 223.392C823.106 223.313 823.671 223.183 824.361 222.96C828.85 221.753 832.697 218.849 835.091 214.862C837.485 210.874 838.241 206.113 837.198 201.582C837.175 201.482 837.153 201.388 837.13 201.289C836.596 199.117 835.66 197.065 834.37 195.239C832.547 192.926 830.291 190.991 827.728 189.542C824.711 187.82 821.553 186.358 818.289 185.171L800.452 178.659C790.441 174.937 780.432 171.309 770.328 167.771C763.776 165.439 758.224 163.393 753.4 161.901C752.49 161.62 751.485 161.34 750.669 161.058C744.837 159.271 740.739 158.53 737.272 158.505C734.956 158.42 732.649 158.841 730.511 159.738C728.283 160.699 726.282 162.119 724.639 163.906C723.822 164.835 723.054 165.806 722.337 166.815C721.665 167.843 721.049 168.907 720.491 170.001C719.876 171.174 719.348 172.391 718.911 173.642C715.6 183.428 713.951 193.7 714.032 204.029C714.091 213.368 714.342 225.354 719.475 233.479C720.712 235.564 722.372 237.366 724.348 238.769C728.004 241.294 731.7 241.627 735.544 241.904C741.289 242.316 746.855 240.905 752.403 239.623L806.45 227.135L806.495 227.151Z" fill="#FF1A1A"/>
52
+ &lt;path d="M987.995 140.779C983.553 131.457 977.581 122.947 970.328 115.601C969.39 114.669 968.385 113.806 967.321 113.02C966.339 112.283 965.318 111.598 964.264 110.967C963.18 110.373 962.065 109.837 960.924 109.362C958.668 108.476 956.25 108.077 953.829 108.19C951.513 108.322 949.254 108.956 947.207 110.049C944.105 111.591 940.748 114.07 936.283 118.221C935.666 118.834 934.891 119.525 934.195 120.177C930.511 123.641 926.413 127.911 921.536 132.883C914.002 140.497 906.583 148.152 899.21 155.89L886.017 169.571C883.601 172.071 881.401 174.771 879.441 177.643C877.771 180.07 876.59 182.799 875.963 185.678C875.6 187.886 875.653 190.142 876.12 192.329C876.143 192.429 876.164 192.523 876.187 192.622C877.229 197.154 879.988 201.103 883.883 203.637C887.778 206.172 892.505 207.094 897.068 206.211C897.791 206.106 898.352 205.982 898.693 205.898L969.033 189.646C974.576 188.365 980.202 187.191 985.182 184.3C988.522 182.363 991.699 180.443 993.878 176.569C995.043 174.441 995.748 172.092 995.948 169.675C997.027 160.089 992.021 149.202 987.995 140.779Z" fill="#FF1A1A"/>
53
+ &lt;path d="M862.1 170.358C867.197 163.955 867.184 154.41 867.64 146.607C869.174 120.536 870.79 94.4619 872.07 68.3766C872.56 58.4962 873.624 48.7498 873.036 38.7944C872.552 30.5816 872.492 21.1521 867.307 14.4122C858.154 2.52688 838.636 3.50371 825.319 5.34732C821.239 5.91358 817.153 6.6749 813.099 7.64807C809.045 8.62124 805.033 9.6841 801.108 10.9412C788.329 15.127 770.365 22.8103 767.323 37.5341C765.608 45.858 769.672 54.3727 772.824 61.9691C776.645 71.1774 781.865 79.4721 786.622 88.1401C799.198 111.024 812.008 133.765 824.782 156.53C828.597 163.326 832.755 171.933 840.135 175.454C840.623 175.667 841.121 175.856 841.628 176.018C844.937 177.272 848.545 177.513 851.993 176.712C852.201 176.664 852.405 176.617 852.608 176.57C855.792 175.704 858.675 173.973 860.937 171.568C861.345 171.185 861.734 170.782 862.1 170.358Z" fill="#FF1A1A"/>
54
+ &lt;path d="M855.997 240.155C854.008 237.355 851.184 235.258 847.931 234.162C844.677 233.065 841.16 233.027 837.881 234.051C837.111 234.307 836.361 234.618 835.636 234.983C834.515 235.554 833.445 236.221 832.439 236.976C829.507 239.148 827.039 241.97 824.791 244.8C824.221 245.522 823.7 246.483 823.022 247.1L811.708 262.663C805.295 271.382 798.971 280.123 792.7 289.003C788.608 294.735 785.068 299.576 782.273 303.859C781.743 304.666 781.193 305.567 780.689 306.284C777.338 311.469 775.441 315.252 774.467 318.622C773.735 320.862 773.503 323.234 773.788 325.572C774.1 328.008 774.92 330.35 776.195 332.447C776.873 333.499 777.604 334.516 778.385 335.495C779.196 336.436 780.058 337.332 780.966 338.18C781.936 339.105 782.973 339.957 784.07 340.729C791.879 346.162 800.428 350.066 809.421 353.083C816.904 355.567 824.682 357.053 832.555 357.504C833.894 357.572 835.237 357.543 836.572 357.417C837.809 357.309 839.04 357.136 840.26 356.9C841.479 356.615 842.681 356.266 843.863 355.853C846.162 354.993 848.255 353.66 850.008 351.94C851.667 350.279 852.944 348.276 853.749 346.07C855.057 342.81 855.917 338.671 856.483 332.526C856.532 331.652 856.657 330.604 856.744 329.644C857.19 324.545 857.395 318.556 857.723 311.514C858.276 300.685 858.71 289.903 859.053 279.09C859.053 279.09 859.782 259.875 859.78 259.865C859.946 255.437 859.81 250.53 858.582 246.121C858.042 244.008 857.17 241.994 855.997 240.155V240.155Z" fill="#FF1A1A"/>
55
+ &lt;path d="M983.707 270.24C981.346 267.651 978 265.069 972.722 261.878C971.961 261.453 971.068 260.886 970.244 260.392C965.85 257.749 960.557 254.969 954.374 251.611C944.876 246.396 935.372 241.312 925.778 236.271L908.825 227.28C907.946 227.024 907.053 226.389 906.225 225.989C902.968 224.432 899.516 222.978 895.932 222.311C894.697 222.074 893.444 221.944 892.186 221.923C891.375 221.913 890.565 221.962 889.761 222.07C886.371 222.595 883.234 224.178 880.795 226.591C878.356 229.005 876.74 232.128 876.178 235.513C875.919 237.667 875.998 239.847 876.411 241.976C877.24 246.487 879.254 250.95 881.338 254.858L890.391 271.824C895.428 281.394 900.526 290.907 905.752 300.391C909.123 306.578 911.929 311.871 914.557 316.26C915.055 317.085 915.62 317.974 916.046 318.738C919.245 324.013 921.815 327.333 924.421 329.715C926.109 331.345 928.132 332.586 930.349 333.351C932.68 334.124 935.146 334.398 937.59 334.155C938.832 334.008 940.066 333.795 941.286 333.516C942.488 333.193 943.672 332.808 944.833 332.362C946.087 331.889 947.305 331.327 948.478 330.678C955.36 326.82 961.703 322.07 967.345 316.552C974.112 309.894 980.093 302.633 984.745 294.321C985.392 293.145 985.952 291.924 986.422 290.667C986.86 289.504 987.24 288.319 987.558 287.118C987.834 285.896 988.045 284.662 988.191 283.418C988.422 280.977 988.138 278.514 987.358 276.19C986.591 273.963 985.345 271.932 983.707 270.24V270.24Z" fill="#FF1A1A"/>
56
+ &lt;path fill-rule="evenodd" clip-rule="evenodd" d="M400.03 105.19C400.03 91.2089 411.42 79.7877 425.167 79.7877C438.717 79.7877 449.714 91.2089 450.303 105.387V303.682C450.303 317.663 438.913 329.084 425.167 329.084C411.027 329.084 400.03 317.663 400.03 303.682V105.19ZM376.657 227.672C376.461 231.61 375.479 238.896 370.373 244.213C364.874 249.923 357.412 251.302 353.092 251.302C335.123 251.4 317.155 251.45 299.187 251.499C281.218 251.548 263.248 251.597 245.279 251.696C246.85 256.619 249.992 264.101 257.062 270.994C261.382 275.129 265.506 277.492 267.273 278.476C269.434 279.855 276.896 283.793 286.126 283.793C295.945 283.793 304.586 280.642 313.03 276.31L313.736 275.945C319.604 272.904 325.66 269.766 332.079 268.631C338.363 267.646 345.04 268.827 349.949 273.16C355.841 278.279 358.197 285.762 356.037 293.442C353.484 302.106 346.218 309.589 338.559 314.118C334.239 316.678 329.526 318.844 324.813 320.617C318.725 322.783 312.441 324.358 306.157 325.343C299.872 326.327 293.392 326.721 286.911 326.524H286.911C283.769 326.524 280.431 326.524 277.092 326.13C273.558 325.736 270.023 324.949 266.684 324.161C261.186 322.98 256.08 321.207 250.974 318.844C246.064 316.678 241.155 313.921 236.638 310.771C232.121 307.62 227.997 303.879 224.07 299.94C220.338 296.002 216.804 291.67 213.662 286.944C203.057 270.797 198.147 250.908 199.129 231.61C199.915 212.706 206.199 193.802 217.589 178.443C218.823 176.519 220.247 174.883 221.596 173.333C222.18 172.663 222.75 172.008 223.284 171.354C237.35 154.158 256.142 148.716 263.894 146.471L264.328 146.345C286.519 140.044 304.978 144.179 312.441 146.345C316.172 147.33 337.185 153.828 353.484 171.354C354.27 172.141 356.43 174.701 359.179 178.443C369.505 192.508 373.066 205.605 374.272 210.042L374.301 210.146C375.479 214.478 376.657 220.386 376.657 227.672ZM261.382 195.181C249.992 204.436 246.85 216.251 246.064 219.992H331.686C330.901 216.448 327.562 204.436 316.172 195.181C304.586 185.925 292.41 185.335 288.679 185.335C284.948 185.335 272.772 185.925 261.382 195.181ZM586.98 142.998C564.593 142.998 544.169 153.041 529.637 169.385V168.794C529.048 155.6 518.05 144.967 504.696 144.967C490.753 144.967 479.56 156.191 479.56 170.172V359.409C479.56 373.391 490.753 384.615 504.696 384.615C518.64 384.615 529.833 373.391 529.833 359.409V352.123V300.334C544.365 316.482 564.593 326.721 587.176 326.721C632.147 326.721 668.674 285.959 668.674 235.155C668.478 184.35 631.951 142.998 586.98 142.998ZM575.983 285.566C550.453 285.566 529.637 263.314 529.637 235.549C529.637 207.586 550.257 185.335 575.983 185.335C601.512 185.335 622.328 207.586 622.328 235.549C622.132 263.314 601.512 285.566 575.983 285.566ZM161.425 248.348L153.177 266.464C149.446 274.341 145.715 282.415 142.18 290.488C141.052 292.966 139.916 295.494 138.764 298.057C123.068 332.981 104.44 374.43 63.8242 383.236C44.1861 387.568 14.5327 381.661 3.5354 363.15C-7.4619 344.443 8.83767 322.979 29.8504 327.902C33.1646 328.641 36.4235 330.266 39.7101 331.904C45.187 334.635 50.7406 337.404 56.7545 336.173C62.4495 335.188 65.9844 331.053 70.5011 325.736C76.7853 318.45 79.5346 310.771 80.7129 306.242C80.6147 306.045 80.5165 305.798 80.4183 305.552C80.3201 305.306 80.2219 305.06 80.1237 304.863C75.0117 295.326 70.5473 286.8 66.8178 279.677C64.3868 275.034 62.2681 270.987 60.4857 267.646C56.8287 260.714 54.0662 255.473 51.918 251.398C45.6449 239.497 44.609 237.532 41.8296 232.398C35.7418 220.78 29.2612 209.555 22.5843 198.331C15.3182 186.122 7.85577 172.535 13.9436 158.16C18.8531 146.542 31.4214 140.634 43.4006 144.376C56.0403 148.212 61.6377 160.239 66.8724 171.487C67.8188 173.52 68.7534 175.528 69.7156 177.458C78.16 194.196 86.4079 210.934 94.6559 227.672C95.382 229.336 96.4917 231.605 97.8402 234.362C99.0447 236.824 100.44 239.676 101.922 242.834C102.697 244.475 103.434 246.002 104.101 247.382C104.954 249.149 105.691 250.676 106.242 251.892C110.072 242.342 113.95 232.841 117.829 223.34C121.707 213.839 125.586 204.337 129.415 194.787C129.522 194.253 130.436 192.216 131.813 189.145C132.977 186.549 134.473 183.215 136.092 179.427C136.64 178.133 137.191 176.79 137.755 175.417C142.856 162.995 148.988 148.06 162.604 143.982C172.423 141.028 183.42 144.967 189.115 153.237C192.061 157.372 193.239 162.098 193.435 166.824C193.593 177.275 188.545 188.491 184.212 198.115C183.157 200.459 182.144 202.708 181.26 204.829C181.219 204.91 181.048 205.296 180.739 205.988C179.541 208.679 176.278 216.005 170.655 228.066C168.626 232.389 166.679 236.713 164.707 241.09C163.626 243.491 162.538 245.907 161.425 248.348Z" fill="black"/>
57
+ &lt;path d="M687.728 310.153H689.549C690.447 310.153 691.167 309.923 691.706 309.462C692.256 308.99 692.532 308.395 692.532 307.676C692.532 306.833 692.29 306.232 691.807 305.872C691.324 305.502 690.56 305.316 689.515 305.316H687.728V310.153ZM695.043 307.608C695.043 308.507 694.801 309.305 694.318 310.002C693.846 310.687 693.178 311.198 692.313 311.535L696.324 318.193H693.492L690.004 312.226H687.728V318.193H685.234V303.176H689.633C691.498 303.176 692.863 303.541 693.728 304.271C694.605 305.002 695.043 306.114 695.043 307.608ZM677.228 310.676C677.228 308.429 677.79 306.322 678.914 304.356C680.037 302.389 681.582 300.839 683.549 299.704C685.515 298.569 687.633 298.002 689.902 298.002C692.15 298.002 694.256 298.564 696.223 299.687C698.189 300.811 699.74 302.356 700.874 304.322C702.009 306.288 702.577 308.406 702.577 310.676C702.577 312.889 702.032 314.968 700.942 316.912C699.852 318.856 698.324 320.412 696.358 321.58C694.391 322.749 692.24 323.333 689.902 323.333C687.577 323.333 685.431 322.754 683.464 321.597C681.498 320.429 679.964 318.872 678.863 316.929C677.773 314.985 677.228 312.901 677.228 310.676ZM678.998 310.676C678.998 312.62 679.487 314.44 680.464 316.136C681.442 317.822 682.773 319.153 684.459 320.131C686.155 321.097 687.97 321.58 689.902 321.58C691.858 321.58 693.672 321.092 695.346 320.114C697.02 319.136 698.346 317.816 699.324 316.153C700.313 314.479 700.807 312.653 700.807 310.676C700.807 308.721 700.318 306.906 699.341 305.232C698.363 303.558 697.037 302.232 695.363 301.255C693.7 300.266 691.88 299.771 689.902 299.771C687.947 299.771 686.133 300.26 684.459 301.238C682.785 302.215 681.453 303.541 680.464 305.215C679.487 306.878 678.998 308.698 678.998 310.676Z" fill="black"/>
58
+ &lt;/svg>
59
+ </pre>
60
+
61
+
62
+ ??Enhance the banner
63
+
64
+ We want the banner to show the logo. Remove the `html` property and add
65
+ vdom that describes the _img_ tag you'll create:
66
+
67
+ <pre class="runnable readonly text 400">
68
+ import Base from '../../../node_modules/neo.mjs/src/component/Base.mjs';
69
+
70
+ class Banner extends Base {
71
+ static config = {
72
+ className: 'Yelp.view.Banner',
73
+ ntype: 'banner',
74
+ height: 32,
75
+ _vdom: {
76
+ tag: 'img',
77
+ src: '../../resources/images/yelp_logo.svg',
78
+ };
79
+ }
80
+ }
81
+
82
+ Neo.applyClassConfig(Banner);
83
+ export default Banner;
84
+ </pre>
85
+
86
+ Verify that the app runs. You should see the new banner.
87
+
@@ -0,0 +1 @@
1
+ <img src="resources/images/YelpAppSketch.png"></img>
@@ -0,0 +1,33 @@
1
+ <pre style="font-size: 11pt; border: thin solid blue; padding: 4px; ">
2
+ {
3
+ "businesses": [{
4
+ "id": "nsw3tlB-hwz4KbPYcuaSww",
5
+ "image_url": "https://s3-media1.fl.yelpcdn.com/bphoto/2QtMzHr1ZNoflLzXKRza9A/o.jpg",
6
+ "is_closed": false,
7
+ "url": "https://www.yelp.com/biz/novanta-madison?adjust_creative=hAlq2S6c7S0nxZcdmjtkhA&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=hAlq2S6c7S0nxZcdmjtkhA",
8
+ "review_count": 328,
9
+ "categories": [
10
+ {"alias": "pizza", "title": "Pizza"},
11
+ {"alias": "italian", "title": "Italian"},
12
+ {"alias": "mediterranean", "title": "Mediterranean"}
13
+ ],
14
+ "rating": 4.5,
15
+ "coordinates": {"latitude": 43.0753733442932, "longitude": -89.5296266588608},
16
+ "transactions": ["delivery", "pickup"],
17
+ "price": "$$",
18
+ "location": {
19
+ "address1": "8452 Old Sauk Rd",
20
+ "address2": "",
21
+ "address3": "",
22
+ "city": "Madison",
23
+ "zip_code": "53562",
24
+ "country": "US",
25
+ "state": "WI",
26
+ "display_address": ["8452 Old Sauk Rd", "Madison, WI 53562"]
27
+ },
28
+ "phone": "+16088317740",
29
+ "display_phone": "(608) 831-7740",
30
+ "distance": 1639.6643113166895
31
+ }]
32
+ }
33
+ </pre>
@@ -0,0 +1,50 @@
1
+ The model config is kind of long, and it distracts from the
2
+ primary purpose of the main container, which is to describe
3
+ the view.
4
+
5
+ Therefore, we should refactor the component model into its own class,
6
+ just like we did for the table.
7
+
8
+ Just before, that means creating a new `.mjs` file to hold the
9
+ new class, extending the corresponding class, copying and pasting
10
+ the config block, and adding whatever imports might be needed.
11
+
12
+ <pre class="runnable text readonly">
13
+ import Base from '../../../node_modules/neo.mjs/src/model/Component.mjs';
14
+ import Store from '../../../node_modules/neo.mjs/src/data/Store.mjs';
15
+
16
+ class MainViewModel extends Base {
17
+ static config = {
18
+ className: 'Earthquakes.view.MainViewModel',
19
+ data: {},
20
+ stores: {
21
+ earthquakes: {
22
+ module: Store,
23
+ model: {
24
+ fields: [{
25
+ name: 'humanReadableLocation'
26
+ }, {
27
+ name: 'size',
28
+ ntype: 'data-field-float',
29
+ }, {
30
+ name: 'timestamp',
31
+ type: 'Date'
32
+ }, {
33
+ name: 'title',
34
+ calculate: (data, field, item) => item.humanReadableLocation
35
+ }, {
36
+ name: 'position',
37
+ calculate: (data, field, item) => ({ lat: item.latitude, lng: item.longitude })
38
+ }]
39
+ },
40
+ url: 'https://apis.is/earthquake/is',
41
+ responseRoot: 'results',
42
+ autoLoad: true
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ Neo.applyClassConfig(MainViewModel);
49
+ export default MainViewModel;
50
+ </pre>
@@ -0,0 +1,41 @@
1
+ #Introduction
2
+
3
+ In this lab you'll add a couple of event handlers.
4
+
5
+ #Steps
6
+
7
+ ??Add a listener to a table event
8
+
9
+ Tables fire a _select_ event, passing an object that contains a
10
+ reference to the corresponding row.
11
+
12
+ Add this table config:
13
+
14
+ listeners: {
15
+ select: (data) => {
16
+ console.log(data.record);
17
+ }
18
+ }
19
+
20
+ Save and refresh, then click on a table row. If you look at the
21
+ debugger console you'll see the record being logged.
22
+
23
+ Just for fun, expand the logged value and look for the _size_ property.
24
+ If you recall, that's a value from the feed, and one of the things we
25
+ configured in the store's `fields:[]`.
26
+
27
+ In the console, click on the ellipses by _size_ and enter a new value, like
28
+ _2.5_. (Don't enter a larger value, or you may destroy that part of Iceland.)
29
+
30
+ After changing the value you should immediately see it reflected in the table row.
31
+
32
+ ??Add a listener to a map event
33
+
34
+ Now add a _markerClick_ listener to the Google Map.
35
+
36
+ listeners: {
37
+ markerClick: data => {
38
+ console.log(data.data.record);
39
+ }
40
+ },
41
+
@@ -0,0 +1,95 @@
1
+ #Introduction
2
+
3
+ In this lab, you'll use a component controller to hold the event handlers.
4
+
5
+ #Steps
6
+
7
+ ??Define the event handler methods
8
+
9
+ Edit `MainContainerController.mjs` the add two instance methods:
10
+ - `onTableSelect`
11
+ - `onMapMarkerClick`
12
+
13
+ Each method takes a single `data` param and each method has
14
+ one statement, which is the `console.log()` you already coded in the main container.
15
+
16
+ ??You already knew this, but here's what the controller class looks like
17
+
18
+ <pre style="color:blue; padding: 8px; border: thin solid gray; font-size:80%;">
19
+ import ComponentController from '../../../node_modules/neo.mjs/src/controller/Component.mjs';
20
+
21
+ /**
22
+ * @class Earthquakes.view.MainContainerController
23
+ * @extends Neo.controller.Component
24
+ */
25
+ class MainContainerController extends ComponentController {
26
+ static config = {
27
+ /**
28
+ * @member {String} className='Earthquakes.view.MainContainerController'
29
+ * @protected
30
+ */
31
+ className: 'Earthquakes.view.MainContainerController'
32
+ }
33
+
34
+ onMapSelect(data){
35
+ console.log(data);
36
+ }
37
+ onTableSelect(data){
38
+ console.log(data);
39
+ }
40
+ }
41
+
42
+ Neo.applyClassConfig(MainContainerController);
43
+
44
+ export default MainContainerController;
45
+ </pre>
46
+
47
+ ??Have the table select event handler change the map selection
48
+
49
+ It would be nice for the map to reflect the table selection. We might
50
+ be able to do that using a binding, but since we're discussing controllers
51
+ and event handlers, we'll update the map's selection in the controller.
52
+
53
+ To do that, in `onTableSelect`, we need to
54
+ - Get a reference to the map
55
+ - Assign the selected record to the map's `selection` property
56
+
57
+ Neo has a easy way to get a reference to some component in the view:
58
+ the `reference` config.
59
+
60
+ To use that feature, first edit `MainContainer`, and add `reference: 'myMap` to the map config.
61
+ <pre style="color:lightgray; padding: 8px; border: thin solid gray; font-size:80%;">
62
+ {
63
+ module: GoogleMapsComponent,
64
+ <span style="color:blue;">reference: 'myMap',</span>
65
+ flex: 1,
66
+ center: {
67
+ lat: 64.8014187,
68
+ lng: -18.3096357
69
+ },
70
+ zoom: 6,
71
+ bind: {
72
+ markerStore: 'stores.earthquakes',
73
+ },
74
+ listeners: {
75
+ select: 'onMapSelect'
76
+ }
77
+ }
78
+ </pre>
79
+
80
+ Then edit `MainContainerController` and in the `onTableSelect` method add this statement.
81
+
82
+ this.getReference('myMap').selection = data.record;
83
+
84
+ Save your changes, then click on a few table rows &mdash; you should see the corresponding
85
+ map marker become highlighted.
86
+
87
+ <img src="resources/images/earthquakes/TableSyncsMap.png"></img>
88
+
89
+ ??To reiterate: Neo.findFirst should not be used in your app logic
90
+
91
+ In the debugging labs you learned that `Neo.findFirst()` provides a handy debugging technique
92
+ for getting a component reference. *That should only be used for debugging, and should
93
+ never be used in your app logic.*
94
+
95
+ If you need a reference, use `this.getReference()`.
@@ -0,0 +1,11 @@
1
+ What's the goal of this somewhat lengthy topic?
2
+
3
+ - To touch on fundamental Neo concepts
4
+ - To do some coding without emphasizing syntax details
5
+
6
+ Most of these labs are copy-and-paste because we're focusing
7
+ on _what_ it's doing on rather than _how_.
8
+
9
+ As we progress through the training we'll spend more and
10
+ more time on syntax and _how_, and you'll be more and more
11
+ proficient at writing your own code.
@@ -0,0 +1,25 @@
1
+ Controllers are a little easier to set up than view or model
2
+ classes, because for views and models we're overriding
3
+ the configs in the base class. But controllers simply hold event
4
+ handlers; these are instance functions.
5
+
6
+ <pre class="runnable text readonly">
7
+ import Base from '../../../node_modules/neo.mjs/src/controller/Component.mjs';
8
+
9
+ class MainViewController extends Base {
10
+ static config = {
11
+ className: 'MyApp.view.MainViewController',
12
+ }
13
+
14
+ /**
15
+ * This is an example of a button's click handler
16
+ */
17
+ onClick() {
18
+ console.log('click');
19
+ }
20
+ }
21
+
22
+ Neo.applyClassConfig(MainViewController);
23
+
24
+ export default MainViewController;
25
+ </pre>
@@ -0,0 +1,18 @@
1
+ <div type="expander" caption="Object literals">
2
+ <p>
3
+ It's very easy to drop an ending `}` or `]` or otherwise have problems with object literals.
4
+ One way to help with that is to have some kind of source code "linter" installed. (There are
5
+ many options, like JSLint.) A linter will tell you if there's something structural problem
6
+ with your source code.
7
+ </p>
8
+ </div>
9
+
10
+ <div type="expander" caption="Imports">
11
+ <p>
12
+ The import path can be complicated, and the relative path will change depending on whether
13
+ the source file is nested sub-directories.
14
+ </p>
15
+ <p>
16
+ Some code editors, like WebStorm, will detect bad import paths.
17
+ </p>
18
+ </div>
@@ -0,0 +1,66 @@
1
+ <div type="expander" caption="Very Very Fast">
2
+ <p>
3
+ Neo uses three (or more) web workers to parallel process app logic, DOM changes, and backend calls.
4
+ </p>
5
+ <p>
6
+ Furthermore, DOM changes are applied as _deltas_, which means updates are especially fast.
7
+ </p>
8
+ <p>
9
+ Another interesting benefit of the web worker approach is that Neo allows multi-window applications.
10
+ </p>
11
+ </div>
12
+
13
+ <div type="expander" caption="Declarative">
14
+ <p>
15
+ Most of the "code" you write is in the form of an object literal that describes what you're creating.
16
+ </p>
17
+ <p>
18
+ That declarative object literal is what's returned by `static getConfig()`.
19
+ </p>
20
+ </div>
21
+
22
+ <div type="expander" caption="Class Based">
23
+ <p>
24
+ The mjs class system is used, making it easy to override methods and extend classes.
25
+ </p>
26
+ <p>
27
+ Any Neo class can be extended, making your code modular, reusable, and extensible.
28
+ </p>
29
+ </div>
30
+
31
+ <div type="expander" caption="Changing Content via Simple Assignments">
32
+ <p>
33
+ You change content by assigning values to properties, or by running methods.
34
+ </p>
35
+ <pre>
36
+ panel.title = 'My new title';
37
+ panel.add({
38
+ ntype: button,
39
+ text: 'Button
40
+ });
41
+ </pre>
42
+ </p>
43
+ </div>
44
+
45
+ <div type="expander" caption="Shared, Bindable, Data">
46
+ <p>Data can be shared within the view hierarchy via _view models_.</p>
47
+ <p>The view model data can also be _bound_ to properties.</p>
48
+ </pre>
49
+ </div>
50
+
51
+ <div type="expander" caption="Events">
52
+ <p>
53
+ All Neo objects are _observable_, and thus, can fire events.
54
+ </p>
55
+ <p>
56
+ Your code _listens_ to those events via `listeners` config. (You can also add listeners procedurally.)
57
+ </p>
58
+ </div>
59
+
60
+ <div type="expander" caption="Debugging">
61
+ <p>
62
+ It's easy to get component references in the browser's debugger. And since updating Neo classes is
63
+ as easy as assigning values to properties, you can easily inspect, update, debug, and otherwise
64
+ exercise your application when debugging.
65
+ </p>
66
+ </div>
@@ -0,0 +1,29 @@
1
+ In English there's an expression: _don't lose the forest for the trees_.
2
+
3
+ <div type="expander" caption="">
4
+ <table>
5
+ <tr>
6
+ <th style="text-align: center; background-color: #eeeeee">Forest</th>
7
+ <th>&nbsp;</th>
8
+ <th style="text-align: center; background-color: #eeeeee">Trees</th>
9
+ </tr>
10
+ <tr><td>&nbsp;</td></tr>
11
+ <tr>
12
+ <td style="text-align: center;">
13
+ <img src="resources/images/MortonArboretumForest.jpg" width="400" />
14
+ </td>
15
+ <td>&nbsp;</td>
16
+ <td style="text-align: center;">
17
+ <img src="resources/images/MortonArboretumTrees.jpg" width="400" />
18
+ </td></tr>
19
+
20
+ <tr><td>&nbsp;</td></tr>
21
+ <tr>
22
+ <td style="text-align:center; font-size: 2.5em;"><i style="color: blue;">Ah, I see.</i></td>
23
+ <td/>
24
+ <td style="text-align:center; font-size: 2.5em;"><i style="color: blue;">I'm lost!</i></td>
25
+ </tr>
26
+ </table></div>
27
+
28
+
29
+ For now, just focus on high-level concepts, and don't worry about the details.
@@ -0,0 +1,14 @@
1
+ The button `handler` config is convenience syntax for adding a click listener.
2
+
3
+
4
+ {
5
+ ntype: 'button',
6
+ text: 'Hi',
7
+ listeners: {
8
+ click: data => alert('Hi!')
9
+ }
10
+ }, {
11
+ ntype: 'button',
12
+ text: 'Yo',
13
+ handler: data => alert('Yo!')
14
+ }
@@ -0,0 +1,5 @@
1
+ The `Neo.data.Model` config describes the records.
2
+
3
+ As with any other Neo class, you're free to define your
4
+ own `Neo.data.Model` sub-class in cases when you need
5
+ to reuse the record configuration.
@@ -0,0 +1,5 @@
1
+ Stores are a collection of records.
2
+
3
+ Stores have a `model` config which configures a `Neo.data.Model`.
4
+
5
+ The `Neo.data.Model` describes the records that will populate the store.
@@ -0,0 +1,13 @@
1
+ - `autoLoad:true` &mdash; runs the specified URL at time of creation
2
+
3
+
4
+ - `load({})`
5
+
6
+
7
+ The load method takes a parameter optionally used to specify:
8
+
9
+ - _url_
10
+ - _params_
11
+ - _headers_
12
+ - _method_
13
+ - _responseType_
@@ -0,0 +1,18 @@
1
+ Neo stores can be configured with an array of `Neo.collection.Sorter`.
2
+
3
+ {
4
+ ntype: 'store',
5
+ sorters: [{
6
+ property: 'prop',
7
+ direction: 'ASC' // Anything else is descending
8
+ }]
9
+ }
10
+
11
+
12
+
13
+ {
14
+ ntype: 'store',
15
+ sorters: [{
16
+ sortBy: (a, b) => // Quicksort return value -1, 0, 1
17
+ }]
18
+ }
@@ -0,0 +1,9 @@
1
+ Stores have a few ways to find records:
2
+
3
+ - `store.find(property, value); // [record]`
4
+
5
+
6
+ - `store.findBy((rec=>rec.property === value)); // [record]`
7
+
8
+
9
+ - `store.map[id]; // record`
@@ -0,0 +1,20 @@
1
+ Under the covers, Neo uses the singleton `Neo.RecordFactory` to create
2
+ the records in a store.
3
+
4
+
5
+ <div class="expander" caption="Records">
6
+ <p>
7
+ A store's records are `Record` instances, which use a
8
+ dynanically-created class that has get/set properties
9
+ for every field in defined in the store's `Neo.data.Model`.
10
+ Field changes are automatically communicated to the store.
11
+ </p>
12
+ </div>
13
+
14
+ <div class="expander" caption="Setting values">
15
+ <p>
16
+ Records have a `set()` and `setSilent()` methods that let you set
17
+ multiple field values at once. (If you only need to change one
18
+ you'd just assign a value directly to the property.)
19
+ </p>
20
+ </div>
@@ -0,0 +1,2 @@
1
+ A toolbar is a container that manages its layout, and adds some css classes
2
+ to make it easier to style its items.
@@ -0,0 +1,5 @@
1
+ - `text`
2
+ - `badge`
3
+ - `badgePosition:string` // top-right (default), bottom-right, bottom-left, top-left
4
+
5
+ - `handler: string|fn` // The name of a controller function or a function
@@ -0,0 +1,3 @@
1
+ There are also some methods relating to sorting:
2
+
3
+ - `store.doSort()
@@ -0,0 +1,10 @@
1
+ Neo UI code is written using JavaScript _modules_ — `.msj` files.
2
+
3
+ That's the file type for JavaScript that uses the class system,
4
+ along with the ability to hide and share information via _import_
5
+ and _export_.
6
+
7
+ Neo code is _declarative_, where the code describes high-level
8
+ things like _stores_, _panels_ or _tables_, without having to
9
+ worry about how those are rendered in HTML.
10
+
@@ -0,0 +1,31 @@
1
+ #Introduction
2
+
3
+ In this lab, you'll generate a Neo.mjs workspace and run the starter app.
4
+
5
+ #Steps
6
+
7
+ <details>
8
+ <summary>Use the command-line to generate the workspace</summary>
9
+
10
+ Use a terminal window to navigate to some parent folder,
11
+ then run
12
+
13
+ npx neo-app@latest
14
+
15
+ You'll be propted for a workspace name, starter app name, etc &mdash; accept the default for everything.
16
+ As the command finishes it starts a server and opens a browser window.
17
+ </details>
18
+
19
+ <details>
20
+ <summary>Inspect the workspace</summary>
21
+
22
+ The workspace contains a local copy of the API docs, an `apps` directory (where your apps are found),
23
+ and some other directories.
24
+ </details>
25
+
26
+ <details>
27
+ <summary>Run the starter app</summary>
28
+
29
+ By default, an app named `myapp` was created. You can run it by entering the `apps` directory and
30
+ clicking `myapp`. It's a folder containing an `index.html` along with the source code for the app.
31
+ </details>