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,84 @@
|
|
1
|
+
Change the starter app's main view to show a table.
|
2
|
+
|
3
|
+
<pre class="runnable javascript readonly">
|
4
|
+
import Table from "../../../node_modules/neo.mjs/src/table/Container.mjs";
|
5
|
+
import Viewport from "../../../node_modules/neo.mjs/src/container/Viewport.mjs";
|
6
|
+
import Store from "../../../node_modules/neo.mjs/src/data/Store.mjs";
|
7
|
+
|
8
|
+
class MainContainer extends Viewport {
|
9
|
+
static config = {
|
10
|
+
className: "Starter.view.MainContainer",
|
11
|
+
autoMount: true,
|
12
|
+
items: [{
|
13
|
+
module: Table,
|
14
|
+
flex: 1,
|
15
|
+
store: {
|
16
|
+
module: Store,
|
17
|
+
model: {
|
18
|
+
fields: [{
|
19
|
+
name: "humanReadableLocation",
|
20
|
+
}, {
|
21
|
+
name: "size",
|
22
|
+
ntype: "data-field-float",
|
23
|
+
}, {
|
24
|
+
name: "timestamp",
|
25
|
+
type: "Date",
|
26
|
+
}, {
|
27
|
+
name: "title",
|
28
|
+
calculate: (data, field, item) => item.humanReadableLocation,
|
29
|
+
}, {
|
30
|
+
name: "position",
|
31
|
+
calculate: (data, field, item) => ({
|
32
|
+
lat: item.latitude,
|
33
|
+
lng: item.longitude,
|
34
|
+
}),
|
35
|
+
},
|
36
|
+
],
|
37
|
+
},
|
38
|
+
url: "https://apis.is/earthquake/is",
|
39
|
+
responseRoot: "results",
|
40
|
+
autoLoad: true,
|
41
|
+
},
|
42
|
+
columns: [{
|
43
|
+
dataField: "timestamp",
|
44
|
+
text: "Date",
|
45
|
+
renderer: (data) =>
|
46
|
+
data.value.toLocaleDateString(undefined, {
|
47
|
+
weekday: "long",
|
48
|
+
year: "numeric",
|
49
|
+
month: "long",
|
50
|
+
day: "numeric",
|
51
|
+
}),
|
52
|
+
}, {
|
53
|
+
dataField: "humanReadableLocation",
|
54
|
+
text: "Location",
|
55
|
+
}, {
|
56
|
+
dataField: "size",
|
57
|
+
text: "Magnitude",
|
58
|
+
align: "right",
|
59
|
+
width: 100,
|
60
|
+
renderer: (data) => data.value.toLocaleString(),
|
61
|
+
}],
|
62
|
+
}],
|
63
|
+
layout: {ntype: "fit"},
|
64
|
+
};
|
65
|
+
|
66
|
+
afterSetMounted(value, oldValue) {
|
67
|
+
super.afterSetMounted(value, oldValue);
|
68
|
+
if (!value) return;
|
69
|
+
this.addDomListeners({
|
70
|
+
"neo-debug-item-select": (event) => {
|
71
|
+
event.path.forEach((item) => {
|
72
|
+
const component = Neo.getComponent(item.id);
|
73
|
+
if (component) console.log(component);
|
74
|
+
});
|
75
|
+
},
|
76
|
+
});
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
Neo.applyClassConfig(MainContainer);
|
81
|
+
|
82
|
+
export default MainContainer;
|
83
|
+
|
84
|
+
</pre>
|
@@ -0,0 +1 @@
|
|
1
|
+
<img height="580" src="resources/images/intro/InitialTable.png"/>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Let's review the code and see how it _describes_ what it's doing. Even if you
|
2
|
+
knew nothing about Neo you could deduce what the code is doing.
|
3
|
+
|
4
|
+
Note how the store defines the field types. This defines how values in the
|
5
|
+
feed are converted as the store's records are created.
|
6
|
+
|
7
|
+
And the table has column renderers which translate how the store values
|
8
|
+
are shown to the user.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Note that the way we've coded the app, the grid is _not_ reusable.
|
2
|
+
|
3
|
+
You can reuse any class config block by creating a new class that
|
4
|
+
extends the component's class. In other words, if you want to
|
5
|
+
reuse a table, you create a new class that extends `Neo.container.Table`
|
6
|
+
and uses the same config.
|
7
|
+
|
8
|
+
Besides reuse, other good reasons to put your components into their own classes
|
9
|
+
is make code more abstract, to isolate complexity, and to allow
|
10
|
+
those to be tested in isolation.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Now that the table is its own class
|
2
|
+
- The main container code is cleaner
|
3
|
+
- The table is reusable
|
4
|
+
|
5
|
+
Since it's reusable, we can create a couple of instances in the main container.
|
6
|
+
To do that, just copy and paste the table's config, give both `flex:1`, and
|
7
|
+
change the parent container's layout to `vbox`.
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
As we discussed before, any time you configure a class via a config
|
2
|
+
you're free to create a class encapsulating the config properties.
|
3
|
+
|
4
|
+
In other words, any time you have an `ntype` or `module` block,
|
5
|
+
you're free to create a new class that extends that type, and
|
6
|
+
move the config to the new class `static getConfig` mehtod.
|
7
|
+
|
8
|
+
Trivial classes might be done inline. Or to keep the view cleaner,
|
9
|
+
and more declarative, use a separate view model class.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
The property's setter is run as the view model property changes.
|
2
|
+
<pre class="runnable text readonly 200">
|
3
|
+
{
|
4
|
+
module: Label,
|
5
|
+
bind: {
|
6
|
+
// Neo.component.Label.mjs has a text_ config.
|
7
|
+
// The value returned by the arrow function is assigned to label.text
|
8
|
+
text: data => \`The value of foo is "${data.foo || ''}"\`
|
9
|
+
}
|
10
|
+
}
|
11
|
+
</pre>
|
12
|
+
|
13
|
+
See <a href="http://localhost:8080/ex/model/oneway/" target="example">
|
14
|
+
examples/model/oneway/MainContainer.mjs
|
15
|
+
</a>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
Bindings are all about _setters_ — if the class has a `set` function you can bind to it.
|
2
|
+
|
3
|
+
<div type="expander" caption="Your own setter">
|
4
|
+
<pre>
|
5
|
+
static getConfig() {
|
6
|
+
return {
|
7
|
+
// configs...
|
8
|
+
}
|
9
|
+
}
|
10
|
+
set foo(value) {
|
11
|
+
this.text = value;
|
12
|
+
}
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div type="expander" caption="A configured setter">
|
16
|
+
<pre>
|
17
|
+
static getConfig() {
|
18
|
+
return {
|
19
|
+
// configs...
|
20
|
+
bar_: null
|
21
|
+
}
|
22
|
+
}
|
23
|
+
afterSetBar(value) {
|
24
|
+
this.text = value;
|
25
|
+
}
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div type="expander" caption="Conclusion">
|
29
|
+
<p>
|
30
|
+
You wouldn't normally use a <code>set</code> function because creating a config
|
31
|
+
property is so easy, and it comes
|
32
|
+
with the auto-generated _beforeSet_, _afterSet_, and _beforeGet_ methods.
|
33
|
+
</p>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
|
37
|
+
See <a href="http://localhost:8080/examples/model/setterversusconfig"
|
38
|
+
target="example">examples/model/setterversusconfig/MainContainer.mjs</a>
|
39
|
+
|
40
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#Introduction
|
2
|
+
|
3
|
+
In this lab you'll have code the tab container which will hold the
|
4
|
+
map, table, and thumbails.
|
5
|
+
|
6
|
+
#Steps
|
7
|
+
|
8
|
+
??Create `businesses/Tabs`
|
9
|
+
|
10
|
+
Create a new class named `Yelp.view.businesses.Tabs` that extends `tab/container`.
|
11
|
+
|
12
|
+
Give it the `ntype:'yelp-businesses-tabs',`.
|
13
|
+
|
14
|
+
It needs *two* tabs, with the tab button text set to 'Map' and 'Table'.
|
15
|
+
|
16
|
+
Remember that a tab is configured with the `tabButtonConfig`, and you'll use the
|
17
|
+
`html` config as a placeholder to indicate that a map and a table will eventually
|
18
|
+
be used. The generated class already has two tabs.
|
19
|
+
|
20
|
+
The first tab shoudl end up looking like this.
|
21
|
+
|
22
|
+
{
|
23
|
+
ntype: 'component',
|
24
|
+
html: 'The map goes here',
|
25
|
+
tabButtonConfig: {
|
26
|
+
text: 'Map'
|
27
|
+
},
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
??Use the new class
|
33
|
+
|
34
|
+
Edit the main view. Import the new tabs class, and replace the item in the
|
35
|
+
`items:[]` to use the new class.
|
36
|
+
|
37
|
+
Save, refresh, and verify that everything is working.
|
38
|
+
|
39
|
+
??Use a map as the first tab item
|
40
|
+
|
41
|
+
Now replace the tab's first item with a config for a Google map. You'll need
|
File without changes
|
File without changes
|
@@ -0,0 +1,7 @@
|
|
1
|
+
The previous example illustrates _one-way_ binding.
|
2
|
+
|
3
|
+
When the component model's property changes, the binding wakes up and the
|
4
|
+
arrow function is evaluated.
|
5
|
+
|
6
|
+
We can see that in action by looking at the view's component model and
|
7
|
+
updating the value — when that happens the bindings fire.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
A basic debugging (and coding!) task is getting a referernce to a component.
|
2
|
+
You can then see the component's state and run its methods.
|
3
|
+
|
4
|
+
There are a few ways to get a component reference.
|
5
|
+
- `Neo.manager.Component.items` <tt>// Returns [Component]</tt>
|
6
|
+
- `Neo.find({property:'value'})` <tt>// Returns [{}] of instances<t/t>
|
7
|
+
- `Neo.findFirst({property:'value'})` <tt>// Returns first instance</tt>
|
@@ -0,0 +1,106 @@
|
|
1
|
+
#Introduction
|
2
|
+
|
3
|
+
In this lab you'll install the bookmarklet, and practice getting component references,
|
4
|
+
changing properties, and runing methods.
|
5
|
+
|
6
|
+
#Steps
|
7
|
+
|
8
|
+
?? Try `Neo.manager.Component.items`
|
9
|
+
|
10
|
+
Run the starter app.
|
11
|
+
|
12
|
+
In Chrome DevTools | Console, switch to the `neomjs-app-worker` context and
|
13
|
+
on the console type `Neo.manager.Component.items`
|
14
|
+
|
15
|
+
Expand the array and look for one of the tab buttons. The buttons will have
|
16
|
+
ids set to something like `neo-tab-header-button-1`. Expand the item and scroll
|
17
|
+
down to the `text: (...)` property.
|
18
|
+
|
19
|
+
Click on the ellipses and enter a new string value. Once you hit Enter or lose
|
20
|
+
focus you should see the tab reflect the change.
|
21
|
+
|
22
|
+
Open `apps/starter/view/MainContainer.mjs` and inspect the code.
|
23
|
+
|
24
|
+
?? Try `Neo.findFirst()`
|
25
|
+
|
26
|
+
Get a reference to to the tab container via this statement:
|
27
|
+
|
28
|
+
tabContainer = Neo.findFirst('ntype', 'tab-container');
|
29
|
+
|
30
|
+
Note that the statement assigns the reference to a variable. That'll make it easier
|
31
|
+
to inspect it, and run methods on it.
|
32
|
+
|
33
|
+
Now add a new tab:
|
34
|
+
|
35
|
+
tabContainer.add({
|
36
|
+
tabButtonConfig: {
|
37
|
+
iconCls: 'fa fa-home',
|
38
|
+
text: 'Hi there!'
|
39
|
+
},
|
40
|
+
vdom: { innerHTML: 'Yet another tab.' }
|
41
|
+
})
|
42
|
+
|
43
|
+
??Enable the Ctrl-right-click debugger
|
44
|
+
|
45
|
+
Edit the starter's `index.html` and use this code.
|
46
|
+
<pre class="runnable html">
|
47
|
+
<!DOCTYPE HTML>
|
48
|
+
<html>
|
49
|
+
<head>
|
50
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
51
|
+
<meta charset="UTF-8">
|
52
|
+
<title>Starter</title>
|
53
|
+
</head>
|
54
|
+
<body>
|
55
|
+
<script src="../../src/MicroLoader.mjs" type="module"></script>
|
56
|
+
<script>
|
57
|
+
new MutationObserver((mutationsList, observer) => {
|
58
|
+
for (let mutation of mutationsList) {
|
59
|
+
for (let addedNode of mutation.addedNodes) {
|
60
|
+
if (addedNode.className && addedNode.className.includes('neo-viewport')) {
|
61
|
+
addedNode.addEventListener("contextmenu", function (e) {
|
62
|
+
if (!(e.ctrlKey || e.metaKey)) return;
|
63
|
+
e.stopPropagation();
|
64
|
+
e.preventDefault();
|
65
|
+
const event = new Event('neo-debug-item-select', {bubbles: true});
|
66
|
+
e.target.dispatchEvent(event);
|
67
|
+
});
|
68
|
+
observer.disconnect(); // We found the viewport so we're finished listening
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}).observe(document.body, {childList: true, subtree: false});
|
73
|
+
</script>
|
74
|
+
</body>
|
75
|
+
</html>
|
76
|
+
</pre>
|
77
|
+
|
78
|
+
Now edit `MainController.mjs` and add the method to detect the event and log the components.
|
79
|
+
This is a _method_, so place it within the class definition.
|
80
|
+
|
81
|
+
<pre class="runnable html 230">
|
82
|
+
afterSetMounted(value, oldValue) {
|
83
|
+
super.afterSetMounted(value, oldValue);
|
84
|
+
if (!value) return;
|
85
|
+
this.addDomListeners({
|
86
|
+
"neo-debug-item-select": event => {
|
87
|
+
event.path.forEach(item => {
|
88
|
+
const component = Neo.getComponent(item.id);
|
89
|
+
if (component) console.log(component);
|
90
|
+
});
|
91
|
+
}
|
92
|
+
});
|
93
|
+
}
|
94
|
+
</pre>
|
95
|
+
|
96
|
+
|
97
|
+
??Change the text in one of the tab buttons
|
98
|
+
|
99
|
+
Refresh the app so the new main view method is in effect, then _Ctrl-right-click_
|
100
|
+
on one of the tab buttons. It should be logged to the console. Drill-down to the `text` property
|
101
|
+
and change the value.
|
102
|
+
|
103
|
+
Clear the console and do another _Ctrl-right-click_, then right-click on the button component logged in
|
104
|
+
the console and choose _Store object as global variable_. It'll use a value like _temp1_.
|
105
|
+
|
106
|
+
Rather than drilling-down, assign a new text value by entering `temp1.text = 'hi there'`.
|
@@ -0,0 +1,112 @@
|
|
1
|
+
#Introduction
|
2
|
+
|
3
|
+
In this lab, you'll generate a starter app and run it.
|
4
|
+
|
5
|
+
#Steps
|
6
|
+
|
7
|
+
??Use the command-line to generate the app
|
8
|
+
|
9
|
+
Using a terminal window, navigate to the root of your Neo workspace.
|
10
|
+
|
11
|
+
If you use a code editor, just open the workspace, and open a terminal
|
12
|
+
window in the editor. If you ever forget the command-line options,
|
13
|
+
just open `package.json` to see the list of scripts.
|
14
|
+
|
15
|
+
From the workspace, run this command.
|
16
|
+
|
17
|
+
npm run create-app
|
18
|
+
|
19
|
+
Name the app _Starter_ and choose the default response for everything.
|
20
|
+
|
21
|
+
<img src="resources/images/intro/NpmRunCreateApp.png"/>
|
22
|
+
|
23
|
+
<pre>
|
24
|
+
</pre>
|
25
|
+
|
26
|
+
??Inspect the application
|
27
|
+
|
28
|
+
Open `apps/starter/view/MainContainer.mjs` and inspect the code.
|
29
|
+
|
30
|
+
??Run the app
|
31
|
+
|
32
|
+
The command to start the server is `npm run server-start`. This starts a server
|
33
|
+
on port 8080 and launches a browser window at the root of the workspace.
|
34
|
+
|
35
|
+
Click on the `apps` directory, then the `starter` directory, and you'll see the
|
36
|
+
running app.
|
37
|
+
|
38
|
+
??Change the code and see the result
|
39
|
+
|
40
|
+
You can change the code any way you dare, but as a suggestion:
|
41
|
+
- Remove the `style`, `height`, and `width` configs for the tab container.
|
42
|
+
- Then add `style: { padding: '20px' },` to the main container.
|
43
|
+
|
44
|
+
You need to refresh the browser to see the result of code changes.
|
45
|
+
|
46
|
+
<pre style="font-size: 80%; color:#cacaca;">
|
47
|
+
import Component from '../../../node_modules/neo.mjs/src/component/Base.mjs';
|
48
|
+
import TabContainer from '../../../node_modules/neo.mjs/src/tab/Container.mjs';
|
49
|
+
import Viewport from '../../../node_modules/neo.mjs/src/container/Viewport.mjs';
|
50
|
+
|
51
|
+
/**
|
52
|
+
* @class june-starter.view.MainContainer
|
53
|
+
* @extends Neo.container.Viewport
|
54
|
+
*/
|
55
|
+
class MainContainer extends Viewport {
|
56
|
+
static config = {
|
57
|
+
/**
|
58
|
+
* @member {String} className='june-starter.view.MainContainer'
|
59
|
+
* @protected
|
60
|
+
*/
|
61
|
+
className: 'june-starter.view.MainContainer',
|
62
|
+
/**
|
63
|
+
* @member {Boolean} autoMount=true
|
64
|
+
*/
|
65
|
+
autoMount: true,
|
66
|
+
<span style="color:red;">style: { padding: '20px' },</span>
|
67
|
+
/**
|
68
|
+
* @member {Object[]} items
|
69
|
+
*/
|
70
|
+
items: [{
|
71
|
+
module: TabContainer,
|
72
|
+
<s style="color:red;">height: 300,</s>
|
73
|
+
<s style="color:red;">width : 500,</s>
|
74
|
+
<s style="color:red;">style : {flex: 'none', margin: '20px'},</s>
|
75
|
+
|
76
|
+
itemDefaults: {
|
77
|
+
module: Component,
|
78
|
+
cls : ['neo-examples-tab-component'],
|
79
|
+
style : {padding: '20px'},
|
80
|
+
},
|
81
|
+
|
82
|
+
items: [{
|
83
|
+
tabButtonConfig: {
|
84
|
+
iconCls: 'fa fa-home',
|
85
|
+
text: 'Tab 1'
|
86
|
+
},
|
87
|
+
vdom: {
|
88
|
+
innerHTML: 'Welcome to your new Neo App.'
|
89
|
+
}
|
90
|
+
}, {
|
91
|
+
tabButtonConfig: {
|
92
|
+
iconCls: 'fa fa-play-circle',
|
93
|
+
text: 'Tab 2'
|
94
|
+
},
|
95
|
+
vdom: {
|
96
|
+
innerHTML: 'Have fun creating something awesome!'
|
97
|
+
}
|
98
|
+
}]
|
99
|
+
}],
|
100
|
+
/*
|
101
|
+
* @member {Object} layout={ntype:'fit'}
|
102
|
+
*/
|
103
|
+
layout: {
|
104
|
+
ntype: 'fit'
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
Neo.applyClassConfig(MainContainer);
|
110
|
+
|
111
|
+
export default MainContainer;
|
112
|
+
</pre>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Neo enables you to create scalable and high performant
|
2
|
+
browser-based apps.
|
3
|
+
|
4
|
+
<div type="expander" caption="Normal Apps">
|
5
|
+
<p>
|
6
|
+
Normal browser apps run in as a single thread in one processer.
|
7
|
+
That means that apps that are processor-intensive — such as doing
|
8
|
+
massive dom updates — are limited by what the one processer can handle.
|
9
|
+
</p>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div type="expander" caption="Neo">
|
13
|
+
<p>
|
14
|
+
Neo uses three (or more) web workers — so three processors are used.
|
15
|
+
One thread holds your app logic, one handles HTTP/Ajax calls, and
|
16
|
+
one handles DOM updates.
|
17
|
+
</p>
|
18
|
+
<p>
|
19
|
+
Furthermore, the DOM updates are intelligently handled via
|
20
|
+
delta updates, rather than re-rendering large DOM hierarchies.
|
21
|
+
Neo can handle tens of thousands of DOM updates _per second_.
|
22
|
+
</p>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div type="expander" caption="And there's more...">
|
26
|
+
<p>
|
27
|
+
There are other advantages, such as lazy loading any part of the
|
28
|
+
running app, and multi-window apps, where a single app can be run
|
29
|
+
in multiple browser window.
|
30
|
+
</p>
|
31
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
The roots of graphical user interfaces started with research done at the Xerox Palo Alto
|
2
|
+
Research Center (PARC).
|
3
|
+
|
4
|
+
Development tools and languages evolved to let developers write user interfaces by choosing
|
5
|
+
from pallets of components to specify a hierarchy of of containers (like panels), and
|
6
|
+
components within the container (like buttons and input widgets).<small><sup>*</sup></small>
|
7
|
+
|
8
|
+
In this style of coding, components are high-level abstractions where developers configure the
|
9
|
+
component, and the framework handles translating that to the low-level native calls.
|
10
|
+
|
11
|
+
<br><br>
|
12
|
+
<small>*
|
13
|
+
Back in the 1980s and 1990s developers used tools like Delphi and PowerBuilder.</small>
|
14
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Over time, web apps starting becoming more important, and this presented a problem for organizations.
|
2
|
+
|
3
|
+
<b style="color:green">Should UI development be done by HTML/Web designers, or by traditional GUI developers?</b>
|
4
|
+
|
5
|
+
And consequently...
|
6
|
+
|
7
|
+
<b style="color:green">Should frameworks and languages be focused on HTML (and add features to integrate it with code), or should they focus on abstract components (and adding a layer
|
8
|
+
to render those into the DOM)?</b>
|
9
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Native applications use the operating system as the run-time environement.
|
2
|
+
|
3
|
+
The runtime for a web app is the browser's JavaScript engine, and the rules of HTML and
|
4
|
+
CSS.
|
5
|
+
|
6
|
+
Normally, languages run at a higher level of abstraction — how many times
|
7
|
+
have you had to write assembly or byte code?
|
@@ -0,0 +1,46 @@
|
|
1
|
+
Neo uses the JavaScript class system to define its classes, but also enhances
|
2
|
+
the class system to auto-generate getters and settings (and setter life-cycle
|
3
|
+
methods) — we'll discuss inheritance and the class system later.
|
4
|
+
|
5
|
+
Your components extend classes from the framework,
|
6
|
+
and you're free to extend the classes you write. That means your code is
|
7
|
+
_extensible_ and _reusable_.
|
8
|
+
|
9
|
+
<pre class="runnable text readonly">
|
10
|
+
import Component from '../../../node_modules/neo.mjs/src/component/Base.mjs';
|
11
|
+
import TabContainer from '../../../node_modules/neo.mjs/src/tab/Container.mjs';
|
12
|
+
import Viewport from '../../../node_modules/neo.mjs/src/container/Viewport.mjs';
|
13
|
+
|
14
|
+
class MainContainer extends Viewport {
|
15
|
+
static config = {
|
16
|
+
className: 'Starter.view.MainContainer',
|
17
|
+
ntype: 'main',
|
18
|
+
autoMount: true,
|
19
|
+
style: { padding: '20px' },
|
20
|
+
layout: { ntype: 'fit' },
|
21
|
+
items: [{
|
22
|
+
module: TabContainer,
|
23
|
+
itemDefaults: {
|
24
|
+
module: Component,
|
25
|
+
cls: ['neo-examples-tab-component'],
|
26
|
+
style: { padding: '20px' }
|
27
|
+
},
|
28
|
+
items: [{
|
29
|
+
tabButtonConfig: {
|
30
|
+
iconCls: 'fa fa-home',
|
31
|
+
text: 'Tab 1'
|
32
|
+
},
|
33
|
+
vdom: { innerHTML: 'Welcome to your new Neo App.' }
|
34
|
+
}, {
|
35
|
+
tabButtonConfig: {
|
36
|
+
iconCls: 'fa fa-play-circle',
|
37
|
+
text: 'Tab 2'
|
38
|
+
},
|
39
|
+
vdom: { innerHTML: 'Have fun creating something awesome!' }
|
40
|
+
}]
|
41
|
+
}]
|
42
|
+
}
|
43
|
+
}
|
44
|
+
Neo.applyClassConfig(MainContainer);
|
45
|
+
export default MainContainer;
|
46
|
+
</pre>
|