@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.
- package/cjs/DSQueryBuilder.js +97 -117
- package/cjs/components/AndOrController/AndOrController.js +162 -148
- package/cjs/components/ConditionController/ConditionController.js +72 -88
- package/cjs/components/DisplayOutput/DisplayOutput.js +68 -63
- package/cjs/components/DragContainerController/DragContainerController.js +41 -61
- package/cjs/components/DragControllerRow/DragControllerRow.js +46 -50
- package/cjs/components/FieldControllerRow/FieldControllerRow.js +32 -54
- package/cjs/components/Nestable/Nestable.js +209 -143
- package/cjs/components/Nestable/NestableItem.js +90 -98
- package/cjs/components/Nestable/actions/events.js +95 -72
- package/cjs/components/Nestable/actions/getItemOptions.js +15 -36
- package/cjs/components/Nestable/actions/getPaths.js +51 -46
- package/cjs/components/Nestable/actions/index.js +28 -42
- package/cjs/components/Nestable/actions/moveItem.js +42 -44
- package/cjs/components/Nestable/actions/paths.js +55 -48
- package/cjs/components/Nestable/actions/tryDecreaseDepth.js +23 -39
- package/cjs/components/Nestable/actions/tryIncreaseDepth.js +26 -39
- package/cjs/components/Nestable/index.js +7 -36
- package/cjs/components/QueryBuilderContext/QueryBuilderContext.js +13 -36
- package/cjs/components/QueryBuilderImpl.js +202 -118
- package/cjs/components/QueryBuilderItem/QueryBuilderItem.js +78 -80
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +211 -154
- package/cjs/components/ToolBarAnimation/ToolBarAnimation.js +26 -39
- package/cjs/components/format/format.js +22 -48
- package/cjs/components/format/sqlFormat.js +48 -69
- package/cjs/components/format/sqlSafeFormat.js +55 -72
- package/cjs/components/format/xmlFormat.js +50 -71
- package/cjs/components/helpers/actions.js +186 -151
- package/cjs/components/helpers/constants.js +8 -36
- package/cjs/components/helpers/dependencies.js +64 -49
- package/cjs/components/helpers/selectors.js +101 -161
- package/cjs/components/helpers/store.js +104 -86
- package/cjs/components/helpers/types.js +44 -72
- package/cjs/index.js +29 -36
- package/cjs/propTypes.js +94 -102
- package/esm/DSQueryBuilder.js +72 -103
- package/esm/components/AndOrController/AndOrController.js +147 -113
- package/esm/components/ConditionController/ConditionController.js +62 -57
- package/esm/components/DisplayOutput/DisplayOutput.js +59 -31
- package/esm/components/DragContainerController/DragContainerController.js +35 -32
- package/esm/components/DragControllerRow/DragControllerRow.js +38 -21
- package/esm/components/FieldControllerRow/FieldControllerRow.js +26 -25
- package/esm/components/Nestable/Nestable.js +186 -115
- package/esm/components/Nestable/NestableItem.js +82 -69
- package/esm/components/Nestable/actions/events.js +79 -45
- package/esm/components/Nestable/actions/getItemOptions.js +11 -7
- package/esm/components/Nestable/actions/getPaths.js +43 -17
- package/esm/components/Nestable/actions/index.js +6 -13
- package/esm/components/Nestable/actions/moveItem.js +31 -13
- package/esm/components/Nestable/actions/paths.js +47 -19
- package/esm/components/Nestable/actions/tryDecreaseDepth.js +19 -10
- package/esm/components/Nestable/actions/tryIncreaseDepth.js +22 -10
- package/esm/components/Nestable/index.js +2 -7
- package/esm/components/QueryBuilderContext/QueryBuilderContext.js +5 -7
- package/esm/components/QueryBuilderImpl.js +187 -82
- package/esm/components/QueryBuilderItem/QueryBuilderItem.js +70 -50
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +201 -123
- package/esm/components/ToolBarAnimation/ToolBarAnimation.js +17 -10
- package/esm/components/format/format.js +17 -16
- package/esm/components/format/sqlFormat.js +43 -39
- package/esm/components/format/sqlSafeFormat.js +50 -43
- package/esm/components/format/xmlFormat.js +45 -41
- package/esm/components/helpers/actions.js +160 -123
- package/esm/components/helpers/constants.js +2 -7
- package/esm/components/helpers/dependencies.js +39 -19
- package/esm/components/helpers/selectors.js +93 -132
- package/esm/components/helpers/store.js +82 -54
- package/esm/components/helpers/types.js +33 -44
- package/esm/index.js +4 -7
- package/esm/propTypes.js +72 -55
- package/package.json +12 -12
- package/cjs/DSQueryBuilder.js.map +0 -7
- package/cjs/components/AndOrController/AndOrController.js.map +0 -7
- package/cjs/components/ConditionController/ConditionController.js.map +0 -7
- package/cjs/components/DisplayOutput/DisplayOutput.js.map +0 -7
- package/cjs/components/DragContainerController/DragContainerController.js.map +0 -7
- package/cjs/components/DragControllerRow/DragControllerRow.js.map +0 -7
- package/cjs/components/FieldControllerRow/FieldControllerRow.js.map +0 -7
- package/cjs/components/Nestable/Nestable.js.map +0 -7
- package/cjs/components/Nestable/NestableItem.js.map +0 -7
- package/cjs/components/Nestable/actions/events.js.map +0 -7
- package/cjs/components/Nestable/actions/getItemOptions.js.map +0 -7
- package/cjs/components/Nestable/actions/getPaths.js.map +0 -7
- package/cjs/components/Nestable/actions/index.js.map +0 -7
- package/cjs/components/Nestable/actions/moveItem.js.map +0 -7
- package/cjs/components/Nestable/actions/paths.js.map +0 -7
- package/cjs/components/Nestable/actions/tryDecreaseDepth.js.map +0 -7
- package/cjs/components/Nestable/actions/tryIncreaseDepth.js.map +0 -7
- package/cjs/components/Nestable/index.js.map +0 -7
- package/cjs/components/QueryBuilderContext/QueryBuilderContext.js.map +0 -7
- package/cjs/components/QueryBuilderImpl.js.map +0 -7
- package/cjs/components/QueryBuilderItem/QueryBuilderItem.js.map +0 -7
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js.map +0 -7
- package/cjs/components/ToolBarAnimation/ToolBarAnimation.js.map +0 -7
- package/cjs/components/format/format.js.map +0 -7
- package/cjs/components/format/sqlFormat.js.map +0 -7
- package/cjs/components/format/sqlSafeFormat.js.map +0 -7
- package/cjs/components/format/xmlFormat.js.map +0 -7
- package/cjs/components/helpers/actions.js.map +0 -7
- package/cjs/components/helpers/constants.js.map +0 -7
- package/cjs/components/helpers/dependencies.js.map +0 -7
- package/cjs/components/helpers/selectors.js.map +0 -7
- package/cjs/components/helpers/store.js.map +0 -7
- package/cjs/components/helpers/types.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/propTypes.js.map +0 -7
- package/esm/DSQueryBuilder.js.map +0 -7
- package/esm/components/AndOrController/AndOrController.js.map +0 -7
- package/esm/components/ConditionController/ConditionController.js.map +0 -7
- package/esm/components/DisplayOutput/DisplayOutput.js.map +0 -7
- package/esm/components/DragContainerController/DragContainerController.js.map +0 -7
- package/esm/components/DragControllerRow/DragControllerRow.js.map +0 -7
- package/esm/components/FieldControllerRow/FieldControllerRow.js.map +0 -7
- package/esm/components/Nestable/Nestable.js.map +0 -7
- package/esm/components/Nestable/NestableItem.js.map +0 -7
- package/esm/components/Nestable/actions/events.js.map +0 -7
- package/esm/components/Nestable/actions/getItemOptions.js.map +0 -7
- package/esm/components/Nestable/actions/getPaths.js.map +0 -7
- package/esm/components/Nestable/actions/index.js.map +0 -7
- package/esm/components/Nestable/actions/moveItem.js.map +0 -7
- package/esm/components/Nestable/actions/paths.js.map +0 -7
- package/esm/components/Nestable/actions/tryDecreaseDepth.js.map +0 -7
- package/esm/components/Nestable/actions/tryIncreaseDepth.js.map +0 -7
- package/esm/components/Nestable/index.js.map +0 -7
- package/esm/components/QueryBuilderContext/QueryBuilderContext.js.map +0 -7
- package/esm/components/QueryBuilderImpl.js.map +0 -7
- package/esm/components/QueryBuilderItem/QueryBuilderItem.js.map +0 -7
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js.map +0 -7
- package/esm/components/ToolBarAnimation/ToolBarAnimation.js.map +0 -7
- package/esm/components/format/format.js.map +0 -7
- package/esm/components/format/sqlFormat.js.map +0 -7
- package/esm/components/format/sqlSafeFormat.js.map +0 -7
- package/esm/components/format/xmlFormat.js.map +0 -7
- package/esm/components/helpers/actions.js.map +0 -7
- package/esm/components/helpers/constants.js.map +0 -7
- package/esm/components/helpers/dependencies.js.map +0 -7
- package/esm/components/helpers/selectors.js.map +0 -7
- package/esm/components/helpers/store.js.map +0 -7
- package/esm/components/helpers/types.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/propTypes.js.map +0 -7
|
@@ -1,161 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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,
|
|
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
|
-
|
|
45
|
-
this.
|
|
46
|
-
|
|
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
|
-
|
|
55
|
+
|
|
56
|
+
this.addFilter = idGroup => {
|
|
55
57
|
const newFilter = this.createNewFilter(idGroup);
|
|
56
|
-
|
|
58
|
+
actions.addFilterToMap.call(this, newFilter); // new API
|
|
59
|
+
|
|
57
60
|
if (this.main === idGroup) {
|
|
58
|
-
|
|
61
|
+
actions.addFilterToMainItem.call(this, this.items, newFilter);
|
|
59
62
|
} else {
|
|
60
|
-
const foundInItems =
|
|
63
|
+
const foundInItems = actions.findItemFilterById.call(this, idGroup);
|
|
64
|
+
|
|
61
65
|
if (foundInItems) {
|
|
62
|
-
|
|
66
|
+
actions.addFilterToItem.call(this, foundInItems, newFilter);
|
|
63
67
|
}
|
|
64
68
|
}
|
|
69
|
+
|
|
65
70
|
return this.getState();
|
|
66
71
|
};
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
|
|
89
|
+
actions.addGroupToMap.call(this, newGroup);
|
|
90
|
+
|
|
79
91
|
if (this.main === idGroup) {
|
|
80
|
-
|
|
92
|
+
actions.addFilterToMainItem.call(this, this.items, newGroup);
|
|
81
93
|
} else {
|
|
82
|
-
const foundInItems =
|
|
94
|
+
const foundInItems = actions.findItemFilterById.call(this, idGroup);
|
|
95
|
+
|
|
83
96
|
if (foundInItems) {
|
|
84
|
-
|
|
97
|
+
actions.addFilterToItem.call(this, foundInItems, newGroup);
|
|
85
98
|
}
|
|
86
99
|
}
|
|
100
|
+
|
|
87
101
|
return this.getState();
|
|
88
102
|
};
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
111
|
+
actions.changeGroupOperator.call(this, idGroup, value);
|
|
96
112
|
return this.getState();
|
|
97
113
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
};
|
|
104
|
-
|
|
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
|
-
|
|
108
|
-
this.
|
|
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: {
|
|
113
|
-
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 =
|
|
118
|
-
return {
|
|
119
|
-
|
|
120
|
-
|
|
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: {
|
|
128
|
-
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 =
|
|
133
|
-
return {
|
|
134
|
-
|
|
135
|
-
|
|
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 =
|
|
140
|
-
if (init)
|
|
141
|
-
|
|
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(
|
|
152
|
-
if (init[key] && this[key] !==
|
|
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
|
-
|
|
158
|
-
module.exports =
|
|
159
|
-
//# sourceMappingURL=store.js.map
|
|
176
|
+
|
|
177
|
+
module.exports = QueryBuilderStore;
|
|
@@ -1,92 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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:
|
|
43
|
-
LTV_VALUES:
|
|
44
|
-
SUBJECT_VALUES:
|
|
45
|
-
LAST_VALUES:
|
|
46
|
-
CREDIT_VALUES:
|
|
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:
|
|
50
|
-
NOT_EQUAL:
|
|
51
|
-
GREATER_THAN:
|
|
52
|
-
LESS_THAN:
|
|
53
|
-
CONTAINS:
|
|
54
|
-
NOT_CONTAINS:
|
|
55
|
-
BETWEEN:
|
|
56
|
-
GREATER_THAN_OR_EQUAL:
|
|
57
|
-
LESS_THAN_OR_EQUAL:
|
|
58
|
-
START_WITH:
|
|
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:
|
|
66
|
-
GROUP:
|
|
29
|
+
FILTER: 'filter',
|
|
30
|
+
GROUP: 'group'
|
|
67
31
|
};
|
|
68
32
|
const QB_DRAG_LOCATIONS = {
|
|
69
|
-
ABOVE:
|
|
70
|
-
BELOW:
|
|
33
|
+
ABOVE: 'above',
|
|
34
|
+
BELOW: 'below'
|
|
71
35
|
};
|
|
72
36
|
const QB_EXPORT_FORMAT_TYPES = {
|
|
73
|
-
DEFAULT:
|
|
74
|
-
XML:
|
|
75
|
-
SQL:
|
|
76
|
-
SAFESQL:
|
|
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:
|
|
80
|
-
APPEND:
|
|
43
|
+
IN_PLACE: 'inplace',
|
|
44
|
+
APPEND: 'append'
|
|
81
45
|
};
|
|
82
46
|
const QB_GROUP_FILTER_METHOD_TYPES = {
|
|
83
|
-
IN_PLACE:
|
|
84
|
-
APPEND:
|
|
47
|
+
IN_PLACE: 'inplace',
|
|
48
|
+
APPEND: 'append'
|
|
85
49
|
};
|
|
86
50
|
const QB_FIELD_SHARED_ACTIONS = {
|
|
87
|
-
RESET_FIELD:
|
|
88
|
-
RESET_OPERATOR:
|
|
89
|
-
RESET_VALUE:
|
|
51
|
+
RESET_FIELD: 'resetField',
|
|
52
|
+
RESET_OPERATOR: 'resetOperator',
|
|
53
|
+
RESET_VALUE: 'resetValue'
|
|
90
54
|
};
|
|
91
|
-
|
|
92
|
-
|
|
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;
|