@appbaseio/reactivesearch-vue 1.29.0 → 2.0.0-alpha
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 +11162 -762
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +21 -5
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-e0b7c1f6.js → Button-446f819e.js} +1 -1
- package/dist/cjs/{CancelSvg-4aa35935.js → CancelSvg-9f258f4f.js} +1 -1
- package/dist/cjs/{Card-fd94ef07.js → Card-642547a8.js} +2 -2
- package/dist/cjs/{ComponentWrapper-10bad289.js → ComponentWrapper-ad3dad02.js} +2 -2
- package/dist/cjs/{Container-526efa6a.js → Container-daf30918.js} +1 -1
- package/dist/cjs/{DataSearch-eec21890.js → DataSearch-6cf29cf0.js} +236 -84
- package/dist/cjs/DataSearch.js +10 -10
- package/dist/cjs/{DropDown-e4381fcc.js → DropDown-c479bbb0.js} +5 -5
- package/dist/cjs/DynamicRangeSlider.js +8 -7
- package/dist/cjs/{Flex-f146cdad.js → Flex-aa517a13.js} +1 -1
- package/dist/cjs/{FormControlList-808dbcef.js → FormControlList-c195a592.js} +1 -1
- package/dist/cjs/{Input-0d7b25ad.js → Input-e6603a7e.js} +1 -1
- package/dist/cjs/{ListItem-b40adb04.js → ListItem-8c9e0d68.js} +2 -2
- package/dist/cjs/MultiDropdownList.js +13 -12
- package/dist/cjs/MultiList.js +11 -10
- package/dist/cjs/MultiRange.js +9 -8
- package/dist/cjs/Pagination-71e85fa9.js +182 -0
- package/dist/cjs/RangeInput.js +11 -10
- package/dist/cjs/RangeSlider.js +9 -8
- package/dist/cjs/ReactiveBase.js +69 -35
- package/dist/cjs/ReactiveComponent.js +6 -5
- package/dist/cjs/ReactiveGoogleMap.js +2336 -0
- package/dist/cjs/ReactiveList.js +22 -185
- package/dist/cjs/ResultCard.js +4 -4
- package/dist/cjs/ResultList.js +4 -4
- package/dist/cjs/SelectedFilters.js +45 -28
- package/dist/cjs/SingleDropdownList.js +13 -12
- package/dist/cjs/SingleList.js +11 -10
- package/dist/cjs/SingleRange.js +10 -9
- package/dist/cjs/StateProvider.js +30 -5
- package/dist/cjs/{Title-584a8cc8.js → Title-1de7d0f4.js} +1 -1
- package/dist/cjs/ToggleButton.js +10 -8
- package/dist/cjs/{_rollupPluginBabelHelpers-f127c8b7.js → _rollupPluginBabelHelpers-c705cbe6.js} +17 -2
- package/dist/cjs/{index-4509aa45.js → index-6a167fe0.js} +13 -1
- package/dist/cjs/index.js +24 -18
- package/dist/cjs/initReactivesearch.js +40 -8
- package/dist/cjs/{install-4886582d.js → install-99716d95.js} +252 -87
- package/dist/cjs/install.js +20 -18
- package/dist/cjs/{ssr-0ee35a09.js → ssr-3027b848.js} +1 -1
- package/dist/cjs/{utils-1219e1fe.js → utils-d6a52588.js} +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-57d01f18.js → vueTypes-727b7c63.js} +30 -13
- package/dist/es/{Button-33de88e6.js → Button-d8bc15ea.js} +1 -1
- package/dist/es/{CancelSvg-c2c03a35.js → CancelSvg-4cfae5fd.js} +1 -1
- package/dist/es/{Card-6446f1b7.js → Card-450683f1.js} +2 -2
- package/dist/es/{ComponentWrapper-0f3431d1.js → ComponentWrapper-424e86fd.js} +2 -2
- package/dist/es/{Container-18b03fde.js → Container-ba826e96.js} +1 -1
- package/dist/es/{DataSearch-42f547cd.js → DataSearch-4888aa43.js} +236 -86
- package/dist/es/DataSearch.js +10 -10
- package/dist/es/{DropDown-ff6ad982.js → DropDown-05a644a5.js} +5 -5
- package/dist/es/DynamicRangeSlider.js +8 -7
- package/dist/es/{Flex-8770345d.js → Flex-1f0795c3.js} +1 -1
- package/dist/es/{FormControlList-704f8dee.js → FormControlList-c22d64f6.js} +1 -1
- package/dist/es/{Input-e339e63a.js → Input-7a2a9fac.js} +1 -1
- package/dist/es/{ListItem-8e8fb535.js → ListItem-cad14c5e.js} +2 -2
- package/dist/es/MultiDropdownList.js +13 -12
- package/dist/es/MultiList.js +11 -10
- package/dist/es/MultiRange.js +9 -8
- package/dist/es/Pagination-784bf143.js +177 -0
- package/dist/es/RangeInput.js +11 -10
- package/dist/es/RangeSlider.js +9 -8
- package/dist/es/ReactiveBase.js +70 -36
- package/dist/es/ReactiveComponent.js +6 -5
- package/dist/es/ReactiveGoogleMap.js +2327 -0
- package/dist/es/ReactiveList.js +21 -184
- package/dist/es/ResultCard.js +4 -4
- package/dist/es/ResultList.js +4 -4
- package/dist/es/SelectedFilters.js +45 -28
- package/dist/es/SingleDropdownList.js +13 -12
- package/dist/es/SingleList.js +11 -10
- package/dist/es/SingleRange.js +10 -9
- package/dist/es/StateProvider.js +30 -5
- package/dist/es/{Title-3522ff56.js → Title-3342664a.js} +1 -1
- package/dist/es/ToggleButton.js +10 -8
- package/dist/es/{_rollupPluginBabelHelpers-0f24d612.js → _rollupPluginBabelHelpers-76660dab.js} +17 -3
- package/dist/es/{index-78920565.js → index-7788a843.js} +13 -2
- package/dist/es/index.js +24 -19
- package/dist/es/initReactivesearch.js +41 -9
- package/dist/es/{install-54ebd72e.js → install-87984085.js} +252 -87
- package/dist/es/install.js +20 -18
- package/dist/es/{ssr-a41dfea9.js → ssr-b2c0b401.js} +1 -1
- package/dist/es/{utils-64a2e5f0.js → utils-9e68acee.js} +1 -1
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-687b2304.js → vueTypes-b8146772.js} +30 -13
- package/package.json +11 -5
package/dist/es/ReactiveList.js
CHANGED
|
@@ -1,188 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
+
import { _ as _taggedTemplateLiteralLoose, a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import { withClickIds } from '@appbaseio/reactivecore/lib/utils/helper';
|
|
6
6
|
import { css } from 'emotion';
|
|
7
7
|
import styled from '@appbaseio/vue-emotion';
|
|
8
8
|
import 'polished';
|
|
9
|
-
import
|
|
10
|
-
import { t as types } from './vueTypes-
|
|
9
|
+
import './Button-d8bc15ea.js';
|
|
10
|
+
import { t as types } from './vueTypes-b8146772.js';
|
|
11
|
+
import { P as Pagination } from './Pagination-784bf143.js';
|
|
11
12
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
12
13
|
import 'redux';
|
|
13
|
-
import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-
|
|
14
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
14
|
+
import { c as connect, h as hasCustomRenderer, i as isQueryIdentical, u as updateDefaultQuery, a as isFunction, g as getComponent } from './index-7788a843.js';
|
|
15
|
+
import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
|
|
15
16
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
16
|
-
import './Title-
|
|
17
|
-
import { c as container } from './ListItem-
|
|
18
|
-
import { c as container$1 } from './Card-
|
|
19
|
-
import { F as Flex } from './Flex-
|
|
20
|
-
|
|
21
|
-
var getClassName = helper.getClassName,
|
|
22
|
-
handleA11yAction = helper.handleA11yAction;
|
|
23
|
-
|
|
24
|
-
function getStartPage(totalPages, currentPage, showEndPage) {
|
|
25
|
-
var midValue = parseInt(totalPages / 2, 10);
|
|
26
|
-
var start = currentPage - (showEndPage ? Math.ceil(midValue / 2) - 1 : midValue);
|
|
27
|
-
return start > 1 ? start : 2;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var Pagination = {
|
|
31
|
-
name: 'Pagination',
|
|
32
|
-
functional: true,
|
|
33
|
-
props: {
|
|
34
|
-
currentPage: types.number,
|
|
35
|
-
innerClass: types.style,
|
|
36
|
-
pages: types.number,
|
|
37
|
-
setPage: types.func,
|
|
38
|
-
totalPages: types.number,
|
|
39
|
-
showEndPage: VueTypes.bool,
|
|
40
|
-
prevLabel: types.string,
|
|
41
|
-
nextLabel: types.string
|
|
42
|
-
},
|
|
43
|
-
render: function render(createElement, context) {
|
|
44
|
-
var h = arguments[0];
|
|
45
|
-
var props = context.props;
|
|
46
|
-
|
|
47
|
-
var onPrevPage = function onPrevPage() {
|
|
48
|
-
if (props.currentPage) {
|
|
49
|
-
props.setPage(props.currentPage - 1);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
var onNextPage = function onNextPage() {
|
|
54
|
-
if (props.currentPage < props.totalPages - 1) {
|
|
55
|
-
props.setPage(props.currentPage + 1);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
if (!props.totalPages) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
var innerClassName = getClassName(props.innerClass, 'button');
|
|
64
|
-
var primary = props.currentPage === 0;
|
|
65
|
-
var className = innerClassName || primary ? innerClassName + " " + (primary ? 'active' : '') : '';
|
|
66
|
-
|
|
67
|
-
var buildPaginationDOM = function buildPaginationDOM(position) {
|
|
68
|
-
var pages = props.pages,
|
|
69
|
-
currentPage = props.currentPage,
|
|
70
|
-
totalPages = props.totalPages,
|
|
71
|
-
setPage = props.setPage,
|
|
72
|
-
showEndPage = props.showEndPage;
|
|
73
|
-
var start = position === 'start' ? getStartPage(pages, currentPage, showEndPage) : Math.max(2, Math.ceil(totalPages - (pages - 1) / 2 + 1));
|
|
74
|
-
var paginationButtons = [];
|
|
75
|
-
|
|
76
|
-
if (start <= totalPages) {
|
|
77
|
-
var totalPagesToShow = pages < totalPages ? start + (pages - 1) : totalPages + 1;
|
|
78
|
-
|
|
79
|
-
if (showEndPage) {
|
|
80
|
-
totalPagesToShow = position === 'start' ? start + (Math.ceil(pages / 2) - pages % 2) : totalPages + 1;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (currentPage > totalPages - pages + 2) {
|
|
84
|
-
start = Math.max(2, totalPages - pages + 2);
|
|
85
|
-
totalPagesToShow = start + pages;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
var _loop = function _loop(i) {
|
|
89
|
-
var activeButton = currentPage === i - 1;
|
|
90
|
-
var classNameBtn = innerClassName || activeButton ? innerClassName + " " + (activeButton ? 'active' : '') : '';
|
|
91
|
-
var pageBtn = h(Button, {
|
|
92
|
-
"class": classNameBtn,
|
|
93
|
-
"attrs": {
|
|
94
|
-
"primary": activeButton,
|
|
95
|
-
"tabIndex": "0",
|
|
96
|
-
"alt": "page-" + i
|
|
97
|
-
},
|
|
98
|
-
"on": {
|
|
99
|
-
"keyPress": function keyPress(event) {
|
|
100
|
-
return handleA11yAction(event, function () {
|
|
101
|
-
return setPage(i - 1);
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
"click": function click() {
|
|
105
|
-
return setPage(i - 1);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}, [i]);
|
|
109
|
-
|
|
110
|
-
if (i <= totalPages + 1) {
|
|
111
|
-
paginationButtons.push(pageBtn);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
for (var i = start; i < Math.min(totalPages + 1, totalPagesToShow); i += 1) {
|
|
116
|
-
_loop(i);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return paginationButtons;
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
var buildIntermediatePaginationDom = function buildIntermediatePaginationDom() {
|
|
124
|
-
var showEndPage = props.showEndPage,
|
|
125
|
-
currentPage = props.currentPage,
|
|
126
|
-
totalPages = props.totalPages,
|
|
127
|
-
pages = props.pages;
|
|
128
|
-
if (!showEndPage) return buildPaginationDOM('start');
|
|
129
|
-
|
|
130
|
-
if (currentPage <= totalPages - pages + 2 || totalPages <= pages) {
|
|
131
|
-
return buildPaginationDOM('start');
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return null;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
return h("div", {
|
|
138
|
-
"class": pagination + " " + getClassName(props.innerClass, 'pagination')
|
|
139
|
-
}, [h(Button, {
|
|
140
|
-
"class": getClassName(props.innerClass, 'button') || '',
|
|
141
|
-
"attrs": {
|
|
142
|
-
"disabled": props.currentPage === 0,
|
|
143
|
-
"tabIndex": "0"
|
|
144
|
-
},
|
|
145
|
-
"on": {
|
|
146
|
-
"keyPress": function keyPress(event) {
|
|
147
|
-
return handleA11yAction(event, onPrevPage);
|
|
148
|
-
},
|
|
149
|
-
"click": onPrevPage
|
|
150
|
-
}
|
|
151
|
-
}, [props.prevLabel || 'Prev']), h(Button, {
|
|
152
|
-
"class": className,
|
|
153
|
-
"attrs": {
|
|
154
|
-
"primary": primary,
|
|
155
|
-
"tabIndex": "0"
|
|
156
|
-
},
|
|
157
|
-
"on": {
|
|
158
|
-
"keyPress": function keyPress(event) {
|
|
159
|
-
return handleA11yAction(event, function () {
|
|
160
|
-
return props.setPage(0);
|
|
161
|
-
});
|
|
162
|
-
},
|
|
163
|
-
"click": function click() {
|
|
164
|
-
return props.setPage(0);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, ["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, {
|
|
168
|
-
"class": getClassName(props.innerClass, 'button') || '',
|
|
169
|
-
"attrs": {
|
|
170
|
-
"disabled": props.currentPage >= props.totalPages - 1,
|
|
171
|
-
"tabIndex": "0"
|
|
172
|
-
},
|
|
173
|
-
"on": {
|
|
174
|
-
"keyPress": function keyPress(event) {
|
|
175
|
-
return handleA11yAction(event, onNextPage);
|
|
176
|
-
},
|
|
177
|
-
"click": onNextPage
|
|
178
|
-
}
|
|
179
|
-
}, [props.nextLabel || 'Next'])]);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
Pagination.install = function (Vue) {
|
|
184
|
-
Vue.component(Pagination.name, Pagination);
|
|
185
|
-
};
|
|
17
|
+
import './Title-3342664a.js';
|
|
18
|
+
import { c as container } from './ListItem-cad14c5e.js';
|
|
19
|
+
import { c as container$1 } from './Card-450683f1.js';
|
|
20
|
+
import { F as Flex } from './Flex-1f0795c3.js';
|
|
186
21
|
|
|
187
22
|
var _templateObject;
|
|
188
23
|
var PoweredByImage = styled('img')(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\twidth: 110px;\n"])));
|
|
@@ -427,7 +262,7 @@ var setQueryOptions = Actions.setQueryOptions,
|
|
|
427
262
|
recordResultClick = Actions.recordResultClick;
|
|
428
263
|
var isEqual$1 = helper.isEqual,
|
|
429
264
|
getQueryOptions = helper.getQueryOptions,
|
|
430
|
-
getClassName
|
|
265
|
+
getClassName = helper.getClassName,
|
|
431
266
|
parseHits = helper.parseHits,
|
|
432
267
|
getCompositeAggsQuery = helper.getCompositeAggsQuery,
|
|
433
268
|
getResultStats = helper.getResultStats,
|
|
@@ -544,7 +379,8 @@ var ReactiveList = {
|
|
|
544
379
|
nextLabel: types.string,
|
|
545
380
|
distinctField: types.string,
|
|
546
381
|
distinctFieldConfig: types.props,
|
|
547
|
-
index: VueTypes.string
|
|
382
|
+
index: VueTypes.string,
|
|
383
|
+
endpoint: types.endpointConfig
|
|
548
384
|
},
|
|
549
385
|
computed: {
|
|
550
386
|
shouldRenderPagination: function shouldRenderPagination() {
|
|
@@ -793,7 +629,7 @@ var ReactiveList = {
|
|
|
793
629
|
"attrs": {
|
|
794
630
|
"labelPosition": this.sortOptions ? 'right' : 'left'
|
|
795
631
|
},
|
|
796
|
-
"class": getClassName
|
|
632
|
+
"class": getClassName(this.$props.innerClass, 'resultsInfo')
|
|
797
633
|
}, [this.sortOptions ? this.renderSortOptions() : null, this.$props.showResultStats && results.length ? this.renderStats() : null]), !this.isLoading && hits && hits.length === 0 ? this.renderNoResult() : null, this.shouldRenderPagination && (this.$props.paginationAt === 'top' || this.$props.paginationAt === 'both') ? h(Pagination, {
|
|
798
634
|
"attrs": {
|
|
799
635
|
"pages": this.$props.pages,
|
|
@@ -825,7 +661,7 @@ var ReactiveList = {
|
|
|
825
661
|
"attrs": {
|
|
826
662
|
"direction": "row-reverse"
|
|
827
663
|
},
|
|
828
|
-
"class": getClassName
|
|
664
|
+
"class": getClassName(this.$props.innerClass, 'poweredBy')
|
|
829
665
|
}, [h(PoweredBy)]) : null]);
|
|
830
666
|
},
|
|
831
667
|
methods: {
|
|
@@ -845,10 +681,11 @@ var ReactiveList = {
|
|
|
845
681
|
var size = this.$props.size;
|
|
846
682
|
var renderItem = this.$scopedSlots.renderItem || this.$props.renderItem;
|
|
847
683
|
var element = this.hasCustomRender ? this.getComponent() : h("div", {
|
|
848
|
-
"class": this.$props.listClass + " " + getClassName
|
|
684
|
+
"class": this.$props.listClass + " " + getClassName(this.$props.innerClass, 'list')
|
|
849
685
|
}, [this.data.map(function (item, index) {
|
|
850
686
|
return renderItem({
|
|
851
687
|
item: item,
|
|
688
|
+
count: _this2.currentPageState * size + index + 1,
|
|
852
689
|
triggerClickAnalytics: function triggerClickAnalytics() {
|
|
853
690
|
return _this2.triggerClickAnalytics(_this2.currentPageState * size + index);
|
|
854
691
|
}
|
|
@@ -963,7 +800,7 @@ var ReactiveList = {
|
|
|
963
800
|
|
|
964
801
|
if (this.stats.numberOfResults) {
|
|
965
802
|
return h("p", {
|
|
966
|
-
"class": resultStats + " " + getClassName
|
|
803
|
+
"class": resultStats + " " + getClassName(this.$props.innerClass, 'resultStats')
|
|
967
804
|
}, [this.stats.numberOfResults, " results found in ", this.stats.time || 0, "ms"]);
|
|
968
805
|
}
|
|
969
806
|
|
|
@@ -978,7 +815,7 @@ var ReactiveList = {
|
|
|
978
815
|
}
|
|
979
816
|
|
|
980
817
|
return h("p", {
|
|
981
|
-
"class": getClassName
|
|
818
|
+
"class": getClassName(this.$props.innerClass, 'noResults') || null
|
|
982
819
|
}, [isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
|
|
983
820
|
},
|
|
984
821
|
handleSortChange: function handleSortChange(e) {
|
|
@@ -1030,7 +867,7 @@ var ReactiveList = {
|
|
|
1030
867
|
renderSortOptions: function renderSortOptions() {
|
|
1031
868
|
var h = this.$createElement;
|
|
1032
869
|
return h("select", {
|
|
1033
|
-
"class": sortOptions + " " + getClassName
|
|
870
|
+
"class": sortOptions + " " + getClassName(this.$props.innerClass, 'sortOptions'),
|
|
1034
871
|
"attrs": {
|
|
1035
872
|
"name": "sort-options",
|
|
1036
873
|
"aria-label": "Sort options"
|
package/dist/es/ResultCard.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
2
2
|
import VueTypes from 'vue-types';
|
|
3
3
|
import 'emotion';
|
|
4
4
|
import '@appbaseio/vue-emotion';
|
|
5
5
|
import 'polished';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-b8146772.js';
|
|
7
7
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
8
|
-
import { T as Title } from './Title-
|
|
9
|
-
import { I as Image, C as Card } from './Card-
|
|
8
|
+
import { T as Title } from './Title-3342664a.js';
|
|
9
|
+
import { I as Image, C as Card } from './Card-450683f1.js';
|
|
10
10
|
|
|
11
11
|
var ResultCardTitle = {
|
|
12
12
|
name: 'ResultCardTitle',
|
package/dist/es/ResultList.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-
|
|
1
|
+
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
2
2
|
import VueTypes from 'vue-types';
|
|
3
3
|
import 'emotion';
|
|
4
4
|
import '@appbaseio/vue-emotion';
|
|
5
5
|
import 'polished';
|
|
6
|
-
import { t as types } from './vueTypes-
|
|
6
|
+
import { t as types } from './vueTypes-b8146772.js';
|
|
7
7
|
import _mergeJSXProps from '@vue/babel-helper-vue-jsx-merge-props';
|
|
8
|
-
import { T as Title } from './Title-
|
|
9
|
-
import { I as Image, L as ListItem } from './ListItem-
|
|
8
|
+
import { T as Title } from './Title-3342664a.js';
|
|
9
|
+
import { I as Image, L as ListItem } from './ListItem-cad14c5e.js';
|
|
10
10
|
|
|
11
11
|
var ResultListContent = {
|
|
12
12
|
name: 'ResultListContent',
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import 'emotion';
|
|
6
6
|
import '@appbaseio/vue-emotion';
|
|
7
7
|
import 'polished';
|
|
8
|
-
import { f as filters, B as Button } from './Button-
|
|
9
|
-
import { t as types } from './vueTypes-
|
|
8
|
+
import { f as filters, B as Button } from './Button-d8bc15ea.js';
|
|
9
|
+
import { t as types } from './vueTypes-b8146772.js';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { c as connect } from './index-
|
|
12
|
-
import { T as Title } from './Title-
|
|
13
|
-
import { C as Container } from './Container-
|
|
11
|
+
import { n as decodeHtml, c as connect } from './index-7788a843.js';
|
|
12
|
+
import { T as Title } from './Title-3342664a.js';
|
|
13
|
+
import { C as Container } from './Container-ba826e96.js';
|
|
14
14
|
|
|
15
15
|
var setValue = Actions.setValue,
|
|
16
16
|
clearValues = Actions.clearValues,
|
|
@@ -44,6 +44,7 @@ var SelectedFilters = {
|
|
|
44
44
|
components: this.components,
|
|
45
45
|
selectedValues: this.selectedValues,
|
|
46
46
|
clearValues: this.clearValues,
|
|
47
|
+
clearValue: this.clearValue,
|
|
47
48
|
setValue: this.setValue,
|
|
48
49
|
resetValuesToDefault: this.resetValuesToDefault
|
|
49
50
|
});
|
|
@@ -55,7 +56,7 @@ var SelectedFilters = {
|
|
|
55
56
|
"class": filters(this.theme) + " " + (this.$props.className || '')
|
|
56
57
|
}, [this.$props.title && hasValues && h(Title, {
|
|
57
58
|
"class": getClassName(this.$props.innerClass, 'title') || ''
|
|
58
|
-
}, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues ? h(Button, {
|
|
59
|
+
}, [this.$props.title]), filtersToRender, this.$props.showClearAll && hasValues && filtersToRender.length > 1 ? h(Button, {
|
|
59
60
|
"class": getClassName(this.$props.innerClass, 'button') || '',
|
|
60
61
|
"on": _extends({}, {
|
|
61
62
|
click: this.clearValues,
|
|
@@ -92,6 +93,20 @@ var SelectedFilters = {
|
|
|
92
93
|
|
|
93
94
|
this.$emit('clear', resetToValues);
|
|
94
95
|
},
|
|
96
|
+
clearValue: function clearValue(componentId) {
|
|
97
|
+
var resetToDefault = this.resetToDefault,
|
|
98
|
+
resetToValues = this.resetToValues;
|
|
99
|
+
|
|
100
|
+
if (resetToDefault) {
|
|
101
|
+
this.resetValuesToDefault(this.components.filter(function (component) {
|
|
102
|
+
return component !== componentId;
|
|
103
|
+
}));
|
|
104
|
+
} else {
|
|
105
|
+
this.setValue(componentId, (resetToValues == null ? void 0 : resetToValues[componentId]) || null);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
this.$emit('clear', resetToValues == null ? void 0 : resetToValues[componentId]);
|
|
109
|
+
},
|
|
95
110
|
renderValue: function renderValue(value, isArray) {
|
|
96
111
|
var _this2 = this;
|
|
97
112
|
|
|
@@ -115,39 +130,41 @@ var SelectedFilters = {
|
|
|
115
130
|
|
|
116
131
|
return value;
|
|
117
132
|
},
|
|
133
|
+
renderFilterButton: function renderFilterButton(component, keyProp, handleRemove, label) {
|
|
134
|
+
var h = this.$createElement;
|
|
135
|
+
return h(Button, {
|
|
136
|
+
"class": getClassName(this.$props.innerClass, 'button') || '',
|
|
137
|
+
"key": keyProp,
|
|
138
|
+
"on": _extends({}, {
|
|
139
|
+
click: handleRemove,
|
|
140
|
+
keypress: function keypress(event) {
|
|
141
|
+
return handleA11yAction(event, handleRemove);
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
"attrs": {
|
|
145
|
+
"tabIndex": "0"
|
|
146
|
+
}
|
|
147
|
+
}, [h("span", [label]), h("span", ["\u2715"])]);
|
|
148
|
+
},
|
|
118
149
|
renderFilters: function renderFilters() {
|
|
119
150
|
var _this3 = this;
|
|
120
151
|
|
|
121
|
-
var h = this.$createElement;
|
|
122
152
|
var selectedValues = this.selectedValues;
|
|
123
|
-
|
|
153
|
+
var filterComponents = Object.keys(selectedValues).filter(function (id) {
|
|
124
154
|
return _this3.components.includes(id) && selectedValues[id].showFilter;
|
|
125
|
-
})
|
|
155
|
+
});
|
|
156
|
+
return filterComponents.map(function (component, index) {
|
|
126
157
|
var _selectedValues$compo = selectedValues[component],
|
|
127
158
|
label = _selectedValues$compo.label,
|
|
128
159
|
value = _selectedValues$compo.value;
|
|
129
|
-
var isArray = Array.isArray(value);
|
|
160
|
+
var isArray = Array.isArray(value); // default behaviour
|
|
130
161
|
|
|
131
162
|
if (label && (isArray && value.length || !isArray && value)) {
|
|
132
163
|
var valueToRender = _this3.renderValue(value, isArray);
|
|
133
164
|
|
|
134
|
-
return
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"on": _extends({}, {
|
|
138
|
-
click: function click() {
|
|
139
|
-
return _this3.remove(component, value);
|
|
140
|
-
},
|
|
141
|
-
keypress: function keypress(event) {
|
|
142
|
-
return handleA11yAction(event, function () {
|
|
143
|
-
return _this3.remove(component, value);
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
}),
|
|
147
|
-
"attrs": {
|
|
148
|
-
"tabIndex": "0"
|
|
149
|
-
}
|
|
150
|
-
}, [h("span", [selectedValues[component].label, ": ", valueToRender]), h("span", ["\u2715"])]);
|
|
165
|
+
return _this3.renderFilterButton(component, component + "-" + (index + 1), function () {
|
|
166
|
+
return _this3.remove(component, value);
|
|
167
|
+
}, selectedValues[component].label + ": " + decodeHtml(valueToRender));
|
|
151
168
|
}
|
|
152
169
|
|
|
153
170
|
return null;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import '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-d8bc15ea.js';
|
|
9
|
+
import { t as types } from './vueTypes-b8146772.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, g as getComponent, h as hasCustomRenderer, c as connect } from './index-
|
|
13
|
-
import { C as ComponentWrapper } from './ComponentWrapper-
|
|
12
|
+
import { f as updateCustomQuery, u as updateDefaultQuery, i as isQueryIdentical, a as isFunction, g as getComponent, h as hasCustomRenderer, c as connect } from './index-7788a843.js';
|
|
13
|
+
import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
|
|
14
14
|
import '@vue/babel-helper-vue-jsx-merge-props';
|
|
15
|
-
import { T as Title } from './Title-
|
|
16
|
-
import './CancelSvg-
|
|
17
|
-
import './Input-
|
|
15
|
+
import { T as Title } from './Title-3342664a.js';
|
|
16
|
+
import './CancelSvg-4cfae5fd.js';
|
|
17
|
+
import './Input-7a2a9fac.js';
|
|
18
18
|
import 'compute-scroll-into-view';
|
|
19
|
-
import { C as Container } from './Container-
|
|
19
|
+
import { C as Container } from './Container-ba826e96.js';
|
|
20
20
|
import '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
21
|
-
import { g as getAggsQuery } from './utils-
|
|
22
|
-
import { D as Dropdown } from './DropDown-
|
|
21
|
+
import { g as getAggsQuery } from './utils-9e68acee.js';
|
|
22
|
+
import { D as Dropdown } from './DropDown-05a644a5.js';
|
|
23
23
|
|
|
24
24
|
var updateQuery = Actions.updateQuery,
|
|
25
25
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -81,7 +81,8 @@ var SingleDropdownList = {
|
|
|
81
81
|
loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
|
|
82
82
|
nestedField: types.string,
|
|
83
83
|
index: VueTypes.string,
|
|
84
|
-
searchPlaceholder: VueTypes.string.def('Type here to search...')
|
|
84
|
+
searchPlaceholder: VueTypes.string.def('Type here to search...'),
|
|
85
|
+
endpoint: types.endpointConfig
|
|
85
86
|
},
|
|
86
87
|
created: function created() {
|
|
87
88
|
if (!this.enableAppbase && this.$props.index) {
|
package/dist/es/SingleList.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import { componentTypes } from '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
5
|
import '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-b8146772.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, g as getComponent,
|
|
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, g as getComponent, o as isEvent, h as hasCustomRenderer, c as connect } from './index-7788a843.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
|
|
13
|
+
import { T as Title } from './Title-3342664a.js';
|
|
14
|
+
import { I as Input } from './Input-7a2a9fac.js';
|
|
15
|
+
import { C as Container } from './Container-ba826e96.js';
|
|
16
16
|
import { replaceDiacritics } from '@appbaseio/reactivecore/lib/utils/suggestions';
|
|
17
|
-
import { U as UL, R as Radio } from './FormControlList-
|
|
18
|
-
import { g as getAggsQuery } from './utils-
|
|
17
|
+
import { U as UL, R as Radio } from './FormControlList-c22d64f6.js';
|
|
18
|
+
import { g as getAggsQuery } from './utils-9e68acee.js';
|
|
19
19
|
|
|
20
20
|
var updateQuery = Actions.updateQuery,
|
|
21
21
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -59,7 +59,8 @@ var SingleList = {
|
|
|
59
59
|
missingLabel: VueTypes.string.def('N/A'),
|
|
60
60
|
nestedField: types.string,
|
|
61
61
|
index: VueTypes.string,
|
|
62
|
-
enableStrictSelection: VueTypes.bool.def(false)
|
|
62
|
+
enableStrictSelection: VueTypes.bool.def(false),
|
|
63
|
+
endpoint: types.endpointConfig
|
|
63
64
|
},
|
|
64
65
|
data: function data() {
|
|
65
66
|
var props = this.$props;
|
package/dist/es/SingleRange.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Actions, helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import './_rollupPluginBabelHelpers-
|
|
2
|
+
import './_rollupPluginBabelHelpers-76660dab.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-b8146772.js';
|
|
9
9
|
import '@appbaseio/reactivecore/lib/utils/transform';
|
|
10
10
|
import 'redux';
|
|
11
|
-
import { 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, R as Radio } from './FormControlList-
|
|
11
|
+
import { f as updateCustomQuery, i as isQueryIdentical, c as connect } from './index-7788a843.js';
|
|
12
|
+
import { C as ComponentWrapper } from './ComponentWrapper-424e86fd.js';
|
|
13
|
+
import { T as Title } from './Title-3342664a.js';
|
|
14
|
+
import { C as Container } from './Container-ba826e96.js';
|
|
15
|
+
import { U as UL, R as Radio } from './FormControlList-c22d64f6.js';
|
|
16
16
|
|
|
17
17
|
var updateQuery = Actions.updateQuery,
|
|
18
18
|
setQueryOptions = Actions.setQueryOptions,
|
|
@@ -47,7 +47,8 @@ var SingleRange = {
|
|
|
47
47
|
title: types.title,
|
|
48
48
|
URLParams: VueTypes.bool.def(false),
|
|
49
49
|
nestedField: types.string,
|
|
50
|
-
index: VueTypes.string
|
|
50
|
+
index: VueTypes.string,
|
|
51
|
+
endpoint: types.endpointConfig
|
|
51
52
|
},
|
|
52
53
|
created: function created() {
|
|
53
54
|
if (!this.enableAppbase && this.$props.index) {
|
|
@@ -133,7 +134,7 @@ var SingleRange = {
|
|
|
133
134
|
props = this.$props;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
var currentValue = SingleRange.parseValue(value, props);
|
|
137
|
+
var currentValue = typeof value === 'string' ? SingleRange.parseValue(value, props) : value;
|
|
137
138
|
|
|
138
139
|
var performUpdate = function performUpdate() {
|
|
139
140
|
_this2.currentValue = currentValue;
|
package/dist/es/StateProvider.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { helper } from '@appbaseio/reactivecore';
|
|
2
|
-
import { a as _extends } from './_rollupPluginBabelHelpers-
|
|
2
|
+
import { a as _extends } from './_rollupPluginBabelHelpers-76660dab.js';
|
|
3
3
|
import VueTypes from 'vue-types';
|
|
4
4
|
import '@appbaseio/reactivecore/lib/utils/constants';
|
|
5
|
+
import { isInternalComponent } from '@appbaseio/reactivecore/lib/utils/transform';
|
|
5
6
|
import 'redux';
|
|
6
|
-
import { c as connect } from './index-
|
|
7
|
+
import { c as connect } from './index-7788a843.js';
|
|
8
|
+
import { setValues } from '@appbaseio/reactivecore/lib/actions/value';
|
|
7
9
|
|
|
8
10
|
var getSearchState = helper.getSearchState;
|
|
9
11
|
var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
|
|
@@ -147,13 +149,32 @@ var StateProvider = {
|
|
|
147
149
|
if (this.isStateChanged(newVal, oldVal)) {
|
|
148
150
|
this.searchState = filterByKeys(getSearchState(filterProps(this.searchStateProps)), this.includeKeys);
|
|
149
151
|
}
|
|
152
|
+
},
|
|
153
|
+
setSearchState: function setSearchState(valuesMap) {
|
|
154
|
+
if (valuesMap === void 0) {
|
|
155
|
+
valuesMap = {};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var components = this.components;
|
|
159
|
+
var computedValuesMap = {};
|
|
160
|
+
components.filter(function (component) {
|
|
161
|
+
return !isInternalComponent(component);
|
|
162
|
+
}).forEach(function (component) {
|
|
163
|
+
if (component in valuesMap) {
|
|
164
|
+
computedValuesMap[component] = valuesMap[component];
|
|
165
|
+
} else {
|
|
166
|
+
computedValuesMap[component] = null;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
this.setValues(computedValuesMap);
|
|
150
170
|
}
|
|
151
171
|
},
|
|
152
172
|
render: function render() {
|
|
153
173
|
var searchState = this.searchState;
|
|
154
174
|
var dom = this.$scopedSlots["default"];
|
|
155
175
|
return dom ? dom({
|
|
156
|
-
searchState: searchState
|
|
176
|
+
searchState: searchState,
|
|
177
|
+
setSearchState: this.setSearchState
|
|
157
178
|
}) : null;
|
|
158
179
|
}
|
|
159
180
|
};
|
|
@@ -171,11 +192,15 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
171
192
|
promotedResults: filterByComponentIds(state.promotedResults, props),
|
|
172
193
|
customData: filterByComponentIds(state.customData, props),
|
|
173
194
|
settings: filterByComponentIds(state.settings, props),
|
|
174
|
-
rawData: filterByComponentIds(state.rawData, props)
|
|
195
|
+
rawData: filterByComponentIds(state.rawData, props),
|
|
196
|
+
components: filterByComponentIds(state.components, props)
|
|
175
197
|
};
|
|
176
198
|
};
|
|
177
199
|
|
|
178
|
-
var
|
|
200
|
+
var mapDispatchtoProps = {
|
|
201
|
+
setValues: setValues
|
|
202
|
+
};
|
|
203
|
+
var StateProviderConnected = connect(mapStateToProps, mapDispatchtoProps)(StateProvider);
|
|
179
204
|
|
|
180
205
|
StateProvider.install = function (Vue) {
|
|
181
206
|
Vue.component(StateProvider.name, StateProviderConnected);
|