neo.mjs 6.17.2 → 6.18.1

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 (323) hide show
  1. package/apps/ServiceWorker.mjs +3 -5
  2. package/apps/colors/README.md +8 -0
  3. package/apps/colors/app.mjs +6 -0
  4. package/apps/colors/childapps/widget/app.mjs +7 -0
  5. package/apps/colors/childapps/widget/index.html +11 -0
  6. package/apps/colors/childapps/widget/neo-config.json +10 -0
  7. package/apps/colors/childapps/widget/view/Viewport.mjs +19 -0
  8. package/apps/colors/index.html +11 -0
  9. package/apps/colors/model/Color.mjs +43 -0
  10. package/apps/colors/neo-config.json +10 -0
  11. package/apps/colors/remotes-api.json +13 -0
  12. package/apps/colors/store/Colors.mjs +24 -0
  13. package/apps/colors/view/BarChartComponent.mjs +64 -0
  14. package/apps/colors/view/HeaderToolbar.mjs +95 -0
  15. package/apps/colors/view/PieChartComponent.mjs +58 -0
  16. package/apps/colors/view/TableContainer.mjs +91 -0
  17. package/apps/colors/view/Viewport.mjs +57 -0
  18. package/apps/colors/view/ViewportController.mjs +277 -0
  19. package/apps/colors/view/ViewportModel.mjs +53 -0
  20. package/apps/portal/Util.mjs +11 -0
  21. package/apps/portal/childapps/preview/neo-config.json +2 -2
  22. package/apps/portal/neo-config.json +2 -1
  23. package/apps/portal/remotes-api.json +13 -0
  24. package/apps/portal/view/HeaderToolbar.mjs +1 -1
  25. package/apps/portal/view/ViewportController.mjs +89 -1
  26. package/apps/portal/view/home/MainContainer.mjs +34 -6
  27. package/apps/portal/view/home/parts/AfterMath.mjs +1 -1
  28. package/apps/portal/view/home/parts/Colors.mjs +98 -0
  29. package/apps/portal/view/home/parts/Helix.mjs +114 -0
  30. package/apps/portal/view/home/parts/HelloWorld.mjs +6 -3
  31. package/apps/portal/view/home/parts/How.mjs +66 -0
  32. package/apps/portal/view/home/parts/MainNeo.mjs +4 -3
  33. package/apps/portal/view/learn/LivePreview.mjs +56 -15
  34. package/apps/portal/view/learn/MainContainerController.mjs +10 -90
  35. package/apps/realworld/api/Article.mjs +1 -3
  36. package/apps/realworld/api/Favorite.mjs +1 -3
  37. package/apps/realworld/api/Profile.mjs +1 -3
  38. package/apps/realworld/api/Tag.mjs +1 -3
  39. package/apps/realworld/api/User.mjs +1 -3
  40. package/apps/realworld2/api/Article.mjs +1 -3
  41. package/apps/realworld2/api/Favorite.mjs +1 -3
  42. package/apps/realworld2/api/Profile.mjs +1 -3
  43. package/apps/realworld2/api/Tag.mjs +1 -3
  44. package/apps/realworld2/api/User.mjs +1 -3
  45. package/apps/realworld2/view/article/HelixContainer.mjs +5 -5
  46. package/buildScripts/webpack/json/myApps.template.json +1 -0
  47. package/docs/app/view/MainContainer.mjs +5 -0
  48. package/docs/app/view/classdetails/MembersList.mjs +1 -1
  49. package/examples/ServiceWorker.mjs +3 -5
  50. package/examples/component/helix/Viewport.mjs +309 -0
  51. package/examples/component/helix/ViewportController.mjs +122 -0
  52. package/examples/component/helix/app.mjs +2 -2
  53. package/examples/component/helix/neo-config.json +0 -1
  54. package/examples/component/multiWindowHelix/Viewport.mjs +11 -3
  55. package/examples/component/multiWindowHelix/ViewportController.mjs +21 -9
  56. package/examples/component/multiWindowHelix/neo-config.json +0 -1
  57. package/examples/fieldWithPrefix/MainContainer.mjs +1 -6
  58. package/examples/list/animate/MainContainerController.mjs +1 -1
  59. package/examples/worker/task/MyTasks.mjs +1 -3
  60. package/package.json +2 -2
  61. package/resources/data/deck/learnneo/pages/Events.md +15 -9
  62. package/resources/data/deck/learnneo/pages/GuideEvents.md +254 -0
  63. package/resources/data/deck/learnneo/pages/WhyNeo-Speed.md +1 -1
  64. package/resources/images/logo/neo_logo_primary.svg +6 -0
  65. package/resources/images/logo/neo_logo_text_primary.svg +5 -0
  66. package/resources/scss/src/apps/colors/BarChartComponent.scss +3 -0
  67. package/resources/scss/src/apps/colors/HeaderToolbar.scss +11 -0
  68. package/resources/scss/src/apps/colors/PieChartComponent.scss +3 -0
  69. package/resources/scss/src/apps/colors/TableContainer.scss +64 -0
  70. package/resources/scss/src/apps/colors/Viewport.scss +9 -0
  71. package/resources/scss/src/apps/portal/HeaderToolbar.scss +142 -124
  72. package/resources/scss/src/apps/portal/home/MainContainer.scss +9 -22
  73. package/resources/scss/src/apps/portal/home/parts/MainNeo.scss +22 -0
  74. package/resources/scss/src/apps/portal/home/preview/PageCodeContainer.scss +1 -1
  75. package/resources/scss/src/examples/component/multiWindowHelix/Viewport.scss +3 -0
  76. package/resources/scss/src/form/field/CheckBox.scss +1 -0
  77. package/resources/scss/src/tab/header/Button.scss +2 -1
  78. package/resources/scss/theme-dark/Global.scss +8 -0
  79. package/resources/scss/theme-dark/button/Base.scss +1 -1
  80. package/resources/scss/theme-dark/tab/header/Button.scss +1 -0
  81. package/resources/scss/theme-light/Global.scss +8 -0
  82. package/resources/scss/theme-light/button/Base.scss +1 -1
  83. package/resources/scss/theme-light/tab/header/Button.scss +1 -0
  84. package/resources/scss/theme-neo-light/Global.scss +53 -53
  85. package/resources/scss/theme-neo-light/button/Base.scss +3 -4
  86. package/resources/scss/theme-neo-light/tab/header/Button.scss +6 -8
  87. package/src/DefaultConfig.mjs +2 -2
  88. package/src/Fetch.mjs +1 -3
  89. package/src/Main.mjs +13 -11
  90. package/src/MicroLoader.mjs +2 -2
  91. package/src/Neo.mjs +27 -26
  92. package/src/Xhr.mjs +1 -3
  93. package/src/button/Base.mjs +6 -4
  94. package/src/button/Split.mjs +10 -9
  95. package/src/calendar/view/EditEventContainer.mjs +13 -12
  96. package/src/calendar/view/MainContainer.mjs +40 -40
  97. package/src/calendar/view/MainContainerModel.mjs +5 -5
  98. package/src/calendar/view/SettingsContainer.mjs +11 -11
  99. package/src/calendar/view/YearComponent.mjs +73 -75
  100. package/src/calendar/view/calendars/ColorsList.mjs +2 -2
  101. package/src/calendar/view/calendars/EditContainer.mjs +2 -2
  102. package/src/calendar/view/calendars/List.mjs +12 -13
  103. package/src/calendar/view/month/Component.mjs +72 -73
  104. package/src/calendar/view/settings/GeneralContainer.mjs +5 -5
  105. package/src/calendar/view/settings/MonthContainer.mjs +5 -5
  106. package/src/calendar/view/settings/WeekContainer.mjs +6 -6
  107. package/src/calendar/view/settings/YearContainer.mjs +4 -4
  108. package/src/calendar/view/week/Component.mjs +47 -57
  109. package/src/calendar/view/week/EventDragZone.mjs +43 -50
  110. package/src/calendar/view/week/TimeAxisComponent.mjs +21 -21
  111. package/src/calendar/view/week/plugin/DragDrop.mjs +53 -45
  112. package/src/calendar/view/week/plugin/EventResizable.mjs +8 -3
  113. package/src/collection/Base.mjs +15 -22
  114. package/src/collection/Filter.mjs +4 -9
  115. package/src/collection/Sorter.mjs +6 -7
  116. package/src/component/Base.mjs +73 -41
  117. package/src/component/Canvas.mjs +9 -9
  118. package/src/component/Carousel.mjs +31 -33
  119. package/src/component/Chip.mjs +9 -9
  120. package/src/component/Circle.mjs +84 -91
  121. package/src/component/Clock.mjs +8 -8
  122. package/src/component/DateSelector.mjs +14 -15
  123. package/src/component/Gallery.mjs +82 -80
  124. package/src/component/Helix.mjs +131 -126
  125. package/src/component/Iframe.mjs +1 -1
  126. package/src/component/Label.mjs +1 -1
  127. package/src/component/Legend.mjs +3 -3
  128. package/src/component/Process.mjs +39 -37
  129. package/src/component/Splitter.mjs +9 -11
  130. package/src/component/StatusBadge.mjs +2 -3
  131. package/src/component/Timer.mjs +62 -68
  132. package/src/component/Toast.mjs +11 -11
  133. package/src/component/Video.mjs +7 -8
  134. package/src/component/mwc/Button.mjs +10 -10
  135. package/src/component/mwc/TextField.mjs +17 -17
  136. package/src/component/wrapper/AmChart.mjs +5 -5
  137. package/src/component/wrapper/CesiumJS.mjs +11 -17
  138. package/src/component/wrapper/GoogleMaps.mjs +58 -35
  139. package/src/component/wrapper/MapboxGL.mjs +112 -79
  140. package/src/container/Accordion.mjs +18 -20
  141. package/src/container/AccordionItem.mjs +12 -11
  142. package/src/container/Base.mjs +24 -23
  143. package/src/container/Panel.mjs +9 -9
  144. package/src/controller/Base.mjs +12 -14
  145. package/src/controller/Component.mjs +60 -66
  146. package/src/core/Base.mjs +5 -8
  147. package/src/core/IdGenerator.mjs +1 -3
  148. package/src/core/Observable.mjs +40 -24
  149. package/src/core/Util.mjs +5 -5
  150. package/src/data/Model.mjs +3 -3
  151. package/src/data/RecordFactory.mjs +3 -6
  152. package/src/data/Store.mjs +34 -34
  153. package/src/data/connection/Fetch.mjs +3 -3
  154. package/src/data/connection/WebSocket.mjs +21 -25
  155. package/src/data/connection/Xhr.mjs +31 -28
  156. package/src/date/DayViewComponent.mjs +1 -1
  157. package/src/date/SelectorContainer.mjs +2 -2
  158. package/src/dialog/Base.mjs +27 -25
  159. package/src/dialog/header/Toolbar.mjs +5 -4
  160. package/src/draggable/DragProxyComponent.mjs +7 -4
  161. package/src/draggable/DragZone.mjs +30 -30
  162. package/src/draggable/DropZone.mjs +7 -7
  163. package/src/draggable/list/DragZone.mjs +18 -18
  164. package/src/draggable/tab/header/toolbar/SortZone.mjs +7 -7
  165. package/src/draggable/toolbar/DragZone.mjs +15 -15
  166. package/src/draggable/toolbar/SortZone.mjs +30 -31
  167. package/src/draggable/tree/DragZone.mjs +9 -9
  168. package/src/filter/BooleanContainer.mjs +3 -3
  169. package/src/filter/NumberContainer.mjs +5 -5
  170. package/src/filter/ToggleOperatorsButton.mjs +5 -5
  171. package/src/form/Fieldset.mjs +26 -26
  172. package/src/form/field/Base.mjs +1 -1
  173. package/src/form/field/CheckBox.mjs +15 -16
  174. package/src/form/field/Color.mjs +13 -15
  175. package/src/form/field/ComboBox.mjs +16 -24
  176. package/src/form/field/Country.mjs +1 -1
  177. package/src/form/field/Date.mjs +3 -4
  178. package/src/form/field/Display.mjs +1 -1
  179. package/src/form/field/Email.mjs +2 -2
  180. package/src/form/field/Number.mjs +51 -56
  181. package/src/form/field/Picker.mjs +2 -2
  182. package/src/form/field/Radio.mjs +1 -1
  183. package/src/form/field/Range.mjs +7 -6
  184. package/src/form/field/Text.mjs +29 -36
  185. package/src/form/field/TextArea.mjs +9 -9
  186. package/src/form/field/Time.mjs +30 -30
  187. package/src/form/field/trigger/Base.mjs +19 -13
  188. package/src/form/field/trigger/Clear.mjs +13 -13
  189. package/src/form/field/trigger/CopyToClipboard.mjs +7 -7
  190. package/src/form/field/trigger/Picker.mjs +2 -2
  191. package/src/form/field/trigger/SpinDown.mjs +1 -1
  192. package/src/form/field/trigger/SpinUp.mjs +1 -1
  193. package/src/form/field/trigger/SpinUpDown.mjs +3 -3
  194. package/src/form/field/trigger/Time.mjs +3 -3
  195. package/src/grid/Container.mjs +33 -33
  196. package/src/grid/View.mjs +20 -22
  197. package/src/grid/header/Button.mjs +12 -12
  198. package/src/grid/header/Toolbar.mjs +4 -4
  199. package/src/layout/Base.mjs +5 -4
  200. package/src/layout/Card.mjs +15 -16
  201. package/src/layout/Fit.mjs +22 -8
  202. package/src/layout/Flexbox.mjs +30 -29
  203. package/src/layout/Form.mjs +15 -15
  204. package/src/layout/Grid.mjs +2 -2
  205. package/src/layout/HBox.mjs +3 -2
  206. package/src/layout/VBox.mjs +3 -2
  207. package/src/list/Base.mjs +45 -47
  208. package/src/list/Chip.mjs +4 -4
  209. package/src/list/Circle.mjs +3 -3
  210. package/src/list/Color.mjs +4 -4
  211. package/src/list/Component.mjs +10 -10
  212. package/src/list/plugin/Animate.mjs +18 -13
  213. package/src/main/DomAccess.mjs +92 -56
  214. package/src/main/DomEvents.mjs +38 -39
  215. package/src/main/addon/AmCharts.mjs +37 -37
  216. package/src/main/addon/AnalyticsByGoogle.mjs +4 -4
  217. package/src/main/addon/CesiumJS.mjs +8 -8
  218. package/src/main/addon/CloneNode.mjs +5 -5
  219. package/src/main/addon/Cookie.mjs +4 -4
  220. package/src/main/addon/DragDrop.mjs +35 -34
  221. package/src/main/addon/GoogleMaps.mjs +19 -19
  222. package/src/main/addon/IntersectionObserver.mjs +20 -1
  223. package/src/main/addon/LocalStorage.mjs +3 -3
  224. package/src/main/addon/MapboxGL.mjs +40 -41
  225. package/src/main/addon/MonacoEditor.mjs +5 -5
  226. package/src/main/addon/Mwc.mjs +6 -6
  227. package/src/main/addon/Navigator.mjs +35 -39
  228. package/src/main/addon/Popover.mjs +5 -6
  229. package/src/main/addon/PrefixField.mjs +1 -2
  230. package/src/main/addon/ServiceWorker.mjs +9 -9
  231. package/src/main/addon/Siesta.mjs +3 -2
  232. package/src/main/addon/Stylesheet.mjs +37 -37
  233. package/src/main/addon/WebComponent.mjs +2 -3
  234. package/src/main/addon/WindowPosition.mjs +18 -18
  235. package/src/main/draggable/sensor/Base.mjs +2 -2
  236. package/src/main/draggable/sensor/Mouse.mjs +15 -15
  237. package/src/main/draggable/sensor/Touch.mjs +24 -23
  238. package/src/main/mixin/DeltaUpdates.mjs +10 -12
  239. package/src/main/mixin/TouchDomEvents.mjs +6 -6
  240. package/src/manager/Base.mjs +4 -4
  241. package/src/manager/Component.mjs +41 -41
  242. package/src/manager/DomEvent.mjs +41 -44
  243. package/src/manager/Focus.mjs +14 -16
  244. package/src/manager/Instance.mjs +2 -4
  245. package/src/manager/Store.mjs +4 -8
  246. package/src/manager/Task.mjs +20 -22
  247. package/src/manager/Toast.mjs +14 -16
  248. package/src/manager/rpc/Api.mjs +1 -3
  249. package/src/manager/rpc/Message.mjs +16 -18
  250. package/src/menu/List.mjs +16 -16
  251. package/src/menu/Panel.mjs +4 -4
  252. package/src/model/Component.mjs +16 -14
  253. package/src/plugin/Base.mjs +2 -0
  254. package/src/plugin/Popover.mjs +1 -1
  255. package/src/plugin/PrefixField.mjs +35 -45
  256. package/src/plugin/Resizable.mjs +86 -101
  257. package/src/plugin/Responsive.mjs +1 -1
  258. package/src/remotes/Api.mjs +4 -6
  259. package/src/selection/CircleModel.mjs +12 -16
  260. package/src/selection/DateSelectorModel.mjs +21 -23
  261. package/src/selection/GalleryModel.mjs +49 -63
  262. package/src/selection/HelixModel.mjs +35 -41
  263. package/src/selection/ListModel.mjs +9 -14
  264. package/src/selection/Model.mjs +31 -31
  265. package/src/selection/TreeAccordionModel.mjs +74 -80
  266. package/src/selection/grid/CellColumnModel.mjs +10 -10
  267. package/src/selection/grid/CellColumnRowModel.mjs +10 -10
  268. package/src/selection/grid/CellModel.mjs +26 -28
  269. package/src/selection/grid/CellRowModel.mjs +24 -24
  270. package/src/selection/grid/ColumnModel.mjs +16 -20
  271. package/src/selection/grid/RowModel.mjs +27 -29
  272. package/src/selection/menu/ListModel.mjs +2 -2
  273. package/src/selection/table/CellColumnModel.mjs +12 -12
  274. package/src/selection/table/CellColumnRowModel.mjs +12 -12
  275. package/src/selection/table/CellModel.mjs +26 -29
  276. package/src/selection/table/CellRowModel.mjs +19 -19
  277. package/src/selection/table/ColumnModel.mjs +18 -22
  278. package/src/selection/table/RowModel.mjs +27 -29
  279. package/src/sitemap/Component.mjs +20 -20
  280. package/src/sitemap/Store.mjs +1 -1
  281. package/src/tab/Container.mjs +15 -15
  282. package/src/tab/Strip.mjs +1 -1
  283. package/src/tab/header/Toolbar.mjs +4 -4
  284. package/src/table/Container.mjs +8 -10
  285. package/src/table/View.mjs +29 -34
  286. package/src/table/header/Button.mjs +18 -18
  287. package/src/table/header/Toolbar.mjs +2 -2
  288. package/src/toolbar/Base.mjs +14 -14
  289. package/src/toolbar/Breadcrumb.mjs +11 -11
  290. package/src/toolbar/Paging.mjs +18 -18
  291. package/src/tooltip/Base.mjs +20 -22
  292. package/src/tree/Accordion.mjs +69 -75
  293. package/src/tree/List.mjs +22 -25
  294. package/src/util/Array.mjs +19 -18
  295. package/src/util/ClassSystem.mjs +9 -9
  296. package/src/util/Css.mjs +2 -2
  297. package/src/util/Date.mjs +9 -9
  298. package/src/util/Function.mjs +2 -2
  299. package/src/util/HashHistory.mjs +3 -5
  300. package/src/util/KeyNavigation.mjs +17 -17
  301. package/src/util/Logger.mjs +9 -9
  302. package/src/util/Matrix.mjs +19 -19
  303. package/src/util/String.mjs +9 -9
  304. package/src/util/Style.mjs +11 -11
  305. package/src/util/VDom.mjs +12 -14
  306. package/src/util/VNode.mjs +29 -29
  307. package/src/vdom/Helper.mjs +84 -93
  308. package/src/vdom/VNode.mjs +1 -1
  309. package/src/worker/App.mjs +19 -16
  310. package/src/worker/Base.mjs +14 -15
  311. package/src/worker/Canvas.mjs +1 -3
  312. package/src/worker/Data.mjs +4 -8
  313. package/src/worker/Manager.mjs +27 -32
  314. package/src/worker/Message.mjs +1 -1
  315. package/src/worker/ServiceBase.mjs +38 -42
  316. package/src/worker/Task.mjs +1 -3
  317. package/src/worker/VDom.mjs +2 -4
  318. package/src/worker/mixin/RemoteMethodAccess.mjs +5 -6
  319. package/apps/portal/view/home/parts/CoolStuff.mjs +0 -82
  320. package/examples/component/helix/MainContainer.mjs +0 -340
  321. /package/resources/images/{Neo_Logo_Blue.svg → logo/neo_logo_secondary.svg} +0 -0
  322. /package/resources/images/{Neo_Logo_Text.svg → logo/neo_logo_text_secondary.svg} +0 -0
  323. /package/resources/images/{Neo_Logo_White.svg → logo/neo_logo_white.svg} +0 -0
