@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
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
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';
|
|
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';
|
|
4
|
-
import
|
|
5
|
-
import _createClass from '@babel/runtime/helpers/esm/createClass';
|
|
6
|
-
import _inherits from '@babel/runtime/helpers/esm/inherits';
|
|
7
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
8
|
-
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
9
|
-
import React, { Component } from 'react';
|
|
9
|
+
import { Component } from 'react';
|
|
10
10
|
import Nestable from './Nestable/Nestable.js';
|
|
11
11
|
import { QueryBuilderContext } from './QueryBuilderContext/QueryBuilderContext.js';
|
|
12
12
|
import { QB_ADD_FILTER_METHOD_TYPES, QB_GROUP_FILTER_METHOD_TYPES, QB_DRAG_TYPES } from './helpers/types.js';
|
|
@@ -14,300 +14,258 @@ import QueryBuilderStore from './helpers/store.js';
|
|
|
14
14
|
import AndOrController from './AndOrController/AndOrController.js';
|
|
15
15
|
import QueryBuilderItem from './QueryBuilderItem/QueryBuilderItem.js';
|
|
16
16
|
import DisplayOutput from './DisplayOutput/DisplayOutput.js';
|
|
17
|
-
import '
|
|
18
|
-
import 'prop-types';
|
|
19
|
-
import 'classnames';
|
|
20
|
-
import '@elliemae/ds-shared/utils';
|
|
21
|
-
import '@elliemae/ds-utilities';
|
|
22
|
-
import './Nestable/actions/tryIncreaseDepth.js';
|
|
23
|
-
import './Nestable/actions/tryDecreaseDepth.js';
|
|
24
|
-
import './Nestable/actions/moveItem.js';
|
|
25
|
-
import 'react-addons-update';
|
|
26
|
-
import './Nestable/actions/paths.js';
|
|
27
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
28
|
-
import './Nestable/actions/events.js';
|
|
29
|
-
import './Nestable/actions/getItemOptions.js';
|
|
30
|
-
import './Nestable/NestableItem.js';
|
|
31
|
-
import './helpers/actions.js';
|
|
32
|
-
import './format/format.js';
|
|
33
|
-
import './format/sqlFormat.js';
|
|
34
|
-
import './format/xmlFormat.js';
|
|
35
|
-
import './format/sqlSafeFormat.js';
|
|
36
|
-
import '@elliemae/ds-classnames';
|
|
37
|
-
import '@elliemae/ds-tooltip';
|
|
38
|
-
import '@elliemae/ds-popper';
|
|
39
|
-
import '@elliemae/ds-form';
|
|
40
|
-
import '@elliemae/ds-button';
|
|
41
|
-
import '@elliemae/ds-icons';
|
|
42
|
-
import '@elliemae/ds-icon';
|
|
43
|
-
import './helpers/constants.js';
|
|
44
|
-
import './ToolBarAnimation/ToolBarAnimation.js';
|
|
45
|
-
import '@elliemae/ds-shared/Animations/GrowRight';
|
|
46
|
-
import './DragContainerController/DragContainerController.js';
|
|
47
|
-
import './QueryBuilderRow/QueryBuilderRow.js';
|
|
48
|
-
import './helpers/dependencies.js';
|
|
49
|
-
import 'lodash';
|
|
50
|
-
import '@elliemae/ds-utilities/operators';
|
|
51
|
-
import './ConditionController/ConditionController.js';
|
|
52
|
-
import './DragControllerRow/DragControllerRow.js';
|
|
53
|
-
import '@babel/runtime/helpers/esm/typeof';
|
|
54
|
-
import '@elliemae/ds-grid';
|
|
55
|
-
import '@elliemae/ds-accordion';
|
|
17
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
56
18
|
|
|
57
|
-
|
|
19
|
+
const _excluded = ["format"];
|
|
58
20
|
|
|
59
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; }
|
|
60
22
|
|
|
61
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(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; }
|
|
62
24
|
|
|
63
|
-
|
|
25
|
+
class QueryBuilderImpl extends Component {
|
|
26
|
+
constructor(props) {
|
|
27
|
+
super(props);
|
|
28
|
+
this.isDraggableItem = true;
|
|
64
29
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var _super = _createSuper(QueryBuilderImpl);
|
|
71
|
-
|
|
72
|
-
function QueryBuilderImpl(props) {
|
|
73
|
-
var _this;
|
|
74
|
-
|
|
75
|
-
_classCallCheck(this, QueryBuilderImpl);
|
|
76
|
-
|
|
77
|
-
_this = _super.call(this, props);
|
|
78
|
-
_this.isDraggableItem = true;
|
|
79
|
-
|
|
80
|
-
_this.onOrderDragAndDrop = function (items, item) {
|
|
81
|
-
var newFilters = _this.store.onOrderDragAndDrop(items, item);
|
|
82
|
-
|
|
83
|
-
_this.sendCall('reOrderOnDragAndDrop', {
|
|
84
|
-
items: items
|
|
30
|
+
this.onOrderDragAndDrop = (items, item) => {
|
|
31
|
+
const newFilters = this.store.onOrderDragAndDrop(items, item);
|
|
32
|
+
this.sendCall('reOrderOnDragAndDrop', {
|
|
33
|
+
items
|
|
85
34
|
});
|
|
86
|
-
|
|
87
|
-
_this.sendChange(newFilters);
|
|
35
|
+
this.sendChange(newFilters);
|
|
88
36
|
};
|
|
89
37
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
idGroup: idGroup
|
|
38
|
+
this.onAddFilterToGroup = idGroup => {
|
|
39
|
+
const newFilters = this.store.addFilter(idGroup);
|
|
40
|
+
this.sendCall('onAddFilterToGroup', {
|
|
41
|
+
idGroup
|
|
95
42
|
});
|
|
96
|
-
|
|
97
|
-
_this.sendChange(newFilters);
|
|
43
|
+
this.sendChange(newFilters);
|
|
98
44
|
};
|
|
99
45
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
46
|
+
this.onAddFilter = (idGroup, idFilter) => {
|
|
47
|
+
const {
|
|
48
|
+
addFilterMethod
|
|
49
|
+
} = this.props;
|
|
50
|
+
const newFilters = addFilterMethod === QB_ADD_FILTER_METHOD_TYPES.IN_PLACE ? this.store.addFilterNextToFilterId(idGroup, idFilter) : this.onAddFilterToGroup(idGroup);
|
|
51
|
+
this.sendCall('onAddFilter', {
|
|
52
|
+
idGroup,
|
|
53
|
+
idFilter
|
|
107
54
|
});
|
|
108
|
-
|
|
109
|
-
_this.sendChange(newFilters);
|
|
55
|
+
this.sendChange(newFilters);
|
|
110
56
|
};
|
|
111
57
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
58
|
+
this.onAddRuleContainer = (idGroup, idFilter) => {
|
|
59
|
+
const {
|
|
60
|
+
groupFilterMethod
|
|
61
|
+
} = this.props;
|
|
62
|
+
const newFilters = groupFilterMethod === QB_GROUP_FILTER_METHOD_TYPES.IN_PLACE ? this.store.addRuleContainerInPlace(idGroup, idFilter) : this.store.addRuleContainer(idGroup, idFilter);
|
|
63
|
+
this.sendCall('onAddRuleContainer', {
|
|
64
|
+
idGroup,
|
|
65
|
+
idFilter
|
|
119
66
|
});
|
|
120
|
-
|
|
121
|
-
_this.sendChange(newFilters);
|
|
67
|
+
this.sendChange(newFilters);
|
|
122
68
|
};
|
|
123
69
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
idFilter: idFilter
|
|
70
|
+
this.onRemoveFilter = idFilter => {
|
|
71
|
+
const newFilters = this.store.onRemoveFilter(idFilter);
|
|
72
|
+
this.sendCall('onRemoveFilter', {
|
|
73
|
+
idFilter
|
|
129
74
|
});
|
|
130
|
-
|
|
131
|
-
_this.sendChange(newFilters);
|
|
75
|
+
this.sendChange(newFilters);
|
|
132
76
|
};
|
|
133
77
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
78
|
+
this.handleFieldChange = data => {
|
|
79
|
+
const {
|
|
80
|
+
fieldsSharedActions
|
|
81
|
+
} = this.props;
|
|
82
|
+
const newFilters = this.store.changeFilter(_objectSpread(_objectSpread({}, data), {}, {
|
|
83
|
+
fieldsSharedActions
|
|
139
84
|
}));
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
data: data
|
|
85
|
+
this.sendCall('handleFieldChange', {
|
|
86
|
+
data
|
|
143
87
|
});
|
|
144
|
-
|
|
145
|
-
_this.sendChange(newFilters);
|
|
88
|
+
this.sendChange(newFilters);
|
|
146
89
|
};
|
|
147
90
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
value: value
|
|
91
|
+
this.handleRuleContainerOperator = (idGroup, value) => {
|
|
92
|
+
const newFilters = this.store.changeGroupOperator(idGroup, value);
|
|
93
|
+
this.sendCall('handleRuleContainerOperator', {
|
|
94
|
+
idGroup,
|
|
95
|
+
value
|
|
154
96
|
});
|
|
155
|
-
|
|
156
|
-
_this.sendChange(newFilters);
|
|
97
|
+
this.sendChange(newFilters);
|
|
157
98
|
};
|
|
158
99
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
idGroup: idGroup
|
|
100
|
+
this.handleRuleContainerUnGroup = idGroup => {
|
|
101
|
+
const newFilters = this.store.unGroup(idGroup);
|
|
102
|
+
this.sendCall('handleRuleContainerUnGroup', {
|
|
103
|
+
idGroup
|
|
164
104
|
});
|
|
165
|
-
|
|
166
|
-
_this.sendChange(newFilters);
|
|
105
|
+
this.sendChange(newFilters);
|
|
167
106
|
};
|
|
168
107
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
108
|
+
this.handleDropFilter = (filter, dragTo) => {
|
|
109
|
+
const {
|
|
110
|
+
position: oldPosition,
|
|
111
|
+
idGroup,
|
|
112
|
+
idFilter
|
|
113
|
+
} = filter;
|
|
114
|
+
const {
|
|
115
|
+
position: newPosition,
|
|
116
|
+
targetIdGroup
|
|
117
|
+
} = dragTo;
|
|
118
|
+
const newFilters = this.store.reOrderFilter(idFilter, idGroup, oldPosition, newPosition, targetIdGroup);
|
|
119
|
+
this.sendCall('handleDropFilter', {
|
|
120
|
+
filter,
|
|
121
|
+
dragTo
|
|
181
122
|
});
|
|
182
|
-
|
|
183
|
-
_this.sendChange(newFilters);
|
|
123
|
+
this.sendChange(newFilters);
|
|
184
124
|
};
|
|
185
125
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
126
|
+
this.handleDropGroup = (group, dragTo) => {
|
|
127
|
+
const {
|
|
128
|
+
position: oldPosition,
|
|
129
|
+
idFilter,
|
|
130
|
+
idGroup
|
|
131
|
+
} = group;
|
|
132
|
+
const {
|
|
133
|
+
position: newPosition,
|
|
134
|
+
targetIdGroup
|
|
135
|
+
} = dragTo;
|
|
136
|
+
const newFilters = this.store.reOrderFilter(idFilter, idGroup, oldPosition, newPosition, targetIdGroup);
|
|
137
|
+
this.sendCall('handleDropGroup', {
|
|
138
|
+
group,
|
|
139
|
+
dragTo
|
|
198
140
|
});
|
|
199
|
-
|
|
200
|
-
_this.sendChange(newFilters);
|
|
141
|
+
this.sendChange(newFilters);
|
|
201
142
|
};
|
|
202
143
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
144
|
+
this.handleDrop = (dragElement, dragTo) => {
|
|
145
|
+
const {
|
|
146
|
+
type
|
|
147
|
+
} = dragElement;
|
|
148
|
+
if (type === QB_DRAG_TYPES.FILTER) return this.handleDropFilter(dragElement, dragTo);
|
|
149
|
+
return this.handleDropGroup(dragElement, dragTo);
|
|
207
150
|
};
|
|
208
151
|
|
|
209
|
-
|
|
210
|
-
|
|
152
|
+
this.sendChange = _ref => {
|
|
153
|
+
let {
|
|
154
|
+
format
|
|
155
|
+
} = _ref,
|
|
211
156
|
newFilters = _objectWithoutProperties(_ref, _excluded);
|
|
212
157
|
|
|
213
|
-
|
|
214
|
-
format
|
|
158
|
+
this.setState(_objectSpread({
|
|
159
|
+
format
|
|
215
160
|
}, newFilters));
|
|
216
|
-
|
|
217
|
-
|
|
161
|
+
const {
|
|
162
|
+
onChange
|
|
163
|
+
} = this.props;
|
|
218
164
|
onChange(format, newFilters);
|
|
219
165
|
};
|
|
220
166
|
|
|
221
|
-
|
|
222
|
-
|
|
167
|
+
this.sendCall = (action, data) => {
|
|
168
|
+
const {
|
|
169
|
+
[action]: callback
|
|
170
|
+
} = this.props;
|
|
223
171
|
if (callback) callback(data);
|
|
224
172
|
};
|
|
225
173
|
|
|
226
|
-
|
|
227
|
-
|
|
174
|
+
this.setDraggableItems = drag => {
|
|
175
|
+
this.isDraggableItem = true;
|
|
228
176
|
|
|
229
177
|
try {
|
|
230
|
-
|
|
231
|
-
|
|
178
|
+
const ua = window.navigator.userAgent;
|
|
179
|
+
const msie = ua.indexOf('MSIE '); // eslint-disable-next-line no-useless-escape
|
|
232
180
|
|
|
233
181
|
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
|
|
234
|
-
|
|
182
|
+
const {
|
|
183
|
+
isDraggableItem
|
|
184
|
+
} = this.state;
|
|
235
185
|
|
|
236
186
|
if (drag !== isDraggableItem) {
|
|
237
|
-
|
|
187
|
+
this.setState({
|
|
238
188
|
isDraggableItem: drag
|
|
239
189
|
});
|
|
240
190
|
}
|
|
241
191
|
|
|
242
|
-
|
|
192
|
+
this.isDraggableItem = drag;
|
|
243
193
|
}
|
|
244
194
|
} catch (error) {
|
|
245
|
-
|
|
195
|
+
this.isDraggableItem = true;
|
|
246
196
|
}
|
|
247
197
|
};
|
|
248
198
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return _this;
|
|
199
|
+
this.store = new QueryBuilderStore(props.init, props.format);
|
|
200
|
+
this.state = this.store.getInitialState();
|
|
252
201
|
}
|
|
253
202
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
QueryBuilderImpl.recalculateStore = null;
|
|
260
|
-
}
|
|
203
|
+
static getDerivedStateFromProps(props, state) {
|
|
204
|
+
if (props.init && props.init.step !== undefined && Number.isInteger(props.init.step) && props.init.step !== state.step) {
|
|
205
|
+
const store = new QueryBuilderStore(props.init, props.format);
|
|
206
|
+
QueryBuilderImpl.recalculateStore = store;
|
|
207
|
+
return store.getInitialState();
|
|
261
208
|
}
|
|
262
|
-
}, {
|
|
263
|
-
key: "render",
|
|
264
|
-
value: function render() {
|
|
265
|
-
var _this2 = this;
|
|
266
209
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
main = _this$state.main,
|
|
270
|
-
mapFilters = _this$state.mapFilters,
|
|
271
|
-
step = _this$state.step,
|
|
272
|
-
items = _this$state.items,
|
|
273
|
-
format = _this$state.format;
|
|
274
|
-
var _this$props = this.props,
|
|
275
|
-
containerProps = _this$props.containerProps,
|
|
276
|
-
ruleContainerClassName = _this$props.ruleContainerClassName,
|
|
277
|
-
fields = _this$props.fields,
|
|
278
|
-
displayFixedOutput = _this$props.displayFixedOutput,
|
|
279
|
-
displayOutput = _this$props.displayOutput,
|
|
280
|
-
displayOutputLabel = _this$props.displayOutputLabel,
|
|
281
|
-
singleRow = _this$props.singleRow,
|
|
282
|
-
toolTipZIndex = _this$props.toolTipZIndex; // const { children } = items[0]
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
283
212
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
213
|
+
componentDidUpdate() {
|
|
214
|
+
if (QueryBuilderImpl.recalculateStore) {
|
|
215
|
+
this.store = QueryBuilderImpl.recalculateStore;
|
|
216
|
+
QueryBuilderImpl.recalculateStore = null;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
render() {
|
|
221
|
+
const {
|
|
222
|
+
mapGroups,
|
|
223
|
+
main,
|
|
224
|
+
mapFilters,
|
|
225
|
+
step,
|
|
226
|
+
items,
|
|
227
|
+
format
|
|
228
|
+
} = this.state;
|
|
229
|
+
const {
|
|
230
|
+
containerProps,
|
|
231
|
+
ruleContainerClassName,
|
|
232
|
+
fields,
|
|
233
|
+
displayFixedOutput,
|
|
234
|
+
displayOutput,
|
|
235
|
+
displayOutputLabel,
|
|
236
|
+
singleRow,
|
|
237
|
+
toolTipZIndex
|
|
238
|
+
} = this.props; // const { children } = items[0]
|
|
239
|
+
|
|
240
|
+
const {
|
|
241
|
+
condition
|
|
242
|
+
} = mapGroups[main];
|
|
243
|
+
return /*#__PURE__*/_jsx(QueryBuilderContext.Provider, {
|
|
244
|
+
value: {
|
|
245
|
+
toolTipZIndex,
|
|
246
|
+
fields,
|
|
247
|
+
handleDrop: this.handleDrop,
|
|
248
|
+
handleFieldChange: this.handleFieldChange,
|
|
249
|
+
handleRuleContainerOperator: this.handleRuleContainerOperator,
|
|
250
|
+
handleRuleContainerUnGroup: this.handleRuleContainerUnGroup,
|
|
251
|
+
mapFilters,
|
|
252
|
+
mapGroups,
|
|
253
|
+
onAddFilter: this.onAddFilter,
|
|
254
|
+
onAddFilterToGroup: this.onAddFilterToGroup,
|
|
255
|
+
onAddRuleContainer: this.onAddRuleContainer,
|
|
256
|
+
onRemoveFilter: this.onRemoveFilter,
|
|
257
|
+
ruleContainerClassName,
|
|
258
|
+
showDragController: false,
|
|
259
|
+
format,
|
|
260
|
+
step,
|
|
261
|
+
items,
|
|
262
|
+
isDraggableItem: this.isDraggableItem,
|
|
263
|
+
setDraggableItems: this.setDraggableItems,
|
|
264
|
+
singleRow
|
|
265
|
+
}
|
|
266
|
+
}, void 0, /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
267
|
+
className: "nested-main-group ".concat(condition !== true ? 'is-or-group' : 'is-and-groupL', " ").concat(singleRow ? 'query-main-single-row' : 'query-main-multiple-row'),
|
|
268
|
+
children: [/*#__PURE__*/_jsx(Nestable, {
|
|
311
269
|
isAndItem: condition === true,
|
|
312
270
|
isDraggableItem: this.isDraggableItem,
|
|
313
271
|
isOrItem: condition !== true,
|
|
@@ -317,46 +275,27 @@ var QueryBuilderImpl = /*#__PURE__*/function (_Component) {
|
|
|
317
275
|
setDraggableItems: this.setDraggableItems,
|
|
318
276
|
step: step,
|
|
319
277
|
singleRow: singleRow
|
|
320
|
-
}), !singleRow && /*#__PURE__*/
|
|
278
|
+
}), !singleRow && /*#__PURE__*/_jsx("div", {
|
|
321
279
|
className: "rule-container-options"
|
|
322
|
-
}, /*#__PURE__*/
|
|
280
|
+
}, void 0, /*#__PURE__*/_jsx(AndOrController, {
|
|
323
281
|
allowUnGroup: false,
|
|
324
282
|
condition: condition,
|
|
325
|
-
handleRuleContainerOperator:
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
handleRuleContainerUnGroup: function handleRuleContainerUnGroup() {
|
|
329
|
-
return _this2.handleRuleContainerUnGroup(main);
|
|
330
|
-
},
|
|
283
|
+
handleRuleContainerOperator: value => this.handleRuleContainerOperator(main, value),
|
|
284
|
+
handleRuleContainerUnGroup: () => this.handleRuleContainerUnGroup(main),
|
|
331
285
|
isMain: true,
|
|
332
|
-
onAddFilter:
|
|
333
|
-
return _this2.onAddFilterToGroup(main);
|
|
334
|
-
},
|
|
286
|
+
onAddFilter: () => this.onAddFilterToGroup(main),
|
|
335
287
|
showDragController: false,
|
|
336
288
|
step: step,
|
|
337
289
|
toolTipZIndex: toolTipZIndex
|
|
338
|
-
}))
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
key: "getDerivedStateFromProps",
|
|
347
|
-
value: function getDerivedStateFromProps(props, state) {
|
|
348
|
-
if (props.init && props.init.step !== undefined && Number.isInteger(props.init.step) && props.init.step !== state.step) {
|
|
349
|
-
var store = new QueryBuilderStore(props.init, props.format);
|
|
350
|
-
QueryBuilderImpl.recalculateStore = store;
|
|
351
|
-
return store.getInitialState();
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return null;
|
|
355
|
-
}
|
|
356
|
-
}]);
|
|
290
|
+
}))]
|
|
291
|
+
})), (displayOutput || displayFixedOutput) && /*#__PURE__*/_jsx(DisplayOutput, {
|
|
292
|
+
displayFixedOutput: displayFixedOutput,
|
|
293
|
+
hideLabel: displayOutputLabel.hide,
|
|
294
|
+
showLabel: displayOutputLabel.show,
|
|
295
|
+
show: displayOutputLabel.open
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
357
298
|
|
|
358
|
-
|
|
359
|
-
}(Component);
|
|
299
|
+
}
|
|
360
300
|
|
|
361
301
|
export { QueryBuilderImpl as default };
|
|
362
|
-
//# sourceMappingURL=QueryBuilderImpl.js.map
|