neo.mjs 4.0.15 → 4.0.16
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/covid/view/WorldMapContainer.mjs +1 -1
- package/apps/realworld2/view/HeaderToolbar.mjs +2 -2
- package/apps/realworld2/view/article/FormContainer.mjs +1 -1
- package/apps/realworld2/view/user/LoginFormContainer.mjs +1 -1
- package/apps/realworld2/view/user/SettingsFormContainer.mjs +1 -1
- package/apps/sharedcovid/view/WorldMapContainer.mjs +1 -1
- package/apps/shareddialog/view/MainContainer.mjs +1 -1
- package/apps/shareddialog2/view/MainContainer.mjs +1 -1
- package/examples/calendar/basic/MainContainer.mjs +1 -1
- package/examples/component/wrapper/cesiumJS/MainContainer.mjs +1 -1
- package/examples/dialog/MainContainer.mjs +1 -1
- package/examples/list/animate/MainContainer.mjs +1 -1
- package/examples/remotesApi/basic/MainContainer.mjs +1 -1
- package/examples/todoList/version2/MainContainer.mjs +1 -1
- package/examples/toolbar/paging/app.mjs +6 -0
- package/examples/toolbar/paging/index.html +11 -0
- package/examples/toolbar/paging/model/User.mjs +38 -0
- package/examples/toolbar/paging/neo-config.json +8 -0
- package/examples/toolbar/paging/remotes-api.json +21 -0
- package/examples/toolbar/paging/store/Users.mjs +39 -0
- package/examples/toolbar/paging/view/AddUserDialog.mjs +67 -0
- package/examples/toolbar/paging/view/MainContainer.mjs +44 -0
- package/examples/toolbar/paging/view/MainContainerController.mjs +53 -0
- package/examples/toolbar/paging/view/MainContainerModel.mjs +29 -0
- package/examples/toolbar/paging/view/UserTableContainer.mjs +39 -0
- package/package.json +5 -5
- package/resources/scss/src/{container/Toolbar.scss → toolbar/Base.scss} +0 -0
- package/resources/scss/src/toolbar/Paging.scss +5 -0
- package/resources/scss/theme-dark/{container/Toolbar.scss → toolbar/Base.scss} +0 -0
- package/resources/scss/theme-light/{container/Toolbar.scss → toolbar/Base.scss} +0 -0
- package/src/calendar/view/MainContainer.mjs +1 -1
- package/src/container/Base.mjs +1 -1
- package/src/container/Panel.mjs +1 -1
- package/src/data/Store.mjs +44 -5
- package/src/dialog/Base.mjs +1 -1
- package/src/form/field/Select.mjs +14 -4
- package/src/grid/header/Toolbar.mjs +2 -2
- package/src/list/Base.mjs +1 -0
- package/src/tab/Container.mjs +1 -1
- package/src/tab/header/Toolbar.mjs +2 -2
- package/src/table/View.mjs +4 -0
- package/src/table/header/Toolbar.mjs +2 -2
- package/src/{container/Toolbar.mjs → toolbar/Base.mjs} +7 -7
- package/src/toolbar/Paging.mjs +280 -0
- package/src/util/ClassSystem.mjs +7 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Container from '../../../src/container/Base.mjs';
|
|
2
2
|
import NumberField from '../../../src/form/field/Number.mjs';
|
|
3
|
-
import Toolbar from '../../../src/
|
|
3
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
4
4
|
import WorldMapComponent from './WorldMapComponent.mjs';
|
|
5
5
|
import WorldMapContainerController from './WorldMapContainerController.mjs';
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import HeaderToolbarController from './HeaderToolbarController.mjs';
|
|
2
|
-
import Toolbar from '../../../src/
|
|
2
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @class RealWorld2.view.HeaderToolbar
|
|
6
|
-
* @extends Neo.
|
|
6
|
+
* @extends Neo.toolbar.Base
|
|
7
7
|
*/
|
|
8
8
|
class HeaderToolbar extends Toolbar {
|
|
9
9
|
static getConfig() {return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ChipField from '../../../../src/form/field/Chip.mjs';
|
|
2
2
|
import Container from '../../../../src/form/Container.mjs';
|
|
3
3
|
import TextArea from '../../../../src/form/field/TextArea.mjs';
|
|
4
|
-
import Toolbar from '../../../../src/
|
|
4
|
+
import Toolbar from '../../../../src/toolbar/Base.mjs';
|
|
5
5
|
import TextField from '../../../../src/form/field/Text.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Container from '../../../../src/form/Container.mjs';
|
|
2
2
|
import PasswordField from '../../../../src/form/field/Password.mjs';
|
|
3
3
|
import TextField from '../../../../src/form/field/Text.mjs';
|
|
4
|
-
import Toolbar from '../../../../src/
|
|
4
|
+
import Toolbar from '../../../../src/toolbar/Base.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @class RealWorld2.view.user.LoginFormContainer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Container from '../../../../src/form/Container.mjs';
|
|
2
2
|
import TextField from '../../../../src/form/field/Text.mjs';
|
|
3
|
-
import Toolbar from '../../../../src/
|
|
3
|
+
import Toolbar from '../../../../src/toolbar/Base.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @class RealWorld2.view.user.SettingsFormContainer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Container from '../../../src/container/Base.mjs';
|
|
2
2
|
import NumberField from '../../../src/form/field/Number.mjs';
|
|
3
|
-
import Toolbar from '../../../src/
|
|
3
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
4
4
|
import WorldMapComponent from './WorldMapComponent.mjs';
|
|
5
5
|
import WorldMapContainerController from './WorldMapContainerController.mjs';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Button from '../../../src/button/Base.mjs';
|
|
2
2
|
import Radio from '../../../src/form/field/Radio.mjs';
|
|
3
3
|
import MainContainerController from './MainContainerController.mjs';
|
|
4
|
-
import Toolbar from '../../../src/
|
|
4
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
5
5
|
import Viewport from '../../../src/container/Viewport.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Button from '../../../src/button/Base.mjs';
|
|
2
2
|
import MainContainerController from './MainContainerController.mjs';
|
|
3
|
-
import Toolbar from '../../../src/
|
|
3
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
4
4
|
import Viewport from '../../../src/container/Viewport.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Button from '../../../src/button/Base.mjs';
|
|
2
2
|
import Calendar from '../../../src/calendar/view/MainContainer.mjs';
|
|
3
3
|
import MainContainerController from './MainContainerController.mjs';
|
|
4
|
-
import Toolbar from '../../../src/
|
|
4
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
5
5
|
import Viewport from '../../../src/container/Viewport.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Button from '../../../../src/button/Base.mjs';
|
|
2
2
|
import CesiumJSComponent from '../../../../src/component/wrapper/CesiumJS.mjs';
|
|
3
3
|
import MainContainerController from './MainContainerController.mjs';
|
|
4
|
-
import Toolbar from '../../../../src/
|
|
4
|
+
import Toolbar from '../../../../src/toolbar/Base.mjs';
|
|
5
5
|
import Viewport from '../../../../src/container/Viewport.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Button from '../../src/button/Base.mjs';
|
|
2
2
|
import CheckBox from '../../src/form/field/CheckBox.mjs';
|
|
3
3
|
import NeoArray from '../../src/util/Array.mjs';
|
|
4
|
-
import Toolbar from '../../src/
|
|
4
|
+
import Toolbar from '../../src/toolbar/Base.mjs';
|
|
5
5
|
import DemoDialog from './DemoDialog.mjs';
|
|
6
6
|
import Viewport from '../../src/container/Viewport.mjs';
|
|
7
7
|
|
|
@@ -4,7 +4,7 @@ import MainContainerController from './MainContainerController.mjs';
|
|
|
4
4
|
import MainStore from './MainStore.mjs';
|
|
5
5
|
import NumberField from '../../../src/form/field/Number.mjs';
|
|
6
6
|
import TextField from '../../../src/form/field/Text.mjs';
|
|
7
|
-
import Toolbar from '../../../src/
|
|
7
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
8
8
|
import Viewport from '../../../src/container/Viewport.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Button from '../../../src/button/Base.mjs';
|
|
2
2
|
import MainContainerController from './MainContainerController.mjs';
|
|
3
|
-
import Toolbar from '../../../src/
|
|
3
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
4
4
|
import Viewport from '../../../src/container/Viewport.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -3,7 +3,7 @@ import Container from '../../../src/container/Base.mjs';
|
|
|
3
3
|
import TextField from '../../../src/form/field/Text.mjs';
|
|
4
4
|
import TodoList from './TodoList.mjs';
|
|
5
5
|
import TodoListStore from './TodoListStore.mjs';
|
|
6
|
-
import Toolbar from '../../../src/
|
|
6
|
+
import Toolbar from '../../../src/toolbar/Base.mjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @class Neo.examples.todoList.version2.MainContainer
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!DOCTYPE HTML>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<title>Neo Paging Toolbar</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<script src="../../../src/MicroLoader.mjs" type="module"></script>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Model from '../../../../src/data/Model.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @class Neo.examples.toolbar.paging.model.User
|
|
5
|
+
* @extends Neo.data.Model
|
|
6
|
+
*/
|
|
7
|
+
class User extends Model {
|
|
8
|
+
static getConfig() {return {
|
|
9
|
+
/**
|
|
10
|
+
* @member {String} className='Neo.examples.toolbar.paging.model.User'
|
|
11
|
+
* @protected
|
|
12
|
+
*/
|
|
13
|
+
className: 'Neo.examples.toolbar.paging.model.User',
|
|
14
|
+
/**
|
|
15
|
+
* @member {Object[]} fields
|
|
16
|
+
*/
|
|
17
|
+
fields: [{
|
|
18
|
+
name: 'firstname',
|
|
19
|
+
type: 'String'
|
|
20
|
+
}, {
|
|
21
|
+
name: 'id',
|
|
22
|
+
type: 'Integer'
|
|
23
|
+
}, {
|
|
24
|
+
name: 'image',
|
|
25
|
+
type: 'String'
|
|
26
|
+
}, {
|
|
27
|
+
name: 'isOnline',
|
|
28
|
+
type: 'Boolean'
|
|
29
|
+
}, {
|
|
30
|
+
name: 'lastname',
|
|
31
|
+
type: 'String'
|
|
32
|
+
}]
|
|
33
|
+
}}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Neo.applyClassConfig(User);
|
|
37
|
+
|
|
38
|
+
export default User;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"namespace": "MyApp.backend",
|
|
3
|
+
"type" : "websocket",
|
|
4
|
+
"url" : "ws://localhost:3001",
|
|
5
|
+
|
|
6
|
+
"services": {
|
|
7
|
+
"FriendService": {
|
|
8
|
+
"methods": {
|
|
9
|
+
"getAll": {}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"UserService": {
|
|
13
|
+
"methods": {
|
|
14
|
+
"create" : {},
|
|
15
|
+
"destroy": {},
|
|
16
|
+
"read" : {"params": [{"type": "Object"}]},
|
|
17
|
+
"update" : {}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import UserModel from '../model/User.mjs';
|
|
2
|
+
import Store from '../../../../src/data/Store.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @class Neo.examples.toolbar.paging.store.Users
|
|
6
|
+
* @extends Neo.data.Store
|
|
7
|
+
*/
|
|
8
|
+
class Users extends Store {
|
|
9
|
+
static getConfig() {return {
|
|
10
|
+
/**
|
|
11
|
+
* @member {String} className='Neo.examples.toolbar.paging.store.Users'
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
className: 'Neo.examples.toolbar.paging.store.Users',
|
|
15
|
+
/**
|
|
16
|
+
* @member {Object|String|null} api
|
|
17
|
+
*/
|
|
18
|
+
api: 'MyApp.backend.UserService',
|
|
19
|
+
/**
|
|
20
|
+
* @member {Boolean} autoLoad=true
|
|
21
|
+
*/
|
|
22
|
+
autoLoad: true,
|
|
23
|
+
/**
|
|
24
|
+
* @member {Neo.data.Model} model=UserModel
|
|
25
|
+
*/
|
|
26
|
+
model: UserModel,
|
|
27
|
+
/**
|
|
28
|
+
* @member {Object[]} sorters
|
|
29
|
+
*/
|
|
30
|
+
sorters: [{
|
|
31
|
+
direction: 'ASC',
|
|
32
|
+
property : 'id'
|
|
33
|
+
}]
|
|
34
|
+
}}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Neo.applyClassConfig(Users);
|
|
38
|
+
|
|
39
|
+
export default Users;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Dialog from '../../../../src/dialog/Base.mjs';
|
|
2
|
+
import TextField from '../../../../src/form/field/Text.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @class Neo.examples.toolbar.paging.view.AddUserDialog
|
|
6
|
+
* @extends Neo.dialog.Base
|
|
7
|
+
*/
|
|
8
|
+
class AddUserDialog extends Dialog {
|
|
9
|
+
static getConfig() {return {
|
|
10
|
+
/**
|
|
11
|
+
* @member {String} className='Neo.examples.toolbar.paging.view.AddUserDialog'
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
className: 'Neo.examples.toolbar.paging.view.AddUserDialog',
|
|
15
|
+
/**
|
|
16
|
+
* @member {Object} containerConfig={style:{padding:'1em'}}
|
|
17
|
+
*/
|
|
18
|
+
containerConfig: {
|
|
19
|
+
style: {
|
|
20
|
+
padding: '1em'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* @member {Object[]} headers
|
|
25
|
+
*/
|
|
26
|
+
headers: [{
|
|
27
|
+
cls : ['neo-footer-toolbar', 'neo-toolbar'],
|
|
28
|
+
dock : 'bottom',
|
|
29
|
+
items: ['->', {
|
|
30
|
+
text: 'Submit'
|
|
31
|
+
}]
|
|
32
|
+
}],
|
|
33
|
+
/**
|
|
34
|
+
* @member {Object[]} items
|
|
35
|
+
*/
|
|
36
|
+
items: [{
|
|
37
|
+
module : TextField,
|
|
38
|
+
flex : 'none',
|
|
39
|
+
labelText : 'Firstname:',
|
|
40
|
+
labelWidth: 110
|
|
41
|
+
}, {
|
|
42
|
+
module : TextField,
|
|
43
|
+
flex : 'none',
|
|
44
|
+
labelText : 'Lastname:',
|
|
45
|
+
labelWidth: 110
|
|
46
|
+
}],
|
|
47
|
+
/**
|
|
48
|
+
* @member {Boolean} resizable=false
|
|
49
|
+
*/
|
|
50
|
+
resizable: false,
|
|
51
|
+
/**
|
|
52
|
+
* @member {String} title='Edit User'
|
|
53
|
+
*/
|
|
54
|
+
title: 'Add User',
|
|
55
|
+
/**
|
|
56
|
+
* @member {Object} wrapperStyle={height:'300px',width:'400px'}
|
|
57
|
+
*/
|
|
58
|
+
wrapperStyle: {
|
|
59
|
+
height: '300px',
|
|
60
|
+
width : '400px'
|
|
61
|
+
}
|
|
62
|
+
}}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
Neo.applyClassConfig(AddUserDialog);
|
|
66
|
+
|
|
67
|
+
export default AddUserDialog;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import MainContainerController from './MainContainerController.mjs';
|
|
2
|
+
import MainContainerModel from './MainContainerModel.mjs';
|
|
3
|
+
import PagingToolbar from '../../../../src/toolbar/Paging.mjs';
|
|
4
|
+
import UserTableContainer from './UserTableContainer.mjs';
|
|
5
|
+
import Viewport from '../../../../src/container/Viewport.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class Neo.examples.toolbar.paging.view.MainContainer
|
|
9
|
+
* @extends Neo.container.Viewport
|
|
10
|
+
*/
|
|
11
|
+
class MainContainer extends Viewport {
|
|
12
|
+
static getConfig() {return {
|
|
13
|
+
className : 'Neo.examples.toolbar.paging.view.MainContainer',
|
|
14
|
+
autoMount : true,
|
|
15
|
+
controller: MainContainerController,
|
|
16
|
+
layout : {ntype: 'vbox', align: 'stretch'},
|
|
17
|
+
model : MainContainerModel,
|
|
18
|
+
style : {padding: '20px'},
|
|
19
|
+
|
|
20
|
+
items: [{
|
|
21
|
+
ntype: 'toolbar',
|
|
22
|
+
flex : 'none',
|
|
23
|
+
items: ['->', {
|
|
24
|
+
handler: 'onAddUserButtonClick',
|
|
25
|
+
iconCls: 'fa fa-circle-plus',
|
|
26
|
+
text : 'Add User'
|
|
27
|
+
}]
|
|
28
|
+
}, {
|
|
29
|
+
module : UserTableContainer,
|
|
30
|
+
bind : {store: 'stores.users'},
|
|
31
|
+
flex : 1,
|
|
32
|
+
reference : 'user-table',
|
|
33
|
+
wrapperStyle: {maxHeight: '300px'}
|
|
34
|
+
}, {
|
|
35
|
+
module: PagingToolbar,
|
|
36
|
+
bind : {store: 'stores.users'},
|
|
37
|
+
flex : 'none'
|
|
38
|
+
}]
|
|
39
|
+
}}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Neo.applyClassConfig(MainContainer);
|
|
43
|
+
|
|
44
|
+
export default MainContainer;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import ComponentController from '../../../../src/controller/Component.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @class Neo.examples.toolbar.paging.view.MainContainerController
|
|
5
|
+
* @extends Neo.controller.Component
|
|
6
|
+
*/
|
|
7
|
+
class MainContainerController extends ComponentController {
|
|
8
|
+
/**
|
|
9
|
+
* @member {Neo.examples.toolbar.paging.view.AddUserDialog|null} addUserDialog=null
|
|
10
|
+
*/
|
|
11
|
+
addUserDialog = null
|
|
12
|
+
|
|
13
|
+
static getConfig() {return {
|
|
14
|
+
/**
|
|
15
|
+
* @member {String} className='Neo.examples.toolbar.paging.view.MainContainerController'
|
|
16
|
+
* @protected
|
|
17
|
+
*/
|
|
18
|
+
className: 'Neo.examples.toolbar.paging.view.MainContainerController'
|
|
19
|
+
}}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {Object} data
|
|
23
|
+
*/
|
|
24
|
+
onAddUserButtonClick(data) {
|
|
25
|
+
let me = this;
|
|
26
|
+
|
|
27
|
+
if (!me.addUserDialog) {
|
|
28
|
+
import('./AddUserDialog.mjs').then(module => {
|
|
29
|
+
me.addUserDialog = Neo.create(module.default, {
|
|
30
|
+
animateTargetId: data.component.id,
|
|
31
|
+
appName : me.component.appName,
|
|
32
|
+
closeAction : 'hide'
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
me.addUserDialog.show();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Sending messages through a WebSocket inside the data worker
|
|
42
|
+
* @param {Object} data
|
|
43
|
+
*/
|
|
44
|
+
onUserServiceReadButtonClick(data) {
|
|
45
|
+
MyApp.backend.UserService.read().then(response => {
|
|
46
|
+
console.log(response);
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Neo.applyClassConfig(MainContainerController);
|
|
52
|
+
|
|
53
|
+
export default MainContainerController;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Component from '../../../../src/model/Component.mjs';
|
|
2
|
+
import UserStore from '../store/Users.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @class Neo.examples.toolbar.paging.view.MainContainerModel
|
|
6
|
+
* @extends Neo.model.Component
|
|
7
|
+
*/
|
|
8
|
+
class MainContainerModel extends Component {
|
|
9
|
+
static getConfig() {return {
|
|
10
|
+
/**
|
|
11
|
+
* @member {String} className='Neo.examples.toolbar.paging.view.MainContainerModel'
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
className: 'Neo.examples.toolbar.paging.view.MainContainerModel',
|
|
15
|
+
/**
|
|
16
|
+
* @member {Object} stores
|
|
17
|
+
*/
|
|
18
|
+
stores: {
|
|
19
|
+
users: {
|
|
20
|
+
module : UserStore,
|
|
21
|
+
pageSize: 30
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
Neo.applyClassConfig(MainContainerModel);
|
|
28
|
+
|
|
29
|
+
export default MainContainerModel;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import TableContainer from '../../../../src/table/Container.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @class Neo.examples.toolbar.paging.view.UserTableContainer
|
|
5
|
+
* @extends Neo.table.Container
|
|
6
|
+
*/
|
|
7
|
+
class UserTableContainer extends TableContainer {
|
|
8
|
+
static getConfig() {return {
|
|
9
|
+
/**
|
|
10
|
+
* @member {String} className='Neo.examples.toolbar.paging.view.UserTableContainer'
|
|
11
|
+
* @protected
|
|
12
|
+
*/
|
|
13
|
+
className: 'Neo.examples.toolbar.paging.view.UserTableContainer',
|
|
14
|
+
/**
|
|
15
|
+
* @member {Object[]} columns
|
|
16
|
+
*/
|
|
17
|
+
columns: [{
|
|
18
|
+
dataField: 'id',
|
|
19
|
+
text : 'Id'
|
|
20
|
+
}, {
|
|
21
|
+
dataField: 'firstname',
|
|
22
|
+
text : 'Firstname'
|
|
23
|
+
}, {
|
|
24
|
+
dataField: 'lastname',
|
|
25
|
+
text : 'Lastname'
|
|
26
|
+
}, {
|
|
27
|
+
dataField: 'isOnline',
|
|
28
|
+
text : 'Is Online'
|
|
29
|
+
}, {
|
|
30
|
+
dataField: 'image',
|
|
31
|
+
flex : 1,
|
|
32
|
+
text : 'Image'
|
|
33
|
+
}]
|
|
34
|
+
}}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Neo.applyClassConfig(UserTableContainer);
|
|
38
|
+
|
|
39
|
+
export default UserTableContainer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neo.mjs",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.16",
|
|
4
4
|
"description": "The webworkers driven UI framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"homepage": "https://neomjs.github.io/pages/",
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@fortawesome/fontawesome-free": "^6.1.1",
|
|
38
|
-
"@material/mwc-button": "^0.
|
|
39
|
-
"@material/mwc-textfield": "^0.
|
|
40
|
-
"autoprefixer": "^10.4.
|
|
38
|
+
"@material/mwc-button": "^0.26.0",
|
|
39
|
+
"@material/mwc-textfield": "^0.26.0",
|
|
40
|
+
"autoprefixer": "^10.4.7",
|
|
41
41
|
"chalk": "^5.0.1",
|
|
42
42
|
"clean-webpack-plugin": "^4.0.0",
|
|
43
43
|
"commander": "^9.2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"sass": "^1.51.0",
|
|
53
53
|
"webpack": "^5.72.0",
|
|
54
54
|
"webpack-cli": "^4.9.2",
|
|
55
|
-
"webpack-dev-server": "4.
|
|
55
|
+
"webpack-dev-server": "4.9.0",
|
|
56
56
|
"webpack-hook-plugin": "^1.0.7",
|
|
57
57
|
"webpack-node-externals": "^3.0.0"
|
|
58
58
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ import DateUtil from '../../util/Date.mjs';
|
|
|
5
5
|
import EditCalendarContainer from './calendars/EditContainer.mjs';
|
|
6
6
|
import EditEventContainer from './EditEventContainer.mjs';
|
|
7
7
|
import MainContainerModel from './MainContainerModel.mjs';
|
|
8
|
-
import Toolbar from '../../
|
|
8
|
+
import Toolbar from '../../toolbar/Base.mjs';
|
|
9
9
|
|
|
10
10
|
const todayDate = new Date();
|
|
11
11
|
|
package/src/container/Base.mjs
CHANGED
|
@@ -37,7 +37,7 @@ class Base extends Component {
|
|
|
37
37
|
* @example
|
|
38
38
|
* import Button from '../button/Base.mjs';
|
|
39
39
|
* import MyRedButton from 'myapp/MyRedButton.mjs';
|
|
40
|
-
* import Toolbar from '../
|
|
40
|
+
* import Toolbar from '../toolbar/Base.mjs';
|
|
41
41
|
*
|
|
42
42
|
* let myButton = Neo.create(Button, {
|
|
43
43
|
* text: 'Button1'
|
package/src/container/Panel.mjs
CHANGED
package/src/data/Store.mjs
CHANGED
|
@@ -50,6 +50,10 @@ class Store extends Base {
|
|
|
50
50
|
* @member {Boolean} autoLoad=false
|
|
51
51
|
*/
|
|
52
52
|
autoLoad: false,
|
|
53
|
+
/**
|
|
54
|
+
* @member {Number} currentPage_=1
|
|
55
|
+
*/
|
|
56
|
+
currentPage_: 1,
|
|
53
57
|
/**
|
|
54
58
|
* @member {Array|null} data_=null
|
|
55
59
|
*/
|
|
@@ -74,6 +78,11 @@ class Store extends Base {
|
|
|
74
78
|
* @member {Neo.data.Model} model_=null
|
|
75
79
|
*/
|
|
76
80
|
model_: null,
|
|
81
|
+
/**
|
|
82
|
+
* Use a value of 0 to not limit the pageSize
|
|
83
|
+
* @member {Number} pageSize_=0
|
|
84
|
+
*/
|
|
85
|
+
pageSize_: 0,
|
|
77
86
|
/**
|
|
78
87
|
* True to let the backend handle the filtering.
|
|
79
88
|
* Useful for buffered stores
|
|
@@ -86,6 +95,10 @@ class Store extends Base {
|
|
|
86
95
|
* @member {Boolean} remoteSort=false
|
|
87
96
|
*/
|
|
88
97
|
remoteSort: false,
|
|
98
|
+
/**
|
|
99
|
+
* @member {Number} totalCount=0
|
|
100
|
+
*/
|
|
101
|
+
totalCount: 0,
|
|
89
102
|
/**
|
|
90
103
|
* Url for Ajax requests
|
|
91
104
|
* @member {String|null} url=null
|
|
@@ -118,6 +131,16 @@ class Store extends Base {
|
|
|
118
131
|
return super.add(this.beforeSetData(item));
|
|
119
132
|
}
|
|
120
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Triggered after the currentPage config got changed
|
|
136
|
+
* @param {Number} value
|
|
137
|
+
* @param {Number} oldValue
|
|
138
|
+
* @protected
|
|
139
|
+
*/
|
|
140
|
+
afterSetCurrentPage(value, oldValue) {
|
|
141
|
+
oldValue && this.load();
|
|
142
|
+
}
|
|
143
|
+
|
|
121
144
|
/**
|
|
122
145
|
* @param value
|
|
123
146
|
* @param oldValue
|
|
@@ -160,6 +183,19 @@ class Store extends Base {
|
|
|
160
183
|
}
|
|
161
184
|
}
|
|
162
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Triggered after the pageSize config got changed
|
|
188
|
+
* @param {Number} value
|
|
189
|
+
* @param {Number} oldValue
|
|
190
|
+
* @protected
|
|
191
|
+
*/
|
|
192
|
+
afterSetPageSize(value, oldValue) {
|
|
193
|
+
if (oldValue) {
|
|
194
|
+
this._currentPage = 1; // silent update
|
|
195
|
+
this.load();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
163
199
|
/**
|
|
164
200
|
* @param {Object|String|null} value
|
|
165
201
|
* @param {Object|String|null} oldValue
|
|
@@ -254,13 +290,16 @@ class Store extends Base {
|
|
|
254
290
|
if (!service) {
|
|
255
291
|
console.log('Api is not defined', this);
|
|
256
292
|
} else {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
293
|
+
service[fn]({
|
|
294
|
+
page : me.currentPage,
|
|
295
|
+
pageSize: me.pageSize
|
|
296
|
+
}).then(response => {
|
|
297
|
+
if (response.success) {
|
|
298
|
+
me.totalCount = response.totalCount;
|
|
299
|
+
me.data = response.data; // fires the load event
|
|
300
|
+
}
|
|
261
301
|
});
|
|
262
302
|
}
|
|
263
|
-
|
|
264
303
|
} else {
|
|
265
304
|
Neo.Xhr.promiseJson({
|
|
266
305
|
url: me.url
|
package/src/dialog/Base.mjs
CHANGED
|
@@ -10,6 +10,16 @@ import VDomUtil from '../../util/VDom.mjs';
|
|
|
10
10
|
* @extends Neo.form.field.Picker
|
|
11
11
|
*/
|
|
12
12
|
class Select extends Picker {
|
|
13
|
+
/**
|
|
14
|
+
* @member {String} filterOperator='like'
|
|
15
|
+
*/
|
|
16
|
+
filterOperator = 'like'
|
|
17
|
+
/**
|
|
18
|
+
* Set this config to false, in case typing into the input field should not filter list items
|
|
19
|
+
* @member {Boolean} useFilter=true
|
|
20
|
+
*/
|
|
21
|
+
useFilter = true
|
|
22
|
+
|
|
13
23
|
static getStaticConfig() {return {
|
|
14
24
|
/**
|
|
15
25
|
* Valid values for triggerAction
|
|
@@ -148,12 +158,12 @@ class Select extends Picker {
|
|
|
148
158
|
let me = this,
|
|
149
159
|
filters;
|
|
150
160
|
|
|
151
|
-
if (value) {
|
|
161
|
+
if (value && me.useFilter) {
|
|
152
162
|
filters = value.filters || [];
|
|
153
163
|
|
|
154
164
|
filters.push({
|
|
155
165
|
includeEmptyValues: true,
|
|
156
|
-
operator :
|
|
166
|
+
operator : me.filterOperator,
|
|
157
167
|
property : me.displayField,
|
|
158
168
|
value : value.get(me.value)?.[me.displayField] || me.value
|
|
159
169
|
});
|
|
@@ -209,7 +219,7 @@ class Select extends Picker {
|
|
|
209
219
|
* @protected
|
|
210
220
|
*/
|
|
211
221
|
beforeSetStore(value, oldValue) {
|
|
212
|
-
oldValue
|
|
222
|
+
oldValue?.destroy();
|
|
213
223
|
|
|
214
224
|
return ClassSystemUtil.beforeSetInstance(value, Store);
|
|
215
225
|
}
|
|
@@ -452,7 +462,7 @@ class Select extends Picker {
|
|
|
452
462
|
me.afterSetValue(value, oldValue, true); // prevent the list from getting filtered
|
|
453
463
|
|
|
454
464
|
me.fire('select', {
|
|
455
|
-
record
|
|
465
|
+
record,
|
|
456
466
|
value : record[displayField]
|
|
457
467
|
});
|
|
458
468
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import BaseToolbar from '../../
|
|
1
|
+
import BaseToolbar from '../../toolbar/Base.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @class Neo.grid.header.Toolbar
|
|
5
|
-
* @extends Neo.
|
|
5
|
+
* @extends Neo.toolbar.Base
|
|
6
6
|
*/
|
|
7
7
|
class Toolbar extends BaseToolbar {
|
|
8
8
|
static getConfig() {return {
|
package/src/list/Base.mjs
CHANGED
package/src/tab/Container.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import BaseToolbar from '../../
|
|
1
|
+
import BaseToolbar from '../../toolbar/Base.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @class Neo.tab.header.Toolbar
|
|
5
|
-
* @extends Neo.
|
|
5
|
+
* @extends Neo.toolbar.Base
|
|
6
6
|
*/
|
|
7
7
|
class Toolbar extends BaseToolbar {
|
|
8
8
|
static getConfig() {return {
|
package/src/table/View.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import BaseToolbar from '../../
|
|
1
|
+
import BaseToolbar from '../../toolbar/Base.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @class Neo.table.header.Toolbar
|
|
5
|
-
* @extends Neo.
|
|
5
|
+
* @extends Neo.toolbar.Base
|
|
6
6
|
*/
|
|
7
7
|
class Toolbar extends BaseToolbar {
|
|
8
8
|
static getConfig() {return {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import Button from '../button/Base.mjs';
|
|
2
2
|
import Component from '../component/Base.mjs';
|
|
3
|
-
import Container from '
|
|
3
|
+
import Container from '../container/Base.mjs';
|
|
4
4
|
import Label from '../component/Label.mjs';
|
|
5
5
|
import NeoArray from '../util/Array.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @class Neo.
|
|
8
|
+
* @class Neo.toolbar.Base
|
|
9
9
|
* @extends Neo.container.Base
|
|
10
10
|
*/
|
|
11
|
-
class
|
|
11
|
+
class Base extends Container {
|
|
12
12
|
static getStaticConfig() {return {
|
|
13
13
|
/**
|
|
14
14
|
* Valid values for dock
|
|
@@ -20,10 +20,10 @@ class Toolbar extends Container {
|
|
|
20
20
|
|
|
21
21
|
static getConfig() {return {
|
|
22
22
|
/**
|
|
23
|
-
* @member {String} className='Neo.
|
|
23
|
+
* @member {String} className='Neo.toolbar.Base'
|
|
24
24
|
* @protected
|
|
25
25
|
*/
|
|
26
|
-
className: 'Neo.
|
|
26
|
+
className: 'Neo.toolbar.Base',
|
|
27
27
|
/**
|
|
28
28
|
* @member {String} ntype='toolbar'
|
|
29
29
|
* @protected
|
|
@@ -189,6 +189,6 @@ class Toolbar extends Container {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
Neo.applyClassConfig(
|
|
192
|
+
Neo.applyClassConfig(Base);
|
|
193
193
|
|
|
194
|
-
export default
|
|
194
|
+
export default Base;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import ClassSystemUtil from '../util/ClassSystem.mjs';
|
|
2
|
+
import SelectField from '../form/field/Select.mjs';
|
|
3
|
+
import Toolbar from './Base.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @class Neo.toolbar.Paging
|
|
7
|
+
* @extends Neo.toolbar.Base
|
|
8
|
+
*/
|
|
9
|
+
class Paging extends Toolbar {
|
|
10
|
+
static getConfig() {return {
|
|
11
|
+
/**
|
|
12
|
+
* @member {String} className='Neo.toolbar.Paging'
|
|
13
|
+
* @protected
|
|
14
|
+
*/
|
|
15
|
+
className: 'Neo.toolbar.Paging',
|
|
16
|
+
/**
|
|
17
|
+
* @member {String} ntype='paging-toolbar'
|
|
18
|
+
* @protected
|
|
19
|
+
*/
|
|
20
|
+
ntype: 'paging-toolbar',
|
|
21
|
+
/**
|
|
22
|
+
* @member {String[]} cls=['neo-paging-toolbar','neo-toolbar']
|
|
23
|
+
*/
|
|
24
|
+
cls: ['neo-paging-toolbar', 'neo-toolbar'],
|
|
25
|
+
/**
|
|
26
|
+
* @member {Number} currentPage_=1
|
|
27
|
+
*/
|
|
28
|
+
currentPage_: 1,
|
|
29
|
+
/**
|
|
30
|
+
* @member {Number} pageSize_=30
|
|
31
|
+
*/
|
|
32
|
+
pageSize_: 30,
|
|
33
|
+
/**
|
|
34
|
+
* @member {Function} pagesText_=me=>`Page: ${me.page} / ${me.getMaxPages()}`
|
|
35
|
+
*/
|
|
36
|
+
pagesText_: me => `Page ${me.currentPage} / ${me.getMaxPages()}`,
|
|
37
|
+
/**
|
|
38
|
+
* @member {Neo.data.Store|null} store_=null
|
|
39
|
+
*/
|
|
40
|
+
store_: null,
|
|
41
|
+
/**
|
|
42
|
+
* @member {Function} totalText_=count=>`Total: ${count} records`
|
|
43
|
+
*/
|
|
44
|
+
totalText_: count => `Total: ${count} rows`
|
|
45
|
+
}}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @param config
|
|
49
|
+
*/
|
|
50
|
+
construct(config) {
|
|
51
|
+
super.construct(config);
|
|
52
|
+
this.createToolbarItems();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Triggered after the currentPage config got changed
|
|
57
|
+
* @param {Number} value
|
|
58
|
+
* @param {Number} oldValue
|
|
59
|
+
* @protected
|
|
60
|
+
*/
|
|
61
|
+
afterSetCurrentPage(value, oldValue) {
|
|
62
|
+
if (oldValue) {
|
|
63
|
+
this.store.currentPage = value;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Triggered after the pageSize config got changed
|
|
69
|
+
* @param {Number} value
|
|
70
|
+
* @param {Number} oldValue
|
|
71
|
+
* @protected
|
|
72
|
+
*/
|
|
73
|
+
afterSetPageSize(value, oldValue) {
|
|
74
|
+
if (oldValue) {
|
|
75
|
+
this._currentPage = 1; // silent update
|
|
76
|
+
this.store.pageSize = value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Triggered after the pagesText config got changed
|
|
82
|
+
* @param {Function} value
|
|
83
|
+
* @param {Function} oldValue
|
|
84
|
+
* @protected
|
|
85
|
+
*/
|
|
86
|
+
afterSetPagesText(value, oldValue) {
|
|
87
|
+
oldValue && this.updatePagesText();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Triggered after the totalText config got changed
|
|
92
|
+
* @param {Function} value
|
|
93
|
+
* @param {Function} oldValue
|
|
94
|
+
* @protected
|
|
95
|
+
*/
|
|
96
|
+
afterSetTotalText(value, oldValue) {
|
|
97
|
+
oldValue && this.updateTotalText();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Triggered before the store config gets changed.
|
|
102
|
+
* @param {Neo.data.Store|Object|null} value
|
|
103
|
+
* @param {Neo.data.Store|null} oldValue
|
|
104
|
+
* @returns {Neo.data.Store}
|
|
105
|
+
* @protected
|
|
106
|
+
*/
|
|
107
|
+
beforeSetStore(value, oldValue) {
|
|
108
|
+
let listeners = {
|
|
109
|
+
load : this.onStoreLoad,
|
|
110
|
+
scope: this
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
oldValue?.un(listeners);
|
|
114
|
+
|
|
115
|
+
return ClassSystemUtil.beforeSetInstance(value, null, {listeners});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
*/
|
|
121
|
+
createToolbarItems() {
|
|
122
|
+
let me = this;
|
|
123
|
+
|
|
124
|
+
me.items = [{
|
|
125
|
+
handler : me.onFirstPageButtonClick.bind(me),
|
|
126
|
+
iconCls : 'fa fa-angles-left',
|
|
127
|
+
reference: 'nav-button-first'
|
|
128
|
+
}, {
|
|
129
|
+
handler : me.onPrevPageButtonClick.bind(me),
|
|
130
|
+
iconCls : 'fa fa-angle-left',
|
|
131
|
+
reference: 'nav-button-prev',
|
|
132
|
+
style : {marginLeft: '2px'}
|
|
133
|
+
}, {
|
|
134
|
+
ntype : 'label',
|
|
135
|
+
reference: 'pages-text',
|
|
136
|
+
style : {marginLeft: '10px'},
|
|
137
|
+
text : me.pagesText(me)
|
|
138
|
+
}, {
|
|
139
|
+
handler : me.onNextPageButtonClick.bind(me),
|
|
140
|
+
iconCls : 'fa fa-angle-right',
|
|
141
|
+
reference: 'nav-button-next',
|
|
142
|
+
style : {marginLeft: '10px'}
|
|
143
|
+
}, {
|
|
144
|
+
handler : me.onLastPageButtonClick.bind(me),
|
|
145
|
+
iconCls : 'fa fa-angles-right',
|
|
146
|
+
reference: 'nav-button-last',
|
|
147
|
+
style : {marginLeft: '2px'}
|
|
148
|
+
}, {
|
|
149
|
+
ntype: 'label',
|
|
150
|
+
style: {marginLeft: '50px'},
|
|
151
|
+
text : 'Rows per page:'
|
|
152
|
+
}, {
|
|
153
|
+
module : SelectField,
|
|
154
|
+
clearable : false,
|
|
155
|
+
hideLabel : true,
|
|
156
|
+
listConfig : {highlightFilterValue: false},
|
|
157
|
+
listeners : {change: me.onPageSizeFieldChange.bind(me)},
|
|
158
|
+
style : {margin: 0},
|
|
159
|
+
triggerAction: 'all',
|
|
160
|
+
useFilter : false,
|
|
161
|
+
value : 30,
|
|
162
|
+
width : 70,
|
|
163
|
+
|
|
164
|
+
store: {
|
|
165
|
+
model: {
|
|
166
|
+
fields: [
|
|
167
|
+
{name: 'id', type: 'Integer'},
|
|
168
|
+
{name: 'name', type: 'Integer'}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
data: [
|
|
172
|
+
{id: 1, name: 10},
|
|
173
|
+
{id: 2, name: 20},
|
|
174
|
+
{id: 3, name: 30},
|
|
175
|
+
{id: 4, name: 50},
|
|
176
|
+
{id: 5, name: 100}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
}, '->', {
|
|
180
|
+
ntype : 'label',
|
|
181
|
+
reference: 'total-text',
|
|
182
|
+
text : me.totalText(me.store.totalCount)
|
|
183
|
+
}];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @returns {Number}
|
|
188
|
+
*/
|
|
189
|
+
getMaxPages() {
|
|
190
|
+
return Math.ceil(this.store.totalCount / this.pageSize);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
*
|
|
195
|
+
*/
|
|
196
|
+
onFirstPageButtonClick() {
|
|
197
|
+
this.currentPage = 1;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
*/
|
|
203
|
+
onLastPageButtonClick() {
|
|
204
|
+
this.currentPage = this.getMaxPages();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
*
|
|
209
|
+
*/
|
|
210
|
+
onNextPageButtonClick() {
|
|
211
|
+
let me = this;
|
|
212
|
+
|
|
213
|
+
if (me.currentPage < me.getMaxPages()) {
|
|
214
|
+
me.currentPage++;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @param {Object} data
|
|
220
|
+
*/
|
|
221
|
+
onPageSizeFieldChange(data) {
|
|
222
|
+
this.pageSize = data.value;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
*
|
|
227
|
+
*/
|
|
228
|
+
onPrevPageButtonClick() {
|
|
229
|
+
if (this.currentPage > 1) {
|
|
230
|
+
this.currentPage--;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
*
|
|
236
|
+
*/
|
|
237
|
+
onStoreLoad() {
|
|
238
|
+
let me = this;
|
|
239
|
+
|
|
240
|
+
me.updateNavigationButtons();
|
|
241
|
+
me.updatePagesText();
|
|
242
|
+
me.updateTotalText();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
*/
|
|
248
|
+
updateNavigationButtons() {
|
|
249
|
+
let me = this,
|
|
250
|
+
currentPage = me.currentPage,
|
|
251
|
+
maxPages = me.getMaxPages();
|
|
252
|
+
|
|
253
|
+
me.down({reference: 'nav-button-first'}).disabled = currentPage === 1;
|
|
254
|
+
me.down({reference: 'nav-button-prev'}) .disabled = currentPage === 1;
|
|
255
|
+
me.down({reference: 'nav-button-next'}) .disabled = currentPage === maxPages;
|
|
256
|
+
me.down({reference: 'nav-button-last'}) .disabled = currentPage === maxPages;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
*
|
|
261
|
+
*/
|
|
262
|
+
updatePagesText() {
|
|
263
|
+
let me = this;
|
|
264
|
+
|
|
265
|
+
me.down({reference: 'pages-text'}).text = me.pagesText(me);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
*
|
|
270
|
+
*/
|
|
271
|
+
updateTotalText() {
|
|
272
|
+
let me = this;
|
|
273
|
+
|
|
274
|
+
me.down({reference: 'total-text'}).text = me.totalText(me.store.totalCount);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
Neo.applyClassConfig(Paging);
|
|
279
|
+
|
|
280
|
+
export default Paging;
|
package/src/util/ClassSystem.mjs
CHANGED
|
@@ -21,6 +21,8 @@ class ClassSystem extends Base {
|
|
|
21
21
|
* @returns {Neo.core.Base} instance
|
|
22
22
|
*/
|
|
23
23
|
static beforeSetInstance(config, DefaultClass=null, defaultValues={}) {
|
|
24
|
+
let isInstance = config instanceof Neo.core.Base;
|
|
25
|
+
|
|
24
26
|
if (Neo.isString(DefaultClass)) {
|
|
25
27
|
DefaultClass = Neo.ns(DefaultClass);
|
|
26
28
|
}
|
|
@@ -29,7 +31,7 @@ class ClassSystem extends Base {
|
|
|
29
31
|
config = Neo.create(DefaultClass, defaultValues);
|
|
30
32
|
} else if (config?.isClass) {
|
|
31
33
|
config = Neo.create(config, defaultValues);
|
|
32
|
-
} else if (Neo.isObject(config) && !
|
|
34
|
+
} else if (Neo.isObject(config) && !isInstance) {
|
|
33
35
|
if (config.ntype) {
|
|
34
36
|
config = Neo.ntype({
|
|
35
37
|
...defaultValues,
|
|
@@ -49,6 +51,10 @@ class ClassSystem extends Base {
|
|
|
49
51
|
|
|
50
52
|
config = Neo.create(newConfig);
|
|
51
53
|
}
|
|
54
|
+
} else if (isInstance) {
|
|
55
|
+
if (defaultValues?.listeners) {
|
|
56
|
+
config.on(defaultValues.listeners);
|
|
57
|
+
}
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
return config;
|