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/data/Store.mjs
CHANGED
@@ -132,7 +132,7 @@ class Store extends Base {
|
|
132
132
|
* @returns {Number} the collection count
|
133
133
|
*/
|
134
134
|
add(item) {
|
135
|
-
return super.add(this.beforeSetData(item))
|
135
|
+
return super.add(this.beforeSetData(item))
|
136
136
|
}
|
137
137
|
|
138
138
|
/**
|
@@ -142,7 +142,7 @@ class Store extends Base {
|
|
142
142
|
* @protected
|
143
143
|
*/
|
144
144
|
afterSetCurrentPage(value, oldValue) {
|
145
|
-
oldValue && this.load()
|
145
|
+
oldValue && this.load()
|
146
146
|
}
|
147
147
|
|
148
148
|
/**
|
@@ -156,12 +156,12 @@ class Store extends Base {
|
|
156
156
|
if (me.configsApplied) {
|
157
157
|
if (value) {
|
158
158
|
if (oldValue) {
|
159
|
-
me.clear()
|
159
|
+
me.clear()
|
160
160
|
} else {
|
161
|
-
me.initialData = [...value]
|
161
|
+
me.initialData = [...value]
|
162
162
|
}
|
163
163
|
|
164
|
-
me.add(value)
|
164
|
+
me.add(value)
|
165
165
|
}
|
166
166
|
}
|
167
167
|
}
|
@@ -178,7 +178,7 @@ class Store extends Base {
|
|
178
178
|
|
179
179
|
me._currentPage = 1; // silent update
|
180
180
|
|
181
|
-
oldValue && me.remoteFilter && me.load()
|
181
|
+
oldValue && me.remoteFilter && me.load()
|
182
182
|
}
|
183
183
|
|
184
184
|
/**
|
@@ -198,7 +198,7 @@ class Store extends Base {
|
|
198
198
|
afterSetModel(value, oldValue) {
|
199
199
|
if (value) {
|
200
200
|
value.storeId = this.id;
|
201
|
-
RecordFactory.createRecordClass(value)
|
201
|
+
RecordFactory.createRecordClass(value)
|
202
202
|
}
|
203
203
|
}
|
204
204
|
|
@@ -211,7 +211,7 @@ class Store extends Base {
|
|
211
211
|
afterSetPageSize(value, oldValue) {
|
212
212
|
if (oldValue) {
|
213
213
|
this._currentPage = 1; // silent update
|
214
|
-
this.load()
|
214
|
+
this.load()
|
215
215
|
}
|
216
216
|
}
|
217
217
|
|
@@ -227,7 +227,7 @@ class Store extends Base {
|
|
227
227
|
|
228
228
|
me._currentPage = 1; // silent update
|
229
229
|
|
230
|
-
oldValue && me.remoteSort && me.load()
|
230
|
+
oldValue && me.remoteSort && me.load()
|
231
231
|
}
|
232
232
|
|
233
233
|
/**
|
@@ -243,10 +243,10 @@ class Store extends Base {
|
|
243
243
|
destroy: value + '.destroy',
|
244
244
|
read : value + '.read',
|
245
245
|
update : value + '.update'
|
246
|
-
}
|
246
|
+
}
|
247
247
|
}
|
248
248
|
|
249
|
-
return value
|
249
|
+
return value
|
250
250
|
}
|
251
251
|
|
252
252
|
/**
|
@@ -260,7 +260,7 @@ class Store extends Base {
|
|
260
260
|
|
261
261
|
if (value) {
|
262
262
|
if (!Array.isArray(value)) {
|
263
|
-
value = [value]
|
263
|
+
value = [value]
|
264
264
|
}
|
265
265
|
|
266
266
|
// todo: add a config to make the cloning optional
|
@@ -268,12 +268,12 @@ class Store extends Base {
|
|
268
268
|
|
269
269
|
value.forEach((key, index) => {
|
270
270
|
if (!RecordFactory.isRecord(key)) {
|
271
|
-
value[index] = RecordFactory.createRecord(me.model, key)
|
271
|
+
value[index] = RecordFactory.createRecord(me.model, key)
|
272
272
|
}
|
273
|
-
})
|
273
|
+
})
|
274
274
|
}
|
275
275
|
|
276
|
-
return value
|
276
|
+
return value
|
277
277
|
}
|
278
278
|
|
279
279
|
/**
|
@@ -284,10 +284,10 @@ class Store extends Base {
|
|
284
284
|
*/
|
285
285
|
beforeSetInitialData(value, oldValue) {
|
286
286
|
if (!value && oldValue) {
|
287
|
-
return oldValue
|
287
|
+
return oldValue
|
288
288
|
}
|
289
289
|
|
290
|
-
return value
|
290
|
+
return value
|
291
291
|
}
|
292
292
|
|
293
293
|
/**
|
@@ -299,14 +299,14 @@ class Store extends Base {
|
|
299
299
|
beforeSetModel(value, oldValue) {
|
300
300
|
oldValue?.destroy();
|
301
301
|
|
302
|
-
return ClassSystemUtil.beforeSetInstance(value, Model)
|
302
|
+
return ClassSystemUtil.beforeSetInstance(value, Model)
|
303
303
|
}
|
304
304
|
|
305
305
|
/**
|
306
306
|
* @param {Object} config
|
307
307
|
*/
|
308
308
|
createRecord(config) {
|
309
|
-
RecordFactory.createRecord(config)
|
309
|
+
RecordFactory.createRecord(config)
|
310
310
|
}
|
311
311
|
|
312
312
|
/**
|
@@ -325,11 +325,11 @@ class Store extends Base {
|
|
325
325
|
params = {page: me.currentPage, pageSize: me.pageSize, ...opts.params};
|
326
326
|
|
327
327
|
if (me.remoteFilter) {
|
328
|
-
params.filters = me.exportFilters()
|
328
|
+
params.filters = me.exportFilters()
|
329
329
|
}
|
330
330
|
|
331
331
|
if (me.remoteSort) {
|
332
|
-
params.sorters = me.exportSorters()
|
332
|
+
params.sorters = me.exportSorters()
|
333
333
|
}
|
334
334
|
|
335
335
|
if (me.api) {
|
@@ -338,7 +338,7 @@ class Store extends Base {
|
|
338
338
|
service = Neo.ns(apiArray.join('.'));
|
339
339
|
|
340
340
|
if (!service) {
|
341
|
-
console.log('Api is not defined', this)
|
341
|
+
console.log('Api is not defined', this)
|
342
342
|
} else {
|
343
343
|
service[fn](params).then(response => {
|
344
344
|
response = Neo.ns(me.responseRoot, false, response);
|
@@ -347,15 +347,15 @@ class Store extends Base {
|
|
347
347
|
me.totalCount = response.totalCount;
|
348
348
|
me.data = Neo.ns(me.responseRoot, false, response); // fires the load event
|
349
349
|
}
|
350
|
-
})
|
350
|
+
})
|
351
351
|
}
|
352
352
|
} else {
|
353
353
|
opts.url ??= me.url;
|
354
354
|
|
355
355
|
Neo.Xhr.promiseJson(opts).catch(err => {
|
356
|
-
console.log('Error for Neo.Xhr.request', err, me.id)
|
356
|
+
console.log('Error for Neo.Xhr.request', err, me.id)
|
357
357
|
}).then(data => {
|
358
|
-
me.data = Neo.ns(me.responseRoot, false, data.json) || data.json
|
358
|
+
me.data = Neo.ns(me.responseRoot, false, data.json) || data.json
|
359
359
|
// we do not need to fire a load event => onCollectionMutate()
|
360
360
|
})
|
361
361
|
}
|
@@ -369,7 +369,7 @@ class Store extends Base {
|
|
369
369
|
|
370
370
|
if (me.configsApplied) {
|
371
371
|
// console.log('onCollectionMutate', opts);
|
372
|
-
me.fire('load', me.items)
|
372
|
+
me.fire('load', me.items)
|
373
373
|
}
|
374
374
|
}
|
375
375
|
|
@@ -399,8 +399,8 @@ class Store extends Base {
|
|
399
399
|
|
400
400
|
if (me.autoLoad) {
|
401
401
|
setTimeout(() => { // todo
|
402
|
-
me.load()
|
403
|
-
}, 100)
|
402
|
+
me.load()
|
403
|
+
}, 100)
|
404
404
|
}
|
405
405
|
}
|
406
406
|
|
@@ -413,9 +413,9 @@ class Store extends Base {
|
|
413
413
|
|
414
414
|
if (me.remoteFilter) {
|
415
415
|
me._currentPage = 1; // silent update
|
416
|
-
me.load()
|
416
|
+
me.load()
|
417
417
|
} else {
|
418
|
-
super.onFilterChange(opts)
|
418
|
+
super.onFilterChange(opts)
|
419
419
|
}
|
420
420
|
}
|
421
421
|
|
@@ -431,7 +431,7 @@ class Store extends Base {
|
|
431
431
|
this.fire('recordChange', {
|
432
432
|
...data,
|
433
433
|
index: this.indexOf(data.record)
|
434
|
-
})
|
434
|
+
})
|
435
435
|
}
|
436
436
|
|
437
437
|
/**
|
@@ -449,11 +449,11 @@ class Store extends Base {
|
|
449
449
|
me.sorters = [{
|
450
450
|
direction: opts.direction,
|
451
451
|
property : opts.property
|
452
|
-
}]
|
452
|
+
}]
|
453
453
|
} else {
|
454
454
|
if (!me.remoteSort) {
|
455
455
|
me.startUpdate();
|
456
|
-
me.clear()
|
456
|
+
me.clear()
|
457
457
|
}
|
458
458
|
|
459
459
|
me.sorters = [];
|
@@ -461,7 +461,7 @@ class Store extends Base {
|
|
461
461
|
if (!me.remoteSort) {
|
462
462
|
me.add([...me.initialData]);
|
463
463
|
me.endUpdate();
|
464
|
-
me.fire('sort')
|
464
|
+
me.fire('sort')
|
465
465
|
}
|
466
466
|
}
|
467
467
|
}
|
@@ -94,9 +94,9 @@ class Fetch extends Base {
|
|
94
94
|
request(url, config={}, method, data) {
|
95
95
|
if (!Neo.isString(url)) {
|
96
96
|
config = url;
|
97
|
-
url = config.url
|
97
|
+
url = config.url
|
98
98
|
} else {
|
99
|
-
config.url = config
|
99
|
+
config.url = config
|
100
100
|
}
|
101
101
|
|
102
102
|
return fetch(url, {
|
@@ -117,7 +117,7 @@ class Fetch extends Base {
|
|
117
117
|
.then(data => {
|
118
118
|
response.data = data;
|
119
119
|
})
|
120
|
-
.then(() => (resp.ok ? response : Promise.reject(response)))
|
120
|
+
.then(() => (resp.ok ? response : Promise.reject(response)))
|
121
121
|
})
|
122
122
|
}
|
123
123
|
}
|
@@ -65,7 +65,7 @@ class Socket extends Base {
|
|
65
65
|
*/
|
66
66
|
construct(config) {
|
67
67
|
super.construct(config);
|
68
|
-
this.createSocket()
|
68
|
+
this.createSocket()
|
69
69
|
}
|
70
70
|
|
71
71
|
/**
|
@@ -84,7 +84,7 @@ class Socket extends Base {
|
|
84
84
|
callback,
|
85
85
|
scope : scope || me,
|
86
86
|
single: true
|
87
|
-
})
|
87
|
+
})
|
88
88
|
}
|
89
89
|
}
|
90
90
|
|
@@ -94,12 +94,10 @@ class Socket extends Base {
|
|
94
94
|
* @returns {String}
|
95
95
|
*/
|
96
96
|
beforeSend(data) {
|
97
|
-
let me
|
98
|
-
channel = me
|
99
|
-
|
100
|
-
console.log('WS: Sending message', (channel ? '\nChannel: ' + channel : ''), '\nData:', data);
|
97
|
+
let me = this,
|
98
|
+
{channel} = me;
|
101
99
|
|
102
|
-
return JSON.stringify(channel ? {channel, data} : data)
|
100
|
+
return JSON.stringify(channel ? {channel, data} : data)
|
103
101
|
}
|
104
102
|
|
105
103
|
/**
|
@@ -120,10 +118,10 @@ class Socket extends Base {
|
|
120
118
|
onopen : me.onOpen .bind(me)
|
121
119
|
});
|
122
120
|
|
123
|
-
createInterceptor(value, 'send', me.beforeSend, me)
|
121
|
+
createInterceptor(value, 'send', me.beforeSend, me)
|
124
122
|
}
|
125
123
|
|
126
|
-
return value
|
124
|
+
return value
|
127
125
|
}
|
128
126
|
|
129
127
|
/**
|
@@ -131,14 +129,14 @@ class Socket extends Base {
|
|
131
129
|
* @param {String} [reason]
|
132
130
|
*/
|
133
131
|
close(code, reason) {
|
134
|
-
this.socket.close(code, reason)
|
132
|
+
this.socket.close(code, reason)
|
135
133
|
}
|
136
134
|
|
137
135
|
/**
|
138
136
|
*
|
139
137
|
*/
|
140
138
|
createSocket() {
|
141
|
-
this.socket = new WebSocket(this.serverAddress)
|
139
|
+
this.socket = new WebSocket(this.serverAddress)
|
142
140
|
}
|
143
141
|
|
144
142
|
/**
|
@@ -146,7 +144,7 @@ class Socket extends Base {
|
|
146
144
|
*/
|
147
145
|
destroy(...args) {
|
148
146
|
this.close();
|
149
|
-
super.destroy(...args)
|
147
|
+
super.destroy(...args)
|
150
148
|
}
|
151
149
|
|
152
150
|
/**
|
@@ -171,14 +169,14 @@ class Socket extends Base {
|
|
171
169
|
* @param {Boolean} wasClean Indicates whether or not the connection was cleanly closed.
|
172
170
|
*/
|
173
171
|
onClose(event, reason, wasClean) {
|
174
|
-
console.log('onClose', event, reason, wasClean)
|
172
|
+
console.log('onClose', event, reason, wasClean)
|
175
173
|
}
|
176
174
|
|
177
175
|
/**
|
178
176
|
*
|
179
177
|
*/
|
180
178
|
onError() {
|
181
|
-
console.log('onError', arguments)
|
179
|
+
console.log('onError', arguments)
|
182
180
|
}
|
183
181
|
|
184
182
|
/**
|
@@ -188,11 +186,9 @@ class Socket extends Base {
|
|
188
186
|
let me = this,
|
189
187
|
data = JSON.parse(event.data);
|
190
188
|
|
191
|
-
console.log('onMessage', data);
|
192
|
-
|
193
189
|
if (data.mId) {
|
194
190
|
me.messageCallbacks[data.mId].resolve(data.data);
|
195
|
-
delete me.messageCallbacks[data.mId]
|
191
|
+
delete me.messageCallbacks[data.mId]
|
196
192
|
}
|
197
193
|
}
|
198
194
|
|
@@ -200,7 +196,7 @@ class Socket extends Base {
|
|
200
196
|
*
|
201
197
|
*/
|
202
198
|
onOpen() {
|
203
|
-
this.fire('open', {scope: this})
|
199
|
+
this.fire('open', {scope: this})
|
204
200
|
}
|
205
201
|
|
206
202
|
/**
|
@@ -214,17 +210,17 @@ class Socket extends Base {
|
|
214
210
|
me.messageCallbacks[me.messageId] = {reject, resolve};
|
215
211
|
|
216
212
|
me.sendMessage({data, mId: me.messageId});
|
217
|
-
me.messageId
|
218
|
-
})
|
213
|
+
me.messageId++
|
214
|
+
})
|
219
215
|
}
|
220
216
|
|
221
217
|
/**
|
222
218
|
* @param {Object} data
|
223
219
|
*/
|
224
220
|
sendMessage(data) {
|
225
|
-
let me
|
226
|
-
socket = me
|
227
|
-
d
|
221
|
+
let me = this,
|
222
|
+
{socket} = me,
|
223
|
+
d = data;
|
228
224
|
|
229
225
|
// CONNECTING 0 The connection is not yet open.
|
230
226
|
// OPEN 1 The connection is open and ready to communicate.
|
@@ -241,8 +237,8 @@ class Socket extends Base {
|
|
241
237
|
break;
|
242
238
|
case WebSocket.CONNECTING:
|
243
239
|
me.on('open', function() {
|
244
|
-
me.sendMessage(d)
|
245
|
-
}, me, {
|
240
|
+
me.sendMessage(d)
|
241
|
+
}, me, {once: true});
|
246
242
|
break;
|
247
243
|
case WebSocket.OPEN:
|
248
244
|
socket.send(data);
|
@@ -43,15 +43,16 @@ class Xhr extends Base {
|
|
43
43
|
* @param {Object} event
|
44
44
|
*/
|
45
45
|
getResponse(event) {
|
46
|
-
let target = event
|
46
|
+
let {target} = event,
|
47
|
+
{readyState, response, status, statusText} = target;
|
47
48
|
|
48
49
|
return {
|
49
|
-
readyState
|
50
|
-
response
|
51
|
-
status
|
52
|
-
statusText
|
53
|
-
headers
|
54
|
-
}
|
50
|
+
readyState,
|
51
|
+
response,
|
52
|
+
status,
|
53
|
+
statusText,
|
54
|
+
headers: target.getAllResponseHeaders()
|
55
|
+
}
|
55
56
|
}
|
56
57
|
|
57
58
|
/**
|
@@ -69,7 +70,7 @@ class Xhr extends Base {
|
|
69
70
|
request[key] = null;
|
70
71
|
});
|
71
72
|
|
72
|
-
delete me.requests[id]
|
73
|
+
delete me.requests[id]
|
73
74
|
}
|
74
75
|
|
75
76
|
/**
|
@@ -84,10 +85,10 @@ class Xhr extends Base {
|
|
84
85
|
cb?.apply(request.scope || me, [me.getResponse(e), true]);
|
85
86
|
|
86
87
|
Object.entries(request).forEach(([key, value]) => {
|
87
|
-
request[key] = null
|
88
|
+
request[key] = null
|
88
89
|
});
|
89
90
|
|
90
|
-
delete me.requests[id]
|
91
|
+
delete me.requests[id]
|
91
92
|
}
|
92
93
|
|
93
94
|
/**
|
@@ -111,19 +112,20 @@ class Xhr extends Base {
|
|
111
112
|
try {
|
112
113
|
json = JSON.parse(data.response);
|
113
114
|
|
114
|
-
resolve(Object.assign(data, { json }))
|
115
|
+
resolve(Object.assign(data, { json }))
|
115
116
|
} catch(err) {
|
116
117
|
reject({
|
117
|
-
reject
|
118
|
-
error
|
119
|
-
})
|
118
|
+
reject: true,
|
119
|
+
error : err.message
|
120
|
+
})
|
120
121
|
}
|
121
122
|
} else {
|
122
|
-
reject(data)
|
123
|
+
reject(data)
|
123
124
|
}
|
124
125
|
};
|
125
|
-
|
126
|
-
|
126
|
+
|
127
|
+
me.request(opts)
|
128
|
+
})
|
127
129
|
}
|
128
130
|
|
129
131
|
/**
|
@@ -136,13 +138,14 @@ class Xhr extends Base {
|
|
136
138
|
return new Promise((resolve, reject) => {
|
137
139
|
opts.callback = function(data, success) {
|
138
140
|
if (success) {
|
139
|
-
resolve(data)
|
141
|
+
resolve(data)
|
140
142
|
} else {
|
141
|
-
reject(data)
|
143
|
+
reject(data)
|
142
144
|
}
|
143
145
|
};
|
144
|
-
|
145
|
-
|
146
|
+
|
147
|
+
me.request(opts)
|
148
|
+
})
|
146
149
|
}
|
147
150
|
|
148
151
|
/**
|
@@ -167,16 +170,16 @@ class Xhr extends Base {
|
|
167
170
|
xhr = new XMLHttpRequest();
|
168
171
|
|
169
172
|
if (!opts.url) {
|
170
|
-
console.error('Neo.Xhr.request without a given url' + JSON.stringify(opts))
|
173
|
+
console.error('Neo.Xhr.request without a given url' + JSON.stringify(opts))
|
171
174
|
} else {
|
172
175
|
if (!opts.insideNeo && location.href.includes('/node_modules/neo.mjs/') && !location.href.startsWith('https://neomjs.com/')) {
|
173
176
|
if (opts.url.startsWith('./') || opts.url.startsWith('../')) {
|
174
|
-
opts.url = '../../' + opts.url
|
177
|
+
opts.url = '../../' + opts.url
|
175
178
|
}
|
176
179
|
}
|
177
180
|
|
178
181
|
if (opts.params) {
|
179
|
-
opts.url += ('?' + new URLSearchParams(opts.params).toString())
|
182
|
+
opts.url += ('?' + new URLSearchParams(opts.params).toString())
|
180
183
|
}
|
181
184
|
|
182
185
|
xhr.neoId = id;
|
@@ -198,12 +201,12 @@ class Xhr extends Base {
|
|
198
201
|
xhr.open(method, opts.url, true);
|
199
202
|
|
200
203
|
Object.entries(headers).forEach(([key, value]) => {
|
201
|
-
xhr.setRequestHeader(key, value)
|
204
|
+
xhr.setRequestHeader(key, value)
|
202
205
|
});
|
203
206
|
|
204
207
|
xhr.send(opts.data);
|
205
208
|
|
206
|
-
return xhr
|
209
|
+
return xhr
|
207
210
|
}
|
208
211
|
}
|
209
212
|
|
@@ -215,7 +218,7 @@ class Xhr extends Base {
|
|
215
218
|
sendForm(form, opts) {
|
216
219
|
opts.data = new FormData(form);
|
217
220
|
|
218
|
-
return this.request(opts)
|
221
|
+
return this.request(opts)
|
219
222
|
}
|
220
223
|
|
221
224
|
/**
|
@@ -224,7 +227,7 @@ class Xhr extends Base {
|
|
224
227
|
* @param {Object} value
|
225
228
|
*/
|
226
229
|
setDefaultHeaders(value) {
|
227
|
-
this.defaultHeaders = value
|
230
|
+
this.defaultHeaders = value
|
228
231
|
}
|
229
232
|
}
|
230
233
|
|
@@ -127,7 +127,7 @@ class DayViewComponent extends Base {
|
|
127
127
|
*/
|
128
128
|
createContent(silent=false, containerEl) {
|
129
129
|
let me = this,
|
130
|
-
currentDate
|
130
|
+
{currentDate} = me,
|
131
131
|
currentDay = currentDate.getDate(),
|
132
132
|
currentMonth = currentDate.getMonth(),
|
133
133
|
currentYear = currentDate.getFullYear(),
|
@@ -215,8 +215,8 @@ class SelectorContainer extends Container {
|
|
215
215
|
* @protected
|
216
216
|
*/
|
217
217
|
afterSetShowCellBorders(value, oldValue) {
|
218
|
-
let me
|
219
|
-
cls = me
|
218
|
+
let me = this,
|
219
|
+
{cls} = me;
|
220
220
|
|
221
221
|
NeoArray.toggle(cls, 'neo-hide-inner-borders', !value);
|
222
222
|
me.cls = cls
|