neo.mjs 10.0.0-alpha.5 → 10.0.0-beta.2
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/ServiceWorker.mjs +2 -2
- package/apps/colors/view/GridContainer.mjs +1 -1
- package/apps/covid/view/AttributionComponent.mjs +1 -1
- package/apps/covid/view/HeaderContainer.mjs +6 -6
- package/apps/covid/view/MainContainerController.mjs +5 -5
- package/apps/covid/view/TableContainerController.mjs +1 -1
- package/apps/covid/view/country/Gallery.mjs +13 -13
- package/apps/covid/view/country/Helix.mjs +13 -13
- package/apps/covid/view/country/HistoricalDataTable.mjs +1 -1
- package/apps/email/view/Viewport.mjs +2 -2
- package/apps/form/view/SideNavList.mjs +1 -1
- package/apps/portal/index.html +1 -1
- package/apps/portal/resources/data/examples_devmode.json +26 -27
- package/apps/portal/resources/data/examples_dist_dev.json +26 -27
- package/apps/portal/resources/data/examples_dist_esm.json +25 -26
- package/apps/portal/resources/data/examples_dist_prod.json +26 -27
- package/apps/portal/view/HeaderToolbar.mjs +3 -3
- package/apps/portal/view/about/Container.mjs +2 -2
- package/apps/portal/view/about/MemberContainer.mjs +3 -3
- package/apps/portal/view/blog/List.mjs +7 -7
- package/apps/portal/view/examples/List.mjs +4 -4
- package/apps/portal/view/home/ContentBox.mjs +2 -2
- package/apps/portal/view/home/FeatureSection.mjs +3 -3
- package/apps/portal/view/home/FooterContainer.mjs +7 -7
- package/apps/portal/view/home/parts/AfterMath.mjs +3 -3
- package/apps/portal/view/home/parts/MainNeo.mjs +3 -3
- package/apps/portal/view/home/parts/References.mjs +6 -6
- package/apps/portal/view/learn/ContentComponent.mjs +102 -111
- package/apps/portal/view/learn/PageSectionsContainer.mjs +1 -1
- package/apps/portal/view/learn/PageSectionsList.mjs +2 -2
- package/apps/portal/view/services/Component.mjs +16 -16
- package/apps/realworld/view/FooterComponent.mjs +1 -1
- package/apps/realworld/view/HeaderComponent.mjs +8 -8
- package/apps/realworld/view/HomeComponent.mjs +6 -6
- package/apps/realworld/view/article/CommentComponent.mjs +4 -4
- package/apps/realworld/view/article/Component.mjs +14 -14
- package/apps/realworld/view/article/CreateCommentComponent.mjs +3 -3
- package/apps/realworld/view/article/CreateComponent.mjs +3 -3
- package/apps/realworld/view/article/PreviewComponent.mjs +1 -1
- package/apps/realworld/view/article/TagListComponent.mjs +2 -2
- package/apps/realworld/view/user/ProfileComponent.mjs +8 -8
- package/apps/realworld/view/user/SettingsComponent.mjs +4 -4
- package/apps/realworld/view/user/SignUpComponent.mjs +4 -4
- package/apps/realworld2/view/FooterComponent.mjs +1 -1
- package/apps/realworld2/view/HomeContainer.mjs +3 -3
- package/apps/realworld2/view/article/DetailsContainer.mjs +1 -1
- package/apps/realworld2/view/article/PreviewComponent.mjs +7 -7
- package/apps/realworld2/view/article/TagListComponent.mjs +2 -2
- package/apps/realworld2/view/user/ProfileContainer.mjs +1 -1
- package/apps/route/view/center/CardAdministration.mjs +2 -2
- package/apps/route/view/center/CardAdministrationDenied.mjs +1 -1
- package/apps/route/view/center/CardContact.mjs +2 -2
- package/apps/route/view/center/CardHome.mjs +1 -1
- package/apps/route/view/center/CardSection1.mjs +1 -1
- package/apps/route/view/center/CardSection2.mjs +1 -1
- package/apps/sharedcovid/view/AttributionComponent.mjs +1 -1
- package/apps/sharedcovid/view/HeaderContainer.mjs +6 -6
- package/apps/sharedcovid/view/MainContainerController.mjs +5 -5
- package/apps/sharedcovid/view/TableContainerController.mjs +1 -1
- package/apps/sharedcovid/view/country/Gallery.mjs +13 -13
- package/apps/sharedcovid/view/country/Helix.mjs +13 -13
- package/apps/sharedcovid/view/country/HistoricalDataTable.mjs +1 -1
- package/apps/shareddialog/childapps/shareddialog2/view/MainContainer.mjs +1 -1
- package/apps/shareddialog/view/MainContainer.mjs +1 -1
- package/buildScripts/createApp.mjs +2 -2
- package/examples/table/cellEditing/MainContainer.mjs +1 -1
- package/examples/table/container/MainContainer.mjs +3 -3
- package/examples/table/nestedRecordFields/Viewport.mjs +6 -6
- package/examples/tableFiltering/MainContainer.mjs +1 -1
- package/examples/tablePerformance/MainContainer.mjs +1 -1
- package/examples/tablePerformance/MainContainer2.mjs +1 -1
- package/examples/tablePerformance/MainContainer3.mjs +2 -2
- package/examples/tableStore/MainContainer.mjs +2 -2
- package/learn/Glossary.md +261 -0
- package/learn/UsingTheseTopics.md +2 -2
- package/learn/benefits/ConfigSystem.md +538 -28
- package/learn/benefits/Effort.md +47 -2
- package/learn/benefits/Features.md +50 -32
- package/learn/benefits/FormsEngine.md +68 -38
- package/learn/benefits/MultiWindow.md +33 -7
- package/learn/benefits/OffTheMainThread.md +2 -2
- package/learn/benefits/Quick.md +45 -12
- package/learn/benefits/RPCLayer.md +75 -0
- package/learn/benefits/Speed.md +16 -11
- package/learn/gettingstarted/ComponentModels.md +4 -4
- package/learn/gettingstarted/Config.md +6 -6
- package/learn/gettingstarted/DescribingTheUI.md +4 -4
- package/learn/gettingstarted/Events.md +6 -6
- package/learn/gettingstarted/Extending.md +4 -4
- package/learn/gettingstarted/References.md +6 -6
- package/learn/gettingstarted/Workspaces.md +6 -6
- package/learn/guides/ApplicationBootstrap.md +26 -26
- package/learn/guides/ComponentsAndContainers.md +12 -12
- package/learn/guides/ConfigSystemDeepDive.md +280 -0
- package/learn/guides/CustomComponents.md +2 -2
- package/learn/guides/DeclarativeComponentTreesVsImperativeVdom.md +17 -17
- package/learn/guides/InstanceLifecycle.md +295 -1
- package/learn/guides/MainThreadAddons.md +475 -0
- package/learn/guides/PortalApp.md +2 -2
- package/learn/guides/StateProviders.md +12 -12
- package/learn/guides/WorkingWithVDom.md +14 -14
- package/learn/guides/events/CustomEvents.md +16 -16
- package/learn/guides/events/DomEvents.md +12 -12
- package/learn/javascript/ClassFeatures.md +3 -2
- package/learn/javascript/Classes.md +8 -8
- package/learn/javascript/NewNode.md +4 -4
- package/learn/javascript/Overrides.md +8 -8
- package/learn/javascript/Super.md +10 -8
- package/learn/tree.json +52 -51
- package/learn/tutorials/Earthquakes.md +54 -57
- package/learn/tutorials/TodoList.md +4 -4
- package/package.json +2 -2
- package/resources/scss/src/apps/portal/learn/ContentComponent.scss +12 -0
- package/resources/scss/src/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/src/table/plugin/CellEditing.scss +1 -1
- package/resources/scss/theme-dark/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-light/table/{View.scss → Body.scss} +1 -1
- package/resources/scss/theme-neo-light/Global.scss +1 -2
- package/resources/scss/theme-neo-light/table/{View.scss → Body.scss} +1 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/Main.mjs +8 -7
- package/src/Neo.mjs +16 -2
- package/src/button/Base.mjs +2 -2
- package/src/calendar/view/SettingsContainer.mjs +2 -2
- package/src/calendar/view/YearComponent.mjs +9 -9
- package/src/calendar/view/calendars/ColorsList.mjs +1 -1
- package/src/calendar/view/calendars/List.mjs +1 -1
- package/src/calendar/view/month/Component.mjs +15 -15
- package/src/calendar/view/week/Component.mjs +12 -12
- package/src/calendar/view/week/EventDragZone.mjs +4 -4
- package/src/calendar/view/week/TimeAxisComponent.mjs +3 -3
- package/src/component/Base.mjs +17 -2
- package/src/component/Carousel.mjs +2 -2
- package/src/component/Chip.mjs +3 -3
- package/src/component/Circle.mjs +2 -2
- package/src/component/DateSelector.mjs +8 -8
- package/src/component/Helix.mjs +1 -1
- package/src/component/Label.mjs +3 -18
- package/src/component/Legend.mjs +3 -3
- package/src/component/MagicMoveText.mjs +6 -14
- package/src/component/Process.mjs +3 -3
- package/src/component/Progress.mjs +1 -1
- package/src/component/StatusBadge.mjs +2 -2
- package/src/component/Timer.mjs +2 -2
- package/src/component/Toast.mjs +5 -3
- package/src/container/AccordionItem.mjs +2 -2
- package/src/container/Base.mjs +1 -1
- package/src/core/Base.mjs +77 -14
- package/src/core/Util.mjs +14 -2
- package/src/date/DayViewComponent.mjs +2 -2
- package/src/date/SelectorContainer.mjs +1 -1
- package/src/draggable/grid/header/toolbar/SortZone.mjs +21 -21
- package/src/draggable/table/header/toolbar/SortZone.mjs +1 -1
- package/src/form/field/CheckBox.mjs +4 -4
- package/src/form/field/FileUpload.mjs +25 -39
- package/src/form/field/Range.mjs +1 -1
- package/src/form/field/Text.mjs +3 -3
- package/src/form/field/TextArea.mjs +2 -3
- package/src/grid/Body.mjs +8 -5
- package/src/grid/_export.mjs +1 -1
- package/src/list/Color.mjs +2 -2
- package/src/main/DeltaUpdates.mjs +157 -98
- package/src/main/addon/AmCharts.mjs +61 -84
- package/src/main/addon/Base.mjs +161 -42
- package/src/main/addon/GoogleMaps.mjs +9 -16
- package/src/main/addon/HighlightJS.mjs +2 -13
- package/src/main/addon/IntersectionObserver.mjs +21 -21
- package/src/main/addon/MonacoEditor.mjs +32 -64
- package/src/manager/ClassHierarchy.mjs +114 -0
- package/src/menu/List.mjs +1 -1
- package/src/plugin/Popover.mjs +2 -2
- package/src/sitemap/Component.mjs +1 -1
- package/src/table/{View.mjs → Body.mjs} +25 -22
- package/src/table/Container.mjs +43 -43
- package/src/table/_export.mjs +2 -2
- package/src/table/plugin/CellEditing.mjs +19 -19
- package/src/tooltip/Base.mjs +1 -6
- package/src/tree/Accordion.mjs +3 -3
- package/src/vdom/Helper.mjs +19 -22
- package/src/worker/App.mjs +1 -2
- package/src/worker/Base.mjs +7 -5
- package/src/worker/Canvas.mjs +2 -3
- package/src/worker/Data.mjs +5 -7
- package/src/worker/Task.mjs +2 -3
- package/src/worker/VDom.mjs +3 -4
- package/src/worker/mixin/RemoteMethodAccess.mjs +5 -2
- package/learn/guides/MainThreadAddonExample.md +0 -15
- package/learn/guides/MainThreadAddonIntro.md +0 -44
@@ -16,6 +16,20 @@ class MonacoEditor extends Base {
|
|
16
16
|
* @protected
|
17
17
|
*/
|
18
18
|
className: 'Neo.main.addon.MonacoEditor',
|
19
|
+
/**
|
20
|
+
* List methods which must get cached until the addon reaches its `isReady` state
|
21
|
+
* @member {String[]} interceptRemotes
|
22
|
+
*/
|
23
|
+
interceptRemotes: [
|
24
|
+
'createInstance',
|
25
|
+
'destroyInstance',
|
26
|
+
'getValue',
|
27
|
+
'layoutEditor',
|
28
|
+
'setLanguage',
|
29
|
+
'setTheme',
|
30
|
+
'setValue',
|
31
|
+
'updateOptions'
|
32
|
+
],
|
19
33
|
/**
|
20
34
|
* @member {String} libraryBasePath='../../node_modules/monaco-editor/min/vs'
|
21
35
|
*/
|
@@ -53,23 +67,18 @@ class MonacoEditor extends Base {
|
|
53
67
|
createInstance(data) {
|
54
68
|
let me = this,
|
55
69
|
{id} = data,
|
56
|
-
|
57
|
-
|
58
|
-
if (!me.isReady) {
|
59
|
-
return me.cacheMethodCall({fn: 'createInstance', data})
|
60
|
-
} else {
|
61
|
-
delete data.appName;
|
62
|
-
delete data.id;
|
70
|
+
node = DomAccess.getElement(id),
|
71
|
+
editor;
|
63
72
|
|
64
|
-
|
73
|
+
delete data.appName;
|
74
|
+
delete data.id;
|
65
75
|
|
66
|
-
|
67
|
-
|
76
|
+
if (node) {
|
77
|
+
editor = me.map[id] = monaco.editor.create(node, data);
|
68
78
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
}
|
79
|
+
editor.getModel().onDidChangeContent(me.onContentChange.bind(me, id))
|
80
|
+
} else if (Neo.config.environment === 'development') {
|
81
|
+
console.warn(`addon.MonacoEditor: node ${id} not found`)
|
73
82
|
}
|
74
83
|
}
|
75
84
|
|
@@ -78,14 +87,8 @@ class MonacoEditor extends Base {
|
|
78
87
|
* @param {String} data.id
|
79
88
|
*/
|
80
89
|
destroyInstance(data) {
|
81
|
-
|
82
|
-
|
83
|
-
if (!me.isReady) {
|
84
|
-
return me.cacheMethodCall({fn: 'destroyInstance', data})
|
85
|
-
} else {
|
86
|
-
// todo: destroy the editor instance if possible
|
87
|
-
delete this.map[data.id]
|
88
|
-
}
|
90
|
+
// todo: destroy the editor instance if possible
|
91
|
+
delete this.map[data.id]
|
89
92
|
}
|
90
93
|
|
91
94
|
/**
|
@@ -94,13 +97,7 @@ class MonacoEditor extends Base {
|
|
94
97
|
* @returns {Object}
|
95
98
|
*/
|
96
99
|
getValue(data) {
|
97
|
-
|
98
|
-
|
99
|
-
if (!me.isReady) {
|
100
|
-
return me.cacheMethodCall({fn: 'getValue', data})
|
101
|
-
} else {
|
102
|
-
return me.map[data.id].getModel().getValue()
|
103
|
-
}
|
100
|
+
return this.map[data.id].getModel().getValue()
|
104
101
|
}
|
105
102
|
|
106
103
|
/**
|
@@ -109,7 +106,7 @@ class MonacoEditor extends Base {
|
|
109
106
|
* @param {String} data.id
|
110
107
|
*/
|
111
108
|
layoutEditor(data) {
|
112
|
-
this.
|
109
|
+
this.map[data.id].layout()
|
113
110
|
}
|
114
111
|
|
115
112
|
/**
|
@@ -119,8 +116,6 @@ class MonacoEditor extends Base {
|
|
119
116
|
let me = this,
|
120
117
|
path = me.libraryBasePath;
|
121
118
|
|
122
|
-
me.isLoading = true;
|
123
|
-
|
124
119
|
window.require = {paths: {vs: path}};
|
125
120
|
|
126
121
|
await DomAccess.loadScript(path + '/loader.js');
|
@@ -129,10 +124,7 @@ class MonacoEditor extends Base {
|
|
129
124
|
DomAccess.loadStylesheet(path + '/editor/editor.main.css', {name: 'vs/editor/editor.main'}),
|
130
125
|
DomAccess.loadScript(path + '/editor/editor.main.nls.js'),
|
131
126
|
DomAccess.loadScript(path + '/editor/editor.main.js')
|
132
|
-
])
|
133
|
-
|
134
|
-
me.isLoading = false;
|
135
|
-
me.isReady = true
|
127
|
+
])
|
136
128
|
}
|
137
129
|
|
138
130
|
/**
|
@@ -159,13 +151,7 @@ class MonacoEditor extends Base {
|
|
159
151
|
* @param {String} data.value
|
160
152
|
*/
|
161
153
|
setLanguage(data) {
|
162
|
-
|
163
|
-
|
164
|
-
if (!me.isReady) {
|
165
|
-
return me.cacheMethodCall({fn: 'setLanguage', data})
|
166
|
-
} else {
|
167
|
-
me.map[data.id].getModel().setLanguage(data.value)
|
168
|
-
}
|
154
|
+
this.map[data.id].getModel().setLanguage(data.value)
|
169
155
|
}
|
170
156
|
|
171
157
|
/**
|
@@ -174,13 +160,7 @@ class MonacoEditor extends Base {
|
|
174
160
|
* @param {String} data.value
|
175
161
|
*/
|
176
162
|
setTheme(data) {
|
177
|
-
|
178
|
-
|
179
|
-
if (!me.isReady) {
|
180
|
-
return me.cacheMethodCall({fn: 'setTheme', data})
|
181
|
-
} else {
|
182
|
-
me.map[data.id]._themeService.setTheme(data.value)
|
183
|
-
}
|
163
|
+
this.map[data.id]._themeService.setTheme(data.value)
|
184
164
|
}
|
185
165
|
|
186
166
|
/**
|
@@ -189,13 +169,7 @@ class MonacoEditor extends Base {
|
|
189
169
|
* @param {String} data.value
|
190
170
|
*/
|
191
171
|
setValue(data) {
|
192
|
-
|
193
|
-
|
194
|
-
if (!me.isReady) {
|
195
|
-
return me.cacheMethodCall({fn: 'setValue', data})
|
196
|
-
} else {
|
197
|
-
me.map[data.id].getModel().setValue(data.value)
|
198
|
-
}
|
172
|
+
this.map[data.id].getModel().setValue(data.value)
|
199
173
|
}
|
200
174
|
|
201
175
|
/**
|
@@ -204,13 +178,7 @@ class MonacoEditor extends Base {
|
|
204
178
|
* @param {Object} data.options
|
205
179
|
*/
|
206
180
|
updateOptions(data) {
|
207
|
-
|
208
|
-
|
209
|
-
if (!me.isReady) {
|
210
|
-
return me.cacheMethodCall({fn: 'updateOptions', data})
|
211
|
-
} else {
|
212
|
-
me.map[data.id].updateOptions(data.options)
|
213
|
-
}
|
181
|
+
this.map[data.id].updateOptions(data.options)
|
214
182
|
}
|
215
183
|
}
|
216
184
|
|
@@ -0,0 +1,114 @@
|
|
1
|
+
import BaseManager from './Base.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Neo.manager.ClassHierarchy
|
5
|
+
* @extends Neo.manager.Base
|
6
|
+
* @singleton
|
7
|
+
*
|
8
|
+
* This manager maintains a registry of all classes defined within the Neo.mjs framework's current realm (main or worker),
|
9
|
+
* including their inheritance relationships and key metadata.
|
10
|
+
* Each registered item (value in the manager's store) has the following structure:
|
11
|
+
* @typedef {Object} ClassHierarchyInfo
|
12
|
+
* @property {String} className - The full Neo.mjs class name (e.g., 'Neo.component.Base').
|
13
|
+
* @property {Function|Object} module - The direct reference to the class constructor function itself (for non-singletons)
|
14
|
+
* or the instantiated singleton object (for singletons).
|
15
|
+
* @property {String|null} ntype - The ntype of the class if defined (e.g., 'button', 'container'), otherwise `null`.
|
16
|
+
* @property {String|null} parentClassName - The full class name of its direct parent class,
|
17
|
+
* or `null` if it's a top-level class (e.g., 'Neo.core.Base').
|
18
|
+
*/
|
19
|
+
class ClassHierarchy extends BaseManager {
|
20
|
+
static config = {
|
21
|
+
/**
|
22
|
+
* @member {String} className='Neo.manager.ClassHierarchy'
|
23
|
+
* @protected
|
24
|
+
*/
|
25
|
+
className: 'Neo.manager.ClassHierarchy',
|
26
|
+
/**
|
27
|
+
* @member {String} keyProperty='className'
|
28
|
+
* @protected
|
29
|
+
*/
|
30
|
+
keyProperty: 'className',
|
31
|
+
/**
|
32
|
+
* @member {Boolean} singleton=true
|
33
|
+
* @protected
|
34
|
+
*/
|
35
|
+
singleton: true
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Memoizes the return values of isA() calls
|
40
|
+
* @member {Map} isAQueryMap=new Map()
|
41
|
+
* @protected
|
42
|
+
*/
|
43
|
+
isAQueryMap = new Map()
|
44
|
+
|
45
|
+
/**
|
46
|
+
* @param {Object} config
|
47
|
+
*/
|
48
|
+
construct(config) {
|
49
|
+
super.construct(config);
|
50
|
+
this.consumeTempMap()
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Register all classes that got applied to the Neo namespace before this instance got created
|
55
|
+
* @protected
|
56
|
+
*/
|
57
|
+
consumeTempMap() {
|
58
|
+
if (Neo.classHierarchyMap) {
|
59
|
+
this.add(Object.values(Neo.classHierarchyMap));
|
60
|
+
delete Neo.classHierarchyMap
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Both params represent classNames.
|
66
|
+
*
|
67
|
+
* Example use cases:
|
68
|
+
* - isA('Neo.button.Menu', 'Neo.button.Base') => true
|
69
|
+
* - isA('Neo.button.Base', 'Neo.button.Menu') => false
|
70
|
+
* - isA('Neo.button.Base', 'Neo.component.Base') => true
|
71
|
+
* - isA('Neo.component.Base', 'Neo.core.Base') => true
|
72
|
+
* @param {String} descendant
|
73
|
+
* @param {String} ancestor
|
74
|
+
* @returns {Boolean}
|
75
|
+
*/
|
76
|
+
isA(descendant, ancestor) {
|
77
|
+
if (descendant === ancestor) {
|
78
|
+
return true
|
79
|
+
}
|
80
|
+
|
81
|
+
let parent = descendant,
|
82
|
+
{isAQueryMap} = this,
|
83
|
+
queryName = `${descendant},${ancestor}`,
|
84
|
+
returnValue = false;
|
85
|
+
|
86
|
+
if (isAQueryMap.has(queryName)) {
|
87
|
+
return isAQueryMap.get(queryName)
|
88
|
+
}
|
89
|
+
|
90
|
+
while (parent = this.get(parent)?.parentClassName) {
|
91
|
+
if (parent === ancestor) {
|
92
|
+
returnValue = true;
|
93
|
+
break
|
94
|
+
}
|
95
|
+
|
96
|
+
// Assumption: component.Base directly extends core.Base
|
97
|
+
if (parent === 'Neo.component.Base' && ancestor !== 'Neo.core.Base') {
|
98
|
+
returnValue = false;
|
99
|
+
break
|
100
|
+
}
|
101
|
+
|
102
|
+
if (parent === 'Neo.core.Base') {
|
103
|
+
returnValue = false;
|
104
|
+
break
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
isAQueryMap.set(queryName, returnValue);
|
109
|
+
|
110
|
+
return returnValue
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
export default Neo.setupClass(ClassHierarchy);
|
package/src/menu/List.mjs
CHANGED
@@ -182,7 +182,7 @@ class List extends BaseList {
|
|
182
182
|
let me = this,
|
183
183
|
{iconCls} = record,
|
184
184
|
id = record[me.store.keyProperty],
|
185
|
-
vdomCn = [{tag: 'span', cls: ['neo-content'],
|
185
|
+
vdomCn = [{tag: 'span', cls: ['neo-content'], text: record[me.displayField]}];
|
186
186
|
|
187
187
|
if (iconCls && iconCls !== '') {
|
188
188
|
vdomCn.unshift({tag: 'i', cls: ['neo-menu-icon', 'neo-icon', iconCls], id: me.getIconId(id)})
|
package/src/plugin/Popover.mjs
CHANGED
@@ -18,10 +18,10 @@ import Plugin from './Base.mjs';
|
|
18
18
|
* ntype : 'panel',
|
19
19
|
* headers: [{
|
20
20
|
* dock: 'top',
|
21
|
-
*
|
21
|
+
* text: 'HEADER'
|
22
22
|
* }],
|
23
23
|
* items : [{
|
24
|
-
*
|
24
|
+
* text: 'This is a comment about the button'
|
25
25
|
* }]
|
26
26
|
* }]
|
27
27
|
* }]
|
@@ -5,25 +5,25 @@ import RowModel from '../selection/table/RowModel.mjs';
|
|
5
5
|
import VDomUtil from '../util/VDom.mjs';
|
6
6
|
|
7
7
|
/**
|
8
|
-
* @class Neo.table.
|
8
|
+
* @class Neo.table.Body
|
9
9
|
* @extends Neo.component.Base
|
10
10
|
*/
|
11
|
-
class
|
11
|
+
class TableBody extends Component {
|
12
12
|
static config = {
|
13
13
|
/**
|
14
|
-
* @member {String} className='Neo.table.
|
14
|
+
* @member {String} className='Neo.table.Body'
|
15
15
|
* @protected
|
16
16
|
*/
|
17
|
-
className: 'Neo.table.
|
17
|
+
className: 'Neo.table.Body',
|
18
18
|
/**
|
19
|
-
* @member {String} ntype='table-
|
19
|
+
* @member {String} ntype='table-body'
|
20
20
|
* @protected
|
21
21
|
*/
|
22
|
-
ntype: 'table-
|
22
|
+
ntype: 'table-body',
|
23
23
|
/**
|
24
|
-
* @member {String[]} baseCls=['neo-table-
|
24
|
+
* @member {String[]} baseCls=['neo-table-body']
|
25
25
|
*/
|
26
|
-
baseCls: ['neo-table-
|
26
|
+
baseCls: ['neo-table-body'],
|
27
27
|
/**
|
28
28
|
* Define which model field contains the value of colspan definitions
|
29
29
|
* @member {String} colspanField='colspan'
|
@@ -132,18 +132,17 @@ class View extends Component {
|
|
132
132
|
}
|
133
133
|
|
134
134
|
/**
|
135
|
-
* @param {Object}
|
136
|
-
* @param {String}
|
137
|
-
* @param {Object}
|
138
|
-
* @param {Number}
|
139
|
-
* @param {Object}
|
140
|
-
* @param {Number}
|
135
|
+
* @param {Object} data
|
136
|
+
* @param {String} [data.cellId]
|
137
|
+
* @param {Object} data.column
|
138
|
+
* @param {Number} data.columnIndex
|
139
|
+
* @param {Object} data.record
|
140
|
+
* @param {Number} data.rowIndex
|
141
141
|
* @param {Neo.table.Container} data.tableContainer
|
142
142
|
* @returns {Object}
|
143
143
|
*/
|
144
|
-
applyRendererOutput(
|
145
|
-
let
|
146
|
-
me = this,
|
144
|
+
applyRendererOutput({cellId, column, columnIndex, record, rowIndex, tableContainer}) {
|
145
|
+
let me = this,
|
147
146
|
cellCls = ['neo-table-cell'],
|
148
147
|
colspan = record[me.colspanField],
|
149
148
|
{dataField} = column,
|
@@ -178,7 +177,7 @@ class View extends Component {
|
|
178
177
|
|
179
178
|
switch (Neo.typeOf(rendererOutput)) {
|
180
179
|
case 'Object': {
|
181
|
-
if (rendererOutput.html) {
|
180
|
+
if (rendererOutput.html || rendererOutput.text) {
|
182
181
|
rendererOutput.cls && cellCls.push(...rendererOutput.cls);
|
183
182
|
} else {
|
184
183
|
rendererOutput = [rendererOutput];
|
@@ -231,7 +230,11 @@ class View extends Component {
|
|
231
230
|
}
|
232
231
|
|
233
232
|
if (Neo.typeOf(rendererOutput) === 'Object') {
|
234
|
-
|
233
|
+
if (Object.hasOwn(rendererOutput, 'html')) {
|
234
|
+
cellConfig.html = rendererOutput.html || ''
|
235
|
+
} else {
|
236
|
+
cellConfig.text = rendererOutput.text || ''
|
237
|
+
}
|
235
238
|
} else {
|
236
239
|
cellConfig.cn = rendererOutput
|
237
240
|
}
|
@@ -382,7 +385,7 @@ class View extends Component {
|
|
382
385
|
dataField = me.getCellDataField(id),
|
383
386
|
record = me.getRecord(id);
|
384
387
|
|
385
|
-
me.parent.fire(eventName, {data, dataField, record
|
388
|
+
me.parent.fire(eventName, {body: me, data, dataField, record})
|
386
389
|
}
|
387
390
|
|
388
391
|
/**
|
@@ -394,7 +397,7 @@ class View extends Component {
|
|
394
397
|
id = data.currentTarget,
|
395
398
|
record = me.getRecord(id);
|
396
399
|
|
397
|
-
me.parent.fire(eventName, {data, record
|
400
|
+
me.parent.fire(eventName, {body: me, data, record})
|
398
401
|
}
|
399
402
|
|
400
403
|
/**
|
@@ -619,4 +622,4 @@ class View extends Component {
|
|
619
622
|
}
|
620
623
|
}
|
621
624
|
|
622
|
-
export default Neo.setupClass(
|
625
|
+
export default Neo.setupClass(TableBody);
|
package/src/table/Container.mjs
CHANGED
@@ -3,7 +3,7 @@ import ClassSystemUtil from '../util/ClassSystem.mjs';
|
|
3
3
|
import CssUtil from '../util/Css.mjs';
|
4
4
|
import NeoArray from '../util/Array.mjs';
|
5
5
|
import Store from '../data/Store.mjs';
|
6
|
-
import
|
6
|
+
import TableBody from './Body.mjs';
|
7
7
|
import * as header from './header/_export.mjs';
|
8
8
|
|
9
9
|
/**
|
@@ -26,6 +26,16 @@ class Container extends BaseContainer {
|
|
26
26
|
* @member {String[]} baseCls=['neo-table-container']
|
27
27
|
*/
|
28
28
|
baseCls: ['neo-table-container'],
|
29
|
+
/**
|
30
|
+
* Configs for Neo.table.Body
|
31
|
+
* @member {Object|null} [bodyConfig=null]
|
32
|
+
*/
|
33
|
+
bodyConfig: null,
|
34
|
+
/**
|
35
|
+
* @member {String|null} bodyId_=null
|
36
|
+
* @protected
|
37
|
+
*/
|
38
|
+
bodyId_: null,
|
29
39
|
/**
|
30
40
|
* true uses table.plugin.CellEditing
|
31
41
|
* @member {Boolean} cellEditing_=false
|
@@ -75,16 +85,6 @@ class Container extends BaseContainer {
|
|
75
85
|
* @member {Boolean} useCustomScrollbars_=true
|
76
86
|
*/
|
77
87
|
useCustomScrollbars_: true,
|
78
|
-
/**
|
79
|
-
* Configs for Neo.table.View
|
80
|
-
* @member {Object|null} [viewConfig=null]
|
81
|
-
*/
|
82
|
-
viewConfig: null,
|
83
|
-
/**
|
84
|
-
* @member {String|null} viewId_=null
|
85
|
-
* @protected
|
86
|
-
*/
|
87
|
-
viewId_: null,
|
88
88
|
/**
|
89
89
|
* @member {Array|null} items=null
|
90
90
|
* @protected
|
@@ -100,19 +100,19 @@ class Container extends BaseContainer {
|
|
100
100
|
}
|
101
101
|
|
102
102
|
/**
|
103
|
-
* Convenience method to access the Neo.table.
|
104
|
-
* @returns {Neo.table.
|
103
|
+
* Convenience method to access the Neo.table.Body
|
104
|
+
* @returns {Neo.table.Body|null}
|
105
105
|
*/
|
106
|
-
get
|
107
|
-
return Neo.getComponent(this.
|
106
|
+
get body() {
|
107
|
+
return Neo.getComponent(this.bodyId) || Neo.get(this.bodyId)
|
108
108
|
}
|
109
109
|
|
110
110
|
/**
|
111
|
-
* Convenience method to access the Neo.table.
|
112
|
-
* @returns {Neo.table.
|
111
|
+
* Convenience method to access the Neo.table.header.Toolbar
|
112
|
+
* @returns {Neo.table.header.Toolbar|null}
|
113
113
|
*/
|
114
|
-
get
|
115
|
-
return Neo.getComponent(this.
|
114
|
+
get headerToolbar() {
|
115
|
+
return Neo.getComponent(this.headerToolbarId) || Neo.get(this.headerToolbarId)
|
116
116
|
}
|
117
117
|
|
118
118
|
/**
|
@@ -123,8 +123,8 @@ class Container extends BaseContainer {
|
|
123
123
|
|
124
124
|
let me = this;
|
125
125
|
|
126
|
+
me.bodyId = Neo.getId('table-body');
|
126
127
|
me.headerToolbarId = Neo.getId('table-header-toolbar');
|
127
|
-
me.viewId = Neo.getId('table-view');
|
128
128
|
|
129
129
|
me.items = [{
|
130
130
|
module : header.Toolbar,
|
@@ -133,11 +133,11 @@ class Container extends BaseContainer {
|
|
133
133
|
sortable : me.sortable,
|
134
134
|
...me.headerToolbarConfig
|
135
135
|
}, {
|
136
|
-
module :
|
136
|
+
module : TableBody,
|
137
137
|
containerId: me.id,
|
138
|
-
id : me.
|
138
|
+
id : me.bodyId,
|
139
139
|
store : me.store,
|
140
|
-
...me.
|
140
|
+
...me.bodyConfig
|
141
141
|
}];
|
142
142
|
|
143
143
|
me.vdom.id = me.getWrapperId();
|
@@ -184,7 +184,7 @@ class Container extends BaseContainer {
|
|
184
184
|
headerToolbar.createItems()
|
185
185
|
}
|
186
186
|
|
187
|
-
me.
|
187
|
+
me.body?.createViewData()
|
188
188
|
}
|
189
189
|
}
|
190
190
|
|
@@ -229,9 +229,9 @@ class Container extends BaseContainer {
|
|
229
229
|
value ?.on(listeners);
|
230
230
|
oldValue?.un(listeners);
|
231
231
|
|
232
|
-
// in case we dynamically change the store, the
|
233
|
-
if (me.
|
234
|
-
me.
|
232
|
+
// in case we dynamically change the store, the body needs to get the new reference
|
233
|
+
if (me.body) {
|
234
|
+
me.body.store = value
|
235
235
|
}
|
236
236
|
}
|
237
237
|
|
@@ -270,6 +270,16 @@ class Container extends BaseContainer {
|
|
270
270
|
me.scrollbarsCssApplied = true
|
271
271
|
}
|
272
272
|
|
273
|
+
/**
|
274
|
+
* Triggered before the bodyId config gets changed.
|
275
|
+
* @param {String} value
|
276
|
+
* @param {String} oldValue
|
277
|
+
* @protected
|
278
|
+
*/
|
279
|
+
beforeSetBodyId(value, oldValue) {
|
280
|
+
return value || oldValue
|
281
|
+
}
|
282
|
+
|
273
283
|
/**
|
274
284
|
* Triggered before the columns config gets changed.
|
275
285
|
* @param {Object[]} value
|
@@ -308,16 +318,6 @@ class Container extends BaseContainer {
|
|
308
318
|
return value
|
309
319
|
}
|
310
320
|
|
311
|
-
/**
|
312
|
-
* Triggered before the viewId config gets changed.
|
313
|
-
* @param {String} value
|
314
|
-
* @param {String} oldValue
|
315
|
-
* @protected
|
316
|
-
*/
|
317
|
-
beforeSetViewId(value, oldValue) {
|
318
|
-
return value || oldValue
|
319
|
-
}
|
320
|
-
|
321
321
|
/**
|
322
322
|
* In case you want to update multiple existing records in parallel,
|
323
323
|
* using this method is faster than updating each record one by one.
|
@@ -325,19 +325,19 @@ class Container extends BaseContainer {
|
|
325
325
|
* @param {Object[]} records
|
326
326
|
*/
|
327
327
|
bulkUpdateRecords(records) {
|
328
|
-
let {
|
328
|
+
let {body, store} = this,
|
329
329
|
{keyProperty} = store;
|
330
330
|
|
331
|
-
if (
|
332
|
-
|
331
|
+
if (body) {
|
332
|
+
body.silentVdomUpdate = true;
|
333
333
|
|
334
334
|
records.forEach(item => {
|
335
335
|
store.get(item[keyProperty])?.set(item)
|
336
336
|
});
|
337
337
|
|
338
|
-
|
338
|
+
body.silentVdomUpdate = false;
|
339
339
|
|
340
|
-
|
340
|
+
body.update()
|
341
341
|
}
|
342
342
|
}
|
343
343
|
|
@@ -426,7 +426,7 @@ class Container extends BaseContainer {
|
|
426
426
|
|
427
427
|
me.store.sort(opts);
|
428
428
|
me.removeSortingCss(opts.property);
|
429
|
-
opts.direction && me.
|
429
|
+
opts.direction && me.body.onStoreLoad()
|
430
430
|
}
|
431
431
|
|
432
432
|
/**
|
package/src/table/_export.mjs
CHANGED