@appbaseio/reactivesearch-vue 1.16.0-alpha.56 → 1.16.0-alpha.57
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 +1413 -16025
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +8 -6
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-10e5cf51.js → Button-446f819e.js} +1 -1
- package/dist/cjs/{CancelSvg-82021d23.js → CancelSvg-9f258f4f.js} +1 -1
- package/dist/cjs/{Card-4b915733.js → Card-642547a8.js} +2 -2
- package/dist/cjs/{ComponentWrapper-7302fe1a.js → ComponentWrapper-ca5f0cbd.js} +2 -2
- package/dist/cjs/{Container-8a08d663.js → Container-daf30918.js} +1 -1
- package/dist/cjs/{DataSearch-7fd1b95d.js → DataSearch-1333a6de.js} +222 -80
- package/dist/cjs/DataSearch.js +10 -9
- package/dist/cjs/{DropDown-16a2a728.js → DropDown-c3f83a46.js} +4 -4
- package/dist/cjs/DynamicRangeSlider.js +5 -5
- package/dist/cjs/{Flex-699639d2.js → Flex-aa517a13.js} +1 -1
- package/dist/cjs/{FormControlList-73497794.js → FormControlList-c195a592.js} +1 -1
- package/dist/cjs/{Input-64087a69.js → Input-e6603a7e.js} +1 -1
- package/dist/cjs/{ListItem-933c27e4.js → ListItem-8c9e0d68.js} +2 -2
- package/dist/cjs/MultiDropdownList.js +10 -10
- package/dist/cjs/MultiList.js +8 -8
- package/dist/cjs/MultiRange.js +6 -6
- package/dist/cjs/{Pagination-e0654529.js → Pagination-c01d1547.js} +1 -1
- package/dist/cjs/RangeInput.js +8 -8
- package/dist/cjs/RangeSlider.js +6 -6
- package/dist/cjs/ReactiveBase.js +2 -2
- package/dist/cjs/ReactiveComponent.js +3 -3
- package/dist/cjs/ReactiveGoogleMap.js +10 -16
- package/dist/cjs/ReactiveList.js +9 -9
- package/dist/cjs/ResultCard.js +3 -3
- package/dist/cjs/ResultList.js +3 -3
- package/dist/cjs/SelectedFilters.js +44 -27
- package/dist/cjs/SingleDropdownList.js +10 -10
- package/dist/cjs/SingleList.js +8 -8
- package/dist/cjs/SingleRange.js +6 -6
- package/dist/cjs/StateProvider.js +2 -2
- package/dist/cjs/{Title-39765ee6.js → Title-1de7d0f4.js} +1 -1
- package/dist/cjs/ToggleButton.js +6 -6
- package/dist/cjs/{_rollupPluginBabelHelpers-4abdbfff.js → _rollupPluginBabelHelpers-c705cbe6.js} +2 -4
- package/dist/cjs/{index-d44a0a21.js → index-c288153a.js} +1 -1
- package/dist/cjs/index.js +19 -18
- package/dist/cjs/initReactivesearch.js +1 -1
- package/dist/cjs/{install-ac3374ec.js → install-c771d81a.js} +226 -65
- package/dist/cjs/install.js +19 -18
- package/dist/cjs/{ssr-c333c82c.js → ssr-3027b848.js} +1 -1
- package/dist/cjs/{utils-23afb20b.js → utils-d6a52588.js} +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/{Button-8b211174.js → Button-d8bc15ea.js} +1 -1
- package/dist/es/{CancelSvg-4d9e0857.js → CancelSvg-4cfae5fd.js} +1 -1
- package/dist/es/{Card-04b3c33e.js → Card-450683f1.js} +2 -2
- package/dist/es/{ComponentWrapper-bbb717bc.js → ComponentWrapper-6ad0997b.js} +2 -2
- package/dist/es/{Container-4383c6f0.js → Container-ba826e96.js} +1 -1
- package/dist/es/{DataSearch-a5aaa29e.js → DataSearch-1259f2fd.js} +221 -81
- package/dist/es/DataSearch.js +10 -9
- package/dist/es/{DropDown-7639f223.js → DropDown-2ddad7ae.js} +4 -4
- package/dist/es/DynamicRangeSlider.js +5 -5
- package/dist/es/{Flex-aac91505.js → Flex-1f0795c3.js} +1 -1
- package/dist/es/{FormControlList-fe389a2e.js → FormControlList-c22d64f6.js} +1 -1
- package/dist/es/{Input-d1bb4868.js → Input-7a2a9fac.js} +1 -1
- package/dist/es/{ListItem-bdb6d53d.js → ListItem-cad14c5e.js} +2 -2
- package/dist/es/MultiDropdownList.js +10 -10
- package/dist/es/MultiList.js +8 -8
- package/dist/es/MultiRange.js +6 -6
- package/dist/es/{Pagination-3c50d4ba.js → Pagination-491c44ee.js} +1 -1
- package/dist/es/RangeInput.js +8 -8
- package/dist/es/RangeSlider.js +6 -6
- package/dist/es/ReactiveBase.js +2 -2
- package/dist/es/ReactiveComponent.js +3 -3
- package/dist/es/ReactiveGoogleMap.js +10 -16
- package/dist/es/ReactiveList.js +9 -9
- package/dist/es/ResultCard.js +3 -3
- package/dist/es/ResultList.js +3 -3
- package/dist/es/SelectedFilters.js +44 -27
- package/dist/es/SingleDropdownList.js +10 -10
- package/dist/es/SingleList.js +8 -8
- package/dist/es/SingleRange.js +6 -6
- package/dist/es/StateProvider.js +2 -2
- package/dist/es/{Title-579f8d6c.js → Title-3342664a.js} +1 -1
- package/dist/es/ToggleButton.js +6 -6
- package/dist/es/{_rollupPluginBabelHelpers-ecf6c03c.js → _rollupPluginBabelHelpers-76660dab.js} +2 -4
- package/dist/es/{index-5daa8276.js → index-3d98f51b.js} +1 -1
- package/dist/es/index.js +20 -19
- package/dist/es/initReactivesearch.js +1 -1
- package/dist/es/{install-cdccc63e.js → install-4391877a.js} +226 -65
- package/dist/es/install.js +19 -18
- package/dist/es/{ssr-e3196de1.js → ssr-b2c0b401.js} +1 -1
- package/dist/es/{utils-3a32e13f.js → utils-9e68acee.js} +1 -1
- package/dist/es/version.js +1 -1
- package/package.json +2 -2
|
@@ -4,24 +4,25 @@ 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-c705cbe6.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-
|
|
13
|
+
var Button = require('./Button-446f819e.js');
|
|
14
14
|
var vueTypes = require('./vueTypes-6de9d2a9.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-c288153a.js');
|
|
17
|
+
var ComponentWrapper = require('./ComponentWrapper-ca5f0cbd.js');
|
|
18
|
+
var Title = require('./Title-1de7d0f4.js');
|
|
19
19
|
var ReactiveBase = require('./ReactiveBase.js');
|
|
20
20
|
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
21
|
+
var constants$1 = require('@appbaseio/reactivecore/src/utils/constants');
|
|
22
|
+
var DataSearch = require('./DataSearch-1333a6de.js');
|
|
23
|
+
var CancelSvg = require('./CancelSvg-9f258f4f.js');
|
|
24
|
+
var Input = require('./Input-e6603a7e.js');
|
|
25
|
+
var Container = require('./Container-daf30918.js');
|
|
25
26
|
var SingleList = require('./SingleList.js');
|
|
26
27
|
var MultiList = require('./MultiList.js');
|
|
27
28
|
var SingleDropdownList = require('./SingleDropdownList.js');
|
|
@@ -80,10 +81,12 @@ var _debounce = configureStore.helper.debounce,
|
|
|
80
81
|
normalizeDataField = configureStore.helper.normalizeDataField;
|
|
81
82
|
var SearchBox = {
|
|
82
83
|
name: 'SearchBox',
|
|
84
|
+
isTagsMode: false,
|
|
83
85
|
data: function data() {
|
|
84
86
|
var props = this.$props;
|
|
85
87
|
this.__state = {
|
|
86
88
|
currentValue: '',
|
|
89
|
+
selectedTags: [],
|
|
87
90
|
isOpen: false,
|
|
88
91
|
normalizedSuggestions: []
|
|
89
92
|
};
|
|
@@ -99,7 +102,16 @@ var SearchBox = {
|
|
|
99
102
|
var _this$$props = this.$props,
|
|
100
103
|
distinctField = _this$$props.distinctField,
|
|
101
104
|
distinctFieldConfig = _this$$props.distinctFieldConfig,
|
|
102
|
-
index = _this$$props.index
|
|
105
|
+
index = _this$$props.index,
|
|
106
|
+
mode = _this$$props.mode;
|
|
107
|
+
|
|
108
|
+
if (mode === constants$1.SEARCH_COMPONENTS_MODES.TAG) {
|
|
109
|
+
this.$options.isTagsMode = true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (this.$options.isTagsMode) {
|
|
113
|
+
console.warn('Warning(ReactiveSearch): The `categoryField` prop is not supported when `mode` prop is set to `tag`');
|
|
114
|
+
}
|
|
103
115
|
|
|
104
116
|
if (this.enableAppbase && this.aggregationField && this.aggregationField !== '') {
|
|
105
117
|
console.warn('Warning(ReactiveSearch): The `aggregationField` prop has been marked as deprecated, please use the `distinctField` prop instead.');
|
|
@@ -114,8 +126,12 @@ var SearchBox = {
|
|
|
114
126
|
}
|
|
115
127
|
|
|
116
128
|
this.currentValue = this.selectedValue || this.value || this.defaultValue || '';
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
|
|
130
|
+
if (this.$options.isTagsMode) {
|
|
131
|
+
this.currentValue = '';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
this.handleTextChange = _debounce(this.handleText, this.$props.debounce); // Set custom and default queries in store
|
|
119
135
|
|
|
120
136
|
this.triggerCustomQuery(this.currentValue, this.selectedCategory);
|
|
121
137
|
this.triggerDefaultQuery(this.currentValue);
|
|
@@ -151,7 +167,7 @@ var SearchBox = {
|
|
|
151
167
|
debounce: VueTypes.number.def(0),
|
|
152
168
|
defaultValue: vueTypes.types.string,
|
|
153
169
|
excludeFields: vueTypes.types.excludeFields,
|
|
154
|
-
value: vueTypes.types.value,
|
|
170
|
+
value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), vueTypes.types.value]),
|
|
155
171
|
defaultSuggestions: vueTypes.types.suggestions,
|
|
156
172
|
enableSynonyms: VueTypes.bool.def(true),
|
|
157
173
|
enableQuerySuggestions: VueTypes.bool.def(false),
|
|
@@ -204,7 +220,18 @@ var SearchBox = {
|
|
|
204
220
|
onData: vueTypes.types.func,
|
|
205
221
|
renderItem: vueTypes.types.func,
|
|
206
222
|
enterButton: VueTypes.bool.def(false),
|
|
207
|
-
renderEnterButton: VueTypes.any
|
|
223
|
+
renderEnterButton: VueTypes.any,
|
|
224
|
+
mode: VueTypes.oneOf(['select', 'tag']).def('select'),
|
|
225
|
+
renderSelectedTags: VueTypes.any
|
|
226
|
+
},
|
|
227
|
+
beforeMount: function beforeMount() {
|
|
228
|
+
if (this.selectedValue) {
|
|
229
|
+
this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
|
|
230
|
+
} else if (this.$props.value) {
|
|
231
|
+
this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
|
|
232
|
+
} else if (this.$props.defaultValue) {
|
|
233
|
+
this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
|
|
234
|
+
}
|
|
208
235
|
},
|
|
209
236
|
mounted: function mounted() {
|
|
210
237
|
this.listenForFocusShortcuts();
|
|
@@ -254,15 +281,25 @@ var SearchBox = {
|
|
|
254
281
|
this.normalizedSuggestions = suggestionsList;
|
|
255
282
|
},
|
|
256
283
|
selectedValue: function selectedValue(newVal, oldVal) {
|
|
257
|
-
if (oldVal
|
|
284
|
+
if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
|
|
258
285
|
if (!newVal && this.$data.currentValue) {
|
|
259
286
|
// selected value is cleared, call onValueSelected
|
|
260
287
|
this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
|
|
288
|
+
} // if (this.$props.value === undefined) {
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
if (this.$options.isTagsMode) {
|
|
292
|
+
// handling reset of tags through SelectedFilters or URL
|
|
293
|
+
this.selectedTags = [];
|
|
261
294
|
}
|
|
262
295
|
|
|
263
|
-
|
|
264
|
-
|
|
296
|
+
var cause = !newVal ? configureStore.causes.CLEAR_VALUE : undefined;
|
|
297
|
+
|
|
298
|
+
if (this.$options.isTagsMode) {
|
|
299
|
+
cause = configureStore.causes.SUGGESTION_SELECT;
|
|
265
300
|
}
|
|
301
|
+
|
|
302
|
+
this.setValue(newVal || '', true, this.$props, cause); // }
|
|
266
303
|
}
|
|
267
304
|
},
|
|
268
305
|
focusShortcuts: function focusShortcuts() {
|
|
@@ -403,7 +440,40 @@ var SearchBox = {
|
|
|
403
440
|
}
|
|
404
441
|
|
|
405
442
|
var performUpdate = function performUpdate() {
|
|
406
|
-
_this.
|
|
443
|
+
if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
|
|
448
|
+
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
449
|
+
// check if value already present in selectedTags
|
|
450
|
+
if (typeof value === 'string' && _this.selectedTags.includes(value)) {
|
|
451
|
+
_this.isOpen = false;
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
_this.selectedTags = [].concat(_this.selectedTags);
|
|
456
|
+
|
|
457
|
+
if (typeof value === 'string' && !!value) {
|
|
458
|
+
_this.selectedTags.push(value);
|
|
459
|
+
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
460
|
+
var mergedArray = Array.from(new Set([].concat(_this.selectedTags, value)));
|
|
461
|
+
_this.selectedTags = mergedArray;
|
|
462
|
+
}
|
|
463
|
+
} else if (value) {
|
|
464
|
+
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
_this.currentValue = '';
|
|
468
|
+
} else {
|
|
469
|
+
_this.currentValue = value;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
var queryHandlerValue = value;
|
|
473
|
+
|
|
474
|
+
if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
|
|
475
|
+
queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
|
|
476
|
+
}
|
|
407
477
|
|
|
408
478
|
if (isDefaultValue) {
|
|
409
479
|
if (_this.$props.autosuggest) {
|
|
@@ -411,19 +481,19 @@ var SearchBox = {
|
|
|
411
481
|
_this.isOpen = false;
|
|
412
482
|
}
|
|
413
483
|
|
|
414
|
-
_this.triggerDefaultQuery(
|
|
484
|
+
if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
|
|
415
485
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
416
486
|
// to set the query otherwise the value should reset
|
|
417
487
|
|
|
418
488
|
|
|
419
489
|
if (props.strictSelection) {
|
|
420
|
-
if (cause === configureStore.causes.SUGGESTION_SELECT || value === '') {
|
|
421
|
-
_this.triggerCustomQuery(
|
|
490
|
+
if (cause === configureStore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
|
|
491
|
+
_this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
|
|
422
492
|
} else {
|
|
423
493
|
_this.setValue('', true);
|
|
424
494
|
}
|
|
425
|
-
} else if (props.value === undefined) {
|
|
426
|
-
_this.triggerCustomQuery(
|
|
495
|
+
} else if (props.value === undefined || cause === configureStore.causes.SUGGESTION_SELECT || cause === configureStore.causes.CLEAR_VALUE) {
|
|
496
|
+
_this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
|
|
427
497
|
}
|
|
428
498
|
} else {
|
|
429
499
|
// debounce for handling text while typing
|
|
@@ -474,6 +544,11 @@ var SearchBox = {
|
|
|
474
544
|
showFilter = _this$$props2.showFilter,
|
|
475
545
|
URLParams = _this$$props2.URLParams;
|
|
476
546
|
var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
|
|
547
|
+
|
|
548
|
+
if (this.$options.isTagsMode) {
|
|
549
|
+
value = paramValue;
|
|
550
|
+
}
|
|
551
|
+
|
|
477
552
|
var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
|
|
478
553
|
var query = defaultQueryTobeSet;
|
|
479
554
|
|
|
@@ -567,7 +642,8 @@ var SearchBox = {
|
|
|
567
642
|
if (this.$props.autosuggest === false) {
|
|
568
643
|
this.enterButtonOnClick();
|
|
569
644
|
} else if (highlightedIndex === null) {
|
|
570
|
-
this.setValue(event.target.value, true
|
|
645
|
+
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined // to handle tags
|
|
646
|
+
);
|
|
571
647
|
this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
|
|
572
648
|
}
|
|
573
649
|
} // Need to review
|
|
@@ -612,13 +688,29 @@ var SearchBox = {
|
|
|
612
688
|
if (value === undefined) {
|
|
613
689
|
this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
614
690
|
} else {
|
|
615
|
-
|
|
691
|
+
var emitValue = suggestion.value;
|
|
692
|
+
|
|
693
|
+
if (this.$options.isTagsMode) {
|
|
694
|
+
emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
|
|
695
|
+
|
|
696
|
+
if (this.selectedTags.includes(suggestion.value)) {
|
|
697
|
+
// avoid duplicates in tags array
|
|
698
|
+
this.isOpen = false;
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
emitValue.push(suggestion.value);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
this.setValue(emitValue, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
706
|
+
this.$emit('change', emitValue, function (_ref4) {
|
|
616
707
|
var isOpen = _ref4.isOpen;
|
|
617
|
-
return _this3.triggerQuery({
|
|
708
|
+
return _this3.triggerQuery(_rollupPluginBabelHelpers._extends({
|
|
618
709
|
isOpen: isOpen,
|
|
619
|
-
value:
|
|
710
|
+
value: emitValue
|
|
711
|
+
}, !_this3.$options.isTagsMode && {
|
|
620
712
|
categoryValue: suggestion._category
|
|
621
|
-
});
|
|
713
|
+
}));
|
|
622
714
|
});
|
|
623
715
|
}
|
|
624
716
|
|
|
@@ -901,10 +993,79 @@ var SearchBox = {
|
|
|
901
993
|
"click": handleAutoFillClick
|
|
902
994
|
}
|
|
903
995
|
});
|
|
996
|
+
},
|
|
997
|
+
renderTag: function renderTag(item) {
|
|
998
|
+
var _this7 = this;
|
|
999
|
+
|
|
1000
|
+
var h = this.$createElement;
|
|
1001
|
+
var innerClass = this.$props.innerClass;
|
|
1002
|
+
return h(DataSearch.TagItem, {
|
|
1003
|
+
"class": getClassName(innerClass, 'selected-tag') || ''
|
|
1004
|
+
}, [h("span", [item]), h("span", {
|
|
1005
|
+
"attrs": {
|
|
1006
|
+
"role": "img",
|
|
1007
|
+
"aria-label": "delete-tag"
|
|
1008
|
+
},
|
|
1009
|
+
"class": "close-icon",
|
|
1010
|
+
"on": {
|
|
1011
|
+
"click": function click() {
|
|
1012
|
+
return _this7.clearTag(item);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
}, [h(CancelSvg.CancelSvg)])]);
|
|
1016
|
+
},
|
|
1017
|
+
clearAllTags: function clearAllTags() {
|
|
1018
|
+
this.selectedTags = [];
|
|
1019
|
+
this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
|
|
1020
|
+
|
|
1021
|
+
if (this.$props.value !== undefined) {
|
|
1022
|
+
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
clearTag: function clearTag(tagValue) {
|
|
1026
|
+
this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
|
|
1027
|
+
return tag !== tagValue;
|
|
1028
|
+
}));
|
|
1029
|
+
this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
|
|
1030
|
+
|
|
1031
|
+
if (this.$props.value !== undefined) {
|
|
1032
|
+
this.$emit('change', this.selectedTags, this.triggerQuery);
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
renderTags: function renderTags() {
|
|
1036
|
+
var _this8 = this;
|
|
1037
|
+
|
|
1038
|
+
var h = this.$createElement;
|
|
1039
|
+
|
|
1040
|
+
if (!Array.isArray(this.selectedTags)) {
|
|
1041
|
+
return null;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
var tagsList = [].concat(this.selectedTags);
|
|
1045
|
+
var shouldRenderClearAllTag = tagsList.length > 1;
|
|
1046
|
+
var renderSelectedTags = this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;
|
|
1047
|
+
return renderSelectedTags ? renderSelectedTags({
|
|
1048
|
+
values: this.selectedTags,
|
|
1049
|
+
handleClear: this.clearTag,
|
|
1050
|
+
handleClearAll: this.clearAllTags
|
|
1051
|
+
}) : h(DataSearch.TagsContainer, [tagsList.map(function (item) {
|
|
1052
|
+
return _this8.renderTag(item);
|
|
1053
|
+
}), shouldRenderClearAllTag && h(DataSearch.TagItem, {
|
|
1054
|
+
"class": getClassName(this.$props.innerClass, 'selected-tag') || ''
|
|
1055
|
+
}, [h("span", ["Clear All"]), h("span", {
|
|
1056
|
+
"attrs": {
|
|
1057
|
+
"role": "img",
|
|
1058
|
+
"aria-label": "delete-tag"
|
|
1059
|
+
},
|
|
1060
|
+
"class": "close-icon",
|
|
1061
|
+
"on": {
|
|
1062
|
+
"click": this.clearAllTags
|
|
1063
|
+
}
|
|
1064
|
+
}, [h(CancelSvg.CancelSvg)])])]);
|
|
904
1065
|
}
|
|
905
1066
|
},
|
|
906
1067
|
render: function render() {
|
|
907
|
-
var
|
|
1068
|
+
var _this9 = this;
|
|
908
1069
|
|
|
909
1070
|
var h = arguments[0];
|
|
910
1071
|
var _this$$props6 = this.$props,
|
|
@@ -950,14 +1111,14 @@ var SearchBox = {
|
|
|
950
1111
|
}
|
|
951
1112
|
};
|
|
952
1113
|
|
|
953
|
-
return h("div", [
|
|
1114
|
+
return h("div", [_this9.hasCustomRenderer && _this9.getComponent({
|
|
954
1115
|
isOpen: isOpen,
|
|
955
1116
|
getItemProps: getItemProps,
|
|
956
1117
|
getItemEvents: getItemEvents,
|
|
957
1118
|
highlightedIndex: highlightedIndex
|
|
958
|
-
}),
|
|
959
|
-
"class": Input.suggestions(
|
|
960
|
-
}, [
|
|
1119
|
+
}), _this9.renderErrorComponent(), !_this9.hasCustomRenderer && isOpen && hasSuggestions ? h("ul", {
|
|
1120
|
+
"class": Input.suggestions(_this9.themePreset, theme) + " " + getClassName(_this9.$props.innerClass, 'list')
|
|
1121
|
+
}, [_this9.normalizedSuggestions.map(function (item, index) {
|
|
961
1122
|
return renderItem ? h("li", {
|
|
962
1123
|
"domProps": _rollupPluginBabelHelpers._extends({}, getItemProps({
|
|
963
1124
|
item: item
|
|
@@ -967,7 +1128,7 @@ var SearchBox = {
|
|
|
967
1128
|
})),
|
|
968
1129
|
"key": index + 1 + "-" + item.value,
|
|
969
1130
|
"style": {
|
|
970
|
-
backgroundColor:
|
|
1131
|
+
backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
|
|
971
1132
|
justifyContent: 'flex-start',
|
|
972
1133
|
alignItems: 'center'
|
|
973
1134
|
}
|
|
@@ -980,7 +1141,7 @@ var SearchBox = {
|
|
|
980
1141
|
})),
|
|
981
1142
|
"key": index + 1 + "-" + item.value,
|
|
982
1143
|
"style": {
|
|
983
|
-
backgroundColor:
|
|
1144
|
+
backgroundColor: _this9.getBackgroundColor(highlightedIndex, index),
|
|
984
1145
|
justifyContent: 'flex-start',
|
|
985
1146
|
alignItems: 'center'
|
|
986
1147
|
}
|
|
@@ -991,61 +1152,61 @@ var SearchBox = {
|
|
|
991
1152
|
}
|
|
992
1153
|
}, [h(DataSearch.CustomSvg, {
|
|
993
1154
|
"attrs": {
|
|
994
|
-
"className": getClassName(
|
|
1155
|
+
"className": getClassName(_this9.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
995
1156
|
"icon": getIcon(item._suggestion_type),
|
|
996
1157
|
"type": item._suggestion_type + "-search-icon"
|
|
997
1158
|
}
|
|
998
1159
|
})]), h(DataSearch.SuggestionItem, {
|
|
999
1160
|
"attrs": {
|
|
1000
|
-
"currentValue":
|
|
1161
|
+
"currentValue": _this9.currentValue,
|
|
1001
1162
|
"suggestion": item
|
|
1002
1163
|
}
|
|
1003
|
-
}),
|
|
1004
|
-
})]) :
|
|
1164
|
+
}), _this9.renderAutoFill(item)]);
|
|
1165
|
+
})]) : _this9.renderNoSuggestions(_this9.normalizedSuggestions)]);
|
|
1005
1166
|
};
|
|
1006
1167
|
|
|
1007
1168
|
return h("div", {
|
|
1008
1169
|
"class": Input.suggestionsContainer
|
|
1009
|
-
}, [h(DataSearch.InputGroup, [
|
|
1170
|
+
}, [h(DataSearch.InputGroup, [_this9.renderInputAddonBefore(), h(CancelSvg.InputWrapper, [h(Input.Input, {
|
|
1010
1171
|
"attrs": {
|
|
1011
|
-
"id":
|
|
1012
|
-
"showIcon":
|
|
1013
|
-
"showClear":
|
|
1014
|
-
"iconPosition":
|
|
1015
|
-
"placeholder":
|
|
1016
|
-
"autoFocus":
|
|
1017
|
-
"themePreset":
|
|
1172
|
+
"id": _this9.$props.componentId + "-input",
|
|
1173
|
+
"showIcon": _this9.$props.showIcon,
|
|
1174
|
+
"showClear": _this9.$props.showClear,
|
|
1175
|
+
"iconPosition": _this9.$props.iconPosition,
|
|
1176
|
+
"placeholder": _this9.$props.placeholder,
|
|
1177
|
+
"autoFocus": _this9.$props.autoFocus,
|
|
1178
|
+
"themePreset": _this9.themePreset,
|
|
1018
1179
|
"autocomplete": "off"
|
|
1019
1180
|
},
|
|
1020
|
-
"ref":
|
|
1021
|
-
"class": getClassName(
|
|
1181
|
+
"ref": _this9.$props.innerRef,
|
|
1182
|
+
"class": getClassName(_this9.$props.innerClass, 'input'),
|
|
1022
1183
|
"on": _rollupPluginBabelHelpers._extends({}, getInputEvents({
|
|
1023
|
-
onInput:
|
|
1184
|
+
onInput: _this9.onInputChange,
|
|
1024
1185
|
onBlur: function onBlur(e) {
|
|
1025
|
-
|
|
1186
|
+
_this9.$emit('blur', e, _this9.triggerQuery);
|
|
1026
1187
|
},
|
|
1027
|
-
onFocus:
|
|
1188
|
+
onFocus: _this9.handleFocus,
|
|
1028
1189
|
onKeyPress: function onKeyPress(e) {
|
|
1029
|
-
|
|
1190
|
+
_this9.$emit('keyPress', e, _this9.triggerQuery);
|
|
1030
1191
|
|
|
1031
|
-
|
|
1192
|
+
_this9.$emit('key-press', e, _this9.triggerQuery);
|
|
1032
1193
|
},
|
|
1033
1194
|
onKeyDown: function onKeyDown(e) {
|
|
1034
|
-
return
|
|
1195
|
+
return _this9.handleKeyDown(e, highlightedIndex);
|
|
1035
1196
|
},
|
|
1036
1197
|
onKeyUp: function onKeyUp(e) {
|
|
1037
|
-
|
|
1198
|
+
_this9.$emit('keyUp', e, _this9.triggerQuery);
|
|
1038
1199
|
|
|
1039
|
-
|
|
1200
|
+
_this9.$emit('key-up', e, _this9.triggerQuery);
|
|
1040
1201
|
},
|
|
1041
1202
|
onClick: function onClick() {
|
|
1042
1203
|
setHighlightedIndex(null);
|
|
1043
1204
|
}
|
|
1044
1205
|
})),
|
|
1045
1206
|
"domProps": _rollupPluginBabelHelpers._extends({}, getInputProps({
|
|
1046
|
-
value:
|
|
1207
|
+
value: _this9.$data.currentValue === null ? '' : _this9.$data.currentValue
|
|
1047
1208
|
}))
|
|
1048
|
-
}),
|
|
1209
|
+
}), _this9.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()]), _this9.renderInputAddonAfter(), _this9.renderEnterButtonElement()]), expandSuggestionsContainer && renderSuggestionsDropdown(), _this9.renderTags()]);
|
|
1049
1210
|
}
|
|
1050
1211
|
}
|
|
1051
1212
|
}) : h("div", {
|
|
@@ -1061,22 +1222,22 @@ var SearchBox = {
|
|
|
1061
1222
|
},
|
|
1062
1223
|
"on": _rollupPluginBabelHelpers._extends({}, {
|
|
1063
1224
|
blur: function blur(e) {
|
|
1064
|
-
|
|
1225
|
+
_this9.$emit('blur', e, _this9.triggerQuery);
|
|
1065
1226
|
},
|
|
1066
1227
|
keypress: function keypress(e) {
|
|
1067
|
-
|
|
1228
|
+
_this9.$emit('keyPress', e, _this9.triggerQuery);
|
|
1068
1229
|
|
|
1069
|
-
|
|
1230
|
+
_this9.$emit('key-press', e, _this9.triggerQuery);
|
|
1070
1231
|
},
|
|
1071
1232
|
input: this.onInputChange,
|
|
1072
1233
|
focus: function focus(e) {
|
|
1073
|
-
|
|
1234
|
+
_this9.$emit('focus', e, _this9.triggerQuery);
|
|
1074
1235
|
},
|
|
1075
1236
|
keydown: this.handleKeyDown,
|
|
1076
1237
|
keyup: function keyup(e) {
|
|
1077
|
-
|
|
1238
|
+
_this9.$emit('keyUp', e, _this9.triggerQuery);
|
|
1078
1239
|
|
|
1079
|
-
|
|
1240
|
+
_this9.$emit('key-up', e, _this9.triggerQuery);
|
|
1080
1241
|
}
|
|
1081
1242
|
}),
|
|
1082
1243
|
"domProps": _rollupPluginBabelHelpers._extends({}, {
|
package/dist/cjs/install.js
CHANGED
|
@@ -3,44 +3,45 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('@appbaseio/reactivecore');
|
|
6
|
-
require('./_rollupPluginBabelHelpers-
|
|
6
|
+
require('./_rollupPluginBabelHelpers-c705cbe6.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-
|
|
13
|
+
require('./Button-446f819e.js');
|
|
14
14
|
require('./vueTypes-6de9d2a9.js');
|
|
15
|
-
require('./Pagination-
|
|
15
|
+
require('./Pagination-c01d1547.js');
|
|
16
16
|
require('./ReactiveList.js');
|
|
17
17
|
require('@appbaseio/reactivecore/lib/utils/transform');
|
|
18
18
|
require('redux');
|
|
19
|
-
require('./index-
|
|
20
|
-
require('./ComponentWrapper-
|
|
19
|
+
require('./index-c288153a.js');
|
|
20
|
+
require('./ComponentWrapper-ca5f0cbd.js');
|
|
21
21
|
require('@vue/babel-helper-vue-jsx-merge-props');
|
|
22
|
-
require('./Title-
|
|
23
|
-
require('./ListItem-
|
|
24
|
-
require('./Card-
|
|
25
|
-
require('./Flex-
|
|
22
|
+
require('./Title-1de7d0f4.js');
|
|
23
|
+
require('./ListItem-8c9e0d68.js');
|
|
24
|
+
require('./Card-642547a8.js');
|
|
25
|
+
require('./Flex-aa517a13.js');
|
|
26
26
|
require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
27
27
|
require('appbase-js');
|
|
28
28
|
require('url-search-params-polyfill');
|
|
29
29
|
require('./ReactiveBase.js');
|
|
30
30
|
require('hotkeys-js');
|
|
31
|
-
require('
|
|
32
|
-
require('./
|
|
33
|
-
require('./
|
|
31
|
+
require('@appbaseio/reactivecore/src/utils/constants');
|
|
32
|
+
require('./DataSearch-1333a6de.js');
|
|
33
|
+
require('./CancelSvg-9f258f4f.js');
|
|
34
|
+
require('./Input-e6603a7e.js');
|
|
34
35
|
require('compute-scroll-into-view');
|
|
35
|
-
require('./Container-
|
|
36
|
+
require('./Container-daf30918.js');
|
|
36
37
|
require('vue-highlight-words');
|
|
37
|
-
var install = require('./install-
|
|
38
|
+
var install = require('./install-c771d81a.js');
|
|
38
39
|
require('@appbaseio/reactivecore/lib/utils/suggestions');
|
|
39
|
-
require('./FormControlList-
|
|
40
|
-
require('./utils-
|
|
40
|
+
require('./FormControlList-c195a592.js');
|
|
41
|
+
require('./utils-d6a52588.js');
|
|
41
42
|
require('./SingleList.js');
|
|
42
43
|
require('./MultiList.js');
|
|
43
|
-
require('./DropDown-
|
|
44
|
+
require('./DropDown-c3f83a46.js');
|
|
44
45
|
require('./SingleDropdownList.js');
|
|
45
46
|
require('./MultiDropdownList.js');
|
|
46
47
|
require('./ToggleButton.js');
|
|
@@ -51,7 +52,7 @@ require('./MultiRange.js');
|
|
|
51
52
|
require('./ResultCard.js');
|
|
52
53
|
require('./ResultList.js');
|
|
53
54
|
require('vue-no-ssr');
|
|
54
|
-
require('./ssr-
|
|
55
|
+
require('./ssr-3027b848.js');
|
|
55
56
|
require('./RangeSlider.js');
|
|
56
57
|
require('./DynamicRangeSlider.js');
|
|
57
58
|
require('./StateProvider.js');
|
|
@@ -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-c705cbe6.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-c705cbe6.js');
|
|
8
8
|
|
|
9
9
|
var getAggsOrder = configureStore.helper.getAggsOrder;
|
|
10
10
|
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-76660dab.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-76660dab.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-76660dab.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-3342664a.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"])));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import { getInternalComponentID } from '@appbaseio/reactivecore/lib/utils/transform';
|
|
6
|
-
import { c as connect, b as getCamelCase, d as getValidPropsKeys } from './index-
|
|
6
|
+
import { c as connect, b as getCamelCase, d as getValidPropsKeys } from './index-3d98f51b.js';
|
|
7
7
|
|
|
8
8
|
var addComponent = Actions.addComponent,
|
|
9
9
|
removeComponent = Actions.removeComponent,
|