neo.mjs 6.17.2 → 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 +1 -1
- package/apps/portal/view/ViewportController.mjs +89 -1
- package/apps/portal/view/home/MainContainer.mjs +5 -6
- package/apps/portal/view/home/parts/AfterMath.mjs +1 -1
- package/apps/portal/view/home/parts/{CoolStuff.mjs → Colors.mjs} +20 -28
- package/apps/portal/view/home/parts/Helix.mjs +75 -0
- package/apps/portal/view/learn/LivePreview.mjs +56 -15
- 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/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 +2 -2
- 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_text_primary.svg +5 -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 +1 -1
- package/resources/scss/src/apps/portal/home/MainContainer.scss +1 -1
- package/resources/scss/src/apps/portal/home/preview/PageCodeContainer.scss +1 -1
- 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 +25 -31
- 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/container/Accordion.mjs +18 -20
- package/src/container/AccordionItem.mjs +12 -11
- package/src/container/Base.mjs +24 -23
- package/src/container/Panel.mjs +9 -9
- 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 +41 -44
- 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 +1 -1
- 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_Logo_Blue.svg → logo/neo_logo_secondary.svg} +0 -0
- /package/resources/images/{Neo_Logo_Text.svg → logo/neo_logo_text_secondary.svg} +0 -0
- /package/resources/images/{Neo_Logo_White.svg → logo/neo_logo_white.svg} +0 -0
@@ -47,21 +47,21 @@ class Mouse extends Base {
|
|
47
47
|
*/
|
48
48
|
construct(config) {
|
49
49
|
super.construct(config);
|
50
|
-
Neo.bindMethods(this, ['onDistanceChange', 'onMouseDown', 'onMouseMove', 'onMouseUp'])
|
50
|
+
Neo.bindMethods(this, ['onDistanceChange', 'onMouseDown', 'onMouseMove', 'onMouseUp'])
|
51
51
|
}
|
52
52
|
|
53
53
|
/**
|
54
54
|
* Attaches sensors event listeners to the DOM
|
55
55
|
*/
|
56
56
|
attach() {
|
57
|
-
document.addEventListener('mousedown', this.onMouseDown, true)
|
57
|
+
document.addEventListener('mousedown', this.onMouseDown, true)
|
58
58
|
}
|
59
59
|
|
60
60
|
/**
|
61
61
|
* Detaches sensors event listeners from the DOM
|
62
62
|
*/
|
63
63
|
detach() {
|
64
|
-
document.removeEventListener('mousedown', this.onMouseDown, true)
|
64
|
+
document.removeEventListener('mousedown', this.onMouseDown, true)
|
65
65
|
}
|
66
66
|
|
67
67
|
/**
|
@@ -81,7 +81,7 @@ class Mouse extends Base {
|
|
81
81
|
if (timeElapsed >= me.delay && distanceTravelled >= me.minDistance) {
|
82
82
|
clearTimeout(me.mouseDownTimeout);
|
83
83
|
document.removeEventListener('mousemove', me.onDistanceChange);
|
84
|
-
me.startDrag()
|
84
|
+
me.startDrag()
|
85
85
|
}
|
86
86
|
}
|
87
87
|
}
|
@@ -96,7 +96,7 @@ class Mouse extends Base {
|
|
96
96
|
|
97
97
|
// see: https://github.com/neomjs/neo/issues/2669
|
98
98
|
if (!event.path) {
|
99
|
-
event.path = event.composedPath()
|
99
|
+
event.path = event.composedPath()
|
100
100
|
}
|
101
101
|
|
102
102
|
if (target) {
|
@@ -113,8 +113,8 @@ class Mouse extends Base {
|
|
113
113
|
document.addEventListener('mouseup', me.onMouseUp);
|
114
114
|
|
115
115
|
me.mouseDownTimeout = setTimeout(() => {
|
116
|
-
me.onDistanceChange({pageX: me.pageX, pageY: me.pageY})
|
117
|
-
}, me.delay)
|
116
|
+
me.onDistanceChange({pageX: me.pageX, pageY: me.pageY})
|
117
|
+
}, me.delay)
|
118
118
|
}
|
119
119
|
}
|
120
120
|
}
|
@@ -137,7 +137,7 @@ class Mouse extends Base {
|
|
137
137
|
path : me.startEvent.path || me.startEvent.composedPath(),
|
138
138
|
target,
|
139
139
|
type : 'drag:move'
|
140
|
-
})
|
140
|
+
})
|
141
141
|
}
|
142
142
|
}
|
143
143
|
|
@@ -175,10 +175,10 @@ class Mouse extends Base {
|
|
175
175
|
currentElement: null,
|
176
176
|
dragging : false,
|
177
177
|
startEvent : null
|
178
|
-
})
|
178
|
+
})
|
179
179
|
}
|
180
180
|
|
181
|
-
me.dragging = false
|
181
|
+
me.dragging = false
|
182
182
|
}
|
183
183
|
}
|
184
184
|
|
@@ -186,9 +186,9 @@ class Mouse extends Base {
|
|
186
186
|
*
|
187
187
|
*/
|
188
188
|
startDrag() {
|
189
|
-
let me
|
190
|
-
element
|
191
|
-
startEvent = me
|
189
|
+
let me = this,
|
190
|
+
element = me.currentElement,
|
191
|
+
{startEvent} = me;
|
192
192
|
|
193
193
|
me.trigger(element, {
|
194
194
|
clientX : startEvent.clientX,
|
@@ -204,13 +204,13 @@ class Mouse extends Base {
|
|
204
204
|
|
205
205
|
if (me.dragging) {
|
206
206
|
document.addEventListener('contextmenu', preventDefault, true);
|
207
|
-
document.addEventListener('mousemove', me.onMouseMove)
|
207
|
+
document.addEventListener('mousemove', me.onMouseMove)
|
208
208
|
}
|
209
209
|
}
|
210
210
|
}
|
211
211
|
|
212
212
|
function preventDefault(event) {
|
213
|
-
event.preventDefault()
|
213
|
+
event.preventDefault()
|
214
214
|
}
|
215
215
|
|
216
216
|
Neo.setupClass(Mouse);
|
@@ -6,12 +6,12 @@ let preventScrolling = false;
|
|
6
6
|
// WebKit requires cancelable touchmove events to be added as early as possible
|
7
7
|
window.addEventListener('touchmove', event => {
|
8
8
|
if (!preventScrolling) {
|
9
|
-
return
|
9
|
+
return
|
10
10
|
}
|
11
11
|
|
12
12
|
// Prevent scrolling
|
13
13
|
if (event.cancelable) {
|
14
|
-
event.preventDefault()
|
14
|
+
event.preventDefault()
|
15
15
|
}
|
16
16
|
}, {cancelable: true, passive: false});
|
17
17
|
|
@@ -59,21 +59,21 @@ class Touch extends Base {
|
|
59
59
|
*/
|
60
60
|
construct(config) {
|
61
61
|
super.construct(config);
|
62
|
-
Neo.bindMethods(this, ['onDistanceChange', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'startDrag'])
|
62
|
+
Neo.bindMethods(this, ['onDistanceChange', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'startDrag'])
|
63
63
|
}
|
64
64
|
|
65
65
|
/**
|
66
66
|
* Attaches sensors event listeners to the DOM
|
67
67
|
*/
|
68
68
|
attach() {
|
69
|
-
document.addEventListener('touchstart', this.onTouchStart)
|
69
|
+
document.addEventListener('touchstart', this.onTouchStart)
|
70
70
|
}
|
71
71
|
|
72
72
|
/**
|
73
73
|
* Detaches sensors event listeners from the DOM
|
74
74
|
*/
|
75
75
|
detach() {
|
76
|
-
document.removeEventListener('touchstart', this.onTouchStart)
|
76
|
+
document.removeEventListener('touchstart', this.onTouchStart)
|
77
77
|
}
|
78
78
|
|
79
79
|
/**
|
@@ -84,17 +84,18 @@ class Touch extends Base {
|
|
84
84
|
let me = this;
|
85
85
|
|
86
86
|
if (me.currentElement) {
|
87
|
-
const
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
const
|
88
|
+
{pageX, pageY} = DomEvents.getTouchCoords(event),
|
89
|
+
start = DomEvents.getTouchCoords(me.startEvent),
|
90
|
+
timeElapsed = Date.now() - me.touchStartTime,
|
91
|
+
distanceTravelled = DomEvents.getDistance(start.pageX, start.pageY, pageX, pageY) || 0;
|
91
92
|
|
92
93
|
Object.assign(me, {pageX, pageY});
|
93
94
|
|
94
95
|
if (timeElapsed >= me.delay && distanceTravelled >= me.minDistance) {
|
95
96
|
clearTimeout(me.tapTimeout);
|
96
97
|
document.removeEventListener('touchmove', me.onDistanceChange);
|
97
|
-
me.startDrag()
|
98
|
+
me.startDrag()
|
98
99
|
}
|
99
100
|
}
|
100
101
|
}
|
@@ -140,10 +141,10 @@ class Touch extends Base {
|
|
140
141
|
currentElement: null,
|
141
142
|
dragging : false,
|
142
143
|
startEvent : null
|
143
|
-
})
|
144
|
+
})
|
144
145
|
}
|
145
146
|
|
146
|
-
me.dragging = false
|
147
|
+
me.dragging = false
|
147
148
|
}
|
148
149
|
|
149
150
|
/**
|
@@ -167,7 +168,7 @@ class Touch extends Base {
|
|
167
168
|
path : me.startEvent.path || me.startEvent.composedPath(),
|
168
169
|
target,
|
169
170
|
type : 'drag:move'
|
170
|
-
})
|
171
|
+
})
|
171
172
|
}
|
172
173
|
}
|
173
174
|
|
@@ -183,7 +184,7 @@ class Touch extends Base {
|
|
183
184
|
|
184
185
|
// see: https://github.com/neomjs/neo/issues/2669
|
185
186
|
if (!event.path) {
|
186
|
-
event.path = event.composedPath()
|
187
|
+
event.path = event.composedPath()
|
187
188
|
}
|
188
189
|
|
189
190
|
Object.assign(me, {
|
@@ -200,8 +201,8 @@ class Touch extends Base {
|
|
200
201
|
document.addEventListener('touchmove', me.onDistanceChange, {cancelable: true});
|
201
202
|
|
202
203
|
me.tapTimeout = setTimeout(() => {
|
203
|
-
me.onDistanceChange({touches: [{pageX: me.pageX, pageY: me.pageY}]})
|
204
|
-
}, me.delay)
|
204
|
+
me.onDistanceChange({touches: [{pageX: me.pageX, pageY: me.pageY}]})
|
205
|
+
}, me.delay)
|
205
206
|
}
|
206
207
|
}
|
207
208
|
|
@@ -209,10 +210,10 @@ class Touch extends Base {
|
|
209
210
|
*
|
210
211
|
*/
|
211
212
|
startDrag() {
|
212
|
-
let me
|
213
|
-
element
|
214
|
-
startEvent = me
|
215
|
-
touch
|
213
|
+
let me = this,
|
214
|
+
element = me.currentElement,
|
215
|
+
{startEvent} = me,
|
216
|
+
touch = DomEvents.getTouchCoords(me.startEvent);
|
216
217
|
|
217
218
|
me.trigger(element, {
|
218
219
|
clientX : touch.pageX,
|
@@ -228,16 +229,16 @@ class Touch extends Base {
|
|
228
229
|
|
229
230
|
if (me.dragging) {
|
230
231
|
document.addEventListener('contextmenu', preventDefault, true);
|
231
|
-
document.addEventListener('touchmove', me.onTouchMove)
|
232
|
+
document.addEventListener('touchmove', me.onTouchMove)
|
232
233
|
}
|
233
234
|
|
234
|
-
preventScrolling = me.dragging
|
235
|
+
preventScrolling = me.dragging
|
235
236
|
}
|
236
237
|
}
|
237
238
|
|
238
239
|
function preventDefault(event) {
|
239
240
|
event.preventDefault();
|
240
|
-
event.stopPropagation()
|
241
|
+
event.stopPropagation()
|
241
242
|
}
|
242
243
|
|
243
244
|
Neo.setupClass(Touch);
|
@@ -20,10 +20,10 @@ class DeltaUpdates extends Base {
|
|
20
20
|
* @param {String} nodeName
|
21
21
|
*/
|
22
22
|
du_changeNodeName(node, nodeName) {
|
23
|
-
let attributes = node
|
24
|
-
clone
|
25
|
-
i
|
26
|
-
len
|
23
|
+
let {attributes} = node,
|
24
|
+
clone = document.createElement(nodeName),
|
25
|
+
i = 0,
|
26
|
+
len = attributes.length,
|
27
27
|
attribute;
|
28
28
|
|
29
29
|
for (; i < len; i++) {
|
@@ -59,7 +59,7 @@ class DeltaUpdates extends Base {
|
|
59
59
|
* @param {String} delta.parentId
|
60
60
|
*/
|
61
61
|
du_insertNode(delta) {
|
62
|
-
let index
|
62
|
+
let {index} = delta,
|
63
63
|
parentNode = this.getElementOrBody(delta.parentId),
|
64
64
|
countChildren = parentNode?.childNodes.length,
|
65
65
|
i = 0,
|
@@ -67,9 +67,7 @@ class DeltaUpdates extends Base {
|
|
67
67
|
hasComments = false,
|
68
68
|
node;
|
69
69
|
|
70
|
-
if (
|
71
|
-
// console.log('parentNode not found', delta.parentId);
|
72
|
-
} else {
|
70
|
+
if (parentNode) {
|
73
71
|
// console.log('insertNode', index, countChildren, delta.parentId);
|
74
72
|
|
75
73
|
if (countChildren <= 20 && parentNode.nodeName !== 'TBODY') {
|
@@ -118,7 +116,7 @@ class DeltaUpdates extends Base {
|
|
118
116
|
* @param {String} delta.parentId
|
119
117
|
*/
|
120
118
|
du_moveNode(delta) {
|
121
|
-
let index
|
119
|
+
let {index} = delta,
|
122
120
|
node = this.getElement(delta.id),
|
123
121
|
parentNode = this.getElement(delta.parentId);
|
124
122
|
|
@@ -291,9 +289,9 @@ class DeltaUpdates extends Base {
|
|
291
289
|
* @param {String} [data.origin='app']
|
292
290
|
*/
|
293
291
|
update(data) {
|
294
|
-
let me
|
295
|
-
deltas = data
|
296
|
-
i
|
292
|
+
let me = this,
|
293
|
+
{deltas} = data,
|
294
|
+
i = 0,
|
297
295
|
len, map;
|
298
296
|
|
299
297
|
deltas = Array.isArray(deltas) ? deltas : [deltas];
|
@@ -19,42 +19,42 @@ class TouchDomEvents extends Base {
|
|
19
19
|
* @param {Object} event
|
20
20
|
*/
|
21
21
|
onTouchCancel(event) {
|
22
|
-
this.sendMessageToApp(this.getEventData(event))
|
22
|
+
this.sendMessageToApp(this.getEventData(event))
|
23
23
|
}
|
24
24
|
|
25
25
|
/**
|
26
26
|
* @param {Object} event
|
27
27
|
*/
|
28
28
|
onTouchEnd(event) {
|
29
|
-
this.sendMessageToApp(this.getEventData(event))
|
29
|
+
this.sendMessageToApp(this.getEventData(event))
|
30
30
|
}
|
31
31
|
|
32
32
|
/**
|
33
33
|
* @param {Object} event
|
34
34
|
*/
|
35
35
|
onTouchEnter(event) {
|
36
|
-
this.sendMessageToApp(this.getEventData(event))
|
36
|
+
this.sendMessageToApp(this.getEventData(event))
|
37
37
|
}
|
38
38
|
|
39
39
|
/**
|
40
40
|
* @param {Object} event
|
41
41
|
*/
|
42
42
|
onTouchLeave(event) {
|
43
|
-
this.sendMessageToApp(this.getEventData(event))
|
43
|
+
this.sendMessageToApp(this.getEventData(event))
|
44
44
|
}
|
45
45
|
|
46
46
|
/**
|
47
47
|
* @param {Object} event
|
48
48
|
*/
|
49
49
|
onTouchMove(event) {
|
50
|
-
this.sendMessageToApp(this.getEventData(event))
|
50
|
+
this.sendMessageToApp(this.getEventData(event))
|
51
51
|
}
|
52
52
|
|
53
53
|
/**
|
54
54
|
* @param {Object} event
|
55
55
|
*/
|
56
56
|
onTouchStart(event) {
|
57
|
-
this.sendMessageToApp(this.getEventData(event))
|
57
|
+
this.sendMessageToApp(this.getEventData(event))
|
58
58
|
}
|
59
59
|
}
|
60
60
|
|
package/src/manager/Base.mjs
CHANGED
@@ -19,7 +19,7 @@ class Base extends CollectionBase{
|
|
19
19
|
* @returns {Object}
|
20
20
|
*/
|
21
21
|
getById(id) {
|
22
|
-
return id && this.get(id) || null
|
22
|
+
return id && this.get(id) || null
|
23
23
|
}
|
24
24
|
|
25
25
|
/**
|
@@ -29,9 +29,9 @@ class Base extends CollectionBase{
|
|
29
29
|
let me = this;
|
30
30
|
|
31
31
|
if (me.get(item.id)) {
|
32
|
-
Neo.logError('Trying to create an item with an already existing id', item, me.get(item.id))
|
32
|
+
Neo.logError('Trying to create an item with an already existing id', item, me.get(item.id))
|
33
33
|
} else {
|
34
|
-
me.push(item)
|
34
|
+
me.push(item)
|
35
35
|
}
|
36
36
|
}
|
37
37
|
|
@@ -40,7 +40,7 @@ class Base extends CollectionBase{
|
|
40
40
|
* @param {Object|String} item
|
41
41
|
*/
|
42
42
|
unregister(item) {
|
43
|
-
this.remove(item)
|
43
|
+
this.remove(item)
|
44
44
|
}
|
45
45
|
}
|
46
46
|
|
@@ -29,7 +29,7 @@ class Component extends Base {
|
|
29
29
|
let me = this;
|
30
30
|
|
31
31
|
Neo.first = me.getFirst.bind(me); // alias
|
32
|
-
Neo.getComponent = me.getById.bind(me)
|
32
|
+
Neo.getComponent = me.getById.bind(me) // alias
|
33
33
|
}
|
34
34
|
|
35
35
|
/**
|
@@ -56,9 +56,9 @@ class Component extends Base {
|
|
56
56
|
if (Neo.isString(config)) {
|
57
57
|
config = {
|
58
58
|
ntype: config
|
59
|
-
}
|
59
|
+
}
|
60
60
|
} else if (!config) {
|
61
|
-
config = {}
|
61
|
+
config = {}
|
62
62
|
}
|
63
63
|
|
64
64
|
configArray = Object.entries(config);
|
@@ -68,16 +68,16 @@ class Component extends Base {
|
|
68
68
|
if ((component[key] === value)
|
69
69
|
|| (key === 'ntype' && me.hasPrototypePropertyValue(component, key, value)))
|
70
70
|
{
|
71
|
-
matchArray.push(true)
|
71
|
+
matchArray.push(true)
|
72
72
|
}
|
73
73
|
});
|
74
74
|
|
75
75
|
if (matchArray.length === configLength) {
|
76
76
|
if (returnFirstMatch) {
|
77
|
-
return component
|
77
|
+
return component
|
78
78
|
}
|
79
79
|
|
80
|
-
returnArray.push(component)
|
80
|
+
returnArray.push(component)
|
81
81
|
}
|
82
82
|
|
83
83
|
childItems = me.find({parentId: component.id});
|
@@ -88,14 +88,14 @@ class Component extends Base {
|
|
88
88
|
|
89
89
|
if (returnFirstMatch) {
|
90
90
|
if (returnValue !== null) {
|
91
|
-
return returnValue
|
91
|
+
return returnValue
|
92
92
|
}
|
93
93
|
} else if (returnValue.length > 0) {
|
94
|
-
returnArray.push(...returnValue)
|
94
|
+
returnArray.push(...returnValue)
|
95
95
|
}
|
96
96
|
}
|
97
97
|
|
98
|
-
return returnFirstMatch ? null: returnArray
|
98
|
+
return returnFirstMatch ? null: returnArray
|
99
99
|
}
|
100
100
|
|
101
101
|
/**
|
@@ -112,11 +112,11 @@ class Component extends Base {
|
|
112
112
|
id = path[i];
|
113
113
|
|
114
114
|
if (id && me.has(id)) {
|
115
|
-
return id
|
115
|
+
return id
|
116
116
|
}
|
117
117
|
}
|
118
118
|
|
119
|
-
return null
|
119
|
+
return null
|
120
120
|
}
|
121
121
|
|
122
122
|
/**
|
@@ -135,10 +135,10 @@ class Component extends Base {
|
|
135
135
|
|
136
136
|
childComponents = me.getChildComponents(item);
|
137
137
|
|
138
|
-
childComponents && components.push(...childComponents)
|
138
|
+
childComponents && components.push(...childComponents)
|
139
139
|
});
|
140
140
|
|
141
|
-
return components
|
141
|
+
return components
|
142
142
|
}
|
143
143
|
|
144
144
|
/**
|
@@ -149,7 +149,7 @@ class Component extends Base {
|
|
149
149
|
* @returns {Array} childIds
|
150
150
|
*/
|
151
151
|
getChildIds(vnode, childIds) {
|
152
|
-
return VNodeUtil.getChildIds(vnode, childIds)
|
152
|
+
return VNodeUtil.getChildIds(vnode, childIds)
|
153
153
|
}
|
154
154
|
|
155
155
|
/**
|
@@ -166,11 +166,11 @@ class Component extends Base {
|
|
166
166
|
childComponent = this.get(node);
|
167
167
|
|
168
168
|
if (childComponent) {
|
169
|
-
childComponents.push(childComponent)
|
169
|
+
childComponents.push(childComponent)
|
170
170
|
}
|
171
171
|
});
|
172
172
|
|
173
|
-
return childComponents
|
173
|
+
return childComponents
|
174
174
|
}
|
175
175
|
|
176
176
|
/**
|
@@ -227,18 +227,18 @@ class Component extends Base {
|
|
227
227
|
const pairs = pairsMatch[1].split(',');
|
228
228
|
pairs.forEach((pair) => {
|
229
229
|
const [key, value] = pair.split('=');
|
230
|
-
obj[key] = value.replace(/"/g, '')
|
230
|
+
obj[key] = value.replace(/"/g, '')
|
231
231
|
});
|
232
232
|
}
|
233
233
|
}
|
234
234
|
objects.push(obj);
|
235
235
|
|
236
|
-
regex.lastIndex
|
236
|
+
regex.lastIndex++
|
237
237
|
}
|
238
238
|
} else if (Neo.isObject(componentDescription)){
|
239
|
-
objects.push(componentDescription)
|
239
|
+
objects.push(componentDescription)
|
240
240
|
} else if (Neo.isArray(componentDescription)) {
|
241
|
-
objects = componentDescription
|
241
|
+
objects = componentDescription
|
242
242
|
}
|
243
243
|
|
244
244
|
/* find the correct child using down() */
|
@@ -247,10 +247,11 @@ class Component extends Base {
|
|
247
247
|
let child = acc.down(key, returnFirstMatch);
|
248
248
|
|
249
249
|
if (!!child) {
|
250
|
-
return child
|
250
|
+
return child
|
251
251
|
}
|
252
252
|
}
|
253
|
-
|
253
|
+
|
254
|
+
return null
|
254
255
|
}, root);
|
255
256
|
|
256
257
|
return result
|
@@ -268,11 +269,11 @@ class Component extends Base {
|
|
268
269
|
component = this.getById(component.parentId);
|
269
270
|
|
270
271
|
if (component) {
|
271
|
-
parentIds.push(component.id)
|
272
|
+
parentIds.push(component.id)
|
272
273
|
}
|
273
274
|
}
|
274
275
|
|
275
|
-
return parentIds
|
276
|
+
return parentIds
|
276
277
|
}
|
277
278
|
|
278
279
|
/**
|
@@ -287,11 +288,11 @@ class Component extends Base {
|
|
287
288
|
|
288
289
|
for (; i < len; i++) {
|
289
290
|
if (me.has(path[i])) {
|
290
|
-
componentPath.push(path[i])
|
291
|
+
componentPath.push(path[i])
|
291
292
|
}
|
292
293
|
}
|
293
294
|
|
294
|
-
return componentPath
|
295
|
+
return componentPath
|
295
296
|
}
|
296
297
|
|
297
298
|
/**
|
@@ -301,7 +302,7 @@ class Component extends Base {
|
|
301
302
|
*/
|
302
303
|
getParents(component) {
|
303
304
|
if (Neo.isString(component)) {
|
304
|
-
component = this.getById(component)
|
305
|
+
component = this.getById(component)
|
305
306
|
}
|
306
307
|
|
307
308
|
let parents = [];
|
@@ -310,11 +311,11 @@ class Component extends Base {
|
|
310
311
|
component = this.getById(component.parentId);
|
311
312
|
|
312
313
|
if (component) {
|
313
|
-
parents.push(component)
|
314
|
+
parents.push(component)
|
314
315
|
}
|
315
316
|
}
|
316
317
|
|
317
|
-
return parents
|
318
|
+
return parents
|
318
319
|
}
|
319
320
|
|
320
321
|
/**
|
@@ -328,12 +329,13 @@ class Component extends Base {
|
|
328
329
|
hasPrototypePropertyValue(component, property, value) {
|
329
330
|
while (component !== null) {
|
330
331
|
if (component.hasOwnProperty(property) && component[property] === value) {
|
331
|
-
return true
|
332
|
+
return true
|
332
333
|
}
|
333
|
-
|
334
|
+
|
335
|
+
component = component.__proto__
|
334
336
|
}
|
335
337
|
|
336
|
-
return false
|
338
|
+
return false
|
337
339
|
}
|
338
340
|
|
339
341
|
/**
|
@@ -353,9 +355,9 @@ class Component extends Base {
|
|
353
355
|
if (Neo.isString(config)) {
|
354
356
|
config = {
|
355
357
|
ntype: config
|
356
|
-
}
|
358
|
+
}
|
357
359
|
} else if (!config) {
|
358
|
-
config = {}
|
360
|
+
config = {}
|
359
361
|
}
|
360
362
|
|
361
363
|
configArray = Object.entries(config);
|
@@ -365,28 +367,26 @@ class Component extends Base {
|
|
365
367
|
component = this.getById(component.parentId);
|
366
368
|
|
367
369
|
if (!component) {
|
368
|
-
return returnFirstMatch ? null : returnArray
|
370
|
+
return returnFirstMatch ? null : returnArray
|
369
371
|
}
|
370
372
|
|
371
373
|
matchArray = [];
|
372
374
|
|
373
375
|
configArray.forEach(([key, value]) => {
|
374
376
|
if (component[key] === value) {
|
375
|
-
matchArray.push(true)
|
377
|
+
matchArray.push(true)
|
376
378
|
}
|
377
379
|
});
|
378
380
|
|
379
381
|
if (matchArray.length === configLength) {
|
380
382
|
if (returnFirstMatch) {
|
381
|
-
return component
|
383
|
+
return component
|
382
384
|
}
|
383
385
|
|
384
|
-
returnArray.push(component)
|
386
|
+
returnArray.push(component)
|
385
387
|
}
|
386
388
|
}
|
387
389
|
}
|
388
390
|
}
|
389
391
|
|
390
|
-
|
391
|
-
|
392
|
-
export default instance;
|
392
|
+
export default Neo.setupClass(Component);
|