@elliemae/ds-data-table 3.10.0-next.0 → 3.10.0-next.2

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.
Files changed (52) hide show
  1. package/dist/cjs/DataTableSchema.js +1 -0
  2. package/dist/cjs/DataTableSchema.js.map +2 -2
  3. package/dist/cjs/configs/useRowFlattenization.js +5 -2
  4. package/dist/cjs/configs/useRowFlattenization.js.map +2 -2
  5. package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js +39 -57
  6. package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
  7. package/dist/cjs/exported-related/RowRenderer/index.js +6 -3
  8. package/dist/cjs/exported-related/RowRenderer/index.js.map +2 -2
  9. package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js.map +1 -1
  10. package/dist/cjs/exported-related/RowRenderer/useRowStyle.js +3 -1
  11. package/dist/cjs/exported-related/RowRenderer/useRowStyle.js.map +2 -2
  12. package/dist/cjs/parts/DropIndicator.js +9 -7
  13. package/dist/cjs/parts/DropIndicator.js.map +2 -2
  14. package/dist/cjs/parts/HoC/DnDTreeContext.js +33 -0
  15. package/dist/cjs/parts/HoC/DnDTreeContext.js.map +7 -0
  16. package/dist/cjs/parts/HoC/SortableItemContext.js.map +1 -1
  17. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +34 -26
  18. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
  19. package/dist/cjs/parts/HoC/withDnDSortableRowContext.js +4 -3
  20. package/dist/cjs/parts/HoC/withDnDSortableRowContext.js.map +2 -2
  21. package/dist/cjs/parts/RowVariants/types.js.map +1 -1
  22. package/dist/cjs/parts/Rows.js +3 -2
  23. package/dist/cjs/parts/Rows.js.map +2 -2
  24. package/dist/cjs/styled.js +4 -4
  25. package/dist/cjs/styled.js.map +2 -2
  26. package/dist/cjs/types/props.js.map +2 -2
  27. package/dist/esm/DataTableSchema.js +1 -0
  28. package/dist/esm/DataTableSchema.js.map +2 -2
  29. package/dist/esm/configs/useRowFlattenization.js +5 -2
  30. package/dist/esm/configs/useRowFlattenization.js.map +2 -2
  31. package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js +39 -57
  32. package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
  33. package/dist/esm/exported-related/RowRenderer/index.js +6 -3
  34. package/dist/esm/exported-related/RowRenderer/index.js.map +2 -2
  35. package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js.map +1 -1
  36. package/dist/esm/exported-related/RowRenderer/useRowStyle.js +3 -1
  37. package/dist/esm/exported-related/RowRenderer/useRowStyle.js.map +2 -2
  38. package/dist/esm/parts/DropIndicator.js +9 -7
  39. package/dist/esm/parts/DropIndicator.js.map +2 -2
  40. package/dist/esm/parts/HoC/DnDTreeContext.js +7 -0
  41. package/dist/esm/parts/HoC/DnDTreeContext.js.map +7 -0
  42. package/dist/esm/parts/HoC/SortableItemContext.js.map +1 -1
  43. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +34 -26
  44. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
  45. package/dist/esm/parts/HoC/withDnDSortableRowContext.js +4 -3
  46. package/dist/esm/parts/HoC/withDnDSortableRowContext.js.map +2 -2
  47. package/dist/esm/parts/Rows.js +4 -3
  48. package/dist/esm/parts/Rows.js.map +2 -2
  49. package/dist/esm/styled.js +4 -4
  50. package/dist/esm/styled.js.map +2 -2
  51. package/dist/esm/types/props.js.map +2 -2
  52. package/package.json +18 -18
@@ -24,29 +24,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
25
  var withConditionalDnDRowContext_exports = {};
26
26
  __export(withConditionalDnDRowContext_exports, {
27
- DnDTreeContext: () => DnDTreeContext,
28
27
  withConditionalDnDRowContext: () => withConditionalDnDRowContext
29
28
  });
30
29
  module.exports = __toCommonJS(withConditionalDnDRowContext_exports);
31
30
  var React = __toESM(require("react"));
32
31
  var import_jsx_runtime = require("react/jsx-runtime");
33
32
  var import_react = __toESM(require("react"));
34
- var import_DataTableContext = require("../../DataTableContext");
35
33
  var import_ds_drag_and_drop = require("@elliemae/ds-drag-and-drop");
36
- var import_Row = require("../Row");
37
34
  var import_react_dom = require("react-dom");
38
- var import_props = require("../../types/props");
39
- const DnDTreeContext = (0, import_react.createContext)({
40
- depth: void 0,
41
- activeIndex: void 0,
42
- visibleItems: void 0,
43
- dropIndicatorPosition: import_props.DropIndicatorPosition.None,
44
- lastActiveId: void 0,
45
- setLastActiveId: void 0
46
- });
35
+ var import_DataTableContext = require("../../DataTableContext");
36
+ var import_Row = require("../Row");
37
+ var import_DnDTreeContext = require("./DnDTreeContext");
47
38
  const withConditionalDnDRowContext = (Component) => (props) => {
48
39
  const {
49
- tableProps: { dragAndDropRows, isExpandable, onRowsReorder, maxDragAndDropLevel },
40
+ tableProps: { dragAndDropRows, isExpandable, onRowsReorder, maxDragAndDropLevel, getIsDropValid },
50
41
  flattenedData,
51
42
  allDataFlattened
52
43
  } = import_react.default.useContext(import_DataTableContext.DataTableContext);
@@ -73,31 +64,48 @@ const withConditionalDnDRowContext = (Component) => (props) => {
73
64
  },
74
65
  [onRowsReorder]
75
66
  );