@@ -33,8 +33,8 @@ class Component extends Base {
33
33
  super.afterSetAppName(value, oldValue);
34
34
 
35
35
  value && this.items?.forEach(item => {
36
- item.appName = value;
37
- });
36
+ item.appName = value
37
+ })
38
38
  }
39
39
 
40
40
  /**
@@ -44,10 +44,10 @@ class Component extends Base {
44
44
  let items = this.items || [];
45
45
 
46
46
  items.forEach(item => {
47
- item.destroy();
47
+ item.destroy()
48
48
  });
49
49
 
50
- super.destroy(...args);
50
+ super.destroy(...args)
51
51
  }
52
52
 
53
53
  /**
@@ -55,7 +55,7 @@ class Component extends Base {
55
55
  * @returns {String}
56
56
  */
57
57
  getComponentId(index) {
58
- return `${this.id}__${index}__component`;
58
+ return `${this.id}__${index}__component`
59
59
  }
60
60
 
61
61
  /**
@@ -63,7 +63,7 @@ class Component extends Base {
63
63
  * @returns {String}
64
64
  */
65
65
  getItemId(recordId) {
66
- return `${this.id}__${this.store.indexOf(recordId)}`;
66
+ return `${this.id}__${this.store.indexOf(recordId)}`
67
67
  }
