@elliemae/ds-query-builder 1.60.0 → 2.0.0-alpha.12

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 (210) hide show
  1. package/cjs/DSQueryBuilder.js +58 -151
  2. package/cjs/components/AndOrController/AndOrController.js +126 -162
  3. package/cjs/components/ConditionController/ConditionController.js +40 -60
  4. package/cjs/components/DisplayOutput/DisplayOutput.js +62 -83
  5. package/cjs/components/DragContainerController/DragContainerController.js +20 -21
  6. package/cjs/components/DragControllerRow/DragControllerRow.js +33 -23
  7. package/cjs/components/FieldControllerRow/FieldControllerRow.js +14 -19
  8. package/cjs/components/Nestable/Nestable.js +243 -283
  9. package/cjs/components/Nestable/NestableItem.js +61 -52
  10. package/cjs/components/Nestable/actions/events.js +53 -35
  11. package/cjs/components/Nestable/actions/getItemOptions.js +14 -12
  12. package/cjs/components/Nestable/actions/getPaths.js +46 -38
  13. package/cjs/components/Nestable/actions/index.js +21 -26
  14. package/cjs/components/Nestable/actions/moveItem.js +26 -16
  15. package/cjs/components/Nestable/actions/paths.js +48 -40
  16. package/cjs/components/Nestable/actions/tryDecreaseDepth.js +12 -12
  17. package/cjs/components/Nestable/actions/tryIncreaseDepth.js +14 -14
  18. package/cjs/components/Nestable/index.js +2 -25
  19. package/cjs/components/QueryBuilderContext/QueryBuilderContext.js +1 -2
  20. package/cjs/components/QueryBuilderImpl.js +216 -283
  21. package/cjs/components/QueryBuilderItem/QueryBuilderItem.js +59 -77
  22. package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +154 -174
  23. package/cjs/components/ToolBarAnimation/ToolBarAnimation.js +16 -11
  24. package/cjs/components/format/format.js +27 -39
  25. package/cjs/components/format/sqlFormat.js +35 -32
  26. package/cjs/components/format/sqlSafeFormat.js +38 -35
  27. package/cjs/components/format/xmlFormat.js +35 -32
  28. package/cjs/components/helpers/actions.js +108 -93
  29. package/cjs/components/helpers/constants.js +3 -4
  30. package/cjs/components/helpers/dependencies.js +36 -26
  31. package/cjs/components/helpers/selectors.js +18 -19
  32. package/cjs/components/helpers/store.js +87 -109
  33. package/cjs/components/helpers/types.js +9 -10
  34. package/cjs/index.js +19 -76
  35. package/cjs/propTypes.js +4 -5
  36. package/esm/DSQueryBuilder.js +37 -130
  37. package/esm/components/AndOrController/AndOrController.js +120 -152
  38. package/esm/components/ConditionController/ConditionController.js +37 -57
  39. package/esm/components/DisplayOutput/DisplayOutput.js +61 -76
  40. package/esm/components/DragContainerController/DragContainerController.js +20 -21
  41. package/esm/components/DragControllerRow/DragControllerRow.js +27 -17
  42. package/esm/components/FieldControllerRow/FieldControllerRow.js +13 -18
  43. package/esm/components/Nestable/Nestable.js +235 -268
  44. package/esm/components/Nestable/NestableItem.js +58 -48
  45. package/esm/components/Nestable/actions/events.js +52 -34
  46. package/esm/components/Nestable/actions/getItemOptions.js +14 -12
  47. package/esm/components/Nestable/actions/getPaths.js +46 -33
  48. package/esm/components/Nestable/actions/index.js +0 -5
  49. package/esm/components/Nestable/actions/moveItem.js +23 -13
  50. package/esm/components/Nestable/actions/paths.js +48 -35
  51. package/esm/components/Nestable/actions/tryDecreaseDepth.js +12 -12
  52. package/esm/components/Nestable/actions/tryIncreaseDepth.js +14 -14
  53. package/esm/components/Nestable/index.js +0 -23
  54. package/esm/components/QueryBuilderContext/QueryBuilderContext.js +1 -2
  55. package/esm/components/QueryBuilderImpl.js +204 -265
  56. package/esm/components/QueryBuilderItem/QueryBuilderItem.js +52 -70
  57. package/esm/components/QueryBuilderRow/QueryBuilderRow.js +149 -164
  58. package/esm/components/ToolBarAnimation/ToolBarAnimation.js +16 -10
  59. package/esm/components/format/format.js +19 -27
  60. package/esm/components/format/sqlFormat.js +34 -31
  61. package/esm/components/format/sqlSafeFormat.js +37 -34
  62. package/esm/components/format/xmlFormat.js +34 -31
  63. package/esm/components/helpers/actions.js +100 -85
  64. package/esm/components/helpers/constants.js +3 -4
  65. package/esm/components/helpers/dependencies.js +33 -21
  66. package/esm/components/helpers/selectors.js +5 -6
  67. package/esm/components/helpers/store.js +84 -104
  68. package/esm/components/helpers/types.js +9 -10
  69. package/esm/index.js +0 -57
  70. package/esm/propTypes.js +1 -2
  71. package/package.json +173 -15
  72. package/types/DSQueryBuilder.d.ts +211 -0
  73. package/types/components/AndOrController/AndOrController.d.ts +38 -0
  74. package/types/components/ConditionController/ConditionController.d.ts +16 -0
  75. package/types/components/DisplayOutput/DisplayOutput.d.ts +7 -0
  76. package/types/components/DragContainerController/DragContainerController.d.ts +9 -0
  77. package/types/components/DragControllerRow/DragControllerRow.d.ts +9 -0
  78. package/types/components/FieldControllerRow/FieldControllerRow.d.ts +9 -0
  79. package/types/components/Nestable/Nestable.d.ts +51 -0
  80. package/types/components/Nestable/NestableItem.d.ts +12 -0
  81. package/types/components/Nestable/actions/events.d.ts +6 -0
  82. package/types/components/Nestable/actions/getItemOptions.d.ts +11 -0
  83. package/types/components/Nestable/actions/getPaths.d.ts +5 -0
  84. package/types/components/Nestable/actions/index.d.ts +6 -0
  85. package/types/components/Nestable/actions/moveItem.d.ts +5 -0
  86. package/types/components/Nestable/actions/paths.d.ts +5 -0
  87. package/types/components/Nestable/actions/tryDecreaseDepth.d.ts +1 -0
  88. package/types/components/Nestable/actions/tryIncreaseDepth.d.ts +1 -0
  89. package/types/components/Nestable/index.d.ts +2 -0
  90. package/types/components/QueryBuilderContext/QueryBuilderContext.d.ts +2 -0
  91. package/types/components/QueryBuilderImpl.d.ts +49 -0
  92. package/types/components/QueryBuilderItem/QueryBuilderItem.d.ts +5 -0
  93. package/types/components/QueryBuilderRow/QueryBuilderRow.d.ts +12 -0
  94. package/types/components/ToolBarAnimation/ToolBarAnimation.d.ts +3 -0
  95. package/types/components/format/format.d.ts +26 -0
  96. package/types/components/format/sqlFormat.d.ts +5 -0
  97. package/types/components/format/sqlSafeFormat.d.ts +6 -0
  98. package/types/components/format/xmlFormat.d.ts +5 -0
  99. package/types/components/helpers/actions.d.ts +63 -0
  100. package/types/components/helpers/constants.d.ts +3 -0
  101. package/types/components/helpers/dependencies.d.ts +1 -0
  102. package/types/components/helpers/selectors.d.ts +20 -0
  103. package/types/components/helpers/store.d.ts +144 -0
  104. package/types/components/helpers/types.d.ts +50 -0
  105. package/types/index.d.ts +2 -0
  106. package/types/propTypes.d.ts +156 -0
  107. package/DSQueryBuilder/package.json +0 -10
  108. package/cjs/DSQueryBuilder.js.map +0 -1
  109. package/cjs/components/AndOrController/AndOrController.js.map +0 -1
  110. package/cjs/components/ConditionController/ConditionController.js.map +0 -1
  111. package/cjs/components/DisplayOutput/DisplayOutput.js.map +0 -1
  112. package/cjs/components/DragContainerController/DragContainerController.js.map +0 -1
  113. package/cjs/components/DragControllerRow/DragControllerRow.js.map +0 -1
  114. package/cjs/components/FieldControllerRow/FieldControllerRow.js.map +0 -1
  115. package/cjs/components/Nestable/Nestable.js.map +0 -1
  116. package/cjs/components/Nestable/NestableItem.js.map +0 -1
  117. package/cjs/components/Nestable/actions/events.js.map +0 -1
  118. package/cjs/components/Nestable/actions/getItemOptions.js.map +0 -1
  119. package/cjs/components/Nestable/actions/getPaths.js.map +0 -1
  120. package/cjs/components/Nestable/actions/index.js.map +0 -1
  121. package/cjs/components/Nestable/actions/moveItem.js.map +0 -1
  122. package/cjs/components/Nestable/actions/paths.js.map +0 -1
  123. package/cjs/components/Nestable/actions/tryDecreaseDepth.js.map +0 -1
  124. package/cjs/components/Nestable/actions/tryIncreaseDepth.js.map +0 -1
  125. package/cjs/components/Nestable/index.js.map +0 -1
  126. package/cjs/components/QueryBuilderContext/QueryBuilderContext.js.map +0 -1
  127. package/cjs/components/QueryBuilderImpl.js.map +0 -1
  128. package/cjs/components/QueryBuilderItem/QueryBuilderItem.js.map +0 -1
  129. package/cjs/components/QueryBuilderRow/QueryBuilderRow.js.map +0 -1
  130. package/cjs/components/ToolBarAnimation/ToolBarAnimation.js.map +0 -1
  131. package/cjs/components/format/format.js.map +0 -1
  132. package/cjs/components/format/sqlFormat.js.map +0 -1
  133. package/cjs/components/format/sqlSafeFormat.js.map +0 -1
  134. package/cjs/components/format/xmlFormat.js.map +0 -1
  135. package/cjs/components/helpers/actions.js.map +0 -1
  136. package/cjs/components/helpers/constants.js.map +0 -1
  137. package/cjs/components/helpers/dependencies.js.map +0 -1
  138. package/cjs/components/helpers/selectors.js.map +0 -1
  139. package/cjs/components/helpers/store.js.map +0 -1
  140. package/cjs/components/helpers/types.js.map +0 -1
  141. package/cjs/index.js.map +0 -1
  142. package/cjs/propTypes.js.map +0 -1
  143. package/components/AndOrController/AndOrController/package.json +0 -10
  144. package/components/ConditionController/ConditionController/package.json +0 -10
  145. package/components/DisplayOutput/DisplayOutput/package.json +0 -10
  146. package/components/DragContainerController/DragContainerController/package.json +0 -10
  147. package/components/DragControllerRow/DragControllerRow/package.json +0 -10
  148. package/components/FieldControllerRow/FieldControllerRow/package.json +0 -10
  149. package/components/Nestable/Nestable/package.json +0 -10
  150. package/components/Nestable/NestableItem/package.json +0 -10
  151. package/components/Nestable/actions/events/package.json +0 -10
  152. package/components/Nestable/actions/getItemOptions/package.json +0 -10
  153. package/components/Nestable/actions/getPaths/package.json +0 -10
  154. package/components/Nestable/actions/moveItem/package.json +0 -10
  155. package/components/Nestable/actions/package.json +0 -10
  156. package/components/Nestable/actions/paths/package.json +0 -10
  157. package/components/Nestable/actions/tryDecreaseDepth/package.json +0 -10
  158. package/components/Nestable/actions/tryIncreaseDepth/package.json +0 -10
  159. package/components/Nestable/package.json +0 -10
  160. package/components/QueryBuilderContext/QueryBuilderContext/package.json +0 -10
  161. package/components/QueryBuilderImpl/package.json +0 -10
  162. package/components/QueryBuilderItem/QueryBuilderItem/package.json +0 -10
  163. package/components/QueryBuilderRow/QueryBuilderRow/package.json +0 -10
  164. package/components/ToolBarAnimation/ToolBarAnimation/package.json +0 -10
  165. package/components/format/format/package.json +0 -10
  166. package/components/format/sqlFormat/package.json +0 -10
  167. package/components/format/sqlSafeFormat/package.json +0 -10
  168. package/components/format/xmlFormat/package.json +0 -10
  169. package/components/helpers/actions/package.json +0 -10
  170. package/components/helpers/constants/package.json +0 -10
  171. package/components/helpers/dependencies/package.json +0 -10
  172. package/components/helpers/selectors/package.json +0 -10
  173. package/components/helpers/store/package.json +0 -10
  174. package/components/helpers/types/package.json +0 -10
  175. package/esm/DSQueryBuilder.js.map +0 -1
  176. package/esm/components/AndOrController/AndOrController.js.map +0 -1
  177. package/esm/components/ConditionController/ConditionController.js.map +0 -1
  178. package/esm/components/DisplayOutput/DisplayOutput.js.map +0 -1
  179. package/esm/components/DragContainerController/DragContainerController.js.map +0 -1
  180. package/esm/components/DragControllerRow/DragControllerRow.js.map +0 -1
  181. package/esm/components/FieldControllerRow/FieldControllerRow.js.map +0 -1
  182. package/esm/components/Nestable/Nestable.js.map +0 -1
  183. package/esm/components/Nestable/NestableItem.js.map +0 -1
  184. package/esm/components/Nestable/actions/events.js.map +0 -1
  185. package/esm/components/Nestable/actions/getItemOptions.js.map +0 -1
  186. package/esm/components/Nestable/actions/getPaths.js.map +0 -1
  187. package/esm/components/Nestable/actions/index.js.map +0 -1
  188. package/esm/components/Nestable/actions/moveItem.js.map +0 -1
  189. package/esm/components/Nestable/actions/paths.js.map +0 -1
  190. package/esm/components/Nestable/actions/tryDecreaseDepth.js.map +0 -1
  191. package/esm/components/Nestable/actions/tryIncreaseDepth.js.map +0 -1
  192. package/esm/components/Nestable/index.js.map +0 -1
  193. package/esm/components/QueryBuilderContext/QueryBuilderContext.js.map +0 -1
  194. package/esm/components/QueryBuilderImpl.js.map +0 -1
  195. package/esm/components/QueryBuilderItem/QueryBuilderItem.js.map +0 -1
  196. package/esm/components/QueryBuilderRow/QueryBuilderRow.js.map +0 -1
  197. package/esm/components/ToolBarAnimation/ToolBarAnimation.js.map +0 -1
  198. package/esm/components/format/format.js.map +0 -1
  199. package/esm/components/format/sqlFormat.js.map +0 -1
  200. package/esm/components/format/sqlSafeFormat.js.map +0 -1
  201. package/esm/components/format/xmlFormat.js.map +0 -1
  202. package/esm/components/helpers/actions.js.map +0 -1
  203. package/esm/components/helpers/constants.js.map +0 -1
  204. package/esm/components/helpers/dependencies.js.map +0 -1
  205. package/esm/components/helpers/selectors.js.map +0 -1
  206. package/esm/components/helpers/store.js.map +0 -1
  207. package/esm/components/helpers/types.js.map +0 -1
  208. package/esm/index.js.map +0 -1
  209. package/esm/propTypes.js.map +0 -1
  210. package/propTypes/package.json +0 -10