76
- const { dndContextProps, sortableContextProps, activeId, activeIndex, depth, dropIndicatorPosition, visibleItems } = (0, import_ds_drag_and_drop.useTreeDndkitConfig)({
67
+ const {
68
+ dndContextProps,
69
+ sortableContextProps,
70
+ activeId,
71
+ activeIndex,
72
+ depth,
73
+ dropIndicatorPosition,
74
+ visibleItems,
75
+ isDropValid
76
+ } = (0, import_ds_drag_and_drop.useTreeDndkitConfig)({
77
77
  flattenedItems: allDataFlattened,
78
78
  visibleItems: flattenedData,
79
79
  isHorizontalDnD: false,
80
80
  isExpandable,
81
81
  onReorder,
82
- maxDragAndDropLevel
82
+ maxDragAndDropLevel,
83
+ getIsDropValid
83
84
  });
84
- if (lastActiveId !== activeId && activeId)
85
- setLastActiveId(activeId);
85
+ (0, import_react.useEffect)(() => {
86
+ if (activeId)
87
+ setLastActiveId(activeId);
88
+ }, [activeId]);
89
+ const ctx = (0, import_react.useMemo)(
90
+ () => ({
91
+ activeIndex,
92
+ depth,
93
+ visibleItems,
94
+ dropIndicatorPosition,
95
+ lastActiveId,
96
+ setLastActiveId,
97
+ isDropValid
98
+ }),
99
+ [activeIndex, depth, visibleItems, dropIndicatorPosition, lastActiveId, isDropValid]
100
+ );
86
101
  if (dragAndDropRows)
87
102
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_drag_and_drop.DndContext, {
88
103
  ...dndContextProps,
89
104
  children: [
90
105
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_drag_and_drop.SortableContext, {
91
106
  ...sortableContextProps,
92
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DnDTreeContext.Provider, {
93
- value: {
94
- activeIndex,
95
- depth,
96
- visibleItems,
97
- dropIndicatorPosition,
98
- lastActiveId,
99
- setLastActiveId
100
- },
107
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DnDTreeContext.DnDTreeContext.Provider, {
108
+ value: ctx,
101
109
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
102
110
  ...props
103
111
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/HoC/withConditionalDnDRowContext.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { createContext, useCallback } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport { FunctionalHOC } from '../../types/FunctionalHoC';\nimport { DndContext, DragOverlay, SortableContext, useTreeDndkitConfig } from '@elliemae/ds-drag-and-drop';\nimport { Item } from '../../helpers/dndkit/tree/types';\nimport { Row } from '../Row';\nimport { createPortal } from 'react-dom';\nimport { DropIndicatorPosition } from '../../types/props';\n\ntype DnDTreeContextType = {\n depth: number;\n activeIndex: number;\n visibleItems: unknown[];\n dropIndicatorPosition: DropIndicatorPosition;\n lastActiveId: string;\n setLastActiveId: React.Dispatch<React.SetStateAction<string>>;\n};\n\nexport const DnDTreeContext = createContext<DnDTreeContextType>({\n depth: undefined,\n activeIndex: undefined,\n visibleItems: undefined,\n dropIndicatorPosition: DropIndicatorPosition.None,\n lastActiveId: undefined,\n setLastActiveId: undefined,\n});\n\n// only wraps in \"DnDContext\" and \"DnDTreeContext\" if any Drag and Drop functionality is requested\nexport const withConditionalDnDRowContext: FunctionalHOC = (Component) => (props) => {\n const {\n tableProps: { dragAndDropRows, isExpandable, onRowsReorder, maxDragAndDropLevel },\n flattenedData,\n allDataFlattened,\n } = React.useContext(DataTableContext);\n\n const [lastActiveId, setLastActiveId] = React.useState<string>(null);\n\n const onReorder = useCallback(\n (newData: Item[], indexes: { targetIndex: number; fromIndex: number }, considerExpanding: string) => {\n // Pull the row's original data into an object\n const nodes = {};\n newData.forEach((row) => {\n delete row.original.subRows;\n nodes[row.uid] = row.original;\n });\n const newUserData = [];\n newData.forEach((row) => {\n // If row has parent, insert it to it's subrows\n // otherwise append it to the new user data\n if (row.parentId) {\n const parentNode = nodes[row.parentId];\n if (parentNode?.subRows) parentNode.subRows.push(row.original);\n else parentNode.subRows = [row.original];\n } else newUserData.push(row.original);\n });\n // Tell the user that the order has change, he can chose to commit it or not\n onRowsReorder(newUserData, indexes, considerExpanding);\n },\n [onRowsReorder],\n );\n\n const { dndContextProps, sortableContextProps, activeId, activeIndex, depth, dropIndicatorPosition, visibleItems } =\n useTreeDndkitConfig({\n flattenedItems: allDataFlattened,\n visibleItems: flattenedData,\n isHorizontalDnD: false,\n isExpandable,\n onReorder,\n maxDragAndDropLevel,\n });\n\n if (lastActiveId !== activeId && activeId) setLastActiveId(activeId);\n\n if (dragAndDropRows)\n return (\n <DndContext {...dndContextProps}>\n <SortableContext {...sortableContextProps}>\n <DnDTreeContext.Provider\n value={{\n activeIndex,\n depth,\n visibleItems,\n dropIndicatorPosition,\n lastActiveId,\n setLastActiveId,\n }}\n >\n <Component {...props} />\n </DnDTreeContext.Provider>\n </SortableContext>\n {createPortal(\n <DragOverlay style={{ width: 'auto' }}>\n {activeId ? <Row row={flattenedData.find((row) => row.uid === activeId)} isDragOverlay /> : null}\n </DragOverlay>,\n document.body,\n )}\n </DndContext>\n );\n return <Component {...props} />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAAkD;AAClD,8BAAiC;AAEjC,8BAA8E;AAE9E,iBAAoB;AACpB,uBAA6B;AAC7B,mBAAsC;AAW/B,MAAM,qBAAiB,4BAAkC;AAAA,EAC9D,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc;AAAA,EACd,uBAAuB,mCAAsB;AAAA,EAC7C,cAAc;AAAA,EACd,iBAAiB;AACnB,CAAC;AAGM,MAAM,+BAA8C,CAAC,cAAc,CAAC,UAAU;AACnF,QAAM;AAAA,IACJ,YAAY,EAAE,iBAAiB,cAAc,eAAe,oBAAoB;AAAA,IAChF;AAAA,IACA;AAAA,EACF,IAAI,aAAAA,QAAM,WAAW,wCAAgB;AAErC,QAAM,CAAC,cAAc,eAAe,IAAI,aAAAA,QAAM,SAAiB,IAAI;AAEnE,QAAM,gBAAY;AAAA,IAChB,CAAC,SAAiB,SAAqD,sBAA8B;AAEnG,YAAM,QAAQ,CAAC;AACf,cAAQ,QAAQ,CAAC,QAAQ;AACvB,eAAO,IAAI,SAAS;AACpB,cAAM,IAAI,OAAO,IAAI;AAAA,MACvB,CAAC;AACD,YAAM,cAAc,CAAC;AACrB,cAAQ,QAAQ,CAAC,QAAQ;AAGvB,YAAI,IAAI,UAAU;AAChB,gBAAM,aAAa,MAAM,IAAI;AAC7B,cAAI,YAAY;AAAS,uBAAW,QAAQ,KAAK,IAAI,QAAQ;AAAA;AACxD,uBAAW,UAAU,CAAC,IAAI,QAAQ;AAAA,QACzC;AAAO,sBAAY,KAAK,IAAI,QAAQ;AAAA,MACtC,CAAC;AAED,oBAAc,aAAa,SAAS,iBAAiB;AAAA,IACvD;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AAEA,QAAM,EAAE,iBAAiB,sBAAsB,UAAU,aAAa,OAAO,uBAAuB,aAAa,QAC/G,6CAAoB;AAAA,IAClB,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAEH,MAAI,iBAAiB,YAAY;AAAU,oBAAgB,QAAQ;AAEnE,MAAI;AACF,WACE,6CAAC;AAAA,MAAY,GAAG;AAAA,MACd;AAAA,oDAAC;AAAA,UAAiB,GAAG;AAAA,UACnB,sDAAC,eAAe,UAAf;AAAA,YACC,OAAO;AAAA,cACL;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF;AAAA,YAEA,sDAAC;AAAA,cAAW,GAAG;AAAA,aAAO;AAAA,WACxB;AAAA,SACF;AAAA,YACC;AAAA,UACC,4CAAC;AAAA,YAAY,OAAO,EAAE,OAAO,OAAO;AAAA,YACjC,qBAAW,4CAAC;AAAA,cAAI,KAAK,cAAc,KAAK,CAAC,QAAQ,IAAI,QAAQ,QAAQ;AAAA,cAAG,eAAa;AAAA,aAAC,IAAK;AAAA,WAC9F;AAAA,UACA,SAAS;AAAA,QACX;AAAA;AAAA,KACF;AAEJ,SAAO,4CAAC;AAAA,IAAW,GAAG;AAAA,GAAO;AAC/B;",
4
+ "sourcesContent": ["/* eslint-disable react/function-component-definition */\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport { DndContext, DragOverlay, SortableContext, useTreeDndkitConfig } from '@elliemae/ds-drag-and-drop';\nimport { createPortal } from 'react-dom';\nimport { DataTableContext } from '../../DataTableContext';\nimport { FunctionalHOC } from '../../types/FunctionalHoC';\nimport { Row } from '../Row';\nimport { DnDTreeContext } from './DnDTreeContext';\n\n// only wraps in \"DnDContext\" and \"DnDTreeContext\" if any Drag and Drop functionality is requested\nexport const withConditionalDnDRowContext: FunctionalHOC = (Component) => (props) => {\n const {\n tableProps: { dragAndDropRows, isExpandable, onRowsReorder, maxDragAndDropLevel, getIsDropValid },\n flattenedData,\n allDataFlattened,\n } = React.useContext(DataTableContext);\n\n const [lastActiveId, setLastActiveId] = React.useState<string | null>(null);\n\n const onReorder = useCallback(\n (newData: unknown, indexes: { targetIndex: number; fromIndex: number }, considerExpanding: string) => {\n // Pull the row's original data into an object\n const nodes = {};\n newData.forEach((row) => {\n delete row.original.subRows;\n nodes[row.uid] = row.original;\n });\n const newUserData = [];\n newData.forEach((row) => {\n // If row has parent, insert it to it's subrows\n // otherwise append it to the new user data\n if (row.parentId) {\n const parentNode = nodes[row.parentId];\n if (parentNode?.subRows) parentNode.subRows.push(row.original);\n else parentNode.subRows = [row.original];\n } else newUserData.push(row.original);\n });\n // Tell the user that the order has change, he can chose to commit it or not\n onRowsReorder(newUserData, indexes, considerExpanding);\n },\n [onRowsReorder],\n );\n\n const {\n dndContextProps,\n sortableContextProps,\n activeId,\n activeIndex,\n depth,\n dropIndicatorPosition,\n visibleItems,\n isDropValid,\n } = useTreeDndkitConfig({\n flattenedItems: allDataFlattened,\n visibleItems: flattenedData,\n isHorizontalDnD: false,\n isExpandable,\n onReorder,\n maxDragAndDropLevel,\n getIsDropValid,\n });\n\n useEffect(() => {\n if (activeId) setLastActiveId(activeId);\n }, [activeId]);\n\n const ctx = useMemo(\n () => ({\n activeIndex,\n depth,\n visibleItems,\n dropIndicatorPosition,\n lastActiveId,\n setLastActiveId,\n isDropValid,\n }),\n [activeIndex, depth, visibleItems, dropIndicatorPosition, lastActiveId, isDropValid],\n );\n\n if (dragAndDropRows)\n return (\n <DndContext {...dndContextProps}>\n <SortableContext {...sortableContextProps}>\n <DnDTreeContext.Provider value={ctx}>\n <Component {...props} />\n </DnDTreeContext.Provider>\n </SortableContext>\n {createPortal(\n <DragOverlay style={{ width: 'auto' }}>\n {activeId ? <Row row={flattenedData.find((row) => row.uid === activeId)} isDragOverlay /> : null}\n </DragOverlay>,\n document.body,\n )}\n </DndContext>\n );\n return <Component {...props} />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAAuD;AACvD,8BAA8E;AAC9E,uBAA6B;AAC7B,8BAAiC;AAEjC,iBAAoB;AACpB,4BAA+B;AAGxB,MAAM,+BAA8C,CAAC,cAAc,CAAC,UAAU;AACnF,QAAM;AAAA,IACJ,YAAY,EAAE,iBAAiB,cAAc,eAAe,qBAAqB,eAAe;AAAA,IAChG;AAAA,IACA;AAAA,EACF,IAAI,aAAAA,QAAM,WAAW,wCAAgB;AAErC,QAAM,CAAC,cAAc,eAAe,IAAI,aAAAA,QAAM,SAAwB,IAAI;AAE1E,QAAM,gBAAY;AAAA,IAChB,CAAC,SAAkB,SAAqD,sBAA8B;AAEpG,YAAM,QAAQ,CAAC;AACf,cAAQ,QAAQ,CAAC,QAAQ;AACvB,eAAO,IAAI,SAAS;AACpB,cAAM,IAAI,OAAO,IAAI;AAAA,MACvB,CAAC;AACD,YAAM,cAAc,CAAC;AACrB,cAAQ,QAAQ,CAAC,QAAQ;AAGvB,YAAI,IAAI,UAAU;AAChB,gBAAM,aAAa,MAAM,IAAI;AAC7B,cAAI,YAAY;AAAS,uBAAW,QAAQ,KAAK,IAAI,QAAQ;AAAA;AACxD,uBAAW,UAAU,CAAC,IAAI,QAAQ;AAAA,QACzC;AAAO,sBAAY,KAAK,IAAI,QAAQ;AAAA,MACtC,CAAC;AAED,oBAAc,aAAa,SAAS,iBAAiB;AAAA,IACvD;AAAA,IACA,CAAC,aAAa;AAAA,EAChB;AAEA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,6CAAoB;AAAA,IACtB,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,8BAAU,MAAM;AACd,QAAI;AAAU,sBAAgB,QAAQ;AAAA,EACxC,GAAG,CAAC,QAAQ,CAAC;AAEb,QAAM,UAAM;AAAA,IACV,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,aAAa,OAAO,cAAc,uBAAuB,cAAc,WAAW;AAAA,EACrF;AAEA,MAAI;AACF,WACE,6CAAC;AAAA,MAAY,GAAG;AAAA,MACd;AAAA,oDAAC;AAAA,UAAiB,GAAG;AAAA,UACnB,sDAAC,qCAAe,UAAf;AAAA,YAAwB,OAAO;AAAA,YAC9B,sDAAC;AAAA,cAAW,GAAG;AAAA,aAAO;AAAA,WACxB;AAAA,SACF;AAAA,YACC;AAAA,UACC,4CAAC;AAAA,YAAY,OAAO,EAAE,OAAO,OAAO;AAAA,YACjC,qBAAW,4CAAC;AAAA,cAAI,KAAK,cAAc,KAAK,CAAC,QAAQ,IAAI,QAAQ,QAAQ;AAAA,cAAG,eAAa;AAAA,aAAC,IAAK;AAAA,WAC9F;AAAA,UACA,SAAS;AAAA,QACX;AAAA;AAAA,KACF;AAEJ,SAAO,4CAAC;AAAA,IAAW,GAAG;AAAA,GAAO;AAC/B;",
6
6
  "names": ["React"]
7
7
  }
@@ -32,13 +32,13 @@ var import_jsx_runtime = require("react/jsx-runtime");
32
32
  var import_react = require("react");
33
33
  var import_ds_drag_and_drop = require("@elliemae/ds-drag-and-drop");
34
34
  var import_DataTableContext = require("../../DataTableContext");
35
- var import_withConditionalDnDRowContext = require("./withConditionalDnDRowContext");
35
+ var import_DnDTreeContext = require("./DnDTreeContext");
36
36
  var import_SortableItemContext = require("./SortableItemContext");
37
37
  const withDnDSortableRowContext = (Component) => (props) => {
38
38
  const {
39
39
  tableProps: { dragAndDropRows }
40
40
  } = (0, import_react.useContext)(import_DataTableContext.DataTableContext);
41
- const { dropIndicatorPosition, lastActiveId, setLastActiveId } = (0, import_react.useContext)(import_withConditionalDnDRowContext.DnDTreeContext);
41
+ const { dropIndicatorPosition, lastActiveId, setLastActiveId, isDropValid } = (0, import_react.useContext)(import_DnDTreeContext.DnDTreeContext);
42
42
  const draggableOptions = (0, import_react.useMemo)(
43
43
  () => ({
44
44
  id: props.row.uid
@@ -55,7 +55,8 @@ const withDnDSortableRowContext = (Component) => (props) => {
55
55
  shouldShowDropIndicatorPosition: overIndex === index,
56
56
  dropIndicatorPosition,
57
57
  lastActiveId,
58
- setLastActiveId
58
+ setLastActiveId,
59
+ isDropValid
59
60
  };
60
61
  }, [dragAndDropRows, useSortableHelpers, dropIndicatorPosition, lastActiveId, setLastActiveId]);
61
62
  const ctx = (0, import_react.useMemo)(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/HoC/withDnDSortableRowContext.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { cloneElement, useContext, useEffect, useMemo } from 'react';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { DataTableContext } from '../../DataTableContext';\nimport { DnDTreeContext } from './withConditionalDnDRowContext';\nimport { FunctionalHOC } from '../../types/FunctionalHoC';\nimport { SortableItemContext, SortableItemContextType } from './SortableItemContext';\n\nexport const withDnDSortableRowContext: FunctionalHOC = (Component) => (props: any) => {\n const {\n tableProps: { dragAndDropRows },\n } = useContext(DataTableContext);\n const { dropIndicatorPosition, lastActiveId, setLastActiveId } = useContext(DnDTreeContext);\n\n // onMount generate unique options, so everyting is only ran once\n const draggableOptions = useMemo(\n () => ({\n id: props.row.uid,\n }),\n [props.row],\n );\n\n const useSortableHelpers = useSortable(draggableOptions);\n\n // calculate all the \"useSortable\" values as per required\n const draggableProps = useMemo(() => {\n if (!dragAndDropRows) return false;\n\n const { index, overIndex } = useSortableHelpers;\n\n return {\n ...useSortableHelpers,\n shouldShowDropIndicatorPosition: overIndex === index,\n dropIndicatorPosition,\n lastActiveId,\n setLastActiveId,\n };\n }, [dragAndDropRows, useSortableHelpers, dropIndicatorPosition, lastActiveId, setLastActiveId]);\n\n // we use a context so we can easly access information wherever without bubbling down\n // this context is all Memoized so as long as component is not re-mounted,\n // the context won't trigger un-required renders per-se...\n const ctx: SortableItemContextType = useMemo(\n () => ({\n draggableProps,\n }),\n [draggableProps],\n );\n // we always add the context, if draggableProps===false we don't have the DnD enabled.\n return (\n <SortableItemContext.Provider value={ctx}>\n <Component {...props} />\n </SortableItemContext.Provider>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAAoE;AACpE,8BAA4B;AAC5B,8BAAiC;AACjC,0CAA+B;AAE/B,iCAA6D;AAEtD,MAAM,4BAA2C,CAAC,cAAc,CAAC,UAAe;AACrF,QAAM;AAAA,IACJ,YAAY,EAAE,gBAAgB;AAAA,EAChC,QAAI,yBAAW,wCAAgB;AAC/B,QAAM,EAAE,uBAAuB,cAAc,gBAAgB,QAAI,yBAAW,kDAAc;AAG1F,QAAM,uBAAmB;AAAA,IACvB,OAAO;AAAA,MACL,IAAI,MAAM,IAAI;AAAA,IAChB;AAAA,IACA,CAAC,MAAM,GAAG;AAAA,EACZ;AAEA,QAAM,yBAAqB,qCAAY,gBAAgB;AAGvD,QAAM,qBAAiB,sBAAQ,MAAM;AACnC,QAAI,CAAC;AAAiB,aAAO;AAE7B,UAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,WAAO;AAAA,MACL,GAAG;AAAA,MACH,iCAAiC,cAAc;AAAA,MAC/C;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,oBAAoB,uBAAuB,cAAc,eAAe,CAAC;AAK9F,QAAM,UAA+B;AAAA,IACnC,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,SACE,4CAAC,+CAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,IACnC,sDAAC;AAAA,MAAW,GAAG;AAAA,KAAO;AAAA,GACxB;AAEJ;",
4
+ "sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { DataTableContext } from '../../DataTableContext';\nimport { DnDTreeContext } from './DnDTreeContext';\nimport { FunctionalHOC } from '../../types/FunctionalHoC';\nimport { SortableItemContext, SortableItemContextType } from './SortableItemContext';\n\nexport const withDnDSortableRowContext: FunctionalHOC = (Component) => (props: any) => {\n const {\n tableProps: { dragAndDropRows },\n } = useContext(DataTableContext);\n const { dropIndicatorPosition, lastActiveId, setLastActiveId, isDropValid } = useContext(DnDTreeContext);\n\n // onMount generate unique options, so everyting is only ran once\n const draggableOptions = useMemo(\n () => ({\n id: props.row.uid,\n }),\n [props.row],\n );\n\n const useSortableHelpers = useSortable(draggableOptions);\n\n // calculate all the \"useSortable\" values as per required\n const draggableProps = useMemo(() => {\n if (!dragAndDropRows) return false;\n\n const { index, overIndex } = useSortableHelpers;\n\n return {\n ...useSortableHelpers,\n shouldShowDropIndicatorPosition: overIndex === index,\n dropIndicatorPosition,\n lastActiveId,\n setLastActiveId,\n isDropValid,\n };\n }, [dragAndDropRows, useSortableHelpers, dropIndicatorPosition, lastActiveId, setLastActiveId]);\n\n // we use a context so we can easly access information wherever without bubbling down\n // this context is all Memoized so as long as component is not re-mounted,\n // the context won't trigger un-required renders per-se...\n const ctx: SortableItemContextType = useMemo(\n () => ({\n draggableProps,\n }),\n [draggableProps],\n );\n // we always add the context, if draggableProps===false we don't have the DnD enabled.\n return (\n <SortableItemContext.Provider value={ctx}>\n <Component {...props} />\n </SortableItemContext.Provider>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAA2C;AAC3C,8BAA4B;AAC5B,8BAAiC;AACjC,4BAA+B;AAE/B,iCAA6D;AAEtD,MAAM,4BAA2C,CAAC,cAAc,CAAC,UAAe;AACrF,QAAM;AAAA,IACJ,YAAY,EAAE,gBAAgB;AAAA,EAChC,QAAI,yBAAW,wCAAgB;AAC/B,QAAM,EAAE,uBAAuB,cAAc,iBAAiB,YAAY,QAAI,yBAAW,oCAAc;AAGvG,QAAM,uBAAmB;AAAA,IACvB,OAAO;AAAA,MACL,IAAI,MAAM,IAAI;AAAA,IAChB;AAAA,IACA,CAAC,MAAM,GAAG;AAAA,EACZ;AAEA,QAAM,yBAAqB,qCAAY,gBAAgB;AAGvD,QAAM,qBAAiB,sBAAQ,MAAM;AACnC,QAAI,CAAC;AAAiB,aAAO;AAE7B,UAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,WAAO;AAAA,MACL,GAAG;AAAA,MACH,iCAAiC,cAAc;AAAA,MAC/C;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,oBAAoB,uBAAuB,cAAc,eAAe,CAAC;AAK9F,QAAM,UAA+B;AAAA,IACnC,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,SACE,4CAAC,+CAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,IACnC,sDAAC;AAAA,MAAW,GAAG;AAAA,KAAO;AAAA,GACxB;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/RowVariants/types.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { TypescriptContext, TypescriptRow, DropIndicatorPosition } from '../../types/props';\nimport { SortableItemContextType } from '../HoC/SortableItemContext';\n\nexport interface RowVariantProps {\n row: TypescriptRow;\n ctx: TypescriptContext;\n compact?: boolean;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n itemIndex: number;\n draggableProps: SortableItemContextType['draggableProps'];\n backgroundColor?: string;\n isDragOverlay: boolean;\n minHeight: string;\n height: string;\n rowsLayout?: (string | number)[];\n dropIndicatorPosition: DropIndicatorPosition;\n CustomRowContentRenderer?: React.ComponentType<RowVariantProps>;\n}\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import { TypescriptContext, TypescriptRow, DropIndicatorPosition } from '../../types/props';\nimport { SortableItemContextType } from '../HoC/SortableItemContext';\n\nexport interface RowVariantProps {\n row: TypescriptRow;\n ctx: TypescriptContext;\n compact?: boolean;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n itemIndex: number;\n draggableProps: SortableItemContextType['draggableProps'];\n backgroundColor?: string;\n isDragOverlay: boolean;\n minHeight: string;\n height: string;\n rowsLayout?: (string | number)[];\n dropIndicatorPosition: false | DropIndicatorPosition;\n isDropValid: boolean;\n CustomRowContentRenderer?: React.ComponentType<RowVariantProps>;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
6
  "names": []
7
7
  }
@@ -34,6 +34,7 @@ var import_react = require("react");
34
34
  var import_Row = require("./Row");
35
35
  var import_DataTableContext = require("../DataTableContext");
36
36
  var import_withConditionalDnDRowContext = require("./HoC/withConditionalDnDRowContext");
37
+ var import_DnDTreeContext = require("./HoC/DnDTreeContext");
37
38
  var import_helpers = require("../helpers");
38
39
  const Rows = () => {
39
40
  const {
@@ -42,8 +43,8 @@ const Rows = () => {
42
43
  flattenedData,
43
44
  visibleColumns
44
45
  } = (0, import_react.useContext)(import_DataTableContext.DataTableContext);
45
- const { visibleItems } = (0, import_react.useContext)(import_withConditionalDnDRowContext.DnDTreeContext);
46
- const items = visibleItems || flattenedData;
46
+ const ctx = (0, import_react.useContext)(import_DnDTreeContext.DnDTreeContext);
47
+ const items = ctx?.visibleItems || flattenedData;
47
48
  const PureVirtualizedRows = (0, import_react.useMemo)(
48
49
  () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
49
50
  children: virtualItems.map((virtualItem) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/Rows.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable no-underscore-dangle */\nimport React, { useContext, useMemo } from 'react';\n\nimport { RowWithContext as Row } from './Row';\nimport { DataTableContext } from '../DataTableContext';\nimport { DnDTreeContext, withConditionalDnDRowContext } from './HoC/withConditionalDnDRowContext';\nimport { addCellData } from '../helpers';\n\nconst Rows = (): JSX.Element => {\n const {\n virtualListHelpers: { virtualItems },\n layoutHelpers: { totalColumnsWidth },\n flattenedData,\n visibleColumns,\n } = useContext(DataTableContext);\n\n const { visibleItems } = useContext(DnDTreeContext);\n\n const items = visibleItems || flattenedData;\n\n const PureVirtualizedRows = useMemo(\n () => (\n <>\n {virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = items[index];\n if (!row) return null;\n addCellData(row, visibleColumns);\n const style = {\n position: 'absolute',\n top: `${start}px`,\n left: 0,\n width: totalColumnsWidth,\n };\n const rowProps = {\n key: `ds-table-row-${row.uid}`,\n row,\n measureRef,\n index, // this is consumed by the DnD HOC\n itemIndex: index,\n itemWrapperStyle: style,\n };\n return <Row {...rowProps} />;\n })}\n </>\n ),\n [virtualItems, items, visibleColumns, totalColumnsWidth],\n );\n\n return PureVirtualizedRows;\n};\n\nRows.propTypes = {};\n\nexport const RowsWithContext = withConditionalDnDRowContext(Rows);\nexport default RowsWithContext;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAA2C;AAE3C,iBAAsC;AACtC,8BAAiC;AACjC,0CAA6D;AAC7D,qBAA4B;AAE5B,MAAM,OAAO,MAAmB;AAC9B,QAAM;AAAA,IACJ,oBAAoB,EAAE,aAAa;AAAA,IACnC,eAAe,EAAE,kBAAkB;AAAA,IACnC;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,wCAAgB;AAE/B,QAAM,EAAE,aAAa,QAAI,yBAAW,kDAAc;AAElD,QAAM,QAAQ,gBAAgB;AAE9B,QAAM,0BAAsB;AAAA,IAC1B,MACE;AAAA,MACG,uBAAa,IAAI,CAAC,gBAAgB;AACjC,cAAM,EAAE,OAAO,YAAY,MAAM,IAAI;AACrC,cAAM,MAAM,MAAM;AAClB,YAAI,CAAC;AAAK,iBAAO;AACjB,wCAAY,KAAK,cAAc;AAC/B,cAAM,QAAQ;AAAA,UACZ,UAAU;AAAA,UACV,KAAK,GAAG;AAAA,UACR,MAAM;AAAA,UACN,OAAO;AAAA,QACT;AACA,cAAM,WAAW;AAAA,UACf,KAAK,gBAAgB,IAAI;AAAA,UACzB;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAW;AAAA,UACX,kBAAkB;AAAA,QACpB;AACA,eAAO,4CAAC,WAAAA,gBAAA;AAAA,UAAK,GAAG;AAAA,SAAU;AAAA,MAC5B,CAAC;AAAA,KACH;AAAA,IAEF,CAAC,cAAc,OAAO,gBAAgB,iBAAiB;AAAA,EACzD;AAEA,SAAO;AACT;AAEA,KAAK,YAAY,CAAC;AAEX,MAAM,sBAAkB,kEAA6B,IAAI;AAChE,IAAO,eAAQ;",
4
+ "sourcesContent": ["/* eslint-disable no-underscore-dangle */\nimport React, { useContext, useMemo } from 'react';\n\nimport { RowWithContext as Row } from './Row';\nimport { DataTableContext } from '../DataTableContext';\nimport { withConditionalDnDRowContext } from './HoC/withConditionalDnDRowContext';\nimport { DnDTreeContext } from './HoC/DnDTreeContext';\nimport { addCellData } from '../helpers';\n\nconst Rows = (): JSX.Element => {\n const {\n virtualListHelpers: { virtualItems },\n layoutHelpers: { totalColumnsWidth },\n flattenedData,\n visibleColumns,\n } = useContext(DataTableContext);\n\n const ctx = useContext(DnDTreeContext);\n\n const items = ctx?.visibleItems || flattenedData;\n\n const PureVirtualizedRows = useMemo(\n () => (\n <>\n {virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = items[index];\n if (!row) return null;\n addCellData(row, visibleColumns);\n const style = {\n position: 'absolute',\n top: `${start}px`,\n left: 0,\n width: totalColumnsWidth,\n };\n const rowProps = {\n key: `ds-table-row-${row.uid}`,\n row,\n measureRef,\n index, // this is consumed by the DnD HOC\n itemIndex: index,\n itemWrapperStyle: style,\n };\n return <Row {...rowProps} />;\n })}\n </>\n ),\n [virtualItems, items, visibleColumns, totalColumnsWidth],\n );\n\n return PureVirtualizedRows;\n};\n\nRows.propTypes = {};\n\nexport const RowsWithContext = withConditionalDnDRowContext(Rows);\nexport default RowsWithContext;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAA2C;AAE3C,iBAAsC;AACtC,8BAAiC;AACjC,0CAA6C;AAC7C,4BAA+B;AAC/B,qBAA4B;AAE5B,MAAM,OAAO,MAAmB;AAC9B,QAAM;AAAA,IACJ,oBAAoB,EAAE,aAAa;AAAA,IACnC,eAAe,EAAE,kBAAkB;AAAA,IACnC;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,wCAAgB;AAE/B,QAAM,UAAM,yBAAW,oCAAc;AAErC,QAAM,QAAQ,KAAK,gBAAgB;AAEnC,QAAM,0BAAsB;AAAA,IAC1B,MACE;AAAA,MACG,uBAAa,IAAI,CAAC,gBAAgB;AACjC,cAAM,EAAE,OAAO,YAAY,MAAM,IAAI;AACrC,cAAM,MAAM,MAAM;AAClB,YAAI,CAAC;AAAK,iBAAO;AACjB,wCAAY,KAAK,cAAc;AAC/B,cAAM,QAAQ;AAAA,UACZ,UAAU;AAAA,UACV,KAAK,GAAG;AAAA,UACR,MAAM;AAAA,UACN,OAAO;AAAA,QACT;AACA,cAAM,WAAW;AAAA,UACf,KAAK,gBAAgB,IAAI;AAAA,UACzB;AAAA,UACA;AAAA,UACA;AAAA,UACA,WAAW;AAAA,UACX,kBAAkB;AAAA,QACpB;AACA,eAAO,4CAAC,WAAAA,gBAAA;AAAA,UAAK,GAAG;AAAA,SAAU;AAAA,MAC5B,CAAC;AAAA,KACH;AAAA,IAEF,CAAC,cAAc,OAAO,gBAAgB,iBAAiB;AAAA,EACzD;AAEA,SAAO;AACT;AAEA,KAAK,YAAY,CAAC;AAEX,MAAM,sBAAkB,kEAA6B,IAAI;AAChE,IAAO,eAAQ;",
6
6
  "names": ["Row"]
7
7
  }
@@ -53,7 +53,7 @@ var import_ds_icons = require("@elliemae/ds-icons");
53
53
  var import_helpers = require("./helpers");
54
54
  var import_zIndexInternalConfig = require("./configs/zIndexInternalConfig");
55
55
  var import_constants = require("./configs/constants");
56
- const styledFocusCss = ({ theme }) => `
56
+ const styledFocusCss = ({ theme }, color) => `
57
57
  &:after {
58
58
  display: block;
59
59
  content: ' ';
@@ -62,7 +62,7 @@ const styledFocusCss = ({ theme }) => `
62
62
  left: 0;
63
63
  right: 0;
64
64
  bottom: 0;
65
- border: 2px solid ${theme.colors.brand[700]};
65
+ border: 2px solid ${color ?? theme.colors.brand[700]};
66
66
  pointer-events: none;
67
67
  z-index: ${import_zIndexInternalConfig.ZIndexDataTable.FOCUS_BORDER};
68
68
  }`;
@@ -283,10 +283,10 @@ const StyledCellContainer = (0, import_ds_system.styled)(import_ds_grid.Grid)`
283
283
  ${(props) => props.isDragOverlay ? "" : styledFocusCss(props)}
284
284
  }
285
285
 
286
- ${({ isDropIndicatorPositionInside, theme }) => {
286
+ ${({ isDropIndicatorPositionInside, isDropValid, theme }) => {
287
287
  if (!isDropIndicatorPositionInside)
288
288
  return "";
289
- return styledFocusCss({ theme });
289
+ return styledFocusCss({ theme }, isDropValid ? theme.colors.brand[700] : theme.colors.danger[900]);
290
290
  }}
291
291
 
292
292
  ${({ shouldDisplayHover, theme, disabled }) => shouldDisplayHover && !disabled ? `:hover {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { sizeToCss, cellPadding, columnPadding } from './helpers';\nimport { ZIndexDataTable } from './configs/zIndexInternalConfig';\nimport { ColsLayoutStyle } from './configs/constants';\n\ninterface WidthAndHeight {\n width?: string | number;\n height?: string | number;\n}\n\nconst styledFocusCss = ({ theme }) => `\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n}`;\n\nexport const StyledFocusWithin = styled(Grid)`\n :focus-within {\n ${(props) => (props.hideFocus ? '' : styledFocusCss(props))}\n }\n`;\n\nexport const StyledDataTableWrapper = styled(Grid)<WidthAndHeight>`\n width: ${(props) => sizeToCss(props.width ?? ' 100%')};\n height: ${(props) => sizeToCss(props.height ?? ' 100%')};\n`;\n\nexport const StyledDataTableContentWrapper = styled(Grid)<WidthAndHeight & { noSelectionAllowed: boolean }>`\n user-select: ${({ noSelectionAllowed }) => (noSelectionAllowed ? 'none' : 'auto')};\n width: 100%;\n`;\n\nexport const StyledTableWrapper = styled.div<WidthAndHeight>`\n display: inline-block;\n border-spacing: 0;\n z-index: 0;\n position: relative;\n width: 100%;\n height: 100%;\n`;\nexport const StyledTableContentWrapper = styled.div<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledVirtualListWrapper = styled.div<WidthAndHeight>`\n overflow: auto;\n height: 100%;\n width: 100%;\n`;\n\n/**\n * HEADER\n */\ntype gridTemplateColumnStyleProps = {\n cols: string[];\n isExpandable: boolean;\n colsLayoutStyle: ColsLayoutStyle;\n};\nconst getGridTemplateColumnsStyle = ({\n cols,\n colsLayoutStyle = ColsLayoutStyle.Auto,\n}: gridTemplateColumnStyleProps) => {\n if (!cols) return '';\n if (colsLayoutStyle === 'fixed') {\n const widthAttr = cols.map((col) => `minmax(0, ${col})`).join(' ');\n return `grid-template-columns: ${widthAttr}`;\n }\n\n return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(' ')}`;\n};\n\nexport const StyledHeadWrapper = styled.div<{\n colsLayoutStyle: string;\n totalColumnsWidth: number | string;\n}>`\n position: relative; /* ie11 fallback */\n position: sticky;\n top: 0;\n z-index: 4;\n background: white;\n width: ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n`;\n\nexport const StyledHeadTr = styled(Grid)`\n ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n isExpandable: props.isExpandable,\n colsLayoutStyle: props.colsLayoutStyle,\n })};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['080']};\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['080']};\n grid-auto-flow: column;\n`;\n\nexport const StyledHeadTh = styled.div<any>`\n min-height: 24px;\n line-height: normal;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 0.923rem;\n text-align: left;\n ${columnPadding}\n color: #353c46;\n min-height: 1.84615rem;\n position: sticky;\n z-index: ${ZIndexDataTable.HEADER_ROW};\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n outline: none;\n ${(props) =>\n props.isDraggingActive\n ? ''\n : `:hover {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: 1px solid ${props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n cursor: pointer;\n }`}\n\n :focus {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n }\n`;\n\nexport const StyledHeaderRightIconsWrapper = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n max-height: 24px;\n`;\n\nexport const StyledResizer = styled.div<{ isResizing: boolean }>`\n display: inline-block;\n background: transparent;\n width: 4px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n\n // prevents from scrolling while dragging on touch devices\n touch-action: none;\n\n cursor: col-resize;\n`;\n\n// CELL ***********************************************************************/\nexport const StyledActionCell = styled.div`\n position: relative; /* ie11 fallback */\n position: sticky;\n display: inline-block;\n right: 0;\n /* border-bottom: 1px solid #ebedf0; */\n background: white;\n`;\n\nexport const StyledCell = styled.div`\n ${cellPadding}\n display: flex;\n align-items: center;\n width: 100%;\n position: relative;\n`;\n\nexport const StyledCellContent = styled.div`\n display: grid;\n justify-self: flex-end;\n flex: 1 1 auto;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const StyledPencilIcon = styled(EditPencil)``;\n\nexport const StyledEditableContainer = styled(Grid)<{ shouldDisplayEditIcon: string }>`\n width: 100%;\n height: 100%;\n align-items: center;\n & ${StyledPencilIcon} {\n display: ${({ shouldDisplayEditIcon }) => (shouldDisplayEditIcon ? 'block' : 'none')};\n }\n &:hover {\n ${StyledPencilIcon} {\n display: block;\n }\n }\n &:focus {\n ${styledFocusCss}\n ${StyledPencilIcon} {\n display: block;\n }\n }\n outline: none;\n`;\n\n// ROW ************************************************************************/\nexport const StyledFullsizeGrid = styled(Grid)`\n position: relative;\n z-index: ${ZIndexDataTable.ROW};\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n /* width: ${(props) =>\n props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%'}; */\n`;\n\nexport const GroupHeaderContainer = styled(Grid)<{ padding: string }>`\n position: relative;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n align-items: center;\n padding-left: ${(props) => props.paddingLeft};\n border-top: 1px solid ${({ theme }) => theme.colors.brand[300]};\n`;\n\nexport const GroupHeaderTitle = styled.span`\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n font-size: 12px;\n color: ${(props) => props.theme.colors.neutral[700]};\n`;\n\nexport const StyledCellContainer = styled(Grid)`\n position: relative;\n z-index: 2;\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n\n width: ${(props) => (props.colLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n ${(props) => (props.isDragOverlay ? 'width: fit-content;' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n colsLayoutStyle: props.colLayoutStyle,\n isExpandable: props.isExpandable,\n })};\n background-color: ${({ backgroundColor, isDragging, theme }) =>\n isDragging ? theme.colors.neutral[100] : backgroundColor || 'white'};\n\n outline: none;\n\n :focus {\n ${(props) => (props.isDragOverlay ? '' : styledFocusCss(props))}\n }\n\n ${({ isDropIndicatorPositionInside, theme }) => {\n if (!isDropIndicatorPositionInside) return '';\n return styledFocusCss({ theme });\n }}\n\n ${({ shouldDisplayHover, theme, disabled }) =>\n shouldDisplayHover && !disabled\n ? `:hover {\n background-color: ${theme.colors.brand[200]};\n }`\n : ''}\n\n box-shadow: 0 2px 4px 0 ${(props) => (props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent')};\n\n opacity: ${(props) => (props.isDragging ? 0.8 : 1)};\n\n ${(props) =>\n !props.selected\n ? ''\n : `\n background-color: ${props.theme.colors.brand[200]};\n border: 1px solid ${props.theme.colors.brand[500]};\n `}\n\n color: ${(props) => (props.disabled ? props.theme.colors.neutral['500'] : '#333333')};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;AACvB,qBAAqB;AACrB,sBAA2B;AAC3B,qBAAsD;AACtD,kCAAgC;AAChC,uBAAgC;AAOhC,MAAM,iBAAiB,CAAC,EAAE,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAShB,MAAM,OAAO,MAAM;AAAA;AAAA,aAE5B,4CAAgB;AAAA;AAGtB,MAAM,wBAAoB,yBAAO,mBAAI;AAAA;AAAA,MAEtC,CAAC,UAAW,MAAM,YAAY,KAAK,eAAe,KAAK;AAAA;AAAA;AAItD,MAAM,6BAAyB,yBAAO,mBAAI;AAAA,WACtC,CAAC,cAAU,0BAAU,MAAM,SAAS,OAAO;AAAA,YAC1C,CAAC,cAAU,0BAAU,MAAM,UAAU,OAAO;AAAA;AAGjD,MAAM,oCAAgC,yBAAO,mBAAI;AAAA,iBACvC,CAAC,EAAE,mBAAmB,MAAO,qBAAqB,SAAS;AAAA;AAAA;AAIrE,MAAM,qBAAqB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQlC,MAAM,4BAA4B,wBAAO;AAAA;AAAA,IAE5C,CAAC,EAAE,SAA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S;AAAA;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { sizeToCss, cellPadding, columnPadding } from './helpers';\nimport { ZIndexDataTable } from './configs/zIndexInternalConfig';\nimport { ColsLayoutStyle } from './configs/constants';\n\ninterface WidthAndHeight {\n width?: string | number;\n height?: string | number;\n}\n\nconst styledFocusCss = ({ theme }, color?: string) => `\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${color ?? theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n}`;\n\nexport const StyledFocusWithin = styled(Grid)`\n :focus-within {\n ${(props) => (props.hideFocus ? '' : styledFocusCss(props))}\n }\n`;\n\nexport const StyledDataTableWrapper = styled(Grid)<WidthAndHeight>`\n width: ${(props) => sizeToCss(props.width ?? ' 100%')};\n height: ${(props) => sizeToCss(props.height ?? ' 100%')};\n`;\n\nexport const StyledDataTableContentWrapper = styled(Grid)<WidthAndHeight & { noSelectionAllowed: boolean }>`\n user-select: ${({ noSelectionAllowed }) => (noSelectionAllowed ? 'none' : 'auto')};\n width: 100%;\n`;\n\nexport const StyledTableWrapper = styled.div<WidthAndHeight>`\n display: inline-block;\n border-spacing: 0;\n z-index: 0;\n position: relative;\n width: 100%;\n height: 100%;\n`;\nexport const StyledTableContentWrapper = styled.div<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledVirtualListWrapper = styled.div<WidthAndHeight>`\n overflow: auto;\n height: 100%;\n width: 100%;\n`;\n\n/**\n * HEADER\n */\ntype gridTemplateColumnStyleProps = {\n cols: string[];\n isExpandable: boolean;\n colsLayoutStyle: ColsLayoutStyle;\n};\nconst getGridTemplateColumnsStyle = ({\n cols,\n colsLayoutStyle = ColsLayoutStyle.Auto,\n}: gridTemplateColumnStyleProps) => {\n if (!cols) return '';\n if (colsLayoutStyle === 'fixed') {\n const widthAttr = cols.map((col) => `minmax(0, ${col})`).join(' ');\n return `grid-template-columns: ${widthAttr}`;\n }\n\n return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(' ')}`;\n};\n\nexport const StyledHeadWrapper = styled.div<{\n colsLayoutStyle: string;\n totalColumnsWidth: number | string;\n}>`\n position: relative; /* ie11 fallback */\n position: sticky;\n top: 0;\n z-index: 4;\n background: white;\n width: ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n`;\n\nexport const StyledHeadTr = styled(Grid)`\n ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n isExpandable: props.isExpandable,\n colsLayoutStyle: props.colsLayoutStyle,\n })};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['080']};\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['080']};\n grid-auto-flow: column;\n`;\n\nexport const StyledHeadTh = styled.div<any>`\n min-height: 24px;\n line-height: normal;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 0.923rem;\n text-align: left;\n ${columnPadding}\n color: #353c46;\n min-height: 1.84615rem;\n position: sticky;\n z-index: ${ZIndexDataTable.HEADER_ROW};\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n outline: none;\n ${(props) =>\n props.isDraggingActive\n ? ''\n : `:hover {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: 1px solid ${props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n cursor: pointer;\n }`}\n\n :focus {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n }\n`;\n\nexport const StyledHeaderRightIconsWrapper = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n max-height: 24px;\n`;\n\nexport const StyledResizer = styled.div<{ isResizing: boolean }>`\n display: inline-block;\n background: transparent;\n width: 4px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n\n // prevents from scrolling while dragging on touch devices\n touch-action: none;\n\n cursor: col-resize;\n`;\n\n// CELL ***********************************************************************/\nexport const StyledActionCell = styled.div`\n position: relative; /* ie11 fallback */\n position: sticky;\n display: inline-block;\n right: 0;\n /* border-bottom: 1px solid #ebedf0; */\n background: white;\n`;\n\nexport const StyledCell = styled.div`\n ${cellPadding}\n display: flex;\n align-items: center;\n width: 100%;\n position: relative;\n`;\n\nexport const StyledCellContent = styled.div`\n display: grid;\n justify-self: flex-end;\n flex: 1 1 auto;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const StyledPencilIcon = styled(EditPencil)``;\n\nexport const StyledEditableContainer = styled(Grid)<{ shouldDisplayEditIcon: string }>`\n width: 100%;\n height: 100%;\n align-items: center;\n & ${StyledPencilIcon} {\n display: ${({ shouldDisplayEditIcon }) => (shouldDisplayEditIcon ? 'block' : 'none')};\n }\n &:hover {\n ${StyledPencilIcon} {\n display: block;\n }\n }\n &:focus {\n ${styledFocusCss}\n ${StyledPencilIcon} {\n display: block;\n }\n }\n outline: none;\n`;\n\n// ROW ************************************************************************/\nexport const StyledFullsizeGrid = styled(Grid)`\n position: relative;\n z-index: ${ZIndexDataTable.ROW};\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n /* width: ${(props) =>\n props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%'}; */\n`;\n\nexport const GroupHeaderContainer = styled(Grid)<{ padding: string }>`\n position: relative;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n align-items: center;\n padding-left: ${(props) => props.paddingLeft};\n border-top: 1px solid ${({ theme }) => theme.colors.brand[300]};\n`;\n\nexport const GroupHeaderTitle = styled.span`\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n font-size: 12px;\n color: ${(props) => props.theme.colors.neutral[700]};\n`;\n\nexport const StyledCellContainer = styled(Grid)`\n position: relative;\n z-index: 2;\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n\n width: ${(props) => (props.colLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n ${(props) => (props.isDragOverlay ? 'width: fit-content;' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n colsLayoutStyle: props.colLayoutStyle,\n isExpandable: props.isExpandable,\n })};\n background-color: ${({ backgroundColor, isDragging, theme }) =>\n isDragging ? theme.colors.neutral[100] : backgroundColor || 'white'};\n\n outline: none;\n\n :focus {\n ${(props) => (props.isDragOverlay ? '' : styledFocusCss(props))}\n }\n\n ${({ isDropIndicatorPositionInside, isDropValid, theme }) => {\n if (!isDropIndicatorPositionInside) return '';\n return styledFocusCss({ theme }, isDropValid ? theme.colors.brand[700] : theme.colors.danger[900]);\n }}\n\n ${({ shouldDisplayHover, theme, disabled }) =>\n shouldDisplayHover && !disabled\n ? `:hover {\n background-color: ${theme.colors.brand[200]};\n }`\n : ''}\n\n box-shadow: 0 2px 4px 0 ${(props) => (props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent')};\n\n opacity: ${(props) => (props.isDragging ? 0.8 : 1)};\n\n ${(props) =>\n !props.selected\n ? ''\n : `\n background-color: ${props.theme.colors.brand[200]};\n border: 1px solid ${props.theme.colors.brand[500]};\n `}\n\n color: ${(props) => (props.disabled ? props.theme.colors.neutral['500'] : '#333333')};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;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IAAI;AAAA,IACzG,CAAC,UAAW,MAAM,gBAAgB,wBAAwB;AAAA,IAC1D,CAAC,UACD,4BAA4B;AAAA,EAC1B,MAAM,MAAM;AAAA,EACZ,iBAAiB,MAAM;AAAA,EACvB,cAAc,MAAM;AACtB,CAAC;AAAA,sBACiB,CAAC,EAAE,iBAAiB,YAAY,MAAM,MACxD,aAAa,MAAM,OAAO,QAAQ,OAAO,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,MAK1D,CAAC,UAAW,MAAM,gBAAgB,KAAK,eAAe,KAAK;AAAA;AAAA;AAAA,IAG7D,CAAC,EAAE,+BAA+B,aAAa,MAAM,MAAM;AAC3D,MAAI,CAAC;AAA+B,WAAO;AAC3C,SAAO,eAAe,EAAE,MAAM,GAAG,cAAc,MAAM,OAAO,MAAM,OAAO,MAAM,OAAO,OAAO,IAAI;AACnG;AAAA;AAAA,IAEE,CAAC,EAAE,oBAAoB,OAAO,SAAS,MACvC,sBAAsB,CAAC,WACnB;AAAA,gCACwB,MAAM,OAAO,MAAM;AAAA,eAE3C;AAAA;AAAA,4BAEoB,CAAC,UAAW,MAAM,gBAAgB,oBAAoB;AAAA;AAAA,aAErE,CAAC,UAAW,MAAM,aAAa,MAAM;AAAA;AAAA,IAE9C,CAAC,UACD,CAAC,MAAM,WACH,KACA;AAAA,wBACgB,MAAM,MAAM,OAAO,MAAM;AAAA,wBACzB,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,WAGtC,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,QAAQ,SAAS;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/types/props.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { MutableRefObject } from 'react';\nimport { useVirtual } from 'react-virtual/types';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { ColsLayoutStyle } from '../configs/constants';\nimport { CSSProperties } from 'styled-components';\n\nexport type TypescriptGenericFunc = (...args: unknown[]) => unknown;\ninterface FilterOptionT {\n dsId: string;\n type: string;\n value: string;\n label: string;\n}\n\ninterface HeaderComponentProps {\n ctx: TypescriptContext;\n}\n\nexport type DraggablePropsT =\n | false\n | (ReturnType<typeof useSortable> & {\n dropIndicatorPosition: DropIndicatorPosition;\n shouldShowDropIndicatorPosition: boolean;\n lastActiveId?: string;\n setLastActiveId?: React.Dispatch<React.SetStateAction<string>>;\n });\n\ninterface CellComponentProps<T = HTMLElement> {\n ctx: TypescriptContext;\n isRowSelected: boolean;\n row: InternalTypescriptRow;\n cell: TypescriptCell<T>;\n draggableProps: DraggablePropsT;\n isDragOverlay: boolean;\n}\n\nexport enum DropIndicatorPosition {\n None = 0,\n Before = 1,\n After = 2,\n Inside = 3,\n}\n\nexport interface TypescriptColumn<T extends HTMLElement = HTMLElement> {\n id?: string;\n Header: string | React.ComponentType<HeaderComponentProps>;\n accessor?: string;\n filter?: string;\n filterOptions?: FilterOptionT[] | (() => FilterOptionT[]);\n filterMinWidth?: number | string;\n Filter?: React.ComponentType<FilterProps>;\n Cell?: React.ComponentType<CellComponentProps<T>>;\n editable?: string | TypescriptGenericFunc;\n disableDnD?: boolean;\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n padding?: number;\n columns?: TypescriptColumn[];\n canSort?: boolean;\n isSortedDesc?: boolean;\n canResize?: boolean;\n isFocuseable?: boolean;\n textWrap?: 'wrap' | 'wrap-all' | 'truncate';\n ref?: React.MutableRefObject<HTMLTableColElement>;\n required?: boolean;\n cellStyle?: CSSProperties;\n alwaysDisplayEditIcon?: boolean;\n}\n\nexport interface InternalTypescriptColumn<T extends HTMLElement = HTMLElement> extends TypescriptColumn<T> {\n id: string;\n}\n\nexport interface TypescriptCell<T = HTMLElement> {\n column: TypescriptColumn;\n value: any;\n render: React.ComponentType<CellComponentProps>;\n row: InternalTypescriptRow;\n ref: React.RefObject<T>;\n id: string;\n}\n\nexport interface TypescriptRow {\n [key: string]: any;\n subRows: TypescriptRow[];\n tableRowDetails: React.ComponentType<any>;\n dimsumHeaderValue: string;\n}\n\nexport interface InternalTypescriptRow {\n id: string;\n uid: string;\n index: number;\n realIndex: number;\n parentId: string | null;\n parentIndex: number | null;\n depth: number;\n isExpanded: boolean;\n subRows: TypescriptRow[];\n childrenCount: number;\n original: TypescriptRow;\n cells: TypescriptCell[];\n}\n\nexport type RowVariant = 'ds-header-group-row' | 'ds-primary-row' | 'ds-secondary-row';\n\nexport type TypescriptRenderRowActionsConfig = {\n columnWidth: number;\n renderer: (...args: any[]) => JSX.Element;\n};\n\nexport type TypescriptRenderRowActions = false | TypescriptRenderRowActionsConfig;\n\nexport type TypescriptAppliedFilter = {\n id: string;\n type: string;\n value: any;\n};\n\nexport type TypescriptPagination = {\n page?: any[];\n pageIndex?: number;\n canPreviousPage?: boolean;\n canNextPage?: boolean;\n pageSize?: number;\n dataIsPage?: boolean;\n showPerPageSelector?: boolean;\n perPageOptions?: number[];\n perPageStep?: number;\n minPerPage?: number;\n maxPerPage?: number;\n onPageSizeChange?: (pageSize: number) => void;\n onPreviousPage?: () => void;\n onNextPage?: () => void;\n onPageChange?: (page: number) => void;\n pageCount?: number;\n pageDetails?: string[];\n pageDetailsTitle?: string;\n};\n\nexport type TypescriptSortBy = {\n id: string;\n desc: boolean;\n};\n\nexport type TypescriptSelectionItem = boolean | 'mixed';\n\nexport type TypescriptSelection = Record<string | number, TypescriptSelectionItem>;\n\nexport type UniqueRowAccessorType = string | string[] | ((row: TypescriptRow) => string) | undefined;\n\nexport interface ReduxHeader {\n hideFilterMenu?: boolean;\n hideFilterButton?: boolean;\n showDnDHandle?: boolean;\n withTabStops?: boolean;\n}\n\ninterface DataTableFilter {\n id: string;\n type: string;\n value: any;\n}\n\ninterface PropsWithDefault {\n height: string;\n width: string;\n renderRowActions: boolean;\n getRowVariant: (\n row: TypescriptRow,\n defaultCellRenderer: React.ComponentType<any>,\n ) => RowVariant | React.ComponentType<any>;\n withFilterBar: boolean;\n isExpandable: boolean;\n expandedRows: Record<string, boolean>;\n disabledRows: Record<string, boolean>;\n isResizeable: boolean;\n isLoading: boolean;\n pagination: false | TypescriptPagination;\n filters: DataTableFilter[];\n colsLayoutStyle: ColsLayoutStyle;\n hiddenColumns: string[];\n noResultsMessage: string;\n dragAndDropRows: boolean;\n maxDragAndDropLevel: number;\n onRowsReorder: (\n newData: TypescriptRow[],\n indexes: { targetIndex: number; fromIndex: number },\n considerExpanding: string,\n ) => void;\n dragAndDropColumns: boolean;\n onColumnsReorder: (newData: TypescriptColumn[], indexes: { targetIndex: number; fromIndex: number }) => void;\n onColumnResize: (headerId: string, width: number) => void;\n onColumnSizeChange: (newColumns: TypescriptColumn[], headerId: string, width: number) => void;\n onRowClick: TypescriptGenericFunc;\n onRowFocus: TypescriptGenericFunc;\n noSelectionColumn: boolean;\n selectSingle: boolean;\n onSelectionChange: (newSelection: TypescriptSelection, selectedControl: string, event: React.ChangeEvent) => void;\n textWrap: 'wrap' | 'wrap-all' | 'truncate';\n onCellValueChange: (cellChange: { value: any; property: any; rowIndex: number }) => void;\n onFiltersChange: TypescriptGenericFunc;\n onPageChanged: TypescriptGenericFunc;\n onRowExpand: (expandedRows: Record<string, boolean>, toggledRow: string) => void;\n onColumnSortChange: (newSortRequest: { column: any; direction: any }) => void;\n onColumnSort: (newColumns: TypescriptColumn[], headerId: string, direction: 'ASC' | 'DESC') => void;\n}\n\ninterface PropsRequired {\n columns: TypescriptColumn[];\n data: TypescriptRow[];\n}\n\ninterface PropsOptional {\n uniqueRowAccessor?: UniqueRowAccessorType;\n cellRendererProps?: Record<string, any>;\n selection?: TypescriptSelection;\n groupedRowsRenderHeader?: TypescriptGenericFunc | string;\n filterBarProps?: {\n filterBarAddonRenderer?: React.ComponentType<any>;\n customPillRenderer?: React.ComponentType<any>;\n extraOptions?: { type: string; id: string; label: string; onClick?: TypescriptGenericFunc }[];\n };\n actionRef?: React.RefObject<any>;\n noResultsSecondaryMessage?: string;\n noResultsButtonLabel?: string;\n noResultsPlaceholder?: TypescriptGenericFunc;\n onNoResultsButtonClick?: TypescriptGenericFunc;\n}\n\nexport interface TypescriptProps extends Partial<PropsWithDefault>, PropsRequired, PropsOptional {}\nexport interface InternalTypescriptProps extends PropsWithDefault, PropsRequired, PropsOptional {}\n\nexport interface FilterProps {\n column: TypescriptColumn;\n ctx: TypescriptContext;\n onFiltersChange?: (filters: DataTableFilter[]) => void;\n onValueChange: (type: string, value: any) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, newState: any) => void;\n patchHeader: (headerId: string, newHeader: any) => void;\n filterValue?: any;\n reduxHeader?: any;\n innerRef: MutableRefObject<HTMLDivElement | null>;\n}\n\nexport type TypescriptContext = {\n tableProps: InternalTypescriptProps;\n virtualListRef: React.RefObject<HTMLDivElement>;\n columnHeaderRef: React.RefObject<HTMLDivElement>;\n flattenedData: InternalTypescriptRow[];\n allDataFlattened: InternalTypescriptRow[];\n visibleColumns: TypescriptColumn[];\n virtualListHelpers?: ReturnType<typeof useVirtual>;\n layoutHelpers: {\n totalColumnsWidth?: number | string;\n gridLayout: string[];\n setGridLayout: React.Dispatch<React.SetStateAction<string[]>>;\n };\n paginationHelpers: TypescriptPagination;\n drilldownRowId: string | null;\n setDrilldownRowId: React.Dispatch<React.SetStateAction<string | null>>;\n focusedRowId: string | null;\n setFocusedRowId: React.Dispatch<React.SetStateAction<string | null>>;\n reduxHeaders: Record<string, ReduxHeader>;\n patchHeader: (headerId: string, newHeader: ReduxHeader) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, value: boolean) => void;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqChB,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,8CAAA,UAAO,KAAP;AACA,EAAAA,8CAAA,YAAS,KAAT;AACA,EAAAA,8CAAA,WAAQ,KAAR;AACA,EAAAA,8CAAA,YAAS,KAAT;AAJU,SAAAA;AAAA,GAAA;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { MutableRefObject } from 'react';\nimport { useVirtual } from 'react-virtual/types';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { ColsLayoutStyle } from '../configs/constants';\nimport { CSSProperties } from 'styled-components';\n\nexport type TypescriptGenericFunc = (...args: unknown[]) => unknown;\ninterface FilterOptionT {\n dsId: string;\n type: string;\n value: string;\n label: string;\n}\n\ninterface HeaderComponentProps {\n ctx: TypescriptContext;\n}\n\nexport type DraggablePropsT =\n | false\n | (ReturnType<typeof useSortable> & {\n dropIndicatorPosition: DropIndicatorPosition;\n shouldShowDropIndicatorPosition: boolean;\n lastActiveId: string;\n setLastActiveId: React.Dispatch<React.SetStateAction<string>>;\n isDropValid: boolean;\n });\n\ninterface CellComponentProps<T = HTMLElement> {\n ctx: TypescriptContext;\n isRowSelected: boolean;\n row: InternalTypescriptRow;\n cell: TypescriptCell<T>;\n draggableProps: DraggablePropsT;\n isDragOverlay: boolean;\n}\n\nexport enum DropIndicatorPosition {\n None = 0,\n Before = 1,\n After = 2,\n Inside = 3,\n}\n\nexport interface TypescriptColumn<T extends HTMLElement = HTMLElement> {\n id?: string;\n Header: string | React.ComponentType<HeaderComponentProps>;\n accessor?: string;\n filter?: string;\n filterOptions?: FilterOptionT[] | (() => FilterOptionT[]);\n filterMinWidth?: number | string;\n Filter?: React.ComponentType<FilterProps>;\n Cell?: React.ComponentType<CellComponentProps<T>>;\n editable?: string | TypescriptGenericFunc;\n disableDnD?: boolean;\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n padding?: number;\n columns?: TypescriptColumn[];\n canSort?: boolean;\n isSortedDesc?: boolean;\n canResize?: boolean;\n isFocuseable?: boolean;\n textWrap?: 'wrap' | 'wrap-all' | 'truncate';\n ref?: React.MutableRefObject<HTMLTableColElement>;\n required?: boolean;\n cellStyle?: CSSProperties;\n alwaysDisplayEditIcon?: boolean;\n}\n\nexport interface InternalTypescriptColumn<T extends HTMLElement = HTMLElement> extends TypescriptColumn<T> {\n id: string;\n}\n\nexport interface TypescriptCell<T = HTMLElement> {\n column: TypescriptColumn;\n value: any;\n render: React.ComponentType<CellComponentProps>;\n row: InternalTypescriptRow;\n ref: React.RefObject<T>;\n id: string;\n}\n\nexport interface TypescriptRow {\n [key: string]: any;\n subRows: TypescriptRow[];\n tableRowDetails: React.ComponentType<any>;\n dimsumHeaderValue: string;\n}\n\nexport interface InternalTypescriptRow {\n id: string;\n uid: string;\n index: number;\n realIndex: number;\n parent: InternalTypescriptRow | null;\n parentId: string | null;\n parentIndex: number | null;\n depth: number;\n isExpanded: boolean;\n subRows: TypescriptRow[];\n childrenCount: number;\n original: TypescriptRow;\n cells: TypescriptCell[];\n}\n\nexport type RowVariant = 'ds-header-group-row' | 'ds-primary-row' | 'ds-secondary-row';\n\nexport type TypescriptRenderRowActionsConfig = {\n columnWidth: number;\n renderer: (...args: any[]) => JSX.Element;\n};\n\nexport type TypescriptRenderRowActions = false | TypescriptRenderRowActionsConfig;\n\nexport type TypescriptAppliedFilter = {\n id: string;\n type: string;\n value: any;\n};\n\nexport type TypescriptPagination = {\n page?: any[];\n pageIndex?: number;\n canPreviousPage?: boolean;\n canNextPage?: boolean;\n pageSize?: number;\n dataIsPage?: boolean;\n showPerPageSelector?: boolean;\n perPageOptions?: number[];\n perPageStep?: number;\n minPerPage?: number;\n maxPerPage?: number;\n onPageSizeChange?: (pageSize: number) => void;\n onPreviousPage?: () => void;\n onNextPage?: () => void;\n onPageChange?: (page: number) => void;\n pageCount?: number;\n pageDetails?: string[];\n pageDetailsTitle?: string;\n};\n\nexport type TypescriptSortBy = {\n id: string;\n desc: boolean;\n};\n\nexport type TypescriptSelectionItem = boolean | 'mixed';\n\nexport type TypescriptSelection = Record<string | number, TypescriptSelectionItem>;\n\nexport type UniqueRowAccessorType = string | string[] | ((row: TypescriptRow) => string) | undefined;\n\nexport interface ReduxHeader {\n hideFilterMenu?: boolean;\n hideFilterButton?: boolean;\n showDnDHandle?: boolean;\n withTabStops?: boolean;\n}\n\ninterface DataTableFilter {\n id: string;\n type: string;\n value: any;\n}\n\ninterface PropsWithDefault {\n height: string;\n width: string;\n renderRowActions: boolean;\n getRowVariant: (\n row: TypescriptRow,\n defaultCellRenderer: React.ComponentType<any>,\n ) => RowVariant | React.ComponentType<any>;\n withFilterBar: boolean;\n isExpandable: boolean;\n expandedRows: Record<string, boolean>;\n disabledRows: Record<string, boolean>;\n isResizeable: boolean;\n isLoading: boolean;\n pagination: false | TypescriptPagination;\n filters: DataTableFilter[];\n colsLayoutStyle: ColsLayoutStyle;\n hiddenColumns: string[];\n noResultsMessage: string;\n dragAndDropRows: boolean;\n maxDragAndDropLevel: number;\n onRowsReorder: (\n newData: TypescriptRow[],\n indexes: { targetIndex: number; fromIndex: number },\n considerExpanding: string,\n ) => void;\n dragAndDropColumns: boolean;\n onColumnsReorder: (newData: TypescriptColumn[], indexes: { targetIndex: number; fromIndex: number }) => void;\n getIsDropValid: (\n active: InternalTypescriptRow,\n over: InternalTypescriptRow,\n dropIndicatorPosition: DropIndicatorPosition,\n ) => boolean;\n onColumnResize: (headerId: string, width: number) => void;\n onColumnSizeChange: (newColumns: TypescriptColumn[], headerId: string, width: number) => void;\n onRowClick: TypescriptGenericFunc;\n onRowFocus: TypescriptGenericFunc;\n noSelectionColumn: boolean;\n selectSingle: boolean;\n onSelectionChange: (newSelection: TypescriptSelection, selectedControl: string, event: React.ChangeEvent) => void;\n textWrap: 'wrap' | 'wrap-all' | 'truncate';\n onCellValueChange: (cellChange: { value: any; property: any; rowIndex: number }) => void;\n onFiltersChange: TypescriptGenericFunc;\n onPageChanged: TypescriptGenericFunc;\n onRowExpand: (expandedRows: Record<string, boolean>, toggledRow: string) => void;\n onColumnSortChange: (newSortRequest: { column: any; direction: any }) => void;\n onColumnSort: (newColumns: TypescriptColumn[], headerId: string, direction: 'ASC' | 'DESC') => void;\n}\n\ninterface PropsRequired {\n columns: TypescriptColumn[];\n data: TypescriptRow[];\n}\n\ninterface PropsOptional {\n uniqueRowAccessor?: UniqueRowAccessorType;\n cellRendererProps?: Record<string, any>;\n selection?: TypescriptSelection;\n groupedRowsRenderHeader?: TypescriptGenericFunc | string;\n filterBarProps?: {\n filterBarAddonRenderer?: React.ComponentType<any>;\n customPillRenderer?: React.ComponentType<any>;\n extraOptions?: { type: string; id: string; label: string; onClick?: TypescriptGenericFunc }[];\n };\n actionRef?: React.RefObject<any>;\n noResultsSecondaryMessage?: string;\n noResultsButtonLabel?: string;\n noResultsPlaceholder?: TypescriptGenericFunc;\n onNoResultsButtonClick?: TypescriptGenericFunc;\n}\n\nexport interface TypescriptProps extends Partial<PropsWithDefault>, PropsRequired, PropsOptional {}\nexport interface InternalTypescriptProps extends PropsWithDefault, PropsRequired, PropsOptional {}\n\nexport interface FilterProps {\n column: TypescriptColumn;\n ctx: TypescriptContext;\n onFiltersChange?: (filters: DataTableFilter[]) => void;\n onValueChange: (type: string, value: any) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, newState: any) => void;\n patchHeader: (headerId: string, newHeader: any) => void;\n filterValue?: any;\n reduxHeader?: any;\n innerRef: MutableRefObject<HTMLDivElement | null>;\n}\n\nexport type TypescriptContext = {\n tableProps: InternalTypescriptProps;\n virtualListRef: React.RefObject<HTMLDivElement>;\n columnHeaderRef: React.RefObject<HTMLDivElement>;\n flattenedData: InternalTypescriptRow[];\n allDataFlattened: InternalTypescriptRow[];\n visibleColumns: TypescriptColumn[];\n virtualListHelpers?: ReturnType<typeof useVirtual>;\n layoutHelpers: {\n totalColumnsWidth: number | string;\n gridLayout: string[];\n setGridLayout: React.Dispatch<React.SetStateAction<string[]>>;\n };\n paginationHelpers: TypescriptPagination;\n drilldownRowId: string | null;\n setDrilldownRowId: React.Dispatch<React.SetStateAction<string | null>>;\n focusedRowId: string | null;\n setFocusedRowId: React.Dispatch<React.SetStateAction<string | null>>;\n reduxHeaders: Record<string, ReduxHeader>;\n patchHeader: (headerId: string, newHeader: ReduxHeader) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, value: boolean) => void;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsChB,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,8CAAA,UAAO,KAAP;AACA,EAAAA,8CAAA,YAAS,KAAT;AACA,EAAAA,8CAAA,WAAQ,KAAR;AACA,EAAAA,8CAAA,YAAS,KAAT;AAJU,SAAAA;AAAA,GAAA;",
6
6
  "names": ["DropIndicatorPosition"]
7
7
  }
@@ -143,6 +143,7 @@ const DataTableSchema = {
143
143
  maxDragAndDropLevel: PropTypes.number.description("Which level is the maximum allowed to drop into"),
144
144
  dragAndDropColumns: PropTypes.bool.description("Whether to turn on the d&d feature for the columns"),
145
145
  onColumnsReorder: PropTypes.func.description("Function invoked when a column is reordered"),
146
+ getIsDropValid: PropTypes.func.description("Function to determine if a drop is valid"),
146
147
  textWrap: textWrappingType.description("Global wrapping rule"),
147
148
  noResultsMessage: PropTypes.string.description("Message to show when no more data is available"),
148
149
  noResultsSecondaryMessage: PropTypes.string.description("Secondary message to show when no more data is available"),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DataTableSchema.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { WeakValidationMap } from 'react';\n\nconst outOfTheBoxFilterType = PropTypes.oneOf([\n 'ds-filter-select',\n 'ds-filter-multi-select',\n 'ds-filter-single-date',\n 'ds-filter-date-range',\n 'ds-filter-number-range',\n]);\n\nconst textWrappingType = PropTypes.oneOf(['wrap', 'wrap-all', 'truncate']);\n\nconst columnPropTypes = {\n Header: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.element]).description(\n 'Header name or component',\n ).isRequired,\n accessor: PropTypes.string.description('The entry of the data that this column will display'),\n id: PropTypes.string.description('The id of the column, will default to the Header or accessor if not present'),\n filter: outOfTheBoxFilterType.description('out-of-the-box filters'),\n Filter: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'The custom component to render as a filter',\n ),\n Cell: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('The custom cell renderer component'),\n editable: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.element]).description(\n 'The editable out-of-the-box or component to render',\n ),\n disableDnD: PropTypes.bool.description('Whereas this column should be draggable'),\n canResize: PropTypes.bool.description('Whereas this column should be resizable'),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Width of this column'),\n minWidth: PropTypes.number.description('Minimum width of this column, useful when resizing'),\n maxWidth: PropTypes.number.description('Maximum width of this column, useful when resizing'),\n canSort: PropTypes.bool.description('Whereas this column is sortable'),\n isSortedDesc: PropTypes.bool.description('Whereas this column is sorted descendingly'),\n required: PropTypes.bool.description('Whereas this column is required'),\n alwaysDisplayEditIcon: PropTypes.bool.description(\n 'Whereas to always show the edit icon on this column if it is editable',\n ),\n textWrap: textWrappingType.description('How to wrap the text in the column'),\n};\n\nconst columnsPropTypes = PropTypes.shape(columnPropTypes).description('Columns props');\n\nconst rowPropTypes = {\n tableRowDetails: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description('Component for row details'),\n dimsumHeaderValue: PropTypes.string.description('Header displayed on the header variant of the row'),\n};\n\nconst rowsPropTypes = PropTypes.shape(rowPropTypes).description('Rows props');\n\nexport const DataTableSchema = {\n columns: PropTypes.arrayOf(columnsPropTypes).description('Array of columns').isRequired,\n data: PropTypes.arrayOf(rowsPropTypes).description('Array of rows'),\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Height of the datatable component'),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Width of the datatable component'),\n renderRowActions: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]).description(\n 'The renderer to use for the action toolbar',\n ),\n isExpandable: PropTypes.bool.description('Whether the datatable is expandable').defaultValue(false),\n uniqueRowAccessor: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.func,\n ]).description(\n 'Column / Combination of columns / Function to call to produce a unique identifier for each row.' +\n ' This is necessary for the selectable and drag and drop features',\n ),\n disabledRows: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is disabled or not',\n ),\n expandedRows: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is expanded or not',\n ),\n onRowExpand: PropTypes.func.description('Function invoked when a row is (un)expanded'),\n cellRendererProps: PropTypes.object.description(\n 'Object with all the props you want the cells to have available when rendering',\n ),\n selectSingle: PropTypes.bool.description('Whether the selectable feature is single').defaultValue(false),\n selection: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is selected or not',\n ),\n onSelectionChange: PropTypes.func.description('Function invoked when a row is selected'),\n groupedRowsRenderHeader: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).description(\n 'String | Function to call which will display in the row headers',\n ),\n isResizeable: PropTypes.bool.description(\"Whether the datatable's columns are resizeable\"),\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n type: PropTypes.string,\n value: PropTypes.any,\n }),\n ).description('Array of filter keys and values'),\n withFilterBar: PropTypes.bool.description('Whether to display the filter bar'),\n filterBarProps: PropTypes.shape({\n filterBarAddonRenderer: PropTypes.func.description('Render filterbar right addon component'),\n customPillRenderer: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'If you specify custom filters, you will need to render their pills here',\n ),\n isDropdownMenuOpen: PropTypes.bool.description('Wether the DropdownMenu is Open or not.'),\n onDropdownMenuToggle: PropTypes.func.description('Callback to toggle the DropdownMenu.'),\n onClearAllFiltersClick: PropTypes.func.description('Callback for Clear Al Filters option.'),\n onDropdownMenuClickOutside: PropTypes.func.description('Callback triggered when clicking outside DropdownMenu.'),\n onDropdownMenuTriggerClick: PropTypes.func.description('Callback triggered when clicking DropdownMenu ellipsis.'),\n extraOptions: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n }),\n ).description('Any extra option you want in the dropdownmenu of the filter bar'),\n }).description('Props for the filter bar'),\n onFiltersChange: PropTypes.func.description('Function invoked when filters change'),\n pagination: PropTypes.oneOfType([\n PropTypes.oneOf([false]),\n PropTypes.shape({\n pageCount: PropTypes.number.description('How many pages are there'),\n pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),\n canPreviousPage: PropTypes.bool.description('Whether the previous button is disabled or not').defaultValue(true),\n canNextPage: PropTypes.bool.description('Whether the next button is disabled or not').defaultValue(true),\n pageSize: PropTypes.number.description('The current page size').defaultValue(10),\n showPerPageSelector: PropTypes.bool.description('Whether to show the page selector').defaultValue(true),\n perPageOptions: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.number,\n PropTypes.shape({\n dsId: PropTypes.string,\n value: PropTypes.number,\n label: PropTypes.string,\n type: PropTypes.oneOf(['single']),\n }),\n ]),\n )\n .description('The available options for page size')\n .defaultValue([10]),\n perPageStep: PropTypes.number.description('Step for the per page options').defaultValue(5),\n minPerPage: PropTypes.number.description('Step for the per page options').defaultValue(0),\n maxPerPage: PropTypes.number.description('Step for the per page options').defaultValue(100),\n onPageSizeChange: PropTypes.func\n .description('Function invoked when the page size changes')\n .defaultValue(() => null),\n onPreviousPage: PropTypes.func\n .description('Function invoked when the previous button is pressed')\n .defaultValue(() => null),\n onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),\n onNextPage: PropTypes.func.description('Function invoked when next button is pressed').defaultValue(() => null),\n pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),\n dataIsPage: PropTypes.bool.description('Whether to treat data as a page').defaultValue(false),\n pageDetailsTitle: PropTypes.string\n .description('The title of the details (usually a column of your dataset)')\n .defaultValue(''),\n }),\n ]).description('Object containing the data for the pagination'),\n colsLayoutStyle: PropTypes.oneOf(['auto', 'fixed']).description('Whether the datatable fills its container or not'),\n hiddenColumns: PropTypes.arrayOf(PropTypes.string).description('IDs of columns not to render'),\n dragAndDropRows: PropTypes.bool.description('Whether to turn on the d&d feature for the rows').defaultValue(false),\n onRowsReorder: PropTypes.func.description('Function invoked when a row is reordered'),\n maxDragAndDropLevel: PropTypes.number.description('Which level is the maximum allowed to drop into'),\n dragAndDropColumns: PropTypes.bool.description('Whether to turn on the d&d feature for the columns'),\n onColumnsReorder: PropTypes.func.description('Function invoked when a column is reordered'),\n textWrap: textWrappingType.description('Global wrapping rule'),\n noResultsMessage: PropTypes.string.description('Message to show when no more data is available'),\n noResultsSecondaryMessage: PropTypes.string.description('Secondary message to show when no more data is available'),\n noResultsButtonLabel: PropTypes.string.description('Label of the button when no more data is available'),\n noResultsPlaceholder: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'Custom content to show when dataset is empty',\n ),\n isLoading: PropTypes.bool.description('Whether to show a global loader in the datatable'),\n onColumnResize: PropTypes.func\n .description('Function invoked when a column is resized')\n .deprecated({ version: '4.x', message: 'Use onColumnSizeChange' }),\n onColumnSizeChange: PropTypes.func.description('Function invoked when a column is resized'),\n onRowClick: PropTypes.func.description('Function invoked when clicking a row'),\n onRowFocus: PropTypes.func.description('Function invoked when focusing a row'),\n onCellValueChange: PropTypes.func.description(\"Function invoked when an editable cell's content is changed\"),\n onColumnSortChange: PropTypes.func\n .description('Function invoked when a column is sorted')\n .deprecated({ version: '4.x', message: 'Use onColumnSort' }),\n onColumnSort: PropTypes.func.description('Function invoked when a column is sorted'),\n actionRef: PropTypes.object.description('Reference where all the exposed action callbacks will be exposed'),\n} as WeakValid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,UAAU,KAC3B,YAAY,0CAA0C,EACtD,WAAW,EAAE,SAAS,OAAO,SAAS,mBAAmB,CAAC;AAAA,EAC7D,cAAc,UAAU,KAAK,YAAY,0CAA0C;AAAA,EACnF,WAAW,UAAU,OAAO,YAAY,kEAAkE;AAC5G;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { WeakValidationMap } from 'react';\n\nconst outOfTheBoxFilterType = PropTypes.oneOf([\n 'ds-filter-select',\n 'ds-filter-multi-select',\n 'ds-filter-single-date',\n 'ds-filter-date-range',\n 'ds-filter-number-range',\n]);\n\nconst textWrappingType = PropTypes.oneOf(['wrap', 'wrap-all', 'truncate']);\n\nconst columnPropTypes = {\n Header: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.element]).description(\n 'Header name or component',\n ).isRequired,\n accessor: PropTypes.string.description('The entry of the data that this column will display'),\n id: PropTypes.string.description('The id of the column, will default to the Header or accessor if not present'),\n filter: outOfTheBoxFilterType.description('out-of-the-box filters'),\n Filter: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'The custom component to render as a filter',\n ),\n Cell: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('The custom cell renderer component'),\n editable: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.element]).description(\n 'The editable out-of-the-box or component to render',\n ),\n disableDnD: PropTypes.bool.description('Whereas this column should be draggable'),\n canResize: PropTypes.bool.description('Whereas this column should be resizable'),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Width of this column'),\n minWidth: PropTypes.number.description('Minimum width of this column, useful when resizing'),\n maxWidth: PropTypes.number.description('Maximum width of this column, useful when resizing'),\n canSort: PropTypes.bool.description('Whereas this column is sortable'),\n isSortedDesc: PropTypes.bool.description('Whereas this column is sorted descendingly'),\n required: PropTypes.bool.description('Whereas this column is required'),\n alwaysDisplayEditIcon: PropTypes.bool.description(\n 'Whereas to always show the edit icon on this column if it is editable',\n ),\n textWrap: textWrappingType.description('How to wrap the text in the column'),\n};\n\nconst columnsPropTypes = PropTypes.shape(columnPropTypes).description('Columns props');\n\nconst rowPropTypes = {\n tableRowDetails: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description('Component for row details'),\n dimsumHeaderValue: PropTypes.string.description('Header displayed on the header variant of the row'),\n};\n\nconst rowsPropTypes = PropTypes.shape(rowPropTypes).description('Rows props');\n\nexport const DataTableSchema = {\n columns: PropTypes.arrayOf(columnsPropTypes).description('Array of columns').isRequired,\n data: PropTypes.arrayOf(rowsPropTypes).description('Array of rows'),\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Height of the datatable component'),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Width of the datatable component'),\n renderRowActions: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]).description(\n 'The renderer to use for the action toolbar',\n ),\n isExpandable: PropTypes.bool.description('Whether the datatable is expandable').defaultValue(false),\n uniqueRowAccessor: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.func,\n ]).description(\n 'Column / Combination of columns / Function to call to produce a unique identifier for each row.' +\n ' This is necessary for the selectable and drag and drop features',\n ),\n disabledRows: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is disabled or not',\n ),\n expandedRows: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is expanded or not',\n ),\n onRowExpand: PropTypes.func.description('Function invoked when a row is (un)expanded'),\n cellRendererProps: PropTypes.object.description(\n 'Object with all the props you want the cells to have available when rendering',\n ),\n selectSingle: PropTypes.bool.description('Whether the selectable feature is single').defaultValue(false),\n selection: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is selected or not',\n ),\n onSelectionChange: PropTypes.func.description('Function invoked when a row is selected'),\n groupedRowsRenderHeader: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).description(\n 'String | Function to call which will display in the row headers',\n ),\n isResizeable: PropTypes.bool.description(\"Whether the datatable's columns are resizeable\"),\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n type: PropTypes.string,\n value: PropTypes.any,\n }),\n ).description('Array of filter keys and values'),\n withFilterBar: PropTypes.bool.description('Whether to display the filter bar'),\n filterBarProps: PropTypes.shape({\n filterBarAddonRenderer: PropTypes.func.description('Render filterbar right addon component'),\n customPillRenderer: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'If you specify custom filters, you will need to render their pills here',\n ),\n isDropdownMenuOpen: PropTypes.bool.description('Wether the DropdownMenu is Open or not.'),\n onDropdownMenuToggle: PropTypes.func.description('Callback to toggle the DropdownMenu.'),\n onClearAllFiltersClick: PropTypes.func.description('Callback for Clear Al Filters option.'),\n onDropdownMenuClickOutside: PropTypes.func.description('Callback triggered when clicking outside DropdownMenu.'),\n onDropdownMenuTriggerClick: PropTypes.func.description('Callback triggered when clicking DropdownMenu ellipsis.'),\n extraOptions: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n }),\n ).description('Any extra option you want in the dropdownmenu of the filter bar'),\n }).description('Props for the filter bar'),\n onFiltersChange: PropTypes.func.description('Function invoked when filters change'),\n pagination: PropTypes.oneOfType([\n PropTypes.oneOf([false]),\n PropTypes.shape({\n pageCount: PropTypes.number.description('How many pages are there'),\n pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),\n canPreviousPage: PropTypes.bool.description('Whether the previous button is disabled or not').defaultValue(true),\n canNextPage: PropTypes.bool.description('Whether the next button is disabled or not').defaultValue(true),\n pageSize: PropTypes.number.description('The current page size').defaultValue(10),\n showPerPageSelector: PropTypes.bool.description('Whether to show the page selector').defaultValue(true),\n perPageOptions: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.number,\n PropTypes.shape({\n dsId: PropTypes.string,\n value: PropTypes.number,\n label: PropTypes.string,\n type: PropTypes.oneOf(['single']),\n }),\n ]),\n )\n .description('The available options for page size')\n .defaultValue([10]),\n perPageStep: PropTypes.number.description('Step for the per page options').defaultValue(5),\n minPerPage: PropTypes.number.description('Step for the per page options').defaultValue(0),\n maxPerPage: PropTypes.number.description('Step for the per page options').defaultValue(100),\n onPageSizeChange: PropTypes.func\n .description('Function invoked when the page size changes')\n .defaultValue(() => null),\n onPreviousPage: PropTypes.func\n .description('Function invoked when the previous button is pressed')\n .defaultValue(() => null),\n onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),\n onNextPage: PropTypes.func.description('Function invoked when next button is pressed').defaultValue(() => null),\n pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),\n dataIsPage: PropTypes.bool.description('Whether to treat data as a page').defaultValue(false),\n pageDetailsTitle: PropTypes.string\n .description('The title of the details (usually a column of your dataset)')\n .defaultValue(''),\n }),\n ]).description('Object containing the data for the pagination'),\n colsLayoutStyle: PropTypes.oneOf(['auto', 'fixed']).description('Whether the datatable fills its container or not'),\n hiddenColumns: PropTypes.arrayOf(PropTypes.string).description('IDs of columns not to render'),\n dragAndDropRows: PropTypes.bool.description('Whether to turn on the d&d feature for the rows').defaultValue(false),\n onRowsReorder: PropTypes.func.description('Function invoked when a row is reordered'),\n maxDragAndDropLevel: PropTypes.number.description('Which level is the maximum allowed to drop into'),\n dragAndDropColumns: PropTypes.bool.description('Whether to turn on the d&d feature for the columns'),\n onColumnsReorder: PropTypes.func.description('Function invoked when a column is reordered'),\n getIsDropValid: PropTypes.func.description('Function to determine if a drop is valid'),\n textWrap: textWrappingType.description('Global wrapping rule'),\n noResultsMessage: PropTypes.string.description('Message to show when no more data is available'),\n noResultsSecondaryMessage: PropTypes.string.description('Secondary message to show when no more data is available'),\n noResultsButtonLabel: PropTypes.string.description('Label of the button when no more data is available'),\n noResultsPlaceholder: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'Custom content to show when dataset is empty',\n ),\n isLoading: PropTypes.bool.description('Whether to show a global loader in the datatable'),\n onColumnResize: PropTypes.func\n .description('Function invoked when a column is resized')\n .deprecated({ version: '4.x', message: 'Use onColumnSizeChange' }),\n onColumnSizeChange: PropTypes.func.description('Function invoked when a column is resized'),\n onRowClick: PropTypes.func.description('Function invoked when clicking a row'),\n onRowFocus: PropTypes.func.description('Function invoked when focusing a row'),\n onCellValueChange: PropTypes.func.description(\"Function invoked when an editable cell's content is changed\"),\n onColumnSortChange: PropTypes.func\n .description('Function invoked when a column is sorted')\n .deprecated({ version: '4.x', message: 'Use onColumnSort' }),\n onColumnSort: PropTypes.func.description('Function invoked when a column is sorted'),\n actionRef: PropTypes.object.description('Reference where all the exposed action callbacks will be exposed'),\n} as WeakValidationMap<unknown>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AAG1B,MAAM,wBAAwB,UAAU,MAAM;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,mBAAmB,UAAU,MAAM,CAAC,QAAQ,YAAY,UAAU,CAAC;AAEzE,MAAM,kBAAkB;AAAA,EACtB,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,UAAU,OAAO,CAAC,EAAE;AAAA,IACjF;AAAA,EACF,EAAE;AAAA,EACF,UAAU,UAAU,OAAO,YAAY,qDAAqD;AAAA,EAC5F,IAAI,UAAU,OAAO,YAAY,6EAA6E;AAAA,EAC9G,QAAQ,sBAAsB,YAAY,wBAAwB;AAAA,EAClE,QAAQ,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,OAAO,CAAC,EAAE;AAAA,IAC/D;AAAA,EACF;AAAA,EACA,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EAAE,YAAY,oCAAoC;AAAA,EAC9G,UAAU,UAAU,UAAU,C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OAAO,YAAY,gDAAgD;AAAA,EAC/F,2BAA2B,UAAU,OAAO,YAAY,0DAA0D;AAAA,EAClH,sBAAsB,UAAU,OAAO,YAAY,oDAAoD;AAAA,EACvG,sBAAsB,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,OAAO,CAAC,EAAE;AAAA,IAC7E;AAAA,EACF;AAAA,EACA,WAAW,UAAU,KAAK,YAAY,kDAAkD;AAAA,EACxF,gBAAgB,UAAU,KACvB,YAAY,2CAA2C,EACvD,WAAW,EAAE,SAAS,OAAO,SAAS,yBAAyB,CAAC;AAAA,EACnE,oBAAoB,UAAU,KAAK,YAAY,2CAA2C;AAAA,EAC1F,YAAY,UAAU,KAAK,YAAY,sCAAsC;AAAA,EAC7E,YAAY,UAAU,KAAK,YAAY,sCAAsC;AAAA,EAC7E,mBAAmB,UAAU,KAAK,YAAY,6DAA6D;AAAA,EAC3G,oBAAoB,UAAU,KAC3B,YAAY,0CAA0C,EACtD,WAAW,EAAE,SAAS,OAAO,SAAS,mBAAmB,CAAC;AAAA,EAC7D,cAAc,UAAU,KAAK,YAAY,0CAA0C;AAAA,EACnF,WAAW,UAAU,OAAO,YAAY,kEAAkE;AAC5G;",
6
6
  "names": []
7
7
  }
@@ -10,7 +10,7 @@ const trueReturner = new Proxy(
10
10
  );
11
11
  const flatten = (data, expandedRows, uniqueRowAccessor, maxDepth = 0) => {
12
12
  const result = [];
13
- const doit = (row, index = 0, parentId = null, parentIndex = null, depth = 0) => {
13
+ const doit = (row, index = 0, parent = null, parentId = null, parentIndex = null, depth = 0) => {
14
14
  const id = (parentId !== null ? `${parentId}.` : "") + index.toString();
15
15
  const uid = getIdFromUniqueRowAccessor(uniqueRowAccessor, {
16
16
  id,
@@ -22,6 +22,7 @@ const flatten = (data, expandedRows, uniqueRowAccessor, maxDepth = 0) => {
22
22
  uid,
23
23
  index,
24
24
  realIndex: result.length,
25
+ parent,
25
26
  parentId,
26
27
  parentIndex,
27
28
  depth,
@@ -33,7 +34,9 @@ const flatten = (data, expandedRows, uniqueRowAccessor, maxDepth = 0) => {
33
34
  };
34
35
  result.push(rowToPush);
35
36
  if (row?.subRows && expandedRows[uid] && depth <= maxDepth) {
36
- row.subRows.forEach((subRow, i) => doit(subRow, i, uid, rowToPush.realIndex, depth + 1));
37
+ row.subRows.forEach(
38
+ (subRow, i) => doit(subRow, i, rowToPush, uid, rowToPush.realIndex, depth + 1)
39
+ );
37
40
  }
38
41
  };
39
42
  data.forEach((row, i) => doit(row, i));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/configs/useRowFlattenization.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { useMemo } from 'react';\nimport { getIdFromUniqueRowAccessor } from '../helpers/getIdFromUniqueRowAccessor';\nimport { InternalTypescriptRow, TypescriptProps, TypescriptRow, UniqueRowAccessorType } from '../types/props';\n\nconst emptyObject = {};\n\nconst trueReturner = new Proxy(\n {},\n {\n get: () => true,\n },\n);\n\nconst flatten = (\n data: TypescriptRow[],\n expandedRows: Record<string, boolean>,\n uniqueRowAccessor: UniqueRowAccessorType,\n maxDepth = 0,\n): InternalTypescriptRow[] => {\n const result: InternalTypescriptRow[] = [];\n const doit = (\n row: TypescriptRow,\n index = 0,\n parentId: string | null = null,\n parentIndex: number | null = null,\n depth = 0,\n ) => {\n const id = (parentId !== null ? `${parentId}.` : '') + index.toString();\n\n const uid = getIdFromUniqueRowAccessor(uniqueRowAccessor, {\n id,\n original: row ?? {},\n });\n\n const isExpanded = expandedRows[uid];\n\n const rowToPush: InternalTypescriptRow = {\n id,\n uid,\n index,\n realIndex: result.length,\n parentId,\n parentIndex,\n depth,\n isExpanded,\n subRows: row?.subRows ?? [],\n childrenCount: row?.subRows?.length ?? 0,\n original: row ?? {},\n cells: [],\n };\n\n result.push(rowToPush);\n\n // If we have subrows and we are expanded\n if (row?.subRows && expandedRows[uid] && depth <= maxDepth) {\n row.subRows.forEach((subRow: TypescriptRow, i: number) => doit(subRow, i, uid, rowToPush.realIndex, depth + 1));\n }\n };\n\n data.forEach((row, i) => doit(row, i));\n return result;\n};\n\nexport const useRowFlattenization = (props: TypescriptProps): [InternalTypescriptRow[], InternalTypescriptRow[]] => {\n const { data } = props;\n\n const expandedRows = props.isExpandable ? props.expandedRows ?? emptyObject : emptyObject;\n\n const flattenedData = useMemo(\n () => flatten(data, expandedRows, props.uniqueRowAccessor),\n [data, expandedRows, props.uniqueRowAccessor],\n );\n\n const allDataFlattened = useMemo(\n () => flatten(data, trueReturner, props.uniqueRowAccessor, Infinity),\n [data, props.uniqueRowAccessor],\n );\n\n return [flattenedData, allDataFlattened];\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,eAAe;AACxB,SAAS,kCAAkC;AAG3C,MAAM,cAAc,CAAC;AAErB,MAAM,eAAe,IAAI;AAAA,EACvB,CAAC;AAAA,EACD;AAAA,IACE,KAAK,MAAM;AAAA,EACb;AACF;AAEA,MAAM,UAAU,CACd,MACA,cACA,mBACA,WAAW,MACiB;AAC5B,QAAM,SAAkC,CAAC;AACzC,QAAM,OAAO,CACX,KACA,QAAQ,GACR,WAA0B,MAC1B,cAA6B,MAC7B,QAAQ,MACL;AACH,UAAM,MAAM,aAAa,OAAO,GAAG,cAAc,MAAM,MAAM,SAAS;AAEtE,UAAM,MAAM,2BAA2B,mBAAmB;AAAA,MACxD;AAAA,MACA,UAAU,OAAO,CAAC;AAAA,IACpB,CAAC;AAED,UAAM,aAAa,aAAa;AAEhC,UAAM,YAAmC;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,OAAO;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,KAAK,WAAW,CAAC;AAAA,MAC1B,eAAe,KAAK,SAAS,UAAU;AAAA,MACvC,UAAU,OAAO,CAAC;AAAA,MAClB,OAAO,CAAC;AAAA,IACV;AAEA,WAAO,KAAK,SAAS;AAGrB,QAAI,KAAK,WAAW,aAAa,QAAQ,SAAS,UAAU;AAC1D,UAAI,QAAQ,QAAQ,CAAC,QAAuB,MAAc,KAAK,QAAQ,GAAG,KAAK,UAAU,WAAW,QAAQ,CAAC,CAAC;AAAA,IAChH;AAAA,EACF;AAEA,OAAK,QAAQ,CAAC,KAAK,MAAM,KAAK,KAAK,CAAC,CAAC;AACrC,SAAO;AACT;AAEO,MAAM,uBAAuB,CAAC,UAA+E;AAClH,QAAM,EAAE,KAAK,IAAI;AAEjB,QAAM,eAAe,MAAM,eAAe,MAAM,gBAAgB,cAAc;AAE9E,QAAM,gBAAgB;AAAA,IACpB,MAAM,QAAQ,MAAM,cAAc,MAAM,iBAAiB;AAAA,IACzD,CAAC,MAAM,cAAc,MAAM,iBAAiB;AAAA,EAC9C;AAEA,QAAM,mBAAmB;AAAA,IACvB,MAAM,QAAQ,MAAM,cAAc,MAAM,mBAAmB,QAAQ;AAAA,IACnE,CAAC,MAAM,MAAM,iBAAiB;AAAA,EAChC;AAEA,SAAO,CAAC,eAAe,gBAAgB;AACzC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { useMemo } from 'react';\nimport { getIdFromUniqueRowAccessor } from '../helpers/getIdFromUniqueRowAccessor';\nimport { InternalTypescriptRow, TypescriptProps, TypescriptRow, UniqueRowAccessorType } from '../types/props';\n\nconst emptyObject = {};\n\nconst trueReturner = new Proxy(\n {},\n {\n get: () => true,\n },\n);\n\nconst flatten = (\n data: TypescriptRow[],\n expandedRows: Record<string, boolean>,\n uniqueRowAccessor: UniqueRowAccessorType,\n maxDepth = 0,\n): InternalTypescriptRow[] => {\n const result: InternalTypescriptRow[] = [];\n const doit = (\n row: TypescriptRow,\n index = 0,\n parent: InternalTypescriptRow | null = null,\n parentId: string | null = null,\n parentIndex: number | null = null,\n depth = 0,\n ) => {\n const id = (parentId !== null ? `${parentId}.` : '') + index.toString();\n\n const uid = getIdFromUniqueRowAccessor(uniqueRowAccessor, {\n id,\n original: row ?? {},\n });\n\n const isExpanded = expandedRows[uid];\n\n const rowToPush: InternalTypescriptRow = {\n id,\n uid,\n index,\n realIndex: result.length,\n parent,\n parentId,\n parentIndex,\n depth,\n isExpanded,\n subRows: row?.subRows ?? [],\n childrenCount: row?.subRows?.length ?? 0,\n original: row ?? {},\n cells: [],\n };\n\n result.push(rowToPush);\n\n // If we have subrows and we are expanded\n if (row?.subRows && expandedRows[uid] && depth <= maxDepth) {\n row.subRows.forEach((subRow: TypescriptRow, i: number) =>\n doit(subRow, i, rowToPush, uid, rowToPush.realIndex, depth + 1),\n );\n }\n };\n\n data.forEach((row, i) => doit(row, i));\n return result;\n};\n\nexport const useRowFlattenization = (props: TypescriptProps): [InternalTypescriptRow[], InternalTypescriptRow[]] => {\n const { data } = props;\n\n const expandedRows = props.isExpandable ? props.expandedRows ?? emptyObject : emptyObject;\n\n const flattenedData = useMemo(\n () => flatten(data, expandedRows, props.uniqueRowAccessor),\n [data, expandedRows, props.uniqueRowAccessor],\n );\n\n const allDataFlattened = useMemo(\n () => flatten(data, trueReturner, props.uniqueRowAccessor, Infinity),\n [data, props.uniqueRowAccessor],\n );\n\n return [flattenedData, allDataFlattened];\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,eAAe;AACxB,SAAS,kCAAkC;AAG3C,MAAM,cAAc,CAAC;AAErB,MAAM,eAAe,IAAI;AAAA,EACvB,CAAC;AAAA,EACD;AAAA,IACE,KAAK,MAAM;AAAA,EACb;AACF;AAEA,MAAM,UAAU,CACd,MACA,cACA,mBACA,WAAW,MACiB;AAC5B,QAAM,SAAkC,CAAC;AACzC,QAAM,OAAO,CACX,KACA,QAAQ,GACR,SAAuC,MACvC,WAA0B,MAC1B,cAA6B,MAC7B,QAAQ,MACL;AACH,UAAM,MAAM,aAAa,OAAO,GAAG,cAAc,MAAM,MAAM,SAAS;AAEtE,UAAM,MA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