68
68
 
69
69
  /**
@@ -72,7 +72,7 @@ class Component extends Base {
72
72
  */
73
73
  getItemRecordId(vnodeId) {
74
74
  let itemId = vnodeId.split('__')[1];
75
- return this.store.getAt(parseInt(itemId))[this.getKeyProperty()];
75
+ return this.store.getAt(parseInt(itemId))[this.getKeyProperty()]
76
76
  }
77
77
 
78
78
  /**
@@ -83,7 +83,7 @@ class Component extends Base {
83
83
  */
84
84
  onStoreSort(data) {
85
85
  this.sortItems(data);
86
- super.onStoreSort(data);
86
+ super.onStoreSort(data)
87
87
  }
88
88
 
89
89
  /**
@@ -103,10 +103,10 @@ class Component extends Base {
103
103
 
104
104
  data.items.forEach(item => {
105
105
  fromIndex = previousKeys.indexOf(item[key]);
106
- newItems.push(me.items[fromIndex]);
106
+ newItems.push(me.items[fromIndex])
107
107
  });
108
108
 
109
- me.items = newItems;
109
+ me.items = newItems
110
110
  }
111
111
  }
112
112
  }
@@ -20,6 +20,11 @@ class Animate extends Base {
20
20
  * @protected
21
21
  */
