neo.mjs 10.0.0-beta.5 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/.github/RELEASE_NOTES/v10.0.0-beta.1.md +20 -0
  2. package/.github/RELEASE_NOTES/v10.0.0-beta.2.md +73 -0
  3. package/.github/RELEASE_NOTES/v10.0.0-beta.3.md +39 -0
  4. package/.github/RELEASE_NOTES/v10.0.0-beta.5.md +70 -0
  5. package/.github/RELEASE_NOTES/v10.0.0-beta.6.md +48 -0
  6. package/.github/RELEASE_NOTES/v10.0.0.md +52 -0
  7. package/.github/epic-functional-components.md +498 -0
  8. package/.github/ticket-asymmetric-vdom-updates.md +122 -0
  9. package/README.md +0 -3
  10. package/ServiceWorker.mjs +2 -2
  11. package/apps/colors/store/Colors.mjs +1 -0
  12. package/apps/colors/view/GridContainer.mjs +3 -0
  13. package/apps/colors/view/HeaderToolbar.mjs +2 -0
  14. package/apps/colors/view/Viewport.mjs +3 -0
  15. package/apps/covid/view/FooterContainer.mjs +3 -0
  16. package/apps/covid/view/GalleryContainer.mjs +2 -0
  17. package/apps/covid/view/GalleryContainerController.mjs +1 -0
  18. package/apps/covid/view/HeaderContainer.mjs +2 -0
  19. package/apps/covid/view/HelixContainer.mjs +2 -0
  20. package/apps/covid/view/HelixContainerController.mjs +1 -0
  21. package/apps/covid/view/MainContainer.mjs +3 -0
  22. package/apps/covid/view/TableContainer.mjs +3 -0
  23. package/apps/covid/view/TableContainerController.mjs +1 -0
  24. package/apps/covid/view/WorldMapContainer.mjs +2 -0
  25. package/apps/covid/view/country/Gallery.mjs +3 -0
  26. package/apps/covid/view/country/Helix.mjs +8 -0
  27. package/apps/covid/view/country/HistoricalDataTable.mjs +1 -0
  28. package/apps/covid/view/country/Table.mjs +2 -0
  29. package/apps/covid/view/mapboxGl/Component.mjs +1 -0
  30. package/apps/covid/view/mapboxGl/Container.mjs +2 -0
  31. package/apps/email/EPIC_PLAN.md +58 -0
  32. package/apps/email/neo-config.json +2 -2
  33. package/apps/email/store/Emails.mjs +11 -1
  34. package/apps/email/view/ComposeView.mjs +44 -0
  35. package/apps/email/view/MainView.mjs +89 -0
  36. package/apps/email/view/Viewport.mjs +4 -33
  37. package/apps/email/view/ViewportStateProvider.mjs +3 -3
  38. package/apps/form/store/SideNav.mjs +1 -0
  39. package/apps/form/view/FormContainer.mjs +1 -0
  40. package/apps/form/view/FormPageContainer.mjs +2 -0
  41. package/apps/form/view/SideNavList.mjs +1 -0
  42. package/apps/form/view/Viewport.mjs +3 -0
  43. package/apps/portal/childapps/preview/MainContainer.mjs +1 -0
  44. package/apps/portal/index.html +1 -1
  45. package/apps/portal/store/BlogPosts.mjs +2 -0
  46. package/apps/portal/store/Content.mjs +1 -0
  47. package/apps/portal/store/ContentSections.mjs +1 -0
  48. package/apps/portal/store/Examples.mjs +1 -0
  49. package/apps/portal/view/HeaderToolbar.mjs +1 -0
  50. package/apps/portal/view/Viewport.mjs +5 -0
  51. package/apps/portal/view/ViewportController.mjs +11 -3
  52. package/apps/portal/view/about/Container.mjs +2 -0
  53. package/apps/portal/view/about/MemberContainer.mjs +7 -0
  54. package/apps/portal/view/blog/Container.mjs +2 -0
  55. package/apps/portal/view/blog/List.mjs +2 -0
  56. package/apps/portal/view/examples/List.mjs +29 -19
  57. package/apps/portal/view/examples/TabContainer.mjs +4 -0
  58. package/apps/portal/view/home/ContentBox.mjs +3 -0
  59. package/apps/portal/view/home/FeatureSection.mjs +8 -0
  60. package/apps/portal/view/home/FooterContainer.mjs +4 -1
  61. package/apps/portal/view/home/MainContainer.mjs +2 -0
  62. package/apps/portal/view/home/parts/AfterMath.mjs +2 -0
  63. package/apps/portal/view/home/parts/BaseContainer.mjs +1 -0
  64. package/apps/portal/view/home/parts/Colors.mjs +4 -0
  65. package/apps/portal/view/home/parts/Features.mjs +2 -0
  66. package/apps/portal/view/home/parts/Helix.mjs +5 -0
  67. package/apps/portal/view/home/parts/How.mjs +4 -0
  68. package/apps/portal/view/home/parts/MainNeo.mjs +1 -0
  69. package/apps/portal/view/home/parts/References.mjs +2 -0
  70. package/apps/portal/view/learn/ContentComponent.mjs +11 -5
  71. package/apps/portal/view/learn/ContentTreeList.mjs +2 -0
  72. package/apps/portal/view/learn/CubeLayoutButton.mjs +1 -0
  73. package/apps/portal/view/learn/MainContainer.mjs +4 -0
  74. package/apps/portal/view/learn/PageContainer.mjs +2 -0
  75. package/apps/portal/view/learn/PageSectionsContainer.mjs +3 -0
  76. package/apps/portal/view/learn/PageSectionsList.mjs +1 -0
  77. package/apps/portal/view/services/Component.mjs +1 -0
  78. package/apps/realworld/api/Base.mjs +1 -0
  79. package/apps/realworld/view/HeaderComponent.mjs +4 -0
  80. package/apps/realworld/view/HomeComponent.mjs +7 -0
  81. package/apps/realworld/view/MainContainer.mjs +2 -0
  82. package/apps/realworld/view/MainContainerController.mjs +2 -0
  83. package/apps/realworld/view/article/CommentComponent.mjs +3 -0
  84. package/apps/realworld/view/article/Component.mjs +17 -10
  85. package/apps/realworld/view/article/CreateCommentComponent.mjs +2 -0
  86. package/apps/realworld/view/article/CreateComponent.mjs +5 -0
  87. package/apps/realworld/view/article/PreviewComponent.mjs +9 -0
  88. package/apps/realworld/view/article/TagListComponent.mjs +2 -0
  89. package/apps/realworld/view/user/ProfileComponent.mjs +7 -0
  90. package/apps/realworld/view/user/SettingsComponent.mjs +5 -0
  91. package/apps/realworld/view/user/SignUpComponent.mjs +3 -0
  92. package/apps/realworld2/api/Base.mjs +1 -0
  93. package/apps/realworld2/view/FooterComponent.mjs +1 -0
  94. package/apps/realworld2/view/HeaderToolbar.mjs +3 -0
  95. package/apps/realworld2/view/HomeContainer.mjs +1 -0
  96. package/apps/realworld2/view/MainContainer.mjs +2 -0
  97. package/apps/realworld2/view/MainContainerController.mjs +1 -0
  98. package/apps/realworld2/view/article/Helix.mjs +1 -0
  99. package/apps/realworld2/view/article/PreviewComponent.mjs +9 -0
  100. package/apps/realworld2/view/article/PreviewList.mjs +1 -0
  101. package/apps/realworld2/view/article/TagListComponent.mjs +2 -0
  102. package/apps/route/view/CenterContainer.mjs +1 -0
  103. package/apps/route/view/MainView.mjs +1 -0
  104. package/apps/sharedcovid/childapps/sharedcovidchart/MainContainer.mjs +1 -0
  105. package/apps/sharedcovid/childapps/sharedcovidgallery/MainContainer.mjs +1 -0
  106. package/apps/sharedcovid/childapps/sharedcovidhelix/MainContainer.mjs +1 -0
  107. package/apps/sharedcovid/childapps/sharedcovidmap/MainContainer.mjs +1 -0
  108. package/apps/sharedcovid/view/FooterContainer.mjs +3 -0
  109. package/apps/sharedcovid/view/GalleryContainer.mjs +2 -0
  110. package/apps/sharedcovid/view/GalleryContainerController.mjs +1 -0
  111. package/apps/sharedcovid/view/HeaderContainer.mjs +2 -0
  112. package/apps/sharedcovid/view/HelixContainer.mjs +2 -0
  113. package/apps/sharedcovid/view/HelixContainerController.mjs +1 -0
  114. package/apps/sharedcovid/view/MainContainer.mjs +3 -0
  115. package/apps/sharedcovid/view/TableContainer.mjs +3 -0
  116. package/apps/sharedcovid/view/TableContainerController.mjs +1 -0
  117. package/apps/sharedcovid/view/WorldMapContainer.mjs +2 -0
  118. package/apps/sharedcovid/view/country/Gallery.mjs +3 -0
  119. package/apps/sharedcovid/view/country/Helix.mjs +8 -0
  120. package/apps/sharedcovid/view/country/HistoricalDataTable.mjs +1 -0
  121. package/apps/sharedcovid/view/country/Table.mjs +2 -0
  122. package/apps/sharedcovid/view/mapboxGl/Component.mjs +1 -0
  123. package/apps/sharedcovid/view/mapboxGl/Container.mjs +2 -0
  124. package/apps/shareddialog/childapps/shareddialog2/view/MainContainer.mjs +2 -0
  125. package/apps/shareddialog/view/DemoDialog.mjs +2 -0
  126. package/apps/shareddialog/view/MainContainer.mjs +2 -0
  127. package/apps/shareddialog/view/MainContainerController.mjs +1 -0
  128. package/buildScripts/addReactiveTags.mjs +191 -0
  129. package/buildScripts/checkReactiveTags.mjs +160 -0
  130. package/docs/app/store/Api.mjs +1 -0
  131. package/docs/app/store/Examples.mjs +1 -0
  132. package/docs/app/view/ApiTreeList.mjs +1 -0
  133. package/docs/app/view/ContentTabContainer.mjs +2 -0
  134. package/docs/app/view/ExamplesTreeList.mjs +2 -0
  135. package/docs/app/view/HeaderContainer.mjs +3 -0
  136. package/docs/app/view/MainContainer.mjs +5 -0
  137. package/docs/app/view/classdetails/HeaderComponent.mjs +1 -0
  138. package/docs/app/view/classdetails/MainContainer.mjs +3 -0
  139. package/docs/app/view/classdetails/MembersList.mjs +5 -0
  140. package/docs/app/view/classdetails/SourceViewComponent.mjs +2 -0
  141. package/examples/ConfigurationViewport.mjs +14 -8
  142. package/examples/calendar/weekview/MainContainer.mjs +4 -0
  143. package/examples/component/coronaGallery/CountryGallery.mjs +2 -0
  144. package/examples/component/coronaGallery/CountryStore.mjs +1 -0
  145. package/examples/component/coronaGallery/Viewport.mjs +3 -0
  146. package/examples/component/coronaGallery/ViewportController.mjs +1 -0
  147. package/examples/component/coronaHelix/CountryHelix.mjs +7 -0
  148. package/examples/component/coronaHelix/MainContainer.mjs +1 -0
  149. package/examples/component/gallery/ImageStore.mjs +1 -0
  150. package/examples/component/helix/ImageStore.mjs +1 -0
  151. package/examples/component/helix/Viewport.mjs +3 -0
  152. package/examples/component/helix/ViewportController.mjs +1 -0
  153. package/examples/component/multiWindowCoronaGallery/childapp/Viewport.mjs +1 -0
  154. package/examples/component/multiWindowHelix/childapp/Viewport.mjs +1 -0
  155. package/examples/component/wrapper/googleMaps/MapComponent.mjs +2 -0
  156. package/examples/core/config/MainContainer.mjs +2 -0
  157. package/examples/dialog/DemoDialog.mjs +2 -0
  158. package/examples/dialog/MainContainer.mjs +1 -0
  159. package/examples/form/field/color/MainStore.mjs +1 -0
  160. package/examples/functional/button/base/MainContainer.mjs +207 -0
  161. package/examples/functional/button/base/app.mjs +6 -0
  162. package/examples/functional/button/base/index.html +11 -0
  163. package/examples/functional/button/base/neo-config.json +6 -0
  164. package/examples/functional/defineComponent/Component.mjs +18 -0
  165. package/examples/functional/defineComponent/MainContainer.mjs +41 -0
  166. package/examples/functional/defineComponent/app.mjs +6 -0
  167. package/examples/functional/defineComponent/index.html +11 -0
  168. package/examples/functional/defineComponent/neo-config.json +6 -0
  169. package/examples/functional/hostComponent/Component.mjs +32 -0
  170. package/examples/functional/hostComponent/MainContainer.mjs +48 -0
  171. package/examples/functional/hostComponent/app.mjs +6 -0
  172. package/examples/functional/hostComponent/index.html +11 -0
  173. package/examples/functional/hostComponent/neo-config.json +6 -0
  174. package/examples/grid/animatedRowSorting/Viewport.mjs +1 -1
  175. package/examples/grid/bigData/ControlsContainer.mjs +3 -0
  176. package/examples/grid/bigData/GridContainer.mjs +4 -2
  177. package/examples/grid/bigData/MainContainer.mjs +2 -0
  178. package/examples/grid/bigData/MainModel.mjs +1 -0
  179. package/examples/grid/bigData/MainStore.mjs +3 -0
  180. package/examples/grid/cellEditing/MainContainer.mjs +1 -1
  181. package/examples/grid/container/MainContainer.mjs +1 -1
  182. package/examples/grid/covid/GridContainer.mjs +3 -0
  183. package/examples/grid/covid/MainContainer.mjs +2 -0
  184. package/examples/grid/covid/Store.mjs +1 -0
  185. package/examples/grid/nestedRecordFields/EditUserDialog.mjs +3 -0
  186. package/examples/grid/nestedRecordFields/Viewport.mjs +3 -1
  187. package/examples/list/animate/List.mjs +4 -0
  188. package/examples/list/animate/MainContainer.mjs +2 -0
  189. package/examples/list/circle/MainStore.mjs +1 -0
  190. package/examples/list/color/MainStore.mjs +1 -0
  191. package/examples/preloadingAssets/view/MainContainer.mjs +2 -0
  192. package/examples/stateProvider/advanced/MainContainer.mjs +1 -0
  193. package/examples/stateProvider/dialog/EditUserDialog.mjs +2 -0
  194. package/examples/stateProvider/dialog/MainContainer.mjs +1 -0
  195. package/examples/stateProvider/extendedClass/MainContainer.mjs +2 -0
  196. package/examples/stateProvider/inline/MainContainer.mjs +1 -0
  197. package/examples/stateProvider/inlineNoStateProvider/MainContainer.mjs +1 -0
  198. package/examples/stateProvider/inlineNoStateProvider/MainContainerController.mjs +2 -0
  199. package/examples/stateProvider/multiWindow/EditUserDialog.mjs +3 -0
  200. package/examples/stateProvider/multiWindow/MainContainer.mjs +1 -0
  201. package/examples/stateProvider/multiWindow/Viewport.mjs +1 -0
  202. package/examples/stateProvider/nestedData/MainContainer.mjs +1 -0
  203. package/examples/stateProvider/table/MainContainer.mjs +1 -0
  204. package/examples/table/covid/MainContainer.mjs +2 -0
  205. package/examples/table/covid/Store.mjs +1 -0
  206. package/examples/table/covid/TableContainer.mjs +3 -0
  207. package/examples/table/nestedRecordFields/EditUserDialog.mjs +3 -0
  208. package/examples/table/nestedRecordFields/Viewport.mjs +1 -0
  209. package/examples/todoList/version1/MainComponent.mjs +1 -1
  210. package/examples/toolbar/breadcrumb/view/MainContainer.mjs +2 -0
  211. package/examples/toolbar/paging/store/Users.mjs +1 -0
  212. package/examples/toolbar/paging/view/AddUserDialog.mjs +3 -0
  213. package/examples/toolbar/paging/view/MainContainer.mjs +3 -0
  214. package/examples/treeAccordion/MainContainer.mjs +2 -2
  215. package/examples/worker/task/MainContainer.mjs +1 -0
  216. package/learn/Glossary.md +1 -0
  217. package/learn/UsingTheseTopics.md +1 -0
  218. package/learn/benefits/ConfigSystem.md +2 -0
  219. package/learn/benefits/Effort.md +1 -0
  220. package/learn/benefits/Features.md +1 -0
  221. package/learn/benefits/FormsEngine.md +1 -0
  222. package/learn/benefits/FourEnvironments.md +2 -0
  223. package/learn/benefits/Introduction.md +2 -0
  224. package/learn/benefits/MultiWindow.md +3 -1
  225. package/learn/benefits/OffTheMainThread.md +2 -0
  226. package/learn/benefits/Quick.md +2 -0
  227. package/learn/benefits/RPCLayer.md +2 -0
  228. package/learn/benefits/Speed.md +2 -0
  229. package/learn/blog/v10-deep-dive-functional-components.md +293 -0
  230. package/learn/blog/v10-deep-dive-reactivity.md +522 -0
  231. package/learn/blog/v10-deep-dive-state-provider.md +432 -0
  232. package/learn/blog/v10-deep-dive-vdom-revolution.md +194 -0
  233. package/learn/blog/v10-post1-love-story.md +383 -0
  234. package/learn/comparisons/NeoVsAngular.md +90 -0
  235. package/learn/comparisons/NeoVsExtJs.md +178 -0
  236. package/learn/comparisons/NeoVsNextJs.md +124 -0
  237. package/learn/comparisons/NeoVsReact.md +95 -0
  238. package/learn/comparisons/NeoVsSolid.md +78 -0
  239. package/learn/comparisons/NeoVsVue.md +92 -0
  240. package/learn/comparisons/Overview.md +46 -0
  241. package/learn/gettingstarted/ComponentModels.md +2 -0
  242. package/learn/gettingstarted/Config.md +2 -0
  243. package/learn/gettingstarted/DescribingTheUI.md +2 -0
  244. package/learn/gettingstarted/Events.md +2 -0
  245. package/learn/gettingstarted/Extending.md +2 -0
  246. package/learn/gettingstarted/References.md +2 -0
  247. package/learn/gettingstarted/Setup.md +3 -2
  248. package/learn/gettingstarted/Workspaces.md +2 -0
  249. package/learn/guides/datahandling/Collections.md +1 -0
  250. package/learn/guides/datahandling/Records.md +1 -0
  251. package/learn/guides/datahandling/StateProviders.md +130 -16
  252. package/learn/guides/datahandling/Tables.md +1 -1
  253. package/learn/guides/fundamentals/ConfigSystemDeepDive.md +1 -0
  254. package/learn/guides/fundamentals/DeclarativeComponentTreesVsImperativeVdom.md +2 -0
  255. package/learn/guides/fundamentals/DeclarativeVDOMWithEffects.md +10 -8
  256. package/learn/guides/fundamentals/ExtendingNeoClasses.md +1 -0
  257. package/learn/guides/fundamentals/InstanceLifecycle.md +3 -1
  258. package/learn/guides/fundamentals/MainThreadAddons.md +2 -0
  259. package/learn/guides/specificfeatures/Mixins.md +3 -1
  260. package/learn/guides/specificfeatures/MultiWindow.md +3 -1
  261. package/learn/guides/specificfeatures/PortalApp.md +2 -0
  262. package/learn/guides/uibuildingblocks/ComponentsAndContainers.md +2 -0
  263. package/learn/guides/uibuildingblocks/CustomComponents.md +2 -0
  264. package/learn/guides/uibuildingblocks/Layouts.md +2 -0
  265. package/learn/guides/uibuildingblocks/WorkingWithVDom.md +28 -2
  266. package/learn/guides/userinteraction/Forms.md +2 -0
  267. package/learn/guides/userinteraction/events/CustomEvents.md +2 -1
  268. package/learn/guides/userinteraction/events/DomEvents.md +2 -0
  269. package/learn/javascript/ClassFeatures.md +4 -3
  270. package/learn/javascript/Classes.md +10 -13
  271. package/learn/javascript/Overrides.md +10 -6
  272. package/learn/javascript/Super.md +12 -8
  273. package/learn/tree.json +71 -64
  274. package/learn/tutorials/Earthquakes.md +2 -0
  275. package/learn/tutorials/RSP.md +3 -1
  276. package/learn/tutorials/TodoList.md +103 -7
  277. package/package.json +8 -6
  278. package/resources/scss/src/apps/email/ComposeView.scss +16 -0
  279. package/resources/scss/src/apps/email/MainView.scss +5 -0
  280. package/resources/scss/src/apps/portal/learn/ContentComponent.scss +5 -4
  281. package/src/DefaultConfig.mjs +12 -2
  282. package/src/Main.mjs +1 -0
  283. package/src/Neo.mjs +219 -166
  284. package/src/Xhr.mjs +1 -0
  285. package/src/button/Base.mjs +13 -0
  286. package/src/button/Effect.mjs +16 -2
  287. package/src/button/Split.mjs +2 -0
  288. package/src/calendar/store/Calendars.mjs +1 -0
  289. package/src/calendar/store/Colors.mjs +1 -0
  290. package/src/calendar/store/Events.mjs +1 -0
  291. package/src/calendar/view/DayComponent.mjs +2 -0
  292. package/src/calendar/view/EditEventContainer.mjs +4 -1
  293. package/src/calendar/view/MainContainer.mjs +13 -0
  294. package/src/calendar/view/MainContainerStateProvider.mjs +14 -28
  295. package/src/calendar/view/SettingsContainer.mjs +1 -0
  296. package/src/calendar/view/YearComponent.mjs +16 -0
  297. package/src/calendar/view/calendars/ColorsList.mjs +2 -0
  298. package/src/calendar/view/calendars/Container.mjs +2 -0
  299. package/src/calendar/view/calendars/EditContainer.mjs +1 -0
  300. package/src/calendar/view/month/Component.mjs +11 -0
  301. package/src/calendar/view/settings/GeneralContainer.mjs +1 -0
  302. package/src/calendar/view/settings/MonthContainer.mjs +1 -0
  303. package/src/calendar/view/settings/WeekContainer.mjs +1 -0
  304. package/src/calendar/view/settings/YearContainer.mjs +1 -0
  305. package/src/calendar/view/week/Component.mjs +15 -1
  306. package/src/calendar/view/week/TimeAxisComponent.mjs +4 -0
  307. package/src/code/LivePreview.mjs +51 -23
  308. package/src/collection/Base.mjs +7 -10
  309. package/src/collection/Filter.mjs +6 -0
  310. package/src/collection/Sorter.mjs +3 -0
  311. package/src/component/Abstract.mjs +412 -0
  312. package/src/component/Base.mjs +48 -1077
  313. package/src/component/Canvas.mjs +1 -0
  314. package/src/component/Chip.mjs +4 -0
  315. package/src/component/Circle.mjs +14 -0
  316. package/src/component/Clock.mjs +4 -0
  317. package/src/component/DateSelector.mjs +12 -0
  318. package/src/component/Gallery.mjs +11 -0
  319. package/src/component/Helix.mjs +24 -0
  320. package/src/component/Label.mjs +1 -0
  321. package/src/component/Legend.mjs +3 -0
  322. package/src/component/MagicMoveText.mjs +4 -0
  323. package/src/component/Progress.mjs +3 -0
  324. package/src/component/Splitter.mjs +3 -0
  325. package/src/component/StatusBadge.mjs +6 -0
  326. package/src/component/Timer.mjs +4 -0
  327. package/src/component/Toast.mjs +6 -0
  328. package/src/component/Video.mjs +1 -0
  329. package/src/component/mwc/Button.mjs +7 -0
  330. package/src/component/mwc/TextField.mjs +9 -0
  331. package/src/component/wrapper/AmChart.mjs +2 -0
  332. package/src/component/wrapper/GoogleMaps.mjs +3 -0
  333. package/src/component/wrapper/MapboxGL.mjs +5 -0
  334. package/src/component/wrapper/MonacoEditor.mjs +12 -0
  335. package/src/container/Accordion.mjs +2 -0
  336. package/src/container/Base.mjs +7 -3
  337. package/src/container/Panel.mjs +1 -0
  338. package/src/container/Viewport.mjs +1 -0
  339. package/src/controller/Application.mjs +1 -0
  340. package/src/controller/Base.mjs +1 -0
  341. package/src/controller/Component.mjs +1 -0
  342. package/src/core/Base.mjs +86 -33
  343. package/src/core/Compare.mjs +4 -7
  344. package/src/core/Config.mjs +65 -52
  345. package/src/core/Effect.mjs +86 -24
  346. package/src/core/EffectManager.mjs +117 -8
  347. package/src/core/IdGenerator.mjs +13 -44
  348. package/src/core/Observable.mjs +69 -65
  349. package/src/data/Model.mjs +2 -0
  350. package/src/data/Store.mjs +7 -0
  351. package/src/data/connection/WebSocket.mjs +2 -0
  352. package/src/date/DayViewComponent.mjs +2 -0
  353. package/src/date/SelectorContainer.mjs +14 -0
  354. package/src/dialog/Base.mjs +8 -0
  355. package/src/draggable/DragZone.mjs +5 -0
  356. package/src/draggable/tree/DragZone.mjs +1 -0
  357. package/src/filter/BooleanContainer.mjs +2 -0
  358. package/src/filter/NumberContainer.mjs +3 -0
  359. package/src/filter/ToggleOperatorsButton.mjs +2 -0
  360. package/src/form/Fieldset.mjs +6 -0
  361. package/src/form/field/Base.mjs +7 -0
  362. package/src/form/field/CheckBox.mjs +18 -0
  363. package/src/form/field/Chip.mjs +1 -0
  364. package/src/form/field/ComboBox.mjs +8 -0
  365. package/src/form/field/Country.mjs +1 -0
  366. package/src/form/field/Currency.mjs +2 -0
  367. package/src/form/field/Date.mjs +4 -0
  368. package/src/form/field/Display.mjs +1 -0
  369. package/src/form/field/Email.mjs +1 -0
  370. package/src/form/field/FileUpload.mjs +7 -0
  371. package/src/form/field/Hidden.mjs +1 -0
  372. package/src/form/field/Number.mjs +7 -0
  373. package/src/form/field/Password.mjs +1 -0
  374. package/src/form/field/Phone.mjs +3 -0
  375. package/src/form/field/Picker.mjs +2 -0
  376. package/src/form/field/Radio.mjs +1 -0
  377. package/src/form/field/Range.mjs +3 -0
  378. package/src/form/field/Search.mjs +2 -0
  379. package/src/form/field/Text.mjs +43 -5
  380. package/src/form/field/TextArea.mjs +7 -0
  381. package/src/form/field/Time.mjs +6 -0
  382. package/src/form/field/Url.mjs +3 -0
  383. package/src/form/field/ZipCode.mjs +2 -0
  384. package/src/form/field/trigger/Base.mjs +3 -0
  385. package/src/form/field/trigger/Clear.mjs +2 -0
  386. package/src/form/field/trigger/CopyToClipboard.mjs +2 -0
  387. package/src/form/field/trigger/Date.mjs +1 -0
  388. package/src/form/field/trigger/Picker.mjs +1 -0
  389. package/src/form/field/trigger/Search.mjs +1 -0
  390. package/src/form/field/trigger/SpinDown.mjs +2 -0
  391. package/src/form/field/trigger/SpinUp.mjs +1 -0
  392. package/src/form/field/trigger/Time.mjs +2 -0
  393. package/src/functional/_export.mjs +6 -0
  394. package/src/functional/button/Base.mjs +384 -0
  395. package/src/functional/component/Base.mjs +405 -0
  396. package/src/functional/defineComponent.mjs +102 -0
  397. package/src/functional/useConfig.mjs +52 -0
  398. package/src/functional/useEvent.mjs +43 -0
  399. package/src/grid/Body.mjs +20 -1
  400. package/src/grid/Container.mjs +50 -60
  401. package/src/grid/ScrollManager.mjs +2 -0
  402. package/src/grid/VerticalScrollbar.mjs +2 -0
  403. package/src/grid/column/Base.mjs +2 -0
  404. package/src/grid/header/Button.mjs +7 -0
  405. package/src/grid/header/Toolbar.mjs +6 -0
  406. package/src/grid/plugin/AnimateRows.mjs +2 -0
  407. package/src/layout/Base.mjs +3 -0
  408. package/src/layout/Card.mjs +1 -0
  409. package/src/layout/Cube.mjs +18 -4
  410. package/src/layout/Fit.mjs +1 -0
  411. package/src/layout/Flexbox.mjs +7 -0
  412. package/src/layout/Form.mjs +2 -0
  413. package/src/layout/Grid.mjs +1 -0
  414. package/src/layout/HBox.mjs +1 -0
  415. package/src/layout/VBox.mjs +1 -0
  416. package/src/list/Base.mjs +13 -0
  417. package/src/list/Chip.mjs +1 -0
  418. package/src/list/Circle.mjs +2 -0
  419. package/src/list/Color.mjs +1 -0
  420. package/src/list/plugin/Animate.mjs +2 -0
  421. package/src/main/DeltaUpdates.mjs +1 -0
  422. package/src/main/DomEvents.mjs +2 -0
  423. package/src/main/addon/CloneNode.mjs +1 -0
  424. package/src/main/addon/Cookie.mjs +1 -0
  425. package/src/main/addon/GoogleMaps.mjs +1 -0
  426. package/src/main/addon/LocalStorage.mjs +1 -0
  427. package/src/main/addon/MapboxGL.mjs +1 -0
  428. package/src/main/addon/Markdown.mjs +1 -0
  429. package/src/main/addon/Navigator.mjs +1 -0
  430. package/src/main/addon/Popover.mjs +1 -0
  431. package/src/main/addon/Stylesheet.mjs +1 -0
  432. package/src/main/addon/WindowPosition.mjs +1 -0
  433. package/src/manager/Component.mjs +0 -71
  434. package/src/manager/VDomUpdate.mjs +320 -0
  435. package/src/menu/List.mjs +6 -0
  436. package/src/menu/Model.mjs +1 -0
  437. package/src/menu/Panel.mjs +3 -0
  438. package/src/menu/Store.mjs +1 -0
  439. package/src/mixin/DomEvents.mjs +130 -0
  440. package/src/mixin/VdomLifecycle.mjs +670 -0
  441. package/src/plugin/Base.mjs +1 -0
  442. package/src/plugin/Resizable.mjs +2 -0
  443. package/src/selection/Model.mjs +15 -18
  444. package/src/selection/grid/BaseModel.mjs +1 -0
  445. package/src/sitemap/Component.mjs +1 -0
  446. package/src/state/Provider.mjs +129 -87
  447. package/src/state/createHierarchicalDataProxy.mjs +39 -25
  448. package/src/tab/Container.mjs +6 -0
  449. package/src/tab/Strip.mjs +1 -0
  450. package/src/tab/header/Button.mjs +2 -0
  451. package/src/tab/header/EffectButton.mjs +2 -0
  452. package/src/tab/header/Toolbar.mjs +1 -0
  453. package/src/table/Body.mjs +3 -0
  454. package/src/table/Container.mjs +10 -0
  455. package/src/table/header/Button.mjs +8 -0
  456. package/src/table/header/Toolbar.mjs +5 -0
  457. package/src/table/plugin/CellEditing.mjs +1 -0
  458. package/src/toolbar/Base.mjs +4 -0
  459. package/src/toolbar/Breadcrumb.mjs +3 -0
  460. package/src/toolbar/Paging.mjs +5 -0
  461. package/src/tooltip/Base.mjs +2 -0
  462. package/src/tree/List.mjs +3 -0
  463. package/src/util/HashHistory.mjs +1 -0
  464. package/src/util/KeyNavigation.mjs +2 -0
  465. package/src/util/Matrix.mjs +1 -0
  466. package/src/util/VDom.mjs +18 -5
  467. package/src/util/VNode.mjs +7 -1
  468. package/src/util/vdom/TreeBuilder.mjs +105 -0
  469. package/src/vdom/Helper.mjs +35 -23
  470. package/src/vdom/VNode.mjs +4 -6
  471. package/src/worker/App.mjs +1 -0
  472. package/src/worker/Base.mjs +2 -0
  473. package/src/worker/Manager.mjs +2 -0
  474. package/src/worker/ServiceBase.mjs +6 -1
  475. package/src/worker/mixin/RemoteMethodAccess.mjs +1 -6
  476. package/test/siesta/siesta.js +17 -2
  477. package/test/siesta/tests/VdomCalendar.mjs +19 -15
  478. package/test/siesta/tests/VdomHelper.mjs +7 -7
  479. package/test/siesta/tests/classic/Button.mjs +113 -0
  480. package/test/siesta/tests/core/Effect.mjs +10 -14
  481. package/test/siesta/tests/core/EffectBatching.mjs +72 -79
  482. package/test/siesta/tests/functional/Button.mjs +113 -0
  483. package/test/siesta/tests/state/ProviderNestedDataConfigs.mjs +314 -0
  484. package/test/siesta/tests/state/createHierarchicalDataProxy.mjs +42 -55
  485. package/test/siesta/tests/vdom/Advanced.mjs +14 -8
  486. package/test/siesta/tests/vdom/VdomAsymmetricUpdates.mjs +366 -0
  487. package/test/siesta/tests/vdom/VdomRealWorldUpdates.mjs +249 -0
  488. package/test/siesta/tests/vdom/layout/Cube.mjs +11 -7
  489. package/test/siesta/tests/vdom/table/Container.mjs +9 -5
  490. package/learn/javascript/NewNode.md +0 -31
  491. package/src/core/EffectBatchManager.mjs +0 -68
