@appbaseio/reactivesearch-vue 1.27.0-gamma.2 → 1.28.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 +4551 -6116
- 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/DataSearch.js +2107 -18
- package/dist/cjs/{DropDown-0076babc.js → DropDown-7aa3d0d2.js} +1 -1
- package/dist/cjs/DynamicRangeSlider.js +24 -16
- package/dist/cjs/{Input-a9ee53ed.js → Input-3cc3fa59.js} +1 -1
- package/dist/cjs/MultiDropdownList.js +35 -26
- package/dist/cjs/MultiList.js +34 -24
- package/dist/cjs/MultiRange.js +2 -3
- package/dist/cjs/RangeInput.js +1 -1
- package/dist/cjs/RangeSlider.js +2 -3
- package/dist/cjs/ReactiveComponent.js +41 -72
- package/dist/cjs/ReactiveList.js +37 -47
- package/dist/cjs/SelectedFilters.js +5 -3
- package/dist/cjs/SingleDropdownList.js +22 -19
- package/dist/cjs/SingleList.js +20 -17
- package/dist/cjs/SingleRange.js +2 -3
- package/dist/cjs/index.js +8 -9
- package/dist/cjs/initReactivesearch.js +109 -77
- package/dist/cjs/install.js +28 -23
- package/dist/cjs/version.js +1 -1
- package/dist/es/DataSearch.js +2106 -17
- package/dist/es/{DropDown-0dd8f2a3.js → DropDown-60a426a2.js} +1 -1
- package/dist/es/DynamicRangeSlider.js +24 -16
- package/dist/es/{Input-10b1d62d.js → Input-08bb1bcf.js} +1 -1
- package/dist/es/MultiDropdownList.js +35 -26
- package/dist/es/MultiList.js +34 -24
- package/dist/es/MultiRange.js +2 -3
- package/dist/es/RangeInput.js +1 -1
- package/dist/es/RangeSlider.js +2 -3
- package/dist/es/ReactiveComponent.js +41 -72
- package/dist/es/ReactiveList.js +37 -47
- package/dist/es/SelectedFilters.js +5 -3
- package/dist/es/SingleDropdownList.js +22 -19
- package/dist/es/SingleList.js +20 -17
- package/dist/es/SingleRange.js +2 -3
- package/dist/es/index.js +5 -5
- package/dist/es/initReactivesearch.js +111 -79
- package/dist/es/install.js +30 -21
- package/dist/es/version.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/DataSearch-37dfdf39.js +0 -2154
- package/dist/cjs/install-d95c7185.js +0 -1204
- package/dist/es/DataSearch-77325036.js +0 -2141
- package/dist/es/install-432674ef.js +0 -1197
|
@@ -8,10 +8,7 @@ import 'redux';
|
|
|
8
8
|
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-78920565.js';
|
|
9
9
|
import { C as ComponentWrapper } from './ComponentWrapper-0f3431d1.js';
|
|
10
10
|
|
|
11
|
-
var _excluded = ["options"]
|
|
12
|
-
_excluded2 = ["query"],
|
|
13
|
-
_excluded3 = ["query"],
|
|
14
|
-
_excluded4 = ["query"];
|
|
11
|
+
var _excluded = ["options"];
|
|
15
12
|
var updateQuery = Actions.updateQuery,
|
|
16
13
|
setQueryOptions = Actions.setQueryOptions,
|
|
17
14
|
setCustomQuery = Actions.setCustomQuery,
|
|
@@ -19,15 +16,16 @@ var updateQuery = Actions.updateQuery,
|
|
|
19
16
|
var parseHits = helper.parseHits,
|
|
20
17
|
isEqual = helper.isEqual,
|
|
21
18
|
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
getResultStats = helper.getResultStats,
|
|
20
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
21
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
24
22
|
var ReactiveComponent = {
|
|
25
23
|
name: 'ReactiveComponent',
|
|
26
24
|
props: {
|
|
27
25
|
componentId: types.stringRequired,
|
|
28
26
|
aggregationField: types.string,
|
|
29
27
|
aggregationSize: VueTypes.number,
|
|
30
|
-
size: VueTypes.number
|
|
28
|
+
size: VueTypes.number,
|
|
31
29
|
defaultQuery: types.func,
|
|
32
30
|
customQuery: types.func,
|
|
33
31
|
filterLabel: types.string,
|
|
@@ -69,25 +67,16 @@ var ReactiveComponent = {
|
|
|
69
67
|
|
|
70
68
|
if (customQuery) {
|
|
71
69
|
var calcCustomQuery = customQuery(this.selectedValue, props);
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
query = _ref.query;
|
|
75
|
-
|
|
76
|
-
var customQueryOptions = calcCustomQuery ? getOptionsFromQuery(calcCustomQuery) : null;
|
|
70
|
+
var query = extractQueryFromCustomQuery(calcCustomQuery);
|
|
71
|
+
var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
|
|
77
72
|
|
|
78
73
|
if (customQueryOptions) {
|
|
79
74
|
this.setQueryOptions(componentId, _extends({}, customQueryOptions, this.getAggsQuery()), false);
|
|
80
75
|
} else this.setQueryOptions(componentId, this.getAggsQuery(), false);
|
|
81
76
|
|
|
82
|
-
var queryToSet = query || null;
|
|
83
|
-
|
|
84
|
-
if (calcCustomQuery && calcCustomQuery.id) {
|
|
85
|
-
queryToSet = calcCustomQuery;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
77
|
this.updateQuery({
|
|
89
78
|
componentId: componentId,
|
|
90
|
-
query:
|
|
79
|
+
query: query,
|
|
91
80
|
value: this.selectedValue || null,
|
|
92
81
|
label: filterLabel,
|
|
93
82
|
showFilter: showFilter,
|
|
@@ -95,36 +84,35 @@ var ReactiveComponent = {
|
|
|
95
84
|
});
|
|
96
85
|
}
|
|
97
86
|
|
|
98
|
-
this.setQuery = function (
|
|
99
|
-
var options =
|
|
100
|
-
obj = _objectWithoutPropertiesLoose(
|
|
87
|
+
this.setQuery = function (_ref) {
|
|
88
|
+
var options = _ref.options,
|
|
89
|
+
obj = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
101
90
|
|
|
102
|
-
|
|
103
|
-
|
|
91
|
+
var queryToBeSet = obj.query; // when enableAppbase is true, Backend throws error because of repeated query in request body
|
|
92
|
+
|
|
93
|
+
if (queryToBeSet && queryToBeSet.query) {
|
|
94
|
+
queryToBeSet = queryToBeSet.query;
|
|
104
95
|
}
|
|
105
96
|
|
|
106
|
-
var
|
|
97
|
+
var customQueryCalc = _extends({}, options, {
|
|
98
|
+
query: queryToBeSet
|
|
99
|
+
});
|
|
107
100
|
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
var rsAPIQuery = customQueryCalc; // handle stored queries
|
|
102
|
+
|
|
103
|
+
if (queryToBeSet && queryToBeSet.id) {
|
|
104
|
+
rsAPIQuery = queryToBeSet;
|
|
110
105
|
} // Update customQuery field for RS API
|
|
111
106
|
|
|
112
107
|
|
|
113
|
-
|
|
114
|
-
var customQueryCalc = _extends({}, options);
|
|
108
|
+
_this.setCustomQuery(props.componentId, rsAPIQuery);
|
|
115
109
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
customQueryCalc = queryToBeSet;
|
|
119
|
-
} else {
|
|
120
|
-
customQueryCalc.query = obj.query;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
_this.setCustomQuery(props.componentId, customQueryCalc);
|
|
110
|
+
if (options) {
|
|
111
|
+
_this.setQueryOptions(props.componentId, _extends({}, _this.getAggsQuery(), options), false);
|
|
125
112
|
}
|
|
126
113
|
|
|
127
114
|
_this.updateQuery(_extends({}, obj, {
|
|
115
|
+
query: customQueryCalc.query,
|
|
128
116
|
componentId: props.componentId,
|
|
129
117
|
label: props.filterLabel,
|
|
130
118
|
showFilter: props.showFilter,
|
|
@@ -135,29 +123,22 @@ var ReactiveComponent = {
|
|
|
135
123
|
if (props.defaultQuery) {
|
|
136
124
|
this.internalComponent = props.componentId + "__internal";
|
|
137
125
|
}
|
|
138
|
-
|
|
139
|
-
beforeMount: function beforeMount() {
|
|
126
|
+
|
|
140
127
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
141
128
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
142
129
|
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
143
130
|
|
|
144
|
-
var
|
|
145
|
-
|
|
146
|
-
|
|
131
|
+
var _query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
132
|
+
|
|
133
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
147
134
|
|
|
148
135
|
if (queryOptions) {
|
|
149
136
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
150
137
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
151
138
|
|
|
152
|
-
var queryToSet = query || null;
|
|
153
|
-
|
|
154
|
-
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
155
|
-
queryToSet = this.$defaultQuery;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
139
|
this.updateQuery({
|
|
159
140
|
componentId: this.internalComponent,
|
|
160
|
-
query:
|
|
141
|
+
query: _query
|
|
161
142
|
});
|
|
162
143
|
}
|
|
163
144
|
},
|
|
@@ -205,10 +186,8 @@ var ReactiveComponent = {
|
|
|
205
186
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
206
187
|
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
207
188
|
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
208
|
-
|
|
209
|
-
var
|
|
210
|
-
query = _ref4.query,
|
|
211
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref4, _excluded3);
|
|
189
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
190
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
212
191
|
|
|
213
192
|
if (queryOptions) {
|
|
214
193
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
@@ -216,15 +195,9 @@ var ReactiveComponent = {
|
|
|
216
195
|
|
|
217
196
|
|
|
218
197
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
219
|
-
var queryToSet = query || null;
|
|
220
|
-
|
|
221
|
-
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
222
|
-
queryToSet = this.$defaultQuery;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
198
|
this.updateQuery({
|
|
226
199
|
componentId: this.internalComponent,
|
|
227
|
-
query:
|
|
200
|
+
query: query
|
|
228
201
|
});
|
|
229
202
|
}
|
|
230
203
|
},
|
|
@@ -232,10 +205,8 @@ var ReactiveComponent = {
|
|
|
232
205
|
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
233
206
|
var componentId = this.$props.componentId;
|
|
234
207
|
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
query = _ref5.query,
|
|
238
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref5, _excluded4);
|
|
208
|
+
var query = extractQueryFromCustomQuery(this.$customQuery);
|
|
209
|
+
var queryOptions = getOptionsForCustomQuery(this.$customQuery);
|
|
239
210
|
|
|
240
211
|
if (queryOptions) {
|
|
241
212
|
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
@@ -243,15 +214,9 @@ var ReactiveComponent = {
|
|
|
243
214
|
|
|
244
215
|
|
|
245
216
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
|
|
246
|
-
var queryToSet = query || null;
|
|
247
|
-
|
|
248
|
-
if (this.$customQuery && this.$customQuery.id) {
|
|
249
|
-
queryToSet = this.$customQuery;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
217
|
this.updateQuery({
|
|
253
218
|
componentId: componentId,
|
|
254
|
-
query:
|
|
219
|
+
query: query
|
|
255
220
|
});
|
|
256
221
|
}
|
|
257
222
|
}
|
|
@@ -331,6 +296,10 @@ var ReactiveComponent = {
|
|
|
331
296
|
}
|
|
332
297
|
};
|
|
333
298
|
|
|
299
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
300
|
+
return !!props.defaultQuery;
|
|
301
|
+
};
|
|
302
|
+
|
|
334
303
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
335
304
|
return {
|
|
336
305
|
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|
package/dist/es/ReactiveList.js
CHANGED
|
@@ -429,9 +429,10 @@ var isEqual$1 = helper.isEqual,
|
|
|
429
429
|
getQueryOptions = helper.getQueryOptions,
|
|
430
430
|
getClassName$1 = helper.getClassName,
|
|
431
431
|
parseHits = helper.parseHits,
|
|
432
|
-
getOptionsFromQuery = helper.getOptionsFromQuery,
|
|
433
432
|
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
434
|
-
getResultStats = helper.getResultStats
|
|
433
|
+
getResultStats = helper.getResultStats,
|
|
434
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
435
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
435
436
|
var ReactiveList = {
|
|
436
437
|
name: 'ReactiveList',
|
|
437
438
|
components: {
|
|
@@ -629,19 +630,11 @@ var ReactiveList = {
|
|
|
629
630
|
var options = getQueryOptions(this.$props);
|
|
630
631
|
options.from = 0;
|
|
631
632
|
this.$defaultQuery = newVal(null, this.$props);
|
|
632
|
-
|
|
633
|
-
var
|
|
634
|
-
sort = _ref.sort,
|
|
635
|
-
query = _ref.query;
|
|
636
|
-
|
|
637
|
-
if (sort) {
|
|
638
|
-
options.sort = this.$defaultQuery.sort;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
var queryOptions = getOptionsFromQuery(this.$defaultQuery);
|
|
633
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
634
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
642
635
|
|
|
643
636
|
if (queryOptions) {
|
|
644
|
-
options = _extends({}, options,
|
|
637
|
+
options = _extends({}, options, queryOptions);
|
|
645
638
|
} // Update calculated default query in store
|
|
646
639
|
|
|
647
640
|
|
|
@@ -732,24 +725,24 @@ var ReactiveList = {
|
|
|
732
725
|
options.from = this.$data.from;
|
|
733
726
|
|
|
734
727
|
if (this.sortOptions && this.sortOptions[this.sortOptionIndex]) {
|
|
735
|
-
var
|
|
728
|
+
var _ref;
|
|
736
729
|
|
|
737
730
|
var sortField = this.sortOptions[this.sortOptionIndex].dataField;
|
|
738
731
|
var sortBy = this.sortOptions[this.sortOptionIndex].sortBy;
|
|
739
|
-
options.sort = [(
|
|
732
|
+
options.sort = [(_ref = {}, _ref[sortField] = {
|
|
740
733
|
order: sortBy
|
|
741
|
-
},
|
|
734
|
+
}, _ref)]; // To handle sort options for RS API
|
|
742
735
|
|
|
743
736
|
this.updateComponentProps(this.componentId, {
|
|
744
737
|
dataField: sortField,
|
|
745
738
|
sortBy: sortBy
|
|
746
739
|
}, componentTypes.reactiveList);
|
|
747
740
|
} else if (this.$props.sortBy) {
|
|
748
|
-
var
|
|
741
|
+
var _ref2;
|
|
749
742
|
|
|
750
|
-
options.sort = [(
|
|
743
|
+
options.sort = [(_ref2 = {}, _ref2[this.$props.dataField] = {
|
|
751
744
|
order: this.$props.sortBy
|
|
752
|
-
},
|
|
745
|
+
}, _ref2)];
|
|
753
746
|
} // Override sort query with defaultQuery's sort if defined
|
|
754
747
|
|
|
755
748
|
|
|
@@ -757,20 +750,13 @@ var ReactiveList = {
|
|
|
757
750
|
|
|
758
751
|
if (this.$props.defaultQuery) {
|
|
759
752
|
this.$defaultQuery = this.$props.defaultQuery();
|
|
760
|
-
options = _extends({}, options,
|
|
761
|
-
|
|
762
|
-
if (this.$defaultQuery.sort) {
|
|
763
|
-
options.sort = this.$defaultQuery.sort;
|
|
764
|
-
} // Update calculated default query in store
|
|
765
|
-
|
|
753
|
+
options = _extends({}, options, getOptionsForCustomQuery(this.$defaultQuery)); // Update calculated default query in store
|
|
766
754
|
|
|
767
755
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props);
|
|
768
756
|
} // execute is set to false at the time of mount
|
|
769
757
|
|
|
770
758
|
|
|
771
|
-
var
|
|
772
|
-
query = _ref4.query;
|
|
773
|
-
|
|
759
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
774
760
|
var execute = false;
|
|
775
761
|
this.setQueryOptions(this.$props.componentId, _extends({}, options, this.getAggsQuery()), execute);
|
|
776
762
|
|
|
@@ -885,18 +871,18 @@ var ReactiveList = {
|
|
|
885
871
|
}) : 0;
|
|
886
872
|
|
|
887
873
|
if (props.sortOptions[sortOptionIndex]) {
|
|
888
|
-
var
|
|
874
|
+
var _ref3;
|
|
889
875
|
|
|
890
|
-
options.sort = [(
|
|
876
|
+
options.sort = [(_ref3 = {}, _ref3[props.sortOptions[sortOptionIndex].dataField] = {
|
|
891
877
|
order: props.sortOptions[sortOptionIndex].sortBy
|
|
892
|
-
},
|
|
878
|
+
}, _ref3)];
|
|
893
879
|
}
|
|
894
880
|
} else if (props.sortBy) {
|
|
895
|
-
var
|
|
881
|
+
var _ref4;
|
|
896
882
|
|
|
897
|
-
options.sort = [(
|
|
883
|
+
options.sort = [(_ref4 = {}, _ref4[props.dataField] = {
|
|
898
884
|
order: props.sortBy
|
|
899
|
-
},
|
|
885
|
+
}, _ref4)];
|
|
900
886
|
}
|
|
901
887
|
|
|
902
888
|
this.setQueryOptions(this.$props.componentId, _extends({}, options, this.getAggsQuery()), true);
|
|
@@ -999,16 +985,16 @@ var ReactiveList = {
|
|
|
999
985
|
var index = e.target.value;
|
|
1000
986
|
|
|
1001
987
|
if (this.sortOptions && this.sortOptions[index]) {
|
|
1002
|
-
var
|
|
988
|
+
var _ref5;
|
|
1003
989
|
|
|
1004
990
|
// This fixes issue #371 (where sorting a multi-result page with infinite loader breaks)
|
|
1005
991
|
var options = getQueryOptions(this.$props);
|
|
1006
992
|
options.from = 0;
|
|
1007
993
|
var sortField = this.sortOptions[index].dataField;
|
|
1008
994
|
var sortBy = this.sortOptions[index].sortBy;
|
|
1009
|
-
options.sort = [(
|
|
995
|
+
options.sort = [(_ref5 = {}, _ref5[sortField] = {
|
|
1010
996
|
order: sortBy
|
|
1011
|
-
},
|
|
997
|
+
}, _ref5)];
|
|
1012
998
|
this.sortOptionIndex = index; // To handle sort options for RS API
|
|
1013
999
|
|
|
1014
1000
|
this.updateComponentProps(this.componentId, {
|
|
@@ -1173,7 +1159,7 @@ ReactiveList.generateQueryOptions = function (props) {
|
|
|
1173
1159
|
options.size = size || 10;
|
|
1174
1160
|
|
|
1175
1161
|
var getSortOption = function getSortOption() {
|
|
1176
|
-
var
|
|
1162
|
+
var _ref7;
|
|
1177
1163
|
|
|
1178
1164
|
if (defaultSortOption) {
|
|
1179
1165
|
var sortOption = sortOptionsNew.find(function (option) {
|
|
@@ -1181,35 +1167,39 @@ ReactiveList.generateQueryOptions = function (props) {
|
|
|
1181
1167
|
});
|
|
1182
1168
|
|
|
1183
1169
|
if (sortOption) {
|
|
1184
|
-
var
|
|
1170
|
+
var _ref6;
|
|
1185
1171
|
|
|
1186
|
-
return
|
|
1172
|
+
return _ref6 = {}, _ref6[sortOption.dataField] = {
|
|
1187
1173
|
order: sortOption.sortBy
|
|
1188
|
-
},
|
|
1174
|
+
}, _ref6;
|
|
1189
1175
|
}
|
|
1190
1176
|
}
|
|
1191
1177
|
|
|
1192
|
-
return
|
|
1178
|
+
return _ref7 = {}, _ref7[sortOptionsNew[0].dataField] = {
|
|
1193
1179
|
order: sortOptionsNew[0].sortBy
|
|
1194
|
-
},
|
|
1180
|
+
}, _ref7;
|
|
1195
1181
|
};
|
|
1196
1182
|
|
|
1197
1183
|
if (sortOptionsNew) {
|
|
1198
1184
|
options.sort = [getSortOption()];
|
|
1199
1185
|
} else if (sortBy) {
|
|
1200
|
-
var
|
|
1186
|
+
var _ref8;
|
|
1201
1187
|
|
|
1202
|
-
options.sort = [(
|
|
1188
|
+
options.sort = [(_ref8 = {}, _ref8[dataField] = {
|
|
1203
1189
|
order: sortBy
|
|
1204
|
-
},
|
|
1190
|
+
}, _ref8)];
|
|
1205
1191
|
}
|
|
1206
1192
|
|
|
1207
1193
|
return options;
|
|
1208
1194
|
};
|
|
1209
1195
|
|
|
1196
|
+
ReactiveList.hasInternalComponent = function () {
|
|
1197
|
+
return true;
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1210
1200
|
var RLConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(ReactiveList), {
|
|
1211
1201
|
componentType: componentTypes.reactiveList,
|
|
1212
|
-
internalComponent:
|
|
1202
|
+
internalComponent: ReactiveList.hasInternalComponent()
|
|
1213
1203
|
});
|
|
1214
1204
|
|
|
1215
1205
|
ReactiveList.install = function (Vue) {
|
|
@@ -26,6 +26,7 @@ var SelectedFilters = {
|
|
|
26
26
|
showClearAll: VueTypes.bool.def(true),
|
|
27
27
|
title: types.title,
|
|
28
28
|
resetToDefault: VueTypes.bool.def(false),
|
|
29
|
+
clearAllBlacklistComponents: VueTypes.array,
|
|
29
30
|
resetToValues: VueTypes.object
|
|
30
31
|
},
|
|
31
32
|
inject: {
|
|
@@ -80,12 +81,13 @@ var SelectedFilters = {
|
|
|
80
81
|
},
|
|
81
82
|
clearValues: function clearValues() {
|
|
82
83
|
var resetToDefault = this.resetToDefault,
|
|
83
|
-
resetToValues = this.resetToValues
|
|
84
|
+
resetToValues = this.resetToValues,
|
|
85
|
+
clearAllBlacklistComponents = this.clearAllBlacklistComponents;
|
|
84
86
|
|
|
85
87
|
if (resetToDefault) {
|
|
86
|
-
this.resetValuesToDefault();
|
|
88
|
+
this.resetValuesToDefault(clearAllBlacklistComponents);
|
|
87
89
|
} else {
|
|
88
|
-
this.clearValuesAction(resetToValues);
|
|
90
|
+
this.clearValuesAction(resetToValues, clearAllBlacklistComponents);
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
this.$emit('clear', resetToValues);
|
|
@@ -14,12 +14,12 @@ import { C as ComponentWrapper } from './ComponentWrapper-0f3431d1.js';
|
|
|
14
14
|
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
15
15
|
import { T as Title } from './Title-3522ff56.js';
|
|
16
16
|
import './CancelSvg-c2c03a35.js';
|
|
17
|
-
import './Input-
|
|
17
|
+
import './Input-08bb1bcf.js';
|
|
18
18
|
import 'compute-scroll-into-view';
|
|
19
19
|
import { C as Container } from './Container-18b03fde.js';
|
|
20
20
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
21
21
|
import { g as getAggsQuery } from './utils-64a2e5f0.js';
|
|
22
|
-
import { D as Dropdown } from './DropDown-
|
|
22
|
+
import { D as Dropdown } from './DropDown-60a426a2.js';
|
|
23
23
|
|
|
24
24
|
var updateQuery = Actions.updateQuery,
|
|
25
25
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -29,9 +29,10 @@ var getQueryOptions = helper.getQueryOptions,
|
|
|
29
29
|
checkValueChange = helper.checkValueChange,
|
|
30
30
|
checkPropChange = helper.checkPropChange,
|
|
31
31
|
getClassName = helper.getClassName,
|
|
32
|
-
getOptionsFromQuery = helper.getOptionsFromQuery,
|
|
33
32
|
isEqual = helper.isEqual,
|
|
34
|
-
getCompositeAggsQuery = helper.getCompositeAggsQuery
|
|
33
|
+
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
34
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
35
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
35
36
|
var SingleDropdownList = {
|
|
36
37
|
name: 'SingleDropdownList',
|
|
37
38
|
data: function data() {
|
|
@@ -68,7 +69,7 @@ var SingleDropdownList = {
|
|
|
68
69
|
selectAllLabel: types.string,
|
|
69
70
|
showCount: VueTypes.bool.def(true),
|
|
70
71
|
showFilter: VueTypes.bool.def(true),
|
|
71
|
-
size: VueTypes.number
|
|
72
|
+
size: VueTypes.number,
|
|
72
73
|
sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
|
|
73
74
|
title: types.title,
|
|
74
75
|
URLParams: VueTypes.bool.def(false),
|
|
@@ -280,22 +281,22 @@ var SingleDropdownList = {
|
|
|
280
281
|
}
|
|
281
282
|
},
|
|
282
283
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
283
|
-
var defaultQueryOptions;
|
|
284
284
|
var query = SingleDropdownList.defaultQuery(value, props);
|
|
285
285
|
|
|
286
286
|
if (this.defaultQuery) {
|
|
287
287
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
288
|
+
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
288
289
|
|
|
289
|
-
if (
|
|
290
|
-
query =
|
|
291
|
-
}
|
|
290
|
+
if (defaultQueryObj) {
|
|
291
|
+
query = defaultQueryObj;
|
|
292
|
+
} // Update calculated default query in store
|
|
292
293
|
|
|
293
|
-
defaultQueryOptions = getOptionsFromQuery(defaultQueryToBeSet); // Update calculated default query in store
|
|
294
294
|
|
|
295
295
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
296
|
+
var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
297
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
296
298
|
}
|
|
297
299
|
|
|
298
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
299
300
|
this.updateQuery({
|
|
300
301
|
componentId: this.internalComponent,
|
|
301
302
|
query: query,
|
|
@@ -306,17 +307,15 @@ var SingleDropdownList = {
|
|
|
306
307
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
307
308
|
var customQuery = props.customQuery;
|
|
308
309
|
var query = SingleDropdownList.defaultQuery(value, props);
|
|
309
|
-
var customQueryOptions;
|
|
310
310
|
|
|
311
311
|
if (customQuery) {
|
|
312
|
-
var
|
|
313
|
-
|
|
314
|
-
query = _ref.query;
|
|
315
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
312
|
+
var customQueryCalc = customQuery(value, props);
|
|
313
|
+
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
316
314
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
315
|
+
var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
|
|
316
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
320
319
|
this.updateQuery({
|
|
321
320
|
componentId: props.componentId,
|
|
322
321
|
query: query,
|
|
@@ -350,7 +349,7 @@ var SingleDropdownList = {
|
|
|
350
349
|
|
|
351
350
|
if (props.defaultQuery) {
|
|
352
351
|
var value = this.$data.currentValue;
|
|
353
|
-
var defaultQueryOptions =
|
|
352
|
+
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
354
353
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
355
354
|
} else {
|
|
356
355
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
@@ -442,6 +441,10 @@ SingleDropdownList.generateQueryOptions = function (props, after) {
|
|
|
442
441
|
}) : getAggsQuery(queryOptions, props);
|
|
443
442
|
};
|
|
444
443
|
|
|
444
|
+
SingleDropdownList.hasInternalComponent = function () {
|
|
445
|
+
return true;
|
|
446
|
+
};
|
|
447
|
+
|
|
445
448
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
446
449
|
return {
|
|
447
450
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -463,7 +466,7 @@ var mapDispatchtoProps = {
|
|
|
463
466
|
};
|
|
464
467
|
var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(SingleDropdownList), {
|
|
465
468
|
componentType: componentTypes.singleDropdownList,
|
|
466
|
-
internalComponent:
|
|
469
|
+
internalComponent: SingleDropdownList.hasInternalComponent()
|
|
467
470
|
});
|
|
468
471
|
|
|
469
472
|
SingleDropdownList.install = function (Vue) {
|
package/dist/es/SingleList.js
CHANGED
|
@@ -11,7 +11,7 @@ import 'redux';
|
|
|
11
11
|
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, n as isEvent, h as hasCustomRenderer, c as connect } from './index-78920565.js';
|
|
12
12
|
import { C as ComponentWrapper } from './ComponentWrapper-0f3431d1.js';
|
|
13
13
|
import { T as Title } from './Title-3522ff56.js';
|
|
14
|
-
import { I as Input } from './Input-
|
|
14
|
+
import { I as Input } from './Input-08bb1bcf.js';
|
|
15
15
|
import { C as Container } from './Container-18b03fde.js';
|
|
16
16
|
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
17
17
|
import { U as UL, R as Radio } from './FormControlList-704f8dee.js';
|
|
@@ -24,8 +24,9 @@ var updateQuery = Actions.updateQuery,
|
|
|
24
24
|
var getQueryOptions = helper.getQueryOptions,
|
|
25
25
|
checkValueChange = helper.checkValueChange,
|
|
26
26
|
getClassName = helper.getClassName,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
isEqual = helper.isEqual,
|
|
28
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
29
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
29
30
|
var SingleList = {
|
|
30
31
|
name: 'SingleList',
|
|
31
32
|
props: {
|
|
@@ -262,22 +263,22 @@ var SingleList = {
|
|
|
262
263
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
263
264
|
},
|
|
264
265
|
updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props) {
|
|
265
|
-
var defaultQueryOptions;
|
|
266
266
|
var query = SingleList.defaultQuery(value, props);
|
|
267
267
|
|
|
268
268
|
if (this.defaultQuery) {
|
|
269
269
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
270
|
+
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
270
271
|
|
|
271
|
-
if (
|
|
272
|
-
query =
|
|
273
|
-
}
|
|
272
|
+
if (defaultQueryObj) {
|
|
273
|
+
query = defaultQueryObj;
|
|
274
|
+
} // Update calculated default query in store
|
|
274
275
|
|
|
275
|
-
defaultQueryOptions = getOptionsFromQuery(defaultQueryToBeSet); // Update calculated default query in store
|
|
276
276
|
|
|
277
277
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
278
|
+
var defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet);
|
|
279
|
+
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
278
280
|
}
|
|
279
281
|
|
|
280
|
-
this.setQueryOptions(this.internalComponent, defaultQueryOptions, false);
|
|
281
282
|
this.updateQuery({
|
|
282
283
|
componentId: this.internalComponent,
|
|
283
284
|
query: query,
|
|
@@ -288,17 +289,15 @@ var SingleList = {
|
|
|
288
289
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
289
290
|
var customQuery = props.customQuery;
|
|
290
291
|
var query = SingleList.defaultQuery(value, props);
|
|
291
|
-
var customQueryOptions;
|
|
292
292
|
|
|
293
293
|
if (customQuery) {
|
|
294
|
-
var
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
294
|
+
var customQueryCalc = customQuery(value, props);
|
|
295
|
+
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
296
|
+
var customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
|
|
298
297
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
298
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
302
301
|
this.updateQuery({
|
|
303
302
|
componentId: props.componentId,
|
|
304
303
|
query: query,
|
|
@@ -318,7 +317,7 @@ var SingleList = {
|
|
|
318
317
|
|
|
319
318
|
if (props.defaultQuery) {
|
|
320
319
|
var value = this.$data.currentValue;
|
|
321
|
-
var defaultQueryOptions =
|
|
320
|
+
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
322
321
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
323
322
|
} else {
|
|
324
323
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
@@ -463,6 +462,10 @@ SingleList.defaultQuery = function (value, props) {
|
|
|
463
462
|
return query;
|
|
464
463
|
};
|
|
465
464
|
|
|
465
|
+
SingleList.hasInternalComponent = function () {
|
|
466
|
+
return true;
|
|
467
|
+
};
|
|
468
|
+
|
|
466
469
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
467
470
|
return {
|
|
468
471
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -484,7 +487,7 @@ var mapDispatchtoProps = {
|
|
|
484
487
|
};
|
|
485
488
|
var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(SingleList), {
|
|
486
489
|
componentType: componentTypes.singleList,
|
|
487
|
-
internalComponent:
|
|
490
|
+
internalComponent: SingleList.hasInternalComponent()
|
|
488
491
|
});
|
|
489
492
|
|
|
490
493
|
SingleList.install = function (Vue) {
|
package/dist/es/SingleRange.js
CHANGED
|
@@ -150,17 +150,16 @@ var SingleRange = {
|
|
|
150
150
|
updateQueryHandler: function updateQueryHandler(value, props) {
|
|
151
151
|
var customQuery = props.customQuery;
|
|
152
152
|
var query = SingleRange.defaultQuery(value, props);
|
|
153
|
-
var customQueryOptions;
|
|
154
153
|
|
|
155
154
|
if (customQuery) {
|
|
156
155
|
var _ref = customQuery(value, props) || {};
|
|
157
156
|
|
|
158
157
|
query = _ref.query;
|
|
159
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
158
|
+
var customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
160
159
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
|
|
160
|
+
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
this.setQueryOptions(props.componentId, customQueryOptions, false);
|
|
164
163
|
this.updateQuery({
|
|
165
164
|
componentId: props.componentId,
|
|
166
165
|
query: query,
|