neo.mjs 6.5.4 → 6.5.6
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/package.json +2 -2
- package/src/DefaultConfig.mjs +2 -2
- package/src/calendar/view/week/Component.mjs +6 -5
- package/src/component/Base.mjs +17 -0
- package/src/component/DateSelector.mjs +7 -5
- package/src/form/field/Text.mjs +0 -11
- package/src/util/Function.mjs +15 -6
package/apps/ServiceWorker.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "6.5.
|
3
|
+
"version": "6.5.6",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -67,7 +67,7 @@
|
|
67
67
|
},
|
68
68
|
"devDependencies": {
|
69
69
|
"siesta-lite": "5.5.2",
|
70
|
-
"url": "^0.11.
|
70
|
+
"url": "^0.11.3"
|
71
71
|
},
|
72
72
|
"funding": {
|
73
73
|
"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 '6.5.
|
239
|
+
* @default '6.5.6'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '6.5.
|
244
|
+
version: '6.5.6'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
@@ -444,7 +444,7 @@ class Component extends BaseComponent {
|
|
444
444
|
super.afterSetMounted(value, oldValue);
|
445
445
|
|
446
446
|
let me = this,
|
447
|
-
rect;
|
447
|
+
scrollContainerId, rect;
|
448
448
|
|
449
449
|
if (value) {
|
450
450
|
if (me.needsEventUpdate) {
|
@@ -452,14 +452,15 @@ class Component extends BaseComponent {
|
|
452
452
|
me.needsEventUpdate = false;
|
453
453
|
}
|
454
454
|
|
455
|
-
await me.timeout(
|
455
|
+
await me.timeout(100);
|
456
456
|
|
457
|
-
rect
|
457
|
+
rect = await me.getDomRect(me.getColumnContainer().id);
|
458
|
+
scrollContainerId = me.getScrollContainer().id;
|
458
459
|
|
459
|
-
Neo.main.DomAccess.scrollBy({
|
460
|
+
scrollContainerId && Neo.main.DomAccess.scrollBy({
|
460
461
|
appName : me.appName,
|
461
462
|
direction: 'left',
|
462
|
-
id :
|
463
|
+
id : scrollContainerId,
|
463
464
|
value : rect.width * me.columnsBuffer / me.columnsVisible / 3
|
464
465
|
});
|
465
466
|
}
|
package/src/component/Base.mjs
CHANGED
@@ -264,6 +264,13 @@ class Base extends CoreBase {
|
|
264
264
|
* @protected
|
265
265
|
*/
|
266
266
|
plugins_: null,
|
267
|
+
/**
|
268
|
+
* Set a reference for accessing the component inside view controllers.
|
269
|
+
* References will also get mapped into the vdom root (data-ref: value).
|
270
|
+
* @member {String|null} reference_=null
|
271
|
+
* @protected
|
272
|
+
*/
|
273
|
+
reference_: null,
|
267
274
|
/**
|
268
275
|
* True in case the component is rendering the vnode
|
269
276
|
* @member {Boolean} rendering_=false
|
@@ -702,6 +709,16 @@ class Base extends CoreBase {
|
|
702
709
|
}
|
703
710
|
}
|
704
711
|
|
712
|
+
/**
|
713
|
+
* Triggered after the reference config got changed
|
714
|
+
* @param {String|null} value
|
715
|
+
* @param {String|null} oldValue
|
716
|
+
* @protected
|
717
|
+
*/
|
718
|
+
afterSetReference(value, oldValue) {
|
719
|
+
value && this.changeVdomRootKey('data-ref', value)
|
720
|
+
}
|
721
|
+
|
705
722
|
/**
|
706
723
|
* Triggered after the role config got changed
|
707
724
|
* @param {String|null} value
|
@@ -759,15 +759,17 @@ class DateSelector extends Component {
|
|
759
759
|
*/
|
760
760
|
onComponentWheel(data) {
|
761
761
|
let me = this,
|
762
|
+
deltaX = data.deltaX,
|
763
|
+
deltaY = data.deltaY,
|
762
764
|
wheelDelta = me.mouseWheelDelta,
|
763
765
|
date, monthIncrement, yearIncrement;
|
764
766
|
|
765
|
-
if (Math.abs(
|
766
|
-
if (
|
767
|
-
else if (
|
767
|
+
if (Math.abs(deltaY) >= Math.abs(deltaX)) {
|
768
|
+
if (deltaY >= wheelDelta) {yearIncrement = 1;}
|
769
|
+
else if (deltaY <= -wheelDelta) {yearIncrement = -1;}
|
768
770
|
} else {
|
769
|
-
if (
|
770
|
-
else if (
|
771
|
+
if (deltaX >= wheelDelta) {monthIncrement = 1;}
|
772
|
+
else if (deltaX <= -wheelDelta) {monthIncrement = -1;}
|
771
773
|
}
|
772
774
|
|
773
775
|
if (monthIncrement) {
|
package/src/form/field/Text.mjs
CHANGED
@@ -17,17 +17,6 @@ class Text extends Base {
|
|
17
17
|
* @static
|
18
18
|
*/
|
19
19
|
static autoCapitalizeValues = ['characters', 'none', 'on', 'off', 'sentences', 'words']
|
20
|
-
/**
|
21
|
-
* @member {Object} delayable
|
22
|
-
* @protected
|
23
|
-
* @static
|
24
|
-
*/
|
25
|
-
static delayable = {
|
26
|
-
fireChangeEvent: {
|
27
|
-
type : 'debounce',
|
28
|
-
timer: 300
|
29
|
-
}
|
30
|
-
}
|
31
20
|
/**
|
32
21
|
* Valid values for labelPosition
|
33
22
|
* @member {String[]} labelPositions=['bottom','inline','left','right','top']
|
package/src/util/Function.mjs
CHANGED
@@ -59,7 +59,7 @@ export function debounce(callback, scope, delay=300) {
|
|
59
59
|
// we need to check if the scope (instance) did not get destroyed yet
|
60
60
|
scope?.id && callback.apply(scope, args);
|
61
61
|
|
62
|
-
// we still want to start a timer
|
62
|
+
// we still want to start a timer to delay the 2nd+ update
|
63
63
|
debounceTimer = setTimeout(() => {debounceTimer = null}, delay)
|
64
64
|
} else {
|
65
65
|
clearTimeout(debounceTimer);
|
@@ -99,16 +99,25 @@ export function intercept(target, targetMethodName, interceptFunction, scope, pr
|
|
99
99
|
* @returns {Function}
|
100
100
|
*/
|
101
101
|
export function throttle(callback, scope, delay=300) {
|
102
|
-
let
|
102
|
+
let lastRanDate, timeoutId;
|
103
103
|
|
104
104
|
return function(...args) {
|
105
|
-
if (!
|
106
|
-
wait = true;
|
107
|
-
|
105
|
+
if (!lastRanDate) {
|
108
106
|
// we need to check if the scope (instance) did not get destroyed yet
|
109
107
|
scope?.id && callback.apply(scope, args);
|
110
108
|
|
111
|
-
|
109
|
+
lastRanDate = Date.now()
|
110
|
+
} else {
|
111
|
+
clearTimeout(timeoutId)
|
112
|
+
|
113
|
+
timeoutId = setTimeout(function() {
|
114
|
+
if ((Date.now() - lastRanDate) >= delay) {
|
115
|
+
// we need to check if the scope (instance) did not get destroyed yet
|
116
|
+
scope?.id && callback.apply(scope, args);
|
117
|
+
|
118
|
+
lastRanDate = Date.now()
|
119
|
+
}
|
120
|
+
}, delay - (Date.now() - lastRanDate))
|
112
121
|
}
|
113
122
|
}
|
114
123
|
}
|