neo.mjs 6.9.10 → 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.
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/learnneo/neo-config.json +5 -1
- package/apps/learnneo/store/Content.mjs +1 -1
- package/apps/learnneo/view/Viewport.mjs +12 -1
- package/apps/learnneo/view/home/ContentTreeList.mjs +8 -5
- package/apps/learnneo/view/home/ContentView.mjs +60 -0
- package/apps/learnneo/view/home/MainContainer.mjs +22 -14
- package/apps/learnneo/view/home/MainContainerController.mjs +57 -18
- package/apps/newwebsite/app.mjs +6 -0
- package/apps/newwebsite/index.html +10 -0
- package/apps/newwebsite/neo-config.json +7 -0
- package/apps/newwebsite/view/MainContainer.mjs +59 -0
- package/buildScripts/webpack/json/myApps.template.json +1 -0
- package/examples/ConfigurationViewport.mjs +12 -9
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/button/base/neo-config.json +1 -2
- package/package.json +2 -2
- package/resources/data/{learnneo → deck/learnneo}/p/2023-10-01T18-29-19-158Z.md +3 -6
- package/resources/data/deck/learnneo/p/stylesheet.md +40 -0
- package/resources/data/{learnneo → deck/learnneo}/t.json +19 -2
- package/resources/data/deck/training/p/2022-12-27T21-54-52-300Z.md +11 -0
- package/resources/data/deck/training/p/2022-12-27T21-55-23-144Z.md +43 -0
- package/resources/data/deck/training/p/2022-12-27T21-55-30-948Z.md +1 -0
- package/resources/data/deck/training/p/2022-12-27T21-55-43-542Z.md +84 -0
- package/resources/data/deck/training/p/2022-12-27T22-23-55-083Z.md +1 -0
- package/resources/data/deck/training/p/2022-12-27T22-24-07-886Z.md +8 -0
- package/resources/data/deck/training/p/2022-12-27T22-24-52-295Z.md +8 -0
- package/resources/data/deck/training/p/2022-12-27T22-25-03-853Z.md +5 -0
- package/resources/data/deck/training/p/2022-12-27T22-43-58-924Z.md +10 -0
- package/resources/data/deck/training/p/2022-12-27T22-44-28-881Z.md +3 -0
- package/resources/data/deck/training/p/2022-12-27T22-44-41-791Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-27T22-45-21-032Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-27T22-49-22-078Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-27T22-50-20-626Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-28T16-58-47-786Z.md +0 -0
- package/resources/data/deck/training/p/2022-12-28T16-58-55-192Z.md +9 -0
- package/resources/data/deck/training/p/2022-12-28T17-10-18-058Z.md +15 -0
- package/resources/data/deck/training/p/2022-12-28T17-10-42-296Z.md +40 -0
- package/resources/data/deck/training/p/2022-12-28T17-11-34-653Z.md +41 -0
- package/resources/data/deck/training/p/2022-12-28T17-13-09-994Z.md +0 -0
- package/resources/data/deck/training/p/2022-12-28T21-32-14-420Z.md +0 -0
- package/resources/data/deck/training/p/2022-12-29T01-43-32-431Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T15-56-54-485Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T15-57-11-499Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T16-00-13-223Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T18-34-25-826Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-29T18-36-08-226Z.md +106 -0
- package/resources/data/deck/training/p/2022-12-29T18-36-56-893Z.md +112 -0
- package/resources/data/deck/training/p/2022-12-29T19-31-30-507Z.md +31 -0
- package/resources/data/deck/training/p/2022-12-29T19-31-55-091Z.md +14 -0
- package/resources/data/deck/training/p/2022-12-29T20-03-42-628Z.md +9 -0
- package/resources/data/deck/training/p/2022-12-29T20-21-20-669Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-29T20-37-08-919Z.md +46 -0
- package/resources/data/deck/training/p/2022-12-29T20-37-20-344Z.md +43 -0
- package/resources/data/deck/training/p/2022-12-30T19-04-30-990Z.md +8 -0
- package/resources/data/deck/training/p/2022-12-31T18-43-56-338Z.md +7 -0
- package/resources/data/deck/training/p/2022-12-31T18-51-50-682Z.md +1 -0
- package/resources/data/deck/training/p/2022-12-31T18-54-04-176Z.md +4 -0
- package/resources/data/deck/training/p/2022-12-31T22-11-55-555Z.md +112 -0
- package/resources/data/deck/training/p/2022-12-31T23-00-41-222Z.md +6 -0
- package/resources/data/deck/training/p/2022-12-31T23-18-55-655Z.md +69 -0
- package/resources/data/deck/training/p/2022-12-31T23-25-40-735Z.md +21 -0
- package/resources/data/deck/training/p/2022-12-31T23-25-51-014Z.md +7 -0
- package/resources/data/deck/training/p/2023-01-01T17-49-18-429Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-01T18-44-07-034Z.md +34 -0
- package/resources/data/deck/training/p/2023-01-01T18-47-39-766Z.md +15 -0
- package/resources/data/deck/training/p/2023-01-01T19-04-22-830Z.md +4 -0
- package/resources/data/deck/training/p/2023-01-01T21-11-58-025Z.md +25 -0
- package/resources/data/deck/training/p/2023-01-01T21-12-37-340Z.md +23 -0
- package/resources/data/deck/training/p/2023-01-01T21-13-13-880Z.md +8 -0
- package/resources/data/deck/training/p/2023-01-01T21-14-45-740Z.md +98 -0
- package/resources/data/deck/training/p/2023-01-01T21-18-23-886Z.md +26 -0
- package/resources/data/deck/training/p/2023-01-01T21-18-31-316Z.md +19 -0
- package/resources/data/deck/training/p/2023-01-01T21-18-42-290Z.md +23 -0
- package/resources/data/deck/training/p/2023-01-01T21-19-57-020Z.md +24 -0
- package/resources/data/deck/training/p/2023-01-01T21-22-31-184Z.md +13 -0
- package/resources/data/deck/training/p/2023-01-01T21-22-38-317Z.md +17 -0
- package/resources/data/deck/training/p/2023-01-01T21-22-47-693Z.md +20 -0
- package/resources/data/deck/training/p/2023-01-01T21-23-17-716Z.md +39 -0
- package/resources/data/deck/training/p/2023-01-01T21-23-28-532Z.md +22 -0
- package/resources/data/deck/training/p/2023-01-01T21-25-23-899Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-01T21-25-59-742Z.md +1 -0
- package/resources/data/deck/training/p/2023-01-01T21-26-53-748Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-01T23-38-42-863Z.md +2 -0
- package/resources/data/deck/training/p/2023-01-03T02-07-19-014Z.md +143 -0
- package/resources/data/deck/training/p/2023-01-04T01-52-23-454Z.md +76 -0
- package/resources/data/deck/training/p/2023-01-06T23-21-12-009Z.md +127 -0
- package/resources/data/deck/training/p/2023-01-06T23-21-31-685Z.md +81 -0
- package/resources/data/deck/training/p/2023-01-06T23-21-59-596Z.md +36 -0
- package/resources/data/deck/training/p/2023-01-06T23-34-13-897Z.md +87 -0
- package/resources/data/deck/training/p/2023-01-06T23-44-02-340Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-06T23-46-36-687Z.md +1 -0
- package/resources/data/deck/training/p/2023-01-06T23-46-45-783Z.md +33 -0
- package/resources/data/deck/training/p/2023-01-08T00-45-11-144Z.md +50 -0
- package/resources/data/deck/training/p/2023-01-08T01-06-31-267Z.md +41 -0
- package/resources/data/deck/training/p/2023-01-08T01-24-21-088Z.md +95 -0
- package/resources/data/deck/training/p/2023-01-08T01-25-12-557Z.md +11 -0
- package/resources/data/deck/training/p/2023-01-08T01-46-50-723Z.md +25 -0
- package/resources/data/deck/training/p/2023-01-08T02-09-07-802Z.md +18 -0
- package/resources/data/deck/training/p/2023-01-08T02-09-19-678Z.md +66 -0
- package/resources/data/deck/training/p/2023-01-08T02-11-26-333Z.md +29 -0
- package/resources/data/deck/training/p/2023-01-08T17-22-48-841Z.md +14 -0
- package/resources/data/deck/training/p/2023-01-08T20-46-11-806Z.md +5 -0
- package/resources/data/deck/training/p/2023-01-08T20-47-23-682Z.md +5 -0
- package/resources/data/deck/training/p/2023-01-08T20-47-32-064Z.md +13 -0
- package/resources/data/deck/training/p/2023-01-08T20-47-57-045Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-08T20-48-03-791Z.md +18 -0
- package/resources/data/deck/training/p/2023-01-08T20-48-32-466Z.md +9 -0
- package/resources/data/deck/training/p/2023-01-08T20-48-51-322Z.md +20 -0
- package/resources/data/deck/training/p/2023-01-08T20-49-52-741Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-08T20-52-03-556Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-08T20-57-36-333Z.md +2 -0
- package/resources/data/deck/training/p/2023-01-08T20-57-51-136Z.md +5 -0
- package/resources/data/deck/training/p/2023-01-09T00-07-37-951Z.md +0 -0
- package/resources/data/deck/training/p/2023-01-09T00-35-40-671Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-10T01-29-38-148Z.md +10 -0
- package/resources/data/deck/training/p/2023-01-10T01-43-12-166Z.md +31 -0
- package/resources/data/deck/training/p/2023-01-10T02-21-54-303Z.md +10 -0
- package/resources/data/deck/training/p/2023-01-12T01-50-54-617Z.md +74 -0
- package/resources/data/deck/training/p/2023-01-13T19-55-24-735Z.md +14 -0
- package/resources/data/deck/training/p/2023-01-13T20-08-27-068Z.md +28 -0
- package/resources/data/deck/training/p/2023-01-13T20-23-38-411Z.md +25 -0
- package/resources/data/deck/training/p/2023-01-13T20-37-06-267Z.md +13 -0
- package/resources/data/deck/training/p/2023-01-13T21-05-57-708Z.md +8 -0
- package/resources/data/deck/training/p/2023-01-13T21-48-17-258Z.md +20 -0
- package/resources/data/deck/training/p/2023-01-13T22-05-05-799Z.md +14 -0
- package/resources/data/deck/training/p/2023-01-13T22-08-30-863Z.md +17 -0
- package/resources/data/deck/training/p/2023-01-13T23-01-50-449Z.md +4 -0
- package/resources/data/deck/training/p/2023-01-14T00-33-05-958Z.md +62 -0
- package/resources/data/deck/training/p/2023-01-14T00-40-27-784Z.md +229 -0
- package/resources/data/deck/training/p/2023-01-14T00-41-59-081Z.md +153 -0
- package/resources/data/deck/training/p/2023-01-14T13-50-28-199Z.md +19 -0
- package/resources/data/deck/training/p/2023-01-14T13-59-20-275Z.md +6 -0
- package/resources/data/deck/training/p/2023-01-14T14-03-29-456Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-14T14-27-57-678Z.md +7 -0
- package/resources/data/deck/training/p/2023-01-14T17-30-18-228Z.md +33 -0
- package/resources/data/deck/training/p/2023-01-14T18-28-39-316Z.md +1 -0
- package/resources/data/deck/training/p/2023-01-14T18-28-44-115Z.md +4 -0
- package/resources/data/deck/training/p/2023-01-14T18-28-49-548Z.md +18 -0
- package/resources/data/deck/training/p/2023-01-14T18-40-13-758Z.md +10 -0
- package/resources/data/deck/training/p/2023-01-14T19-29-15-291Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-15T18-51-52-134Z.md +83 -0
- package/resources/data/deck/training/p/2023-01-15T20-03-30-073Z.md +11 -0
- package/resources/data/deck/training/p/2023-01-15T22-07-52-073Z.md +16 -0
- package/resources/data/deck/training/p/2023-01-15T22-22-13-517Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-15T22-28-57-508Z.md +131 -0
- package/resources/data/deck/training/p/2023-01-15T22-36-30-913Z.md +115 -0
- package/resources/data/deck/training/p/2023-01-16T16-03-40-770Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-16T20-21-56-859Z.md +5 -0
- package/resources/data/deck/training/p/2023-01-16T20-24-09-690Z.md +24 -0
- package/resources/data/deck/training/p/2023-01-20T12-51-22-646Z.md +21 -0
- package/resources/data/deck/training/p/2023-01-20T13-06-46-614Z.md +9 -0
- package/resources/data/deck/training/p/2023-01-20T13-08-51-600Z.md +7 -0
- package/resources/data/deck/training/p/2023-01-20T15-20-13-363Z.md +26 -0
- package/resources/data/deck/training/p/2023-01-20T15-34-58-813Z.md +75 -0
- package/resources/data/deck/training/p/2023-01-21T16-33-20-458Z.md +33 -0
- package/resources/data/deck/training/p/2023-01-21T16-45-28-263Z.md +28 -0
- package/resources/data/deck/training/p/2023-01-21T16-56-25-452Z.md +3 -0
- package/resources/data/deck/training/p/2023-01-21T17-28-31-493Z.md +6 -0
- package/resources/data/deck/training/p/2023-01-21T19-49-51-918Z.md +13 -0
- package/resources/data/deck/training/p/2023-01-21T20-08-24-452Z.md +15 -0
- package/resources/data/deck/training/p/2023-01-21T20-35-54-947Z.md +20 -0
- package/resources/data/deck/training/p/2023-01-21T20-54-47-603Z.md +39 -0
- package/resources/data/deck/training/p/2023-01-21T20-56-28-184Z.md +25 -0
- package/resources/data/deck/training/p/2023-01-21T20-57-32-927Z.md +4 -0
- package/resources/data/deck/training/p/2023-01-21T23-13-33-394Z.md +6 -0
- package/resources/data/deck/training/p/2023-01-28T19-11-37-464Z.md +24 -0
- package/resources/data/deck/training/p/2023-01-28T20-43-41-188Z.md +9 -0
- package/resources/data/deck/training/p/2023-01-28T20-53-56-476Z.md +8 -0
- package/resources/data/deck/training/p/2023-01-28T20-58-43-776Z.md +10 -0
- package/resources/data/deck/training/p/2023-01-28T22-18-41-259Z.md +33 -0
- package/resources/data/deck/training/p/2023-01-28T22-24-34-808Z.md +24 -0
- package/resources/data/deck/training/p/2023-01-29T16-25-24-528Z.md +44 -0
- package/resources/data/deck/training/p/2023-01-29T21-14-32-588Z.md +12 -0
- package/resources/data/deck/training/p/2023-01-31T19-24-53-504Z.md +8 -0
- package/resources/data/deck/training/p/2023-01-31T20-33-55-855Z.md +11 -0
- package/resources/data/deck/training/p/2023-01-31T20-34-30-261Z.md +7 -0
- package/resources/data/deck/training/p/2023-01-31T20-52-53-367Z.md +43 -0
- package/resources/data/deck/training/p/2023-02-04T15-18-35-682Z.md +20 -0
- package/resources/data/deck/training/p/2023-02-04T15-49-47-597Z.md +14 -0
- package/resources/data/deck/training/p/2023-02-04T18-58-57-808Z.md +1 -0
- package/resources/data/deck/training/p/2023-02-04T20-07-11-288Z.md +1 -0
- package/resources/data/deck/training/p/2023-02-04T20-09-50-169Z.md +1 -0
- package/resources/data/deck/training/p/2023-02-04T20-19-42-740Z.md +8 -0
- package/resources/data/deck/training/p/2023-02-04T20-23-56-013Z.md +12 -0
- package/resources/data/deck/training/p/2023-02-04T20-28-12-391Z.md +20 -0
- package/resources/data/deck/training/p/2023-02-05T00-20-32-554Z.md +16 -0
- package/resources/data/deck/training/p/2023-02-05T00-35-56-282Z.md +13 -0
- package/resources/data/deck/training/p/2023-02-05T15-36-57-182Z.md +24 -0
- package/resources/data/deck/training/p/2023-02-05T17-39-51-712Z.md +70 -0
- package/resources/data/deck/training/p/2023-02-05T17-44-53-815Z.md +195 -0
- package/resources/data/deck/training/p/2023-02-05T17-45-40-114Z.md +92 -0
- package/resources/data/deck/training/p/2023-02-05T18-12-14-489Z.md +60 -0
- package/resources/data/deck/training/p/2023-02-06T00-14-54-457Z.md +9 -0
- package/resources/data/deck/training/p/2023-06-28T18-03-14-313Z.md +8 -0
- package/resources/data/deck/training/p/2023-06-28T18-26-17-290Z.md +7 -0
- package/resources/data/deck/training/p/2023-06-28T21-16-24-034Z.md +40 -0
- package/resources/data/deck/training/p/2023-06-28T21-16-34-972Z.md +16 -0
- package/resources/data/deck/training/p/2023-06-28T21-28-28-379Z.md +4 -0
- package/resources/data/deck/training/p/2023-06-29T23-15-10-411Z.md +5 -0
- package/resources/data/deck/training/p/2023-07-01T15-42-45-193Z.md +433 -0
- package/resources/data/deck/training/p/2023-07-01T21-54-31-329Z.md +6 -0
- package/resources/data/deck/training/p/2023-07-02T16-14-06-970Z.md +14 -0
- package/resources/data/deck/training/p/2023-07-31T00-26-03-842Z.md +4 -0
- package/resources/data/deck/training/p/2023-07-31T00-31-51-933Z.md +10 -0
- package/resources/data/deck/training/p/2023-07-31T00-37-21-927Z.md +205 -0
- package/resources/data/deck/training/p/2023-10-01T18-29-19-158Z.md +76 -0
- package/resources/data/deck/training/p/2023-10-07T19-18-28-517Z.md +102 -0
- package/resources/data/deck/training/p/2023-10-08T20-20-07-934Z.md +75 -0
- package/resources/data/deck/training/p/2023-10-08T20-20-37-336Z.md +29 -0
- package/resources/data/deck/training/p/2023-10-08T20-37-30-658Z.md +0 -0
- package/resources/data/deck/training/p/2023-10-08T21-58-25-809Z.md +68 -0
- package/resources/data/deck/training/p/2023-10-08T22-22-11-013Z.md +0 -0
- package/resources/data/deck/training/p/2023-10-14T19-25-08-153Z.md +119 -0
- package/resources/data/deck/training/t.json +1 -0
- package/resources/scss/src/apps/learnneo/home/{ContentComponent.scss → ContentView.scss} +9 -15
- package/resources/scss/theme-neo-light/Global.scss +46 -0
- package/resources/scss/theme-neo-light/design-tokens/Core.scss +7 -0
- package/resources/scss/theme-neo-light/design-tokens/Semantic.scss +0 -0
- package/resources/scss/theme-neo-light/design-tokens/_all.scss +4 -0
- package/src/DefaultConfig.mjs +4 -4
- package/src/form/field/Text.mjs +2 -2
- package/apps/learnneo/view/home/ContentComponent.mjs +0 -24
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-07T19-18-28-517Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T20-20-07-934Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T20-20-37-336Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T20-37-30-658Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T21-58-25-809Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-08T22-22-11-013Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/p/2023-10-14T19-25-08-153Z.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/pages/whyneo.md +0 -0
- /package/resources/data/{learnneo → deck/learnneo}/tree.json +0 -0
- /package/resources/{deck → data/deck}/whyneo.md +0 -0
- /package/resources/scss/src/apps/newwebsite/{MainContainer.css → MainContainer.scss} +0 -0
- /package/resources/scss/theme-neo-light/design-tokens/{Components.scss → Component.scss} +0 -0
@@ -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 — 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> </th>
|
8
|
+
<th style="text-align: center; background-color: #eeeeee">Trees</th>
|
9
|
+
</tr>
|
10
|
+
<tr><td> </td></tr>
|
11
|
+
<tr>
|
12
|
+
<td style="text-align: center;">
|
13
|
+
<img src="resources/images/MortonArboretumForest.jpg" width="400" />
|
14
|
+
</td>
|
15
|
+
<td> </td>
|
16
|
+
<td style="text-align: center;">
|
17
|
+
<img src="resources/images/MortonArboretumTrees.jpg" width="400" />
|
18
|
+
</td></tr>
|
19
|
+
|
20
|
+
<tr><td> </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.
|
File without changes
|
@@ -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,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>
|
File without changes
|
File without changes
|
File without changes
|
@@ -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 — 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>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<a href="" target="_blank">Here are some examples.</a>
|
2
|
+
|
3
|
+
|
4
|
+
(They don't demo as well while screen charing because the
|
5
|
+
meeting app will have its own frame rate.)
|
6
|
+
|
7
|
+
Run the the prod version of one of the demos, like
|
8
|
+
the <a href="https://neomjs.github.io/pages/node_modules/neo.mjs/dist/production/examples/component/coronaHelix/index.html" target="">COVID-19 Helix</a> example. Note the delta-updates per second information
|
9
|
+
at the upper right. You're seeing 10,000 or 20,000 delta updates per
|
10
|
+
second as you zoom in and out and pan.
|
@@ -0,0 +1,74 @@
|
|
1
|
+
#Introduction
|
2
|
+
|
3
|
+
In this lab you'll add the Google map.
|
4
|
+
|
5
|
+
#Steps
|
6
|
+
|
7
|
+
??Add the import
|
8
|
+
|
9
|
+
import GoogleMapsComponent from '../../../node_modules/neo.mjs/src/component/wrapper/GoogleMaps.mjs';
|
10
|
+
|
11
|
+
Save and refresh to make sure the import is working.
|
12
|
+
|
13
|
+
??Add the map to the main view
|
14
|
+
|
15
|
+
Add a second item to the main container's `items[]`
|
16
|
+
|
17
|
+
{
|
18
|
+
module: GoogleMapsComponent,
|
19
|
+
flex: 1,
|
20
|
+
center: {
|
21
|
+
lat: 64.8014187,
|
22
|
+
lng: -18.3096357
|
23
|
+
},
|
24
|
+
zoom: 6,
|
25
|
+
}
|
26
|
+
|
27
|
+
??Bind the store
|
28
|
+
|
29
|
+
The map component has a `markerStore` config. Add the code to bind that to
|
30
|
+
the store. This will be very similar to what you did for the table.
|
31
|
+
|
32
|
+
??Solution — don't peek
|
33
|
+
|
34
|
+
Here's the code, in case you need it.
|
35
|
+
|
36
|
+
<pre style="border: thin solid gray; padding: 8px; ">
|
37
|
+
import Viewport from '../../../node_modules/neo.mjs/src/container/Viewport.mjs';
|
38
|
+
import EarthquakesTable from './earthquakes/Table.mjs';
|
39
|
+
import ViewModel from './MainContainerViewModel.mjs';
|
40
|
+
import GoogleMapsComponent from '../../../../node_modules/neo.mjs/src/component/wrapper/GoogleMaps.mjs';
|
41
|
+
|
42
|
+
class MainContainer extends Viewport {
|
43
|
+
static getConfig() {
|
44
|
+
return {
|
45
|
+
className: 'Earthquakes.view.MainContainer',
|
46
|
+
layout: { ntype: 'vbox', align: 'stretch' },
|
47
|
+
autoMount: true,
|
48
|
+
model: {
|
49
|
+
module: ViewModel,
|
50
|
+
},
|
51
|
+
items: [{
|
52
|
+
module: EarthquakesTable,
|
53
|
+
flex: 1,
|
54
|
+
bind: {
|
55
|
+
store: 'stores.earthquakes'
|
56
|
+
}
|
57
|
+
}, {
|
58
|
+
module: GoogleMapsComponent,
|
59
|
+
flex: 1,
|
60
|
+
center: {
|
61
|
+
lat: 64.8014187,
|
62
|
+
lng: -18.3096357
|
63
|
+
},
|
64
|
+
zoom: 6,
|
65
|
+
}],
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
Neo.applyClassConfig(MainContainer);
|
71
|
+
|
72
|
+
export default MainContainer;
|
73
|
+
</pre>
|
74
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
<pre class="runnable readonly text 300">
|
3
|
+
/**
|
4
|
+
* The person's name. Null names are ignored.
|
5
|
+
* @member {String} name_=''
|
6
|
+
*/
|
7
|
+
name_: '',
|
8
|
+
|
9
|
+
...
|
10
|
+
|
11
|
+
beforeSetName(name, oldName){
|
12
|
+
return (name == null)?oldName:name; // null or undefined are ignored.
|
13
|
+
}
|
14
|
+
</pre>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<pre class="runnable readonly text 240">
|
2
|
+
/**
|
3
|
+
* The number of ducks
|
4
|
+
* @member {Integer} duckCount_=0
|
5
|
+
*/
|
6
|
+
duckCount_: 0,
|
7
|
+
|
8
|
+
...
|
9
|
+
|
10
|
+
beforeSetDuckCount(count){
|
11
|
+
return Math.round(count);
|
12
|
+
}
|
13
|
+
</pre>
|
14
|
+
|
15
|
+
<pre class="runnable readonly text 260">
|
16
|
+
/**
|
17
|
+
* Store holding
|
18
|
+
* @member {Store|Object}
|
19
|
+
*/
|
20
|
+
store_: null,
|
21
|
+
|
22
|
+
...
|
23
|
+
|
24
|
+
beforeSetStore(store){
|
25
|
+
// Utility method that returns store if it's a Store instance, or a Store if store is a config
|
26
|
+
return ClassSystem.beforeSetInstance(store, Store); store]
|
27
|
+
}
|
28
|
+
</pre>
|