@elliemae/ds-drag-and-drop 3.46.2 → 3.48.0
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/hierarchy/customCollisionDetection.js +3 -0
- package/dist/cjs/hierarchy/customCollisionDetection.js.map +2 -2
- package/dist/cjs/parts/DSDropIndicator/DropIndicator.js +1 -1
- package/dist/cjs/parts/DSDropIndicator/DropIndicator.js.map +2 -2
- package/dist/esm/hierarchy/customCollisionDetection.js +3 -0
- package/dist/esm/hierarchy/customCollisionDetection.js.map +2 -2
- package/dist/esm/parts/DSDropIndicator/DropIndicator.js +1 -1
- package/dist/esm/parts/DSDropIndicator/DropIndicator.js.map +2 -2
- package/package.json +7 -7
|
@@ -42,6 +42,9 @@ const customCollisionDetection = (sensorContext) => ({ droppableContainers, coll
|
|
|
42
42
|
const originalContainer = entriesWithSameParent.find(({ id }) => id === active.id);
|
|
43
43
|
const originalRect = originalContainer?.rect?.current;
|
|
44
44
|
if (!originalRect) return [];
|
|
45
|
+
if (originalRect.left <= collisionRect.left && collisionRect.left <= originalRect.left + originalRect.width) {
|
|
46
|
+
return [{ id: originalContainer.id }];
|
|
47
|
+
}
|
|
45
48
|
const isLeft = collisionRect.left <= originalRect.left + collisionRect.width / 2 + 5;
|
|
46
49
|
let match = null;
|
|
47
50
|
const collisionPoint = collisionRect.left + collisionRect.width / 2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hierarchy/customCollisionDetection.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable indent, complexity */\nimport { type CollisionDetection, type DroppableContainer } from '@dnd-kit/core';\nimport type { DnDKitHierarchy } from './types.js';\n\nexport const customCollisionDetection =\n <T,>(sensorContext: DnDKitHierarchy.SensorContext<T>): CollisionDetection =>\n ({ droppableContainers, collisionRect }) => {\n const { flattenedItems, active, itemsDictionary } = sensorContext.current;\n\n if (!active) return [];\n\n const activeParent = itemsDictionary[active.id].parentId;\n\n const entriesWithSameParent = droppableContainers.filter(\n ({ id }) => flattenedItems.find((item) => item.uid === id)?.parentId === activeParent,\n );\n\n const originalContainer = entriesWithSameParent.find(({ id }) => id === active.id);\n const originalRect = originalContainer?.rect?.current;\n\n if (!originalRect) return [];\n\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIhB,MAAM,2BACX,CAAK,kBACL,CAAC,EAAE,qBAAqB,cAAc,MAAM;AAC1C,QAAM,EAAE,gBAAgB,QAAQ,gBAAgB,IAAI,cAAc;AAElE,MAAI,CAAC,OAAQ,QAAO,CAAC;AAErB,QAAM,eAAe,gBAAgB,OAAO,EAAE,EAAE;AAEhD,QAAM,wBAAwB,oBAAoB;AAAA,IAChD,CAAC,EAAE,GAAG,MAAM,eAAe,KAAK,CAAC,SAAS,KAAK,QAAQ,EAAE,GAAG,aAAa;AAAA,EAC3E;AAEA,QAAM,oBAAoB,sBAAsB,KAAK,CAAC,EAAE,GAAG,MAAM,OAAO,OAAO,EAAE;AACjF,QAAM,eAAe,mBAAmB,MAAM;AAE9C,MAAI,CAAC,aAAc,QAAO,CAAC;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable indent, complexity */\nimport { type CollisionDetection, type DroppableContainer } from '@dnd-kit/core';\nimport type { DnDKitHierarchy } from './types.js';\n\nexport const customCollisionDetection =\n <T,>(sensorContext: DnDKitHierarchy.SensorContext<T>): CollisionDetection =>\n ({ droppableContainers, collisionRect }) => {\n const { flattenedItems, active, itemsDictionary } = sensorContext.current;\n\n if (!active) return [];\n\n const activeParent = itemsDictionary[active.id].parentId;\n\n const entriesWithSameParent = droppableContainers.filter(\n ({ id }) => flattenedItems.find((item) => item.uid === id)?.parentId === activeParent,\n );\n\n const originalContainer = entriesWithSameParent.find(({ id }) => id === active.id);\n const originalRect = originalContainer?.rect?.current;\n\n if (!originalRect) return [];\n\n if (originalRect.left <= collisionRect.left && collisionRect.left <= originalRect.left + originalRect.width) {\n return [{ id: originalContainer.id }];\n }\n\n const isLeft = collisionRect.left <= originalRect.left + collisionRect.width / 2 + 5;\n\n let match: DroppableContainer | null = null;\n // If going to the left, search the closest offset left\n // Otherwise, get the closest offset right\n const collisionPoint = collisionRect.left + collisionRect.width / 2;\n entriesWithSameParent.forEach((entry) => {\n const rect = entry.rect.current;\n\n if (rect !== null) {\n const offsetRight = rect.left + rect.width;\n\n if (!match) {\n match = entry;\n } else if (\n match &&\n match.rect.current &&\n isLeft &&\n Math.abs(collisionPoint - rect.left) <= Math.abs(collisionPoint - match.rect.current.left)\n ) {\n match = entry;\n } else if (\n match &&\n match.rect.current &&\n !isLeft &&\n Math.abs(collisionPoint - offsetRight) <=\n Math.abs(collisionPoint - match.rect.current.left - match.rect.current.width)\n ) {\n match = entry;\n }\n }\n });\n // Typescript believes match is always null for some reason\n const matchCastedForSomeReason = match as DroppableContainer | null;\n return matchCastedForSomeReason === null ? [] : [{ id: matchCastedForSomeReason.id }];\n };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIhB,MAAM,2BACX,CAAK,kBACL,CAAC,EAAE,qBAAqB,cAAc,MAAM;AAC1C,QAAM,EAAE,gBAAgB,QAAQ,gBAAgB,IAAI,cAAc;AAElE,MAAI,CAAC,OAAQ,QAAO,CAAC;AAErB,QAAM,eAAe,gBAAgB,OAAO,EAAE,EAAE;AAEhD,QAAM,wBAAwB,oBAAoB;AAAA,IAChD,CAAC,EAAE,GAAG,MAAM,eAAe,KAAK,CAAC,SAAS,KAAK,QAAQ,EAAE,GAAG,aAAa;AAAA,EAC3E;AAEA,QAAM,oBAAoB,sBAAsB,KAAK,CAAC,EAAE,GAAG,MAAM,OAAO,OAAO,EAAE;AACjF,QAAM,eAAe,mBAAmB,MAAM;AAE9C,MAAI,CAAC,aAAc,QAAO,CAAC;AAE3B,MAAI,aAAa,QAAQ,cAAc,QAAQ,cAAc,QAAQ,aAAa,OAAO,aAAa,OAAO;AAC3G,WAAO,CAAC,EAAE,IAAI,kBAAkB,GAAG,CAAC;AAAA,EACtC;AAEA,QAAM,SAAS,cAAc,QAAQ,aAAa,OAAO,cAAc,QAAQ,IAAI;AAEnF,MAAI,QAAmC;AAGvC,QAAM,iBAAiB,cAAc,OAAO,cAAc,QAAQ;AAClE,wBAAsB,QAAQ,CAAC,UAAU;AACvC,UAAM,OAAO,MAAM,KAAK;AAExB,QAAI,SAAS,MAAM;AACjB,YAAM,cAAc,KAAK,OAAO,KAAK;AAErC,UAAI,CAAC,OAAO;AACV,gBAAQ;AAAA,MACV,WACE,SACA,MAAM,KAAK,WACX,UACA,KAAK,IAAI,iBAAiB,KAAK,IAAI,KAAK,KAAK,IAAI,iBAAiB,MAAM,KAAK,QAAQ,IAAI,GACzF;AACA,gBAAQ;AAAA,MACV,WACE,SACA,MAAM,KAAK,WACX,CAAC,UACD,KAAK,IAAI,iBAAiB,WAAW,KACnC,KAAK,IAAI,iBAAiB,MAAM,KAAK,QAAQ,OAAO,MAAM,KAAK,QAAQ,KAAK,GAC9E;AACA,gBAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF,CAAC;AAED,QAAM,2BAA2B;AACjC,SAAO,6BAA6B,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,yBAAyB,GAAG,CAAC;AACtF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,8 +35,8 @@ module.exports = __toCommonJS(DropIndicator_exports);
|
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_ds_system = require("@elliemae/ds-system");
|
|
38
|
-
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
39
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
40
|
const getPositionStyles = ({
|
|
41
41
|
dropIndicatorPosition,
|
|
42
42
|
vertical
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/DSDropIndicator/DropIndicator.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport { DropIndicatorPosition, DSDropIndicatorPropTypes, type DSDropIndicatorT } from './react-desc-prop-types.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDnB;AAnDJ,uBAAuB;AACvB,
|
|
4
|
+
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DropIndicatorPosition, DSDropIndicatorPropTypes, type DSDropIndicatorT } from './react-desc-prop-types.js';\n\nconst getPositionStyles = ({\n dropIndicatorPosition,\n vertical,\n}: {\n dropIndicatorPosition: (typeof DropIndicatorPosition)[keyof typeof DropIndicatorPosition];\n vertical: boolean;\n}) => {\n if (vertical) {\n return `\n left: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n right: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n `;\n }\n return `\n top: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n bottom: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n `;\n};\n\nconst getCircleStyles = ({\n dropIndicatorPosition,\n vertical,\n}: {\n dropIndicatorPosition: (typeof DropIndicatorPosition)[keyof typeof DropIndicatorPosition];\n vertical: boolean;\n}) => ({\n position: 'absolute',\n zIndex: 1000,\n top: vertical || dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n bottom: vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n left: !vertical || dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n right: !vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n opacity: 1,\n});\n\nconst StyledIndicator = styled.div<{ isDropValid: boolean; vertical: boolean; dropIndicatorPosition: string }>`\n position: absolute;\n ${getPositionStyles}\n box-sizing: border-box;\n width: ${(props) => (props.vertical ? '2px' : '100%')};\n height: ${(props) => (props.vertical ? '100%' : '2px')};\n background-color: ${({ isDropValid, theme }) => (isDropValid ? theme.colors.brand[600] : theme.colors.danger[900])};\n z-index: ${1000};\n`;\n\nconst CircleIndicator = (style: Record<string, unknown>, isDropValid: boolean) => (\n <svg height=\"6\" width=\"6\" style={style}>\n <circle cx=\"3\" cy=\"3\" r=\"3\" strokeWidth=\"0\" fill={isDropValid ? '#1E79C2' : '#C64252'} />\n </svg>\n);\n\nexport const DropIndicator = (props: DSDropIndicatorT.Props) => {\n const { vertical, dropIndicatorPosition, isLast, isDropValid } = props;\n if (\n dropIndicatorPosition === false ||\n dropIndicatorPosition === DropIndicatorPosition.None ||\n dropIndicatorPosition === DropIndicatorPosition.Inside\n )\n return null;\n\n const safeDropIndicatorPosition = isLast ? DropIndicatorPosition.Before : dropIndicatorPosition;\n\n return (\n <>\n {CircleIndicator(getCircleStyles({ ...props, dropIndicatorPosition: safeDropIndicatorPosition }), isDropValid)}\n <StyledIndicator\n vertical={vertical}\n dropIndicatorPosition={safeDropIndicatorPosition}\n isDropValid={isDropValid}\n />\n </>\n );\n};\n\nconst DropIndicatorWithSchema = describe(DropIndicator);\nDropIndicatorWithSchema.propTypes = DSDropIndicatorPropTypes;\n\nexport { DropIndicatorWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAA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AM,gBAAgB,CAAC,UAAkC;AAC9D,QAAM,EAAE,UAAU,uBAAuB,QAAQ,YAAY,IAAI;AACjE,MACE,0BAA0B,SAC1B,0BAA0B,mDAAsB,QAChD,0BAA0B,mDAAsB;AAEhD,WAAO;AAET,QAAM,4BAA4B,SAAS,mDAAsB,SAAS;AAE1E,SACE,4EACG;AAAA,oBAAgB,gBAAgB,EAAE,GAAG,OAAO,uBAAuB,0BAA0B,CAAC,GAAG,WAAW;AAAA,IAC7G;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,uBAAuB;AAAA,QACvB;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,MAAM,8BAA0B,kCAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -9,6 +9,9 @@ const customCollisionDetection = (sensorContext) => ({ droppableContainers, coll
|
|
|
9
9
|
const originalContainer = entriesWithSameParent.find(({ id }) => id === active.id);
|
|
10
10
|
const originalRect = originalContainer?.rect?.current;
|
|
11
11
|
if (!originalRect) return [];
|
|
12
|
+
if (originalRect.left <= collisionRect.left && collisionRect.left <= originalRect.left + originalRect.width) {
|
|
13
|
+
return [{ id: originalContainer.id }];
|
|
14
|
+
}
|
|
12
15
|
const isLeft = collisionRect.left <= originalRect.left + collisionRect.width / 2 + 5;
|
|
13
16
|
let match = null;
|
|
14
17
|
const collisionPoint = collisionRect.left + collisionRect.width / 2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hierarchy/customCollisionDetection.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent, complexity */\nimport { type CollisionDetection, type DroppableContainer } from '@dnd-kit/core';\nimport type { DnDKitHierarchy } from './types.js';\n\nexport const customCollisionDetection =\n <T,>(sensorContext: DnDKitHierarchy.SensorContext<T>): CollisionDetection =>\n ({ droppableContainers, collisionRect }) => {\n const { flattenedItems, active, itemsDictionary } = sensorContext.current;\n\n if (!active) return [];\n\n const activeParent = itemsDictionary[active.id].parentId;\n\n const entriesWithSameParent = droppableContainers.filter(\n ({ id }) => flattenedItems.find((item) => item.uid === id)?.parentId === activeParent,\n );\n\n const originalContainer = entriesWithSameParent.find(({ id }) => id === active.id);\n const originalRect = originalContainer?.rect?.current;\n\n if (!originalRect) return [];\n\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACIhB,MAAM,2BACX,CAAK,kBACL,CAAC,EAAE,qBAAqB,cAAc,MAAM;AAC1C,QAAM,EAAE,gBAAgB,QAAQ,gBAAgB,IAAI,cAAc;AAElE,MAAI,CAAC,OAAQ,QAAO,CAAC;AAErB,QAAM,eAAe,gBAAgB,OAAO,EAAE,EAAE;AAEhD,QAAM,wBAAwB,oBAAoB;AAAA,IAChD,CAAC,EAAE,GAAG,MAAM,eAAe,KAAK,CAAC,SAAS,KAAK,QAAQ,EAAE,GAAG,aAAa;AAAA,EAC3E;AAEA,QAAM,oBAAoB,sBAAsB,KAAK,CAAC,EAAE,GAAG,MAAM,OAAO,OAAO,EAAE;AACjF,QAAM,eAAe,mBAAmB,MAAM;AAE9C,MAAI,CAAC,aAAc,QAAO,CAAC;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent, complexity */\nimport { type CollisionDetection, type DroppableContainer } from '@dnd-kit/core';\nimport type { DnDKitHierarchy } from './types.js';\n\nexport const customCollisionDetection =\n <T,>(sensorContext: DnDKitHierarchy.SensorContext<T>): CollisionDetection =>\n ({ droppableContainers, collisionRect }) => {\n const { flattenedItems, active, itemsDictionary } = sensorContext.current;\n\n if (!active) return [];\n\n const activeParent = itemsDictionary[active.id].parentId;\n\n const entriesWithSameParent = droppableContainers.filter(\n ({ id }) => flattenedItems.find((item) => item.uid === id)?.parentId === activeParent,\n );\n\n const originalContainer = entriesWithSameParent.find(({ id }) => id === active.id);\n const originalRect = originalContainer?.rect?.current;\n\n if (!originalRect) return [];\n\n if (originalRect.left <= collisionRect.left && collisionRect.left <= originalRect.left + originalRect.width) {\n return [{ id: originalContainer.id }];\n }\n\n const isLeft = collisionRect.left <= originalRect.left + collisionRect.width / 2 + 5;\n\n let match: DroppableContainer | null = null;\n // If going to the left, search the closest offset left\n // Otherwise, get the closest offset right\n const collisionPoint = collisionRect.left + collisionRect.width / 2;\n entriesWithSameParent.forEach((entry) => {\n const rect = entry.rect.current;\n\n if (rect !== null) {\n const offsetRight = rect.left + rect.width;\n\n if (!match) {\n match = entry;\n } else if (\n match &&\n match.rect.current &&\n isLeft &&\n Math.abs(collisionPoint - rect.left) <= Math.abs(collisionPoint - match.rect.current.left)\n ) {\n match = entry;\n } else if (\n match &&\n match.rect.current &&\n !isLeft &&\n Math.abs(collisionPoint - offsetRight) <=\n Math.abs(collisionPoint - match.rect.current.left - match.rect.current.width)\n ) {\n match = entry;\n }\n }\n });\n // Typescript believes match is always null for some reason\n const matchCastedForSomeReason = match as DroppableContainer | null;\n return matchCastedForSomeReason === null ? [] : [{ id: matchCastedForSomeReason.id }];\n };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIhB,MAAM,2BACX,CAAK,kBACL,CAAC,EAAE,qBAAqB,cAAc,MAAM;AAC1C,QAAM,EAAE,gBAAgB,QAAQ,gBAAgB,IAAI,cAAc;AAElE,MAAI,CAAC,OAAQ,QAAO,CAAC;AAErB,QAAM,eAAe,gBAAgB,OAAO,EAAE,EAAE;AAEhD,QAAM,wBAAwB,oBAAoB;AAAA,IAChD,CAAC,EAAE,GAAG,MAAM,eAAe,KAAK,CAAC,SAAS,KAAK,QAAQ,EAAE,GAAG,aAAa;AAAA,EAC3E;AAEA,QAAM,oBAAoB,sBAAsB,KAAK,CAAC,EAAE,GAAG,MAAM,OAAO,OAAO,EAAE;AACjF,QAAM,eAAe,mBAAmB,MAAM;AAE9C,MAAI,CAAC,aAAc,QAAO,CAAC;AAE3B,MAAI,aAAa,QAAQ,cAAc,QAAQ,cAAc,QAAQ,aAAa,OAAO,aAAa,OAAO;AAC3G,WAAO,CAAC,EAAE,IAAI,kBAAkB,GAAG,CAAC;AAAA,EACtC;AAEA,QAAM,SAAS,cAAc,QAAQ,aAAa,OAAO,cAAc,QAAQ,IAAI;AAEnF,MAAI,QAAmC;AAGvC,QAAM,iBAAiB,cAAc,OAAO,cAAc,QAAQ;AAClE,wBAAsB,QAAQ,CAAC,UAAU;AACvC,UAAM,OAAO,MAAM,KAAK;AAExB,QAAI,SAAS,MAAM;AACjB,YAAM,cAAc,KAAK,OAAO,KAAK;AAErC,UAAI,CAAC,OAAO;AACV,gBAAQ;AAAA,MACV,WACE,SACA,MAAM,KAAK,WACX,UACA,KAAK,IAAI,iBAAiB,KAAK,IAAI,KAAK,KAAK,IAAI,iBAAiB,MAAM,KAAK,QAAQ,IAAI,GACzF;AACA,gBAAQ;AAAA,MACV,WACE,SACA,MAAM,KAAK,WACX,CAAC,UACD,KAAK,IAAI,iBAAiB,WAAW,KACnC,KAAK,IAAI,iBAAiB,MAAM,KAAK,QAAQ,OAAO,MAAM,KAAK,QAAQ,KAAK,GAC9E;AACA,gBAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF,CAAC;AAED,QAAM,2BAA2B;AACjC,SAAO,6BAA6B,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,yBAAyB,GAAG,CAAC;AACtF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { styled } from "@elliemae/ds-system";
|
|
4
|
-
import { DropIndicatorPosition, DSDropIndicatorPropTypes } from "./react-desc-prop-types.js";
|
|
5
4
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { DropIndicatorPosition, DSDropIndicatorPropTypes } from "./react-desc-prop-types.js";
|
|
6
6
|
const getPositionStyles = ({
|
|
7
7
|
dropIndicatorPosition,
|
|
8
8
|
vertical
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSDropIndicator/DropIndicator.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { DropIndicatorPosition, DSDropIndicatorPropTypes, type DSDropIndicatorT } from './react-desc-prop-types.js';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACmDnB,SAgBA,UAhBA,KAgBA,YAhBA;AAnDJ,SAAS,cAAc;AACvB,SAAS,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DropIndicatorPosition, DSDropIndicatorPropTypes, type DSDropIndicatorT } from './react-desc-prop-types.js';\n\nconst getPositionStyles = ({\n dropIndicatorPosition,\n vertical,\n}: {\n dropIndicatorPosition: (typeof DropIndicatorPosition)[keyof typeof DropIndicatorPosition];\n vertical: boolean;\n}) => {\n if (vertical) {\n return `\n left: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n right: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n `;\n }\n return `\n top: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n bottom: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n `;\n};\n\nconst getCircleStyles = ({\n dropIndicatorPosition,\n vertical,\n}: {\n dropIndicatorPosition: (typeof DropIndicatorPosition)[keyof typeof DropIndicatorPosition];\n vertical: boolean;\n}) => ({\n position: 'absolute',\n zIndex: 1000,\n top: vertical || dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n bottom: vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n left: !vertical || dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n right: !vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n opacity: 1,\n});\n\nconst StyledIndicator = styled.div<{ isDropValid: boolean; vertical: boolean; dropIndicatorPosition: string }>`\n position: absolute;\n ${getPositionStyles}\n box-sizing: border-box;\n width: ${(props) => (props.vertical ? '2px' : '100%')};\n height: ${(props) => (props.vertical ? '100%' : '2px')};\n background-color: ${({ isDropValid, theme }) => (isDropValid ? theme.colors.brand[600] : theme.colors.danger[900])};\n z-index: ${1000};\n`;\n\nconst CircleIndicator = (style: Record<string, unknown>, isDropValid: boolean) => (\n <svg height=\"6\" width=\"6\" style={style}>\n <circle cx=\"3\" cy=\"3\" r=\"3\" strokeWidth=\"0\" fill={isDropValid ? '#1E79C2' : '#C64252'} />\n </svg>\n);\n\nexport const DropIndicator = (props: DSDropIndicatorT.Props) => {\n const { vertical, dropIndicatorPosition, isLast, isDropValid } = props;\n if (\n dropIndicatorPosition === false ||\n dropIndicatorPosition === DropIndicatorPosition.None ||\n dropIndicatorPosition === DropIndicatorPosition.Inside\n )\n return null;\n\n const safeDropIndicatorPosition = isLast ? DropIndicatorPosition.Before : dropIndicatorPosition;\n\n return (\n <>\n {CircleIndicator(getCircleStyles({ ...props, dropIndicatorPosition: safeDropIndicatorPosition }), isDropValid)}\n <StyledIndicator\n vertical={vertical}\n dropIndicatorPosition={safeDropIndicatorPosition}\n isDropValid={isDropValid}\n />\n </>\n );\n};\n\nconst DropIndicatorWithSchema = describe(DropIndicator);\nDropIndicatorWithSchema.propTypes = DSDropIndicatorPropTypes;\n\nexport { DropIndicatorWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmDnB,SAgBA,UAhBA,KAgBA,YAhBA;AAnDJ,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,uBAAuB,gCAAuD;A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BAA0B,SAC1B,0BAA0B,sBAAsB,QAChD,0BAA0B,sBAAsB;AAEhD,WAAO;AAET,QAAM,4BAA4B,SAAS,sBAAsB,SAAS;AAE1E,SACE,iCACG;AAAA,oBAAgB,gBAAgB,EAAE,GAAG,OAAO,uBAAuB,0BAA0B,CAAC,GAAG,WAAW;AAAA,IAC7G;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,uBAAuB;AAAA,QACvB;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-drag-and-drop",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.48.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Drag And Drop",
|
|
6
6
|
"files": [
|
|
@@ -111,16 +111,16 @@
|
|
|
111
111
|
"@dnd-kit/core": "~6.0.8",
|
|
112
112
|
"@dnd-kit/modifiers": "~6.0.1",
|
|
113
113
|
"@dnd-kit/sortable": "~7.0.2",
|
|
114
|
-
"@elliemae/ds-fast-list": "3.
|
|
115
|
-
"@elliemae/ds-
|
|
116
|
-
"@elliemae/ds-
|
|
117
|
-
"@elliemae/ds-
|
|
118
|
-
"@elliemae/ds-typescript-helpers": "3.
|
|
114
|
+
"@elliemae/ds-fast-list": "3.48.0",
|
|
115
|
+
"@elliemae/ds-props-helpers": "3.48.0",
|
|
116
|
+
"@elliemae/ds-tree-model": "3.48.0",
|
|
117
|
+
"@elliemae/ds-system": "3.48.0",
|
|
118
|
+
"@elliemae/ds-typescript-helpers": "3.48.0"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@elliemae/pui-cli": "9.0.0-next.50",
|
|
122
122
|
"styled-components": "~5.3.9",
|
|
123
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
123
|
+
"@elliemae/ds-monorepo-devops": "3.48.0"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
126
|
"lodash": "^4.17.21",
|