@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
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { helper } from '@appbaseio/reactivecore';
|
|
2
|
+
import VueTypes from 'vue-types';
|
|
3
|
+
import { p as pagination, B as Button } from './Button-799185e2.js';
|
|
4
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
5
|
+
|
|
6
|
+
var getClassName = helper.getClassName,
|
|
7
|
+
handleA11yAction = helper.handleA11yAction;
|
|
8
|
+
|
|
9
|
+
function getStartPage(totalPages, currentPage, showEndPage) {
|
|
10
|
+
var midValue = parseInt(totalPages / 2, 10);
|
|
11
|
+
var start = currentPage - (showEndPage ? Math.ceil(midValue / 2) - 1 : midValue);
|
|
12
|
+
return start > 1 ? start : 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var Pagination = {
|
|
16
|
+
name: 'Pagination',
|
|
17
|
+
functional: true,
|
|
18
|
+
props: {
|
|
19
|
+
currentPage: types.number,
|
|
20
|
+
innerClass: types.style,
|
|
21
|
+
pages: types.number,
|
|
22
|
+
setPage: types.func,
|
|
23
|
+
totalPages: types.number,
|
|
24
|
+
showEndPage: VueTypes.bool,
|
|
25
|
+
prevLabel: types.string,
|
|
26
|
+
nextLabel: types.string
|
|
27
|
+
},
|
|
28
|
+
render: function render(createElement, context) {
|
|
29
|
+
var h = arguments[0];
|
|
30
|
+
var props = context.props;
|
|
31
|
+
|
|
32
|
+
var onPrevPage = function onPrevPage() {
|
|
33
|
+
if (props.currentPage) {
|
|
34
|
+
props.setPage(props.currentPage - 1);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var onNextPage = function onNextPage() {
|
|
39
|
+
if (props.currentPage < props.totalPages - 1) {
|
|
40
|
+
props.setPage(props.currentPage + 1);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
if (!props.totalPages) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var innerClassName = getClassName(props.innerClass, 'button');
|
|
49
|
+
var primary = props.currentPage === 0;
|
|
50
|
+
var className = innerClassName || primary ? innerClassName + " " + (primary ? 'active' : '') : '';
|
|
51
|
+
|
|
52
|
+
var buildPaginationDOM = function buildPaginationDOM(position) {
|
|
53
|
+
var pages = props.pages,
|
|
54
|
+
currentPage = props.currentPage,
|
|
55
|
+
totalPages = props.totalPages,
|
|
56
|
+
setPage = props.setPage,
|
|
57
|
+
showEndPage = props.showEndPage;
|
|
58
|
+
var start = position === 'start' ? getStartPage(pages, currentPage, showEndPage) : Math.max(2, Math.ceil(totalPages - (pages - 1) / 2 + 1));
|
|
59
|
+
var paginationButtons = [];
|
|
60
|
+
|
|
61
|
+
if (start <= totalPages) {
|
|
62
|
+
var totalPagesToShow = pages < totalPages ? start + (pages - 1) : totalPages + 1;
|
|
63
|
+
|
|
64
|
+
if (showEndPage) {
|
|
65
|
+
totalPagesToShow = position === 'start' ? start + (Math.ceil(pages / 2) - pages % 2) : totalPages + 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (currentPage > totalPages - pages + 2) {
|
|
69
|
+
start = Math.max(2, totalPages - pages + 2);
|
|
70
|
+
totalPagesToShow = start + pages;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
var _loop = function _loop(i) {
|
|
74
|
+
var activeButton = currentPage === i - 1;
|
|
75
|
+
var classNameBtn = innerClassName || activeButton ? innerClassName + " " + (activeButton ? 'active' : '') : '';
|
|
76
|
+
var pageBtn = h(Button, {
|
|
77
|
+
"class": classNameBtn,
|
|
78
|
+
"attrs": {
|
|
79
|
+
"primary": activeButton,
|
|
80
|
+
"tabIndex": "0",
|
|
81
|
+
"alt": "page-" + i
|
|
82
|
+
},
|
|
83
|
+
"on": {
|
|
84
|
+
"keyPress": function keyPress(event) {
|
|
85
|
+
return handleA11yAction(event, function () {
|
|
86
|
+
return setPage(i - 1);
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
"click": function click() {
|
|
90
|
+
return setPage(i - 1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}, [i]);
|
|
94
|
+
|
|
95
|
+
if (i <= totalPages + 1) {
|
|
96
|
+
paginationButtons.push(pageBtn);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
for (var i = start; i < Math.min(totalPages + 1, totalPagesToShow); i += 1) {
|
|
101
|
+
_loop(i);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return paginationButtons;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var buildIntermediatePaginationDom = function buildIntermediatePaginationDom() {
|
|
109
|
+
var showEndPage = props.showEndPage,
|
|
110
|
+
currentPage = props.currentPage,
|
|
111
|
+
totalPages = props.totalPages,
|
|
112
|
+
pages = props.pages;
|
|
113
|
+
if (!showEndPage) return buildPaginationDOM('start');
|
|
114
|
+
|
|
115
|
+
if (currentPage <= totalPages - pages + 2 || totalPages <= pages) {
|
|
116
|
+
return buildPaginationDOM('start');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return null;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return h("div", {
|
|
123
|
+
"class": pagination + " " + getClassName(props.innerClass, 'pagination')
|
|
124
|
+
}, [h(Button, {
|
|
125
|
+
"class": getClassName(props.innerClass, 'button') || '',
|
|
126
|
+
"attrs": {
|
|
127
|
+
"disabled": props.currentPage === 0,
|
|
128
|
+
"tabIndex": "0"
|
|
129
|
+
},
|
|
130
|
+
"on": {
|
|
131
|
+
"keyPress": function keyPress(event) {
|
|
132
|
+
return handleA11yAction(event, onPrevPage);
|
|
133
|
+
},
|
|
134
|
+
"click": onPrevPage
|
|
135
|
+
}
|
|
136
|
+
}, [props.prevLabel || 'Prev']), h(Button, {
|
|
137
|
+
"class": className,
|
|
138
|
+
"attrs": {
|
|
139
|
+
"primary": primary,
|
|
140
|
+
"tabIndex": "0"
|
|
141
|
+
},
|
|
142
|
+
"on": {
|
|
143
|
+
"keyPress": function keyPress(event) {
|
|
144
|
+
return handleA11yAction(event, function () {
|
|
145
|
+
return props.setPage(0);
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
"click": function click() {
|
|
149
|
+
return props.setPage(0);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, ["1"]), props.showEndPage && props.currentPage >= Math.floor(props.pages / 2) + !!(props.pages % 2) ? h("span", ["..."]) : null, buildIntermediatePaginationDom(), props.showEndPage && props.pages > 2 && props.currentPage <= props.totalPages - Math.ceil(props.pages * 0.75) ? h("span", ["..."]) : null, props.showEndPage && props.totalPages >= props.pages && buildPaginationDOM('end'), h(Button, {
|
|
153
|
+
"class": getClassName(props.innerClass, 'button') || '',
|
|
154
|
+
"attrs": {
|
|
155
|
+
"disabled": props.currentPage >= props.totalPages - 1,
|
|
156
|
+
"tabIndex": "0"
|
|
157
|
+
},
|
|
158
|
+
"on": {
|
|
159
|
+
"keyPress": function keyPress(event) {
|
|
160
|
+
return handleA11yAction(event, onNextPage);
|
|
161
|
+
},
|
|
162
|
+
"click": onNextPage
|
|
163
|
+
}
|
|
164
|
+
}, [props.nextLabel || 'Next'])]);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
Pagination.install = function (Vue) {
|
|
169
|
+
Vue.component(Pagination.name, Pagination);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export { Pagination as P };
|
package/dist/es/RangeInput.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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 { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import { css } from 'emotion';
|
|
6
6
|
import styled from '@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 { c as connect } from './index-
|
|
12
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
13
|
-
import './Title-
|
|
14
|
-
import { F as Flex } from './Flex-
|
|
15
|
-
import { I as Input } from './Input-
|
|
16
|
-
import { C as Container } from './Container-
|
|
11
|
+
import { c as connect } from './index-5daa8276.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
13
|
+
import './Title-579f8d6c.js';
|
|
14
|
+
import { F as Flex } from './Flex-aac91505.js';
|
|
15
|
+
import { I as Input } from './Input-d8519224.js';
|
|
16
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
17
17
|
import 'vue-no-ssr';
|
|
18
|
-
import './ssr-
|
|
18
|
+
import './ssr-e3196de1.js';
|
|
19
19
|
import { RangeConnected as RangeConnected$1 } from './RangeSlider.js';
|
|
20
20
|
|
|
21
21
|
var _templateObject, _templateObject2;
|
|
@@ -193,6 +193,10 @@ var RangeInput = {
|
|
|
193
193
|
if (this.$props.defaultValue && this.$props.defaultValue.start && this.$props.defaultValue.end) {
|
|
194
194
|
this.handleChange(this.$props.defaultValue);
|
|
195
195
|
}
|
|
196
|
+
|
|
197
|
+
if (this.isControlled()) {
|
|
198
|
+
this.handleChange(this.$props.value, 'change');
|
|
199
|
+
}
|
|
196
200
|
},
|
|
197
201
|
render: function render() {
|
|
198
202
|
var h = arguments[0];
|
package/dist/es/RangeSlider.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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 '@appbaseio/reactivecore/lib/utils/transform';
|
|
8
8
|
import 'redux';
|
|
9
|
-
import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-
|
|
10
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
11
|
-
import { T as Title } from './Title-
|
|
12
|
-
import { C as Container } from './Container-
|
|
9
|
+
import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-5daa8276.js';
|
|
10
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.js';
|
|
11
|
+
import { T as Title } from './Title-579f8d6c.js';
|
|
12
|
+
import { C as Container } from './Container-4383c6f0.js';
|
|
13
13
|
import NoSSR from 'vue-no-ssr';
|
|
14
|
-
import { g as getComponents, S as Slider } from './ssr-
|
|
14
|
+
import { g as getComponents, S as Slider } from './ssr-e3196de1.js';
|
|
15
15
|
|
|
16
16
|
var updateQuery = Actions.updateQuery,
|
|
17
17
|
setQueryOptions = Actions.setQueryOptions,
|
package/dist/es/ReactiveBase.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import configureStore, { Actions, 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 '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import { isEqual as isEqual$1 } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
6
6
|
import styled from '@appbaseio/vue-emotion';
|
|
7
|
-
import { t as types } from './vueTypes-
|
|
7
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
8
8
|
import 'redux';
|
|
9
|
-
import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-
|
|
9
|
+
import { c as connect, e as composeThemeObject, X as X_SEARCH_CLIENT } from './index-5daa8276.js';
|
|
10
10
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
11
11
|
import { updateAnalyticsConfig } from '@appbaseio/reactivecore/lib/actions/analytics';
|
|
12
12
|
import Appbase from 'appbase-js';
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends, b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-ecf6c03c.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
-
import { t as types } from './vueTypes-
|
|
5
|
+
import { t as types } from './vueTypes-9326e0be.js';
|
|
6
6
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
7
7
|
import 'redux';
|
|
8
|
-
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-
|
|
9
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
8
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, c as connect } from './index-5daa8276.js';
|
|
9
|
+
import { C as ComponentWrapper } from './ComponentWrapper-bbb717bc.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,8 +16,9 @@ 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: {
|
|
@@ -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,9 +84,9 @@ 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
91
|
if (options) {
|
|
103
92
|
_this.setQueryOptions(props.componentId, _extends({}, options, _this.getAggsQuery()), false);
|
|
@@ -107,17 +96,17 @@ var ReactiveComponent = {
|
|
|
107
96
|
|
|
108
97
|
if (obj && obj.query && obj.query.query) {
|
|
109
98
|
queryToBeSet = obj.query.query;
|
|
110
|
-
}
|
|
99
|
+
}
|
|
111
100
|
|
|
101
|
+
var customQueryCalc = _extends({}, options); // Update customQuery field for RS API
|
|
112
102
|
|
|
113
|
-
if (obj && obj.query || options) {
|
|
114
|
-
var customQueryCalc = _extends({}, options);
|
|
115
103
|
|
|
116
|
-
|
|
117
|
-
|
|
104
|
+
if (queryToBeSet || options) {
|
|
105
|
+
if (queryToBeSet.query) {
|
|
106
|
+
if (queryToBeSet.id) {
|
|
118
107
|
customQueryCalc = queryToBeSet;
|
|
119
108
|
} else {
|
|
120
|
-
customQueryCalc.query =
|
|
109
|
+
customQueryCalc.query = queryToBeSet;
|
|
121
110
|
}
|
|
122
111
|
}
|
|
123
112
|
|
|
@@ -125,6 +114,7 @@ var ReactiveComponent = {
|
|
|
125
114
|
}
|
|
126
115
|
|
|
127
116
|
_this.updateQuery(_extends({}, obj, {
|
|
117
|
+
query: customQueryCalc,
|
|
128
118
|
componentId: props.componentId,
|
|
129
119
|
label: props.filterLabel,
|
|
130
120
|
showFilter: props.showFilter,
|
|
@@ -140,24 +130,16 @@ var ReactiveComponent = {
|
|
|
140
130
|
if (this.internalComponent && this.$props.defaultQuery) {
|
|
141
131
|
updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
|
|
142
132
|
this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
|
|
143
|
-
|
|
144
|
-
var
|
|
145
|
-
query = _ref3.query,
|
|
146
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref3, _excluded2);
|
|
133
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
134
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
147
135
|
|
|
148
136
|
if (queryOptions) {
|
|
149
137
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
150
138
|
} else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
|
|
151
139
|
|
|
152
|
-
var queryToSet = query || null;
|
|
153
|
-
|
|
154
|
-
if (!queryToSet && this.$defaultQuery && this.$defaultQuery.id) {
|
|
155
|
-
queryToSet = this.$defaultQuery;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
140
|
this.updateQuery({
|
|
159
141
|
componentId: this.internalComponent,
|
|
160
|
-
query:
|
|
142
|
+
query: query
|
|
161
143
|
});
|
|
162
144
|
}
|
|
163
145
|
},
|
|
@@ -205,10 +187,8 @@ var ReactiveComponent = {
|
|
|
205
187
|
defaultQuery: function defaultQuery(newVal, oldVal) {
|
|
206
188
|
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
207
189
|
this.$defaultQuery = newVal(this.selectedValue, this.$props);
|
|
208
|
-
|
|
209
|
-
var
|
|
210
|
-
query = _ref4.query,
|
|
211
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref4, _excluded3);
|
|
190
|
+
var query = extractQueryFromCustomQuery(this.$defaultQuery);
|
|
191
|
+
var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
|
|
212
192
|
|
|
213
193
|
if (queryOptions) {
|
|
214
194
|
this.setQueryOptions(this.internalComponent, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
@@ -216,15 +196,9 @@ var ReactiveComponent = {
|
|
|
216
196
|
|
|
217
197
|
|
|
218
198
|
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
199
|
this.updateQuery({
|
|
226
200
|
componentId: this.internalComponent,
|
|
227
|
-
query:
|
|
201
|
+
query: query
|
|
228
202
|
});
|
|
229
203
|
}
|
|
230
204
|
},
|
|
@@ -232,10 +206,8 @@ var ReactiveComponent = {
|
|
|
232
206
|
if (newVal && !isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
|
|
233
207
|
var componentId = this.$props.componentId;
|
|
234
208
|
this.$customQuery = newVal(this.selectedValue, this.$props);
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
query = _ref5.query,
|
|
238
|
-
queryOptions = _objectWithoutPropertiesLoose(_ref5, _excluded4);
|
|
209
|
+
var query = extractQueryFromCustomQuery(this.$customQuery);
|
|
210
|
+
var queryOptions = getOptionsForCustomQuery(this.$customQuery);
|
|
239
211
|
|
|
240
212
|
if (queryOptions) {
|
|
241
213
|
this.setQueryOptions(componentId, _extends({}, queryOptions, this.getAggsQuery()), false);
|
|
@@ -243,15 +215,9 @@ var ReactiveComponent = {
|
|
|
243
215
|
|
|
244
216
|
|
|
245
217
|
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
218
|
this.updateQuery({
|
|
253
219
|
componentId: componentId,
|
|
254
|
-
query:
|
|
220
|
+
query: query
|
|
255
221
|
});
|
|
256
222
|
}
|
|
257
223
|
}
|
|
@@ -331,6 +297,10 @@ var ReactiveComponent = {
|
|
|
331
297
|
}
|
|
332
298
|
};
|
|
333
299
|
|
|
300
|
+
ReactiveComponent.hasInternalComponent = function (props) {
|
|
301
|
+
return !!props.defaultQuery;
|
|
302
|
+
};
|
|
303
|
+
|
|
334
304
|
var mapStateToProps = function mapStateToProps(state, props) {
|
|
335
305
|
return {
|
|
336
306
|
aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
|