neo.mjs 6.9.10 → 6.9.12
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/index.html +4 -3
- package/apps/learnneo/neo-config.json +2 -1
- package/apps/learnneo/store/Content.mjs +1 -1
- package/apps/learnneo/view/Viewport.mjs +18 -0
- package/apps/learnneo/view/ViewportController.mjs +2 -2
- package/apps/learnneo/view/home/ContentTreeList.mjs +22 -14
- package/apps/learnneo/view/home/ContentView.mjs +60 -0
- package/apps/learnneo/view/home/MainContainer.mjs +14 -6
- package/apps/learnneo/view/home/MainContainerController.mjs +57 -18
- package/apps/learnneo/view/home/MainContainerModel.mjs +3 -5
- package/apps/newwebsite/app.mjs +6 -0
- package/apps/newwebsite/index.html +13 -0
- package/apps/newwebsite/neo-config.json +7 -0
- package/apps/newwebsite/view/MainContainer.mjs +59 -0
- package/buildScripts/convertDesignTokens.mjs +173 -0
- package/buildScripts/webpack/json/myApps.template.json +1 -0
- package/examples/ConfigurationViewport.mjs +12 -9
- package/examples/ServiceWorker.mjs +2 -2
- package/package.json +3 -2
- package/resources/data/{learnneo → deck/learnneo}/p/2023-10-01T18-29-19-158Z.md +3 -6
- package/resources/data/deck/learnneo/p/2023-10-08T20-20-37-336Z.md +36 -0
- package/resources/data/deck/learnneo/p/stylesheet.md +58 -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-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 +1276 -0
- package/resources/design-tokens/json/component.json +288 -0
- package/resources/design-tokens/json/core.json +352 -0
- package/resources/design-tokens/json/semantic.json +231 -0
- package/resources/scss/src/apps/learnneo/Viewport.scss +3 -0
- package/resources/scss/src/apps/learnneo/home/ContentTreeList.scss +60 -13
- package/resources/scss/src/apps/learnneo/home/ContentView.scss +58 -0
- package/resources/scss/src/apps/newwebsite/MainContainer.scss +32 -0
- package/resources/scss/src/list/Base.scss +1 -1
- package/resources/scss/theme-neo-light/Global.scss +65 -1
- package/resources/scss/theme-neo-light/design-tokens/Component.scss +64 -0
- package/resources/scss/theme-neo-light/design-tokens/Core.scss +67 -0
- package/resources/scss/theme-neo-light/design-tokens/Semantic.scss +61 -0
- package/resources/scss/theme-neo-light/design-tokens/_all.scss +4 -0
- package/resources/scss/theme-neo-light/list/Base.scss +29 -6
- package/src/DefaultConfig.mjs +4 -4
- package/src/controller/Base.mjs +31 -23
- package/src/data/connection/Xhr.mjs +1 -1
- /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-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/data/{learnneo → deck/training}/p/2023-10-08T20-20-37-336Z.md +0 -0
- /package/resources/{deck → data/deck}/whyneo.md +0 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
#Introduction
|
2
|
+
|
3
|
+
In this lab, you'll refactor the app, making the table its own class, adding the map,
|
4
|
+
|
5
|
+
|
6
|
+
#Steps
|
7
|
+
|
8
|
+
??Move the table into its own class
|
9
|
+
|
10
|
+
Create a new file named `apps/earthquakes/view/earthquakes/Table.mjs` with this content.
|
11
|
+
|
12
|
+
<pre class="runnable text readonly">
|
13
|
+
import Base from '../../../../node_modules/neo.mjs/src/table/Container.mjs';
|
14
|
+
|
15
|
+
class Table extends Base {
|
16
|
+
static config = {
|
17
|
+
className: 'Earthquakes.view.earthquakes.Table',
|
18
|
+
ntype: 'earthquakes-table',
|
19
|
+
columns: [{
|
20
|
+
dataField: 'timestamp',
|
21
|
+
text: 'Date',
|
22
|
+
flex: 1,
|
23
|
+
renderer: data => data.value.toLocaleDateString(undefined, {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'})
|
24
|
+
}, {
|
25
|
+
dataField: 'humanReadableLocation',
|
26
|
+
text: 'Location',
|
27
|
+
flex: 1,
|
28
|
+
}, {
|
29
|
+
dataField: 'size',
|
30
|
+
text: 'Magnitude',
|
31
|
+
align: 'right',
|
32
|
+
flex: 1,
|
33
|
+
renderer: data => data.value.toLocaleString()
|
34
|
+
}]
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
Neo.applyClassConfig(Table);
|
39
|
+
export default Table;
|
40
|
+
</pre>
|
41
|
+
|
42
|
+
??Review the code
|
43
|
+
|
44
|
+
What's in the code?
|
45
|
+
|
46
|
+
- The class extends `Neo.table.Container`
|
47
|
+
- It has an `ntype`, which we can use when creating an instance, or when debugging
|
48
|
+
- Each column has `text` and `dataField` configs, and some have renderers
|
49
|
+
|
50
|
+
??Use the new component
|
51
|
+
|
52
|
+
Edit `apps/earthquakes/view/MainView` and look for the config block for the table.
|
53
|
+
|
54
|
+
- Import the new class: `import EarthquakesTable from './earthquakes/Table.mjs';`
|
55
|
+
- Replace the `module: Table` with `module: EarthquakesTable`
|
56
|
+
- Remove the `columns:[]` config
|
57
|
+
- Leave the `store` config alone
|
58
|
+
|
59
|
+
Save and refresh the browser, and your app should run as before.
|
60
|
+
|
61
|
+
You can confim that the new class _is being loaded_ by using DevTools to try to open `earthquakes/Table` — if it
|
62
|
+
was imported, it'll be listed.
|
63
|
+
|
64
|
+
You can conrim that an instance _was created_ by using the DevTools console and searching for it via
|
65
|
+
|
66
|
+
Neo.first('earthquakes-table')
|
67
|
+
|
68
|
+
That will return a component reference if there's a match.
|
69
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Neo comes with a Google maps wrapper. Its key properties are:
|
2
|
+
|
3
|
+
|
4
|
+
##center
|
5
|
+
|
6
|
+
{lat: 1.1234, lng:23.4456}
|
7
|
+
|
8
|
+
<br>
|
9
|
+
|
10
|
+
##markerStore
|
11
|
+
|
12
|
+
A store whose records contain
|
13
|
+
|
14
|
+
{title: 'String', location:{lat: 1.1234, lng:23.4456}}
|
15
|
+
|
16
|
+
<br>
|
17
|
+
|
18
|
+
|
19
|
+
##zoom
|
20
|
+
|
21
|
+
The Google Maps zoom level. It defaults to 8.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
`Neo.core.Base` is the Neo base class. It mixes in `Neo.core.Observable`.
|
2
|
+
This means all Neo classes have the ability to fire events or configure
|
3
|
+
event listeners.
|
4
|
+
|
5
|
+
The API docs have an _events_ section for each class.
|
6
|
+
|
7
|
+
Tables fire a _select_ event. Google Maps components fire a _markerClick_ event
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<pre class="runnable text readonly">
|
2
|
+
import Base from '../../../../node_modules/neo.mjs/src/table/Container.mjs';
|
3
|
+
|
4
|
+
class Table extends Base {
|
5
|
+
static config = {
|
6
|
+
className: 'Earthquakes.view.earthquakes.Table',
|
7
|
+
ntype: 'earthquakes-table',
|
8
|
+
columns: [{
|
9
|
+
dataField: 'timestamp',
|
10
|
+
text: 'Date',
|
11
|
+
flex: 1,
|
12
|
+
renderer: data => data.value.toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })
|
13
|
+
}, {
|
14
|
+
dataField: 'humanReadableLocation',
|
15
|
+
text: 'Location',
|
16
|
+
flex: 1,
|
17
|
+
}, {
|
18
|
+
dataField: 'size',
|
19
|
+
text: 'Magnitude',
|
20
|
+
align: 'right',
|
21
|
+
flex: 1,
|
22
|
+
// width: 100,
|
23
|
+
renderer: data => data.value.toLocaleString()
|
24
|
+
}]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
Neo.applyClassConfig(Table);
|
29
|
+
export default Table;
|
30
|
+
|
31
|
+
</pre>
|
32
|
+
|
33
|
+
Why isn't the store there? Because typically, the code _creating_ the table
|
34
|
+
is responsible for providing the store.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Let's enhance the app to use a Google Map to show where the earthquakes occurred.
|
2
|
+
|
3
|
+
<pre style="font-size:1.6em;">
|
4
|
+
import GoogleMapsComponent from '../../../node_modules/neo.mjs/src/component/wrapper/GoogleMaps.mjs';
|
5
|
+
...
|
6
|
+
{
|
7
|
+
module: GoogleMapsComponent,
|
8
|
+
flex: 1,
|
9
|
+
center: {
|
10
|
+
lat: 64.8014187,
|
11
|
+
lng: -18.3096357
|
12
|
+
},
|
13
|
+
zoom: 6,
|
14
|
+
}
|
15
|
+
</pre>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Configs can hold simple instance properties.
|
2
|
+
|
3
|
+
<pre class="runnable readonly text">
|
4
|
+
class Simple extends Base {
|
5
|
+
static config = {
|
6
|
+
className: 'Demo.view.component.Simple',
|
7
|
+
ntype: 'demo-simple-component',
|
8
|
+
|
9
|
+
foo: 1, // An instance field
|
10
|
+
|
11
|
+
}
|
12
|
+
}
|
13
|
+
...
|
14
|
+
items: [{
|
15
|
+
module: Simple
|
16
|
+
|
17
|
+
tabButtonConfig: {iconCls: 'fa fa-home', text: 'Simple'},
|
18
|
+
|
19
|
+
}, {
|
20
|
+
module: Simple
|
21
|
+
foo: 2, // This value is used for the instance
|
22
|
+
|
23
|
+
tabButtonConfig: {iconCls: 'fa fa-home', text: 'Simple'},
|
24
|
+
}],
|
25
|
+
</pre>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
You can create get/set properties by using the underscore suffix.
|
2
|
+
|
3
|
+
<pre class="runnable readonly text 300">
|
4
|
+
class Simple extends Base {
|
5
|
+
static getConfig() {
|
6
|
+
return {
|
7
|
+
className: 'Demo.view.component.Simple',
|
8
|
+
ntype: 'demo-simple-component',
|
9
|
+
|
10
|
+
foo: 1, // An instance field
|
11
|
+
|
12
|
+
bar_: null, // A get/set field with lifecycle hooks
|
13
|
+
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
</pre>
|
18
|
+
|
19
|
+
In the debugger console this shows up as a get/set property.
|
20
|
+
|
21
|
+
<pre style="color:gray;">
|
22
|
+
<span style="color:DarkOrchid">bar</span>: (...)
|
23
|
+
</pre>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
When you use the underscore suffix, Neo generates the get/set, and it also generates
|
2
|
+
lifecycle methods that let you intervene as the property is accessed or set.
|
3
|
+
|
4
|
+
For example, if you define the property `foo_`, Neo will generate these methods.
|
5
|
+
|
6
|
+
- `beforeSetFoo(value, oldValue)` — returns the value to be used for the set
|
7
|
+
- `afterSetFoo(value, oldValue)`
|
8
|
+
- `beforeGetFoo(value)` — returns a value
|
@@ -0,0 +1,98 @@
|
|
1
|
+
#Introduction
|
2
|
+
|
3
|
+
In this lab, you'll generate a starter app.
|
4
|
+
|
5
|
+
#Steps
|
6
|
+
|
7
|
+
<details>
|
8
|
+
<summary>Create the application</summary>
|
9
|
+
|
10
|
+
Use a terminal window to navigate to the root of your Neo workspace,
|
11
|
+
and run the following command. **Important:** Rather than taking all defaults, you _must_ choose the GoogleMaps option.
|
12
|
+
|
13
|
+
npm run create-app-training
|
14
|
+
|
15
|
+
Name the app `Yelp`.
|
16
|
+
|
17
|
+
If you run the app you'll get a runtime error telling you the api key is missing.
|
18
|
+
You add the API key in the next step.
|
19
|
+
|
20
|
+
Google Maps JavaScript API warning: NoApiKeys
|
21
|
+
|
22
|
+
??Add the Google Maps API key
|
23
|
+
|
24
|
+
Edit `apps/yelp/neo-config.json` and add an entry for _googleMapsApiKey_.
|
25
|
+
|
26
|
+
<pre style="color:lightgray;">
|
27
|
+
{
|
28
|
+
"appPath": "../../apps/yelp/app.mjs",
|
29
|
+
"basePath": "../../",
|
30
|
+
"environment": "development",
|
31
|
+
"mainPath": "../node_modules/neo.mjs/src/Main.mjs",
|
32
|
+
"mainThreadAddons": [
|
33
|
+
"DragDrop",
|
34
|
+
"GoogleMaps",
|
35
|
+
"Stylesheet"
|
36
|
+
],
|
37
|
+
<span style="font-weight:bold;color:limegreen">"googleMapsApiKey": "AIzaSyCRj-EPE3H7PCzZtYCmDzln6sj7uPCGohA",</span>
|
38
|
+
"workerBasePath": "../../node_modules/neo.mjs/src/worker/"
|
39
|
+
}
|
40
|
+
</pre>
|
41
|
+
|
42
|
+
Refresh your browser window and you should see the starter app without any warnings.
|
43
|
+
</details>
|
44
|
+
|
45
|
+
<details>
|
46
|
+
<summary>Change `MainView` to be a panel</summary>
|
47
|
+
|
48
|
+
Replace the entire contents of `MainView` with this code.
|
49
|
+
|
50
|
+
<pre class="runnable readonly text">
|
51
|
+
import Base from '../../../node_modules/neo.mjs/src/container/Panel.mjs';
|
52
|
+
import Controller from './MainViewController.mjs';
|
53
|
+
import ViewModel from './MainViewModel.mjs';
|
54
|
+
|
55
|
+
class MainView extends Base {
|
56
|
+
static config = {
|
57
|
+
className: 'Junk.view.MainView',
|
58
|
+
|
59
|
+
controller: {module: Controller},
|
60
|
+
model: {module: ViewModel},
|
61
|
+
|
62
|
+
headers: [{
|
63
|
+
dock: 'top',
|
64
|
+
html: 'banner'
|
65
|
+
}, {
|
66
|
+
dock: 'top',
|
67
|
+
html: 'filter'
|
68
|
+
}, {
|
69
|
+
dock: 'right',
|
70
|
+
html: 'details',
|
71
|
+
width: 300
|
72
|
+
}],
|
73
|
+
items: [{
|
74
|
+
html: 'tab container'
|
75
|
+
}]
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
Neo.applyClassConfig(MainView);
|
80
|
+
|
81
|
+
export default MainView;
|
82
|
+
</pre>
|
83
|
+
|
84
|
+
We'll learn about panels later, but in a nutshell, a panel is a container
|
85
|
+
that has a special `headers:[]` config that lets you add components to the
|
86
|
+
top, right, bottom, or left edges of the container.
|
87
|
+
|
88
|
+
What does the code do?
|
89
|
+
|
90
|
+
- Changes the view to be a panel
|
91
|
+
- Adds three docked headers which are placeholders for classes you'll create
|
92
|
+
- The banner at the top
|
93
|
+
- The filter container at the top
|
94
|
+
- The business details container at the right
|
95
|
+
|
96
|
+
Verify that the app runs.
|
97
|
+
|
98
|
+
</details>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<pre class="runnable readonly text 480">
|
2
|
+
{
|
3
|
+
ntype : 'container',
|
4
|
+
style: {
|
5
|
+
marginTop: '30px'
|
6
|
+
},
|
7
|
+
|
8
|
+
layout: {
|
9
|
+
ntype: 'vbox',
|
10
|
+
align: 'start'
|
11
|
+
},
|
12
|
+
|
13
|
+
items: [{
|
14
|
+
module : Button,
|
15
|
+
iconCls : 'fa fa-home',
|
16
|
+
iconPosition: 'right',
|
17
|
+
text : 'Right'
|
18
|
+
}, {
|
19
|
+
ntype : 'button',
|
20
|
+
flex : 1,
|
21
|
+
iconCls : 'fa fa-play-circle',
|
22
|
+
iconPosition: 'bottom',
|
23
|
+
text : 'Bottom'
|
24
|
+
}, SomeClass]
|
25
|
+
}
|
26
|
+
</pre>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
`itemDefaults:{}` specifies an item config used for every item in
|
2
|
+
`items:[]`. Individual items are free to set their own values.
|
3
|
+
|
4
|
+
<pre class="runnable readonly text 300">
|
5
|
+
itemDefaults: {
|
6
|
+
module: Button,
|
7
|
+
handler: 'onButtonClick',
|
8
|
+
flex: 1
|
9
|
+
},
|
10
|
+
items: [{
|
11
|
+
style: { backgroundColor: 'red' },
|
12
|
+
}, {
|
13
|
+
style: { backgroundColor: 'yellow' },
|
14
|
+
}, {
|
15
|
+
style: { backgroundColor: 'lightblue' },
|
16
|
+
}, {
|
17
|
+
module: Label // This is used instead of the default
|
18
|
+
}]
|
19
|
+
</pre>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Items are arranged according to a `layout`.
|
2
|
+
|
3
|
+
- `layout:'fit'`
|
4
|
+
- `layout: 'card'`
|
5
|
+
- `layout: 'vbox'`
|
6
|
+
- `layout: 'hbox'`
|
7
|
+
- `layout: 'flexbox'`
|
8
|
+
|
9
|
+
When you need to provide more config details, use this form:
|
10
|
+
|
11
|
+
layout: {
|
12
|
+
ntype:'vbox',
|
13
|
+
align: 'stretch'
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
The container base class imports all layouts, which means you
|
18
|
+
can use `ntype` (and don't need to explicitly import the layout class).
|
19
|
+
|
20
|
+
<span style="color: #bbbbbb;">And actually, in the case of layouts, you
|
21
|
+
<i style="color: #bbbbbb;">must</i> use ntype. You do not specify layouts
|
22
|
+
using the <tt>module</tt> config.
|
23
|
+
</span>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
You can procedurally add or remove items.
|
2
|
+
|
3
|
+
- `insert(index, item, [silent])`
|
4
|
+
- `remove(component, [destroyItem], [silent])`
|
5
|
+
- `removeAt(index, [destroyItem], [silent])`
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
<pre class="runnable readonly text 100">
|
10
|
+
this.add({
|
11
|
+
module: Button,
|
12
|
+
text: 'New Button'
|
13
|
+
});
|
14
|
+
</pre>
|
15
|
+
|
16
|
+
<pre class="runnable readonly text 160">
|
17
|
+
this.add([{
|
18
|
+
module: Button,
|
19
|
+
text: 'One'
|
20
|
+
}, {
|
21
|
+
module: Button,
|
22
|
+
text: 'Two'
|
23
|
+
}]);
|
24
|
+
</pre>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Components and other classes fire _events_. Those events run a callback
|
2
|
+
function called the event _listener_ or _handler_.
|
3
|
+
|
4
|
+
For example, buttons fire _click_ events, tables
|
5
|
+
fire _select_ events, and stores fire _load_ events.
|
6
|
+
|
7
|
+
The usual way to configure to an event is with the `listeners` config.
|
8
|
+
|
9
|
+
listeners: {
|
10
|
+
select: 'onTableSelect'
|
11
|
+
},
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
The _listeners_ object is a name value pair, where the name is the
|
2
|
+
name of the event, and the value is either a function or the string
|
3
|
+
name of the function in the view's controller (or controllers up the
|
4
|
+
containment hierarchy).
|
5
|
+
|
6
|
+
listeners: {
|
7
|
+
change: data=>console.log(data),
|
8
|
+
focusChange: data=>console.log(data)
|
9
|
+
},
|
10
|
+
|
11
|
+
|
12
|
+
listeners: {
|
13
|
+
change: 'onChange',
|
14
|
+
focusChange: 'onFocusChange'
|
15
|
+
},
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
You can also add listeners procedurally.
|
2
|
+
|
3
|
+
<pre style="font-size: 14pt">
|
4
|
+
this.getReference('mycomp').addListener(string, function);
|
5
|
+
</pre>
|
6
|
+
|
7
|
+
The string is the name of the event, the function is the callback function.
|
8
|
+
|
9
|
+
The callback function could be an in-line function, or a reference to a function.
|
10
|
+
|
11
|
+
|
12
|
+
<pre style="font-size: 14pt">
|
13
|
+
this.getReference('mycomp').addListener('change', data=>console.log(data));
|
14
|
+
</pre>
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
<pre style="font-size: 14pt">
|
19
|
+
this.getReference('mycomp').addListener('change', this.onChange.bind(this));
|
20
|
+
</pre>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Internally, listeners are set up as a map, with event names as the key, and and array of
|
2
|
+
function references as the value.
|
3
|
+
|
4
|
+
<img src="resources/images/EventsInMemory.png"/>
|
5
|
+
|
6
|
+
<!--
|
7
|
+
<table>
|
8
|
+
<tr><th>component.listeners</th><th></th><th>Config</th></tr>
|
9
|
+
<tr>
|
10
|
+
<td width="45%"><pre style="font-size:12pt">
|
11
|
+
{
|
12
|
+
change: [ , ]
|
13
|
+
foo: [ ]
|
14
|
+
}
|
15
|
+
|
16
|
+
</pre></td>
|
17
|
+
<td width="5%"></td>
|
18
|
+
<td width="45%"><pre style="font-size:12pt">
|
19
|
+
// Adds the "change" entry and adds 1st array element
|
20
|
+
listeners: {
|
21
|
+
change: data=>console.log(data)
|
22
|
+
}
|
23
|
+
|
24
|
+
// Uses existing "change" entry and adds 2nd array element
|
25
|
+
listeners: {
|
26
|
+
change: data=>console.log(data)
|
27
|
+
}
|
28
|
+
|
29
|
+
// Adds the "foo" entry and adds 1st array element
|
30
|
+
listeners: {
|
31
|
+
foo: data=>console.log(data)
|
32
|
+
}
|
33
|
+
</pre>
|
34
|
+
</td>
|
35
|
+
<td><pre style="font-size:12pt">
|
36
|
+
</pre></td>
|
37
|
+
</tr>
|
38
|
+
</table>
|
39
|
+
-->
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Many Neo classes are observable, and thus, have the `fire()` method.<small><sup>*</sup></small>
|
2
|
+
|
3
|
+
From a view method:
|
4
|
+
|
5
|
+
<pre style="font-size: 14pt;margin:0 0 3em 0;">
|
6
|
+
this.fire('foo', {component:this, prop: 'whatever you want'})
|
7
|
+
</pre>
|
8
|
+
|
9
|
+
From a controller method:
|
10
|
+
|
11
|
+
<pre style="font-size: 14pt;margin:0 0 3em 0;">
|
12
|
+
this.component.fire('foo', {component:this, prop: 'whatever you want'})
|
13
|
+
</pre>
|
14
|
+
|
15
|
+
There's nothing stopping you from firing an event on anything (although
|
16
|
+
there's probably never a reason to do that).
|
17
|
+
|
18
|
+
<pre style="font-size: 14pt;margin:0 0 3em 0;">
|
19
|
+
this.getComponent('myReference').fire('foo', {message: 'yo'});
|
20
|
+
</pre>
|
21
|
+
|
22
|
+
<small>* Document your events so people know how to use your Neo classes!</small>
|
@@ -0,0 +1 @@
|
|
1
|
+
`Ext.component.Base` has a few properties relating to content:
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Earlier, we made a big deal about how Neo components were _declarative_ — where
|
2
|
+
the code is an abstraction that _describes_ what's being created.
|
3
|
+
|
4
|
+
But the code has some procedural code.
|
5
|
+
|
6
|
+
There's _was_ some procedural in the store's fields[], but we moved that into
|
7
|
+
a separate view model class.
|
8
|
+
|
9
|
+
But the event handlers are in the main container. In a normal app you'd have
|
10
|
+
a lot of event listeners with a lot of business logic in them. Except for the
|
11
|
+
most trivial use cases, you don't want that logic in your views.
|
12
|
+
|