neo.mjs 6.17.1 → 6.18.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.
- package/apps/ServiceWorker.mjs +3 -5
- package/apps/colors/README.md +8 -0
- package/apps/colors/app.mjs +6 -0
- package/apps/colors/childapps/widget/app.mjs +7 -0
- package/apps/colors/childapps/widget/index.html +11 -0
- package/apps/colors/childapps/widget/neo-config.json +10 -0
- package/apps/colors/childapps/widget/view/Viewport.mjs +19 -0
- package/apps/colors/index.html +11 -0
- package/apps/colors/model/Color.mjs +43 -0
- package/apps/colors/neo-config.json +10 -0
- package/apps/colors/remotes-api.json +13 -0
- package/apps/colors/store/Colors.mjs +24 -0
- package/apps/colors/view/BarChartComponent.mjs +64 -0
- package/apps/colors/view/HeaderToolbar.mjs +95 -0
- package/apps/colors/view/PieChartComponent.mjs +58 -0
- package/apps/colors/view/TableContainer.mjs +91 -0
- package/apps/colors/view/Viewport.mjs +57 -0
- package/apps/colors/view/ViewportController.mjs +277 -0
- package/apps/colors/view/ViewportModel.mjs +53 -0
- package/apps/portal/Util.mjs +11 -0
- package/apps/portal/childapps/preview/neo-config.json +2 -2
- package/apps/portal/neo-config.json +2 -1
- package/apps/portal/remotes-api.json +13 -0
- package/apps/portal/view/HeaderToolbar.mjs +44 -27
- package/apps/portal/view/Viewport.mjs +12 -1
- package/apps/portal/view/ViewportController.mjs +89 -1
- package/apps/portal/view/home/MainContainer.mjs +27 -60
- package/apps/portal/view/home/parts/AfterMath.mjs +58 -0
- package/apps/portal/view/home/parts/Colors.mjs +74 -0
- package/apps/portal/view/home/parts/Features.mjs +52 -0
- package/apps/portal/view/home/parts/Helix.mjs +75 -0
- package/apps/portal/view/home/parts/HelloWorld.mjs +82 -0
- package/apps/portal/view/home/parts/MainNeo.mjs +55 -0
- package/apps/portal/view/home/preview/PageCodeContainer.mjs +55 -0
- package/apps/portal/view/learn/LivePreview.mjs +72 -29
- package/apps/portal/view/learn/MainContainerController.mjs +10 -90
- package/apps/realworld/api/Article.mjs +1 -3
- package/apps/realworld/api/Favorite.mjs +1 -3
- package/apps/realworld/api/Profile.mjs +1 -3
- package/apps/realworld/api/Tag.mjs +1 -3
- package/apps/realworld/api/User.mjs +1 -3
- package/apps/realworld2/api/Article.mjs +1 -3
- package/apps/realworld2/api/Favorite.mjs +1 -3
- package/apps/realworld2/api/Profile.mjs +1 -3
- package/apps/realworld2/api/Tag.mjs +1 -3
- package/apps/realworld2/api/User.mjs +1 -3
- package/apps/realworld2/view/article/HelixContainer.mjs +5 -5
- package/buildScripts/webpack/json/myApps.template.json +1 -0
- package/buildScripts/webpack/webpack.server.config.mjs +4 -1
- package/docs/app/view/MainContainer.mjs +5 -0
- package/docs/app/view/classdetails/MembersList.mjs +1 -1
- package/examples/ServiceWorker.mjs +3 -5
- package/examples/component/helix/Viewport.mjs +309 -0
- package/examples/component/helix/ViewportController.mjs +122 -0
- package/examples/component/helix/app.mjs +2 -2
- package/examples/component/helix/neo-config.json +0 -1
- package/examples/component/multiWindowHelix/Viewport.mjs +11 -3
- package/examples/component/multiWindowHelix/ViewportController.mjs +21 -9
- package/examples/component/multiWindowHelix/neo-config.json +0 -1
- package/examples/fieldWithPrefix/MainContainer.mjs +1 -6
- package/examples/list/animate/MainContainerController.mjs +1 -1
- package/examples/worker/task/MyTasks.mjs +1 -3
- package/package.json +5 -5
- package/resources/data/deck/learnneo/pages/GuideEvents.md +131 -0
- package/resources/data/deck/learnneo/pages/WhyNeo-Speed.md +1 -1
- package/resources/images/logo/neo_logo_primary.svg +6 -0
- package/resources/images/logo/neo_logo_secondary.svg +6 -0
- package/resources/images/logo/neo_logo_text_primary.svg +5 -0
- package/resources/images/logo/neo_logo_text_secondary.svg +5 -0
- package/resources/images/logo/neo_logo_white.svg +6 -0
- package/resources/scss/src/apps/colors/BarChartComponent.scss +3 -0
- package/resources/scss/src/apps/colors/HeaderToolbar.scss +11 -0
- package/resources/scss/src/apps/colors/PieChartComponent.scss +3 -0
- package/resources/scss/src/apps/colors/TableContainer.scss +64 -0
- package/resources/scss/src/apps/colors/Viewport.scss +9 -0
- package/resources/scss/src/apps/portal/HeaderToolbar.scss +189 -17
- package/resources/scss/src/apps/portal/home/MainContainer.scss +46 -20
- package/resources/scss/src/apps/portal/home/parts/Features.scss +3 -0
- package/resources/scss/src/apps/portal/home/preview/PageCodeContainer.scss +115 -0
- package/resources/scss/src/component/Base.scss +2 -0
- package/resources/scss/src/examples/component/multiWindowHelix/Viewport.scss +3 -0
- package/resources/scss/src/form/field/CheckBox.scss +1 -0
- package/resources/scss/src/tab/header/Button.scss +2 -1
- package/resources/scss/theme-dark/Global.scss +8 -0
- package/resources/scss/theme-dark/button/Base.scss +1 -1
- package/resources/scss/theme-dark/tab/header/Button.scss +1 -0
- package/resources/scss/theme-light/Global.scss +8 -0
- package/resources/scss/theme-light/button/Base.scss +1 -1
- package/resources/scss/theme-light/tab/header/Button.scss +1 -0
- package/resources/scss/theme-neo-light/Global.scss +53 -53
- package/resources/scss/theme-neo-light/button/Base.scss +3 -4
- package/resources/scss/theme-neo-light/tab/header/Button.scss +6 -8
- package/src/DefaultConfig.mjs +2 -2
- package/src/Fetch.mjs +1 -3
- package/src/Main.mjs +13 -11
- package/src/MicroLoader.mjs +2 -2
- package/src/Neo.mjs +27 -26
- package/src/Xhr.mjs +1 -3
- package/src/button/Base.mjs +6 -4
- package/src/button/Split.mjs +10 -9
- package/src/calendar/view/EditEventContainer.mjs +13 -12
- package/src/calendar/view/MainContainer.mjs +40 -40
- package/src/calendar/view/MainContainerModel.mjs +5 -5
- package/src/calendar/view/SettingsContainer.mjs +11 -11
- package/src/calendar/view/YearComponent.mjs +73 -75
- package/src/calendar/view/calendars/ColorsList.mjs +2 -2
- package/src/calendar/view/calendars/EditContainer.mjs +2 -2
- package/src/calendar/view/calendars/List.mjs +12 -13
- package/src/calendar/view/month/Component.mjs +72 -73
- package/src/calendar/view/settings/GeneralContainer.mjs +5 -5
- package/src/calendar/view/settings/MonthContainer.mjs +5 -5
- package/src/calendar/view/settings/WeekContainer.mjs +6 -6
- package/src/calendar/view/settings/YearContainer.mjs +4 -4
- package/src/calendar/view/week/Component.mjs +47 -57
- package/src/calendar/view/week/EventDragZone.mjs +43 -50
- package/src/calendar/view/week/TimeAxisComponent.mjs +21 -21
- package/src/calendar/view/week/plugin/DragDrop.mjs +53 -45
- package/src/calendar/view/week/plugin/EventResizable.mjs +8 -3
- package/src/collection/Base.mjs +15 -22
- package/src/collection/Filter.mjs +4 -9
- package/src/collection/Sorter.mjs +6 -7
- package/src/component/Base.mjs +149 -87
- package/src/component/Canvas.mjs +9 -9
- package/src/component/Carousel.mjs +31 -33
- package/src/component/Chip.mjs +9 -9
- package/src/component/Circle.mjs +84 -91
- package/src/component/Clock.mjs +8 -8
- package/src/component/DateSelector.mjs +14 -15
- package/src/component/Gallery.mjs +82 -80
- package/src/component/Helix.mjs +131 -126
- package/src/component/Iframe.mjs +1 -1
- package/src/component/Label.mjs +1 -1
- package/src/component/Legend.mjs +3 -3
- package/src/component/Process.mjs +39 -37
- package/src/component/Splitter.mjs +9 -11
- package/src/component/StatusBadge.mjs +2 -3
- package/src/component/Timer.mjs +62 -68
- package/src/component/Toast.mjs +11 -11
- package/src/component/Video.mjs +7 -8
- package/src/component/mwc/Button.mjs +10 -10
- package/src/component/mwc/TextField.mjs +17 -17
- package/src/component/wrapper/AmChart.mjs +5 -5
- package/src/component/wrapper/CesiumJS.mjs +11 -17
- package/src/component/wrapper/GoogleMaps.mjs +58 -35
- package/src/component/wrapper/MapboxGL.mjs +112 -79
- package/src/component/wrapper/MonacoEditor.mjs +1 -6
- package/src/container/Accordion.mjs +18 -20
- package/src/container/AccordionItem.mjs +12 -11
- package/src/container/Base.mjs +29 -28
- package/src/container/Panel.mjs +9 -9
- package/src/container/Viewport.mjs +30 -1
- package/src/controller/Base.mjs +12 -14
- package/src/controller/Component.mjs +60 -66
- package/src/core/Base.mjs +5 -8
- package/src/core/IdGenerator.mjs +1 -3
- package/src/core/Observable.mjs +17 -17
- package/src/core/Util.mjs +5 -5
- package/src/data/Model.mjs +3 -3
- package/src/data/RecordFactory.mjs +3 -6
- package/src/data/Store.mjs +34 -34
- package/src/data/connection/Fetch.mjs +3 -3
- package/src/data/connection/WebSocket.mjs +21 -25
- package/src/data/connection/Xhr.mjs +31 -28
- package/src/date/DayViewComponent.mjs +1 -1
- package/src/date/SelectorContainer.mjs +2 -2
- package/src/dialog/Base.mjs +27 -25
- package/src/dialog/header/Toolbar.mjs +5 -4
- package/src/draggable/DragProxyComponent.mjs +7 -4
- package/src/draggable/DragZone.mjs +30 -30
- package/src/draggable/DropZone.mjs +7 -7
- package/src/draggable/list/DragZone.mjs +18 -18
- package/src/draggable/tab/header/toolbar/SortZone.mjs +7 -7
- package/src/draggable/toolbar/DragZone.mjs +15 -15
- package/src/draggable/toolbar/SortZone.mjs +30 -31
- package/src/draggable/tree/DragZone.mjs +9 -9
- package/src/filter/BooleanContainer.mjs +3 -3
- package/src/filter/NumberContainer.mjs +5 -5
- package/src/filter/ToggleOperatorsButton.mjs +5 -5
- package/src/form/Fieldset.mjs +26 -26
- package/src/form/field/Base.mjs +1 -1
- package/src/form/field/CheckBox.mjs +15 -16
- package/src/form/field/Color.mjs +13 -15
- package/src/form/field/ComboBox.mjs +16 -24
- package/src/form/field/Country.mjs +1 -1
- package/src/form/field/Date.mjs +3 -4
- package/src/form/field/Display.mjs +1 -1
- package/src/form/field/Email.mjs +2 -2
- package/src/form/field/Number.mjs +51 -56
- package/src/form/field/Picker.mjs +2 -2
- package/src/form/field/Radio.mjs +1 -1
- package/src/form/field/Range.mjs +7 -6
- package/src/form/field/Text.mjs +29 -36
- package/src/form/field/TextArea.mjs +9 -9
- package/src/form/field/Time.mjs +30 -30
- package/src/form/field/trigger/Base.mjs +19 -13
- package/src/form/field/trigger/Clear.mjs +13 -13
- package/src/form/field/trigger/CopyToClipboard.mjs +7 -7
- package/src/form/field/trigger/Picker.mjs +2 -2
- package/src/form/field/trigger/SpinDown.mjs +1 -1
- package/src/form/field/trigger/SpinUp.mjs +1 -1
- package/src/form/field/trigger/SpinUpDown.mjs +3 -3
- package/src/form/field/trigger/Time.mjs +3 -3
- package/src/grid/Container.mjs +33 -33
- package/src/grid/View.mjs +20 -22
- package/src/grid/header/Button.mjs +12 -12
- package/src/grid/header/Toolbar.mjs +4 -4
- package/src/layout/Base.mjs +5 -4
- package/src/layout/Card.mjs +15 -16
- package/src/layout/Fit.mjs +22 -8
- package/src/layout/Flexbox.mjs +30 -29
- package/src/layout/Form.mjs +15 -15
- package/src/layout/Grid.mjs +2 -2
- package/src/layout/HBox.mjs +3 -2
- package/src/layout/VBox.mjs +3 -2
- package/src/list/Base.mjs +45 -47
- package/src/list/Chip.mjs +4 -4
- package/src/list/Circle.mjs +3 -3
- package/src/list/Color.mjs +4 -4
- package/src/list/Component.mjs +10 -10
- package/src/list/plugin/Animate.mjs +18 -13
- package/src/main/DomAccess.mjs +92 -56
- package/src/main/DomEvents.mjs +38 -39
- package/src/main/addon/AmCharts.mjs +37 -37
- package/src/main/addon/AnalyticsByGoogle.mjs +4 -4
- package/src/main/addon/CesiumJS.mjs +8 -8
- package/src/main/addon/CloneNode.mjs +5 -5
- package/src/main/addon/Cookie.mjs +4 -4
- package/src/main/addon/DragDrop.mjs +35 -34
- package/src/main/addon/GoogleMaps.mjs +19 -19
- package/src/main/addon/LocalStorage.mjs +3 -3
- package/src/main/addon/MapboxGL.mjs +40 -41
- package/src/main/addon/MonacoEditor.mjs +5 -5
- package/src/main/addon/Mwc.mjs +6 -6
- package/src/main/addon/Navigator.mjs +35 -39
- package/src/main/addon/Popover.mjs +5 -6
- package/src/main/addon/PrefixField.mjs +1 -2
- package/src/main/addon/ServiceWorker.mjs +9 -9
- package/src/main/addon/Siesta.mjs +3 -2
- package/src/main/addon/Stylesheet.mjs +37 -37
- package/src/main/addon/WebComponent.mjs +2 -3
- package/src/main/addon/WindowPosition.mjs +18 -18
- package/src/main/draggable/sensor/Base.mjs +2 -2
- package/src/main/draggable/sensor/Mouse.mjs +15 -15
- package/src/main/draggable/sensor/Touch.mjs +24 -23
- package/src/main/mixin/DeltaUpdates.mjs +10 -12
- package/src/main/mixin/TouchDomEvents.mjs +6 -6
- package/src/manager/Base.mjs +4 -4
- package/src/manager/Component.mjs +41 -41
- package/src/manager/DomEvent.mjs +52 -50
- package/src/manager/Focus.mjs +14 -16
- package/src/manager/Instance.mjs +2 -4
- package/src/manager/Store.mjs +4 -8
- package/src/manager/Task.mjs +20 -22
- package/src/manager/Toast.mjs +14 -16
- package/src/manager/rpc/Api.mjs +1 -3
- package/src/manager/rpc/Message.mjs +16 -18
- package/src/menu/List.mjs +16 -16
- package/src/menu/Panel.mjs +4 -4
- package/src/model/Component.mjs +5 -5
- package/src/plugin/Base.mjs +2 -0
- package/src/plugin/Popover.mjs +1 -1
- package/src/plugin/PrefixField.mjs +35 -45
- package/src/plugin/Resizable.mjs +86 -101
- package/src/plugin/Responsive.mjs +175 -0
- package/src/remotes/Api.mjs +4 -6
- package/src/selection/CircleModel.mjs +12 -16
- package/src/selection/DateSelectorModel.mjs +21 -23
- package/src/selection/GalleryModel.mjs +49 -63
- package/src/selection/HelixModel.mjs +35 -41
- package/src/selection/ListModel.mjs +9 -14
- package/src/selection/Model.mjs +31 -31
- package/src/selection/TreeAccordionModel.mjs +74 -80
- package/src/selection/grid/CellColumnModel.mjs +10 -10
- package/src/selection/grid/CellColumnRowModel.mjs +10 -10
- package/src/selection/grid/CellModel.mjs +26 -28
- package/src/selection/grid/CellRowModel.mjs +24 -24
- package/src/selection/grid/ColumnModel.mjs +16 -20
- package/src/selection/grid/RowModel.mjs +27 -29
- package/src/selection/menu/ListModel.mjs +2 -2
- package/src/selection/table/CellColumnModel.mjs +12 -12
- package/src/selection/table/CellColumnRowModel.mjs +12 -12
- package/src/selection/table/CellModel.mjs +26 -29
- package/src/selection/table/CellRowModel.mjs +19 -19
- package/src/selection/table/ColumnModel.mjs +18 -22
- package/src/selection/table/RowModel.mjs +27 -29
- package/src/sitemap/Component.mjs +20 -20
- package/src/sitemap/Store.mjs +1 -1
- package/src/tab/Container.mjs +15 -15
- package/src/tab/Strip.mjs +1 -1
- package/src/tab/header/Toolbar.mjs +4 -4
- package/src/table/Container.mjs +8 -10
- package/src/table/View.mjs +29 -34
- package/src/table/header/Button.mjs +18 -18
- package/src/table/header/Toolbar.mjs +2 -2
- package/src/toolbar/Base.mjs +14 -14
- package/src/toolbar/Breadcrumb.mjs +11 -11
- package/src/toolbar/Paging.mjs +18 -18
- package/src/tooltip/Base.mjs +20 -22
- package/src/tree/Accordion.mjs +69 -75
- package/src/tree/List.mjs +22 -25
- package/src/util/Array.mjs +19 -18
- package/src/util/ClassSystem.mjs +9 -9
- package/src/util/Css.mjs +2 -2
- package/src/util/Date.mjs +9 -9
- package/src/util/Function.mjs +2 -2
- package/src/util/HashHistory.mjs +3 -5
- package/src/util/KeyNavigation.mjs +17 -17
- package/src/util/Logger.mjs +9 -9
- package/src/util/Matrix.mjs +19 -19
- package/src/util/String.mjs +9 -9
- package/src/util/Style.mjs +11 -11
- package/src/util/VDom.mjs +12 -14
- package/src/util/VNode.mjs +29 -29
- package/src/vdom/Helper.mjs +84 -93
- package/src/vdom/VNode.mjs +1 -1
- package/src/worker/App.mjs +19 -16
- package/src/worker/Base.mjs +14 -15
- package/src/worker/Canvas.mjs +1 -3
- package/src/worker/Data.mjs +4 -8
- package/src/worker/Manager.mjs +27 -32
- package/src/worker/Message.mjs +1 -1
- package/src/worker/ServiceBase.mjs +38 -42
- package/src/worker/Task.mjs +1 -3
- package/src/worker/VDom.mjs +2 -4
- package/src/worker/mixin/RemoteMethodAccess.mjs +5 -6
- package/examples/component/helix/MainContainer.mjs +0 -340
- package/resources/images/Neo_Vector.svg +0 -3
- package/resources/images/logos/Github-logo-black.svg +0 -1
- package/resources/images/logos/Slack-logo-black.svg +0 -17
package/src/manager/DomEvent.mjs
CHANGED
@@ -76,10 +76,9 @@ class DomEvent extends Base {
|
|
76
76
|
console.error('For using resize domListeners, you must include main.addon.ResizeObserver.', event)
|
77
77
|
}
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
})
|
79
|
+
let {id, windowId} = component;
|
80
|
+
|
81
|
+
Neo.main.addon.ResizeObserver.register({id, windowId})
|
83
82
|
}
|
84
83
|
|
85
84
|
/**
|
@@ -87,15 +86,15 @@ class DomEvent extends Base {
|
|
87
86
|
* @protected
|
88
87
|
*/
|
89
88
|
fire(event) {
|
90
|
-
let me
|
91
|
-
bubble
|
92
|
-
data
|
93
|
-
eventName
|
94
|
-
i
|
95
|
-
listeners
|
96
|
-
pathIds
|
97
|
-
path
|
98
|
-
len
|
89
|
+
let me = this,
|
90
|
+
bubble = true,
|
91
|
+
data = event.data || {},
|
92
|
+
{eventName} = event,
|
93
|
+
i = 0,
|
94
|
+
listeners = null,
|
95
|
+
pathIds = data.path.map(e => e.id),
|
96
|
+
path = ComponentManager.getParentPath(pathIds),
|
97
|
+
len = path.length,
|
99
98
|
component, delegationTargetId, id, preventFire;
|
100
99
|
|
101
100
|
for (; i < len; i++) {
|
@@ -103,7 +102,7 @@ class DomEvent extends Base {
|
|
103
102
|
component = Neo.getComponent(id);
|
104
103
|
|
105
104
|
if (!component || component.disabled) {
|
106
|
-
break
|
105
|
+
break
|
107
106
|
}
|
108
107
|
|
109
108
|
listeners = me.items[id]?.[eventName];
|
@@ -117,14 +116,19 @@ class DomEvent extends Base {
|
|
117
116
|
let result;
|
118
117
|
|
119
118
|
if (listener && listener.fn) {
|
120
|
-
|
119
|
+
if (eventName === 'resize') {
|
120
|
+
// we do not want delegation for custom main.addon.ResizeObserver events
|
121
|
+
delegationTargetId = data.id === component.id ? data.id : false
|
122
|
+
} else {
|
123
|
+
delegationTargetId = me.verifyDelegationPath(listener, data.path)
|
124
|
+
}
|
121
125
|
|
122
126
|
if (delegationTargetId !== false) {
|
123
127
|
preventFire = false;
|
124
128
|
|
125
129
|
// we only want mouseenter & leave to fire on their top level nodes, not for children
|
126
130
|
if (eventName === 'mouseenter' || eventName === 'mouseleave') {
|
127
|
-
preventFire = !DomEvent.verifyMouseEnterLeave(component, data, delegationTargetId, eventName)
|
131
|
+
preventFire = !DomEvent.verifyMouseEnterLeave(component, data, delegationTargetId, eventName)
|
128
132
|
}
|
129
133
|
|
130
134
|
if (!preventFire) {
|
@@ -135,17 +139,18 @@ class DomEvent extends Base {
|
|
135
139
|
|
136
140
|
// Handler needs to know which actual target matched the delegate
|
137
141
|
data.currentTarget = delegationTargetId;
|
142
|
+
|
138
143
|
result = listener.fn.apply(listener.scope || globalThis, [data]);
|
139
144
|
|
140
145
|
if (!listener.bubble) {
|
141
|
-
bubble = false
|
146
|
+
bubble = false
|
142
147
|
}
|
143
148
|
}
|
144
149
|
}
|
145
150
|
}
|
146
151
|
// If a listener returns false, we stop iterating the listeners
|
147
152
|
return result !== false
|
148
|
-
})
|
153
|
+
})
|
149
154
|
}
|
150
155
|
}
|
151
156
|
|
@@ -156,12 +161,12 @@ class DomEvent extends Base {
|
|
156
161
|
data
|
157
162
|
});
|
158
163
|
|
159
|
-
break
|
164
|
+
break
|
160
165
|
}
|
161
166
|
|
162
|
-
//
|
167
|
+
// Honor the Event cancelBubble property
|
163
168
|
if (!bubble || data.cancelBubble) {
|
164
|
-
break
|
169
|
+
break
|
165
170
|
}
|
166
171
|
}
|
167
172
|
|
@@ -174,7 +179,7 @@ class DomEvent extends Base {
|
|
174
179
|
'drop' : 'onDrop',
|
175
180
|
'drop:enter': 'onDropEnter',
|
176
181
|
'drop:leave': 'onDropLeave',
|
177
|
-
}[eventName]].call(dragZone, data)
|
182
|
+
}[eventName]].call(dragZone, data)
|
178
183
|
}
|
179
184
|
}
|
180
185
|
}
|
@@ -201,12 +206,12 @@ class DomEvent extends Base {
|
|
201
206
|
if (Neo.isObject(config)) {
|
202
207
|
Object.keys(config).forEach(key => {
|
203
208
|
if (!eventConfigKeys.includes(key)) {
|
204
|
-
eventName = key
|
209
|
+
eventName = key
|
205
210
|
}
|
206
|
-
})
|
211
|
+
})
|
207
212
|
}
|
208
213
|
|
209
|
-
return eventName
|
214
|
+
return eventName
|
210
215
|
}
|
211
216
|
|
212
217
|
/**
|
@@ -226,7 +231,7 @@ class DomEvent extends Base {
|
|
226
231
|
if (listeners?.[config.id]) {
|
227
232
|
event = listeners[config.id][config.eventName];
|
228
233
|
|
229
|
-
return event || null
|
234
|
+
return event || null
|
230
235
|
}
|
231
236
|
}
|
232
237
|
|
@@ -285,24 +290,21 @@ class DomEvent extends Base {
|
|
285
290
|
* @returns {Boolean} true if the listener got registered successfully (false in case it was already there)
|
286
291
|
*/
|
287
292
|
register(config) {
|
288
|
-
let alreadyRegistered
|
289
|
-
eventName
|
290
|
-
|
291
|
-
|
292
|
-
opts = config.opts,
|
293
|
-
scope = config.scope,
|
294
|
-
fnType = typeof opts,
|
293
|
+
let alreadyRegistered = false,
|
294
|
+
{eventName, id, opts, scope} = config,
|
295
|
+
listeners = this.items,
|
296
|
+
fnType = typeof opts,
|
295
297
|
fn, listener, listenerConfig, listenerId;
|
296
298
|
|
297
299
|
if (fnType === 'function' || fnType === 'string') {
|
298
|
-
fn = opts
|
300
|
+
fn = opts
|
299
301
|
} else {
|
300
302
|
fn = opts.fn;
|
301
|
-
scope = opts.scope || scope
|
303
|
+
scope = opts.scope || scope
|
302
304
|
}
|
303
305
|
|
304
306
|
if (!listeners[id]) {
|
305
|
-
listeners[id] = {}
|
307
|
+
listeners[id] = {}
|
306
308
|
}
|
307
309
|
|
308
310
|
if (listeners[id][eventName]) {
|
@@ -314,11 +316,11 @@ class DomEvent extends Base {
|
|
314
316
|
listener[key].scope === scope &&
|
315
317
|
listener[key].delegate === config.delegate
|
316
318
|
) {
|
317
|
-
alreadyRegistered = true
|
319
|
+
alreadyRegistered = true
|
318
320
|
}
|
319
321
|
})
|
320
322
|
} else {
|
321
|
-
listeners[id][eventName] = []
|
323
|
+
listeners[id][eventName] = []
|
322
324
|
}
|
323
325
|
|
324
326
|
if (alreadyRegistered === true) {
|
@@ -373,7 +375,7 @@ class DomEvent extends Base {
|
|
373
375
|
let listener = this.getListener(config);
|
374
376
|
|
375
377
|
if (listener) {
|
376
|
-
console.log('listener found', listener)
|
378
|
+
console.log('listener found', listener)
|
377
379
|
}
|
378
380
|
}
|
379
381
|
|
@@ -399,7 +401,7 @@ class DomEvent extends Base {
|
|
399
401
|
for (; i < len; i++) {
|
400
402
|
if (listeners[i].originalConfig === oldDomListener) {
|
401
403
|
NeoArray.remove(listeners, listeners[i]);
|
402
|
-
break
|
404
|
+
break
|
403
405
|
}
|
404
406
|
}
|
405
407
|
}
|
@@ -430,7 +432,7 @@ class DomEvent extends Base {
|
|
430
432
|
}, 100)
|
431
433
|
}
|
432
434
|
} else {
|
433
|
-
Logger.logError('Component.domListeners have to be an array', component)
|
435
|
+
Logger.logError('Component.domListeners have to be an array', component)
|
434
436
|
}
|
435
437
|
}
|
436
438
|
|
@@ -440,14 +442,16 @@ class DomEvent extends Base {
|
|
440
442
|
* @returns {Boolean|String} true in case the delegation string matches the event path
|
441
443
|
*/
|
442
444
|
verifyDelegationPath(listener, path) {
|
443
|
-
|
444
|
-
|
445
|
-
|
445
|
+
let {delegate} = listener,
|
446
|
+
j = 0,
|
447
|
+
pathLen = path.length,
|
448
|
+
targetId;
|
446
449
|
|
447
450
|
if (typeof delegate === 'function') {
|
448
451
|
j = delegate(path);
|
452
|
+
|
449
453
|
if (j != null) {
|
450
|
-
targetId = path[j].id
|
454
|
+
targetId = path[j].id
|
451
455
|
}
|
452
456
|
}
|
453
457
|
else {
|
@@ -461,7 +465,7 @@ class DomEvent extends Base {
|
|
461
465
|
isId = item.startsWith('#');
|
462
466
|
|
463
467
|
if (isId || item.startsWith('.')) {
|
464
|
-
item = item.substr(1)
|
468
|
+
item = item.substr(1)
|
465
469
|
}
|
466
470
|
|
467
471
|
for (; j < pathLen; j++) {
|
@@ -484,7 +488,7 @@ class DomEvent extends Base {
|
|
484
488
|
// ensure the delegation path is a child of the owner components root node
|
485
489
|
for (; j < pathLen; j++) {
|
486
490
|
if (path[j].id === listener.vnodeId) {
|
487
|
-
return targetId
|
491
|
+
return targetId
|
488
492
|
}
|
489
493
|
}
|
490
494
|
|
@@ -516,6 +520,4 @@ class DomEvent extends Base {
|
|
516
520
|
}
|
517
521
|
}
|
518
522
|
|
519
|
-
|
520
|
-
|
521
|
-
export default instance;
|
523
|
+
export default Neo.setupClass(DomEvent);
|
package/src/manager/Focus.mjs
CHANGED
@@ -60,7 +60,7 @@ class Focus extends CoreBase {
|
|
60
60
|
let history = this.history;
|
61
61
|
|
62
62
|
history.unshift(opts);
|
63
|
-
history.length >= this.maxHistoryLength && history.pop()
|
63
|
+
history.length >= this.maxHistoryLength && history.pop()
|
64
64
|
}
|
65
65
|
|
66
66
|
/**
|
@@ -71,7 +71,7 @@ class Focus extends CoreBase {
|
|
71
71
|
*/
|
72
72
|
focusEnter(opts) {
|
73
73
|
this.setComponentFocus(opts, true);
|
74
|
-
this.addToHistory(opts)
|
74
|
+
this.addToHistory(opts)
|
75
75
|
}
|
76
76
|
|
77
77
|
/**
|
@@ -81,7 +81,7 @@ class Focus extends CoreBase {
|
|
81
81
|
* @protected
|
82
82
|
*/
|
83
83
|
focusLeave(opts) {
|
84
|
-
this.setComponentFocus(opts, false)
|
84
|
+
this.setComponentFocus(opts, false)
|
85
85
|
}
|
86
86
|
|
87
87
|
/**
|
@@ -92,7 +92,7 @@ class Focus extends CoreBase {
|
|
92
92
|
*/
|
93
93
|
focusMove(opts) {
|
94
94
|
let me = this,
|
95
|
-
history
|
95
|
+
{history} = me,
|
96
96
|
newComponentPath = opts.componentPath,
|
97
97
|
oldComponentPath = history[0].componentPath,
|
98
98
|
focusEnter = NeoArray.difference(newComponentPath, oldComponentPath),
|
@@ -117,11 +117,11 @@ class Focus extends CoreBase {
|
|
117
117
|
component.fire('focusMove', data);
|
118
118
|
|
119
119
|
component.onFocusChange?.(data);
|
120
|
-
component.fire('focusChange', data)
|
120
|
+
component.fire('focusChange', data)
|
121
121
|
}
|
122
122
|
});
|
123
123
|
|
124
|
-
me.addToHistory(opts)
|
124
|
+
me.addToHistory(opts)
|
125
125
|
}
|
126
126
|
|
127
127
|
/**
|
@@ -136,9 +136,9 @@ class Focus extends CoreBase {
|
|
136
136
|
me.lastFocusInDate = new Date();
|
137
137
|
|
138
138
|
if (me.lastFocusOutDate && me.lastFocusInDate - me.lastFocusOutDate < me.maxFocusInOutGap) {
|
139
|
-
me.focusMove(opts)
|
139
|
+
me.focusMove(opts)
|
140
140
|
} else {
|
141
|
-
me.focusEnter(opts)
|
141
|
+
me.focusEnter(opts)
|
142
142
|
}
|
143
143
|
}
|
144
144
|
|
@@ -155,7 +155,7 @@ class Focus extends CoreBase {
|
|
155
155
|
|
156
156
|
setTimeout(() => {
|
157
157
|
if (me.lastFocusOutDate > me.lastFocusInDate) {
|
158
|
-
me.focusLeave(opts)
|
158
|
+
me.focusLeave(opts)
|
159
159
|
}
|
160
160
|
}, me.maxFocusInOutGap);
|
161
161
|
}
|
@@ -169,14 +169,14 @@ class Focus extends CoreBase {
|
|
169
169
|
*/
|
170
170
|
setComponentFocus(opts, containsFocus) {
|
171
171
|
let data = {
|
172
|
-
relatedTarget
|
172
|
+
relatedTarget: opts.data.relatedTarget
|
173
173
|
},
|
174
174
|
components = opts.componentPath.map(id => Neo.getComponent(id)),
|
175
175
|
handler;
|
176
176
|
|
177
177
|
components.forEach(component => {
|
178
178
|
if (component) {
|
179
|
-
component.containsFocus = containsFocus
|
179
|
+
component.containsFocus = containsFocus
|
180
180
|
}
|
181
181
|
});
|
182
182
|
|
@@ -192,12 +192,10 @@ class Focus extends CoreBase {
|
|
192
192
|
component.fire(containsFocus ? 'focusEnter' : 'focusLeave', data);
|
193
193
|
|
194
194
|
component.onFocusChange?.(data);
|
195
|
-
component.fire('focusChange', data)
|
195
|
+
component.fire('focusChange', data)
|
196
196
|
}
|
197
|
-
})
|
197
|
+
})
|
198
198
|
}
|
199
199
|
}
|
200
200
|
|
201
|
-
|
202
|
-
|
203
|
-
export default instance;
|
201
|
+
export default Neo.setupClass(Focus);
|
package/src/manager/Instance.mjs
CHANGED
@@ -44,11 +44,9 @@ class Instance extends Base {
|
|
44
44
|
consumeNeoIdMap() {
|
45
45
|
if (Neo.idMap) {
|
46
46
|
this.add(Object.values(Neo.idMap));
|
47
|
-
delete Neo.idMap
|
47
|
+
delete Neo.idMap
|
48
48
|
}
|
49
49
|
}
|
50
50
|
}
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
export default instance;
|
52
|
+
export default Neo.setupClass(Instance);
|
package/src/manager/Store.mjs
CHANGED
@@ -45,15 +45,13 @@ class Store extends Base {
|
|
45
45
|
for (; i < amountRows; i++) {
|
46
46
|
data.push({});
|
47
47
|
|
48
|
-
j
|
49
|
-
|
50
|
-
for (; j < amountColumns; j++) {
|
48
|
+
for (j=0; j < amountColumns; j++) {
|
51
49
|
data[i]['column' + j] = 'Column' + (j + 1) + ' - ' + Math.round(Math.random() / 1.5);
|
52
|
-
data[i]['column' + j + 'style'] = Math.round(Math.random() / 1.7) > 0 ? 'brown' : i%2 ? '#3c3f41' : '#323232'
|
50
|
+
data[i]['column' + j + 'style'] = Math.round(Math.random() / 1.7) > 0 ? 'brown' : i%2 ? '#3c3f41' : '#323232'
|
53
51
|
}
|
54
52
|
}
|
55
53
|
|
56
|
-
return data
|
54
|
+
return data
|
57
55
|
}
|
58
56
|
|
59
57
|
/**
|
@@ -83,6 +81,4 @@ class Store extends Base {
|
|
83
81
|
}
|
84
82
|
}
|
85
83
|
|
86
|
-
|
87
|
-
|
88
|
-
export default instance;
|
84
|
+
export default Neo.setupClass(Store);
|
package/src/manager/Task.mjs
CHANGED
@@ -56,7 +56,7 @@ class Task extends Base {
|
|
56
56
|
let me = this;
|
57
57
|
|
58
58
|
if (!task.id) {
|
59
|
-
task.id = Neo.core.IdGenerator.getId('task')
|
59
|
+
task.id = Neo.core.IdGenerator.getId('task')
|
60
60
|
}
|
61
61
|
|
62
62
|
task.scope && task.run.bind(task.scope);
|
@@ -74,7 +74,7 @@ class Task extends Base {
|
|
74
74
|
|
75
75
|
me.register(task);
|
76
76
|
|
77
|
-
return task
|
77
|
+
return task
|
78
78
|
}
|
79
79
|
|
80
80
|
/**
|
@@ -82,7 +82,7 @@ class Task extends Base {
|
|
82
82
|
* @param {String} taskId
|
83
83
|
*/
|
84
84
|
removeTask(taskId) {
|
85
|
-
this.unregister(taskId)
|
85
|
+
this.unregister(taskId)
|
86
86
|
}
|
87
87
|
|
88
88
|
/**
|
@@ -95,7 +95,7 @@ class Task extends Base {
|
|
95
95
|
|
96
96
|
if (task.isRunning) {
|
97
97
|
Neo.logError('[Neo.util.TaskManager] Task is already running');
|
98
|
-
return task
|
98
|
+
return task
|
99
99
|
}
|
100
100
|
|
101
101
|
try {
|
@@ -103,22 +103,22 @@ class Task extends Base {
|
|
103
103
|
task.runCount++;
|
104
104
|
|
105
105
|
if (task.addCountToArgs) {
|
106
|
-
task.args[task.args.length - 1] = task.runCount
|
106
|
+
task.args[task.args.length - 1] = task.runCount
|
107
107
|
}
|
108
108
|
|
109
109
|
if (task.repeat && task.runCount === task.repeat) {
|
110
|
-
me.stop(task.id)
|
110
|
+
me.stop(task.id)
|
111
111
|
}
|
112
112
|
|
113
|
-
task.run(...task.args)
|
113
|
+
task.run(...task.args)
|
114
114
|
};
|
115
115
|
|
116
116
|
task.isRunning = true;
|
117
|
-
task.runner = setInterval(fn, task.interval, task)
|
117
|
+
task.runner = setInterval(fn, task.interval, task)
|
118
118
|
} catch (taskError) {
|
119
119
|
Neo.logError('[Neo.util.TaskManager] Error while running task ' + task.id);
|
120
120
|
task.onError(taskError);
|
121
|
-
task.isRunning = false
|
121
|
+
task.isRunning = false
|
122
122
|
}
|
123
123
|
}
|
124
124
|
|
@@ -132,24 +132,24 @@ class Task extends Base {
|
|
132
132
|
|
133
133
|
if (Neo.isString(task)) {
|
134
134
|
task = me.get(task);
|
135
|
-
!task && Neo.logError('[Neo.util.TaskManager] You passed a taskId which does not exits')
|
136
|
-
} else if (!task.id || !me.get(task.id)){
|
137
|
-
task = me.createTask(task)
|
135
|
+
!task && Neo.logError('[Neo.util.TaskManager] You passed a taskId which does not exits')
|
136
|
+
} else if (!task.id || !me.get(task.id)) {
|
137
|
+
task = me.createTask(task)
|
138
138
|
}
|
139
139
|
|
140
140
|
if (task.isRunning) {
|
141
141
|
Neo.logError('[Neo.util.TaskManager] Task is already running');
|
142
|
-
return task
|
142
|
+
return task
|
143
143
|
}
|
144
144
|
|
145
145
|
if (task.runOnStart) {
|
146
146
|
task.runCount++;
|
147
|
-
task.run(...task.args)
|
147
|
+
task.run(...task.args)
|
148
148
|
}
|
149
149
|
|
150
150
|
me.run(task.id);
|
151
151
|
|
152
|
-
return task
|
152
|
+
return task
|
153
153
|
}
|
154
154
|
|
155
155
|
/**
|
@@ -164,14 +164,14 @@ class Task extends Base {
|
|
164
164
|
task.isRunning && clearInterval(task.runner);
|
165
165
|
|
166
166
|
if (remove) {
|
167
|
-
this.removeTask(task)
|
167
|
+
this.removeTask(task)
|
168
168
|
} else {
|
169
169
|
task.isRunning = false;
|
170
170
|
task.runCount = 0;
|
171
171
|
task.runner = null;
|
172
172
|
|
173
173
|
if (task.addCountToArgs) {
|
174
|
-
task.args[task.args.length - 1] = 0
|
174
|
+
task.args[task.args.length - 1] = 0
|
175
175
|
}
|
176
176
|
}
|
177
177
|
}
|
@@ -183,11 +183,9 @@ class Task extends Base {
|
|
183
183
|
*/
|
184
184
|
stopAll(remove) {
|
185
185
|
Object.keys(this.map).forEach(key => {
|
186
|
-
this.stop(key, remove)
|
187
|
-
})
|
186
|
+
this.stop(key, remove)
|
187
|
+
})
|
188
188
|
}
|
189
189
|
}
|
190
190
|
|
191
|
-
|
192
|
-
|
193
|
-
export default instance;
|
191
|
+
export default Neo.setupClass(Task);
|
package/src/manager/Toast.mjs
CHANGED
@@ -64,13 +64,13 @@ class Toast extends Base {
|
|
64
64
|
|
65
65
|
if (toast.position && !me.running[toast.position]) {
|
66
66
|
Neo.logError('[Neo.manager.Toast] Supported values for slideDirection are: tl, tc, tr, bl, bc, br');
|
67
|
-
return null
|
67
|
+
return null
|
68
68
|
}
|
69
69
|
|
70
70
|
if (!toast.msg || !toast.appName) {
|
71
71
|
!toast.msg && Neo.logError('[Neo.manager.Toast] Toast has to define a msg');
|
72
72
|
!toast.appName && Neo.logError('[Neo.manager.Toast] Toast has to define an appName. Typically me.appName.');
|
73
|
-
return null
|
73
|
+
return null
|
74
74
|
}
|
75
75
|
|
76
76
|
toast = Neo.create({
|
@@ -83,7 +83,7 @@ class Toast extends Base {
|
|
83
83
|
scope : me
|
84
84
|
})
|
85
85
|
|
86
|
-
return toast.id
|
86
|
+
return toast.id
|
87
87
|
}
|
88
88
|
|
89
89
|
/**
|
@@ -101,13 +101,13 @@ class Toast extends Base {
|
|
101
101
|
if (me.running[item.position].length < me.maxToasts) {
|
102
102
|
firstToast = item;
|
103
103
|
firstToast.running = true;
|
104
|
-
break
|
104
|
+
break
|
105
105
|
}
|
106
106
|
}
|
107
107
|
|
108
108
|
me.clearFilters();
|
109
109
|
|
110
|
-
return firstToast
|
110
|
+
return firstToast
|
111
111
|
}
|
112
112
|
|
113
113
|
/**
|
@@ -115,7 +115,7 @@ class Toast extends Base {
|
|
115
115
|
*/
|
116
116
|
register(item) {
|
117
117
|
super.register(item);
|
118
|
-
this.runQueue()
|
118
|
+
this.runQueue()
|
119
119
|
}
|
120
120
|
|
121
121
|
/**
|
@@ -128,7 +128,7 @@ class Toast extends Base {
|
|
128
128
|
position;
|
129
129
|
|
130
130
|
if (!toast) {
|
131
|
-
return
|
131
|
+
return
|
132
132
|
}
|
133
133
|
|
134
134
|
position = toast.position;
|
@@ -136,7 +136,7 @@ class Toast extends Base {
|
|
136
136
|
// decrease total of displayed toasts for a position
|
137
137
|
NeoArray.remove(me.running[position], toastId);
|
138
138
|
|
139
|
-
me.updateItemsInPosition(toastId)
|
139
|
+
me.updateItemsInPosition(toastId)
|
140
140
|
}
|
141
141
|
|
142
142
|
/**
|
@@ -164,8 +164,8 @@ class Toast extends Base {
|
|
164
164
|
|
165
165
|
// todo: we could use a mounted listener
|
166
166
|
setTimeout(() => {
|
167
|
-
this.updateItemsInPosition(toast.id)
|
168
|
-
}, 50)
|
167
|
+
this.updateItemsInPosition(toast.id)
|
168
|
+
}, 50)
|
169
169
|
}
|
170
170
|
|
171
171
|
/**
|
@@ -174,7 +174,7 @@ class Toast extends Base {
|
|
174
174
|
*/
|
175
175
|
unregister(item) {
|
176
176
|
super.unregister(item);
|
177
|
-
this.runQueue()
|
177
|
+
this.runQueue()
|
178
178
|
}
|
179
179
|
|
180
180
|
/**
|
@@ -186,7 +186,7 @@ class Toast extends Base {
|
|
186
186
|
async updateItemsInPosition(id) {
|
187
187
|
let me = this,
|
188
188
|
toast = me.get(id),
|
189
|
-
position
|
189
|
+
{position} = toast,
|
190
190
|
positionArray = me.running[position],
|
191
191
|
acc = 0,
|
192
192
|
margin = me.defaultMargin,
|
@@ -207,12 +207,10 @@ class Toast extends Base {
|
|
207
207
|
// Sometimes the index is already reduced
|
208
208
|
// so the last index might not be available
|
209
209
|
if(rects[index]) {
|
210
|
-
acc = acc + rects[index].height
|
210
|
+
acc = acc + rects[index].height
|
211
211
|
}
|
212
212
|
}
|
213
213
|
}
|
214
214
|
}
|
215
215
|
|
216
|
-
|
217
|
-
|
218
|
-
export default instance;
|
216
|
+
export default Neo.setupClass(Toast);
|