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/component/Base.mjs
CHANGED
@@ -52,8 +52,8 @@ class Base extends CoreBase {
|
|
52
52
|
* @member {Object|String} align_={edgeAlign:'t-b',constrainTo:'document.body'}
|
53
53
|
*/
|
54
54
|
align_: {
|
55
|
-
edgeAlign
|
56
|
-
constrainTo
|
55
|
+
edgeAlign : 't-b',
|
56
|
+
constrainTo: 'document.body'
|
57
57
|
},
|
58
58
|
/**
|
59
59
|
* The name of the App this component belongs to
|
@@ -288,6 +288,13 @@ class Base extends CoreBase {
|
|
288
288
|
* @protected
|
289
289
|
*/
|
290
290
|
reference_: null,
|
291
|
+
/**
|
292
|
+
* Make the view Responsive by adding alternative configs.
|
293
|
+
* The definition happens via responsiveCfg
|
294
|
+
* @member {Object} responsive=null
|
295
|
+
* @protected
|
296
|
+
*/
|
297
|
+
responsive_: null,
|
291
298
|
/**
|
292
299
|
* True in case the component is rendering the vnode
|
293
300
|
* @member {Boolean} rendering_=false
|
@@ -300,6 +307,13 @@ class Base extends CoreBase {
|
|
300
307
|
* @member {String|null} role_=null
|
301
308
|
*/
|
302
309
|
role_: null,
|
310
|
+
/**
|
311
|
+
* Set this to true for style 'overflow:auto'.
|
312
|
+
* Set this to 'x' or 'y' to add style 'overflow-x' or 'overflow-y' to 'auto'
|
313
|
+
* Other than false this will add cls 'neo-scrollable'.
|
314
|
+
* @member {Boolean|"x"|"y"} scrollable_=false
|
315
|
+
*/
|
316
|
+
scrollable_: false,
|
303
317
|
/**
|
304
318
|
* Set this to true for bulk updates. Ensure to set it back to false afterwards.
|
305
319
|
* Internally the value will get saved as a number to ensure that child methods won't stop the silent mode too early.
|
@@ -408,7 +422,7 @@ class Base extends CoreBase {
|
|
408
422
|
get parent() {
|
409
423
|
let me = this;
|
410
424
|
|
411
|
-
return me.parentComponent || me.parentId
|
425
|
+
return me.parentComponent || me.parentId === 'document.body' ? null : Neo.getComponent(me.parentId)
|
412
426
|
}
|
413
427
|
|
414
428
|
/**
|
@@ -694,8 +708,8 @@ class Base extends CoreBase {
|
|
694
708
|
*/
|
695
709
|
afterSetIsLoading(value, oldValue) {
|
696
710
|
if (!(value === false && oldValue === undefined)) {
|
697
|
-
let me
|
698
|
-
{
|
711
|
+
let me = this,
|
712
|
+
{cls, vdom} = me,
|
699
713
|
maskIndex;
|
700
714
|
|
701
715
|
if (oldValue !== undefined && vdom.cn) {
|
@@ -780,7 +794,8 @@ class Base extends CoreBase {
|
|
780
794
|
*/
|
781
795
|
afterSetMounted(value, oldValue) {
|
782
796
|
if (oldValue !== undefined) {
|
783
|
-
let me
|
797
|
+
let me = this,
|
798
|
+
{id, windowId} = me;
|
784
799
|
|
785
800
|
if (value) {
|
786
801
|
me.hasBeenMounted = true;
|
@@ -789,7 +804,7 @@ class Base extends CoreBase {
|
|
789
804
|
// todo: the main thread reply of mount arrives after pushing the task into the queue which does not ensure the dom is mounted
|
790
805
|
setTimeout(() => {
|
791
806
|
DomEventManager.mountDomListeners(me)
|
792
|
-
},
|
807
|
+
}, 150)
|
793
808
|
}
|
794
809
|
|
795
810
|
me.doResolveUpdateCache();
|
@@ -798,16 +813,12 @@ class Base extends CoreBase {
|
|
798
813
|
me.alignTo();
|
799
814
|
|
800
815
|
// Focus will be pushed into the first input field or other focusable item
|
801
|
-
Neo.main.DomAccess.focus({
|
802
|
-
id : this.id,
|
803
|
-
children : true
|
804
|
-
});
|
816
|
+
Neo.main.DomAccess.focus({id, children: true, windowId})
|
805
817
|
}
|
806
818
|
|
807
819
|
me.fire('mounted', me.id)
|
808
|
-
}
|
809
|
-
|
810
|
-
me.revertFocus();
|
820
|
+
} else {
|
821
|
+
me.revertFocus()
|
811
822
|
}
|
812
823
|
}
|
813
824
|
}
|
@@ -822,6 +833,28 @@ class Base extends CoreBase {
|
|
822
833
|
value && this.changeVdomRootKey('data-ref', value)
|
823
834
|
}
|
824
835
|
|
836
|
+
/**
|
837
|
+
* Triggered after the responsive config got changed
|
838
|
+
* @param {Object} value
|
839
|
+
* @param {Object} oldValue
|
840
|
+
* @protected
|
841
|
+
*/
|
842
|
+
async afterSetResponsive(value, oldValue) {
|
843
|
+
if (value && !this.getPlugin('responsive')) {
|
844
|
+
let me = this,
|
845
|
+
module = await import(`../../src/plugin/Responsive.mjs`),
|
846
|
+
plugins = me.plugins || [];
|
847
|
+
|
848
|
+
plugins.push({
|
849
|
+
module : module.default,
|
850
|
+
appName: me.appName,
|
851
|
+
value
|
852
|
+
});
|
853
|
+
|
854
|
+
me.plugins = plugins
|
855
|
+
}
|
856
|
+
}
|
857
|
+
|
825
858
|
/**
|
826
859
|
* Triggered after the role config got changed
|
827
860
|
* @param {String|null} value
|
@@ -832,6 +865,45 @@ class Base extends CoreBase {
|
|
832
865
|
this.changeVdomRootKey('role', value)
|
833
866
|
}
|
834
867
|
|
868
|
+
/**
|
869
|
+
* Triggered after the scrollable config got changed
|
870
|
+
* @param {String|Boolean} value
|
871
|
+
* @param {String|Boolean|null} oldValue
|
872
|
+
* @protected
|
873
|
+
*/
|
874
|
+
afterSetScrollable(value, oldValue) {
|
875
|
+
if (oldValue === undefined && !value) {
|
876
|
+
return
|
877
|
+
}
|
878
|
+
|
879
|
+
let me = this;
|
880
|
+
|
881
|
+
if (oldValue) {
|
882
|
+
let oldOverflowKey = 'overflow';
|
883
|
+
|
884
|
+
if (!Neo.isBoolean(oldValue)) {
|
885
|
+
oldOverflowKey += Neo.capitalize(oldValue)
|
886
|
+
}
|
887
|
+
|
888
|
+
me.removeStyle([oldOverflowKey])
|
889
|
+
}
|
890
|
+
|
891
|
+
if (!Neo.isEmpty(value)) {
|
892
|
+
let overflowKey = 'overflow';
|
893
|
+
|
894
|
+
if (value && !Neo.isBoolean(value)) {
|
895
|
+
overflowKey += Neo.capitalize(value)
|
896
|
+
}
|
897
|
+
|
898
|
+
if (value) {
|
899
|
+
me.addStyle(overflowKey + ':auto');
|
900
|
+
me.addCls('neo-scrollable')
|
901
|
+
} else {
|
902
|
+
me.removeCls('neo-scrollable')
|
903
|
+
}
|
904
|
+
}
|
905
|
+
}
|
906
|
+
|
835
907
|
/**
|
836
908
|
* Triggered after the style config got changed
|
837
909
|
* @param {Object} value
|
@@ -1022,18 +1094,18 @@ class Base extends CoreBase {
|
|
1022
1094
|
align = {
|
1023
1095
|
...me.align,
|
1024
1096
|
...spec,
|
1025
|
-
id
|
1026
|
-
configuredFlex
|
1027
|
-
configuredWidth
|
1028
|
-
configuredHeight
|
1029
|
-
configuredMinWidth
|
1030
|
-
configuredMinHeight
|
1031
|
-
configuredMaxWidth
|
1032
|
-
configuredMaxHeight
|
1097
|
+
id : me.id,
|
1098
|
+
configuredFlex : me.configuredFlex,
|
1099
|
+
configuredWidth : me.configuredWidth,
|
1100
|
+
configuredHeight : me.configuredHeight,
|
1101
|
+
configuredMinWidth : me.configuredMinWidth,
|
1102
|
+
configuredMinHeight: me.configuredMinHeight,
|
1103
|
+
configuredMaxWidth : me.configuredMaxWidth,
|
1104
|
+
configuredMaxHeight: me.configuredMaxHeight
|
1033
1105
|
};
|
1034
1106
|
|
1035
1107
|
if (align.target) {
|
1036
|
-
await Neo.main.DomAccess.align(align)
|
1108
|
+
await Neo.main.DomAccess.align(align)
|
1037
1109
|
}
|
1038
1110
|
}
|
1039
1111
|
|
@@ -1057,15 +1129,6 @@ class Base extends CoreBase {
|
|
1057
1129
|
return this.getModel().getHierarchyData()
|
1058
1130
|
}
|
1059
1131
|
|
1060
|
-
/**
|
1061
|
-
* Triggered when accessing the parentComponent config
|
1062
|
-
* @param {Object} value
|
1063
|
-
* @protected
|
1064
|
-
*/
|
1065
|
-
beforeParentComponent(value) {
|
1066
|
-
return value || this.parent
|
1067
|
-
}
|
1068
|
-
|
1069
1132
|
/**
|
1070
1133
|
* Triggered when accessing the style config
|
1071
1134
|
* @param {Object} value
|
@@ -1081,7 +1144,7 @@ class Base extends CoreBase {
|
|
1081
1144
|
* @protected
|
1082
1145
|
*/
|
1083
1146
|
beforeGetWrapperCls(value) {
|
1084
|
-
return value ? [...value]: []
|
1147
|
+
return value ? [...value] : []
|
1085
1148
|
}
|
1086
1149
|
|
1087
1150
|
/**
|
@@ -1168,7 +1231,7 @@ class Base extends CoreBase {
|
|
1168
1231
|
* @returns {String}
|
1169
1232
|
* @protected
|
1170
1233
|
*/
|
1171
|
-
|
1234
|
+
beforeSetHideMode(value, oldValue) {
|
1172
1235
|
return this.beforeSetEnumValue(value, oldValue, 'hideMode')
|
1173
1236
|
}
|
1174
1237
|
|
@@ -1185,8 +1248,8 @@ class Base extends CoreBase {
|
|
1185
1248
|
|
1186
1249
|
if (value) {
|
1187
1250
|
value = ClassSystemUtil.beforeSetInstance(value, KeyNavigation, {
|
1188
|
-
keyDownEventBubble
|
1189
|
-
keys: value
|
1251
|
+
keyDownEventBubble: true,
|
1252
|
+
keys : value
|
1190
1253
|
})
|
1191
1254
|
}
|
1192
1255
|
|
@@ -1306,10 +1369,9 @@ class Base extends CoreBase {
|
|
1306
1369
|
* todo: unregister events
|
1307
1370
|
*/
|
1308
1371
|
destroy(updateParentVdom=false, silent=false) {
|
1309
|
-
let me
|
1310
|
-
parentId
|
1311
|
-
|
1312
|
-
parentModel = parent?.getModel(),
|
1372
|
+
let me = this,
|
1373
|
+
{parent, parentId} = me,
|
1374
|
+
parentModel = parent?.getModel(),
|
1313
1375
|
parentVdom;
|
1314
1376
|
|
1315
1377
|
me.revertFocus();
|
@@ -1426,7 +1488,8 @@ class Base extends CoreBase {
|
|
1426
1488
|
*/
|
1427
1489
|
focus(id=this.id) {
|
1428
1490
|
Neo.main.DomAccess.focus({
|
1429
|
-
id
|
1491
|
+
id,
|
1492
|
+
windowId: this.id
|
1430
1493
|
}).catch(err => {
|
1431
1494
|
console.log('Error attempting to receive focus for component', err, this)
|
1432
1495
|
})
|
@@ -1447,7 +1510,7 @@ class Base extends CoreBase {
|
|
1447
1510
|
}
|
1448
1511
|
|
1449
1512
|
/**
|
1450
|
-
* Find an instance stored inside a config via optionally passing
|
1513
|
+
* Find an instance stored inside a config via optionally passing a ntype.
|
1451
1514
|
* Returns this[configName] or the closest parent component with a match.
|
1452
1515
|
* Used by getController() & getModel()
|
1453
1516
|
* @param {String} configName
|
@@ -1455,9 +1518,9 @@ class Base extends CoreBase {
|
|
1455
1518
|
* @returns {Neo.core.Base|null}
|
1456
1519
|
*/
|
1457
1520
|
getConfigInstanceByNtype(configName, ntype) {
|
1458
|
-
let me
|
1459
|
-
config
|
1460
|
-
parentComponent = me
|
1521
|
+
let me = this,
|
1522
|
+
config = me[configName],
|
1523
|
+
{parentComponent} = me;
|
1461
1524
|
|
1462
1525
|
if (config && (!ntype || ntype === config.ntype)) {
|
1463
1526
|
return config
|
@@ -1490,7 +1553,7 @@ class Base extends CoreBase {
|
|
1490
1553
|
* @returns {Promise<Neo.util.Rectangle>}
|
1491
1554
|
*/
|
1492
1555
|
async getDomRect(id=this.id, appName=this.appName) {
|
1493
|
-
const result = await Neo.main.DomAccess.getBoundingClientRect({appName, id});
|
1556
|
+
const result = await Neo.main.DomAccess.getBoundingClientRect({appName, id, windowId: this.windowId});
|
1494
1557
|
|
1495
1558
|
if (Array.isArray(result)) {
|
1496
1559
|
return result.map(rect => Rectangle.clone(rect))
|
@@ -1562,7 +1625,13 @@ class Base extends CoreBase {
|
|
1562
1625
|
* @returns {Neo.plugin.Base|null}
|
1563
1626
|
*/
|
1564
1627
|
getPlugin(opts) {
|
1565
|
-
|
1628
|
+
if (Neo.isString(opts)) {
|
1629
|
+
if (!opts.startsWith('plugin-')) {
|
1630
|
+
opts = 'plugin-' + opts
|
1631
|
+
}
|
1632
|
+
|
1633
|
+
opts = {ntype: opts}
|
1634
|
+
}
|
1566
1635
|
|
1567
1636
|
let me = this,
|
1568
1637
|
hasMatch;
|
@@ -1666,8 +1735,8 @@ class Base extends CoreBase {
|
|
1666
1735
|
let me = this;
|
1667
1736
|
|
1668
1737
|
if (me.hideMode !== 'visibility') {
|
1669
|
-
let removeFn = function() {
|
1670
|
-
if(me.parentId !== 'document.body') {
|
1738
|
+
let removeFn = function () {
|
1739
|
+
if (me.parentId !== 'document.body') {
|
1671
1740
|
me.vdom.removeDom = true;
|
1672
1741
|
me.parent.update()
|
1673
1742
|
} else {
|
@@ -1735,7 +1804,7 @@ class Base extends CoreBase {
|
|
1735
1804
|
resolve && me.resolveUpdateCache.push(resolve)
|
1736
1805
|
return true
|
1737
1806
|
} else {
|
1738
|
-
return me.isParentVdomUpdating(parent.parentId)
|
1807
|
+
return me.isParentVdomUpdating(parent.parentId, resolve)
|
1739
1808
|
}
|
1740
1809
|
}
|
1741
1810
|
}
|
@@ -1750,13 +1819,12 @@ class Base extends CoreBase {
|
|
1750
1819
|
async measure(value) {
|
1751
1820
|
if (value != null) {
|
1752
1821
|
if (value.endsWith('px')) {
|
1753
|
-
value = parseFloat(value)
|
1754
|
-
}
|
1755
|
-
|
1756
|
-
value = await Neo.main.DomAccess.measure({ value,
|
1757
|
-
}
|
1758
|
-
|
1759
|
-
value = parseFloat(value);
|
1822
|
+
value = parseFloat(value)
|
1823
|
+
} else if (lengthRE.test(value)) {
|
1824
|
+
let {id, windowId} = this;
|
1825
|
+
value = await Neo.main.DomAccess.measure({id, value, windowId})
|
1826
|
+
} else if (!isNaN(value)) {
|
1827
|
+
value = parseFloat(value)
|
1760
1828
|
}
|
1761
1829
|
}
|
1762
1830
|
|
@@ -1783,7 +1851,7 @@ class Base extends CoreBase {
|
|
1783
1851
|
|
1784
1852
|
if (config.style) {
|
1785
1853
|
// If we are passed an object, merge it with the class's own style
|
1786
|
-
me.style = Neo.typeOf(config.style) === 'Object' ? {
|
1854
|
+
me.style = Neo.typeOf(config.style) === 'Object' ? {...config.style, ...me.constructor.config.style} : config.style
|
1787
1855
|
}
|
1788
1856
|
|
1789
1857
|
me.wrapperStyle = Neo.clone(config.wrapperStyle, false);
|
@@ -1924,8 +1992,8 @@ class Base extends CoreBase {
|
|
1924
1992
|
* @protected
|
1925
1993
|
*/
|
1926
1994
|
onRender(data, autoMount) {
|
1927
|
-
let me
|
1928
|
-
app = me
|
1995
|
+
let me = this,
|
1996
|
+
{app} = me;
|
1929
1997
|
|
1930
1998
|
me.rendering = false;
|
1931
1999
|
|
@@ -1933,15 +2001,15 @@ class Base extends CoreBase {
|
|
1933
2001
|
if (app) {
|
1934
2002
|
if (!app.rendered) {
|
1935
2003
|
app.rendering = false;
|
1936
|
-
app.rendered
|
2004
|
+
app.rendered = true;
|
1937
2005
|
app.fire('render')
|
1938
2006
|
}
|
1939
2007
|
|
1940
2008
|
me.vnode = data;
|
1941
2009
|
|
1942
|
-
let childIds
|
1943
|
-
i
|
1944
|
-
len
|
2010
|
+
let childIds = ComponentManager.getChildIds(data),
|
2011
|
+
i = 0,
|
2012
|
+
len = childIds.length,
|
1945
2013
|
child;
|
1946
2014
|
|
1947
2015
|
for (; i < len; i++) {
|
@@ -1974,7 +2042,7 @@ class Base extends CoreBase {
|
|
1974
2042
|
* @param {Neo.vdom.VNode} vnode= this.vnode
|
1975
2043
|
* @returns {Promise<any>}
|
1976
2044
|
*/
|
1977
|
-
promiseUpdate(vdom=this.vdom, vnode=this.vnode) {
|
2045
|
+
promiseUpdate(vdom = this.vdom, vnode = this.vnode) {
|
1978
2046
|
return new Promise((resolve, reject) => {
|
1979
2047
|
this.updateVdom(vdom, vnode, resolve, reject)
|
1980
2048
|
})
|
@@ -1999,8 +2067,8 @@ class Base extends CoreBase {
|
|
1999
2067
|
value = [value];
|
2000
2068
|
}
|
2001
2069
|
|
2002
|
-
let me
|
2003
|
-
domListeners = me
|
2070
|
+
let me = this,
|
2071
|
+
{domListeners} = me,
|
2004
2072
|
i, len;
|
2005
2073
|
|
2006
2074
|
value.forEach(item => {
|
@@ -2024,14 +2092,14 @@ class Base extends CoreBase {
|
|
2024
2092
|
* @returns {Object} all styles of this.el
|
2025
2093
|
*/
|
2026
2094
|
removeStyle(value) {
|
2027
|
-
if (
|
2028
|
-
value = [value]
|
2095
|
+
if (!Array.isArray(value)) {
|
2096
|
+
value = [value]
|
2029
2097
|
}
|
2030
2098
|
|
2031
|
-
let style
|
2099
|
+
let {style} = this,
|
2032
2100
|
doUpdate = false;
|
2033
2101
|
|
2034
|
-
Object.
|
2102
|
+
Object.keys(style).forEach(key => {
|
2035
2103
|
if (value.indexOf(key) > -1) {
|
2036
2104
|
delete style[key];
|
2037
2105
|
doUpdate = true
|
@@ -2157,7 +2225,7 @@ class Base extends CoreBase {
|
|
2157
2225
|
* Convenience shortcut calling set() with the silent flag
|
2158
2226
|
* @param {Object} values={}
|
2159
2227
|
*/
|
2160
|
-
setSilent(values={}) {
|
2228
|
+
setSilent(values = {}) {
|
2161
2229
|
return this.set(values, true)
|
2162
2230
|
}
|
2163
2231
|
|
@@ -2174,7 +2242,7 @@ class Base extends CoreBase {
|
|
2174
2242
|
|
2175
2243
|
if (me.silentVdomUpdate) {
|
2176
2244
|
me.needsVdomUpdate = true
|
2177
|
-
} else if(me.parentId !== 'document.body') {
|
2245
|
+
} else if (me.parentId !== 'document.body') {
|
2178
2246
|
me.parent.update()
|
2179
2247
|
} else {
|
2180
2248
|
!me.mounted && me.render(true)
|
@@ -2194,7 +2262,7 @@ class Base extends CoreBase {
|
|
2194
2262
|
* @param {Object} [vdom=this.vdom]
|
2195
2263
|
* @param {Boolean} force=false
|
2196
2264
|
*/
|
2197
|
-
syncVdomIds(vnode=this.vnode, vdom=this.vdom, force=false) {
|
2265
|
+
syncVdomIds(vnode = this.vnode, vdom = this.vdom, force = false) {
|
2198
2266
|
VDomUtil.syncVdomIds(vnode, vdom, force)
|
2199
2267
|
}
|
2200
2268
|
|
@@ -2250,19 +2318,14 @@ class Base extends CoreBase {
|
|
2250
2318
|
else if (index === 0 && me.vnode.outerHTML) {
|
2251
2319
|
// console.log('dyn item', me.vnode, me.parentIndex);
|
2252
2320
|
component.vnode.childNodes.splice(me.parentIndex || 0, 0, me.vnode)
|
2253
|
-
}
|
2254
|
-
|
2255
|
-
else if (!VNodeUtil.replaceChildVnode(component.vnode, me.vnode.id, me.vnode)) {
|
2321
|
+
} else if (!VNodeUtil.replaceChildVnode(component.vnode, me.vnode.id, me.vnode)) {
|
2256
2322
|
// todo: can happen for dynamically inserted container items
|
2257
2323
|
// console.warn('syncVnodeTree: Could not replace the parent vnode for', me.vnode.id, component);
|
2258
2324
|
}
|
2259
2325
|
}
|
2260
2326
|
});
|
2261
2327
|
|
2262
|
-
|
2263
|
-
let end = performance.now();
|
2264
|
-
console.log('syncVnodeTree', me.id, end - start)
|
2265
|
-
}
|
2328
|
+
debug && console.log('syncVnodeTree', me.id, performance.now() - start)
|
2266
2329
|
}
|
2267
2330
|
|
2268
2331
|
/**
|
@@ -2316,7 +2379,7 @@ class Base extends CoreBase {
|
|
2316
2379
|
*/
|
2317
2380
|
updateCls(cls, oldCls, id=this.id) {
|
2318
2381
|
let me = this,
|
2319
|
-
vnode
|
2382
|
+
{vnode} = me,
|
2320
2383
|
vnodeTarget = vnode && VNodeUtil.findChildVnode(me.vnode, {id})?.vnode;
|
2321
2384
|
|
2322
2385
|
if (vnode && !Neo.isEqual(cls, oldCls)) {
|
@@ -2396,9 +2459,8 @@ class Base extends CoreBase {
|
|
2396
2459
|
* @protected
|
2397
2460
|
*/
|
2398
2461
|
updateVdom(vdom=this.vdom, vnode=this.vnode, resolve, reject) {
|
2399
|
-
let me
|
2400
|
-
app
|
2401
|
-
mounted = me.mounted,
|
2462
|
+
let me = this,
|
2463
|
+
{app, mounted, parentId} = me,
|
2402
2464
|
listenerId;
|
2403
2465
|
|
2404
2466
|
// It is important to keep the vdom tree stable to ensure that containers do not lose the references to their
|
@@ -2437,8 +2499,8 @@ class Base extends CoreBase {
|
|
2437
2499
|
}
|
2438
2500
|
|
2439
2501
|
if (
|
2440
|
-
!me.needsParentUpdate(
|
2441
|
-
&& !me.isParentVdomUpdating(
|
2502
|
+
!me.needsParentUpdate(parentId, resolve)
|
2503
|
+
&& !me.isParentVdomUpdating(parentId, resolve)
|
2442
2504
|
&& mounted
|
2443
2505
|
&& vnode
|
2444
2506
|
) {
|
package/src/component/Canvas.mjs
CHANGED
@@ -42,10 +42,10 @@ class Canvas extends Component {
|
|
42
42
|
afterSetMounted(value, oldValue) {
|
43
43
|
super.afterSetMounted(value, oldValue);
|
44
44
|
|
45
|
-
let me
|
46
|
-
id
|
47
|
-
offscreen = me
|
48
|
-
worker
|
45
|
+
let me = this,
|
46
|
+
id = me.getCanvasId(),
|
47
|
+
{offscreen} = me,
|
48
|
+
worker = Neo.currentWorker;
|
49
49
|
|
50
50
|
if (value && offscreen) {
|
51
51
|
worker.promiseMessage('main', {
|
@@ -58,11 +58,11 @@ class Canvas extends Component {
|
|
58
58
|
node : data.offscreen,
|
59
59
|
nodeId: id
|
60
60
|
}, [data.offscreen]).then(() => {
|
61
|
-
me.offscreenRegistered = true
|
62
|
-
})
|
63
|
-
})
|
61
|
+
me.offscreenRegistered = true
|
62
|
+
})
|
63
|
+
})
|
64
64
|
} else if (offscreen) {
|
65
|
-
me.offscreenRegistered = false
|
65
|
+
me.offscreenRegistered = false
|
66
66
|
}
|
67
67
|
}
|
68
68
|
|
@@ -71,7 +71,7 @@ class Canvas extends Component {
|
|
71
71
|
* @returns {String}
|
72
72
|
*/
|
73
73
|
getCanvasId() {
|
74
|
-
return this.id
|
74
|
+
return this.id
|
75
75
|
}
|
76
76
|
}
|
77
77
|
|