@appbaseio/reactivesearch-vue 1.29.0-preview.1 → 1.31.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/@appbaseio/reactivesearch-vue.umd.js +1596 -566
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-e0b7c1f6.js → Button-0e2e2c02.js} +1 -1
- package/dist/cjs/{CancelSvg-4aa35935.js → CancelSvg-c48c1085.js} +1 -1
- package/dist/cjs/{Card-fd94ef07.js → Card-4fa0f769.js} +2 -2
- package/dist/cjs/{ComponentWrapper-10bad289.js → ComponentWrapper-6909bc2a.js} +2 -2
- package/dist/cjs/{Container-526efa6a.js → Container-cfd69a34.js} +1 -1
- package/dist/cjs/{DataSearch-eec21890.js → DataSearch-a8fabd77.js} +236 -84
- package/dist/cjs/DataSearch.js +10 -10
- package/dist/cjs/{DropDown-e4381fcc.js → DropDown-aa358fff.js} +5 -5
- package/dist/cjs/DynamicRangeSlider.js +8 -7
- package/dist/cjs/{Flex-f146cdad.js → Flex-63774e4d.js} +1 -1
- package/dist/cjs/{FormControlList-808dbcef.js → FormControlList-a9c64bb8.js} +1 -1
- package/dist/cjs/{Input-0d7b25ad.js → Input-43868594.js} +1 -1
- package/dist/cjs/{ListItem-b40adb04.js → ListItem-38962297.js} +2 -2
- package/dist/cjs/MultiDropdownList.js +13 -12
- package/dist/cjs/MultiList.js +11 -10
- package/dist/cjs/MultiRange.js +9 -8
- package/dist/cjs/RangeInput.js +11 -10
- package/dist/cjs/RangeSlider.js +9 -8
- package/dist/cjs/ReactiveBase.js +69 -35
- package/dist/cjs/ReactiveComponent.js +6 -5
- package/dist/cjs/ReactiveList.js +22 -15
- package/dist/cjs/ResultCard.js +4 -4
- package/dist/cjs/ResultList.js +4 -4
- package/dist/cjs/SelectedFilters.js +45 -28
- package/dist/cjs/SingleDropdownList.js +13 -12
- package/dist/cjs/SingleList.js +11 -10
- package/dist/cjs/SingleRange.js +10 -9
- package/dist/cjs/StateProvider.js +30 -5
- package/dist/cjs/{Title-584a8cc8.js → Title-26661936.js} +1 -1
- package/dist/cjs/ToggleButton.js +10 -8
- package/dist/cjs/{_rollupPluginBabelHelpers-f127c8b7.js → _rollupPluginBabelHelpers-91d4b5a6.js} +1 -2
- package/dist/cjs/{index-4509aa45.js → index-2e0ea8d8.js} +13 -1
- package/dist/cjs/index.js +19 -18
- package/dist/cjs/initReactivesearch.js +40 -8
- package/dist/cjs/{install-b05fef06.js → install-27314778.js} +232 -70
- package/dist/cjs/install.js +19 -18
- package/dist/cjs/{ssr-0ee35a09.js → ssr-949cafb5.js} +1 -1
- package/dist/cjs/{utils-1219e1fe.js → utils-0df3cb93.js} +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-57d01f18.js → vueTypes-3970ff42.js} +6 -0
- package/dist/es/{Button-33de88e6.js → Button-e18ad90f.js} +1 -1
- package/dist/es/{CancelSvg-c2c03a35.js → CancelSvg-e3b33cdd.js} +1 -1
- package/dist/es/{Card-6446f1b7.js → Card-ad6ba09f.js} +2 -2
- package/dist/es/{ComponentWrapper-0f3431d1.js → ComponentWrapper-ca0354ea.js} +2 -2
- package/dist/es/{Container-18b03fde.js → Container-421450dc.js} +1 -1
- package/dist/es/{DataSearch-42f547cd.js → DataSearch-da9347f7.js} +236 -86
- package/dist/es/DataSearch.js +10 -10
- package/dist/es/{DropDown-ff6ad982.js → DropDown-604374d2.js} +5 -5
- package/dist/es/DynamicRangeSlider.js +8 -7
- package/dist/es/{Flex-8770345d.js → Flex-09d40927.js} +1 -1
- package/dist/es/{FormControlList-704f8dee.js → FormControlList-38ffe3d3.js} +1 -1
- package/dist/es/{Input-e339e63a.js → Input-c9d757bc.js} +1 -1
- package/dist/es/{ListItem-8e8fb535.js → ListItem-41d6ddd7.js} +2 -2
- package/dist/es/MultiDropdownList.js +13 -12
- package/dist/es/MultiList.js +11 -10
- package/dist/es/MultiRange.js +9 -8
- package/dist/es/RangeInput.js +11 -10
- package/dist/es/RangeSlider.js +9 -8
- package/dist/es/ReactiveBase.js +70 -36
- package/dist/es/ReactiveComponent.js +6 -5
- package/dist/es/ReactiveList.js +22 -15
- package/dist/es/ResultCard.js +4 -4
- package/dist/es/ResultList.js +4 -4
- package/dist/es/SelectedFilters.js +45 -28
- package/dist/es/SingleDropdownList.js +13 -12
- package/dist/es/SingleList.js +11 -10
- package/dist/es/SingleRange.js +10 -9
- package/dist/es/StateProvider.js +30 -5
- package/dist/es/{Title-3522ff56.js → Title-35edd732.js} +1 -1
- package/dist/es/ToggleButton.js +10 -8
- package/dist/es/{_rollupPluginBabelHelpers-0f24d612.js → _rollupPluginBabelHelpers-51ce1182.js} +1 -2
- package/dist/es/{index-78920565.js → index-4715798c.js} +13 -2
- package/dist/es/index.js +20 -19
- package/dist/es/initReactivesearch.js +41 -9
- package/dist/es/{install-bd448c02.js → install-5d9cb7ed.js} +232 -70
- package/dist/es/install.js +19 -18
- package/dist/es/{ssr-a41dfea9.js → ssr-ad57b0ad.js} +1 -1
- package/dist/es/{utils-64a2e5f0.js → utils-9b45e0ab.js} +1 -1
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-687b2304.js → vueTypes-c0d8b875.js} +6 -0
- package/package.json +3 -3
|
@@ -4,24 +4,24 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
4
4
|
|
|
5
5
|
var configureStore = require('@appbaseio/reactivecore');
|
|
6
6
|
var configureStore__default = _interopDefault(configureStore);
|
|
7
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
7
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-91d4b5a6.js');
|
|
8
8
|
var VueTypes = _interopDefault(require('vue-types'));
|
|
9
9
|
var constants = require('@appbaseio/reactivecore/lib/utils/constants');
|
|
10
10
|
var helper = require('@appbaseio/reactivecore/lib/utils/helper');
|
|
11
11
|
var styled = require('@appbaseio/vue-emotion');
|
|
12
12
|
var styled__default = _interopDefault(styled);
|
|
13
|
-
var Button = require('./Button-
|
|
14
|
-
var vueTypes = require('./vueTypes-
|
|
13
|
+
var Button = require('./Button-0e2e2c02.js');
|
|
14
|
+
var vueTypes = require('./vueTypes-3970ff42.js');
|
|
15
15
|
var ReactiveList = require('./ReactiveList.js');
|
|
16
|
-
var index = require('./index-
|
|
17
|
-
var ComponentWrapper = require('./ComponentWrapper-
|
|
18
|
-
var Title = require('./Title-
|
|
16
|
+
var index = require('./index-2e0ea8d8.js');
|
|
17
|
+
var ComponentWrapper = require('./ComponentWrapper-6909bc2a.js');
|
|
18
|
+
var Title = require('./Title-26661936.js');
|
|
19
19
|
var ReactiveBase = require('./ReactiveBase.js');
|
|
20
20
|
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
21
|
-
var DataSearch = require('./DataSearch-
|
|
22
|
-
var CancelSvg = require('./CancelSvg-
|
|
23
|
-
var Input = require('./Input-
|
|
24
|
-
var Container = require('./Container-
|
|
21
|
+
var DataSearch = require('./DataSearch-a8fabd77.js');
|
|
22
|
+
var CancelSvg = require('./CancelSvg-c48c1085.js');
|
|
23
|
+
var Input = require('./Input-43868594.js');
|
|
24
|
+
var Container = require('./Container-cfd69a34.js');
|
|
25
25
|
var SingleList = require('./SingleList.js');
|
|
26
26
|
var MultiList = require('./MultiList.js');
|
|
27
27
|
var SingleDropdownList = require('./SingleDropdownList.js');
|
|
@@ -80,10 +80,12 @@ var _debounce = configureStore.helper.debounce,
|
|
|
80
80
|
normalizeDataField = configureStore.helper.normalizeDataField;
|
|
81
81
|
var SearchBox = {
|
|
82
82
|
name: 'SearchBox',
|
|
83
|
+
isTagsMode: false,
|
|
83
84
|
data: function data() {
|
|
84
85
|
var props = this.$props;
|
|
85
86
|
this.__state = {
|
|
86
87
|
currentValue: '',
|
|
88
|
+
selectedTags: [],
|
|
87
89
|
isOpen: false,
|
|
88
90
|
normalizedSuggestions: []
|
|
89
91
|
};
|
|
@@ -99,7 +101,16 @@ var SearchBox = {
|
|
|
99
101
|
var _this$$props = this.$props,
|
|
100
102
|
distinctField = _this$$props.distinctField,
|
|
101
103
|
distinctFieldConfig = _this$$props.distinctFieldConfig,
|
|
102
|
-
index = _this$$props.index
|
|
104
|
+
index$1 = _this$$props.index,
|
|
105
|
+
mode = _this$$props.mode;
|
|
106
|
+
|
|
107
|
+
if (mode === constants.SEARCH_COMPONENTS_MODES.TAG) {
|
|
108
|
+
this.$options.isTagsMode = true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (this.$options.isTagsMode) {
|
|
112
|
+
console.warn('Warning(ReactiveSearch): The `categoryField` prop is not supported when `mode` prop is set to `tag`');
|
|
113
|
+
}
|
|
103
114
|
|
|
104
115
|
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
105
116
|
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
@@ -109,13 +120,17 @@ var SearchBox = {
|
|
|
109
120
|
console.warn('Warning(ReactiveSearch): In order to use the `distinctField` and `distinctFieldConfig` props, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
110
121
|
}
|
|
111
122
|
|
|
112
|
-
if (!this.enableAppbase && index) {
|
|
123
|
+
if (!this.enableAppbase && index$1) {
|
|
113
124
|
console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
|
|
114
125
|
}
|
|
115
126
|
|
|
116
|
-
this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
|
|
117
|
-
|
|
118
|
-
|
|
127
|
+
this.currentValue = index.decodeHtml(this.selectedValue || this.value || this.defaultValue || '');
|
|
128
|
+
|
|
129
|
+
if (this.$options.isTagsMode) {
|
|
130
|
+
this.currentValue = '';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
this.handleTextChange = _debounce(this.handleText, this.$props.debounce); // Set custom and default queries in store
|
|
119
134
|
|
|
120
135
|
this.triggerCustomQuery(this.currentValue, this.selectedCategory);
|
|
121
136
|
this.triggerDefaultQuery(this.currentValue);
|
|
@@ -151,7 +166,7 @@ var SearchBox = {
|
|
|
151
166
|
debounce: VueTypes.number.def(0),
|
|
152
167
|
defaultValue: vueTypes.types.string,
|
|
153
168
|
excludeFields: vueTypes.types.excludeFields,
|
|
154
|
-
value: vueTypes.types.value,
|
|
169
|
+
value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), vueTypes.types.value]),
|
|
155
170
|
defaultSuggestions: vueTypes.types.suggestions,
|
|
156
171
|
enableSynonyms: VueTypes.bool.def(true),
|
|
157
172
|
enableQuerySuggestions: VueTypes.bool.def(false),
|
|
@@ -204,7 +219,20 @@ var SearchBox = {
|
|
|
204
219
|
onData: vueTypes.types.func,
|
|
205
220
|
renderItem: vueTypes.types.func,
|
|
206
221
|
enterButton: VueTypes.bool.def(false),
|
|
207
|
-
renderEnterButton: VueTypes.any
|
|
222
|
+
renderEnterButton: VueTypes.any,
|
|
223
|
+
mode: VueTypes.oneOf(['select', 'tag']).def('select'),
|
|
224
|
+
renderSelectedTags: VueTypes.any,
|
|
225
|
+
searchboxId: VueTypes.string,
|
|
226
|
+
endpoint: vueTypes.types.endpointConfig
|
|
227
|
+
},
|
|
228
|
+
beforeMount: function beforeMount() {
|
|
229
|
+
if (this.selectedValue) {
|
|
230
|
+
this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
|
|
231
|
+
} else if (this.$props.value) {
|
|
232
|
+
this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
|
|
233
|
+
} else if (this.$props.defaultValue) {
|
|
234
|
+
this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
|
|
235
|
+
}
|
|
208
236
|
},
|
|
209
237
|
mounted: function mounted() {
|
|
210
238
|
this.listenForFocusShortcuts();
|
|
@@ -254,15 +282,25 @@ var SearchBox = {
|
|
|
254
282
|
this.normalizedSuggestions = suggestionsList;
|
|
255
283
|
},
|
|
256
284
|
selectedValue: function selectedValue(newVal, oldVal) {
|
|
257
|
-
if (oldVal
|
|
285
|
+
if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
|
|
258
286
|
if (!newVal && this.$data.currentValue) {
|
|
259
287
|
// selected value is cleared, call onValueSelected
|
|
260
288
|
this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
|
|
289
|
+
} // if (this.$props.value === undefined) {
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
if (this.$options.isTagsMode) {
|
|
293
|
+
// handling reset of tags through SelectedFilters or URL
|
|
294
|
+
this.selectedTags = [];
|
|
261
295
|
}
|
|
262
296
|
|
|
263
|
-
|
|
264
|
-
|
|
297
|
+
var cause = !newVal ? configureStore.causes.CLEAR_VALUE : undefined;
|
|
298
|
+
|
|
299
|
+
if (this.$options.isTagsMode) {
|
|
300
|
+
cause = configureStore.causes.SUGGESTION_SELECT;
|
|
265
301
|
}
|
|
302
|
+
|
|
303
|
+
this.setValue(newVal || '', true, this.$props, cause); // }
|
|
266
304
|
}
|
|
267
305
|
},
|
|
268
306
|
focusShortcuts: function focusShortcuts() {
|
|
@@ -403,7 +441,40 @@ var SearchBox = {
|
|
|
403
441
|
}
|
|
404
442
|
|
|
405
443
|
var performUpdate = function performUpdate() {
|
|
406
|
-
_this.
|
|
444
|
+
if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
|
|
449
|
+
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
450
|
+
// check if value already present in selectedTags
|
|
451
|
+
if (typeof value === 'string' && _this.selectedTags.includes(value)) {
|
|
452
|
+
_this.isOpen = false;
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
_this.selectedTags = [].concat(_this.selectedTags);
|
|
457
|
+
|
|
458
|
+
if (typeof value === 'string' && !!value) {
|
|
459
|
+
_this.selectedTags.push(value);
|
|
460
|
+
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
461
|
+
var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
|
|
462
|
+
_this.selectedTags = mergedArray;
|
|
463
|
+
}
|
|
464
|
+
} else if (value) {
|
|
465
|
+
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
_this.currentValue = '';
|
|
469
|
+
} else {
|
|
470
|
+
_this.currentValue = index.decodeHtml(value);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
var queryHandlerValue = value;
|
|
474
|
+
|
|
475
|
+
if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
|
|
476
|
+
queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
|
|
477
|
+
}
|
|
407
478
|
|
|
408
479
|
if (isDefaultValue) {
|
|
409
480
|
if (_this.$props.autosuggest) {
|
|
@@ -411,19 +482,19 @@ var SearchBox = {
|
|
|
411
482
|
_this.isOpen = false;
|
|
412
483
|
}
|
|
413
484
|
|
|
414
|
-
_this.triggerDefaultQuery(
|
|
485
|
+
if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
|
|
415
486
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
416
487
|
// to set the query otherwise the value should reset
|
|
417
488
|
|
|
418
489
|
|
|
419
490
|
if (props.strictSelection) {
|
|
420
|
-
if (cause === configureStore.causes.SUGGESTION_SELECT || value === '') {
|
|
421
|
-
_this.triggerCustomQuery(
|
|
491
|
+
if (cause === configureStore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
|
|
492
|
+
_this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
|
|
422
493
|
} else {
|
|
423
494
|
_this.setValue('', true);
|
|
424
495
|
}
|
|
425
|
-
} else if (props.value === undefined) {
|
|
426
|
-
_this.triggerCustomQuery(
|
|
496
|
+
} else if (props.value === undefined || cause === configureStore.causes.SUGGESTION_SELECT || cause === configureStore.causes.CLEAR_VALUE) {
|
|
497
|
+
_this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
|
|
427
498
|
}
|
|
428
499
|
} else {
|
|
429
500
|
// debounce for handling text while typing
|
|
@@ -474,6 +545,11 @@ var SearchBox = {
|
|
|
474
545
|
showFilter = _this$$props2.showFilter,
|
|
475
546
|
URLParams = _this$$props2.URLParams;
|
|
476
547
|
var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
|
|
548
|
+
|
|
549
|
+
if (this.$options.isTagsMode) {
|
|
550
|
+
value = paramValue;
|
|
551
|
+
}
|
|
552
|
+
|
|
477
553
|
var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
|
|
478
554
|
var query = defaultQueryTobeSet;
|
|
479
555
|
|
|
@@ -567,7 +643,8 @@ var SearchBox = {
|
|
|
567
643
|
if (this.$props.autosuggest === false) {
|
|
568
644
|
this.enterButtonOnClick();
|
|
569
645
|
} else if (highlightedIndex === null) {
|
|
570
|
-
this.setValue(event.target.value, true
|
|
646
|
+
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined // to handle tags
|
|
647
|
+
);
|
|
571
648
|
this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
|
|
572
649
|
}
|
|
573
650
|
} // Need to review
|
|
@@ -612,13 +689,29 @@ var SearchBox = {
|
|
|
612
689
|
if (value === undefined) {
|
|
613
690
|
this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
614
691
|
} else {
|
|
615
|
-
|
|
692
|
+
var emitValue = suggestion.value;
|
|
693
|
+
|
|
694
|
+
if (this.$options.isTagsMode) {
|
|
695
|
+
emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
|
|
696
|
+
|
|
697
|
+
if (this.selectedTags.includes(suggestion.value)) {
|
|
698
|
+
// avoid duplicates in tags array
|
|
699
|
+
this.isOpen = false;
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
emitValue.push(suggestion.value);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
this.setValue(emitValue, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
707
|
+
this.$emit('change', emitValue, function (_ref4) {
|
|
616
708
|
var isOpen = _ref4.isOpen;
|
|
617
|
-
return _this3.triggerQuery({
|
|
709
|
+
return _this3.triggerQuery(_rollupPluginBabelHelpers._extends({
|
|
618
710
|
isOpen: isOpen,
|
|
619
|
-
value:
|
|
711
|
+
value: emitValue
|
|
712
|
+
}, !_this3.$options.isTagsMode && {
|
|
620
713
|
categoryValue: suggestion._category
|
|
621
|
-
});
|
|
714
|
+
}));
|
|
622
715
|
});
|
|
623
716
|
}
|
|
624
717
|
|
|
@@ -764,7 +857,7 @@ var SearchBox = {
|
|
|
764
857
|
}
|
|
765
858
|
|
|
766
859
|
return h(Button.Button, {
|
|
767
|
-
"class": "enter-btn " + getClassName(innerClass, '
|
|
860
|
+
"class": "enter-btn " + getClassName(innerClass, 'enter-button'),
|
|
768
861
|
"attrs": {
|
|
769
862
|
"primary": true
|
|
770
863
|
},
|
|
@@ -880,7 +973,7 @@ var SearchBox = {
|
|
|
880
973
|
onAutofillClick: function onAutofillClick(suggestion) {
|
|
881
974
|
var value = suggestion.value;
|
|
882
975
|
this.isOpen = true;
|
|
883
|
-
this.currentValue = value;
|
|
976
|
+
this.currentValue = index.decodeHtml(value);
|
|
884
977
|
this.triggerDefaultQuery(value);
|
|
885
978
|
},
|
|
886
979
|
renderAutoFill: function renderAutoFill(suggestion) {
|
|
@@ -901,10 +994,79 @@ var SearchBox = {
|
|
|
901
994
|
"click": handleAutoFillClick
|
|
902
995
|
}
|
|
903
996
|
});
|
|
997
|
+
},
|
|
998
|
+
renderTag: function renderTag(item) {
|
|
999
|
+
var _this7 = this;
|
|
1000
|
+
|
|
1001
|
+
var h = this.$createElement;
|
|
1002
|
+
var innerClass = this.$props.innerClass;
|
|
1003
|
+
return h(DataSearch.TagItem, {
|
|
1004
|
+
"class": getClassName(innerClass, 'selected-tag') || ''
|
|
1005
|
+
}, [h("span", [item]), h("span", {
|
|
1006
|
+
"attrs": {
|
|
1007
|
+
"role": "img",
|
|
1008
|
+
"aria-label": "delete-tag"
|
|
1009
|
+
},
|
|
1010
|
+
"class": "close-icon",
|
|
1011
|
+
"on": {
|
|
1012
|
+
"click": function click() {
|
|
1013
|
+
return _this7.clearTag(item);
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}, [h(CancelSvg.CancelSvg)])]);
|
|
1017
|
+
},
|
|
1018
|
+
clearAllTags: function clearAllTags() {
|
|
1019
|
+
this.selectedTags = [];
|
|
1020
|
+
this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
|
|
1021
|
+
|
|
1022
|
+
if (this.$props.value !== undefined) {
|
|
1023
|
+
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
clearTag: function clearTag(tagValue) {
|
|
1027
|
+
this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
|
|
1028
|
+
return tag !== tagValue;
|
|
1029
|
+
}));
|
|
1030
|
+
this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
|
|
1031
|
+
|
|
1032
|
+
if (this.$props.value !== undefined) {
|
|
1033
|
+
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
renderTags: function renderTags() {
|
|
1037
|
+
var _this8 = this;
|
|
1038
|
+
|
|
1039
|
+
var h = this.$createElement;
|
|
1040
|
+
|
|
1041
|
+
if (!Array.isArray(this.selectedTags)) {
|
|
1042
|
+
return null;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
var tagsList = [].concat(this.selectedTags);
|
|
1046
|
+
var shouldRenderClearAllTag = tagsList.length > 1;
|
|
1047
|
+
var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
|
|
1048
|
+
return renderSelectedTags ? renderSelectedTags({
|
|
1049
|
+
values: this.selectedTags,
|
|
1050
|
+
handleClear: this.clearTag,
|
|
1051
|
+
handleClearAll: this.clearAllTags
|
|
1052
|
+
}) : h(DataSearch.TagsContainer, [tagsList.map(function (item) {
|
|
1053
|
+
return _this8.renderTag(item);
|
|
1054
|
+
}), shouldRenderClearAllTag && h(DataSearch.TagItem, {
|
|
1055
|
+
"class": getClassName(this.$props.innerClass, 'selected-tag') || ''
|
|
1056
|
+
}, [h("span", ["Clear All"]), h("span", {
|
|
1057
|
+
"attrs": {
|
|
1058
|
+
"role": "img",
|
|
1059
|
+
"aria-label": "delete-tag"
|
|
1060
|
+
},
|
|
1061
|
+
"class": "close-icon",
|
|
1062
|
+
"on": {
|
|
1063
|
+
"click": this.clearAllTags
|
|
1064
|
+
}
|
|
1065
|
+
}, [h(CancelSvg.CancelSvg)])])]);
|
|
904
1066
|
}
|
|
905
1067
|
},
|
|
906
1068
|
render: function render() {
|
|
907
|
-
var
|
|
1069
|
+
var _this9 = this;
|
|
908
1070
|
|
|
909
1071
|
var h = arguments[0];
|
|
910
1072
|
var _this$$props6 = this.$props,
|
|
@@ -950,14 +1112,14 @@ var SearchBox = {
|
|
|
950
1112
|
}
|
|
951
1113
|
};
|
|
952
1114
|
|
|
953
|
-
return h("div", [
|
|
1115
|
+
return h("div", [_this9.hasCustomRenderer && _this9.getComponent({
|
|
954
1116
|
isOpen: isOpen,
|
|
955
1117
|
getItemProps: getItemProps,
|
|
956
1118
|
getItemEvents: getItemEvents,
|
|
957
1119
|
highlightedIndex: highlightedIndex
|
|
958
|
-
}),
|
|
959
|
-
"class": Input.suggestions(
|
|
960
|
-
}, [
|
|
1120
|
+
}), _this9.renderErrorComponent(), !_this9.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
1121
|
+
"class": Input.suggestions(_this9.themePreset, theme) + " " + getClassName(_this9.$props.innerClass, 'list')
|
|
1122
|
+
}, [_this9.normalizedSuggestions.map(function (item, index) {
|
|
961
1123
|
return renderItem ? h("li", {
|
|
962
1124
|
"domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
|
|
963
1125
|
item: item
|
|
@@ -967,7 +1129,7 @@ var SearchBox = {
|
|
|
967
1129
|
})),
|
|
968
1130
|
"key": index + 1 + "-" + item.value,
|
|
969
1131
|
"style": {
|
|
970
|
-
backgroundColor:
|
|
1132
|
+
backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
|
|
971
1133
|
justifyContent: 'flex-start',
|
|
972
1134
|
alignItems: 'center'
|
|
973
1135
|
}
|
|
@@ -980,7 +1142,7 @@ var SearchBox = {
|
|
|
980
1142
|
})),
|
|
981
1143
|
"key": index + 1 + "-" + item.value,
|
|
982
1144
|
"style": {
|
|
983
|
-
backgroundColor:
|
|
1145
|
+
backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
|
|
984
1146
|
justifyContent: 'flex-start',
|
|
985
1147
|
alignItems: 'center'
|
|
986
1148
|
}
|
|
@@ -991,61 +1153,61 @@ var SearchBox = {
|
|
|
991
1153
|
}
|
|
992
1154
|
}, [h(DataSearch.CustomSvg, {
|
|
993
1155
|
"attrs": {
|
|
994
|
-
"className": getClassName(
|
|
1156
|
+
"className": getClassName(_this9.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
995
1157
|
"icon": getIcon(item._suggestion_type),
|
|
996
1158
|
"type": item._suggestion_type + "-search-icon"
|
|
997
1159
|
}
|
|
998
1160
|
})]), h(DataSearch.SuggestionItem, {
|
|
999
1161
|
"attrs": {
|
|
1000
|
-
"currentValue":
|
|
1162
|
+
"currentValue": _this9.currentValue,
|
|
1001
1163
|
"suggestion": item
|
|
1002
1164
|
}
|
|
1003
|
-
}),
|
|
1004
|
-
})]) :
|
|
1165
|
+
}), _this9.renderAutoFill(item)]);
|
|
1166
|
+
})]) : _this9.renderNoSuggestions(_this9.normalizedSuggestions)]);
|
|
1005
1167
|
};
|
|
1006
1168
|
|
|
1007
1169
|
return h("div", {
|
|
1008
1170
|
"class": Input.suggestionsContainer
|
|
1009
|
-
}, [h(DataSearch.InputGroup, [
|
|
1171
|
+
}, [h(DataSearch.InputGroup, [_this9.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
|
|
1010
1172
|
"attrs": {
|
|
1011
|
-
"id":
|
|
1012
|
-
"showIcon":
|
|
1013
|
-
"showClear":
|
|
1014
|
-
"iconPosition":
|
|
1015
|
-
"placeholder":
|
|
1016
|
-
"autoFocus":
|
|
1017
|
-
"themePreset":
|
|
1173
|
+
"id": _this9.$props.componentId + "-input",
|
|
1174
|
+
"showIcon": _this9.$props.showIcon,
|
|
1175
|
+
"showClear": _this9.$props.showClear,
|
|
1176
|
+
"iconPosition": _this9.$props.iconPosition,
|
|
1177
|
+
"placeholder": _this9.$props.placeholder,
|
|
1178
|
+
"autoFocus": _this9.$props.autoFocus,
|
|
1179
|
+
"themePreset": _this9.themePreset,
|
|
1018
1180
|
"autocomplete": "off"
|
|
1019
1181
|
},
|
|
1020
|
-
"ref":
|
|
1021
|
-
"class": getClassName(
|
|
1182
|
+
"ref": _this9.$props.innerRef,
|
|
1183
|
+
"class": getClassName(_this9.$props.innerClass, 'input'),
|
|
1022
1184
|
"on": _rollupPluginBabelHelpers._extends({}, getInputEvents({
|
|
1023
|
-
onInput:
|
|
1185
|
+
onInput: _this9.onInputChange,
|
|
1024
1186
|
onBlur: function onBlur(e) {
|
|
1025
|
-
|
|
1187
|
+
_this9.$emit('blur', e, _this9.triggerQuery);
|
|
1026
1188
|
},
|
|
1027
|
-
onFocus:
|
|
1189
|
+
onFocus: _this9.handleFocus,
|
|
1028
1190
|
onKeyPress: function onKeyPress(e) {
|
|
1029
|
-
|
|
1191
|
+
_this9.$emit('keyPress', e, _this9.triggerQuery);
|
|
1030
1192
|
|
|
1031
|
-
|
|
1193
|
+
_this9.$emit('key-press', e, _this9.triggerQuery);
|
|
1032
1194
|
},
|
|
1033
1195
|
onKeyDown: function onKeyDown(e) {
|
|
1034
|
-
return
|
|
1196
|
+
return _this9.handleKeyDown(e, highlightedIndex);
|
|
1035
1197
|
},
|
|
1036
1198
|
onKeyUp: function onKeyUp(e) {
|
|
1037
|
-
|
|
1199
|
+
_this9.$emit('keyUp', e, _this9.triggerQuery);
|
|
1038
1200
|
|
|
1039
|
-
|
|
1201
|
+
_this9.$emit('key-up', e, _this9.triggerQuery);
|
|
1040
1202
|
},
|
|
1041
1203
|
onClick: function onClick() {
|
|
1042
1204
|
setHighlightedIndex(null);
|
|
1043
1205
|
}
|
|
1044
1206
|
})),
|
|
1045
1207
|
"domProps": _rollupPluginBabelHelpers._extends({}, getInputProps({
|
|
1046
|
-
value:
|
|
1208
|
+
value: _this9.$data.currentValue === null ? '' : _this9.$data.currentValue
|
|
1047
1209
|
}))
|
|
1048
|
-
}),
|
|
1210
|
+
}), _this9.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this9.renderInputAddonAfter(), _this9.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown(), _this9.renderTags()]);
|
|
1049
1211
|
}
|
|
1050
1212
|
}
|
|
1051
1213
|
}) : h("div", {
|
|
@@ -1061,22 +1223,22 @@ var SearchBox = {
|
|
|
1061
1223
|
},
|
|
1062
1224
|
"on": _rollupPluginBabelHelpers._extends({}, {
|
|
1063
1225
|
blur: function blur(e) {
|
|
1064
|
-
|
|
1226
|
+
_this9.$emit('blur', e, _this9.triggerQuery);
|
|
1065
1227
|
},
|
|
1066
1228
|
keypress: function keypress(e) {
|
|
1067
|
-
|
|
1229
|
+
_this9.$emit('keyPress', e, _this9.triggerQuery);
|
|
1068
1230
|
|
|
1069
|
-
|
|
1231
|
+
_this9.$emit('key-press', e, _this9.triggerQuery);
|
|
1070
1232
|
},
|
|
1071
1233
|
input: this.onInputChange,
|
|
1072
1234
|
focus: function focus(e) {
|
|
1073
|
-
|
|
1235
|
+
_this9.$emit('focus', e, _this9.triggerQuery);
|
|
1074
1236
|
},
|
|
1075
1237
|
keydown: this.handleKeyDown,
|
|
1076
1238
|
keyup: function keyup(e) {
|
|
1077
|
-
|
|
1239
|
+
_this9.$emit('keyUp', e, _this9.triggerQuery);
|
|
1078
1240
|
|
|
1079
|
-
|
|
1241
|
+
_this9.$emit('key-up', e, _this9.triggerQuery);
|
|
1080
1242
|
}
|
|
1081
1243
|
}),
|
|
1082
1244
|
"domProps": _rollupPluginBabelHelpers._extends({}, {
|
package/dist/cjs/install.js
CHANGED
|
@@ -3,43 +3,43 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('@appbaseio/reactivecore');
|
|
6
|
-
require('./_rollupPluginBabelHelpers-
|
|
6
|
+
require('./_rollupPluginBabelHelpers-91d4b5a6.js');
|
|
7
7
|
require('vue-types');
|
|
8
8
|
require('@appbaseio/reactivecore/lib/utils/constants');
|
|
9
9
|
require('@appbaseio/reactivecore/lib/utils/helper');
|
|
10
10
|
require('emotion');
|
|
11
11
|
require('@appbaseio/vue-emotion');
|
|
12
12
|
require('polished');
|
|
13
|
-
require('./Button-
|
|
14
|
-
require('./vueTypes-
|
|
13
|
+
require('./Button-0e2e2c02.js');
|
|
14
|
+
require('./vueTypes-3970ff42.js');
|
|
15
15
|
require('./ReactiveList.js');
|
|
16
16
|
require('@appbaseio/reactivecore/lib/utils/transform');
|
|
17
17
|
require('redux');
|
|
18
|
-
require('./index-
|
|
19
|
-
require('./ComponentWrapper-
|
|
18
|
+
require('./index-2e0ea8d8.js');
|
|
19
|
+
require('./ComponentWrapper-6909bc2a.js');
|
|
20
20
|
require('@vue/babel-helper-vue-jsx-merge-props');
|
|
21
|
-
require('./Title-
|
|
22
|
-
require('./ListItem-
|
|
23
|
-
require('./Card-
|
|
24
|
-
require('./Flex-
|
|
21
|
+
require('./Title-26661936.js');
|
|
22
|
+
require('./ListItem-38962297.js');
|
|
23
|
+
require('./Card-4fa0f769.js');
|
|
24
|
+
require('./Flex-63774e4d.js');
|
|
25
25
|
require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
26
26
|
require('appbase-js');
|
|
27
27
|
require('url-search-params-polyfill');
|
|
28
28
|
require('./ReactiveBase.js');
|
|
29
29
|
require('hotkeys-js');
|
|
30
|
-
require('./DataSearch-
|
|
31
|
-
require('./CancelSvg-
|
|
32
|
-
require('./Input-
|
|
30
|
+
require('./DataSearch-a8fabd77.js');
|
|
31
|
+
require('./CancelSvg-c48c1085.js');
|
|
32
|
+
require('./Input-43868594.js');
|
|
33
33
|
require('compute-scroll-into-view');
|
|
34
|
-
require('./Container-
|
|
34
|
+
require('./Container-cfd69a34.js');
|
|
35
35
|
require('vue-highlight-words');
|
|
36
|
-
var install = require('./install-
|
|
36
|
+
var install = require('./install-27314778.js');
|
|
37
37
|
require('@appbaseio/reactivecore/lib/utils/suggestions');
|
|
38
|
-
require('./FormControlList-
|
|
39
|
-
require('./utils-
|
|
38
|
+
require('./FormControlList-a9c64bb8.js');
|
|
39
|
+
require('./utils-0df3cb93.js');
|
|
40
40
|
require('./SingleList.js');
|
|
41
41
|
require('./MultiList.js');
|
|
42
|
-
require('./DropDown-
|
|
42
|
+
require('./DropDown-aa358fff.js');
|
|
43
43
|
require('./SingleDropdownList.js');
|
|
44
44
|
require('./MultiDropdownList.js');
|
|
45
45
|
require('./ToggleButton.js');
|
|
@@ -50,9 +50,10 @@ require('./MultiRange.js');
|
|
|
50
50
|
require('./ResultCard.js');
|
|
51
51
|
require('./ResultList.js');
|
|
52
52
|
require('vue-no-ssr');
|
|
53
|
-
require('./ssr-
|
|
53
|
+
require('./ssr-949cafb5.js');
|
|
54
54
|
require('./RangeSlider.js');
|
|
55
55
|
require('./DynamicRangeSlider.js');
|
|
56
|
+
require('@appbaseio/reactivecore/lib/actions/value');
|
|
56
57
|
require('./StateProvider.js');
|
|
57
58
|
require('./RangeInput.js');
|
|
58
59
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
4
|
|
|
5
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
5
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-91d4b5a6.js');
|
|
6
6
|
var styled = require('@appbaseio/vue-emotion');
|
|
7
7
|
var styled__default = _interopDefault(styled);
|
|
8
8
|
var NoSSR = _interopDefault(require('vue-no-ssr'));
|
|
@@ -4,7 +4,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
4
4
|
|
|
5
5
|
var configureStore = require('@appbaseio/reactivecore');
|
|
6
6
|
var configureStore__default = _interopDefault(configureStore);
|
|
7
|
-
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-
|
|
7
|
+
var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-91d4b5a6.js');
|
|
8
8
|
|
|
9
9
|
var getAggsOrder = configureStore.helper.getAggsOrder;
|
|
10
10
|
|
package/dist/cjs/version.js
CHANGED
|
@@ -118,6 +118,12 @@ var types = {
|
|
|
118
118
|
mongodb: VueTypes.shape({
|
|
119
119
|
db: VueTypes.string,
|
|
120
120
|
collection: VueTypes.string
|
|
121
|
+
}),
|
|
122
|
+
endpointConfig: VueTypes.shape({
|
|
123
|
+
url: VueTypes.string.isRequired,
|
|
124
|
+
method: VueTypes.string,
|
|
125
|
+
headers: VueTypes.object,
|
|
126
|
+
body: VueTypes.object
|
|
121
127
|
})
|
|
122
128
|
};
|
|
123
129
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-51ce1182.js';
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
import { darken, rgba, lighten } from 'polished';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-51ce1182.js';
|
|
2
2
|
import styled, { css } from '@appbaseio/vue-emotion';
|
|
3
3
|
import computeScrollIntoView from 'compute-scroll-into-view';
|
|
4
4
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-51ce1182.js';
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
import { lighten } from 'polished';
|
|
5
|
-
import './Title-
|
|
5
|
+
import './Title-35edd732.js';
|
|
6
6
|
|
|
7
7
|
var _templateObject, _templateObject2, _templateObject3;
|
|
8
8
|
var container = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: row;\n\tjustify-content: center;\n\tflex-wrap: wrap;\n\tmargin: 0 -8px;\n\n\t@media (max-width: 420px) {\n\t\tmargin: 0;\n\t}\n"])));
|