@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,161 +1,101 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var selectors_exports = {};
29
- __export(selectors_exports, {
30
- QB_DEFAULT_VALUES_OPTIONS: () => QB_DEFAULT_VALUES_OPTIONS,
31
- QB_FIELD_OPTIONS: () => QB_FIELD_OPTIONS,
32
- QB_LOAN_VALUES_OPTIONS: () => QB_LOAN_VALUES_OPTIONS,
33
- QB_OPERATOR_OPTIONS: () => QB_OPERATOR_OPTIONS,
34
- QB_SUBJECT_VALUES_OPTIONS: () => QB_SUBJECT_VALUES_OPTIONS
35
- });
36
- var React = __toESM(require("react"));
37
- var import_types = require("./types");
38
- const QB_DEFAULT_VALUES_OPTIONS = [
39
- {
40
- label: "Choose a Field",
41
- value: ""
42
- }
43
- ];
44
- const QB_SUBJECT_VALUES_OPTIONS = [
45
- {
46
- label: "Condominium",
47
- value: "Condominium"
48
- },
49
- {
50
- label: "Single Family Home",
51
- value: "Single Family Home"
52
- },
53
- {
54
- label: "Co-Operative",
55
- value: "Co-Operative"
56
- },
57
- {
58
- label: "Detached",
59
- value: "Detached"
60
- },
61
- {
62
- label: "High Rise Condominium",
63
- value: "High Rise Condominium"
64
- },
65
- {
66
- label: "Manufactured Housing",
67
- value: "Manufactured Housing"
68
- },
69
- {
70
- label: "Other",
71
- value: "Other"
72
- }
73
- ];
74
- const QB_LOAN_VALUES_OPTIONS = [
75
- {
76
- label: "Conventional",
77
- value: "Conventional"
78
- },
79
- {
80
- label: "VA",
81
- value: "VA"
82
- },
83
- {
84
- label: "FHA",
85
- value: "FHA"
86
- },
87
- {
88
- label: "USAD-RHS",
89
- value: "USAD-RHS"
90
- },
91
- {
92
- label: "HELOC",
93
- value: "HELOC"
94
- },
95
- {
96
- label: "Other",
97
- value: "Other"
98
- }
99
- ];
100
- const QB_FIELD_OPTIONS = [
101
- {
102
- label: "Select",
103
- value: ""
104
- },
105
- {
106
- label: "Loan Type",
107
- value: import_types.QB_FIELD_TYPES.LOAN_VALUES
108
- },
109
- {
110
- label: "Loan To Value (LTV)",
111
- value: import_types.QB_FIELD_TYPES.LTV_VALUES
112
- },
113
- {
114
- label: "Subject Property Type",
115
- value: import_types.QB_FIELD_TYPES.SUBJECT_VALUES
116
- },
117
- {
118
- label: "Last Finished Milestone",
119
- value: import_types.QB_FIELD_TYPES.LAST_VALUES
120
- },
121
- {
122
- label: "Credit Score",
123
- value: import_types.QB_FIELD_TYPES.CREDIT_VALUES
124
- }
125
- ];
126
- const QB_OPERATOR_OPTIONS = [
127
- {
128
- label: "Select",
129
- value: ""
130
- },
131
- {
132
- label: "Is",
133
- value: import_types.QB_OPERATOR_TYPES.EQUAL
134
- },
135
- {
136
- label: "Is not",
137
- value: import_types.QB_OPERATOR_TYPES.NOT_EQUAL
138
- },
139
- {
140
- label: "Greater than",
141
- value: import_types.QB_OPERATOR_TYPES.GREATER_THAN
142
- },
143
- {
144
- label: "Less than",
145
- value: import_types.QB_OPERATOR_TYPES.LESS_THAN
146
- },
147
- {
148
- label: "Contains",
149
- value: import_types.QB_OPERATOR_TYPES.CONTAINS
150
- },
151
- {
152
- label: "Doesn't Contain",
153
- value: import_types.QB_OPERATOR_TYPES.NOT_CONTAINS
154
- },
155
- {
156
- label: "Between",
157
- value: import_types.QB_OPERATOR_TYPES.BETWEEN
158
- }
159
- ];
160
- module.exports = __toCommonJS(selectors_exports);
161
- //# sourceMappingURL=selectors.js.map
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var types = require('./types.js');
6
+
7
+ const QB_DEFAULT_VALUES_OPTIONS = [{
8
+ label: 'Choose a Field',
9
+ value: ''
10
+ }];
11
+ const QB_SUBJECT_VALUES_OPTIONS = [{
12
+ label: 'Condominium',
13
+ value: 'Condominium'
14
+ }, {
15
+ label: 'Single Family Home',
16
+ value: 'Single Family Home'
17
+ }, {
18
+ label: 'Co-Operative',
19
+ value: 'Co-Operative'
20
+ }, {
21
+ label: 'Detached',
22
+ value: 'Detached'
23
+ }, {
24
+ label: 'High Rise Condominium',
25
+ value: 'High Rise Condominium'
26
+ }, {
27
+ label: 'Manufactured Housing',
28
+ value: 'Manufactured Housing'
29
+ }, {
30
+ label: 'Other',
31
+ value: 'Other'
32
+ }];
33
+ const QB_LOAN_VALUES_OPTIONS = [{
34
+ label: 'Conventional',
35
+ value: 'Conventional'
36
+ }, {
37
+ label: 'VA',
38
+ value: 'VA'
39
+ }, {
40
+ label: 'FHA',
41
+ value: 'FHA'
42
+ }, {
43
+ label: 'USAD-RHS',
44
+ value: 'USAD-RHS'
45
+ }, {
46
+ label: 'HELOC',
47
+ value: 'HELOC'
48
+ }, {
49
+ label: 'Other',
50
+ value: 'Other'
51
+ }];
52
+ const QB_FIELD_OPTIONS = [{
53
+ label: 'Select',
54
+ value: ''
55
+ }, {
56
+ label: 'Loan Type',
57
+ value: types.QB_FIELD_TYPES.LOAN_VALUES
58
+ }, {
59
+ label: 'Loan To Value (LTV)',
60
+ value: types.QB_FIELD_TYPES.LTV_VALUES
61
+ }, {
62
+ label: 'Subject Property Type',
63
+ value: types.QB_FIELD_TYPES.SUBJECT_VALUES
64
+ }, {
65
+ label: 'Last Finished Milestone',
66
+ value: types.QB_FIELD_TYPES.LAST_VALUES
67
+ }, {
68
+ label: 'Credit Score',
69
+ value: types.QB_FIELD_TYPES.CREDIT_VALUES
70
+ }];
71
+ const QB_OPERATOR_OPTIONS = [{
72
+ label: 'Select',
73
+ value: ''
74
+ }, {
75
+ label: 'Is',
76
+ value: types.QB_OPERATOR_TYPES.EQUAL
77
+ }, {
78
+ label: 'Is not',
79
+ value: types.QB_OPERATOR_TYPES.NOT_EQUAL
80
+ }, {
81
+ label: 'Greater than',
82
+ value: types.QB_OPERATOR_TYPES.GREATER_THAN
83
+ }, {
84
+ label: 'Less than',
85
+ value: types.QB_OPERATOR_TYPES.LESS_THAN
86
+ }, {
87
+ label: 'Contains',
88
+ value: types.QB_OPERATOR_TYPES.CONTAINS
89
+ }, {
90
+ label: "Doesn't Contain",
91
+ value: types.QB_OPERATOR_TYPES.NOT_CONTAINS
92
+ }, {
93
+ label: 'Between',
94
+ value: types.QB_OPERATOR_TYPES.BETWEEN
95
+ }];
96
+
97
+ exports.QB_DEFAULT_VALUES_OPTIONS = QB_DEFAULT_VALUES_OPTIONS;
98
+ exports.QB_FIELD_OPTIONS = QB_FIELD_OPTIONS;
99
+ exports.QB_LOAN_VALUES_OPTIONS = QB_LOAN_VALUES_OPTIONS;
100
+ exports.QB_OPERATOR_OPTIONS = QB_OPERATOR_OPTIONS;
101
+ exports.QB_SUBJECT_VALUES_OPTIONS = QB_SUBJECT_VALUES_OPTIONS;
@@ -1,39 +1,35 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var store_exports = {};
29
- __export(store_exports, {
30
- default: () => store_default
31
- });
32
- var React = __toESM(require("react"));
33
- var import_actions = require("./actions");
34
- var import_format = __toESM(require("../format/format"));
1
+ 'use strict';
2
+
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ require('core-js/modules/esnext.async-iterator.for-each.js');
5
+ require('core-js/modules/esnext.iterator.constructor.js');
6
+ require('core-js/modules/esnext.iterator.for-each.js');
7
+ require('core-js/modules/esnext.async-iterator.filter.js');
8
+ require('core-js/modules/esnext.iterator.filter.js');
9
+ var actions = require('./actions.js');
10
+ var format = require('../format/format.js');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
15
+
16
+ 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; }
17
+
18
+ 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__default["default"](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; }
19
+ /**
20
+ * Fluent interface: https://en.wikipedia.org/wiki/Fluent_interface
21
+ *
22
+ * @param idGroup
23
+ * @param parentIdGroup
24
+ * @param items
25
+ * @param idFilter
26
+ * @param value
27
+ * @param data
28
+ * @class QueryBuilderStore
29
+ */
30
+
35
31
  class QueryBuilderStore {
36
- constructor(init, format) {
32
+ constructor(init, _format) {
37
33
  this.items = [];
38
34
  this.step = 0;
39
35
  this.steps = {};
@@ -41,119 +37,141 @@ class QueryBuilderStore {
41
37
  this.mapGroups = {};
42
38
  this.main = null;
43
39
  this.format = null;
44
- this.createNewFilter = (idGroup) => import_actions.createNewFilter.call(this, idGroup);
45
- this.createNewGroup = (parentIdGroup) => import_actions.createNewGroup.call(this, parentIdGroup);
46
- this.onOrderDragAndDrop = (items) => {
40
+
41
+ this.createNewFilter = idGroup => actions.createNewFilter.call(this, idGroup);
42
+
43
+ this.createNewGroup = parentIdGroup => actions.createNewGroup.call(this, parentIdGroup);
44
+
45
+ this.onOrderDragAndDrop = items => {
47
46
  this.items = items;
48
47
  return this.getState();
49
48
  };
49
+
50
50
  this.addFilterNextToFilterId = (idGroup, idFilter) => {
51
+ // eslint-disable-line
51
52
  this.addFilter(idGroup);
52
53
  return this.getState();
53
54
  };
54
- this.addFilter = (idGroup) => {
55
+
56
+ this.addFilter = idGroup => {
55
57
  const newFilter = this.createNewFilter(idGroup);
56
- import_actions.addFilterToMap.call(this, newFilter);
58
+ actions.addFilterToMap.call(this, newFilter); // new API
59
+
57
60
  if (this.main === idGroup) {
58
- import_actions.addFilterToMainItem.call(this, this.items, newFilter);
61
+ actions.addFilterToMainItem.call(this, this.items, newFilter);
59
62
  } else {
60
- const foundInItems = import_actions.findItemFilterById.call(this, idGroup);
63
+ const foundInItems = actions.findItemFilterById.call(this, idGroup);
64
+
61
65
  if (foundInItems) {
62
- import_actions.addFilterToItem.call(this, foundInItems, newFilter);
66
+ actions.addFilterToItem.call(this, foundInItems, newFilter);
63
67
  }
64
68
  }
69
+
65
70
  return this.getState();
66
71
  };
67
- this.onRemoveFilter = (idFilter) => {
68
- import_actions.removeFilterItem.call(this, idFilter);
72
+
73
+ this.onRemoveFilter = idFilter => {
74
+ // new API
75
+ actions.removeFilterItem.call(this, idFilter);
69
76
  return this.getState();
70
77
  };
78
+
71
79
  this.addRuleContainerInPlace = (idGroup, idFilter) => {
80
+ // Create a new group
72
81
  const newGroup = this.createNewGroup(idGroup);
73
- import_actions.addGroupFilterToItem.call(this, idGroup, idFilter, newGroup);
82
+ actions.addGroupFilterToItem.call(this, idGroup, idFilter, newGroup);
74
83
  return this.getState();
75
84
  };
85
+
76
86
  this.addRuleContainer = (idGroup, idFilter) => {
87
+ // eslint-disable-line
77
88
  const newGroup = this.createNewGroup(idGroup);
78
- import_actions.addGroupToMap.call(this, newGroup);
89
+ actions.addGroupToMap.call(this, newGroup);
90
+
79
91
  if (this.main === idGroup) {
80
- import_actions.addFilterToMainItem.call(this, this.items, newGroup);
92
+ actions.addFilterToMainItem.call(this, this.items, newGroup);
81
93
  } else {
82
- const foundInItems = import_actions.findItemFilterById.call(this, idGroup);
94
+ const foundInItems = actions.findItemFilterById.call(this, idGroup);
95
+
83
96
  if (foundInItems) {
84
- import_actions.addFilterToItem.call(this, foundInItems, newGroup);
97
+ actions.addFilterToItem.call(this, foundInItems, newGroup);
85
98
  }
86
99
  }
100
+
87
101
  return this.getState();
88
102
  };
89
- this.unGroup = (idGroup) => {
90
- import_actions.unGroupFilterToItem.call(this, idGroup);
103
+
104
+ this.unGroup = idGroup => {
105
+ actions.unGroupFilterToItem.call(this, idGroup);
91
106
  return this.getState();
92
107
  };
108
+
93
109
  this.changeGroupOperator = (idGroup, value) => {
94
110
  this.getGroupById(idGroup).condition = value;
95
- import_actions.changeGroupOperator.call(this, idGroup, value);
111
+ actions.changeGroupOperator.call(this, idGroup, value);
96
112
  return this.getState();
97
113
  };
98
- this.changeFilter = (data) => {
99
- const { idFilter } = data;
100
- this.mapFilters[idFilter] = {
101
- ...this.mapFilters[idFilter],
102
- ...data
103
- };
104
- import_actions.changeFilterItem.call(this, data);
114
+
115
+ this.changeFilter = data => {
116
+ const {
117
+ idFilter
118
+ } = data;
119
+ this.mapFilters[idFilter] = _objectSpread(_objectSpread({}, this.mapFilters[idFilter]), data);
120
+ actions.changeFilterItem.call(this, data);
105
121
  return this.getState();
106
122
  };
107
- this.getGroupById = (idGroup) => this.mapGroups[idGroup] || {};
108
- this.getFilterById = (idFilter) => this.mapFilters[idFilter];
123
+
124
+ this.getGroupById = idGroup => this.mapGroups[idGroup] || {};
125
+
126
+ this.getFilterById = idFilter => this.mapFilters[idFilter];
127
+
109
128
  this.getInitialState = () => {
110
129
  const newFilters = {
111
130
  step: this.step,
112
- mapFilters: { ...this.mapFilters },
113
- mapGroups: { ...this.mapGroups },
131
+ mapFilters: _objectSpread({}, this.mapFilters),
132
+ mapGroups: _objectSpread({}, this.mapGroups),
114
133
  main: this.main,
115
134
  items: this.items
116
135
  };
117
- const format = import_format.default.run(newFilters, this.format);
118
- return {
119
- ...newFilters,
120
- format
121
- };
136
+ const format$1 = format.run(newFilters, this.format);
137
+ return _objectSpread(_objectSpread({}, newFilters), {}, {
138
+ format: format$1
139
+ });
122
140
  };
141
+
123
142
  this.getState = () => {
124
143
  this.step += 1;
125
144
  const newFilters = {
126
145
  step: this.step,
127
- mapFilters: { ...this.mapFilters },
128
- mapGroups: { ...this.mapGroups },
146
+ mapFilters: _objectSpread({}, this.mapFilters),
147
+ mapGroups: _objectSpread({}, this.mapGroups),
129
148
  main: this.main,
130
149
  items: this.items
131
150
  };
132
- const format = import_format.default.run(newFilters, this.format);
133
- return {
134
- ...newFilters,
135
- format
136
- };
151
+ const format$1 = format.run(newFilters, this.format);
152
+ return _objectSpread(_objectSpread({}, newFilters), {}, {
153
+ format: format$1
154
+ });
137
155
  };
156
+
138
157
  this.firstLoad = true;
139
- this.format = format;
140
- if (init)
141
- return this.initSetupUp(init);
142
- const mainGroup = this.createNewGroup("main");
158
+ this.format = _format;
159
+ if (init) return this.initSetupUp(init);
160
+ const mainGroup = this.createNewGroup('main');
143
161
  this.mapGroups = {
144
162
  [mainGroup.idGroup]: mainGroup
145
163
  };
146
164
  this.main = mainGroup.idGroup;
147
165
  this.addFilter(mainGroup.idGroup);
148
166
  }
167
+
149
168
  initSetupUp(init) {
150
169
  this.step = init.step || 1;
151
- Object.keys(init).forEach((key) => {
152
- if (init[key] && this[key] !== void 0)
153
- this[key] = init[key];
170
+ Object.keys(init).forEach(key => {
171
+ if (init[key] && this[key] !== undefined) this[key] = init[key];
154
172
  });
155
173
  }
174
+
156
175
  }
157
- var store_default = QueryBuilderStore;
158
- module.exports = __toCommonJS(store_exports);
159
- //# sourceMappingURL=store.js.map
176
+
177
+ module.exports = QueryBuilderStore;
@@ -1,92 +1,64 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var types_exports = {};
29
- __export(types_exports, {
30
- QB_ADD_FILTER_METHOD_TYPES: () => QB_ADD_FILTER_METHOD_TYPES,
31
- QB_DRAG_LOCATIONS: () => QB_DRAG_LOCATIONS,
32
- QB_DRAG_TYPES: () => QB_DRAG_TYPES,
33
- QB_EXPORT_FORMAT_TYPES: () => QB_EXPORT_FORMAT_TYPES,
34
- QB_FIELD_SHARED_ACTIONS: () => QB_FIELD_SHARED_ACTIONS,
35
- QB_FIELD_TYPES: () => QB_FIELD_TYPES,
36
- QB_GROUP_CONDITION_TYPES: () => QB_GROUP_CONDITION_TYPES,
37
- QB_GROUP_FILTER_METHOD_TYPES: () => QB_GROUP_FILTER_METHOD_TYPES,
38
- QB_OPERATOR_TYPES: () => QB_OPERATOR_TYPES
39
- });
40
- var React = __toESM(require("react"));
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
41
5
  const QB_FIELD_TYPES = {
42
- LOAN_VALUES: "loanValues",
43
- LTV_VALUES: "ltvValues",
44
- SUBJECT_VALUES: "subjectValues",
45
- LAST_VALUES: "lastValues",
46
- CREDIT_VALUES: "creditValues"
6
+ LOAN_VALUES: 'loanValues',
7
+ LTV_VALUES: 'ltvValues',
8
+ SUBJECT_VALUES: 'subjectValues',
9
+ LAST_VALUES: 'lastValues',
10
+ CREDIT_VALUES: 'creditValues'
47
11
  };
48
12
  const QB_OPERATOR_TYPES = {
49
- EQUAL: "equal",
50
- NOT_EQUAL: "notEqual",
51
- GREATER_THAN: "greaterThan",
52
- LESS_THAN: "lessThan",
53
- CONTAINS: "contains",
54
- NOT_CONTAINS: "notNontains",
55
- BETWEEN: "between",
56
- GREATER_THAN_OR_EQUAL: "greaterThanOrEquals",
57
- LESS_THAN_OR_EQUAL: "lessThanOrEquals",
58
- START_WITH: "startsWith"
13
+ EQUAL: 'equal',
14
+ NOT_EQUAL: 'notEqual',
15
+ GREATER_THAN: 'greaterThan',
16
+ LESS_THAN: 'lessThan',
17
+ CONTAINS: 'contains',
18
+ NOT_CONTAINS: 'notNontains',
19
+ BETWEEN: 'between',
20
+ GREATER_THAN_OR_EQUAL: 'greaterThanOrEquals',
21
+ LESS_THAN_OR_EQUAL: 'lessThanOrEquals',
22
+ START_WITH: 'startsWith'
59
23
  };
60
24
  const QB_GROUP_CONDITION_TYPES = {
61
25
  AND: true,
62
26
  OR: false
63
27
  };
64
28
  const QB_DRAG_TYPES = {
65
- FILTER: "filter",
66
- GROUP: "group"
29
+ FILTER: 'filter',
30
+ GROUP: 'group'
67
31
  };
68
32
  const QB_DRAG_LOCATIONS = {
69
- ABOVE: "above",
70
- BELOW: "below"
33
+ ABOVE: 'above',
34
+ BELOW: 'below'
71
35
  };
72
36
  const QB_EXPORT_FORMAT_TYPES = {
73
- DEFAULT: "defaultFormat",
74
- XML: "xmlFormat",
75
- SQL: "sqlFormat",
76
- SAFESQL: "sqlSafeFormat"
37
+ DEFAULT: 'defaultFormat',
38
+ XML: 'xmlFormat',
39
+ SQL: 'sqlFormat',
40
+ SAFESQL: 'sqlSafeFormat'
77
41
  };
78
42
  const QB_ADD_FILTER_METHOD_TYPES = {
79
- IN_PLACE: "inplace",
80
- APPEND: "append"
43
+ IN_PLACE: 'inplace',
44
+ APPEND: 'append'
81
45
  };
82
46
  const QB_GROUP_FILTER_METHOD_TYPES = {
83
- IN_PLACE: "inplace",
84
- APPEND: "append"
47
+ IN_PLACE: 'inplace',
48
+ APPEND: 'append'
85
49
  };
86
50
  const QB_FIELD_SHARED_ACTIONS = {
87
- RESET_FIELD: "resetField",
88
- RESET_OPERATOR: "resetOperator",
89
- RESET_VALUE: "resetValue"
51
+ RESET_FIELD: 'resetField',
52
+ RESET_OPERATOR: 'resetOperator',
53
+ RESET_VALUE: 'resetValue'
90
54
  };
91
- module.exports = __toCommonJS(types_exports);
92
- //# sourceMappingURL=types.js.map
55
+
56
+ exports.QB_ADD_FILTER_METHOD_TYPES = QB_ADD_FILTER_METHOD_TYPES;
57
+ exports.QB_DRAG_LOCATIONS = QB_DRAG_LOCATIONS;
58
+ exports.QB_DRAG_TYPES = QB_DRAG_TYPES;
59
+ exports.QB_EXPORT_FORMAT_TYPES = QB_EXPORT_FORMAT_TYPES;
60
+ exports.QB_FIELD_SHARED_ACTIONS = QB_FIELD_SHARED_ACTIONS;
61
+ exports.QB_FIELD_TYPES = QB_FIELD_TYPES;
62
+ exports.QB_GROUP_CONDITION_TYPES = QB_GROUP_CONDITION_TYPES;
63
+ exports.QB_GROUP_FILTER_METHOD_TYPES = QB_GROUP_FILTER_METHOD_TYPES;
64
+ exports.QB_OPERATOR_TYPES = QB_OPERATOR_TYPES;