@@ -1,11 +1,9 @@
1
- import Base from '../core/Base.mjs';
1
+ import Abstract from './Abstract.mjs';
2
2
  import ClassSystemUtil from '../util/ClassSystem.mjs';
3
3
  import ComponentManager from '../manager/Component.mjs';
4
- import DomEventManager from '../manager/DomEvent.mjs';
5
4
  import KeyNavigation from '../util/KeyNavigation.mjs';
6
5
  import Logger from '../util/Logger.mjs';
7
6
  import NeoArray from '../util/Array.mjs';
8
- import Observable from '../core/Observable.mjs';
9
7
  import Rectangle from '../util/Rectangle.mjs';
10
8
  import Style from '../util/Style.mjs';
11
9
  import VDomUtil from '../util/VDom.mjs';
@@ -13,19 +11,17 @@ import VNodeUtil from '../util/VNode.mjs';
13
11
  import {isDescriptor} from '../core/ConfigSymbols.mjs';
14
12
 
15
13
  const
16
- addUnits = value => value == null ? value : isNaN(value) ? value : `${value}px`,
17
- closestController = Symbol.for('closestController'),
18
- closestProvider = Symbol.for('closestProvider'),
19
- {currentWorker} = Neo,
20
- lengthRE = /^\d+\w+$/,
21
- twoWayBindingSymbol = Symbol.for('twoWayBinding');
14
+ addUnits = value => value == null ? value : isNaN(value) ? value : `${value}px`,
15
+ closestController = Symbol.for('closestController'),
16
+ {currentWorker} = Neo,
17
+ lengthRE = /^\d+\w+$/;
22
18
 
