@elliemae/ds-query-builder 2.2.0-next.6 → 2.3.0-alpha.1
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 +117 -97
- package/cjs/DSQueryBuilder.js.map +7 -0
- package/cjs/components/AndOrController/AndOrController.js +148 -162
- package/cjs/components/AndOrController/AndOrController.js.map +7 -0
- package/cjs/components/ConditionController/ConditionController.js +88 -72
- package/cjs/components/ConditionController/ConditionController.js.map +7 -0
- package/cjs/components/DisplayOutput/DisplayOutput.js +63 -68
- package/cjs/components/DisplayOutput/DisplayOutput.js.map +7 -0
- package/cjs/components/DragContainerController/DragContainerController.js +61 -41
- package/cjs/components/DragContainerController/DragContainerController.js.map +7 -0
- package/cjs/components/DragControllerRow/DragControllerRow.js +50 -46
- package/cjs/components/DragControllerRow/DragControllerRow.js.map +7 -0
- package/cjs/components/FieldControllerRow/FieldControllerRow.js +54 -32
- package/cjs/components/FieldControllerRow/FieldControllerRow.js.map +7 -0
- package/cjs/components/Nestable/Nestable.js +143 -209
- package/cjs/components/Nestable/Nestable.js.map +7 -0
- package/cjs/components/Nestable/NestableItem.js +98 -90
- package/cjs/components/Nestable/NestableItem.js.map +7 -0
- package/cjs/components/Nestable/actions/events.js +72 -95
- package/cjs/components/Nestable/actions/events.js.map +7 -0
- package/cjs/components/Nestable/actions/getItemOptions.js +36 -15
- package/cjs/components/Nestable/actions/getItemOptions.js.map +7 -0
- package/cjs/components/Nestable/actions/getPaths.js +46 -51
- package/cjs/components/Nestable/actions/getPaths.js.map +7 -0
- package/cjs/components/Nestable/actions/index.js +42 -28
- package/cjs/components/Nestable/actions/index.js.map +7 -0
- package/cjs/components/Nestable/actions/moveItem.js +44 -42
- package/cjs/components/Nestable/actions/moveItem.js.map +7 -0
- package/cjs/components/Nestable/actions/paths.js +48 -55
- package/cjs/components/Nestable/actions/paths.js.map +7 -0
- package/cjs/components/Nestable/actions/tryDecreaseDepth.js +39 -23
- package/cjs/components/Nestable/actions/tryDecreaseDepth.js.map +7 -0
- package/cjs/components/Nestable/actions/tryIncreaseDepth.js +39 -26
- package/cjs/components/Nestable/actions/tryIncreaseDepth.js.map +7 -0
- package/cjs/components/Nestable/index.js +36 -7
- package/cjs/components/Nestable/index.js.map +7 -0
- package/cjs/components/QueryBuilderContext/QueryBuilderContext.js +36 -13
- package/cjs/components/QueryBuilderContext/QueryBuilderContext.js.map +7 -0
- package/cjs/components/QueryBuilderImpl.js +118 -202
- package/cjs/components/QueryBuilderImpl.js.map +7 -0
- package/cjs/components/QueryBuilderItem/QueryBuilderItem.js +80 -78
- package/cjs/components/QueryBuilderItem/QueryBuilderItem.js.map +7 -0
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +154 -211
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js.map +7 -0
- package/cjs/components/ToolBarAnimation/ToolBarAnimation.js +39 -26
- package/cjs/components/ToolBarAnimation/ToolBarAnimation.js.map +7 -0
- package/cjs/components/format/format.js +48 -22
- package/cjs/components/format/format.js.map +7 -0
- package/cjs/components/format/sqlFormat.js +69 -48
- package/cjs/components/format/sqlFormat.js.map +7 -0
- package/cjs/components/format/sqlSafeFormat.js +72 -55
- package/cjs/components/format/sqlSafeFormat.js.map +7 -0
- package/cjs/components/format/xmlFormat.js +71 -50
- package/cjs/components/format/xmlFormat.js.map +7 -0
- package/cjs/components/helpers/actions.js +151 -186
- package/cjs/components/helpers/actions.js.map +7 -0
- package/cjs/components/helpers/constants.js +36 -8
- package/cjs/components/helpers/constants.js.map +7 -0
- package/cjs/components/helpers/dependencies.js +49 -64
- package/cjs/components/helpers/dependencies.js.map +7 -0
- package/cjs/components/helpers/selectors.js +161 -101
- package/cjs/components/helpers/selectors.js.map +7 -0
- package/cjs/components/helpers/store.js +86 -104
- package/cjs/components/helpers/store.js.map +7 -0
- package/cjs/components/helpers/types.js +72 -44
- package/cjs/components/helpers/types.js.map +7 -0
- package/cjs/index.js +36 -29
- package/cjs/index.js.map +7 -0
- package/cjs/propTypes.js +102 -94
- package/cjs/propTypes.js.map +7 -0
- package/esm/DSQueryBuilder.js +103 -72
- package/esm/DSQueryBuilder.js.map +7 -0
- package/esm/components/AndOrController/AndOrController.js +113 -147
- package/esm/components/AndOrController/AndOrController.js.map +7 -0
- package/esm/components/ConditionController/ConditionController.js +57 -62
- package/esm/components/ConditionController/ConditionController.js.map +7 -0
- package/esm/components/DisplayOutput/DisplayOutput.js +31 -59
- package/esm/components/DisplayOutput/DisplayOutput.js.map +7 -0
- package/esm/components/DragContainerController/DragContainerController.js +32 -35
- package/esm/components/DragContainerController/DragContainerController.js.map +7 -0
- package/esm/components/DragControllerRow/DragControllerRow.js +21 -38
- package/esm/components/DragControllerRow/DragControllerRow.js.map +7 -0
- package/esm/components/FieldControllerRow/FieldControllerRow.js +25 -26
- package/esm/components/FieldControllerRow/FieldControllerRow.js.map +7 -0
- package/esm/components/Nestable/Nestable.js +115 -186
- package/esm/components/Nestable/Nestable.js.map +7 -0
- package/esm/components/Nestable/NestableItem.js +69 -82
- package/esm/components/Nestable/NestableItem.js.map +7 -0
- package/esm/components/Nestable/actions/events.js +45 -79
- package/esm/components/Nestable/actions/events.js.map +7 -0
- package/esm/components/Nestable/actions/getItemOptions.js +7 -11
- package/esm/components/Nestable/actions/getItemOptions.js.map +7 -0
- package/esm/components/Nestable/actions/getPaths.js +17 -43
- package/esm/components/Nestable/actions/getPaths.js.map +7 -0
- package/esm/components/Nestable/actions/index.js +13 -6
- package/esm/components/Nestable/actions/index.js.map +7 -0
- package/esm/components/Nestable/actions/moveItem.js +13 -31
- package/esm/components/Nestable/actions/moveItem.js.map +7 -0
- package/esm/components/Nestable/actions/paths.js +19 -47
- package/esm/components/Nestable/actions/paths.js.map +7 -0
- package/esm/components/Nestable/actions/tryDecreaseDepth.js +10 -19
- package/esm/components/Nestable/actions/tryDecreaseDepth.js.map +7 -0
- package/esm/components/Nestable/actions/tryIncreaseDepth.js +10 -22
- package/esm/components/Nestable/actions/tryIncreaseDepth.js.map +7 -0
- package/esm/components/Nestable/index.js +7 -2
- package/esm/components/Nestable/index.js.map +7 -0
- package/esm/components/QueryBuilderContext/QueryBuilderContext.js +7 -5
- package/esm/components/QueryBuilderContext/QueryBuilderContext.js.map +7 -0
- package/esm/components/QueryBuilderImpl.js +82 -187
- package/esm/components/QueryBuilderImpl.js.map +7 -0
- package/esm/components/QueryBuilderItem/QueryBuilderItem.js +50 -70
- package/esm/components/QueryBuilderItem/QueryBuilderItem.js.map +7 -0
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +123 -201
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js.map +7 -0
- package/esm/components/ToolBarAnimation/ToolBarAnimation.js +10 -17
- package/esm/components/ToolBarAnimation/ToolBarAnimation.js.map +7 -0
- package/esm/components/format/format.js +16 -17
- package/esm/components/format/format.js.map +7 -0
- package/esm/components/format/sqlFormat.js +39 -43
- package/esm/components/format/sqlFormat.js.map +7 -0
- package/esm/components/format/sqlSafeFormat.js +43 -50
- package/esm/components/format/sqlSafeFormat.js.map +7 -0
- package/esm/components/format/xmlFormat.js +41 -45
- package/esm/components/format/xmlFormat.js.map +7 -0
- package/esm/components/helpers/actions.js +123 -160
- package/esm/components/helpers/actions.js.map +7 -0
- package/esm/components/helpers/constants.js +7 -2
- package/esm/components/helpers/constants.js.map +7 -0
- package/esm/components/helpers/dependencies.js +19 -39
- package/esm/components/helpers/dependencies.js.map +7 -0
- package/esm/components/helpers/selectors.js +132 -93
- package/esm/components/helpers/selectors.js.map +7 -0
- package/esm/components/helpers/store.js +54 -82
- package/esm/components/helpers/store.js.map +7 -0
- package/esm/components/helpers/types.js +44 -33
- package/esm/components/helpers/types.js.map +7 -0
- package/esm/index.js +7 -4
- package/esm/index.js.map +7 -0
- package/esm/propTypes.js +55 -72
- package/esm/propTypes.js.map +7 -0
- package/package.json +12 -12
- package/types/DSQueryBuilder.d.ts +1 -32
|
@@ -1,111 +1,119 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var NestableItem_exports = {};
|
|
29
|
+
__export(NestableItem_exports, {
|
|
30
|
+
default: () => NestableItem_default
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_react = __toESM(require("react"));
|
|
34
|
+
var import_classnames = __toESM(require("classnames"));
|
|
35
|
+
const NestableItem = ({
|
|
36
|
+
item,
|
|
37
|
+
isCopy,
|
|
38
|
+
options,
|
|
39
|
+
index,
|
|
40
|
+
isAndItem,
|
|
41
|
+
isOrItem,
|
|
42
|
+
isDraggableItem,
|
|
43
|
+
singleRow
|
|
44
|
+
}) => {
|
|
45
|
+
const { dragItem, renderItem, handler, childrenProp } = options;
|
|
43
46
|
const isCollapsed = options.isCollapsed(item);
|
|
44
47
|
const isDragging = !isCopy && dragItem && dragItem.id === item.id;
|
|
45
48
|
const hasChildren = item[childrenProp] && item[childrenProp].length > 0;
|
|
46
49
|
let Handler;
|
|
47
|
-
const isOrGroup = item.element.type ===
|
|
48
|
-
const isAndGroup = item.element.type ===
|
|
50
|
+
const isOrGroup = item.element.type === "group" && (item.element.condition === "" || item.element.condition === false);
|
|
51
|
+
const isAndGroup = item.element.type === "group" && !(item.element.condition === "" || item.element.condition === false);
|
|
49
52
|
const itemProps = {
|
|
50
|
-
className:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
className: (0, import_classnames.default)(`nestable-item${isCopy ? "-copy" : ""}`, `nestable-item${isCopy ? "-copy" : ""}-${item.id}`, `nestable-item-type-${item.element.type}`, {
|
|
54
|
+
"is-or-group": isOrGroup,
|
|
55
|
+
"is-and-group": isAndGroup,
|
|
56
|
+
"is-and-filter": item.element.type === "filter" && isAndItem,
|
|
57
|
+
"is-or-filter": item.element.type === "filter" && isOrItem
|
|
55
58
|
}, {
|
|
56
|
-
|
|
59
|
+
"is-dragging": isDragging
|
|
57
60
|
})
|
|
58
61
|
};
|
|
59
62
|
let rowProps = {};
|
|
60
63
|
let handlerProps = {};
|
|
61
|
-
|
|
62
64
|
if (!isCopy) {
|
|
63
65
|
if (dragItem) {
|
|
64
|
-
rowProps =
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
rowProps = {
|
|
67
|
+
...rowProps,
|
|
68
|
+
onMouseEnter: (e) => options.onMouseEnter(e, item)
|
|
69
|
+
};
|
|
67
70
|
} else {
|
|
68
|
-
handlerProps =
|
|
71
|
+
handlerProps = {
|
|
72
|
+
...handlerProps,
|
|
69
73
|
draggable: isDraggableItem !== false,
|
|
70
|
-
onDragStart: e => options.onDragStart(e, item)
|
|
71
|
-
}
|
|
74
|
+
onDragStart: (e) => options.onDragStart(e, item)
|
|
75
|
+
};
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
|
-
|
|
75
78
|
if (handler) {
|
|
76
|
-
Handler =
|
|
77
|
-
className: "nestable-item-handler"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})); // Handler = React.cloneElement(handler, handlerProps);
|
|
79
|
+
Handler = /* @__PURE__ */ import_react.default.createElement("span", {
|
|
80
|
+
className: "nestable-item-handler",
|
|
81
|
+
...handlerProps
|
|
82
|
+
}, handler);
|
|
81
83
|
} else {
|
|
82
|
-
rowProps =
|
|
84
|
+
rowProps = {
|
|
85
|
+
...rowProps,
|
|
86
|
+
...handlerProps
|
|
87
|
+
};
|
|
83
88
|
}
|
|
84
|
-
|
|
85
89
|
const childLength = item[childrenProp].length;
|
|
86
|
-
let childClass =
|
|
87
|
-
if (childLength === 0)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
90
|
+
let childClass = "single";
|
|
91
|
+
if (childLength === 0)
|
|
92
|
+
childClass = "empty";
|
|
93
|
+
else if (childLength > 1)
|
|
94
|
+
childClass = "multiple";
|
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement("li", {
|
|
96
|
+
...itemProps
|
|
97
|
+
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
98
|
+
className: `nestable-item-name nestable-item-name--${item.element.type} `,
|
|
99
|
+
...rowProps
|
|
100
|
+
}, renderItem({
|
|
101
|
+
item,
|
|
102
|
+
handler: Handler,
|
|
103
|
+
index
|
|
104
|
+
})), hasChildren && item.element.type === "group" && !isCollapsed && /* @__PURE__ */ import_react.default.createElement("ol", {
|
|
105
|
+
className: `nestable-list nestable-child-count-${childClass} `
|
|
106
|
+
}, item[childrenProp].map((currentitem, i) => /* @__PURE__ */ import_react.default.createElement(NestableItem, {
|
|
107
|
+
key: i,
|
|
108
|
+
index: i,
|
|
109
|
+
isAndItem: isAndGroup,
|
|
110
|
+
isCopy,
|
|
111
|
+
isOrItem: isOrGroup,
|
|
112
|
+
item: currentitem,
|
|
113
|
+
options,
|
|
114
|
+
singleRow
|
|
115
|
+
}))));
|
|
109
116
|
};
|
|
110
|
-
|
|
111
|
-
module.exports =
|
|
117
|
+
var NestableItem_default = NestableItem;
|
|
118
|
+
module.exports = __toCommonJS(NestableItem_exports);
|
|
119
|
+
//# sourceMappingURL=NestableItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/Nestable/NestableItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\nimport React from 'react';\nimport cn from 'classnames';\n\nconst NestableItem = ({\n item,\n isCopy,\n options,\n index,\n isAndItem,\n isOrItem,\n isDraggableItem,\n singleRow,\n}) => {\n const { dragItem, renderItem, handler, childrenProp } = options;\n\n const isCollapsed = options.isCollapsed(item);\n const isDragging = !isCopy && dragItem && dragItem.id === item.id;\n const hasChildren = item[childrenProp] && item[childrenProp].length > 0;\n\n let Handler;\n const isOrGroup =\n item.element.type === 'group' &&\n (item.element.condition === '' || item.element.condition === false);\n const isAndGroup =\n item.element.type === 'group' &&\n !(item.element.condition === '' || item.element.condition === false);\n\n const itemProps = {\n className: cn(\n `nestable-item${isCopy ? '-copy' : ''}`,\n `nestable-item${isCopy ? '-copy' : ''}-${item.id}`,\n `nestable-item-type-${item.element.type}`,\n {\n 'is-or-group': isOrGroup,\n 'is-and-group': isAndGroup,\n 'is-and-filter': item.element.type === 'filter' && isAndItem,\n 'is-or-filter': item.element.type === 'filter' && isOrItem,\n },\n {\n 'is-dragging': isDragging,\n },\n ),\n };\n\n let rowProps = {};\n let handlerProps = {};\n if (!isCopy) {\n if (dragItem) {\n rowProps = {\n ...rowProps,\n onMouseEnter: e => options.onMouseEnter(e, item),\n };\n } else {\n handlerProps = {\n ...handlerProps,\n draggable: isDraggableItem !== false,\n onDragStart: e => options.onDragStart(e, item),\n };\n }\n }\n\n if (handler) {\n Handler = (\n <span className=\"nestable-item-handler\" {...handlerProps}>\n {handler}\n </span>\n );\n // Handler = React.cloneElement(handler, handlerProps);\n } else {\n rowProps = {\n ...rowProps,\n ...handlerProps,\n };\n }\n\n const childLength = item[childrenProp].length;\n let childClass = 'single';\n if (childLength === 0) childClass = 'empty';\n else if (childLength > 1) childClass = 'multiple';\n\n return (\n <li {...itemProps}>\n <div\n className={`nestable-item-name nestable-item-name--${item.element.type} `}\n {...rowProps}\n >\n {renderItem({\n item,\n handler: Handler,\n index,\n })}\n </div>\n {hasChildren && item.element.type === 'group' && !isCollapsed && (\n <ol className={`nestable-list nestable-child-count-${childClass} `}>\n {item[childrenProp].map((currentitem, i) => (\n <NestableItem\n key={i}\n index={i}\n isAndItem={isAndGroup}\n isCopy={isCopy}\n isOrItem={isOrGroup}\n item={currentitem}\n options={options}\n singleRow={singleRow}\n />\n ))}\n </ol>\n )}\n </li>\n );\n};\n\nexport default NestableItem;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAe;AAEf,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACI;AACJ,QAAM,EAAE,UAAU,YAAY,SAAS,iBAAiB;AAExD,QAAM,cAAc,QAAQ,YAAY;AACxC,QAAM,aAAa,CAAC,UAAU,YAAY,SAAS,OAAO,KAAK;AAC/D,QAAM,cAAc,KAAK,iBAAiB,KAAK,cAAc,SAAS;AAEtE,MAAI;AACJ,QAAM,YACJ,KAAK,QAAQ,SAAS,WACrB,MAAK,QAAQ,cAAc,MAAM,KAAK,QAAQ,cAAc;AAC/D,QAAM,aACJ,KAAK,QAAQ,SAAS,WACtB,CAAE,MAAK,QAAQ,cAAc,MAAM,KAAK,QAAQ,cAAc;AAEhE,QAAM,YAAY;AAAA,IAChB,WAAW,+BACT,gBAAgB,SAAS,UAAU,MACnC,gBAAgB,SAAS,UAAU,MAAM,KAAK,MAC9C,sBAAsB,KAAK,QAAQ,QACnC;AAAA,MACE,eAAe;AAAA,MACf,gBAAgB;AAAA,MAChB,iBAAiB,KAAK,QAAQ,SAAS,YAAY;AAAA,MACnD,gBAAgB,KAAK,QAAQ,SAAS,YAAY;AAAA,OAEpD;AAAA,MACE,eAAe;AAAA;AAAA;AAKrB,MAAI,WAAW;AACf,MAAI,eAAe;AACnB,MAAI,CAAC,QAAQ;AACX,QAAI,UAAU;AACZ,iBAAW;AAAA,WACN;AAAA,QACH,cAAc,OAAK,QAAQ,aAAa,GAAG;AAAA;AAAA,WAExC;AACL,qBAAe;AAAA,WACV;AAAA,QACH,WAAW,oBAAoB;AAAA,QAC/B,aAAa,OAAK,QAAQ,YAAY,GAAG;AAAA;AAAA;AAAA;AAK/C,MAAI,SAAS;AACX,cACE,mDAAC,QAAD;AAAA,MAAM,WAAU;AAAA,SAA4B;AAAA,OACzC;AAAA,SAIA;AACL,eAAW;AAAA,SACN;AAAA,SACA;AAAA;AAAA;AAIP,QAAM,cAAc,KAAK,cAAc;AACvC,MAAI,aAAa;AACjB,MAAI,gBAAgB;AAAG,iBAAa;AAAA,WAC3B,cAAc;AAAG,iBAAa;AAEvC,SACE,mDAAC,MAAD;AAAA,OAAQ;AAAA,KACN,mDAAC,OAAD;AAAA,IACE,WAAW,0CAA0C,KAAK,QAAQ;AAAA,OAC9D;AAAA,KAEH,WAAW;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT;AAAA,OAGH,eAAe,KAAK,QAAQ,SAAS,WAAW,CAAC,eAChD,mDAAC,MAAD;AAAA,IAAI,WAAW,sCAAsC;AAAA,KAClD,KAAK,cAAc,IAAI,CAAC,aAAa,MACpC,mDAAC,cAAD;AAAA,IACE,KAAK;AAAA,IACL,OAAO;AAAA,IACP,WAAW;AAAA,IACX;AAAA,IACA,UAAU;AAAA,IACV,MAAM;AAAA,IACN;AAAA,IACA;AAAA;AAAA;AASd,IAAO,uBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,99 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var events_exports = {};
|
|
29
|
+
__export(events_exports, {
|
|
30
|
+
onDragEnd: () => onDragEnd,
|
|
31
|
+
onDragStart: () => onDragStart,
|
|
32
|
+
onKeyDown: () => onKeyDown,
|
|
33
|
+
onMouseEnter: () => onMouseEnter,
|
|
34
|
+
onMouseMove: () => onMouseMove,
|
|
35
|
+
onToggleCollapse: () => onToggleCollapse
|
|
36
|
+
});
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_utils = require("@elliemae/ds-shared/utils");
|
|
20
39
|
function onDragStart(e, item) {
|
|
21
40
|
if (e) {
|
|
22
41
|
e.preventDefault();
|
|
23
42
|
e.stopPropagation();
|
|
24
43
|
}
|
|
25
|
-
|
|
26
|
-
this.el = utils.closest(e.target, '.nestable-item');
|
|
44
|
+
this.el = (0, import_utils.closest)(e.target, ".nestable-item");
|
|
27
45
|
this.startTrackMouse();
|
|
28
46
|
this.onMouseMove(e);
|
|
29
|
-
const {
|
|
30
|
-
items
|
|
31
|
-
} = this.state;
|
|
47
|
+
const { items } = this.state;
|
|
32
48
|
this.setState({
|
|
33
49
|
dragItem: item,
|
|
34
50
|
itemsOld: items
|
|
35
51
|
});
|
|
36
52
|
}
|
|
37
53
|
function onDragEnd(e, isCancel) {
|
|
38
|
-
if (e && e.preventDefault)
|
|
54
|
+
if (e && e.preventDefault)
|
|
55
|
+
e.preventDefault();
|
|
39
56
|
this.stopTrackMouse();
|
|
40
|
-
this.el = null;
|
|
41
|
-
|
|
42
|
-
const {
|
|
43
|
-
items
|
|
44
|
-
} = this.state;
|
|
57
|
+
this.el = null;
|
|
58
|
+
const { items } = this.state;
|
|
45
59
|
const nestedInFilter = this.checkFilterChildren(items);
|
|
46
|
-
if (nestedInFilter)
|
|
60
|
+
if (nestedInFilter)
|
|
61
|
+
return this.dragRevert();
|
|
47
62
|
return isCancel ? this.dragRevert() : this.dragApply();
|
|
48
63
|
}
|
|
49
64
|
function onMouseMove(e) {
|
|
50
|
-
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const {
|
|
55
|
-
dragItem
|
|
56
|
-
} = this.state;
|
|
57
|
-
const {
|
|
58
|
-
clientX,
|
|
59
|
-
clientY
|
|
60
|
-
} = e;
|
|
61
|
-
const transformProps = utils.getTransformProps(clientX, clientY);
|
|
62
|
-
const elCopy = document.querySelector(".nestable-".concat(group, " .nestable-drag-layer > .nestable-list"));
|
|
63
|
-
|
|
65
|
+
const { group, threshold } = this.props;
|
|
66
|
+
const { dragItem } = this.state;
|
|
67
|
+
const { clientX, clientY } = e;
|
|
68
|
+
const transformProps = (0, import_utils.getTransformProps)(clientX, clientY);
|
|
69
|
+
const elCopy = document.querySelector(`.nestable-${group} .nestable-drag-layer > .nestable-list`);
|
|
64
70
|
if (!this.elCopyStyles) {
|
|
65
|
-
const offset =
|
|
66
|
-
const scroll =
|
|
67
|
-
this.elCopyStyles =
|
|
71
|
+
const offset = (0, import_utils.getOffsetRect)(this.el);
|
|
72
|
+
const scroll = (0, import_utils.getTotalScroll)(this.el);
|
|
73
|
+
this.elCopyStyles = {
|
|
68
74
|
marginTop: offset.top - clientY - scroll.top,
|
|
69
|
-
marginLeft: offset.left - clientX - scroll.left
|
|
70
|
-
|
|
75
|
+
marginLeft: offset.left - clientX - scroll.left,
|
|
76
|
+
...transformProps
|
|
77
|
+
};
|
|
71
78
|
} else {
|
|
72
|
-
this.elCopyStyles =
|
|
73
|
-
|
|
79
|
+
this.elCopyStyles = {
|
|
80
|
+
...this.elCopyStyles,
|
|
81
|
+
...transformProps
|
|
82
|
+
};
|
|
74
83
|
for (const key in transformProps) {
|
|
75
84
|
if (transformProps.hasOwnProperty(key)) {
|
|
76
85
|
elCopy.style[key] = transformProps[key];
|
|
77
86
|
}
|
|
78
87
|
}
|
|
79
|
-
|
|
80
88
|
const diffX = clientX - this.mouse.last.x;
|
|
81
|
-
|
|
82
89
|
if (diffX >= 0 && this.mouse.shift.x >= 0 || diffX <= 0 && this.mouse.shift.x <= 0) {
|
|
83
90
|
this.mouse.shift.x += diffX;
|
|
84
91
|
} else {
|
|
85
92
|
this.mouse.shift.x = 0;
|
|
86
93
|
}
|
|
87
|
-
|
|
88
94
|
this.mouse.last.x = clientX;
|
|
89
|
-
|
|
90
95
|
if (Math.abs(this.mouse.shift.x) > threshold) {
|
|
91
96
|
if (this.mouse.shift.x > 0) {
|
|
92
97
|
this.tryIncreaseDepth(dragItem);
|
|
93
98
|
} else {
|
|
94
99
|
this.tryDecreaseDepth(dragItem);
|
|
95
100
|
}
|
|
96
|
-
|
|
97
101
|
this.mouse.shift.x = 0;
|
|
98
102
|
}
|
|
99
103
|
}
|
|
@@ -103,64 +107,37 @@ function onMouseEnter(e, item) {
|
|
|
103
107
|
e.preventDefault();
|
|
104
108
|
e.stopPropagation();
|
|
105
109
|
}
|
|
106
|
-
|
|
107
|
-
const {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} = this.props;
|
|
111
|
-
const {
|
|
112
|
-
dragItem
|
|
113
|
-
} = this.state;
|
|
114
|
-
if (dragItem.id === item.id) return;
|
|
110
|
+
const { collapsed, childrenProp } = this.props;
|
|
111
|
+
const { dragItem } = this.state;
|
|
112
|
+
if (dragItem.id === item.id)
|
|
113
|
+
return;
|
|
115
114
|
const pathFrom = this.getPathById(dragItem.id);
|
|
116
|
-
const pathTo = this.getPathById(item.id);
|
|
117
|
-
// and move last (by count) child
|
|
118
|
-
// remove parent node from list of open nodes
|
|
119
|
-
|
|
115
|
+
const pathTo = this.getPathById(item.id);
|
|
120
116
|
let collapseProps = {};
|
|
121
|
-
|
|
122
117
|
if (collapsed && pathFrom.length > 1) {
|
|
123
118
|
const parent = this.getItemByPath(pathFrom.slice(0, -1));
|
|
124
|
-
|
|
125
119
|
if (parent[childrenProp].length === 1) {
|
|
126
120
|
collapseProps = this.onToggleCollapse(parent, true);
|
|
127
121
|
}
|
|
128
122
|
}
|
|
129
|
-
|
|
130
|
-
this.moveItem({
|
|
131
|
-
dragItem,
|
|
132
|
-
pathFrom,
|
|
133
|
-
pathTo
|
|
134
|
-
}, collapseProps);
|
|
123
|
+
this.moveItem({ dragItem, pathFrom, pathTo }, collapseProps);
|
|
135
124
|
}
|
|
136
125
|
function onToggleCollapse(item, isGetter) {
|
|
137
|
-
const {
|
|
138
|
-
|
|
139
|
-
} = this.props;
|
|
140
|
-
const {
|
|
141
|
-
collapsedGroups
|
|
142
|
-
} = this.state;
|
|
126
|
+
const { collapsed } = this.props;
|
|
127
|
+
const { collapsedGroups } = this.state;
|
|
143
128
|
const isCollapsed = this.isCollapsed(item);
|
|
144
129
|
const newState = {
|
|
145
|
-
collapsedGroups: isCollapsed ^ collapsed ? collapsedGroups.filter(id => id !== item.id) : collapsedGroups.concat(item.id)
|
|
130
|
+
collapsedGroups: isCollapsed ^ collapsed ? collapsedGroups.filter((id) => id !== item.id) : collapsedGroups.concat(item.id)
|
|
146
131
|
};
|
|
147
|
-
|
|
148
132
|
if (isGetter) {
|
|
149
133
|
return newState;
|
|
150
134
|
}
|
|
151
|
-
|
|
152
135
|
return this.setState(newState);
|
|
153
136
|
}
|
|
154
137
|
function onKeyDown(e) {
|
|
155
138
|
if (e.which === 27) {
|
|
156
|
-
// ESC
|
|
157
139
|
this.onDragEnd(null, true);
|
|
158
140
|
}
|
|
159
141
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
exports.onDragStart = onDragStart;
|
|
163
|
-
exports.onKeyDown = onKeyDown;
|
|
164
|
-
exports.onMouseEnter = onMouseEnter;
|
|
165
|
-
exports.onMouseMove = onMouseMove;
|
|
166
|
-
exports.onToggleCollapse = onToggleCollapse;
|
|
142
|
+
module.exports = __toCommonJS(events_exports);
|
|
143
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/Nestable/actions/events.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-bitwise, no-loops/no-loops, max-lines, max-statements, no-restricted-syntax, no-prototype-builtins */\nimport {\n closest,\n getOffsetRect,\n getTotalScroll,\n getTransformProps,\n} from '@elliemae/ds-shared/utils';\n\nexport function onDragStart(e, item) {\n if (e) {\n e.preventDefault();\n e.stopPropagation();\n }\n this.el = closest(e.target, '.nestable-item');\n this.startTrackMouse();\n this.onMouseMove(e);\n const { items } = this.state;\n this.setState({\n dragItem: item,\n itemsOld: items,\n });\n}\n\nexport function onDragEnd(e, isCancel) {\n if (e && e.preventDefault) e.preventDefault();\n\n this.stopTrackMouse();\n this.el = null;\n\n // check if filter has children\n const { items } = this.state;\n const nestedInFilter = this.checkFilterChildren(items);\n if (nestedInFilter) return this.dragRevert();\n\n return isCancel ? this.dragRevert() : this.dragApply();\n}\n\nexport function onMouseMove(e) {\n const { group, threshold } = this.props;\n const { dragItem } = this.state;\n const { clientX, clientY } = e;\n const transformProps = getTransformProps(clientX, clientY);\n const elCopy = document.querySelector(\n `.nestable-${group} .nestable-drag-layer > .nestable-list`,\n );\n if (!this.elCopyStyles) {\n const offset = getOffsetRect(this.el);\n const scroll = getTotalScroll(this.el);\n\n this.elCopyStyles = {\n marginTop: offset.top - clientY - scroll.top,\n marginLeft: offset.left - clientX - scroll.left,\n ...transformProps,\n };\n } else {\n this.elCopyStyles = {\n ...this.elCopyStyles,\n ...transformProps,\n };\n for (const key in transformProps) {\n if (transformProps.hasOwnProperty(key)) {\n elCopy.style[key] = transformProps[key];\n }\n }\n const diffX = clientX - this.mouse.last.x;\n if (\n (diffX >= 0 && this.mouse.shift.x >= 0) ||\n (diffX <= 0 && this.mouse.shift.x <= 0)\n ) {\n this.mouse.shift.x += diffX;\n } else {\n this.mouse.shift.x = 0;\n }\n this.mouse.last.x = clientX;\n if (Math.abs(this.mouse.shift.x) > threshold) {\n if (this.mouse.shift.x > 0) {\n this.tryIncreaseDepth(dragItem);\n } else {\n this.tryDecreaseDepth(dragItem);\n }\n this.mouse.shift.x = 0;\n }\n }\n}\nexport function onMouseEnter(e, item) {\n if (e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n const { collapsed, childrenProp } = this.props;\n const { dragItem } = this.state;\n if (dragItem.id === item.id) return;\n\n const pathFrom = this.getPathById(dragItem.id);\n const pathTo = this.getPathById(item.id);\n\n // if collapsed by default\n // and move last (by count) child\n // remove parent node from list of open nodes\n let collapseProps = {};\n if (collapsed && pathFrom.length > 1) {\n const parent = this.getItemByPath(pathFrom.slice(0, -1));\n if (parent[childrenProp].length === 1) {\n collapseProps = this.onToggleCollapse(parent, true);\n }\n }\n\n this.moveItem({ dragItem, pathFrom, pathTo }, collapseProps);\n}\n\nexport function onToggleCollapse(item, isGetter) {\n const { collapsed } = this.props;\n const { collapsedGroups } = this.state;\n const isCollapsed = this.isCollapsed(item);\n\n const newState = {\n collapsedGroups:\n isCollapsed ^ collapsed\n ? collapsedGroups.filter(id => id !== item.id)\n : collapsedGroups.concat(item.id),\n };\n\n if (isGetter) {\n return newState;\n }\n return this.setState(newState);\n}\nexport function onKeyDown(e) {\n if (e.which === 27) {\n // ESC\n this.onDragEnd(null, true);\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var getItemOptions_exports = {};
|
|
29
|
+
__export(getItemOptions_exports, {
|
|
30
|
+
getItemOptions: () => getItemOptions
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
5
33
|
function getItemOptions() {
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
renderCollapseIcon,
|
|
9
|
-
handler,
|
|
10
|
-
childrenProp
|
|
11
|
-
} = this.props;
|
|
12
|
-
const {
|
|
13
|
-
dragItem
|
|
14
|
-
} = this.state;
|
|
34
|
+
const { renderItem, renderCollapseIcon, handler, childrenProp } = this.props;
|
|
35
|
+
const { dragItem } = this.state;
|
|
15
36
|
return {
|
|
16
37
|
dragItem,
|
|
17
38
|
childrenProp,
|
|
@@ -24,5 +45,5 @@ function getItemOptions() {
|
|
|
24
45
|
onToggleCollapse: this.onToggleCollapse
|
|
25
46
|
};
|
|
26
47
|
}
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
module.exports = __toCommonJS(getItemOptions_exports);
|
|
49
|
+
//# sourceMappingURL=getItemOptions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/Nestable/actions/getItemOptions.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export function getItemOptions() {\n const { renderItem, renderCollapseIcon, handler, childrenProp } = this.props;\n const { dragItem } = this.state;\n\n return {\n dragItem,\n childrenProp,\n renderItem,\n renderCollapseIcon,\n handler,\n\n onDragStart: this.onDragStart,\n onMouseEnter: this.onMouseEnter,\n isCollapsed: this.isCollapsed,\n onToggleCollapse: this.onToggleCollapse,\n };\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,0BAA0B;AAC/B,QAAM,EAAE,YAAY,oBAAoB,SAAS,iBAAiB,KAAK;AACvE,QAAM,EAAE,aAAa,KAAK;AAE1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA,aAAa,KAAK;AAAA,IAClB,cAAc,KAAK;AAAA,IACnB,aAAa,KAAK;AAAA,IAClB,kBAAkB,KAAK;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|