@@ -1,376 +1,309 @@
1
1
  'use strict';
2
2
 
3
- var _extends = require('@babel/runtime/helpers/extends');
3
+ require('core-js/modules/esnext.async-iterator.filter.js');
4
+ require('core-js/modules/esnext.iterator.constructor.js');
5
+ require('core-js/modules/esnext.iterator.filter.js');
6
+ require('core-js/modules/esnext.async-iterator.for-each.js');
7
+ require('core-js/modules/esnext.iterator.for-each.js');
8
+ var _jsx = require('@babel/runtime/helpers/jsx');
4
9
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
5
10
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
7
- var _createClass = require('@babel/runtime/helpers/createClass');
8
- var _inherits = require('@babel/runtime/helpers/inherits');
9
- var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
10
- var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
11
11
  var React = require('react');
12
- var components_Nestable_Nestable = require('./Nestable/Nestable.js');
13
- var components_QueryBuilderContext_QueryBuilderContext = require('./QueryBuilderContext/QueryBuilderContext.js');
14
- var components_helpers_types = require('./helpers/types.js');
15
- var components_helpers_store = require('./helpers/store.js');
16
- var components_AndOrController_AndOrController = require('./AndOrController/AndOrController.js');
17
- var components_QueryBuilderItem_QueryBuilderItem = require('./QueryBuilderItem/QueryBuilderItem.js');
18
- var components_DisplayOutput_DisplayOutput = require('./DisplayOutput/DisplayOutput.js');
19
- require('@babel/runtime/helpers/assertThisInitialized');
20
- require('prop-types');
21
- require('classnames');
22
- require('@elliemae/ds-shared/utils');
23
- require('@elliemae/ds-utilities');
24
- require('./Nestable/actions/tryIncreaseDepth.js');
25
- require('./Nestable/actions/tryDecreaseDepth.js');
26
- require('./Nestable/actions/moveItem.js');
27
- require('react-addons-update');
28
- require('./Nestable/actions/paths.js');
29
- require('@babel/runtime/helpers/toConsumableArray');
30
- require('./Nestable/actions/events.js');
31
- require('./Nestable/actions/getItemOptions.js');
32
- require('./Nestable/NestableItem.js');
33
- require('./helpers/actions.js');
34
- require('./format/format.js');
35
- require('./format/sqlFormat.js');
36
- require('./format/xmlFormat.js');
37
- require('./format/sqlSafeFormat.js');
38
- require('@elliemae/ds-classnames');
39
- require('@elliemae/ds-tooltip');
40
- require('@elliemae/ds-popper');
41
- require('@elliemae/ds-form');
42
- require('@elliemae/ds-button');
43
- require('@elliemae/ds-icons');
44
- require('@elliemae/ds-icon');
45
- require('./helpers/constants.js');
46
- require('./ToolBarAnimation/ToolBarAnimation.js');
47
- require('@elliemae/ds-shared/Animations/GrowRight');
48
- require('./DragContainerController/DragContainerController.js');
49
- require('./QueryBuilderRow/QueryBuilderRow.js');
50
- require('./helpers/dependencies.js');
51
- require('lodash');
52
- require('@elliemae/ds-utilities/operators');
53
- require('./ConditionController/ConditionController.js');
54
- require('./DragControllerRow/DragControllerRow.js');
55
- require('@babel/runtime/helpers/typeof');
56
- require('@elliemae/ds-grid');
57
- require('@elliemae/ds-accordion');
12
+ var Nestable = require('./Nestable/Nestable.js');
13
+ var QueryBuilderContext = require('./QueryBuilderContext/QueryBuilderContext.js');
14
+ var types = require('./helpers/types.js');
15
+ var store = require('./helpers/store.js');
16
+ var AndOrController = require('./AndOrController/AndOrController.js');
17
+ var QueryBuilderItem = require('./QueryBuilderItem/QueryBuilderItem.js');
18
+ var DisplayOutput = require('./DisplayOutput/DisplayOutput.js');
19
+ var jsxRuntime = require('react/jsx-runtime');
58
20
 
