neo.mjs 6.7.0 → 6.7.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/ConfigurationViewport.mjs +30 -23
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/dialog/DemoDialog.mjs +12 -11
- package/package.json +3 -3
- package/src/DefaultConfig.mjs +2 -2
- package/src/form/field/Base.mjs +2 -2
- package/src/toolbar/Breadcrumb.mjs +7 -0
- package/src/util/Function.mjs +3 -3
package/apps/ServiceWorker.mjs
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
-
import Button
|
2
|
-
import Container
|
3
|
-
import
|
4
|
-
import Panel
|
5
|
-
import Viewport
|
1
|
+
import Button from '../src/button/Base.mjs';
|
2
|
+
import Container from '../src/container/Base.mjs';
|
3
|
+
import {bindAppend} from '../src/util/Function.mjs';
|
4
|
+
import Panel from '../src/container/Panel.mjs';
|
5
|
+
import Viewport from '../src/container/Viewport.mjs';
|
6
|
+
|
7
|
+
// add custom themes here
|
8
|
+
const themes = [
|
9
|
+
{name: 'neo-theme-dark', label: 'Theme Dark'},
|
10
|
+
{name: 'neo-theme-light', label: 'Theme Light'}
|
11
|
+
]
|
6
12
|
|
7
13
|
/**
|
8
14
|
* Base class for example Apps which should be configurable
|
@@ -112,8 +118,7 @@ class ConfigurationViewport extends Viewport {
|
|
112
118
|
|
113
119
|
items: [...me.configurationComponents, {
|
114
120
|
module : Button,
|
115
|
-
handler: me.onSwitchTheme
|
116
|
-
id : me.id + '_cmp_' + 'switchThemeButton',
|
121
|
+
handler: bindAppend(me.onSwitchTheme, me, 'cmp'),
|
117
122
|
style : {marginTop: '20px'},
|
118
123
|
text : theme === 'neo-theme-dark' ? 'Theme Light' : 'Theme Dark',
|
119
124
|
width : 100
|
@@ -172,24 +177,26 @@ class ConfigurationViewport extends Viewport {
|
|
172
177
|
}
|
173
178
|
|
174
179
|
/**
|
180
|
+
* @param {Object} data
|
175
181
|
* @param {String} target
|
176
182
|
*/
|
177
|
-
onSwitchTheme(target) {
|
178
|
-
let me
|
179
|
-
button
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
183
|
+
onSwitchTheme(data, target) {
|
184
|
+
let me = this,
|
185
|
+
button = data.component,
|
186
|
+
countThemes = themes.length,
|
187
|
+
newTheme, oldIndex, oldTheme, themeIndex;
|
188
|
+
|
189
|
+
themes.forEach((theme, index) => {
|
190
|
+
if (button.text === theme.label) {
|
191
|
+
newTheme = theme.name;
|
192
|
+
themeIndex = index;
|
193
|
+
}
|
194
|
+
});
|
195
|
+
|
196
|
+
oldIndex = (themeIndex + 1) % countThemes;
|
197
|
+
oldTheme = themes[oldIndex].name;
|
198
|
+
|
199
|
+
button.text = themes[oldIndex].label;
|
193
200
|
|
194
201
|
if (target === 'cmp') {
|
195
202
|
me.exampleComponent.theme = newTheme;
|
@@ -44,11 +44,12 @@ class DemoDialog extends Dialog {
|
|
44
44
|
})()
|
45
45
|
}
|
46
46
|
}, {
|
47
|
-
module
|
48
|
-
handler: me.createDialog.bind(me),
|
49
|
-
iconCls: 'fa fa-window-maximize',
|
50
|
-
|
51
|
-
|
47
|
+
module : Button,
|
48
|
+
handler : me.createDialog.bind(me),
|
49
|
+
iconCls : 'fa fa-window-maximize',
|
50
|
+
reference: 'create-second-dialog-button',
|
51
|
+
text : 'Create new modal Dialog',
|
52
|
+
}]
|
52
53
|
}
|
53
54
|
|
54
55
|
/**
|
@@ -63,16 +64,16 @@ class DemoDialog extends Dialog {
|
|
63
64
|
appName : me.appName,
|
64
65
|
boundaryContainerId: me.boundaryContainerId,
|
65
66
|
listeners : {close: me.onWindowClose, scope: me},
|
66
|
-
modal : true
|
67
|
+
modal : true,
|
68
|
+
title : 'Second Dialog'
|
67
69
|
});
|
68
70
|
}
|
69
71
|
|
72
|
+
/**
|
73
|
+
*
|
74
|
+
*/
|
70
75
|
onWindowClose() {
|
71
|
-
|
72
|
-
text: 'Create new modal Dialog'
|
73
|
-
});
|
74
|
-
|
75
|
-
button.disabled = false;
|
76
|
+
this.getReference('create-second-dialog-button').disabled = false;
|
76
77
|
}
|
77
78
|
}
|
78
79
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "6.7.
|
3
|
+
"version": "6.7.1",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"@fortawesome/fontawesome-free": "^6.4.2",
|
46
46
|
"@material/mwc-button": "^0.27.0",
|
47
47
|
"@material/mwc-textfield": "^0.27.0",
|
48
|
-
"autoprefixer": "^10.4.
|
48
|
+
"autoprefixer": "^10.4.16",
|
49
49
|
"chalk": "^5.3.0",
|
50
50
|
"clean-webpack-plugin": "^4.0.0",
|
51
51
|
"commander": "^11.0.0",
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"neo-jsdoc": "1.0.1",
|
58
58
|
"neo-jsdoc-x": "1.0.5",
|
59
59
|
"postcss": "^8.4.30",
|
60
|
-
"sass": "^1.
|
60
|
+
"sass": "^1.68.0",
|
61
61
|
"showdown": "^2.1.0",
|
62
62
|
"webpack": "^5.88.2",
|
63
63
|
"webpack-cli": "^5.1.4",
|
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 '6.7.
|
239
|
+
* @default '6.7.1'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '6.7.
|
244
|
+
version: '6.7.1'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
package/src/form/field/Base.mjs
CHANGED
@@ -13,8 +13,8 @@ class Base extends Component {
|
|
13
13
|
* @static
|
14
14
|
*/
|
15
15
|
static delayable = {
|
16
|
-
fireChangeEvent : {type: 'debounce', timer:
|
17
|
-
fireUserChangeEvent: {type: 'debounce', timer:
|
16
|
+
fireChangeEvent : {type: 'debounce', timer: 1000},
|
17
|
+
fireUserChangeEvent: {type: 'debounce', timer: 1000}
|
18
18
|
}
|
19
19
|
|
20
20
|
static config = {
|
@@ -27,6 +27,13 @@ class Breadcrumb extends Toolbar {
|
|
27
27
|
* @member {String[]} baseCls=['neo-breadcrumb-toolbar','neo-toolbar']
|
28
28
|
*/
|
29
29
|
baseCls: ['neo-breadcrumb-toolbar', 'neo-toolbar'],
|
30
|
+
/**
|
31
|
+
* @member {Object} itemDefaults={ntype:'button', ui: 'tertiary'}
|
32
|
+
*/
|
33
|
+
itemDefaults: {
|
34
|
+
ntype: 'button',
|
35
|
+
ui : 'tertiary'
|
36
|
+
},
|
30
37
|
/**
|
31
38
|
* @member {Neo.data.Store|Object} store_=null
|
32
39
|
*/
|
package/src/util/Function.mjs
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
/**
|
2
2
|
* Append args instead of prepending them
|
3
|
+
* @param {Function} fn
|
3
4
|
* @param {Object} scope
|
4
5
|
* @returns {Function}
|
5
6
|
*/
|
6
|
-
export function bindAppend(scope) {
|
7
|
-
const
|
8
|
-
args = [].slice.call(arguments).slice(1);
|
7
|
+
export function bindAppend(fn, scope) {
|
8
|
+
const args = [].slice.call(arguments).slice(2);
|
9
9
|
|
10
10
|
return function() {
|
11
11
|
return fn.apply(scope, [].slice.call(arguments).concat(args))
|