@appbaseio/reactivesearch-vue 3.0.0-rc.5.alpha.2 → 3.0.0-rc.5.alpha.4

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 (62) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +35189 -36246
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +32 -32
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{DropDown-b16418e9.js → CancelSvg-ab0f8b23.js} +0 -290
  6. package/dist/cjs/DropDown-e7125b72.js +299 -0
  7. package/dist/cjs/MultiDropdownList.js +2 -1
  8. package/dist/cjs/{install-7cdf6798.js → SearchBox.js} +21 -867
  9. package/dist/cjs/SingleDropdownList.js +2 -1
  10. package/dist/cjs/index.js +7 -5
  11. package/dist/cjs/install-3c4520bf.js +874 -0
  12. package/dist/cjs/install.js +4 -2
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/es/{Button-a376dd9b.js → Button-fd869491.js} +1 -1
  15. package/dist/es/CancelSvg-e7ae49e9.js +401 -0
  16. package/dist/es/{Card-56bd984e.js → Card-54b9e7a0.js} +2 -2
  17. package/dist/es/{ComponentWrapper-b43a546e.js → ComponentWrapper-8a3c388d.js} +4 -3
  18. package/dist/es/{Container-6c21a1e6.js → Container-d00219f7.js} +1 -1
  19. package/dist/es/DropDown-13afb4d2.js +295 -0
  20. package/dist/es/DynamicRangeSlider.js +7 -6
  21. package/dist/es/{Flex-651f2422.js → Flex-25792bc3.js} +1 -1
  22. package/dist/es/{FormControlList-be0456b0.js → FormControlList-fe6eaee4.js} +1 -1
  23. package/dist/es/{Input-3126d7b6.js → Input-f7499ef8.js} +1 -1
  24. package/dist/es/{ListItem-a25ed63a.js → ListItem-e3c6acf4.js} +2 -2
  25. package/dist/es/MultiDropdownList.js +15 -12
  26. package/dist/es/MultiList.js +12 -10
  27. package/dist/es/MultiRange.js +10 -9
  28. package/dist/es/{Pagination-874e01df.js → Pagination-c2745bec.js} +2 -2
  29. package/dist/es/{PreferencesConsumer-9a3b0bac.js → PreferencesConsumer-b058d14e.js} +2 -2
  30. package/dist/es/RangeInput.js +12 -11
  31. package/dist/es/RangeSlider.js +9 -8
  32. package/dist/es/ReactiveBase.js +17 -5508
  33. package/dist/es/ReactiveComponent.js +6 -5
  34. package/dist/es/ReactiveGoogleMap.js +10 -9
  35. package/dist/es/ReactiveList.js +14 -13
  36. package/dist/es/ResultCard.js +3 -3
  37. package/dist/es/ResultList.js +3 -3
  38. package/dist/es/SearchBox.js +1847 -0
  39. package/dist/es/SelectedFilters.js +7 -6
  40. package/dist/es/SingleDropdownList.js +15 -12
  41. package/dist/es/SingleList.js +12 -10
  42. package/dist/es/SingleRange.js +10 -9
  43. package/dist/es/StateProvider.js +4 -3
  44. package/dist/es/{Title-4b7614be.js → Title-863dfa42.js} +1 -1
  45. package/dist/es/ToggleButton.js +9 -8
  46. package/dist/es/_rollupPluginBabelHelpers-ded08042.js +61 -0
  47. package/dist/es/{index-b2212b15.js → index-882489e1.js} +3 -67
  48. package/dist/es/index.js +31 -22
  49. package/dist/es/initReactivesearch.js +3 -2291
  50. package/dist/es/install-ff8b0750.js +868 -0
  51. package/dist/es/install.js +28 -21
  52. package/dist/es/{ssr-26e0b4af.js → ssr-c630ccb9.js} +1 -1
  53. package/dist/es/utils-d7dd4f4e.js +60 -0
  54. package/dist/es/version.js +1 -1
  55. package/package.json +2 -2
  56. package/dist/es/DropDown-59c3fbc7.js +0 -690
  57. package/dist/es/_rollupPluginBabelHelpers-dac426db.js +0 -423
  58. package/dist/es/helper-39773859.js +0 -558
  59. package/dist/es/index-b9203a60.js +0 -10
  60. package/dist/es/install-d7f59dee.js +0 -4008
  61. package/dist/es/transform-e41c9e5c.js +0 -412
  62. package/dist/es/utils-782d91c4.js +0 -1315
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
6
 
5
7
  var reactivecore = require('@appbaseio/reactivecore');
@@ -11,41 +13,22 @@ var VueTypes = _interopDefault(require('vue-types'));
11
13
  var helper = require('@appbaseio/reactivecore/lib/utils/helper');
12
14
  var vueEmotion = require('@appbaseio/vue-emotion');
13
15
  var css = require('@emotion/css');
16
+ require('polished');
14
17
  var Button = require('./Button-d4da7470.js');
15
18
  var vueTypes = require('./vueTypes-1bf00978.js');
16
- var ReactiveList = require('./ReactiveList.js');
17
- var transform = require('@appbaseio/reactivecore/lib/utils/transform');
19
+ require('@appbaseio/reactivecore/lib/utils/transform');
20
+ require('redux');
18
21
  var index = require('./index-779ed366.js');
19
22
  var ComponentWrapper = require('./ComponentWrapper-9146d811.js');
20
23
  var PreferencesConsumer = require('./PreferencesConsumer-85dee673.js');
21
24
  var Title = require('./Title-8802a218.js');
22
- var ListItem = require('./ListItem-7a682970.js');
23
25
  var Flex = require('./Flex-ddde6d26.js');
24
- var ReactiveBase = require('./ReactiveBase.js');
25
26
  var hotkeys = _interopDefault(require('hotkeys-js'));
26
- var DropDown = require('./DropDown-b16418e9.js');
27
+ var CancelSvg = require('./CancelSvg-ab0f8b23.js');
27
28
  var Input = require('./Input-497be42a.js');
29
+ require('compute-scroll-into-view');
28
30
  var Container = require('./Container-29f049b2.js');
29
31
  var Highlight = _interopDefault(require('vue-highlight-words'));
