@elliemae/ds-query-builder 3.0.0-next.0 → 3.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSQueryBuilder.js +118 -0
- package/dist/cjs/DSQueryBuilder.js.map +7 -0
- package/dist/cjs/components/AndOrController/AndOrController.js +208 -0
- package/dist/cjs/components/AndOrController/AndOrController.js.map +7 -0
- package/dist/cjs/components/ConditionController/ConditionController.js +116 -0
- package/dist/cjs/components/ConditionController/ConditionController.js.map +7 -0
- package/dist/cjs/components/DisplayOutput/DisplayOutput.js +92 -0
- package/dist/cjs/components/DisplayOutput/DisplayOutput.js.map +7 -0
- package/dist/cjs/components/DragContainerController/DragContainerController.js +65 -0
- package/dist/cjs/components/DragContainerController/DragContainerController.js.map +7 -0
- package/dist/cjs/components/DragControllerRow/DragControllerRow.js +83 -0
- package/dist/cjs/components/DragControllerRow/DragControllerRow.js.map +7 -0
- package/dist/cjs/components/FieldControllerRow/FieldControllerRow.js +55 -0
- package/dist/cjs/components/FieldControllerRow/FieldControllerRow.js.map +7 -0
- package/dist/cjs/components/Nestable/Nestable.js +264 -0
- package/dist/cjs/components/Nestable/Nestable.js.map +7 -0
- package/dist/cjs/components/Nestable/NestableItem.js +127 -0
- package/dist/cjs/components/Nestable/NestableItem.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/events.js +153 -0
- package/dist/cjs/components/Nestable/actions/events.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/getItemOptions.js +49 -0
- package/dist/cjs/components/Nestable/actions/getItemOptions.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/getPaths.js +119 -0
- package/dist/cjs/components/Nestable/actions/getPaths.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/index.js +42 -0
- package/dist/cjs/components/Nestable/actions/index.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/moveItem.js +69 -0
- package/dist/cjs/components/Nestable/actions/moveItem.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/paths.js +119 -0
- package/dist/cjs/components/Nestable/actions/paths.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/tryDecreaseDepth.js +51 -0
- package/dist/cjs/components/Nestable/actions/tryDecreaseDepth.js.map +7 -0
- package/dist/cjs/components/Nestable/actions/tryIncreaseDepth.js +51 -0
- package/dist/cjs/components/Nestable/actions/tryIncreaseDepth.js.map +7 -0
- package/dist/cjs/components/Nestable/index.js +36 -0
- package/dist/cjs/components/Nestable/index.js.map +7 -0
- package/dist/cjs/components/QueryBuilderContext/QueryBuilderContext.js +36 -0
- package/dist/cjs/components/QueryBuilderContext/QueryBuilderContext.js.map +7 -0
- package/dist/cjs/components/QueryBuilderImpl.js +253 -0
- package/dist/cjs/components/QueryBuilderImpl.js.map +7 -0
- package/dist/cjs/components/QueryBuilderItem/QueryBuilderItem.js +108 -0
- package/dist/cjs/components/QueryBuilderItem/QueryBuilderItem.js.map +7 -0
- package/dist/cjs/components/QueryBuilderRow/QueryBuilderRow.js +235 -0
- package/dist/cjs/components/QueryBuilderRow/QueryBuilderRow.js.map +7 -0
- package/dist/cjs/components/ToolBarAnimation/ToolBarAnimation.js +58 -0
- package/dist/cjs/components/ToolBarAnimation/ToolBarAnimation.js.map +7 -0
- package/dist/cjs/components/format/format.js +59 -0
- package/dist/cjs/components/format/format.js.map +7 -0
- package/dist/cjs/components/format/sqlFormat.js +94 -0
- package/dist/cjs/components/format/sqlFormat.js.map +7 -0
- package/dist/cjs/components/format/sqlSafeFormat.js +98 -0
- package/dist/cjs/components/format/sqlSafeFormat.js.map +7 -0
- package/dist/cjs/components/format/xmlFormat.js +94 -0
- package/dist/cjs/components/format/xmlFormat.js.map +7 -0
- package/dist/cjs/components/helpers/actions.js +253 -0
- package/dist/cjs/components/helpers/actions.js.map +7 -0
- package/dist/cjs/components/helpers/constants.js +39 -0
- package/dist/cjs/components/helpers/constants.js.map +7 -0
- package/dist/cjs/components/helpers/dependencies.js +69 -0
- package/dist/cjs/components/helpers/dependencies.js.map +7 -0
- package/dist/cjs/components/helpers/selectors.js +161 -0
- package/dist/cjs/components/helpers/selectors.js.map +7 -0
- package/dist/cjs/components/helpers/store.js +171 -0
- package/dist/cjs/components/helpers/store.js.map +7 -0
- package/dist/cjs/components/helpers/types.js +92 -0
- package/dist/cjs/components/helpers/types.js.map +7 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/propTypes.js +105 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/esm/DSQueryBuilder.js +105 -0
- package/dist/esm/DSQueryBuilder.js.map +7 -0
- package/dist/esm/components/AndOrController/AndOrController.js +179 -0
- package/dist/esm/components/AndOrController/AndOrController.js.map +7 -0
- package/dist/esm/components/ConditionController/ConditionController.js +87 -0
- package/dist/esm/components/ConditionController/ConditionController.js.map +7 -0
- package/dist/esm/components/DisplayOutput/DisplayOutput.js +63 -0
- package/dist/esm/components/DisplayOutput/DisplayOutput.js.map +7 -0
- package/dist/esm/components/DragContainerController/DragContainerController.js +36 -0
- package/dist/esm/components/DragContainerController/DragContainerController.js.map +7 -0
- package/dist/esm/components/DragControllerRow/DragControllerRow.js +56 -0
- package/dist/esm/components/DragControllerRow/DragControllerRow.js.map +7 -0
- package/dist/esm/components/FieldControllerRow/FieldControllerRow.js +26 -0
- package/dist/esm/components/FieldControllerRow/FieldControllerRow.js.map +7 -0
- package/dist/esm/components/Nestable/Nestable.js +253 -0
- package/dist/esm/components/Nestable/Nestable.js.map +7 -0
- package/dist/esm/components/Nestable/NestableItem.js +100 -0
- package/dist/esm/components/Nestable/NestableItem.js.map +7 -0
- package/dist/esm/components/Nestable/actions/events.js +131 -0
- package/dist/esm/components/Nestable/actions/events.js.map +7 -0
- package/{esm → dist/esm}/components/Nestable/actions/getItemOptions.js +7 -11
- package/dist/esm/components/Nestable/actions/getItemOptions.js.map +7 -0
- package/{esm → dist/esm}/components/Nestable/actions/getPaths.js +17 -43
- package/dist/esm/components/Nestable/actions/getPaths.js.map +7 -0
- package/dist/esm/components/Nestable/actions/index.js +13 -0
- package/dist/esm/components/Nestable/actions/index.js.map +7 -0
- package/dist/esm/components/Nestable/actions/moveItem.js +42 -0
- package/dist/esm/components/Nestable/actions/moveItem.js.map +7 -0
- package/{esm → dist/esm}/components/Nestable/actions/paths.js +19 -47
- package/dist/esm/components/Nestable/actions/paths.js.map +7 -0
- package/dist/esm/components/Nestable/actions/tryDecreaseDepth.js +22 -0
- package/dist/esm/components/Nestable/actions/tryDecreaseDepth.js.map +7 -0
- package/{esm → dist/esm}/components/Nestable/actions/tryIncreaseDepth.js +10 -22
- package/dist/esm/components/Nestable/actions/tryIncreaseDepth.js.map +7 -0
- package/dist/esm/components/Nestable/index.js +7 -0
- package/dist/esm/components/Nestable/index.js.map +7 -0
- package/dist/esm/components/QueryBuilderContext/QueryBuilderContext.js +7 -0
- package/dist/esm/components/QueryBuilderContext/QueryBuilderContext.js.map +7 -0
- package/dist/esm/components/QueryBuilderImpl.js +226 -0
- package/dist/esm/components/QueryBuilderImpl.js.map +7 -0
- package/dist/esm/components/QueryBuilderItem/QueryBuilderItem.js +81 -0
- package/dist/esm/components/QueryBuilderItem/QueryBuilderItem.js.map +7 -0
- package/dist/esm/components/QueryBuilderRow/QueryBuilderRow.js +208 -0
- package/dist/esm/components/QueryBuilderRow/QueryBuilderRow.js.map +7 -0
- package/dist/esm/components/ToolBarAnimation/ToolBarAnimation.js +31 -0
- package/dist/esm/components/ToolBarAnimation/ToolBarAnimation.js.map +7 -0
- package/dist/esm/components/format/format.js +30 -0
- package/dist/esm/components/format/format.js.map +7 -0
- package/dist/esm/components/format/sqlFormat.js +65 -0
- package/dist/esm/components/format/sqlFormat.js.map +7 -0
- package/dist/esm/components/format/sqlSafeFormat.js +69 -0
- package/dist/esm/components/format/sqlSafeFormat.js.map +7 -0
- package/dist/esm/components/format/xmlFormat.js +65 -0
- package/dist/esm/components/format/xmlFormat.js.map +7 -0
- package/dist/esm/components/helpers/actions.js +230 -0
- package/dist/esm/components/helpers/actions.js.map +7 -0
- package/dist/esm/components/helpers/constants.js +10 -0
- package/dist/esm/components/helpers/constants.js.map +7 -0
- package/dist/esm/components/helpers/dependencies.js +40 -0
- package/dist/esm/components/helpers/dependencies.js.map +7 -0
- package/dist/esm/components/helpers/selectors.js +132 -0
- package/dist/esm/components/helpers/selectors.js.map +7 -0
- package/dist/esm/components/helpers/store.js +157 -0
- package/dist/esm/components/helpers/store.js.map +7 -0
- package/dist/esm/components/helpers/types.js +63 -0
- package/dist/esm/components/helpers/types.js.map +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/propTypes.js +76 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/package.json +103 -94
- package/cjs/DSQueryBuilder.js +0 -98
- package/cjs/components/AndOrController/AndOrController.js +0 -222
- package/cjs/components/ConditionController/ConditionController.js +0 -100
- package/cjs/components/DisplayOutput/DisplayOutput.js +0 -89
- package/cjs/components/DragContainerController/DragContainerController.js +0 -45
- package/cjs/components/DragControllerRow/DragControllerRow.js +0 -47
- package/cjs/components/FieldControllerRow/FieldControllerRow.js +0 -33
- package/cjs/components/Nestable/Nestable.js +0 -320
- package/cjs/components/Nestable/NestableItem.js +0 -111
- package/cjs/components/Nestable/actions/events.js +0 -166
- package/cjs/components/Nestable/actions/getItemOptions.js +0 -28
- package/cjs/components/Nestable/actions/getPaths.js +0 -124
- package/cjs/components/Nestable/actions/index.js +0 -28
- package/cjs/components/Nestable/actions/moveItem.js +0 -54
- package/cjs/components/Nestable/actions/paths.js +0 -126
- package/cjs/components/Nestable/actions/tryDecreaseDepth.js +0 -35
- package/cjs/components/Nestable/actions/tryIncreaseDepth.js +0 -38
- package/cjs/components/Nestable/index.js +0 -7
- package/cjs/components/QueryBuilderContext/QueryBuilderContext.js +0 -13
- package/cjs/components/QueryBuilderImpl.js +0 -309
- package/cjs/components/QueryBuilderItem/QueryBuilderItem.js +0 -90
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +0 -276
- package/cjs/components/ToolBarAnimation/ToolBarAnimation.js +0 -29
- package/cjs/components/format/format.js +0 -33
- package/cjs/components/format/sqlFormat.js +0 -73
- package/cjs/components/format/sqlSafeFormat.js +0 -81
- package/cjs/components/format/xmlFormat.js +0 -73
- package/cjs/components/helpers/actions.js +0 -277
- package/cjs/components/helpers/constants.js +0 -11
- package/cjs/components/helpers/dependencies.js +0 -84
- package/cjs/components/helpers/selectors.js +0 -101
- package/cjs/components/helpers/store.js +0 -177
- package/cjs/components/helpers/types.js +0 -64
- package/cjs/index.js +0 -29
- package/cjs/propTypes.js +0 -97
- package/esm/DSQueryBuilder.js +0 -74
- package/esm/components/AndOrController/AndOrController.js +0 -213
- package/esm/components/ConditionController/ConditionController.js +0 -92
- package/esm/components/DisplayOutput/DisplayOutput.js +0 -83
- package/esm/components/DragContainerController/DragContainerController.js +0 -39
- package/esm/components/DragControllerRow/DragControllerRow.js +0 -39
- package/esm/components/FieldControllerRow/FieldControllerRow.js +0 -27
- package/esm/components/Nestable/Nestable.js +0 -312
- package/esm/components/Nestable/NestableItem.js +0 -103
- package/esm/components/Nestable/actions/events.js +0 -153
- package/esm/components/Nestable/actions/index.js +0 -6
- package/esm/components/Nestable/actions/moveItem.js +0 -45
- package/esm/components/Nestable/actions/tryDecreaseDepth.js +0 -31
- package/esm/components/Nestable/index.js +0 -2
- package/esm/components/QueryBuilderContext/QueryBuilderContext.js +0 -5
- package/esm/components/QueryBuilderImpl.js +0 -301
- package/esm/components/QueryBuilderItem/QueryBuilderItem.js +0 -83
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +0 -268
- package/esm/components/ToolBarAnimation/ToolBarAnimation.js +0 -20
- package/esm/components/format/format.js +0 -31
- package/esm/components/format/sqlFormat.js +0 -69
- package/esm/components/format/sqlSafeFormat.js +0 -76
- package/esm/components/format/xmlFormat.js +0 -69
- package/esm/components/helpers/actions.js +0 -254
- package/esm/components/helpers/constants.js +0 -5
- package/esm/components/helpers/dependencies.js +0 -60
- package/esm/components/helpers/selectors.js +0 -93
- package/esm/components/helpers/store.js +0 -171
- package/esm/components/helpers/types.js +0 -52
- package/esm/index.js +0 -4
- package/esm/propTypes.js +0 -93
- package/types/DSQueryBuilder.d.ts +0 -211
- package/types/components/AndOrController/AndOrController.d.ts +0 -38
- package/types/components/ConditionController/ConditionController.d.ts +0 -16
- package/types/components/DisplayOutput/DisplayOutput.d.ts +0 -7
- package/types/components/DragContainerController/DragContainerController.d.ts +0 -9
- package/types/components/DragControllerRow/DragControllerRow.d.ts +0 -9
- package/types/components/FieldControllerRow/FieldControllerRow.d.ts +0 -9
- package/types/components/Nestable/Nestable.d.ts +0 -51
- package/types/components/Nestable/NestableItem.d.ts +0 -12
- package/types/components/Nestable/actions/events.d.ts +0 -6
- package/types/components/Nestable/actions/getItemOptions.d.ts +0 -11
- package/types/components/Nestable/actions/getPaths.d.ts +0 -5
- package/types/components/Nestable/actions/index.d.ts +0 -6
- package/types/components/Nestable/actions/moveItem.d.ts +0 -5
- package/types/components/Nestable/actions/paths.d.ts +0 -5
- package/types/components/Nestable/actions/tryDecreaseDepth.d.ts +0 -1
- package/types/components/Nestable/actions/tryIncreaseDepth.d.ts +0 -1
- package/types/components/Nestable/index.d.ts +0 -2
- package/types/components/QueryBuilderContext/QueryBuilderContext.d.ts +0 -2
- package/types/components/QueryBuilderImpl.d.ts +0 -49
- package/types/components/QueryBuilderItem/QueryBuilderItem.d.ts +0 -5
- package/types/components/QueryBuilderRow/QueryBuilderRow.d.ts +0 -12
- package/types/components/ToolBarAnimation/ToolBarAnimation.d.ts +0 -3
- package/types/components/format/format.d.ts +0 -26
- package/types/components/format/sqlFormat.d.ts +0 -5
- package/types/components/format/sqlSafeFormat.d.ts +0 -6
- package/types/components/format/xmlFormat.d.ts +0 -5
- package/types/components/helpers/actions.d.ts +0 -63
- package/types/components/helpers/constants.d.ts +0 -3
- package/types/components/helpers/dependencies.d.ts +0 -1
- package/types/components/helpers/selectors.d.ts +0 -20
- package/types/components/helpers/store.d.ts +0 -144
- package/types/components/helpers/types.d.ts +0 -50
- package/types/index.d.ts +0 -2
- package/types/propTypes.d.ts +0 -156
|
@@ -1,45 +0,0 @@
|
|
|
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import update from 'react-addons-update';
|
|
8
|
-
|
|
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
|
-
|
|
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
|
-
function moveItem(_ref) {
|
|
13
|
-
let {
|
|
14
|
-
dragItem,
|
|
15
|
-
pathFrom,
|
|
16
|
-
pathTo
|
|
17
|
-
} = _ref;
|
|
18
|
-
let extraProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
19
|
-
const {
|
|
20
|
-
childrenProp
|
|
21
|
-
} = this.props;
|
|
22
|
-
let {
|
|
23
|
-
items
|
|
24
|
-
} = this.state; // the remove action might affect the next position,
|
|
25
|
-
// so update next coordinates accordingly
|
|
26
|
-
|
|
27
|
-
const realPathTo = this.getRealNextPath(pathFrom, pathTo);
|
|
28
|
-
const removePath = this.getSplicePath(pathFrom, {
|
|
29
|
-
numToRemove: 1,
|
|
30
|
-
childrenProp
|
|
31
|
-
});
|
|
32
|
-
const insertPath = this.getSplicePath(realPathTo, {
|
|
33
|
-
numToRemove: 0,
|
|
34
|
-
itemsToInsert: [dragItem],
|
|
35
|
-
childrenProp
|
|
36
|
-
});
|
|
37
|
-
items = update(items, removePath);
|
|
38
|
-
items = update(items, insertPath);
|
|
39
|
-
this.setState(_objectSpread({
|
|
40
|
-
items,
|
|
41
|
-
isDirty: true
|
|
42
|
-
}, extraProps));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export { moveItem };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
function tryDecreaseDepth(dragItem) {
|
|
2
|
-
const {
|
|
3
|
-
childrenProp,
|
|
4
|
-
collapsed
|
|
5
|
-
} = this.props;
|
|
6
|
-
const pathFrom = this.getPathById(dragItem.id);
|
|
7
|
-
const itemIndex = pathFrom[pathFrom.length - 1]; // has parent
|
|
8
|
-
|
|
9
|
-
if (pathFrom.length > 1) {
|
|
10
|
-
const parent = this.getItemByPath(pathFrom.slice(0, -1)); // is last (by order) item in array
|
|
11
|
-
|
|
12
|
-
if (itemIndex + 1 === parent[childrenProp].length) {
|
|
13
|
-
const pathTo = pathFrom.slice(0, -1);
|
|
14
|
-
pathTo[pathTo.length - 1] += 1; // if collapsed by default and is last (by count) item in array remove this node from list of open nodes
|
|
15
|
-
|
|
16
|
-
let collapseProps = {};
|
|
17
|
-
|
|
18
|
-
if (collapsed && parent[childrenProp].length === 1) {
|
|
19
|
-
collapseProps = this.onToggleCollapse(parent, true);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
this.moveItem({
|
|
23
|
-
dragItem,
|
|
24
|
-
pathFrom,
|
|
25
|
-
pathTo
|
|
26
|
-
}, collapseProps);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { tryDecreaseDepth };
|
|
@@ -1,301 +0,0 @@
|
|
|
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';
|
|
7
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
9
|
-
import { Component } from 'react';
|
|
10
|
-
import Nestable from './Nestable/Nestable.js';
|
|
11
|
-
import { QueryBuilderContext } from './QueryBuilderContext/QueryBuilderContext.js';
|
|
12
|
-
import { QB_ADD_FILTER_METHOD_TYPES, QB_GROUP_FILTER_METHOD_TYPES, QB_DRAG_TYPES } from './helpers/types.js';
|
|
13
|
-
import QueryBuilderStore from './helpers/store.js';
|
|
14
|
-
import AndOrController from './AndOrController/AndOrController.js';
|
|
15
|
-
import QueryBuilderItem from './QueryBuilderItem/QueryBuilderItem.js';
|
|
16
|
-
import DisplayOutput from './DisplayOutput/DisplayOutput.js';
|
|
17
|
-
import { jsxs } from 'react/jsx-runtime';
|
|
18
|
-
|
|
19
|
-
const _excluded = ["format"];
|
|
20
|
-
|
|
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
|
-
|
|
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
|
-
|
|
25
|
-
class QueryBuilderImpl extends Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
this.isDraggableItem = true;
|
|
29
|
-
|
|
30
|
-
this.onOrderDragAndDrop = (items, item) => {
|
|
31
|
-
const newFilters = this.store.onOrderDragAndDrop(items, item);
|
|
32
|
-
this.sendCall('reOrderOnDragAndDrop', {
|
|
33
|
-
items
|
|
34
|
-
});
|
|
35
|
-
this.sendChange(newFilters);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
this.onAddFilterToGroup = idGroup => {
|
|
39
|
-
const newFilters = this.store.addFilter(idGroup);
|
|
40
|
-
this.sendCall('onAddFilterToGroup', {
|
|
41
|
-
idGroup
|
|
42
|
-
});
|
|
43
|
-
this.sendChange(newFilters);
|
|
44
|
-
};
|
|
45
|
-
|
|
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
|
|
54
|
-
});
|
|
55
|
-
this.sendChange(newFilters);
|
|
56
|
-
};
|
|
57
|
-
|
|
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
|
|
66
|
-
});
|
|
67
|
-
this.sendChange(newFilters);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
this.onRemoveFilter = idFilter => {
|
|
71
|
-
const newFilters = this.store.onRemoveFilter(idFilter);
|
|
72
|
-
this.sendCall('onRemoveFilter', {
|
|
73
|
-
idFilter
|
|
74
|
-
});
|
|
75
|
-
this.sendChange(newFilters);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
this.handleFieldChange = data => {
|
|
79
|
-
const {
|
|
80
|
-
fieldsSharedActions
|
|
81
|
-
} = this.props;
|
|
82
|
-
const newFilters = this.store.changeFilter(_objectSpread(_objectSpread({}, data), {}, {
|
|
83
|
-
fieldsSharedActions
|
|
84
|
-
}));
|
|
85
|
-
this.sendCall('handleFieldChange', {
|
|
86
|
-
data
|
|
87
|
-
});
|
|
88
|
-
this.sendChange(newFilters);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
this.handleRuleContainerOperator = (idGroup, value) => {
|
|
92
|
-
const newFilters = this.store.changeGroupOperator(idGroup, value);
|
|
93
|
-
this.sendCall('handleRuleContainerOperator', {
|
|
94
|
-
idGroup,
|
|
95
|
-
value
|
|
96
|
-
});
|
|
97
|
-
this.sendChange(newFilters);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
this.handleRuleContainerUnGroup = idGroup => {
|
|
101
|
-
const newFilters = this.store.unGroup(idGroup);
|
|
102
|
-
this.sendCall('handleRuleContainerUnGroup', {
|
|
103
|
-
idGroup
|
|
104
|
-
});
|
|
105
|
-
this.sendChange(newFilters);
|
|
106
|
-
};
|
|
107
|
-
|
|
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
|
|
122
|
-
});
|
|
123
|
-
this.sendChange(newFilters);
|
|
124
|
-
};
|
|
125
|
-
|
|
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
|
|
140
|
-
});
|
|
141
|
-
this.sendChange(newFilters);
|
|
142
|
-
};
|
|
143
|
-
|
|
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);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
this.sendChange = _ref => {
|
|
153
|
-
let {
|
|
154
|
-
format
|
|
155
|
-
} = _ref,
|
|
156
|
-
newFilters = _objectWithoutProperties(_ref, _excluded);
|
|
157
|
-
|
|
158
|
-
this.setState(_objectSpread({
|
|
159
|
-
format
|
|
160
|
-
}, newFilters));
|
|
161
|
-
const {
|
|
162
|
-
onChange
|
|
163
|
-
} = this.props;
|
|
164
|
-
onChange(format, newFilters);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
this.sendCall = (action, data) => {
|
|
168
|
-
const {
|
|
169
|
-
[action]: callback
|
|
170
|
-
} = this.props;
|
|
171
|
-
if (callback) callback(data);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
this.setDraggableItems = drag => {
|
|
175
|
-
this.isDraggableItem = true;
|
|
176
|
-
|
|
177
|
-
try {
|
|
178
|
-
const ua = window.navigator.userAgent;
|
|
179
|
-
const msie = ua.indexOf('MSIE '); // eslint-disable-next-line no-useless-escape
|
|
180
|
-
|
|
181
|
-
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
|
|
182
|
-
const {
|
|
183
|
-
isDraggableItem
|
|
184
|
-
} = this.state;
|
|
185
|
-
|
|
186
|
-
if (drag !== isDraggableItem) {
|
|
187
|
-
this.setState({
|
|
188
|
-
isDraggableItem: drag
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
this.isDraggableItem = drag;
|
|
193
|
-
}
|
|
194
|
-
} catch (error) {
|
|
195
|
-
this.isDraggableItem = true;
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
this.store = new QueryBuilderStore(props.init, props.format);
|
|
200
|
-
this.state = this.store.getInitialState();
|
|
201
|
-
}
|
|
202
|
-
|
|
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();
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
|
|
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, {
|
|
269
|
-
isAndItem: condition === true,
|
|
270
|
-
isDraggableItem: this.isDraggableItem,
|
|
271
|
-
isOrItem: condition !== true,
|
|
272
|
-
items: items,
|
|
273
|
-
onChange: this.onOrderDragAndDrop,
|
|
274
|
-
renderItem: QueryBuilderItem,
|
|
275
|
-
setDraggableItems: this.setDraggableItems,
|
|
276
|
-
step: step,
|
|
277
|
-
singleRow: singleRow
|
|
278
|
-
}), !singleRow && /*#__PURE__*/_jsx("div", {
|
|
279
|
-
className: "rule-container-options"
|
|
280
|
-
}, void 0, /*#__PURE__*/_jsx(AndOrController, {
|
|
281
|
-
allowUnGroup: false,
|
|
282
|
-
condition: condition,
|
|
283
|
-
handleRuleContainerOperator: value => this.handleRuleContainerOperator(main, value),
|
|
284
|
-
handleRuleContainerUnGroup: () => this.handleRuleContainerUnGroup(main),
|
|
285
|
-
isMain: true,
|
|
286
|
-
onAddFilter: () => this.onAddFilterToGroup(main),
|
|
287
|
-
showDragController: false,
|
|
288
|
-
step: step,
|
|
289
|
-
toolTipZIndex: toolTipZIndex
|
|
290
|
-
}))]
|
|
291
|
-
})), (displayOutput || displayFixedOutput) && /*#__PURE__*/_jsx(DisplayOutput, {
|
|
292
|
-
displayFixedOutput: displayFixedOutput,
|
|
293
|
-
hideLabel: displayOutputLabel.hide,
|
|
294
|
-
showLabel: displayOutputLabel.show,
|
|
295
|
-
show: displayOutputLabel.open
|
|
296
|
-
}));
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
export { QueryBuilderImpl as default };
|
|
@@ -1,83 +0,0 @@
|
|
|
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';
|
|
7
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
-
import 'react';
|
|
9
|
-
import { QueryBuilderContext } from '../QueryBuilderContext/QueryBuilderContext.js';
|
|
10
|
-
import { QB_DRAG_TYPES } from '../helpers/types.js';
|
|
11
|
-
import AndOrController from '../AndOrController/AndOrController.js';
|
|
12
|
-
import QueryBuilderRow from '../QueryBuilderRow/QueryBuilderRow.js';
|
|
13
|
-
import { jsx } from 'react/jsx-runtime';
|
|
14
|
-
|
|
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
|
-
|
|
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
|
-
|
|
19
|
-
const QueryBuilderItem = _ref => {
|
|
20
|
-
let {
|
|
21
|
-
item
|
|
22
|
-
} = _ref;
|
|
23
|
-
const {
|
|
24
|
-
element
|
|
25
|
-
} = item;
|
|
26
|
-
const {
|
|
27
|
-
type,
|
|
28
|
-
idFilter,
|
|
29
|
-
idGroup,
|
|
30
|
-
condition
|
|
31
|
-
} = element;
|
|
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
|
-
|
|
51
|
-
if (type === QB_DRAG_TYPES.FILTER) {
|
|
52
|
-
return /*#__PURE__*/jsx(QueryBuilderRow, _objectSpread(_objectSpread({}, element), {}, {
|
|
53
|
-
fields: fields,
|
|
54
|
-
handleFieldChange: handleFieldChange,
|
|
55
|
-
isDraggableItem: isDraggableItem,
|
|
56
|
-
items: items,
|
|
57
|
-
onAddFilter: () => onAddFilter(idGroup, idFilter),
|
|
58
|
-
onAddRuleContainer: () => onAddRuleContainer(idGroup, idFilter),
|
|
59
|
-
onRemoveFilter: () => onRemoveFilter(idFilter),
|
|
60
|
-
setDraggableItems: setDraggableItems,
|
|
61
|
-
showDragController: showDragController,
|
|
62
|
-
step: step,
|
|
63
|
-
singleRow: singleRow,
|
|
64
|
-
toolTipZIndex: toolTipZIndex
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (singleRow) return null;
|
|
69
|
-
return /*#__PURE__*/_jsx(AndOrController, {
|
|
70
|
-
allowUnGroup: true,
|
|
71
|
-
condition: condition,
|
|
72
|
-
handleRuleContainerOperator: value => handleRuleContainerOperator(idGroup, value),
|
|
73
|
-
handleRuleContainerUnGroup: () => handleRuleContainerUnGroup(idGroup),
|
|
74
|
-
multipleSize: false,
|
|
75
|
-
onAddFilter: () => onAddFilterToGroup(idGroup),
|
|
76
|
-
showDragController: true,
|
|
77
|
-
step: step,
|
|
78
|
-
toolTipZIndex: toolTipZIndex
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export { QueryBuilderItem as default };
|