@elliemae/ds-query-builder 2.0.0-rc.9 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/AndOrController/AndOrController.js +10 -12
- package/cjs/components/DisplayOutput/DisplayOutput.js +2 -4
- package/cjs/components/DragControllerRow/DragControllerRow.js +2 -2
- package/cjs/components/Nestable/Nestable.js +22 -22
- package/cjs/components/Nestable/NestableItem.js +2 -2
- package/cjs/components/Nestable/actions/events.js +2 -2
- package/cjs/components/Nestable/actions/moveItem.js +2 -2
- package/cjs/components/QueryBuilderImpl.js +31 -32
- package/cjs/components/QueryBuilderItem/QueryBuilderItem.js +2 -2
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +11 -11
- package/cjs/components/ToolBarAnimation/ToolBarAnimation.js +2 -2
- package/cjs/components/format/format.js +8 -14
- package/cjs/components/helpers/actions.js +2 -2
- package/cjs/components/helpers/store.js +35 -41
- package/esm/components/AndOrController/AndOrController.js +10 -11
- package/esm/components/DisplayOutput/DisplayOutput.js +2 -3
- package/esm/components/DragControllerRow/DragControllerRow.js +2 -2
- package/esm/components/Nestable/Nestable.js +22 -22
- package/esm/components/Nestable/NestableItem.js +2 -2
- package/esm/components/Nestable/actions/events.js +2 -2
- package/esm/components/Nestable/actions/moveItem.js +2 -2
- package/esm/components/QueryBuilderImpl.js +31 -32
- package/esm/components/QueryBuilderItem/QueryBuilderItem.js +2 -2
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +11 -11
- package/esm/components/ToolBarAnimation/ToolBarAnimation.js +2 -2
- package/esm/components/format/format.js +8 -10
- package/esm/components/helpers/actions.js +2 -2
- package/esm/components/helpers/store.js +35 -41
- package/package.json +12 -12
|
@@ -13,9 +13,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
|
|
14
14
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
15
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
17
|
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
19
|
/**
|
|
20
20
|
* Fluent interface: https://en.wikipedia.org/wiki/Fluent_interface
|
|
21
21
|
*
|
|
@@ -30,36 +30,30 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
30
30
|
|
|
31
31
|
class QueryBuilderStore {
|
|
32
32
|
constructor(init, _format) {
|
|
33
|
-
|
|
33
|
+
this.items = [];
|
|
34
|
+
this.step = 0;
|
|
35
|
+
this.steps = {};
|
|
36
|
+
this.mapFilters = {};
|
|
37
|
+
this.mapGroups = {};
|
|
38
|
+
this.main = null;
|
|
39
|
+
this.format = null;
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
this.createNewFilter = idGroup => actions.createNewFilter.call(this, idGroup);
|
|
36
42
|
|
|
37
|
-
|
|
43
|
+
this.createNewGroup = parentIdGroup => actions.createNewGroup.call(this, parentIdGroup);
|
|
38
44
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_defineProperty__default["default"](this, "mapGroups", {});
|
|
42
|
-
|
|
43
|
-
_defineProperty__default["default"](this, "main", null);
|
|
44
|
-
|
|
45
|
-
_defineProperty__default["default"](this, "format", null);
|
|
46
|
-
|
|
47
|
-
_defineProperty__default["default"](this, "createNewFilter", idGroup => actions.createNewFilter.call(this, idGroup));
|
|
48
|
-
|
|
49
|
-
_defineProperty__default["default"](this, "createNewGroup", parentIdGroup => actions.createNewGroup.call(this, parentIdGroup));
|
|
50
|
-
|
|
51
|
-
_defineProperty__default["default"](this, "onOrderDragAndDrop", items => {
|
|
45
|
+
this.onOrderDragAndDrop = items => {
|
|
52
46
|
this.items = items;
|
|
53
47
|
return this.getState();
|
|
54
|
-
}
|
|
48
|
+
};
|
|
55
49
|
|
|
56
|
-
|
|
50
|
+
this.addFilterNextToFilterId = (idGroup, idFilter) => {
|
|
57
51
|
// eslint-disable-line
|
|
58
52
|
this.addFilter(idGroup);
|
|
59
53
|
return this.getState();
|
|
60
|
-
}
|
|
54
|
+
};
|
|
61
55
|
|
|
62
|
-
|
|
56
|
+
this.addFilter = idGroup => {
|
|
63
57
|
const newFilter = this.createNewFilter(idGroup);
|
|
64
58
|
actions.addFilterToMap.call(this, newFilter); // new API
|
|
65
59
|
|
|
@@ -74,22 +68,22 @@ class QueryBuilderStore {
|
|
|
74
68
|
}
|
|
75
69
|
|
|
76
70
|
return this.getState();
|
|
77
|
-
}
|
|
71
|
+
};
|
|
78
72
|
|
|
79
|
-
|
|
73
|
+
this.onRemoveFilter = idFilter => {
|
|
80
74
|
// new API
|
|
81
75
|
actions.removeFilterItem.call(this, idFilter);
|
|
82
76
|
return this.getState();
|
|
83
|
-
}
|
|
77
|
+
};
|
|
84
78
|
|
|
85
|
-
|
|
79
|
+
this.addRuleContainerInPlace = (idGroup, idFilter) => {
|
|
86
80
|
// Create a new group
|
|
87
81
|
const newGroup = this.createNewGroup(idGroup);
|
|
88
82
|
actions.addGroupFilterToItem.call(this, idGroup, idFilter, newGroup);
|
|
89
83
|
return this.getState();
|
|
90
|
-
}
|
|
84
|
+
};
|
|
91
85
|
|
|
92
|
-
|
|
86
|
+
this.addRuleContainer = (idGroup, idFilter) => {
|
|
93
87
|
// eslint-disable-line
|
|
94
88
|
const newGroup = this.createNewGroup(idGroup);
|
|
95
89
|
actions.addGroupToMap.call(this, newGroup);
|
|
@@ -105,33 +99,33 @@ class QueryBuilderStore {
|
|
|
105
99
|
}
|
|
106
100
|
|
|
107
101
|
return this.getState();
|
|
108
|
-
}
|
|
102
|
+
};
|
|
109
103
|
|
|
110
|
-
|
|
104
|
+
this.unGroup = idGroup => {
|
|
111
105
|
actions.unGroupFilterToItem.call(this, idGroup);
|
|
112
106
|
return this.getState();
|
|
113
|
-
}
|
|
107
|
+
};
|
|
114
108
|
|
|
115
|
-
|
|
109
|
+
this.changeGroupOperator = (idGroup, value) => {
|
|
116
110
|
this.getGroupById(idGroup).condition = value;
|
|
117
111
|
actions.changeGroupOperator.call(this, idGroup, value);
|
|
118
112
|
return this.getState();
|
|
119
|
-
}
|
|
113
|
+
};
|
|
120
114
|
|
|
121
|
-
|
|
115
|
+
this.changeFilter = data => {
|
|
122
116
|
const {
|
|
123
117
|
idFilter
|
|
124
118
|
} = data;
|
|
125
119
|
this.mapFilters[idFilter] = _objectSpread(_objectSpread({}, this.mapFilters[idFilter]), data);
|
|
126
120
|
actions.changeFilterItem.call(this, data);
|
|
127
121
|
return this.getState();
|
|
128
|
-
}
|
|
122
|
+
};
|
|
129
123
|
|
|
130
|
-
|
|
124
|
+
this.getGroupById = idGroup => this.mapGroups[idGroup] || {};
|
|
131
125
|
|
|
132
|
-
|
|
126
|
+
this.getFilterById = idFilter => this.mapFilters[idFilter];
|
|
133
127
|
|
|
134
|
-
|
|
128
|
+
this.getInitialState = () => {
|
|
135
129
|
const newFilters = {
|
|
136
130
|
step: this.step,
|
|
137
131
|
mapFilters: _objectSpread({}, this.mapFilters),
|
|
@@ -143,9 +137,9 @@ class QueryBuilderStore {
|
|
|
143
137
|
return _objectSpread(_objectSpread({}, newFilters), {}, {
|
|
144
138
|
format: format$1
|
|
145
139
|
});
|
|
146
|
-
}
|
|
140
|
+
};
|
|
147
141
|
|
|
148
|
-
|
|
142
|
+
this.getState = () => {
|
|
149
143
|
this.step += 1;
|
|
150
144
|
const newFilters = {
|
|
151
145
|
step: this.step,
|
|
@@ -158,7 +152,7 @@ class QueryBuilderStore {
|
|
|
158
152
|
return _objectSpread(_objectSpread({}, newFilters), {}, {
|
|
159
153
|
format: format$1
|
|
160
154
|
});
|
|
161
|
-
}
|
|
155
|
+
};
|
|
162
156
|
|
|
163
157
|
this.firstLoad = true;
|
|
164
158
|
this.format = _format;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
2
|
import React, { Component } from 'react';
|
|
4
3
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
5
4
|
import DSTooltip, { TooltipType } from '@elliemae/ds-tooltip';
|
|
@@ -32,11 +31,11 @@ class AndOrController extends Component {
|
|
|
32
31
|
constructor(props) {
|
|
33
32
|
super(props);
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
this.handleMouseEnterRow = e => {
|
|
36
35
|
this.handleTooltipRow(true); // this.handleMouseMove(e)
|
|
37
|
-
}
|
|
36
|
+
};
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
this.handleMouseMove = e => {
|
|
40
39
|
if (!this.contenerRef.current) return;
|
|
41
40
|
const mouse = e.clientY;
|
|
42
41
|
const {
|
|
@@ -48,13 +47,13 @@ class AndOrController extends Component {
|
|
|
48
47
|
this.setState({
|
|
49
48
|
top: mouse - topDiff - refHeight / 2 - delta
|
|
50
49
|
});
|
|
51
|
-
}
|
|
50
|
+
};
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
this.handleMouseLeaveRow = () => {
|
|
54
53
|
this.handleTooltipRow(false);
|
|
55
|
-
}
|
|
54
|
+
};
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
this.handleTooltipRow = isOpen => {
|
|
58
57
|
this.setState({
|
|
59
58
|
isOpen
|
|
60
59
|
});
|
|
@@ -62,7 +61,7 @@ class AndOrController extends Component {
|
|
|
62
61
|
handleTooltipGroup
|
|
63
62
|
} = this.props;
|
|
64
63
|
handleTooltipGroup(isOpen);
|
|
65
|
-
}
|
|
64
|
+
};
|
|
66
65
|
|
|
67
66
|
this.contenerRef = /*#__PURE__*/React.createRef();
|
|
68
67
|
this.myRef = /*#__PURE__*/React.createRef();
|
|
@@ -188,7 +187,7 @@ class AndOrController extends Component {
|
|
|
188
187
|
|
|
189
188
|
}
|
|
190
189
|
|
|
191
|
-
|
|
190
|
+
AndOrController.defaultProps = {
|
|
192
191
|
isMain: false,
|
|
193
192
|
handleRuleContainerOperator: () => null,
|
|
194
193
|
handleRuleContainerUnGroup: () => null,
|
|
@@ -209,6 +208,6 @@ _defineProperty(AndOrController, "defaultProps", {
|
|
|
209
208
|
toolBarAnimationDuration: TOOLBAR_ANIMATION_DURATION,
|
|
210
209
|
toolBarInteractionType: PopperInteractions.CLICK,
|
|
211
210
|
toolBarPosition: PopperPositions.LEFT
|
|
212
|
-
}
|
|
211
|
+
};
|
|
213
212
|
|
|
214
213
|
export { AndOrController as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
2
|
import { Component } from 'react';
|
|
4
3
|
import { Grid } from '@elliemae/ds-grid';
|
|
5
4
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
@@ -15,7 +14,7 @@ class DisplayOutput extends Component {
|
|
|
15
14
|
constructor(props) {
|
|
16
15
|
super(props);
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
this.handleChange = () => {
|
|
19
18
|
this.setState(_ref => {
|
|
20
19
|
let {
|
|
21
20
|
show
|
|
@@ -24,7 +23,7 @@ class DisplayOutput extends Component {
|
|
|
24
23
|
show: !show
|
|
25
24
|
};
|
|
26
25
|
});
|
|
27
|
-
}
|
|
26
|
+
};
|
|
28
27
|
|
|
29
28
|
this.state = {
|
|
30
29
|
show: props.show
|
|
@@ -13,9 +13,9 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
13
13
|
|
|
14
14
|
const _excluded = ["className", "color", "icon", "size"];
|
|
15
15
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
17
|
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
19
|
|
|
20
20
|
const DragControllerRow = _ref => {
|
|
21
21
|
let {
|
|
@@ -21,9 +21,9 @@ import { onDragStart, onDragEnd, onMouseMove, onMouseEnter, onToggleCollapse, on
|
|
|
21
21
|
import { getItemOptions } from './actions/getItemOptions.js';
|
|
22
22
|
import NestableItem from './NestableItem.js';
|
|
23
23
|
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
24
|
+
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; }
|
|
25
25
|
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
26
|
+
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; }
|
|
27
27
|
|
|
28
28
|
const shallowCompare = (instance, nextProps, nextState) => !isEqualWith(instance.props, nextProps) || !isEqualWith(instance.state, nextState);
|
|
29
29
|
|
|
@@ -31,43 +31,43 @@ class Nestable extends Component {
|
|
|
31
31
|
constructor(props) {
|
|
32
32
|
super(props);
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
this.onDragStart = (e, item) => {
|
|
35
35
|
onDragStart.call(this, e, item);
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
this.onDragEnd = (e, isCancel) => onDragEnd.call(this, e, isCancel);
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
this.onMouseMove = e => onMouseMove.call(this, e);
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
this.onMouseEnter = (e, item) => onMouseEnter.call(this, e, item);
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
this.onToggleCollapse = (item, isGetter) => onToggleCollapse.call(this, item, isGetter);
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
this.onKeyDown = e => onKeyDown.call(this, e);
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
this.getDefaultItems = () => {
|
|
49
49
|
const {
|
|
50
50
|
items
|
|
51
51
|
} = this.state;
|
|
52
52
|
return items;
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
this.getItemDepth = item => getItemDepth.call(this, item);
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
this.startTrackMouse = () => {
|
|
58
58
|
document.addEventListener('mousemove', this.onMouseMove);
|
|
59
59
|
document.addEventListener('mouseup', this.onDragEnd);
|
|
60
60
|
document.addEventListener('keydown', this.onKeyDown);
|
|
61
|
-
}
|
|
61
|
+
};
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
this.stopTrackMouse = () => {
|
|
64
64
|
document.removeEventListener('mousemove', this.onMouseMove);
|
|
65
65
|
document.removeEventListener('mouseup', this.onDragEnd);
|
|
66
66
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
67
67
|
this.elCopyStyles = null;
|
|
68
|
-
}
|
|
68
|
+
};
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
this.isCollapsed = item => {
|
|
71
71
|
const {
|
|
72
72
|
collapsed
|
|
73
73
|
} = this.props;
|
|
@@ -75,9 +75,9 @@ class Nestable extends Component {
|
|
|
75
75
|
collapsedGroups
|
|
76
76
|
} = this.state;
|
|
77
77
|
return !!(collapsedGroups.indexOf(item.id) > -1 ^ collapsed);
|
|
78
|
-
}
|
|
78
|
+
};
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
this.checkFilterChildren = items => items.find(current => {
|
|
81
81
|
const {
|
|
82
82
|
element: {
|
|
83
83
|
type
|
|
@@ -86,9 +86,9 @@ class Nestable extends Component {
|
|
|
86
86
|
} = current;
|
|
87
87
|
if (type === 'filter' && children.length > 0) return true;
|
|
88
88
|
return this.checkFilterChildren(children);
|
|
89
|
-
})
|
|
89
|
+
});
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
this.dragRevert = () => {
|
|
92
92
|
const {
|
|
93
93
|
itemsOld
|
|
94
94
|
} = this.state;
|
|
@@ -98,7 +98,7 @@ class Nestable extends Component {
|
|
|
98
98
|
dragItem: null,
|
|
99
99
|
isDirty: false
|
|
100
100
|
});
|
|
101
|
-
}
|
|
101
|
+
};
|
|
102
102
|
|
|
103
103
|
this.state = {
|
|
104
104
|
items: [],
|
|
@@ -11,9 +11,9 @@ import 'react';
|
|
|
11
11
|
import cn from 'classnames';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
14
|
+
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; }
|
|
15
15
|
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
16
|
+
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; }
|
|
17
17
|
|
|
18
18
|
const NestableItem = _ref => {
|
|
19
19
|
let {
|
|
@@ -6,9 +6,9 @@ import 'core-js/modules/esnext.iterator.constructor.js';
|
|
|
6
6
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
7
7
|
import { closest, getTransformProps, getOffsetRect, getTotalScroll } from '@elliemae/ds-shared/utils';
|
|
8
8
|
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
9
|
+
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; }
|
|
10
10
|
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
11
|
+
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; }
|
|
12
12
|
function onDragStart(e, item) {
|
|
13
13
|
if (e) {
|
|
14
14
|
e.preventDefault();
|
|
@@ -6,9 +6,9 @@ import 'core-js/modules/esnext.iterator.for-each.js';
|
|
|
6
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
7
|
import update from 'react-addons-update';
|
|
8
8
|
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
9
|
+
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; }
|
|
10
10
|
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
11
|
+
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; }
|
|
12
12
|
function moveItem(_ref) {
|
|
13
13
|
let {
|
|
14
14
|
dragItem,
|
|
@@ -18,33 +18,32 @@ import { jsxs } from 'react/jsx-runtime';
|
|
|
18
18
|
|
|
19
19
|
const _excluded = ["format"];
|
|
20
20
|
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
21
|
+
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; }
|
|
22
22
|
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
23
|
+
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; }
|
|
24
24
|
|
|
25
25
|
class QueryBuilderImpl extends Component {
|
|
26
26
|
constructor(props) {
|
|
27
27
|
super(props);
|
|
28
|
+
this.isDraggableItem = true;
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_defineProperty(this, "onOrderDragAndDrop", (items, item) => {
|
|
30
|
+
this.onOrderDragAndDrop = (items, item) => {
|
|
32
31
|
const newFilters = this.store.onOrderDragAndDrop(items, item);
|
|
33
32
|
this.sendCall('reOrderOnDragAndDrop', {
|
|
34
33
|
items
|
|
35
34
|
});
|
|
36
35
|
this.sendChange(newFilters);
|
|
37
|
-
}
|
|
36
|
+
};
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
this.onAddFilterToGroup = idGroup => {
|
|
40
39
|
const newFilters = this.store.addFilter(idGroup);
|
|
41
40
|
this.sendCall('onAddFilterToGroup', {
|
|
42
41
|
idGroup
|
|
43
42
|
});
|
|
44
43
|
this.sendChange(newFilters);
|
|
45
|
-
}
|
|
44
|
+
};
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
this.onAddFilter = (idGroup, idFilter) => {
|
|
48
47
|
const {
|
|
49
48
|
addFilterMethod
|
|
50
49
|
} = this.props;
|
|
@@ -54,9 +53,9 @@ class QueryBuilderImpl extends Component {
|
|
|
54
53
|
idFilter
|
|
55
54
|
});
|
|
56
55
|
this.sendChange(newFilters);
|
|
57
|
-
}
|
|
56
|
+
};
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
this.onAddRuleContainer = (idGroup, idFilter) => {
|
|
60
59
|
const {
|
|
61
60
|
groupFilterMethod
|
|
62
61
|
} = this.props;
|
|
@@ -66,17 +65,17 @@ class QueryBuilderImpl extends Component {
|
|
|
66
65
|
idFilter
|
|
67
66
|
});
|
|
68
67
|
this.sendChange(newFilters);
|
|
69
|
-
}
|
|
68
|
+
};
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
this.onRemoveFilter = idFilter => {
|
|
72
71
|
const newFilters = this.store.onRemoveFilter(idFilter);
|
|
73
72
|
this.sendCall('onRemoveFilter', {
|
|
74
73
|
idFilter
|
|
75
74
|
});
|
|
76
75
|
this.sendChange(newFilters);
|
|
77
|
-
}
|
|
76
|
+
};
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
this.handleFieldChange = data => {
|
|
80
79
|
const {
|
|
81
80
|
fieldsSharedActions
|
|
82
81
|
} = this.props;
|
|
@@ -87,26 +86,26 @@ class QueryBuilderImpl extends Component {
|
|
|
87
86
|
data
|
|
88
87
|
});
|
|
89
88
|
this.sendChange(newFilters);
|
|
90
|
-
}
|
|
89
|
+
};
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
this.handleRuleContainerOperator = (idGroup, value) => {
|
|
93
92
|
const newFilters = this.store.changeGroupOperator(idGroup, value);
|
|
94
93
|
this.sendCall('handleRuleContainerOperator', {
|
|
95
94
|
idGroup,
|
|
96
95
|
value
|
|
97
96
|
});
|
|
98
97
|
this.sendChange(newFilters);
|
|
99
|
-
}
|
|
98
|
+
};
|
|
100
99
|
|
|
101
|
-
|
|
100
|
+
this.handleRuleContainerUnGroup = idGroup => {
|
|
102
101
|
const newFilters = this.store.unGroup(idGroup);
|
|
103
102
|
this.sendCall('handleRuleContainerUnGroup', {
|
|
104
103
|
idGroup
|
|
105
104
|
});
|
|
106
105
|
this.sendChange(newFilters);
|
|
107
|
-
}
|
|
106
|
+
};
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
this.handleDropFilter = (filter, dragTo) => {
|
|
110
109
|
const {
|
|
111
110
|
position: oldPosition,
|
|
112
111
|
idGroup,
|
|
@@ -122,9 +121,9 @@ class QueryBuilderImpl extends Component {
|
|
|
122
121
|
dragTo
|
|
123
122
|
});
|
|
124
123
|
this.sendChange(newFilters);
|
|
125
|
-
}
|
|
124
|
+
};
|
|
126
125
|
|
|
127
|
-
|
|
126
|
+
this.handleDropGroup = (group, dragTo) => {
|
|
128
127
|
const {
|
|
129
128
|
position: oldPosition,
|
|
130
129
|
idFilter,
|
|
@@ -140,17 +139,17 @@ class QueryBuilderImpl extends Component {
|
|
|
140
139
|
dragTo
|
|
141
140
|
});
|
|
142
141
|
this.sendChange(newFilters);
|
|
143
|
-
}
|
|
142
|
+
};
|
|
144
143
|
|
|
145
|
-
|
|
144
|
+
this.handleDrop = (dragElement, dragTo) => {
|
|
146
145
|
const {
|
|
147
146
|
type
|
|
148
147
|
} = dragElement;
|
|
149
148
|
if (type === QB_DRAG_TYPES.FILTER) return this.handleDropFilter(dragElement, dragTo);
|
|
150
149
|
return this.handleDropGroup(dragElement, dragTo);
|
|
151
|
-
}
|
|
150
|
+
};
|
|
152
151
|
|
|
153
|
-
|
|
152
|
+
this.sendChange = _ref => {
|
|
154
153
|
let {
|
|
155
154
|
format
|
|
156
155
|
} = _ref,
|
|
@@ -163,16 +162,16 @@ class QueryBuilderImpl extends Component {
|
|
|
163
162
|
onChange
|
|
164
163
|
} = this.props;
|
|
165
164
|
onChange(format, newFilters);
|
|
166
|
-
}
|
|
165
|
+
};
|
|
167
166
|
|
|
168
|
-
|
|
167
|
+
this.sendCall = (action, data) => {
|
|
169
168
|
const {
|
|
170
169
|
[action]: callback
|
|
171
170
|
} = this.props;
|
|
172
171
|
if (callback) callback(data);
|
|
173
|
-
}
|
|
172
|
+
};
|
|
174
173
|
|
|
175
|
-
|
|
174
|
+
this.setDraggableItems = drag => {
|
|
176
175
|
this.isDraggableItem = true;
|
|
177
176
|
|
|
178
177
|
try {
|
|
@@ -195,7 +194,7 @@ class QueryBuilderImpl extends Component {
|
|
|
195
194
|
} catch (error) {
|
|
196
195
|
this.isDraggableItem = true;
|
|
197
196
|
}
|
|
198
|
-
}
|
|
197
|
+
};
|
|
199
198
|
|
|
200
199
|
this.store = new QueryBuilderStore(props.init, props.format);
|
|
201
200
|
this.state = this.store.getInitialState();
|
|
@@ -12,9 +12,9 @@ import AndOrController from '../AndOrController/AndOrController.js';
|
|
|
12
12
|
import QueryBuilderRow from '../QueryBuilderRow/QueryBuilderRow.js';
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
15
|
+
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; }
|
|
16
16
|
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
17
|
+
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; }
|
|
18
18
|
|
|
19
19
|
const QueryBuilderItem = _ref => {
|
|
20
20
|
let {
|