@elliemae/ds-data-table 3.3.0-next.4 → 3.3.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DataTable.js +1 -15
- package/dist/cjs/DataTable.js.map +1 -1
- package/dist/cjs/DataTableSchema.js +2 -0
- package/dist/cjs/DataTableSchema.js.map +2 -2
- package/dist/cjs/addons/Columns/ColumnDragHandle/ColumnDragHandle.js +13 -17
- package/dist/cjs/addons/Columns/ColumnDragHandle/ColumnDragHandle.js.map +2 -2
- package/dist/cjs/addons/Columns/ColumnExpand/ColumnExpand.js +5 -17
- package/dist/cjs/addons/Columns/ColumnExpand/ColumnExpand.js.map +1 -1
- package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js +1 -18
- package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/CurrencyRangeFilter/index.js +6 -21
- package/dist/cjs/addons/Filters/Components/CurrencyRangeFilter/index.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/NumberRangeFilter/index.js +6 -21
- package/dist/cjs/addons/Filters/Components/NumberRangeFilter/index.js.map +1 -1
- package/dist/cjs/addons/Pagination/Pagination.js +3 -19
- package/dist/cjs/addons/Pagination/Pagination.js.map +1 -1
- package/dist/cjs/configs/useDatatableConfig.js +4 -17
- package/dist/cjs/configs/useDatatableConfig.js.map +1 -1
- package/dist/cjs/configs/useInternalStateConfig.js +2 -16
- package/dist/cjs/configs/useInternalStateConfig.js.map +1 -1
- package/dist/cjs/configs/usePaginationConfig.js +4 -1
- package/dist/cjs/configs/usePaginationConfig.js.map +2 -2
- package/dist/cjs/configs/useTableColsWithAddons.js +4 -21
- package/dist/cjs/configs/useTableColsWithAddons.js.map +1 -1
- package/dist/cjs/exported-related/FilterBar/FilterBarDropdownMenu.js +75 -0
- package/dist/cjs/exported-related/FilterBar/FilterBarDropdownMenu.js.map +7 -0
- package/dist/cjs/{hooks/useRecoverFocusCol.js → exported-related/FilterBar/index.js} +5 -23
- package/dist/cjs/exported-related/FilterBar/index.js.map +7 -0
- package/dist/cjs/exported-related/FilterPopover.js +3 -19
- package/dist/cjs/exported-related/FilterPopover.js.map +1 -1
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js +4 -21
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +1 -1
- package/dist/cjs/exported-related/RowRenderer/index.js +11 -24
- package/dist/cjs/exported-related/RowRenderer/index.js.map +1 -1
- package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js +4 -17
- package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js.map +1 -1
- package/dist/cjs/exported-related/index.js +1 -0
- package/dist/cjs/exported-related/index.js.map +2 -2
- package/dist/cjs/parts/Cells/Cell.js +20 -26
- package/dist/cjs/parts/Cells/Cell.js.map +1 -1
- package/dist/cjs/parts/DnDHandle.js +9 -22
- package/dist/cjs/parts/DnDHandle.js.map +2 -2
- package/dist/cjs/parts/FilterBar/FiltersBar.js +2 -1
- package/dist/cjs/parts/FilterBar/FiltersBar.js.map +2 -2
- package/dist/cjs/parts/Filters/index.js +9 -21
- package/dist/cjs/parts/Filters/index.js.map +1 -1
- package/dist/cjs/parts/Headers/HeaderCell.js +4 -23
- package/dist/cjs/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderResizer.js +1 -15
- package/dist/cjs/parts/Headers/HeaderResizer.js.map +1 -1
- package/dist/cjs/parts/Headers/useHeaderCellHandlers.js +3 -20
- package/dist/cjs/parts/Headers/useHeaderCellHandlers.js.map +1 -1
- package/dist/cjs/parts/HoC/SortableItemContext.js.map +1 -1
- package/dist/cjs/parts/HoC/withConditionalDnDColumnContext.js +10 -20
- package/dist/cjs/parts/HoC/withConditionalDnDColumnContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +11 -19
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withConditionalDnDSortableContext.js +9 -19
- package/dist/cjs/parts/HoC/withConditionalDnDSortableContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withDnDSortableColumnContext.js +8 -22
- package/dist/cjs/parts/HoC/withDnDSortableColumnContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withDnDSortableRowContext.js +8 -22
- package/dist/cjs/parts/HoC/withDnDSortableRowContext.js.map +2 -2
- package/dist/cjs/parts/RowVariants/RowVariantSkeleton.js +3 -19
- package/dist/cjs/parts/RowVariants/RowVariantSkeleton.js.map +1 -1
- package/dist/cjs/parts/RowVariants/index.js +11 -21
- package/dist/cjs/parts/RowVariants/index.js.map +1 -1
- package/dist/cjs/parts/Rows.js +3 -15
- package/dist/cjs/parts/Rows.js.map +1 -1
- package/dist/cjs/parts/SortableHeaderCell.js +12 -46
- package/dist/cjs/parts/SortableHeaderCell.js.map +1 -1
- package/dist/cjs/parts/TableContent.js +3 -19
- package/dist/cjs/parts/TableContent.js.map +1 -1
- package/dist/cjs/types/props.js.map +1 -1
- package/dist/esm/DataTable.js +1 -17
- package/dist/esm/DataTable.js.map +1 -1
- package/dist/esm/DataTableSchema.js +2 -0
- package/dist/esm/DataTableSchema.js.map +2 -2
- package/dist/esm/addons/Columns/ColumnDragHandle/ColumnDragHandle.js +13 -17
- package/dist/esm/addons/Columns/ColumnDragHandle/ColumnDragHandle.js.map +2 -2
- package/dist/esm/addons/Columns/ColumnExpand/ColumnExpand.js +5 -19
- package/dist/esm/addons/Columns/ColumnExpand/ColumnExpand.js.map +1 -1
- package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js +1 -20
- package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +1 -1
- package/dist/esm/addons/Filters/Components/CurrencyRangeFilter/index.js +6 -23
- package/dist/esm/addons/Filters/Components/CurrencyRangeFilter/index.js.map +1 -1
- package/dist/esm/addons/Filters/Components/NumberRangeFilter/index.js +6 -23
- package/dist/esm/addons/Filters/Components/NumberRangeFilter/index.js.map +1 -1
- package/dist/esm/addons/Pagination/Pagination.js +3 -21
- package/dist/esm/addons/Pagination/Pagination.js.map +1 -1
- package/dist/esm/configs/useDatatableConfig.js +4 -19
- package/dist/esm/configs/useDatatableConfig.js.map +1 -1
- package/dist/esm/configs/useInternalStateConfig.js +2 -18
- package/dist/esm/configs/useInternalStateConfig.js.map +1 -1
- package/dist/esm/configs/usePaginationConfig.js +4 -1
- package/dist/esm/configs/usePaginationConfig.js.map +2 -2
- package/dist/esm/configs/useTableColsWithAddons.js +4 -23
- package/dist/esm/configs/useTableColsWithAddons.js.map +1 -1
- package/dist/esm/exported-related/FilterBar/FilterBarDropdownMenu.js +53 -0
- package/dist/esm/exported-related/FilterBar/FilterBarDropdownMenu.js.map +7 -0
- package/dist/esm/exported-related/FilterBar/index.js +4 -0
- package/dist/esm/exported-related/FilterBar/index.js.map +7 -0
- package/dist/esm/exported-related/FilterPopover.js +3 -21
- package/dist/esm/exported-related/FilterPopover.js.map +1 -1
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js +4 -23
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +1 -1
- package/dist/esm/exported-related/RowRenderer/index.js +11 -26
- package/dist/esm/exported-related/RowRenderer/index.js.map +1 -1
- package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js +4 -19
- package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js.map +1 -1
- package/dist/esm/exported-related/index.js +1 -0
- package/dist/esm/exported-related/index.js.map +2 -2
- package/dist/esm/parts/Cells/Cell.js +20 -28
- package/dist/esm/parts/Cells/Cell.js.map +1 -1
- package/dist/esm/parts/DnDHandle.js +9 -24
- package/dist/esm/parts/DnDHandle.js.map +2 -2
- package/dist/esm/parts/FilterBar/FiltersBar.js +2 -1
- package/dist/esm/parts/FilterBar/FiltersBar.js.map +2 -2
- package/dist/esm/parts/Filters/index.js +9 -23
- package/dist/esm/parts/Filters/index.js.map +1 -1
- package/dist/esm/parts/Headers/HeaderCell.js +4 -25
- package/dist/esm/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderResizer.js +1 -17
- package/dist/esm/parts/Headers/HeaderResizer.js.map +1 -1
- package/dist/esm/parts/Headers/useHeaderCellHandlers.js +3 -22
- package/dist/esm/parts/Headers/useHeaderCellHandlers.js.map +1 -1
- package/dist/esm/parts/HoC/SortableItemContext.js.map +1 -1
- package/dist/esm/parts/HoC/withConditionalDnDColumnContext.js +10 -22
- package/dist/esm/parts/HoC/withConditionalDnDColumnContext.js.map +2 -2
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +12 -22
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/esm/parts/HoC/withConditionalDnDSortableContext.js +7 -19
- package/dist/esm/parts/HoC/withConditionalDnDSortableContext.js.map +2 -2
- package/dist/esm/parts/HoC/withDnDSortableColumnContext.js +7 -23
- package/dist/esm/parts/HoC/withDnDSortableColumnContext.js.map +2 -2
- package/dist/esm/parts/HoC/withDnDSortableRowContext.js +7 -23
- package/dist/esm/parts/HoC/withDnDSortableRowContext.js.map +2 -2
- package/dist/esm/parts/RowVariants/RowVariantSkeleton.js +3 -21
- package/dist/esm/parts/RowVariants/RowVariantSkeleton.js.map +1 -1
- package/dist/esm/parts/RowVariants/index.js +11 -23
- package/dist/esm/parts/RowVariants/index.js.map +1 -1
- package/dist/esm/parts/Rows.js +3 -17
- package/dist/esm/parts/Rows.js.map +1 -1
- package/dist/esm/parts/SortableHeaderCell.js +12 -48
- package/dist/esm/parts/SortableHeaderCell.js.map +1 -1
- package/dist/esm/parts/TableContent.js +3 -21
- package/dist/esm/parts/TableContent.js.map +1 -1
- package/package.json +18 -18
- package/dist/cjs/hooks/useRecoverFocusCol.js.map +0 -7
- package/dist/cjs/hooks/useRecoverFocusRow.js +0 -46
- package/dist/cjs/hooks/useRecoverFocusRow.js.map +0 -7
- package/dist/esm/hooks/useRecoverFocusCol.js +0 -19
- package/dist/esm/hooks/useRecoverFocusCol.js.map +0 -7
- package/dist/esm/hooks/useRecoverFocusRow.js +0 -24
- package/dist/esm/hooks/useRecoverFocusRow.js.map +0 -7
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __spreadValues = (a, b) => {
|
|
8
|
-
for (var prop in b || (b = {}))
|
|
9
|
-
if (__hasOwnProp.call(b, prop))
|
|
10
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11
|
-
if (__getOwnPropSymbols)
|
|
12
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
-
if (__propIsEnum.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
2
|
import * as React from "react";
|
|
19
3
|
import React2 from "react";
|
|
20
4
|
import { ROW_VARIANTS } from "../../exported-related";
|
|
@@ -27,12 +11,14 @@ const RowVariantMapper = {
|
|
|
27
11
|
[ROW_VARIANTS.HEADER_GROUP]: RowVariantHeader,
|
|
28
12
|
[ROW_VARIANTS.PRIMARY]: RowVariantPrimary,
|
|
29
13
|
[ROW_VARIANTS.SECONDARY]: RowVariantSecondary,
|
|
30
|
-
[ROW_VARIANTS.COMPACT_PRIMARY]: (props) => /* @__PURE__ */ React2.createElement(RowVariantPrimary,
|
|
31
|
-
compact: true
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
[ROW_VARIANTS.COMPACT_PRIMARY]: (props) => /* @__PURE__ */ React2.createElement(RowVariantPrimary, {
|
|
15
|
+
compact: true,
|
|
16
|
+
...props
|
|
17
|
+
}),
|
|
18
|
+
[ROW_VARIANTS.COMPACT_SECONDARY]: (props) => /* @__PURE__ */ React2.createElement(RowVariantSecondary, {
|
|
19
|
+
compact: true,
|
|
20
|
+
...props
|
|
21
|
+
}),
|
|
36
22
|
[ROW_VARIANTS.SKELETON]: RowVariantSkeleton
|
|
37
23
|
};
|
|
38
24
|
const RowVariantMapItem = (props) => {
|
|
@@ -52,7 +38,9 @@ const RowVariantMapItem = (props) => {
|
|
|
52
38
|
} else {
|
|
53
39
|
Component = variant;
|
|
54
40
|
}
|
|
55
|
-
return /* @__PURE__ */ React2.createElement(Component,
|
|
41
|
+
return /* @__PURE__ */ React2.createElement(Component, {
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
56
44
|
};
|
|
57
45
|
export {
|
|
58
46
|
RowVariantMapItem
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/RowVariants/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ROW_VARIANTS } from '../../exported-related';\nimport { TypescriptContext, TypescriptRow } from '../../types/props';\nimport { Cells } from '../Cells';\nimport { RowVariantHeader } from './RowVariantHeader';\nimport { RowVariantPrimary } from './RowVariantPrimary';\nimport { RowVariantSecondary } from './RowVariantSecondary';\nimport { RowVariantSkeleton } from './RowVariantSkeleton';\nimport { RowVariantProps } from './types';\n\nconst RowVariantMapper: Record<string, React.ComponentType<RowVariantProps>> = {\n [ROW_VARIANTS.HEADER_GROUP]: RowVariantHeader,\n [ROW_VARIANTS.PRIMARY]: RowVariantPrimary,\n [ROW_VARIANTS.SECONDARY]: RowVariantSecondary,\n [ROW_VARIANTS.COMPACT_PRIMARY]: (props) => <RowVariantPrimary compact {...props} />,\n [ROW_VARIANTS.COMPACT_SECONDARY]: (props) => <RowVariantSecondary compact {...props} />,\n [ROW_VARIANTS.SKELETON]: RowVariantSkeleton,\n};\n\ninterface RowVariantMapItemProps {\n row: TypescriptRow;\n itemIndex: number;\n isDragOverlay: boolean;\n ctx: TypescriptContext;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n}\n\nexport const RowVariantMapItem: React.ComponentType<RowVariantMapItemProps> = (props) => {\n const {\n row,\n ctx: {\n tableProps: { getRowVariant },\n },\n } = props;\n\n const variant = getRowVariant(row, Cells);\n\n let Component: React.ComponentType<any>;\n\n if (typeof variant === 'string') {\n if (!(variant in RowVariantMapper)) {\n throw new Error(`${variant} is not an out-of-the-box row variant`);\n }\n Component = RowVariantMapper[variant];\n } else {\n Component = variant;\n }\n\n return <Component {...props} />;\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA,MAAM,mBAAyE;AAAA,EAC7E,CAAC,aAAa,eAAe;AAAA,EAC7B,CAAC,aAAa,UAAU;AAAA,EACxB,CAAC,aAAa,YAAY;AAAA,EAC1B,CAAC,aAAa,kBAAkB,CAAC,UAAU,qCAAC;AAAA,IAAkB,SAAO;AAAA,IAAE,GAAG;AAAA,GAAO;AAAA,EACjF,CAAC,aAAa,oBAAoB,CAAC,UAAU,qCAAC;AAAA,IAAoB,SAAO;AAAA,IAAE,GAAG;AAAA,GAAO;AAAA,EACrF,CAAC,aAAa,WAAW;AAC3B;AAWO,MAAM,oBAAiE,CAAC,UAAU;AACvF,QAAM;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,MACH,YAAY,EAAE;AAAA;AAAA,MAEd;AAEJ,QAAM,UAAU,cAAc,KAAK,KAAK;AAExC,MAAI;AAEJ,MAAI,OAAO,YAAY,UAAU;AAC/B,QAAI,CAAE,YAAW,mBAAmB;AAClC,YAAM,IAAI,MAAM,GAAG,8CAA8C;AAAA,IACnE;AACA,gBAAY,iBAAiB;AAAA,EAC/B,OAAO;AACL,gBAAY;AAAA,EACd;AAEA,SAAO,qCAAC;AAAA,IAAW,GAAG;AAAA,GAAO;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/parts/Rows.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __spreadValues = (a, b) => {
|
|
8
|
-
for (var prop in b || (b = {}))
|
|
9
|
-
if (__hasOwnProp.call(b, prop))
|
|
10
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11
|
-
if (__getOwnPropSymbols)
|
|
12
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
-
if (__propIsEnum.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
2
|
import * as React from "react";
|
|
19
3
|
import React2, { useContext, useMemo } from "react";
|
|
20
4
|
import { RowWithContext as Row } from "./Row";
|
|
@@ -50,7 +34,9 @@ const Rows = () => {
|
|
|
50
34
|
itemIndex: index,
|
|
51
35
|
itemWrapperStyle: style
|
|
52
36
|
};
|
|
53
|
-
return /* @__PURE__ */ React2.createElement(Row,
|
|
37
|
+
return /* @__PURE__ */ React2.createElement(Row, {
|
|
38
|
+
...rowProps
|
|
39
|
+
});
|
|
54
40
|
})), [virtualItems, items, visibleColumns, totalColumnsWidth]);
|
|
55
41
|
return PureVirtualizedRows;
|
|
56
42
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Rows.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACCA;AAEA;AACA;AACA;AACA;AAEA,MAAM,OAAO,MAAmB;AAC9B,QAAM;AAAA,IACJ,oBAAoB,EAAE;AAAA,IACtB,eAAe,EAAE;AAAA,IACjB;AAAA,IACA;AAAA,MACE,WAAW,gBAAgB;AAE/B,QAAM,EAAE,iBAAiB,WAAW,cAAc;AAElD,QAAM,QAAQ,gBAAgB;AAE9B,QAAM,sBAAsB,QAC1B,MACE,4DACG,aAAa,IAAI,CAAC,gBAAgB;AACjC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,MAAM,MAAM;AAClB,QAAI,CAAC;AAAK,aAAO;AACjB,gBAAY,KAAK,cAAc;AAC/B,UAAM,QAAQ;AAAA,MACZ,UAAU;AAAA,MACV,KAAK,GAAG;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AACA,UAAM,WAAW;AAAA,MACf,KAAK,gBAAgB,IAAI;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX,kBAAkB;AAAA,IACpB;AACA,WAAO,qCAAC;AAAA,MAAK,GAAG;AAAA,KAAU;AAAA,EAC5B,CAAC,CACH,GAEF,CAAC,cAAc,OAAO,gBAAgB,iBAAiB,CACzD;AAEA,SAAO;AACT;AAEA,KAAK,YAAY,CAAC;AAEX,MAAM,kBAAkB,6BAA6B,IAAI;AAChE,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,56 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
2
|
import * as React from "react";
|
|
34
3
|
import { Grid } from "@elliemae/ds-grid";
|
|
35
4
|
import { withConditionalDnDSortableContext } from "./HoC/withConditionalDnDSortableContext";
|
|
36
5
|
import { sizeToCss } from "../helpers";
|
|
37
|
-
const SortableHeaderCell = (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
style: isGroup ? {
|
|
50
|
-
gridAutoFlow: "column"
|
|
51
|
-
} : { display: "flex" }
|
|
52
|
-
}));
|
|
53
|
-
};
|
|
6
|
+
const SortableHeaderCell = ({
|
|
7
|
+
items,
|
|
8
|
+
isDragOverlay = false,
|
|
9
|
+
isGroup = false,
|
|
10
|
+
...rest
|
|
11
|
+
}) => withConditionalDnDSortableContext(items, isDragOverlay)(Grid)({
|
|
12
|
+
...rest,
|
|
13
|
+
cols: isGroup ? items.map((col) => sizeToCss(col.width ?? 150)) : void 0,
|
|
14
|
+
style: isGroup ? {
|
|
15
|
+
gridAutoFlow: "column"
|
|
16
|
+
} : { display: "flex" }
|
|
17
|
+
});
|
|
54
18
|
export {
|
|
55
19
|
SortableHeaderCell
|
|
56
20
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/SortableHeaderCell.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Grid } from '@elliemae/ds-grid';\nimport { TypescriptColumn } from '../types/props';\nimport { withConditionalDnDSortableContext } from './HoC/withConditionalDnDSortableContext';\nimport { sizeToCss } from '../helpers';\n\nexport const SortableHeaderCell = ({\n items,\n isDragOverlay = false,\n isGroup = false,\n ...rest\n}: {\n items: TypescriptColumn[];\n isDragOverlay?: boolean;\n isGroup: boolean;\n children: JSX.Element | JSX.Element[];\n}): JSX.Element =>\n withConditionalDnDSortableContext(items, isDragOverlay)(Grid)({\n ...rest,\n cols: isGroup ? items.map((col) => sizeToCss(col.width ?? 150)) : undefined,\n style: isGroup\n ? {\n gridAutoFlow: 'column',\n }\n : { display: 'flex' },\n });\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACAA;AAEA;AACA;AAEO,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA,gBAAgB;AAAA,EAChB,UAAU;AAAA,KACP;AAAA,MAOH,kCAAkC,OAAO,aAAa,EAAE,IAAI,EAAE;AAAA,EAC5D,GAAG;AAAA,EACH,MAAM,UAAU,MAAM,IAAI,CAAC,QAAQ,UAAU,IAAI,SAAS,GAAG,CAAC,IAAI;AAAA,EAClE,OAAO,UACH;AAAA,IACE,cAAc;AAAA,EAChB,IACA,EAAE,SAAS,OAAO;AACxB,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
2
|
import * as React from "react";
|
|
22
3
|
import React2, { useContext, useMemo, useState } from "react";
|
|
23
4
|
import { StyledTableWrapper, StyledDataTableContentWrapper } from "../styled";
|
|
@@ -49,9 +30,10 @@ const TableContentComponent = (props) => {
|
|
|
49
30
|
}, /* @__PURE__ */ React2.createElement(VirtualRowsList, null)), pagination ? /* @__PURE__ */ React2.createElement(Pagination, null) : null), [forwardedRef, allDataFlattened.length, visibleColumns.length, pagination, shiftKeyPressed]);
|
|
50
31
|
return PureTableContent;
|
|
51
32
|
};
|
|
52
|
-
const TableContent = React2.forwardRef((props, ref) => /* @__PURE__ */ React2.createElement(TableContentComponent,
|
|
33
|
+
const TableContent = React2.forwardRef((props, ref) => /* @__PURE__ */ React2.createElement(TableContentComponent, {
|
|
34
|
+
...props,
|
|
53
35
|
forwardedRef: ref
|
|
54
|
-
}))
|
|
36
|
+
}));
|
|
55
37
|
var TableContent_default = TableContent;
|
|
56
38
|
export {
|
|
57
39
|
TableContent,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TableContent.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo, useState } from 'react';\n\nimport { StyledTableWrapper, StyledDataTableContentWrapper } from '../styled';\nimport DataTableContext from '../DataTableContext';\nimport { Pagination } from '../addons/Pagination';\nimport { VirtualRowsList } from './VirtualRowsList';\nimport { DATA_TESTID } from '../configs/constants';\n\ntype TableContentProps = {\n forwardedRef: React.ForwardedRef<HTMLDivElement>;\n};\n\nconst TableContentComponent = (props: TableContentProps) => {\n const { forwardedRef } = props;\n const {\n tableProps: { pagination },\n allDataFlattened,\n visibleColumns,\n } = useContext(DataTableContext);\n\n const [shiftKeyPressed, setShiftKeyPressed] = useState(false);\n\n const PureTableContent = useMemo(\n () => (\n <StyledDataTableContentWrapper\n data-testid={DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER}\n ref={forwardedRef}\n noSelectionAllowed={shiftKeyPressed}\n onKeyDown={(e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed || e.shiftKey)}\n onKeyUp={(e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed && e.code !== 'Shift')}\n rows={pagination ? ['1fr', 'auto'] : ['auto']}\n cols={['100%']}\n >\n <StyledTableWrapper\n role=\"table\"\n aria-rowcount={allDataFlattened.length}\n aria-colcount={visibleColumns.length}\n data-testid={DATA_TESTID.DATA_TABLE_TABLE}\n >\n <VirtualRowsList />\n </StyledTableWrapper>\n {pagination ? <Pagination /> : null}\n </StyledDataTableContentWrapper>\n ),\n [forwardedRef, allDataFlattened.length, visibleColumns.length, pagination, shiftKeyPressed],\n );\n\n return PureTableContent;\n};\n\nexport const TableContent = React.forwardRef<HTMLDivElement>((props, ref) => (\n <TableContentComponent {...props} forwardedRef={ref} />\n));\n\nexport default TableContent;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACAA;AAEA;AACA;AACA;AACA;AACA;AAMA,MAAM,wBAAwB,CAAC,UAA6B;AAC1D,QAAM,EAAE,iBAAiB;AACzB,QAAM;AAAA,IACJ,YAAY,EAAE;AAAA,IACd;AAAA,IACA;AAAA,MACE,WAAW,gBAAgB;AAE/B,QAAM,CAAC,iBAAiB,sBAAsB,SAAS,KAAK;AAE5D,QAAM,mBAAmB,QACvB,MACE,qCAAC;AAAA,IACC,eAAa,YAAY;AAAA,IACzB,KAAK;AAAA,IACL,oBAAoB;AAAA,IACpB,WAAW,CAAC,MAAM,mBAAmB,CAAC,wBAAwB,uBAAuB,EAAE,QAAQ;AAAA,IAC/F,SAAS,CAAC,MAAM,mBAAmB,CAAC,wBAAwB,uBAAuB,EAAE,SAAS,OAAO;AAAA,IACrG,MAAM,aAAa,CAAC,OAAO,MAAM,IAAI,CAAC,MAAM;AAAA,IAC5C,MAAM,CAAC,MAAM;AAAA,KAEb,qCAAC;AAAA,IACC,MAAK;AAAA,IACL,iBAAe,iBAAiB;AAAA,IAChC,iBAAe,eAAe;AAAA,IAC9B,eAAa,YAAY;AAAA,KAEzB,qCAAC,qBAAgB,CACnB,GACC,aAAa,qCAAC,gBAAW,IAAK,IACjC,GAEF,CAAC,cAAc,iBAAiB,QAAQ,eAAe,QAAQ,YAAY,eAAe,CAC5F;AAEA,SAAO;AACT;AAEO,MAAM,eAAe,OAAM,WAA2B,CAAC,OAAO,QACnE,qCAAC;AAAA,EAAuB,GAAG;AAAA,EAAO,cAAc;AAAA,CAAK,CACtD;AAED,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-data-table",
|
|
3
|
-
"version": "3.3.0-next.
|
|
3
|
+
"version": "3.3.0-next.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Data Table",
|
|
6
6
|
"files": [
|
|
@@ -571,23 +571,23 @@
|
|
|
571
571
|
"indent": 4
|
|
572
572
|
},
|
|
573
573
|
"dependencies": {
|
|
574
|
-
"@elliemae/ds-button": "3.3.0-next.
|
|
575
|
-
"@elliemae/ds-circular-progress-indicator": "3.3.0-next.
|
|
576
|
-
"@elliemae/ds-controlled-form": "3.3.0-next.
|
|
577
|
-
"@elliemae/ds-drag-and-drop": "3.3.0-next.
|
|
578
|
-
"@elliemae/ds-dropdownmenu": "3.3.0-next.
|
|
579
|
-
"@elliemae/ds-form": "3.3.0-next.
|
|
580
|
-
"@elliemae/ds-form-layout-blocks": "3.3.0-next.
|
|
581
|
-
"@elliemae/ds-grid": "3.3.0-next.
|
|
582
|
-
"@elliemae/ds-icons": "3.3.0-next.
|
|
583
|
-
"@elliemae/ds-pagination": "3.3.0-next.
|
|
584
|
-
"@elliemae/ds-pills": "3.3.0-next.
|
|
585
|
-
"@elliemae/ds-popperjs": "3.3.0-next.
|
|
586
|
-
"@elliemae/ds-skeleton": "3.3.0-next.
|
|
587
|
-
"@elliemae/ds-system": "3.3.0-next.
|
|
588
|
-
"@elliemae/ds-toolbar": "3.3.0-next.
|
|
589
|
-
"@elliemae/ds-truncated-tooltip-text": "3.3.0-next.
|
|
590
|
-
"@elliemae/ds-utilities": "3.3.0-next.
|
|
574
|
+
"@elliemae/ds-button": "3.3.0-next.7",
|
|
575
|
+
"@elliemae/ds-circular-progress-indicator": "3.3.0-next.7",
|
|
576
|
+
"@elliemae/ds-controlled-form": "3.3.0-next.7",
|
|
577
|
+
"@elliemae/ds-drag-and-drop": "3.3.0-next.7",
|
|
578
|
+
"@elliemae/ds-dropdownmenu": "3.3.0-next.7",
|
|
579
|
+
"@elliemae/ds-form": "3.3.0-next.7",
|
|
580
|
+
"@elliemae/ds-form-layout-blocks": "3.3.0-next.7",
|
|
581
|
+
"@elliemae/ds-grid": "3.3.0-next.7",
|
|
582
|
+
"@elliemae/ds-icons": "3.3.0-next.7",
|
|
583
|
+
"@elliemae/ds-pagination": "3.3.0-next.7",
|
|
584
|
+
"@elliemae/ds-pills": "3.3.0-next.7",
|
|
585
|
+
"@elliemae/ds-popperjs": "3.3.0-next.7",
|
|
586
|
+
"@elliemae/ds-skeleton": "3.3.0-next.7",
|
|
587
|
+
"@elliemae/ds-system": "3.3.0-next.7",
|
|
588
|
+
"@elliemae/ds-toolbar": "3.3.0-next.7",
|
|
589
|
+
"@elliemae/ds-truncated-tooltip-text": "3.3.0-next.7",
|
|
590
|
+
"@elliemae/ds-utilities": "3.3.0-next.7",
|
|
591
591
|
"react-virtual": "~2.10.4",
|
|
592
592
|
"uid": "~2.0.0"
|
|
593
593
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useRecoverFocusCol.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect, useState } from 'react';\n\n// The drag-handle of the column is not replaced by another node,\n// so we just keep track of it and focus it if necessary\n\nexport const useRecoverFocusCol = (condition: boolean, ref: React.MutableRefObject<HTMLElement>): void => {\n const [prevCondition, setPrevCondition] = useState(condition);\n\n useEffect(() => {\n if (prevCondition && !condition) {\n if (ref.current) ref.current?.focus();\n else setTimeout(() => ref.current?.focus());\n }\n setPrevCondition(condition);\n }, [condition, prevCondition, ref]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA2C;AAKpC,MAAM,qBAAqB,CAAC,WAAoB,QAAmD;AACxG,QAAM,CAAC,eAAe,oBAAoB,2BAAS,SAAS;AAE5D,8BAAU,MAAM;AACd,QAAI,iBAAiB,CAAC,WAAW;AAC/B,UAAI,IAAI;AAAS,YAAI,SAAS,MAAM;AAAA;AAC/B,mBAAW,MAAM,IAAI,SAAS,MAAM,CAAC;AAAA,IAC5C;AACA,qBAAiB,SAAS;AAAA,EAC5B,GAAG,CAAC,WAAW,eAAe,GAAG,CAAC;AACpC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
-
var useRecoverFocusRow_exports = {};
|
|
23
|
-
__export(useRecoverFocusRow_exports, {
|
|
24
|
-
useRecoverFocusRow: () => useRecoverFocusRow
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(useRecoverFocusRow_exports);
|
|
27
|
-
var React = __toESM(require("react"));
|
|
28
|
-
var import_react = require("react");
|
|
29
|
-
const useRecoverFocusRow = (row, cell, isDragOverlay, draggableProps) => {
|
|
30
|
-
const isDragging = draggableProps && draggableProps.isDragging;
|
|
31
|
-
const lastActiveId = draggableProps && draggableProps.lastActiveId;
|
|
32
|
-
const setLastActiveId = draggableProps && draggableProps.setLastActiveId;
|
|
33
|
-
const timeoutRef = (0, import_react.useRef)(null);
|
|
34
|
-
(0, import_react.useEffect)(() => {
|
|
35
|
-
if (!isDragging && !isDragOverlay && lastActiveId === row.uid) {
|
|
36
|
-
timeoutRef.current = setTimeout(() => {
|
|
37
|
-
cell.ref.current.focus();
|
|
38
|
-
setLastActiveId(null);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
return () => {
|
|
42
|
-
clearTimeout(timeoutRef.current);
|
|
43
|
-
};
|
|
44
|
-
}, [isDragging, isDragOverlay, lastActiveId, row.uid, setLastActiveId, cell.ref]);
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=useRecoverFocusRow.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useRecoverFocusRow.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-params */\nimport { useEffect, useRef } from 'react';\n\n// When we re-render the rows, the drag handle is replaced by another node\n// So we keep track of the last active id, and re-focus it\n\nexport const useRecoverFocusRow = (row, cell, isDragOverlay, draggableProps) => {\n const isDragging = draggableProps && draggableProps.isDragging;\n const lastActiveId = draggableProps && draggableProps.lastActiveId;\n const setLastActiveId = draggableProps && draggableProps.setLastActiveId;\n\n const timeoutRef = useRef(null);\n\n useEffect(() => {\n if (!isDragging && !isDragOverlay && lastActiveId === row.uid) {\n timeoutRef.current = setTimeout(() => {\n cell.ref.current.focus();\n setLastActiveId(null);\n });\n }\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, [isDragging, isDragOverlay, lastActiveId, row.uid, setLastActiveId, cell.ref]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkC;AAK3B,MAAM,qBAAqB,CAAC,KAAK,MAAM,eAAe,mBAAmB;AAC9E,QAAM,aAAa,kBAAkB,eAAe;AACpD,QAAM,eAAe,kBAAkB,eAAe;AACtD,QAAM,kBAAkB,kBAAkB,eAAe;AAEzD,QAAM,aAAa,yBAAO,IAAI;AAE9B,8BAAU,MAAM;AACd,QAAI,CAAC,cAAc,CAAC,iBAAiB,iBAAiB,IAAI,KAAK;AAC7D,iBAAW,UAAU,WAAW,MAAM;AACpC,aAAK,IAAI,QAAQ,MAAM;AACvB,wBAAgB,IAAI;AAAA,MACtB,CAAC;AAAA,IACH;AACA,WAAO,MAAM;AACX,mBAAa,WAAW,OAAO;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,YAAY,eAAe,cAAc,IAAI,KAAK,iBAAiB,KAAK,GAAG,CAAC;AAClF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
const useRecoverFocusCol = (condition, ref) => {
|
|
5
|
-
const [prevCondition, setPrevCondition] = useState(condition);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
if (prevCondition && !condition) {
|
|
8
|
-
if (ref.current)
|
|
9
|
-
ref.current?.focus();
|
|
10
|
-
else
|
|
11
|
-
setTimeout(() => ref.current?.focus());
|
|
12
|
-
}
|
|
13
|
-
setPrevCondition(condition);
|
|
14
|
-
}, [condition, prevCondition, ref]);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
useRecoverFocusCol
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=useRecoverFocusCol.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useRecoverFocusCol.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect, useState } from 'react';\n\n// The drag-handle of the column is not replaced by another node,\n// so we just keep track of it and focus it if necessary\n\nexport const useRecoverFocusCol = (condition: boolean, ref: React.MutableRefObject<HTMLElement>): void => {\n const [prevCondition, setPrevCondition] = useState(condition);\n\n useEffect(() => {\n if (prevCondition && !condition) {\n if (ref.current) ref.current?.focus();\n else setTimeout(() => ref.current?.focus());\n }\n setPrevCondition(condition);\n }, [condition, prevCondition, ref]);\n};\n"],
|
|
5
|
-
"mappings": ";AAAA;ACAA;AAKO,MAAM,qBAAqB,CAAC,WAAoB,QAAmD;AACxG,QAAM,CAAC,eAAe,oBAAoB,SAAS,SAAS;AAE5D,YAAU,MAAM;AACd,QAAI,iBAAiB,CAAC,WAAW;AAC/B,UAAI,IAAI;AAAS,YAAI,SAAS,MAAM;AAAA;AAC/B,mBAAW,MAAM,IAAI,SAAS,MAAM,CAAC;AAAA,IAC5C;AACA,qBAAiB,SAAS;AAAA,EAC5B,GAAG,CAAC,WAAW,eAAe,GAAG,CAAC;AACpC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
4
|
-
const useRecoverFocusRow = (row, cell, isDragOverlay, draggableProps) => {
|
|
5
|
-
const isDragging = draggableProps && draggableProps.isDragging;
|
|
6
|
-
const lastActiveId = draggableProps && draggableProps.lastActiveId;
|
|
7
|
-
const setLastActiveId = draggableProps && draggableProps.setLastActiveId;
|
|
8
|
-
const timeoutRef = useRef(null);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (!isDragging && !isDragOverlay && lastActiveId === row.uid) {
|
|
11
|
-
timeoutRef.current = setTimeout(() => {
|
|
12
|
-
cell.ref.current.focus();
|
|
13
|
-
setLastActiveId(null);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return () => {
|
|
17
|
-
clearTimeout(timeoutRef.current);
|
|
18
|
-
};
|
|
19
|
-
}, [isDragging, isDragOverlay, lastActiveId, row.uid, setLastActiveId, cell.ref]);
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
useRecoverFocusRow
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=useRecoverFocusRow.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useRecoverFocusRow.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { useEffect, useRef } from 'react';\n\n// When we re-render the rows, the drag handle is replaced by another node\n// So we keep track of the last active id, and re-focus it\n\nexport const useRecoverFocusRow = (row, cell, isDragOverlay, draggableProps) => {\n const isDragging = draggableProps && draggableProps.isDragging;\n const lastActiveId = draggableProps && draggableProps.lastActiveId;\n const setLastActiveId = draggableProps && draggableProps.setLastActiveId;\n\n const timeoutRef = useRef(null);\n\n useEffect(() => {\n if (!isDragging && !isDragOverlay && lastActiveId === row.uid) {\n timeoutRef.current = setTimeout(() => {\n cell.ref.current.focus();\n setLastActiveId(null);\n });\n }\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, [isDragging, isDragOverlay, lastActiveId, row.uid, setLastActiveId, cell.ref]);\n};\n"],
|
|
5
|
-
"mappings": ";AAAA;ACCA;AAKO,MAAM,qBAAqB,CAAC,KAAK,MAAM,eAAe,mBAAmB;AAC9E,QAAM,aAAa,kBAAkB,eAAe;AACpD,QAAM,eAAe,kBAAkB,eAAe;AACtD,QAAM,kBAAkB,kBAAkB,eAAe;AAEzD,QAAM,aAAa,OAAO,IAAI;AAE9B,YAAU,MAAM;AACd,QAAI,CAAC,cAAc,CAAC,iBAAiB,iBAAiB,IAAI,KAAK;AAC7D,iBAAW,UAAU,WAAW,MAAM;AACpC,aAAK,IAAI,QAAQ,MAAM;AACvB,wBAAgB,IAAI;AAAA,MACtB,CAAC;AAAA,IACH;AACA,WAAO,MAAM;AACX,mBAAa,WAAW,OAAO;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,YAAY,eAAe,cAAc,IAAI,KAAK,iBAAiB,KAAK,GAAG,CAAC;AAClF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|