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