neo.mjs 6.17.2 → 6.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +34 -6
- package/apps/portal/view/home/parts/AfterMath.mjs +1 -1
- package/apps/portal/view/home/parts/Colors.mjs +98 -0
- package/apps/portal/view/home/parts/Helix.mjs +114 -0
- package/apps/portal/view/home/parts/HelloWorld.mjs +6 -3
- package/apps/portal/view/home/parts/How.mjs +66 -0
- package/apps/portal/view/home/parts/MainNeo.mjs +4 -3
- 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/Events.md +15 -9
- package/resources/data/deck/learnneo/pages/GuideEvents.md +254 -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 +142 -124
- package/resources/scss/src/apps/portal/home/MainContainer.scss +9 -22
- package/resources/scss/src/apps/portal/home/parts/MainNeo.scss +22 -0
- 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 +73 -41
- 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 +40 -24
- 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/IntersectionObserver.mjs +20 -1
- 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 +16 -14
- 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/apps/portal/view/home/parts/CoolStuff.mjs +0 -82
- 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
@@ -74,8 +74,8 @@ class Message extends Base {
|
|
74
74
|
*/
|
75
75
|
onMessageAjax(msg, api) {
|
76
76
|
return new Promise((resolve, reject) => {
|
77
|
-
let me
|
78
|
-
url = api
|
77
|
+
let me = this,
|
78
|
+
{url} = api;
|
79
79
|
|
80
80
|
me.register({
|
81
81
|
id : me.messageId,
|
@@ -94,10 +94,10 @@ class Message extends Base {
|
|
94
94
|
me.endPointTimeouts.push(url);
|
95
95
|
|
96
96
|
setTimeout(() => {
|
97
|
-
me.resolveBufferTimeout(url)
|
97
|
+
me.resolveBufferTimeout(url)
|
98
98
|
}, me.requestBuffer)
|
99
99
|
}
|
100
|
-
})
|
100
|
+
})
|
101
101
|
}
|
102
102
|
|
103
103
|
/**
|
@@ -109,27 +109,27 @@ class Message extends Base {
|
|
109
109
|
*/
|
110
110
|
async onMessageWebsocket(msg, api) {
|
111
111
|
let me = this,
|
112
|
-
url
|
112
|
+
{url} = api,
|
113
113
|
connection = me.socketConnections[url];
|
114
114
|
|
115
115
|
if (!connection) {
|
116
116
|
let module = await import('../../data/connection/WebSocket.mjs');
|
117
117
|
|
118
|
-
me.socketConnections[url] = connection = Neo.create(module.default, {serverAddress: url})
|
118
|
+
me.socketConnections[url] = connection = Neo.create(module.default, {serverAddress: url})
|
119
119
|
}
|
120
120
|
|
121
|
-
return await connection.promiseMessage(msg)
|
121
|
+
return await connection.promiseMessage(msg)
|
122
122
|
}
|
123
123
|
|
124
124
|
/**
|
125
125
|
* @param {String} url
|
126
126
|
*/
|
127
127
|
async resolveBufferTimeout(url) {
|
128
|
-
let me
|
129
|
-
itemIds
|
130
|
-
processItems
|
131
|
-
requests
|
132
|
-
transactionId = me
|
128
|
+
let me = this,
|
129
|
+
itemIds = [],
|
130
|
+
processItems = me.find({transactionId: 0, url}),
|
131
|
+
requests = [],
|
132
|
+
{transactionId} = me,
|
133
133
|
response;
|
134
134
|
|
135
135
|
processItems.forEach(item => {
|
@@ -142,7 +142,7 @@ class Message extends Base {
|
|
142
142
|
method : item.method,
|
143
143
|
params : item.params,
|
144
144
|
service: item.service
|
145
|
-
})
|
145
|
+
})
|
146
146
|
});
|
147
147
|
|
148
148
|
NeoArray.remove(me.endPointTimeouts, url);
|
@@ -155,14 +155,12 @@ class Message extends Base {
|
|
155
155
|
// todo: pass the item which is included inside the response object
|
156
156
|
// todo: reject the Promise in case the item is missing
|
157
157
|
|
158
|
-
item.resolve()
|
158
|
+
item.resolve()
|
159
159
|
});
|
160
160
|
|
161
161
|
// todo: remove only the items which are included inside the response
|
162
|
-
me.remove(itemIds)
|
162
|
+
me.remove(itemIds)
|
163
163
|
}
|
164
164
|
}
|
165
165
|
|
166
|
-
|
167
|
-
|
168
|
-
export default instance;
|
166
|
+
export default Neo.setupClass(Message);
|
package/src/menu/List.mjs
CHANGED
@@ -116,7 +116,7 @@ class List extends BaseList {
|
|
116
116
|
* @protected
|
117
117
|
*/
|
118
118
|
afterSetItems(value, oldValue) {
|
119
|
-
let store = this
|
119
|
+
let {store} = this;
|
120
120
|
|
121
121
|
oldValue && store.clear(); // we can not use remove() here, since items are no records => often no id
|
122
122
|
value && store.add(value)
|
@@ -135,15 +135,15 @@ class List extends BaseList {
|
|
135
135
|
if (me.isRoot) {
|
136
136
|
if (!value) {
|
137
137
|
me.focusTimeoutId = setTimeout(() => {
|
138
|
-
me[me.floating ? 'unmount' : 'hideSubMenu']()
|
139
|
-
}, 20)
|
138
|
+
me[me.floating ? 'unmount' : 'hideSubMenu']()
|
139
|
+
}, 20)
|
140
140
|
} else {
|
141
141
|
clearTimeout(me.focusTimeoutId);
|
142
|
-
me.focusTimeoutId = null
|
142
|
+
me.focusTimeoutId = null
|
143
143
|
}
|
144
144
|
} else {
|
145
145
|
// bubble the focus change upwards
|
146
|
-
me.parentMenu.menuFocus = value
|
146
|
+
me.parentMenu.menuFocus = value
|
147
147
|
}
|
148
148
|
}
|
149
149
|
}
|
@@ -179,17 +179,17 @@ class List extends BaseList {
|
|
179
179
|
* @returns {Object|Object[]|String} Either a config object to assign to the item, a vdom cn array or a html string
|
180
180
|
*/
|
181
181
|
createItemContent(record, index) {
|
182
|
-
let me
|
183
|
-
iconCls = record
|
184
|
-
id
|
185
|
-
vdomCn
|
182
|
+
let me = this,
|
183
|
+
{iconCls} = record,
|
184
|
+
id = record[me.store.keyProperty],
|
185
|
+
vdomCn = [{tag: 'span', cls: ['neo-content'], html: record[me.displayField]}];
|
186
186
|
|
187
187
|
if (iconCls && iconCls !== '') {
|
188
|
-
vdomCn.unshift({tag: 'i', cls: ['neo-menu-icon', 'neo-icon', iconCls], id: me.getIconId(id)})
|
188
|
+
vdomCn.unshift({tag: 'i', cls: ['neo-menu-icon', 'neo-icon', iconCls], id: me.getIconId(id)})
|
189
189
|
}
|
190
190
|
|
191
191
|
if (me.hasChildren(record)) {
|
192
|
-
vdomCn.push({tag: 'i', cls: ['neo-arrow-icon', 'neo-icon', 'fas fa-chevron-right'], id: me.getArrowIconId(id)})
|
192
|
+
vdomCn.push({tag: 'i', cls: ['neo-arrow-icon', 'neo-icon', 'fas fa-chevron-right'], id: me.getArrowIconId(id)})
|
193
193
|
}
|
194
194
|
|
195
195
|
return vdomCn
|
@@ -199,9 +199,9 @@ class List extends BaseList {
|
|
199
199
|
*
|
200
200
|
*/
|
201
201
|
destroy(...args) {
|
202
|
-
let me
|
203
|
-
activeSubMenu = me
|
204
|
-
subMenuMap
|
202
|
+
let me = this,
|
203
|
+
{activeSubMenu} = me,
|
204
|
+
subMenuMap = me.subMenuMap || {};
|
205
205
|
|
206
206
|
activeSubMenu?.unmount();
|
207
207
|
|
@@ -284,7 +284,7 @@ class List extends BaseList {
|
|
284
284
|
for (item of data.oldPath) {
|
285
285
|
if (item.id === parentId) {
|
286
286
|
insideParent = true;
|
287
|
-
break
|
287
|
+
break
|
288
288
|
}
|
289
289
|
}
|
290
290
|
}
|
@@ -362,7 +362,7 @@ class List extends BaseList {
|
|
362
362
|
showSubMenu(nodeId, record) {
|
363
363
|
const
|
364
364
|
me = this,
|
365
|
-
store
|
365
|
+
{store} = me,
|
366
366
|
recordId = record[store.keyProperty],
|
367
367
|
subMenuMap = me.subMenuMap || (me.subMenuMap = {}),
|
368
368
|
subMenuMapId = me.getMenuMapId(recordId),
|
package/src/menu/Panel.mjs
CHANGED
@@ -52,7 +52,7 @@ class Panel extends BasePanel {
|
|
52
52
|
* @protected
|
53
53
|
*/
|
54
54
|
afterSetList(value, oldValue) {
|
55
|
-
this.add(value)
|
55
|
+
this.add(value)
|
56
56
|
}
|
57
57
|
|
58
58
|
/**
|
@@ -62,7 +62,7 @@ class Panel extends BasePanel {
|
|
62
62
|
* @protected
|
63
63
|
*/
|
64
64
|
afterSetListItems(value, oldValue) {
|
65
|
-
this.list.items = value
|
65
|
+
this.list.items = value
|
66
66
|
}
|
67
67
|
|
68
68
|
/**
|
@@ -72,7 +72,7 @@ class Panel extends BasePanel {
|
|
72
72
|
* @protected
|
73
73
|
*/
|
74
74
|
afterSetSubMenuGap(value, oldValue) {
|
75
|
-
this.list.subMenuGap = value
|
75
|
+
this.list.subMenuGap = value
|
76
76
|
}
|
77
77
|
|
78
78
|
/**
|
@@ -83,7 +83,7 @@ class Panel extends BasePanel {
|
|
83
83
|
*/
|
84
84
|
beforeSetList(value, oldValue) {
|
85
85
|
oldValue && oldValue.destroy();
|
86
|
-
return ClassSystemUtil.beforeSetInstance(value, List, this.listConfig)
|
86
|
+
return ClassSystemUtil.beforeSetInstance(value, List, this.listConfig)
|
87
87
|
}
|
88
88
|
}
|
89
89
|
|
package/src/model/Component.mjs
CHANGED
@@ -153,12 +153,14 @@ class Component extends Base {
|
|
153
153
|
* @protected
|
154
154
|
*/
|
155
155
|
beforeSetStores(value, oldValue) {
|
156
|
-
|
156
|
+
if (value) {
|
157
|
+
let controller = this.component.getController();
|
157
158
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
159
|
+
Object.entries(value).forEach(([key, storeValue]) => {
|
160
|
+
controller?.parseConfig(storeValue);
|
161
|
+
value[key] = ClassSystemUtil.beforeSetInstance(storeValue)
|
162
|
+
})
|
163
|
+
}
|
162
164
|
|
163
165
|
return value
|
164
166
|
}
|
@@ -319,7 +321,7 @@ class Component extends Base {
|
|
319
321
|
getData(key, originModel=this) {
|
320
322
|
let me = this,
|
321
323
|
data = me.getDataScope(key),
|
322
|
-
scope
|
324
|
+
{scope} = data,
|
323
325
|
keyLeaf = data.key,
|
324
326
|
parentModel;
|
325
327
|
|
@@ -347,7 +349,7 @@ class Component extends Base {
|
|
347
349
|
getDataScope(key) {
|
348
350
|
let me = this,
|
349
351
|
keyLeaf = key,
|
350
|
-
data
|
352
|
+
{data} = me;
|
351
353
|
|
352
354
|
if (key.includes('.')) {
|
353
355
|
key = key.split('.');
|
@@ -445,13 +447,13 @@ class Component extends Base {
|
|
445
447
|
* @returns {Neo.model.Component|null}
|
446
448
|
*/
|
447
449
|
getParent() {
|
448
|
-
let
|
450
|
+
let {parent} = this;
|
449
451
|
|
450
|
-
if (
|
451
|
-
return
|
452
|
+
if (parent) {
|
453
|
+
return parent
|
452
454
|
}
|
453
455
|
|
454
|
-
return
|
456
|
+
return this.component.parent?.getModel() || null
|
455
457
|
}
|
456
458
|
|
457
459
|
/**
|
@@ -461,8 +463,8 @@ class Component extends Base {
|
|
461
463
|
* @returns {Neo.data.Store}
|
462
464
|
*/
|
463
465
|
getStore(key, originModel=this) {
|
464
|
-
let me
|
465
|
-
stores = me
|
466
|
+
let me = this,
|
467
|
+
{stores} = me,
|
466
468
|
parentModel;
|
467
469
|
|
468
470
|
if (stores?.hasOwnProperty(key)) {
|
@@ -636,7 +638,7 @@ class Component extends Base {
|
|
636
638
|
*/
|
637
639
|
resolveFormulas(data) {
|
638
640
|
let me = this,
|
639
|
-
formulas
|
641
|
+
{formulas} = me,
|
640
642
|
initialRun = !data,
|
641
643
|
affectFormula, bindObject, fn, key, result, value;
|
642
644
|
|
package/src/plugin/Base.mjs
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import CoreBase from '../core/Base.mjs';
|
2
2
|
|
3
3
|
/**
|
4
|
+
* Abstract base class for plugin implementations.
|
4
5
|
* Plugins are intended to get put into the plugins config of component.Base
|
5
6
|
* to enhance them or add additional features
|
6
7
|
* @class Neo.plugin.Base
|
@@ -14,6 +15,7 @@ class Base extends CoreBase {
|
|
14
15
|
*/
|
15
16
|
className: 'Neo.plugin.Base',
|
16
17
|
/**
|
18
|
+
* All plugin ntypes need to start with 'plugin-' to ensure that component.Base: getPlugin() can find them
|
17
19
|
* @member {String} ntype='plugin'
|
18
20
|
* @protected
|
19
21
|
*/
|
package/src/plugin/Popover.mjs
CHANGED
@@ -11,7 +11,6 @@ import Base from './Base.mjs';
|
|
11
11
|
* labelText: 'Credit Card',
|
12
12
|
* plugins : [{
|
13
13
|
* module : PrefixPlugin, // import PrefixPlugin from '../../src/plugin/PrefixField.mjs';
|
14
|
-
* flag : 'prefix', // textField.getPlugins({flag: 'prefix'})
|
15
14
|
* pattern: 'dd/mm/yyyy',
|
16
15
|
* slots : 'dmy', // characters allowed to replace
|
17
16
|
* accept : /\d/ // either '[A-Z]' or regex or undefined
|
@@ -30,7 +29,6 @@ class PrefixField extends Base {
|
|
30
29
|
* @protected
|
31
30
|
*/
|
32
31
|
ntype: 'plugin-prefixfield',
|
33
|
-
|
34
32
|
/**
|
35
33
|
* Custom cls added to the inputEl
|
36
34
|
* @member {String} inputCls='neo-prefixfield-input'
|
@@ -46,7 +44,6 @@ class PrefixField extends Base {
|
|
46
44
|
* @member {String} ownerCls='neo-prefixfield'
|
47
45
|
*/
|
48
46
|
ownerCls: 'neo-prefixfield',
|
49
|
-
|
50
47
|
/**
|
51
48
|
* regex to calculate if entered value is acceptable
|
52
49
|
* Preset to numbers only
|
@@ -70,32 +67,32 @@ class PrefixField extends Base {
|
|
70
67
|
* @member {Number} first
|
71
68
|
* @protected
|
72
69
|
*/
|
73
|
-
first = null
|
70
|
+
first = null
|
74
71
|
/**
|
75
72
|
* Array of numbers, which shows the previous entry point
|
76
73
|
* @member {Array[]} prev
|
77
74
|
* @protected
|
78
75
|
*/
|
79
|
-
prev = null
|
76
|
+
prev = null
|
80
77
|
/**
|
81
78
|
* Position of the cursor inside input element
|
82
79
|
* @member {Object} selection
|
83
80
|
* @protected
|
84
81
|
*/
|
85
|
-
selection = null
|
82
|
+
selection = null
|
86
83
|
|
87
84
|
/**
|
88
85
|
* State if selection should be updated
|
89
86
|
* @member {Boolean} ignoreSelection
|
90
87
|
* @protected
|
91
88
|
*/
|
92
|
-
ignoreSelection = false
|
89
|
+
ignoreSelection = false
|
93
90
|
/**
|
94
91
|
* State if last entry was the back button
|
95
92
|
* @member {Boolean} back
|
96
93
|
* @protected
|
97
94
|
*/
|
98
|
-
back = false
|
95
|
+
back = false
|
99
96
|
|
100
97
|
/**
|
101
98
|
* @param {Object} config
|
@@ -114,13 +111,13 @@ class PrefixField extends Base {
|
|
114
111
|
*/
|
115
112
|
addCss() {
|
116
113
|
const me = this,
|
117
|
-
owner
|
114
|
+
{owner} = me,
|
118
115
|
inputEl = owner.getInputEl(),
|
119
116
|
labelEl = owner.getLabelEl();
|
120
117
|
|
121
118
|
owner .addCls(me.ownerCls);
|
122
119
|
inputEl.cls.push(me.inputCls);
|
123
|
-
labelEl.cls.push(me.labelCls)
|
120
|
+
labelEl.cls.push(me.labelCls)
|
124
121
|
}
|
125
122
|
|
126
123
|
/**
|
@@ -128,9 +125,8 @@ class PrefixField extends Base {
|
|
128
125
|
* @protected
|
129
126
|
*/
|
130
127
|
addListeners() {
|
131
|
-
let me
|
132
|
-
owner = me
|
133
|
-
listenerId;
|
128
|
+
let me = this,
|
129
|
+
{owner} = me;
|
134
130
|
|
135
131
|
owner.addDomListeners([
|
136
132
|
{keydown : me.onFieldKeyDown , scope: me},
|
@@ -139,12 +135,9 @@ class PrefixField extends Base {
|
|
139
135
|
{selectionchange: me.onFieldSelectionChange, scope: me}
|
140
136
|
]);
|
141
137
|
|
142
|
-
|
143
|
-
Neo.currentWorker.insertThemeFiles(owner.appName, owner.windowId, me.__proto__)
|
144
|
-
|
145
|
-
owner.un('mounted', listenerId);
|
146
|
-
listenerId = null;
|
147
|
-
})
|
138
|
+
me.owner.on('mounted', () => {
|
139
|
+
Neo.currentWorker.insertThemeFiles(owner.appName, owner.windowId, me.__proto__)
|
140
|
+
}, me, {once: true})
|
148
141
|
}
|
149
142
|
|
150
143
|
|
@@ -155,7 +148,7 @@ class PrefixField extends Base {
|
|
155
148
|
* @protected
|
156
149
|
*/
|
157
150
|
afterSetAccept(value, oldValue) {
|
158
|
-
|
151
|
+
this.owner.value && this.format()
|
159
152
|
}
|
160
153
|
|
161
154
|
/**
|
@@ -166,7 +159,7 @@ class PrefixField extends Base {
|
|
166
159
|
*/
|
167
160
|
afterSetPattern(value, oldValue) {
|
168
161
|
this.owner.placeholderText = value;
|
169
|
-
this.recalcFirstAndPref()
|
162
|
+
this.recalcFirstAndPref()
|
170
163
|
}
|
171
164
|
|
172
165
|
/**
|
@@ -176,7 +169,7 @@ class PrefixField extends Base {
|
|
176
169
|
* @protected
|
177
170
|
*/
|
178
171
|
afterSetSlots(value, oldValue) {
|
179
|
-
this.recalcFirstAndPref()
|
172
|
+
this.recalcFirstAndPref()
|
180
173
|
}
|
181
174
|
|
182
175
|
/**
|
@@ -186,7 +179,7 @@ class PrefixField extends Base {
|
|
186
179
|
* @protected
|
187
180
|
*/
|
188
181
|
beforeSetSlots(value) {
|
189
|
-
return new Set(value || "_")
|
182
|
+
return new Set(value || "_")
|
190
183
|
}
|
191
184
|
|
192
185
|
/**
|
@@ -204,7 +197,7 @@ class PrefixField extends Base {
|
|
204
197
|
input[0] === c || me.slots.has(c) ? input.shift() || c : c
|
205
198
|
);
|
206
199
|
|
207
|
-
return input.slice(0, me.pattern.length)
|
200
|
+
return input.slice(0, me.pattern.length)
|
208
201
|
}
|
209
202
|
|
210
203
|
/**
|
@@ -212,25 +205,24 @@ class PrefixField extends Base {
|
|
212
205
|
* @protected
|
213
206
|
*/
|
214
207
|
format() {
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
let value = el.value || '';
|
208
|
+
let me = this,
|
209
|
+
el = me.owner,
|
210
|
+
{prev, selection} = me,
|
211
|
+
clean = me.clean.bind(me),
|
212
|
+
value = el.value || '';
|
221
213
|
|
222
214
|
const [i, j] = [selection.start, selection.end].map(i => {
|
223
215
|
i = me.clean(value.slice(0, i)).findIndex(c => me.slots.has(c));
|
224
|
-
return i < 0 ? prev[prev.length - 1] : me.back ? prev[i - 1] || me.first : i
|
216
|
+
return i < 0 ? prev[prev.length - 1] : me.back ? prev[i - 1] || me.first : i
|
225
217
|
});
|
226
218
|
|
227
219
|
el.value = clean(value).join``;
|
228
|
-
|
220
|
+
me.ignoreSelection = true;
|
229
221
|
|
230
222
|
Neo.main.DomAccess.selectNode({id: el.getInputElId(), start: i, end: j});
|
231
|
-
|
223
|
+
me.ignoreSelection = false;
|
232
224
|
|
233
|
-
|
225
|
+
me.back = false
|
234
226
|
}
|
235
227
|
|
236
228
|
/**
|
@@ -240,10 +232,9 @@ class PrefixField extends Base {
|
|
240
232
|
* @protected
|
241
233
|
*/
|
242
234
|
onFieldBlur(data) {
|
243
|
-
|
244
|
-
el = this.owner;
|
235
|
+
let {owner, pattern} = this;
|
245
236
|
|
246
|
-
return
|
237
|
+
return owner.value === pattern && (owner.value = '')
|
247
238
|
}
|
248
239
|
|
249
240
|
/**
|
@@ -252,7 +243,7 @@ class PrefixField extends Base {
|
|
252
243
|
* @protected
|
253
244
|
*/
|
254
245
|
onFieldFocus(data) {
|
255
|
-
this.format()
|
246
|
+
this.format()
|
256
247
|
}
|
257
248
|
|
258
249
|
/**
|
@@ -261,7 +252,7 @@ class PrefixField extends Base {
|
|
261
252
|
* @protected
|
262
253
|
*/
|
263
254
|
onFieldKeyDown(data) {
|
264
|
-
this.back =
|
255
|
+
this.back = data.key === "Backspace"
|
265
256
|
}
|
266
257
|
|
267
258
|
/**
|
@@ -275,11 +266,11 @@ class PrefixField extends Base {
|
|
275
266
|
|
276
267
|
// Do not run, if ignore state or same start and end data
|
277
268
|
if (this.ignoreSelection || (dSel.start === sel.start && dSel.end === sel.end)) {
|
278
|
-
return
|
269
|
+
return
|
279
270
|
}
|
280
271
|
|
281
272
|
this.selection = dSel;
|
282
|
-
this.format()
|
273
|
+
this.format()
|
283
274
|
}
|
284
275
|
|
285
276
|
/**
|
@@ -287,16 +278,15 @@ class PrefixField extends Base {
|
|
287
278
|
* @protected
|
288
279
|
*/
|
289
280
|
recalcFirstAndPref() {
|
290
|
-
|
291
|
-
|
292
|
-
slots = me.slots;
|
281
|
+
let me = this,
|
282
|
+
{pattern, slots} = me;
|
293
283
|
|
294
284
|
me.prev = (j => Array.from(pattern, (c, i) => slots.has(c) ? j = i + 1 : j))(0);
|
295
285
|
me.first = [...pattern].findIndex(c => slots.has(c));
|
296
286
|
|
297
287
|
me.selection = {start: me.first, end: me.first};
|
298
288
|
|
299
|
-
|
289
|
+
me.owner.value && me.format()
|
300
290
|
}
|
301
291
|
}
|
302
292
|
|