@appbaseio/reactivesearch-vue 1.16.0-alpha.3 → 1.16.0-alpha.32

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.
Files changed (101) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +6388 -5403
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/Button-d2f1aeda.js +68 -0
  6. package/dist/cjs/{DownShift-b09da079.js → CancelSvg-82021d23.js} +60 -16
  7. package/dist/cjs/Card-4b915733.js +30 -0
  8. package/dist/cjs/{ComponentWrapper-5a0a8849.js → ComponentWrapper-7302fe1a.js} +40 -21
  9. package/dist/cjs/{Container-f84e72fc.js → Container-8a08d663.js} +3 -11
  10. package/dist/cjs/DataSearch.js +341 -391
  11. package/dist/cjs/{DropDown-c66be1a8.js → DropDown-c46d8b0c.js} +80 -95
  12. package/dist/cjs/DynamicRangeSlider.js +81 -25
  13. package/dist/cjs/Flex-699639d2.js +52 -0
  14. package/dist/cjs/FormControlList-73497794.js +47 -0
  15. package/dist/cjs/Input-c6f181d5.js +79 -0
  16. package/dist/cjs/ListItem-933c27e4.js +46 -0
  17. package/dist/cjs/MultiDropdownList.js +71 -46
  18. package/dist/cjs/MultiList.js +49 -29
  19. package/dist/cjs/MultiRange.js +20 -14
  20. package/dist/cjs/{Pagination-91df3b77.js → Pagination-1b2320a7.js} +4 -3
  21. package/dist/cjs/RangeInput.js +29 -45
  22. package/dist/cjs/RangeSlider.js +31 -28
  23. package/dist/cjs/ReactiveBase.js +55 -34
  24. package/dist/cjs/ReactiveComponent.js +80 -36
  25. package/dist/cjs/ReactiveGoogleMap.js +326 -235
  26. package/dist/cjs/ReactiveList.js +149 -202
  27. package/dist/cjs/ResultCard.js +8 -6
  28. package/dist/cjs/ResultList.js +8 -6
  29. package/dist/cjs/SelectedFilters.js +25 -12
  30. package/dist/cjs/SingleDropdownList.js +70 -45
  31. package/dist/cjs/SingleList.js +44 -26
  32. package/dist/cjs/SingleRange.js +17 -11
  33. package/dist/cjs/StateProvider.js +11 -7
  34. package/dist/cjs/{Title-e9beb554.js → Title-39765ee6.js} +3 -11
  35. package/dist/cjs/ToggleButton.js +35 -16
  36. package/dist/cjs/{_rollupPluginBabelHelpers-280a574c.js → _rollupPluginBabelHelpers-4abdbfff.js} +11 -1
  37. package/dist/cjs/{index-e0583d76.js → index-d44a0a21.js} +87 -13
  38. package/dist/cjs/index.js +23 -19
  39. package/dist/cjs/initReactivesearch.js +80 -38
  40. package/dist/cjs/install.js +20 -18
  41. package/dist/cjs/ssr-c333c82c.js +39 -0
  42. package/dist/cjs/{utils-d1ea9f95.js → utils-23afb20b.js} +2 -2
  43. package/dist/cjs/version.js +1 -1
  44. package/dist/cjs/{vueTypes-c21f265b.js → vueTypes-6de9d2a9.js} +9 -4
  45. package/dist/es/Button-799185e2.js +59 -0
  46. package/dist/es/{DownShift-d8f2500f.js → CancelSvg-4d9e0857.js} +56 -17
  47. package/dist/es/Card-04b3c33e.js +23 -0
  48. package/dist/es/{ComponentWrapper-d0b21b95.js → ComponentWrapper-bbb717bc.js} +40 -21
  49. package/dist/es/Container-4383c6f0.js +10 -0
  50. package/dist/es/DataSearch.js +339 -389
  51. package/dist/es/{DropDown-5dbd69c2.js → DropDown-4edaa621.js} +79 -94
  52. package/dist/es/DynamicRangeSlider.js +81 -25
  53. package/dist/es/Flex-aac91505.js +47 -0
  54. package/dist/es/FormControlList-fe389a2e.js +40 -0
  55. package/dist/es/Input-d8519224.js +71 -0
  56. package/dist/es/ListItem-bdb6d53d.js +39 -0
  57. package/dist/es/MultiDropdownList.js +71 -46
  58. package/dist/es/MultiList.js +49 -29
  59. package/dist/es/MultiRange.js +20 -14
  60. package/dist/es/{Pagination-800af44f.js → Pagination-b3e4054a.js} +4 -3
  61. package/dist/es/RangeInput.js +29 -45
  62. package/dist/es/RangeSlider.js +31 -28
  63. package/dist/es/ReactiveBase.js +55 -34
  64. package/dist/es/ReactiveComponent.js +80 -36
  65. package/dist/es/ReactiveGoogleMap.js +326 -235
  66. package/dist/es/ReactiveList.js +149 -202
  67. package/dist/es/ResultCard.js +8 -6
  68. package/dist/es/ResultList.js +8 -6
  69. package/dist/es/SelectedFilters.js +25 -12
  70. package/dist/es/SingleDropdownList.js +70 -45
  71. package/dist/es/SingleList.js +44 -26
  72. package/dist/es/SingleRange.js +17 -11
  73. package/dist/es/StateProvider.js +11 -7
  74. package/dist/es/Title-579f8d6c.js +10 -0
  75. package/dist/es/ToggleButton.js +35 -16
  76. package/dist/es/{_rollupPluginBabelHelpers-c9fbe19f.js → _rollupPluginBabelHelpers-ecf6c03c.js} +11 -1
  77. package/dist/es/{index-1fe91a0a.js → index-5daa8276.js} +84 -14
  78. package/dist/es/index.js +23 -19
  79. package/dist/es/initReactivesearch.js +80 -38
  80. package/dist/es/install.js +20 -18
  81. package/dist/es/ssr-e3196de1.js +33 -0
  82. package/dist/es/{utils-ce3d86fd.js → utils-3a32e13f.js} +2 -2
  83. package/dist/es/version.js +1 -1
  84. package/dist/es/{vueTypes-98d938a9.js → vueTypes-9326e0be.js} +9 -4
  85. package/package.json +86 -78
  86. package/dist/cjs/Button-78d8bc26.js +0 -146
  87. package/dist/cjs/Card-b4af314f.js +0 -58
  88. package/dist/cjs/Flex-737c55be.js +0 -160
  89. package/dist/cjs/FormControlList-08dfb28e.js +0 -105
  90. package/dist/cjs/Input-643d02a7.js +0 -178
  91. package/dist/cjs/ListItem-0c58c5d2.js +0 -84
  92. package/dist/cjs/ssr-b7a729f9.js +0 -47
  93. package/dist/es/Button-6c71c66e.js +0 -137
  94. package/dist/es/Card-ecf70ba1.js +0 -51
  95. package/dist/es/Container-f5efec9e.js +0 -18
  96. package/dist/es/Flex-40a74d8a.js +0 -155
  97. package/dist/es/FormControlList-b96aebef.js +0 -98
  98. package/dist/es/Input-dfd9dd40.js +0 -170
  99. package/dist/es/ListItem-da73bc7d.js +0 -77
  100. package/dist/es/Title-22c2f3bf.js +0 -18
  101. package/dist/es/ssr-2f57791d.js +0 -41
