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
@@ -29,260 +29,229 @@ class MainContainer extends Container {
|
|
29
29
|
margin: '20px'
|
30
30
|
},
|
31
31
|
|
32
|
-
items: [
|
33
|
-
|
34
|
-
ntype: 'container',
|
32
|
+
items: [{
|
33
|
+
ntype: 'container',
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
layout: {
|
42
|
-
ntype: 'vbox'
|
43
|
-
},
|
35
|
+
itemDefaults: {
|
36
|
+
flex : '0 1 auto',
|
37
|
+
labelWidth: '70px'
|
38
|
+
},
|
44
39
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
id : 'myPickerfield',
|
49
|
-
labelText: 'Picker',
|
50
|
-
width : 220
|
51
|
-
},
|
52
|
-
{
|
53
|
-
module : Button,
|
54
|
-
iconCls: 'fa fa-minus',
|
55
|
-
style : {marginTop: '20px'},
|
56
|
-
text : 'Remove Triggers',
|
57
|
-
width : 120,
|
58
|
-
handler: function() {
|
59
|
-
let field = Neo.getComponent('myPickerfield');
|
60
|
-
field.triggers = [];
|
61
|
-
}
|
62
|
-
},
|
63
|
-
{
|
64
|
-
module : Button,
|
65
|
-
iconCls: 'fa fa-plus',
|
66
|
-
text : 'Add Trigger',
|
67
|
-
width : 120,
|
68
|
-
handler: function() {
|
69
|
-
let field = Neo.getComponent('myPickerfield'),
|
70
|
-
fieldTriggers = field.triggers || [],
|
71
|
-
triggers = [...fieldTriggers]; // ensure to clone the array to not edit the internal oldValue by reference
|
40
|
+
layout: {
|
41
|
+
ntype: 'vbox'
|
42
|
+
},
|
72
43
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
44
|
+
items: [{
|
45
|
+
ntype : 'pickerfield',
|
46
|
+
id : 'myPickerfield',
|
47
|
+
labelText: 'Picker',
|
48
|
+
width : 220
|
49
|
+
}, {
|
50
|
+
module : Button,
|
51
|
+
iconCls: 'fa fa-minus',
|
52
|
+
style : {marginTop: '20px'},
|
53
|
+
text : 'Remove Triggers',
|
54
|
+
width : 120,
|
55
|
+
handler: function() {
|
56
|
+
let field = Neo.getComponent('myPickerfield');
|
57
|
+
field.triggers = [];
|
58
|
+
}
|
59
|
+
}, {
|
60
|
+
module : Button,
|
61
|
+
iconCls: 'fa fa-plus',
|
62
|
+
text : 'Add Trigger',
|
63
|
+
width : 120,
|
64
|
+
handler: function() {
|
65
|
+
let field = Neo.getComponent('myPickerfield'),
|
66
|
+
fieldTriggers = field.triggers || [],
|
67
|
+
triggers = [...fieldTriggers]; // ensure to clone the array to not edit the internal oldValue by reference
|
78
68
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
69
|
+
triggers.push({
|
70
|
+
id : Neo.getId('picker'),
|
71
|
+
cls : 'fa fa-caret-down',
|
72
|
+
handler: 'onPickerTriggerClick'
|
73
|
+
});
|
83
74
|
|
84
|
-
|
85
|
-
iconCls: 'fas fa-list',
|
86
|
-
text : 'Picker'
|
75
|
+
field.triggers = triggers;
|
87
76
|
}
|
77
|
+
}],
|
78
|
+
|
79
|
+
header: {
|
80
|
+
iconCls: 'fas fa-list',
|
81
|
+
text : 'Picker'
|
82
|
+
}
|
83
|
+
}, {
|
84
|
+
ntype: 'container',
|
85
|
+
|
86
|
+
itemDefaults: {
|
87
|
+
flex : '0 1 auto',
|
88
|
+
labelWidth: '70px'
|
88
89
|
},
|
89
|
-
{
|
90
|
-
ntype: 'container',
|
91
90
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
},
|
91
|
+
layout: {
|
92
|
+
ntype: 'vbox'
|
93
|
+
},
|
96
94
|
|
97
|
-
|
98
|
-
|
99
|
-
|
95
|
+
items: [{
|
96
|
+
ntype : 'checkboxfield',
|
97
|
+
checked : true,
|
98
|
+
labelText: 'Option 1',
|
99
|
+
name : 'group1'
|
100
|
+
}, {
|
101
|
+
ntype : 'checkboxfield',
|
102
|
+
labelText: 'Option 2',
|
103
|
+
name : 'group1'
|
104
|
+
}, {
|
105
|
+
ntype : 'checkboxfield',
|
106
|
+
labelText: 'Option 3',
|
107
|
+
name : 'group1'
|
108
|
+
}, {
|
109
|
+
ntype : 'checkboxfield',
|
110
|
+
checked : true,
|
111
|
+
hideValueLabel: false,
|
112
|
+
labelText : 'Group 2',
|
113
|
+
name : 'group2',
|
114
|
+
style : {marginTop: '20px'},
|
115
|
+
valueLabelText: 'Option 1'
|
116
|
+
}, {
|
117
|
+
ntype : 'checkboxfield',
|
118
|
+
hideValueLabel: false,
|
119
|
+
labelText : '',
|
120
|
+
name : 'group2',
|
121
|
+
valueLabelText: 'Option 2'
|
122
|
+
}, {
|
123
|
+
ntype : 'checkboxfield',
|
124
|
+
hideValueLabel: false,
|
125
|
+
labelText : '',
|
126
|
+
name : 'group2',
|
127
|
+
valueLabelText: 'Option 3'
|
128
|
+
}],
|
100
129
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
},
|
108
|
-
{
|
109
|
-
ntype : 'checkboxfield',
|
110
|
-
labelText: 'Option 2',
|
111
|
-
name : 'group1'
|
112
|
-
},
|
113
|
-
{
|
114
|
-
ntype : 'checkboxfield',
|
115
|
-
labelText: 'Option 3',
|
116
|
-
name : 'group1'
|
117
|
-
},
|
118
|
-
{
|
119
|
-
ntype : 'checkboxfield',
|
120
|
-
checked : true,
|
121
|
-
hideValueLabel: false,
|
122
|
-
labelText : 'Group 2',
|
123
|
-
name : 'group2',
|
124
|
-
style : {marginTop: '20px'},
|
125
|
-
valueLabelText: 'Option 1'
|
126
|
-
},
|
127
|
-
{
|
128
|
-
ntype : 'checkboxfield',
|
129
|
-
hideValueLabel: false,
|
130
|
-
labelText : '',
|
131
|
-
name : 'group2',
|
132
|
-
valueLabelText: 'Option 2'
|
133
|
-
},
|
134
|
-
{
|
135
|
-
ntype : 'checkboxfield',
|
136
|
-
hideValueLabel: false,
|
137
|
-
labelText : '',
|
138
|
-
name : 'group2',
|
139
|
-
valueLabelText: 'Option 3'
|
140
|
-
}
|
141
|
-
],
|
130
|
+
header: {
|
131
|
+
iconCls: 'fas fa-check-square',
|
132
|
+
text : 'CheckBox'
|
133
|
+
}
|
134
|
+
}, {
|
135
|
+
ntype: 'container',
|
142
136
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
}
|
137
|
+
itemDefaults: {
|
138
|
+
flex : '0 1 auto',
|
139
|
+
labelWidth: '70px'
|
147
140
|
},
|
148
|
-
{
|
149
|
-
ntype: 'container',
|
150
141
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
},
|
142
|
+
layout: {
|
143
|
+
ntype: 'vbox'
|
144
|
+
},
|
155
145
|
|
156
|
-
|
157
|
-
|
158
|
-
|
146
|
+
items: [{
|
147
|
+
ntype : 'radiofield',
|
148
|
+
checked : true,
|
149
|
+
labelText: 'Option 1',
|
150
|
+
name : 'group1'
|
151
|
+
}, {
|
152
|
+
ntype : 'radiofield',
|
153
|
+
labelText: 'Option 2',
|
154
|
+
name : 'group1'
|
155
|
+
}, {
|
156
|
+
ntype : 'radiofield',
|
157
|
+
labelText: 'Option 3',
|
158
|
+
name : 'group1'
|
159
|
+
}, {
|
160
|
+
ntype : 'radiofield',
|
161
|
+
checked : true,
|
162
|
+
hideValueLabel: false,
|
163
|
+
labelText : 'Group 2',
|
164
|
+
name : 'group2',
|
165
|
+
style : {marginTop: '20px'},
|
166
|
+
valueLabelText: 'Option 1'
|
167
|
+
}, {
|
168
|
+
ntype : 'radiofield',
|
169
|
+
hideValueLabel: false,
|
170
|
+
labelText : '',
|
171
|
+
name : 'group2',
|
172
|
+
valueLabelText: 'Option 2'
|
173
|
+
}, {
|
174
|
+
ntype : 'radiofield',
|
175
|
+
hideValueLabel: false,
|
176
|
+
labelText : '',
|
177
|
+
name : 'group2',
|
178
|
+
valueLabelText: 'Option 3'
|
179
|
+
}],
|
159
180
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
},
|
167
|
-
{
|
168
|
-
ntype : 'radiofield',
|
169
|
-
labelText: 'Option 2',
|
170
|
-
name : 'group1'
|
171
|
-
},
|
172
|
-
{
|
173
|
-
ntype : 'radiofield',
|
174
|
-
labelText: 'Option 3',
|
175
|
-
name : 'group1'
|
176
|
-
},
|
177
|
-
{
|
178
|
-
ntype : 'radiofield',
|
179
|
-
checked : true,
|
180
|
-
hideValueLabel: false,
|
181
|
-
labelText : 'Group 2',
|
182
|
-
name : 'group2',
|
183
|
-
style : {marginTop: '20px'},
|
184
|
-
valueLabelText: 'Option 1'
|
185
|
-
},
|
186
|
-
{
|
187
|
-
ntype : 'radiofield',
|
188
|
-
hideValueLabel: false,
|
189
|
-
labelText : '',
|
190
|
-
name : 'group2',
|
191
|
-
valueLabelText: 'Option 2'
|
192
|
-
},
|
193
|
-
{
|
194
|
-
ntype : 'radiofield',
|
195
|
-
hideValueLabel: false,
|
196
|
-
labelText : '',
|
197
|
-
name : 'group2',
|
198
|
-
valueLabelText: 'Option 3'
|
199
|
-
}
|
200
|
-
],
|
181
|
+
header: {
|
182
|
+
iconCls: 'far fa-circle',
|
183
|
+
text : 'Radio'
|
184
|
+
}
|
185
|
+
}, {
|
186
|
+
ntype: 'container',
|
201
187
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
}
|
188
|
+
itemDefaults: {
|
189
|
+
flex : '0 1 auto',
|
190
|
+
labelWidth: '120px'
|
206
191
|
},
|
207
|
-
{
|
208
|
-
ntype: 'container',
|
209
192
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
},
|
193
|
+
layout: {
|
194
|
+
ntype: 'vbox'
|
195
|
+
},
|
214
196
|
|
215
|
-
|
216
|
-
|
217
|
-
|
197
|
+
items: [{
|
198
|
+
ntype : 'rangefield',
|
199
|
+
labelText: '0-20, Step 1',
|
200
|
+
maxValue : 20,
|
201
|
+
minValue : 0,
|
202
|
+
value : 10
|
203
|
+
}, {
|
204
|
+
ntype : 'rangefield',
|
205
|
+
labelText: '0-20, Step 5',
|
206
|
+
maxValue : 20,
|
207
|
+
minValue : 0,
|
208
|
+
stepSize : 5,
|
209
|
+
value : 10
|
210
|
+
}],
|
218
211
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
value : 10
|
226
|
-
},
|
227
|
-
{
|
228
|
-
ntype : 'rangefield',
|
229
|
-
labelText: '0-20, Step 5',
|
230
|
-
maxValue : 20,
|
231
|
-
minValue : 0,
|
232
|
-
stepSize : 5,
|
233
|
-
value : 10
|
234
|
-
}
|
235
|
-
],
|
212
|
+
header: {
|
213
|
+
iconCls: 'fa fa-exchange-alt',
|
214
|
+
text : 'Range'
|
215
|
+
}
|
216
|
+
}, {
|
217
|
+
ntype: 'container',
|
236
218
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
}
|
219
|
+
itemDefaults: {
|
220
|
+
flex : '0 1 auto',
|
221
|
+
labelWidth: '120px'
|
241
222
|
},
|
242
|
-
{
|
243
|
-
ntype: 'container',
|
244
223
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
},
|
249
|
-
|
250
|
-
layout: {
|
251
|
-
ntype: 'vbox'
|
252
|
-
},
|
224
|
+
layout: {
|
225
|
+
ntype: 'vbox'
|
226
|
+
},
|
253
227
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
228
|
+
items: [{
|
229
|
+
ntype : 'numberfield',
|
230
|
+
labelText: '0-20, Step 1',
|
231
|
+
maxValue : 20,
|
232
|
+
minValue : 0,
|
233
|
+
value : 10
|
234
|
+
}, {
|
235
|
+
ntype : 'numberfield',
|
236
|
+
labelText: '0-20, Step 5',
|
237
|
+
maxValue : 20,
|
238
|
+
minValue : 0,
|
239
|
+
stepSize : 5,
|
240
|
+
value : 10
|
241
|
+
}],
|
242
|
+
header: {
|
243
|
+
iconCls: 'fa fa-sort-numeric-up',
|
244
|
+
text : 'Number'
|
245
|
+
}
|
246
|
+
}, {
|
247
|
+
header: {
|
248
|
+
iconCls: 'fa fa-calendar',
|
249
|
+
text : 'Date'
|
275
250
|
},
|
276
|
-
{
|
277
|
-
|
278
|
-
iconCls: 'fa fa-calendar',
|
279
|
-
text : 'Date'
|
280
|
-
},
|
281
|
-
vdom: {
|
282
|
-
innerHTML: 'todo'
|
283
|
-
}
|
251
|
+
vdom: {
|
252
|
+
innerHTML: 'todo'
|
284
253
|
}
|
285
|
-
]
|
254
|
+
}]
|
286
255
|
}
|
287
256
|
}
|
288
257
|
|
@@ -37,7 +37,7 @@ class MainContainer extends Viewport {
|
|
37
37
|
},
|
38
38
|
|
39
39
|
items: [{
|
40
|
-
|
40
|
+
header: {
|
41
41
|
iconCls: 'fa fa-user-astronaut',
|
42
42
|
text : 'Bob'
|
43
43
|
},
|
@@ -47,7 +47,7 @@ class MainContainer extends Viewport {
|
|
47
47
|
src: 'https://raw.githubusercontent.com/neomjs/pages/main/resources_pub/examples/ai_images/000150.jpg'
|
48
48
|
}
|
49
49
|
}, {
|
50
|
-
|
50
|
+
header: {
|
51
51
|
iconCls: 'fa fa-user-ninja',
|
52
52
|
text : 'Alice'
|
53
53
|
},
|
@@ -1,29 +1,29 @@
|
|
1
|
-
import ComponentModel from '../../../src/model/Component.mjs';
|
2
1
|
import DisplayField from '../../../src/form/field/Display.mjs';
|
3
2
|
import MainContainerController from './MainContainerController.mjs'
|
4
3
|
import Panel from '../../../src/container/Panel.mjs';
|
4
|
+
import StateProvider from '../../../src/state/Provider.mjs';
|
5
5
|
import TextField from '../../../src/form/field/Text.mjs';
|
6
6
|
import Viewport from '../../../src/container/Viewport.mjs';
|
7
7
|
|
8
8
|
/**
|
9
|
-
* @class Neo.examples.
|
9
|
+
* @class Neo.examples.stateProvider.advanced.MainContainer
|
10
10
|
* @extends Neo.container.Viewport
|
11
11
|
*/
|
12
12
|
class MainContainer extends Viewport {
|
13
13
|
static config = {
|
14
14
|
/**
|
15
|
-
* @member {String} className='Neo.examples.
|
15
|
+
* @member {String} className='Neo.examples.stateProvider.advanced.MainContainer'
|
16
16
|
* @protected
|
17
17
|
*/
|
18
|
-
className: 'Neo.examples.
|
18
|
+
className: 'Neo.examples.stateProvider.advanced.MainContainer',
|
19
19
|
/**
|
20
20
|
* @member {Neo.controller.Component} controller=MainContainerController
|
21
21
|
*/
|
22
22
|
controller: MainContainerController,
|
23
23
|
/**
|
24
|
-
* @member {Object|Neo.
|
24
|
+
* @member {Object|Neo.state.Provider} stateProvider
|
25
25
|
*/
|
26
|
-
|
26
|
+
stateProvider: {
|
27
27
|
data: {
|
28
28
|
button1Text: 'Button 1',
|
29
29
|
button3Text: 'Button 3'
|
@@ -42,7 +42,7 @@ class MainContainer extends Viewport {
|
|
42
42
|
module : Panel,
|
43
43
|
reference: 'panel',
|
44
44
|
|
45
|
-
|
45
|
+
stateProvider: {
|
46
46
|
data: {
|
47
47
|
button2Text: 'Button 2'
|
48
48
|
}
|
@@ -64,7 +64,7 @@ class MainContainer extends Viewport {
|
|
64
64
|
|
65
65
|
items: [{
|
66
66
|
ntype: 'label',
|
67
|
-
text : '
|
67
|
+
text : 'state.Provider: advanced'
|
68
68
|
}, {
|
69
69
|
ntype: 'component',
|
70
70
|
flex : 1
|
@@ -142,14 +142,14 @@ class MainContainer extends Viewport {
|
|
142
142
|
text : 'Add a third button & textfield'
|
143
143
|
}, {
|
144
144
|
ntype : 'button',
|
145
|
-
handler: '
|
145
|
+
handler: 'onLogMainStateProviderIntoConsoleButtonClick',
|
146
146
|
style : {marginTop: '1em'},
|
147
|
-
text : 'Log main
|
147
|
+
text : 'Log main stateProvider into console'
|
148
148
|
}, {
|
149
149
|
ntype : 'button',
|
150
|
-
handler: '
|
150
|
+
handler: 'onLogChildStateProviderIntoConsoleButtonClick',
|
151
151
|
style : {marginTop: '1em'},
|
152
|
-
text : 'Log child
|
152
|
+
text : 'Log child stateProvider into console'
|
153
153
|
}]
|
154
154
|
}]
|
155
155
|
}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import Controller from '../../../src/controller/Component.mjs';
|
2
2
|
|
3
3
|
/**
|
4
|
-
* @class Neo.examples.
|
4
|
+
* @class Neo.examples.stateProvider.advanced.MainContainerController
|
5
5
|
* @extends Neo.controller.Component
|
6
6
|
*/
|
7
7
|
class MainContainerController extends Controller {
|
8
8
|
static config = {
|
9
9
|
/**
|
10
|
-
* @member {String} className='Neo.examples.
|
10
|
+
* @member {String} className='Neo.examples.stateProvider.advanced.MainContainerController'
|
11
11
|
* @protected
|
12
12
|
*/
|
13
|
-
className: 'Neo.examples.
|
13
|
+
className: 'Neo.examples.stateProvider.advanced.MainContainerController'
|
14
14
|
}
|
15
15
|
|
16
16
|
/**
|
@@ -81,15 +81,15 @@ class MainContainerController extends Controller {
|
|
81
81
|
/**
|
82
82
|
* @param {Object} data
|
83
83
|
*/
|
84
|
-
|
85
|
-
console.log(this.getReference('panel').
|
84
|
+
onLogChildStateProviderIntoConsoleButtonClick(data) {
|
85
|
+
console.log(this.getReference('panel').stateProvider)
|
86
86
|
}
|
87
87
|
|
88
88
|
/**
|
89
89
|
* @param {Object} data
|
90
90
|
*/
|
91
|
-
|
92
|
-
console.log(this.
|
91
|
+
onLogMainStateProviderIntoConsoleButtonClick(data) {
|
92
|
+
console.log(this.getStateProvider())
|
93
93
|
}
|
94
94
|
|
95
95
|
/**
|
@@ -124,14 +124,14 @@ class MainContainerController extends Controller {
|
|
124
124
|
*/
|
125
125
|
updateButton1Text(value) {
|
126
126
|
// test to access a child model instead to check if the data value bubbles up
|
127
|
-
this.getReference('panel').
|
127
|
+
this.getReference('panel').setState('button1Text', value)
|
128
128
|
}
|
129
129
|
|
130
130
|
/**
|
131
131
|
* @param {String} value
|
132
132
|
*/
|
133
133
|
updateButton2Text(value) {
|
134
|
-
this.getReference('panel').
|
134
|
+
this.getReference('panel').setState({
|
135
135
|
button2Text: value
|
136
136
|
})
|
137
137
|
}
|
@@ -140,7 +140,7 @@ class MainContainerController extends Controller {
|
|
140
140
|
* @param {String} value
|
141
141
|
*/
|
142
142
|
updateButton3Text(value) {
|
143
|
-
this.
|
143
|
+
this.getStateProvider().data['button3Text'] = value
|
144
144
|
}
|
145
145
|
}
|
146
146
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
5
5
|
<meta charset="UTF-8">
|
6
|
-
<title>
|
6
|
+
<title>state.Provider: advanced</title>
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
<script src="../../../src/MicroLoader.mjs" type="module"></script>
|
@@ -3,16 +3,16 @@ import EditUserDialogController from './EditUserDialogController.mjs';
|
|
3
3
|
import TextField from '../../../src/form/field/Text.mjs';
|
4
4
|
|
5
5
|
/**
|
6
|
-
* @class Neo.examples.
|
6
|
+
* @class Neo.examples.stateProvider.dialog.EditUserDialog
|
7
7
|
* @extends Neo.dialog.Base
|
8
8
|
*/
|
9
9
|
class EditUserDialog extends Dialog {
|
10
10
|
static config = {
|
11
11
|
/**
|
12
|
-
* @member {String} className='Neo.examples.
|
12
|
+
* @member {String} className='Neo.examples.stateProvider.dialog.EditUserDialog'
|
13
13
|
* @protected
|
14
14
|
*/
|
15
|
-
className: 'Neo.examples.
|
15
|
+
className: 'Neo.examples.stateProvider.dialog.EditUserDialog',
|
16
16
|
/**
|
17
17
|
* @member {Object} containerConfig={style:{padding:'1em'}}
|
18
18
|
*/
|