@elliemae/ds-query-builder 2.2.0-alpha.4 → 3.0.0-next.2

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 (141) hide show
  1. package/cjs/DSQueryBuilder.js +97 -117
  2. package/cjs/components/AndOrController/AndOrController.js +162 -148
  3. package/cjs/components/ConditionController/ConditionController.js +72 -88
  4. package/cjs/components/DisplayOutput/DisplayOutput.js +68 -63
  5. package/cjs/components/DragContainerController/DragContainerController.js +41 -61
  6. package/cjs/components/DragControllerRow/DragControllerRow.js +46 -50
  7. package/cjs/components/FieldControllerRow/FieldControllerRow.js +32 -54
  8. package/cjs/components/Nestable/Nestable.js +209 -143
  9. package/cjs/components/Nestable/NestableItem.js +90 -98
  10. package/cjs/components/Nestable/actions/events.js +95 -72
  11. package/cjs/components/Nestable/actions/getItemOptions.js +15 -36
  12. package/cjs/components/Nestable/actions/getPaths.js +51 -46
  13. package/cjs/components/Nestable/actions/index.js +28 -42
  14. package/cjs/components/Nestable/actions/moveItem.js +42 -44
  15. package/cjs/components/Nestable/actions/paths.js +55 -48
  16. package/cjs/components/Nestable/actions/tryDecreaseDepth.js +23 -39
  17. package/cjs/components/Nestable/actions/tryIncreaseDepth.js +26 -39
  18. package/cjs/components/Nestable/index.js +7 -36
  19. package/cjs/components/QueryBuilderContext/QueryBuilderContext.js +13 -36
  20. package/cjs/components/QueryBuilderImpl.js +202 -118
  21. package/cjs/components/QueryBuilderItem/QueryBuilderItem.js +78 -80
  22. package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +211 -154
  23. package/cjs/components/ToolBarAnimation/ToolBarAnimation.js +26 -39
  24. package/cjs/components/format/format.js +22 -48
  25. package/cjs/components/format/sqlFormat.js +48 -69
  26. package/cjs/components/format/sqlSafeFormat.js +55 -72
  27. package/cjs/components/format/xmlFormat.js +50 -71
  28. package/cjs/components/helpers/actions.js +186 -151
  29. package/cjs/components/helpers/constants.js +8 -36
  30. package/cjs/components/helpers/dependencies.js +64 -49
  31. package/cjs/components/helpers/selectors.js +101 -161
  32. package/cjs/components/helpers/store.js +104 -86
  33. package/cjs/components/helpers/types.js +44 -72
  34. package/cjs/index.js +29 -36
  35. package/cjs/propTypes.js +94 -102
  36. package/esm/DSQueryBuilder.js +72 -103
  37. package/esm/components/AndOrController/AndOrController.js +147 -113
  38. package/esm/components/ConditionController/ConditionController.js +62 -57
  39. package/esm/components/DisplayOutput/DisplayOutput.js +59 -31
  40. package/esm/components/DragContainerController/DragContainerController.js +35 -32
  41. package/esm/components/DragControllerRow/DragControllerRow.js +38 -21
  42. package/esm/components/FieldControllerRow/FieldControllerRow.js +26 -25
  43. package/esm/components/Nestable/Nestable.js +186 -115
  44. package/esm/components/Nestable/NestableItem.js +82 -69
  45. package/esm/components/Nestable/actions/events.js +79 -45
  46. package/esm/components/Nestable/actions/getItemOptions.js +11 -7
  47. package/esm/components/Nestable/actions/getPaths.js +43 -17
  48. package/esm/components/Nestable/actions/index.js +6 -13
  49. package/esm/components/Nestable/actions/moveItem.js +31 -13
  50. package/esm/components/Nestable/actions/paths.js +47 -19
  51. package/esm/components/Nestable/actions/tryDecreaseDepth.js +19 -10
  52. package/esm/components/Nestable/actions/tryIncreaseDepth.js +22 -10
  53. package/esm/components/Nestable/index.js +2 -7
  54. package/esm/components/QueryBuilderContext/QueryBuilderContext.js +5 -7
  55. package/esm/components/QueryBuilderImpl.js +187 -82
  56. package/esm/components/QueryBuilderItem/QueryBuilderItem.js +70 -50
  57. package/esm/components/QueryBuilderRow/QueryBuilderRow.js +201 -123
  58. package/esm/components/ToolBarAnimation/ToolBarAnimation.js +17 -10
  59. package/esm/components/format/format.js +17 -16
  60. package/esm/components/format/sqlFormat.js +43 -39
  61. package/esm/components/format/sqlSafeFormat.js +50 -43
  62. package/esm/components/format/xmlFormat.js +45 -41
  63. package/esm/components/helpers/actions.js +160 -123
  64. package/esm/components/helpers/constants.js +2 -7
  65. package/esm/components/helpers/dependencies.js +39 -19
  66. package/esm/components/helpers/selectors.js +93 -132
  67. package/esm/components/helpers/store.js +82 -54
  68. package/esm/components/helpers/types.js +33 -44
  69. package/esm/index.js +4 -7
  70. package/esm/propTypes.js +72 -55
  71. package/package.json +12 -12
  72. package/cjs/DSQueryBuilder.js.map +0 -7
  73. package/cjs/components/AndOrController/AndOrController.js.map +0 -7
  74. package/cjs/components/ConditionController/ConditionController.js.map +0 -7
  75. package/cjs/components/DisplayOutput/DisplayOutput.js.map +0 -7
  76. package/cjs/components/DragContainerController/DragContainerController.js.map +0 -7
  77. package/cjs/components/DragControllerRow/DragControllerRow.js.map +0 -7
  78. package/cjs/components/FieldControllerRow/FieldControllerRow.js.map +0 -7
  79. package/cjs/components/Nestable/Nestable.js.map +0 -7
  80. package/cjs/components/Nestable/NestableItem.js.map +0 -7
  81. package/cjs/components/Nestable/actions/events.js.map +0 -7
  82. package/cjs/components/Nestable/actions/getItemOptions.js.map +0 -7
  83. package/cjs/components/Nestable/actions/getPaths.js.map +0 -7
  84. package/cjs/components/Nestable/actions/index.js.map +0 -7
  85. package/cjs/components/Nestable/actions/moveItem.js.map +0 -7
  86. package/cjs/components/Nestable/actions/paths.js.map +0 -7
  87. package/cjs/components/Nestable/actions/tryDecreaseDepth.js.map +0 -7
  88. package/cjs/components/Nestable/actions/tryIncreaseDepth.js.map +0 -7
  89. package/cjs/components/Nestable/index.js.map +0 -7
  90. package/cjs/components/QueryBuilderContext/QueryBuilderContext.js.map +0 -7
  91. package/cjs/components/QueryBuilderImpl.js.map +0 -7
  92. package/cjs/components/QueryBuilderItem/QueryBuilderItem.js.map +0 -7
  93. package/cjs/components/QueryBuilderRow/QueryBuilderRow.js.map +0 -7
  94. package/cjs/components/ToolBarAnimation/ToolBarAnimation.js.map +0 -7
  95. package/cjs/components/format/format.js.map +0 -7
  96. package/cjs/components/format/sqlFormat.js.map +0 -7
  97. package/cjs/components/format/sqlSafeFormat.js.map +0 -7
  98. package/cjs/components/format/xmlFormat.js.map +0 -7
  99. package/cjs/components/helpers/actions.js.map +0 -7
  100. package/cjs/components/helpers/constants.js.map +0 -7
  101. package/cjs/components/helpers/dependencies.js.map +0 -7
  102. package/cjs/components/helpers/selectors.js.map +0 -7
  103. package/cjs/components/helpers/store.js.map +0 -7
  104. package/cjs/components/helpers/types.js.map +0 -7
  105. package/cjs/index.js.map +0 -7
  106. package/cjs/propTypes.js.map +0 -7
  107. package/esm/DSQueryBuilder.js.map +0 -7
  108. package/esm/components/AndOrController/AndOrController.js.map +0 -7
  109. package/esm/components/ConditionController/ConditionController.js.map +0 -7
  110. package/esm/components/DisplayOutput/DisplayOutput.js.map +0 -7
  111. package/esm/components/DragContainerController/DragContainerController.js.map +0 -7
  112. package/esm/components/DragControllerRow/DragControllerRow.js.map +0 -7
  113. package/esm/components/FieldControllerRow/FieldControllerRow.js.map +0 -7
  114. package/esm/components/Nestable/Nestable.js.map +0 -7
  115. package/esm/components/Nestable/NestableItem.js.map +0 -7
  116. package/esm/components/Nestable/actions/events.js.map +0 -7
  117. package/esm/components/Nestable/actions/getItemOptions.js.map +0 -7
  118. package/esm/components/Nestable/actions/getPaths.js.map +0 -7
  119. package/esm/components/Nestable/actions/index.js.map +0 -7
  120. package/esm/components/Nestable/actions/moveItem.js.map +0 -7
  121. package/esm/components/Nestable/actions/paths.js.map +0 -7
  122. package/esm/components/Nestable/actions/tryDecreaseDepth.js.map +0 -7
  123. package/esm/components/Nestable/actions/tryIncreaseDepth.js.map +0 -7
  124. package/esm/components/Nestable/index.js.map +0 -7
  125. package/esm/components/QueryBuilderContext/QueryBuilderContext.js.map +0 -7
  126. package/esm/components/QueryBuilderImpl.js.map +0 -7
  127. package/esm/components/QueryBuilderItem/QueryBuilderItem.js.map +0 -7
  128. package/esm/components/QueryBuilderRow/QueryBuilderRow.js.map +0 -7
  129. package/esm/components/ToolBarAnimation/ToolBarAnimation.js.map +0 -7
  130. package/esm/components/format/format.js.map +0 -7
  131. package/esm/components/format/sqlFormat.js.map +0 -7
  132. package/esm/components/format/sqlSafeFormat.js.map +0 -7
  133. package/esm/components/format/xmlFormat.js.map +0 -7
  134. package/esm/components/helpers/actions.js.map +0 -7
  135. package/esm/components/helpers/constants.js.map +0 -7
  136. package/esm/components/helpers/dependencies.js.map +0 -7
  137. package/esm/components/helpers/selectors.js.map +0 -7
  138. package/esm/components/helpers/store.js.map +0 -7
  139. package/esm/components/helpers/types.js.map +0 -7
  140. package/esm/index.js.map +0 -7
  141. package/esm/propTypes.js.map +0 -7
