@appbaseio/reactivesearch-vue 1.16.0-alpha.34 → 1.16.0-alpha.37
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 +15843 -10573
- 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-11307285.js → Button-d2f1aeda.js} +1 -1
- package/dist/cjs/{CancelSvg-4aa35935.js → CancelSvg-82021d23.js} +1 -1
- package/dist/cjs/{Card-fd94ef07.js → Card-4b915733.js} +2 -2
- package/dist/cjs/{ComponentWrapper-32481890.js → ComponentWrapper-7302fe1a.js} +2 -2
- package/dist/cjs/{Container-526efa6a.js → Container-8a08d663.js} +1 -1
- package/dist/cjs/DataSearch.js +2107 -18
- package/dist/cjs/{DropDown-cf9bfffc.js → DropDown-c46d8b0c.js} +19 -14
- package/dist/cjs/DynamicRangeSlider.js +68 -26
- package/dist/cjs/{Flex-f146cdad.js → Flex-699639d2.js} +1 -1
- package/dist/cjs/{FormControlList-808dbcef.js → FormControlList-73497794.js} +1 -1
- package/dist/cjs/{Input-3cc3fa59.js → Input-c6f181d5.js} +1 -1
- package/dist/cjs/{ListItem-b40adb04.js → ListItem-933c27e4.js} +2 -2
- package/dist/cjs/MultiDropdownList.js +34 -28
- package/dist/cjs/MultiList.js +43 -32
- package/dist/cjs/MultiRange.js +7 -7
- package/dist/cjs/Pagination-1b2320a7.js +177 -0
- package/dist/cjs/RangeInput.js +13 -9
- package/dist/cjs/RangeSlider.js +7 -7
- package/dist/cjs/ReactiveBase.js +3 -3
- package/dist/cjs/ReactiveComponent.js +34 -64
- package/dist/cjs/ReactiveGoogleMap.js +1764 -0
- package/dist/cjs/ReactiveList.js +66 -231
- package/dist/cjs/ResultCard.js +4 -4
- package/dist/cjs/ResultList.js +4 -4
- package/dist/cjs/SelectedFilters.js +6 -6
- package/dist/cjs/SingleDropdownList.js +28 -22
- package/dist/cjs/SingleList.js +25 -20
- package/dist/cjs/SingleRange.js +7 -7
- package/dist/cjs/StateProvider.js +2 -2
- package/dist/cjs/{Title-584a8cc8.js → Title-39765ee6.js} +1 -1
- package/dist/cjs/ToggleButton.js +7 -7
- package/dist/cjs/{_rollupPluginBabelHelpers-f127c8b7.js → _rollupPluginBabelHelpers-4abdbfff.js} +17 -0
- package/dist/cjs/{index-89c39a9e.js → index-d44a0a21.js} +11 -5
- package/dist/cjs/index.js +32 -23
- package/dist/cjs/initReactivesearch.js +98 -81
- package/dist/cjs/install.js +43 -37
- package/dist/cjs/{ssr-0ee35a09.js → ssr-c333c82c.js} +1 -1
- package/dist/cjs/{utils-1219e1fe.js → utils-23afb20b.js} +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-57d01f18.js → vueTypes-6de9d2a9.js} +24 -13
- package/dist/es/{Button-91561391.js → Button-799185e2.js} +1 -1
- package/dist/es/{CancelSvg-c2c03a35.js → CancelSvg-4d9e0857.js} +1 -1
- package/dist/es/{Card-6446f1b7.js → Card-04b3c33e.js} +2 -2
- package/dist/es/{ComponentWrapper-4f85a67e.js → ComponentWrapper-bbb717bc.js} +2 -2
- package/dist/es/{Container-18b03fde.js → Container-4383c6f0.js} +1 -1
- package/dist/es/DataSearch.js +2106 -17
- package/dist/es/{DropDown-c8da0a2c.js → DropDown-4edaa621.js} +19 -14
- package/dist/es/DynamicRangeSlider.js +68 -26
- package/dist/es/{Flex-8770345d.js → Flex-aac91505.js} +1 -1
- package/dist/es/{FormControlList-704f8dee.js → FormControlList-fe389a2e.js} +1 -1
- package/dist/es/{Input-08bb1bcf.js → Input-d8519224.js} +1 -1
- package/dist/es/{ListItem-8e8fb535.js → ListItem-bdb6d53d.js} +2 -2
- package/dist/es/MultiDropdownList.js +34 -28
- package/dist/es/MultiList.js +43 -32
- package/dist/es/MultiRange.js +7 -7
- package/dist/es/Pagination-b3e4054a.js +172 -0
- package/dist/es/RangeInput.js +13 -9
- package/dist/es/RangeSlider.js +7 -7
- package/dist/es/ReactiveBase.js +3 -3
- package/dist/es/ReactiveComponent.js +34 -64
- package/dist/es/ReactiveGoogleMap.js +1756 -0
- package/dist/es/ReactiveList.js +66 -231
- package/dist/es/ResultCard.js +4 -4
- package/dist/es/ResultList.js +4 -4
- package/dist/es/SelectedFilters.js +6 -6
- package/dist/es/SingleDropdownList.js +28 -22
- package/dist/es/SingleList.js +25 -20
- package/dist/es/SingleRange.js +7 -7
- package/dist/es/StateProvider.js +2 -2
- package/dist/es/{Title-3522ff56.js → Title-579f8d6c.js} +1 -1
- package/dist/es/ToggleButton.js +7 -7
- package/dist/es/{_rollupPluginBabelHelpers-0f24d612.js → _rollupPluginBabelHelpers-ecf6c03c.js} +17 -1
- package/dist/es/{index-cb1950b6.js → index-5daa8276.js} +11 -5
- package/dist/es/index.js +28 -19
- package/dist/es/initReactivesearch.js +99 -82
- package/dist/es/install.js +45 -35
- package/dist/es/{ssr-a41dfea9.js → ssr-e3196de1.js} +1 -1
- package/dist/es/{utils-64a2e5f0.js → utils-3a32e13f.js} +1 -1
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-687b2304.js → vueTypes-9326e0be.js} +24 -13
- package/package.json +86 -80
- package/dist/cjs/DataSearch-8658fd8e.js +0 -2154
- package/dist/cjs/install-35f74190.js +0 -1196
- package/dist/es/DataSearch-66e72d1d.js +0 -2141
- package/dist/es/install-ecef1861.js +0 -1189
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { css } from 'emotion';
|
|
5
5
|
import styled from '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
7
|
-
import { a as isFunction } from './index-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
6
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
7
|
+
import { a as isFunction } from './index-5daa8276.js';
|
|
8
|
+
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
9
|
+
import { D as Downshift, b as InputWrapper, a as IconGroup, I as IconWrapper, C as CancelSvg } from './CancelSvg-4d9e0857.js';
|
|
10
|
+
import { s as suggestionsContainer, a as suggestions, I as Input } from './Input-d8519224.js';
|
|
10
11
|
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
11
12
|
|
|
12
13
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
@@ -120,7 +121,8 @@ var Dropdown = {
|
|
|
120
121
|
isOpen = _ref.isOpen,
|
|
121
122
|
highlightedIndex = _ref.highlightedIndex,
|
|
122
123
|
getButtonProps = _ref.getButtonProps,
|
|
123
|
-
getItemEvents = _ref.getItemEvents
|
|
124
|
+
getItemEvents = _ref.getItemEvents,
|
|
125
|
+
getInputEvents = _ref.getInputEvents;
|
|
124
126
|
return h("div", {
|
|
125
127
|
"class": suggestionsContainer
|
|
126
128
|
}, [h(Select, {
|
|
@@ -145,7 +147,13 @@ var Dropdown = {
|
|
|
145
147
|
getItemEvents: getItemEvents
|
|
146
148
|
}) : isOpen && itemsToRender.length ? h("ul", {
|
|
147
149
|
"class": suggestions(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName(_this.$props.innerClass, 'list')
|
|
148
|
-
}, [_this.$props.showSearch ? _this.renderSearchbox(
|
|
150
|
+
}, [_this.$props.showSearch ? _this.renderSearchbox({
|
|
151
|
+
on: {
|
|
152
|
+
input: getInputEvents({
|
|
153
|
+
onInput: _this.handleInputChange
|
|
154
|
+
}).input
|
|
155
|
+
}
|
|
156
|
+
}) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
|
|
149
157
|
var selected = _this.$props.multi // MultiDropdownList
|
|
150
158
|
&& (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
|
|
151
159
|
|| Array.isArray(selectedItem) && selectedItem.find(function (value) {
|
|
@@ -266,7 +274,7 @@ var Dropdown = {
|
|
|
266
274
|
"class": getClassName(this.$props.innerClass, 'noResults') || null
|
|
267
275
|
}, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
268
276
|
},
|
|
269
|
-
renderSearchbox: function renderSearchbox() {
|
|
277
|
+
renderSearchbox: function renderSearchbox(eventObject) {
|
|
270
278
|
var h = this.$createElement;
|
|
271
279
|
var _this$$props2 = this.$props,
|
|
272
280
|
componentId = _this$$props2.componentId,
|
|
@@ -274,7 +282,7 @@ var Dropdown = {
|
|
|
274
282
|
showClear = _this$$props2.showClear,
|
|
275
283
|
themePreset = _this$$props2.themePreset,
|
|
276
284
|
innerClass = _this$$props2.innerClass;
|
|
277
|
-
var InputComponent = h(Input, {
|
|
285
|
+
var InputComponent = h(Input, _mergeJSXProps([{
|
|
278
286
|
"attrs": {
|
|
279
287
|
"id": componentId + "-input",
|
|
280
288
|
"showIcon": false,
|
|
@@ -287,11 +295,8 @@ var Dropdown = {
|
|
|
287
295
|
border: 0,
|
|
288
296
|
borderBottom: '1px solid #ddd'
|
|
289
297
|
},
|
|
290
|
-
"class": getClassName(innerClass, 'input')
|
|
291
|
-
|
|
292
|
-
"change": this.handleInputChange
|
|
293
|
-
}
|
|
294
|
-
});
|
|
298
|
+
"class": getClassName(innerClass, 'input')
|
|
299
|
+
}, eventObject]));
|
|
295
300
|
|
|
296
301
|
if (showClear) {
|
|
297
302
|
return h(InputWrapper, [InputComponent, this.searchTerm && h(IconGroup, {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import '@appbaseio/vue-emotion';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
7
7
|
import 'redux';
|
|
8
|
-
import { f as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-
|
|
9
|
-
import { T as Title } from './Title-
|
|
10
|
-
import { C as Container } from './Container-
|
|
8
|
+
import { f as updateCustomQuery, d as getValidPropsKeys, i as isQueryIdentical, c as connect } from './index-5daa8276.js';
|
|
9
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
10
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
11
11
|
import NoSSR from 'vue-no-ssr';
|
|
12
|
-
import { g as getComponents, S as Slider } from './ssr-
|
|
12
|
+
import { g as getComponents, S as Slider } from './ssr-e3196de1.js';
|
|
13
13
|
|
|
14
14
|
var addComponent = Actions.addComponent,
|
|
15
15
|
removeComponent = Actions.removeComponent,
|
|
@@ -22,9 +22,10 @@ var addComponent = Actions.addComponent,
|
|
|
22
22
|
updateComponentProps = Actions.updateComponentProps;
|
|
23
23
|
var checkValueChange = helper.checkValueChange,
|
|
24
24
|
getClassName = helper.getClassName,
|
|
25
|
-
getOptionsFromQuery = helper.getOptionsFromQuery,
|
|
26
25
|
isEqual = helper.isEqual,
|
|
27
|
-
checkSomePropChange = helper.checkSomePropChange
|
|
26
|
+
checkSomePropChange = helper.checkSomePropChange,
|
|
27
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
28
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
28
29
|
var DynamicRangeSlider = {
|
|
29
30
|
name: 'DynamicRangeSlider',
|
|
30
31
|
components: getComponents(),
|
|
@@ -47,7 +48,8 @@ var DynamicRangeSlider = {
|
|
|
47
48
|
URLParams: VueTypes.bool.def(false),
|
|
48
49
|
sliderOptions: VueTypes.object.def({}),
|
|
49
50
|
nestedField: types.string,
|
|
50
|
-
index: VueTypes.string
|
|
51
|
+
index: VueTypes.string,
|
|
52
|
+
value: types.range
|
|
51
53
|
},
|
|
52
54
|
data: function data() {
|
|
53
55
|
this.internalRangeComponent = this.$props.componentId + "__range__internal";
|
|
@@ -93,6 +95,8 @@ var DynamicRangeSlider = {
|
|
|
93
95
|
components = _this$$$store$getStat.components;
|
|
94
96
|
}
|
|
95
97
|
|
|
98
|
+
var value = this.$props.value;
|
|
99
|
+
|
|
96
100
|
if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
|
|
97
101
|
this.addComponent(this.componentId);
|
|
98
102
|
this.addComponent(this.internalRangeComponent);
|
|
@@ -101,6 +105,8 @@ var DynamicRangeSlider = {
|
|
|
101
105
|
this.handleChange(this.selectedValue);
|
|
102
106
|
} else if (this.selectedValue) {
|
|
103
107
|
this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
|
|
108
|
+
} else if (value) {
|
|
109
|
+
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
104
110
|
} // get range before executing other queries
|
|
105
111
|
|
|
106
112
|
|
|
@@ -119,6 +125,13 @@ var DynamicRangeSlider = {
|
|
|
119
125
|
}
|
|
120
126
|
},
|
|
121
127
|
methods: {
|
|
128
|
+
isControlled: function isControlled() {
|
|
129
|
+
if (this.$props.value && this.$listeners) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return false;
|
|
134
|
+
},
|
|
122
135
|
setDefaultValue: function setDefaultValue(_ref) {
|
|
123
136
|
var start = _ref.start,
|
|
124
137
|
end = _ref.end;
|
|
@@ -129,6 +142,8 @@ var DynamicRangeSlider = {
|
|
|
129
142
|
defaultEnd = _this$$props$defaultV.end;
|
|
130
143
|
|
|
131
144
|
this.handleChange([defaultStart, defaultEnd]);
|
|
145
|
+
} else if (this.isControlled()) {
|
|
146
|
+
this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
|
|
132
147
|
} else {
|
|
133
148
|
this.currentValue = [start, end];
|
|
134
149
|
}
|
|
@@ -178,7 +193,16 @@ var DynamicRangeSlider = {
|
|
|
178
193
|
},
|
|
179
194
|
handleSlider: function handleSlider() {
|
|
180
195
|
var sliderValues = this.$refs.slider.getValue();
|
|
181
|
-
this.
|
|
196
|
+
var value = this.$props.value;
|
|
197
|
+
|
|
198
|
+
if (value === undefined) {
|
|
199
|
+
this.handleChange(sliderValues);
|
|
200
|
+
} else {
|
|
201
|
+
this.$emit('change', {
|
|
202
|
+
start: sliderValues[0],
|
|
203
|
+
end: sliderValues[1]
|
|
204
|
+
});
|
|
205
|
+
}
|
|
182
206
|
},
|
|
183
207
|
handleChange: function handleChange(currentValue) {
|
|
184
208
|
var _this2 = this;
|
|
@@ -212,19 +236,23 @@ var DynamicRangeSlider = {
|
|
|
212
236
|
var customQueryOptions;
|
|
213
237
|
|
|
214
238
|
if (this.$props.customQuery) {
|
|
215
|
-
var
|
|
239
|
+
var customQueryTobeSet = this.$props.customQuery(value, this.$props);
|
|
240
|
+
var queryTobeSet = extractQueryFromCustomQuery(customQueryTobeSet);
|
|
216
241
|
|
|
217
|
-
|
|
218
|
-
|
|
242
|
+
if (queryTobeSet) {
|
|
243
|
+
query = queryTobeSet;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
customQueryOptions = getOptionsForCustomQuery(customQueryTobeSet);
|
|
219
247
|
updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, value);
|
|
220
248
|
}
|
|
221
249
|
|
|
222
|
-
var
|
|
250
|
+
var _ref2 = this.range || {
|
|
223
251
|
start: value[0],
|
|
224
252
|
end: value[1]
|
|
225
253
|
},
|
|
226
|
-
start =
|
|
227
|
-
end =
|
|
254
|
+
start = _ref2.start,
|
|
255
|
+
end = _ref2.end;
|
|
228
256
|
|
|
229
257
|
var currentStart = value[0],
|
|
230
258
|
currentEnd = value[1]; // check if the slider is at its initial position
|
|
@@ -271,18 +299,19 @@ var DynamicRangeSlider = {
|
|
|
271
299
|
start: this.range.start,
|
|
272
300
|
end: this.range.end
|
|
273
301
|
};
|
|
302
|
+
this.$emit('change', value);
|
|
274
303
|
this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
|
|
275
304
|
},
|
|
276
305
|
range: function range(newValue, oldValue) {
|
|
277
306
|
if (isEqual(newValue, oldValue) || !this.currentValue) return;
|
|
278
307
|
|
|
279
|
-
var
|
|
280
|
-
currentStart =
|
|
281
|
-
currentEnd =
|
|
308
|
+
var _ref3 = this.currentValue || [],
|
|
309
|
+
currentStart = _ref3[0],
|
|
310
|
+
currentEnd = _ref3[1];
|
|
282
311
|
|
|
283
|
-
var
|
|
284
|
-
oldStart =
|
|
285
|
-
oldEnd =
|
|
312
|
+
var _ref4 = oldValue || {},
|
|
313
|
+
oldStart = _ref4.start,
|
|
314
|
+
oldEnd = _ref4.end;
|
|
286
315
|
|
|
287
316
|
var newStart = currentStart === oldStart ? newValue.start : currentStart;
|
|
288
317
|
var newEnd = currentEnd === oldEnd ? newValue.end : currentEnd;
|
|
@@ -292,6 +321,11 @@ var DynamicRangeSlider = {
|
|
|
292
321
|
if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
|
|
293
322
|
this.updateQueryHandler(this.$data.currentValue);
|
|
294
323
|
}
|
|
324
|
+
},
|
|
325
|
+
value: function value(newVal, oldVal) {
|
|
326
|
+
if (!isEqual(newVal, oldVal)) {
|
|
327
|
+
this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
|
|
328
|
+
}
|
|
295
329
|
}
|
|
296
330
|
},
|
|
297
331
|
render: function render() {
|
|
@@ -313,9 +347,9 @@ var DynamicRangeSlider = {
|
|
|
313
347
|
}, [h("vue-slider-component", {
|
|
314
348
|
"ref": "slider",
|
|
315
349
|
"attrs": {
|
|
316
|
-
"value": [Math.max(start, this.currentValue[0]), Math.min(end, this.currentValue[1])],
|
|
317
|
-
"min": Math.min(start, this.currentValue[0]),
|
|
318
|
-
"max": Math.max(end, this.currentValue[1]),
|
|
350
|
+
"value": [Math.floor(Math.max(start, this.currentValue[0])), Math.ceil(Math.min(end, this.currentValue[1]))],
|
|
351
|
+
"min": Math.floor(Math.min(start, this.currentValue[0])),
|
|
352
|
+
"max": Math.ceil(Math.max(end, this.currentValue[1])),
|
|
319
353
|
"dotSize": 20,
|
|
320
354
|
"height": 4,
|
|
321
355
|
"enable-cross": false,
|
|
@@ -365,7 +399,15 @@ DynamicRangeSlider.defaultQuery = function (values, props) {
|
|
|
365
399
|
};
|
|
366
400
|
|
|
367
401
|
DynamicRangeSlider.parseValue = function (value) {
|
|
368
|
-
|
|
402
|
+
if (value) {
|
|
403
|
+
return Array.isArray(value) ? value : [value.start, value.end];
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
return [];
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
DynamicRangeSlider.hasInternalComponent = function () {
|
|
410
|
+
return true;
|
|
369
411
|
};
|
|
370
412
|
|
|
371
413
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
import { lighten } from 'polished';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import styled from '@appbaseio/vue-emotion';
|
|
4
4
|
import { lighten } from 'polished';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _taggedTemplateLiteralLoose } from './_rollupPluginBabelHelpers-ecf6c03c.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-579f8d6c.js';
|
|
6
6
|
|
|
7
7
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
8
8
|
var container = css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin: 0;\n\tborder-radius: 0.25rem;\n\toverflow: hidden;\n"])));
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { l as loadMoreContainer, B as Button } from './Button-
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { l as loadMoreContainer, B as Button } from './Button-799185e2.js';
|
|
9
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
10
10
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
11
11
|
import 'redux';
|
|
12
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, o as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-
|
|
13
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
14
|
-
import
|
|
15
|
-
import './
|
|
16
|
-
import './
|
|
12
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, o as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5daa8276.js';
|
|
13
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
14
|
+
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
15
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
16
|
+
import './CancelSvg-4d9e0857.js';
|
|
17
|
+
import './Input-d8519224.js';
|
|
17
18
|
import 'compute-scroll-into-view';
|
|
18
|
-
import { C as Container } from './Container-
|
|
19
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
19
20
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
20
|
-
import { g as getAggsQuery } from './utils-
|
|
21
|
-
import { D as Dropdown } from './DropDown-
|
|
21
|
+
import { g as getAggsQuery } from './utils-3a32e13f.js';
|
|
22
|
+
import { D as Dropdown } from './DropDown-4edaa621.js';
|
|
22
23
|
|
|
23
24
|
var updateQuery = Actions.updateQuery,
|
|
24
25
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -29,8 +30,9 @@ var isEqual = helper.isEqual,
|
|
|
29
30
|
checkValueChange = helper.checkValueChange,
|
|
30
31
|
checkPropChange = helper.checkPropChange,
|
|
31
32
|
getClassName = helper.getClassName,
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
34
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
35
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
34
36
|
var MultiDropdownList = {
|
|
35
37
|
name: 'MultiDropdownList',
|
|
36
38
|
data: function data() {
|
|
@@ -342,7 +344,7 @@ var MultiDropdownList = {
|
|
|
342
344
|
}
|
|
343
345
|
|
|
344
346
|
var performUpdate = function performUpdate() {
|
|
345
|
-
_this3.currentValue = currentValue;
|
|
347
|
+
_this3.currentValue = _extends({}, currentValue);
|
|
346
348
|
|
|
347
349
|
_this3.updateQueryHandler(finalValues, props);
|
|
348
350
|
|
|
@@ -359,12 +361,13 @@ var MultiDropdownList = {
|
|
|
359
361
|
|
|
360
362
|
if (this.defaultQuery) {
|
|
361
363
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
364
|
+
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
362
365
|
|
|
363
|
-
if (
|
|
364
|
-
query =
|
|
366
|
+
if (defaultQueryObj) {
|
|
367
|
+
query = defaultQueryObj;
|
|
365
368
|
}
|
|
366
369
|
|
|
367
|
-
defaultQueryOptions =
|
|
370
|
+
defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet); // Update calculated default query in store
|
|
368
371
|
|
|
369
372
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
370
373
|
}
|
|
@@ -383,10 +386,9 @@ var MultiDropdownList = {
|
|
|
383
386
|
var customQueryOptions;
|
|
384
387
|
|
|
385
388
|
if (customQuery) {
|
|
386
|
-
var
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
389
|
+
var customQueryCalc = customQuery(value, props);
|
|
390
|
+
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
391
|
+
customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
|
|
390
392
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
391
393
|
}
|
|
392
394
|
|
|
@@ -424,7 +426,7 @@ var MultiDropdownList = {
|
|
|
424
426
|
|
|
425
427
|
if (props.defaultQuery) {
|
|
426
428
|
var value = Object.keys(this.$data.currentValue);
|
|
427
|
-
var defaultQueryOptions =
|
|
429
|
+
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
428
430
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
429
431
|
} else {
|
|
430
432
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
@@ -483,12 +485,12 @@ MultiDropdownList.defaultQuery = function (value, props) {
|
|
|
483
485
|
|
|
484
486
|
if (props.queryFormat === 'or') {
|
|
485
487
|
if (props.showMissing) {
|
|
486
|
-
var _type,
|
|
488
|
+
var _type, _ref;
|
|
487
489
|
|
|
488
490
|
var hasMissingTerm = value.includes(props.missingLabel);
|
|
489
|
-
var should = [(
|
|
491
|
+
var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
|
|
490
492
|
return item !== props.missingLabel;
|
|
491
|
-
}), _type),
|
|
493
|
+
}), _type), _ref)];
|
|
492
494
|
|
|
493
495
|
if (hasMissingTerm) {
|
|
494
496
|
should = should.concat({
|
|
@@ -515,9 +517,9 @@ MultiDropdownList.defaultQuery = function (value, props) {
|
|
|
515
517
|
} else {
|
|
516
518
|
// adds a sub-query with must as an array of objects for each term/value
|
|
517
519
|
var queryArray = value.map(function (item) {
|
|
518
|
-
var _type3,
|
|
520
|
+
var _type3, _ref2;
|
|
519
521
|
|
|
520
|
-
return
|
|
522
|
+
return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
|
|
521
523
|
});
|
|
522
524
|
listQuery = {
|
|
523
525
|
bool: {
|
|
@@ -552,6 +554,10 @@ MultiDropdownList.generateQueryOptions = function (props, after) {
|
|
|
552
554
|
}) : getAggsQuery(queryOptions, props);
|
|
553
555
|
};
|
|
554
556
|
|
|
557
|
+
MultiDropdownList.hasInternalComponent = function () {
|
|
558
|
+
return true;
|
|
559
|
+
};
|
|
560
|
+
|
|
555
561
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
556
562
|
return {
|
|
557
563
|
options: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId],
|
|
@@ -573,7 +579,7 @@ var mapDispatchtoProps = {
|
|
|
573
579
|
};
|
|
574
580
|
var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(MultiDropdownList), {
|
|
575
581
|
componentType: componentTypes.multiDropdownList,
|
|
576
|
-
internalComponent:
|
|
582
|
+
internalComponent: MultiDropdownList.hasInternalComponent()
|
|
577
583
|
});
|
|
578
584
|
|
|
579
585
|
MultiDropdownList.install = function (Vue) {
|
package/dist/es/MultiList.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, n as isEvent, o as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { T as Title } from './Title-
|
|
14
|
-
import { I as Input } from './Input-
|
|
15
|
-
import { C as Container } from './Container-
|
|
11
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, n as isEvent, o as parseValueArray, g as getComponent, h as hasCustomRenderer, c as connect } from './index-5daa8276.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
13
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
14
|
+
import { I as Input } from './Input-d8519224.js';
|
|
15
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
16
16
|
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
17
|
-
import { U as UL, C as Checkbox } from './FormControlList-
|
|
18
|
-
import { g as getAggsQuery } from './utils-
|
|
17
|
+
import { U as UL, C as Checkbox } from './FormControlList-fe389a2e.js';
|
|
18
|
+
import { g as getAggsQuery } from './utils-3a32e13f.js';
|
|
19
19
|
|
|
20
20
|
var updateQuery = Actions.updateQuery,
|
|
21
21
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -25,7 +25,8 @@ var isEqual = helper.isEqual,
|
|
|
25
25
|
getQueryOptions = helper.getQueryOptions,
|
|
26
26
|
checkValueChange = helper.checkValueChange,
|
|
27
27
|
getClassName = helper.getClassName,
|
|
28
|
-
|
|
28
|
+
extractQueryFromCustomQuery = helper.extractQueryFromCustomQuery,
|
|
29
|
+
getOptionsForCustomQuery = helper.getOptionsForCustomQuery;
|
|
29
30
|
var MultiList = {
|
|
30
31
|
name: 'MultiList',
|
|
31
32
|
props: {
|
|
@@ -84,13 +85,14 @@ var MultiList = {
|
|
|
84
85
|
},
|
|
85
86
|
beforeMount: function beforeMount() {
|
|
86
87
|
this.updateQueryHandlerOptions(this.$props);
|
|
88
|
+
var value = this.selectedValue || this.$props.value || this.$props.defaultValue;
|
|
89
|
+
this.setValue(value, !this.selectedValue);
|
|
90
|
+
},
|
|
91
|
+
mounted: function mounted() {
|
|
92
|
+
var currentValue = Object.keys(this.$data.currentValue);
|
|
87
93
|
|
|
88
|
-
if (this.
|
|
89
|
-
this
|
|
90
|
-
} else if (this.$props.value) {
|
|
91
|
-
this.setValue(this.$props.value, true);
|
|
92
|
-
} else if (this.$props.defaultValue) {
|
|
93
|
-
this.setValue(this.$props.defaultValue, true);
|
|
94
|
+
if (this.$props.value !== undefined && !isEqual(this.$props.value, currentValue)) {
|
|
95
|
+
this.$emit('change', currentValue);
|
|
94
96
|
}
|
|
95
97
|
},
|
|
96
98
|
watch: {
|
|
@@ -135,7 +137,11 @@ var MultiList = {
|
|
|
135
137
|
}
|
|
136
138
|
|
|
137
139
|
if (!isEqual(selectedValue, newVal)) {
|
|
138
|
-
this.
|
|
140
|
+
if (this.value === undefined) {
|
|
141
|
+
this.setValue(newVal, true);
|
|
142
|
+
} else {
|
|
143
|
+
this.$emit('change', newVal);
|
|
144
|
+
}
|
|
139
145
|
}
|
|
140
146
|
},
|
|
141
147
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
@@ -339,12 +345,13 @@ var MultiList = {
|
|
|
339
345
|
|
|
340
346
|
if (this.defaultQuery) {
|
|
341
347
|
var defaultQueryToBeSet = this.defaultQuery(value, props) || {};
|
|
348
|
+
var defaultQueryObj = extractQueryFromCustomQuery(defaultQueryToBeSet);
|
|
342
349
|
|
|
343
|
-
if (
|
|
344
|
-
query =
|
|
350
|
+
if (defaultQueryObj) {
|
|
351
|
+
query = defaultQueryObj;
|
|
345
352
|
}
|
|
346
353
|
|
|
347
|
-
defaultQueryOptions =
|
|
354
|
+
defaultQueryOptions = getOptionsForCustomQuery(defaultQueryToBeSet); // Update calculated default query in store
|
|
348
355
|
|
|
349
356
|
updateDefaultQuery(props.componentId, this.setDefaultQuery, props, value);
|
|
350
357
|
}
|
|
@@ -363,10 +370,9 @@ var MultiList = {
|
|
|
363
370
|
var customQueryOptions;
|
|
364
371
|
|
|
365
372
|
if (customQuery) {
|
|
366
|
-
var
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
customQueryOptions = getOptionsFromQuery(customQuery(value, props));
|
|
373
|
+
var customQueryCalc = customQuery(value, props);
|
|
374
|
+
query = extractQueryFromCustomQuery(customQueryCalc);
|
|
375
|
+
customQueryOptions = getOptionsForCustomQuery(customQueryCalc);
|
|
370
376
|
updateCustomQuery(props.componentId, this.setCustomQuery, props, value);
|
|
371
377
|
}
|
|
372
378
|
|
|
@@ -390,7 +396,7 @@ var MultiList = {
|
|
|
390
396
|
|
|
391
397
|
if (props.defaultQuery) {
|
|
392
398
|
var value = Object.keys(this.$data.currentValue);
|
|
393
|
-
var defaultQueryOptions =
|
|
399
|
+
var defaultQueryOptions = getOptionsForCustomQuery(props.defaultQuery(value, props));
|
|
394
400
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, defaultQueryOptions));
|
|
395
401
|
} else {
|
|
396
402
|
this.setQueryOptions(this.internalComponent, queryOptions);
|
|
@@ -434,7 +440,7 @@ var MultiList = {
|
|
|
434
440
|
if (value === undefined) {
|
|
435
441
|
this.setValue(currentValue);
|
|
436
442
|
} else {
|
|
437
|
-
var values = parseValueArray(value, currentValue);
|
|
443
|
+
var values = parseValueArray(value || [], currentValue);
|
|
438
444
|
this.$emit('change', values);
|
|
439
445
|
}
|
|
440
446
|
},
|
|
@@ -499,12 +505,12 @@ MultiList.defaultQuery = function (value, props) {
|
|
|
499
505
|
|
|
500
506
|
if (props.queryFormat === 'or') {
|
|
501
507
|
if (props.showMissing) {
|
|
502
|
-
var _type,
|
|
508
|
+
var _type, _ref;
|
|
503
509
|
|
|
504
510
|
var hasMissingTerm = value.includes(props.missingLabel);
|
|
505
|
-
var should = [(
|
|
511
|
+
var should = [(_ref = {}, _ref[type] = (_type = {}, _type[props.dataField] = value.filter(function (item) {
|
|
506
512
|
return item !== props.missingLabel;
|
|
507
|
-
}), _type),
|
|
513
|
+
}), _type), _ref)];
|
|
508
514
|
|
|
509
515
|
if (hasMissingTerm) {
|
|
510
516
|
should = should.concat({
|
|
@@ -531,9 +537,9 @@ MultiList.defaultQuery = function (value, props) {
|
|
|
531
537
|
} else {
|
|
532
538
|
// adds a sub-query with must as an array of objects for each term/value
|
|
533
539
|
var queryArray = value.map(function (item) {
|
|
534
|
-
var _type3,
|
|
540
|
+
var _type3, _ref2;
|
|
535
541
|
|
|
536
|
-
return
|
|
542
|
+
return _ref2 = {}, _ref2[type] = (_type3 = {}, _type3[props.dataField] = item, _type3), _ref2;
|
|
537
543
|
});
|
|
538
544
|
listQuery = {
|
|
539
545
|
bool: {
|
|
@@ -583,9 +589,14 @@ var mapDispatchtoProps = {
|
|
|
583
589
|
setCustomQuery: setCustomQuery,
|
|
584
590
|
setDefaultQuery: setDefaultQuery
|
|
585
591
|
};
|
|
592
|
+
|
|
593
|
+
MultiList.hasInternalComponent = function () {
|
|
594
|
+
return true;
|
|
595
|
+
};
|
|
596
|
+
|
|
586
597
|
var ListConnected = ComponentWrapper(connect(mapStateToProps, mapDispatchtoProps)(MultiList), {
|
|
587
598
|
componentType: componentTypes.multiList,
|
|
588
|
-
internalComponent:
|
|
599
|
+
internalComponent: MultiList.hasInternalComponent()
|
|
589
600
|
});
|
|
590
601
|
|
|
591
602
|
MultiList.install = function (Vue) {
|
package/dist/es/MultiRange.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose, c as _toPropertyKey } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { o as parseValueArray, f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import { T as Title } from './Title-
|
|
14
|
-
import { C as Container } from './Container-
|
|
15
|
-
import { U as UL, C as Checkbox } from './FormControlList-
|
|
11
|
+
import { o as parseValueArray, f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-5daa8276.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
13
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
14
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
15
|
+
import { U as UL, C as Checkbox } from './FormControlList-fe389a2e.js';
|
|
16
16
|
|
|
17
17
|
var updateQuery = Actions.updateQuery,
|
|
18
18
|
setQueryOptions = Actions.setQueryOptions,
|