23
19
  /**
24
20
  * Base class for all Components which have a DOM representation
25
21
  * @class Neo.component.Base
26
- * @extends Neo.core.Base
22
+ * @extends Neo.component.Abstract
27
23
  */
28
- class Component extends Base {
24
+ class Component extends Abstract {
29
25
  /**
30
26
  * Valid values for hideMode
31
27
  * @member {String[]} hideModes=['removeDom','visibility']
@@ -33,12 +29,6 @@ class Component extends Base {
33
29
  * @static
34
30
  */
35
31
  static hideModes = ['removeDom', 'visibility']
36
- /**
37
- * True automatically applies the core.Observable mixin
38
- * @member {Boolean} observable=true
39
- * @static
40
- */
41
- static observable = true
42
32
 
43
33
  static config = {
44
34
  /**
@@ -55,6 +45,7 @@ class Component extends Base {
55
45
  * The default alignment specification to position this Component relative to some other
56
46
  * Component, or Element or Rectangle. Only applies in case floating = true.
57
47
  * @member {Object|String} align_={[isDescriptor]: true, merge: 'deep', value: {edgeAlign: 't-b',constrainTo: 'document.body'}}
48
+ * @reactive
58
49
  */
59
50
  align_: {
60
51
  [isDescriptor]: true,
@@ -64,91 +55,28 @@ class Component extends Base {
64
55
  constrainTo: 'document.body'
65
56
  }
66
57
  },
67
- /**
68
- * The name of the App this component belongs to
69
- * @member {String|null} appName_=null
70
- */
71
- appName_: null,
72
- /**
73
- * True automatically mounts a component after being rendered.
74
- * Use this for the top level component of your app.
75
- * @member {Boolean} autoMount=false
76
- * @tutorial 02_ClassSystem
77
- */
78
- autoMount: false,
79
- /**
80
- * True automatically renders a component after being created inside the init call.
81
- * Use this for the top level component of your app.
82
- * @member {Boolean} autoRender=false
83
- * @see {@link Neo.component.Base#init init}
84
- * @tutorial 02_ClassSystem
85
- */
86
- autoRender: false,
87
58
  /**
88
59
  * CSS selectors to apply to the root level node of this component
89
60
  * @member {String[]} baseCls=[]
90
61
  */
91
62
  baseCls: [],
92
- /**
93
- * Bind configs to state.Provider data properties.
94
- * Example for a button.Base:
95
- * @example
96
- * bind: {
97
- * iconCls: data => `fa fa-{$data.icon}`,
98
- * text : data => data.foo.bar
99
- * }
100
- * @see https://github.com/neomjs/neo/blob/dev/examples/stateProvider
101
- * @member {Object|null} bind=null
102
- */
103
- bind: null,
104
- /**
105
- * Custom CSS selectors to apply to the root level node of this component
106
- * You can override baseCls to remove default selectors.
107
- * @member {String[]} cls_=null
108
- */
109
- cls_: null,
110
63
  /**
111
64
  * manager.Focus will change this flag on focusin & out dom events
112
65
  * @member {Boolean} containsFocus_=false
113
66
  * @protected
67
+ * @reactive
114
68
  */
115
69
  containsFocus_: false,
116
70
  /**
117
71
  * Assign a component controller to this component (pass an imported module or the string based class name)
118
72
  * @member {Neo.controller.Component|String} controller_=null
73
+ * @reactive
119
74
  */
120
75
  controller_: null,
121
- /**
122
- * Convenience shortcut to access the data config of the closest state.Provider.
123
- * Read only.
124
- * @member {Object} data_=null
125
- * @protected
126
- */
127
- data_: null,
128
- /**
129
- * Disabled components will get the neo-disabled cls applied and won't receive DOM events
130
- * @member {Boolean} disabled_=false
131
- */
132
- disabled_: false,
133
- /**
134
- * An array of domListener configs
135
- * @member {Object[]|null} domListeners_=null
136
- * @example
137
- * afterSetStayOnHover(value, oldValue) {
138
- * if (value) {
139
- * let me = this;
140
- *
141
- * me.addDomListeners(
142
- * {mouseenter: me.onMouseEnter, scope: me},
143
- * {mouseleave: me.onMouseLeave, scope: me}
144
- * )
145
- * }
146
- *}
147
- */
148
- domListeners_: null,
149
76
  /**
150
77
  * Set this config to true to dynamically import a DropZone module & create an instance
151
78
  * @member {Boolean} droppable_=false
79
+ * @reactive
152
80
  */
153
81
  droppable_: false,
154
82
  /**
@@ -170,39 +98,30 @@ class Component extends Base {
170
98
  * @protected
171
99
  */
172
100
  hasBeenMounted: false,
173
- /**
174
- * Internal flag
175
- * @member {Boolean} hasRenderingListener=false
176
- * @protected
177
- */
178
- hasRenderingListener: false,
179
- /**
180
- * Internal flag for vdom changes after a component got unmounted
181
- * (delta updates can no longer get applied & a new render call is required before re-mounting)
182
- * @member {Boolean} hasUnmountedVdomChanges_=false
183
- * @protected
184
- */
185
- hasUnmountedVdomChanges_: false,
186
101
  /**
187
102
  * Shortcut for style.height, defaults to px
188
103
  * @member {Number|String|null} height_=null
104
+ * @reactive
189
105
  */
190
106
  height_: null,
191
107
  /**
192
108
  * Initial setting to hide or show the component and
193
109
  * you can use either hide()/show() or change this config directly to change the hidden state
194
110
  * @member {Boolean} hidden_=false
111
+ * @reactive
195
112
  */
196
113
  hidden_: false,
197
114
  /**
198
115
  * Used for hide and show and defines if the component
199
116
  * should use css visibility:'hidden' or vdom:removeDom
200
117
  * @member {String} hideMode_='removeDom'
118
+ * @reactive
201
119
  */
202
120
  hideMode_: 'removeDom',
203
121
  /**
204
122
  * The top level innerHTML of the component
205
123
  * @member {String|null} html_=null
124
+ * @reactive
206
125
  */
207
126
  html_: null,
208
127
  /**
@@ -211,78 +130,48 @@ class Component extends Base {
211
130
  * @member {Boolean|String} isLoading=false
212
131
  */
213
132
  isLoading_: false,
214
- /**
215
- * Internal flag which will get set to true while an update request (worker messages) is in progress
216
- * @member {Boolean} isVdomUpdating_=false
217
- * @protected
218
- */
219
- isVdomUpdating_: false,
220
133
  /**
221
134
  * Using the keys config will create an instance of Neo.util.KeyNavigation.
222
135
  * @see {@link Neo.util.KeyNavigation KeyNavigation}
223
136
  * @member {Object} keys_=null
137
+ * @reactive
224
138
  */
225
139
  keys_: null,
226
140
  /**
227
141
  * Gets used inside afterSetIsLoading() to define the CSS for the loading spinner icon
228
142
  * @member {String[]} loadingSpinnerCls_=['fa','fa-spinner','fa-spin']
143
+ * @reactive
229
144
  */
230
145
  loadingSpinnerCls_: ['fa', 'fa-spinner', 'fa-spin'],
231
146
  /**
232
147
  * Shortcut for style.maxHeight, defaults to px
233
148
  * @member {Number|String|null} maxHeight_=null
149
+ * @reactive
234
150
  */
235
151
  maxHeight_: null,
236
152
  /**
237
153
  * Shortcut for style.maxWidth, defaults to px
238
154
  * @member {Number|String|null} maxWidth_=null
155
+ * @reactive
239
156
  */
240
157
  maxWidth_: null,
241
158
  /**
242
159
  * Shortcut for style.minHeight, defaults to px
243
160
  * @member {Number|String|null} minHeight_=null
161
+ * @reactive
244
162
  */
245
163
  minHeight_: null,
246
164
  /**
247
165
  * Shortcut for style.minWidth, defaults to px
248
166
  * @member {Number|String|null} minWidth_=null
167
+ * @reactive
249
168
  */
250
169
  minWidth_: null,
251
- /**
252
- * Override specific stateProvider data properties.
253
- * This will merge the content.
254
- * @member {Object|null} modelData=null
255
- */
256
- modelData: null,
257
- /**
258
- * True in case the component is mounted to the DOM
259
- * @member {Boolean} mounted_=false
260
- * @protected
261
- */
262
- mounted_: false,
263
- /**
264
- * Internal flag which will get set to true in case an update call arrives while another update is running
265
- * @member {Boolean} needsVdomUpdate_=false
266
- * @protected
267
- */
268
- needsVdomUpdate_: false,
269
- /**
270
- * If the parentId does not match a neo component id, you can manually set this value for finding
271
- * view controllers or state providers.
272
- * Use case: manually dropping components into a vdom structure
273
- * @member {Neo.component.Base|null} parentComponent_=null
274
- * @protected
275
- */
276
- parentComponent_: null,
277
- /**
278
- * The parent component id or document.body
279
- * @member {String} parentId_='document.body'
280
- */
281
- parentId_: 'document.body',
282
170
  /**
283
171
  * Array of Plugin Modules and / or config objects
284
172
  * @member {Array|null} plugins_=null
285
173
  * @protected
174
+ * @reactive
286
175
  */
287
176
  plugins_: null,
288
177
  /**
@@ -290,6 +179,7 @@ class Component extends Base {
290
179
  * References will also get mapped into the vdom root (data-ref: value).
291
180
  * @member {String|null} reference_=null
292
181
  * @protected
182
+ * @reactive
293
183
  */
294
184
  reference_: null,
295
185
  /**
@@ -299,16 +189,11 @@ class Component extends Base {
299
189
  * @protected
300
190
  */
301
191
  responsive_: null,
302
- /**
303
- * True in case the component is rendering the vnode
304
- * @member {Boolean} rendering_=false
305
- * @protected
306
- */
307
- rendering_: false,
308
192
  /**
309
193
  * Specify a role tag attribute for the vdom root.
310
194
  * See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles
311
195
  * @member {String|null} role_=null
196
+ * @reactive
312
197
  */
313
198
  role_: null,
314
199
  /**
@@ -316,19 +201,9 @@ class Component extends Base {
316
201
  * Set this to 'x' or 'y' to add style 'overflow-x' or 'overflow-y' to 'auto'
317
202
  * Other than false this will add cls 'neo-scrollable'.
318
203
  * @member {Boolean|"x"|"y"} scrollable_=false
204
+ * @reactive
319
205
  */
320
206
  scrollable_: false,
321
- /**
322
- * Set this to true for bulk updates. Ensure to set it back to false afterwards.
323
- * Internally the value will get saved as a number to ensure that child methods won't stop the silent mode too early.
324
- * @member {Boolean} silentVdomUpdate_=false
325
- */
326
- silentVdomUpdate_: false,
327
- /**
328
- * Optionally add a state.Provider to share state data with child components
329
- * @member {Object|null} stateProvider_=null
330
- */
331
- stateProvider_: null,
332
207
  /**
333
208
  * Style attributes added to this vdom root. see: getVdomRoot()
334
209
  * @member {Object} style={[isDescriptor]: true, merge: 'shallow', value: null}
@@ -342,6 +217,7 @@ class Component extends Base {
342
217
  * You can pass a used theme directly to any component,
343
218
  * to style specific component trees differently from your main view.
344
219
  * @member {String|null} theme_=null
220
+ * @reactive
345
221
  */
346
222
  theme_: null,
347
223
  /**
@@ -349,11 +225,13 @@ class Component extends Base {
349
225
  * this shortcut enables us to change the vdom root tag on instance level.
350
226
  * Use cases: switch a Toolbar to a "nav" tag, switch a SideNav to an "aside" tag.
351
227
  * @member {String|null} tag_=null
228
+ * @reactive
352
229
  */
353
230
  tag_: null,
354
231
  /**
355
232
  * The top level textContent of the component
356
233
  * @member {String|null} text_=null
234
+ * @reactive
357
235
  */
358
236
  text_: null,
359
237
  /**
@@ -366,51 +244,30 @@ class Component extends Base {
366
244
  * If a widget needs its own instance for any reason, inslude the property `ownInstance : true`
367
245
  * in the tooltip config object.
368
246
  * @member {Object|String} tooltip_=null
247
+ * @reactive
369
248
  */
370
249
  tooltip_: null,
371
250
  /**
372
251
  * Add 'primary' and other attributes to make it an outstanding design
373
252
  * @member {String|null} ui_=null
253
+ * @reactive
374
254
  */
375
255
  ui_: null,
376
- /**
377
- * Defines the depth of the vdom tree for the next update cycle.
378
- * - The value 1 will only send the current vdom structure as it is
379
- * - The value of 2 will include the vdom of direct children
380
- * - The value of 3 will include the vdom of grandchildren
381
- * - The value of -1 will include the full tree of any depth
382
- * @member {Number} updateDepth_=1
383
- */
384
- updateDepth_: 1,
385
- /**
386
- * The component vnode tree. Available after the component got rendered.
387
- * @member {Object} vnode_=={[isDescriptor]: true, value: null, isEqual: (a, b) => a === b,}
388
- * @protected
389
- */
390
- vnode_: {
391
- [isDescriptor]: true,
392
- clone : 'none',
393
- cloneOnGet : 'none',
394
- isEqual : (a, b) => a === b, // vnode trees can be huge, and will get compared by the vdom worker.
395
- value : null,
396
- },
397
256
  /**
398
257
  * Shortcut for style.width, defaults to px
399
258
  * @member {Number|String|null} width_=null
259
+ * @reactive
400
260
  */
401
261
  width_: null,
402
- /**
403
- * The custom windowIs (timestamp) this component belongs to
404
- * @member {Number|null} windowId_=null
405
- */
406
- windowId_: null,
407
262
  /**
408
263
  * @member {String[]|null} wrapperCls_=null
264
+ * @reactive
409
265
  */
410
266
  wrapperCls_: null,
411
267
  /**
412
268
  * Top level style attributes. Useful in case getVdomRoot() does not point to the top level DOM node.
413
269
  * @member {Object|null} wrapperStyle_={[isDescriptor]: true, merge: 'shallow', value: null}
270
+ * @reactive
414
271
  */
415
272
  wrapperStyle_: {
416
273
  [isDescriptor]: true,
@@ -424,31 +281,6 @@ class Component extends Base {
424
281
  _vdom: {}
425
282
  }
426
283
 
427
- /**
428
- * If an update() gets called while a parent is updating, we store the id & distance of the
429
- * requesting component inside the childUpdateCache of the parent, to get resolved once the update is done.
430
- * e.g. childUpdateCache = {'neo-grid-view-1': {distance: 1, resolve: fn}}
431
- * @member {Object} childUpdateCache={}
432
- */
433
- childUpdateCache = {}
434
- /**
435
- * Stores the updateDepth while an update is running to enable checks for parent update collisions
436
- * @member {Number|null} currentUpdateDepth=null
437
- */
438
- currentUpdateDepth = null
439
- /**
440
- * @member {Function[]} resolveUpdateCache=[]
441
- */
442
- resolveUpdateCache = []
443
-
444
- /**
445
- * Convenience shortcut to access the App this component belongs to
446
- * @returns {Neo.controller.Application|null}
447
- */
448
- get app() {
449
- return Neo.apps[this.appName] || null
450
- }
451
-
452
284
  /**
453
285
  * Returns true if this Component is fully visible, that is it is not hidden and has no hidden ancestors
454
286
  */
@@ -456,27 +288,6 @@ class Component extends Base {
456
288
  return this.mounted && !this.hidden && (!this.parent || this.parent.isVisible);
457
289
  }
458
290
 
459
- /**
460
- * Apply component based listeners
461
- * @member {Object} listeners={}
462
- */
463
- get listeners() {
464
- return this._listeners || {}
465
- }
466
- set listeners(value) {
467
- this._listeners = value
468
- }
469
-
470
- /**
471
- * Convenience method to access the parent component
472
- * @returns {Neo.component.Base|null}
473
- */
474
- get parent() {
475
- let me = this;
476
-
477
- return me.parentComponent || (me.parentId === 'document.body' ? null : Neo.getComponent(me.parentId))
478
- }
479
-
480
291
  /**
481
292
  * True after the component render() method was called. Also fires the rendered event.
482
293
  * @member {Boolean} rendered=false
@@ -517,21 +328,7 @@ class Component extends Base {
517
328
  this.cls = cls
518
329
  }
519
330
 
520
- /**
521
- * Convenience shortcut to add additional dom listeners
522
- * @param {Object|Object[]} value
523
- */
524
- addDomListeners(value) {
525
- if (!Array.isArray(value)) {
526
- value = [value]
527
- }
528
-
529
- let domListeners = this.domListeners;
530
-
531
- domListeners.push(...value);
532
331
 
533
- this.domListeners = domListeners
534
- }
535
332
 
536
333
  /**
537
334
  * Either a string like 'color: red; background-color: blue;'
@@ -597,30 +394,6 @@ class Component extends Base {
597
394
  me.update()
598
395
  }
599
396
 
600
- /**
601
- * Triggered after any config got changed
602
- * @param {String} key
603
- * @param {*} value
604
- * @param {*} oldValue
605
- * @protected
606
- */
607
- afterSetConfig(key, value, oldValue) {
608
- let me = this;
609
-
610
- if (Neo.isUsingStateProviders && me[twoWayBindingSymbol]) {
611
- // When a component config is updated by its state provider, this flag is set to the config's key.
612
- // This prevents circular updates in two-way data bindings by skipping the push back to the state provider.
613
- if (me._skipTwoWayPush === key) {
614
- return;
615
- }
616
- let binding = me.bind?.[key];
617
-
618
- if (binding?.twoWay) {
619
- this.getStateProvider()?.setData(binding.key, value)
620
- }
621
- }
622
- }
623
-
624
397
  /**
625
398
  * Triggered after the disabled config got changed
626
399
  * @param {Boolean} value
@@ -634,19 +407,7 @@ class Component extends Base {
634
407
  this.cls = cls
635
408
  }
636
409
 
637
- /**
638
- * Registers the domListeners inside the Neo.manager.DomEvent
639
- * @param {Object[]} value
640
- * @param {Object[]} oldValue
641
- * @protected
642
- */
643
- afterSetDomListeners(value, oldValue) {
644
- let me = this;
645
410
 
646
- if (value?.[0] || oldValue?.[0]) {
647
- DomEventManager.updateDomListeners(me, value, oldValue)
648
- }
649
- }
650
411
 
651
412
  /**
652
413
  * Triggered after the droppable config got changed
@@ -670,29 +431,6 @@ class Component extends Base {
670
431
  }
671
432
  }
672
433
 
673
- /**
674
- * Triggered after the hasUnmountedVdomChanges config got changed
675
- * @param {Boolean} value
676
- * @param {Boolean} oldValue
677
- * @protected
678
- */
679
- afterSetHasUnmountedVdomChanges(value, oldValue) {
680
- if (value || (!value && oldValue)) {
681
- let parentIds = ComponentManager.getParentIds(this),
682
- i = 0,
683
- len = parentIds.length,
684
- parent;
685
-
686
- for (; i < len; i++) {
687
- parent = Neo.getComponent(parentIds[i]);
688
-
689
- if (parent) {
690
- parent._hasUnmountedVdomChanges = value // silent update
691
- }
692
- }
693
- }
694
- }
695
-
696
434
  /**
697
435
  * Triggered after the height config got changed
698
436
  * @param {Number|String|null} value
@@ -746,10 +484,7 @@ class Component extends Base {
746
484
  */
747
485
  afterSetId(value, oldValue) {
748
486
  super.afterSetId(value, oldValue);
749
- this.changeVdomRootKey('id', value);
750
-
751
- oldValue && ComponentManager.unregister(oldValue);
752
- value && ComponentManager.register(this)
487
+ this.changeVdomRootKey('id', value)
753
488
  }
754
489
 
755
490
  /**
@@ -786,16 +521,6 @@ class Component extends Base {
786
521
  }
787
522
  }
788
523
 
789
- /**
790
- * Triggered after the isVdomUpdating config got changed
791
- * @param {Number|null} value
792
- * @param {Number|null} oldValue
793
- * @protected
794
- */
795
- afterSetIsVdomUpdating(value, oldValue) {
796
- this.currentUpdateDepth = value ? this.updateDepth : null
797
- }
798
-
799
524
  /**
800
525
  * Triggered after the maxHeight config got changed
801
526
  * @param {Number|String|null} value
@@ -847,31 +572,23 @@ class Component extends Base {
847
572
  * @protected
848
573
  */
849
574
  afterSetMounted(value, oldValue) {
575
+ super.afterSetMounted(value, oldValue);
576
+
850
577
  if (oldValue !== undefined) {
851
- let me = this,
852
- {id, windowId} = me;
578
+ let me = this;
853
579
 
854
- if (value) {
580
+ if (value) { // mount
855
581
  me.hasBeenMounted = true;
856
582
 
857
- if (me.domListeners?.length > 0) {
858
- // todo: the main thread reply of mount arrives after pushing the task into the queue which does not ensure the dom is mounted
859
- me.timeout(150).then(() => {
860
- DomEventManager.mountDomListeners(me)
861
- })
862
- }
863
-
864
- me.doResolveUpdateCache();
865
-
866
583
  if (me.floating) {
867
584
  me.alignTo();
868
585
 
869
586
  // Focus will be pushed into the first input field or other focusable item
870
- me.focus(id, true)
587
+ me.focus(me.id, true)
871
588
  }
872
589
 
873
- me.fire('mounted', me.id)
874
- } else {
590
+ me.fire('mounted', me.id);
591
+ } else { // unmount
875
592
  me.revertFocus()
876
593
  }
877
594
  }
@@ -958,16 +675,6 @@ class Component extends Base {
958
675
  }
959
676
  }
960
677
 
961
- /**
962
- * Triggered after the stateProvider config got changed
963
- * @param {Neo.state.Provider} value
964
- * @param {Object|Neo.state.Provider|null} oldValue
965
- * @protected
966
- */
967
- afterSetStateProvider(value, oldValue) {
968
- value?.createBindings(this)
969
- }
970
-
971
678
  /**
972
679
  * Triggered after the style config got changed
973
680
  * @param {Object} value
@@ -1071,26 +778,6 @@ class Component extends Base {
1071
778
  me.cls = cls
1072
779
  }
1073
780
 
1074
- /**
1075
- * Triggered after the vdom pseudo-config got changed
1076
- * @param {Object} value
1077
- * @param {Object|null} oldValue
1078
- * @protected
1079
- */
1080
- afterSetVdom(value, oldValue) {
1081
- this.updateVdom()
1082
- }
1083
-
1084
- /**
1085
- * Triggered after the vnode config got changed
1086
- * @param {Object} value
1087
- * @param {Object|null} oldValue
1088
- * @protected
1089
- */
1090
- afterSetVnode(value, oldValue) {
1091
- oldValue !== undefined && this.syncVnodeTree()
1092
- }
1093
-
1094
781
  /**
1095
782
  * Triggered after the width config got changed
1096
783
  * @param {Number|String|null} value
@@ -1109,21 +796,12 @@ class Component extends Base {
1109
796
  * @protected
1110
797
  */
1111
798
  afterSetWindowId(value, oldValue) {
1112
- let me = this,
1113
- controller = me.controller;
799
+ super.afterSetWindowId(value, oldValue);
1114
800
 
1115
- if (value) {
1116
- currentWorker.insertThemeFiles(value, me.__proto__);
801
+ let controller = this.controller;
1117
802
 
1118
- if (controller) {
1119
- controller.windowId = value
1120
- }
1121
- }
1122
-
1123
- // If a component gets moved into a different window, an update cycle might still be running.
1124
- // Since the update might no longer get mapped, we want to re-enable this instance for future updates.
1125
- if (oldValue) {
1126
- me.isVdomUpdating = false
803
+ if (controller) {
804
+ controller.windowId = value
1127
805
  }
1128
806
  }
1129
807
 
@@ -1207,16 +885,6 @@ class Component extends Base {
1207
885
  return value ? [...value] : []
1208
886
  }
1209
887
 
1210
- /**
1211
- * Triggered when accessing the data config
1212
- * Convenience shortcut which is expensive to use, since it will generate a merged parent state providers data map.
1213
- * @param {Object} value
1214
- * @protected
1215
- */
1216
- beforeGetData(value) {
1217
- return this.getStateProvider().getHierarchyData()
1218
- }
1219
-
1220
888
  /**
1221
889
  * Triggered when accessing the style config
1222
890
  * @param {Object} value
@@ -1377,31 +1045,6 @@ class Component extends Base {
1377
1045
  return (Neo.isNumber(oldValue) && oldValue > 0) ? (oldValue - 1) : 0
1378
1046
  }
1379
1047
 
1380
- /**
1381
- * Triggered before the stateProvider config gets changed.
1382
- * Creates a state.Provider instance if needed.
1383
- * @param {Object} value
1384
- * @param {Object} oldValue
1385
- * @returns {Neo.state.Provider}
1386
- * @protected
1387
- */
1388
- beforeSetStateProvider(value, oldValue) {
1389
- oldValue?.destroy();
1390
-
1391
- if (value) {
1392
- let me = this,
1393
- defaultValues = {component: me};
1394
-
1395
- if (me.modelData) {
1396
- defaultValues.data = me.modelData
1397
- }
1398
-
1399
- return ClassSystemUtil.beforeSetInstance(value, 'Neo.state.Provider', defaultValues)
1400
- }
1401
-
1402
- return null
1403
- }
1404
-
1405
1048
  /**
1406
1049
  * Triggered before the updateDepth config gets changed.
1407
1050
  * @param {Number} value
@@ -1486,22 +1129,6 @@ class Component extends Base {
1486
1129
  }
1487
1130
  }
1488
1131
 
1489
- /**
1490
- * Convenience shortcut to create a component reference
1491
- * @returns {Object}
1492
- */
1493
- createVdomReference() {
1494
- let me = this,
1495
- reference = {componentId: me.id},
1496
- vdomId = me.vdom.id;
1497
-
1498
- if (vdomId && me.id !== vdomId) {
1499
- reference.id = vdomId
1500
- }
1501
-
1502
- return reference
1503
- }
1504
-
1505
1132
  /**
1506
1133
  * Unregister this instance from the ComponentManager
1507
1134
  * @param {Boolean} updateParentVdom=false true to remove the component from the parent vdom => real dom
@@ -1509,23 +1136,16 @@ class Component extends Base {
1509
1136
  * todo: unregister events
1510
1137
  */
1511
1138
  destroy(updateParentVdom=false, silent=false) {
1512
- let me = this,
1513
- {parent, parentId} = me,
1514
- parentStateProvider = parent?.getStateProvider(),
1139
+ let me = this,
1140
+ {parent, parentId} = me,
1515
1141
  parentVdom;
1516
1142
 
1517
1143
  me.revertFocus();
1518
1144
 
1519
- me.domListeners = [];
1520
-
1521
1145
  me.controller = null; // triggers destroy()
1522
1146
 
1523
1147
  me.reference && me.getController()?.removeReference(me); // remove own reference from parent controllers
1524
1148
 
1525
- me.stateProvider = null; // triggers destroy()
1526
-
1527
- me.bind && parentStateProvider?.removeBindings(me.id);
1528
-
1529
1149
  me.plugins?.forEach(plugin => {
1530
1150
  plugin.destroy()
1531
1151
  });
@@ -1541,8 +1161,6 @@ class Component extends Base {
1541
1161
  }
1542
1162
  }
1543
1163
 
1544
- ComponentManager.unregister(me);
1545
-
1546
1164
  super.destroy();
1547
1165
 
1548
1166
  // We do want to prevent delayed calls after a component instance got destroyed.
@@ -1550,18 +1168,6 @@ class Component extends Base {
1550
1168
  me.unmount = Neo.emptyFn
1551
1169
  }
1552
1170
 
1553
- /**
1554
- * Triggers all stored resolve() callbacks
1555
- */
1556
- doResolveUpdateCache() {
1557
- let me = this;
1558
-
1559
- if (me.resolveUpdateCache) {
1560
- me.resolveUpdateCache.forEach(item => item());
1561
- me.resolveUpdateCache = []
1562
- }
1563
- }
1564
-
1565
1171
  /**
1566
1172
  * Convenience shortcut for Neo.manager.Component.down
1567
1173
  * @param {Object|String} config
@@ -1572,59 +1178,6 @@ class Component extends Base {
1572
1178
  return ComponentManager.down(this, config, returnFirstMatch)
1573
1179
  }
1574
1180
 
1575
- /**
1576
- * Internal method to send update requests to the vdom worker
1577
- * @param {function} [resolve] used by promiseUpdate()
1578
- * @param {function} [reject] used by promiseUpdate()
1579
- * @private
1580
- */
1581
- #executeVdomUpdate(resolve, reject) {
1582
- let me = this,
1583
- {vdom, vnode} = me,
1584
- opts = {},
1585
- deltas;
1586
-
1587
- if (currentWorker.isSharedWorker) {
1588
- opts.appName = me.appName;
1589
- opts.windowId = me.windowId
1590
- }
1591
-
1592
- me.isVdomUpdating = true;
1593
-
1594
- // we can not set the config directly => it could already be false,
1595
- // and we still want to pass it further into subtrees
1596
- me._needsVdomUpdate = false;
1597
- me.afterSetNeedsVdomUpdate?.(false, true);
1598
-
1599
- opts.vdom = ComponentManager.getVdomTree(vdom, me.updateDepth);
1600
- opts.vnode = ComponentManager.getVnodeTree(vnode, me.updateDepth);
1601
-
1602
- // Reset the updateDepth to the default value for the next update cycle
1603
- me._updateDepth = me.constructor.config.updateDepth;
1604
-
1605
- Neo.vdom.Helper.update(opts).catch(err => {
1606
- me.isVdomUpdating = false;
1607
- reject?.()
1608
- }).then(data => {
1609
- // Checking if the component got destroyed before the update cycle is done
1610
- if (me.id) {
1611
- // It is crucial to delegate the vnode tree before resolving the cycle
1612
- me.vnode = data.vnode;
1613
- me.isVdomUpdating = false;
1614
-
1615
- deltas = data.deltas;
1616
-
1617
- if (!Neo.config.useVdomWorker && deltas.length > 0) {
1618
- Neo.applyDeltas(me.appName, deltas).then(() => {
1619
- me.resolveVdomUpdate(resolve)
1620
- })
1621
- } else {
1622
- me.resolveVdomUpdate(resolve)
1623
- }
1624
- }
1625
- })
1626
- }
1627
-
1628
1181
  /**
1629
1182
  * Calls focus() on the top level DOM node of this component or on a given node via id
1630
1183
  * @param {String} id=this.id
@@ -1648,34 +1201,6 @@ class Component extends Base {
1648
1201
  return result
1649
1202
  }
1650
1203
 
1651
- /**
1652
- * Find an instance stored inside a config via optionally passing a ntype.
1653
- * Returns this[configName] or the closest parent component with a match.
1654
- * Used by getController() & getStateProvider()
1655
- * @param {String} configName
1656
- * @param {String} [ntype]
1657
- * @returns {Neo.core.Base|null}
1658
- */
1659
- getConfigInstanceByNtype(configName, ntype) {
1660
- let me = this,
1661
- config = me[configName],
1662
- {parentComponent} = me;
1663
-
1664
- if (config && (!ntype || ntype === config.ntype)) {
1665
- return config
1666
- }
1667
-
1668
- if (!parentComponent && me.parentId) {
1669
- parentComponent = me.parent || Neo.get(me.parentId);
1670
- }
1671
-
1672
- if (parentComponent) {
1673
- return parentComponent.getConfigInstanceByNtype(configName, ntype)
1674
- }
1675
-
1676
- return null
1677
- }
1678
-
1679
1204
  /**
1680
1205
  * Returns this.controller or the closest parent controller
1681
1206
  * @param {String} [ntype]
@@ -1718,43 +1243,6 @@ class Component extends Base {
1718
1243
  return Rectangle.clone(result)
1719
1244
  }
1720
1245
 
1721
- /**
1722
- * Honors different item roots for mount / render OPs
1723
- * @returns {String}
1724
- */
1725
- getMountedParentId() {
1726
- let parentId = this.parentId,
1727
- parent = Neo.getComponent(parentId),
1728
- itemsRoot = parent?.getVdomItemsRoot?.();
1729
-
1730
- return itemsRoot ? itemsRoot.id : parentId
1731
- }
1732
-
1733
- /**
1734
- * Calculate the real parentIndex inside the DOM
1735
- * @returns {Number|undefined}
1736
- */
1737
- getMountedParentIndex() {
1738
- let parent = this.parent,
1739
- items = parent?.items || [],
1740
- i = 0,
1741
- index = 0,
1742
- len = items.length,
1743
- item;
1744
-
1745
- for (; i < len; i++) {
1746
- item = items[i];
1747
-
1748
- if (item === this) {
1749
- return index
1750
- }
1751
-
1752
- if (!item.hidden && item.hideMode === 'removeDom') {
1753
- index++
1754
- }
1755
- }
1756
- }
1757
-
1758
1246
  /**
1759
1247
  * Get the parent components as an array
1760
1248
  * @returns {Neo.component.Base[]}
@@ -1806,45 +1294,6 @@ class Component extends Base {
1806
1294
  return this.down({reference: value})
1807
1295
  }
1808
1296
 
1809
- /**
1810
- * Convenience shortcut
1811
- * @param args
1812
- * @returns {*}
1813
- */
1814
- getState(...args) {
1815
- return this.getStateProvider().getData(...args)
1816
- }
1817
-
1818
- /**
1819
- * Returns this.stateProvider or the closest parent stateProvider
1820
- * @param {String} [ntype]
1821
- * @returns {Neo.state.Provider|null}
1822
- */
1823
- getStateProvider(ntype) {
1824
- if (!Neo.isUsingStateProviders) {
1825
- return null
1826
- }
1827
-
1828
- let me = this,
1829
- provider;
1830
-
1831
- if (!ntype) {
1832
- provider = me[closestProvider];
1833
-
1834
- if (provider) {
1835
- return provider
1836
- }
1837
- }
1838
-
1839
- provider = me.getConfigInstanceByNtype('stateProvider', ntype);
1840
-
1841
- if (!ntype) {
1842
- me[closestProvider] = provider
1843
- }
1844
-
1845
- return provider
1846
- }
1847
-
1848
1297
  /**
1849
1298
  * Walks up the vdom tree and returns the closest theme found
1850
1299
  * @returns {String}
@@ -1877,44 +1326,6 @@ class Component extends Base {
1877
1326
  return Neo.config.themes?.[0]
1878
1327
  }
1879
1328
 
1880
- /**
1881
- * Search a vdom child node by id for a given vdom tree
1882
- * @param {String} id
1883
- * @param {Object} vdom=this.vdom
1884
- * @returns {Object}
1885
- */
1886
- getVdomChild(id, vdom=this.vdom) {
1887
- return VDomUtil.find(vdom, id)?.vdom
1888
- }
1889
-
1890
- /**
1891
- * Specify a different vdom root if needed to apply the top level style attributes on a different level.
1892
- * Make sure to use getVnodeRoot() as well, to keep the vdom & vnode trees in sync.
1893
- * @returns {Object} The new vdom root
1894
- */
1895
- getVdomRoot() {
1896
- return this.vdom
1897
- }
1898
-
1899
- /**
1900
- * Specify a different vnode root if needed to apply the top level style attributes on a different level.
1901
- * Make sure to use getVdomRoot() as well, to keep the vdom & vnode trees in sync.
1902
- * @returns {Object} The new vnode root
1903
- */
1904
- getVnodeRoot() {
1905
- return this.vnode
1906
- }
1907
-
1908
- /**
1909
- * Checks if a given updateDepth & distance would result in an update collision
1910
- * @param {Number} updateDepth
1911
- * @param {Number} distance
1912
- * @returns {Boolean}
1913
- */
1914
- hasUpdateCollision(updateDepth, distance) {
1915
- return updateDepth === -1 ? true : distance < updateDepth
1916
- }
1917
-
1918
1329
  /**
1919
1330
  * Hide the component.
1920
1331
  * hideMode: 'removeDom' uses vdom removeDom.
@@ -1957,14 +1368,6 @@ class Component extends Base {
1957
1368
  this.autoRender && this.render()
1958
1369
  }
1959
1370
 
1960
- /**
1961
- * @param args
1962
- */
1963
- initConfig(...args) {
1964
- super.initConfig(...args);
1965
- this.getStateProvider()?.createBindings(this)
1966
- }
1967
-
1968
1371
  /**
1969
1372
  * Check if this component or any of its parents is floating
1970
1373
  * @returns {Boolean}
@@ -1983,45 +1386,6 @@ class Component extends Base {
1983
1386
  return me.parent.floating
1984
1387
  }
1985
1388
 
1986
- /**
1987
- * Checks for vdom updates inside the parent chain and if found.
1988
- * Registers the component for a vdom update once done.
1989
- * @param {String} parentId=this.parentId
1990
- * @param {Function} [resolve] Gets passed by updateVdom()
1991
- * @param {Number} distance=1 Distance inside the component tree
1992
- * @returns {Boolean}
1993
- */
1994
- isParentUpdating(parentId=this.parentId, resolve, distance=1) {
1995
- if (parentId !== 'document.body') {
1996
- let me = this,
1997
- parent = Neo.getComponent(parentId);
1998
-
1999
- if (parent) {
2000
- if (parent.isVdomUpdating) {
2001
- if (me.hasUpdateCollision(parent.currentUpdateDepth, distance)) {
2002
- if (Neo.config.logVdomUpdateCollisions) {
2003
- console.warn('vdom parent update conflict with:', parent, 'for:', me)
2004
- }
2005
-
2006
- parent.childUpdateCache[me.id] = {distance, resolve};
2007
-
2008
- // Adding the resolve fn to its own cache, since the parent will trigger
2009
- // a new update() directly on this cmp
2010
- resolve && me.resolveUpdateCache.push(resolve);
2011
- return true
2012
- }
2013
-
2014
- // If an update is running and does not have a collision, we do not need to check further parents
2015
- return false
2016
- }
2017
-
2018
- return me.isParentUpdating(parent.parentId, resolve, distance+1)
2019
- }
2020
- }
2021
-
2022
- return false
2023
- }
2024
-
2025
1389
  /**
2026
1390
  * @param {Number|String} value
2027
1391
  * @returns {Promise<number>}
@@ -2109,44 +1473,15 @@ class Component extends Base {
2109
1473
  }
2110
1474
  }
2111
1475
 
2112
- /**
2113
- * Checks the needsVdomUpdate config inside the parent tree
2114
- * @param {String} parentId=this.parentId
2115
- * @param {Function} [resolve] gets passed by updateVdom()
2116
- * @param {Number} distance=1 Distance inside the component tree
2117
- * @returns {Boolean}
2118
- */
2119
- needsParentUpdate(parentId=this.parentId, resolve, distance=1) {
2120
- if (parentId !== 'document.body') {
2121
- let me = this,
2122
- parent = Neo.getComponent(parentId);
2123
-
2124
- if (parent) {
2125
- // We are checking for parent.updateDepth, since we care about the depth of the next update cycle
2126
- if (parent.needsVdomUpdate && me.hasUpdateCollision(parent.updateDepth, distance)) {
2127
- parent.resolveUpdateCache.push(...me.resolveUpdateCache);
2128
- resolve && parent.resolveUpdateCache.push(resolve);
2129
- me.resolveUpdateCache = [];
2130
- return true
2131
- }
2132
-
2133
- return me.needsParentUpdate(parent.parentId, resolve, distance+1)
2134
- }
2135
- }
2136
-
2137
- return false
2138
- }
2139
-
2140
1476
  /**
2141
1477
  *
2142
1478
  */
2143
1479
  onConstructed() {
2144
- super.onConstructed()
1480
+ super.onConstructed();
2145
1481
 
2146
1482
  let me = this;
2147
1483
 
2148
1484
  me.keys?.register(me);
2149
- me.getStateProvider()?.createBindings(me)
2150
1485
  }
2151
1486
 
2152
1487
  /**
@@ -2188,65 +1523,6 @@ class Component extends Base {
2188
1523
  * @param {Array} opts.oldPath dom element ids upwards
2189
1524
  */
2190
1525
 
2191
- /**
2192
- * Gets called from the render() promise success handler
2193
- * @param {Object} vnode
2194
- * @param {Boolean} autoMount Mount the DOM after the vnode got created
2195
- * @protected
2196
- */
2197
- onRender(vnode, autoMount) {
2198
- let me = this,
2199
- {app} = me;
2200
-
2201
- me.rendering = false;
2202
-
2203
- // if app is a check to see if the Component got destroyed while rendering => before onRender got triggered
2204
- if (app) {
2205
- if (!app.rendered) {
2206
- app.rendering = false;
2207
- app.rendered = true;
2208
- app.fire('render')
2209
- }
2210
-
2211
- me.vnode = vnode;
2212
-
2213
- let childIds = ComponentManager.getChildIds(vnode),
2214
- i = 0,
2215
- len = childIds.length,
2216
- child;
2217
-
2218
- for (; i < len; i++) {
2219
- child = Neo.getComponent(childIds[i]);
2220
-
2221
- if (child) {
2222
- child.rendered = true
2223
- }
2224
- }
2225
-
2226
- me._rendered = true; // silent update
2227
- me.fire('rendered', me.id);
2228
-
2229
- if (autoMount) {
2230
- me.mounted = true;
2231
-
2232
- if (!app.mounted) {
2233
- app.mounted = true;
2234
- app.fire('mounted')
2235
- }
2236
- }
2237
- }
2238
- }
2239
-
2240
- /**
2241
- * Promise based vdom update
2242
- * @returns {Promise<any>}
2243
- */
2244
- promiseUpdate() {
2245
- return new Promise((resolve, reject) => {
2246
- this.updateVdom(resolve, reject)
2247
- })
2248
- }
2249
-
2250
1526
  /**
2251
1527
  * Remove a cls from the vdomRoot
2252
1528
  * @param {String} value
@@ -2258,32 +1534,7 @@ class Component extends Base {
2258
1534
  this.cls = cls
2259
1535
  }
2260
1536
 
2261
- /**
2262
- * @param {Array|Object} value
2263
- */
2264
- removeDomListeners(value) {
2265
- if (!Array.isArray(value)) {
2266
- value = [value];
2267
- }
2268
-
2269
- let me = this,
2270
- {domListeners} = me,
2271
- i, len;
2272
-
2273
- value.forEach(item => {
2274
- i = 0;
2275
- len = domListeners.length;
2276
1537
 
2277
- for (; i < len; i++) {
2278
- if (Neo.isEqual(item, domListeners[i])) {
2279
- domListeners.splice(i, 1);
2280
- break
2281
- }
2282
- }
2283
- });
2284
-
2285
- me.domListeners = domListeners
2286
- }
2287
1538
 
2288
1539
  /**
2289
1540
  * Either a string like 'color' or an array containing style attributes to remove
@@ -2312,110 +1563,6 @@ class Component extends Base {
2312
1563
  return style
2313
1564
  }
2314
1565
 
2315
- /**
2316
- * Creates the vnode tree for this component and mounts the component in case
2317
- * - you pass true for the mount param
2318
- * - or the autoMount config is set to true
2319
- * @param {Boolean} [mount] Mount the DOM after the vnode got created
2320
- */
2321
- async render(mount) {
2322
- let me = this,
2323
- autoMount = mount || me.autoMount,
2324
- {app} = me,
2325
- {unitTestMode, useVdomWorker} = Neo.config;
2326
-
2327
- if (unitTestMode) return;
2328
-
2329
- // Verify that the critical rendering path => CSS files for the new tree is in place
2330
- if (autoMount && currentWorker.countLoadingThemeFiles !== 0) {
2331
- currentWorker.on('themeFilesLoaded', function() {
2332
- !me.mounted && me.render(mount)
2333
- }, me, {once: true});
2334
-
2335
- return
2336
- }
2337
-
2338
- me.rendering = true;
2339
-
2340
- if (!app.rendered) {
2341
- app.rendering = true
2342
- }
2343
-
2344
- if (me.vdom) {
2345
- me.isVdomUpdating = true;
2346
-
2347
- delete me.vdom.removeDom;
2348
-
2349
- me._needsVdomUpdate = false;
2350
- me.afterSetNeedsVdomUpdate?.(false, true);
2351
-
2352
- const data = await Neo.vdom.Helper.create({
2353
- appName : me.appName,
2354
- autoMount,
2355
- parentId : autoMount ? me.getMountedParentId() : undefined,
2356
- parentIndex: autoMount ? me.getMountedParentIndex() : undefined,
2357
- vdom : ComponentManager.getVdomTree(me.vdom),
2358
- windowId : me.windowId
2359
- });
2360
-
2361
- me.onRender(data.vnode, useVdomWorker ? autoMount : false);
2362
- me.isVdomUpdating = false;
2363
-
2364
- autoMount && !useVdomWorker && me.mount();
2365
-
2366
- me.resolveVdomUpdate()
2367
- }
2368
- }
2369
-
2370
- /**
2371
- * Internal helper fn to resolve the Promise for updateVdom()
2372
- * @param {Function|undefined} resolve
2373
- * @protected
2374
- */
2375
- resolveVdomUpdate(resolve) {
2376
- let me = this,
2377
- hasChildUpdateCache = !Neo.isEmpty(me.childUpdateCache),
2378
- component;
2379
-
2380
- me.doResolveUpdateCache();
2381
-
2382
- resolve?.();
2383
-
2384
- if (me.needsVdomUpdate) {
2385
- if (hasChildUpdateCache) {
2386
- Object.entries(me.childUpdateCache).forEach(([key, value]) => {
2387
- component = Neo.getComponent(key);
2388
-
2389
- // The component might already got destroyed
2390
- if (component) {
2391
- // Pass callbacks to the resolver cache => getting executed once the following update is done
2392
- value.resolve && NeoArray.add(me.resolveUpdateCache, value.resolve);
2393
-
2394
- // Adjust the updateDepth to include the depth of all merged child updates
2395
- if (me.updateDepth !== -1) {
2396
- if (component.updateDepth === -1) {
2397
- me.updateDepth = -1
2398
- } else {
2399
- // Since updateDepth is 1-based, we need to subtract 1 level
2400
- me.updateDepth = me.updateDepth + value.distance + component.updateDepth - 1
2401
- }
2402
- }
2403
- }
2404
- });
2405
-
2406
- me.childUpdateCache = {}
2407
- }
2408
-
2409
- me.update()
2410
- } else if (hasChildUpdateCache) {
2411
- Object.keys(me.childUpdateCache).forEach(key => {
2412
- Neo.getComponent(key)?.update()
2413
- });
2414
-
2415
- me.childUpdateCache = {}
2416
- }
2417
- }
2418
-
2419
1566
  /**
2420
1567
  *
2421
1568
  */
@@ -2427,50 +1574,6 @@ class Component extends Base {
2427
1574
  }
2428
1575
  }
2429
1576
 
2430
- /**
2431
- * Change multiple configs at once, ensuring that all afterSet methods get all new assigned values
2432
- * @param {Object} values={}
2433
- * @param {Boolean} silent=false
2434
- * @returns {Promise<*>}
2435
- */
2436
- set(values={}, silent=false) {
2437
- let me = this,
2438
- needsRendering = values.hidden === false && values.hidden !== me.hidden;
2439
-
2440
- me.silentVdomUpdate = true;
2441
-
2442
- super.set(values);
2443
-
2444
- me.silentVdomUpdate = false;
2445
-
2446
- if (silent || !me.needsVdomUpdate) {
2447
- return Promise.resolve()
2448
- } else {
2449
- if (needsRendering) {
2450
- me.show();
2451
- return Promise.resolve()
2452
- }
2453
-
2454
- return me.promiseUpdate()
2455
- }
2456
- }
2457
-
2458
- /**
2459
- * Convenience shortcut calling set() with the silent flag
2460
- * @param {Object} values={}
2461
- */
2462
- setSilent(values = {}) {
2463
- return this.set(values, true)
2464
- }
2465
-
2466
- /**
2467
- * Convenience shortcut
2468
- * @param args
2469
- */
2470
- setState(...args) {
2471
- this.getStateProvider().setData(...args)
2472
- }
2473
-
2474
1577
  /**
2475
1578
  * Show the component.
2476
1579
  * hideMode: 'removeDom' uses vdom removeDom.
@@ -2499,78 +1602,6 @@ class Component extends Base {
2499
1602
  me._hidden = false
2500
1603
  }
2501
1604
 
2502
- /**
2503
- * Placeholder method for util.VDom.syncVdomIds to allow overriding (disabling) it
2504
- * @param {Neo.vdom.VNode} [vnode=this.vnode]
2505
- * @param {Object} [vdom=this.vdom]
2506
- * @param {Boolean} force=false
2507
- */
2508
- syncVdomIds(vnode=this.vnode, vdom=this.vdom, force=false) {
2509
- VDomUtil.syncVdomIds(vnode, vdom, force)
2510
- }
2511
-
2512
- /**
2513
- * In case a component receives a new vnode, we want to do:
2514
- * - sync the vdom ids
2515
- * - setting rendered to true for child components
2516
- * - updating the parent component to ensure that the vnode tree stays persistent
2517
- * @param {Neo.vdom.VNode} [vnode=this.vnode]
2518
- */
2519
- syncVnodeTree(vnode=this.vnode) {
2520
- let me = this,
2521
- childComponents = ComponentManager.getChildren(me),
2522
- debug = false,
2523
- map = {},
2524
- childVnode, start;
2525
-
2526
- if (debug) {
2527
- start = performance.now()
2528
- }
2529
-
2530
- me.syncVdomIds();
2531
-
2532
- if (vnode && me.id !== vnode.id) {
2533
- ComponentManager.registerWrapperNode(vnode.id, me)
2534
- }
2535
-
2536
- // we need one separate iteration first to ensure all wrapper nodes get registered
2537
- childComponents.forEach(component => {
2538
- childVnode = VNodeUtil.find(me.vnode, component.vdom.id)?.vnode;
2539
-
2540
- if (childVnode) {
2541
- map[component.id] = childVnode;
2542
-
2543
- if (component.id !== childVnode.id) {
2544
- ComponentManager.registerWrapperNode(childVnode.id, component)
2545
- }
2546
- }
2547
- });
2548
-
2549
- // delegate the latest node updates to all possible child components found inside the vnode tree
2550
- childComponents.forEach(component => {
2551
- childVnode = map[component.id];
2552
-
2553
- if (childVnode) {
2554
- // silent update
2555
- component._vnode = ComponentManager.addVnodeComponentReferences(childVnode, component.id);
2556
-
2557
- if (!component.rendered) {
2558
- component._rendered = true;
2559
- component.fire('rendered', component.id)
2560
- }
2561
-
2562
- component.mounted = true
2563
- } else {
2564
- console.warn('syncVnodeTree: Could not replace the child vnode for', component.id)
2565
- }
2566
- });
2567
-
2568
- // silent update
2569
- me._vnode = vnode ? ComponentManager.addVnodeComponentReferences(vnode, me.id) : null;
2570
-
2571
- debug && console.log('syncVnodeTree', me.id, performance.now() - start)
2572
- }
2573
-
2574
1605
  /**
2575
1606
  * Toggle a cls inside the vdomRoot of the component
2576
1607
  * @param {String} value
@@ -2606,13 +1637,6 @@ class Component extends Base {
2606
1637
  return ComponentManager.up(this.id, config)
2607
1638
  }
2608
1639
 
2609
- /**
2610
- *
2611
- */
2612
- update() {
2613
- this.afterSetVdom(this.vdom, null)
2614
- }
2615
-
2616
1640
  /**
2617
1641
  *
2618
1642
  */
@@ -2631,59 +1655,6 @@ class Component extends Base {
2631
1655
  me.update()
2632
1656
  }
2633
1657
 
2634
- /**
2635
- * Gets called after the vdom config gets changed in case the component is already mounted (delta updates).
2636
- * @param {function} [resolve] used by promiseUpdate()
2637
- * @param {function} [reject] used by promiseUpdate()
2638
- * @protected
2639
- */
2640
- updateVdom(resolve, reject) {
2641
- if (Neo.config.unitTestMode) {
2642
- reject?.();
2643
- return
2644
- }
2645
-
2646
- let me = this,
2647
- {app, mounted, parentId, vnode} = me;
2648
-
2649
- if (me.isVdomUpdating || me.silentVdomUpdate) {
2650
- resolve && me.resolveUpdateCache.push(resolve);
2651
- me.needsVdomUpdate = true
2652
- } else {
2653
- if (!mounted && me.isConstructed && !me.hasRenderingListener && app?.rendering === true) {
2654
- me.hasRenderingListener = true;
2655
-
2656
- app.on('mounted', () => {
2657
- me.timeout(50).then(() => {
2658
- me.vnode && me.updateVdom(resolve, reject)
2659
- })
2660
- }, me, {once: true})
2661
- } else {
2662
- if (resolve && (!mounted || !vnode)) {
2663
- me.resolveUpdateCache.push(resolve)
2664
- }
2665
-
2666
- if (
2667
- !me.needsParentUpdate(parentId, resolve)
2668
- && !me.isParentUpdating(parentId, resolve)
2669
- && mounted
2670
- && vnode
2671
- ) {
2672
- // Verify that the critical rendering path => CSS files for the new tree is in place
2673
- if (currentWorker.countLoadingThemeFiles !== 0) {
2674
- currentWorker.on('themeFilesLoaded', function() {
2675
- me.updateVdom(resolve, reject)
2676
- }, me, {once: true})
2677
- } else {
2678
- me.#executeVdomUpdate(resolve, reject)
2679
- }
2680
- }
2681
- }
2682
- }
2683
-
2684
- me.hasUnmountedVdomChanges = !mounted && me.hasBeenMounted
2685
- }
2686
-
2687
1658
  /**
2688
1659
  * In case you are sure a DOMRect exists, use getDomRect()
2689
1660
  * Otherwise you can wait for it using this method.