@elliemae/ds-drag-and-drop 3.37.0-rc.4 → 3.37.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/index.js +4 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/{exported-related → parts/DSDragAndDrop}/DSDragAndDrop.js +9 -4
- package/dist/cjs/parts/DSDragAndDrop/DSDragAndDrop.js.map +7 -0
- package/dist/cjs/{exported-related/SortableContainerContext.js → parts/DSDragAndDrop/index.js} +7 -15
- package/dist/cjs/parts/DSDragAndDrop/index.js.map +7 -0
- package/dist/cjs/parts/DSDragAndDrop/react-desc-prop-types.js +46 -0
- package/dist/cjs/parts/DSDragAndDrop/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSDragAndDrop/typescript-testing/typescript-dialog-valid.js +97 -0
- package/dist/cjs/parts/DSDragAndDrop/typescript-testing/typescript-dialog-valid.js.map +7 -0
- package/dist/cjs/{exported-related → parts/DSDropIndicator}/DropIndicator.js +16 -17
- package/dist/cjs/parts/DSDropIndicator/DropIndicator.js.map +7 -0
- package/dist/cjs/parts/DSDropIndicator/index.js +37 -0
- package/dist/cjs/parts/DSDropIndicator/index.js.map +7 -0
- package/dist/cjs/parts/DSDropIndicator/react-desc-prop-types.js +51 -0
- package/dist/cjs/parts/DSDropIndicator/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSDropIndicator/typescript-testing/typescript-dialog-valid.js +88 -0
- package/dist/cjs/parts/DSDropIndicator/typescript-testing/typescript-dialog-valid.js.map +7 -0
- package/dist/cjs/{exported-related → parts/DSSortableContainer}/DSSortableContainer.js +22 -5
- package/dist/cjs/parts/DSSortableContainer/DSSortableContainer.js.map +7 -0
- package/dist/cjs/{exported-related → parts/DSSortableContainer}/index.js +5 -9
- package/dist/cjs/parts/DSSortableContainer/index.js.map +7 -0
- package/dist/cjs/parts/DSSortableContainer/react-desc-prop-types.js +44 -0
- package/dist/cjs/parts/DSSortableContainer/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSSortableContainer/typescript-testing/typescript-dialog-valid.js +106 -0
- package/dist/cjs/parts/DSSortableContainer/typescript-testing/typescript-dialog-valid.js.map +7 -0
- package/dist/cjs/{exported-related → parts/DSSortableItem}/DSSortableItem.js +19 -10
- package/dist/cjs/parts/DSSortableItem/DSSortableItem.js.map +7 -0
- package/dist/cjs/parts/DSSortableItem/index.js +37 -0
- package/dist/cjs/parts/DSSortableItem/index.js.map +7 -0
- package/dist/cjs/parts/DSSortableItem/react-desc-prop-types.js +41 -0
- package/dist/cjs/parts/DSSortableItem/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/DSSortableItem/typescript-testing/typescript-dialog-valid.js +80 -0
- package/dist/cjs/parts/DSSortableItem/typescript-testing/typescript-dialog-valid.js.map +7 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/{exported-related → parts/DSDragAndDrop}/DSDragAndDrop.js +8 -3
- package/dist/esm/parts/DSDragAndDrop/DSDragAndDrop.js.map +7 -0
- package/dist/esm/parts/DSDragAndDrop/index.js +7 -0
- package/dist/esm/parts/DSDragAndDrop/index.js.map +7 -0
- package/dist/esm/parts/DSDragAndDrop/react-desc-prop-types.js +16 -0
- package/dist/esm/parts/DSDragAndDrop/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSDragAndDrop/typescript-testing/typescript-dialog-valid.js +74 -0
- package/dist/esm/parts/DSDragAndDrop/typescript-testing/typescript-dialog-valid.js.map +7 -0
- package/dist/esm/{exported-related → parts/DSDropIndicator}/DropIndicator.js +6 -7
- package/dist/esm/parts/DSDropIndicator/DropIndicator.js.map +7 -0
- package/dist/esm/parts/DSDropIndicator/index.js +7 -0
- package/dist/esm/parts/DSDropIndicator/index.js.map +7 -0
- package/dist/esm/parts/DSDropIndicator/react-desc-prop-types.js +21 -0
- package/dist/esm/parts/DSDropIndicator/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSDropIndicator/typescript-testing/typescript-dialog-valid.js +65 -0
- package/dist/esm/parts/DSDropIndicator/typescript-testing/typescript-dialog-valid.js.map +7 -0
- package/dist/esm/{exported-related → parts/DSSortableContainer}/DSSortableContainer.js +22 -5
- package/dist/esm/parts/DSSortableContainer/DSSortableContainer.js.map +7 -0
- package/dist/esm/parts/DSSortableContainer/index.js +8 -0
- package/dist/esm/parts/DSSortableContainer/index.js.map +7 -0
- package/dist/esm/parts/DSSortableContainer/react-desc-prop-types.js +14 -0
- package/dist/esm/parts/DSSortableContainer/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSSortableContainer/typescript-testing/typescript-dialog-valid.js +83 -0
- package/dist/esm/parts/DSSortableContainer/typescript-testing/typescript-dialog-valid.js.map +7 -0
- package/dist/esm/{exported-related → parts/DSSortableItem}/DSSortableItem.js +18 -9
- package/dist/esm/parts/DSSortableItem/DSSortableItem.js.map +7 -0
- package/dist/esm/parts/DSSortableItem/index.js +7 -0
- package/dist/esm/parts/DSSortableItem/index.js.map +7 -0
- package/dist/esm/parts/DSSortableItem/react-desc-prop-types.js +11 -0
- package/dist/esm/parts/DSSortableItem/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/DSSortableItem/typescript-testing/typescript-dialog-valid.js +57 -0
- package/dist/esm/parts/DSSortableItem/typescript-testing/typescript-dialog-valid.js.map +7 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/parts/DSDragAndDrop/DSDragAndDrop.d.ts +4 -0
- package/dist/types/parts/DSDragAndDrop/index.d.ts +2 -0
- package/dist/types/parts/DSDragAndDrop/react-desc-prop-types.d.ts +35 -0
- package/dist/types/parts/DSDragAndDrop/typescript-testing/typescript-dialog-valid.d.ts +1 -0
- package/dist/types/parts/DSDropIndicator/DropIndicator.d.ts +4 -0
- package/dist/types/parts/DSDropIndicator/index.d.ts +2 -0
- package/dist/types/parts/DSDropIndicator/react-desc-prop-types.d.ts +25 -0
- package/dist/types/parts/DSDropIndicator/typescript-testing/typescript-dialog-valid.d.ts +1 -0
- package/dist/types/parts/DSSortableContainer/DSSortableContainer.d.ts +15 -0
- package/dist/types/parts/DSSortableContainer/index.d.ts +2 -0
- package/dist/types/parts/DSSortableContainer/react-desc-prop-types.d.ts +45 -0
- package/dist/types/parts/DSSortableContainer/typescript-testing/typescript-dialog-valid.d.ts +1 -0
- package/dist/types/parts/DSSortableItem/DSSortableItem.d.ts +4 -0
- package/dist/types/parts/DSSortableItem/index.d.ts +2 -0
- package/dist/types/parts/DSSortableItem/react-desc-prop-types.d.ts +32 -0
- package/dist/types/parts/DSSortableItem/typescript-testing/typescript-dialog-valid.d.ts +1 -0
- package/package.json +7 -6
- package/dist/cjs/exported-related/DSDragAndDrop.js.map +0 -7
- package/dist/cjs/exported-related/DSSortableContainer.js.map +0 -7
- package/dist/cjs/exported-related/DSSortableItem.js.map +0 -7
- package/dist/cjs/exported-related/DropIndicator.js.map +0 -7
- package/dist/cjs/exported-related/SortableContainerContext.js.map +0 -7
- package/dist/cjs/exported-related/index.js.map +0 -7
- package/dist/esm/exported-related/DSDragAndDrop.js.map +0 -7
- package/dist/esm/exported-related/DSSortableContainer.js.map +0 -7
- package/dist/esm/exported-related/DSSortableItem.js.map +0 -7
- package/dist/esm/exported-related/DropIndicator.js.map +0 -7
- package/dist/esm/exported-related/SortableContainerContext.js +0 -15
- package/dist/esm/exported-related/SortableContainerContext.js.map +0 -7
- package/dist/esm/exported-related/index.js +0 -12
- package/dist/esm/exported-related/index.js.map +0 -7
- package/dist/types/exported-related/DSDragAndDrop.d.ts +0 -23
- package/dist/types/exported-related/DSSortableContainer.d.ts +0 -17
- package/dist/types/exported-related/DSSortableItem.d.ts +0 -21
- package/dist/types/exported-related/DropIndicator.d.ts +0 -15
- package/dist/types/exported-related/SortableContainerContext.d.ts +0 -13
- package/dist/types/exported-related/index.d.ts +0 -4
package/dist/cjs/index.js
CHANGED
|
@@ -28,7 +28,10 @@ module.exports = __toCommonJS(src_exports);
|
|
|
28
28
|
var React = __toESM(require("react"));
|
|
29
29
|
__reExport(src_exports, require("./hierarchy/index.js"), module.exports);
|
|
30
30
|
__reExport(src_exports, require("./tree/index.js"), module.exports);
|
|
31
|
-
__reExport(src_exports, require("./
|
|
31
|
+
__reExport(src_exports, require("./parts/DSDragAndDrop/index.js"), module.exports);
|
|
32
|
+
__reExport(src_exports, require("./parts/DSSortableContainer/index.js"), module.exports);
|
|
33
|
+
__reExport(src_exports, require("./parts/DSSortableItem/index.js"), module.exports);
|
|
34
|
+
__reExport(src_exports, require("./parts/DSDropIndicator/index.js"), module.exports);
|
|
32
35
|
__reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
33
36
|
__reExport(src_exports, require("@dnd-kit/sortable"), module.exports);
|
|
34
37
|
__reExport(src_exports, require("@dnd-kit/modifiers"), module.exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './hierarchy/index.js';\nexport * from './tree/index.js';\nexport * from './
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,iCAAd;AACA,wBAAc,4BADd;AAEA,wBAAc,
|
|
4
|
+
"sourcesContent": ["export * from './hierarchy/index.js';\nexport * from './tree/index.js';\nexport * from './parts/DSDragAndDrop/index.js';\nexport * from './parts/DSSortableContainer/index.js';\nexport * from './parts/DSSortableItem/index.js';\nexport * from './parts/DSDropIndicator/index.js';\nexport * from '@dnd-kit/core';\nexport * from '@dnd-kit/sortable';\nexport * from '@dnd-kit/modifiers';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,iCAAd;AACA,wBAAc,4BADd;AAEA,wBAAc,2CAFd;AAGA,wBAAc,iDAHd;AAIA,wBAAc,4CAJd;AAKA,wBAAc,6CALd;AAMA,wBAAc,0BANd;AAOA,wBAAc,8BAPd;AAQA,wBAAc,+BARd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,15 +28,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var DSDragAndDrop_exports = {};
|
|
30
30
|
__export(DSDragAndDrop_exports, {
|
|
31
|
-
DSDragAndDrop: () => DSDragAndDrop
|
|
31
|
+
DSDragAndDrop: () => DSDragAndDrop,
|
|
32
|
+
DSDragAndDropWithSchema: () => DSDragAndDropWithSchema
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(DSDragAndDrop_exports);
|
|
34
35
|
var React = __toESM(require("react"));
|
|
35
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
37
|
var import_react = require("react");
|
|
37
38
|
var import_react_dom = require("react-dom");
|
|
38
|
-
var import__ = require("
|
|
39
|
-
var
|
|
39
|
+
var import__ = require("../../index.js");
|
|
40
|
+
var import_DSSortableContainer = require("../DSSortableContainer/index.js");
|
|
41
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
42
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
43
|
const flatten = (items, parentId = null, depth = 0, container = "root", iteration = { count: 0 }) => items.reduce((acc, item, index) => {
|
|
41
44
|
acc.push({
|
|
42
45
|
...item,
|
|
@@ -84,7 +87,7 @@ const DSDragAndDrop = ({
|
|
|
84
87
|
});
|
|
85
88
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import__.DndContext, { ...dndContextProps, children: [
|
|
86
89
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
-
|
|
90
|
+
import_DSSortableContainer.ContainersContext.Provider,
|
|
88
91
|
{
|
|
89
92
|
value: { sortableContextProps, dropIndicatorPosition, isDropValid, items: itemsFlattened, onCollapse },
|
|
90
93
|
children
|
|
@@ -96,4 +99,6 @@ const DSDragAndDrop = ({
|
|
|
96
99
|
)
|
|
97
100
|
] });
|
|
98
101
|
};
|
|
102
|
+
const DSDragAndDropWithSchema = (0, import_ds_props_helpers.describe)(DSDragAndDrop);
|
|
103
|
+
DSDragAndDropWithSchema.propTypes = import_react_desc_prop_types.DSDragAndDropPropTypes;
|
|
99
104
|
//# sourceMappingURL=DSDragAndDrop.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/DSDragAndDrop/DSDragAndDrop.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-params */\nimport React, { useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport {\n DndContext,\n DragOverlay,\n restrictToWindowEdges,\n useMultiTreeDndkitConfig,\n type UniqueIdentifier,\n} from '../../index.js';\nimport { ContainersContext } from '../DSSortableContainer/index.js';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport type { DSDragAndDropT, Item } from './react-desc-prop-types.js';\nimport { DSDragAndDropPropTypes } from './react-desc-prop-types.js';\n\nconst flatten = <T,>(\n items: Item<T>[],\n parentId: UniqueIdentifier | null = null,\n depth = 0,\n container = 'root',\n iteration = { count: 0 },\n) =>\n items.reduce((acc, item, index) => {\n acc.push({\n ...item,\n uid: item.dsId,\n childrenCount: item?.subitems?.length || 0,\n original: item,\n realIndex: iteration.count++,\n parentId,\n depth,\n index,\n container,\n });\n if (item.subitems?.length > 0 && item.collapsed === false) {\n acc.push(...flatten(item.subitems, item.dsId, depth + 1, container, iteration));\n }\n return acc;\n }, [] as Item<T>[]);\n\nexport const DSDragAndDrop = <T,>({\n items,\n children,\n onReorder,\n onCollapse,\n DragOverlayRenderer,\n maxDragAndDropLevel = 0,\n ...rest\n}: DSDragAndDropT.Props<T>) => {\n const itemsFlattened = useMemo(\n () =>\n Object.keys(items).reduce(\n (acc, container) => {\n acc[container] = flatten(items[container] as Item<T>[], null, 0, container);\n return acc;\n },\n {} as Record<string, Item<T>[]>,\n ),\n [items],\n );\n const { dndContextProps, sortableContextProps, active, dropIndicatorPosition, isDropValid } =\n useMultiTreeDndkitConfig({\n flattenedItems: itemsFlattened,\n isHorizontalDnD: false,\n isExpandable: true,\n onReorder,\n maxDragAndDropLevel,\n getIsDropValid: () => true,\n ...rest,\n });\n\n return (\n <DndContext {...dndContextProps}>\n <ContainersContext.Provider\n value={{ sortableContextProps, dropIndicatorPosition, isDropValid, items: itemsFlattened, onCollapse }}\n >\n {children}\n </ContainersContext.Provider>\n {createPortal(\n <DragOverlay style={{ width: 'auto', zIndex: 1001 }} modifiers={[restrictToWindowEdges]}>\n {active ? <DragOverlayRenderer activeItem={active} /> : null}\n </DragOverlay>,\n document.body,\n )}\n </DndContext>\n );\n};\n\nconst DSDragAndDropWithSchema = describe(DSDragAndDrop);\n\nDSDragAndDropWithSchema.propTypes = DSDragAndDropPropTypes;\n\nexport { DSDragAndDropWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwEnB;AAvEJ,mBAA+B;AAC/B,uBAA6B;AAC7B,eAMO;AACP,iCAAkC;AAClC,8BAAyB;AAEzB,mCAAuC;AAEvC,MAAM,UAAU,CACd,OACA,WAAoC,MACpC,QAAQ,GACR,YAAY,QACZ,YAAY,EAAE,OAAO,EAAE,MAEvB,MAAM,OAAO,CAAC,KAAK,MAAM,UAAU;AACjC,MAAI,KAAK;AAAA,IACP,GAAG;AAAA,IACH,KAAK,KAAK;AAAA,IACV,eAAe,MAAM,UAAU,UAAU;AAAA,IACzC,UAAU;AAAA,IACV,WAAW,UAAU;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,MAAI,KAAK,UAAU,SAAS,KAAK,KAAK,cAAc,OAAO;AACzD,QAAI,KAAK,GAAG,QAAQ,KAAK,UAAU,KAAK,MAAM,QAAQ,GAAG,WAAW,SAAS,CAAC;AAAA,EAChF;AACA,SAAO;AACT,GAAG,CAAC,CAAc;AAEb,MAAM,gBAAgB,CAAK;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,sBAAsB;AAAA,EACtB,GAAG;AACL,MAA+B;AAC7B,QAAM,qBAAiB;AAAA,IACrB,MACE,OAAO,KAAK,KAAK,EAAE;AAAA,MACjB,CAAC,KAAK,cAAc;AAClB,YAAI,SAAS,IAAI,QAAQ,MAAM,SAAS,GAAgB,MAAM,GAAG,SAAS;AAC1E,eAAO;AAAA,MACT;AAAA,MACA,CAAC;AAAA,IACH;AAAA,IACF,CAAC,KAAK;AAAA,EACR;AACA,QAAM,EAAE,iBAAiB,sBAAsB,QAAQ,uBAAuB,YAAY,QACxF,mCAAyB;AAAA,IACvB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA,gBAAgB,MAAM;AAAA,IACtB,GAAG;AAAA,EACL,CAAC;AAEH,SACE,6CAAC,uBAAY,GAAG,iBACd;AAAA;AAAA,MAAC,6CAAkB;AAAA,MAAlB;AAAA,QACC,OAAO,EAAE,sBAAsB,uBAAuB,aAAa,OAAO,gBAAgB,WAAW;AAAA,QAEpG;AAAA;AAAA,IACH;AAAA,QACC;AAAA,MACC,4CAAC,wBAAY,OAAO,EAAE,OAAO,QAAQ,QAAQ,KAAK,GAAG,WAAW,CAAC,8BAAqB,GACnF,mBAAS,4CAAC,uBAAoB,YAAY,QAAQ,IAAK,MAC1D;AAAA,MACA,SAAS;AAAA,IACX;AAAA,KACF;AAEJ;AAEA,MAAM,8BAA0B,kCAAS,aAAa;AAEtD,wBAAwB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/{exported-related/SortableContainerContext.js → parts/DSDragAndDrop/index.js}
RENAMED
|
@@ -26,20 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
var DSDragAndDrop_exports = {};
|
|
30
|
+
__export(DSDragAndDrop_exports, {
|
|
31
|
+
DSDragAndDrop: () => import_DSDragAndDrop.DSDragAndDrop,
|
|
32
|
+
DSDragAndDropWithSchema: () => import_DSDragAndDrop.DSDragAndDropWithSchema
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(DSDragAndDrop_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
return (0, import_react.createContext)({
|
|
39
|
-
sortableContextProps: {},
|
|
40
|
-
items: {}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
const ContainersContext = createContainerContext();
|
|
44
|
-
var SortableContainerContext_default = ContainersContext;
|
|
45
|
-
//# sourceMappingURL=SortableContainerContext.js.map
|
|
36
|
+
var import_DSDragAndDrop = require("./DSDragAndDrop.js");
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/DSDragAndDrop/index.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { DSDragAndDrop, DSDragAndDropWithSchema } from './DSDragAndDrop.js';\nexport type { DSDragAndDropT, DnDReOrder, ItemProp, Item } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAuD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSDragAndDropPropTypes: () => DSDragAndDropPropTypes,
|
|
32
|
+
defaultProps: () => defaultProps
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
const defaultProps = {};
|
|
38
|
+
const DSDragAndDropPropTypes = {
|
|
39
|
+
items: import_ds_props_helpers.PropTypes.object.description("The items to be rendered in the drag and drop container").isRequired,
|
|
40
|
+
onReorder: import_ds_props_helpers.PropTypes.func.description("The function to be called when an item is reordered").isRequired,
|
|
41
|
+
children: import_ds_props_helpers.PropTypes.node.description("The children to be rendered in the drag and drop container").isRequired,
|
|
42
|
+
DragOverlayRenderer: import_ds_props_helpers.PropTypes.node.description("The component to be rendered as the drag overlay").isRequired,
|
|
43
|
+
onCollapse: import_ds_props_helpers.PropTypes.func.description("The function to be called when an item is collapsed"),
|
|
44
|
+
maxDragAndDropLevel: import_ds_props_helpers.PropTypes.number.description("The maximum level of drag and drop")
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/DSDragAndDrop/react-desc-prop-types.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\n/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { DnDKitTree } from '../../tree/types.js';\nimport { type Active } from '../../index.js';\n\nexport type DnDReOrder<T> = DnDKitTree.OnReorder<T>;\n\nexport type ItemProp<T> = {\n dsId: number | string;\n subitems?: ItemProp<T>[] | [];\n} & T;\n\n// opinionated item type\nexport type Item<T> = DnDKitTree.Item<T> & {\n dsId: number | string;\n subitems?: Item<T>[];\n} & T;\n\nexport declare namespace DSDragAndDropT {\n export interface RequiredProps<T> {\n items: Record<string, ItemProp<T>[]>;\n onReorder: DnDKitTree.OnReorder<T>;\n children: React.ReactNode;\n DragOverlayRenderer: React.ComponentType<{ activeItem: Active }>;\n }\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n onCollapse?: (nodeId: string) => void;\n maxDragAndDropLevel?: number;\n }\n\n export interface Props<T> extends Partial<DefaultProps>, OptionalProps, XstyledProps, RequiredProps<T> {}\n\n export interface InternalProps<T> extends DefaultProps, OptionalProps, XstyledProps, RequiredProps<T> {}\n}\n\nexport const defaultProps: DSDragAndDropT.DefaultProps = {};\n\nexport const DSDragAndDropPropTypes = {\n items: PropTypes.object.description('The items to be rendered in the drag and drop container').isRequired,\n onReorder: PropTypes.func.description('The function to be called when an item is reordered').isRequired,\n children: PropTypes.node.description('The children to be rendered in the drag and drop container').isRequired,\n DragOverlayRenderer: PropTypes.node.description('The component to be rendered as the drag overlay').isRequired,\n onCollapse: PropTypes.func.description('The function to be called when an item is collapsed'),\n maxDragAndDropLevel: PropTypes.number.description('The maximum level of drag and drop'),\n} as React.WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAA0B;AAqCnB,MAAM,eAA4C,CAAC;AAEnD,MAAM,yBAAyB;AAAA,EACpC,OAAO,kCAAU,OAAO,YAAY,yDAAyD,EAAE;AAAA,EAC/F,WAAW,kCAAU,KAAK,YAAY,qDAAqD,EAAE;AAAA,EAC7F,UAAU,kCAAU,KAAK,YAAY,4DAA4D,EAAE;AAAA,EACnG,qBAAqB,kCAAU,KAAK,YAAY,kDAAkD,EAAE;AAAA,EACpG,YAAY,kCAAU,KAAK,YAAY,qDAAqD;AAAA,EAC5F,qBAAqB,kCAAU,OAAO,YAAY,oCAAoC;AACxF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = __toESM(require("react"));
|
|
27
|
+
var import__ = require("../index.js");
|
|
28
|
+
const ref = import_react.default.createRef();
|
|
29
|
+
const noop = () => {
|
|
30
|
+
};
|
|
31
|
+
const testRequiredProps = {
|
|
32
|
+
items: {},
|
|
33
|
+
onReorder: noop,
|
|
34
|
+
children: "Content",
|
|
35
|
+
DragOverlayRenderer: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {})
|
|
36
|
+
};
|
|
37
|
+
const testOptionalProps = {
|
|
38
|
+
onCollapse: (nodeId) => {
|
|
39
|
+
},
|
|
40
|
+
maxDragAndDropLevel: 10
|
|
41
|
+
};
|
|
42
|
+
const testPartialDefaults = {
|
|
43
|
+
onReorder: noop,
|
|
44
|
+
children: "Content",
|
|
45
|
+
DragOverlayRenderer: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {})
|
|
46
|
+
};
|
|
47
|
+
const testProps = {
|
|
48
|
+
...testRequiredProps,
|
|
49
|
+
...testOptionalProps,
|
|
50
|
+
...testPartialDefaults
|
|
51
|
+
};
|
|
52
|
+
const testPropsAsSyntax = {
|
|
53
|
+
...testRequiredProps,
|
|
54
|
+
...testOptionalProps,
|
|
55
|
+
...testPartialDefaults
|
|
56
|
+
};
|
|
57
|
+
const testCompleteDefaults = {
|
|
58
|
+
items: {},
|
|
59
|
+
onReorder: noop,
|
|
60
|
+
children: "Content",
|
|
61
|
+
DragOverlayRenderer: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {})
|
|
62
|
+
};
|
|
63
|
+
const testInternalProps = {
|
|
64
|
+
...testRequiredProps,
|
|
65
|
+
...testOptionalProps,
|
|
66
|
+
...testCompleteDefaults
|
|
67
|
+
};
|
|
68
|
+
const testInternalPropsAsSyntax = {
|
|
69
|
+
...testRequiredProps,
|
|
70
|
+
...testOptionalProps,
|
|
71
|
+
...testCompleteDefaults
|
|
72
|
+
};
|
|
73
|
+
const testExplicitDefinition = {
|
|
74
|
+
items: {},
|
|
75
|
+
onReorder: noop,
|
|
76
|
+
children: "Content",
|
|
77
|
+
DragOverlayRenderer: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {})
|
|
78
|
+
};
|
|
79
|
+
const testInferedTypeCompatibility = {
|
|
80
|
+
items: {},
|
|
81
|
+
onReorder: noop,
|
|
82
|
+
children: "Content",
|
|
83
|
+
DragOverlayRenderer: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {})
|
|
84
|
+
};
|
|
85
|
+
const testDefinitionAsConst = {
|
|
86
|
+
items: {},
|
|
87
|
+
onReorder: noop,
|
|
88
|
+
children: "Content",
|
|
89
|
+
DragOverlayRenderer: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {})
|
|
90
|
+
};
|
|
91
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSDragAndDrop, { ...testExplicitDefinition }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSDragAndDrop, { ...testInferedTypeCompatibility }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSDragAndDrop, { ...testDefinitionAsConst }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSDragAndDrop, { items: {}, onReorder: noop, children: "Content", DragOverlayRenderer: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}) })
|
|
96
|
+
] });
|
|
97
|
+
//# sourceMappingURL=typescript-dialog-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSDragAndDrop/typescript-testing/typescript-dialog-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React, { type MutableRefObject } from 'react';\nimport { DSDragAndDrop } from '../index.js';\nimport type { DSDragAndDropT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\n\ntype ComponentPropsForApp = DSDragAndDropT.Props<object>;\ntype ComponentPropsInternals = DSDragAndDropT.InternalProps<object>;\ntype ComponentPropsDefaultProps = DSDragAndDropT.DefaultProps;\ntype ComponentPropsOptionalProps = DSDragAndDropT.OptionalProps;\ntype ComponentPropsRequiredProps = DSDragAndDropT.RequiredProps<object>; // Provide the type argument here\n\nconst ref = React.createRef() as MutableRefObject<HTMLElement>;\nconst noop = () => {};\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n items: {},\n onReorder: noop,\n children: 'Content',\n DragOverlayRenderer: () => <div />,\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n onCollapse: (nodeId: string) => {},\n maxDragAndDropLevel: 10,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n onReorder: noop,\n children: 'Content',\n DragOverlayRenderer: () => <div />,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n items: {},\n onReorder: noop,\n children: 'Content',\n DragOverlayRenderer: () => <div />,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n items: {},\n onReorder: noop,\n children: 'Content',\n DragOverlayRenderer: () => <div />,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n items: {},\n onReorder: noop,\n children: 'Content',\n DragOverlayRenderer: () => <div />,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n items: {},\n onReorder: noop,\n children: 'Content',\n DragOverlayRenderer: () => <div />,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSDragAndDrop {...testExplicitDefinition} />\n <DSDragAndDrop {...testInferedTypeCompatibility} />\n <DSDragAndDrop {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSDragAndDrop items={{}} onReorder={noop} children=\"Content\" DragOverlayRenderer={() => <div />} />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACoBM;AAnB7B,mBAA6C;AAC7C,eAA8B;AAW9B,MAAM,MAAM,aAAAA,QAAM,UAAU;AAC5B,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,oBAAiD;AAAA,EACrD,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,qBAAqB,MAAM,4CAAC,SAAI;AAClC;AAEA,MAAM,oBAAiD;AAAA,EACrD,YAAY,CAAC,WAAmB;AAAA,EAAC;AAAA,EACjC,qBAAqB;AACvB;AAIA,MAAM,sBAA2D;AAAA,EAC/D,WAAW;AAAA,EACX,UAAU;AAAA,EACV,qBAAqB,MAAM,4CAAC,SAAI;AAClC;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,qBAAqB,MAAM,4CAAC,SAAI;AAClC;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,qBAAqB,MAAM,4CAAC,SAAI;AAClC;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,qBAAqB,MAAM,4CAAC,SAAI;AAClC;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO,CAAC;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,qBAAqB,MAAM,4CAAC,SAAI;AAClC;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,0BAAe,GAAG,wBAAwB;AAAA,EAC3C,4CAAC,0BAAe,GAAG,8BAA8B;AAAA,EACjD,4CAAC,0BAAe,GAAG,uBAAuB;AAAA,EAE1C,4CAAC,0BAAc,OAAO,CAAC,GAAG,WAAW,MAAM,UAAS,WAAU,qBAAqB,MAAM,4CAAC,SAAI,GAAI;AAAA,GACpG;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -28,31 +28,28 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var DropIndicator_exports = {};
|
|
30
30
|
__export(DropIndicator_exports, {
|
|
31
|
-
DropIndicator: () => DropIndicator
|
|
31
|
+
DropIndicator: () => DropIndicator,
|
|
32
|
+
DropIndicatorWithSchema: () => DropIndicatorWithSchema
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(DropIndicator_exports);
|
|
34
35
|
var React = __toESM(require("react"));
|
|
35
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
37
|
var import_ds_system = require("@elliemae/ds-system");
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Before: "before",
|
|
40
|
-
After: "after",
|
|
41
|
-
Inside: "inside"
|
|
42
|
-
};
|
|
38
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
39
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
43
40
|
const getPositionStyles = ({
|
|
44
41
|
dropIndicatorPosition,
|
|
45
42
|
vertical
|
|
46
43
|
}) => {
|
|
47
44
|
if (vertical) {
|
|
48
45
|
return `
|
|
49
|
-
left: ${dropIndicatorPosition === DropIndicatorPosition.Before ? "0" : "unset"};
|
|
50
|
-
right: ${dropIndicatorPosition === DropIndicatorPosition.After ? "0" : "unset"};
|
|
46
|
+
left: ${dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.Before ? "0" : "unset"};
|
|
47
|
+
right: ${dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.After ? "0" : "unset"};
|
|
51
48
|
`;
|
|
52
49
|
}
|
|
53
50
|
return `
|
|
54
|
-
top: ${dropIndicatorPosition === DropIndicatorPosition.Before ? "0" : "unset"};
|
|
55
|
-
bottom: ${dropIndicatorPosition === DropIndicatorPosition.After ? "0" : "unset"};
|
|
51
|
+
top: ${dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.Before ? "0" : "unset"};
|
|
52
|
+
bottom: ${dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.After ? "0" : "unset"};
|
|
56
53
|
`;
|
|
57
54
|
};
|
|
58
55
|
const getCircleStyles = ({
|
|
@@ -61,10 +58,10 @@ const getCircleStyles = ({
|
|
|
61
58
|
}) => ({
|
|
62
59
|
position: "absolute",
|
|
63
60
|
zIndex: 1e3,
|
|
64
|
-
top: vertical || dropIndicatorPosition === DropIndicatorPosition.After ? "unset" : "-2px",
|
|
65
|
-
bottom: vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? "unset" : "-2px",
|
|
66
|
-
left: !vertical || dropIndicatorPosition === DropIndicatorPosition.After ? "unset" : "-2px",
|
|
67
|
-
right: !vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? "unset" : "-2px",
|
|
61
|
+
top: vertical || dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.After ? "unset" : "-2px",
|
|
62
|
+
bottom: vertical || dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.Before ? "unset" : "-2px",
|
|
63
|
+
left: !vertical || dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.After ? "unset" : "-2px",
|
|
64
|
+
right: !vertical || dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.Before ? "unset" : "-2px",
|
|
68
65
|
opacity: 1
|
|
69
66
|
});
|
|
70
67
|
const StyledIndicator = import_ds_system.styled.div`
|
|
@@ -79,9 +76,9 @@ const StyledIndicator = import_ds_system.styled.div`
|
|
|
79
76
|
const CircleIndicator = (style, isDropValid) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { height: "6", width: "6", style, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "3", cy: "3", r: "3", strokeWidth: "0", fill: isDropValid ? "#1E79C2" : "#C64252" }) });
|
|
80
77
|
const DropIndicator = (props) => {
|
|
81
78
|
const { vertical, dropIndicatorPosition, isLast, isDropValid } = props;
|
|
82
|
-
if (dropIndicatorPosition === false || dropIndicatorPosition === DropIndicatorPosition.None || dropIndicatorPosition === DropIndicatorPosition.Inside)
|
|
79
|
+
if (dropIndicatorPosition === false || dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.None || dropIndicatorPosition === import_react_desc_prop_types.DropIndicatorPosition.Inside)
|
|
83
80
|
return null;
|
|
84
|
-
const safeDropIndicatorPosition = isLast ? DropIndicatorPosition.Before : dropIndicatorPosition;
|
|
81
|
+
const safeDropIndicatorPosition = isLast ? import_react_desc_prop_types.DropIndicatorPosition.Before : dropIndicatorPosition;
|
|
85
82
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
86
83
|
CircleIndicator(getCircleStyles({ ...props, dropIndicatorPosition: safeDropIndicatorPosition }), isDropValid),
|
|
87
84
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -94,4 +91,6 @@ const DropIndicator = (props) => {
|
|
|
94
91
|
)
|
|
95
92
|
] });
|
|
96
93
|
};
|
|
94
|
+
const DropIndicatorWithSchema = (0, import_ds_props_helpers.describe)(DropIndicator);
|
|
95
|
+
DropIndicatorWithSchema.propTypes = import_react_desc_prop_types.DSDropIndicatorPropTypes;
|
|
97
96
|
//# sourceMappingURL=DropIndicator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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';\nimport { describe } from '@elliemae/ds-props-helpers';\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;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDnB;AAnDJ,uBAAuB;AACvB,mCAAuF;AACvF,8BAAyB;AAEzB,MAAM,oBAAoB,CAAC;AAAA,EACzB;AAAA,EACA;AACF,MAGM;AACJ,MAAI,UAAU;AACZ,WAAO;AAAA,cACG,0BAA0B,mDAAsB,SAAS,MAAM,OAAO;AAAA,eACrE,0BAA0B,mDAAsB,QAAQ,MAAM,OAAO;AAAA;AAAA,EAElF;AACA,SAAO;AAAA,aACI,0BAA0B,mDAAsB,SAAS,MAAM,OAAO;AAAA,gBACnE,0BAA0B,mDAAsB,QAAQ,MAAM,OAAO;AAAA;AAErF;AAEA,MAAM,kBAAkB,CAAC;AAAA,EACvB;AAAA,EACA;AACF,OAGO;AAAA,EACL,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,KAAK,YAAY,0BAA0B,mDAAsB,QAAQ,UAAU;AAAA,EACnF,QAAQ,YAAY,0BAA0B,mDAAsB,SAAS,UAAU;AAAA,EACvF,MAAM,CAAC,YAAY,0BAA0B,mDAAsB,QAAQ,UAAU;AAAA,EACrF,OAAO,CAAC,YAAY,0BAA0B,mDAAsB,SAAS,UAAU;AAAA,EACvF,SAAS;AACX;AAEA,MAAM,kBAAkB,wBAAO;AAAA;AAAA,IAE3B,iBAAiB;AAAA;AAAA,WAEV,CAAC,UAAW,MAAM,WAAW,QAAQ,MAAO;AAAA,YAC3C,CAAC,UAAW,MAAM,WAAW,SAAS,KAAM;AAAA,sBAClC,CAAC,EAAE,aAAa,MAAM,MAAO,cAAc,MAAM,OAAO,MAAM,GAAG,IAAI,MAAM,OAAO,OAAO,GAAG,CAAE;AAAA,aACvG,GAAI;AAAA;AAGjB,MAAM,kBAAkB,CAAC,OAAgC,gBACvD,4CAAC,SAAI,QAAO,KAAI,OAAM,KAAI,OACxB,sDAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,KAAI,aAAY,KAAI,MAAM,cAAc,YAAY,WAAW,GACzF;AAGK,MAAM,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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSDropIndicator_exports = {};
|
|
30
|
+
__export(DSDropIndicator_exports, {
|
|
31
|
+
DropIndicator: () => import_DropIndicator.DropIndicator,
|
|
32
|
+
DropIndicatorWithSchema: () => import_DropIndicator.DropIndicatorWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSDropIndicator_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_DropIndicator = require("./DropIndicator.js");
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/DSDropIndicator/index.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { DropIndicator, DropIndicatorWithSchema } from './DropIndicator.js';\nexport type { DSDropIndicatorT, DSDropIndicatorPropTypes } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAuD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSDropIndicatorPropTypes: () => DSDropIndicatorPropTypes,
|
|
32
|
+
DropIndicatorPosition: () => DropIndicatorPosition
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
const DropIndicatorPosition = {
|
|
38
|
+
None: "none",
|
|
39
|
+
Before: "before",
|
|
40
|
+
After: "after",
|
|
41
|
+
Inside: "inside"
|
|
42
|
+
};
|
|
43
|
+
const DSDropIndicatorPropTypes = {
|
|
44
|
+
vertical: import_ds_props_helpers.PropTypes.bool.description("Whether the drop indicator is vertical.").isRequired,
|
|
45
|
+
dropIndicatorPosition: import_ds_props_helpers.PropTypes.oneOf(Object.values(DropIndicatorPosition)).description(
|
|
46
|
+
"The position of the drop indicator."
|
|
47
|
+
).isRequired,
|
|
48
|
+
isDropValid: import_ds_props_helpers.PropTypes.bool.description("Whether the drop is valid.").isRequired,
|
|
49
|
+
isLast: import_ds_props_helpers.PropTypes.bool.description("Whether the drop indicator is the last one.")
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/DSDropIndicator/react-desc-prop-types.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\n/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport const DropIndicatorPosition = {\n None: 'none',\n Before: 'before',\n After: 'after',\n Inside: 'inside',\n};\n\nexport declare namespace DSDropIndicatorT {\n export type DropIndicatorPositionT = (typeof DropIndicatorPosition)[keyof typeof DropIndicatorPosition] | false;\n\n export interface RequiredProps {\n vertical: boolean;\n dropIndicatorPosition: DropIndicatorPositionT;\n isDropValid: boolean;\n }\n\n export interface DefaultProps {}\n\n export interface OptionalProps {\n isLast?: boolean;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {}\n}\n\nexport const DSDropIndicatorPropTypes = {\n vertical: PropTypes.bool.description('Whether the drop indicator is vertical.').isRequired,\n dropIndicatorPosition: PropTypes.oneOf(Object.values(DropIndicatorPosition)).description(\n 'The position of the drop indicator.',\n ).isRequired,\n isDropValid: PropTypes.bool.description('Whether the drop is valid.').isRequired,\n isLast: PropTypes.bool.description('Whether the drop indicator is the last one.'),\n} as React.WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAA0B;AAEnB,MAAM,wBAAwB;AAAA,EACnC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AACV;AAsBO,MAAM,2BAA2B;AAAA,EACtC,UAAU,kCAAU,KAAK,YAAY,yCAAyC,EAAE;AAAA,EAChF,uBAAuB,kCAAU,MAAM,OAAO,OAAO,qBAAqB,CAAC,EAAE;AAAA,IAC3E;AAAA,EACF,EAAE;AAAA,EACF,aAAa,kCAAU,KAAK,YAAY,4BAA4B,EAAE;AAAA,EACtE,QAAQ,kCAAU,KAAK,YAAY,6CAA6C;AAClF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import__ = require("../index.js");
|
|
27
|
+
const testRequiredProps = {
|
|
28
|
+
vertical: true,
|
|
29
|
+
dropIndicatorPosition: "before",
|
|
30
|
+
isDropValid: true
|
|
31
|
+
};
|
|
32
|
+
const testOptionalProps = {
|
|
33
|
+
isLast: true
|
|
34
|
+
};
|
|
35
|
+
const testPartialDefaults = {
|
|
36
|
+
isDropValid: true
|
|
37
|
+
};
|
|
38
|
+
const testProps = {
|
|
39
|
+
...testRequiredProps,
|
|
40
|
+
...testOptionalProps,
|
|
41
|
+
...testPartialDefaults
|
|
42
|
+
};
|
|
43
|
+
const testPropsAsSyntax = {
|
|
44
|
+
...testRequiredProps,
|
|
45
|
+
...testOptionalProps,
|
|
46
|
+
...testPartialDefaults
|
|
47
|
+
};
|
|
48
|
+
const testCompleteDefaults = {
|
|
49
|
+
vertical: true,
|
|
50
|
+
dropIndicatorPosition: "before",
|
|
51
|
+
isDropValid: true,
|
|
52
|
+
isLast: false
|
|
53
|
+
};
|
|
54
|
+
const testInternalProps = {
|
|
55
|
+
...testRequiredProps,
|
|
56
|
+
...testOptionalProps,
|
|
57
|
+
...testCompleteDefaults
|
|
58
|
+
};
|
|
59
|
+
const testInternalPropsAsSyntax = {
|
|
60
|
+
...testRequiredProps,
|
|
61
|
+
...testOptionalProps,
|
|
62
|
+
...testCompleteDefaults
|
|
63
|
+
};
|
|
64
|
+
const testExplicitDefinition = {
|
|
65
|
+
vertical: true,
|
|
66
|
+
dropIndicatorPosition: "before",
|
|
67
|
+
isDropValid: true,
|
|
68
|
+
isLast: false
|
|
69
|
+
};
|
|
70
|
+
const testInferedTypeCompatibility = {
|
|
71
|
+
vertical: true,
|
|
72
|
+
dropIndicatorPosition: "before",
|
|
73
|
+
isDropValid: true,
|
|
74
|
+
isLast: false
|
|
75
|
+
};
|
|
76
|
+
const testDefinitionAsConst = {
|
|
77
|
+
vertical: true,
|
|
78
|
+
dropIndicatorPosition: "before",
|
|
79
|
+
isDropValid: true,
|
|
80
|
+
isLast: false
|
|
81
|
+
};
|
|
82
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DropIndicator, { ...testExplicitDefinition }),
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DropIndicator, { ...testInferedTypeCompatibility }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DropIndicator, { ...testDefinitionAsConst }),
|
|
86
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DropIndicator, { vertical: true, dropIndicatorPosition: "before", isDropValid: true, isLast: false })
|
|
87
|
+
] });
|
|
88
|
+
//# sourceMappingURL=typescript-dialog-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSDropIndicator/typescript-testing/typescript-dialog-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DropIndicator } from '../index.js';\nimport type { DSDropIndicatorT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\n\ntype ComponentPropsForApp = DSDropIndicatorT.Props;\ntype ComponentPropsInternals = DSDropIndicatorT.InternalProps;\ntype ComponentPropsDefaultProps = DSDropIndicatorT.DefaultProps;\ntype ComponentPropsOptionalProps = DSDropIndicatorT.OptionalProps;\ntype ComponentPropsRequiredProps = DSDropIndicatorT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n vertical: true,\n dropIndicatorPosition: 'before',\n isDropValid: true,\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n isLast: true,\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n isDropValid: true,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n vertical: true,\n dropIndicatorPosition: 'before',\n isDropValid: true,\n isLast: false,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n vertical: true,\n dropIndicatorPosition: 'before',\n isDropValid: true,\n isLast: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n vertical: true,\n dropIndicatorPosition: 'before',\n isDropValid: true,\n isLast: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n vertical: true,\n dropIndicatorPosition: 'before',\n isDropValid: true,\n isLast: false,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DropIndicator {...testExplicitDefinition} />\n <DropIndicator {...testInferedTypeCompatibility} />\n <DropIndicator {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DropIndicator vertical={true} dropIndicatorPosition=\"before\" isDropValid={true} isLast={false} />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACoFrB;AAnFF,eAA8B;AAW9B,MAAM,oBAAiD;AAAA,EACrD,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,aAAa;AACf;AAEA,MAAM,oBAAiD;AAAA,EACrD,QAAQ;AACV;AAIA,MAAM,sBAA2D;AAAA,EAC/D,aAAa;AACf;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,QAAQ;AACV;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,QAAQ;AACV;AAGA,MAAM,+BAA+B;AAAA,EACnC,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,QAAQ;AACV;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,aAAa;AAAA,EACb,QAAQ;AACV;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,0BAAe,GAAG,wBAAwB;AAAA,EAC3C,4CAAC,0BAAe,GAAG,8BAA8B;AAAA,EACjD,4CAAC,0BAAe,GAAG,uBAAuB;AAAA,EAE1C,4CAAC,0BAAc,UAAU,MAAM,uBAAsB,UAAS,aAAa,MAAM,QAAQ,OAAO;AAAA,GAClG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|