@elliemae/ds-query-builder 3.0.0-next.44 → 3.0.0-next.47
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 +9 -16
- package/dist/cjs/DSQueryBuilder.js.map +1 -1
- package/dist/cjs/components/AndOrController/AndOrController.js +9 -16
- package/dist/cjs/components/AndOrController/AndOrController.js.map +1 -1
- package/dist/cjs/components/ConditionController/ConditionController.js +9 -16
- package/dist/cjs/components/ConditionController/ConditionController.js.map +1 -1
- package/dist/cjs/components/DisplayOutput/DisplayOutput.js +9 -16
- package/dist/cjs/components/DisplayOutput/DisplayOutput.js.map +1 -1
- package/dist/cjs/components/DragContainerController/DragContainerController.js +9 -16
- package/dist/cjs/components/DragContainerController/DragContainerController.js.map +1 -1
- package/dist/cjs/components/DragControllerRow/DragControllerRow.js +9 -16
- package/dist/cjs/components/DragControllerRow/DragControllerRow.js.map +1 -1
- package/dist/cjs/components/FieldControllerRow/FieldControllerRow.js +9 -16
- package/dist/cjs/components/FieldControllerRow/FieldControllerRow.js.map +1 -1
- package/dist/cjs/components/Nestable/Nestable.js +9 -16
- package/dist/cjs/components/Nestable/Nestable.js.map +1 -1
- package/dist/cjs/components/Nestable/NestableItem.js +9 -16
- package/dist/cjs/components/Nestable/NestableItem.js.map +1 -1
- package/dist/cjs/components/Nestable/actions/events.js +9 -16
- package/dist/cjs/components/Nestable/actions/events.js.map +1 -1
- package/dist/cjs/components/Nestable/actions/getItemOptions.js +9 -16
- package/dist/cjs/components/Nestable/actions/getItemOptions.js.map +1 -1
- package/dist/cjs/components/Nestable/actions/getPaths.js +9 -16
- package/dist/cjs/components/Nestable/actions/getPaths.js.map +1 -1
- package/dist/cjs/components/Nestable/actions/index.js +13 -19
- package/dist/cjs/components/Nestable/actions/index.js.map +1 -1
- package/dist/cjs/components/Nestable/actions/moveItem.js +9 -16
- package/dist/cjs/components/Nestable/actions/moveItem.js.map +1 -1
- package/dist/cjs/components/Nestable/actions/paths.js +9 -16
- package/dist/cjs/components/Nestable/actions/paths.js.map +1 -1
- package/dist/cjs/components/Nestable/actions/tryDecreaseDepth.js +9 -16
- package/dist/cjs/components/Nestable/actions/tryDecreaseDepth.js.map +1 -1
- package/dist/cjs/components/Nestable/actions/tryIncreaseDepth.js +9 -16
- package/dist/cjs/components/Nestable/actions/tryIncreaseDepth.js.map +1 -1
- package/dist/cjs/components/Nestable/index.js +9 -16
- package/dist/cjs/components/Nestable/index.js.map +1 -1
- package/dist/cjs/components/QueryBuilderContext/QueryBuilderContext.js +9 -16
- package/dist/cjs/components/QueryBuilderContext/QueryBuilderContext.js.map +1 -1
- package/dist/cjs/components/QueryBuilderImpl.js +9 -16
- package/dist/cjs/components/QueryBuilderImpl.js.map +1 -1
- package/dist/cjs/components/QueryBuilderItem/QueryBuilderItem.js +9 -16
- package/dist/cjs/components/QueryBuilderItem/QueryBuilderItem.js.map +1 -1
- package/dist/cjs/components/QueryBuilderRow/QueryBuilderRow.js +9 -16
- package/dist/cjs/components/QueryBuilderRow/QueryBuilderRow.js.map +1 -1
- package/dist/cjs/components/ToolBarAnimation/ToolBarAnimation.js +9 -16
- package/dist/cjs/components/ToolBarAnimation/ToolBarAnimation.js.map +1 -1
- package/dist/cjs/components/format/format.js +9 -16
- package/dist/cjs/components/format/format.js.map +1 -1
- package/dist/cjs/components/format/sqlFormat.js +9 -16
- package/dist/cjs/components/format/sqlFormat.js.map +1 -1
- package/dist/cjs/components/format/sqlSafeFormat.js +9 -16
- package/dist/cjs/components/format/sqlSafeFormat.js.map +1 -1
- package/dist/cjs/components/format/xmlFormat.js +9 -16
- package/dist/cjs/components/format/xmlFormat.js.map +1 -1
- package/dist/cjs/components/helpers/actions.js +9 -16
- package/dist/cjs/components/helpers/actions.js.map +1 -1
- package/dist/cjs/components/helpers/constants.js +9 -16
- package/dist/cjs/components/helpers/constants.js.map +1 -1
- package/dist/cjs/components/helpers/dependencies.js +9 -16
- package/dist/cjs/components/helpers/dependencies.js.map +1 -1
- package/dist/cjs/components/helpers/selectors.js +9 -16
- package/dist/cjs/components/helpers/selectors.js.map +1 -1
- package/dist/cjs/components/helpers/store.js +9 -16
- package/dist/cjs/components/helpers/store.js.map +1 -1
- package/dist/cjs/components/helpers/types.js +9 -16
- package/dist/cjs/components/helpers/types.js.map +1 -1
- package/dist/cjs/index.js +11 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/propTypes.js +9 -16
- package/dist/cjs/propTypes.js.map +1 -1
- package/package.json +12 -12
|
@@ -21,31 +21,25 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __export = (target, all) => {
|
|
26
25
|
for (var name in all)
|
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
27
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return to;
|
|
36
35
|
};
|
|
37
|
-
var __toESM = (
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
-
return (module2, temp) => {
|
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
-
};
|
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
38
|
var NestableItem_exports = {};
|
|
46
39
|
__export(NestableItem_exports, {
|
|
47
40
|
default: () => NestableItem_default
|
|
48
41
|
});
|
|
42
|
+
module.exports = __toCommonJS(NestableItem_exports);
|
|
49
43
|
var React = __toESM(require("react"));
|
|
50
44
|
var import_react = __toESM(require("react"));
|
|
51
45
|
var import_classnames = __toESM(require("classnames"));
|
|
@@ -123,5 +117,4 @@ const NestableItem = ({
|
|
|
123
117
|
}))));
|
|
124
118
|
};
|
|
125
119
|
var NestableItem_default = NestableItem;
|
|
126
|
-
module.exports = __toCommonJS(NestableItem_exports);
|
|
127
120
|
//# sourceMappingURL=NestableItem.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/Nestable/NestableItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAe;AAEf,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AAA,EAGJ,OAAO;AACL,eAAW,kCACN,WACA;AAAA,EAEP;AAEA,QAAM,cAAc,KAAK,cAAc;AACvC,MAAI,aAAa;AACjB,MAAI,gBAAgB;AAAG,iBAAa;AAAA,WAC3B,cAAc;AAAG,iBAAa;AAEvC,SACE,mDAAC,yBAAO,YACN,mDAAC;AAAA,IACC,WAAW,0CAA0C,KAAK,QAAQ;AAAA,KAC9D,WAEH,WAAW;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT;AAAA,EACF,CAAC,CACH,GACC,eAAe,KAAK,QAAQ,SAAS,WAAW,CAAC,eAChD,mDAAC;AAAA,IAAG,WAAW,sCAAsC;AAAA,KAClD,KAAK,cAAc,IAAI,CAAC,aAAa,MACpC,mDAAC;AAAA,IACC,KAAK;AAAA,IACL,OAAO;AAAA,IACP,WAAW;AAAA,IACX;AAAA,IACA,UAAU;AAAA,IACV,MAAM;AAAA,IACN;AAAA,IACA;AAAA,GACF,CACD,CACH,CAEJ;AAEJ;AAEA,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,27 +18,20 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
}
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __export = (target, all) => {
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return to;
|
|
33
32
|
};
|
|
34
|
-
var __toESM = (
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
-
return (module2, temp) => {
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var events_exports = {};
|
|
43
36
|
__export(events_exports, {
|
|
44
37
|
onDragEnd: () => onDragEnd,
|
|
@@ -48,6 +41,7 @@ __export(events_exports, {
|
|
|
48
41
|
onMouseMove: () => onMouseMove,
|
|
49
42
|
onToggleCollapse: () => onToggleCollapse
|
|
50
43
|
});
|
|
44
|
+
module.exports = __toCommonJS(events_exports);
|
|
51
45
|
var React = __toESM(require("react"));
|
|
52
46
|
var import_ds_shared = require("@elliemae/ds-shared");
|
|
53
47
|
function onDragStart(e, item) {
|
|
@@ -149,5 +143,4 @@ function onKeyDown(e) {
|
|
|
149
143
|
this.onDragEnd(null, true);
|
|
150
144
|
}
|
|
151
145
|
}
|
|
152
|
-
module.exports = __toCommonJS(events_exports);
|
|
153
146
|
//# sourceMappingURL=events.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/Nestable/actions/events.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-bitwise, no-loops/no-loops, max-lines, max-statements, no-restricted-syntax, no-prototype-builtins */\nimport { closest, getOffsetRect, getTotalScroll, getTransformProps } from '@elliemae/ds-shared';\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(`.nestable-${group} .nestable-drag-layer > .nestable-list`);\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 ((diffX >= 0 && this.mouse.shift.x >= 0) || (diffX <= 0 && this.mouse.shift.x <= 0)) {\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 ? collapsedGroups.filter((id) => id !== item.id) : 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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAA0E;AAEnE,qBAAqB,GAAG,MAAM;AACnC,MAAI,GAAG;AACL,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAAA,EACpB;AACA,OAAK,KAAK,8BAAQ,EAAE,QAAQ,gBAAgB;AAC5C,OAAK,gBAAgB;AACrB,OAAK,YAAY,CAAC;AAClB,QAAM,EAAE,UAAU,KAAK;AACvB,OAAK,SAAS;AAAA,IACZ,UAAU;AAAA,IACV,UAAU;AAAA,EACZ,CAAC;AACH;AAEO,mBAAmB,GAAG,UAAU;AACrC,MAAI,KAAK,EAAE;AAAgB,MAAE,eAAe;AAE5C,OAAK,e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rototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var getItemOptions_exports = {};
|
|
29
22
|
__export(getItemOptions_exports, {
|
|
30
23
|
getItemOptions: () => getItemOptions
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(getItemOptions_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
function getItemOptions() {
|
|
34
28
|
const { renderItem, renderCollapseIcon, handler, childrenProp } = this.props;
|
|
@@ -45,5 +39,4 @@ function getItemOptions() {
|
|
|
45
39
|
onToggleCollapse: this.onToggleCollapse
|
|
46
40
|
};
|
|
47
41
|
}
|
|
48
|
-
module.exports = __toCommonJS(getItemOptions_exports);
|
|
49
42
|
//# sourceMappingURL=getItemOptions.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/Nestable/actions/getItemOptions.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;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,EACzB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var getPaths_exports = {};
|
|
29
22
|
__export(getPaths_exports, {
|
|
30
23
|
getItemByPath: () => getItemByPath,
|
|
@@ -33,6 +26,7 @@ __export(getPaths_exports, {
|
|
|
33
26
|
getRealNextPath: () => getRealNextPath,
|
|
34
27
|
getSplicePath: () => getSplicePath
|
|
35
28
|
});
|
|
29
|
+
module.exports = __toCommonJS(getPaths_exports);
|
|
36
30
|
var React = __toESM(require("react"));
|
|
37
31
|
function getRealNextPath(prevPath, nextPath) {
|
|
38
32
|
const { childrenProp } = this.props;
|
|
@@ -115,5 +109,4 @@ function getSplicePath(path, options = {}) {
|
|
|
115
109
|
});
|
|
116
110
|
return splicePath;
|
|
117
111
|
}
|
|
118
|
-
module.exports = __toCommonJS(getPaths_exports);
|
|
119
112
|
//# sourceMappingURL=getPaths.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/Nestable/actions/getPaths.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export function getRealNextPath(prevPath, nextPath) {\n const { childrenProp } = this.props;\n const ppLastIndex = prevPath.length - 1;\n const npLastIndex = nextPath.length - 1;\n\n if (prevPath.length < nextPath.length) {\n // move into deep\n let wasShifted = false;\n\n return nextPath.map((nextIndex, i) => {\n if (wasShifted) {\n return i === npLastIndex ? nextIndex + 1 : nextIndex;\n }\n\n if (typeof prevPath[i] !== 'number') {\n return nextIndex;\n }\n\n if (nextPath[i] > prevPath[i] && i === ppLastIndex) {\n wasShifted = true;\n return nextIndex - 1;\n }\n\n return nextIndex;\n });\n }\n\n if (prevPath.length === nextPath.length) {\n // if move bottom + move to item with children => make it a first child instead of swap\n if (nextPath[npLastIndex] > prevPath[npLastIndex]) {\n const target = this.getItemByPath(nextPath);\n\n if (\n target[childrenProp] &&\n target[childrenProp].length &&\n !this.isCollapsed(target)\n ) {\n return nextPath\n .slice(0, -1)\n .concat(nextPath[npLastIndex] - 1)\n .concat(0);\n }\n }\n }\n\n return nextPath;\n}\n\nexport function getPathById(id, items) {\n const { childrenProp } = this.props;\n let path = [];\n\n items.every((item, i) => {\n if (item.id === id) {\n path.push(i);\n } else if (item[childrenProp]) {\n const childrenPath = this.getPathById(id, item[childrenProp]);\n\n if (childrenPath.length) {\n path = path.concat(i).concat(childrenPath);\n }\n }\n\n return path.length === 0;\n });\n\n return path;\n}\n\nexport function getItemByPath(path, items) {\n const { childrenProp } = this.props;\n let item = null;\n\n path.forEach(index => {\n const list = item ? item[childrenProp] : items;\n item = list[index];\n });\n\n return item;\n}\nexport function getItemDepth(item) {\n const { childrenProp } = this.props;\n let level = 1;\n\n if (item[childrenProp].length > 0) {\n const childrenDepths = item[childrenProp].map(this.getItemDepth);\n level += Math.max(...childrenDepths);\n }\n\n return level;\n}\nexport function getSplicePath(path, options = {}) {\n const splicePath = {};\n const numToRemove = options.numToRemove || 0;\n const itemsToInsert = options.itemsToInsert || [];\n const lastIndex = path.length - 1;\n let currentPath = splicePath;\n\n path.forEach((index, i) => {\n if (i === lastIndex) {\n currentPath.$splice = [[index, numToRemove, ...itemsToInsert]];\n } else {\n const nextPath = {};\n currentPath[index] = { [options.childrenProp]: nextPath };\n currentPath = nextPath;\n }\n });\n\n return splicePath;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,yBAAyB,UAAU,UAAU;AAClD,QAAM,EAAE,iBAAiB,KAAK;AAC9B,QAAM,cAAc,SAAS,SAAS;AACtC,QAAM,cAAc,SAAS,SAAS;AAEtC,MAAI,SAAS,SAAS,SAAS,QAAQ;AAErC,QAAI,aAAa;AAEjB,WAAO,SAAS,IAAI,CAAC,WAAW,MAAM;AACpC,UAAI,YAAY;AACd,eAAO,MAAM,cAAc,YAAY,IAAI;AAAA,MAC7C;AAEA,UAAI,OAAO,SAAS,OAAO,UAAU;AACnC,eAAO;AAAA,MACT;AAEA,UAAI,SAAS,KAAK,SAAS,MAAM,MAAM,aAAa;AA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AuB,MAAM,UAAU,CAAC,GAAG;AAChD,QAAM,aAAa,CAAC;AACpB,QAAM,cAAc,QAAQ,eAAe;AAC3C,QAAM,gBAAgB,QAAQ,iBAAiB,CAAC;AAChD,QAAM,YAAY,KAAK,SAAS;AAChC,MAAI,cAAc;AAElB,OAAK,QAAQ,CAAC,OAAO,MAAM;AACzB,QAAI,MAAM,WAAW;AACnB,kBAAY,UAAU,CAAC,CAAC,OAAO,aAAa,GAAG,aAAa,CAAC;AAAA,IAC/D,OAAO;AACL,YAAM,WAAW,CAAC;AAClB,kBAAY,SAAS,GAAG,QAAQ,eAAe,SAAS;AACxD,oBAAc;AAAA,IAChB;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,39 +4,33 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
22
|
var actions_exports = {};
|
|
29
23
|
__export(actions_exports, {
|
|
30
24
|
moveItem: () => import_moveItem.moveItem,
|
|
31
25
|
tryDecreaseDepth: () => import_tryDecreaseDepth.tryDecreaseDepth,
|
|
32
26
|
tryIncreaseDepth: () => import_tryIncreaseDepth.tryIncreaseDepth
|
|
33
27
|
});
|
|
28
|
+
module.exports = __toCommonJS(actions_exports);
|
|
34
29
|
var React = __toESM(require("react"));
|
|
35
30
|
var import_tryIncreaseDepth = require("./tryIncreaseDepth");
|
|
36
31
|
var import_tryDecreaseDepth = require("./tryDecreaseDepth");
|
|
37
32
|
var import_moveItem = require("./moveItem");
|
|
38
|
-
__reExport(actions_exports, require("./paths"));
|
|
39
|
-
__reExport(actions_exports, require("./events"));
|
|
40
|
-
__reExport(actions_exports, require("./getItemOptions"));
|
|
41
|
-
module.exports = __toCommonJS(actions_exports);
|
|
33
|
+
__reExport(actions_exports, require("./paths"), module.exports);
|
|
34
|
+
__reExport(actions_exports, require("./events"), module.exports);
|
|
35
|
+
__reExport(actions_exports, require("./getItemOptions"), module.exports);
|
|
42
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/Nestable/actions/index.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export { tryIncreaseDepth } from './tryIncreaseDepth';\nexport { tryDecreaseDepth } from './tryDecreaseDepth';\nexport { moveItem } from './moveItem';\nexport * from './paths';\nexport * from './events';\nexport * from './getItemOptions';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAiC;AACjC,8BAAiC;AACjC,sBAAyB;AACzB,4BAAc,oBAHd;AAIA,4BAAc,qBAJd;AAKA,4BAAc,6BALd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,31 +18,25 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
}
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __export = (target, all) => {
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return to;
|
|
33
32
|
};
|
|
34
|
-
var __toESM = (
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
-
return (module2, temp) => {
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var moveItem_exports = {};
|
|
43
36
|
__export(moveItem_exports, {
|
|
44
37
|
moveItem: () => moveItem
|
|
45
38
|
});
|
|
39
|
+
module.exports = __toCommonJS(moveItem_exports);
|
|
46
40
|
var React = __toESM(require("react"));
|
|
47
41
|
var import_react_addons_update = __toESM(require("react-addons-update"));
|
|
48
42
|
function moveItem({ dragItem, pathFrom, pathTo }, extraProps = {}) {
|
|
@@ -65,5 +59,4 @@ function moveItem({ dragItem, pathFrom, pathTo }, extraProps = {}) {
|
|
|
65
59
|
isDirty: true
|
|
66
60
|
}, extraProps));
|
|
67
61
|
}
|
|
68
|
-
module.exports = __toCommonJS(moveItem_exports);
|
|
69
62
|
//# sourceMappingURL=moveItem.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/Nestable/actions/moveItem.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import update from 'react-addons-update';\n\nexport function moveItem({ dragItem, pathFrom, pathTo }, extraProps = {}) {\n const { childrenProp } = this.props;\n let { items } = this.state;\n\n // the remove action might affect the next position,\n // so update next coordinates accordingly\n const realPathTo = this.getRealNextPath(pathFrom, pathTo);\n\n const removePath = this.getSplicePath(pathFrom, {\n numToRemove: 1,\n childrenProp,\n });\n\n const insertPath = this.getSplicePath(realPathTo, {\n numToRemove: 0,\n itemsToInsert: [dragItem],\n childrenProp,\n });\n\n items = update(items, removePath);\n items = update(items, insertPath);\n\n this.setState({\n items,\n isDirty: true,\n ...extraProps,\n });\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,iCAAmB;AAEZ,kBAAkB,EAAE,UAAU,UAAU,UAAU,aAAa,CAAC,GAAG;AACxE,QAAM,EAAE,iBAAiB,KAAK;AAC9B,MAAI,EAAE,UAAU,KAAK;AAIrB,QAAM,aAAa,KAAK,gBAAgB,UAAU,MAAM;AAExD,QAAM,aAAa,KAAK,cAAc,UAAU;AAAA,IAC9C,aAAa;AAAA,IACb;AAAA,EACF,CAAC;AAED,QAAM,aAAa,KAAK,cAAc,YAAY;AAAA,IAChD,aAAa;AAAA,IACb,eAAe,CAAC,QAAQ;AAAA,IACxB;AAAA,EACF,CAAC;AAED,UAAQ,wCAAO,OAAO,UAAU;AAChC,UAAQ,wCAAO,OAAO,UAAU;AAEhC,OAAK,SAAS;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,KACN,WACJ;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var paths_exports = {};
|
|
29
22
|
__export(paths_exports, {
|
|
30
23
|
getItemByPath: () => getItemByPath,
|
|
@@ -33,6 +26,7 @@ __export(paths_exports, {
|
|
|
33
26
|
getRealNextPath: () => getRealNextPath,
|
|
34
27
|
getSplicePath: () => getSplicePath
|
|
35
28
|
});
|
|
29
|
+
module.exports = __toCommonJS(paths_exports);
|
|
36
30
|
var React = __toESM(require("react"));
|
|
37
31
|
function getRealNextPath(prevPath, nextPath) {
|
|
38
32
|
const { childrenProp } = this.props;
|
|
@@ -115,5 +109,4 @@ function getSplicePath(path, options = {}) {
|
|
|
115
109
|
});
|
|
116
110
|
return splicePath;
|
|
117
111
|
}
|
|
118
|
-
module.exports = __toCommonJS(paths_exports);
|
|
119
112
|
//# sourceMappingURL=paths.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/Nestable/actions/paths.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export function getRealNextPath(prevPath, nextPath) {\n const { childrenProp } = this.props;\n const ppLastIndex = prevPath.length - 1;\n const npLastIndex = nextPath.length - 1;\n\n if (prevPath.length < nextPath.length) {\n // move into deep\n let wasShifted = false;\n\n return nextPath.map((nextIndex, i) => {\n if (wasShifted) {\n return i === npLastIndex ? nextIndex + 1 : nextIndex;\n }\n\n if (typeof prevPath[i] !== 'number') {\n return nextIndex;\n }\n\n if (nextPath[i] > prevPath[i] && i === ppLastIndex) {\n wasShifted = true;\n return nextIndex - 1;\n }\n\n return nextIndex;\n });\n }\n\n if (prevPath.length === nextPath.length) {\n // if move bottom + move to item with children => make it a first child instead of swap\n if (nextPath[npLastIndex] > prevPath[npLastIndex]) {\n const target = this.getItemByPath(nextPath);\n\n if (\n target[childrenProp] &&\n target[childrenProp].length &&\n !this.isCollapsed(target)\n ) {\n return nextPath\n .slice(0, -1)\n .concat(nextPath[npLastIndex] - 1)\n .concat(0);\n }\n }\n }\n\n return nextPath;\n}\n\nexport function getPathById(id, items = this.getDefaultItems()) {\n const { childrenProp } = this.props;\n let path = [];\n\n items.every((item, i) => {\n if (item.id === id) {\n path.push(i);\n } else if (item[childrenProp]) {\n const childrenPath = this.getPathById(id, item[childrenProp]);\n\n if (childrenPath.length) {\n path = path.concat(i).concat(childrenPath);\n }\n }\n\n return path.length === 0;\n });\n\n return path;\n}\n\nexport function getItemByPath(path, items = this.getDefaultItems()) {\n const { childrenProp } = this.props;\n let item = null;\n\n path.forEach(index => {\n const list = item ? item[childrenProp] : items;\n item = list[index];\n });\n\n return item;\n}\n\nexport function getItemDepth(item) {\n const { childrenProp } = this.props;\n let level = 1;\n\n if (item[childrenProp].length > 0) {\n const childrenDepths = item[childrenProp].map(this.getItemDepth);\n level += Math.max(...childrenDepths);\n }\n\n return level;\n}\n\nexport function getSplicePath(path, options = {}) {\n const splicePath = {};\n const numToRemove = options.numToRemove || 0;\n const itemsToInsert = options.itemsToInsert || [];\n const lastIndex = path.length - 1;\n let currentPath = splicePath;\n\n path.forEach((index, i) => {\n if (i === lastIndex) {\n currentPath.$splice = [[index, numToRemove, ...itemsToInsert]];\n } else {\n const nextPath = {};\n currentPath[index] = { [options.childrenProp]: nextPath };\n currentPath = nextPath;\n }\n });\n\n return splicePath;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,yBAAyB,UAAU,UAAU;AAClD,QAAM,EAAE,iBAAiB,KAAK;AAC9B,QAAM,cAAc,SAAS,SAAS;AACtC,QAAM,cAAc,SAAS,SAAS;AAEtC,MAAI,SAAS,SAAS,SAAS,QAAQ;AAErC,QAAI,aAAa;AAEjB,WAAO,SAAS,IAAI,CAAC,WAAW,MAAM;AACpC,UAAI,YAAY;AACd,eAAO,MAAM,cAAc,YAAY,IAAI;AAAA,MAC7C;AAEA,UAAI,OAAO,SAAS,OAAO,UAAU;AACnC,eAAO;AAAA,MACT;AAEA,UAAI,SAAS,KAAK,SAAS,MAAM,MAAM,aAAa;AAClD,qBAAa;AACb,eAAO,YAAY;AAAA,MACrB;AAEA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,MAAI,SAAS,WAAW,SAAS,QAAQ;AAEvC,QAAI,SAAS,eAAe,SAAS,cAAc;AACjD,YAAM,SAAS,KA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AAChD,QAAM,YAAY,KAAK,SAAS;AAChC,MAAI,cAAc;AAElB,OAAK,QAAQ,CAAC,OAAO,MAAM;AACzB,QAAI,MAAM,WAAW;AACnB,kBAAY,UAAU,CAAC,CAAC,OAAO,aAAa,GAAG,aAAa,CAAC;AAAA,IAC/D,OAAO;AACL,YAAM,WAAW,CAAC;AAClB,kBAAY,SAAS,GAAG,QAAQ,eAAe,SAAS;AACxD,oBAAc;AAAA,IAChB;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var tryDecreaseDepth_exports = {};
|
|
29
22
|
__export(tryDecreaseDepth_exports, {
|
|
30
23
|
tryDecreaseDepth: () => tryDecreaseDepth
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(tryDecreaseDepth_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
function tryDecreaseDepth(dragItem) {
|
|
34
28
|
const { childrenProp, collapsed } = this.props;
|
|
@@ -47,5 +41,4 @@ function tryDecreaseDepth(dragItem) {
|
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
43
|
}
|
|
50
|
-
module.exports = __toCommonJS(tryDecreaseDepth_exports);
|
|
51
44
|
//# sourceMappingURL=tryDecreaseDepth.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/Nestable/actions/tryDecreaseDepth.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export function tryDecreaseDepth(dragItem) {\n const { childrenProp, collapsed } = this.props;\n const pathFrom = this.getPathById(dragItem.id);\n const itemIndex = pathFrom[pathFrom.length - 1];\n // has parent\n if (pathFrom.length > 1) {\n const parent = this.getItemByPath(pathFrom.slice(0, -1));\n // is last (by order) item in array\n if (itemIndex + 1 === parent[childrenProp].length) {\n const pathTo = pathFrom.slice(0, -1);\n pathTo[pathTo.length - 1] += 1;\n // if collapsed by default and is last (by count) item in array remove this node from list of open nodes\n let collapseProps = {};\n if (collapsed && parent[childrenProp].length === 1) {\n collapseProps = this.onToggleCollapse(parent, true);\n }\n\n this.moveItem({ dragItem, pathFrom, pathTo }, collapseProps);\n }\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,0BAA0B,UAAU;AACzC,QAAM,EAAE,cAAc,cAAc,KAAK;AACzC,QAAM,WAAW,KAAK,YAAY,SAAS,EAAE;AAC7C,QAAM,YAAY,SAAS,SAAS,SAAS;AAE7C,MAAI,SAAS,SAAS,GAAG;AACvB,UAAM,SAAS,KAAK,cAAc,SAAS,MAAM,GAAG,EAAE,CAAC;AAEvD,QAAI,YAAY,MAAM,OAAO,cAAc,QAAQ;AACjD,YAAM,SAAS,SAAS,MAAM,GAAG,EAAE;AACnC,aAAO,OAAO,SAAS,MAAM;AAE7B,UAAI,gBAAgB,CAAC;AACrB,UAAI,aAAa,OAAO,cAAc,WAAW,GAAG;AAClD,wBAAgB,KAAK,iBAAiB,QAAQ,IAAI;AAAA,MACpD;AAEA,WAAK,SAAS,EAAE,UAAU,UAAU,OAAO,GAAG,aAAa;AAAA,IAC7D;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var tryIncreaseDepth_exports = {};
|
|
29
22
|
__export(tryIncreaseDepth_exports, {
|
|
30
23
|
tryIncreaseDepth: () => tryIncreaseDepth
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(tryIncreaseDepth_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
27
|
function tryIncreaseDepth(dragItem) {
|
|
34
28
|
const { maxDepth, childrenProp, collapsed } = this.props;
|
|
@@ -47,5 +41,4 @@ function tryIncreaseDepth(dragItem) {
|
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
43
|
}
|
|
50
|
-
module.exports = __toCommonJS(tryIncreaseDepth_exports);
|
|
51
44
|
//# sourceMappingURL=tryIncreaseDepth.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/components/Nestable/actions/tryIncreaseDepth.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export function tryIncreaseDepth(dragItem) {\n const { maxDepth, childrenProp, collapsed } = this.props;\n const pathFrom = this.getPathById(dragItem.id);\n const itemIndex = pathFrom[pathFrom.length - 1];\n const newDepth = pathFrom.length + this.getItemDepth(dragItem);\n\n // has previous sibling and isn't at max depth\n if (itemIndex > 0 && newDepth <= maxDepth) {\n const prevSibling = this.getItemByPath(\n pathFrom.slice(0, -1).concat(itemIndex - 1),\n );\n // previous sibling is not collapsed\n if (!prevSibling[childrenProp].length || !this.isCollapsed(prevSibling)) {\n const pathTo = pathFrom\n .slice(0, -1)\n .concat(itemIndex - 1)\n .concat(prevSibling[childrenProp].length);\n\n // if collapsed by default\n // and was no children here\n // open this node\n let collapseProps = {};\n if (collapsed && !prevSibling[childrenProp].length) {\n collapseProps = this.onToggleCollapse(prevSibling, true);\n }\n\n this.moveItem({ dragItem, pathFrom, pathTo }, collapseProps);\n }\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,0BAA0B,UAAU;AACzC,QAAM,EAAE,UAAU,cAAc,cAAc,KAAK;AACnD,QAAM,WAAW,KAAK,YAAY,SAAS,EAAE;AAC7C,QAAM,YAAY,SAAS,SAAS,SAAS;AAC7C,QAAM,WAAW,SAAS,SAAS,KAAK,aAAa,QAAQ;AAG7D,MAAI,YAAY,KAAK,YAAY,UAAU;AACzC,UAAM,cAAc,KAAK,cACvB,SAAS,MAAM,GAAG,EAAE,EAAE,OAAO,YAAY,CAAC,CAC5C;AAEA,QAAI,CAAC,YAAY,cAAc,UAAU,CAAC,KAAK,YAAY,WAAW,GAAG;AACvE,YAAM,SAAS,SACZ,MAAM,GAAG,EAAE,EACX,OAAO,YAAY,CAAC,EACpB,OAAO,YAAY,cAAc,MAAM;AAK1C,UAAI,gBAAgB,CAAC;AACrB,UAAI,aAAa,CAAC,YAAY,cAAc,QAAQ;AAClD,wBAAgB,KAAK,iBAAiB,aAAa,IAAI;AAAA,MACzD;AAEA,WAAK,SAAS,EAAE,UAAU,UAAU,OAAO,GAAG,aAAa;AAAA,IAC7D;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|