neo.mjs 6.13.0 → 6.15.0
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/apps/covid/neo-config.json +1 -1
- package/apps/covid/view/HeaderContainer.mjs +2 -2
- package/apps/form/view/pages/Page10.mjs +2 -2
- package/apps/portal/view/ViewportController.mjs +5 -4
- package/apps/portal/view/home/ContentBox.mjs +80 -0
- package/apps/portal/view/home/MainContainer.mjs +51 -15
- package/apps/portal/view/learn/ContentTreeList.mjs +10 -3
- package/apps/portal/view/learn/MainContainerController.mjs +37 -5
- package/apps/portal/view/learn/MainContainerModel.mjs +51 -7
- package/apps/portal/view/learn/PageContainer.mjs +21 -9
- package/apps/sharedcovid/neo-config.json +1 -1
- package/apps/sharedcovid/view/HeaderContainer.mjs +2 -2
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/button/base/MainContainer.mjs +2 -2
- package/examples/button/split/MainContainer.mjs +2 -2
- package/examples/component/process/MainContainer.mjs +3 -3
- package/examples/component/process/realWorldExample/MainContainer.mjs +15 -15
- package/examples/component/toast/MainContainer.mjs +4 -4
- package/examples/dialog/DemoDialog.mjs +4 -4
- package/examples/fieldWithPrefix/MainContainer.mjs +4 -5
- package/examples/form/field/{select → combobox}/MainContainer.mjs +7 -10
- package/examples/form/field/{select → combobox}/MainModel.mjs +4 -4
- package/examples/form/field/{select → combobox}/MainStore.mjs +2 -2
- package/examples/form/field/{select → combobox}/app.mjs +1 -1
- package/examples/form/field/{select → combobox}/index.html +1 -1
- package/examples/form/field/{select → combobox}/neo-config.json +1 -1
- package/examples/tableFiltering/MainContainer.mjs +2 -2
- package/package.json +4 -4
- package/resources/data/deck/learnneo/pages/2023-10-14T19-25-08-153Z.md +16 -1
- package/resources/data/deck/learnneo/pages/ComponentsAndContainers.md +180 -0
- package/resources/data/deck/learnneo/pages/Config.md +11 -4
- package/resources/data/deck/learnneo/pages/DescribingTheUI.md +6 -0
- package/resources/data/deck/learnneo/pages/Earthquakes.md +36 -9
- package/resources/data/deck/learnneo/pages/Events.md +55 -43
- package/resources/data/deck/learnneo/pages/GuideEvents.md +9 -8
- package/resources/data/deck/learnneo/pages/References.md +14 -7
- package/resources/data/deck/learnneo/pages/TodoList.md +241 -0
- package/resources/data/deck/learnneo/pages/WhyNeo-Quick.md +6 -11
- package/resources/data/deck/learnneo/tree.json +2 -0
- package/resources/scss/src/apps/portal/home/ContentBox.scss +26 -0
- package/resources/scss/src/apps/portal/home/MainContainer.scss +4 -12
- package/resources/scss/src/apps/portal/learn/MainContainer.scss +0 -7
- package/resources/scss/src/apps/portal/learn/PageContainer.scss +35 -0
- package/resources/scss/src/apps/portal/learn/PageSectionsPanel.scss +8 -0
- package/resources/scss/src/form/field/{Select.scss → ComboBox.scss} +8 -8
- package/resources/scss/theme-dark/form/field/ComboBox.scss +9 -0
- package/resources/scss/theme-light/form/field/ComboBox.scss +9 -0
- package/resources/scss/theme-neo-light/form/field/ComboBox.scss +9 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/Base.mjs +16 -1
- package/src/container/Viewport.mjs +5 -2
- package/src/controller/Application.mjs +12 -1
- package/src/controller/Base.mjs +15 -4
- package/src/controller/Component.mjs +5 -1
- package/src/core/Observable.mjs +62 -22
- package/src/form/field/Base.mjs +21 -9
- package/src/form/field/Chip.mjs +3 -3
- package/src/form/field/Color.mjs +3 -3
- package/src/form/field/{Select.mjs → ComboBox.mjs} +179 -130
- package/src/form/field/Country.mjs +3 -3
- package/src/form/field/Text.mjs +7 -10
- package/src/form/field/_export.mjs +2 -2
- package/src/main/DomEvents.mjs +2 -1
- package/src/main/addon/MonacoEditor.mjs +2 -2
- package/src/main/addon/Navigator.mjs +27 -24
- package/src/selection/ListModel.mjs +13 -14
- package/src/selection/Model.mjs +10 -10
- package/src/toolbar/Paging.mjs +2 -2
- package/src/util/HashHistory.mjs +1 -0
- package/src/worker/App.mjs +5 -1
- package/src/worker/Manager.mjs +14 -7
- package/test/components/app.mjs +1 -1
- package/test/components/files/form/field/{Select.mjs → ComboBox.mjs} +9 -7
- package/test/components/siesta.js +1 -1
- package/resources/scss/theme-dark/form/field/Select.scss +0 -9
- package/resources/scss/theme-light/form/field/Select.scss +0 -9
- package/resources/scss/theme-neo-light/form/field/Select.scss +0 -9
@@ -10,10 +10,10 @@ import VDomUtil from '../../util/VDom.mjs';
|
|
10
10
|
* Provides a dropdown list to select one or multiple items.
|
11
11
|
*
|
12
12
|
* Conforms to ARIA accessibility standards outlines in https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
13
|
-
* @class Neo.form.field.
|
13
|
+
* @class Neo.form.field.ComboBox
|
14
14
|
* @extends Neo.form.field.Picker
|
15
15
|
*/
|
16
|
-
class
|
16
|
+
class ComboBox extends Picker {
|
17
17
|
/**
|
18
18
|
* Valid values for triggerAction
|
19
19
|
* @member {String[]} triggerActions=['all','filtered']
|
@@ -24,23 +24,23 @@ class Select extends Picker {
|
|
24
24
|
|
25
25
|
static config = {
|
26
26
|
/**
|
27
|
-
* @member {String} className='Neo.form.field.
|
27
|
+
* @member {String} className='Neo.form.field.ComboBox'
|
28
28
|
* @protected
|
29
29
|
*/
|
30
|
-
className: 'Neo.form.field.
|
30
|
+
className: 'Neo.form.field.ComboBox',
|
31
31
|
/**
|
32
|
-
* @member {String} ntype='
|
32
|
+
* @member {String} ntype='combobox'
|
33
33
|
* @protected
|
34
34
|
*/
|
35
|
-
ntype: '
|
35
|
+
ntype: 'combobox',
|
36
36
|
/**
|
37
37
|
* @member {String|Number|null} activeRecordId=null
|
38
38
|
*/
|
39
39
|
activeRecordId: null,
|
40
40
|
/**
|
41
|
-
* @member {String[]} baseCls=['neo-
|
41
|
+
* @member {String[]} baseCls=['neo-combobox','neo-pickerfield','neo-textfield']
|
42
42
|
*/
|
43
|
-
baseCls: ['neo-
|
43
|
+
baseCls: ['neo-combobox', 'neo-pickerfield', 'neo-textfield'],
|
44
44
|
/**
|
45
45
|
* @member {String} displayField='name'
|
46
46
|
*/
|
@@ -88,11 +88,6 @@ class Select extends Picker {
|
|
88
88
|
* @member {Number|null} pickerHeight=null
|
89
89
|
*/
|
90
90
|
pickerHeight: null,
|
91
|
-
/**
|
92
|
-
* @member {Object} record_=null
|
93
|
-
* @protected
|
94
|
-
*/
|
95
|
-
record_: null,
|
96
91
|
/**
|
97
92
|
* @member {String|null} role='combobox'
|
98
93
|
*/
|
@@ -126,6 +121,17 @@ class Select extends Picker {
|
|
126
121
|
valueField: 'id'
|
127
122
|
}
|
128
123
|
|
124
|
+
/**
|
125
|
+
* Internal flag to store the value, in case it was set before the store was loaded
|
126
|
+
* @member {Number|String} preStoreLoadValue=null
|
127
|
+
*/
|
128
|
+
preStoreLoadValue = null
|
129
|
+
/**
|
130
|
+
* Internal flag to not show a picker when non user-based input value changes happen
|
131
|
+
* @member {Boolean} programmaticValueChange=false
|
132
|
+
*/
|
133
|
+
programmaticValueChange = false
|
134
|
+
|
129
135
|
/**
|
130
136
|
* @param {Object} config
|
131
137
|
*/
|
@@ -135,28 +141,20 @@ class Select extends Picker {
|
|
135
141
|
let me = this;
|
136
142
|
|
137
143
|
// Create buffered function to respond to input field mutation
|
138
|
-
me.filterOnInput = buffer(me.filterOnInput, me, me.filterDelay);
|
144
|
+
//me.filterOnInput = buffer(me.filterOnInput, me, me.filterDelay);
|
139
145
|
|
140
146
|
me.typeAhead && me.updateTypeAhead()
|
141
147
|
}
|
142
148
|
|
143
149
|
/**
|
144
|
-
* Triggered after the
|
145
|
-
* @param {
|
146
|
-
* @param {
|
150
|
+
* Triggered after the inputValue config got changed
|
151
|
+
* @param {String|null} value
|
152
|
+
* @param {String|null} oldValue
|
147
153
|
* @protected
|
148
154
|
*/
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
if (value) {
|
154
|
-
oldValue && selectionModel?.deselect(oldValue);
|
155
|
-
selectionModel?.select(value)
|
156
|
-
} else {
|
157
|
-
selectionModel.deselectAll()
|
158
|
-
}
|
159
|
-
}
|
155
|
+
afterSetInputValue(value, oldValue) {
|
156
|
+
super.afterSetInputValue(value, oldValue);
|
157
|
+
this.updateTypeAheadValue(value);
|
160
158
|
}
|
161
159
|
|
162
160
|
/**
|
@@ -177,7 +175,7 @@ class Select extends Picker {
|
|
177
175
|
includeEmptyValues: true,
|
178
176
|
operator : me.filterOperator,
|
179
177
|
property : me.displayField,
|
180
|
-
value : value
|
178
|
+
value : value?.[me.displayField] || null
|
181
179
|
});
|
182
180
|
|
183
181
|
value.filters = filters
|
@@ -201,6 +199,31 @@ class Select extends Picker {
|
|
201
199
|
this.rendered && this.updateTypeAhead()
|
202
200
|
}
|
203
201
|
|
202
|
+
/**
|
203
|
+
* Triggered after the value config got changed
|
204
|
+
* @param {Object} value
|
205
|
+
* @param {Object} oldValue
|
206
|
+
* @protected
|
207
|
+
*/
|
208
|
+
afterSetValue(value, oldValue) {
|
209
|
+
super.afterSetValue(value, oldValue);
|
210
|
+
|
211
|
+
let me = this;
|
212
|
+
|
213
|
+
me.programmaticValueChange = false;
|
214
|
+
|
215
|
+
if (me._picker?.isVisible) {
|
216
|
+
let selectionModel = me.list?.selectionModel;
|
217
|
+
|
218
|
+
if (value) {
|
219
|
+
oldValue && selectionModel?.deselect(oldValue);
|
220
|
+
selectionModel?.select(value)
|
221
|
+
} else {
|
222
|
+
selectionModel.deselectAll()
|
223
|
+
}
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
204
227
|
/**
|
205
228
|
* Triggered before the listConfig config gets changed.
|
206
229
|
* @param {Object} value
|
@@ -234,13 +257,14 @@ class Select extends Picker {
|
|
234
257
|
// Simplest case is just picking string values.
|
235
258
|
if (typeof v === 'string') {
|
236
259
|
v = {
|
237
|
-
[valueField]
|
238
|
-
[displayField]
|
239
|
-
}
|
260
|
+
[valueField] : v,
|
261
|
+
[displayField]: v
|
262
|
+
}
|
240
263
|
}
|
241
|
-
|
264
|
+
|
265
|
+
return v
|
242
266
|
})
|
243
|
-
}
|
267
|
+
}
|
244
268
|
}
|
245
269
|
|
246
270
|
// to reduce boilerplate code, a store config object without a defined model should default
|
@@ -269,9 +293,9 @@ class Select extends Picker {
|
|
269
293
|
|
270
294
|
/**
|
271
295
|
* Triggered before the value config gets changed.
|
272
|
-
* @param {Number|String
|
273
|
-
* @param {Number|String
|
274
|
-
* @returns {Number|String
|
296
|
+
* @param {Number|Object|String} value
|
297
|
+
* @param {Number|Object|String} oldValue
|
298
|
+
* @returns {Number|Object|String}
|
275
299
|
* @protected
|
276
300
|
*/
|
277
301
|
beforeSetValue(value, oldValue) {
|
@@ -280,21 +304,31 @@ class Select extends Picker {
|
|
280
304
|
store = me.store,
|
281
305
|
record;
|
282
306
|
|
307
|
+
me.programmaticValueChange = true;
|
308
|
+
|
309
|
+
// getting a record, nothing to do
|
283
310
|
if (Neo.isObject(value)) {
|
284
|
-
|
285
|
-
|
286
|
-
|
311
|
+
return value
|
312
|
+
}
|
313
|
+
|
314
|
+
if (value === null) {
|
315
|
+
return null
|
316
|
+
}
|
317
|
+
|
318
|
+
// we can only match record ids or display values in case the store is loaded
|
319
|
+
if (store.getCount() > 0) {
|
287
320
|
record = store.isFiltered() ? store.allItems.get(value) : store.get(value);
|
288
321
|
|
289
322
|
if (record) {
|
290
|
-
|
291
|
-
return record[displayField];
|
323
|
+
return record
|
292
324
|
}
|
293
|
-
}
|
294
|
-
|
295
|
-
me.record = store.find(displayField, value)[0] || null;
|
296
325
|
|
297
|
-
|
326
|
+
return store.find(displayField, value)[0] || null
|
327
|
+
} else {
|
328
|
+
// store not loaded yet
|
329
|
+
me.preStoreLoadValue = value;
|
330
|
+
return null
|
331
|
+
}
|
298
332
|
}
|
299
333
|
|
300
334
|
/**
|
@@ -332,7 +366,7 @@ class Select extends Picker {
|
|
332
366
|
scope : me
|
333
367
|
});
|
334
368
|
|
335
|
-
return me.list
|
369
|
+
return me.list
|
336
370
|
}
|
337
371
|
|
338
372
|
/**
|
@@ -349,10 +383,8 @@ class Select extends Picker {
|
|
349
383
|
let me = this,
|
350
384
|
store = me.store,
|
351
385
|
filter = store.getFilter(me.displayField),
|
352
|
-
|
353
|
-
|
354
|
-
record
|
355
|
-
} = me;
|
386
|
+
picker = me.picker,
|
387
|
+
record = me.value;
|
356
388
|
|
357
389
|
if (filter) {
|
358
390
|
filter.value = value
|
@@ -387,11 +419,11 @@ class Select extends Picker {
|
|
387
419
|
}
|
388
420
|
|
389
421
|
/**
|
390
|
-
* @param {
|
422
|
+
* @param {String} value
|
391
423
|
*/
|
392
|
-
filterOnInput(
|
393
|
-
if (
|
394
|
-
this.doFilter(
|
424
|
+
filterOnInput(value) {
|
425
|
+
if (value) {
|
426
|
+
this.doFilter(value)
|
395
427
|
} else {
|
396
428
|
this.picker?.hide()
|
397
429
|
}
|
@@ -406,19 +438,10 @@ class Select extends Picker {
|
|
406
438
|
fireChangeEvent(value, oldValue) {
|
407
439
|
let me = this,
|
408
440
|
FormContainer = Neo.form?.Container,
|
409
|
-
|
410
|
-
oldRecord, params;
|
441
|
+
params;
|
411
442
|
|
412
|
-
if (!(me.forceSelection && !
|
413
|
-
|
414
|
-
|
415
|
-
params = {
|
416
|
-
component: me,
|
417
|
-
oldRecord,
|
418
|
-
oldValue,
|
419
|
-
record,
|
420
|
-
value
|
421
|
-
};
|
443
|
+
if (!(me.forceSelection && !value)) {
|
444
|
+
params = {component: me, oldValue, value};
|
422
445
|
|
423
446
|
me.fire('change', params);
|
424
447
|
|
@@ -463,7 +486,7 @@ class Select extends Picker {
|
|
463
486
|
getValue() {
|
464
487
|
let me = this;
|
465
488
|
|
466
|
-
return me.
|
489
|
+
return me.value?.[me.valueField] || me.emptyValue
|
467
490
|
}
|
468
491
|
|
469
492
|
/**
|
@@ -487,24 +510,15 @@ class Select extends Picker {
|
|
487
510
|
onFocusLeave(data) {
|
488
511
|
let me = this;
|
489
512
|
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
me.
|
513
|
+
if (me.forceSelection && !me.value) {
|
514
|
+
me.programmaticValueChange = true;
|
515
|
+
me.value = me.store.get(me.activeRecordId);
|
516
|
+
me.programmaticValueChange = false;
|
494
517
|
}
|
495
518
|
|
496
|
-
|
497
|
-
}
|
519
|
+
me.updateTypeAheadValue(null);
|
498
520
|
|
499
|
-
|
500
|
-
* @param {Object} data
|
501
|
-
* @protected
|
502
|
-
*/
|
503
|
-
onInputValueChange(data) {
|
504
|
-
// We do not call super here. The value of the Select is *not* connected to the value
|
505
|
-
// typed into the input area. The input area is just a filter value to filter the list.
|
506
|
-
this.lastManualInput = data.value
|
507
|
-
this.filterOnInput(data);
|
521
|
+
super.onFocusLeave(data)
|
508
522
|
}
|
509
523
|
|
510
524
|
/**
|
@@ -530,27 +544,30 @@ class Select extends Picker {
|
|
530
544
|
* @param {Object[]} selectionChangeEvent.selection
|
531
545
|
* @protected
|
532
546
|
*/
|
533
|
-
onListItemSelectionChange({ selection }) {
|
547
|
+
async onListItemSelectionChange({ selection }) {
|
534
548
|
if (selection?.length) {
|
535
549
|
const
|
536
|
-
me
|
537
|
-
|
538
|
-
|
539
|
-
record = typeof selected === 'string' ? me.store.get(me.list.getItemRecordId(selected)) : selected,
|
540
|
-
value = record[me.displayField];
|
550
|
+
me = this,
|
551
|
+
selected = selection[0],
|
552
|
+
record = typeof selected === 'string' ? me.store.get(me.list.getItemRecordId(selected)) : selected;
|
541
553
|
|
542
|
-
me.hidePicker();
|
543
554
|
me.hintRecordId = null;
|
544
|
-
me.record = record;
|
545
|
-
me._value = value;
|
546
|
-
me.getInputHintEl().value = null;
|
547
555
|
|
548
|
-
me.
|
556
|
+
me.updateTypeAheadValue(null, true);
|
557
|
+
|
558
|
+
me.preventFiltering = true;
|
559
|
+
me.value = record;
|
560
|
+
me.preventFiltering = false;
|
549
561
|
|
550
562
|
me.fire('select', {
|
551
|
-
record
|
552
|
-
|
553
|
-
|
563
|
+
value: record
|
564
|
+
});
|
565
|
+
|
566
|
+
// Short delay to let selection DOM updates get applied.
|
567
|
+
// Alternatively, we could hide the picker before the selection happen and limit updates to the vdom.
|
568
|
+
await me.timeout(20);
|
569
|
+
|
570
|
+
await me.hidePicker()
|
554
571
|
}
|
555
572
|
}
|
556
573
|
|
@@ -559,14 +576,16 @@ class Select extends Picker {
|
|
559
576
|
* For example clicking on already selected list item.
|
560
577
|
*/
|
561
578
|
onListItemSelectionNoChange() {
|
562
|
-
this.hidePicker()
|
579
|
+
this.hidePicker()
|
563
580
|
}
|
564
581
|
|
565
582
|
/**
|
566
583
|
* @param {Object} record
|
567
584
|
* @protected
|
568
585
|
*/
|
569
|
-
onListItemNavigate(
|
586
|
+
onListItemNavigate(record) {
|
587
|
+
let {activeItem, activeIndex} = record;
|
588
|
+
|
570
589
|
if (activeIndex >= 0) {
|
571
590
|
const
|
572
591
|
me = this,
|
@@ -587,11 +606,13 @@ class Select extends Picker {
|
|
587
606
|
const inputEl = this.getInputEl();
|
588
607
|
|
589
608
|
super.onPickerHiddenChange(...arguments);
|
609
|
+
|
590
610
|
if (value) {
|
591
|
-
inputEl['aria-activedescendant'] = ''
|
611
|
+
inputEl['aria-activedescendant'] = ''
|
592
612
|
}
|
613
|
+
|
593
614
|
inputEl['aria-expanded'] = !value;
|
594
|
-
this.update()
|
615
|
+
this.update()
|
595
616
|
}
|
596
617
|
|
597
618
|
/**
|
@@ -602,8 +623,7 @@ class Select extends Picker {
|
|
602
623
|
|
603
624
|
if (me.picker?.isVisible) {
|
604
625
|
me.picker.hidden = true
|
605
|
-
}
|
606
|
-
else if (!me.readOnly && !me.disabled) {
|
626
|
+
} else if (!me.disabled && !me.readOnly) {
|
607
627
|
me.doFilter(null)
|
608
628
|
}
|
609
629
|
}
|
@@ -614,10 +634,10 @@ class Select extends Picker {
|
|
614
634
|
*/
|
615
635
|
onStoreLoad(items) {
|
616
636
|
let me = this,
|
617
|
-
value = me.
|
637
|
+
value = me.preStoreLoadValue;
|
618
638
|
|
619
|
-
if (value) {
|
620
|
-
me._value =
|
639
|
+
if (value !== null) {
|
640
|
+
me._value = undefined; // silent update
|
621
641
|
me.value = value
|
622
642
|
}
|
623
643
|
}
|
@@ -645,13 +665,28 @@ class Select extends Picker {
|
|
645
665
|
|
646
666
|
if (!Neo.isNumber(index)) {
|
647
667
|
if (me.activeRecordId) {
|
648
|
-
index = me.store.indexOfKey(me.activeRecordId)
|
668
|
+
index = me.store.indexOfKey(me.activeRecordId)
|
649
669
|
} else {
|
650
|
-
index = 0
|
670
|
+
index = 0
|
651
671
|
}
|
652
672
|
}
|
653
673
|
|
654
|
-
me.list.selectItem(index)
|
674
|
+
me.list.selectItem(index)
|
675
|
+
}
|
676
|
+
|
677
|
+
/**
|
678
|
+
* Override this method as needed inside class extensions.
|
679
|
+
* @param {*} value
|
680
|
+
* @protected
|
681
|
+
*/
|
682
|
+
updateInputValueFromValue(value) {
|
683
|
+
let inputValue = null;
|
684
|
+
|
685
|
+
if (Neo.isObject(value)) {
|
686
|
+
inputValue = value[this.displayField]
|
687
|
+
}
|
688
|
+
|
689
|
+
this.inputValue = inputValue
|
655
690
|
}
|
656
691
|
|
657
692
|
/**
|
@@ -690,31 +725,45 @@ class Select extends Picker {
|
|
690
725
|
* @protected
|
691
726
|
*/
|
692
727
|
updateTypeAheadValue(value=this.lastManualInput, silent=false) {
|
693
|
-
let me
|
694
|
-
match
|
695
|
-
|
696
|
-
|
697
|
-
displayField
|
698
|
-
}
|
699
|
-
= me,
|
700
|
-
inputHintEl = me.getInputHintEl();
|
728
|
+
let me = this,
|
729
|
+
match = false,
|
730
|
+
inputHintEl = me.getInputHintEl(),
|
731
|
+
{displayField, store} = me;
|
701
732
|
|
702
|
-
if (
|
703
|
-
|
704
|
-
|
733
|
+
if (me.typeAhead) {
|
734
|
+
if (!me.value && value?.length > 0) {
|
735
|
+
const search = value.toLocaleLowerCase();
|
736
|
+
match = store.items.find(r => r[displayField]?.toLowerCase?.()?.startsWith(search));
|
737
|
+
|
738
|
+
if (match && inputHintEl) {
|
739
|
+
inputHintEl.value = value + match[displayField].substr(value.length);
|
740
|
+
me.activeRecord = match;
|
741
|
+
me.activeRecordId = match[store.keyProperty || store.model.keyProperty]
|
742
|
+
}
|
743
|
+
}
|
705
744
|
|
706
|
-
if (match && inputHintEl) {
|
707
|
-
inputHintEl.value =
|
708
|
-
me.activeRecord = match;
|
709
|
-
me.activeRecordId = match[store.keyProperty || store.model.keyProperty]
|
745
|
+
if (!match && inputHintEl) {
|
746
|
+
inputHintEl.value = me.activeRecord = me.activeRecordId = null;
|
710
747
|
}
|
711
|
-
}
|
712
748
|
|
713
|
-
|
714
|
-
inputHintEl.value = me.activeRecord = me.activeRecordId = null;
|
749
|
+
!silent && me.update()
|
715
750
|
}
|
751
|
+
}
|
752
|
+
/**
|
753
|
+
* @param {String} inputValue
|
754
|
+
* @protected
|
755
|
+
*/
|
756
|
+
updateValueFromInputValue(inputValue) {
|
757
|
+
let me = this;
|
716
758
|
|
717
|
-
|
759
|
+
me.lastManualInput = inputValue;
|
760
|
+
|
761
|
+
if (!me.programmaticValueChange) {
|
762
|
+
// changing the input => silent record reset
|
763
|
+
me._value = null;
|
764
|
+
|
765
|
+
me.filterOnInput(inputValue)
|
766
|
+
}
|
718
767
|
}
|
719
768
|
}
|
720
769
|
|
@@ -726,6 +775,6 @@ class Select extends Picker {
|
|
726
775
|
* @returns {Object}
|
727
776
|
*/
|
728
777
|
|
729
|
-
Neo.setupClass(
|
778
|
+
Neo.setupClass(ComboBox);
|
730
779
|
|
731
|
-
export default
|
780
|
+
export default ComboBox;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
1
|
+
import ComboBox from './ComboBox.mjs';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* @class Neo.form.field.Country
|
5
|
-
* @extends Neo.form.field.
|
5
|
+
* @extends Neo.form.field.ComboBox
|
6
6
|
*/
|
7
|
-
class Country extends
|
7
|
+
class Country extends ComboBox {
|
8
8
|
static config = {
|
9
9
|
/**
|
10
10
|
* @member {String} className='Neo.form.field.Country'
|
package/src/form/field/Text.mjs
CHANGED
@@ -496,7 +496,7 @@ class Text extends Base {
|
|
496
496
|
NeoArray.toggle(cls, 'neo-has-content', me.hasContent());
|
497
497
|
me.cls = cls;
|
498
498
|
|
499
|
-
me.
|
499
|
+
me.updateValueFromInputValue(value)
|
500
500
|
}
|
501
501
|
|
502
502
|
/**
|
@@ -866,18 +866,17 @@ class Text extends Base {
|
|
866
866
|
* @protected
|
867
867
|
*/
|
868
868
|
afterSetValue(value, oldValue) {
|
869
|
-
let me
|
870
|
-
originalValue = me.originalConfig.value,
|
871
|
-
isDirty = value !== originalValue && Neo.isEmpty(value) !== Neo.isEmpty(originalValue),
|
869
|
+
let me = this,
|
872
870
|
cls;
|
873
871
|
|
874
872
|
me.silentVdomUpdate = true;
|
875
|
-
|
873
|
+
|
874
|
+
me.updateInputValueFromValue(value);
|
876
875
|
|
877
876
|
me.validate(); // silent
|
878
877
|
|
879
878
|
cls = me.cls;
|
880
|
-
NeoArray.toggle(cls, 'neo-is-dirty', isDirty);
|
879
|
+
NeoArray.toggle(cls, 'neo-is-dirty', me.isDirty);
|
881
880
|
me.cls = cls;
|
882
881
|
|
883
882
|
me.silentVdomUpdate = false;
|
@@ -1505,11 +1504,10 @@ class Text extends Base {
|
|
1505
1504
|
/**
|
1506
1505
|
* Override this method as needed inside class extensions.
|
1507
1506
|
* @param {*} value
|
1508
|
-
* @returns {String}
|
1509
1507
|
* @protected
|
1510
1508
|
*/
|
1511
1509
|
updateInputValueFromValue(value) {
|
1512
|
-
|
1510
|
+
this.inputValue = value
|
1513
1511
|
}
|
1514
1512
|
|
1515
1513
|
/**
|
@@ -1562,11 +1560,10 @@ class Text extends Base {
|
|
1562
1560
|
/**
|
1563
1561
|
* Override this method as needed inside class extensions.
|
1564
1562
|
* @param {String} inputValue
|
1565
|
-
* @returns {*}
|
1566
1563
|
* @protected
|
1567
1564
|
*/
|
1568
1565
|
updateValueFromInputValue(inputValue) {
|
1569
|
-
|
1566
|
+
this.value = inputValue
|
1570
1567
|
}
|
1571
1568
|
|
1572
1569
|
/**
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import Base from './Base.mjs';
|
2
2
|
import CheckBox from './CheckBox.mjs';
|
3
3
|
import Chip from './Chip.mjs';
|
4
|
+
import ComboBox from './ComboBox.mjs';
|
4
5
|
import Date from './Date.mjs';
|
5
6
|
import Display from './Display.mjs';
|
6
7
|
import Email from './Email.mjs';
|
@@ -10,10 +11,9 @@ import Picker from './Picker.mjs';
|
|
10
11
|
import Radio from './Radio.mjs';
|
11
12
|
import Range from './Range.mjs';
|
12
13
|
import Search from './Search.mjs';
|
13
|
-
import Select from './Select.mjs';
|
14
14
|
import Text from './Text.mjs';
|
15
15
|
import TextArea from './TextArea.mjs';
|
16
16
|
import Time from './Time.mjs';
|
17
17
|
import Url from './Url.mjs';
|
18
18
|
|
19
|
-
export {Base, CheckBox, Chip, Date, Display, Email, Number, Password, Picker, Radio, Range, Search,
|
19
|
+
export {Base, CheckBox, Chip, ComboBox, Date, Display, Email, Number, Password, Picker, Radio, Range, Search, Text, TextArea, Time, Url};
|
package/src/main/DomEvents.mjs
CHANGED
@@ -17,9 +17,9 @@ class MonacoEditor extends Base {
|
|
17
17
|
*/
|
18
18
|
className: 'Neo.main.addon.MonacoEditor',
|
19
19
|
/**
|
20
|
-
* @member {String} libraryBasePath='
|
20
|
+
* @member {String} libraryBasePath='../../node_modules/monaco-editor/min/vs'
|
21
21
|
*/
|
22
|
-
libraryBasePath: '
|
22
|
+
libraryBasePath: '../../node_modules/monaco-editor/min/vs',
|
23
23
|
/**
|
24
24
|
* Remote method access for other workers
|
25
25
|
* @member {Object} remote
|