59
21
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
60
22
 
61
- var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
23
+ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
62
24
  var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
63
25
  var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
64
- var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
65
- var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
66
- var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
67
- var _possibleConstructorReturn__default = /*#__PURE__*/_interopDefaultLegacy(_possibleConstructorReturn);
68
- var _getPrototypeOf__default = /*#__PURE__*/_interopDefaultLegacy(_getPrototypeOf);
69
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
70
26
 
71
- var _excluded = ["format"];
27
+ const _excluded = ["format"];
72
28
 
73
29
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
74
30
 
75
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
31
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
76
32
 
77
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
33
+ class QueryBuilderImpl extends React.Component {
34
+ constructor(props) {
35
+ super(props);
36
+ this.isDraggableItem = true;
78
37
 
79
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
80
-
81
- var QueryBuilderImpl = /*#__PURE__*/function (_Component) {
82
- _inherits__default['default'](QueryBuilderImpl, _Component);
83
-
84
- var _super = _createSuper(QueryBuilderImpl);
85
-
86
- function QueryBuilderImpl(props) {
87
- var _this;
88
-
89
- _classCallCheck__default['default'](this, QueryBuilderImpl);
90
-
91
- _this = _super.call(this, props);
92
- _this.isDraggableItem = true;
93
-
94
- _this.onOrderDragAndDrop = function (items, item) {
95
- var newFilters = _this.store.onOrderDragAndDrop(items, item);
96
-
97
- _this.sendCall('reOrderOnDragAndDrop', {
98
- items: items
38
+ this.onOrderDragAndDrop = (items, item) => {
39
+ const newFilters = this.store.onOrderDragAndDrop(items, item);
40
+ this.sendCall('reOrderOnDragAndDrop', {
41
+ items
99
42
  });
100
-
101
- _this.sendChange(newFilters);
43
+ this.sendChange(newFilters);
102
44
  };
103
45
 
104
- _this.onAddFilterToGroup = function (idGroup) {
105
- var newFilters = _this.store.addFilter(idGroup);
106
-
107
- _this.sendCall('onAddFilterToGroup', {
108
- idGroup: idGroup
46
+ this.onAddFilterToGroup = idGroup => {
47
+ const newFilters = this.store.addFilter(idGroup);
48
+ this.sendCall('onAddFilterToGroup', {
49
+ idGroup
109
50
  });
110
-
111
- _this.sendChange(newFilters);
51
+ this.sendChange(newFilters);
112
52
  };
113
53
 
114
- _this.onAddFilter = function (idGroup, idFilter) {
115
- var addFilterMethod = _this.props.addFilterMethod;
116
- var newFilters = addFilterMethod === components_helpers_types.QB_ADD_FILTER_METHOD_TYPES.IN_PLACE ? _this.store.addFilterNextToFilterId(idGroup, idFilter) : _this.onAddFilterToGroup(idGroup);
117
-
118
- _this.sendCall('onAddFilter', {
119
- idGroup: idGroup,
120
- idFilter: idFilter
54
+ this.onAddFilter = (idGroup, idFilter) => {
55
+ const {
56
+ addFilterMethod
57
+ } = this.props;
58
+ const newFilters = addFilterMethod === types.QB_ADD_FILTER_METHOD_TYPES.IN_PLACE ? this.store.addFilterNextToFilterId(idGroup, idFilter) : this.onAddFilterToGroup(idGroup);
59
+ this.sendCall('onAddFilter', {
60
+ idGroup,
61
+ idFilter
121
62
  });
122
-
123
- _this.sendChange(newFilters);
63
+ this.sendChange(newFilters);
124
64
  };
125
65
 
126
- _this.onAddRuleContainer = function (idGroup, idFilter) {
127
- var groupFilterMethod = _this.props.groupFilterMethod;
128
- var newFilters = groupFilterMethod === components_helpers_types.QB_GROUP_FILTER_METHOD_TYPES.IN_PLACE ? _this.store.addRuleContainerInPlace(idGroup, idFilter) : _this.store.addRuleContainer(idGroup, idFilter);
129
-
130
- _this.sendCall('onAddRuleContainer', {
131
- idGroup: idGroup,
132
- idFilter: idFilter
66
+ this.onAddRuleContainer = (idGroup, idFilter) => {
67
+ const {
68
+ groupFilterMethod
69
+ } = this.props;
70
+ const newFilters = groupFilterMethod === types.QB_GROUP_FILTER_METHOD_TYPES.IN_PLACE ? this.store.addRuleContainerInPlace(idGroup, idFilter) : this.store.addRuleContainer(idGroup, idFilter);
71
+ this.sendCall('onAddRuleContainer', {
72
+ idGroup,
73
+ idFilter
133
74
  });
134
-
135
- _this.sendChange(newFilters);
75
+ this.sendChange(newFilters);
136
76
  };
137
77
 
138
- _this.onRemoveFilter = function (idFilter) {
139
- var newFilters = _this.store.onRemoveFilter(idFilter);
140
-
141
- _this.sendCall('onRemoveFilter', {
142
- idFilter: idFilter
78
+ this.onRemoveFilter = idFilter => {
79
+ const newFilters = this.store.onRemoveFilter(idFilter);
80
+ this.sendCall('onRemoveFilter', {
81
+ idFilter
143
82
  });
144
-
145
- _this.sendChange(newFilters);
83
+ this.sendChange(newFilters);
146
84
  };
147
85
 
148
- _this.handleFieldChange = function (data) {
149
- var fieldsSharedActions = _this.props.fieldsSharedActions;
150
-
151
- var newFilters = _this.store.changeFilter(_objectSpread(_objectSpread({}, data), {}, {
152
- fieldsSharedActions: fieldsSharedActions
86
+ this.handleFieldChange = data => {
87
+ const {
88
+ fieldsSharedActions
89
+ } = this.props;
90
+ const newFilters = this.store.changeFilter(_objectSpread(_objectSpread({}, data), {}, {
91
+ fieldsSharedActions
153
92
  }));
154
-
155
- _this.sendCall('handleFieldChange', {
156
- data: data
93
+ this.sendCall('handleFieldChange', {
94
+ data
157
95
  });
158
-
159
- _this.sendChange(newFilters);
96
+ this.sendChange(newFilters);
160
97
  };
161
98
 
162
- _this.handleRuleContainerOperator = function (idGroup, value) {
163
- var newFilters = _this.store.changeGroupOperator(idGroup, value);
164
-
165
- _this.sendCall('handleRuleContainerOperator', {
166
- idGroup: idGroup,
167
- value: value
99
+ this.handleRuleContainerOperator = (idGroup, value) => {
100
+ const newFilters = this.store.changeGroupOperator(idGroup, value);
101
+ this.sendCall('handleRuleContainerOperator', {
102
+ idGroup,
103
+ value
168
104
  });
169
-
170
- _this.sendChange(newFilters);
105
+ this.sendChange(newFilters);
171
106
  };
172
107
 
173
- _this.handleRuleContainerUnGroup = function (idGroup) {
174
- var newFilters = _this.store.unGroup(idGroup);
175
-
176
- _this.sendCall('handleRuleContainerUnGroup', {
177
- idGroup: idGroup
108
+ this.handleRuleContainerUnGroup = idGroup => {
109
+ const newFilters = this.store.unGroup(idGroup);
110
+ this.sendCall('handleRuleContainerUnGroup', {
111
+ idGroup
178
112
  });
179
-
180
- _this.sendChange(newFilters);
113
+ this.sendChange(newFilters);
181
114
  };
182
115
 
183
- _this.handleDropFilter = function (filter, dragTo) {
184
- var oldPosition = filter.position,
185
- idGroup = filter.idGroup,
186
- idFilter = filter.idFilter;
187
- var newPosition = dragTo.position,
188
- targetIdGroup = dragTo.targetIdGroup;
189
-
190
- var newFilters = _this.store.reOrderFilter(idFilter, idGroup, oldPosition, newPosition, targetIdGroup);
191
-
192
- _this.sendCall('handleDropFilter', {
193
- filter: filter,
194
- dragTo: dragTo
116
+ this.handleDropFilter = (filter, dragTo) => {
117
+ const {
118
+ position: oldPosition,
119
+ idGroup,
120
+ idFilter
121
+ } = filter;
122
+ const {
123
+ position: newPosition,
124
+ targetIdGroup
125
+ } = dragTo;
126
+ const newFilters = this.store.reOrderFilter(idFilter, idGroup, oldPosition, newPosition, targetIdGroup);
127
+ this.sendCall('handleDropFilter', {
128
+ filter,
129
+ dragTo
195
130
  });
196
-
197
- _this.sendChange(newFilters);
131
+ this.sendChange(newFilters);
198
132
  };
199
133
 
200
- _this.handleDropGroup = function (group, dragTo) {
201
- var oldPosition = group.position,
202
- idFilter = group.idFilter,
203
- idGroup = group.idGroup;
204
- var newPosition = dragTo.position,
205
- targetIdGroup = dragTo.targetIdGroup;
206
-
207
- var newFilters = _this.store.reOrderFilter(idFilter, idGroup, oldPosition, newPosition, targetIdGroup);
208
-
209
- _this.sendCall('handleDropGroup', {
210
- group: group,
211
- dragTo: dragTo
134
+ this.handleDropGroup = (group, dragTo) => {
135
+ const {
136
+ position: oldPosition,
137
+ idFilter,
138
+ idGroup
139
+ } = group;
140
+ const {
141
+ position: newPosition,
142
+ targetIdGroup
143
+ } = dragTo;
144
+ const newFilters = this.store.reOrderFilter(idFilter, idGroup, oldPosition, newPosition, targetIdGroup);
145
+ this.sendCall('handleDropGroup', {
146
+ group,
147
+ dragTo
212
148
  });
213
-
214
- _this.sendChange(newFilters);
149
+ this.sendChange(newFilters);
215
150
  };
216
151
 
217
- _this.handleDrop = function (dragElement, dragTo) {
218
- var type = dragElement.type;
219
- if (type === components_helpers_types.QB_DRAG_TYPES.FILTER) return _this.handleDropFilter(dragElement, dragTo);
220
- return _this.handleDropGroup(dragElement, dragTo);
152
+ this.handleDrop = (dragElement, dragTo) => {
153
+ const {
154
+ type
155
+ } = dragElement;
156
+ if (type === types.QB_DRAG_TYPES.FILTER) return this.handleDropFilter(dragElement, dragTo);
157
+ return this.handleDropGroup(dragElement, dragTo);
221
158
  };
222
159
 
223
- _this.sendChange = function (_ref) {
224
- var format = _ref.format,
225
- newFilters = _objectWithoutProperties__default['default'](_ref, _excluded);
160
+ this.sendChange = _ref => {
161
+ let {
162
+ format
163
+ } = _ref,
164
+ newFilters = _objectWithoutProperties__default["default"](_ref, _excluded);
226
165
 
227
- _this.setState(_objectSpread({
228
- format: format
166
+ this.setState(_objectSpread({
167
+ format
229
168
  }, newFilters));
230
-
231
- var onChange = _this.props.onChange;
169
+ const {
170
+ onChange
171
+ } = this.props;
232
172
  onChange(format, newFilters);
233
173
  };
234
174
 
235
- _this.sendCall = function (action, data) {
236
- var callback = _this.props[action];
175
+ this.sendCall = (action, data) => {
176
+ const {
177
+ [action]: callback
178
+ } = this.props;
237
179
  if (callback) callback(data);
238
180
  };
239
181
 
240
- _this.setDraggableItems = function (drag) {
241
- _this.isDraggableItem = true;
182
+ this.setDraggableItems = drag => {
183
+ this.isDraggableItem = true;
242
184
 
243
185
  try {
244
- var ua = window.navigator.userAgent;
245
- var msie = ua.indexOf('MSIE '); // eslint-disable-next-line no-useless-escape
186
+ const ua = window.navigator.userAgent;
187
+ const msie = ua.indexOf('MSIE '); // eslint-disable-next-line no-useless-escape
246
188
 
247
189
  if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
248
- var isDraggableItem = _this.state.isDraggableItem;
190
+ const {
191
+ isDraggableItem
192
+ } = this.state;
249
193
 
250
194
  if (drag !== isDraggableItem) {
251
- _this.setState({
195
+ this.setState({
252
196
  isDraggableItem: drag
253
197
  });
254
198
  }
255
199
 
256
- _this.isDraggableItem = drag;
200
+ this.isDraggableItem = drag;
257
201
  }
258
202
  } catch (error) {
259
- _this.isDraggableItem = true;
203
+ this.isDraggableItem = true;
260
204
  }
261
205
  };
262
206
 
263
- _this.store = new components_helpers_store(props.init, props.format);
264
- _this.state = _this.store.getInitialState();
265
- return _this;
207
+ this.store = new store(props.init, props.format);
208
+ this.state = this.store.getInitialState();
266
209
  }
267
210
 
268
- _createClass__default['default'](QueryBuilderImpl, [{
269
- key: "componentDidUpdate",
270
- value: function componentDidUpdate() {
271
- if (QueryBuilderImpl.recalculateStore) {
272
- this.store = QueryBuilderImpl.recalculateStore;
273
- QueryBuilderImpl.recalculateStore = null;
274
- }
211
+ static getDerivedStateFromProps(props, state) {
212
+ if (props.init && props.init.step !== undefined && Number.isInteger(props.init.step) && props.init.step !== state.step) {
213
+ const store$1 = new store(props.init, props.format);
214
+ QueryBuilderImpl.recalculateStore = store$1;
215
+ return store$1.getInitialState();
275
216
  }
276
- }, {
277
- key: "render",
278
- value: function render() {
279
- var _this2 = this;
280
-
281
- var _this$state = this.state,
282
- mapGroups = _this$state.mapGroups,
283
- main = _this$state.main,
284
- mapFilters = _this$state.mapFilters,
285
- step = _this$state.step,
286
- items = _this$state.items,
287
- format = _this$state.format;
288
- var _this$props = this.props,
289
- containerProps = _this$props.containerProps,
290
- ruleContainerClassName = _this$props.ruleContainerClassName,
291
- fields = _this$props.fields,
292
- displayFixedOutput = _this$props.displayFixedOutput,
293
- displayOutput = _this$props.displayOutput,
294
- displayOutputLabel = _this$props.displayOutputLabel,
295
- singleRow = _this$props.singleRow,
296
- toolTipZIndex = _this$props.toolTipZIndex; // const { children } = items[0]
297
-
298
- var condition = mapGroups[main].condition;
299
- return /*#__PURE__*/React__default['default'].createElement(components_QueryBuilderContext_QueryBuilderContext.QueryBuilderContext.Provider, {
300
- value: {
301
- toolTipZIndex: toolTipZIndex,
302
- fields: fields,
303
- handleDrop: this.handleDrop,
304
- handleFieldChange: this.handleFieldChange,
305
- handleRuleContainerOperator: this.handleRuleContainerOperator,
306
- handleRuleContainerUnGroup: this.handleRuleContainerUnGroup,
307
- mapFilters: mapFilters,
308
- mapGroups: mapGroups,
309
- onAddFilter: this.onAddFilter,
310
- onAddFilterToGroup: this.onAddFilterToGroup,
311
- onAddRuleContainer: this.onAddRuleContainer,
312
- onRemoveFilter: this.onRemoveFilter,
313
- ruleContainerClassName: ruleContainerClassName,
314
- showDragController: false,
315
- format: format,
316
- step: step,
317
- items: items,
318
- isDraggableItem: this.isDraggableItem,
319
- setDraggableItems: this.setDraggableItems,
320
- singleRow: singleRow
321
- }
322
- }, /*#__PURE__*/React__default['default'].createElement("div", _extends__default['default']({}, containerProps, {
323
- className: "nested-main-group ".concat(condition !== true ? 'is-or-group' : 'is-and-groupL', " ").concat(singleRow ? 'query-main-single-row' : 'query-main-multiple-row')
324
- }), /*#__PURE__*/React__default['default'].createElement(components_Nestable_Nestable, {
217
+
218
+ return null;
219
+ }
220
+
221
+ componentDidUpdate() {
222
+ if (QueryBuilderImpl.recalculateStore) {
223
+ this.store = QueryBuilderImpl.recalculateStore;
224
+ QueryBuilderImpl.recalculateStore = null;
225
+ }
226
+ }
227
+
228
+ render() {
229
+ const {
230
+ mapGroups,
231
+ main,
232
+ mapFilters,
233
+ step,
234
+ items,
235
+ format
236
+ } = this.state;
237
+ const {
238
+ containerProps,
239
+ ruleContainerClassName,
240
+ fields,
241
+ displayFixedOutput,
242
+ displayOutput,
243
+ displayOutputLabel,
244
+ singleRow,
245
+ toolTipZIndex
246
+ } = this.props; // const { children } = items[0]
247
+
248
+ const {
249
+ condition
250
+ } = mapGroups[main];
251
+ return /*#__PURE__*/_jsx__default["default"](QueryBuilderContext.QueryBuilderContext.Provider, {
252
+ value: {
253
+ toolTipZIndex,
254
+ fields,
255
+ handleDrop: this.handleDrop,
256
+ handleFieldChange: this.handleFieldChange,
257
+ handleRuleContainerOperator: this.handleRuleContainerOperator,
258
+ handleRuleContainerUnGroup: this.handleRuleContainerUnGroup,
259
+ mapFilters,
260
+ mapGroups,
261
+ onAddFilter: this.onAddFilter,
262
+ onAddFilterToGroup: this.onAddFilterToGroup,
263
+ onAddRuleContainer: this.onAddRuleContainer,
264
+ onRemoveFilter: this.onRemoveFilter,
265
+ ruleContainerClassName,
266
+ showDragController: false,
267
+ format,
268
+ step,
269
+ items,
270
+ isDraggableItem: this.isDraggableItem,
271
+ setDraggableItems: this.setDraggableItems,
272
+ singleRow
273
+ }
274
+ }, void 0, /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
275
+ className: "nested-main-group ".concat(condition !== true ? 'is-or-group' : 'is-and-groupL', " ").concat(singleRow ? 'query-main-single-row' : 'query-main-multiple-row'),
276
+ children: [/*#__PURE__*/_jsx__default["default"](Nestable, {
325
277
  isAndItem: condition === true,
326
278
  isDraggableItem: this.isDraggableItem,
327
279
  isOrItem: condition !== true,
328
280
  items: items,
329
281
  onChange: this.onOrderDragAndDrop,
330
- renderItem: components_QueryBuilderItem_QueryBuilderItem,
282
+ renderItem: QueryBuilderItem,
331
283
  setDraggableItems: this.setDraggableItems,
332
284
  step: step,
333
285
  singleRow: singleRow
334
- }), !singleRow && /*#__PURE__*/React__default['default'].createElement("div", {
286
+ }), !singleRow && /*#__PURE__*/_jsx__default["default"]("div", {
335
287
  className: "rule-container-options"
336
- }, /*#__PURE__*/React__default['default'].createElement(components_AndOrController_AndOrController, {
288
+ }, void 0, /*#__PURE__*/_jsx__default["default"](AndOrController, {
337
289
  allowUnGroup: false,
338
290
  condition: condition,
339
- handleRuleContainerOperator: function handleRuleContainerOperator(value) {
340
- return _this2.handleRuleContainerOperator(main, value);
341
- },
342
- handleRuleContainerUnGroup: function handleRuleContainerUnGroup() {
343
- return _this2.handleRuleContainerUnGroup(main);
344
- },
291
+ handleRuleContainerOperator: value => this.handleRuleContainerOperator(main, value),
292
+ handleRuleContainerUnGroup: () => this.handleRuleContainerUnGroup(main),
345
293
  isMain: true,
346
- onAddFilter: function onAddFilter() {
347
- return _this2.onAddFilterToGroup(main);
348
- },
294
+ onAddFilter: () => this.onAddFilterToGroup(main),
349
295
  showDragController: false,
350
296
  step: step,
351
297
  toolTipZIndex: toolTipZIndex
352
- }))), (displayOutput || displayFixedOutput) && /*#__PURE__*/React__default['default'].createElement(components_DisplayOutput_DisplayOutput, {
353
- displayFixedOutput: displayFixedOutput,
354
- hideLabel: displayOutputLabel.hide,
355
- showLabel: displayOutputLabel.show,
356
- show: displayOutputLabel.open
357
- }));
358
- }
359
- }], [{
360
- key: "getDerivedStateFromProps",
361
- value: function getDerivedStateFromProps(props, state) {
362
- if (props.init && props.init.step !== undefined && Number.isInteger(props.init.step) && props.init.step !== state.step) {
363
- var store = new components_helpers_store(props.init, props.format);
364
- QueryBuilderImpl.recalculateStore = store;
365
- return store.getInitialState();
366
- }
367
-
368
- return null;
369
- }
370
- }]);
298
+ }))]
299
+ })), (displayOutput || displayFixedOutput) && /*#__PURE__*/_jsx__default["default"](DisplayOutput, {
300
+ displayFixedOutput: displayFixedOutput,
301
+ hideLabel: displayOutputLabel.hide,
302
+ showLabel: displayOutputLabel.show,
303
+ show: displayOutputLabel.open
304
+ }));
305
+ }
371
306
 
372
- return QueryBuilderImpl;
373
- }(React.Component);
307
+ }
374
308
 
375
309
  module.exports = QueryBuilderImpl;
376
- //# sourceMappingURL=QueryBuilderImpl.js.map