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
package/src/tree/Accordion.mjs
CHANGED
@@ -109,12 +109,10 @@ class AccordionTree extends TreeList {
|
|
109
109
|
* @param {Boolean} oldValue
|
110
110
|
*/
|
111
111
|
afterSetFirstParentIsVisible(value, oldValue) {
|
112
|
-
|
113
|
-
|
114
|
-
this[toggleFn]('first-parent-not-visible');
|
112
|
+
this[!value ? 'addCls' : 'removeCls']('first-parent-not-visible');
|
115
113
|
|
116
114
|
if (this.store.first()) {
|
117
|
-
this.store.first().visible = value
|
115
|
+
this.store.first().visible = value
|
118
116
|
}
|
119
117
|
}
|
120
118
|
|
@@ -126,17 +124,16 @@ class AccordionTree extends TreeList {
|
|
126
124
|
* @param {Boolean} oldValue
|
127
125
|
*/
|
128
126
|
afterSetRootParentsAreCollapsible(value, oldValue) {
|
129
|
-
|
130
|
-
toggleFn = !value ? 'addCls' : 'removeCls';
|
127
|
+
let me = this;
|
131
128
|
|
132
|
-
me[
|
129
|
+
me[!value ? 'addCls' : 'removeCls']('root-not-collapsible');
|
133
130
|
|
134
131
|
if (me.rendered && value === false) {
|
135
|
-
|
132
|
+
let {store} = me;
|
136
133
|
|
137
134
|
store.items.forEach(record => {
|
138
135
|
if (record.parentId === null && !record.isLeaf) {
|
139
|
-
me.expandItem(record)
|
136
|
+
me.expandItem(record)
|
140
137
|
}
|
141
138
|
})
|
142
139
|
}
|
@@ -150,9 +147,9 @@ class AccordionTree extends TreeList {
|
|
150
147
|
* @param {Boolean} oldValue
|
151
148
|
*/
|
152
149
|
afterSetShowIcon(value, oldValue) {
|
153
|
-
const me
|
154
|
-
store = me
|
155
|
-
hide
|
150
|
+
const me = this,
|
151
|
+
{store} = me,
|
152
|
+
hide = !value;
|
156
153
|
|
157
154
|
store.items.forEach((record) => {
|
158
155
|
const itemId = me.getItemId(record[me.getKeyProperty()]),
|
@@ -160,7 +157,7 @@ class AccordionTree extends TreeList {
|
|
160
157
|
itemVdom = VDomUtil.getByFlag(vdom, 'icon');
|
161
158
|
|
162
159
|
if (record.isLeaf) {
|
163
|
-
itemVdom.removeDom = hide
|
160
|
+
itemVdom.removeDom = hide
|
164
161
|
}
|
165
162
|
})
|
166
163
|
|
@@ -177,7 +174,7 @@ class AccordionTree extends TreeList {
|
|
177
174
|
beforeSetSelectionModel(value, oldValue) {
|
178
175
|
oldValue?.destroy();
|
179
176
|
|
180
|
-
return ClassSystemUtil.beforeSetInstance(value, TreeAccordionModel)
|
177
|
+
return ClassSystemUtil.beforeSetInstance(value, TreeAccordionModel)
|
181
178
|
}
|
182
179
|
|
183
180
|
/**
|
@@ -189,7 +186,7 @@ class AccordionTree extends TreeList {
|
|
189
186
|
clear(withUpdate=true) {
|
190
187
|
delete this.getVdomRoot().cn[0].cn
|
191
188
|
|
192
|
-
withUpdate && this.update()
|
189
|
+
withUpdate && this.update()
|
193
190
|
}
|
194
191
|
|
195
192
|
/**
|
@@ -207,15 +204,14 @@ class AccordionTree extends TreeList {
|
|
207
204
|
* @protected
|
208
205
|
*/
|
209
206
|
createItems(parentId, vdomRoot, level) {
|
210
|
-
let me
|
211
|
-
|
212
|
-
|
213
|
-
folderCls = me.folderCls,
|
207
|
+
let me = this,
|
208
|
+
{folderCls, itemCls} = me,
|
209
|
+
items = me.store.find('parentId', parentId),
|
214
210
|
cls, id, itemIconCls, tmpRoot;
|
215
211
|
|
216
212
|
if (items.length > 0) {
|
217
213
|
if (!vdomRoot.cn) {
|
218
|
-
vdomRoot.cn = []
|
214
|
+
vdomRoot.cn = []
|
219
215
|
}
|
220
216
|
|
221
217
|
if (parentId !== null) {
|
@@ -226,45 +222,45 @@ class AccordionTree extends TreeList {
|
|
226
222
|
id : `${me.id}__${parentId}__ul`
|
227
223
|
});
|
228
224
|
|
229
|
-
tmpRoot = vdomRoot.cn[vdomRoot.cn.length - 1]
|
225
|
+
tmpRoot = vdomRoot.cn[vdomRoot.cn.length - 1]
|
230
226
|
} else {
|
231
|
-
tmpRoot = vdomRoot
|
227
|
+
tmpRoot = vdomRoot
|
232
228
|
}
|
233
229
|
|
234
230
|
items.forEach(item => {
|
235
|
-
cls
|
236
|
-
|
231
|
+
cls = [itemCls];
|
237
232
|
itemIconCls = ['neo-accordion-item-icon'];
|
233
|
+
|
238
234
|
if (item.iconCls) {
|
239
|
-
NeoArray.add(itemIconCls, item.iconCls.split(' '))
|
235
|
+
NeoArray.add(itemIconCls, item.iconCls.split(' '))
|
240
236
|
}
|
241
237
|
|
242
|
-
|
243
238
|
if (item.isLeaf) {
|
244
|
-
cls.push(itemCls + (item.singleton ? '-leaf-singleton' : '-leaf'))
|
239
|
+
cls.push(itemCls + (item.singleton ? '-leaf-singleton' : '-leaf'))
|
245
240
|
} else {
|
246
241
|
cls.push(folderCls);
|
247
242
|
|
248
243
|
if (!item.parentId && !me.rootParentsAreCollapsible) {
|
249
|
-
|
250
244
|
cls.push('neo-not-collapsible');
|
245
|
+
|
251
246
|
if (item.collapsed) {
|
252
|
-
item.collapsed = false
|
247
|
+
item.collapsed = false
|
253
248
|
}
|
254
249
|
}
|
250
|
+
|
255
251
|
if (!item.collapsed) {
|
256
|
-
cls.push('neo-folder-open')
|
252
|
+
cls.push('neo-folder-open')
|
257
253
|
}
|
258
254
|
}
|
259
255
|
|
260
256
|
id = me.getItemId(item.id);
|
261
257
|
|
262
258
|
tmpRoot.cn.push({
|
263
|
-
|
264
|
-
|
259
|
+
tag : 'li',
|
260
|
+
tabIndex: -1,
|
265
261
|
cls,
|
266
262
|
id,
|
267
|
-
cn
|
263
|
+
cn : [{
|
268
264
|
flag : 'iconCls',
|
269
265
|
tag : 'span',
|
270
266
|
cls : itemIconCls,
|
@@ -295,11 +291,11 @@ class AccordionTree extends TreeList {
|
|
295
291
|
}
|
296
292
|
});
|
297
293
|
|
298
|
-
tmpRoot = me.createItems(item.id, tmpRoot, level + 1)
|
299
|
-
})
|
294
|
+
tmpRoot = me.createItems(item.id, tmpRoot, level + 1)
|
295
|
+
})
|
300
296
|
}
|
301
297
|
|
302
|
-
return vdomRoot
|
298
|
+
return vdomRoot
|
303
299
|
}
|
304
300
|
|
305
301
|
|
@@ -308,14 +304,14 @@ class AccordionTree extends TreeList {
|
|
308
304
|
* @param {Object} record
|
309
305
|
*/
|
310
306
|
expandItem(record) {
|
311
|
-
|
312
|
-
|
313
|
-
|
307
|
+
let me = this,
|
308
|
+
itemId = me.getItemId(record[me.getKeyProperty()]),
|
309
|
+
item = me.getVdomChild(itemId);
|
314
310
|
|
315
311
|
record.collapsed = false;
|
316
312
|
|
317
313
|
NeoArray.add(item.cls, 'neo-folder-open');
|
318
|
-
me.update()
|
314
|
+
me.update()
|
319
315
|
}
|
320
316
|
|
321
317
|
/**
|
@@ -325,11 +321,11 @@ class AccordionTree extends TreeList {
|
|
325
321
|
onItemClick(item, data) {
|
326
322
|
super.onItemClick(item, data);
|
327
323
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
324
|
+
let me = this,
|
325
|
+
{selectionModel} = me,
|
326
|
+
itemId = item.id,
|
327
|
+
id = Number(itemId.split('__')[1]),
|
328
|
+
record = me.store.get(id);
|
333
329
|
|
334
330
|
selectionModel.select(item.id);
|
335
331
|
|
@@ -351,7 +347,7 @@ class AccordionTree extends TreeList {
|
|
351
347
|
* @returns {Object}
|
352
348
|
*/
|
353
349
|
getListItemsRoot() {
|
354
|
-
return this.vdom.cn[0]
|
350
|
+
return this.vdom.cn[0]
|
355
351
|
}
|
356
352
|
|
357
353
|
/**
|
@@ -359,11 +355,11 @@ class AccordionTree extends TreeList {
|
|
359
355
|
* @param {Object} data
|
360
356
|
*/
|
361
357
|
onFocus(data) {
|
362
|
-
|
363
|
-
|
364
|
-
|
358
|
+
let me = this,
|
359
|
+
{selectionModel} = me,
|
360
|
+
selection = selectionModel.getSelection()[0];
|
365
361
|
|
366
|
-
|
362
|
+
!selection && selectionModel.selectRoot()
|
367
363
|
}
|
368
364
|
|
369
365
|
/**
|
@@ -371,17 +367,17 @@ class AccordionTree extends TreeList {
|
|
371
367
|
* @param {String[]} value
|
372
368
|
*/
|
373
369
|
onSelect(value) {
|
374
|
-
|
375
|
-
|
370
|
+
let me = this,
|
371
|
+
records = [];
|
376
372
|
|
377
373
|
value.forEach((selectItemId) => {
|
378
374
|
let id = me.getItemRecordId(selectItemId),
|
379
375
|
record = me.store.get(id);
|
380
376
|
|
381
|
-
records.push(record)
|
377
|
+
records.push(record)
|
382
378
|
});
|
383
379
|
|
384
|
-
me.selection = records
|
380
|
+
me.selection = records
|
385
381
|
}
|
386
382
|
|
387
383
|
/**
|
@@ -389,17 +385,15 @@ class AccordionTree extends TreeList {
|
|
389
385
|
* @param {Record[]} records
|
390
386
|
*/
|
391
387
|
onStoreLoad(records) {
|
392
|
-
let me = this
|
393
|
-
listenerId;
|
388
|
+
let me = this;
|
394
389
|
|
395
390
|
me.clear(false);
|
396
391
|
|
397
392
|
if (!me.mounted && me.rendering) {
|
398
|
-
|
399
|
-
me.un('mounted', listenerId);
|
393
|
+
me.on('mounted', () => {
|
400
394
|
me.createItems(null, me.getListItemsRoot(), 0);
|
401
395
|
me.update()
|
402
|
-
})
|
396
|
+
}, me, {once: true})
|
403
397
|
} else {
|
404
398
|
me.createItems(null, me.getListItemsRoot(), 0);
|
405
399
|
me.update()
|
@@ -415,11 +409,10 @@ class AccordionTree extends TreeList {
|
|
415
409
|
* @param {Record} data.record
|
416
410
|
*/
|
417
411
|
onStoreRecordChange(data) {
|
418
|
-
let me
|
419
|
-
record = data
|
420
|
-
|
421
|
-
|
422
|
-
vdom = me.getVdomChild(itemId),
|
412
|
+
let me = this,
|
413
|
+
{fields, record} = data,
|
414
|
+
itemId = me.getItemId(record[me.getKeyProperty()]),
|
415
|
+
vdom = me.getVdomChild(itemId),
|
423
416
|
itemVdom;
|
424
417
|
|
425
418
|
fields.forEach((field) => {
|
@@ -427,13 +420,13 @@ class AccordionTree extends TreeList {
|
|
427
420
|
|
428
421
|
if (itemVdom) {
|
429
422
|
if (field.name === 'iconCls') {
|
430
|
-
|
431
|
-
|
423
|
+
let clsItems = field.value.split(' '),
|
424
|
+
cls = ['neo-accordion-item-icon'];
|
432
425
|
|
433
426
|
NeoArray.add(cls, clsItems);
|
434
|
-
itemVdom.cls = cls
|
427
|
+
itemVdom.cls = cls
|
435
428
|
} else {
|
436
|
-
itemVdom.html = field.value
|
429
|
+
itemVdom.html = field.value
|
437
430
|
}
|
438
431
|
}
|
439
432
|
});
|
@@ -450,17 +443,18 @@ class AccordionTree extends TreeList {
|
|
450
443
|
setSelection(value) {
|
451
444
|
if (value === null) {
|
452
445
|
this.clearSelection();
|
453
|
-
return
|
446
|
+
return
|
454
447
|
}
|
455
448
|
|
456
449
|
// In case you pass in an array use only the first item
|
457
|
-
if (Neo.isArray(value))
|
450
|
+
if (Neo.isArray(value)) {
|
451
|
+
value = value[0]
|
452
|
+
}
|
458
453
|
|
459
|
-
|
460
|
-
|
454
|
+
let me = this,
|
455
|
+
recordKeyProperty, elId;
|
461
456
|
|
462
|
-
if (Neo.
|
463
|
-
// Record
|
457
|
+
if (Neo.isRecord(value)) {
|
464
458
|
recordKeyProperty = value[me.getKeyProperty()];
|
465
459
|
} else {
|
466
460
|
// RecordId
|
@@ -469,7 +463,7 @@ class AccordionTree extends TreeList {
|
|
469
463
|
|
470
464
|
elId = me.getItemId(recordKeyProperty);
|
471
465
|
|
472
|
-
me.selectionModel.selectAndScrollIntoView(elId)
|
466
|
+
me.selectionModel.selectAndScrollIntoView(elId)
|
473
467
|
}
|
474
468
|
}
|
475
469
|
|
package/src/tree/List.mjs
CHANGED
@@ -76,7 +76,7 @@ class Tree extends Base {
|
|
76
76
|
|
77
77
|
if (value) {
|
78
78
|
if (me.sortable) {
|
79
|
-
console.error('tree.List can be either draggable or sortable, not both.', me.id)
|
79
|
+
console.error('tree.List can be either draggable or sortable, not both.', me.id)
|
80
80
|
} else if (!me.dragZone) {
|
81
81
|
import('../draggable/tree/DragZone.mjs').then(module => {
|
82
82
|
me.dragZone = Neo.create({
|
@@ -84,8 +84,8 @@ class Tree extends Base {
|
|
84
84
|
appName: me.appName,
|
85
85
|
owner : me,
|
86
86
|
...me.dragZoneConfig
|
87
|
-
})
|
88
|
-
})
|
87
|
+
})
|
88
|
+
})
|
89
89
|
}
|
90
90
|
}
|
91
91
|
}
|
@@ -101,7 +101,7 @@ class Tree extends Base {
|
|
101
101
|
|
102
102
|
if (value) {
|
103
103
|
if (me.draggable) {
|
104
|
-
console.error('tree.List can be either draggable or sortable, not both.', me.id)
|
104
|
+
console.error('tree.List can be either draggable or sortable, not both.', me.id)
|
105
105
|
} else if (!me.sortZone) {
|
106
106
|
import('../draggable/tree/SortZone.mjs').then(module => {
|
107
107
|
me.sortZone = Neo.create({
|
@@ -110,8 +110,8 @@ class Tree extends Base {
|
|
110
110
|
boundaryContainerId: me.id,
|
111
111
|
owner : me,
|
112
112
|
...me.sortZoneConfig
|
113
|
-
})
|
114
|
-
})
|
113
|
+
})
|
114
|
+
})
|
115
115
|
}
|
116
116
|
}
|
117
117
|
}
|
@@ -151,25 +151,24 @@ class Tree extends Base {
|
|
151
151
|
* Collapses all folders
|
152
152
|
* @param {Boolean} [silent]=false Set silent to true to prevent a vnode update
|
153
153
|
*/
|
154
|
-
collapseAll(silent
|
154
|
+
collapseAll(silent=false) {
|
155
155
|
let me = this,
|
156
|
-
vdom = me.vdom,
|
157
156
|
hasMatch = false,
|
158
157
|
node;
|
159
158
|
|
160
159
|
me.store.items.forEach(item => {
|
161
160
|
if (!item.isLeaf) {
|
162
|
-
node = me.getVdomChild(me.getItemId(item.id), vdom);
|
161
|
+
node = me.getVdomChild(me.getItemId(item.id), me.vdom);
|
163
162
|
|
164
163
|
if (node.cls.includes('neo-folder-open')) {
|
165
164
|
NeoArray.remove(node.cls, 'neo-folder-open');
|
166
|
-
hasMatch = true
|
165
|
+
hasMatch = true
|
167
166
|
}
|
168
167
|
}
|
169
168
|
});
|
170
169
|
|
171
170
|
if (hasMatch) {
|
172
|
-
|
171
|
+
!silent && me.update()
|
173
172
|
}
|
174
173
|
}
|
175
174
|
|
@@ -182,15 +181,14 @@ class Tree extends Base {
|
|
182
181
|
* @protected
|
183
182
|
*/
|
184
183
|
createItems(parentId, vdomRoot, level, hidden=false) {
|
185
|
-
let me
|
186
|
-
items
|
187
|
-
itemCls
|
188
|
-
folderCls = me.folderCls,
|
184
|
+
let me = this,
|
185
|
+
items = me.store.find('parentId', parentId),
|
186
|
+
{folderCls, itemCls} = me,
|
189
187
|
cls, itemVdom, tmpRoot;
|
190
188
|
|
191
189
|
if (items.length > 0) {
|
192
190
|
if (!vdomRoot.cn) {
|
193
|
-
vdomRoot.cn = []
|
191
|
+
vdomRoot.cn = []
|
194
192
|
}
|
195
193
|
|
196
194
|
if (parentId !== null) {
|
@@ -258,15 +256,14 @@ class Tree extends Base {
|
|
258
256
|
* Expands all folders
|
259
257
|
* @param {Boolean} silent=false Set silent to true to prevent a vnode update
|
260
258
|
*/
|
261
|
-
expandAll(silent
|
259
|
+
expandAll(silent=false) {
|
262
260
|
let me = this,
|
263
|
-
vdom = me.vdom,
|
264
261
|
hasMatch = false,
|
265
262
|
node;
|
266
263
|
|
267
264
|
me.store.items.forEach(item => {
|
268
265
|
if (!item.isLeaf) {
|
269
|
-
node = me.getVdomChild(me.getItemId(item.id), vdom);
|
266
|
+
node = me.getVdomChild(me.getItemId(item.id), me.vdom);
|
270
267
|
|
271
268
|
if (!node.cls.includes('neo-folder-open')) {
|
272
269
|
NeoArray.add(node.cls, 'neo-folder-open');
|
@@ -276,7 +273,7 @@ class Tree extends Base {
|
|
276
273
|
});
|
277
274
|
|
278
275
|
if (hasMatch) {
|
279
|
-
|
276
|
+
!silent && me.update()
|
280
277
|
}
|
281
278
|
}
|
282
279
|
|
@@ -380,11 +377,11 @@ class Tree extends Base {
|
|
380
377
|
* @param {Object} data
|
381
378
|
*/
|
382
379
|
onItemClick(node, data) {
|
383
|
-
let me
|
384
|
-
items = me.store
|
385
|
-
i
|
386
|
-
len
|
387
|
-
path
|
380
|
+
let me = this,
|
381
|
+
{items} = me.store,
|
382
|
+
i = 0,
|
383
|
+
len = items.length,
|
384
|
+
path = data.path.map(e => e.id),
|
388
385
|
item, record, tmpItem, vnodeId;
|
389
386
|
|
390
387
|
for (; i < len; i++) {
|
package/src/util/Array.mjs
CHANGED
@@ -21,7 +21,7 @@ class NeoArray extends Base {
|
|
21
21
|
*/
|
22
22
|
static add(arr, items) {
|
23
23
|
if (!Array.isArray(items)) {
|
24
|
-
items = [items]
|
24
|
+
items = [items]
|
25
25
|
}
|
26
26
|
|
27
27
|
items.forEach(item => {
|
@@ -29,7 +29,8 @@ class NeoArray extends Base {
|
|
29
29
|
arr.push(item);
|
30
30
|
}
|
31
31
|
});
|
32
|
-
|
32
|
+
|
33
|
+
return arr
|
33
34
|
}
|
34
35
|
|
35
36
|
/**
|
@@ -39,7 +40,7 @@ class NeoArray extends Base {
|
|
39
40
|
* @returns {Array}
|
40
41
|
*/
|
41
42
|
static difference(array1=[], array2=[]) {
|
42
|
-
return array1.filter(item => !array2.includes(item))
|
43
|
+
return array1.filter(item => !array2.includes(item))
|
43
44
|
}
|
44
45
|
|
45
46
|
/**
|
@@ -48,7 +49,7 @@ class NeoArray extends Base {
|
|
48
49
|
* @param {*} item
|
49
50
|
*/
|
50
51
|
static hasItem(arr, item) {
|
51
|
-
return arr.includes(item)
|
52
|
+
return arr.includes(item)
|
52
53
|
}
|
53
54
|
|
54
55
|
/**
|
@@ -59,7 +60,7 @@ class NeoArray extends Base {
|
|
59
60
|
* @returns {Array}
|
60
61
|
*/
|
61
62
|
static intersection(array1=[], array2=[]) {
|
62
|
-
return array1.filter(item => array2.includes(item))
|
63
|
+
return array1.filter(item => array2.includes(item))
|
63
64
|
}
|
64
65
|
|
65
66
|
/**
|
@@ -70,15 +71,15 @@ class NeoArray extends Base {
|
|
70
71
|
*/
|
71
72
|
static move(arr, fromIndex, toIndex) {
|
72
73
|
if (fromIndex === toIndex) {
|
73
|
-
return arr
|
74
|
+
return arr
|
74
75
|
}
|
75
76
|
|
76
77
|
if (fromIndex >= arr.length) {
|
77
|
-
fromIndex = arr.length - 1
|
78
|
+
fromIndex = arr.length - 1
|
78
79
|
}
|
79
80
|
|
80
81
|
arr.splice(toIndex, 0, arr.splice(fromIndex, 1)[0]);
|
81
|
-
return arr
|
82
|
+
return arr
|
82
83
|
}
|
83
84
|
|
84
85
|
/**
|
@@ -90,15 +91,16 @@ class NeoArray extends Base {
|
|
90
91
|
let index;
|
91
92
|
|
92
93
|
if (!Array.isArray(items)) {
|
93
|
-
items = [items]
|
94
|
+
items = [items]
|
94
95
|
}
|
95
96
|
|
96
97
|
items.forEach(item => {
|
97
98
|
index = arr.indexOf(item);
|
98
99
|
|
99
|
-
index > -1 && arr.splice(index, 1)
|
100
|
+
index > -1 && arr.splice(index, 1)
|
100
101
|
});
|
101
|
-
|
102
|
+
|
103
|
+
return arr
|
102
104
|
}
|
103
105
|
|
104
106
|
/**
|
@@ -110,7 +112,7 @@ class NeoArray extends Base {
|
|
110
112
|
*/
|
111
113
|
static removeAdd(arr, removeItems, addItems) {
|
112
114
|
this.remove(arr, removeItems);
|
113
|
-
return this.add(arr, addItems)
|
115
|
+
return this.add(arr, addItems)
|
114
116
|
}
|
115
117
|
|
116
118
|
/**
|
@@ -127,12 +129,10 @@ class NeoArray extends Base {
|
|
127
129
|
* Returns an array of items which are present in the passed arrays.
|
128
130
|
* Multiple arrays may be passed.
|
129
131
|
* Only supports primitive items
|
130
|
-
* @param {Array} array1
|
131
|
-
* @param {Array} array2
|
132
132
|
* @returns {Array}
|
133
133
|
*/
|
134
134
|
static union() {
|
135
|
-
return [...new Set(Array.prototype.concat(...arguments))]
|
135
|
+
return [...new Set(Array.prototype.concat(...arguments))]
|
136
136
|
}
|
137
137
|
|
138
138
|
/**
|
@@ -143,15 +143,16 @@ class NeoArray extends Base {
|
|
143
143
|
*/
|
144
144
|
static unshift(arr, items) {
|
145
145
|
if (!Array.isArray(items)) {
|
146
|
-
items = [items]
|
146
|
+
items = [items]
|
147
147
|
}
|
148
148
|
|
149
149
|
items.forEach(item => {
|
150
150
|
if (!arr.includes(item)) {
|
151
|
-
arr.unshift(item)
|
151
|
+
arr.unshift(item)
|
152
152
|
}
|
153
153
|
});
|
154
|
-
|
154
|
+
|
155
|
+
return arr
|
155
156
|
}
|
156
157
|
}
|
157
158
|
|
package/src/util/ClassSystem.mjs
CHANGED
@@ -24,24 +24,24 @@ class ClassSystem extends Base {
|
|
24
24
|
let isInstance = config instanceof Neo.core.Base;
|
25
25
|
|
26
26
|
if (Neo.isString(DefaultClass)) {
|
27
|
-
DefaultClass = Neo.ns(DefaultClass)
|
27
|
+
DefaultClass = Neo.ns(DefaultClass)
|
28
28
|
}
|
29
29
|
|
30
30
|
if (!config && DefaultClass) {
|
31
|
-
config = Neo.create(DefaultClass, defaultValues)
|
31
|
+
config = Neo.create(DefaultClass, defaultValues)
|
32
32
|
} else if (config?.isClass) {
|
33
|
-
config = Neo.create(config, defaultValues)
|
33
|
+
config = Neo.create(config, defaultValues)
|
34
34
|
} else if (Neo.isObject(config) && !isInstance) {
|
35
35
|
if (config.ntype) {
|
36
36
|
config = Neo.ntype({
|
37
37
|
...defaultValues,
|
38
38
|
...config
|
39
|
-
})
|
39
|
+
})
|
40
40
|
} else {
|
41
|
-
|
41
|
+
let newConfig = {};
|
42
42
|
|
43
43
|
if (DefaultClass) {
|
44
|
-
newConfig.module = DefaultClass
|
44
|
+
newConfig.module = DefaultClass
|
45
45
|
}
|
46
46
|
|
47
47
|
Object.assign(newConfig, {
|
@@ -49,15 +49,15 @@ class ClassSystem extends Base {
|
|
49
49
|
...config
|
50
50
|
});
|
51
51
|
|
52
|
-
config = Neo.create(newConfig)
|
52
|
+
config = Neo.create(newConfig)
|
53
53
|
}
|
54
54
|
} else if (isInstance) {
|
55
55
|
if (defaultValues?.listeners) {
|
56
|
-
config.on(defaultValues.listeners)
|
56
|
+
config.on(defaultValues.listeners)
|
57
57
|
}
|
58
58
|
}
|
59
59
|
|
60
|
-
return config
|
60
|
+
return config
|
61
61
|
}
|
62
62
|
}
|
63
63
|
|
package/src/util/Css.mjs
CHANGED
@@ -20,7 +20,7 @@ class Css extends Base {
|
|
20
20
|
*/
|
21
21
|
static deleteRules(appName, rules) {
|
22
22
|
if (!Array.isArray(rules)) {
|
23
|
-
rules = [rules]
|
23
|
+
rules = [rules]
|
24
24
|
}
|
25
25
|
|
26
26
|
Neo.main.addon.Stylesheet.deleteCssRules({appName, rules})
|
@@ -32,7 +32,7 @@ class Css extends Base {
|
|
32
32
|
*/
|
33
33
|
static insertRules(appName, rules) {
|
34
34
|
if (!Array.isArray(rules)) {
|
35
|
-
rules = [rules]
|
35
|
+
rules = [rules]
|
36
36
|
}
|
37
37
|
|
38
38
|
Neo.main.addon.Stylesheet.insertCssRules({appName, rules})
|