22
22
  className: 'Neo.list.plugin.Animate',
23
+ /**
24
+ * @member {String} ntype='plugin-list-animate'
25
+ * @protected
26
+ */
27
+ ntype: 'plugin-list-animate',
23
28
  /**
24
29
  * Read only
25
30
  * @member {Number|null} columns=null
@@ -63,11 +68,11 @@ class Animate extends Base {
63
68
  construct(config) {
64
69
  super.construct(config);
65
70
 
66
- let me = this,
67
- owner = me.owner;
71
+ let me = this,
72
+ {owner} = me;
68
73
 
69
74
  if (!owner.itemHeight || !owner.itemWidth) {
70
- console.error('list.plugin.Animate requires fixed itemHeight and itemWidth values', owner);
75
+ console.error('list.plugin.Animate requires fixed itemHeight and itemWidth values', owner)
71
76
  }
72
77
 
73
78
  me.adjustCreateItem();
@@ -75,18 +80,18 @@ class Animate extends Base {
75
80
  owner.onStoreFilter = me.onStoreFilter.bind(me);
76
81
  owner.onStoreSort = me.onStoreSort .bind(me);
77
82
 
78
- this.updateTransitionDetails(false);
83
+ this.updateTransitionDetails(false)
79
84
  }
80
85
 
81
86
  /**
82
87
  *
83
88
  */
