@elliemae/ds-query-builder 2.0.0-next.8 → 2.0.0-rc.11
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 +60 -56
- package/cjs/components/AndOrController/AndOrController.js +26 -34
- package/cjs/components/ConditionController/ConditionController.js +26 -32
- package/cjs/components/DisplayOutput/DisplayOutput.js +20 -21
- package/cjs/components/DragContainerController/DragContainerController.js +13 -15
- package/cjs/components/DragControllerRow/DragControllerRow.js +10 -6
- package/cjs/components/FieldControllerRow/FieldControllerRow.js +22 -22
- package/cjs/components/Nestable/Nestable.js +44 -30
- package/cjs/components/Nestable/NestableItem.js +18 -10
- package/cjs/components/Nestable/actions/events.js +5 -0
- package/cjs/components/Nestable/actions/getPaths.js +9 -1
- package/cjs/components/Nestable/actions/moveItem.js +12 -5
- package/cjs/components/Nestable/actions/paths.js +13 -3
- package/cjs/components/QueryBuilderImpl.js +34 -30
- package/cjs/components/QueryBuilderItem/QueryBuilderItem.js +28 -20
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +42 -33
- package/cjs/components/ToolBarAnimation/ToolBarAnimation.js +5 -0
- package/cjs/components/format/format.js +8 -14
- package/cjs/components/format/sqlFormat.js +9 -7
- package/cjs/components/format/sqlSafeFormat.js +9 -7
- package/cjs/components/format/xmlFormat.js +9 -7
- package/cjs/components/helpers/actions.js +59 -34
- package/cjs/components/helpers/dependencies.js +17 -8
- package/cjs/components/helpers/store.js +38 -39
- package/cjs/index.js +2 -1
- package/esm/DSQueryBuilder.js +60 -57
- package/esm/components/AndOrController/AndOrController.js +16 -19
- package/esm/components/ConditionController/ConditionController.js +20 -22
- package/esm/components/DisplayOutput/DisplayOutput.js +16 -14
- package/esm/components/DragContainerController/DragContainerController.js +10 -10
- package/esm/components/DragControllerRow/DragControllerRow.js +7 -2
- package/esm/components/FieldControllerRow/FieldControllerRow.js +22 -20
- package/esm/components/Nestable/Nestable.js +43 -29
- package/esm/components/Nestable/NestableItem.js +18 -10
- package/esm/components/Nestable/actions/events.js +5 -0
- package/esm/components/Nestable/actions/getPaths.js +9 -1
- package/esm/components/Nestable/actions/moveItem.js +12 -5
- package/esm/components/Nestable/actions/paths.js +13 -3
- package/esm/components/QueryBuilderImpl.js +34 -30
- package/esm/components/QueryBuilderItem/QueryBuilderItem.js +28 -20
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +42 -32
- package/esm/components/ToolBarAnimation/ToolBarAnimation.js +5 -0
- package/esm/components/format/format.js +8 -10
- package/esm/components/format/sqlFormat.js +9 -7
- package/esm/components/format/sqlSafeFormat.js +9 -7
- package/esm/components/format/xmlFormat.js +9 -7
- package/esm/components/helpers/actions.js +59 -34
- package/esm/components/helpers/dependencies.js +17 -8
- package/esm/components/helpers/store.js +38 -39
- package/esm/index.js +1 -1
- package/package.json +14 -7
- package/types/DSQueryBuilder.d.ts +170 -25
- package/types/components/AndOrController/AndOrController.d.ts +4 -4
- package/types/components/ConditionController/ConditionController.d.ts +2 -2
- package/types/components/DragContainerController/DragContainerController.d.ts +3 -3
- package/types/components/DragControllerRow/DragControllerRow.d.ts +2 -2
- package/types/propTypes.d.ts +133 -23
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import update from 'react-addons-update';
|
|
3
8
|
|
|
4
9
|
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; }
|
|
5
10
|
|
|
6
11
|
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(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; }
|
|
7
|
-
function moveItem({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
function moveItem(_ref) {
|
|
13
|
+
let {
|
|
14
|
+
dragItem,
|
|
15
|
+
pathFrom,
|
|
16
|
+
pathTo
|
|
17
|
+
} = _ref;
|
|
18
|
+
let extraProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12
19
|
const {
|
|
13
20
|
childrenProp
|
|
14
21
|
} = this.props;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.every.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.every.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
8
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
9
|
|
|
3
10
|
function getRealNextPath(prevPath, nextPath) {
|
|
@@ -41,7 +48,8 @@ function getRealNextPath(prevPath, nextPath) {
|
|
|
41
48
|
|
|
42
49
|
return nextPath;
|
|
43
50
|
}
|
|
44
|
-
function getPathById(id
|
|
51
|
+
function getPathById(id) {
|
|
52
|
+
let items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getDefaultItems();
|
|
45
53
|
const {
|
|
46
54
|
childrenProp
|
|
47
55
|
} = this.props;
|
|
@@ -61,7 +69,8 @@ function getPathById(id, items = this.getDefaultItems()) {
|
|
|
61
69
|
});
|
|
62
70
|
return path;
|
|
63
71
|
}
|
|
64
|
-
function getItemByPath(path
|
|
72
|
+
function getItemByPath(path) {
|
|
73
|
+
let items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getDefaultItems();
|
|
65
74
|
const {
|
|
66
75
|
childrenProp
|
|
67
76
|
} = this.props;
|
|
@@ -85,7 +94,8 @@ function getItemDepth(item) {
|
|
|
85
94
|
|
|
86
95
|
return level;
|
|
87
96
|
}
|
|
88
|
-
function getSplicePath(path
|
|
97
|
+
function getSplicePath(path) {
|
|
98
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
89
99
|
const splicePath = {};
|
|
90
100
|
const numToRemove = options.numToRemove || 0;
|
|
91
101
|
const itemsToInsert = options.itemsToInsert || [];
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
8
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
@@ -20,26 +25,25 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
20
25
|
class QueryBuilderImpl extends Component {
|
|
21
26
|
constructor(props) {
|
|
22
27
|
super(props);
|
|
28
|
+
this.isDraggableItem = true;
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_defineProperty(this, "onOrderDragAndDrop", (items, item) => {
|
|
30
|
+
this.onOrderDragAndDrop = (items, item) => {
|
|
27
31
|
const newFilters = this.store.onOrderDragAndDrop(items, item);
|
|
28
32
|
this.sendCall('reOrderOnDragAndDrop', {
|
|
29
33
|
items
|
|
30
34
|
});
|
|
31
35
|
this.sendChange(newFilters);
|
|
32
|
-
}
|
|
36
|
+
};
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
this.onAddFilterToGroup = idGroup => {
|
|
35
39
|
const newFilters = this.store.addFilter(idGroup);
|
|
36
40
|
this.sendCall('onAddFilterToGroup', {
|
|
37
41
|
idGroup
|
|
38
42
|
});
|
|
39
43
|
this.sendChange(newFilters);
|
|
40
|
-
}
|
|
44
|
+
};
|
|
41
45
|
|
|
42
|
-
|
|
46
|
+
this.onAddFilter = (idGroup, idFilter) => {
|
|
43
47
|
const {
|
|
44
48
|
addFilterMethod
|
|
45
49
|
} = this.props;
|
|
@@ -49,9 +53,9 @@ class QueryBuilderImpl extends Component {
|
|
|
49
53
|
idFilter
|
|
50
54
|
});
|
|
51
55
|
this.sendChange(newFilters);
|
|
52
|
-
}
|
|
56
|
+
};
|
|
53
57
|
|
|
54
|
-
|
|
58
|
+
this.onAddRuleContainer = (idGroup, idFilter) => {
|
|
55
59
|
const {
|
|
56
60
|
groupFilterMethod
|
|
57
61
|
} = this.props;
|
|
@@ -61,17 +65,17 @@ class QueryBuilderImpl extends Component {
|
|
|
61
65
|
idFilter
|
|
62
66
|
});
|
|
63
67
|
this.sendChange(newFilters);
|
|
64
|
-
}
|
|
68
|
+
};
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
this.onRemoveFilter = idFilter => {
|
|
67
71
|
const newFilters = this.store.onRemoveFilter(idFilter);
|
|
68
72
|
this.sendCall('onRemoveFilter', {
|
|
69
73
|
idFilter
|
|
70
74
|
});
|
|
71
75
|
this.sendChange(newFilters);
|
|
72
|
-
}
|
|
76
|
+
};
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
this.handleFieldChange = data => {
|
|
75
79
|
const {
|
|
76
80
|
fieldsSharedActions
|
|
77
81
|
} = this.props;
|
|
@@ -82,26 +86,26 @@ class QueryBuilderImpl extends Component {
|
|
|
82
86
|
data
|
|
83
87
|
});
|
|
84
88
|
this.sendChange(newFilters);
|
|
85
|
-
}
|
|
89
|
+
};
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
this.handleRuleContainerOperator = (idGroup, value) => {
|
|
88
92
|
const newFilters = this.store.changeGroupOperator(idGroup, value);
|
|
89
93
|
this.sendCall('handleRuleContainerOperator', {
|
|
90
94
|
idGroup,
|
|
91
95
|
value
|
|
92
96
|
});
|
|
93
97
|
this.sendChange(newFilters);
|
|
94
|
-
}
|
|
98
|
+
};
|
|
95
99
|
|
|
96
|
-
|
|
100
|
+
this.handleRuleContainerUnGroup = idGroup => {
|
|
97
101
|
const newFilters = this.store.unGroup(idGroup);
|
|
98
102
|
this.sendCall('handleRuleContainerUnGroup', {
|
|
99
103
|
idGroup
|
|
100
104
|
});
|
|
101
105
|
this.sendChange(newFilters);
|
|
102
|
-
}
|
|
106
|
+
};
|
|
103
107
|
|
|
104
|
-
|
|
108
|
+
this.handleDropFilter = (filter, dragTo) => {
|
|
105
109
|
const {
|
|
106
110
|
position: oldPosition,
|
|
107
111
|
idGroup,
|
|
@@ -117,9 +121,9 @@ class QueryBuilderImpl extends Component {
|
|
|
117
121
|
dragTo
|
|
118
122
|
});
|
|
119
123
|
this.sendChange(newFilters);
|
|
120
|
-
}
|
|
124
|
+
};
|
|
121
125
|
|
|
122
|
-
|
|
126
|
+
this.handleDropGroup = (group, dragTo) => {
|
|
123
127
|
const {
|
|
124
128
|
position: oldPosition,
|
|
125
129
|
idFilter,
|
|
@@ -135,17 +139,17 @@ class QueryBuilderImpl extends Component {
|
|
|
135
139
|
dragTo
|
|
136
140
|
});
|
|
137
141
|
this.sendChange(newFilters);
|
|
138
|
-
}
|
|
142
|
+
};
|
|
139
143
|
|
|
140
|
-
|
|
144
|
+
this.handleDrop = (dragElement, dragTo) => {
|
|
141
145
|
const {
|
|
142
146
|
type
|
|
143
147
|
} = dragElement;
|
|
144
148
|
if (type === QB_DRAG_TYPES.FILTER) return this.handleDropFilter(dragElement, dragTo);
|
|
145
149
|
return this.handleDropGroup(dragElement, dragTo);
|
|
146
|
-
}
|
|
150
|
+
};
|
|
147
151
|
|
|
148
|
-
|
|
152
|
+
this.sendChange = _ref => {
|
|
149
153
|
let {
|
|
150
154
|
format
|
|
151
155
|
} = _ref,
|
|
@@ -158,16 +162,16 @@ class QueryBuilderImpl extends Component {
|
|
|
158
162
|
onChange
|
|
159
163
|
} = this.props;
|
|
160
164
|
onChange(format, newFilters);
|
|
161
|
-
}
|
|
165
|
+
};
|
|
162
166
|
|
|
163
|
-
|
|
167
|
+
this.sendCall = (action, data) => {
|
|
164
168
|
const {
|
|
165
169
|
[action]: callback
|
|
166
170
|
} = this.props;
|
|
167
171
|
if (callback) callback(data);
|
|
168
|
-
}
|
|
172
|
+
};
|
|
169
173
|
|
|
170
|
-
|
|
174
|
+
this.setDraggableItems = drag => {
|
|
171
175
|
this.isDraggableItem = true;
|
|
172
176
|
|
|
173
177
|
try {
|
|
@@ -190,7 +194,7 @@ class QueryBuilderImpl extends Component {
|
|
|
190
194
|
} catch (error) {
|
|
191
195
|
this.isDraggableItem = true;
|
|
192
196
|
}
|
|
193
|
-
}
|
|
197
|
+
};
|
|
194
198
|
|
|
195
199
|
this.store = new QueryBuilderStore(props.init, props.format);
|
|
196
200
|
this.state = this.store.getInitialState();
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import 'react';
|
|
@@ -11,9 +16,10 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
11
16
|
|
|
12
17
|
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(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; }
|
|
13
18
|
|
|
14
|
-
const QueryBuilderItem =
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
const QueryBuilderItem = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
item
|
|
22
|
+
} = _ref;
|
|
17
23
|
const {
|
|
18
24
|
element
|
|
19
25
|
} = item;
|
|
@@ -23,23 +29,25 @@ const QueryBuilderItem = ({
|
|
|
23
29
|
idGroup,
|
|
24
30
|
condition
|
|
25
31
|
} = element;
|
|
26
|
-
return /*#__PURE__*/_jsx(QueryBuilderContext.Consumer, {}, void 0,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
return /*#__PURE__*/_jsx(QueryBuilderContext.Consumer, {}, void 0, _ref2 => {
|
|
33
|
+
let {
|
|
34
|
+
fields,
|
|
35
|
+
handleFieldChange,
|
|
36
|
+
onAddFilter,
|
|
37
|
+
onAddFilterToGroup,
|
|
38
|
+
onAddRuleContainer,
|
|
39
|
+
onRemoveFilter,
|
|
40
|
+
showDragController,
|
|
41
|
+
handleRuleContainerOperator,
|
|
42
|
+
handleRuleContainerUnGroup,
|
|
43
|
+
step,
|
|
44
|
+
items,
|
|
45
|
+
isDraggableItem,
|
|
46
|
+
setDraggableItems,
|
|
47
|
+
singleRow,
|
|
48
|
+
toolTipZIndex
|
|
49
|
+
} = _ref2;
|
|
50
|
+
|
|
43
51
|
if (type === QB_DRAG_TYPES.FILTER) {
|
|
44
52
|
return /*#__PURE__*/jsx(QueryBuilderRow, _objectSpread(_objectSpread({}, element), {}, {
|
|
45
53
|
fields: fields,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
8
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
4
11
|
import React, { Component } from 'react';
|
|
5
|
-
import AlertsDetail from '@elliemae/ds-icons
|
|
6
|
-
import {
|
|
12
|
+
import { AlertsDetail } from '@elliemae/ds-icons';
|
|
13
|
+
import { DSTooltipV3 } from '@elliemae/ds-tooltip';
|
|
7
14
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
8
15
|
import { resolveDependencies } from '../helpers/dependencies.js';
|
|
9
16
|
import ConditionController from '../ConditionController/ConditionController.js';
|
|
@@ -14,16 +21,17 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
14
21
|
|
|
15
22
|
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(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; }
|
|
16
23
|
|
|
17
|
-
const RenderField =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const RenderField = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
target,
|
|
27
|
+
component,
|
|
28
|
+
valueProp,
|
|
29
|
+
additionalInfo,
|
|
30
|
+
handleMouseEnterInput,
|
|
31
|
+
handleMouseLeaveInput,
|
|
32
|
+
onChangeHandler,
|
|
33
|
+
hasError
|
|
34
|
+
} = _ref;
|
|
27
35
|
const ref = React.useRef();
|
|
28
36
|
const id = React.useMemo(() => "el_".concat(String.fromCharCode(65 + Math.floor(Math.random() * 26))), []);
|
|
29
37
|
return /*#__PURE__*/_jsx("div", {
|
|
@@ -51,20 +59,22 @@ const RenderField = ({
|
|
|
51
59
|
'aria-invalid': Boolean(hasError)
|
|
52
60
|
})
|
|
53
61
|
}), hasError && hasError.errorMessage ? /*#__PURE__*/_jsx("div", {
|
|
62
|
+
style: {
|
|
63
|
+
width: '40px'
|
|
64
|
+
}
|
|
65
|
+
}, void 0, /*#__PURE__*/_jsx(DSTooltipV3, {
|
|
66
|
+
text: hasError.errorMessage
|
|
67
|
+
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
54
68
|
tabIndex: 0,
|
|
55
69
|
className: "row-icon-alert",
|
|
56
70
|
"data-testid": "qb-error-state-icon",
|
|
57
|
-
role: "alert"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
color: ['danger', 900],
|
|
65
|
-
title: hasError.message
|
|
66
|
-
})
|
|
67
|
-
})) : null); // return React.useMemo(
|
|
71
|
+
role: "alert"
|
|
72
|
+
}, void 0, /*#__PURE__*/_jsx(AlertsDetail, {
|
|
73
|
+
width: 20,
|
|
74
|
+
height: 20,
|
|
75
|
+
color: ['danger', 900],
|
|
76
|
+
title: hasError.errorMessage
|
|
77
|
+
})))) : null); // return React.useMemo(
|
|
68
78
|
// () => (
|
|
69
79
|
// <div
|
|
70
80
|
// className={`em-ds-query-builder-row-input child-type-${target}`}
|
|
@@ -96,31 +106,31 @@ class QueryBuilderRow extends Component {
|
|
|
96
106
|
constructor(props) {
|
|
97
107
|
super(props);
|
|
98
108
|
|
|
99
|
-
|
|
109
|
+
this.handleMouseEnterRow = () => {};
|
|
100
110
|
|
|
101
|
-
|
|
111
|
+
this.handleMouseLeaveRow = () => {
|
|
102
112
|
this.handleTooltipRow(false);
|
|
103
|
-
}
|
|
113
|
+
};
|
|
104
114
|
|
|
105
|
-
|
|
115
|
+
this.handleMouseEnterInput = () => {
|
|
106
116
|
const {
|
|
107
117
|
setDraggableItems
|
|
108
118
|
} = this.props;
|
|
109
119
|
setDraggableItems(false);
|
|
110
|
-
}
|
|
120
|
+
};
|
|
111
121
|
|
|
112
|
-
|
|
122
|
+
this.handleMouseLeaveInput = () => {
|
|
113
123
|
const {
|
|
114
124
|
setDraggableItems
|
|
115
125
|
} = this.props;
|
|
116
126
|
setDraggableItems(true);
|
|
117
|
-
}
|
|
127
|
+
};
|
|
118
128
|
|
|
119
|
-
|
|
129
|
+
this.handleTooltipRow = isOpen => {
|
|
120
130
|
this.setState({
|
|
121
131
|
isOpen
|
|
122
132
|
});
|
|
123
|
-
}
|
|
133
|
+
};
|
|
124
134
|
|
|
125
135
|
this.state = {
|
|
126
136
|
isOpen: false
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import { createElement } from 'react';
|
|
3
8
|
import GrowRight from '@elliemae/ds-shared/Animations/GrowRight';
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
1
|
import { sqlFormat } from './sqlFormat.js';
|
|
3
2
|
import { xmlFormat } from './xmlFormat.js';
|
|
4
3
|
import { sqlSafeFormat } from './sqlSafeFormat.js';
|
|
5
4
|
|
|
6
5
|
class QueryBuilderFormat {
|
|
7
6
|
constructor() {
|
|
8
|
-
|
|
7
|
+
this.format = {
|
|
9
8
|
defaultFormat: query => query,
|
|
10
9
|
sqlFormat,
|
|
11
10
|
xmlFormat,
|
|
12
11
|
sqlSafeFormat
|
|
13
|
-
}
|
|
12
|
+
};
|
|
13
|
+
this.currentFormat = 'sqlFormat';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_defineProperty(this, "setDefaultFormat", formatName => {
|
|
15
|
+
this.setDefaultFormat = formatName => {
|
|
18
16
|
if (this.format[formatName]) this.currentFormat = formatName;
|
|
19
|
-
}
|
|
17
|
+
};
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
this.addFormat = (formatName, format) => this.format[formatName] = format;
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
this.run = (query, formatName) => {
|
|
24
22
|
if (this.format[formatName]) return this.format[formatName](query);
|
|
25
23
|
return this.format[this.currentFormat](query);
|
|
26
|
-
}
|
|
24
|
+
};
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
1
3
|
import { QB_OPERATOR_TYPES } from '../helpers/types.js';
|
|
2
4
|
|
|
3
|
-
/* eslint-disable complexity */
|
|
4
|
-
|
|
5
5
|
const conditionSql = (condition, value) => {
|
|
6
6
|
const {
|
|
7
7
|
EQUAL,
|
|
@@ -37,11 +37,13 @@ const renderFilterSQl = filter => {
|
|
|
37
37
|
return "".concat(field, " ").concat(conditionSql(operator, value) || '');
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
const sqlFormat =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const sqlFormat = _ref => {
|
|
41
|
+
let {
|
|
42
|
+
main,
|
|
43
|
+
mapGroups,
|
|
44
|
+
items
|
|
45
|
+
} = _ref;
|
|
46
|
+
|
|
45
47
|
const groupSql = (item, idGroup) => {
|
|
46
48
|
if (idGroup === main) {
|
|
47
49
|
const groupCondition = mapGroups[idGroup].condition === true ? 'AND' : 'OR';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
1
3
|
import { QB_OPERATOR_TYPES } from '../helpers/types.js';
|
|
2
4
|
|
|
3
|
-
/* eslint-disable complexity */
|
|
4
|
-
|
|
5
5
|
const specialChar = /[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/;
|
|
6
6
|
|
|
7
7
|
const conditionSql = (condition, value) => {
|
|
@@ -44,11 +44,13 @@ const renderFilterSQl = filter => {
|
|
|
44
44
|
return "".concat(fieldDisplay, " ").concat(conditionSql(operator, value) || '');
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
const sqlSafeFormat =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
const sqlSafeFormat = _ref => {
|
|
48
|
+
let {
|
|
49
|
+
main,
|
|
50
|
+
mapGroups,
|
|
51
|
+
items
|
|
52
|
+
} = _ref;
|
|
53
|
+
|
|
52
54
|
const groupSql = (item, idGroup) => {
|
|
53
55
|
if (idGroup === main) {
|
|
54
56
|
const groupCondition = mapGroups[idGroup].condition === true ? 'AND' : 'OR';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
1
3
|
import { QB_OPERATOR_TYPES } from '../helpers/types.js';
|
|
2
4
|
|
|
3
|
-
/* eslint-disable complexity */
|
|
4
|
-
|
|
5
5
|
const conditionSql = (condition, value) => {
|
|
6
6
|
const {
|
|
7
7
|
EQUAL,
|
|
@@ -37,11 +37,13 @@ const renderFilterSQl = filter => {
|
|
|
37
37
|
return "<filter><field>".concat(field, "</field>").concat(conditionSql(operator, value) || '', "</filter>");
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
const xmlFormat =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const xmlFormat = _ref => {
|
|
41
|
+
let {
|
|
42
|
+
main,
|
|
43
|
+
mapGroups,
|
|
44
|
+
items
|
|
45
|
+
} = _ref;
|
|
46
|
+
|
|
45
47
|
const groupXML = (item, idGroup) => {
|
|
46
48
|
if (idGroup === main) {
|
|
47
49
|
const groupCondition = mapGroups[idGroup].condition === true ? 'AND' : 'OR';
|