30
- var suggestions = require('@appbaseio/reactivecore/lib/utils/suggestions');
31
- var FormControlList = require('./FormControlList-fadd792f.js');
32
- var utils = require('./utils-c9bd5628.js');
33
- var SingleList = require('./SingleList.js');
34
- var MultiList = require('./MultiList.js');
35
- var types = _interopDefault(require('@appbaseio/reactivecore/lib/utils/types'));
36
- var SingleDropdownList = require('./SingleDropdownList.js');
37
- var MultiDropdownList = require('./MultiDropdownList.js');
38
- var ToggleButton = require('./ToggleButton.js');
39
- var ReactiveComponent = require('./ReactiveComponent.js');
40
- var DynamicRangeSlider = require('./DynamicRangeSlider.js');
41
- var SingleRange = require('./SingleRange.js');
42
- var MultiRange = require('./MultiRange.js');
43
- var RangeSlider = require('./RangeSlider.js');
44
- var RangeInput = require('./RangeInput.js');
45
- var SelectedFilters = require('./SelectedFilters.js');
46
- var ResultCard = require('./ResultCard.js');
47
- var ResultList = require('./ResultList.js');
48
- var StateProvider = require('./StateProvider.js');
49
32
 
50
33
  var _templateObject;
51
34
  var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