@@ -1,132 +1,93 @@
1
- import * as React from "react";
2
- import { QB_OPERATOR_TYPES, QB_FIELD_TYPES } from "./types";
3
- const QB_DEFAULT_VALUES_OPTIONS = [
4
- {
5
- label: "Choose a Field",
6
- value: ""
7
- }
8
- ];
9
- const QB_SUBJECT_VALUES_OPTIONS = [
10
- {
11
- label: "Condominium",
12
- value: "Condominium"
13
- },
14
- {
15
- label: "Single Family Home",
16
- value: "Single Family Home"
17
- },
18
- {
19
- label: "Co-Operative",
20
- value: "Co-Operative"
21
- },
22
- {
23
- label: "Detached",
24
- value: "Detached"
25
- },
26
- {
27
- label: "High Rise Condominium",
28
- value: "High Rise Condominium"
29
- },
30
- {
31
- label: "Manufactured Housing",
32
- value: "Manufactured Housing"
33
- },
34
- {
35
- label: "Other",
36
- value: "Other"
37
- }
38
- ];
39
- const QB_LOAN_VALUES_OPTIONS = [
40
- {
41
- label: "Conventional",
42
- value: "Conventional"
43
- },
44
- {
45
- label: "VA",
46
- value: "VA"
47
- },
48
- {
49
- label: "FHA",
50
- value: "FHA"
51
- },
52
- {
53
- label: "USAD-RHS",
54
- value: "USAD-RHS"
55
- },
56
- {
57
- label: "HELOC",
58
- value: "HELOC"
59
- },
60
- {
61
- label: "Other",
62
- value: "Other"
63
- }
64
- ];
65
- const QB_FIELD_OPTIONS = [
66
- {
67
- label: "Select",
68
- value: ""
69
- },
70
- {
71
- label: "Loan Type",
72
- value: QB_FIELD_TYPES.LOAN_VALUES
73
- },
74
- {
75
- label: "Loan To Value (LTV)",
76
- value: QB_FIELD_TYPES.LTV_VALUES
77
- },
78
- {
79
- label: "Subject Property Type",
80
- value: QB_FIELD_TYPES.SUBJECT_VALUES
81
- },
82
- {
83
- label: "Last Finished Milestone",
84
- value: QB_FIELD_TYPES.LAST_VALUES
85
- },
86
- {
87
- label: "Credit Score",
88
- value: QB_FIELD_TYPES.CREDIT_VALUES
89
- }
90
- ];
91
- const QB_OPERATOR_OPTIONS = [
92
- {
93
- label: "Select",
94
- value: ""
95
- },
96
- {
97
- label: "Is",
98
- value: QB_OPERATOR_TYPES.EQUAL
99
- },
100
- {
101
- label: "Is not",
102
- value: QB_OPERATOR_TYPES.NOT_EQUAL
103
- },
104
- {
105
- label: "Greater than",
106
- value: QB_OPERATOR_TYPES.GREATER_THAN
107
- },
108
- {
109
- label: "Less than",
110
- value: QB_OPERATOR_TYPES.LESS_THAN
111
- },
112
- {
113
- label: "Contains",
114
- value: QB_OPERATOR_TYPES.CONTAINS
115
- },
116
- {
117
- label: "Doesn't Contain",
118
- value: QB_OPERATOR_TYPES.NOT_CONTAINS
119
- },
120
- {
121
- label: "Between",
122
- value: QB_OPERATOR_TYPES.BETWEEN
123
- }
124
- ];
125
- export {
126
- QB_DEFAULT_VALUES_OPTIONS,
127
- QB_FIELD_OPTIONS,
128
- QB_LOAN_VALUES_OPTIONS,
129
- QB_OPERATOR_OPTIONS,
130
- QB_SUBJECT_VALUES_OPTIONS
131
- };
132
- //# sourceMappingURL=selectors.js.map
1
+ import { QB_FIELD_TYPES, QB_OPERATOR_TYPES } from './types.js';
2
+
3
+ const QB_DEFAULT_VALUES_OPTIONS = [{
4
+ label: 'Choose a Field',
5
+ value: ''
6
+ }];
7
+ const QB_SUBJECT_VALUES_OPTIONS = [{
8
+ label: 'Condominium',
9
+ value: 'Condominium'
10
+ }, {
11
+ label: 'Single Family Home',
12
+ value: 'Single Family Home'
13
+ }, {
14
+ label: 'Co-Operative',
15
+ value: 'Co-Operative'
16
+ }, {
17
+ label: 'Detached',
18
+ value: 'Detached'
19
+ }, {
20
+ label: 'High Rise Condominium',
21
+ value: 'High Rise Condominium'
22
+ }, {
23
+ label: 'Manufactured Housing',
24
+ value: 'Manufactured Housing'
25
+ }, {
26
+ label: 'Other',
27
+ value: 'Other'
28
+ }];
29
+ const QB_LOAN_VALUES_OPTIONS = [{
30
+ label: 'Conventional',
31
+ value: 'Conventional'
32
+ }, {
33
+ label: 'VA',
34
+ value: 'VA'
35
+ }, {
36
+ label: 'FHA',
37
+ value: 'FHA'
38
+ }, {
39
+ label: 'USAD-RHS',
40
+ value: 'USAD-RHS'
41
+ }, {
42
+ label: 'HELOC',
43
+ value: 'HELOC'
44
+ }, {
45
+ label: 'Other',
46
+ value: 'Other'
47
+ }];
48
+ const QB_FIELD_OPTIONS = [{
49
+ label: 'Select',
50
+ value: ''
51
+ }, {
52
+ label: 'Loan Type',
53
+ value: QB_FIELD_TYPES.LOAN_VALUES
54
+ }, {
55
+ label: 'Loan To Value (LTV)',
56
+ value: QB_FIELD_TYPES.LTV_VALUES
57
+ }, {
58
+ label: 'Subject Property Type',
59
+ value: QB_FIELD_TYPES.SUBJECT_VALUES
60
+ }, {
61
+ label: 'Last Finished Milestone',
62
+ value: QB_FIELD_TYPES.LAST_VALUES
63
+ }, {
64
+ label: 'Credit Score',
65
+ value: QB_FIELD_TYPES.CREDIT_VALUES
66
+ }];
67
+ const QB_OPERATOR_OPTIONS = [{
68
+ label: 'Select',
69
+ value: ''
70
+ }, {
71
+ label: 'Is',
72
+ value: QB_OPERATOR_TYPES.EQUAL
73
+ }, {
74
+ label: 'Is not',
75
+ value: QB_OPERATOR_TYPES.NOT_EQUAL
76
+ }, {
77
+ label: 'Greater than',
78
+ value: QB_OPERATOR_TYPES.GREATER_THAN
79
+ }, {
80
+ label: 'Less than',
81
+ value: QB_OPERATOR_TYPES.LESS_THAN
82
+ }, {
83
+ label: 'Contains',
84
+ value: QB_OPERATOR_TYPES.CONTAINS
85
+ }, {
86
+ label: "Doesn't Contain",
87
+ value: QB_OPERATOR_TYPES.NOT_CONTAINS
88
+ }, {
89
+ label: 'Between',
90
+ value: QB_OPERATOR_TYPES.BETWEEN
91
+ }];
92
+
93
+ export { QB_DEFAULT_VALUES_OPTIONS, QB_FIELD_OPTIONS, QB_LOAN_VALUES_OPTIONS, QB_OPERATOR_OPTIONS, QB_SUBJECT_VALUES_OPTIONS };
@@ -1,21 +1,29 @@
1
- import * as React from "react";
2
- import {
3
- createNewFilter,
4
- createNewGroup,
5
- addFilterToMap,
6
- addGroupToMap,
7
- addFilterToItem,
8
- addFilterToMainItem,
9
- findItemFilterById,
10
- removeFilterItem,
11
- addGroupFilterToItem,
12
- unGroupFilterToItem,
13
- changeFilterItem,
14
- changeGroupOperator
15
- } from "./actions";
16
- import QueryBuilderFormat from "../format/format";
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.filter.js';
3
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.constructor.js';
6
+ import 'core-js/modules/esnext.iterator.for-each.js';
7
+ import { createNewFilter, createNewGroup, addFilterToMap, addFilterToMainItem, findItemFilterById, addFilterToItem, removeFilterItem, addGroupFilterToItem, addGroupToMap, unGroupFilterToItem, changeGroupOperator, changeFilterItem } from './actions.js';
8
+ import QueryBuilderFormat from '../format/format.js';
9
+
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+ /**
14
+ * Fluent interface: https://en.wikipedia.org/wiki/Fluent_interface
15
+ *
16
+ * @param idGroup
17
+ * @param parentIdGroup
18
+ * @param items
19
+ * @param idFilter
20
+ * @param value
21
+ * @param data
22
+ * @class QueryBuilderStore
23
+ */
24
+
17
25
  class QueryBuilderStore {
18
- constructor(init, format) {
26
+ constructor(init, _format) {
19
27
  this.items = [];
20
28
  this.step = 0;
21
29
  this.steps = {};
@@ -23,121 +31,141 @@ class QueryBuilderStore {
23
31
  this.mapGroups = {};
24
32
  this.main = null;
25
33
  this.format = null;
26
- this.createNewFilter = (idGroup) => createNewFilter.call(this, idGroup);
27
- this.createNewGroup = (parentIdGroup) => createNewGroup.call(this, parentIdGroup);
28
- this.onOrderDragAndDrop = (items) => {
34
+
35
+ this.createNewFilter = idGroup => createNewFilter.call(this, idGroup);
36
+
37
+ this.createNewGroup = parentIdGroup => createNewGroup.call(this, parentIdGroup);
38
+
39
+ this.onOrderDragAndDrop = items => {
29
40
  this.items = items;
30
41
  return this.getState();
31
42
  };
43
+
32
44
  this.addFilterNextToFilterId = (idGroup, idFilter) => {
45
+ // eslint-disable-line
33
46
  this.addFilter(idGroup);
34
47
  return this.getState();
35
48
  };
36
- this.addFilter = (idGroup) => {
49
+
50
+ this.addFilter = idGroup => {
37
51
  const newFilter = this.createNewFilter(idGroup);
38
- addFilterToMap.call(this, newFilter);
52
+ addFilterToMap.call(this, newFilter); // new API
53
+
39
54
  if (this.main === idGroup) {
40
55
  addFilterToMainItem.call(this, this.items, newFilter);
41
56
  } else {
42
57
  const foundInItems = findItemFilterById.call(this, idGroup);
58
+
43
59
  if (foundInItems) {
44
60
  addFilterToItem.call(this, foundInItems, newFilter);
45
61
  }
46
62
  }
63
+
47
64
  return this.getState();
48
65
  };
49
- this.onRemoveFilter = (idFilter) => {
66
+
67
+ this.onRemoveFilter = idFilter => {
68
+ // new API
50
69
  removeFilterItem.call(this, idFilter);
51
70
  return this.getState();
52
71
  };
72
+
53
73
  this.addRuleContainerInPlace = (idGroup, idFilter) => {
74
+ // Create a new group
54
75
  const newGroup = this.createNewGroup(idGroup);
55
76
  addGroupFilterToItem.call(this, idGroup, idFilter, newGroup);
56
77
  return this.getState();
57
78
  };
79
+
58
80
  this.addRuleContainer = (idGroup, idFilter) => {
81
+ // eslint-disable-line
59
82
  const newGroup = this.createNewGroup(idGroup);
60
83
  addGroupToMap.call(this, newGroup);
84
+
61
85
  if (this.main === idGroup) {
62
86
  addFilterToMainItem.call(this, this.items, newGroup);
63
87
  } else {
64
88
  const foundInItems = findItemFilterById.call(this, idGroup);
89
+
65
90
  if (foundInItems) {
66
91
  addFilterToItem.call(this, foundInItems, newGroup);
67
92
  }
68
93
  }
94
+
69
95
  return this.getState();
70
96
  };
71
- this.unGroup = (idGroup) => {
97
+
98
+ this.unGroup = idGroup => {
72
99
  unGroupFilterToItem.call(this, idGroup);
73
100
  return this.getState();
74
101
  };
102
+
75
103
  this.changeGroupOperator = (idGroup, value) => {
76
104
  this.getGroupById(idGroup).condition = value;
77
105
  changeGroupOperator.call(this, idGroup, value);
78
106
  return this.getState();
79
107
  };
80
- this.changeFilter = (data) => {
81
- const { idFilter } = data;
82
- this.mapFilters[idFilter] = {
83
- ...this.mapFilters[idFilter],
84
- ...data
85
- };
108
+
109
+ this.changeFilter = data => {
110
+ const {
111
+ idFilter
112
+ } = data;
113
+ this.mapFilters[idFilter] = _objectSpread(_objectSpread({}, this.mapFilters[idFilter]), data);
86
114
  changeFilterItem.call(this, data);
87
115
  return this.getState();
88
116
  };
89
- this.getGroupById = (idGroup) => this.mapGroups[idGroup] || {};
90
- this.getFilterById = (idFilter) => this.mapFilters[idFilter];
117
+
118
+ this.getGroupById = idGroup => this.mapGroups[idGroup] || {};
119
+
120
+ this.getFilterById = idFilter => this.mapFilters[idFilter];
121
+
91
122
  this.getInitialState = () => {
92
123
  const newFilters = {
93
124
  step: this.step,
94
- mapFilters: { ...this.mapFilters },
95
- mapGroups: { ...this.mapGroups },
125
+ mapFilters: _objectSpread({}, this.mapFilters),
126
+ mapGroups: _objectSpread({}, this.mapGroups),
96
127
  main: this.main,
97
128
  items: this.items
98
129
  };
99
130
  const format = QueryBuilderFormat.run(newFilters, this.format);
100
- return {
101
- ...newFilters,
131
+ return _objectSpread(_objectSpread({}, newFilters), {}, {
102
132
  format
103
- };
133
+ });
104
134
  };
135
+
105
136
  this.getState = () => {
106
137
  this.step += 1;
107
138
  const newFilters = {
108
139
  step: this.step,
109
- mapFilters: { ...this.mapFilters },
110
- mapGroups: { ...this.mapGroups },
140
+ mapFilters: _objectSpread({}, this.mapFilters),
141
+ mapGroups: _objectSpread({}, this.mapGroups),
111
142
  main: this.main,
112
143
  items: this.items
113
144
  };
114
145
  const format = QueryBuilderFormat.run(newFilters, this.format);
115
- return {
116
- ...newFilters,
146
+ return _objectSpread(_objectSpread({}, newFilters), {}, {
117
147
  format
118
- };
148
+ });
119
149
  };
150
+
120
151
  this.firstLoad = true;
121
- this.format = format;
122
- if (init)
123
- return this.initSetupUp(init);
124
- const mainGroup = this.createNewGroup("main");
152
+ this.format = _format;
153
+ if (init) return this.initSetupUp(init);
154
+ const mainGroup = this.createNewGroup('main');
125
155
  this.mapGroups = {
126
156
  [mainGroup.idGroup]: mainGroup
127
157
  };
128
158
  this.main = mainGroup.idGroup;
129
159
  this.addFilter(mainGroup.idGroup);
130
160
  }
161
+
131
162
  initSetupUp(init) {
132
163
  this.step = init.step || 1;
133
- Object.keys(init).forEach((key) => {
134
- if (init[key] && this[key] !== void 0)
135
- this[key] = init[key];
164
+ Object.keys(init).forEach(key => {
165
+ if (init[key] && this[key] !== undefined) this[key] = init[key];
136
166
  });
137
167
  }
168
+
138
169
  }
139
- var store_default = QueryBuilderStore;
140
- export {
141
- store_default as default
142
- };
143
- //# sourceMappingURL=store.js.map
170
+
171
+ export { QueryBuilderStore as default };
@@ -1,63 +1,52 @@
1
- import * as React from "react";
2
1
  const QB_FIELD_TYPES = {
3
- LOAN_VALUES: "loanValues",
4
- LTV_VALUES: "ltvValues",
5
- SUBJECT_VALUES: "subjectValues",
6
- LAST_VALUES: "lastValues",
7
- CREDIT_VALUES: "creditValues"
2
+ LOAN_VALUES: 'loanValues',
3
+ LTV_VALUES: 'ltvValues',
4
+ SUBJECT_VALUES: 'subjectValues',
5
+ LAST_VALUES: 'lastValues',
6
+ CREDIT_VALUES: 'creditValues'
8
7
  };
9
8
  const QB_OPERATOR_TYPES = {
10
- EQUAL: "equal",
11
- NOT_EQUAL: "notEqual",
12
- GREATER_THAN: "greaterThan",
13
- LESS_THAN: "lessThan",
14
- CONTAINS: "contains",
15
- NOT_CONTAINS: "notNontains",
16
- BETWEEN: "between",
17
- GREATER_THAN_OR_EQUAL: "greaterThanOrEquals",
18
- LESS_THAN_OR_EQUAL: "lessThanOrEquals",
19
- START_WITH: "startsWith"
9
+ EQUAL: 'equal',
10
+ NOT_EQUAL: 'notEqual',
11
+ GREATER_THAN: 'greaterThan',
12
+ LESS_THAN: 'lessThan',
13
+ CONTAINS: 'contains',
14
+ NOT_CONTAINS: 'notNontains',
15
+ BETWEEN: 'between',
16
+ GREATER_THAN_OR_EQUAL: 'greaterThanOrEquals',
17
+ LESS_THAN_OR_EQUAL: 'lessThanOrEquals',
18
+ START_WITH: 'startsWith'
20
19
  };
21
20
  const QB_GROUP_CONDITION_TYPES = {
22
21
  AND: true,
23
22
  OR: false
24
23
  };
25
24
  const QB_DRAG_TYPES = {
26
- FILTER: "filter",
27
- GROUP: "group"
25
+ FILTER: 'filter',
26
+ GROUP: 'group'
28
27
  };
29
28
  const QB_DRAG_LOCATIONS = {
30
- ABOVE: "above",
31
- BELOW: "below"
29
+ ABOVE: 'above',
30
+ BELOW: 'below'
32
31
  };
33
32
  const QB_EXPORT_FORMAT_TYPES = {
34
- DEFAULT: "defaultFormat",
35
- XML: "xmlFormat",
36
- SQL: "sqlFormat",
37
- SAFESQL: "sqlSafeFormat"
33
+ DEFAULT: 'defaultFormat',
34
+ XML: 'xmlFormat',
35
+ SQL: 'sqlFormat',
36
+ SAFESQL: 'sqlSafeFormat'
38
37
  };
39
38
  const QB_ADD_FILTER_METHOD_TYPES = {
40
- IN_PLACE: "inplace",
41
- APPEND: "append"
39
+ IN_PLACE: 'inplace',
40
+ APPEND: 'append'
42
41
  };
43
42
  const QB_GROUP_FILTER_METHOD_TYPES = {
44
- IN_PLACE: "inplace",
45
- APPEND: "append"
43
+ IN_PLACE: 'inplace',
44
+ APPEND: 'append'
46
45
  };
47
46
  const QB_FIELD_SHARED_ACTIONS = {
48
- RESET_FIELD: "resetField",
49
- RESET_OPERATOR: "resetOperator",
50
- RESET_VALUE: "resetValue"
51
- };
52
- export {
53
- QB_ADD_FILTER_METHOD_TYPES,
54
- QB_DRAG_LOCATIONS,
55
- QB_DRAG_TYPES,
56
- QB_EXPORT_FORMAT_TYPES,
57
- QB_FIELD_SHARED_ACTIONS,
58
- QB_FIELD_TYPES,
59
- QB_GROUP_CONDITION_TYPES,
60
- QB_GROUP_FILTER_METHOD_TYPES,
61
- QB_OPERATOR_TYPES
62
- };
63
- //# sourceMappingURL=types.js.map
47
+ RESET_FIELD: 'resetField',
48
+ RESET_OPERATOR: 'resetOperator',
49
+ RESET_VALUE: 'resetValue'
50
+ };
51
+
52
+ export { QB_ADD_FILTER_METHOD_TYPES, QB_DRAG_LOCATIONS, QB_DRAG_TYPES, QB_EXPORT_FORMAT_TYPES, QB_FIELD_SHARED_ACTIONS, QB_FIELD_TYPES, QB_GROUP_CONDITION_TYPES, QB_GROUP_FILTER_METHOD_TYPES, QB_OPERATOR_TYPES };
package/esm/index.js CHANGED
@@ -1,7 +1,4 @@
1
- import * as React from "react";
2
- import { default as default2 } from "./DSQueryBuilder";
3
- export * from "./DSQueryBuilder";
4
- export {
5
- default2 as default
6
- };
7
- //# sourceMappingURL=index.js.map
1
+ export { DSQueryBuilder, DSQueryBuilderWithSchema, DSQueryBuilder as default } from './DSQueryBuilder.js';
2
+ export { QB_ADD_FILTER_METHOD_TYPES, QB_DRAG_LOCATIONS, QB_DRAG_TYPES, QB_EXPORT_FORMAT_TYPES, QB_FIELD_SHARED_ACTIONS, QB_FIELD_TYPES, QB_GROUP_CONDITION_TYPES, QB_GROUP_FILTER_METHOD_TYPES, QB_OPERATOR_TYPES } from './components/helpers/types.js';
3
+ export { QB_DEFAULT_VALUES_OPTIONS, QB_FIELD_OPTIONS, QB_LOAN_VALUES_OPTIONS, QB_OPERATOR_OPTIONS, QB_SUBJECT_VALUES_OPTIONS } from './components/helpers/selectors.js';
4
+ export { default as QueryBuilderFormat } from './components/format/format.js';