@@ -4,94 +4,40 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
4
4
 
5
5
  var configureStore = require('@appbaseio/reactivecore');
6
6
  var configureStore__default = _interopDefault(configureStore);
7
- var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-280a574c.js');
7
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-4abdbfff.js');
8
8
  var VueTypes = _interopDefault(require('vue-types'));
9
9
  var emotion = require('emotion');
10
10
  var styled = require('@appbaseio/vue-emotion');
11
11
  var styled__default = _interopDefault(styled);
12
- var vueTypes = require('./vueTypes-c21f265b.js');
13
- var index = require('./index-e0583d76.js');
14
- var Input = require('./Input-643d02a7.js');
15
- var DownShift = require('./DownShift-b09da079.js');
12
+ var vueTypes = require('./vueTypes-6de9d2a9.js');
13
+ var index = require('./index-d44a0a21.js');
14
+ var _mergeJSXProps = _interopDefault(require('@vue/babel-helper-vue-jsx-merge-props'));
15
+ var CancelSvg = require('./CancelSvg-82021d23.js');
16
+ var Input = require('./Input-c6f181d5.js');
17
+ var suggestions = require('@appbaseio/reactivecore/lib/utils/suggestions');
16
18
 
17
- function _templateObject4() {
18
- var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 16px;\n\theight: 16px;\n\tdisplay: inline-block;\n\tposition: relative;\n\tuser-select: none;\n\talign-items: center;\n\n\t&::after {\n\t\tbox-sizing: content-box;\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tbackground-color: transparent;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\twidth: 8px;\n\t\theight: 4px;\n\t\tmargin-top: -4px;\n\t\tborder-style: solid;\n\t\tborder-color: ", ";\n\t\tborder-width: 0 0 2px 2px;\n\t\tborder-radius: 0;\n\t\tborder-image: none;\n\t\ttransform: rotate(-45deg) scale(1);\n\t\ttransition: all 200ms ease-out;\n\t}\n"]);
19
-
20
- _templateObject4 = function _templateObject4() {
21
- return data;
22
- };
23
-
24
- return data;
25
- }
26
-
27
- function _templateObject3() {
28
- var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"]);
29
-
30
- _templateObject3 = function _templateObject3() {
31
- return data;
32
- };
33
-
34
- return data;
35
- }
36
-
37
- function _templateObject2() {
38
- var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tborder-color: ", ";\n\tcolor: ", ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"]);
39
-
40
- _templateObject2 = function _templateObject2() {
41
- return data;
42
- };
43
-
44
- return data;
45
- }
46
-
47
- function _templateObject() {
48
- var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n"]);
49
-
50
- _templateObject = function _templateObject() {
51
- return data;
52
- };
53
-
54
- return data;
55
- }
56
- var small = emotion.css(_templateObject());
19
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
20
+ var small = emotion.css(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tmin-height: 0;\n\theight: 30px;\n\tborder: 0;\n\tbox-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;\n\tborder-radius: 2px;\n"])));
57
21
 
58
22
  var dark = function dark(_ref) {
59
23
  var theme = _ref.theme;
60
- return emotion.css(_templateObject2(), theme.colors.backgroundColor, theme.colors.borderColor, theme.colors.textColor, theme.colors.backgroundColor);
24
+ return emotion.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tborder-color: ", ";\n\tcolor: ", ";\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: ", ";\n\t}\n"])), theme.colors.backgroundColor, theme.colors.borderColor, theme.colors.textColor, theme.colors.backgroundColor);
61
25
  };
