neo.mjs 5.10.7 → 5.10.9
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/buildScripts/buildThemes.mjs +1 -1
- package/buildScripts/watchThemes.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/button/split/MainContainer.mjs +18 -0
- package/package.json +5 -5
- package/src/DefaultConfig.mjs +2 -2
- package/src/button/Split.mjs +6 -1
- package/src/main/DomEvents.mjs +20 -5
package/apps/ServiceWorker.mjs
CHANGED
@@ -2,6 +2,7 @@ import CheckBox from '../../../src/form/field/CheckBox.mjs';
|
|
2
2
|
import ConfigurationViewport from '../../ConfigurationViewport.mjs';
|
3
3
|
import Radio from '../../../src/form/field/Radio.mjs';
|
4
4
|
import NumberField from '../../../src/form/field/Number.mjs';
|
5
|
+
import SelectField from '../../../src/form/field/Select.mjs';
|
5
6
|
import SplitButton from '../../../src/button/Split.mjs';
|
6
7
|
import TextField from '../../../src/form/field/Text.mjs';
|
7
8
|
|
@@ -87,6 +88,22 @@ class MainContainer extends ConfigurationViewport {
|
|
87
88
|
listeners : {change: me.onConfigChange.bind(me, 'text')},
|
88
89
|
style : {marginTop: '10px'},
|
89
90
|
value : me.exampleComponent.text
|
91
|
+
}, {
|
92
|
+
module : SelectField,
|
93
|
+
forceSelection: true,
|
94
|
+
labelText : 'ui',
|
95
|
+
listeners : {change: me.onConfigChange.bind(me, 'ui')},
|
96
|
+
style : {marginTop: '10px'},
|
97
|
+
value : me.exampleComponent.ui,
|
98
|
+
|
99
|
+
store: {
|
100
|
+
data: [
|
101
|
+
{id: 'ghost', name: 'ghost'},
|
102
|
+
{id: 'primary', name: 'primary'},
|
103
|
+
{id: 'secondary', name: 'secondary'},
|
104
|
+
{id: 'tertiary', name: 'tertiary'}
|
105
|
+
]
|
106
|
+
}
|
90
107
|
}, {
|
91
108
|
module : NumberField,
|
92
109
|
clearable : true,
|
@@ -104,6 +121,7 @@ class MainContainer extends ConfigurationViewport {
|
|
104
121
|
module : SplitButton,
|
105
122
|
iconCls: 'fa fa-home',
|
106
123
|
text : 'Hello World',
|
124
|
+
ui : 'ghost',
|
107
125
|
|
108
126
|
handler: data => {
|
109
127
|
console.log('button click =>', data.component.id);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "5.10.
|
3
|
+
"version": "5.10.9",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"autoprefixer": "^10.4.14",
|
48
48
|
"chalk": "^5.2.0",
|
49
49
|
"clean-webpack-plugin": "^4.0.0",
|
50
|
-
"commander": "^
|
50
|
+
"commander": "^11.0.0",
|
51
51
|
"cssnano": "^6.0.1",
|
52
52
|
"envinfo": "^7.8.1",
|
53
53
|
"fs-extra": "^11.1.1",
|
@@ -56,8 +56,8 @@
|
|
56
56
|
"neo-jsdoc": "^1.0.1",
|
57
57
|
"neo-jsdoc-x": "^1.0.5",
|
58
58
|
"postcss": "^8.4.24",
|
59
|
-
"sass": "1.
|
60
|
-
"webpack": "^5.
|
59
|
+
"sass": "^1.63.4",
|
60
|
+
"webpack": "^5.87.0",
|
61
61
|
"webpack-cli": "^5.1.4",
|
62
62
|
"webpack-dev-server": "4.15.1",
|
63
63
|
"webpack-hook-plugin": "^1.0.7",
|
@@ -65,7 +65,7 @@
|
|
65
65
|
},
|
66
66
|
"devDependencies": {
|
67
67
|
"siesta-lite": "5.5.2",
|
68
|
-
"url": "^0.11.
|
68
|
+
"url": "^0.11.1"
|
69
69
|
},
|
70
70
|
"funding": {
|
71
71
|
"type": "GitHub Sponsors",
|
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.10.
|
239
|
+
* @default '5.10.9'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '5.10.
|
244
|
+
version: '5.10.9'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
package/src/button/Split.mjs
CHANGED
@@ -174,13 +174,18 @@ class Split extends Button {
|
|
174
174
|
* @param {String|null} oldValue
|
175
175
|
*/
|
176
176
|
afterSetUi(value, oldValue) {
|
177
|
-
let
|
177
|
+
let me = this,
|
178
|
+
ntype = me.ntype,
|
179
|
+
triggerButton = me.triggerButton;
|
178
180
|
|
179
181
|
if (triggerButton) {
|
180
182
|
triggerButton.ui = value;
|
181
183
|
}
|
182
184
|
|
185
|
+
// we do want to assign a button based ui to the vdomRoot
|
186
|
+
me.ntype = 'button';
|
183
187
|
super.afterSetUi(value, oldValue);
|
188
|
+
me.ntype = ntype;
|
184
189
|
}
|
185
190
|
|
186
191
|
/**
|
package/src/main/DomEvents.mjs
CHANGED
@@ -411,12 +411,15 @@ class DomEvents extends Base {
|
|
411
411
|
* @param {Object} event
|
412
412
|
*/
|
413
413
|
onChange(event) {
|
414
|
-
let
|
414
|
+
let me = this,
|
415
|
+
target = event.target,
|
416
|
+
tagName = target.tagName,
|
417
|
+
value = target.value,
|
415
418
|
|
416
419
|
data = {
|
417
|
-
...
|
420
|
+
...me.getEventData(event),
|
418
421
|
valid: target.checkValidity(),
|
419
|
-
value:
|
422
|
+
value: tagName === 'INPUT' ? StringUtil.escapeHtml(value) : tagName === 'TEXTAREA' ? me.stripHtml(value) : value
|
420
423
|
};
|
421
424
|
|
422
425
|
// input and change events can pass a FileList for input type file
|
@@ -424,7 +427,7 @@ class DomEvents extends Base {
|
|
424
427
|
data.files = target.files;
|
425
428
|
}
|
426
429
|
|
427
|
-
|
430
|
+
me.sendMessageToApp(data);
|
428
431
|
}
|
429
432
|
|
430
433
|
/**
|
@@ -512,7 +515,8 @@ class DomEvents extends Base {
|
|
512
515
|
*/
|
513
516
|
onKeyDown(event) {
|
514
517
|
let target = event.target,
|
515
|
-
|
518
|
+
tagName = target.tagName,
|
519
|
+
isInput = tagName === 'INPUT' || tagName === 'TEXTAREA';
|
516
520
|
|
517
521
|
if (isInput && disabledInputKeys[target.id]?.includes(event.key)) {
|
518
522
|
event.preventDefault();
|
@@ -721,6 +725,17 @@ class DomEvents extends Base {
|
|
721
725
|
})
|
722
726
|
}
|
723
727
|
|
728
|
+
/**
|
729
|
+
* hello <foo>world thorsten! 3 < 4 and 5 > 3
|
730
|
+
* @param {String} value
|
731
|
+
* @returns {String}
|
732
|
+
*/
|
733
|
+
stripHtml(value) {
|
734
|
+
let doc = new DOMParser().parseFromString(value, 'text/html');
|
735
|
+
|
736
|
+
return doc.body.textContent || '';
|
737
|
+
}
|
738
|
+
|
724
739
|
/**
|
725
740
|
* @param {Object} event
|
726
741
|
* @param {Object} targetArray
|