neo.mjs 8.0.0-alpha.2 → 8.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/.github/CODING_GUIDELINES.md +5 -5
- package/.github/CONCEPT.md +10 -10
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/colors/view/Viewport.mjs +9 -9
- package/apps/colors/view/ViewportController.mjs +13 -13
- package/apps/colors/view/{ViewportModel.mjs → ViewportStateProvider.mjs} +8 -8
- package/apps/covid/view/MainContainer.mjs +22 -22
- package/apps/covid/view/MainContainerController.mjs +8 -10
- package/apps/covid/view/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +7 -7
- package/apps/covid/view/TableContainer.mjs +2 -2
- package/apps/covid/view/TableContainerController.mjs +1 -1
- package/apps/form/view/FormContainerController.mjs +2 -2
- package/apps/form/view/SideNavList.mjs +3 -3
- package/apps/form/view/Viewport.mjs +7 -7
- package/apps/form/view/ViewportController.mjs +4 -4
- package/apps/form/view/{ViewportModel.mjs → ViewportStateProvider.mjs} +8 -8
- package/apps/portal/index.html +1 -1
- package/apps/portal/resources/data/examples_devmode.json +3 -3
- package/apps/portal/resources/data/examples_dist_dev.json +3 -3
- package/apps/portal/resources/data/examples_dist_prod.json +3 -3
- package/apps/portal/view/Viewport.mjs +12 -12
- package/apps/portal/view/ViewportController.mjs +2 -2
- package/apps/portal/view/ViewportStateProvider.mjs +27 -0
- package/apps/portal/view/examples/TabContainer.mjs +11 -11
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/portal/view/home/parts/MainNeo.mjs +6 -2
- package/apps/portal/view/learn/ContentComponent.mjs +2 -2
- package/apps/portal/view/learn/ContentTreeList.mjs +1 -1
- package/apps/portal/view/learn/MainContainer.mjs +9 -9
- package/apps/portal/view/learn/MainContainerController.mjs +12 -12
- package/apps/portal/view/learn/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +7 -7
- package/apps/portal/view/learn/PageSectionsList.mjs +1 -1
- package/apps/realworld/view/article/CreateComponent.mjs +1 -1
- package/apps/realworld2/view/HomeContainer.mjs +7 -7
- package/apps/sharedcovid/view/GalleryContainer.mjs +2 -2
- package/apps/sharedcovid/view/HelixContainer.mjs +2 -2
- package/apps/sharedcovid/view/MainContainer.mjs +25 -25
- package/apps/sharedcovid/view/MainContainerController.mjs +10 -11
- package/apps/sharedcovid/view/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +8 -8
- package/apps/sharedcovid/view/TableContainer.mjs +2 -2
- package/apps/sharedcovid/view/TableContainerController.mjs +1 -1
- package/apps/sharedcovid/view/mapboxGl/Container.mjs +2 -2
- package/buildScripts/createApp.mjs +2 -2
- package/buildScripts/createClass.mjs +15 -17
- package/buildScripts/createComponent.mjs +4 -4
- package/docs/app/view/ContentTabContainer.mjs +1 -1
- package/docs/app/view/MainContainer.mjs +3 -3
- package/docs/app/view/MainContainerController.mjs +15 -15
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/mwc/buttons/MainContainer.mjs +2 -2
- package/examples/component/mwc/textFields/MainContainer.mjs +2 -2
- package/examples/fields/MainContainer.mjs +197 -228
- package/examples/preloadingAssets/view/MainContainer.mjs +2 -2
- package/examples/{model → stateProvider}/advanced/MainContainer.mjs +12 -12
- package/examples/{model → stateProvider}/advanced/MainContainerController.mjs +10 -10
- package/examples/stateProvider/advanced/app.mjs +6 -0
- package/examples/{model/dialog → stateProvider/advanced}/index.html +1 -1
- package/examples/{model/inline → stateProvider/advanced}/neo-config.json +1 -1
- package/examples/{model → stateProvider}/dialog/EditUserDialog.mjs +3 -3
- package/examples/{model → stateProvider}/dialog/EditUserDialogController.mjs +5 -5
- package/examples/{model → stateProvider}/dialog/MainContainer.mjs +7 -7
- package/examples/{model → stateProvider}/dialog/MainContainerController.mjs +5 -5
- package/examples/{model → stateProvider}/dialog/app.mjs +1 -1
- package/examples/{model/multiWindow2 → stateProvider/dialog}/index.html +1 -1
- package/examples/{model → stateProvider}/dialog/neo-config.json +1 -1
- package/examples/{model → stateProvider}/extendedClass/MainContainer.mjs +13 -13
- package/examples/{model/inline → stateProvider/extendedClass}/MainContainerController.mjs +7 -7
- package/examples/stateProvider/extendedClass/MainContainerStateProvider.mjs +24 -0
- package/examples/stateProvider/extendedClass/app.mjs +6 -0
- package/examples/stateProvider/extendedClass/index.html +11 -0
- package/examples/stateProvider/extendedClass/neo-config.json +7 -0
- package/examples/{model → stateProvider}/inline/MainContainer.mjs +10 -10
- package/examples/{model/extendedClass → stateProvider/inline}/MainContainerController.mjs +7 -7
- package/examples/{model/extendedClass → stateProvider/inline}/app.mjs +1 -1
- package/examples/{model/extendedClass → stateProvider/inline}/index.html +1 -1
- package/examples/{model/extendedClass → stateProvider/inline}/neo-config.json +1 -1
- package/examples/{model/inlineNoModel → stateProvider/inlineNoStateProvider}/MainContainer.mjs +4 -4
- package/examples/{model/inlineNoModel → stateProvider/inlineNoStateProvider}/MainContainerController.mjs +3 -3
- package/examples/stateProvider/inlineNoStateProvider/README.md +8 -0
- package/examples/stateProvider/inlineNoStateProvider/app.mjs +6 -0
- package/examples/{model/inline → stateProvider/inlineNoStateProvider}/index.html +1 -1
- package/examples/stateProvider/inlineNoStateProvider/neo-config.json +7 -0
- package/examples/{model → stateProvider}/multiWindow/EditUserDialog.mjs +3 -3
- package/examples/{model → stateProvider}/multiWindow/EditUserDialogController.mjs +5 -5
- package/examples/{model → stateProvider}/multiWindow/MainContainer.mjs +3 -3
- package/examples/{model → stateProvider}/multiWindow/MainContainerController.mjs +6 -6
- package/examples/{model → stateProvider}/multiWindow/Viewport.mjs +3 -3
- package/examples/{model → stateProvider}/multiWindow/ViewportController.mjs +14 -14
- package/examples/{model/multiWindow2 → stateProvider/multiWindow}/app.mjs +1 -1
- package/examples/{model/advanced → stateProvider/multiWindow}/index.html +1 -1
- package/examples/{model → stateProvider}/multiWindow/neo-config.json +1 -1
- package/examples/{model → stateProvider}/multiWindow2/Viewport.mjs +3 -3
- package/examples/{model/multiWindow → stateProvider/multiWindow2}/app.mjs +1 -1
- package/examples/{model/multiWindow → stateProvider/multiWindow2}/index.html +1 -1
- package/examples/{model → stateProvider}/multiWindow2/neo-config.json +1 -1
- package/examples/{model → stateProvider}/nestedData/MainContainer.mjs +9 -9
- package/examples/{model → stateProvider}/nestedData/MainContainerController.mjs +7 -7
- package/examples/stateProvider/nestedData/app.mjs +6 -0
- package/examples/stateProvider/nestedData/index.html +11 -0
- package/examples/stateProvider/nestedData/neo-config.json +7 -0
- package/examples/{model → stateProvider}/table/MainContainer.mjs +8 -8
- package/examples/stateProvider/table/MainContainerStateProvider.mjs +24 -0
- package/examples/{model → stateProvider}/table/MainModel.mjs +2 -2
- package/examples/{model → stateProvider}/table/MainStore.mjs +2 -2
- package/examples/{model/advanced → stateProvider/table}/app.mjs +1 -1
- package/examples/{model/advanced → stateProvider/table}/neo-config.json +1 -1
- package/examples/{model → stateProvider}/twoWay/MainContainer.mjs +9 -9
- package/examples/{model/inline → stateProvider/twoWay}/app.mjs +1 -1
- package/examples/stateProvider/twoWay/index.html +11 -0
- package/examples/{model → stateProvider}/twoWay/neo-config.json +1 -1
- package/examples/tab/container/MainContainer.mjs +7 -9
- package/examples/table/nestedRecordFields/EditUserDialog.mjs +3 -3
- package/examples/table/nestedRecordFields/MainContainer.mjs +8 -8
- package/examples/table/nestedRecordFields/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +10 -10
- package/examples/tabs/MainContainer.mjs +3 -3
- package/examples/tabs/MainContainer2.mjs +4 -4
- package/examples/toolbar/paging/view/MainContainer.mjs +7 -7
- package/examples/toolbar/paging/view/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +8 -8
- package/examples/treeAccordion/MainContainer.mjs +2 -2
- package/examples/videoMove/MainContainer.mjs +14 -7
- package/examples/viewport/MainContainer.mjs +3 -3
- package/package.json +6 -6
- package/resources/data/deck/learnneo/pages/benefits/FormsEngine.md +13 -13
- package/resources/data/deck/learnneo/pages/guides/{ViewModels.md → StateProviders.md} +52 -58
- package/resources/data/deck/learnneo/tree.json +46 -46
- package/resources/data/deck/training/pages/2022-12-27T21-55-23-144Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-28T17-11-34-653Z.md +6 -6
- package/resources/data/deck/training/pages/2022-12-29T18-36-08-226Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T18-36-56-893Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T20-37-08-919Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T20-37-20-344Z.md +2 -2
- package/resources/data/deck/training/pages/2023-01-01T21-11-58-025Z.md +3 -3
- package/resources/data/deck/training/pages/2023-01-16T20-24-09-690Z.md +4 -4
- package/resources/data/deck/training/pages/2023-02-05T17-44-53-815Z.md +3 -3
- package/resources/data/deck/training/pages/2023-02-05T17-45-40-114Z.md +1 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/button/Base.mjs +7 -7
- package/src/calendar/view/EditEventContainer.mjs +3 -3
- package/src/calendar/view/MainContainer.mjs +27 -27
- package/src/calendar/view/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +7 -7
- package/src/calendar/view/SettingsContainer.mjs +13 -28
- package/src/calendar/view/YearComponent.mjs +5 -5
- package/src/calendar/view/calendars/ColorsList.mjs +5 -0
- package/src/calendar/view/calendars/EditContainer.mjs +1 -1
- package/src/calendar/view/calendars/List.mjs +1 -1
- package/src/calendar/view/month/Component.mjs +6 -6
- package/src/calendar/view/settings/GeneralContainer.mjs +2 -2
- package/src/calendar/view/week/Component.mjs +10 -10
- package/src/calendar/view/week/EventDragZone.mjs +1 -1
- package/src/code/LivePreview.mjs +10 -10
- package/src/component/Base.mjs +123 -105
- package/src/container/Base.mjs +4 -4
- package/src/controller/Component.mjs +29 -12
- package/src/core/Base.mjs +0 -1
- package/src/core/Compare.mjs +128 -83
- package/src/date/SelectorContainer.mjs +12 -12
- package/src/date/{SelectorContainerModel.mjs → SelectorContainerStateProvider.mjs} +7 -7
- package/src/form/field/Text.mjs +1 -1
- package/src/form/field/Time.mjs +5 -3
- package/src/form/field/trigger/Time.mjs +2 -1
- package/src/layout/Base.mjs +6 -6
- package/src/list/Base.mjs +7 -1
- package/src/list/Color.mjs +3 -3
- package/src/main/DomEvents.mjs +1 -1
- package/src/main/DomUtils.mjs +39 -36
- package/src/{model/Component.mjs → state/Provider.mjs} +67 -69
- package/src/tab/Container.mjs +3 -5
- package/src/toolbar/Base.mjs +26 -8
- package/src/tree/Accordion.mjs +15 -13
- package/src/util/VNode.mjs +6 -8
- package/src/worker/App.mjs +2 -2
- package/apps/portal/view/ViewportModel.mjs +0 -27
- package/examples/model/extendedClass/MainContainerModel.mjs +0 -24
- package/examples/model/inlineNoModel/README.md +0 -8
- package/examples/model/inlineNoModel/app.mjs +0 -6
- package/examples/model/inlineNoModel/index.html +0 -11
- package/examples/model/inlineNoModel/neo-config.json +0 -7
- package/examples/model/nestedData/app.mjs +0 -6
- package/examples/model/nestedData/index.html +0 -11
- package/examples/model/nestedData/neo-config.json +0 -7
- package/examples/model/table/MainContainerModel.mjs +0 -24
- package/examples/model/table/app.mjs +0 -6
- package/examples/model/table/neo-config.json +0 -7
- package/examples/model/twoWay/app.mjs +0 -6
- package/examples/model/twoWay/index.html +0 -11
- /package/examples/{model → stateProvider}/table/index.html +0 -0
package/src/core/Compare.mjs
CHANGED
@@ -14,118 +14,163 @@ class Compare extends Base {
|
|
14
14
|
}
|
15
15
|
|
16
16
|
/**
|
17
|
-
*
|
18
|
-
* @
|
17
|
+
* Storing the comparison method names by data type
|
18
|
+
* @member {Object} map
|
19
|
+
*/
|
20
|
+
static map = {
|
21
|
+
Array : 'compareArrays',
|
22
|
+
Date : 'compareDates',
|
23
|
+
Function : 'compareFunctions',
|
24
|
+
Map : 'compareMaps',
|
25
|
+
NeoInstance: 'compareNeoInstances',
|
26
|
+
Object : 'compareObjects',
|
27
|
+
RegExp : 'compareRegExps',
|
28
|
+
Set : 'compareSets'
|
29
|
+
}
|
30
|
+
|
31
|
+
/**
|
32
|
+
* @param {Array} item1
|
33
|
+
* @param {Array} item2
|
19
34
|
* @returns {Boolean}
|
20
35
|
*/
|
21
|
-
static
|
22
|
-
if (item1
|
23
|
-
return
|
36
|
+
static compareArrays(item1, item2) {
|
37
|
+
if (item1.length !== item2.length) {
|
38
|
+
return false
|
24
39
|
}
|
25
40
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
if (type1 !== type2) {
|
31
|
-
return false;
|
41
|
+
for (const [i, v] of item1.entries()) {
|
42
|
+
if (!Compare.isEqual(v, item2[i])) {
|
43
|
+
return false
|
44
|
+
}
|
32
45
|
}
|
33
46
|
|
34
|
-
|
35
|
-
|
36
|
-
if (item1.length !== item2.length) {
|
37
|
-
return false;
|
38
|
-
}
|
39
|
-
|
40
|
-
for (const [i, v] of item1.entries()) {
|
41
|
-
if (!Compare.isEqual(v, item2[i])) {
|
42
|
-
return false;
|
43
|
-
}
|
44
|
-
}
|
47
|
+
return true
|
48
|
+
}
|
45
49
|
|
46
|
-
|
47
|
-
|
50
|
+
/**
|
51
|
+
* @param {Date} item1
|
52
|
+
* @param {Date} item2
|
53
|
+
* @returns {Boolean}
|
54
|
+
*/
|
55
|
+
static compareDates(item1, item2) {
|
56
|
+
return item1.valueOf() === item2.valueOf()
|
57
|
+
}
|
48
58
|
|
49
|
-
|
50
|
-
|
51
|
-
|
59
|
+
/**
|
60
|
+
* @param {Function} item1
|
61
|
+
* @param {Function} item2
|
62
|
+
* @returns {Boolean}
|
63
|
+
*/
|
64
|
+
static compareFunctions(item1, item2) {
|
65
|
+
if (item1.name !== item2.name) {
|
66
|
+
return false
|
67
|
+
}
|
52
68
|
|
53
|
-
|
54
|
-
|
55
|
-
return false;
|
56
|
-
}
|
69
|
+
return item1.toString() === item2.toString()
|
70
|
+
}
|
57
71
|
|
58
|
-
|
59
|
-
|
72
|
+
/**
|
73
|
+
* @param {Map} item1
|
74
|
+
* @param {Map} item2
|
75
|
+
* @returns {Boolean}
|
76
|
+
*/
|
77
|
+
static compareMaps(item1, item2) {
|
78
|
+
if (item1.size !== item2.size) {
|
79
|
+
return false
|
80
|
+
}
|
60
81
|
|
61
|
-
|
62
|
-
if (item1.size !== item2.size) {
|
63
|
-
return false;
|
64
|
-
}
|
82
|
+
let val2;
|
65
83
|
|
66
|
-
|
84
|
+
for (const [key, val] of item1) {
|
85
|
+
val2 = item2.get(key);
|
67
86
|
|
68
|
-
|
69
|
-
|
87
|
+
if (val2 !== val || val2 === undefined && !item2.has(key)) {
|
88
|
+
return false
|
89
|
+
}
|
90
|
+
}
|
70
91
|
|
71
|
-
|
72
|
-
|
73
|
-
}
|
74
|
-
}
|
92
|
+
return true
|
93
|
+
}
|
75
94
|
|
76
|
-
|
77
|
-
|
95
|
+
/**
|
96
|
+
* @param {Neo.core.Base} item1
|
97
|
+
* @param {Neo.core.Base} item2
|
98
|
+
* @returns {Boolean}
|
99
|
+
*/
|
100
|
+
static compareNeoInstances(item1, item2) {
|
101
|
+
return item1.id === item2.id
|
102
|
+
}
|
78
103
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
104
|
+
/**
|
105
|
+
* @param {Object} item1
|
106
|
+
* @param {Object} item2
|
107
|
+
* @returns {Boolean}
|
108
|
+
*/
|
109
|
+
static compareObjects(item1, item2) {
|
110
|
+
if (Object.keys(item1).length !== Object.keys(item2).length) {
|
111
|
+
return false
|
112
|
+
}
|
83
113
|
|
84
|
-
|
114
|
+
for (let key in item1) {
|
115
|
+
if (!Compare.isEqual(item1[key], item2[key])) {
|
116
|
+
return false
|
85
117
|
}
|
118
|
+
}
|
86
119
|
|
87
|
-
|
88
|
-
|
89
|
-
return false;
|
90
|
-
}
|
91
|
-
|
92
|
-
for (key in item1) {
|
93
|
-
if (!Compare.isEqual(item1[key], item2[key])) {
|
94
|
-
return false;
|
95
|
-
}
|
96
|
-
}
|
120
|
+
return true
|
121
|
+
}
|
97
122
|
|
98
|
-
|
99
|
-
|
123
|
+
/**
|
124
|
+
* @param {RegExp} item1
|
125
|
+
* @param {RegExp} item2
|
126
|
+
* @returns {Boolean}
|
127
|
+
*/
|
128
|
+
static compareRegExps(item1, item2) {
|
129
|
+
return item1.toString() === item2.toString()
|
130
|
+
}
|
100
131
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
132
|
+
/**
|
133
|
+
* @param {Set} item1
|
134
|
+
* @param {Set} item2
|
135
|
+
* @returns {Boolean}
|
136
|
+
*/
|
137
|
+
static compareSets(item1, item2) {
|
138
|
+
if (item1.size !== item2.size) {
|
139
|
+
return false
|
140
|
+
}
|
105
141
|
|
106
|
-
|
142
|
+
for (let key of item1) {
|
143
|
+
if (!item2.has(key)) {
|
144
|
+
return false
|
107
145
|
}
|
146
|
+
}
|
108
147
|
|
109
|
-
|
110
|
-
|
111
|
-
return false;
|
112
|
-
}
|
148
|
+
return true
|
149
|
+
}
|
113
150
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
151
|
+
/**
|
152
|
+
* @param {*} item1
|
153
|
+
* @param {*} item2
|
154
|
+
* @returns {Boolean}
|
155
|
+
*/
|
156
|
+
static isEqual(item1, item2) {
|
157
|
+
if (item1 === item2) {
|
158
|
+
return true
|
159
|
+
}
|
119
160
|
|
120
|
-
|
121
|
-
|
161
|
+
let type1 = Neo.typeOf(item1),
|
162
|
+
type2 = Neo.typeOf(item2);
|
122
163
|
|
123
|
-
|
124
|
-
|
125
|
-
|
164
|
+
if (type1 !== type2) {
|
165
|
+
return false
|
166
|
+
}
|
167
|
+
|
168
|
+
if (Compare.map[type1]) {
|
169
|
+
return Compare[Compare.map[type1]](item1, item2)
|
126
170
|
}
|
127
171
|
|
128
|
-
|
172
|
+
// all other types
|
173
|
+
return item1 === item2
|
129
174
|
}
|
130
175
|
}
|
131
176
|
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import ClassSystemUtil
|
2
|
-
import Container
|
3
|
-
import DateSelectorModel
|
4
|
-
import DayViewComponent
|
5
|
-
import DateUtil
|
6
|
-
import NeoArray
|
7
|
-
import
|
8
|
-
import Toolbar
|
1
|
+
import ClassSystemUtil from '../util/ClassSystem.mjs';
|
2
|
+
import Container from '../container/Base.mjs';
|
3
|
+
import DateSelectorModel from '../selection/DateSelectorModel.mjs';
|
4
|
+
import DayViewComponent from './DayViewComponent.mjs';
|
5
|
+
import DateUtil from '../util/Date.mjs';
|
6
|
+
import NeoArray from '../util/Array.mjs';
|
7
|
+
import SelectorContainerStateProvider from './SelectorContainerStateProvider.mjs';
|
8
|
+
import Toolbar from '../toolbar/Base.mjs';
|
9
9
|
|
10
10
|
const todayDate = new Date();
|
11
11
|
|
@@ -114,10 +114,6 @@ class SelectorContainer extends Container {
|
|
114
114
|
* @member {String|null} minValue_=null
|
115
115
|
*/
|
116
116
|
minValue_: null,
|
117
|
-
/**
|
118
|
-
* @member {Neo.model.Component} model=SelectorContainerModel
|
119
|
-
*/
|
120
|
-
model: SelectorContainerModel,
|
121
117
|
/**
|
122
118
|
* Used for wheel events. min value = 1.
|
123
119
|
* A higher value means lesser sensitivity for wheel events
|
@@ -149,6 +145,10 @@ class SelectorContainer extends Container {
|
|
149
145
|
* @member {Boolean} showWeekends_=true
|
150
146
|
*/
|
151
147
|
showWeekends_: true,
|
148
|
+
/**
|
149
|
+
* @member {Neo.state.Provider} stateProvider=SelectorContainerStateProvider
|
150
|
+
*/
|
151
|
+
stateProvider: SelectorContainerStateProvider,
|
152
152
|
/**
|
153
153
|
* True to use sliding animations
|
154
154
|
* @member {Boolean} useAnimations=true
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import
|
1
|
+
import StateProvider from '../state/Provider.mjs';
|
2
2
|
|
3
3
|
/**
|
4
|
-
* @class Neo.date.
|
5
|
-
* @extends Neo.
|
4
|
+
* @class Neo.date.SelectorContainerStateProvider
|
5
|
+
* @extends Neo.state.Provider
|
6
6
|
*/
|
7
|
-
class
|
7
|
+
class SelectorContainerStateProvider extends StateProvider {
|
8
8
|
static config = {
|
9
9
|
/**
|
10
|
-
* @member {String} className='Neo.date.
|
10
|
+
* @member {String} className='Neo.date.SelectorContainerStateProvider'
|
11
11
|
* @protected
|
12
12
|
*/
|
13
|
-
className: 'Neo.date.
|
13
|
+
className: 'Neo.date.SelectorContainerStateProvider',
|
14
14
|
/**
|
15
15
|
* @member {Object} data
|
16
16
|
*/
|
@@ -28,4 +28,4 @@ class SelectorContainerModel extends Component {
|
|
28
28
|
}
|
29
29
|
}
|
30
30
|
|
31
|
-
export default Neo.setupClass(
|
31
|
+
export default Neo.setupClass(SelectorContainerStateProvider);
|
package/src/form/field/Text.mjs
CHANGED
@@ -1356,7 +1356,7 @@ class Text extends Base {
|
|
1356
1356
|
let me = this,
|
1357
1357
|
oldValue = me.value,
|
1358
1358
|
inputValue = data.value,
|
1359
|
-
vnode = VNodeUtil.
|
1359
|
+
vnode = VNodeUtil.find(me.vnode, {nodeName: 'input'});
|
1360
1360
|
|
1361
1361
|
if (vnode) {
|
1362
1362
|
// Update the current state (modified DOM by the user) to enable the delta-updates logic.
|
package/src/form/field/Time.mjs
CHANGED
@@ -101,9 +101,11 @@ class Time extends Picker {
|
|
101
101
|
});
|
102
102
|
|
103
103
|
me.list = Neo.create({
|
104
|
-
module
|
105
|
-
displayField: 'value',
|
106
|
-
|
104
|
+
module : List,
|
105
|
+
displayField : 'value',
|
106
|
+
itemsFocusable: false,
|
107
|
+
navigator : {eventSource: me.getInputElId()},
|
108
|
+
store : me.collection,
|
107
109
|
...me.listConfig
|
108
110
|
});
|
109
111
|
|
package/src/layout/Base.mjs
CHANGED
@@ -101,18 +101,18 @@ class Base extends CoreBase {
|
|
101
101
|
destroy() {
|
102
102
|
let me = this;
|
103
103
|
|
104
|
-
me.bind && me.
|
104
|
+
me.bind && me.getStateProvider()?.removeBindings(me.id);
|
105
105
|
|
106
106
|
super.destroy()
|
107
107
|
}
|
108
108
|
|
109
109
|
/**
|
110
|
-
* Returns the container
|
110
|
+
* Returns the container stateProvider or its closest parent stateProvider
|
111
111
|
* @param {String} [ntype]
|
112
|
-
* @returns {Neo.
|
112
|
+
* @returns {Neo.state.Provider|null}
|
113
113
|
*/
|
114
|
-
|
115
|
-
return this.container.
|
114
|
+
getStateProvider(ntype) {
|
115
|
+
return this.container.getStateProvider(ntype)
|
116
116
|
}
|
117
117
|
|
118
118
|
/**
|
@@ -125,7 +125,7 @@ class Base extends CoreBase {
|
|
125
125
|
|
126
126
|
let me = this;
|
127
127
|
|
128
|
-
me.bind && me.container.
|
128
|
+
me.bind && me.container.getStateProvider()?.parseConfig(me)
|
129
129
|
}
|
130
130
|
|
131
131
|
/**
|
package/src/list/Base.mjs
CHANGED
@@ -125,7 +125,12 @@ class Base extends Component {
|
|
125
125
|
*/
|
126
126
|
selectionModel_: null,
|
127
127
|
/**
|
128
|
-
* Set this to true in case a
|
128
|
+
* Set this to true in case a keyboard navigation should immediately select the focussed item
|
129
|
+
* @member {Boolean} selectOnFocus=false
|
130
|
+
*/
|
131
|
+
selectOnFocus: false,
|
132
|
+
/**
|
133
|
+
* Set this to true in case a select event should only update _vdom (e.g. when used inside a form.field.ComboBox
|
129
134
|
* @member {Boolean} silentSelect=false
|
130
135
|
*/
|
131
136
|
silentSelect: false,
|
@@ -298,6 +303,7 @@ class Base extends Component {
|
|
298
303
|
if (!me.hasNavigator) {
|
299
304
|
me.navigator = {
|
300
305
|
appName : me.appName,
|
306
|
+
autoClick : me.selectOnFocus,
|
301
307
|
id : me.id,
|
302
308
|
keepFocusIndex: me.keepFocusIndex,
|
303
309
|
selector : `.${me.itemCls}:not(.neo-disabled,.neo-list-header)`,
|
package/src/list/Color.mjs
CHANGED
@@ -22,13 +22,13 @@ class Color extends Base {
|
|
22
22
|
baseCls: ['neo-color-list', 'neo-list'],
|
23
23
|
/**
|
24
24
|
* The data.Model field which contains the color value
|
25
|
-
* @member {String}
|
25
|
+
* @member {String} colorField_='name'
|
26
26
|
*/
|
27
|
-
|
27
|
+
colorField_: 'name',
|
28
28
|
/**
|
29
29
|
* Override the formatter to apply a custom background-color styling.
|
30
30
|
* E.g. using CSS vars for different themes
|
31
|
-
* @member {Function}
|
31
|
+
* @member {Function} colorFormatter=(scope,data)=>data[scope.colorField]
|
32
32
|
*/
|
33
33
|
colorFormatter: (scope,data) => data[scope.colorField]
|
34
34
|
}
|
package/src/main/DomEvents.mjs
CHANGED
package/src/main/DomUtils.mjs
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
import Base from '../core/Base.mjs';
|
2
2
|
|
3
3
|
const focusableTags = {
|
4
|
-
BODY
|
5
|
-
BUTTON
|
6
|
-
EMBED
|
7
|
-
IFRAME
|
8
|
-
INPUT
|
9
|
-
OBJECT
|
10
|
-
SELECT
|
11
|
-
TEXTAREA
|
4
|
+
BODY : 1,
|
5
|
+
BUTTON : 1,
|
6
|
+
EMBED : 1,
|
7
|
+
IFRAME : 1,
|
8
|
+
INPUT : 1,
|
9
|
+
OBJECT : 1,
|
10
|
+
SELECT : 1,
|
11
|
+
TEXTAREA: 1
|
12
12
|
};
|
13
13
|
|
14
14
|
/**
|
15
|
-
* @class Neo.main.DomUtils
|
15
|
+
* @class Neo.main.DomUtils
|
16
16
|
* @extends Neo.core.Base
|
17
17
|
* @singleton
|
18
18
|
*/
|
19
|
-
|
19
|
+
class DomUtils extends Base {
|
20
20
|
static config = {
|
21
21
|
/**
|
22
22
|
* @member {String} className='Neo.main.DomUtils'
|
@@ -31,42 +31,21 @@ export default class DomUtils extends Base {
|
|
31
31
|
* @param {HTMLElement} el The element to start from.
|
32
32
|
* @param {Function} filterFn A function which returns `true` when the desired element is reached.
|
33
33
|
* @param {HTMLElement} [limit] The element to stop at. This is *not* considered for matching.
|
34
|
-
* @returns {
|
34
|
+
* @returns {HTMLElement}
|
35
35
|
*/
|
36
36
|
static closest(el, filterFn, limit = document.body) {
|
37
37
|
while (el?.nodeType === Node.ELEMENT_NODE && el !== limit) {
|
38
38
|
if (filterFn(el)) {
|
39
|
-
return el
|
39
|
+
return el
|
40
40
|
}
|
41
|
-
el = el.parentNode;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
/**
|
46
|
-
* Analogous to the `HTMLElement` `querySelectorAll` method. Searches the passed element
|
47
|
-
* and all descendants for all elements for which the passed `filterFn` returns `true`.
|
48
|
-
* @param {HTMLElement} el The element to start from.
|
49
|
-
* @param {Function} filterFn A function which returns `true` when a desired element is reached.
|
50
|
-
* @returns {HTMLElement[]} An array of matching elements
|
51
|
-
*/
|
52
|
-
static queryAll(el, filterFn) {
|
53
|
-
return [el, ...el.querySelectorAll('*')].filter(filterFn);
|
54
|
-
}
|
55
41
|
|
56
|
-
|
57
|
-
|
58
|
-
* and all descendants for the first element for which the passed `filterFn` returns `true`.
|
59
|
-
* @param {HTMLElement} el The element to start from.
|
60
|
-
* @param {Function} filterFn A function which returns `true` when the desired element is reached.
|
61
|
-
* @returns {HTMLElement} The first matching element
|
62
|
-
*/
|
63
|
-
static query(el, filterFn) {
|
64
|
-
return [el, ...el.querySelectorAll('*')].find(filterFn);
|
42
|
+
el = el.parentNode
|
43
|
+
}
|
65
44
|
}
|
66
45
|
|
67
46
|
static isFocusable(e) {
|
68
47
|
// May be used as a scopeless callback, so use "DomUtils", not "this"
|
69
|
-
return DomUtils.isTabbable(e) || Number(e.getAttribute('tabIndex')) < 0
|
48
|
+
return DomUtils.isTabbable(e) || Number(e.getAttribute('tabIndex')) < 0
|
70
49
|
}
|
71
50
|
|
72
51
|
static isTabbable(e) {
|
@@ -86,4 +65,28 @@ export default class DomUtils extends Base {
|
|
86
65
|
(tabIndex != null && Number(tabIndex) >= 0) ||
|
87
66
|
e.contentEditable === 'true'
|
88
67
|
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Analogous to the `HTMLElement` `querySelector` method. Searches the passed element
|
71
|
+
* and all descendants for the first element for which the passed `filterFn` returns `true`.
|
72
|
+
* @param {HTMLElement} el The element to start from.
|
73
|
+
* @param {Function} filterFn A function which returns `true` when the desired element is reached.
|
74
|
+
* @returns {HTMLElement} The first matching element
|
75
|
+
*/
|
76
|
+
static query(el, filterFn) {
|
77
|
+
return [el, ...el.querySelectorAll('*')].find(filterFn);
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Analogous to the `HTMLElement` `querySelectorAll` method. Searches the passed element
|
82
|
+
* and all descendants for all elements for which the passed `filterFn` returns `true`.
|
83
|
+
* @param {HTMLElement} el The element to start from.
|
84
|
+
* @param {Function} filterFn A function which returns `true` when a desired element is reached.
|
85
|
+
* @returns {HTMLElement[]} An array of matching elements
|
86
|
+
*/
|
87
|
+
static queryAll(el, filterFn) {
|
88
|
+
return [el, ...el.querySelectorAll('*')].filter(filterFn)
|
89
|
+
}
|
89
90
|
}
|
91
|
+
|
92
|
+
export default Neo.setupClass(DomUtils);
|