neo.mjs 5.11.0 → 5.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/ServiceWorker.mjs +2 -2
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/dateSelector/MainContainer.mjs +32 -31
- package/examples/component/video/MainContainer.mjs +46 -0
- package/examples/component/video/MainContainerController.mjs +37 -0
- package/examples/component/video/app.mjs +7 -0
- package/examples/component/video/index.html +12 -0
- package/examples/component/video/neo-config.json +7 -0
- package/examples/list/base/MainModel.mjs +3 -0
- package/examples/list/base/MainStore.mjs +6 -0
- package/package.json +3 -3
- package/resources/scss/src/component/Video.scss +31 -0
- package/resources/scss/theme-dark/component/Video.scss +11 -0
- package/resources/scss/theme-light/component/Video.scss +11 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/Video.mjs +165 -0
- package/src/list/Base.mjs +11 -1
- package/src/selection/ListModel.mjs +3 -1
package/apps/ServiceWorker.mjs
CHANGED
@@ -15,11 +15,12 @@ class MainContainer extends ConfigurationViewport {
|
|
15
15
|
}
|
16
16
|
|
17
17
|
createConfigurationComponents() {
|
18
|
-
let me
|
18
|
+
let me = this,
|
19
|
+
exampleComponent = me.exampleComponent;
|
19
20
|
|
20
21
|
return [{
|
21
22
|
module : Radio,
|
22
|
-
checked :
|
23
|
+
checked : exampleComponent.currentDate.getMonth() === 0,
|
23
24
|
hideValueLabel: false,
|
24
25
|
labelText : 'currentDate (month)',
|
25
26
|
listeners : {change: me.onMonthRadioChange.bind(me, 0)},
|
@@ -27,7 +28,7 @@ class MainContainer extends ConfigurationViewport {
|
|
27
28
|
valueLabelText: 'Jan'
|
28
29
|
}, {
|
29
30
|
module : Radio,
|
30
|
-
checked :
|
31
|
+
checked : exampleComponent.currentDate.getMonth() === 1,
|
31
32
|
hideValueLabel: false,
|
32
33
|
labelText : '',
|
33
34
|
listeners : {change: me.onMonthRadioChange.bind(me, 1)},
|
@@ -35,7 +36,7 @@ class MainContainer extends ConfigurationViewport {
|
|
35
36
|
valueLabelText: 'Feb'
|
36
37
|
}, {
|
37
38
|
module : Radio,
|
38
|
-
checked :
|
39
|
+
checked : exampleComponent.currentDate.getMonth() === 2,
|
39
40
|
hideValueLabel: false,
|
40
41
|
labelText : '',
|
41
42
|
listeners : {change: me.onMonthRadioChange.bind(me, 2)},
|
@@ -43,7 +44,7 @@ class MainContainer extends ConfigurationViewport {
|
|
43
44
|
valueLabelText: 'Mar'
|
44
45
|
}, {
|
45
46
|
module : Radio,
|
46
|
-
checked :
|
47
|
+
checked : exampleComponent.currentDate.getMonth() === 3,
|
47
48
|
hideValueLabel: false,
|
48
49
|
labelText : '',
|
49
50
|
listeners : {change: me.onMonthRadioChange.bind(me, 3)},
|
@@ -51,7 +52,7 @@ class MainContainer extends ConfigurationViewport {
|
|
51
52
|
valueLabelText: 'Apr'
|
52
53
|
}, {
|
53
54
|
module : Radio,
|
54
|
-
checked :
|
55
|
+
checked : exampleComponent.currentDate.getFullYear() === 2021,
|
55
56
|
hideValueLabel: false,
|
56
57
|
labelText : 'currentDate (year)',
|
57
58
|
listeners : {change: me.onYearRadioChange.bind(me, 2021)},
|
@@ -60,7 +61,7 @@ class MainContainer extends ConfigurationViewport {
|
|
60
61
|
valueLabelText: '2021'
|
61
62
|
}, {
|
62
63
|
module : Radio,
|
63
|
-
checked :
|
64
|
+
checked : exampleComponent.currentDate.getFullYear() === 2020,
|
64
65
|
hideValueLabel: false,
|
65
66
|
labelText : '',
|
66
67
|
listeners : {change: me.onYearRadioChange.bind(me, 2020)},
|
@@ -68,7 +69,7 @@ class MainContainer extends ConfigurationViewport {
|
|
68
69
|
valueLabelText: '2020'
|
69
70
|
}, {
|
70
71
|
module : Radio,
|
71
|
-
checked :
|
72
|
+
checked : exampleComponent.currentDate.getFullYear() === 2019,
|
72
73
|
hideValueLabel: false,
|
73
74
|
labelText : '',
|
74
75
|
listeners : {change: me.onYearRadioChange.bind(me, 2019)},
|
@@ -76,7 +77,7 @@ class MainContainer extends ConfigurationViewport {
|
|
76
77
|
valueLabelText: '2019'
|
77
78
|
}, {
|
78
79
|
module : Radio,
|
79
|
-
checked :
|
80
|
+
checked : exampleComponent.currentDate.getFullYear() === 2018,
|
80
81
|
hideValueLabel: false,
|
81
82
|
labelText : '',
|
82
83
|
listeners : {change: me.onYearRadioChange.bind(me, 2018)},
|
@@ -84,7 +85,7 @@ class MainContainer extends ConfigurationViewport {
|
|
84
85
|
valueLabelText: '2018'
|
85
86
|
}, {
|
86
87
|
module : Radio,
|
87
|
-
checked :
|
88
|
+
checked : exampleComponent.dayNameFormat === 'narrow',
|
88
89
|
hideValueLabel: false,
|
89
90
|
labelText : 'dayNameFormat',
|
90
91
|
listeners : {change: me.onRadioChange.bind(me, 'dayNameFormat', 'narrow')},
|
@@ -93,7 +94,7 @@ class MainContainer extends ConfigurationViewport {
|
|
93
94
|
valueLabelText: 'narrow'
|
94
95
|
}, {
|
95
96
|
module : Radio,
|
96
|
-
checked :
|
97
|
+
checked : exampleComponent.dayNameFormat === 'short',
|
97
98
|
hideValueLabel: false,
|
98
99
|
labelText : '',
|
99
100
|
listeners : {change: me.onRadioChange.bind(me, 'dayNameFormat', 'short')},
|
@@ -101,55 +102,55 @@ class MainContainer extends ConfigurationViewport {
|
|
101
102
|
valueLabelText: 'short'
|
102
103
|
}, {
|
103
104
|
module : Radio,
|
104
|
-
checked :
|
105
|
+
checked : exampleComponent.dayNameFormat === 'long',
|
105
106
|
hideValueLabel: false,
|
106
107
|
labelText : '',
|
107
108
|
listeners : {change: me.onRadioChange.bind(me, 'dayNameFormat', 'long')},
|
108
109
|
name : 'dayNameFormat',
|
109
110
|
valueLabelText: 'long'
|
111
|
+
}, {
|
112
|
+
module : NumberField,
|
113
|
+
clearable : true,
|
114
|
+
labelText : 'height',
|
115
|
+
listeners : {change: me.onConfigChange.bind(me, 'height')},
|
116
|
+
maxValue : 800,
|
117
|
+
minValue : 230,
|
118
|
+
stepSize : 10,
|
119
|
+
style : {marginTop: '10px'},
|
120
|
+
value : exampleComponent.height
|
110
121
|
}, {
|
111
122
|
module : DateField,
|
112
123
|
labelText : 'maxValue',
|
113
124
|
listeners : {change: me.onConfigChange.bind(me, 'maxValue')},
|
114
125
|
matchPickerWidth: false,
|
115
|
-
|
116
|
-
value : me.exampleComponent.maxValue
|
126
|
+
value : exampleComponent.maxValue
|
117
127
|
}, {
|
118
128
|
module : DateField,
|
119
129
|
labelText : 'minValue',
|
120
130
|
listeners : {change: me.onConfigChange.bind(me, 'minValue')},
|
121
131
|
matchPickerWidth: false,
|
122
|
-
value :
|
123
|
-
}, {
|
124
|
-
module : NumberField,
|
125
|
-
clearable : true,
|
126
|
-
labelText : 'height',
|
127
|
-
listeners : {change: me.onConfigChange.bind(me, 'height')},
|
128
|
-
maxValue : 800,
|
129
|
-
minValue : 230,
|
130
|
-
stepSize : 10,
|
131
|
-
value : me.exampleComponent.height
|
132
|
+
value : exampleComponent.minValue
|
132
133
|
}, {
|
133
134
|
module : CheckBox,
|
134
|
-
checked :
|
135
|
+
checked : exampleComponent.showCellBorders,
|
135
136
|
labelText: 'showCellBorders',
|
136
137
|
listeners: {change: me.onConfigChange.bind(me, 'showCellBorders')},
|
137
138
|
style : {marginTop: '10px'}
|
138
139
|
}, {
|
139
140
|
module : CheckBox,
|
140
|
-
checked :
|
141
|
+
checked : exampleComponent.showDisabledDays,
|
141
142
|
labelText: 'showDisabledDays',
|
142
143
|
listeners: {change: me.onConfigChange.bind(me, 'showDisabledDays')},
|
143
144
|
style : {marginTop: '10px'}
|
144
145
|
}, {
|
145
146
|
module : CheckBox,
|
146
|
-
checked :
|
147
|
+
checked : exampleComponent.useAnimations,
|
147
148
|
labelText: 'useAnimations',
|
148
149
|
listeners: {change: me.onConfigChange.bind(me, 'useAnimations')},
|
149
150
|
style : {marginTop: '10px'}
|
150
151
|
}, {
|
151
152
|
module : Radio,
|
152
|
-
checked :
|
153
|
+
checked : exampleComponent.weekStartDay === 6,
|
153
154
|
hideValueLabel: false,
|
154
155
|
labelText : 'weekStartDay',
|
155
156
|
listeners : {change: me.onRadioChange.bind(me, 'weekStartDay', 6)},
|
@@ -158,7 +159,7 @@ class MainContainer extends ConfigurationViewport {
|
|
158
159
|
valueLabelText: '6 (Saturday)'
|
159
160
|
}, {
|
160
161
|
module : Radio,
|
161
|
-
checked :
|
162
|
+
checked : exampleComponent.weekStartDay === 0,
|
162
163
|
hideValueLabel: false,
|
163
164
|
labelText : '',
|
164
165
|
listeners : {change: me.onRadioChange.bind(me, 'weekStartDay', 0)},
|
@@ -166,7 +167,7 @@ class MainContainer extends ConfigurationViewport {
|
|
166
167
|
valueLabelText: '0 (Sunday)'
|
167
168
|
}, {
|
168
169
|
module : Radio,
|
169
|
-
checked :
|
170
|
+
checked : exampleComponent.weekStartDay === 1,
|
170
171
|
hideValueLabel: false,
|
171
172
|
labelText : '',
|
172
173
|
listeners : {change: me.onRadioChange.bind(me, 'weekStartDay', 1)},
|
@@ -181,7 +182,7 @@ class MainContainer extends ConfigurationViewport {
|
|
181
182
|
minValue : 240,
|
182
183
|
stepSize : 10,
|
183
184
|
style : {marginTop: '10px'},
|
184
|
-
value :
|
185
|
+
value : exampleComponent.width
|
185
186
|
}];
|
186
187
|
}
|
187
188
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import Viewport from '../../../src/container/Viewport.mjs';
|
2
|
+
import Video from '../../../src/component/Video.mjs';
|
3
|
+
import Panel from '../../../src/container/Panel.mjs';
|
4
|
+
import MainContainerController from "./MainContainerController.mjs";
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @class Neo.examples.component.timer.MainContainer
|
8
|
+
* @extends Neo.examples.Viewport
|
9
|
+
*/
|
10
|
+
class MainContainer extends Viewport {
|
11
|
+
static config = {
|
12
|
+
className: 'Neo.examples.component.timer.MainContainer',
|
13
|
+
|
14
|
+
controller: MainContainerController,
|
15
|
+
|
16
|
+
items : [{
|
17
|
+
ntype: 'panel',
|
18
|
+
headers: [{
|
19
|
+
dock: 'top',
|
20
|
+
items: [{
|
21
|
+
ntype: 'component',
|
22
|
+
html : '<h1>Video Demo</h1>',
|
23
|
+
flex : 'none',
|
24
|
+
style: {textAlign: 'center'}
|
25
|
+
}, {
|
26
|
+
ntype: 'component', flex: 1
|
27
|
+
}, {
|
28
|
+
reference: 'theme-button',
|
29
|
+
iconCls : 'fa fa-sun',
|
30
|
+
handler : 'onToggleTheme',
|
31
|
+
style : {height: '100%',padding: '0 40px',borderWidth: 0,borderLeftWidth: '1px',borderRadius: 0}
|
32
|
+
}]
|
33
|
+
}],
|
34
|
+
items: [{
|
35
|
+
module : Video,
|
36
|
+
url : 'https://video-ssl.itunes.apple.com/itunes-assets/Video125/v4/a0/57/54/a0575426-dd8e-2d25-bdf3-139702870b50/mzvf_786190431362224858.640x464.h264lc.U.p.m4v',
|
37
|
+
flag : 'video-component',
|
38
|
+
minHeight: 400,
|
39
|
+
}]
|
40
|
+
}]
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
Neo.applyClassConfig(MainContainer);
|
45
|
+
|
46
|
+
export default MainContainer;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import ComponentController from '../../../src/controller/Component.mjs';
|
2
|
+
import Toast from '../../../src/component/Toast.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Neo.examples.component.toast.MainContainerController
|
6
|
+
* @extends Neo.controller.Component
|
7
|
+
*/
|
8
|
+
class MainContainerController extends ComponentController {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Neo.examples.component.toast.MainContainerController'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Neo.examples.component.toast.MainContainerController'
|
15
|
+
}
|
16
|
+
|
17
|
+
theme = 'light';
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @param {Object} config
|
21
|
+
*/
|
22
|
+
onToggleTheme(config) {
|
23
|
+
const add = (this.theme === 'light') ? 'dark' : 'light',
|
24
|
+
remove = add === 'light' ? 'dark' : 'light',
|
25
|
+
themeButton = this.getReference('theme-button'),
|
26
|
+
buttonIcon = add === 'light' ? 'sun' : 'moon';
|
27
|
+
|
28
|
+
this.theme = add;
|
29
|
+
|
30
|
+
Neo.main.DomAccess.setBodyCls({remove: ['neo-theme-' + remove] , add: ['neo-theme-' + add]});
|
31
|
+
themeButton.iconCls = 'fa fa-' + buttonIcon;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
Neo.applyClassConfig(MainContainerController);
|
36
|
+
|
37
|
+
export default MainContainerController;
|
@@ -0,0 +1,12 @@
|
|
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 Video</title>
|
7
|
+
</head>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<script src="../../../src/MicroLoader.mjs" type="module"></script>
|
11
|
+
</body>
|
12
|
+
</html>
|
@@ -13,31 +13,37 @@ class MainStore extends Store {
|
|
13
13
|
|
14
14
|
data: [{
|
15
15
|
country : 'Germany',
|
16
|
+
disabled : false,
|
16
17
|
firstname: 'Tobias',
|
17
18
|
githubId : 'tobiu',
|
18
19
|
lastname : 'Uhlig'
|
19
20
|
}, {
|
20
21
|
country : 'USA',
|
22
|
+
disabled : true,
|
21
23
|
firstname: 'Rich',
|
22
24
|
githubId : 'rwaters',
|
23
25
|
lastname : 'Waters'
|
24
26
|
}, {
|
25
27
|
country : 'Germany',
|
28
|
+
disabled : false,
|
26
29
|
firstname: 'Nils',
|
27
30
|
githubId : 'mrsunshine',
|
28
31
|
lastname : 'Dehl'
|
29
32
|
}, {
|
30
33
|
country : 'USA',
|
34
|
+
disabled : false,
|
31
35
|
firstname: 'Gerard',
|
32
36
|
githubId : 'camtnbikerrwc',
|
33
37
|
lastname : 'Horan'
|
34
38
|
}, {
|
35
39
|
country : 'Slovakia',
|
40
|
+
disabled : false,
|
36
41
|
firstname: 'Jozef',
|
37
42
|
githubId : 'jsakalos',
|
38
43
|
lastname : 'Sakalos'
|
39
44
|
}, {
|
40
45
|
country : 'Germany',
|
46
|
+
disabled : false,
|
41
47
|
firstname: 'Bastian',
|
42
48
|
githubId : 'bhaustein',
|
43
49
|
lastname : 'Haustein'
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "5.11.
|
3
|
+
"version": "5.11.1",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -52,10 +52,10 @@
|
|
52
52
|
"envinfo": "^7.10.0",
|
53
53
|
"fs-extra": "^11.1.1",
|
54
54
|
"highlightjs-line-numbers.js": "^2.8.0",
|
55
|
-
"inquirer": "^9.2.
|
55
|
+
"inquirer": "^9.2.8",
|
56
56
|
"neo-jsdoc": "^1.0.1",
|
57
57
|
"neo-jsdoc-x": "^1.0.5",
|
58
|
-
"postcss": "^8.4.
|
58
|
+
"postcss": "^8.4.26",
|
59
59
|
"sass": "^1.63.6",
|
60
60
|
"webpack": "^5.88.1",
|
61
61
|
"webpack-cli": "^5.1.4",
|
@@ -0,0 +1,31 @@
|
|
1
|
+
.neo-video {
|
2
|
+
position: relative;
|
3
|
+
|
4
|
+
& > * {
|
5
|
+
position: absolute;
|
6
|
+
inset: 0;
|
7
|
+
}
|
8
|
+
|
9
|
+
.neo-video-ghost {
|
10
|
+
display: flex;
|
11
|
+
align-items: center;
|
12
|
+
justify-content: center;
|
13
|
+
|
14
|
+
height: 100%;
|
15
|
+
width: 100%;
|
16
|
+
background-color: v(video-ghost-color);
|
17
|
+
|
18
|
+
.fa-solid {
|
19
|
+
height: v(video-ghost-size);
|
20
|
+
width: v(video-ghost-size);
|
21
|
+
font-size: v(video-ghost-size);
|
22
|
+
cursor: pointer;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.neo-video-media {
|
27
|
+
height: 100%;
|
28
|
+
width: 100%;
|
29
|
+
background: black;
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
$neoMap: map-merge($neoMap, (
|
2
|
+
'video-ghost-color': rgb(50, 50, 50),
|
3
|
+
'video-ghost-size' : 30px
|
4
|
+
));
|
5
|
+
|
6
|
+
@if $useCssVars == true {
|
7
|
+
:root .neo-theme-dark { // .neo-video
|
8
|
+
--video-ghost-color: #{neo(video-ghost-color)};
|
9
|
+
--video-ghost-size: #{neo(video-ghost-size)};
|
10
|
+
}
|
11
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
$neoMap: map-merge($neoMap, (
|
2
|
+
'video-ghost-color': rgba(50, 50, 50, 0.3),
|
3
|
+
'video-ghost-size' : 30px
|
4
|
+
));
|
5
|
+
|
6
|
+
@if $useCssVars == true {
|
7
|
+
:root .neo-theme-light { // .neo-video
|
8
|
+
--video-ghost-color: #{neo(video-ghost-color)};
|
9
|
+
--video-ghost-size: #{neo(video-ghost-size)};
|
10
|
+
}
|
11
|
+
}
|
package/src/DefaultConfig.mjs
CHANGED
@@ -236,12 +236,12 @@ const DefaultConfig = {
|
|
236
236
|
useVdomWorker: true,
|
237
237
|
/**
|
238
238
|
* buildScripts/injectPackageVersion.mjs will update this value
|
239
|
-
* @default '5.11.
|
239
|
+
* @default '5.11.1'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '5.11.
|
244
|
+
version: '5.11.1'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
@@ -0,0 +1,165 @@
|
|
1
|
+
import BaseComponent from '../component/Base.mjs';
|
2
|
+
import VDomUtil from '../util/VDom.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Neo.component.Video
|
6
|
+
* @extends Neo.component.Base
|
7
|
+
*
|
8
|
+
* @example
|
9
|
+
* ntype: 'video',
|
10
|
+
* url: 'https://video-ssl.itunes.apple.com/itunes-assets/Video125/v4/a0/57/54/a0575426-dd8e-2d25-bdf3-139702870b50/mzvf_786190431362224858.640x464.h264lc.U.p.m4v'
|
11
|
+
*/
|
12
|
+
class Video extends BaseComponent {
|
13
|
+
static config = {
|
14
|
+
/*
|
15
|
+
* @member {String} className='Neo.component.Video'
|
16
|
+
* @protected
|
17
|
+
*/
|
18
|
+
className: 'Neo.component.Video',
|
19
|
+
/*
|
20
|
+
* @member {String} ntype='neo-video'
|
21
|
+
* @protected
|
22
|
+
*/
|
23
|
+
ntype: 'video',
|
24
|
+
/*
|
25
|
+
* @member {[String]} cls=['neo-video']
|
26
|
+
*/
|
27
|
+
baseCls: ['neo-video'],
|
28
|
+
/*
|
29
|
+
* @member {String} url=null
|
30
|
+
* @public
|
31
|
+
*/
|
32
|
+
url_: null,
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Current state of the video
|
36
|
+
* @member {boolean} playing=false
|
37
|
+
*/
|
38
|
+
playing_: false,
|
39
|
+
/**
|
40
|
+
* Type of the video
|
41
|
+
* @member {boolean} type='video/mp4'
|
42
|
+
*/
|
43
|
+
type: 'video/mp4',
|
44
|
+
|
45
|
+
_vdom: {
|
46
|
+
cn: [{
|
47
|
+
flag: 'ghost',
|
48
|
+
cls : ['neo-video-ghost'],
|
49
|
+
cn : [{
|
50
|
+
// The <i> tag defines a part of text in an alternate voice or mood. The content inside is typically displayed in italic.
|
51
|
+
tag: 'i',
|
52
|
+
cls: ['fa-solid', 'fa-circle-play']
|
53
|
+
}]
|
54
|
+
}, {
|
55
|
+
// Neo specific configs
|
56
|
+
tag : 'video',
|
57
|
+
flag : 'media',
|
58
|
+
removeDom: true,
|
59
|
+
cls : ['neo-video-media'],
|
60
|
+
// dom attributes
|
61
|
+
autoplay: true,
|
62
|
+
controls: true
|
63
|
+
}]
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
/**
|
69
|
+
* construct is earlier in component life cicle than init
|
70
|
+
*
|
71
|
+
* @param config
|
72
|
+
*/
|
73
|
+
construct(config) {
|
74
|
+
super.construct(config);
|
75
|
+
|
76
|
+
console.log(this);
|
77
|
+
|
78
|
+
let me = this,
|
79
|
+
domListeners = me.domListeners;
|
80
|
+
|
81
|
+
domListeners.push({
|
82
|
+
click : me.play,
|
83
|
+
delegate: '.neo-video-ghost'
|
84
|
+
}, {
|
85
|
+
click : me.pause,
|
86
|
+
delegate: '.neo-video-media'
|
87
|
+
});
|
88
|
+
|
89
|
+
me.domListeners = domListeners;
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* beforeSetPlaying autgen by playing_
|
94
|
+
*
|
95
|
+
* @param {Boolean} value
|
96
|
+
* @param {Boolean} oldValue
|
97
|
+
* @returns {Boolean}
|
98
|
+
*/
|
99
|
+
beforeSetPlaying(value, oldValue) {
|
100
|
+
if (!Neo.isBoolean(value)) {
|
101
|
+
return oldValue;
|
102
|
+
}
|
103
|
+
|
104
|
+
return value;
|
105
|
+
}
|
106
|
+
|
107
|
+
/**
|
108
|
+
* afterSetPlaying - run the event listeners
|
109
|
+
* @param {Boolean} value
|
110
|
+
* @param {Boolean} oldValue
|
111
|
+
*/
|
112
|
+
afterSetPlaying(value, oldValue) {
|
113
|
+
let vdom = this.vdom,
|
114
|
+
media = VDomUtil.getFlags(vdom, 'media')[0],
|
115
|
+
ghost = VDomUtil.getFlags(vdom, 'ghost')[0];
|
116
|
+
|
117
|
+
ghost.removeDom = value;
|
118
|
+
media.removeDom = !value;
|
119
|
+
|
120
|
+
this.vdom = vdom;
|
121
|
+
}
|
122
|
+
|
123
|
+
/**
|
124
|
+
* afterSetUrl
|
125
|
+
* Add a source element into the video element containing the url
|
126
|
+
*
|
127
|
+
* @param {String} value
|
128
|
+
* @param {String|null} oldValue
|
129
|
+
*/
|
130
|
+
afterSetUrl(value, oldValue) {
|
131
|
+
if (!value) {
|
132
|
+
return;
|
133
|
+
}
|
134
|
+
|
135
|
+
const me = this;
|
136
|
+
let vdom = me.vdom,
|
137
|
+
media = vdom.cn[1];
|
138
|
+
|
139
|
+
media.cn = [{
|
140
|
+
tag : 'source',
|
141
|
+
src : value,
|
142
|
+
type: me.type
|
143
|
+
}];
|
144
|
+
|
145
|
+
me.vdom = vdom;
|
146
|
+
}
|
147
|
+
|
148
|
+
/**
|
149
|
+
* Clicked ghost
|
150
|
+
*/
|
151
|
+
play() {
|
152
|
+
this.playing = true;
|
153
|
+
}
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Clicked media
|
157
|
+
*/
|
158
|
+
pause() {
|
159
|
+
this.playing = false;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
Neo.applyClassConfig(Video);
|
164
|
+
|
165
|
+
export default Video;
|
package/src/list/Base.mjs
CHANGED
@@ -37,6 +37,12 @@ class Base extends Component {
|
|
37
37
|
* @member {String[]} baseCls=['neo-list']
|
38
38
|
*/
|
39
39
|
baseCls: ['neo-list'],
|
40
|
+
/**
|
41
|
+
* An optional record field to make items non-clickable and visually greyed out.
|
42
|
+
* The field expects the Boolean type.
|
43
|
+
* @member {String} disabledField='disabled'
|
44
|
+
*/
|
45
|
+
disabledField: 'disabled',
|
40
46
|
/**
|
41
47
|
* @member {Boolean} disableSelection_=false
|
42
48
|
*/
|
@@ -373,10 +379,14 @@ class Base extends Component {
|
|
373
379
|
|
374
380
|
if (!me.disableSelection && selectionModel) {
|
375
381
|
if (selectionModel.isSelected(itemId)) {
|
376
|
-
cls.push(selectionModel.selectedCls)
|
382
|
+
cls.push(selectionModel.selectedCls)
|
377
383
|
}
|
378
384
|
}
|
379
385
|
|
386
|
+
if (record[me.disabledField]) {
|
387
|
+
cls.push('neo-disabled')
|
388
|
+
}
|
389
|
+
|
380
390
|
item = {
|
381
391
|
tag : isHeader ? 'dt' : me.itemTagName,
|
382
392
|
cls,
|
@@ -83,9 +83,11 @@ class ListModel extends Model {
|
|
83
83
|
if (item) {
|
84
84
|
recordId = view.getItemRecordId(item);
|
85
85
|
index = store.indexOf(recordId) + step;
|
86
|
+
record = store.getAt(index);
|
86
87
|
|
87
|
-
while (
|
88
|
+
while (record?.[view.disabledField] === true || record?.isHeader === true) {
|
88
89
|
index += step;
|
90
|
+
record = store.getAt(index)
|
89
91
|
}
|
90
92
|
|
91
93
|
if (index < 0) {
|