84
89
  adjustCreateItem() {
85
- let me = this,
86
- owner = me.owner;
90
+ let me = this,
91
+ {owner} = me;
87
92
 
88
93
  me.ownerCreateItem = owner.createItem.bind(owner);
89
- owner.createItem = me.createItem.bind(owner, me);
94
+ owner.createItem = me.createItem.bind(owner, me)
90
95
  }
91
96
 
92
97
  /**
@@ -96,7 +101,7 @@ class Animate extends Base {
96
101
  * @protected
97
102
  */
98
103
  afterSetTransitionDuration(value, oldValue) {
99
- this.isConstructed && this.updateTransitionDetails(Neo.isNumber(oldValue));
104
+ this.isConstructed && this.updateTransitionDetails(Neo.isNumber(oldValue))
100
105
  }
101
106
 
102
107
  /**
@@ -106,7 +111,7 @@ class Animate extends Base {
106
111
  * @protected
107
112
  */
108
113
  afterSetTransitionEasing(value, oldValue) {
109
- this.isConstructed && this.updateTransitionDetails(!!oldValue);
114
+ this.isConstructed && this.updateTransitionDetails(!!oldValue)
110
115
  }
111
116
 
112
117
  /**
@@ -116,7 +121,7 @@ class Animate extends Base {
116
121
  * @protected
117
122
  */
118
123
  beforeSetTransitionEasing(value, oldValue) {
119
- return this.beforeSetEnumValue(value, oldValue, 'transitionEasing');
124
+ return this.beforeSetEnumValue(value, oldValue, 'transitionEasing')
120
125
  }
121
126
 
122
127
  /**
@@ -127,12 +132,12 @@ class Animate extends Base {
127
132
  */
