@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
@@ -3,7 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- var components_helpers_types = require('./types.js');
6
+ require('core-js/modules/esnext.async-iterator.find.js');
7
+ require('core-js/modules/esnext.iterator.constructor.js');
8
+ require('core-js/modules/esnext.iterator.find.js');
9
+ require('core-js/modules/esnext.async-iterator.for-each.js');
10
+ require('core-js/modules/esnext.iterator.for-each.js');
11
+ require('core-js/modules/esnext.async-iterator.filter.js');
12
+ require('core-js/modules/esnext.iterator.filter.js');
13
+ require('core-js/modules/esnext.async-iterator.map.js');
14
+ require('core-js/modules/esnext.iterator.map.js');
15
+ var types = require('./types.js');
7
16
 
8
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
18
 
@@ -11,7 +20,7 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
11
20
 
12
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; }
13
22
 
14
- 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; }
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__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; }
15
24
  /**
16
25
  * this is injected. instance of QBStore
17
26
  *
@@ -19,15 +28,15 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
19
28
  * @param idGroup
20
29
  */
21
30
 
22
- var createNewFilter = function createNewFilter(idGroup) {
23
- var idFilter = "filter_".concat(new Date().getTime(), "_").concat(Math.random().toString(36).substring(7));
31
+ const createNewFilter = function (idGroup) {
32
+ const idFilter = "filter_".concat(new Date().getTime(), "_").concat(Math.random().toString(36).substring(7));
24
33
  return {
25
- idGroup: idGroup,
34
+ idGroup,
26
35
  field: '',
27
36
  condition: '',
28
37
  value: '',
29
- idFilter: idFilter,
30
- type: components_helpers_types.QB_DRAG_TYPES.FILTER
38
+ idFilter,
39
+ type: types.QB_DRAG_TYPES.FILTER
31
40
  };
32
41
  };
33
42
  /**
@@ -37,13 +46,13 @@ var createNewFilter = function createNewFilter(idGroup) {
37
46
  * @param parentIdGroup
38
47
  */
39
48
 
40
- var createNewGroup = function createNewGroup(parentIdGroup) {
41
- var idGroup = "group_".concat(new Date().getTime(), "_").concat(Math.random().toString(36).substring(7));
49
+ const createNewGroup = function (parentIdGroup) {
50
+ const idGroup = "group_".concat(new Date().getTime(), "_").concat(Math.random().toString(36).substring(7));
42
51
  return {
43
- parentIdGroup: parentIdGroup,
44
- idGroup: idGroup,
45
- condition: components_helpers_types.QB_GROUP_CONDITION_TYPES.AND,
46
- type: components_helpers_types.QB_DRAG_TYPES.GROUP
52
+ parentIdGroup,
53
+ idGroup,
54
+ condition: types.QB_GROUP_CONDITION_TYPES.AND,
55
+ type: types.QB_DRAG_TYPES.GROUP
47
56
  };
48
57
  };
49
58
  /**
@@ -52,8 +61,10 @@ var createNewGroup = function createNewGroup(parentIdGroup) {
52
61
  * @param {*} newFilter
53
62
  */
54
63
 
55
- var addFilterToMap = function addFilterToMap(newFilter) {
56
- this.mapFilters = _objectSpread(_objectSpread({}, this.mapFilters), {}, _defineProperty__default['default']({}, newFilter.idFilter, newFilter));
64
+ const addFilterToMap = function (newFilter) {
65
+ this.mapFilters = _objectSpread(_objectSpread({}, this.mapFilters), {}, {
66
+ [newFilter.idFilter]: newFilter
67
+ });
57
68
  };
58
69
  /**
59
70
  * this is injected. instance of QBStore
@@ -62,32 +73,36 @@ var addFilterToMap = function addFilterToMap(newFilter) {
62
73
  * @param newGroup
63
74
  */
64
75
 
65
- var addGroupToMap = function addGroupToMap(newGroup) {
66
- this.mapGroups = _objectSpread(_objectSpread({}, this.mapGroups), {}, _defineProperty__default['default']({}, newGroup.idGroup, _objectSpread({}, newGroup)));
76
+ const addGroupToMap = function (newGroup) {
77
+ this.mapGroups = _objectSpread(_objectSpread({}, this.mapGroups), {}, {
78
+ [newGroup.idGroup]: _objectSpread({}, newGroup)
79
+ });
67
80
  };
68
- var addFilterToItem = function addFilterToItem(item, newFilter) {
81
+ const addFilterToItem = function (item, newFilter) {
69
82
  item.children.push({
70
83
  id: newFilter.idFilter,
71
84
  element: newFilter,
72
85
  children: []
73
86
  });
74
87
  };
75
- var addFilterToMainItem = function addFilterToMainItem(items, newFilter) {
88
+ const addFilterToMainItem = function (items, newFilter) {
76
89
  items.push({
77
90
  id: newFilter.idFilter,
78
91
  element: newFilter,
79
92
  children: []
80
93
  });
81
94
  };
82
- var findInChilds = function findInChilds(childs, filterId) {
83
- var found = childs.find(function (_ref) {
84
- var id = _ref.id;
95
+ const findInChilds = function (childs, filterId) {
96
+ const found = childs.find(_ref => {
97
+ let {
98
+ id
99
+ } = _ref;
85
100
  return id === filterId;
86
101
  });
87
102
 
88
103
  if (!found) {
89
- var findInChild;
90
- childs.forEach(function (item) {
104
+ let findInChild;
105
+ childs.forEach(item => {
91
106
  if (!findInChild) findInChild = findInChilds(item.children, filterId);
92
107
  });
93
108
  if (findInChild) return findInChild;
@@ -95,18 +110,20 @@ var findInChilds = function findInChilds(childs, filterId) {
95
110
 
96
111
  return found;
97
112
  };
98
- var findItemFilterById = function findItemFilterById(filterId) {
113
+ const findItemFilterById = function (filterId) {
99
114
  return findInChilds(this.items, filterId);
100
115
  };
101
- var findParentWithFilterId = function findParentWithFilterId(childs, filterId) {
102
- var found = childs.find(function (_ref2) {
103
- var id = _ref2.id;
116
+ const findParentWithFilterId = function (childs, filterId) {
117
+ const found = childs.find(_ref2 => {
118
+ let {
119
+ id
120
+ } = _ref2;
104
121
  return id === filterId;
105
122
  });
106
123
 
107
124
  if (!found) {
108
- var findInChild;
109
- childs.forEach(function (item) {
125
+ let findInChild;
126
+ childs.forEach(item => {
110
127
  if (!findInChild) findInChild = findParentWithFilterId(item.children, filterId);
111
128
  });
112
129
  if (findInChild) return findInChild;
@@ -114,44 +131,44 @@ var findParentWithFilterId = function findParentWithFilterId(childs, filterId) {
114
131
 
115
132
  return childs;
116
133
  };
117
- var findParentFilterById = function findParentFilterById(filterId) {
134
+ const findParentFilterById = function (filterId) {
118
135
  return findParentWithFilterId(this.items, filterId);
119
136
  };
120
- var filterInChildren = function filterInChildren(childs, filterId, mainId) {
137
+ const filterInChildren = function (childs, filterId, mainId) {
121
138
  if (childs.children) {
122
- childs.children = childs.children.filter(function (_ref3) {
123
- var id = _ref3.id;
139
+ childs.children = childs.children.filter(_ref3 => {
140
+ let {
141
+ id
142
+ } = _ref3;
124
143
  return id !== filterId;
125
144
  });
126
- childs.children = childs.children.forEach(function (item) {
127
- return filterInChildren(item.children, filterId);
128
- });
145
+ childs.children = childs.children.forEach(item => filterInChildren(item.children, filterId));
129
146
  return childs;
130
147
  } // main
131
148
 
132
149
 
133
- if (childs.length > 1) childs = childs.filter(function (_ref4) {
134
- var id = _ref4.id;
150
+ if (childs.length > 1) childs = childs.filter(_ref4 => {
151
+ let {
152
+ id
153
+ } = _ref4;
135
154
  return id !== filterId;
136
155
  }); // https://jira.elliemae.io/browse/PUI-1252
137
156
 
138
157
  if (childs.length === 0 && mainId) {
139
- var emptyFilter = createNewFilter.call(this, mainId);
158
+ const emptyFilter = createNewFilter.call(this, mainId);
140
159
  addFilterToMainItem.call(this, childs, emptyFilter);
141
160
  }
142
161
 
143
- childs.forEach(function (item) {
144
- return item.children = filterInChildren(item.children, filterId);
145
- });
162
+ childs.forEach(item => item.children = filterInChildren(item.children, filterId));
146
163
  return childs;
147
164
  };
148
- var removeFilterItem = function removeFilterItem(filterId) {
165
+ const removeFilterItem = function (filterId) {
149
166
  this.items = filterInChildren(this.items, filterId, this.main);
150
167
  };
151
- var addGroupFilterToItem = function addGroupFilterToItem(idGroup, idFilter, newGroup) {
152
- var child = findItemFilterById.call(this, idFilter);
168
+ const addGroupFilterToItem = function (idGroup, idFilter, newGroup) {
169
+ const child = findItemFilterById.call(this, idFilter);
153
170
 
154
- var copy = _objectSpread({}, child);
171
+ const copy = _objectSpread({}, child);
155
172
 
156
173
  if (copy.element.type === 'group') {
157
174
  copy.element.parentIdGroup = newGroup.idGroup;
@@ -163,36 +180,26 @@ var addGroupFilterToItem = function addGroupFilterToItem(idGroup, idFilter, newG
163
180
  child.element = newGroup;
164
181
  child.children = [copy];
165
182
  };
166
- var unGroupFilterToItem = function unGroupFilterToItem(idGroup) {
167
- var _this = this;
168
-
169
- var group = findItemFilterById.call(this, idGroup);
183
+ const unGroupFilterToItem = function (idGroup) {
184
+ const group = findItemFilterById.call(this, idGroup);
170
185
 
171
186
  if (group.element.parentIdGroup === this.main) {
172
- var index = this.items.map(function (item) {
173
- return item.id;
174
- }).indexOf(idGroup);
175
- var tmp = [];
187
+ const index = this.items.map(item => item.id).indexOf(idGroup);
188
+ const tmp = [];
176
189
  tmp.splice.apply(this.items, [index, 1].concat(group.children));
177
- this.items.forEach(function (item) {
190
+ this.items.forEach(item => {
178
191
  if (item.element.type === 'group') {
179
- item.element.parentIdGroup = _this.main;
192
+ item.element.parentIdGroup = this.main;
180
193
  } else {
181
- item.element.idGroup = _this.main;
194
+ item.element.idGroup = this.main;
182
195
  }
183
196
  });
184
197
  } else {
185
- var parent = findItemFilterById.call(this, group.element.parentIdGroup);
186
-
187
- var _index = parent.children.map(function (item) {
188
- return item.id;
189
- }).indexOf(idGroup);
190
-
191
- var _tmp = [];
192
-
193
- _tmp.splice.apply(parent.children, [_index, 1].concat(group.children));
194
-
195
- parent.children.forEach(function (item) {
198
+ const parent = findItemFilterById.call(this, group.element.parentIdGroup);
199
+ const index = parent.children.map(item => item.id).indexOf(idGroup);
200
+ const tmp = [];
201
+ tmp.splice.apply(parent.children, [index, 1].concat(group.children));
202
+ parent.children.forEach(item => {
196
203
  if (item.element.type === 'group') {
197
204
  item.element.parentIdGroup = parent.id;
198
205
  } else {
@@ -201,44 +208,53 @@ var unGroupFilterToItem = function unGroupFilterToItem(idGroup) {
201
208
  });
202
209
  }
203
210
  };
204
- var changeGroupOperator = function changeGroupOperator(idGroup, value) {
205
- var group = findItemFilterById.call(this, idGroup);
211
+ const changeGroupOperator = function (idGroup, value) {
212
+ const group = findItemFilterById.call(this, idGroup);
206
213
 
207
214
  if (idGroup !== this.main) {
208
215
  group.element.condition = value;
209
216
  }
210
217
  };
211
- var changeFilterItem = function changeFilterItem(_ref5) {
212
- var idFilter = _ref5.idFilter,
213
- field = _ref5.field,
214
- value = _ref5.value,
215
- operator = _ref5.operator,
216
- additionalInfo = _ref5.additionalInfo,
217
- target = _ref5.target,
218
- _ref5$fieldsSharedAct = _ref5.fieldsSharedActions,
219
- onFieldChange = _ref5$fieldsSharedAct.onFieldChange,
220
- onOperatorChange = _ref5$fieldsSharedAct.onOperatorChange,
221
- onValueChange = _ref5$fieldsSharedAct.onValueChange;
222
- var child = findItemFilterById.call(this, idFilter);
218
+ const changeFilterItem = function (_ref5) {
219
+ let {
220
+ idFilter,
221
+ field,
222
+ value,
223
+ operator,
224
+ additionalInfo,
225
+ target,
226
+ fieldsSharedActions: {
227
+ onFieldChange,
228
+ onOperatorChange,
229
+ onValueChange
230
+ }
231
+ } = _ref5;
232
+ const child = findItemFilterById.call(this, idFilter);
223
233
  if (field || field === '' || typeof field === 'boolean') child.element.field = field;
224
234
  if (operator) child.element.operator = operator;
225
235
  if (value || value === '' || typeof value === 'boolean') child.element.value = value;
226
236
  if (additionalInfo) child.element.additionalInfo = additionalInfo; // shared fields actions
227
237
 
228
238
  if (target === 'field') {
229
- onFieldChange.forEach(function (_ref6) {
230
- var action = _ref6.action;
231
- if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
239
+ onFieldChange.forEach(_ref6 => {
240
+ let {
241
+ action
242
+ } = _ref6;
243
+ if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
232
244
  });
233
245
  } else if (target === 'operator') {
234
- onOperatorChange.forEach(function (_ref7) {
235
- var action = _ref7.action;
236
- if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
246
+ onOperatorChange.forEach(_ref7 => {
247
+ let {
248
+ action
249
+ } = _ref7;
250
+ if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
237
251
  });
238
252
  } else if (target === 'value') {
239
- onValueChange.forEach(function (_ref8) {
240
- var action = _ref8.action;
241
- if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === components_helpers_types.QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
253
+ onValueChange.forEach(_ref8 => {
254
+ let {
255
+ action
256
+ } = _ref8;
257
+ if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === types.QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
242
258
  });
243
259
  }
244
260
  };
@@ -259,4 +275,3 @@ exports.findParentFilterById = findParentFilterById;
259
275
  exports.findParentWithFilterId = findParentWithFilterId;
260
276
  exports.removeFilterItem = removeFilterItem;
261
277
  exports.unGroupFilterToItem = unGroupFilterToItem;
262
- //# sourceMappingURL=actions.js.map
@@ -2,11 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var DELAY_CLOSE = 0.1;
6
- var DELAY_OPEN = 0.1;
7
- var TOOLBAR_ANIMATION_DURATION = 50;
5
+ const DELAY_CLOSE = 0.1;
6
+ const DELAY_OPEN = 0.1;
7
+ const TOOLBAR_ANIMATION_DURATION = 50;
8
8
 
9
9
  exports.DELAY_CLOSE = DELAY_CLOSE;
10
10
  exports.DELAY_OPEN = DELAY_OPEN;
11
11
  exports.TOOLBAR_ANIMATION_DURATION = TOOLBAR_ANIMATION_DURATION;
12
- //# sourceMappingURL=constants.js.map
@@ -2,9 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ require('core-js/modules/esnext.async-iterator.every.js');
6
+ require('core-js/modules/esnext.iterator.constructor.js');
7
+ require('core-js/modules/esnext.iterator.every.js');
8
+ require('core-js/modules/esnext.async-iterator.some.js');
9
+ require('core-js/modules/esnext.iterator.some.js');
10
+ require('core-js/modules/esnext.async-iterator.reduce.js');
11
+ require('core-js/modules/esnext.iterator.reduce.js');
5
12
  var lodash = require('lodash');
6
13
  var operators = require('@elliemae/ds-utilities/operators');
7
- var components_helpers_types = require('./types.js');
14
+ var types = require('./types.js');
8
15
 
9
16
  function _interopNamespace(e) {
10
17
  if (e && e.__esModule) return e;
@@ -15,53 +22,57 @@ function _interopNamespace(e) {
15
22
  var d = Object.getOwnPropertyDescriptor(e, k);
16
23
  Object.defineProperty(n, k, d.get ? d : {
17
24
  enumerable: true,
18
- get: function () {
19
- return e[k];
20
- }
25
+ get: function () { return e[k]; }
21
26
  });
22
27
  }
23
28
  });
24
29
  }
25
- n['default'] = e;
30
+ n["default"] = e;
26
31
  return Object.freeze(n);
27
32
  }
28
33
 
29
34
  var operators__namespace = /*#__PURE__*/_interopNamespace(operators);
30
35
 
31
- var resolveCondition = function resolveCondition(condition, state) {
32
- var resolveBy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : components_helpers_types.QB_GROUP_CONDITION_TYPES.AND;
36
+ const resolveCondition = function (condition, state) {
37
+ let resolveBy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : types.QB_GROUP_CONDITION_TYPES.AND;
33
38
  if (condition.length === 0 || !condition) return true; // resolve by AND: all the conditions must be true
34
39
 
35
40
  if (resolveBy) {
36
- return condition.every(function (rule) {
37
- var sourceRule = rule.source,
38
- operatorRule = rule.operator,
39
- valueRule = rule.value;
41
+ return condition.every(rule => {
42
+ const {
43
+ source: sourceRule,
44
+ operator: operatorRule,
45
+ value: valueRule
46
+ } = rule;
40
47
  if (typeof operatorRule === "function") return operatorRule(lodash.get(state, sourceRule), valueRule);
41
48
  return operators__namespace[operatorRule](lodash.get(state, sourceRule), valueRule);
42
49
  });
43
50
  } // resolve by OR: at least one condition must be true
44
51
 
45
52
 
46
- return condition.some(function (rule) {
47
- var sourceRule = rule.source,
48
- operatorRule = rule.operator,
49
- valueRule = rule.value;
53
+ return condition.some(rule => {
54
+ const {
55
+ source: sourceRule,
56
+ operator: operatorRule,
57
+ value: valueRule
58
+ } = rule;
50
59
  return operators__namespace[operatorRule](state[sourceRule], valueRule);
51
60
  });
52
61
  };
53
62
 
54
- var resolveDependencies = function resolveDependencies(state, fields) {
55
- var fieldsToRender = fields.reduce(function (result, _ref) {
56
- var target = _ref.target,
57
- component = _ref.component,
58
- condition = _ref.condition,
59
- resolveBy = _ref.resolveBy,
60
- validation = _ref.validation;
63
+ const resolveDependencies = (state, fields) => {
64
+ const fieldsToRender = fields.reduce((result, _ref) => {
65
+ let {
66
+ target,
67
+ component,
68
+ condition,
69
+ resolveBy,
70
+ validation
71
+ } = _ref;
61
72
  if (resolveCondition(condition, state, resolveBy)) result.push({
62
- target: target,
63
- component: component,
64
- validation: validation
73
+ target,
74
+ component,
75
+ validation
65
76
  });
66
77
  return result;
67
78
  }, []);
@@ -69,4 +80,3 @@ var resolveDependencies = function resolveDependencies(state, fields) {
69
80
  };
70
81
 
71
82
  exports.resolveDependencies = resolveDependencies;
72
- //# sourceMappingURL=dependencies.js.map
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var components_helpers_types = require('./types.js');
5
+ var types = require('./types.js');
6
6
 
7
- var QB_DEFAULT_VALUES_OPTIONS = [{
7
+ const QB_DEFAULT_VALUES_OPTIONS = [{
8
8
  label: 'Choose a Field',
9
9
  value: ''
10
10
  }];
11
- var QB_SUBJECT_VALUES_OPTIONS = [{
11
+ const QB_SUBJECT_VALUES_OPTIONS = [{
12
12
  label: 'Condominium',
13
13
  value: 'Condominium'
14
14
  }, {
@@ -30,7 +30,7 @@ var QB_SUBJECT_VALUES_OPTIONS = [{
30
30
  label: 'Other',
31
31
  value: 'Other'
32
32
  }];
33
- var QB_LOAN_VALUES_OPTIONS = [{
33
+ const QB_LOAN_VALUES_OPTIONS = [{
34
34
  label: 'Conventional',
35
35
  value: 'Conventional'
36
36
  }, {
@@ -49,49 +49,49 @@ var QB_LOAN_VALUES_OPTIONS = [{
49
49
  label: 'Other',
50
50
  value: 'Other'
51
51
  }];
52
- var QB_FIELD_OPTIONS = [{
52
+ const QB_FIELD_OPTIONS = [{
53
53
  label: 'Select',
54
54
  value: ''
55
55
  }, {
56
56
  label: 'Loan Type',
57
- value: components_helpers_types.QB_FIELD_TYPES.LOAN_VALUES
57
+ value: types.QB_FIELD_TYPES.LOAN_VALUES
58
58
  }, {
59
59
  label: 'Loan To Value (LTV)',
60
- value: components_helpers_types.QB_FIELD_TYPES.LTV_VALUES
60
+ value: types.QB_FIELD_TYPES.LTV_VALUES
61
61
  }, {
62
62
  label: 'Subject Property Type',
63
- value: components_helpers_types.QB_FIELD_TYPES.SUBJECT_VALUES
63
+ value: types.QB_FIELD_TYPES.SUBJECT_VALUES
64
64
  }, {
65
65
  label: 'Last Finished Milestone',
66
- value: components_helpers_types.QB_FIELD_TYPES.LAST_VALUES
66
+ value: types.QB_FIELD_TYPES.LAST_VALUES
67
67
  }, {
68
68
  label: 'Credit Score',
69
- value: components_helpers_types.QB_FIELD_TYPES.CREDIT_VALUES
69
+ value: types.QB_FIELD_TYPES.CREDIT_VALUES
70
70
  }];
71
- var QB_OPERATOR_OPTIONS = [{
71
+ const QB_OPERATOR_OPTIONS = [{
72
72
  label: 'Select',
73
73
  value: ''
74
74
  }, {
75
75
  label: 'Is',
76
- value: components_helpers_types.QB_OPERATOR_TYPES.EQUAL
76
+ value: types.QB_OPERATOR_TYPES.EQUAL
77
77
  }, {
78
78
  label: 'Is not',
79
- value: components_helpers_types.QB_OPERATOR_TYPES.NOT_EQUAL
79
+ value: types.QB_OPERATOR_TYPES.NOT_EQUAL
80
80
  }, {
81
81
  label: 'Greater than',
82
- value: components_helpers_types.QB_OPERATOR_TYPES.GREATER_THAN
82
+ value: types.QB_OPERATOR_TYPES.GREATER_THAN
83
83
  }, {
84
84
  label: 'Less than',
85
- value: components_helpers_types.QB_OPERATOR_TYPES.LESS_THAN
85
+ value: types.QB_OPERATOR_TYPES.LESS_THAN
86
86
  }, {
87
87
  label: 'Contains',
88
- value: components_helpers_types.QB_OPERATOR_TYPES.CONTAINS
88
+ value: types.QB_OPERATOR_TYPES.CONTAINS
89
89
  }, {
90
90
  label: "Doesn't Contain",
91
- value: components_helpers_types.QB_OPERATOR_TYPES.NOT_CONTAINS
91
+ value: types.QB_OPERATOR_TYPES.NOT_CONTAINS
92
92
  }, {
93
93
  label: 'Between',
94
- value: components_helpers_types.QB_OPERATOR_TYPES.BETWEEN
94
+ value: types.QB_OPERATOR_TYPES.BETWEEN
95
95
  }];
96
96
 
97
97
  exports.QB_DEFAULT_VALUES_OPTIONS = QB_DEFAULT_VALUES_OPTIONS;
@@ -99,4 +99,3 @@ exports.QB_FIELD_OPTIONS = QB_FIELD_OPTIONS;
99
99
  exports.QB_LOAN_VALUES_OPTIONS = QB_LOAN_VALUES_OPTIONS;
100
100
  exports.QB_OPERATOR_OPTIONS = QB_OPERATOR_OPTIONS;
101
101
  exports.QB_SUBJECT_VALUES_OPTIONS = QB_SUBJECT_VALUES_OPTIONS;
102
- //# sourceMappingURL=selectors.js.map