@oat-sa/tao-core-ui 1.62.0 → 1.63.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/dist/actionbar.js +3 -3
- package/dist/animable/absorbable/css/absorb.css.map +1 -1
- package/dist/animable/pulsable/css/pulse.css.map +1 -1
- package/dist/autocomplete/css/autocomplete.css.map +1 -1
- package/dist/autocomplete.js +8 -10
- package/dist/badge/css/badge.css.map +1 -1
- package/dist/breadcrumbs/css/breadcrumbs.css.map +1 -1
- package/dist/breadcrumbs.js +17 -17
- package/dist/btngrouper.js +3 -3
- package/dist/bulkActionPopup/css/bulkActionPopup.css.map +1 -1
- package/dist/calculator/css/calculator.css.map +1 -1
- package/dist/calculator.js +1 -1
- package/dist/cascadingComboBox.js +5 -5
- package/dist/ckeditor/ckConfigurator.js +9 -1
- package/dist/ckeditor/dtdHandler.js +4 -4
- package/dist/class/css/selector.css.map +1 -1
- package/dist/component/css/components.css.map +1 -1
- package/dist/component/css/windowComponent.css.map +1 -1
- package/dist/contextualPopup/css/contextualPopup.css.map +1 -1
- package/dist/contextualPopup.js +7 -7
- package/dist/dashboard/css/dashboard.css.map +1 -1
- package/dist/dashboard.js +3 -2
- package/dist/datalist/css/datalist.css.map +1 -1
- package/dist/datatable/css/datatable.css.map +1 -1
- package/dist/datatable/filterStrategy/single.js +2 -2
- package/dist/datatable.js +4 -4
- package/dist/dateRange/css/dateRange.css.map +1 -1
- package/dist/datetime/css/picker.css.map +1 -1
- package/dist/deleter.js +9 -9
- package/dist/destination/css/selector.css.map +1 -1
- package/dist/dialog.js +3 -5
- package/dist/documentViewer/css/documentViewer.css.map +1 -1
- package/dist/dropdown/css/dropdown.css.map +1 -1
- package/dist/durationer.js +6 -8
- package/dist/dynamicComponent/css/dynamicComponent.css.map +1 -1
- package/dist/dynamicComponent.js +2 -3
- package/dist/filesender.js +6 -8
- package/dist/filter.js +6 -10
- package/dist/form/css/dropdownForm.css.map +1 -1
- package/dist/form/css/form.css.map +1 -1
- package/dist/form/validator/css/validator.css.map +1 -1
- package/dist/form/widget/css/widget.css.map +1 -1
- package/dist/form.js +3 -3
- package/dist/formValidator/highlighters/highlighter.js +5 -4
- package/dist/formValidator/highlighters/message.js +1 -3
- package/dist/generis/form/css/form.css.map +1 -1
- package/dist/generis/validator/css/validator.css.map +1 -1
- package/dist/generis/widget/comboBox/comboBox.js +2 -2
- package/dist/generis/widget/css/widget.css.map +1 -1
- package/dist/generis/widget/hiddenBox/hiddenBox.js +2 -2
- package/dist/generis/widget/textBox/textBox.js +2 -2
- package/dist/groupedComboBox.js +3 -3
- package/dist/highlighter.js +49 -47
- package/dist/incrementer.js +17 -16
- package/dist/inplacer.js +4 -4
- package/dist/itemButtonList/css/item-button-list.css.map +1 -1
- package/dist/listbox/css/listbox.css.map +1 -1
- package/dist/listbox.js +1 -0
- package/dist/liststyler.js +1 -1
- package/dist/loadingButton/css/button.css.map +1 -1
- package/dist/lock.js +4 -4
- package/dist/login/login.js +4 -4
- package/dist/maths/calculator/css/calculator.css.map +1 -1
- package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +2 -2
- package/dist/mediaEditor/plugins/mediaDimension/helper.js +4 -4
- package/dist/mediaplayer/css/player.css.map +1 -1
- package/dist/mediaplayer/players/youtube.js +1 -1
- package/dist/mediaplayer/youtubeManager.js +1 -1
- package/dist/mediaplayer.js +3 -3
- package/dist/modal.js +1 -1
- package/dist/pageSizeSelector.js +3 -3
- package/dist/pagination/css/pagination.css.map +1 -1
- package/dist/pagination.js +5 -5
- package/dist/propertySelector/css/propertySelector.css.map +1 -1
- package/dist/propertySelector/propertySelector.js +3 -3
- package/dist/resource/css/selector.css.map +1 -1
- package/dist/resourcemgr/css/resourcemgr.css.map +1 -1
- package/dist/resourcemgr/fileSelector.js +6 -4
- package/dist/searchModal/css/advancedSearch.css.map +1 -1
- package/dist/searchModal/css/searchModal.css.map +1 -1
- package/dist/searchModal.js +16 -17
- package/dist/switch/css/switch.css.map +1 -1
- package/dist/tabs/css/tabs.css.map +1 -1
- package/dist/taskQueue/css/taskQueue.css.map +1 -1
- package/dist/taskQueue/status.js +4 -4
- package/dist/taskQueue/table.js +1 -1
- package/dist/taskQueue.js +7 -7
- package/dist/taskQueueButton/css/taskable.css.map +1 -1
- package/dist/taskQueueButton/css/treeButton.css.map +1 -1
- package/dist/taskQueueButton/treeButton.js +2 -2
- package/dist/toggler.js +4 -4
- package/dist/transformer.js +2 -2
- package/dist/tristateCheckboxGroup/css/tristateCheckboxGroup.css.map +1 -1
- package/dist/validator/Validator.js +4 -4
- package/dist/validator/validators.js +3 -5
- package/dist/validator.js +54 -54
- package/dist/waitingDialog/css/waitingDialog.css.map +1 -1
- package/package.json +3 -2
- package/scss/.DS_Store +0 -0
- package/scss/ckeditor/.DS_Store +0 -0
- package/scss/ckeditor/skins/.DS_Store +0 -0
- package/scss/ckeditor/skins/tao/.DS_Store +0 -0
- package/scss/ckeditor/skins/tao/scss/.DS_Store +0 -0
- package/scss/ckeditor/skins/tao/scss/inc/_ck-icons.scss +1 -0
- package/scss/font/.DS_Store +0 -0
- package/scss/font/tao/tao.svg +1 -0
- package/scss/font/tao/tao.ttf +0 -0
- package/scss/font/tao/tao.woff +0 -0
- package/scss/inc/.DS_Store +0 -0
- package/scss/inc/fonts/_tao-icon-classes.scss +2 -1
- package/scss/inc/fonts/_tao-icon-def.scss +3 -3
- package/scss/inc/fonts/_tao-icon-vars.scss +2 -1
- package/src/actionbar.js +7 -7
- package/src/animable/absorbable/css/absorb.css.map +1 -1
- package/src/animable/pulsable/css/pulse.css.map +1 -1
- package/src/autocomplete/css/autocomplete.css.map +1 -1
- package/src/autocomplete.js +74 -76
- package/src/badge/css/badge.css.map +1 -1
- package/src/breadcrumbs/css/breadcrumbs.css.map +1 -1
- package/src/breadcrumbs.js +17 -17
- package/src/btngrouper.js +14 -14
- package/src/bulkActionPopup/css/bulkActionPopup.css.map +1 -1
- package/src/calculator/css/calculator.css.map +1 -1
- package/src/calculator.js +11 -11
- package/src/cascadingComboBox.js +9 -9
- package/src/ckeditor/ckConfigurator.js +6 -0
- package/src/ckeditor/dtdHandler.js +15 -15
- package/src/class/css/selector.css.map +1 -1
- package/src/component/css/components.css.map +1 -1
- package/src/component/css/windowComponent.css.map +1 -1
- package/src/contextualPopup/css/contextualPopup.css.map +1 -1
- package/src/contextualPopup.js +11 -14
- package/src/css/basic.css +19 -5
- package/src/css/basic.css.map +1 -1
- package/src/dashboard/css/dashboard.css.map +1 -1
- package/src/dashboard.js +9 -14
- package/src/datalist/css/datalist.css.map +1 -1
- package/src/datatable/css/datatable.css.map +1 -1
- package/src/datatable/filterStrategy/single.js +7 -7
- package/src/datatable.js +6 -6
- package/src/dateRange/css/dateRange.css.map +1 -1
- package/src/datetime/css/picker.css.map +1 -1
- package/src/deleter.js +21 -21
- package/src/destination/css/selector.css.map +1 -1
- package/src/dialog.js +25 -25
- package/src/documentViewer/css/documentViewer.css.map +1 -1
- package/src/dropdown/css/dropdown.css.map +1 -1
- package/src/durationer.js +18 -20
- package/src/dynamicComponent/css/dynamicComponent.css.map +1 -1
- package/src/dynamicComponent.js +22 -23
- package/src/filesender.js +9 -11
- package/src/filter.js +8 -14
- package/src/form/css/dropdownForm.css.map +1 -1
- package/src/form/css/form.css.map +1 -1
- package/src/form/validator/css/validator.css.map +1 -1
- package/src/form/widget/css/widget.css.map +1 -1
- package/src/form.js +5 -11
- package/src/formValidator/highlighters/highlighter.js +6 -5
- package/src/formValidator/highlighters/message.js +1 -3
- package/src/generis/form/css/form.css.map +1 -1
- package/src/generis/validator/css/validator.css.map +1 -1
- package/src/generis/widget/comboBox/comboBox.js +0 -1
- package/src/generis/widget/css/widget.css.map +1 -1
- package/src/generis/widget/hiddenBox/hiddenBox.js +2 -3
- package/src/generis/widget/textBox/textBox.js +0 -1
- package/src/groupedComboBox.js +5 -5
- package/src/highlighter.js +99 -73
- package/src/incrementer.js +41 -52
- package/src/inplacer.js +21 -22
- package/src/itemButtonList/css/item-button-list.css.map +1 -1
- package/src/keyNavigation/navigableDomElement.js +22 -19
- package/src/keyNavigation/navigator.js +18 -26
- package/src/listbox/css/listbox.css.map +1 -1
- package/src/listbox.js +3 -2
- package/src/liststyler.js +7 -7
- package/src/loadingButton/css/button.css.map +1 -1
- package/src/lock.js +17 -19
- package/src/login/login.js +14 -19
- package/src/maths/calculator/css/calculator.css.map +1 -1
- package/src/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +7 -8
- package/src/mediaEditor/plugins/mediaDimension/helper.js +5 -4
- package/src/mediaplayer/css/player.css.map +1 -1
- package/src/mediaplayer/players/youtube.js +1 -1
- package/src/mediaplayer/youtubeManager.js +1 -1
- package/src/mediaplayer.js +3 -3
- package/src/modal.js +18 -18
- package/src/pageSizeSelector.js +7 -8
- package/src/pagination/css/pagination.css.map +1 -1
- package/src/pagination.js +14 -14
- package/src/propertySelector/css/propertySelector.css.map +1 -1
- package/src/propertySelector/propertySelector.js +3 -3
- package/src/resource/css/selector.css.map +1 -1
- package/src/resource/list.js +11 -11
- package/src/resource/tree.js +15 -17
- package/src/resourcemgr/css/resourcemgr.css.map +1 -1
- package/src/resourcemgr/fileSelector.js +46 -72
- package/src/searchModal/css/advancedSearch.css.map +1 -1
- package/src/searchModal/css/searchModal.css.map +1 -1
- package/src/searchModal.js +24 -25
- package/src/switch/css/switch.css.map +1 -1
- package/src/tabs/css/tabs.css.map +1 -1
- package/src/taskQueue/css/taskQueue.css.map +1 -1
- package/src/taskQueue/status.js +12 -12
- package/src/taskQueue/table.js +15 -15
- package/src/taskQueue.js +13 -15
- package/src/taskQueueButton/css/taskable.css.map +1 -1
- package/src/taskQueueButton/css/treeButton.css.map +1 -1
- package/src/taskQueueButton/treeButton.js +2 -3
- package/src/toggler.js +13 -13
- package/src/transformer.js +6 -6
- package/src/tristateCheckboxGroup/css/tristateCheckboxGroup.css.map +1 -1
- package/src/validator/Validator.js +15 -15
- package/src/validator/validators.js +10 -13
- package/src/validator.js +70 -72
- package/src/waitingDialog/css/waitingDialog.css.map +1 -1
package/src/autocomplete.js
CHANGED
|
@@ -227,7 +227,7 @@ var autocompleter = {
|
|
|
227
227
|
* The complete list of plugin options can be found at: https://github.com/devbridge/jQuery-Autocomplete
|
|
228
228
|
* @returns {autocompleter} this
|
|
229
229
|
*/
|
|
230
|
-
init: function(element, options) {
|
|
230
|
+
init: function (element, options) {
|
|
231
231
|
// fetch the element to handle, we need an input element
|
|
232
232
|
this.$element = $(element);
|
|
233
233
|
if (!this.$element.is(':input')) {
|
|
@@ -274,7 +274,7 @@ var autocompleter = {
|
|
|
274
274
|
* The value is conserved.
|
|
275
275
|
* @returns {autocompleter} this
|
|
276
276
|
*/
|
|
277
|
-
destroy: function() {
|
|
277
|
+
destroy: function () {
|
|
278
278
|
this.applyPlugin('dispose');
|
|
279
279
|
if (this.$element) {
|
|
280
280
|
this.$element.off('.' + NS);
|
|
@@ -292,12 +292,12 @@ var autocompleter = {
|
|
|
292
292
|
* The complete list of plugin options can be found at: https://github.com/devbridge/jQuery-Autocomplete
|
|
293
293
|
* @returns {Object} Returns the list of plugin options and their values.
|
|
294
294
|
*/
|
|
295
|
-
parseOptions: function(options) {
|
|
295
|
+
parseOptions: function (options) {
|
|
296
296
|
var self = this;
|
|
297
297
|
var pluginOptions = {};
|
|
298
298
|
|
|
299
299
|
// filter the options
|
|
300
|
-
_.forOwn(options, function(value, name) {
|
|
300
|
+
_.forOwn(options, function (value, name) {
|
|
301
301
|
var setterName = 'set' + capitalize(name);
|
|
302
302
|
if (self[setterName]) {
|
|
303
303
|
// a setter exists for this option
|
|
@@ -343,7 +343,7 @@ var autocompleter = {
|
|
|
343
343
|
* The complete list of plugin options can be found at: https://github.com/devbridge/jQuery-Autocomplete
|
|
344
344
|
* @returns {autocompleter} this
|
|
345
345
|
*/
|
|
346
|
-
setOptions: function(options) {
|
|
346
|
+
setOptions: function (options) {
|
|
347
347
|
this.applyPlugin('setOptions', [this.parseOptions(options)]);
|
|
348
348
|
return this;
|
|
349
349
|
},
|
|
@@ -354,7 +354,7 @@ var autocompleter = {
|
|
|
354
354
|
* @param {Array} [params] A list of optional params to pass to the called method
|
|
355
355
|
* @returns {*} Returns the callee result
|
|
356
356
|
*/
|
|
357
|
-
applyElement: function(action, params) {
|
|
357
|
+
applyElement: function (action, params) {
|
|
358
358
|
var $element = this.$element;
|
|
359
359
|
|
|
360
360
|
if ($element) {
|
|
@@ -368,7 +368,7 @@ var autocompleter = {
|
|
|
368
368
|
* @param {Array} [params] A list of optional params to pass to the called method
|
|
369
369
|
* @returns {*} Returns the callee result
|
|
370
370
|
*/
|
|
371
|
-
applyPlugin: function(action, params) {
|
|
371
|
+
applyPlugin: function (action, params) {
|
|
372
372
|
var $element = this.$element;
|
|
373
373
|
var $plugin = $element && $element[this.pluginName]();
|
|
374
374
|
|
|
@@ -380,7 +380,7 @@ var autocompleter = {
|
|
|
380
380
|
/**
|
|
381
381
|
* Shows the tooltip displayed when the server returns less records than available
|
|
382
382
|
*/
|
|
383
|
-
showTooltipTooMany: function() {
|
|
383
|
+
showTooltipTooMany: function () {
|
|
384
384
|
if (this.$element) {
|
|
385
385
|
this.tooltip.show();
|
|
386
386
|
}
|
|
@@ -389,7 +389,7 @@ var autocompleter = {
|
|
|
389
389
|
/**
|
|
390
390
|
* Hides the tooltip displayed when the server returns less records than available
|
|
391
391
|
*/
|
|
392
|
-
hideTooltipTooMany: function() {
|
|
392
|
+
hideTooltipTooMany: function () {
|
|
393
393
|
if (this.$element) {
|
|
394
394
|
this.tooltip.hide();
|
|
395
395
|
}
|
|
@@ -401,7 +401,7 @@ var autocompleter = {
|
|
|
401
401
|
* @param {Array} [params] A list of optional parameters
|
|
402
402
|
* @returns {*} Returns the call result
|
|
403
403
|
*/
|
|
404
|
-
trigger: function(eventName, params) {
|
|
404
|
+
trigger: function (eventName, params) {
|
|
405
405
|
return this.applyElement('triggerHandler', [adjustEventName(eventName), params]);
|
|
406
406
|
},
|
|
407
407
|
|
|
@@ -411,7 +411,7 @@ var autocompleter = {
|
|
|
411
411
|
* @param {Function } callback The function called back when the event occurs
|
|
412
412
|
* @returns {autocompleter} this
|
|
413
413
|
*/
|
|
414
|
-
on: function(eventName, callback) {
|
|
414
|
+
on: function (eventName, callback) {
|
|
415
415
|
this.applyElement('on', [adjustEventName(eventName), callback]);
|
|
416
416
|
return this;
|
|
417
417
|
},
|
|
@@ -422,7 +422,7 @@ var autocompleter = {
|
|
|
422
422
|
* @param {Function } [callback] The callback provided at install
|
|
423
423
|
* @returns {autocompleter} this
|
|
424
424
|
*/
|
|
425
|
-
off: function(eventName, callback) {
|
|
425
|
+
off: function (eventName, callback) {
|
|
426
426
|
this.applyElement('off', [adjustEventName(eventName), callback]);
|
|
427
427
|
return this;
|
|
428
428
|
},
|
|
@@ -431,7 +431,7 @@ var autocompleter = {
|
|
|
431
431
|
* Gets the nested element on which the component is installed.
|
|
432
432
|
* @returns {*|jQuery|HTMLElement}
|
|
433
433
|
*/
|
|
434
|
-
getElement: function() {
|
|
434
|
+
getElement: function () {
|
|
435
435
|
return this.$element;
|
|
436
436
|
},
|
|
437
437
|
|
|
@@ -439,7 +439,7 @@ var autocompleter = {
|
|
|
439
439
|
* Checks if the server can provide more suggestions than displayed for the current query
|
|
440
440
|
* @returns {Boolean}
|
|
441
441
|
*/
|
|
442
|
-
hasTooManySuggestions: function() {
|
|
442
|
+
hasTooManySuggestions: function () {
|
|
443
443
|
return !!this.tooManySuggestions;
|
|
444
444
|
},
|
|
445
445
|
|
|
@@ -447,7 +447,7 @@ var autocompleter = {
|
|
|
447
447
|
* Gets the field value.
|
|
448
448
|
* @returns {String}
|
|
449
449
|
*/
|
|
450
|
-
getValue: function() {
|
|
450
|
+
getValue: function () {
|
|
451
451
|
return this.value;
|
|
452
452
|
},
|
|
453
453
|
|
|
@@ -457,7 +457,7 @@ var autocompleter = {
|
|
|
457
457
|
* @param {String} label The label to display inside the field
|
|
458
458
|
* @returns {autocompleter} this
|
|
459
459
|
*/
|
|
460
|
-
setValue: function(value, label) {
|
|
460
|
+
setValue: function (value, label) {
|
|
461
461
|
this.value = value;
|
|
462
462
|
if (!_.isUndefined(label)) {
|
|
463
463
|
this.setLabel(label);
|
|
@@ -469,7 +469,7 @@ var autocompleter = {
|
|
|
469
469
|
* Gets the displayed label.
|
|
470
470
|
* @returns {String}
|
|
471
471
|
*/
|
|
472
|
-
getLabel: function() {
|
|
472
|
+
getLabel: function () {
|
|
473
473
|
return this.label;
|
|
474
474
|
},
|
|
475
475
|
|
|
@@ -478,7 +478,7 @@ var autocompleter = {
|
|
|
478
478
|
* @param {String} label The label to display inside the field
|
|
479
479
|
* @returns {autocompleter} this
|
|
480
480
|
*/
|
|
481
|
-
setLabel: function(label) {
|
|
481
|
+
setLabel: function (label) {
|
|
482
482
|
this.label = label;
|
|
483
483
|
if (this.$element) {
|
|
484
484
|
this.$element.val(label);
|
|
@@ -490,7 +490,7 @@ var autocompleter = {
|
|
|
490
490
|
* Gets the URI of the target ontology.
|
|
491
491
|
* @returns {String}
|
|
492
492
|
*/
|
|
493
|
-
getOntology: function() {
|
|
493
|
+
getOntology: function () {
|
|
494
494
|
return this.ontology;
|
|
495
495
|
},
|
|
496
496
|
|
|
@@ -499,7 +499,7 @@ var autocompleter = {
|
|
|
499
499
|
* @param {String} ontology
|
|
500
500
|
* @returns {autocompleter} this
|
|
501
501
|
*/
|
|
502
|
-
setOntology: function(ontology) {
|
|
502
|
+
setOntology: function (ontology) {
|
|
503
503
|
this.ontology = ontology;
|
|
504
504
|
return this;
|
|
505
505
|
},
|
|
@@ -508,7 +508,7 @@ var autocompleter = {
|
|
|
508
508
|
* Gets the name of the field containing the value within the received data.
|
|
509
509
|
* @returns {String}
|
|
510
510
|
*/
|
|
511
|
-
getValueField: function() {
|
|
511
|
+
getValueField: function () {
|
|
512
512
|
return this.valueField;
|
|
513
513
|
},
|
|
514
514
|
|
|
@@ -517,7 +517,7 @@ var autocompleter = {
|
|
|
517
517
|
* @param {String} valueField
|
|
518
518
|
* @returns {autocompleter} this
|
|
519
519
|
*/
|
|
520
|
-
setValueField: function(valueField) {
|
|
520
|
+
setValueField: function (valueField) {
|
|
521
521
|
this.valueField = valueField;
|
|
522
522
|
return this;
|
|
523
523
|
},
|
|
@@ -526,7 +526,7 @@ var autocompleter = {
|
|
|
526
526
|
* Gets the name of the field containing the label within the received data.
|
|
527
527
|
* @returns {String}
|
|
528
528
|
*/
|
|
529
|
-
getLabelField: function() {
|
|
529
|
+
getLabelField: function () {
|
|
530
530
|
return this.labelField;
|
|
531
531
|
},
|
|
532
532
|
|
|
@@ -535,7 +535,7 @@ var autocompleter = {
|
|
|
535
535
|
* @param {String} labelField
|
|
536
536
|
* @returns {autocompleter} this
|
|
537
537
|
*/
|
|
538
|
-
setLabelField: function(labelField) {
|
|
538
|
+
setLabelField: function (labelField) {
|
|
539
539
|
this.labelField = labelField;
|
|
540
540
|
return this;
|
|
541
541
|
},
|
|
@@ -548,7 +548,7 @@ var autocompleter = {
|
|
|
548
548
|
* has to take care of the selected value and to add it in its own list.
|
|
549
549
|
* @returns {Boolean}
|
|
550
550
|
*/
|
|
551
|
-
getIsProvider: function() {
|
|
551
|
+
getIsProvider: function () {
|
|
552
552
|
return this.isProvider;
|
|
553
553
|
},
|
|
554
554
|
|
|
@@ -561,7 +561,7 @@ var autocompleter = {
|
|
|
561
561
|
* @param {Boolean} isProvider
|
|
562
562
|
* @returns {autocompleter} this
|
|
563
563
|
*/
|
|
564
|
-
setIsProvider: function(isProvider) {
|
|
564
|
+
setIsProvider: function (isProvider) {
|
|
565
565
|
this.isProvider = toBoolean(isProvider);
|
|
566
566
|
return this;
|
|
567
567
|
},
|
|
@@ -571,7 +571,7 @@ var autocompleter = {
|
|
|
571
571
|
* When set to true the component prevents auto submit when the user hit enter on the text box.
|
|
572
572
|
* @returns {Boolean}
|
|
573
573
|
*/
|
|
574
|
-
getPreventSubmit: function() {
|
|
574
|
+
getPreventSubmit: function () {
|
|
575
575
|
return this.preventSubmit;
|
|
576
576
|
},
|
|
577
577
|
|
|
@@ -581,7 +581,7 @@ var autocompleter = {
|
|
|
581
581
|
* @param {Boolean} preventSubmit
|
|
582
582
|
* @returns {autocompleter} this
|
|
583
583
|
*/
|
|
584
|
-
setPreventSubmit: function(preventSubmit) {
|
|
584
|
+
setPreventSubmit: function (preventSubmit) {
|
|
585
585
|
this.preventSubmit = toBoolean(preventSubmit);
|
|
586
586
|
return this;
|
|
587
587
|
},
|
|
@@ -591,7 +591,7 @@ var autocompleter = {
|
|
|
591
591
|
* When provided, all the search params are wrapped under the same root.
|
|
592
592
|
* @returns {String}
|
|
593
593
|
*/
|
|
594
|
-
getParamsRoot: function() {
|
|
594
|
+
getParamsRoot: function () {
|
|
595
595
|
return this.paramsRoot;
|
|
596
596
|
},
|
|
597
597
|
|
|
@@ -601,7 +601,7 @@ var autocompleter = {
|
|
|
601
601
|
* @param {String} paramsRoot
|
|
602
602
|
* @returns {autocompleter} this
|
|
603
603
|
*/
|
|
604
|
-
setParamsRoot: function(paramsRoot) {
|
|
604
|
+
setParamsRoot: function (paramsRoot) {
|
|
605
605
|
this.paramsRoot = paramsRoot;
|
|
606
606
|
return this;
|
|
607
607
|
},
|
|
@@ -610,7 +610,7 @@ var autocompleter = {
|
|
|
610
610
|
* Gets the list of extra params to be sent with the query.
|
|
611
611
|
* @returns {Object}
|
|
612
612
|
*/
|
|
613
|
-
getParams: function() {
|
|
613
|
+
getParams: function () {
|
|
614
614
|
var params = _.merge({}, this.params || {});
|
|
615
615
|
var searchParams = params;
|
|
616
616
|
|
|
@@ -621,12 +621,12 @@ var autocompleter = {
|
|
|
621
621
|
|
|
622
622
|
if (this.ontology) {
|
|
623
623
|
if (!Array.isArray(this.ontologyParam)) {
|
|
624
|
-
|
|
624
|
+
searchParams[this.ontologyParam] = this.ontology;
|
|
625
625
|
} else {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}
|
|
626
|
+
this.ontologyParam.forEach(p => {
|
|
627
|
+
searchParams[p] = this.ontology;
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
630
|
}
|
|
631
631
|
|
|
632
632
|
return params;
|
|
@@ -637,7 +637,7 @@ var autocompleter = {
|
|
|
637
637
|
* @param {Object} params
|
|
638
638
|
* @returns {autocompleter} this
|
|
639
639
|
*/
|
|
640
|
-
setParams: function(params) {
|
|
640
|
+
setParams: function (params) {
|
|
641
641
|
this.params = params;
|
|
642
642
|
return this;
|
|
643
643
|
},
|
|
@@ -647,7 +647,7 @@ var autocompleter = {
|
|
|
647
647
|
* If paramsRoot has been defined, the param name will be wrapped.
|
|
648
648
|
* @returns {String}
|
|
649
649
|
*/
|
|
650
|
-
getQueryParam: function() {
|
|
650
|
+
getQueryParam: function () {
|
|
651
651
|
return this.adjustParam(this.queryParam);
|
|
652
652
|
},
|
|
653
653
|
|
|
@@ -656,7 +656,7 @@ var autocompleter = {
|
|
|
656
656
|
* @param {String} queryParam
|
|
657
657
|
* @returns {autocompleter} this
|
|
658
658
|
*/
|
|
659
|
-
setQueryParam: function(queryParam) {
|
|
659
|
+
setQueryParam: function (queryParam) {
|
|
660
660
|
this.queryParam = queryParam;
|
|
661
661
|
return this;
|
|
662
662
|
},
|
|
@@ -666,7 +666,7 @@ var autocompleter = {
|
|
|
666
666
|
* If paramsRoot has been defined, the param name will be wrapped.
|
|
667
667
|
* @returns {String}
|
|
668
668
|
*/
|
|
669
|
-
getOntologyParam: function() {
|
|
669
|
+
getOntologyParam: function () {
|
|
670
670
|
const p = Array.isArray(this.ontologyParam) ? this.ontologyParam[0] : this.ontologyParam;
|
|
671
671
|
return this.adjustParam(p);
|
|
672
672
|
},
|
|
@@ -676,7 +676,7 @@ var autocompleter = {
|
|
|
676
676
|
* @param {String} ontologyParam
|
|
677
677
|
* @returns {autocompleter} this
|
|
678
678
|
*/
|
|
679
|
-
setOntologyParam: function(ontologyParam) {
|
|
679
|
+
setOntologyParam: function (ontologyParam) {
|
|
680
680
|
this.ontologyParam = ontologyParam;
|
|
681
681
|
return this;
|
|
682
682
|
},
|
|
@@ -685,7 +685,7 @@ var autocompleter = {
|
|
|
685
685
|
* Gets the URL to data source
|
|
686
686
|
* @returns {String}
|
|
687
687
|
*/
|
|
688
|
-
getUrl: function() {
|
|
688
|
+
getUrl: function () {
|
|
689
689
|
return this.url;
|
|
690
690
|
},
|
|
691
691
|
|
|
@@ -694,7 +694,7 @@ var autocompleter = {
|
|
|
694
694
|
* @param {String} url
|
|
695
695
|
* @returns {autocompleter} this
|
|
696
696
|
*/
|
|
697
|
-
setUrl: function(url) {
|
|
697
|
+
setUrl: function (url) {
|
|
698
698
|
this.url = url;
|
|
699
699
|
return this;
|
|
700
700
|
},
|
|
@@ -703,7 +703,7 @@ var autocompleter = {
|
|
|
703
703
|
* Gets the request method. Can be either GET or POST, default to GET.
|
|
704
704
|
* @returns {String}
|
|
705
705
|
*/
|
|
706
|
-
getType: function() {
|
|
706
|
+
getType: function () {
|
|
707
707
|
return this.type || 'GET';
|
|
708
708
|
},
|
|
709
709
|
|
|
@@ -712,7 +712,7 @@ var autocompleter = {
|
|
|
712
712
|
* @param {String} type
|
|
713
713
|
* @returns {autocompleter} this
|
|
714
714
|
*/
|
|
715
|
-
setType: function(type) {
|
|
715
|
+
setType: function (type) {
|
|
716
716
|
this.type = type;
|
|
717
717
|
return this;
|
|
718
718
|
},
|
|
@@ -721,7 +721,7 @@ var autocompleter = {
|
|
|
721
721
|
* Gets the number of miliseconds to defer ajax request.
|
|
722
722
|
* @returns {number}
|
|
723
723
|
*/
|
|
724
|
-
getDelay: function() {
|
|
724
|
+
getDelay: function () {
|
|
725
725
|
return this.delay;
|
|
726
726
|
},
|
|
727
727
|
|
|
@@ -730,7 +730,7 @@ var autocompleter = {
|
|
|
730
730
|
* @param {Number} delay
|
|
731
731
|
* @returns {autocompleter}
|
|
732
732
|
*/
|
|
733
|
-
setDelay: function(delay) {
|
|
733
|
+
setDelay: function (delay) {
|
|
734
734
|
this.delay = Math.max(0, Number(delay));
|
|
735
735
|
return this;
|
|
736
736
|
},
|
|
@@ -739,7 +739,7 @@ var autocompleter = {
|
|
|
739
739
|
* Gets the minimum number of characters required to trigger the ajax request.
|
|
740
740
|
* @returns {number}
|
|
741
741
|
*/
|
|
742
|
-
getMinChars: function() {
|
|
742
|
+
getMinChars: function () {
|
|
743
743
|
return this.minChars;
|
|
744
744
|
},
|
|
745
745
|
|
|
@@ -748,7 +748,7 @@ var autocompleter = {
|
|
|
748
748
|
* @param {Number} minChars
|
|
749
749
|
* @returns {autocompleter} this
|
|
750
750
|
*/
|
|
751
|
-
setMinChars: function(minChars) {
|
|
751
|
+
setMinChars: function (minChars) {
|
|
752
752
|
this.minChars = Math.max(1, Number(minChars));
|
|
753
753
|
return this;
|
|
754
754
|
},
|
|
@@ -757,7 +757,7 @@ var autocompleter = {
|
|
|
757
757
|
* Activates the component if it was deactivated before.
|
|
758
758
|
* @returns {autocompleter} this
|
|
759
759
|
*/
|
|
760
|
-
enable: function() {
|
|
760
|
+
enable: function () {
|
|
761
761
|
this.applyPlugin('enable');
|
|
762
762
|
return this;
|
|
763
763
|
},
|
|
@@ -766,7 +766,7 @@ var autocompleter = {
|
|
|
766
766
|
* Deactivates the component.
|
|
767
767
|
* @returns {autocompleter} this
|
|
768
768
|
*/
|
|
769
|
-
disable: function() {
|
|
769
|
+
disable: function () {
|
|
770
770
|
this.applyPlugin('disable');
|
|
771
771
|
return this;
|
|
772
772
|
},
|
|
@@ -775,7 +775,7 @@ var autocompleter = {
|
|
|
775
775
|
* Hides suggestions.
|
|
776
776
|
* @returns {autocompleter} this
|
|
777
777
|
*/
|
|
778
|
-
hide: function() {
|
|
778
|
+
hide: function () {
|
|
779
779
|
this.applyPlugin('hide');
|
|
780
780
|
return this;
|
|
781
781
|
},
|
|
@@ -784,7 +784,7 @@ var autocompleter = {
|
|
|
784
784
|
* Clears suggestion cache and current suggestions.
|
|
785
785
|
* @returns {autocompleter} this
|
|
786
786
|
*/
|
|
787
|
-
clear: function() {
|
|
787
|
+
clear: function () {
|
|
788
788
|
this.tooManySuggestions = false;
|
|
789
789
|
this.applyPlugin('clear');
|
|
790
790
|
return this;
|
|
@@ -794,7 +794,7 @@ var autocompleter = {
|
|
|
794
794
|
* Clears suggestion cache.
|
|
795
795
|
* @returns {autocompleter} this
|
|
796
796
|
*/
|
|
797
|
-
clearCache: function() {
|
|
797
|
+
clearCache: function () {
|
|
798
798
|
this.applyPlugin('clearCache');
|
|
799
799
|
return this;
|
|
800
800
|
},
|
|
@@ -806,7 +806,7 @@ var autocompleter = {
|
|
|
806
806
|
* - hides suggestions.
|
|
807
807
|
* @returns {autocompleter} this
|
|
808
808
|
*/
|
|
809
|
-
reset: function() {
|
|
809
|
+
reset: function () {
|
|
810
810
|
this.setValue(null, '');
|
|
811
811
|
this.clear();
|
|
812
812
|
this.applyPlugin('hide');
|
|
@@ -818,7 +818,7 @@ var autocompleter = {
|
|
|
818
818
|
* @param {Event} event
|
|
819
819
|
* @private
|
|
820
820
|
*/
|
|
821
|
-
_onKeyEvent: function(event) {
|
|
821
|
+
_onKeyEvent: function (event) {
|
|
822
822
|
// prevent auto submit when the option preventSubmit is enabled
|
|
823
823
|
if (this.preventSubmit && 13 === event.which) {
|
|
824
824
|
event.preventDefault();
|
|
@@ -830,7 +830,7 @@ var autocompleter = {
|
|
|
830
830
|
* @param {Object} suggestion
|
|
831
831
|
* @private
|
|
832
832
|
*/
|
|
833
|
-
_onSelect: function(suggestion) {
|
|
833
|
+
_onSelect: function (suggestion) {
|
|
834
834
|
var value = suggestion && suggestion.data;
|
|
835
835
|
var label = suggestion && suggestion.value;
|
|
836
836
|
|
|
@@ -854,7 +854,7 @@ var autocompleter = {
|
|
|
854
854
|
* @param {Object} params The list of params which will be bound the query
|
|
855
855
|
* @private
|
|
856
856
|
*/
|
|
857
|
-
_onSearchStart: function(params) {
|
|
857
|
+
_onSearchStart: function (params) {
|
|
858
858
|
var queryParam = this.getQueryParam();
|
|
859
859
|
var query;
|
|
860
860
|
|
|
@@ -877,7 +877,7 @@ var autocompleter = {
|
|
|
877
877
|
* @param {Object} suggestions An array containing the results.
|
|
878
878
|
* @private
|
|
879
879
|
*/
|
|
880
|
-
_onSearchComplete: function(query, suggestions) {
|
|
880
|
+
_onSearchComplete: function (query, suggestions) {
|
|
881
881
|
// clear cache when the query returns no records :
|
|
882
882
|
// this avoids to have to reload the page when the server has a temporary failure
|
|
883
883
|
if (!suggestions || !suggestions.length) {
|
|
@@ -895,7 +895,7 @@ var autocompleter = {
|
|
|
895
895
|
* @param {Exception} errorThrown
|
|
896
896
|
* @private
|
|
897
897
|
*/
|
|
898
|
-
_onSearchError: function(query, jqXHR, textStatus, errorThrown) {
|
|
898
|
+
_onSearchError: function (query, jqXHR, textStatus, errorThrown) {
|
|
899
899
|
return this.trigger('searchError', [query, jqXHR, textStatus, errorThrown, this]);
|
|
900
900
|
},
|
|
901
901
|
|
|
@@ -903,7 +903,7 @@ var autocompleter = {
|
|
|
903
903
|
* Fired when input is altered after selection has been made.
|
|
904
904
|
* @private
|
|
905
905
|
*/
|
|
906
|
-
_onInvalidateSelection: function() {
|
|
906
|
+
_onInvalidateSelection: function () {
|
|
907
907
|
return this.trigger('invalidateSelection', [this]);
|
|
908
908
|
},
|
|
909
909
|
|
|
@@ -913,16 +913,15 @@ var autocompleter = {
|
|
|
913
913
|
* @param {jQuery} $container
|
|
914
914
|
* @private
|
|
915
915
|
*/
|
|
916
|
-
_onBeforeRender: function($container) {
|
|
916
|
+
_onBeforeRender: function ($container) {
|
|
917
917
|
this.trigger('beforeRender', [$container, this]);
|
|
918
918
|
},
|
|
919
919
|
|
|
920
920
|
/**
|
|
921
921
|
* Fired when the input element has the focus
|
|
922
|
-
* @param {Event} event
|
|
923
922
|
* @private
|
|
924
923
|
*/
|
|
925
|
-
_onFocus: function(
|
|
924
|
+
_onFocus: function () {
|
|
926
925
|
if (this.hasTooManySuggestions()) {
|
|
927
926
|
this.showTooltipTooMany();
|
|
928
927
|
}
|
|
@@ -930,10 +929,9 @@ var autocompleter = {
|
|
|
930
929
|
|
|
931
930
|
/**
|
|
932
931
|
* Fired when the input element lose the focus
|
|
933
|
-
* @param {Event} event
|
|
934
932
|
* @private
|
|
935
933
|
*/
|
|
936
|
-
_onBlur: function(
|
|
934
|
+
_onBlur: function () {
|
|
937
935
|
this.hideTooltipTooMany();
|
|
938
936
|
},
|
|
939
937
|
|
|
@@ -942,7 +940,7 @@ var autocompleter = {
|
|
|
942
940
|
* @param response
|
|
943
941
|
* @returns {{suggestions: Array}}
|
|
944
942
|
*/
|
|
945
|
-
_transformResult: function(response) {
|
|
943
|
+
_transformResult: function (response) {
|
|
946
944
|
var self = this;
|
|
947
945
|
var results = {
|
|
948
946
|
suggestions: []
|
|
@@ -952,7 +950,7 @@ var autocompleter = {
|
|
|
952
950
|
response = JSON.parse(response);
|
|
953
951
|
}
|
|
954
952
|
if (response.records) {
|
|
955
|
-
results.suggestions = _.map(response.data, function(dataItem) {
|
|
953
|
+
results.suggestions = _.map(response.data, function (dataItem) {
|
|
956
954
|
return {
|
|
957
955
|
value: dataItem[self.labelField],
|
|
958
956
|
data: dataItem[self.valueField]
|
|
@@ -976,7 +974,7 @@ var autocompleter = {
|
|
|
976
974
|
* @param {String} param
|
|
977
975
|
* @returns {String}
|
|
978
976
|
*/
|
|
979
|
-
adjustParam: function(param) {
|
|
977
|
+
adjustParam: function (param) {
|
|
980
978
|
if (this.paramsRoot) {
|
|
981
979
|
param = this.paramsRoot + '[' + param + ']';
|
|
982
980
|
}
|
|
@@ -989,8 +987,8 @@ var autocompleter = {
|
|
|
989
987
|
* @param {string} eventName
|
|
990
988
|
* @returns {string}
|
|
991
989
|
*/
|
|
992
|
-
|
|
993
|
-
var names = _(eventName.split(' ')).map(function(name) {
|
|
990
|
+
function adjustEventName(eventName) {
|
|
991
|
+
var names = _(eventName.split(' ')).map(function (name) {
|
|
994
992
|
name = name.toLowerCase();
|
|
995
993
|
if (-1 === name.indexOf('.')) {
|
|
996
994
|
name += '.' + NS;
|
|
@@ -998,21 +996,21 @@ var adjustEventName = function(eventName) {
|
|
|
998
996
|
return name;
|
|
999
997
|
});
|
|
1000
998
|
return names.join(' ');
|
|
1001
|
-
}
|
|
999
|
+
}
|
|
1002
1000
|
|
|
1003
1001
|
/**
|
|
1004
1002
|
* Converts a value to boolean
|
|
1005
1003
|
* @param value
|
|
1006
1004
|
* @returns {Boolean}
|
|
1007
1005
|
*/
|
|
1008
|
-
|
|
1006
|
+
function toBoolean(value) {
|
|
1009
1007
|
if (_.isString(value)) {
|
|
1010
1008
|
if ('false' === value.toLowerCase() || '0' === value) {
|
|
1011
1009
|
value = false;
|
|
1012
1010
|
}
|
|
1013
1011
|
}
|
|
1014
1012
|
return !!value;
|
|
1015
|
-
}
|
|
1013
|
+
}
|
|
1016
1014
|
|
|
1017
1015
|
/**
|
|
1018
1016
|
* Installs the autocompleter onto an element.
|
|
@@ -1020,10 +1018,10 @@ var toBoolean = function(value) {
|
|
|
1020
1018
|
* @param {Object} options A list of options to set
|
|
1021
1019
|
* @returns {autocompleter} Returns the instance of the autocompleter component
|
|
1022
1020
|
*/
|
|
1023
|
-
|
|
1021
|
+
function autocompleteFactory(element, options) {
|
|
1024
1022
|
var autocomplete = _.clone(autocompleter, true);
|
|
1025
1023
|
_.defaults(autocomplete, defaults);
|
|
1026
1024
|
return autocomplete.init(element, options);
|
|
1027
|
-
}
|
|
1025
|
+
}
|
|
1028
1026
|
|
|
1029
1027
|
export default autocompleteFactory;
|