@@ -639,7 +622,7 @@ var Mic = {
639
622
  if (this.hasCustomRenderer) {
640
623
  return this.getComponent();
641
624
  }
642
- return vue.createVNode(DropDown.IconWrapper, null, {
625
+ return vue.createVNode(CancelSvg.IconWrapper, null, {
643
626
  "default": function _default() {
644
627
  return [_this2.Icon];
645
628
  }
@@ -1349,7 +1332,7 @@ var SearchBox = vue.defineComponent({
1349
1332
  },
1350
1333
  renderCancelIcon: function renderCancelIcon() {
1351
1334
  if (this.$props.showClear) {
1352
- return this.$props.clearIcon || vue.createVNode(DropDown.CancelSvg, null, null);
1335
+ return this.$props.clearIcon || vue.createVNode(CancelSvg.CancelSvg, null, null);
1353
1336
  }
1354
1337
  return null;
1355
1338
  },
@@ -1451,12 +1434,12 @@ var SearchBox = vue.defineComponent({
1451
1434
  showIcon = _this$$props3.showIcon;
1452
1435
  var renderMic = this.$slots.renderMic || this.$props.renderMic;
1453
1436
  var currentValue = this.$data.currentValue;
1454
- return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
1437
+ return vue.createVNode("div", null, [vue.createVNode(CancelSvg.IconGroup, {
1455
1438
  "groupPosition": "right",
1456
1439
  "positionType": "absolute"
1457
1440
  }, {
1458
1441
  "default": function _default() {
1459
- return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
1442
+ return [currentValue && showClear && vue.createVNode(CancelSvg.IconWrapper, {
1460
1443
  "onClick": _this6.clearValue,
1461
1444
  "showIcon": showIcon,
1462
1445
  "isClearIcon": true
@@ -1469,7 +1452,7 @@ var SearchBox = vue.defineComponent({
1469
1452
  "render": renderMic,
1470
1453
  "handleResult": _this6.handleVoiceResults,
1471
1454
  "className": getClassName$1(innerClass, 'mic') || null
1472
- }, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1455
+ }, null), iconPosition === 'right' && showIcon && vue.createVNode(CancelSvg.IconWrapper, {
1473
1456
  "onClick": _this6.handleSearchIconClick
1474
1457
  }, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
1475
1458
  "default": function _default() {
@@ -1477,12 +1460,12 @@ var SearchBox = vue.defineComponent({
1477
1460
  }
1478
1461
  })];
1479
1462
  }
1480
- }), vue.createVNode(DropDown.IconGroup, {
1463
+ }), vue.createVNode(CancelSvg.IconGroup, {
1481
1464
  "groupPosition": "left",
1482
1465
  "positionType": "absolute"
1483
1466
  }, {
1484
1467
  "default": function _default() {
1485
- return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1468
+ return [iconPosition === 'left' && showIcon && vue.createVNode(CancelSvg.IconWrapper, {
1486
1469
  "onClick": _this6.handleSearchIconClick
1487
1470
  }, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
1488
1471
  "default": function _default() {
@@ -1565,7 +1548,7 @@ var SearchBox = vue.defineComponent({
1565
1548
  "onClick": function onClick() {
1566
1549
  return _this9.clearTag(item);
1567
1550
  }
1568
- }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
1551
+ }, [vue.createVNode(CancelSvg.CancelSvg, null, null)])];
1569
1552
  }
1570
1553
  });
1571
1554
  },
@@ -1610,7 +1593,7 @@ var SearchBox = vue.defineComponent({
1610
1593
  "aria-label": "delete-tag",
1611
1594
  "class": "close-icon",
1612
1595
  "onClick": _this10.clearAllTags
1613
- }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
1596
+ }, [vue.createVNode(CancelSvg.CancelSvg, null, null)])];
1614
1597
  }
1615
1598
  })];
1616
1599
  }
@@ -1635,7 +1618,7 @@ var SearchBox = vue.defineComponent({
1635
1618
  "default": function _default() {
1636
1619
  return [_this11.$props.title];
1637
1620
  }
1638
- }), _this11.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
1621
+ }), _this11.$props.autosuggest ? vue.createVNode(CancelSvg.Downshift, {
1639
1622
  "id": _this11.$props.componentId + "-downshift",
1640
1623
  "handleChange": _this11.onSuggestionSelected,
1641
1624
  "handleMouseup": _this11.handleStateChange,
@@ -1709,7 +1692,7 @@ var SearchBox = vue.defineComponent({
1709
1692
  "class": Input.suggestionsContainer
1710
1693
  }, [vue.createVNode(InputGroup, null, {
1711
1694
  "default": function _default() {
1712
- return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
1695
+ return [_this11.renderInputAddonBefore(), vue.createVNode(CancelSvg.InputWrapper, null, {
1713
1696
  "default": function _default() {
1714
1697
  return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn(getInputEvents({
1715
1698
  onInput: _this11.onInputChange,
@@ -1755,7 +1738,7 @@ var SearchBox = vue.defineComponent({
1755
1738
  "class": Input.suggestionsContainer
1756
1739
  }, [vue.createVNode(InputGroup, null, {
1757
1740
  "default": function _default() {
1758
- return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
1741
+ return [_this11.renderInputAddonBefore(), vue.createVNode(CancelSvg.InputWrapper, null, {
1759
1742
  "default": function _default() {
1760
1743
  return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn({
1761
1744
  blur: function blur(e) {
@@ -1866,834 +1849,5 @@ SBConnected.install = function (Vue) {
1866
1849
  // Add componentType for SSR
1867
1850
  SBConnected.componentType = constants.componentTypes.searchBox;
1868
1851
 
1869
- var _templateObject$8, _templateObject2$1;
1870
- var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$8 || (_templateObject$8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
1871
- var HierarchicalMenuListItem = vueEmotion.styled('li')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
1872
- return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
1873
- });
1874
-
1875
- var HierarchicalMenuListItemComponent = {
1876
- name: 'HierarchicalMenuListItemComponent',
1877
- data: function data() {
1878
- return {
1879
- isExpanded: false,
1880
- newParentPath: ''
1881
- };
1882
- },
1883
- created: function created() {
1884
- var listItemLabel = this.listItem.key;
1885
- var newParentPath = listItemLabel;
1886
- if (this.parentPath) {
1887
- newParentPath = "" + this.parentPath + constants.TREELIST_VALUES_PATH_SEPARATOR + listItemLabel;
1888
- }
1889
- this.newParentPath = newParentPath;
1890
- this.isExpanded = !!helper.recLookup(this.selectedValues, newParentPath, constants.TREELIST_VALUES_PATH_SEPARATOR);
1891
- },
1892
- watch: {
1893
- listItem: function listItem(newVal) {
1894
- if (newVal.initiallyExpanded) {
1895
- this.isExpanded = newVal.initiallyExpanded;
1896
- }
1897
- },
1898
- selectedValues: function selectedValues(newVal) {
1899
- this.isExpanded = !!helper.recLookup(newVal, this.newParentPath, constants.TREELIST_VALUES_PATH_SEPARATOR);
1900
- }
1901
- },
1902
- props: {
1903
- parentPath: types.string,
1904
- selectedValues: types.rawData,
1905
- mode: types.string,
1906
- searchTerm: types.string,
1907
- listItem: types.rawData,
1908
- showLine: types.bool,
1909
- renderItem: types.func,
1910
- handleListItemClick: types.func,
1911
- renderSwitcherIcon: types.func,
1912
- showCheckbox: VueTypes.bool,
1913
- innerClass: types.style,
1914
- showRadio: VueTypes.bool,
1915
- renderIcon: types.func,
1916
- showCount: VueTypes.bool,
1917
- showSwitcherIcon: types.bool,
1918
- switcherIcon: types.children
1919
- },
1920
- render: function render() {
1921
- var _this = this;
1922
- var _this$$props = this.$props,
1923
- selectedValues = _this$$props.selectedValues,
1924
- mode = _this$$props.mode,
1925
- searchTerm = _this$$props.searchTerm,
1926
- listItem = _this$$props.listItem,
1927
- parentPath = _this$$props.parentPath,
1928
- showLine = _this$$props.showLine,
1929
- renderItem = _this$$props.renderItem,
1930
- handleListItemClick = _this$$props.handleListItemClick,
1931
- showCheckbox = _this$$props.showCheckbox,
1932
- innerClass = _this$$props.innerClass,
1933
- showRadio = _this$$props.showRadio,
1934
- renderIcon = _this$$props.renderIcon,
1935
- showCount = _this$$props.showCount,
1936
- showSwitcherIcon = _this$$props.showSwitcherIcon;
1937
- if (!(listItem instanceof Object) || Object.keys(listItem).length === 0) {
1938
- return null;
1939
- }
1940
- var listItemLabel = listItem.key;
1941
- var listItemCount = listItem.count;
1942
- var isLeafNode = !(Array.isArray(listItem.list) && listItem.list.length > 0);
1943
- var renderSwitcherIcon = function renderSwitcherIcon(isExpandedProp) {
1944
- if (showSwitcherIcon === false) {
1945
- return null;
1946
- }
1947
- var switcherIcon = _this.$props.switcherIcon;
1948
- if (switcherIcon) return switcherIcon(isExpandedProp);
1949
- return (
1950
- /* eslint-disable jsx-a11y/click-events-have-key-events
1951
- , jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-tabindex */
1952
- vue.createVNode("span", {
1953
- "tabIndex": "0",
1954
- "onClick": function onClick(e) {
1955
- e.stopPropagation();
1956
- _this.isExpanded = !_this.isExpanded;
1957
- },
1958
- "class": "--switcher-icon"
1959
- }, [vue.createTextVNode("\u27A4")])
1960
- );
1961
- };
1962
- var isSelected = false;
1963
- if (mode === 'single') {
1964
- if (helper.recLookup(selectedValues, this.newParentPath, constants.TREELIST_VALUES_PATH_SEPARATOR) === true) {
1965
- isSelected = true;
1966
- }
1967
- } else {
1968
- isSelected = !!helper.recLookup(selectedValues, this.newParentPath, constants.TREELIST_VALUES_PATH_SEPARATOR);
1969
- }
1970
- return vue.createVNode(HierarchicalMenuListItem, {
1971
- "class": (isSelected ? '-selected-item' : '') + " " + (this.isExpanded ? '-expanded-item' : ''),
1972
- "key": this.newParentPath,
1973
- "showLine": showLine
1974
- }, {
1975
- "default": function _default() {
1976
- return [vue.createVNode(ListItem.ListItem, {
1977
- "isTreeListItem": true,
1978
- "onClick": function onClick() {
1979
- handleListItemClick(listItemLabel, parentPath);
1980
- },
1981
- "style": {
1982
- textDecoration: 'none'
1983
- }
1984
- }, {
1985
- "default": function _default() {
1986
- return [renderItem ? renderItem(listItemLabel, listItemCount, isSelected) : vue.createVNode(Flex.Flex, {
1987
- "alignItems": "center",
1988
- "gap": "5px"
1989
- }, {
1990
- "default": function _default() {
1991
- return [!isLeafNode && renderSwitcherIcon(isSelected), mode === 'multiple' && showCheckbox && vue.createVNode(Flex.Flex, {
1992
- "alignItems": "center",
1993
- "gap": "5px"
1994
- }, {
1995
- "default": function _default() {
1996
- return [vue.createVNode(FormControlList.Checkbox, {
1997
- "type": "checkbox",
1998
- "class": helper.getClassName(innerClass, 'checkbox') || null,
1999
- "checked": isSelected,
2000
- "id": listItemLabel + "-checkbox-" + _this.newParentPath,
2001
- "name": listItemLabel + "-checkbox-" + _this.newParentPath,
2002
- "show": true,
2003
- "readOnly": true
2004
- }, null), vue.createVNode("label", {
2005
- "style": {
2006
- width: '26px',
2007
- marginTop: 0,
2008
- marginBottom: 0,
2009
- marginRight: '-9px',
2010
- left: '-3px'
2011
- },
2012
- "htmlFor": listItemLabel + "-checkbox-" + _this.newParentPath,
2013
- "onClick": function onClick(e) {
2014
- e.stopPropagation();
2015
- }
2016
- }, null)];
2017
- }
2018
- }), mode === 'single' && showRadio && vue.createVNode(Flex.Flex, {
2019
- "alignItems": "center",
2020
- "gap": "5px"
2021
- }, {
2022
- "default": function _default() {
2023
- return [vue.createVNode(FormControlList.Radio, {
2024
- "checked": isSelected,
2025
- "class": helper.getClassName(innerClass, 'radio') || null,
2026
- "id": listItemLabel + "-radio-" + _this.newParentPath,
2027
- "name": listItemLabel + "-radio-" + _this.newParentPath,
2028
- "show": true,
2029
- "readOnly": true,
2030
- "type": "radio"
2031
- }, null), vue.createVNode("label", {
2032
- "style": {
2033
- width: '26px',
2034
- marginTop: 0,
2035
- marginBottom: 0,
2036
- marginRight: '-9px',
2037
- left: '-3px'
2038
- },
2039
- "htmlFor": listItemLabel + "-radio-" + _this.newParentPath,
2040
- "onClick": function onClick(e) {
2041
- e.stopPropagation();
2042
- }
2043
- }, null)];
2044
- }
2045
- }), ' ', renderIcon(isLeafNode), vue.createVNode("div", {
2046
- "class": "--list-item-label-count-wrapper"
2047
- }, [vue.createVNode("span", {
2048
- "class": "--list-item-label " + (helper.getClassName(innerClass, 'label') || '')
2049
- }, [listItemLabel]), showCount && vue.createVNode("span", {
2050
- "class": "--list-item-count " + (helper.getClassName(innerClass, 'count') || '')
2051
- }, [listItemCount])])];
2052
- }
2053
- })];
2054
- }
2055
- }), isLeafNode === false && vue.createVNode("div", {
2056
- "class": "--list-child " + (showSwitcherIcon ? ' --show-switcher-icon' : '')
2057
- }, [vue.createVNode(HierarchicalMenuComponent, {
2058
- "key": _this.newParentPath + "-" + listItemLabel + "-" + listItemCount,
2059
- "listArray": listItem.list,
2060
- "parentPath": _this.newParentPath,
2061
- "isExpanded": _this.isExpanded,
2062
- "listItemProps": {
2063
- mode: mode,
2064
- selectedValues: selectedValues,
2065
- searchTerm: searchTerm,
2066
- showLine: showLine,
2067
- renderItem: renderItem,
2068
- handleListItemClick: handleListItemClick,
2069
- renderSwitcherIcon: renderSwitcherIcon,
2070
- showCheckbox: showCheckbox,
2071
- innerClass: innerClass,
2072
- showRadio: showRadio,
2073
- renderIcon: renderIcon,
2074
- showCount: showCount,
2075
- showSwitcherIcon: showSwitcherIcon,
2076
- switcherIcon: _this.$props.switcherIcon
2077
- }
2078
- }, null)])];
2079
- }
2080
- });
2081
- }
2082
- };
2083
-
2084
- function _isSlot$1(s) {
2085
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
2086
- }
2087
- var HierarchicalMenuComponent = {
2088
- name: 'HierarchicalMenuComponent',
2089
- props: {
2090
- listArray: VueTypes.arrayOf(VueTypes.object),
2091
- // array of objects
2092
- parentPath: VueTypes.string.def(''),
2093
- isExpanded: VueTypes.bool.def(false),
2094
- listItemProps: types.rawData
2095
- },
2096
- render: function render() {
2097
- var _slot;
2098
- var _this$$props = this.$props,
2099
- listArray = _this$$props.listArray,
2100
- isExpanded = _this$$props.isExpanded,
2101
- parentPath = _this$$props.parentPath,
2102
- listItemProps = _this$$props.listItemProps;
2103
- if (!Array.isArray(listArray) || listArray.length === 0) {
2104
- return null;
2105
- }
2106
- return vue.createVNode(HierarchicalMenuList, {
2107
- "class": "" + (isExpanded ? '--open' : ''),
2108
- "isSelected": isExpanded
2109
- }, _isSlot$1(_slot = listArray.map(function (listItem) {
2110
- return vue.createVNode(HierarchicalMenuListItemComponent, vue.mergeProps({
2111
- "key": parentPath + "__" + JSON.stringify(listItem),
2112
- "parentPath": parentPath,
2113
- "listItem": listItem
2114
- }, listItemProps), null);
2115
- })) ? _slot : {
2116
- "default": function _default() {
2117
- return [_slot];
2118
- }
2119
- });
2120
- }
2121
- };
2122
-
2123
- function _isSlot$2(s) {
2124
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
2125
- }
2126
- var updateQueryAction = reactivecore.Actions.updateQuery,
2127
- setQueryOptions = reactivecore.Actions.setQueryOptions;
2128
- var transformValueIntoLocalState = function transformValueIntoLocalState(valueArray) {
2129
- var valueToSet = {};
2130
- if (valueArray.length) {
2131
- var newSelectedValues = {};
2132
- valueArray.forEach(function (valueItem) {
2133
- helper.setDeep(newSelectedValues, valueItem.split(' > '), !helper.recLookup(newSelectedValues, valueItem.split(' > '), constants.TREELIST_VALUES_PATH_SEPARATOR), true);
2134
- });
2135
- valueToSet = newSelectedValues;
2136
- }
2137
- return valueToSet;
2138
- };
2139
- var TreeList = {
2140
- name: 'TreeList',
2141
- props: {
2142
- selectedValue: vueTypes.types.selectedValue,
2143
- error: vueTypes.types.title,
2144
- rawData: vueTypes.types.rawData,
2145
- aggregationData: vueTypes.types.rawData,
2146
- themePreset: vueTypes.types.themePreset,
2147
- updateQueryAction: vueTypes.types.funcRequired,
2148
- setQueryOptions: vueTypes.types.funcRequired,
2149
- // component props
2150
- componentId: vueTypes.types.string.isRequired,
2151
- className: vueTypes.types.string,
2152
- style: vueTypes.types.style,
2153
- showRadio: VueTypes.bool.def(false),
2154
- showCheckbox: vueTypes.types.bool.def(false),
2155
- mode: VueTypes.oneOf(['single', 'multiple']).def('multiple'),
2156
- showCount: VueTypes.bool.def(false),
2157
- showSearch: VueTypes.bool.def(false),
2158
- showIcon: VueTypes.bool.def(false),
2159
- icon: vueTypes.types.children,
2160
- showLeafIcon: VueTypes.bool.def(false),
2161
- leafIcon: vueTypes.types.children,
2162
- showLine: VueTypes.bool.def(false),
2163
- switcherIcon: vueTypes.types.func,
2164
- render: vueTypes.types.func,
2165
- renderItem: vueTypes.types.func,
2166
- innerClass: vueTypes.types.style,
2167
- placeholder: vueTypes.types.string,
2168
- title: vueTypes.types.title,
2169
- isLoading: vueTypes.types.bool,
2170
- dataField: vueTypes.types.stringArray.isRequired,
2171
- onQueryChange: vueTypes.types.func,
2172
- defaultValue: vueTypes.types.stringArray,
2173
- value: vueTypes.types.stringArray,
2174
- customQuery: vueTypes.types.func,
2175
- defaultQuery: vueTypes.types.func,
2176
- enableAppbase: vueTypes.types.bool,
2177
- index: vueTypes.types.string,
2178
- showFilter: vueTypes.types.bool,
2179
- URLParams: vueTypes.types.bool,
2180
- filterLabel: vueTypes.types.string,
2181
- onChange: vueTypes.types.func,
2182
- onValueChange: vueTypes.types.func,
2183
- beforeValueChange: vueTypes.types.func,
2184
- sortBy: vueTypes.types.sortByWithCount.def('count'),
2185
- onError: vueTypes.types.func,
2186
- showSwitcherIcon: vueTypes.types.bool.def(true),
2187
- renderError: vueTypes.types.title,
2188
- renderNoResults: vueTypes.types.func,
2189
- loader: vueTypes.types.title,
2190
- aggergationSize: vueTypes.types.number,
2191
- endpoint: vueTypes.types.endpoint,
2192
- queryFormat: vueTypes.types.queryFormatSearch.def('or'),
2193
- size: vueTypes.types.number.def(100),
2194
- nestedField: vueTypes.types.string,
2195
- react: vueTypes.types.react,
2196
- transformData: vueTypes.types.func,
2197
- selectAllLabel: vueTypes.types.string,
2198
- showMissing: VueTypes.bool.def(false),
2199
- missingLabel: VueTypes.string.def('N/A')
2200
- },
2201
- data: function data() {
2202
- var props = this.$props;
2203
- this.__state = {
2204
- selectedValues: {},
2205
- searchTerm: '',
2206
- aggregationData: []
2207
- };
2208
- this.internalComponent = props.componentId + "__internal";
2209
- return this.__state;
2210
- },
2211
- created: function created() {
2212
- var props = this.$props;
2213
- var componentId = props.componentId;
2214
- var defaultValue = this.defaultValue || this.value;
2215
- var currentValueArray = this.selectedValue || defaultValue || [];
2216
- // update local state for selected values
2217
- if (currentValueArray.length) {
2218
- var newSelectedValues = transformValueIntoLocalState(currentValueArray);
2219
- this.setValue(newSelectedValues, true);
2220
- }
2221
-
2222
- // Set custom and default queries in store
2223
- helper.updateCustomQuery(componentId, props, currentValueArray);
2224
- helper.updateDefaultQuery(componentId, props, currentValueArray);
2225
- this.updateQueryOptions();
2226
- },
2227
- mounted: function mounted() {
2228
- var _this$$props = this.$props,
2229
- enableAppbase = _this$$props.enableAppbase,
2230
- index = _this$$props.index;
2231
- if (!enableAppbase && index) {
2232
- console.warn('Warning(ReactiveSearch): In order to use the `index` prop, the `enableAppbase` prop must be set to true in `ReactiveBase`.');
2233
- }
2234
- },
2235
- watch: {
2236
- defaultQuery: function defaultQuery() {
2237
- this.updateDefaultQuery();
2238
- this.updateQuery([]);
2239
- },
2240
- customQuery: function customQuery() {
2241
- var valueArray = helper.transformTreeListLocalStateIntoQueryComptaibleFormat(this.$data.selectedValues) || [];
2242
- this.updateQuery(valueArray);
2243
- },
2244
- sortBy: function sortBy() {
2245
- this.updateQueryOptions();
2246
- },
2247
- dataField: function dataField() {
2248
- var valueArray = helper.transformTreeListLocalStateIntoQueryComptaibleFormat(this.$data.selectedValues) || [];
2249
- this.updateQueryOptions();
2250
- this.updateQuery(valueArray);
2251
- },
2252
- value: function value(newVal, oldVal) {
2253
- if (!helper.isEqual(newVal, oldVal)) {
2254
- this.setValue(newVal);
2255
- }
2256
- },
2257
- selectedValue: function selectedValue(newVal) {
2258
- if (!helper.isEqual(helper.transformTreeListLocalStateIntoQueryComptaibleFormat(this.$data.selectedValues), newVal)) {
2259
- var _this$$props2 = this.$props,
2260
- value = _this$$props2.value,
2261
- onChange = _this$$props2.onChange;
2262
- var valueToSet = [];
2263
- if (Array.isArray(newVal) && newVal.length) {
2264
- valueToSet = newVal;
2265
- }
2266
- if (value === undefined) {
2267
- this.setValue(valueToSet);
2268
- } else if (onChange && !helper.isEqual(value, valueToSet)) {
2269
- onChange(valueToSet);
2270
- }
2271
- }
2272
- },
2273
- aggregationData: function aggregationData(newVal, oldVal) {
2274
- if (newVal && !helper.isEqual(newVal, oldVal)) {
2275
- this.$data.aggregationData = newVal;
2276
- }
2277
- }
2278
- },
2279
- computed: {
2280
- hasCustomRenderer: function hasCustomRenderer() {
2281
- return index.hasCustomRenderer(this);
2282
- }
2283
- },
2284
- methods: {
2285
- renderIcon: function renderIcon(isLeafNode) {
2286
- var _this$$props3 = this.$props,
2287
- showIcon = _this$$props3.showIcon,
2288
- showLeafIcon = _this$$props3.showLeafIcon,
2289
- icon = _this$$props3.icon;
2290
- if (isLeafNode) {
2291
- if (!showLeafIcon) return null;
2292
- var _ref = this.$slots || this.$props,
2293
- leafIcon = _ref.leafIcon;
2294
- if (leafIcon) return leafIcon();
2295
- return vue.createVNode("span", {
2296
- "role": "img",
2297
- "aria-label": "file",
2298
- "class": "--leaf-icon"
2299
- }, [vue.createVNode("svg", {
2300
- "viewBox": "64 64 896 896",
2301
- "focusable": "false",
2302
- "data-icon": "file",
2303
- "width": "1em",
2304
- "height": "1em",
2305
- "fill": "currentColor",
2306
- "aria-hidden": "true"
2307
- }, [vue.createVNode("path", {
2308
- "d": "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"
2309
- }, null)])]);
2310
- }
2311
- if (!showIcon) return null;
2312
- if (icon) {
2313
- return icon;
2314
- }
2315
- if (this.$slots.icon) {
2316
- return this.$slots.icon();
2317
- }
2318
- return vue.createVNode("span", {
2319
- "role": "img",
2320
- "aria-label": "folder-open",
2321
- "class": "--folder-icon"
2322
- }, [vue.createVNode("svg", {
2323
- "viewBox": "64 64 896 896",
2324
- "focusable": "false",
2325
- "data-icon": "folder-open",
2326
- "width": "1em",
2327
- "height": "1em",
2328
- "fill": "currentColor",
2329
- "aria-hidden": "true"
2330
- }, [vue.createVNode("path", {
2331
- "d": "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"
2332
- }, null)])]);
2333
- },
2334
- getTransformedData: function getTransformedData() {
2335
- var _this$$props4 = this.$props,
2336
- dataField = _this$$props4.dataField,
2337
- showSearch = _this$$props4.showSearch;
2338
- var transformedData = helper.transformRawTreeListData(this.$data.aggregationData, dataField);
2339
- var filteredData = [];
2340
- if (showSearch && this.searchTerm) {
2341
- filteredData = this.filterDataBasedOnSearchTerm(transformedData, '');
2342
- }
2343
- return filteredData.length ? filteredData : transformedData;
2344
- },
2345
- handleInputChange: function handleInputChange(e) {
2346
- var value = e.target.value;
2347
- this.searchTerm = value;
2348
- },
2349
- renderSearch: function renderSearch() {
2350
- var _this$$props5 = this.$props,
2351
- showSearch = _this$$props5.showSearch,
2352
- innerClass = _this$$props5.innerClass,
2353
- placeholder = _this$$props5.placeholder,
2354
- componentId = _this$$props5.componentId,
2355
- themePreset = _this$$props5.themePreset;
2356
- if (showSearch) {
2357
- return vue.createVNode(Input.Input, {
2358
- "class": helper.getClassName(innerClass, 'input') || null,
2359
- "onInput": this.handleInputChange,
2360
- "value": this.searchTerm,
2361
- "placeholder": placeholder || 'Search',
2362
- "style": {
2363
- margin: '0 0 8px'
2364
- },
2365
- "aria-label": componentId + "-search",
2366
- "themePreset": themePreset
2367
- }, null);
2368
- }
2369
- return null;
2370
- },
2371
- handleListItemClick: function handleListItemClick(key, parentPath) {
2372
- var path = key;
2373
- if (parentPath) {
2374
- path = "" + parentPath + constants.TREELIST_VALUES_PATH_SEPARATOR + key;
2375
- }
2376
- var newSelectedValues = _rollupPluginBabelHelpers._extends({}, this.selectedValues);
2377
- if (this.$props.mode === 'single') {
2378
- newSelectedValues = {};
2379
- helper.setDeep(newSelectedValues, path.split(constants.TREELIST_VALUES_PATH_SEPARATOR), true, true);
2380
- } else {
2381
- var newValue = !helper.recLookup(newSelectedValues, path, constants.TREELIST_VALUES_PATH_SEPARATOR);
2382
- helper.setDeep(newSelectedValues, path.split(constants.TREELIST_VALUES_PATH_SEPARATOR), newValue, true);
2383
- }
2384
- newSelectedValues = utils.sanitizeObject(_rollupPluginBabelHelpers._extends({}, newSelectedValues));
2385
- if (this.$props.value === undefined) {
2386
- this.setValue(newSelectedValues);
2387
- } else if (this.$props.onChange) {
2388
- var valueToSet = helper.transformTreeListLocalStateIntoQueryComptaibleFormat(newSelectedValues);
2389
- this.$props.onChange(valueToSet);
2390
- }
2391
- },
2392
- filterDataBasedOnSearchTerm: function filterDataBasedOnSearchTerm(listArray, parentPath) {
2393
- var _this = this;
2394
- if (!(listArray && Array.isArray(listArray) && listArray.length)) {
2395
- return null;
2396
- }
2397
- var result = [];
2398
- listArray.forEach(function (ele) {
2399
- var isLeafItem = !ele.list;
2400
- var newParentPath = ele.key;
2401
- if (parentPath) {
2402
- newParentPath = parentPath + "." + ele.key;
2403
- }
2404
- var keyHasSearchTerm = suggestions.replaceDiacritics(ele.key).toLowerCase().includes(suggestions.replaceDiacritics(_this.$data.searchTerm).toLowerCase()) || helper.recLookup(_this.$data.selectedValues, newParentPath, constants.TREELIST_VALUES_PATH_SEPARATOR);
2405
- if (isLeafItem && keyHasSearchTerm) {
2406
- result.push(_rollupPluginBabelHelpers._extends({}, ele, {
2407
- initiallyExpanded: keyHasSearchTerm
2408
- }));
2409
- } else if (!isLeafItem) {
2410
- var filteredChildrenItems = _this.filterDataBasedOnSearchTerm(ele.list, newParentPath);
2411
- if (keyHasSearchTerm || !!filteredChildrenItems.length) {
2412
- result.push(_rollupPluginBabelHelpers._extends({}, ele, {
2413
- initiallyExpanded: keyHasSearchTerm || !!filteredChildrenItems.length,
2414
- list: filteredChildrenItems
2415
- }));
2416
- }
2417
- }
2418
- });
2419
- return result;
2420
- },
2421
- getComponent: function getComponent() {
2422
- var _this$$props6 = this.$props,
2423
- rawData = _this$$props6.rawData,
2424
- error = _this$$props6.error,
2425
- isLoading = _this$$props6.isLoading;
2426
- var data = {
2427
- data: this.getTransformedData(),
2428
- rawData: rawData,
2429
- error: error,
2430
- handleClick: this.handleListItemClick,
2431
- value: this.$data.selectedValues,
2432
- loading: isLoading,
2433
- PATH_SEPARATOR: constants.TREELIST_VALUES_PATH_SEPARATOR
2434
- };
2435
- return this.$slots.render(data) || helper.getComponent(data, this.$props);
2436
- },
2437
- getDefaultQuery: function getDefaultQuery(value) {
2438
- var _this2 = this;
2439
- var query = null;
2440
- var type = 'term';
2441
- var booleanAggregator = this.$props.queryFormat === 'or' ? 'should' : 'must';
2442
- if (!Array.isArray(value) || value.length === 0) {
2443
- return null;
2444
- }
2445
- if (value) {
2446
- var _bool;
2447
- // adds a sub-query with must as an array of objects for each term/value
2448
- var queryArray = value.map(function (item) {
2449
- return {
2450
- bool: {
2451
- must: item.split(' > ').map(function (subItem, i) {
2452
- var _type, _ref2;
2453
- return _ref2 = {}, _ref2[type] = (_type = {}, _type[_this2.$props.dataField[i]] = subItem, _type), _ref2;
2454
- })
2455
- }
2456
- };
2457
- });
2458
- var listQuery = {
2459
- bool: (_bool = {}, _bool[booleanAggregator] = queryArray, _bool)
2460
- };
2461
- query = value.length ? listQuery : null;
2462
- }
2463
- if (query && this.$props.nestedField) {
2464
- return {
2465
- nested: {
2466
- path: this.$props.nestedField,
2467
- query: query
2468
- }
2469
- };
2470
- }
2471
- return query;
2472
- },
2473
- updateQuery: function updateQuery(value) {
2474
- var customQuery = this.$props.customQuery;
2475
- var query = this.getDefaultQuery(value);
2476
- var customQueryOptions;
2477
- if (customQuery) {
2478
- var _ref3 = customQuery(value, this.$props) || {};
2479
- query = _ref3.query;
2480
- customQueryOptions = helper.getOptionsFromQuery(customQuery(value, this.$props));
2481
- helper.updateCustomQuery(this.$props.componentId, this.$props, value);
2482
- }
2483
- this.setQueryOptions(this.$props.componentId, _rollupPluginBabelHelpers._extends({}, this.generateQueryOptions(), customQueryOptions));
2484
- this.updateQueryAction({
2485
- componentId: this.$props.componentId,
2486
- query: query,
2487
- value: value,
2488
- label: this.$props.filterLabel,
2489
- showFilter: this.$props.showFilter,
2490
- URLParams: this.$props.URLParams,
2491
- componentType: constants.componentTypes.treeList
2492
- });
2493
- },
2494
- setValue: function setValue(value, hasMountedParam) {
2495
- var _this3 = this;
2496
- if (hasMountedParam === void 0) {
2497
- hasMountedParam = true;
2498
- }
2499
- var finalValues = Array.isArray(value) === false ? helper.transformTreeListLocalStateIntoQueryComptaibleFormat(value) : value;
2500
- var performUpdate = function performUpdate() {
2501
- var handleUpdates = function handleUpdates() {
2502
- _this3.updateQuery(finalValues);
2503
- if (_this3.$props.onValueChange) _this3.$props.onValueChange(finalValues);
2504
- };
2505
- if (hasMountedParam) {
2506
- _this3.selectedValues = Array.isArray(value) ? transformValueIntoLocalState(value) : value;
2507
- handleUpdates();
2508
- } else {
2509
- handleUpdates();
2510
- }
2511
- };
2512
- helper.checkValueChange(this.$props.componentId, finalValues, this.$props.beforeValueChange, performUpdate);
2513
- },
2514
- generateQueryOptions: function generateQueryOptions() {
2515
- var queryOptions = helper.getQueryOptions(this.$props);
2516
- var valueArray = helper.transformTreeListLocalStateIntoQueryComptaibleFormat(this.selectedValues);
2517
- return helper.getAggsQuery(valueArray, queryOptions, this.$props);
2518
- },
2519
- updateDefaultQuery: function updateDefaultQuery(queryOptions) {
2520
- var value = helper.transformTreeListLocalStateIntoQueryComptaibleFormat(this.selectedValues);
2521
- // Update default query for RS API
2522
- helper.updateDefaultQuery(this.$props.componentId, this.$props, value);
2523
- helper.updateInternalQuery(transform.getInternalComponentID(this.$props.componentId), queryOptions, value, this.$props, this.generateQueryOptions(), null);
2524
- },
2525
- updateQueryOptions: function updateQueryOptions() {
2526
- // for a new query due to other changes don't append after to get fresh results
2527
- var queryOptions = this.generateQueryOptions(this.$props, {}, helper.transformTreeListLocalStateIntoQueryComptaibleFormat(this.$data.selectedValues));
2528
- if (this.$props.defaultQuery) {
2529
- // eslint-disable-next-line no-use-before-define
2530
- this.updateDefaultQuery(queryOptions);
2531
- } else {
2532
- this.setQueryOptions(transform.getInternalComponentID(this.$props.componentId), queryOptions);
2533
- }
2534
- }
2535
- },
2536
- render: function render() {
2537
- var _this4 = this;
2538
- var props = this.$props;
2539
- var style = props.style,
2540
- className = props.className,
2541
- mode = props.mode,
2542
- showLine = props.showLine,
2543
- renderItem = props.renderItem,
2544
- showCheckbox = props.showCheckbox,
2545
- innerClass = props.innerClass,
2546
- showRadio = props.showRadio,
2547
- showCount = props.showCount,
2548
- showSwitcherIcon = props.showSwitcherIcon,
2549
- switcherIcon = props.switcherIcon,
2550
- title = props.title,
2551
- loader = props.loader,
2552
- renderError = props.renderError;
2553
- if (this.isLoading) {
2554
- return (this.$slots.loader ? this.$slots.loader() : loader) || null;
2555
- }
2556
- if (this.error) {
2557
- if (this.$slots.renderError) {
2558
- return this.$slots.renderError(this.error);
2559
- }
2560
- return helper.isFunction(renderError) ? renderError(this.error) : renderError;
2561
- }
2562
- var transformedData = this.getTransformedData();
2563
- if (!transformedData || transformedData.length === 0) {
2564
- return this.$slots.renderNoResults ? this.$slots.renderNoResults() : null;
2565
- }
2566
- return vue.createVNode(Container.Container, {
2567
- "style": style,
2568
- "class": className
2569
- }, {
2570
- "default": function _default() {
2571
- return [props.title && vue.createVNode(Title.Title, {
2572
- "class": helper.getClassName(innerClass, 'title') || null
2573
- }, _isSlot$2(title) ? title : {
2574
- "default": function _default() {
2575
- return [title];
2576
- }
2577
- }), _this4.renderSearch(), _this4.hasCustomRenderer ? _this4.getComponent() : vue.createVNode(HierarchicalMenuComponent, {
2578
- "key": "initial-node",
2579
- "listArray": transformedData,
2580
- "parentPath": "",
2581
- "isExpanded": true,
2582
- "listItemProps": {
2583
- mode: mode,
2584
- selectedValues: _this4.selectedValues,
2585
- searchTerm: _this4.searchTerm,
2586
- showLine: showLine,
2587
- renderItem: renderItem != null ? renderItem : _this4.$slots.renderItem,
2588
- handleListItemClick: _this4.handleListItemClick,
2589
- showCheckbox: showCheckbox,
2590
- innerClass: innerClass,
2591
- showRadio: showRadio,
2592
- renderIcon: _this4.renderIcon,
2593
- showCount: showCount,
2594
- showSwitcherIcon: showSwitcherIcon,
2595
- switcherIcon: switcherIcon != null ? switcherIcon : _this4.$slots.switcherIcon
2596
- }
2597
- }, null)];
2598
- }
2599
- });
2600
- }
2601
- };
2602
- var mapStateToProps$1 = function mapStateToProps(state, props) {
2603
- return {
2604
- selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
2605
- rawData: state.rawData[props.componentId] || {},
2606
- aggregationData: props.nestedField && state.aggregations[props.componentId] ? state.aggregations[props.componentId].reactivesearch_nested : state.aggregations[props.componentId] || {},
2607
- themePreset: state.config.themePreset,
2608
- error: state.error[props.componentId],
2609
- isLoading: state.isLoading[props.componentId],
2610
- enableAppbase: state.config.enableAppbase
2611
- };
2612
- };
2613
- var mapDispatchtoProps = {
2614
- setQueryOptions: setQueryOptions,
2615
- updateQueryAction: updateQueryAction
2616
- };
2617
- TreeList.hasInternalComponent = function () {
2618
- return true;
2619
- };
2620
- var TreeListConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchtoProps)(TreeList), {
2621
- componentType: constants.componentTypes.treeList,
2622
- internalComponent: TreeList.hasInternalComponent()
2623
- }));
2624
- TreeListConnected.name = TreeList.name;
2625
- TreeListConnected.install = function (Vue) {
2626
- Vue.component(TreeListConnected.name, TreeListConnected);
2627
- };
2628
-
2629
- // Add componentType for SSR
2630
- TreeListConnected.componentType = constants.componentTypes.treeList;
2631
-
2632
- var RcConnected = PreferencesConsumer.PreferencesConsumer({
2633
- name: 'RcConnected',
2634
- render: function render() {
2635
- var component = ReactiveComponent.default;
2636
- switch (this.$attrs.componentType) {
2637
- case constants.componentTypes.reactiveList:
2638
- component = ReactiveList.default;
2639
- break;
2640
- case constants.componentTypes.searchBox:
2641
- component = SBConnected;
2642
- break;
2643
- // list components
2644
- case constants.componentTypes.singleList:
2645
- component = SingleList.default;
2646
- break;
2647
- case constants.componentTypes.multiList:
2648
- component = MultiList.default;
2649
- break;
2650
- case constants.componentTypes.singleDropdownList:
2651
- component = SingleDropdownList.default;
2652
- break;
2653
- case constants.componentTypes.multiDropdownList:
2654
- component = MultiDropdownList.default;
2655
- break;
2656
- // basic components
2657
- case constants.componentTypes.toggleButton:
2658
- component = ToggleButton.default;
2659
- break;
2660
- // range components
2661
- case constants.componentTypes.dynamicRangeSlider:
2662
- component = DynamicRangeSlider.default;
2663
- break;
2664
- case constants.componentTypes.singleRange:
2665
- component = SingleRange.default;
2666
- break;
2667
- case constants.componentTypes.multiRange:
2668
- component = MultiRange.default;
2669
- break;
2670
- case constants.componentTypes.rangeSlider:
2671
- component = RangeSlider.default;
2672
- break;
2673
- case constants.componentTypes.rangeInput:
2674
- component = RangeInput.default;
2675
- break;
2676
- }
2677
- return vue.h(component, null, this.$slots);
2678
- }
2679
- });
2680
- RcConnected.name = ReactiveComponent.default.name;
2681
- RcConnected.hasInternalComponent = ReactiveComponent.default.hasInternalComponent;
2682
- // Add componentType for SSR
2683
- RcConnected.componentType = constants.componentTypes.reactiveComponent;
2684
- RcConnected.install = function (Vue) {
2685
- Vue.component(RcConnected.name, RcConnected);
2686
- };
2687
-
2688
- var components = [ReactiveList.default, ResultCard.default, ResultList.default, ReactiveBase.default, SBConnected, SingleList.default, MultiList.default, SingleRange.default, MultiRange.default, RangeSlider.default, DynamicRangeSlider.default, ReactiveComponent.default, RcConnected, SelectedFilters.default, ToggleButton.default, SingleDropdownList.default, MultiDropdownList.default, StateProvider.default, RangeInput.default, TreeListConnected];
2689
- function install (Vue) {
2690
- components.map(function (component) {
2691
- Vue.use(component);
2692
- return null;
2693
- });
2694
- }
2695
-
2696
- exports.ReactiveComponentPrivate = RcConnected;
2697
- exports.SearchBox = SBConnected;
2698
- exports.TreeList = TreeListConnected;
2699
- exports.install = install;
1852
+ exports.SBConnected = SBConnected;
1853
+ exports.default = SBConnected;