@elliemae/ds-data-table 3.22.0-next.2 → 3.22.0-next.20
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/configs/useTableColsWithAddons.js +29 -26
- package/dist/cjs/configs/useTableColsWithAddons.js.map +2 -2
- package/dist/cjs/exported-related/Skeleton/SkeletonCell.js +42 -0
- package/dist/cjs/exported-related/Skeleton/SkeletonCell.js.map +7 -0
- package/dist/cjs/exported-related/Skeleton/SkeletonHeaderCell.js +38 -0
- package/dist/cjs/exported-related/Skeleton/SkeletonHeaderCell.js.map +7 -0
- package/dist/cjs/exported-related/Skeleton/index.js +31 -0
- package/dist/cjs/exported-related/Skeleton/index.js.map +7 -0
- package/dist/cjs/exported-related/index.js +3 -0
- package/dist/cjs/exported-related/index.js.map +2 -2
- package/dist/cjs/parts/Headers/index.js +4 -1
- package/dist/cjs/parts/Headers/index.js.map +2 -2
- package/dist/cjs/parts/RowVariants/RowVariantSkeleton.js +2 -7
- package/dist/cjs/parts/RowVariants/RowVariantSkeleton.js.map +2 -2
- package/dist/cjs/parts/SkeletonTable.js +49 -0
- package/dist/cjs/parts/SkeletonTable.js.map +7 -0
- package/dist/cjs/parts/TableContent.js +4 -3
- package/dist/cjs/parts/TableContent.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +4 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/configs/useTableColsWithAddons.js +29 -26
- package/dist/esm/configs/useTableColsWithAddons.js.map +2 -2
- package/dist/esm/exported-related/Skeleton/SkeletonCell.js +12 -0
- package/dist/esm/exported-related/Skeleton/SkeletonCell.js.map +7 -0
- package/dist/esm/exported-related/Skeleton/SkeletonHeaderCell.js +8 -0
- package/dist/esm/exported-related/Skeleton/SkeletonHeaderCell.js.map +7 -0
- package/dist/esm/exported-related/Skeleton/index.js +4 -0
- package/dist/esm/exported-related/Skeleton/index.js.map +7 -0
- package/dist/esm/exported-related/index.js +3 -0
- package/dist/esm/exported-related/index.js.map +2 -2
- package/dist/esm/parts/Headers/index.js +4 -1
- package/dist/esm/parts/Headers/index.js.map +2 -2
- package/dist/esm/parts/RowVariants/RowVariantSkeleton.js +2 -7
- package/dist/esm/parts/RowVariants/RowVariantSkeleton.js.map +2 -2
- package/dist/esm/parts/SkeletonTable.js +19 -0
- package/dist/esm/parts/SkeletonTable.js.map +7 -0
- package/dist/esm/parts/TableContent.js +4 -3
- package/dist/esm/parts/TableContent.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +4 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/exported-related/Skeleton/SkeletonCell.d.ts +1 -0
- package/dist/types/exported-related/Skeleton/SkeletonHeaderCell.d.ts +1 -0
- package/dist/types/exported-related/Skeleton/index.d.ts +2 -0
- package/dist/types/exported-related/index.d.ts +1 -0
- package/dist/types/parts/SkeletonTable.d.ts +4 -0
- package/dist/types/react-desc-prop-types.d.ts +1 -0
- package/package.json +29 -27
|
@@ -64,30 +64,33 @@ const useTableColsWithAddons = ({
|
|
|
64
64
|
selection,
|
|
65
65
|
dragAndDropRows,
|
|
66
66
|
noSelectionColumn
|
|
67
|
-
}) =>
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
67
|
+
}) => {
|
|
68
|
+
const withSelection = Boolean(selection);
|
|
69
|
+
return (0, import_react.useMemo)(() => {
|
|
70
|
+
const columnsWithAddons = [...augmentColumns(columns)];
|
|
71
|
+
const colsToPrepend = [];
|
|
72
|
+
const colsToAppend = [];
|
|
73
|
+
if (isExpandable)
|
|
74
|
+
colsToPrepend.push(import_Columns.expandRowColumn);
|
|
75
|
+
if (withSelection && !noSelectionColumn) {
|
|
76
|
+
if (selectSingle)
|
|
77
|
+
colsToPrepend.push(import_Columns.singleSelectColumn);
|
|
78
|
+
else
|
|
79
|
+
colsToPrepend.push(import_Columns.multiSelectColumn);
|
|
80
|
+
}
|
|
81
|
+
if (dragAndDropRows)
|
|
82
|
+
colsToPrepend.push(import_Columns.dragHandleColumn);
|
|
83
|
+
if (renderRowActions)
|
|
84
|
+
colsToAppend.push((0, import_Columns.actionColumn)(renderRowActions));
|
|
85
|
+
colsToPrepend.forEach((col) => {
|
|
86
|
+
if (!isColumnInArrayOfColumns(columnsWithAddons, col))
|
|
87
|
+
columnsWithAddons.unshift(col);
|
|
88
|
+
});
|
|
89
|
+
colsToAppend.forEach((col) => {
|
|
90
|
+
if (!isColumnInArrayOfColumns(columnsWithAddons, col))
|
|
91
|
+
columnsWithAddons.push(col);
|
|
92
|
+
});
|
|
93
|
+
return columnsWithAddons;
|
|
94
|
+
}, [columns, isExpandable, withSelection, noSelectionColumn, dragAndDropRows, renderRowActions, selectSingle]);
|
|
95
|
+
};
|
|
93
96
|
//# sourceMappingURL=useTableColsWithAddons.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/configs/useTableColsWithAddons.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-params */\nimport { createRef, useMemo } from 'react';\nimport type { DSDataTableT } from '../react-desc-prop-types.js';\nimport {\n dragHandleColumn,\n expandRowColumn,\n actionColumn,\n singleSelectColumn,\n multiSelectColumn,\n} from '../addons/Columns/index.js';\n\ntype UseTableColsWithAddonsType = (config: DSDataTableT.InternalProps) => DSDataTableT.InternalColumn[];\n\nconst augmentColumns = (columns: DSDataTableT.Column[]): DSDataTableT.InternalColumn[] => {\n const augmentColumn = (\n column: DSDataTableT.Column,\n index: number,\n parentId: string | null = null,\n depth = 0,\n ): DSDataTableT.InternalColumn => {\n let id = `column${index}`;\n if (typeof column.Header === 'string') id = column.Header;\n if (typeof column.accessor === 'string') id = column.accessor;\n const { columns: childColumns, ...restOfColumn } = column;\n const newCol: DSDataTableT.InternalColumn = {\n id,\n parentId,\n depth,\n ...restOfColumn,\n ref: createRef<HTMLTableColElement>() as React.MutableRefObject<HTMLTableColElement>,\n };\n if (childColumns) newCol.columns = childColumns.map((col, i) => augmentColumn(col, i, id, depth + 1));\n return newCol;\n };\n return columns.map((col, index) => augmentColumn(col, index));\n};\n\nconst isColumnInArrayOfColumns = (columns: DSDataTableT.Column[], col: DSDataTableT.Column) =>\n columns.some((column) => column.id === col.id);\n\nconst useTableColsWithAddons: UseTableColsWithAddonsType = ({\n columns,\n renderRowActions,\n isExpandable,\n selectSingle,\n selection,\n dragAndDropRows,\n noSelectionColumn,\n})
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAmC;AAEnC,qBAMO;AAIP,MAAM,iBAAiB,CAAC,YAAkE;AACxF,QAAM,gBAAgB,CACpB,QACA,OACA,WAA0B,MAC1B,QAAQ,MACwB;AAChC,QAAI,KAAK,SAAS;AAClB,QAAI,OAAO,OAAO,WAAW;AAAU,WAAK,OAAO;AACnD,QAAI,OAAO,OAAO,aAAa;AAAU,WAAK,OAAO;AACrD,UAAM,EAAE,SAAS,cAAc,GAAG,aAAa,IAAI;AACnD,UAAM,SAAsC;AAAA,MAC1C;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,MACH,SAAK,wBAA+B;AAAA,IACtC;AACA,QAAI;AAAc,aAAO,UAAU,aAAa,IAAI,CAAC,KAAK,MAAM,cAAc,KAAK,GAAG,IAAI,QAAQ,CAAC,CAAC;AACpG,WAAO;AAAA,EACT;AACA,SAAO,QAAQ,IAAI,CAAC,KAAK,UAAU,cAAc,KAAK,KAAK,CAAC;AAC9D;AAEA,MAAM,2BAA2B,CAAC,SAAgC,QAChE,QAAQ,KAAK,CAAC,WAAW,OAAO,OAAO,IAAI,EAAE;AAE/C,MAAM,yBAAqD,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-params */\nimport { createRef, useMemo } from 'react';\nimport type { DSDataTableT } from '../react-desc-prop-types.js';\nimport {\n dragHandleColumn,\n expandRowColumn,\n actionColumn,\n singleSelectColumn,\n multiSelectColumn,\n} from '../addons/Columns/index.js';\n\ntype UseTableColsWithAddonsType = (config: DSDataTableT.InternalProps) => DSDataTableT.InternalColumn[];\n\nconst augmentColumns = (columns: DSDataTableT.Column[]): DSDataTableT.InternalColumn[] => {\n const augmentColumn = (\n column: DSDataTableT.Column,\n index: number,\n parentId: string | null = null,\n depth = 0,\n ): DSDataTableT.InternalColumn => {\n let id = `column${index}`;\n if (typeof column.Header === 'string') id = column.Header;\n if (typeof column.accessor === 'string') id = column.accessor;\n const { columns: childColumns, ...restOfColumn } = column;\n const newCol: DSDataTableT.InternalColumn = {\n id,\n parentId,\n depth,\n ...restOfColumn,\n ref: createRef<HTMLTableColElement>() as React.MutableRefObject<HTMLTableColElement>,\n };\n if (childColumns) newCol.columns = childColumns.map((col, i) => augmentColumn(col, i, id, depth + 1));\n return newCol;\n };\n return columns.map((col, index) => augmentColumn(col, index));\n};\n\nconst isColumnInArrayOfColumns = (columns: DSDataTableT.Column[], col: DSDataTableT.Column) =>\n columns.some((column) => column.id === col.id);\n\nconst useTableColsWithAddons: UseTableColsWithAddonsType = ({\n columns,\n renderRowActions,\n isExpandable,\n selectSingle,\n selection,\n dragAndDropRows,\n noSelectionColumn,\n}) => {\n const withSelection = Boolean(selection);\n\n return useMemo(() => {\n const columnsWithAddons = [...augmentColumns(columns)];\n\n // Columns to be prepended\n const colsToPrepend: DSDataTableT.InternalColumn[] = [];\n // Columns to be appended\n const colsToAppend: DSDataTableT.InternalColumn[] = [];\n\n if (isExpandable) colsToPrepend.push(expandRowColumn);\n if (withSelection && !noSelectionColumn) {\n if (selectSingle) colsToPrepend.push(singleSelectColumn as unknown as DSDataTableT.InternalColumn);\n else colsToPrepend.push(multiSelectColumn as unknown as DSDataTableT.InternalColumn);\n }\n if (dragAndDropRows) colsToPrepend.push(dragHandleColumn as unknown as DSDataTableT.InternalColumn);\n if (renderRowActions) colsToAppend.push(actionColumn(renderRowActions));\n\n // Prepend or append all the columns that were not extended by the user\n colsToPrepend.forEach((col) => {\n if (!isColumnInArrayOfColumns(columnsWithAddons, col)) columnsWithAddons.unshift(col);\n });\n colsToAppend.forEach((col) => {\n if (!isColumnInArrayOfColumns(columnsWithAddons, col)) columnsWithAddons.push(col);\n });\n\n return columnsWithAddons;\n }, [columns, isExpandable, withSelection, noSelectionColumn, dragAndDropRows, renderRowActions, selectSingle]);\n};\n\nexport { useTableColsWithAddons };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAmC;AAEnC,qBAMO;AAIP,MAAM,iBAAiB,CAAC,YAAkE;AACxF,QAAM,gBAAgB,CACpB,QACA,OACA,WAA0B,MAC1B,QAAQ,MACwB;AAChC,QAAI,KAAK,SAAS;AAClB,QAAI,OAAO,OAAO,WAAW;AAAU,WAAK,OAAO;AACnD,QAAI,OAAO,OAAO,aAAa;AAAU,WAAK,OAAO;AACrD,UAAM,EAAE,SAAS,cAAc,GAAG,aAAa,IAAI;AACnD,UAAM,SAAsC;AAAA,MAC1C;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,MACH,SAAK,wBAA+B;AAAA,IACtC;AACA,QAAI;AAAc,aAAO,UAAU,aAAa,IAAI,CAAC,KAAK,MAAM,cAAc,KAAK,GAAG,IAAI,QAAQ,CAAC,CAAC;AACpG,WAAO;AAAA,EACT;AACA,SAAO,QAAQ,IAAI,CAAC,KAAK,UAAU,cAAc,KAAK,KAAK,CAAC;AAC9D;AAEA,MAAM,2BAA2B,CAAC,SAAgC,QAChE,QAAQ,KAAK,CAAC,WAAW,OAAO,OAAO,IAAI,EAAE;AAE/C,MAAM,yBAAqD,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,gBAAgB,QAAQ,SAAS;AAEvC,aAAO,sBAAQ,MAAM;AACnB,UAAM,oBAAoB,CAAC,GAAG,eAAe,OAAO,CAAC;AAGrD,UAAM,gBAA+C,CAAC;AAEtD,UAAM,eAA8C,CAAC;AAErD,QAAI;AAAc,oBAAc,KAAK,8BAAe;AACpD,QAAI,iBAAiB,CAAC,mBAAmB;AACvC,UAAI;AAAc,sBAAc,KAAK,iCAA4D;AAAA;AAC5F,sBAAc,KAAK,gCAA2D;AAAA,IACrF;AACA,QAAI;AAAiB,oBAAc,KAAK,+BAA0D;AAClG,QAAI;AAAkB,mBAAa,SAAK,6BAAa,gBAAgB,CAAC;AAGtE,kBAAc,QAAQ,CAAC,QAAQ;AAC7B,UAAI,CAAC,yBAAyB,mBAAmB,GAAG;AAAG,0BAAkB,QAAQ,GAAG;AAAA,IACtF,CAAC;AACD,iBAAa,QAAQ,CAAC,QAAQ;AAC5B,UAAI,CAAC,yBAAyB,mBAAmB,GAAG;AAAG,0BAAkB,KAAK,GAAG;AAAA,IACnF,CAAC;AAED,WAAO;AAAA,EACT,GAAG,CAAC,SAAS,cAAc,eAAe,mBAAmB,iBAAiB,kBAAkB,YAAY,CAAC;AAC/G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var SkeletonCell_exports = {};
|
|
30
|
+
__export(SkeletonCell_exports, {
|
|
31
|
+
SkeletonCell: () => SkeletonCell
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(SkeletonCell_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_ds_skeleton = require("@elliemae/ds-skeleton");
|
|
38
|
+
const SkeletonCell = () => {
|
|
39
|
+
const randomPercentage = (0, import_react.useMemo)(() => Math.floor(Math.random() * 70 + 30), []);
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_skeleton.DSSkeleton, { w: `${randomPercentage}%`, height: "25px" });
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=SkeletonCell.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/exported-related/Skeleton/SkeletonCell.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\n\nexport const SkeletonCell = () => {\n const randomPercentage = useMemo(() => Math.floor(Math.random() * 70 + 30), []);\n return <DSSkeleton w={`${randomPercentage}%`} height=\"25px\" />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKd;AALT,mBAA+B;AAC/B,yBAA2B;AAEpB,MAAM,eAAe,MAAM;AAChC,QAAM,uBAAmB,sBAAQ,MAAM,KAAK,MAAM,KAAK,OAAO,IAAI,KAAK,EAAE,GAAG,CAAC,CAAC;AAC9E,SAAO,4CAAC,iCAAW,GAAG,GAAG,qBAAqB,QAAO,QAAO;AAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var SkeletonHeaderCell_exports = {};
|
|
30
|
+
__export(SkeletonHeaderCell_exports, {
|
|
31
|
+
SkeletonHeaderCell: () => SkeletonHeaderCell
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(SkeletonHeaderCell_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_ds_skeleton = require("@elliemae/ds-skeleton");
|
|
37
|
+
const SkeletonHeaderCell = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_skeleton.DSSkeleton, { w: "100%", height: "20px" });
|
|
38
|
+
//# sourceMappingURL=SkeletonHeaderCell.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/exported-related/Skeleton/SkeletonHeaderCell.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\n\nexport const SkeletonHeaderCell = () => <DSSkeleton w=\"100%\" height=\"20px\" />;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGiB;AAFxC,yBAA2B;AAEpB,MAAM,qBAAqB,MAAM,4CAAC,iCAAW,GAAE,QAAO,QAAO,QAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var Skeleton_exports = {};
|
|
27
|
+
module.exports = __toCommonJS(Skeleton_exports);
|
|
28
|
+
var React = __toESM(require("react"));
|
|
29
|
+
__reExport(Skeleton_exports, require("./SkeletonCell.js"), module.exports);
|
|
30
|
+
__reExport(Skeleton_exports, require("./SkeletonHeaderCell.js"), module.exports);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/exported-related/Skeleton/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './SkeletonCell.js';\nexport * from './SkeletonHeaderCell.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,6BAAc,8BAAd;AACA,6BAAc,oCADd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -35,6 +35,8 @@ __export(exported_related_exports, {
|
|
|
35
35
|
ROW_VARIANTS: () => import_RowVariants.ROW_VARIANTS,
|
|
36
36
|
ROW_VARIANT_COMPACT_KEY: () => import_RowVariants.ROW_VARIANT_COMPACT_KEY,
|
|
37
37
|
ROW_VARIANT_KEY: () => import_RowVariants.ROW_VARIANT_KEY,
|
|
38
|
+
SkeletonCell: () => import_Skeleton.SkeletonCell,
|
|
39
|
+
SkeletonHeaderCell: () => import_Skeleton.SkeletonHeaderCell,
|
|
38
40
|
Toolbar: () => import_Toolbar.Toolbar,
|
|
39
41
|
applyOutOfTheBoxFilters: () => import_Filters.applyOutOfTheBoxFilters,
|
|
40
42
|
currencyRangeFilterFn: () => import_Filters.currencyRangeFilterFn,
|
|
@@ -55,4 +57,5 @@ var import_FilterTypes = require("./FilterTypes.js");
|
|
|
55
57
|
var import_RowVariants = require("./RowVariants.js");
|
|
56
58
|
var import_Filters = require("./Filters/index.js");
|
|
57
59
|
var import_FilterBar = require("./FilterBar/index.js");
|
|
60
|
+
var import_Skeleton = require("./Skeleton/index.js");
|
|
58
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exported-related/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { FilterPopover } from './FilterPopover/index.js';\nexport { EditableCell } from './EditableCell.js';\nexport { Toolbar } from './Toolbar/index.js';\nexport { groupBy } from './groupBy.js';\nexport { FILTER_TYPES } from './FilterTypes.js';\nexport { ROW_VARIANTS, ROW_VARIANT_KEY, ROW_VARIANT_COMPACT_KEY } from './RowVariants.js';\nexport {\n applyOutOfTheBoxFilters,\n singleDateFilterFn,\n singleSelectFilterFn,\n multiSelectFilterFn,\n numberRangeFilterFn,\n currencyRangeFilterFn,\n dateRangeFilterFn,\n} from './Filters/index.js';\nexport { FilterBarDropdownMenu } from './FilterBar/index.js';\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;ACAA,YAAuB;ADAvB,2BAA8B;AAC9B,0BAA6B;AAC7B,qBAAwB;AACxB,qBAAwB;AACxB,yBAA6B;AAC7B,yBAAuE;AACvE,qBAQO;AACP,uBAAsC;",
|
|
4
|
+
"sourcesContent": ["export { FilterPopover } from './FilterPopover/index.js';\nexport { EditableCell } from './EditableCell.js';\nexport { Toolbar } from './Toolbar/index.js';\nexport { groupBy } from './groupBy.js';\nexport { FILTER_TYPES } from './FilterTypes.js';\nexport { ROW_VARIANTS, ROW_VARIANT_KEY, ROW_VARIANT_COMPACT_KEY } from './RowVariants.js';\nexport {\n applyOutOfTheBoxFilters,\n singleDateFilterFn,\n singleSelectFilterFn,\n multiSelectFilterFn,\n numberRangeFilterFn,\n currencyRangeFilterFn,\n dateRangeFilterFn,\n} from './Filters/index.js';\nexport { FilterBarDropdownMenu } from './FilterBar/index.js';\nexport { SkeletonCell, SkeletonHeaderCell } from './Skeleton/index.js';\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;ACAA,YAAuB;ADAvB,2BAA8B;AAC9B,0BAA6B;AAC7B,qBAAwB;AACxB,qBAAwB;AACxB,yBAA6B;AAC7B,yBAAuE;AACvE,qBAQO;AACP,uBAAsC;AACtC,sBAAiD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -42,7 +42,7 @@ var import_SortableHeaderCell = require("../SortableHeaderCell.js");
|
|
|
42
42
|
var import_gridLayoutHelpers = require("../../helpers/gridLayoutHelpers.js");
|
|
43
43
|
const HeadersComp = () => {
|
|
44
44
|
const {
|
|
45
|
-
tableProps: { isExpandable, colsLayoutStyle },
|
|
45
|
+
tableProps: { isExpandable, isSkeleton, colsLayoutStyle },
|
|
46
46
|
visibleColumns,
|
|
47
47
|
columnHeaderRef,
|
|
48
48
|
virtualListRef
|
|
@@ -50,6 +50,9 @@ const HeadersComp = () => {
|
|
|
50
50
|
(0, import_react.useEffect)(() => {
|
|
51
51
|
(0, import_gridLayoutHelpers.setSubColumnsGridLayout)(virtualListRef.current, visibleColumns, true);
|
|
52
52
|
}, [virtualListRef, visibleColumns]);
|
|
53
|
+
if (visibleColumns.length === 0 && isSkeleton) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
53
56
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledHeadWrapper, { colsLayoutStyle, ref: columnHeaderRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SortableHeaderCell.SortableHeaderCell, { items: visibleColumns, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledHeadTr, { role: "row", colsLayoutStyle, isExpandable, children: visibleColumns.map((h, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_HeaderCellGroup.HeaderCellGroupSortable, { header: h, isLast: index === visibleColumns.length - 1 }, h.id)) }) }) });
|
|
54
57
|
};
|
|
55
58
|
const Headers = (0, import_withConditionalDnDColumnContext.withConditionalDnDColumnContext)(HeadersComp);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Headers/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext, useEffect } from 'react';\nimport { StyledHeadWrapper, StyledHeadTr } from '../../styled.js';\nimport { DataTableContext } from '../../DataTableContext.js';\nimport { withConditionalDnDColumnContext } from '../HoC/withConditionalDnDColumnContext.js';\nimport { HeaderCellGroupSortable } from './HeaderCellGroup.js';\nimport { SortableHeaderCell } from '../SortableHeaderCell.js';\nimport { setSubColumnsGridLayout } from '../../helpers/gridLayoutHelpers.js';\n\nconst HeadersComp = ()
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext, useEffect } from 'react';\nimport { StyledHeadWrapper, StyledHeadTr } from '../../styled.js';\nimport { DataTableContext } from '../../DataTableContext.js';\nimport { withConditionalDnDColumnContext } from '../HoC/withConditionalDnDColumnContext.js';\nimport { HeaderCellGroupSortable } from './HeaderCellGroup.js';\nimport { SortableHeaderCell } from '../SortableHeaderCell.js';\nimport { setSubColumnsGridLayout } from '../../helpers/gridLayoutHelpers.js';\n\nconst HeadersComp = () => {\n const {\n tableProps: { isExpandable, isSkeleton, colsLayoutStyle },\n visibleColumns,\n columnHeaderRef,\n virtualListRef,\n } = useContext(DataTableContext);\n\n useEffect(() => {\n // TODO: remove this, for further info see the comment on setSubColumnsGridLayout\n setSubColumnsGridLayout(virtualListRef.current, visibleColumns, true);\n }, [virtualListRef, visibleColumns]);\n\n if (visibleColumns.length === 0 && isSkeleton) {\n return null;\n }\n return (\n <StyledHeadWrapper colsLayoutStyle={colsLayoutStyle} ref={columnHeaderRef}>\n <SortableHeaderCell items={visibleColumns}>\n <StyledHeadTr role=\"row\" colsLayoutStyle={colsLayoutStyle} isExpandable={isExpandable}>\n {visibleColumns.map((h, index) => (\n <HeaderCellGroupSortable header={h} key={h.id} isLast={index === visibleColumns.length - 1} />\n ))}\n </StyledHeadTr>\n </SortableHeaderCell>\n </StyledHeadWrapper>\n );\n};\n\nexport const Headers = withConditionalDnDColumnContext(HeadersComp);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BX;AA7BZ,mBAA6C;AAC7C,oBAAgD;AAChD,8BAAiC;AACjC,6CAAgD;AAChD,6BAAwC;AACxC,gCAAmC;AACnC,+BAAwC;AAExC,MAAM,cAAc,MAAM;AACxB,QAAM;AAAA,IACJ,YAAY,EAAE,cAAc,YAAY,gBAAgB;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,wCAAgB;AAE/B,8BAAU,MAAM;AAEd,0DAAwB,eAAe,SAAS,gBAAgB,IAAI;AAAA,EACtE,GAAG,CAAC,gBAAgB,cAAc,CAAC;AAEnC,MAAI,eAAe,WAAW,KAAK,YAAY;AAC7C,WAAO;AAAA,EACT;AACA,SACE,4CAAC,mCAAkB,iBAAkC,KAAK,iBACxD,sDAAC,gDAAmB,OAAO,gBACzB,sDAAC,8BAAa,MAAK,OAAM,iBAAkC,cACxD,yBAAe,IAAI,CAAC,GAAG,UACtB,4CAAC,kDAAwB,QAAQ,GAAc,QAAQ,UAAU,eAAe,SAAS,KAAhD,EAAE,EAAiD,CAC7F,GACH,GACF,GACF;AAEJ;AAEO,MAAM,cAAU,wEAAgC,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,13 +33,8 @@ __export(RowVariantSkeleton_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(RowVariantSkeleton_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var
|
|
37
|
-
var import_ds_skeleton = require("@elliemae/ds-skeleton");
|
|
36
|
+
var import_exported_related = require("../../exported-related/index.js");
|
|
38
37
|
var import_RowRenderer = require("../../exported-related/RowRenderer/index.js");
|
|
39
|
-
const RandomSkeleton = () => {
|
|
40
|
-
const randomPercentage = (0, import_react.useMemo)(() => Math.floor(Math.random() * 70 + 30), []);
|
|
41
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_skeleton.DSSkeleton, { w: `${randomPercentage}%`, h: "90%" });
|
|
42
|
-
};
|
|
43
38
|
const RowVariantSkeleton = ({
|
|
44
39
|
row,
|
|
45
40
|
itemIndex,
|
|
@@ -49,7 +44,7 @@ const RowVariantSkeleton = ({
|
|
|
49
44
|
}) => {
|
|
50
45
|
const newCells = row.cells.map((cell) => ({
|
|
51
46
|
...cell,
|
|
52
|
-
render:
|
|
47
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_exported_related.SkeletonCell, {})
|
|
53
48
|
}));
|
|
54
49
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
50
|
import_RowRenderer.RowRenderer,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/RowVariants/RowVariantSkeleton.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { SkeletonCell } from '../../exported-related/index.js';\nimport { RowRenderer } from '../../exported-related/RowRenderer/index.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\n\nexport const RowVariantSkeleton: React.ComponentType<DSDataTableT.RowVariantProps> = ({\n row,\n itemIndex,\n isDragOverlay,\n focusedRowId,\n drilldownRowId,\n}) => {\n const newCells = row.cells.map((cell) => ({\n ...cell,\n render: () => <SkeletonCell />,\n }));\n\n return (\n <RowRenderer\n row={{ ...row, cells: newCells }}\n itemIndex={itemIndex}\n isDragOverlay={isDragOverlay}\n minHeight=\"0px\"\n height=\"36px\"\n focusedRowId={focusedRowId}\n drilldownRowId={drilldownRowId}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcL;AAblB,8BAA6B;AAC7B,yBAA4B;AAGrB,MAAM,qBAAwE,CAAC;AAAA,EACpF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,WAAW,IAAI,MAAM,IAAI,CAAC,UAAU;AAAA,IACxC,GAAG;AAAA,IACH,QAAQ,MAAM,4CAAC,wCAAa;AAAA,EAC9B,EAAE;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,EAAE,GAAG,KAAK,OAAO,SAAS;AAAA,MAC/B;AAAA,MACA;AAAA,MACA,WAAU;AAAA,MACV,QAAO;AAAA,MACP;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var SkeletonTable_exports = {};
|
|
30
|
+
__export(SkeletonTable_exports, {
|
|
31
|
+
SkeletonTable: () => SkeletonTable
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(SkeletonTable_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_ds_grid = require("@elliemae/ds-grid");
|
|
38
|
+
var import_ds_skeleton = require("@elliemae/ds-skeleton");
|
|
39
|
+
const SkeletonTable = import_react.default.memo(({ height = "100" }) => {
|
|
40
|
+
const gap = 16;
|
|
41
|
+
const rowHeight = 36;
|
|
42
|
+
const headerHeight = 25;
|
|
43
|
+
const rows = Math.floor((parseInt(height, 10) - headerHeight) / (rowHeight + gap));
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { gutter: "xs", children: [
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_skeleton.DSSkeleton, { height: "25px", variant: "rectangular" }),
|
|
46
|
+
Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_skeleton.DSSkeleton, { height: "36px", variant: "rectangular" }, i))
|
|
47
|
+
] });
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=SkeletonTable.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/SkeletonTable.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\n\nexport const SkeletonTable = React.memo(({ height = '100' }: { height: string }) => {\n const gap = 16;\n const rowHeight = 36;\n const headerHeight = 25;\n const rows = Math.floor((parseInt(height, 10) - headerHeight) / (rowHeight + gap));\n return (\n <Grid gutter=\"xs\">\n <DSSkeleton height=\"25px\" variant=\"rectangular\" />\n {Array.from({ length: rows }).map((_, i) => (\n <DSSkeleton height=\"36px\" key={i} variant=\"rectangular\" />\n ))}\n </Grid>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADUnB;AAVJ,mBAAkB;AAClB,qBAAqB;AACrB,yBAA2B;AAEpB,MAAM,gBAAgB,aAAAA,QAAM,KAAK,CAAC,EAAE,SAAS,MAAM,MAA0B;AAClF,QAAM,MAAM;AACZ,QAAM,YAAY;AAClB,QAAM,eAAe;AACrB,QAAM,OAAO,KAAK,OAAO,SAAS,QAAQ,EAAE,IAAI,iBAAiB,YAAY,IAAI;AACjF,SACE,6CAAC,uBAAK,QAAO,MACX;AAAA,gDAAC,iCAAW,QAAO,QAAO,SAAQ,eAAc;AAAA,IAC/C,MAAM,KAAK,EAAE,QAAQ,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,MACpC,4CAAC,iCAAW,QAAO,QAAe,SAAQ,iBAAX,CAAyB,CACzD;AAAA,KACH;AAEJ,CAAC;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -39,6 +39,7 @@ var import_DataTableContext = require("../DataTableContext.js");
|
|
|
39
39
|
var import_Pagination = require("../addons/Pagination/index.js");
|
|
40
40
|
var import_VirtualRowsList = require("./VirtualRowsList.js");
|
|
41
41
|
var import_constants = require("../configs/constants.js");
|
|
42
|
+
var import_SkeletonTable = require("./SkeletonTable.js");
|
|
42
43
|
const TableContent = () => {
|
|
43
44
|
const {
|
|
44
45
|
allDataFlattened,
|
|
@@ -46,7 +47,7 @@ const TableContent = () => {
|
|
|
46
47
|
isShiftPressed,
|
|
47
48
|
setIsShiftPressed,
|
|
48
49
|
paginationHelpers: { hasPagination },
|
|
49
|
-
tableProps: { isLoading }
|
|
50
|
+
tableProps: { isLoading, isSkeleton, height }
|
|
50
51
|
} = (0, import_react.useContext)(import_DataTableContext.DataTableContext);
|
|
51
52
|
const handleOnKeyDown = (0, import_react.useCallback)(
|
|
52
53
|
(e) => {
|
|
@@ -72,8 +73,8 @@ const TableContent = () => {
|
|
|
72
73
|
"aria-rowcount": allDataFlattened.length,
|
|
73
74
|
"aria-colcount": visibleColumns.length,
|
|
74
75
|
"data-testid": import_constants.DATA_TESTID.DATA_TABLE_TABLE,
|
|
75
|
-
"aria-busy": isLoading,
|
|
76
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualRowsList.VirtualRowsList, {})
|
|
76
|
+
"aria-busy": isLoading || isSkeleton,
|
|
77
|
+
children: isSkeleton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SkeletonTable.SkeletonTable, { height }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_VirtualRowsList.VirtualRowsList, {})
|
|
77
78
|
}
|
|
78
79
|
),
|
|
79
80
|
hasPagination ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Pagination.Pagination, {}) : null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/TableContent.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext, useCallback } from 'react';\nimport { StyledTableWrapper, StyledDataTableContentWrapper } from '../styled.js';\nimport { DataTableContext } from '../DataTableContext.js';\nimport { Pagination } from '../addons/Pagination/index.js';\nimport { VirtualRowsList } from './VirtualRowsList.js';\nimport { DATA_TESTID } from '../configs/constants.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext, useCallback } from 'react';\n\nimport { StyledTableWrapper, StyledDataTableContentWrapper } from '../styled.js';\nimport { DataTableContext } from '../DataTableContext.js';\nimport { Pagination } from '../addons/Pagination/index.js';\nimport { VirtualRowsList } from './VirtualRowsList.js';\nimport { DATA_TESTID } from '../configs/constants.js';\nimport { SkeletonTable } from './SkeletonTable.js';\nexport const TableContent = () => {\n const {\n allDataFlattened,\n visibleColumns,\n isShiftPressed,\n setIsShiftPressed,\n paginationHelpers: { hasPagination },\n tableProps: { isLoading, isSkeleton, height },\n } = useContext(DataTableContext);\n\n const handleOnKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n setIsShiftPressed(e.shiftKey);\n },\n [setIsShiftPressed],\n );\n\n const handleOnKeyUp = useCallback(() => setIsShiftPressed(false), [setIsShiftPressed]);\n\n return (\n <StyledDataTableContentWrapper\n data-testid={DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER}\n noSelectionAllowed={isShiftPressed}\n onKeyDown={handleOnKeyDown}\n onKeyUp={handleOnKeyUp}\n rows={hasPagination ? ['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 aria-busy={isLoading || isSkeleton}\n >\n {isSkeleton ? <SkeletonTable height={height} /> : <VirtualRowsList />}\n </StyledTableWrapper>\n {hasPagination ? <Pagination /> : null}\n </StyledDataTableContentWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4BnB;AA5BJ,mBAA+C;AAE/C,oBAAkE;AAClE,8BAAiC;AACjC,wBAA2B;AAC3B,6BAAgC;AAChC,uBAA4B;AAC5B,2BAA8B;AACvB,MAAM,eAAe,MAAM;AAChC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmB,EAAE,cAAc;AAAA,IACnC,YAAY,EAAE,WAAW,YAAY,OAAO;AAAA,EAC9C,QAAI,yBAAW,wCAAgB;AAE/B,QAAM,sBAA8C;AAAA,IAClD,CAAC,MAAM;AACL,wBAAkB,EAAE,QAAQ;AAAA,IAC9B;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,QAAM,oBAAgB,0BAAY,MAAM,kBAAkB,KAAK,GAAG,CAAC,iBAAiB,CAAC;AAErF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,6BAAY;AAAA,MACzB,oBAAoB;AAAA,MACpB,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM,gBAAgB,CAAC,OAAO,MAAM,IAAI,CAAC,MAAM;AAAA,MAC/C,MAAM,CAAC,MAAM;AAAA,MAEb;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,iBAAe,iBAAiB;AAAA,YAChC,iBAAe,eAAe;AAAA,YAC9B,eAAa,6BAAY;AAAA,YACzB,aAAW,aAAa;AAAA,YAEvB,uBAAa,4CAAC,sCAAc,QAAgB,IAAK,4CAAC,0CAAgB;AAAA;AAAA,QACrE;AAAA,QACC,gBAAgB,4CAAC,gCAAW,IAAK;AAAA;AAAA;AAAA,EACpC;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -72,7 +72,8 @@ const defaultProps = {
|
|
|
72
72
|
onFiltersChange: () => null,
|
|
73
73
|
onPageChanged: () => null,
|
|
74
74
|
onRowExpand: () => null,
|
|
75
|
-
onColumnSort: () => null
|
|
75
|
+
onColumnSort: () => null,
|
|
76
|
+
isSkeleton: false
|
|
76
77
|
};
|
|
77
78
|
const DSDataTablePropTypes = {
|
|
78
79
|
columns: import_ds_props_helpers.PropTypes.arrayOf(
|
|
@@ -236,7 +237,8 @@ const DSDataTablePropTypes = {
|
|
|
236
237
|
getRowVariant: import_ds_props_helpers.PropTypes.func.description("Function invoked to determine a row's variant").defaultValue(`() => 'ds-primary-row'`),
|
|
237
238
|
noSelectionColumn: import_ds_props_helpers.PropTypes.bool.description("Whether to show the selection column or not").defaultValue(false),
|
|
238
239
|
onPageChanged: import_ds_props_helpers.PropTypes.func.description("Function invoked when the page changes").defaultValue(() => null),
|
|
239
|
-
onNoResultsButtonClick: import_ds_props_helpers.PropTypes.func.description("Function invoked when the no results button is clicked").defaultValue(() => null)
|
|
240
|
+
onNoResultsButtonClick: import_ds_props_helpers.PropTypes.func.description("Function invoked when the no results button is clicked").defaultValue(() => null),
|
|
241
|
+
isSkeleton: import_ds_props_helpers.PropTypes.bool.description("Whether to show a skeleton loader in the datatable")
|
|
240
242
|
};
|
|
241
243
|
const DSDataTablePropTypesSchema = DSDataTablePropTypes;
|
|
242
244
|
//# sourceMappingURL=react-desc-prop-types.js.map
|