62
26
 
63
- var Select = styled__default('button')(_templateObject3(), function (props) {
27
+ var Select = styled__default('button')(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmin-height: 42px;\n\tborder-radius: 0;\n\toutline: none;\n\tpadding: 5px 12px;\n\tfont-size: 0.9rem;\n\tline-height: 1.2rem;\n\tbackground-color: #fff;\n\tborder: 1px solid #ccc;\n\tcolor: #424242;\n\tcursor: pointer;\n\tuser-select: none;\n\ttransition: all 0.3s ease;\n\n\t", ";\n\n\t& > div {\n\t\twidth: calc(100% - 24px);\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\ttext-align: left;\n\t}\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: #fcfcfc;\n\t}\n\n\t", ";\n"])), function (props) {
64
28
  return props.small ? small : null;
65
29
  }, function (_ref2) {
66
30
  var themePreset = _ref2.themePreset;
67
31
  return themePreset === 'dark' && dark;
68
32
  });
69
- var Tick = styled__default('span')(_templateObject4(), function (_ref3) {
33
+ var Tick = styled__default('span')(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 16px;\n\theight: 16px;\n\tdisplay: inline-block;\n\tposition: relative;\n\tuser-select: none;\n\talign-items: center;\n\n\t&::after {\n\t\tbox-sizing: content-box;\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tbackground-color: transparent;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\twidth: 8px;\n\t\theight: 4px;\n\t\tmargin-top: -4px;\n\t\tborder-style: solid;\n\t\tborder-color: ", ";\n\t\tborder-width: 0 0 2px 2px;\n\t\tborder-radius: 0;\n\t\tborder-image: none;\n\t\ttransform: rotate(-45deg) scale(1);\n\t\ttransition: all 200ms ease-out;\n\t}\n"])), function (_ref3) {
70
34
  var theme = _ref3.theme;
71
35
  return theme.colors.primaryColor;
72
36
  });
73
37
 
74
- function _templateObject2$1() {
75
- var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"]);
76
-
77
- _templateObject2$1 = function _templateObject2() {
78
- return data;
79
- };
80
-
81
- return data;
82
- }
83
-
84
- function _templateObject$1() {
85
- var data = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"]);
86
-
87
- _templateObject$1 = function _templateObject() {
88
- return data;
89
- };
90
-
91
- return data;
92
- }
93
- var open = emotion.css(_templateObject$1());
94
- var Chevron = styled__default('span')(_templateObject2$1(), function (props) {
38
+ var _templateObject$1, _templateObject2$1;
39
+ var open = emotion.css(_templateObject$1 || (_templateObject$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\ttop: 0.55em;\n\ttransform: rotate(-45deg);\n"])));
40
+ var Chevron = styled__default('span')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t&::before {\n\t\tcontent: '';\n\t\tborder-style: solid;\n\t\tborder-width: 0.15em 0.15em 0 0;\n\t\tdisplay: inline-block;\n\t\theight: 0.45em;\n\t\tposition: relative;\n\t\ttop: 0.35em;\n\t\tleft: 0;\n\t\ttransform: rotate(135deg);\n\t\tvertical-align: top;\n\t\twidth: 0.45em;\n\n\t\t", ";\n\t}\n"])), function (props) {
95
41
  return props.open ? open : null;
96
42
  });
97
43
 
@@ -114,23 +60,25 @@ var Dropdown = {
114
60
  items: vueTypes.types.data,
115
61
  keyField: VueTypes.string.def('key'),
116
62
  labelField: VueTypes.string.def('label'),
117
- multi: vueTypes.types.bool,
63
+ multi: VueTypes.bool,
118
64
  // change event
119
65
  placeholder: vueTypes.types.string,
120
- returnsObject: vueTypes.types.bool,
66
+ returnsObject: VueTypes.bool,
121
67
  customLabelRenderer: vueTypes.types.func,
122
- hasCustomRenderer: vueTypes.types.bool,
68
+ hasCustomRenderer: VueTypes.bool,
123
69
  customRenderer: vueTypes.types.func,
124
70
  renderItem: vueTypes.types.func,
125
71
  renderNoResults: VueTypes.any,
126
72
  handleChange: vueTypes.types.func,
127
73
  transformData: vueTypes.types.func,
128
74
  selectedItem: vueTypes.types.selectedValue,
129
- showCount: vueTypes.types.bool,
130
- single: vueTypes.types.bool,
75
+ showCount: VueTypes.bool,
76
+ single: VueTypes.bool,
131
77
  small: VueTypes.bool.def(false),
132
78
  themePreset: vueTypes.types.themePreset,
133
- showSearch: vueTypes.types.bool
79
+ showSearch: VueTypes.bool,
80
+ showClear: VueTypes.bool,
81
+ searchPlaceholder: VueTypes.string.def('Type here to search...')
134
82
  },
135
83
  render: function render() {
136
84
  var _this = this;
@@ -158,7 +106,7 @@ var Dropdown = {
158
106
  var filteredItemsToRender = itemsToRender.filter(function (item) {
159
107
  if (String(item[labelField]).length) {
160
108
  if (_this.$props.showSearch && _this.$data.searchTerm) {
161
- return String(item[labelField]).toLowerCase().includes(_this.$data.searchTerm.toLowerCase());
109
+ return suggestions.replaceDiacritics(String(item[labelField])).toLowerCase().includes(suggestions.replaceDiacritics(_this.$data.searchTerm.toLowerCase()));
162
110
  }
163
111
 
164
112
  return true;
@@ -166,7 +114,7 @@ var Dropdown = {
166
114
 
167
115
  return false;
168
116
  });
169
- return h(DownShift.Downshift, {
117
+ return h(CancelSvg.Downshift, {
170
118
  "attrs": {
171
119
  "isOpen": this.$data.isOpen,
172
120
  "selectedItem": selectedItem,
@@ -179,7 +127,8 @@ var Dropdown = {
179
127
  isOpen = _ref.isOpen,
180
128
  highlightedIndex = _ref.highlightedIndex,
181
129
  getButtonProps = _ref.getButtonProps,
182
- getItemEvents = _ref.getItemEvents;
130
+ getItemEvents = _ref.getItemEvents,
131
+ getInputEvents = _ref.getInputEvents;
183
132
  return h("div", {
184
133
  "class": Input.suggestionsContainer
185
134
  }, [h(Select, {
@@ -204,26 +153,16 @@ var Dropdown = {
204
153
  getItemEvents: getItemEvents
205
154
  }) : isOpen && itemsToRender.length ? h("ul", {
206
155
  "class": Input.suggestions(themePreset, _this.theme) + " " + (_this.$props.small ? 'small' : '') + " " + getClassName(_this.$props.innerClass, 'list')
207
- }, [_this.$props.showSearch ? h(Input.Input, {
208
- "attrs": {
209
- "id": _this.$props.componentId + "-input",
210
- "showIcon": false,
211
- "placeholder": "Type here to search...",
212
- "value": _this.$data.searchTerm,
213
- "themePreset": themePreset
214
- },
215
- "style": {
216
- border: 0,
217
- borderBottom: '1px solid #ddd'
218
- },
219
- "class": getClassName(_this.$props.innerClass, 'input'),
220
- "on": {
221
- "change": _this.handleInputChange
156
+ }, [_this.$props.showSearch ? _this.renderSearchbox({
157
+ on: {
158
+ input: getInputEvents({
159
+ onInput: _this.handleInputChange
160
+ }).input
222
161
  }
223
162
  }) : null, !hasCustomRenderer && filteredItemsToRender.length === 0 ? _this.renderNoResult() : filteredItemsToRender.map(function (item, index) {
224
163
  var selected = _this.$props.multi // MultiDropdownList
225
- && (selectedItem && !!selectedItem[item[keyField]] || // MultiDropdownRange
226
- Array.isArray(selectedItem) && selectedItem.find(function (value) {
164
+ && (selectedItem && !!selectedItem[item[keyField]] // MultiDropdownRange
165
+ || Array.isArray(selectedItem) && selectedItem.find(function (value) {
227
166
  return value[labelField] === item[labelField];
228
167
  }));
229
168
  if (!_this.$props.multi) selected = item.key === selectedItem;
@@ -273,6 +212,7 @@ var Dropdown = {
273
212
 
274
213
  if (!this.$props.multi) {
275
214
  this.isOpen = false;
215
+ this.searchTerm = '';
276
216
  }
277
217
  },
278
218
  handleStateChange: function handleStateChange(_ref2) {
@@ -296,6 +236,9 @@ var Dropdown = {
296
236
  var value = e.target.value;
297
237
  this.searchTerm = value;
298
238
  },
239
+ clearSearchTerm: function clearSearchTerm() {
240
+ this.searchTerm = '';
241
+ },
299
242
  renderToString: function renderToString(value) {
300
243
  var _this2 = this;
301
244
 
@@ -336,6 +279,48 @@ var Dropdown = {
336
279
  return h("p", {
337
280
  "class": getClassName(this.$props.innerClass, 'noResults') || null
338
281
  }, [index.isFunction(renderNoResults) ? renderNoResults() : renderNoResults]);
282
+ },
283
+ renderSearchbox: function renderSearchbox(eventObject) {
284
+ var h = this.$createElement;
285
+ var _this$$props2 = this.$props,
286
+ componentId = _this$$props2.componentId,
287
+ searchPlaceholder = _this$$props2.searchPlaceholder,
288
+ showClear = _this$$props2.showClear,
289
+ themePreset = _this$$props2.themePreset,
290
+ innerClass = _this$$props2.innerClass;
291
+ var InputComponent = h(Input.Input, _mergeJSXProps([{
292
+ "attrs": {
293
+ "id": componentId + "-input",
294
+ "showIcon": false,
295
+ "showClear": showClear,
296
+ "placeholder": searchPlaceholder,
297
+ "value": this.$data.searchTerm,
298
+ "themePreset": themePreset
299
+ },
300
+ "style": {
301
+ border: 0,
302
+ borderBottom: '1px solid #ddd'
303
+ },
304
+ "class": getClassName(innerClass, 'input')
305
+ }, eventObject]));
306
+
307
+ if (showClear) {
308
+ return h(CancelSvg.InputWrapper, [InputComponent, this.searchTerm && h(CancelSvg.IconGroup, {
309
+ "attrs": {
310
+ "groupPosition": "right",
311
+ "positionType": "absolute"
312
+ }
313
+ }, [h(CancelSvg.IconWrapper, {
314
+ "on": {
315
+ "click": this.clearSearchTerm
316
+ },
317
+ "attrs": {
318
+ "isClearIcon": true
319
+ }
320
+ }, [h(CancelSvg.CancelSvg)])])]);
321
+ }
322
+
323
+ return InputComponent;
339
324
  }
340
325
  }
341
326
  };
@@ -6,17 +6,17 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
6
6
 
7
7
  var configureStore = require('@appbaseio/reactivecore');
8
8
  var configureStore__default = _interopDefault(configureStore);
9
- var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-280a574c.js');
9
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-4abdbfff.js');
10
10
  var VueTypes = _interopDefault(require('vue-types'));
11
11
  var constants = require('@appbaseio/reactivecore/lib/utils/constants');
12
12
  require('@appbaseio/vue-emotion');
13
- var vueTypes = require('./vueTypes-c21f265b.js');
13
+ var vueTypes = require('./vueTypes-6de9d2a9.js');
14
14
  require('redux');
15
- var index = require('./index-e0583d76.js');
16
- var Title = require('./Title-e9beb554.js');
17
- var Container = require('./Container-f84e72fc.js');
15
+ var index = require('./index-d44a0a21.js');
16
+ var Title = require('./Title-39765ee6.js');
17
+ var Container = require('./Container-8a08d663.js');
18
18
  var NoSSR = _interopDefault(require('vue-no-ssr'));
19
- var ssr = require('./ssr-b7a729f9.js');
19
+ var ssr = require('./ssr-c333c82c.js');
20
20
 
21
21
  var addComponent = configureStore.Actions.addComponent,
22
22
  removeComponent = configureStore.Actions.removeComponent,
@@ -48,11 +48,14 @@ var DynamicRangeSlider = {
48
48
  innerClass: vueTypes.types.style,
49
49
  react: vueTypes.types.react,
50
50
  showFilter: VueTypes.bool.def(true),
51
+ destroyOnUnmount: VueTypes.bool,
51
52
  showCheckbox: VueTypes.bool.def(true),
52
53
  title: vueTypes.types.title,
53
54
  URLParams: VueTypes.bool.def(false),
54
55
  sliderOptions: VueTypes.object.def({}),
55
- nestedField: vueTypes.types.string
56
+ nestedField: vueTypes.types.string,
57
+ index: VueTypes.string,
58
+ value: vueTypes.types.range
56
59
  },
57
60
  data: function data() {
58
61
  this.internalRangeComponent = this.$props.componentId + "__range__internal";
@@ -77,7 +80,12 @@ var DynamicRangeSlider = {
77
80
  this.setQueryListener(this.$props.componentId, onQueryChange, null); // Update props in store
78
81
 
79
82
  this.setComponentProps(this.componentId, this.$props, constants.componentTypes.dynamicRangeSlider);
80
- this.setComponentProps(this.internalRangeComponent, this.$props, constants.componentTypes.dynamicRangeSlider); // Set custom query in store
83
+ this.setComponentProps(this.internalRangeComponent, this.$props, constants.componentTypes.dynamicRangeSlider);
84
+
85
+ if (!this.enableAppbase && this.$props.index) {
86
+ console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
87
+ } // Set custom query in store
88
+
81
89
 
82
90
  index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
83
91
  },
@@ -85,17 +93,31 @@ var DynamicRangeSlider = {
85
93
  this.setReact();
86
94
  },
87
95
  beforeMount: function beforeMount() {
88
- this.addComponent(this.$props.componentId);
89
- this.addComponent(this.internalRangeComponent);
96
+ var components = [];
97
+
98
+ if (this.$$store) {
99
+ var _this$$$store$getStat = this.$$store.getState();
100
+
101
+ components = _this$$$store$getStat.components;
102
+ }
90
103
 
91
- if (Array.isArray(this.selectedValue)) {
92
- this.handleChange(this.selectedValue);
93
- } else if (this.selectedValue) {
94
- this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
95
- } // get range before executing other queries
104
+ var value = this.$props.value;
96
105
 
106
+ if (this.destroyOnUnmount || components.indexOf(this.componentId) === -1) {
107
+ this.addComponent(this.componentId);
108
+ this.addComponent(this.internalRangeComponent);
97
109
 
98
- this.updateRangeQueryOptions();
110
+ if (Array.isArray(this.selectedValue)) {
111
+ this.handleChange(this.selectedValue);
112
+ } else if (this.selectedValue) {
113
+ this.handleChange(DynamicRangeSlider.parseValue(this.selectedValue, this.$props));
114
+ } else if (value) {
115
+ this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
116
+ } // get range before executing other queries
117
+
118
+
119
+ this.updateRangeQueryOptions();
120
+ }
99
121
  },
100
122
  beforeUpdate: function beforeUpdate() {
101
123
  if (!this.currentValue) {
@@ -103,10 +125,19 @@ var DynamicRangeSlider = {
103
125
  }
104
126
  },
105
127
  beforeDestroy: function beforeDestroy() {
106
- this.removeComponent(this.$props.componentId);
107
- this.removeComponent(this.internalRangeComponent);
128
+ if (this.destroyOnUnmount) {
129
+ this.removeComponent(this.$props.componentId);
130
+ this.removeComponent(this.internalRangeComponent);
131
+ }
108
132
  },
109
133
  methods: {
134
+ isControlled: function isControlled() {
135
+ if (this.$props.value && this.$listeners) {
136
+ return true;
137
+ }
138
+
139
+ return false;
140
+ },
110
141
  setDefaultValue: function setDefaultValue(_ref) {
111
142
  var start = _ref.start,
112
143
  end = _ref.end;
@@ -117,6 +148,8 @@ var DynamicRangeSlider = {
117
148
  defaultEnd = _this$$props$defaultV.end;
118
149
 
119
150
  this.handleChange([defaultStart, defaultEnd]);
151
+ } else if (this.isControlled()) {
152
+ this.handleChange(DynamicRangeSlider.parseValue(this.$props.value), 'change');
120
153
  } else {
121
154
  this.currentValue = [start, end];
122
155
  }
@@ -164,8 +197,18 @@ var DynamicRangeSlider = {
164
197
  aggs: aggs
165
198
  });
166
199
  },
167
- handleSlider: function handleSlider(values) {
168
- this.handleChange(values.currentValue);
200
+ handleSlider: function handleSlider() {
201
+ var sliderValues = this.$refs.slider.getValue();
202
+ var value = this.$props.value;
203
+
204
+ if (value === undefined) {
205
+ this.handleChange(sliderValues);
206
+ } else {
207
+ this.$emit('change', {
208
+ start: sliderValues[0],
209
+ end: sliderValues[1]
210
+ });
211
+ }
169
212
  },
170
213
  handleChange: function handleChange(currentValue) {
171
214
  var _this2 = this;
@@ -217,7 +260,7 @@ var DynamicRangeSlider = {
217
260
  currentEnd = value[1]; // check if the slider is at its initial position
218
261
 
219
262
  var isInitialValue = currentStart === start && currentEnd === end;
220
- this.setQueryOptions(this.$props.componentId, customQueryOptions);
263
+ this.setQueryOptions(this.$props.componentId, customQueryOptions, false);
221
264
  this.updateQuery({
222
265
  componentId: this.$props.componentId,
223
266
  query: query,
@@ -258,6 +301,7 @@ var DynamicRangeSlider = {
258
301
  start: this.range.start,
259
302
  end: this.range.end
260
303
  };
304
+ this.$emit('change', value);
261
305
  this.handleChange(DynamicRangeSlider.parseValue(value, this.$props));
262
306
  },
263
307
  range: function range(newValue, oldValue) {
@@ -279,12 +323,17 @@ var DynamicRangeSlider = {
279
323
  if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
280
324
  this.updateQueryHandler(this.$data.currentValue);
281
325
  }
326
+ },
327
+ value: function value(newVal, oldVal) {
328
+ if (!isEqual(newVal, oldVal)) {
329
+ this.handleChange(DynamicRangeSlider.parseValue(newVal, this.$props));
330
+ }
282
331
  }
283
332
  },
284
333
  render: function render() {
285
334
  var h = arguments[0];
286
335
 
287
- if (!this.range) {
336
+ if (!this.range || !this.currentValue) {
288
337
  return null;
289
338
  }
290
339
 
@@ -298,13 +347,15 @@ var DynamicRangeSlider = {
298
347
  }, [this.$props.title]), h(NoSSR, [h(ssr.Slider, {
299
348
  "class": getClassName(this.$props.innerClass, 'slider')
300
349
  }, [h("vue-slider-component", {
350
+ "ref": "slider",
301
351
  "attrs": {
302
352
  "value": [Math.max(start, this.currentValue[0]), Math.min(end, this.currentValue[1])],
303
353
  "min": Math.min(start, this.currentValue[0]),
304
354
  "max": Math.max(end, this.currentValue[1]),
305
355
  "dotSize": 20,
306
356
  "height": 4,
307
- "enable-cross": false
357
+ "enable-cross": false,
358
+ "tooltip": "always"
308
359
  },
309
360
  "on": {
310
361
  "drag-end": this.handleSlider
@@ -350,7 +401,11 @@ DynamicRangeSlider.defaultQuery = function (values, props) {
350
401
  };
351
402
 
352
403
  DynamicRangeSlider.parseValue = function (value) {
353
- return [value.start, value.end];
404
+ if (value) {
405
+ return Array.isArray(value) ? value : [value.start, value.end];
406
+ }
407
+
408
+ return [];
354
409
  };
355
410
 
356
411
  var mapStateToProps = function mapStateToProps(state, props) {
@@ -377,7 +432,8 @@ var mapStateToProps = function mapStateToProps(state, props) {
377
432
  options: options,
378
433
  range: range,
379
434
  selectedValue: state.selectedValues[props.componentId] ? state.selectedValues[props.componentId].value : null,
380
- componentProps: state.props[props.componentId]
435
+ componentProps: state.props[props.componentId],
436
+ enableAppbase: state.config.enableAppbase
381
437
  };
382
438
  };
383
439
 
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-4abdbfff.js');
6
+ var emotion = require('emotion');
7
+ var styled = require('@appbaseio/vue-emotion');
8
+ var styled__default = _interopDefault(styled);
9
+ var polished = require('polished');
10
+
11
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
12
+ var leftLabel = emotion.css(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tflex-direction: row;\n\talign-items: center;\n"])));
13
+ var rightLabel = emotion.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tflex-direction: row-reverse;\n\talign-items: center;\n"])));
14
+ var topLabel = emotion.css(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tflex-direction: column;\n"])));
15
+ var bottomLabel = emotion.css(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tflex-direction: column-reverse;\n"])));
16
+
17
+ var border = function border(_ref) {
18
+ var colors = _ref.theme.colors;
19
+ return emotion.css(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tborder: 1px solid ", ";\n"])), colors.borderColor || '#ccc');
20
+ };
21
+
22
+ var Flex = styled__default('div')(_templateObject6 || (_templateObject6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: ", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\n\t", ";\n\t", ";\n\t", ";\n\n\tsvg.cancel-icon {\n\t\tcursor: pointer;\n\t\tfill: ", ";\n\t\tflex-basis: 30px;\n\n\t\t&:hover {\n\t\t\tfill: ", ";\n\t\t}\n\t}\n"])), function (props) {
23
+ return props.inline ? 'inline-flex' : 'flex';
24
+ }, function (props) {
25
+ return (props.labelPosition === 'left' || props.iconPosition === 'right') && leftLabel;
26
+ }, function (props) {
27
+ return (props.labelPosition === 'right' || props.iconPosition === 'left') && rightLabel;
28
+ }, function (props) {
29
+ return props.labelPosition === 'top' && topLabel;
30
+ }, function (props) {
31
+ return props.labelPosition === 'bottom' && bottomLabel;
32
+ }, function (props) {
33
+ return props.showBorder && border;
34
+ }, function (props) {
35
+ return props.justifyContent && emotion.css(_templateObject7 || (_templateObject7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\tjustify-content: ", ";\n\t\t"])), props.justifyContent);
36
+ }, function (props) {
37
+ return props.alignItems && emotion.css(_templateObject8 || (_templateObject8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\talign-items: ", ";\n\t\t"])), props.alignItems);
38
+ }, function (props) {
39
+ return props.flex && emotion.css(_templateObject9 || (_templateObject9 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\tflex: ", ";\n\t\t"])), props.flex);
40
+ }, function (props) {
41
+ return props.direction && emotion.css(_templateObject10 || (_templateObject10 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\tflex-direction: ", ";\n\t\t"])), props.direction);
42
+ }, function (props) {
43
+ return props.basis && emotion.css(_templateObject11 || (_templateObject11 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t\t\tflex-basis: ", ";\n\t\t"])), props.basis);
44
+ }, function (_ref2) {
45
+ var colors = _ref2.theme.colors;
46
+ return colors.borderColor || polished.lighten(0.3, colors.textColor);
47
+ }, function (_ref3) {
48
+ var theme = _ref3.theme;
49
+ return theme.colors.textColor;
50
+ });
51
+
52
+ exports.Flex = Flex;
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-4abdbfff.js');
6
+ var emotion = require('emotion');
7
+ var styled = require('@appbaseio/vue-emotion');
8
+ var styled__default = _interopDefault(styled);
9
+ var polished = require('polished');
10
+
11
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
12
+ var item = {
13
+ width: '15px',
14
+ height: '15px',
15
+ scale: '4px'
16
+ };
17
+ var vh = emotion.css(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tborder: 0;\n\tclip: rect(1px, 1px, 1px, 1px);\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n\twhite-space: nowrap;\n"])));
18
+ var hideInputControl = emotion.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t+ label {\n\t\tpadding-left: 0;\n\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder: 0;\n\t\t\tmargin: 0;\n\t\t\tvisibility: hidden;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\tfont-weight: bold;\n\t\t}\n\t}\n"])));
19
+
20
+ var formItem = function formItem(_ref) {
21
+ var theme = _ref.theme;
22
+ return emotion.css(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", ";\n\n\t&:focus {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tbox-shadow: 0 0 0 2px ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:hover {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\t\t}\n\t}\n\n\t&:active {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\ttransition-duration: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t+ label {\n\t\tposition: relative;\n\t\tuser-select: none;\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t\tcursor: pointer;\n\n\t\t&::before {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid ", ";\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tcolor: ", ";\n\t\t\tmargin-right: calc(", " * 0.5);\n\t\t\ttop: 50%;\n\t\t\tleft: 0;\n\t\t\twidth: ", ";\n\t\t\theight: ", ";\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t&::after {\n\t\t\tbox-sizing: content-box;\n\t\t\tcontent: '';\n\t\t\tbackground-color: ", ";\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 2);\n\t\t\twidth: calc(", " - ", ");\n\t\t\theight: calc(", " - ", ");\n\t\t\tmargin-top: calc(", " / -2 - ", " / -2);\n\t\t\ttransform: scale(0);\n\t\t\ttransform-origin: 50%;\n\t\t\ttransition: transform 200ms ease-out;\n\t\t}\n\t}\n"])), vh, polished.lighten(0.4, theme.colors.primaryColor), theme.colors.primaryColor, theme.colors.borderColor || polished.lighten(0.1, theme.colors.textColor), theme.colors.primaryColor, item.width, item.width, item.height, theme.colors.primaryColor, item.scale, item.width, item.scale, item.height, item.scale, item.height, item.scale);
23
+ };
24
+
25
+ var Radio = styled__default('input')(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t+ label {\n\t\t\t\tcolor: ", ";\n\n\t\t\t\t&::before {\n\t\t\t\t\tanimation: none;\n\t\t\t\t\tfilter: none;\n\t\t\t\t\ttransition: none;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tanimation: none;\n\t\t\t\tbackground-color: #fff;\n\t\t\t\tborder-color: ", ";\n\t\t}\n\n\t\t&::after {\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n"])), formItem, function (props) {
26
+ return props.show ? null : hideInputControl;
27
+ }, function (_ref2) {
28
+ var theme = _ref2.theme;
29
+ return theme.colors.primaryColor;
30
+ }, function (_ref3) {
31
+ var theme = _ref3.theme;
32
+ return theme.colors.primaryColor;
33
+ });
34
+ var Checkbox = styled__default('input')(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", ";\n\t", ";\n\n\t+ label {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&::after {\n\t\t\tbackground-color: transparent;\n\t\t\ttop: 50%;\n\t\t\tleft: calc(1px + ", " / 5);\n\t\t\twidth: calc(", " / 2);\n\t\t\theight: calc(", " / 5);\n\t\t\tmargin-top: calc(", " / -2 / 2 * 0.8);\n\t\t\tborder-style: solid;\n\t\t\tborder-color: ", ";\n\t\t\tborder-width: 0 0 2px 2px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-image: none;\n\t\t\ttransform: rotate(-45deg) scale(0);\n\t\t\ttransition: none;\n\t\t}\n\t}\n\n\t&:checked {\n\t\t+ label {\n\t\t\t&::before {\n\t\t\t\tborder-color: ", ";\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\ttransform: rotate(-45deg) scale(1);\n\t\t\t\ttransition: transform 200ms ease-out;\n\t\t\t}\n\t\t}\n\t}\n"])), formItem, function (props) {
35
+ return props.show ? null : hideInputControl;
36
+ }, item.width, item.width, item.width, item.height, function (_ref4) {
37
+ var theme = _ref4.theme;
38
+ return theme.colors.primaryColor;
39
+ }, function (_ref5) {
40
+ var theme = _ref5.theme;
41
+ return theme.colors.primaryColor;
42
+ });
43
+ var UL = styled__default('ul')(_templateObject6 || (_templateObject6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 240px;\n\tposition: relative;\n\toverflow-y: auto;\n\tpadding-bottom: 12px;\n\n\tli {\n\t\theight 30px;\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n"])));
44
+
45
+ exports.Checkbox = Checkbox;
46
+ exports.Radio = Radio;
47
+ exports.UL = UL;