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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.7.0'
23
+ * @member {String} version='6.7.1'
24
24
  */
25
- version: '6.7.0'
25
+ version: '6.7.1'
26
26
  }
27
27
 
28
28
  /**
@@ -1,8 +1,14 @@
1
- import Button from '../src/button/Base.mjs';
2
- import Container from '../src/container/Base.mjs';
3
- import NeoArray from '../src/util/Array.mjs';
4
- import Panel from '../src/container/Panel.mjs';
5
- import Viewport from '../src/container/Viewport.mjs';
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.bind(me, 'cmp'),
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 = this,
179
- button = Neo.getComponent(me.id + (target !== 'cmp' ? '__' : '_cmp_') + 'switchThemeButton'),
180
- newTheme, oldTheme;
181
-
182
- if (button.text === 'Theme Light') {
183
- newTheme = 'neo-theme-light';
184
- oldTheme = 'neo-theme-dark';
185
-
186
- button.text = 'Theme Dark';
187
- } else {
188
- newTheme = 'neo-theme-dark';
189
- oldTheme = 'neo-theme-light';
190
-
191
- button.text = 'Theme Light';
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;
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.7.0'
23
+ * @member {String} version='6.7.1'
24
24
  */
25
- version: '6.7.0'
25
+ version: '6.7.1'
26
26
  }
27
27
 
28
28
  /**
@@ -44,11 +44,12 @@ class DemoDialog extends Dialog {
44
44
  })()
45
45
  }
46
46
  }, {
47
- module : Button,
48
- handler: me.createDialog.bind(me),
49
- iconCls: 'fa fa-window-maximize',
50
- text : 'Create new modal Dialog',
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
- let button = this.down({
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.0",
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.15",
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.67.0",
60
+ "sass": "^1.68.0",
61
61
  "showdown": "^2.1.0",
62
62
  "webpack": "^5.88.2",
63
63
  "webpack-cli": "^5.1.4",
@@ -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.0'
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.0'
244
+ version: '6.7.1'
245
245
  };
246
246
 
247
247
  Object.assign(DefaultConfig, {
@@ -13,8 +13,8 @@ class Base extends Component {
13
13
  * @static
14
14
  */
15
15
  static delayable = {
16
- fireChangeEvent : {type: 'debounce', timer: 300},
17
- fireUserChangeEvent: {type: 'debounce', timer: 300}
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
  */
@@ -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 fn = this,
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))