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,13 @@
1
+ ##ntype:'selectfield'
2
+
3
+ {
4
+ module: SelectField,
5
+ labelText: 'Select field',
6
+ store: {
7
+ data: [ { name: 'Munich', id: '9031' }, { name: 'Nuremberg', id: '6524' }, { name: 'Augsburg', id: '8456' }, { name: 'Regensburg', id: '5826' }, { name: 'Ingolstadt', id: '3492' } { name: 'Würzburg', id: '8892' } ]
8
+ },
9
+ listeners: {
10
+ select: data=>console.log('select', data),
11
+ change: data=>console.log('change', data)
12
+ }
13
+ }
@@ -0,0 +1,24 @@
1
+
2
+
3
+ | Config | Description |
4
+ | -------------- | --------------------------------------- |
5
+ | `store_` | The store providing the dropdown values |
6
+ | `displayField` | The record property displayed to the user |
7
+ | `valueField` | The record property reflected by `value` |
8
+ | `forceSelection` | `value` is only change via record selection |
9
+ | `triggerActions` | Dropdown shows _all_ or values _filtered_ by typed value. |
10
+
11
+ <br>
12
+
13
+ | Methods | Description |
14
+ | -------------- | --------------------------------------- |
15
+ | `selectListItem()` | Selects the specified record or record index |
16
+
17
+
18
+ <br>
19
+
20
+ | Events | Description |
21
+ | -------------- | --------------------------------------- |
22
+ | _change_ | Any change to the input field value |
23
+ | _select_ | The selected record |
24
+
@@ -0,0 +1,70 @@
1
+ #Introduction
2
+
3
+ In this lab you'll add a _business_ property to the businesses tab panel.
4
+
5
+ #Steps
6
+
7
+ ??Plan your work
8
+
9
+ The main view needs to detect when a business is selected, and pass that
10
+ value to the detail panel.
11
+
12
+ The map and table could detect business selection and update the detail
13
+ panel directly. But that would break principles of encapsulation and
14
+ coupling. A given view should have no knowledge of other views that
15
+ may be in the app, and only communicates to the app via property
16
+ binding and event handling.
17
+
18
+ The rule of thumb is that the container that creates views is responsible
19
+ for coordinating how information is passed between the views.
20
+
21
+ Following those guidelines, in Yelp we need to do a few things:
22
+
23
+ - Define a `business_` property on the tab panel class, along with an event
24
+ - Have the main view detect the business change event and pass the record to the detail panel
25
+
26
+ ??Add `business` as a tab panel property
27
+
28
+ Add a `business_:null` config property to `Yelp.view.businesses.Tabs`.
29
+
30
+ Add an `afterSetBusiness(business)` method that logs the business.
31
+
32
+ You can test this by saving, refreshing, then on the console update the property.
33
+
34
+ Neo.findFirst({ntype: 'yelp-businesses-tabs'}).business = {name: 'Some business'}
35
+
36
+ You should see the data being logged.
37
+
38
+
39
+ ??Detect changes to the map selection
40
+
41
+ Set up an event handler to detect the map's _markerChange_ event.
42
+
43
+ listeners: {
44
+ markerClick: data => data.data.component
45
+ .up({ntype: 'yelp-businesses-tabs'}).business = data.data.record
46
+ }
47
+
48
+ Save and refresh, then verify that as you click on map markers the
49
+ corresponding record is being logged.
50
+
51
+ ??Fire a _businessChange_ event
52
+
53
+ Update the `afterSetBusiness` method to fire the event. Note the
54
+ addition of the first statement that ignores empty values. We don't
55
+ need the `console.log` statement any more.
56
+
57
+ afterSetBusiness (business){
58
+ if (!business) return;
59
+ this.fire('businessChange', {component: this, business});
60
+ }
61
+
62
+
63
+ ??Detect the event in the main view
64
+
65
+ Add an `onBusinessChange` event handler in the main view. It should log the business.
66
+
67
+ Then in the main view, configure the _businessChange_ listener to use that handler.
68
+
69
+ Save and refresh. As you choose map markers you should see the log emanating from
70
+ the main view controller.
@@ -0,0 +1,195 @@
1
+ #Introduction
2
+
3
+ In this lab you'll change the detail view to be a tab panel,
4
+ then use the `vdom` property to render content.
5
+
6
+ #Steps
7
+
8
+ ??Change the details container to be a tab container
9
+
10
+ Import `src/tab/Container.mjs` and Import `src/component/Base.mjs`.
11
+
12
+ Change the view to extend tab container.
13
+
14
+ Code an items array. Since we'll be needing references to the
15
+ two items, each has a `reference`. Note the `vdom` and padding
16
+ on the first item. You'll be dynamically updating the vdom
17
+ in the `afterSetBusiness()` method.
18
+
19
+ items: [{
20
+ module: Component,
21
+ reference: 'view',
22
+ tabButtonConfig: {
23
+ text: 'View'
24
+ },
25
+ style: {
26
+ padding: '8px'
27
+ },
28
+ vdom: {
29
+ cn: [{
30
+ tag: 'h2',
31
+ innerHTML: 'foo'
32
+ }]
33
+ }
34
+ }, {
35
+ reference: 'form',
36
+ tabButtonConfig: {
37
+ text: 'Edit'
38
+ }
39
+ }]
40
+
41
+ Save and refresh, and you should see the _foo_ in the detail container.
42
+
43
+ ??Update the field when a record is set
44
+
45
+ Change the detail view's `afterSetBusiness()` method to update the `vdom`.
46
+
47
+ afterSetBusiness(business){
48
+ if (!business) return;
49
+ const view = this.getReference('view');
50
+ view.vdom.cn[0].innerHTML = business.title;
51
+ view.update();
52
+ }
53
+
54
+ <b>Important: </b>The `update()` method tells Neo to apply vdom changes to the DOM.
55
+ Any time you change a set of vdom properties you need to run `update()`.
56
+
57
+ You don't need the first item's `innerHTML:'foo'` property any more, so you can
58
+ remove that from the first item's config.
59
+
60
+ Save, refresh, and confirm that the title is shown as the business is set.
61
+
62
+ ??Use a convenience function
63
+
64
+ Neo has a convenience method that lets you abstract the vdom a little.
65
+
66
+ Edit the detail view's first item, and add a `id` to the element showing the title.
67
+
68
+ vdom: {
69
+ cn: [{
70
+ tag: 'h2',
71
+ id: 'title'
72
+ }]
73
+ }
74
+
75
+ The util method lets you find the node using the id (or using a more complex selector).
76
+ Use the utility method, replacing the statement referencing the vdom hierarchy.
77
+
78
+ <pre>
79
+ <s>view.vdom.cn[0].innerHTML = business.title;</s>
80
+ Neo.util.VDom.findVdomChild(view.vdom, 'title').vdom.innerHTML = business.title;
81
+ </pre>
82
+
83
+
84
+ We'll be updating several vdom nodes, so we can create a more convenient way of
85
+ calling the function.
86
+
87
+ Code a new class member.
88
+
89
+ findVdomChild = Neo.util.VDom.findVdomChild
90
+
91
+ Then use it in the after set method. Here's how that part of the code will look afterwards.
92
+
93
+ <pre style="color:gray; padding: 8px; border: thin solid lightgray;">
94
+ findVdomChild = Neo.util.VDom.findVdomChild;
95
+
96
+ afterSetBusiness(business){
97
+ if (!business) return;
98
+ const view = this.getReference('view');
99
+ this.findVdomChild(view.vdom, 'title').vdom.innerHTML = business.title;
100
+ view.update();
101
+ }
102
+ </pre>
103
+
104
+ ??Add the thumbnail
105
+
106
+ The Yelp businesses store doesn't have a field value for the image. Add this
107
+ to the main view model _businesses_ store `fields:[]`.
108
+
109
+ {
110
+ name: 'imageUrl',
111
+ mapping: 'image_url'
112
+ }
113
+
114
+ Then back in the details view, update the vdom as follows.
115
+
116
+ vdom: {
117
+ tag: 'div',
118
+ cn: [{
119
+ tag: 'h2',
120
+ id: 'title'
121
+ }, {
122
+ tag: 'img',
123
+ id: 'thumbnail',
124
+ style: {
125
+ width: '100%'
126
+ }
127
+ }]
128
+ }
129
+
130
+ Then modify the `afterSetBusiness()` method to update the element's `src`.
131
+
132
+ this.findVdomChild(view.vdom, 'thumbnail').vdom.src = business.imageUrl;
133
+
134
+ ??Add the address
135
+
136
+ Depending on how you left the store's `address` config, you may need to change two things.
137
+
138
+ First, in the businesses store config and make sure the address field is defined like this.
139
+
140
+ {
141
+ name: 'address',
142
+ mapping: 'location.display_address'
143
+ },
144
+
145
+ Second, look at the address column in the table and make sure it uses a renderer.
146
+
147
+ {
148
+ text: 'Address',
149
+ dataField: 'address',
150
+ renderer: data => data.value.join(', ')
151
+ }
152
+
153
+ Now edit the details view and a `vdom` child element between the _h2_ and the _img_ to
154
+ be a div that shows the address.
155
+
156
+ vdom: {
157
+ tag: 'div',
158
+ cn: [{
159
+ tag: 'h2',
160
+ id: 'title'
161
+ }, {
162
+ tag: 'div',
163
+ id: 'address',
164
+ cn: []
165
+ }, {
166
+ tag: 'img',
167
+ id: 'thumbnail',
168
+ style: {
169
+ width: '100%' // It would be better to do this via css
170
+ }
171
+ }]
172
+ }
173
+
174
+ Then modify the `afterSetBusiness()` method to update the _address_ element's
175
+ `cn` to be an array of items, one per item in the address array. Each item should
176
+ be a _div_ with its `innerHTML` set to that part of the address.
177
+
178
+ Hint: The business record's `address` property is an array, and the `cn` is
179
+ also an array. Maybe there's a easy way to map the address array into a new
180
+ array you assign to `cn`? How would you code it? Give it a few minutes
181
+ of thought and try it. If you get stuck, that code is given in the next lab step.
182
+
183
+ ??Here's the code for showing the address
184
+
185
+ Here's one way to code it. How does this compare to your solution?
186
+
187
+ this.findVdomChild(view.vdom, 'address').vdom.cn = business
188
+ .address
189
+ .map(item => ({tag: 'div', innerHTML: item}));
190
+
191
+ ??One last point...
192
+
193
+ The view tab will become more and more complicated as we add content.
194
+ It should be refactored into its own view class to isolate that complexity.
195
+ We won't bother, but on a project that would be the right thing to do.
@@ -0,0 +1,92 @@
1
+ #Introduction
2
+
3
+ In this lab you'll add the form as the second tab.
4
+
5
+ #Steps
6
+
7
+ ??Make the second tab a form
8
+
9
+ You'll add a <b>Save</b> button, and in the handler log the contents
10
+ of the form. This simulates the set of data you'd send to the back-end.
11
+
12
+ Import `src/form/Container.mjs`, and use it as the second item.
13
+
14
+ Configure the form to use vbox, along with some other configs.
15
+
16
+ {
17
+ module: Form,
18
+ reference: 'form',
19
+ tabButtonConfig: {
20
+ text: 'Edit'
21
+ },
22
+ style: {
23
+ padding: '8px'
24
+ },
25
+ itemDefaults: {
26
+ labelWidth: 80,
27
+ flex: 'none'
28
+ },
29
+ layout: {
30
+ ntype: 'vbox',
31
+ pack: 'start',
32
+ align: 'stretch'
33
+ },
34
+ items: []
35
+ }
36
+
37
+ ??Add two fields
38
+
39
+ Add two fields to the `items:[]`.
40
+
41
+ Add a text field. You'll need to import `src/form/field/Text.mjs` and
42
+ use that module. Configure the field with `labelText:'Name'`
43
+ and `name:'name'`.
44
+
45
+ Add a number field. You'll need to import `src/form/field/Number.mjs`
46
+ and use that module. Configure the field with `labelText:'Rating'`,
47
+ `name:'rating'`,
48
+ along with `minValue:1`, `maxValue:5`, and `stepSize:0.5`.
49
+
50
+ The `name` config isn't required, but it makes it easier to
51
+ initialize, as you'll see in the next step.
52
+
53
+ ??Initialize the form with values from the record
54
+
55
+ In the `afterSetBusiness()` method add code to update the form with
56
+ values from the record.
57
+
58
+ const form = this.getReference('form');
59
+ form.setValues({
60
+ name: business.title,
61
+ rating: business.rating
62
+ });
63
+
64
+ If you save and refresh, then choose businesses, you should see the
65
+ form updating to reflect the selected record.
66
+
67
+ ??Add a <b>Save</b> button
68
+
69
+ Add _two_ new items to the form's `items:[]`. One to take up available
70
+ room at the bottom of the form, and the other a save button.
71
+
72
+ {
73
+ flex: 1
74
+ }, {
75
+ module: Button,
76
+ text: 'Save',
77
+ handler: data => data.component.up({ntype: 'yelp-business-details'}).onSaveClick()
78
+ }
79
+
80
+ As you can see, the button calls an `onSaveClick()` event. Add that as a new member
81
+ of the view, and log the values in the form.
82
+
83
+ onSaveClick() {
84
+ const form = this.getReference('form');
85
+ form.getValues().then(data => {
86
+ console.log(data);
87
+ // Send the data to the back-end.
88
+ });
89
+ }
90
+
91
+ Note that in a real-world app you _might_ code a couple of events in the view, but
92
+ beyond a trivial view, you'll create a view controller and put those events there!
@@ -0,0 +1,60 @@
1
+ #Introduction
2
+
3
+ In this lab you'll create the details container.
4
+
5
+ #Steps
6
+
7
+ ??Plan your work
8
+
9
+ The detail component you're creating in this lab will show details about the selected
10
+ business.
11
+
12
+ Conceptually, the details view "reflects details for the specified business,"
13
+ so you'll set it up with a _business_ property, just like you did for the tab container.
14
+ Main will detect the _businessChange_ event, then pass the business to the details
15
+ view by assigning the business record to the detail view's property.
16
+
17
+ The details view will be contained within the main container, off to the right. We have a
18
+ choice about how to lay things out: we could have main arrange its items via _hbox_ layout,
19
+ with two items in its `items:[]` &mdash; the tab container and the details view &mdash;
20
+ or we could make the details view another docked item, docked on the right. We'll do the latter.
21
+
22
+ Main already listens to the _businessChange_ event. You'll modify that code to have it pass the
23
+ business to the details view you're creating in this lab.
24
+
25
+ ??Create the panel
26
+
27
+ Use the `create-class` script to create a class named `Yelp.view.business.Details`
28
+ that extends `container.Base`.
29
+
30
+ Add a `ntype:'yelp-business-details',` config to the new class. We can use
31
+ that when we create an instance in the main view, and it might come in handy
32
+ when debugging.
33
+
34
+ ??Create a <kbd>business_</kbd> property
35
+
36
+ Continue editing `business/Details.mjs` and create a <kbd>business_:null,</kbd>
37
+ property, and a corresponding `afterSetBusiness(business)` method that logs
38
+ the passed business.
39
+
40
+ ??Use the class in the main view
41
+
42
+ Import the new details view, and modify the corresponding entry in the `items:[]`
43
+ to create the details view. Configure it with `reference: 'details'`.
44
+
45
+ ??Update the business as the user selects items on the map
46
+
47
+ The main view controller is detecting changes to the business
48
+ from the tabs view. Modify that code to pass the information onto the details
49
+ view.
50
+
51
+ onBusinessChange(business){
52
+ this.getReference('details').business = business;
53
+ }
54
+
55
+ Note that the code no longer needs the console log it had, so we'll
56
+ delete it to avoid consusion with the console log in the details view.
57
+
58
+ Save and refresh, and and as you choose map markers you should
59
+ see the log emanating from the details view.
60
+
@@ -0,0 +1,9 @@
1
+
2
+
3
+ {
4
+ module: NumberField,
5
+ labelText: 'Rating',
6
+ maxValue: 5,
7
+ minValue: 1,
8
+ stepSize: 0.5
9
+ }
@@ -0,0 +1,8 @@
1
+ I'm too lazy to do anything that isn't extremely easy. So even typing `Neo.findFirst({... `
2
+ is a burden.
3
+
4
+ What's easier is just clicking on a component, and instantly logging the component and its
5
+ containment hierarchy.
6
+
7
+ But a regular click is too commonly used for things like buttons,
8
+ so we'll choose something more uncommon &mdash; _Ctrl-right-click_.
@@ -0,0 +1,7 @@
1
+ 1. Put the event code in `index.html`
2
+ 1. Copy the code and paste the Neo.mjs method to `MainContainer.mjs`
3
+ 2. Refresh the app
4
+ 1. Ctrl-right-click on one of the tab buttons &mdash; the component and hierarchy is logged
5
+
6
+ If you need one of those references in a variable &mdash; for example, to run a method on it &mdash;right-click on the component logged in the console and choose _Store object as global variable_.
7
+ (Make sure you are viewing the app worker context, or _Store object as global variable_ won't work.)
@@ -0,0 +1,40 @@
1
+ A _right-click_ fires the _contextmenu_ event.
2
+
3
+ Somewhere, somehow, we need to have the main thread add a DOM event that
4
+ listens to _contextmenu_, detect if _Ctrl_ is being pressed, then let
5
+ our Neo app know.
6
+
7
+ We could put the code that does that in a bookmarklet, but then we'd have to re-run
8
+ it every time the browser refreshes. Instead, we'll put that code in `index.html`.
9
+
10
+ <pre class="runnable html">
11
+ &lt;!DOCTYPE HTML>
12
+ &lt;html>
13
+ &lt;head>
14
+ &lt;meta name="viewport" content="width=device-width, initial-scale=1">
15
+ &lt;meta charset="UTF-8">
16
+ &lt;title>Starter&lt;/title>
17
+ &lt;/head>
18
+ &lt;body>
19
+ &lt;script src="../../src/MicroLoader.mjs" type="module">&lt;/script>
20
+ &lt;script>
21
+ new MutationObserver((mutationsList, observer) => {
22
+ for (let mutation of mutationsList) {
23
+ for (let addedNode of mutation.addedNodes) {
24
+ if (addedNode.className && addedNode.className.includes('neo-viewport')) {
25
+ addedNode.addEventListener("contextmenu", function (e) {
26
+ if (!(e.ctrlKey || e.metaKey)) return;
27
+ e.stopPropagation();
28
+ e.preventDefault();
29
+ const event = new Event('neo-debug-item-select', {bubbles: true});
30
+ e.target.dispatchEvent(event);
31
+ });
32
+ observer.disconnect(); // We found the viewport so we're finished listening
33
+ }
34
+ }
35
+ }
36
+ }).observe(document.body, {childList: true, subtree: false});
37
+ &lt;/script>
38
+ &lt;/body>
39
+ &lt;/html>
40
+ </pre>
@@ -0,0 +1,16 @@
1
+ Here's the corresponding method that listens to the custom event. You place this in your main view.
2
+
3
+ <pre class="runnable text readonly 280">
4
+ afterSetMounted(value, oldValue) {
5
+ super.afterSetMounted(value, oldValue);
6
+ if (!value) return;
7
+ this.addDomListeners({
8
+ "neo-debug-item-select": event => {
9
+ event.path.forEach(item => {
10
+ const component = Neo.getComponent(item.id);
11
+ if (component) console.log(component);
12
+ });
13
+ }
14
+ });
15
+ }
16
+ </pre>
@@ -0,0 +1,4 @@
1
+ To do this we need two pieces:
2
+ - Main thread code to detect a mouse event and fire a custom event
3
+ - Neo.mjs code to detect the custom event and <code>console.log()</code> the component and its containment hierarchy
4
+
@@ -0,0 +1,5 @@
1
+ A few key concepts we'll be discussing:
2
+ - Class-based coding
3
+ - Component (view) models
4
+ - Events
5
+ - Controllers