neo.mjs 6.10.11 → 6.10.12
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/toolbar/paging/view/MainContainer.mjs +6 -1
- package/package.json +4 -5
- package/resources/data/deck/learnneo/p/2023-10-14T19-25-08-153Z.md +0 -1
- package/resources/data/deck/learnneo/p/ComponentModels.md +0 -2
- package/resources/data/deck/learnneo/p/Extending.md +1 -0
- package/resources/scss/src/list/Base.scss +4 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/form/field/Date.mjs +22 -1
- package/src/main/DomUtils.mjs +1 -1
- package/src/main/addon/Navigator.mjs +0 -1
- package/src/tooltip/Base.mjs +6 -2
- package/src/util/String.mjs +2 -2
package/apps/ServiceWorker.mjs
CHANGED
@@ -60,7 +60,12 @@ class MainContainer extends Viewport {
|
|
60
60
|
tooltip: 'Go to next page'
|
61
61
|
},
|
62
62
|
'nav-button-last' : {
|
63
|
-
tooltip:
|
63
|
+
tooltip: {
|
64
|
+
text : 'Go to last page',
|
65
|
+
align : {
|
66
|
+
edgeAlign : 'b-t'
|
67
|
+
}
|
68
|
+
}
|
64
69
|
},
|
65
70
|
|
66
71
|
// These two have been moved to the start of the Toolbar by their weights
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name" : "neo.mjs",
|
3
|
-
"version" : "6.10.
|
3
|
+
"version" : "6.10.12",
|
4
4
|
"description" : "The webworkers driven UI framework",
|
5
5
|
"type" : "module",
|
6
6
|
"repository" : {
|
@@ -48,15 +48,15 @@
|
|
48
48
|
"chalk" : "^5.3.0",
|
49
49
|
"clean-webpack-plugin" : "^4.0.0",
|
50
50
|
"commander" : "^11.1.0",
|
51
|
-
"cssnano" : "^6.0.
|
51
|
+
"cssnano" : "^6.0.3",
|
52
52
|
"envinfo" : "^7.11.0",
|
53
53
|
"fs-extra" : "^11.2.0",
|
54
54
|
"highlightjs-line-numbers.js" : "^2.8.0",
|
55
55
|
"inquirer" : "^9.2.12",
|
56
56
|
"neo-jsdoc" : "1.0.1",
|
57
57
|
"neo-jsdoc-x" : "1.0.5",
|
58
|
-
"postcss" : "^8.4.
|
59
|
-
"sass" : "^1.69.
|
58
|
+
"postcss" : "^8.4.33",
|
59
|
+
"sass" : "^1.69.7",
|
60
60
|
"siesta-lite" : "5.5.2",
|
61
61
|
"showdown" : "^2.1.0",
|
62
62
|
"url" : "^0.11.3",
|
@@ -70,5 +70,4 @@
|
|
70
70
|
"type" : "GitHub Sponsors",
|
71
71
|
"url" : "https://github.com/sponsors/tobiu"
|
72
72
|
}
|
73
|
-
|
74
73
|
}
|
@@ -106,7 +106,6 @@ Here's a simplified running example. The `model` and `controller` are omitted, b
|
|
106
106
|
actually used in the example, and the import root path is different to reflect the location of the
|
107
107
|
Neo.mjs libarary relative to the examples.
|
108
108
|
|
109
|
-
|
110
109
|
<pre data-neo>
|
111
110
|
import Base from '../../../../src/container/Base.mjs';
|
112
111
|
import Button from '../../../../src/button/Base.mjs';
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
Neo has a feature that allows shared, bindable, data.
|
3
2
|
|
4
3
|
A _view model_ — `Neo.model.Component` — instance holds properties that
|
@@ -113,4 +112,3 @@ Note that in the example above, the view model is in-line. Normally your view mo
|
|
113
112
|
coded in its own class that extends 'Neo.model.Component', and you'd use that in your component.
|
114
113
|
Just like with items component configs, trivial configs are often done in-line, and non-trivial
|
115
114
|
configs are coded as separate classes.
|
116
|
-
|
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
In theory, a Neo.mjs app could be defined in a single `.mjs` source file. But that would be very hard to
|
2
3
|
maintain, and any reusable configs would have to be duplicated. Instead, each of your views and reusable
|
3
4
|
widgets will be defined as its own class. The result is simpler views which are inherently reusable and easier
|
@@ -101,6 +101,10 @@
|
|
101
101
|
background-color: var(--list-item-background-color-active);
|
102
102
|
color : var(--list-container-list-color);
|
103
103
|
}
|
104
|
+
&:active {
|
105
|
+
background-color: var(--list-item-background-color-active);
|
106
|
+
color : var(--list-container-list-color);
|
107
|
+
}
|
104
108
|
}
|
105
109
|
|
106
110
|
&.neo-navigator-active-item {
|
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.10.
|
239
|
+
* @default '6.10.12'
|
240
240
|
* @memberOf! module:Neo
|
241
241
|
* @name config.version
|
242
242
|
* @type String
|
243
243
|
*/
|
244
|
-
version: '6.10.
|
244
|
+
version: '6.10.12'
|
245
245
|
};
|
246
246
|
|
247
247
|
Object.assign(DefaultConfig, {
|
package/src/form/field/Date.mjs
CHANGED
@@ -37,6 +37,10 @@ class DateField extends Picker {
|
|
37
37
|
* @member {String} errorTextInvalidDate='Not a valid date'
|
38
38
|
*/
|
39
39
|
errorTextInvalidDate: 'Not a valid date',
|
40
|
+
/**
|
41
|
+
* @member {Boolean} isoDate=false
|
42
|
+
*/
|
43
|
+
isoDate: false,
|
40
44
|
/**
|
41
45
|
* True to hide the DatePicker when selecting a day
|
42
46
|
* @member {Boolean} hidePickerOnSelect=false
|
@@ -158,6 +162,17 @@ class DateField extends Picker {
|
|
158
162
|
}
|
159
163
|
}
|
160
164
|
|
165
|
+
/**
|
166
|
+
* Triggered before the value config got changed
|
167
|
+
* @param {String} value
|
168
|
+
* @param {String} oldValue
|
169
|
+
* @protected
|
170
|
+
*/
|
171
|
+
beforeSetValue(value, oldValue) {
|
172
|
+
const val = super.beforeSetValue(value, oldValue);
|
173
|
+
return (this.isoDate && val) ? val.substring(0, 10) : val;
|
174
|
+
}
|
175
|
+
|
161
176
|
/**
|
162
177
|
* @returns {Neo.component.DateSelector}
|
163
178
|
*/
|
@@ -171,7 +186,13 @@ class DateField extends Picker {
|
|
171
186
|
getValue() {
|
172
187
|
let value = this.value;
|
173
188
|
|
174
|
-
|
189
|
+
if(this.submitDateObject && value) {
|
190
|
+
return new Date(`${value}T00:00:00.000Z`);
|
191
|
+
} else if(this.isoDate && value) {
|
192
|
+
return new Date(value).toISOString();
|
193
|
+
}
|
194
|
+
|
195
|
+
return value;
|
175
196
|
}
|
176
197
|
|
177
198
|
/**
|
package/src/main/DomUtils.mjs
CHANGED
@@ -31,7 +31,7 @@ export default class DomUtils extends Base {
|
|
31
31
|
* @param {HTMLElement} el The element to start from.
|
32
32
|
* @param {Function} filterFn A function which returns `true` when the desired element is reached.
|
33
33
|
* @param {HTMLElement} [limit] The element to stop at. This is *not* considered for matching.
|
34
|
-
* @returns
|
34
|
+
* @returns {Boolean}
|
35
35
|
*/
|
36
36
|
static closest(el, filterFn, limit = document.body) {
|
37
37
|
while (el?.nodeType === Node.ELEMENT_NODE && el !== limit) {
|
@@ -220,7 +220,6 @@ class Navigator extends Base {
|
|
220
220
|
* @param {String|Number} newActiveElement The id of the new active element in the subject
|
221
221
|
* element, or the index of the item.
|
222
222
|
* @param {Object} data The data block as passed to {@link #subscribe}
|
223
|
-
* @returns
|
224
223
|
*/
|
225
224
|
navigateTo(newActiveElement, data) {
|
226
225
|
if (!data.subject) {
|
package/src/tooltip/Base.mjs
CHANGED
@@ -261,14 +261,18 @@ class Base extends Container {
|
|
261
261
|
// If it's an internal move within the delegate, do nothing
|
262
262
|
if (currentTarget !== me.activeTarget?.id) {
|
263
263
|
me.activeTarget = Neo.get(currentTarget);
|
264
|
-
me.align.target = currentTarget;
|
265
|
-
me.align.targetMargin = 10;
|
266
264
|
|
265
|
+
// Allow listeners (eg the Tooltip singleton) which is shared between all Components
|
266
|
+
// listens for this in order to reconfigure itself from the activeTarget.
|
267
|
+
// So this event must be fired before the alignment is set up.
|
267
268
|
me.fire('targetOver', {
|
268
269
|
target : me.activeTarget,
|
269
270
|
data
|
270
271
|
});
|
271
272
|
|
273
|
+
me.align.target = currentTarget;
|
274
|
+
me.align.targetMargin = 10;
|
275
|
+
|
272
276
|
// Still visible, just realign
|
273
277
|
if (me.mounted) {
|
274
278
|
me.show();
|
package/src/util/String.mjs
CHANGED
@@ -84,8 +84,8 @@ class StringUtil extends Base {
|
|
84
84
|
|
85
85
|
/**
|
86
86
|
* Returns the passed string with the first letter uncapitalized.
|
87
|
-
* @param {
|
88
|
-
* @returns
|
87
|
+
* @param {String} value
|
88
|
+
* @returns {String}
|
89
89
|
*/
|
90
90
|
static uncapitalize(value) {
|
91
91
|
return value && value[0].toLowerCase() + value.substring(1)
|