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/list/Component.mjs
CHANGED
@@ -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
|
67
|
-
owner = me
|
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
|
86
|
-
owner = me
|
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
|
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
|
/**
|
package/src/main/DomAccess.mjs
CHANGED
@@ -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, {
|
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
|
-
|
155
|
+
let me = this;
|
145
156
|
|
146
157
|
if (Neo.config.renderCountDeltas) {
|
147
|
-
|
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
|
-
|
172
|
+
let me = this;
|
169
173
|
|
170
|
-
document.addEventListener('
|
171
|
-
document.addEventListener('keydown',
|
172
|
-
document.addEventListener('keyup',
|
173
|
-
document.addEventListener('
|
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
|
-
|
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
|
211
|
-
{
|
212
|
-
aligns
|
213
|
-
resizeObserver
|
214
|
-
{
|
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
|
276
|
-
{
|
277
|
-
subject
|
278
|
-
{
|
279
|
-
align
|
280
|
-
lastAlign
|
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({
|
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({
|
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({
|
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({
|
489
|
+
returnData.minWidth = me.measure({value: minWidth, id: node})
|
453
490
|
}
|
454
491
|
if (lengthRE.test(minHeight) && minHeight !== '0px') {
|
455
|
-
returnData.minHeight = me.measure({
|
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
|
469
|
-
|
470
|
-
|
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
|
-
|
543
|
+
let me = this;
|
506
544
|
|
507
545
|
if (Array.isArray(data.id)) {
|
508
|
-
return data.id.map(id => me.getScrollingDimensions({
|
546
|
+
return data.id.map(id => me.getScrollingDimensions({id}))
|
509
547
|
} else {
|
510
|
-
|
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
|
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
|
987
|
-
{
|
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
|
-
{
|
1006
|
-
{
|
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
|
-
|
1125
|
-
|
1126
|
-
export default instance;
|
1162
|
+
export default Neo.setupClass(DomAccess);
|
package/src/main/DomEvents.mjs
CHANGED
@@ -62,9 +62,10 @@ const lastWheelEvent = {
|
|
62
62
|
target: null
|
63
63
|
};
|
64
64
|
|
65
|
-
const
|
66
|
-
|
67
|
-
|
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
|
185
|
-
target = event
|
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
|
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
|
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
|
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()
|
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
|
424
|
-
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
|
510
|
+
let {Manager} = Neo.worker,
|
509
511
|
hashString = location.hash.substring(1);
|
510
512
|
|
511
|
-
|
513
|
+
Manager.sendMessage('app', {
|
512
514
|
action: 'hashChange',
|
513
515
|
data : {
|
514
|
-
appNames:
|
516
|
+
appNames: Manager.appNames,
|
515
517
|
hash : this.parseHash(hashString),
|
516
518
|
hashString,
|
517
|
-
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
|
527
|
-
tagName = target
|
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
|
592
|
-
angle
|
593
|
-
layout
|
594
|
-
|
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
|
-
|
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
|
623
|
-
target
|
624
|
-
element
|
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
|
-
|
851
|
-
|
852
|
-
export default instance;
|
851
|
+
export default Neo.setupClass(DomEvents);
|