@elliemae/ds-query-builder 3.0.0-next.0 → 3.0.0-next.4
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/dist/cjs/DSQueryBuilder.js +118 -0
- package/dist/cjs/DSQueryBuilder.js.map +7 -0
- package/dist/cjs/components/AndOrController/AndOrController.js +208 -0
- package/dist/cjs/components/AndOrController/AndOrController.js.map +7 -0
- package/dist/cjs/components/ConditionController/ConditionController.js +116 -0
- package/dist/cjs/components/ConditionController/ConditionController.js.map +7 -0
- package/dist/cjs/components/DisplayOutput/DisplayOutput.js +92 -0
- package/dist/cjs/components/DisplayOutput/DisplayOutput.js.map +7 -0
- package/dist/cjs/components/DragContainerController/DragContainerController.js +65 -0
- package/dist/cjs/components/DragContainerController/DragContainerController.js.map +7 -0
- package/dist/cjs/components/DragControllerRow/DragControllerRow.js +83 -0
- package/dist/cjs/components/DragControllerRow/DragControllerRow.js.map +7 -0
- package/dist/cjs/components/FieldControllerRow/FieldControllerRow.js +55 -0
- package/dist/cjs/components/FieldControllerRow/FieldControllerRow.js.map +7 -0
- package/dist/cjs/components/Nestable/Nestable.js +264 -0
- package/dist/cjs/components/Nestable/Nestable.js.map +7 -0
- package/dist/cjs/components/Nestable/NestableItem.js +127 -0
- package/dist/cjs/components/Nestable/NestableItem.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/events.js +153 -0
- package/dist/cjs/components/Nestable/actions/events.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/getItemOptions.js +49 -0
- package/dist/cjs/components/Nestable/actions/getItemOptions.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/getPaths.js +119 -0
- package/dist/cjs/components/Nestable/actions/getPaths.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/index.js +42 -0
- package/dist/cjs/components/Nestable/actions/index.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/moveItem.js +69 -0
- package/dist/cjs/components/Nestable/actions/moveItem.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/paths.js +119 -0
- package/dist/cjs/components/Nestable/actions/paths.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/tryDecreaseDepth.js +51 -0
- package/dist/cjs/components/Nestable/actions/tryDecreaseDepth.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/tryIncreaseDepth.js +51 -0
- package/dist/cjs/components/Nestable/actions/tryIncreaseDepth.js.map +7 -0
- package/dist/cjs/components/Nestable/index.js +36 -0
- package/dist/cjs/components/Nestable/index.js.map +7 -0
- package/dist/cjs/components/QueryBuilderContext/QueryBuilderContext.js +36 -0
- package/dist/cjs/components/QueryBuilderContext/QueryBuilderContext.js.map +7 -0
- package/dist/cjs/components/QueryBuilderImpl.js +253 -0
- package/dist/cjs/components/QueryBuilderImpl.js.map +7 -0
- package/dist/cjs/components/QueryBuilderItem/QueryBuilderItem.js +108 -0
- package/dist/cjs/components/QueryBuilderItem/QueryBuilderItem.js.map +7 -0
- package/dist/cjs/components/QueryBuilderRow/QueryBuilderRow.js +235 -0
- package/dist/cjs/components/QueryBuilderRow/QueryBuilderRow.js.map +7 -0
- package/dist/cjs/components/ToolBarAnimation/ToolBarAnimation.js +58 -0
- package/dist/cjs/components/ToolBarAnimation/ToolBarAnimation.js.map +7 -0
- package/dist/cjs/components/format/format.js +59 -0
- package/dist/cjs/components/format/format.js.map +7 -0
- package/dist/cjs/components/format/sqlFormat.js +94 -0
- package/dist/cjs/components/format/sqlFormat.js.map +7 -0
- package/dist/cjs/components/format/sqlSafeFormat.js +98 -0
- package/dist/cjs/components/format/sqlSafeFormat.js.map +7 -0
- package/dist/cjs/components/format/xmlFormat.js +94 -0
- package/dist/cjs/components/format/xmlFormat.js.map +7 -0
- package/dist/cjs/components/helpers/actions.js +253 -0
- package/dist/cjs/components/helpers/actions.js.map +7 -0
- package/dist/cjs/components/helpers/constants.js +39 -0
- package/dist/cjs/components/helpers/constants.js.map +7 -0
- package/dist/cjs/components/helpers/dependencies.js +69 -0
- package/dist/cjs/components/helpers/dependencies.js.map +7 -0
- package/dist/cjs/components/helpers/selectors.js +161 -0
- package/dist/cjs/components/helpers/selectors.js.map +7 -0
- package/dist/cjs/components/helpers/store.js +171 -0
- package/dist/cjs/components/helpers/store.js.map +7 -0
- package/dist/cjs/components/helpers/types.js +92 -0
- package/dist/cjs/components/helpers/types.js.map +7 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/propTypes.js +105 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/esm/DSQueryBuilder.js +105 -0
- package/dist/esm/DSQueryBuilder.js.map +7 -0
- package/dist/esm/components/AndOrController/AndOrController.js +179 -0
- package/dist/esm/components/AndOrController/AndOrController.js.map +7 -0
- package/dist/esm/components/ConditionController/ConditionController.js +87 -0
- package/dist/esm/components/ConditionController/ConditionController.js.map +7 -0
- package/dist/esm/components/DisplayOutput/DisplayOutput.js +63 -0
- package/dist/esm/components/DisplayOutput/DisplayOutput.js.map +7 -0
- package/dist/esm/components/DragContainerController/DragContainerController.js +36 -0
- package/dist/esm/components/DragContainerController/DragContainerController.js.map +7 -0
- package/dist/esm/components/DragControllerRow/DragControllerRow.js +56 -0
- package/dist/esm/components/DragControllerRow/DragControllerRow.js.map +7 -0
- package/dist/esm/components/FieldControllerRow/FieldControllerRow.js +26 -0
- package/dist/esm/components/FieldControllerRow/FieldControllerRow.js.map +7 -0
- package/dist/esm/components/Nestable/Nestable.js +253 -0
- package/dist/esm/components/Nestable/Nestable.js.map +7 -0
- package/dist/esm/components/Nestable/NestableItem.js +100 -0
- package/dist/esm/components/Nestable/NestableItem.js.map +7 -0
- package/dist/esm/components/Nestable/actions/events.js +131 -0
- package/dist/esm/components/Nestable/actions/events.js.map +7 -0
- package/{esm → dist/esm}/components/Nestable/actions/getItemOptions.js +7 -11
- package/dist/esm/components/Nestable/actions/getItemOptions.js.map +7 -0
- package/{esm → dist/esm}/components/Nestable/actions/getPaths.js +17 -43
- package/dist/esm/components/Nestable/actions/getPaths.js.map +7 -0
- package/dist/esm/components/Nestable/actions/index.js +13 -0
- package/dist/esm/components/Nestable/actions/index.js.map +7 -0
- package/dist/esm/components/Nestable/actions/moveItem.js +42 -0
- package/dist/esm/components/Nestable/actions/moveItem.js.map +7 -0
- package/{esm → dist/esm}/components/Nestable/actions/paths.js +19 -47
- package/dist/esm/components/Nestable/actions/paths.js.map +7 -0
- package/dist/esm/components/Nestable/actions/tryDecreaseDepth.js +22 -0
- package/dist/esm/components/Nestable/actions/tryDecreaseDepth.js.map +7 -0
- package/{esm → dist/esm}/components/Nestable/actions/tryIncreaseDepth.js +10 -22
- package/dist/esm/components/Nestable/actions/tryIncreaseDepth.js.map +7 -0
- package/dist/esm/components/Nestable/index.js +7 -0
- package/dist/esm/components/Nestable/index.js.map +7 -0
- package/dist/esm/components/QueryBuilderContext/QueryBuilderContext.js +7 -0
- package/dist/esm/components/QueryBuilderContext/QueryBuilderContext.js.map +7 -0
- package/dist/esm/components/QueryBuilderImpl.js +226 -0
- package/dist/esm/components/QueryBuilderImpl.js.map +7 -0
- package/dist/esm/components/QueryBuilderItem/QueryBuilderItem.js +81 -0
- package/dist/esm/components/QueryBuilderItem/QueryBuilderItem.js.map +7 -0
- package/dist/esm/components/QueryBuilderRow/QueryBuilderRow.js +208 -0
- package/dist/esm/components/QueryBuilderRow/QueryBuilderRow.js.map +7 -0
- package/dist/esm/components/ToolBarAnimation/ToolBarAnimation.js +31 -0
- package/dist/esm/components/ToolBarAnimation/ToolBarAnimation.js.map +7 -0
- package/dist/esm/components/format/format.js +30 -0
- package/dist/esm/components/format/format.js.map +7 -0
- package/dist/esm/components/format/sqlFormat.js +65 -0
- package/dist/esm/components/format/sqlFormat.js.map +7 -0
- package/dist/esm/components/format/sqlSafeFormat.js +69 -0
- package/dist/esm/components/format/sqlSafeFormat.js.map +7 -0
- package/dist/esm/components/format/xmlFormat.js +65 -0
- package/dist/esm/components/format/xmlFormat.js.map +7 -0
- package/dist/esm/components/helpers/actions.js +230 -0
- package/dist/esm/components/helpers/actions.js.map +7 -0
- package/dist/esm/components/helpers/constants.js +10 -0
- package/dist/esm/components/helpers/constants.js.map +7 -0
- package/dist/esm/components/helpers/dependencies.js +40 -0
- package/dist/esm/components/helpers/dependencies.js.map +7 -0
- package/dist/esm/components/helpers/selectors.js +132 -0
- package/dist/esm/components/helpers/selectors.js.map +7 -0
- package/dist/esm/components/helpers/store.js +157 -0
- package/dist/esm/components/helpers/store.js.map +7 -0
- package/dist/esm/components/helpers/types.js +63 -0
- package/dist/esm/components/helpers/types.js.map +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/propTypes.js +76 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/package.json +103 -94
- package/cjs/DSQueryBuilder.js +0 -98
- package/cjs/components/AndOrController/AndOrController.js +0 -222
- package/cjs/components/ConditionController/ConditionController.js +0 -100
- package/cjs/components/DisplayOutput/DisplayOutput.js +0 -89
- package/cjs/components/DragContainerController/DragContainerController.js +0 -45
- package/cjs/components/DragControllerRow/DragControllerRow.js +0 -47
- package/cjs/components/FieldControllerRow/FieldControllerRow.js +0 -33
- package/cjs/components/Nestable/Nestable.js +0 -320
- package/cjs/components/Nestable/NestableItem.js +0 -111
- package/cjs/components/Nestable/actions/events.js +0 -166
- package/cjs/components/Nestable/actions/getItemOptions.js +0 -28
- package/cjs/components/Nestable/actions/getPaths.js +0 -124
- package/cjs/components/Nestable/actions/index.js +0 -28
- package/cjs/components/Nestable/actions/moveItem.js +0 -54
- package/cjs/components/Nestable/actions/paths.js +0 -126
- package/cjs/components/Nestable/actions/tryDecreaseDepth.js +0 -35
- package/cjs/components/Nestable/actions/tryIncreaseDepth.js +0 -38
- package/cjs/components/Nestable/index.js +0 -7
- package/cjs/components/QueryBuilderContext/QueryBuilderContext.js +0 -13
- package/cjs/components/QueryBuilderImpl.js +0 -309
- package/cjs/components/QueryBuilderItem/QueryBuilderItem.js +0 -90
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +0 -276
- package/cjs/components/ToolBarAnimation/ToolBarAnimation.js +0 -29
- package/cjs/components/format/format.js +0 -33
- package/cjs/components/format/sqlFormat.js +0 -73
- package/cjs/components/format/sqlSafeFormat.js +0 -81
- package/cjs/components/format/xmlFormat.js +0 -73
- package/cjs/components/helpers/actions.js +0 -277
- package/cjs/components/helpers/constants.js +0 -11
- package/cjs/components/helpers/dependencies.js +0 -84
- package/cjs/components/helpers/selectors.js +0 -101
- package/cjs/components/helpers/store.js +0 -177
- package/cjs/components/helpers/types.js +0 -64
- package/cjs/index.js +0 -29
- package/cjs/propTypes.js +0 -97
- package/esm/DSQueryBuilder.js +0 -74
- package/esm/components/AndOrController/AndOrController.js +0 -213
- package/esm/components/ConditionController/ConditionController.js +0 -92
- package/esm/components/DisplayOutput/DisplayOutput.js +0 -83
- package/esm/components/DragContainerController/DragContainerController.js +0 -39
- package/esm/components/DragControllerRow/DragControllerRow.js +0 -39
- package/esm/components/FieldControllerRow/FieldControllerRow.js +0 -27
- package/esm/components/Nestable/Nestable.js +0 -312
- package/esm/components/Nestable/NestableItem.js +0 -103
- package/esm/components/Nestable/actions/events.js +0 -153
- package/esm/components/Nestable/actions/index.js +0 -6
- package/esm/components/Nestable/actions/moveItem.js +0 -45
- package/esm/components/Nestable/actions/tryDecreaseDepth.js +0 -31
- package/esm/components/Nestable/index.js +0 -2
- package/esm/components/QueryBuilderContext/QueryBuilderContext.js +0 -5
- package/esm/components/QueryBuilderImpl.js +0 -301
- package/esm/components/QueryBuilderItem/QueryBuilderItem.js +0 -83
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +0 -268
- package/esm/components/ToolBarAnimation/ToolBarAnimation.js +0 -20
- package/esm/components/format/format.js +0 -31
- package/esm/components/format/sqlFormat.js +0 -69
- package/esm/components/format/sqlSafeFormat.js +0 -76
- package/esm/components/format/xmlFormat.js +0 -69
- package/esm/components/helpers/actions.js +0 -254
- package/esm/components/helpers/constants.js +0 -5
- package/esm/components/helpers/dependencies.js +0 -60
- package/esm/components/helpers/selectors.js +0 -93
- package/esm/components/helpers/store.js +0 -171
- package/esm/components/helpers/types.js +0 -52
- package/esm/index.js +0 -4
- package/esm/propTypes.js +0 -93
- package/types/DSQueryBuilder.d.ts +0 -211
- package/types/components/AndOrController/AndOrController.d.ts +0 -38
- package/types/components/ConditionController/ConditionController.d.ts +0 -16
- package/types/components/DisplayOutput/DisplayOutput.d.ts +0 -7
- package/types/components/DragContainerController/DragContainerController.d.ts +0 -9
- package/types/components/DragControllerRow/DragControllerRow.d.ts +0 -9
- package/types/components/FieldControllerRow/FieldControllerRow.d.ts +0 -9
- package/types/components/Nestable/Nestable.d.ts +0 -51
- package/types/components/Nestable/NestableItem.d.ts +0 -12
- package/types/components/Nestable/actions/events.d.ts +0 -6
- package/types/components/Nestable/actions/getItemOptions.d.ts +0 -11
- package/types/components/Nestable/actions/getPaths.d.ts +0 -5
- package/types/components/Nestable/actions/index.d.ts +0 -6
- package/types/components/Nestable/actions/moveItem.d.ts +0 -5
- package/types/components/Nestable/actions/paths.d.ts +0 -5
- package/types/components/Nestable/actions/tryDecreaseDepth.d.ts +0 -1
- package/types/components/Nestable/actions/tryIncreaseDepth.d.ts +0 -1
- package/types/components/Nestable/index.d.ts +0 -2
- package/types/components/QueryBuilderContext/QueryBuilderContext.d.ts +0 -2
- package/types/components/QueryBuilderImpl.d.ts +0 -49
- package/types/components/QueryBuilderItem/QueryBuilderItem.d.ts +0 -5
- package/types/components/QueryBuilderRow/QueryBuilderRow.d.ts +0 -12
- package/types/components/ToolBarAnimation/ToolBarAnimation.d.ts +0 -3
- package/types/components/format/format.d.ts +0 -26
- package/types/components/format/sqlFormat.d.ts +0 -5
- package/types/components/format/sqlSafeFormat.d.ts +0 -6
- package/types/components/format/xmlFormat.d.ts +0 -5
- package/types/components/helpers/actions.d.ts +0 -63
- package/types/components/helpers/constants.d.ts +0 -3
- package/types/components/helpers/dependencies.d.ts +0 -1
- package/types/components/helpers/selectors.d.ts +0 -20
- package/types/components/helpers/store.d.ts +0 -144
- package/types/components/helpers/types.d.ts +0 -50
- package/types/index.d.ts +0 -2
- package/types/propTypes.d.ts +0 -156
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import 'core-js/modules/esnext.async-iterator.find.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
4
|
-
import 'core-js/modules/esnext.iterator.find.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
7
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
10
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
11
|
-
import { QB_DRAG_TYPES, QB_GROUP_CONDITION_TYPES, QB_FIELD_SHARED_ACTIONS } from './types.js';
|
|
12
|
-
|
|
13
|
-
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; }
|
|
14
|
-
|
|
15
|
-
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; }
|
|
16
|
-
/**
|
|
17
|
-
* this is injected. instance of QBStore
|
|
18
|
-
*
|
|
19
|
-
* @param {*} idGroup: UUID
|
|
20
|
-
* @param idGroup
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const createNewFilter = function (idGroup) {
|
|
24
|
-
const idFilter = "filter_".concat(new Date().getTime(), "_").concat(Math.random().toString(36).substring(7));
|
|
25
|
-
return {
|
|
26
|
-
idGroup,
|
|
27
|
-
field: '',
|
|
28
|
-
condition: '',
|
|
29
|
-
value: '',
|
|
30
|
-
idFilter,
|
|
31
|
-
type: QB_DRAG_TYPES.FILTER
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* this is injected. instance of QBStore
|
|
36
|
-
*
|
|
37
|
-
* @param {*} parentIdGroup: UUID
|
|
38
|
-
* @param parentIdGroup
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
const createNewGroup = function (parentIdGroup) {
|
|
42
|
-
const idGroup = "group_".concat(new Date().getTime(), "_").concat(Math.random().toString(36).substring(7));
|
|
43
|
-
return {
|
|
44
|
-
parentIdGroup,
|
|
45
|
-
idGroup,
|
|
46
|
-
condition: QB_GROUP_CONDITION_TYPES.AND,
|
|
47
|
-
type: QB_DRAG_TYPES.GROUP
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* this is injected. instance of QBStore
|
|
52
|
-
*
|
|
53
|
-
* @param {*} newFilter
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
const addFilterToMap = function (newFilter) {
|
|
57
|
-
this.mapFilters = _objectSpread(_objectSpread({}, this.mapFilters), {}, {
|
|
58
|
-
[newFilter.idFilter]: newFilter
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* this is injected. instance of QBStore
|
|
63
|
-
*
|
|
64
|
-
* @param {*} newFilter
|
|
65
|
-
* @param newGroup
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
const addGroupToMap = function (newGroup) {
|
|
69
|
-
this.mapGroups = _objectSpread(_objectSpread({}, this.mapGroups), {}, {
|
|
70
|
-
[newGroup.idGroup]: _objectSpread({}, newGroup)
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
const addFilterToItem = function (item, newFilter) {
|
|
74
|
-
item.children.push({
|
|
75
|
-
id: newFilter.idFilter,
|
|
76
|
-
element: newFilter,
|
|
77
|
-
children: []
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
const addFilterToMainItem = function (items, newFilter) {
|
|
81
|
-
items.push({
|
|
82
|
-
id: newFilter.idFilter,
|
|
83
|
-
element: newFilter,
|
|
84
|
-
children: []
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
const findInChilds = function (childs, filterId) {
|
|
88
|
-
const found = childs.find(_ref => {
|
|
89
|
-
let {
|
|
90
|
-
id
|
|
91
|
-
} = _ref;
|
|
92
|
-
return id === filterId;
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
if (!found) {
|
|
96
|
-
let findInChild;
|
|
97
|
-
childs.forEach(item => {
|
|
98
|
-
if (!findInChild) findInChild = findInChilds(item.children, filterId);
|
|
99
|
-
});
|
|
100
|
-
if (findInChild) return findInChild;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return found;
|
|
104
|
-
};
|
|
105
|
-
const findItemFilterById = function (filterId) {
|
|
106
|
-
return findInChilds(this.items, filterId);
|
|
107
|
-
};
|
|
108
|
-
const findParentWithFilterId = function (childs, filterId) {
|
|
109
|
-
const found = childs.find(_ref2 => {
|
|
110
|
-
let {
|
|
111
|
-
id
|
|
112
|
-
} = _ref2;
|
|
113
|
-
return id === filterId;
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
if (!found) {
|
|
117
|
-
let findInChild;
|
|
118
|
-
childs.forEach(item => {
|
|
119
|
-
if (!findInChild) findInChild = findParentWithFilterId(item.children, filterId);
|
|
120
|
-
});
|
|
121
|
-
if (findInChild) return findInChild;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return childs;
|
|
125
|
-
};
|
|
126
|
-
const findParentFilterById = function (filterId) {
|
|
127
|
-
return findParentWithFilterId(this.items, filterId);
|
|
128
|
-
};
|
|
129
|
-
const filterInChildren = function (childs, filterId, mainId) {
|
|
130
|
-
if (childs.children) {
|
|
131
|
-
childs.children = childs.children.filter(_ref3 => {
|
|
132
|
-
let {
|
|
133
|
-
id
|
|
134
|
-
} = _ref3;
|
|
135
|
-
return id !== filterId;
|
|
136
|
-
});
|
|
137
|
-
childs.children = childs.children.forEach(item => filterInChildren(item.children, filterId));
|
|
138
|
-
return childs;
|
|
139
|
-
} // main
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (childs.length > 1) childs = childs.filter(_ref4 => {
|
|
143
|
-
let {
|
|
144
|
-
id
|
|
145
|
-
} = _ref4;
|
|
146
|
-
return id !== filterId;
|
|
147
|
-
}); // https://jira.elliemae.io/browse/PUI-1252
|
|
148
|
-
|
|
149
|
-
if (childs.length === 0 && mainId) {
|
|
150
|
-
const emptyFilter = createNewFilter.call(this, mainId);
|
|
151
|
-
addFilterToMainItem.call(this, childs, emptyFilter);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
childs.forEach(item => item.children = filterInChildren(item.children, filterId));
|
|
155
|
-
return childs;
|
|
156
|
-
};
|
|
157
|
-
const removeFilterItem = function (filterId) {
|
|
158
|
-
this.items = filterInChildren(this.items, filterId, this.main);
|
|
159
|
-
};
|
|
160
|
-
const addGroupFilterToItem = function (idGroup, idFilter, newGroup) {
|
|
161
|
-
const child = findItemFilterById.call(this, idFilter);
|
|
162
|
-
|
|
163
|
-
const copy = _objectSpread({}, child);
|
|
164
|
-
|
|
165
|
-
if (copy.element.type === 'group') {
|
|
166
|
-
copy.element.parentIdGroup = newGroup.idGroup;
|
|
167
|
-
} else {
|
|
168
|
-
copy.element.idGroup = newGroup.idGroup;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
child.id = newGroup.idGroup;
|
|
172
|
-
child.element = newGroup;
|
|
173
|
-
child.children = [copy];
|
|
174
|
-
};
|
|
175
|
-
const unGroupFilterToItem = function (idGroup) {
|
|
176
|
-
const group = findItemFilterById.call(this, idGroup);
|
|
177
|
-
|
|
178
|
-
if (group.element.parentIdGroup === this.main) {
|
|
179
|
-
const index = this.items.map(item => item.id).indexOf(idGroup);
|
|
180
|
-
const tmp = [];
|
|
181
|
-
tmp.splice.apply(this.items, [index, 1].concat(group.children));
|
|
182
|
-
this.items.forEach(item => {
|
|
183
|
-
if (item.element.type === 'group') {
|
|
184
|
-
item.element.parentIdGroup = this.main;
|
|
185
|
-
} else {
|
|
186
|
-
item.element.idGroup = this.main;
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
} else {
|
|
190
|
-
const parent = findItemFilterById.call(this, group.element.parentIdGroup);
|
|
191
|
-
const index = parent.children.map(item => item.id).indexOf(idGroup);
|
|
192
|
-
const tmp = [];
|
|
193
|
-
tmp.splice.apply(parent.children, [index, 1].concat(group.children));
|
|
194
|
-
parent.children.forEach(item => {
|
|
195
|
-
if (item.element.type === 'group') {
|
|
196
|
-
item.element.parentIdGroup = parent.id;
|
|
197
|
-
} else {
|
|
198
|
-
item.element.idGroup = parent.id;
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
const changeGroupOperator = function (idGroup, value) {
|
|
204
|
-
const group = findItemFilterById.call(this, idGroup);
|
|
205
|
-
|
|
206
|
-
if (idGroup !== this.main) {
|
|
207
|
-
group.element.condition = value;
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
const changeFilterItem = function (_ref5) {
|
|
211
|
-
let {
|
|
212
|
-
idFilter,
|
|
213
|
-
field,
|
|
214
|
-
value,
|
|
215
|
-
operator,
|
|
216
|
-
additionalInfo,
|
|
217
|
-
target,
|
|
218
|
-
fieldsSharedActions: {
|
|
219
|
-
onFieldChange,
|
|
220
|
-
onOperatorChange,
|
|
221
|
-
onValueChange
|
|
222
|
-
}
|
|
223
|
-
} = _ref5;
|
|
224
|
-
const child = findItemFilterById.call(this, idFilter);
|
|
225
|
-
if (field || field === '' || typeof field === 'boolean') child.element.field = field;
|
|
226
|
-
if (operator) child.element.operator = operator;
|
|
227
|
-
if (value || value === '' || typeof value === 'boolean') child.element.value = value;
|
|
228
|
-
if (additionalInfo) child.element.additionalInfo = additionalInfo; // shared fields actions
|
|
229
|
-
|
|
230
|
-
if (target === 'field') {
|
|
231
|
-
onFieldChange.forEach(_ref6 => {
|
|
232
|
-
let {
|
|
233
|
-
action
|
|
234
|
-
} = _ref6;
|
|
235
|
-
if (action === QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
|
|
236
|
-
});
|
|
237
|
-
} else if (target === 'operator') {
|
|
238
|
-
onOperatorChange.forEach(_ref7 => {
|
|
239
|
-
let {
|
|
240
|
-
action
|
|
241
|
-
} = _ref7;
|
|
242
|
-
if (action === QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
|
|
243
|
-
});
|
|
244
|
-
} else if (target === 'value') {
|
|
245
|
-
onValueChange.forEach(_ref8 => {
|
|
246
|
-
let {
|
|
247
|
-
action
|
|
248
|
-
} = _ref8;
|
|
249
|
-
if (action === QB_FIELD_SHARED_ACTIONS.RESET_FIELD) child.element.field = null;else if (action === QB_FIELD_SHARED_ACTIONS.RESET_OPERATOR) child.element.operator = null;else if (action === QB_FIELD_SHARED_ACTIONS.RESET_VALUE) child.element.value = null;
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
export { addFilterToItem, addFilterToMainItem, addFilterToMap, addGroupFilterToItem, addGroupToMap, changeFilterItem, changeGroupOperator, createNewFilter, createNewGroup, filterInChildren, findInChilds, findItemFilterById, findParentFilterById, findParentWithFilterId, removeFilterItem, unGroupFilterToItem };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.every.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.every.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.some.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.some.js';
|
|
6
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
8
|
-
import { get } from 'lodash';
|
|
9
|
-
import * as operators from '@elliemae/ds-utilities/operators';
|
|
10
|
-
import { QB_GROUP_CONDITION_TYPES } from './types.js';
|
|
11
|
-
|
|
12
|
-
const resolveCondition = function (condition, state) {
|
|
13
|
-
let resolveBy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QB_GROUP_CONDITION_TYPES.AND;
|
|
14
|
-
if (condition.length === 0 || !condition) return true; // resolve by AND: all the conditions must be true
|
|
15
|
-
|
|
16
|
-
if (resolveBy) {
|
|
17
|
-
return condition.every(rule => {
|
|
18
|
-
const {
|
|
19
|
-
source: sourceRule,
|
|
20
|
-
operator: operatorRule,
|
|
21
|
-
value: valueRule
|
|
22
|
-
} = rule;
|
|
23
|
-
if (typeof operatorRule === "function") return operatorRule(get(state, sourceRule), valueRule);
|
|
24
|
-
return operators[operatorRule](get(state, sourceRule), valueRule);
|
|
25
|
-
});
|
|
26
|
-
} // resolve by OR: at least one condition must be true
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return condition.some(rule => {
|
|
30
|
-
const {
|
|
31
|
-
source: sourceRule,
|
|
32
|
-
operator: operatorRule,
|
|
33
|
-
value: valueRule
|
|
34
|
-
} = rule;
|
|
35
|
-
return operators[operatorRule](state[sourceRule], valueRule);
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const resolveDependencies = (state, fields) => {
|
|
40
|
-
const fieldsToRender = fields.reduce((result, _ref) => {
|
|
41
|
-
let {
|
|
42
|
-
target,
|
|
43
|
-
component,
|
|
44
|
-
condition,
|
|
45
|
-
resolveBy,
|
|
46
|
-
validation,
|
|
47
|
-
handleWidth
|
|
48
|
-
} = _ref;
|
|
49
|
-
if (resolveCondition(condition, state, resolveBy)) result.push({
|
|
50
|
-
target,
|
|
51
|
-
component,
|
|
52
|
-
validation,
|
|
53
|
-
handleWidth
|
|
54
|
-
});
|
|
55
|
-
return result;
|
|
56
|
-
}, []);
|
|
57
|
-
return fieldsToRender;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export { resolveDependencies };
|
|
@@ -1,93 +0,0 @@
|
|
|
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,171 +0,0 @@
|
|
|
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
|
-
|
|
25
|
-
class QueryBuilderStore {
|
|
26
|
-
constructor(init, _format) {
|
|
27
|
-
this.items = [];
|
|
28
|
-
this.step = 0;
|
|
29
|
-
this.steps = {};
|
|
30
|
-
this.mapFilters = {};
|
|
31
|
-
this.mapGroups = {};
|
|
32
|
-
this.main = null;
|
|
33
|
-
this.format = null;
|
|
34
|
-
|
|
35
|
-
this.createNewFilter = idGroup => createNewFilter.call(this, idGroup);
|
|
36
|
-
|
|
37
|
-
this.createNewGroup = parentIdGroup => createNewGroup.call(this, parentIdGroup);
|
|
38
|
-
|
|
39
|
-
this.onOrderDragAndDrop = items => {
|
|
40
|
-
this.items = items;
|
|
41
|
-
return this.getState();
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
this.addFilterNextToFilterId = (idGroup, idFilter) => {
|
|
45
|
-
// eslint-disable-line
|
|
46
|
-
this.addFilter(idGroup);
|
|
47
|
-
return this.getState();
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
this.addFilter = idGroup => {
|
|
51
|
-
const newFilter = this.createNewFilter(idGroup);
|
|
52
|
-
addFilterToMap.call(this, newFilter); // new API
|
|
53
|
-
|
|
54
|
-
if (this.main === idGroup) {
|
|
55
|
-
addFilterToMainItem.call(this, this.items, newFilter);
|
|
56
|
-
} else {
|
|
57
|
-
const foundInItems = findItemFilterById.call(this, idGroup);
|
|
58
|
-
|
|
59
|
-
if (foundInItems) {
|
|
60
|
-
addFilterToItem.call(this, foundInItems, newFilter);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return this.getState();
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
this.onRemoveFilter = idFilter => {
|
|
68
|
-
// new API
|
|
69
|
-
removeFilterItem.call(this, idFilter);
|
|
70
|
-
return this.getState();
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
this.addRuleContainerInPlace = (idGroup, idFilter) => {
|
|
74
|
-
// Create a new group
|
|
75
|
-
const newGroup = this.createNewGroup(idGroup);
|
|
76
|
-
addGroupFilterToItem.call(this, idGroup, idFilter, newGroup);
|
|
77
|
-
return this.getState();
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
this.addRuleContainer = (idGroup, idFilter) => {
|
|
81
|
-
// eslint-disable-line
|
|
82
|
-
const newGroup = this.createNewGroup(idGroup);
|
|
83
|
-
addGroupToMap.call(this, newGroup);
|
|
84
|
-
|
|
85
|
-
if (this.main === idGroup) {
|
|
86
|
-
addFilterToMainItem.call(this, this.items, newGroup);
|
|
87
|
-
} else {
|
|
88
|
-
const foundInItems = findItemFilterById.call(this, idGroup);
|
|
89
|
-
|
|
90
|
-
if (foundInItems) {
|
|
91
|
-
addFilterToItem.call(this, foundInItems, newGroup);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return this.getState();
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
this.unGroup = idGroup => {
|
|
99
|
-
unGroupFilterToItem.call(this, idGroup);
|
|
100
|
-
return this.getState();
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
this.changeGroupOperator = (idGroup, value) => {
|
|
104
|
-
this.getGroupById(idGroup).condition = value;
|
|
105
|
-
changeGroupOperator.call(this, idGroup, value);
|
|
106
|
-
return this.getState();
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
this.changeFilter = data => {
|
|
110
|
-
const {
|
|
111
|
-
idFilter
|
|
112
|
-
} = data;
|
|
113
|
-
this.mapFilters[idFilter] = _objectSpread(_objectSpread({}, this.mapFilters[idFilter]), data);
|
|
114
|
-
changeFilterItem.call(this, data);
|
|
115
|
-
return this.getState();
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
this.getGroupById = idGroup => this.mapGroups[idGroup] || {};
|
|
119
|
-
|
|
120
|
-
this.getFilterById = idFilter => this.mapFilters[idFilter];
|
|
121
|
-
|
|
122
|
-
this.getInitialState = () => {
|
|
123
|
-
const newFilters = {
|
|
124
|
-
step: this.step,
|
|
125
|
-
mapFilters: _objectSpread({}, this.mapFilters),
|
|
126
|
-
mapGroups: _objectSpread({}, this.mapGroups),
|
|
127
|
-
main: this.main,
|
|
128
|
-
items: this.items
|
|
129
|
-
};
|
|
130
|
-
const format = QueryBuilderFormat.run(newFilters, this.format);
|
|
131
|
-
return _objectSpread(_objectSpread({}, newFilters), {}, {
|
|
132
|
-
format
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
this.getState = () => {
|
|
137
|
-
this.step += 1;
|
|
138
|
-
const newFilters = {
|
|
139
|
-
step: this.step,
|
|
140
|
-
mapFilters: _objectSpread({}, this.mapFilters),
|
|
141
|
-
mapGroups: _objectSpread({}, this.mapGroups),
|
|
142
|
-
main: this.main,
|
|
143
|
-
items: this.items
|
|
144
|
-
};
|
|
145
|
-
const format = QueryBuilderFormat.run(newFilters, this.format);
|
|
146
|
-
return _objectSpread(_objectSpread({}, newFilters), {}, {
|
|
147
|
-
format
|
|
148
|
-
});
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
this.firstLoad = true;
|
|
152
|
-
this.format = _format;
|
|
153
|
-
if (init) return this.initSetupUp(init);
|
|
154
|
-
const mainGroup = this.createNewGroup('main');
|
|
155
|
-
this.mapGroups = {
|
|
156
|
-
[mainGroup.idGroup]: mainGroup
|
|
157
|
-
};
|
|
158
|
-
this.main = mainGroup.idGroup;
|
|
159
|
-
this.addFilter(mainGroup.idGroup);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
initSetupUp(init) {
|
|
163
|
-
this.step = init.step || 1;
|
|
164
|
-
Object.keys(init).forEach(key => {
|
|
165
|
-
if (init[key] && this[key] !== undefined) this[key] = init[key];
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export { QueryBuilderStore as default };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const QB_FIELD_TYPES = {
|
|
2
|
-
LOAN_VALUES: 'loanValues',
|
|
3
|
-
LTV_VALUES: 'ltvValues',
|
|
4
|
-
SUBJECT_VALUES: 'subjectValues',
|
|
5
|
-
LAST_VALUES: 'lastValues',
|
|
6
|
-
CREDIT_VALUES: 'creditValues'
|
|
7
|
-
};
|
|
8
|
-
const QB_OPERATOR_TYPES = {
|
|
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'
|
|
19
|
-
};
|
|
20
|
-
const QB_GROUP_CONDITION_TYPES = {
|
|
21
|
-
AND: true,
|
|
22
|
-
OR: false
|
|
23
|
-
};
|
|
24
|
-
const QB_DRAG_TYPES = {
|
|
25
|
-
FILTER: 'filter',
|
|
26
|
-
GROUP: 'group'
|
|
27
|
-
};
|
|
28
|
-
const QB_DRAG_LOCATIONS = {
|
|
29
|
-
ABOVE: 'above',
|
|
30
|
-
BELOW: 'below'
|
|
31
|
-
};
|
|
32
|
-
const QB_EXPORT_FORMAT_TYPES = {
|
|
33
|
-
DEFAULT: 'defaultFormat',
|
|
34
|
-
XML: 'xmlFormat',
|
|
35
|
-
SQL: 'sqlFormat',
|
|
36
|
-
SAFESQL: 'sqlSafeFormat'
|
|
37
|
-
};
|
|
38
|
-
const QB_ADD_FILTER_METHOD_TYPES = {
|
|
39
|
-
IN_PLACE: 'inplace',
|
|
40
|
-
APPEND: 'append'
|
|
41
|
-
};
|
|
42
|
-
const QB_GROUP_FILTER_METHOD_TYPES = {
|
|
43
|
-
IN_PLACE: 'inplace',
|
|
44
|
-
APPEND: 'append'
|
|
45
|
-
};
|
|
46
|
-
const QB_FIELD_SHARED_ACTIONS = {
|
|
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
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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';
|