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