128
133
  createItem(me, record, index) {
129
134
  let item = me.ownerCreateItem(record, index),
130
- owner = me.owner,
135
+ {owner} = me,
131
136
  position = me.getItemPosition(record, index),
132
137
  style = item.style || {};
133
138
 
134
139
  if (!me.ownerRect) {
135
- return null;
140
+ return null
136
141
  }
137
142
 
138
143
  Object.assign(style, {
@@ -144,7 +149,7 @@ class Animate extends Base {
144
149
 
145
150
  item.style = style;
146
151
 
147
- return item;
152
+ return item
148
153
  }
149
154
 
150
155
  /**
@@ -104,6 +104,11 @@ class DomAccess extends Base {
104
104
  'windowScrollTo'
105
105
  ]
106
106
  },
107
+ /**
108
+ * @member {Boolean} renderCountDeltas_=false
109
+ * @protected
110
+ */
111
+ renderCountDeltas_: false,
107
112
  /**
108
113
  * @member {Boolean} singleton=true
109
114
  * @protected
@@ -120,6 +125,12 @@ class DomAccess extends Base {
120
125
  ]
121
126
  }
122
127
 
128
+ /**
129
+ * @member {Number} logDeltasIntervalId=0
130
+ * @protected
131
+ */
132
+ logDeltasIntervalId = 0
133
+
123
134
  /**
124
135
  * @returns {HTMLElement}
125
136
  */
@@ -129,7 +140,7 @@ class DomAccess extends Base {
129
140
  if (!me._modalMask) {
130
141
  me._modalMask = document.createElement('div');
131
142
  me._modalMask.className = 'neo-dialog-modal-mask';
132
- me._modalMask.addEventListener('mousedown', doPreventDefault, { capture : true })
143
+ me._modalMask.addEventListener('mousedown', doPreventDefault, {capture : true})
133
144
  }
134
145
 
135
146
  return me._modalMask
@@ -141,20 +152,10 @@ class DomAccess extends Base {
141
152
  construct(config) {
142
153
  super.construct(config);
143
154
 
144
- const me = this;
155
+ let me = this;
145
156
 
146
157
  if (Neo.config.renderCountDeltas) {
147
- let node;
148
-
149
- setInterval(() => {
150
- node = document.getElementById('neo-delta-updates');
151
-
152
- if (node) {
153
- node.innerHTML = String(me.countDeltasPer250ms * 4)
154
- }
155
-
156
- me.countDeltasPer250ms = 0
157
- }, 250)
158
+ me.renderCountDeltas = true
158
159
  }
159
160
 
160
161
  me.initGlobalListeners();
@@ -164,23 +165,26 @@ class DomAccess extends Base {
164
165
  me.syncAligns = me.syncAligns.bind(me)
165
166
  }
166
167
 
168
+ /**
169
+ *
170
+ */
167
171
  initGlobalListeners() {
168
- const me = this;
172
+ let me = this;
169
173
 
170
- document.addEventListener('mousedown', me.onDocumentMouseDown.bind(me), { capture : true });
171
- document.addEventListener('keydown', me.onDocumentKeyDown.bind(me), capturePassive);
172
- document.addEventListener('keyup', me.onDocumentKeyUp.bind(me), capturePassive);
173
- document.addEventListener('blur', me.onDocumentBlur.bind(me), capturePassive);
174
+ document.addEventListener('blur', me.onDocumentBlur .bind(me), capturePassive);
175
+ document.addEventListener('keydown', me.onDocumentKeyDown .bind(me), capturePassive);
176
+ document.addEventListener('keyup', me.onDocumentKeyUp .bind(me), capturePassive);
177
+ document.addEventListener('mousedown', me.onDocumentMouseDown.bind(me), {capture : true})
174
178
  }
175
179
 
176
180
  onDocumentMouseDown(e) {
177
- const focusController = e.target?.closest('[data-focus]');
181
+ let focusController = e.target?.closest('[data-focus]');
178
182
 
179
183
  // data-focus on an element means reject mousedown gestures, and move focus
180
184
  // to the referenced element.
181
185
  if (focusController) {
182
186
  e.preventDefault();
183
- document.getElementById(focusController.dataset.focus)?.focus();
187
+ document.getElementById(focusController.dataset.focus)?.focus()
184
188
  }
185
189
  }
186
190
 
@@ -207,11 +211,11 @@ class DomAccess extends Base {
207
211
  */
208
212
  addAligned(alignSpec) {
209
213
  const
210
- me = this,
211
- { id } = alignSpec,
212
- aligns = me._aligns || (me._aligns = new Map()),
213
- resizeObserver = me._alignResizeObserver || (me._alignResizeObserver = new ResizeObserver(me.syncAligns)),
214
- { constrainToElement } = alignSpec;
214
+ me = this,
215
+ {id} = alignSpec,
216
+ aligns = me._aligns || (me._aligns = new Map()),
217
+ resizeObserver = me._alignResizeObserver || (me._alignResizeObserver = new ResizeObserver(me.syncAligns)),
218
+ {constrainToElement} = alignSpec;
215
219
 
216
220
  // Set up listeners which monitor for changes
217
221
  if (!aligns.has(id)) {
@@ -266,18 +270,47 @@ class DomAccess extends Base {
266
270
  document.head.appendChild(script)
267
271
  }
268
272
 
273
+ /**
274
+ * Triggered after the renderCountDeltas config got changed
275
+ * @param {Boolean} value
276
+ * @param {Boolean} oldValue
277
+ * @protected
278
+ */
279
+ afterSetRenderCountDeltas(value, oldValue) {
280
+ let me = this,
281
+ {logDeltasIntervalId} = me,
282
+ node;
283
+
284
+ if (value) {
285
+ if (logDeltasIntervalId === 0) {
286
+ me.logDeltasIntervalId = setInterval(() => {
287
+ node = document.getElementById('neo-delta-updates');
288
+
289
+ if (node) {
290
+ node.innerHTML = String(me.countDeltasPer250ms * 4)
291
+ }
292
+
293
+ me.countDeltasPer250ms = 0
294
+ }, 250)
295
+ }
296
+ } else {
297
+ logDeltasIntervalId && clearInterval(logDeltasIntervalId);
298
+ me.logDeltasInterval = 0
299
+ }
300
+ }
301
+
269
302
  /**
270
303
  * @param {Object} data
271
304
  * @returns {Promise<void>}
272
305
  */
273
306
  async align(data) {
274
307
  const
275
- me = this,
276
- { constrainTo } = data,
277
- subject = data.subject = me.getElement(data.id),
278
- { style } = subject,
279
- align = {...data},
280
- lastAlign = me._aligns?.get(data.id);
308
+ me = this,
309
+ {constrainTo} = data,
310
+ subject = data.subject = me.getElement(data.id),
311
+ {style} = subject,
312
+ align = {...data},
313
+ lastAlign = me._aligns?.get(data.id);
281
314
 
282
315
  if (lastAlign) {
283
316
  subject.classList.remove(`neo-aligned-${lastAlign.result.position}`)
@@ -288,16 +321,17 @@ class DomAccess extends Base {
288
321
  me.resetDimensions(align);
289
322
 
290
323
  // The Rectangle's align spec target and constrainTo must be Rectangles
291
- align.target = me.getClippedRect({ id : data.targetElement = me.getElementOrBody(data.target) });
324
+ align.target = me.getClippedRect({id : data.targetElement = me.getElementOrBody(data.target)});
292
325
 
293
326
  if (!align.target) {
294
327
  // Set the Component with id data.id to hidden : true
295
- return Neo.worker.App.setConfigs({ id : data.id, hidden : true })
328
+ return Neo.worker.App.setConfigs({id: data.id, hidden: true})
296
329
  }
297
330
 
298
331
  data.offsetParent = data.targetElement.offsetParent;
332
+
299
333
  if (constrainTo) {
300
- align.constrainTo = me.getBoundingClientRect({ id : data.constrainToElement = me.getElementOrBody(constrainTo) })
334
+ align.constrainTo = me.getBoundingClientRect({id : data.constrainToElement = me.getElementOrBody(constrainTo)})
301
335
  }
302
336
 
303
337
  // Get an aligned clone of myRect aligned according to the align object
@@ -310,9 +344,11 @@ class DomAccess extends Base {
310
344
  left : 0,
311
345
  transform : `translate(${result.x}px,${result.y}px)`
312
346
  });
347
+
313
348
  if (result.width !== myRect.width) {
314
349
  style.width = `${result.width}px`
315
350
  }
351
+
316
352
  if (result.height !== myRect.height) {
317
353
  style.height = `${result.height}px`
318
354
  }
@@ -350,7 +386,7 @@ class DomAccess extends Base {
350
386
  */
351
387
  execCommand(data) {
352
388
  document.execCommand(data.command);
353
- return data;
389
+ return data
354
390
  }
355
391
 
356
392
  /**
@@ -365,18 +401,19 @@ class DomAccess extends Base {
365
401
  // The children property means focus inner elements if possible.
366
402
  if (!DomUtils.isFocusable(node) && data.children) {
367
403
  // query for the first focusable decendent
368
- node = DomUtils.query(node, DomUtils.isFocusable);
404
+ node = DomUtils.query(node, DomUtils.isFocusable)
369
405
  }
406
+
370
407
  if (node) {
371
408
  node.focus();
372
409
 
373
410
  if (Neo.isNumber(node.selectionStart)) {
374
- node.selectionStart = node.selectionEnd = node.value.length;
411
+ node.selectionStart = node.selectionEnd = node.value.length
375
412
  }
376
413
  }
377
414
  }
378
415
 
379
- return {id: data.id};
416
+ return {id: data.id}
380
417
  }
381
418
 
382
419
  /**
@@ -449,10 +486,10 @@ class DomAccess extends Base {
449
486
  // Note that 0px is what the DOM reports if no minWidth is specified
450
487
  // so we do not report a minimum in these cases.
451
488
  if (lengthRE.test(minWidth) && minWidth !== '0px') {
452
- returnData.minWidth = me.measure({ value : minWidth, id : node})
489
+ returnData.minWidth = me.measure({value: minWidth, id: node})
453
490
  }
454
491
  if (lengthRE.test(minHeight) && minHeight !== '0px') {
455
- returnData.minHeight = me.measure({ value : minHeight, id : node })
492
+ returnData.minHeight = me.measure({value: minHeight, id: node})
456
493
  }
457
494
  }
458
495
  }
@@ -465,9 +502,10 @@ class DomAccess extends Base {
465
502
  * @returns {Neo.util.Rectangle}
466
503
  */
467
504
  getClippedRect(data) {
468
- let node = this.getElement(typeof data === 'object' ? data.id : data),
469
- { defaultView } = node.ownerDocument,
470
- rect = this.getBoundingClientRect(node);
505
+ let me = this,
506
+ node = me.getElement(typeof data === 'object' ? data.id : data),
507
+ {defaultView} = node.ownerDocument,
508
+ rect = me.getBoundingClientRect(node);
471
509
 
472
510
  for (let parentElement = node.offsetParent; parentElement && rect && parentElement !== document.documentElement; parentElement = parentElement.parentElement) {
473
511
  if (defaultView.getComputedStyle(parentElement).getPropertyValue('overflow') !== 'visible') {
@@ -502,12 +540,12 @@ class DomAccess extends Base {
502
540
  * @returns {Object}
503
541
  */
504
542
  getScrollingDimensions(data) {
505
- const me = this;
543
+ let me = this;
506
544
 
507
545
  if (Array.isArray(data.id)) {
508
- return data.id.map(id => me.getScrollingDimensions({ id }))
546
+ return data.id.map(id => me.getScrollingDimensions({id}))
509
547
  } else {
510
- const node = data.nodeType ? data : me.getElementOrBody(data.id);
548
+ let node = data.nodeType ? data : me.getElementOrBody(data.id);
511
549
 
512
550
  return {
513
551
  clientHeight: node?.clientHeight,
@@ -723,7 +761,7 @@ class DomAccess extends Base {
723
761
  let attributes = data.attributes || [],
724
762
  functions = data.functions || [],
725
763
  styles = data.styles || [],
726
- vnodeId = data.vnodeId,
764
+ {vnodeId} = data,
727
765
  retAttributes = {},
728
766
  retFunctions = {},
729
767
  retStyles = {},
@@ -731,7 +769,7 @@ class DomAccess extends Base {
731
769
  fnName, scope;
732
770
 
733
771
  attributes.forEach(key => {
734
- retAttributes[key] = element[key];
772
+ retAttributes[key] = element[key]
735
773
  });
736
774
 
737
775
  functions.forEach((key, index) => {
@@ -861,7 +899,7 @@ class DomAccess extends Base {
861
899
  };
862
900
 
863
901
  if (opts.behavior !== 'smooth') {
864
- node.scrollIntoView(opts);
902
+ node.scrollIntoView(opts)
865
903
  } else {
866
904
  // scrollIntoView() does not provide a callback yet.
867
905
  // See: https://github.com/w3c/csswg-drafts/issues/3744
@@ -983,8 +1021,8 @@ class DomAccess extends Base {
983
1021
  */
984
1022
  syncAligns() {
985
1023
  const
986
- me = this,
987
- { _aligns } = me;
1024
+ me = this,
1025
+ {_aligns} = me;
988
1026
 
989
1027
  // Keep all registered aligns aligned on any detected change
990
1028
  _aligns?.forEach(align => {
@@ -1002,8 +1040,8 @@ class DomAccess extends Base {
1002
1040
  }
1003
1041
 
1004
1042
  const
1005
- { _alignResizeObserver } = me,
1006
- { constrainToElement } = align;
1043
+ {_alignResizeObserver} = me,
1044
+ {constrainToElement} = align;
1007
1045
 
1008
1046
  // Stop observing the align elements
1009
1047
  _alignResizeObserver.unobserve(align.subject);
@@ -1121,6 +1159,4 @@ class DomAccess extends Base {
1121
1159
  }
1122
1160
  }
1123
1161
 
1124
- let instance = Neo.setupClass(DomAccess);
1125
-
1126
- export default instance;
1162
+ export default Neo.setupClass(DomAccess);
@@ -62,9 +62,10 @@ const lastWheelEvent = {
62
62
  target: null
63
63
  };
64
64
 
65
- const disabledInputKeys = {},
66
- preventClickTargets = [],
67
- preventContextmenuTargets = [];
65
+ const
66
+ disabledInputKeys = {},
67
+ preventClickTargets = [],
68
+ preventContextmenuTargets = [];
68
69
 
69
70
  /**
70
71
  * @class Neo.main.DomEvents
@@ -181,8 +182,9 @@ class DomEvents extends Base {
181
182
  * @param {Object} event
182
183
  */
183
184
  domEventListener(event) {
184
- let me = this,
185
- target = event.target,
185
+ let me = this,
186
+ {target} = event,
187
+
186
188
  config = {
187
189
  action : 'domEvent',
188
190
  eventName: event.type,
@@ -199,41 +201,41 @@ class DomEvents extends Base {
199
201
  switch (event.type) {
200
202
  case 'dragend':
201
203
  me.dragElementId = null;
202
- break;
204
+ break
203
205
  case 'dragenter':
204
206
  if (me.dragElementId === target.id) {
205
- return; // ignore target and source to be the same
207
+ return // ignore target and source to be the same
206
208
  }
207
- break;
209
+ break
208
210
  case 'dragleave':
209
211
  if (me.dragElementId === target.id) {
210
- return; // ignore target and source to be the same
212
+ return // ignore target and source to be the same
211
213
  }
212
- break;
214
+ break
213
215
  case 'dragover':
214
216
  me.onDragOver(event);
215
217
  event.preventDefault();
216
- break;
218
+ break
217
219
  case 'dragstart':
218
220
  me.dragElementId = target.id;
219
- break;
221
+ break
220
222
  case 'drop':
221
223
  if (!me.dragElementId || me.dragElementId === target.id) {
222
- return; // drop fires twice by default & drop should not trigger on the drag element
224
+ return // drop fires twice by default & drop should not trigger on the drag element
223
225
  }
224
226
  if (event.stopPropagation) {
225
- event.stopPropagation(); // stops the browser from redirecting.
227
+ event.stopPropagation() // stops the browser from redirecting.
226
228
  }
227
229
  event.preventDefault();
228
230
  config.data.srcId = me.dragElementId;
229
231
  me.dragElementId = null;
230
- break;
232
+ break
231
233
  case 'mousemove':
232
234
  Object.assign(config.data, me.getMouseEventData(event));
233
- break;
235
+ break
234
236
  default:
235
237
  event.preventDefault();
236
- break;
238
+ break
237
239
  }
238
240
 
239
241
  Neo.worker.Manager.sendMessage('app', config)
@@ -248,7 +250,7 @@ class DomEvents extends Base {
248
250
  * @returns {Number}
249
251
  */
250
252
  getDistance(x1, y1, x2, y2) {
251
- return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
253
+ return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
252
254
  }
253
255
 
254
256
  /**
@@ -420,10 +422,10 @@ class DomEvents extends Base {
420
422
  * @param {InputEvent} event
421
423
  */
422
424
  onChange(event) {
423
- let me = this,
424
- target = event.target,
425
+ let me = this,
426
+ {target} = event,
425
427
 
426
- data = {
428
+ data = {
427
429
  ...me.getEventData(event),
428
430
  valid: target.checkValidity(),
429
431
  value: target.value
@@ -505,16 +507,16 @@ class DomEvents extends Base {
505
507
  *
506
508
  */
507
509
  onHashChange() {
508
- let manager = Neo.worker.Manager,
510
+ let {Manager} = Neo.worker,
509
511
  hashString = location.hash.substring(1);
510
512
 
511
- manager.sendMessage('app', {
513
+ Manager.sendMessage('app', {
512
514
  action: 'hashChange',
513
515
  data : {
514
- appNames: manager.appNames,
516
+ appNames: Manager.appNames,
515
517
  hash : this.parseHash(hashString),
516
518
  hashString,
517
- windowId: manager.windowId
519
+ windowId: Manager.windowId
518
520
  }
519
521
  })
520
522
  }
@@ -523,8 +525,8 @@ class DomEvents extends Base {
523
525
  * @param {KeyboardEvent} event
524
526
  */
525
527
  onKeyDown(event) {
526
- let target = event.target,
527
- tagName = target.tagName,
528
+ let {target} = event,
529
+ {tagName} = target,
528
530
  isInput = tagName === 'INPUT' || tagName === 'TEXTAREA';
529
531
 
530
532
  if (isInput && disabledInputKeys[target.id]?.includes(event.key)) {
@@ -588,13 +590,12 @@ class DomEvents extends Base {
588
590
  */
589
591
  onOrientationChange(event) {
590
592
  const
591
- orientation = screen.orientation,
592
- angle = orientation.angle,
593
- layout = angle === 0 || angle === 180 ? 'portrait' : 'landscape',
594
- type = orientation.type,
595
- manager = Neo.worker.Manager;
593
+ {orientation} = screen,
594
+ {angle, type} = orientation,
595
+ layout = angle === 0 || angle === 180 ? 'portrait' : 'landscape',
596
+ {Manager} = Neo.worker;
596
597
 
597
- manager.sendMessage('app', {
598
+ Manager.sendMessage('app', {
598
599
  action: 'orientationChange',
599
600
  data : {angle, layout, type}
600
601
  })
@@ -619,9 +620,9 @@ class DomEvents extends Base {
619
620
  * @param {Event} event
620
621
  */
621
622
  onSelectionChange(event) {
622
- let me = this,
623
- target = event.target,
624
- element = target.type ? target : target.activeElement,
623
+ let me = this,
624
+ {target} = event,
625
+ element = target.type ? target : target.activeElement,
625
626
  path, targetData;
626
627
 
627
628
  if (target.tagName === 'BODY') {
@@ -847,6 +848,4 @@ class DomEvents extends Base {
847
848
  }
848
849
  }
849
850
 
850
- let instance = Neo.setupClass(DomEvents);
851
-
852
- export default instance;
851
+ export default Neo.setupClass(DomEvents);