@elliemae/ds-datagrids 3.0.0-next.11 → 3.0.0-next.15
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/DataGridImpl.js +3 -4
- package/dist/cjs/DataGridImpl.js.map +2 -2
- package/dist/cjs/PaginatedDataGrid.js +2 -2
- package/dist/cjs/PaginatedDataGrid.js.map +2 -2
- package/dist/cjs/components/BodyCell.js +4 -5
- package/dist/cjs/components/BodyCell.js.map +2 -2
- package/dist/cjs/components/HeaderCell.js +3 -3
- package/dist/cjs/components/HeaderCell.js.map +2 -2
- package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +5 -6
- package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
- package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js +2 -2
- package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +2 -2
- package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +3 -3
- package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +2 -2
- package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js +2 -2
- package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +2 -2
- package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +2 -2
- package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +2 -2
- package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +2 -2
- package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +2 -2
- package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js +10 -10
- package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js.map +2 -2
- package/dist/cjs/plugins/editable/EditableComponents/TextBox.js +21 -21
- package/dist/cjs/plugins/editable/EditableComponents/TextBox.js.map +2 -2
- package/dist/cjs/plugins/editable/EditablePlugin.js +2 -2
- package/dist/cjs/plugins/editable/EditablePlugin.js.map +2 -2
- package/dist/cjs/plugins/editable/decorateEditable.js +2 -2
- package/dist/cjs/plugins/editable/decorateEditable.js.map +2 -2
- package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js +3 -4
- package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
- package/dist/cjs/plugins/expandable-grid/ExpandedRow.js +3 -4
- package/dist/cjs/plugins/expandable-grid/ExpandedRow.js.map +2 -2
- package/dist/cjs/plugins/export-data/ExportDataPlugin.js +2 -2
- package/dist/cjs/plugins/export-data/ExportDataPlugin.js.map +2 -2
- package/dist/cjs/plugins/filterable/FilterablePlugin.js +2 -2
- package/dist/cjs/plugins/filterable/FilterablePlugin.js.map +2 -2
- package/dist/cjs/plugins/filterable/addFilterToColumn.js +2 -2
- package/dist/cjs/plugins/filterable/addFilterToColumn.js.map +2 -2
- package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js +2 -2
- package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js.map +2 -2
- package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js +2 -2
- package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
- package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +2 -2
- package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +2 -2
- package/dist/cjs/plugins/pagination/PaginationPlugin.js +3 -4
- package/dist/cjs/plugins/pagination/PaginationPlugin.js.map +2 -2
- package/dist/cjs/plugins/resizable/ResizablePlugin.js +2 -2
- package/dist/cjs/plugins/resizable/ResizablePlugin.js.map +2 -2
- package/dist/cjs/plugins/resizable/decorateResizable.js +2 -2
- package/dist/cjs/plugins/resizable/decorateResizable.js.map +2 -2
- package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js +3 -4
- package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js.map +2 -2
- package/dist/cjs/plugins/selectable/SelectablePlugin.js +2 -2
- package/dist/cjs/plugins/selectable/SelectablePlugin.js.map +2 -2
- package/dist/cjs/plugins/selectable/addSelectableColumn.js +3 -3
- package/dist/cjs/plugins/selectable/addSelectableColumn.js.map +2 -2
- package/dist/cjs/plugins/sortable/SortablePlugin.js +3 -4
- package/dist/cjs/plugins/sortable/SortablePlugin.js.map +2 -2
- package/dist/cjs/plugins/toolbar/ToolbarPlugin.js +3 -4
- package/dist/cjs/plugins/toolbar/ToolbarPlugin.js.map +2 -2
- package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js +4 -6
- package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
- package/dist/esm/DataGridImpl.js +1 -2
- package/dist/esm/DataGridImpl.js.map +2 -2
- package/dist/esm/PaginatedDataGrid.js +1 -1
- package/dist/esm/PaginatedDataGrid.js.map +2 -2
- package/dist/esm/components/BodyCell.js +1 -2
- package/dist/esm/components/BodyCell.js.map +2 -2
- package/dist/esm/components/HeaderCell.js +1 -1
- package/dist/esm/components/HeaderCell.js.map +1 -1
- package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +1 -2
- package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +2 -2
- package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js +1 -1
- package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
- package/dist/esm/plugins/column-dnd/decorateGridWithDndColumns.js +1 -4
- package/dist/esm/plugins/column-dnd/decorateGridWithDndColumns.js.map +2 -2
- package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js +1 -1
- package/dist/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
- package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +1 -1
- package/dist/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
- package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +1 -1
- package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
- package/dist/esm/plugins/editable/EditableComponents/ComboBox.js +10 -10
- package/dist/esm/plugins/editable/EditableComponents/ComboBox.js.map +2 -2
- package/dist/esm/plugins/editable/EditableComponents/TextBox.js +21 -21
- package/dist/esm/plugins/editable/EditableComponents/TextBox.js.map +2 -2
- package/dist/esm/plugins/editable/EditablePlugin.js +1 -1
- package/dist/esm/plugins/editable/EditablePlugin.js.map +1 -1
- package/dist/esm/plugins/editable/decorateEditable.js +1 -1
- package/dist/esm/plugins/editable/decorateEditable.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js +1 -2
- package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js.map +2 -2
- package/dist/esm/plugins/expandable-grid/ExpandedRow.js +1 -2
- package/dist/esm/plugins/expandable-grid/ExpandedRow.js.map +2 -2
- package/dist/esm/plugins/export-data/ExportDataPlugin.js +1 -1
- package/dist/esm/plugins/export-data/ExportDataPlugin.js.map +1 -1
- package/dist/esm/plugins/filterable/FilterablePlugin.js +1 -1
- package/dist/esm/plugins/filterable/FilterablePlugin.js.map +1 -1
- package/dist/esm/plugins/filterable/addFilterToColumn.js +1 -1
- package/dist/esm/plugins/filterable/addFilterToColumn.js.map +2 -2
- package/dist/esm/plugins/grouping-by/GroupingByPlugin.js +1 -1
- package/dist/esm/plugins/grouping-by/GroupingByPlugin.js.map +2 -2
- package/dist/esm/plugins/grouping-grid/GroupingPlugin.js +1 -1
- package/dist/esm/plugins/grouping-grid/GroupingPlugin.js.map +2 -2
- package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +1 -1
- package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
- package/dist/esm/plugins/pagination/PaginationPlugin.js +1 -2
- package/dist/esm/plugins/pagination/PaginationPlugin.js.map +2 -2
- package/dist/esm/plugins/resizable/ResizablePlugin.js +1 -1
- package/dist/esm/plugins/resizable/ResizablePlugin.js.map +1 -1
- package/dist/esm/plugins/resizable/decorateResizable.js +1 -1
- package/dist/esm/plugins/resizable/decorateResizable.js.map +2 -2
- package/dist/esm/plugins/row-dnd/DndRowsPlugin.js +1 -2
- package/dist/esm/plugins/row-dnd/DndRowsPlugin.js.map +2 -2
- package/dist/esm/plugins/selectable/SelectablePlugin.js +1 -1
- package/dist/esm/plugins/selectable/SelectablePlugin.js.map +1 -1
- package/dist/esm/plugins/selectable/addSelectableColumn.js +1 -4
- package/dist/esm/plugins/selectable/addSelectableColumn.js.map +2 -2
- package/dist/esm/plugins/sortable/SortablePlugin.js +1 -5
- package/dist/esm/plugins/sortable/SortablePlugin.js.map +2 -2
- package/dist/esm/plugins/toolbar/ToolbarPlugin.js +1 -2
- package/dist/esm/plugins/toolbar/ToolbarPlugin.js.map +2 -2
- package/dist/esm/plugins/virtualization/VirtualizationPlugin.js +2 -4
- package/dist/esm/plugins/virtualization/VirtualizationPlugin.js.map +2 -2
- package/package.json +19 -19
package/dist/cjs/DataGridImpl.js
CHANGED
|
@@ -61,8 +61,7 @@ __export(DataGridImpl_exports, {
|
|
|
61
61
|
});
|
|
62
62
|
var React = __toESM(require("react"));
|
|
63
63
|
var import_react = __toESM(require("react"));
|
|
64
|
-
var
|
|
65
|
-
var import_useDataGrid = require("@elliemae/ds-shared/useDataGrid");
|
|
64
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
66
65
|
var import_Table = require("./components/Table");
|
|
67
66
|
var import_TableBody = require("./components/TableBody");
|
|
68
67
|
var import_TableHeader = require("./components/TableHeader");
|
|
@@ -133,7 +132,7 @@ const DataGridImpl = (_a) => {
|
|
|
133
132
|
if (normalizeDataKeys) {
|
|
134
133
|
(0, import_normalizeData.normalizeRows)(rows);
|
|
135
134
|
}
|
|
136
|
-
const grid = (0,
|
|
135
|
+
const grid = (0, import_ds_shared.useDataGrid)(__spreadValues({
|
|
137
136
|
columns,
|
|
138
137
|
rows,
|
|
139
138
|
renderers: import_renderers.defaultRenderers,
|
|
@@ -147,7 +146,7 @@ const DataGridImpl = (_a) => {
|
|
|
147
146
|
if (noColumnsVisible) {
|
|
148
147
|
return noColumnsPlaceholder;
|
|
149
148
|
}
|
|
150
|
-
return (0,
|
|
149
|
+
return (0, import_ds_shared.isFunction)(noResultsRender) ? noResultsRender() : noResultsPlaceholder;
|
|
151
150
|
}, [noResultsPlaceholder, noColumnsPlaceholder, noColumnsVisible]);
|
|
152
151
|
const { pagination } = otherProps;
|
|
153
152
|
const conditionalPagination = pagination && pagination.conditionalPagination === true && rows.length <= otherProps.pagination.perPage;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DataGridImpl.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { isFunction
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+B;AAC/B,
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { isFunction, useDataGrid } from '@elliemae/ds-shared';\nimport { Table } from './components/Table';\nimport { TableBody } from './components/TableBody';\nimport { TableHeader } from './components/TableHeader';\nimport { defaultRenderers, renderRowsLoader } from './components/renderers';\nimport { DatagridWrapper } from './components/renderers/defaultClassedRenderers';\nimport { addOptionalFooterComponents } from './components/footer/addOptionalFooterComponents';\nimport { addOptionalHeaderComponents } from './components/header/addOptionalHeaderComponents';\nimport { EmptyState } from './components/EmptyState';\nimport { getPluginsFromProps } from './utilities/getPluginsFromProps';\nimport { defaultPlugins } from './defaultPlugins';\nimport { normalizeRows } from './utilities/normalizeData';\n\nconst isFluid = ({ autoHeight, paginated, numRowsVisible }) => {\n if (autoHeight) return false;\n if (paginated) return false;\n return !numRowsVisible;\n};\n\nconst DataGridImpl = ({\n className,\n renderers,\n columns,\n rows,\n containerProps,\n plugins: pluginsProp,\n normalizeDataKeys,\n ...otherProps\n}) => {\n const {\n noResultsPlaceholder = <EmptyState />,\n noColumnsPlaceholder = 'Please select one of more columns in order for data to be displayed.',\n noResultsRender,\n paginated,\n height,\n showHeader,\n showRowsLoader,\n rowsLoaderRenderer = renderRowsLoader,\n groupedRows,\n sortable,\n rowSize,\n wrapText,\n onDefaultFiltersLoad,\n rowKey,\n } = otherProps;\n\n const idKey = rowKey || 'id';\n const rowsIdsSet = new Set();\n const rowsIds = rows.map((row) => {\n if (row[idKey] === undefined) throw new Error('Missing id: each row must have an unique id');\n rowsIdsSet.add(row[idKey]);\n return row[idKey];\n });\n if (rowsIds.length !== rowsIdsSet.size) throw new Error('Repeated id: each row must have an unique id');\n\n const plugins = getPluginsFromProps({\n ...otherProps,\n virtualized: (!paginated || groupedRows) && !wrapText,\n paginated: (paginated && !groupedRows) || wrapText,\n sortable: sortable && !groupedRows,\n });\n\n if (normalizeDataKeys) {\n normalizeRows(rows);\n }\n\n const grid = useDataGrid({\n columns,\n rows,\n renderers: defaultRenderers,\n plugins: [...plugins, ...pluginsProp, ...defaultPlugins],\n ...otherProps,\n });\n\n const noColumnsVisible = useMemo(() => {\n const visibleUserColumns = grid.columns.filter((column) => column.visible || typeof column.visible === 'undefined');\n return visibleUserColumns.length === 0;\n }, [grid.columns]);\n\n const bodyPlaceholder = useMemo(() => {\n if (noColumnsVisible) {\n return noColumnsPlaceholder;\n }\n return isFunction(noResultsRender) ? noResultsRender() : noResultsPlaceholder;\n }, [noResultsPlaceholder, noColumnsPlaceholder, noColumnsVisible]);\n\n const { pagination } = otherProps;\n const conditionalPagination =\n pagination && pagination.conditionalPagination === true && rows.length <= otherProps.pagination.perPage;\n const usePagination = paginated && !conditionalPagination;\n return (\n <DatagridWrapper\n className={`${className} ds-row-size-${rowSize}`}\n classProps={{\n fluidHeight: isFluid({\n autoHeight: otherProps.autoHeight,\n numRowsVisible: otherProps.numRowsVisible,\n paginated: usePagination,\n }),\n }}\n style={{ height }}\n {...containerProps}\n >\n {addOptionalHeaderComponents({ grid })}\n <Table {...grid} onDefaultFiltersLoad={onDefaultFiltersLoad}>\n {showHeader && <TableHeader />}\n {showRowsLoader ? (\n rowsLoaderRenderer()\n ) : (\n <TableBody\n isPlaceholderActive={\n noColumnsVisible ||\n (grid.composedRows.rows && grid.composedRows.rows.length === 0) ||\n grid.composedRows.length === 0\n }\n noResultsPlaceholder={bodyPlaceholder}\n />\n )}\n </Table>\n {addOptionalFooterComponents({\n grid,\n rows: grid.composedRows,\n })}\n </DatagridWrapper>\n );\n};\n\nexport { DataGridImpl };\n\nexport default DataGridImpl;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -60,7 +60,7 @@ __export(PaginatedDataGrid_exports, {
|
|
|
60
60
|
});
|
|
61
61
|
var React = __toESM(require("react"));
|
|
62
62
|
var import_react = __toESM(require("react"));
|
|
63
|
-
var
|
|
63
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
64
64
|
var import_Table = require("./components/Table");
|
|
65
65
|
var import_renderers = require("./components/renderers");
|
|
66
66
|
var import_defaultClassedRenderers = require("./components/renderers/defaultClassedRenderers");
|
|
@@ -92,7 +92,7 @@ function PaginatedDataGrid(_a) {
|
|
|
92
92
|
"pagination"
|
|
93
93
|
]);
|
|
94
94
|
const plugins = (0, import_getPluginsFromProps.getPluginsFromProps)(otherProps, { infiniteScrolling: true });
|
|
95
|
-
const grid = (0,
|
|
95
|
+
const grid = (0, import_ds_shared.useDataGrid)(__spreadProps(__spreadValues({}, otherProps), {
|
|
96
96
|
columns,
|
|
97
97
|
rows,
|
|
98
98
|
renderers: import_renderers.defaultRenderers,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/PaginatedDataGrid.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useDataGrid } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useDataGrid } from '@elliemae/ds-shared';\nimport { Table } from './components/Table';\nimport { defaultRenderers, renderRowsLoader } from './components/renderers';\nimport { DatagridWrapper } from './components/renderers/defaultClassedRenderers';\nimport { addOptionalHeaderComponents } from './components/header/addOptionalHeaderComponents';\nimport { getPluginsFromProps } from './utilities/getPluginsFromProps';\nimport { Pagination } from './plugins/pagination/components/Pagination';\n\nfunction PaginatedDataGrid({\n columns,\n rows,\n showRowsLoader,\n noResultsPlaceholder,\n rowsLoaderRenderer = renderRowsLoader,\n maxPerPage,\n minPerPage,\n onPageSelect,\n onPerPage,\n pagination,\n ...otherProps\n}) {\n const plugins = getPluginsFromProps(otherProps, { infiniteScrolling: true });\n const grid = useDataGrid({\n ...otherProps,\n columns,\n rows,\n renderers: defaultRenderers,\n plugins,\n });\n\n return (\n <DatagridWrapper>\n {addOptionalHeaderComponents({ grid })}\n <Table {...grid}>\n <Table.Header />\n {showRowsLoader ? rowsLoaderRenderer() : <Table.Body rows={grid.composedRows.rows || grid.composedRows} />}\n </Table>\n <Pagination\n maxPerPage={maxPerPage}\n minPerPage={minPerPage}\n onPageSelect={onPageSelect}\n onPerPage={onPerPage}\n paginated={rows}\n pagination={pagination}\n />\n </DatagridWrapper>\n );\n}\n\nexport default PaginatedDataGrid;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,uBAA4B;AAC5B,mBAAsB;AACtB,uBAAmD;AACnD,qCAAgC;AAChC,yCAA4C;AAC5C,iCAAoC;AACpC,wBAA2B;AAE3B,2BAA2B,IAYxB;AAZwB,eACzB;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAVyB,IAWtB,uBAXsB,IAWtB;AAAA,IAVH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,UAAU,oDAAoB,YAAY,EAAE,mBAAmB;AACrE,QAAM,OAAO,kCAAY,iCACpB,aADoB;AAAA,IAEvB;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA;AAGF,SACE,mDAAC,gDAAD,MACG,oEAA4B,EAAE,SAC/B,mDAAC,oBAAD,mBAAW,OACT,mDAAC,mBAAM,QAAP,OACC,iBAAiB,uBAAuB,mDAAC,mBAAM,MAAP;AAAA,IAAY,MAAM,KAAK,aAAa,QAAQ,KAAK;AAAA,OAE5F,mDAAC,8BAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA;AAAA;AAMR,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -59,15 +59,14 @@ __export(BodyCell_exports, {
|
|
|
59
59
|
var React = __toESM(require("react"));
|
|
60
60
|
var import_react = __toESM(require("react"));
|
|
61
61
|
var import_prop_types = __toESM(require("prop-types"));
|
|
62
|
-
var
|
|
63
|
-
var import_utils = require("@elliemae/ds-shared/createDataInstance/utils");
|
|
62
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
64
63
|
var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
|
|
65
64
|
const BodyCell = ({ component: Component, classProps, rowProps, column, columnIndex, rowIndex, grid }) => {
|
|
66
65
|
const _a = rowProps, { rowData, rowKey, isScrolling } = _a, extraRowProps = __objRest(_a, ["rowData", "rowKey", "isScrolling"]);
|
|
67
66
|
const { property, cell, props } = column;
|
|
68
67
|
const evaluatedProperty = property || cell && cell.property;
|
|
69
68
|
const ref = (0, import_react.useRef)(null);
|
|
70
|
-
const { register } = (0, import_react.useContext)(
|
|
69
|
+
const { register } = (0, import_react.useContext)(import_ds_shared.FocusGridContext);
|
|
71
70
|
const registerFocus = (0, import_react.useCallback)((node) => {
|
|
72
71
|
register(node, rowIndex, columnIndex);
|
|
73
72
|
}, []);
|
|
@@ -94,13 +93,13 @@ const BodyCell = ({ component: Component, classProps, rowProps, column, columnIn
|
|
|
94
93
|
value: v
|
|
95
94
|
});
|
|
96
95
|
const value = rowData[`_${evaluatedProperty}`] || rowData[evaluatedProperty];
|
|
97
|
-
const transformed = (0,
|
|
96
|
+
const transformed = (0, import_ds_shared.evaluateTransforms)(transforms, value, extraParameters);
|
|
98
97
|
return /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues(__spreadValues(__spreadValues({
|
|
99
98
|
ref,
|
|
100
99
|
"data-testid": `column-${property}`,
|
|
101
100
|
tabIndex: -1,
|
|
102
101
|
classProps
|
|
103
|
-
}, props), cell && cell.props), transformed), transformed.children || (0,
|
|
102
|
+
}, props), cell && cell.props), transformed), transformed.children || (0, import_ds_shared.evaluateFormatters)(!isScrolling ? [withTooltip, ...formatters, ...fixedFormatters] : [...scrollingFormatters, ...fixedFormatters], value, extraParameters, grid));
|
|
104
103
|
};
|
|
105
104
|
BodyCell.propTypes = {
|
|
106
105
|
component: import_prop_types.default.element,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/BodyCell.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect, useContext, useRef, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { FocusGridContext
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkE;AAClE,wBAAsB;AACtB,
|
|
4
|
+
"sourcesContent": ["import React, { useEffect, useContext, useRef, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { FocusGridContext, evaluateFormatters, evaluateTransforms } from '@elliemae/ds-shared';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\n\nconst BodyCell = ({ component: Component, classProps, rowProps, column, columnIndex, rowIndex, grid }) => {\n const { rowData, rowKey, isScrolling, ...extraRowProps } = rowProps;\n const { property, cell, props } = column;\n const evaluatedProperty = property || (cell && cell.property);\n\n const ref = useRef(null);\n const { register } = useContext(FocusGridContext);\n\n const registerFocus = useCallback((node) => {\n register(node, rowIndex, columnIndex);\n }, []);\n\n useEffect(() => {\n registerFocus(ref.current);\n }, [ref.current]);\n\n const {\n transforms = [],\n formatters = [],\n fixedFormatters = [], // useful for the toolbar trigger at the last column\n scrollingFormatters = [],\n } = cell || {};\n\n const extraParameters = {\n columnIndex,\n property: evaluatedProperty,\n column,\n rowData,\n rowIndex,\n rowKey,\n isScrolling, // improve performance on scroll rendering a lightweight component instead\n registerFocus,\n ...extraRowProps,\n };\n const withTooltip = (v) => (classProps && classProps.wrapText ? v : <DSTruncatedTooltipText value={v} />);\n const value = rowData[`_${evaluatedProperty}`] || rowData[evaluatedProperty];\n const transformed = evaluateTransforms(transforms, value, extraParameters);\n return (\n <Component\n ref={ref}\n data-testid={`column-${property}`}\n tabIndex={-1}\n classProps={classProps}\n {...props}\n {...(cell && cell.props)}\n {...transformed}\n >\n {transformed.children ||\n evaluateFormatters(\n !isScrolling\n ? [withTooltip, ...formatters, ...fixedFormatters]\n : [...scrollingFormatters, ...fixedFormatters],\n value,\n extraParameters,\n grid,\n )}\n </Component>\n );\n};\n\nBodyCell.propTypes = {\n component: PropTypes.element,\n classProps: PropTypes.shape({\n wrapText: PropTypes.bool,\n }),\n rowProps: PropTypes.shape({\n rowData: PropTypes.shape({}),\n rowKey: PropTypes.string,\n isScrolling: PropTypes.bool,\n }),\n column: PropTypes.shape({\n property: PropTypes.string,\n cell: PropTypes.any,\n props: PropTypes.shape({}),\n }),\n columnIndex: PropTypes.number,\n rowIndex: PropTypes.number,\n grid: PropTypes.any,\n};\n\nexport { BodyCell };\nexport default BodyCell;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkE;AAClE,wBAAsB;AACtB,uBAAyE;AACzE,uCAAuC;AAEvC,MAAM,WAAW,CAAC,EAAE,WAAW,WAAW,YAAY,UAAU,QAAQ,aAAa,UAAU,WAAW;AACxG,QAA2D,eAAnD,WAAS,QAAQ,gBAAkC,IAAlB,0BAAkB,IAAlB,CAAjC,WAAS,UAAQ;AACzB,QAAM,EAAE,UAAU,MAAM,UAAU;AAClC,QAAM,oBAAoB,YAAa,QAAQ,KAAK;AAEpD,QAAM,MAAM,yBAAO;AACnB,QAAM,EAAE,aAAa,6BAAW;AAEhC,QAAM,gBAAgB,8BAAY,CAAC,SAAS;AAC1C,aAAS,MAAM,UAAU;AAAA,KACxB;AAEH,8BAAU,MAAM;AACd,kBAAc,IAAI;AAAA,KACjB,CAAC,IAAI;AAER,QAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB,sBAAsB;AAAA,MACpB,QAAQ;AAEZ,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,KACG;AAEL,QAAM,cAAc,CAAC,MAAO,cAAc,WAAW,WAAW,IAAI,mDAAC,yDAAD;AAAA,IAAwB,OAAO;AAAA;AACnG,QAAM,QAAQ,QAAQ,IAAI,wBAAwB,QAAQ;AAC1D,QAAM,cAAc,yCAAmB,YAAY,OAAO;AAC1D,SACE,mDAAC,WAAD;AAAA,IACE;AAAA,IACA,eAAa,UAAU;AAAA,IACvB,UAAU;AAAA,IACV;AAAA,KACI,QACC,QAAQ,KAAK,QACd,cAEH,YAAY,YACX,yCACE,CAAC,cACG,CAAC,aAAa,GAAG,YAAY,GAAG,mBAChC,CAAC,GAAG,qBAAqB,GAAG,kBAChC,OACA,iBACA;AAAA;AAMV,SAAS,YAAY;AAAA,EACnB,WAAW,0BAAU;AAAA,EACrB,YAAY,0BAAU,MAAM;AAAA,IAC1B,UAAU,0BAAU;AAAA;AAAA,EAEtB,UAAU,0BAAU,MAAM;AAAA,IACxB,SAAS,0BAAU,MAAM;AAAA,IACzB,QAAQ,0BAAU;AAAA,IAClB,aAAa,0BAAU;AAAA;AAAA,EAEzB,QAAQ,0BAAU,MAAM;AAAA,IACtB,UAAU,0BAAU;AAAA,IACpB,MAAM,0BAAU;AAAA,IAChB,OAAO,0BAAU,MAAM;AAAA;AAAA,EAEzB,aAAa,0BAAU;AAAA,EACvB,UAAU,0BAAU;AAAA,EACpB,MAAM,0BAAU;AAAA;AAIlB,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -47,7 +47,7 @@ __export(HeaderCell_exports, {
|
|
|
47
47
|
var React = __toESM(require("react"));
|
|
48
48
|
var import_react = __toESM(require("react"));
|
|
49
49
|
var import_prop_types = __toESM(require("prop-types"));
|
|
50
|
-
var
|
|
50
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
51
51
|
var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
|
|
52
52
|
const HeaderCell = ({ column, columnIndex, component: Component, classProps, grid }) => {
|
|
53
53
|
const { property, header = {}, props = {} } = column;
|
|
@@ -65,8 +65,8 @@ const HeaderCell = ({ column, columnIndex, component: Component, classProps, gri
|
|
|
65
65
|
value: v
|
|
66
66
|
});
|
|
67
67
|
const value = withTooltip(label);
|
|
68
|
-
const transformedProps = (0,
|
|
69
|
-
const formattedValue = (0,
|
|
68
|
+
const transformedProps = (0, import_ds_shared.evaluateTransforms)(transforms, value, extraParameters);
|
|
69
|
+
const formattedValue = (0, import_ds_shared.evaluateFormatters)(formatters, value, extraParameters);
|
|
70
70
|
const testId = column.headerDataId || "data-grid-header__cell";
|
|
71
71
|
return /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues(__spreadValues(__spreadValues({
|
|
72
72
|
key: `${evaluatedProperty}-header`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/HeaderCell.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { evaluateFormatters, evaluateTransforms } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAsB;AACtB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { evaluateFormatters, evaluateTransforms } from '@elliemae/ds-shared';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\n\nexport const HeaderCell = ({ column, columnIndex, component: Component, classProps, grid }) => {\n const { property, header = {}, props = {} } = column;\n\n const evaluatedProperty = property || (header && header.property);\n\n const { label, transforms = [], formatters = [] } = header;\n\n // subscribe hook effects into header cell\n if (column.headerHookEffects) column.headerHookEffects.forEach((hook) => hook());\n\n const extraParameters = {\n columnIndex,\n property: evaluatedProperty,\n column,\n grid,\n };\n\n const withTooltip = (v) => (classProps && classProps.wrapText ? v : <DSTruncatedTooltipText value={v} />);\n const value = withTooltip(label);\n const transformedProps = evaluateTransforms(transforms, value, extraParameters);\n const formattedValue = evaluateFormatters(formatters, value, extraParameters);\n\n const testId = column.headerDataId || 'data-grid-header__cell';\n\n return (\n <Component\n key={`${evaluatedProperty}-header`}\n data-testid={testId}\n index={columnIndex}\n classProps={classProps}\n {...props}\n {...(header && header.props)}\n {...transformedProps}\n >\n {transformedProps.children || formattedValue}\n </Component>\n );\n};\n\nHeaderCell.propTypes = {\n column: PropTypes.any,\n columnIndex: PropTypes.number,\n component: PropTypes.any,\n classProps: PropTypes.any,\n grid: PropTypes.any,\n};\n\nexport default HeaderCell;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAsB;AACtB,uBAAuD;AACvD,uCAAuC;AAEhC,MAAM,aAAa,CAAC,EAAE,QAAQ,aAAa,WAAW,WAAW,YAAY,WAAW;AAC7F,QAAM,EAAE,UAAU,SAAS,IAAI,QAAQ,OAAO;AAE9C,QAAM,oBAAoB,YAAa,UAAU,OAAO;AAExD,QAAM,EAAE,OAAO,aAAa,IAAI,aAAa,OAAO;AAGpD,MAAI,OAAO;AAAmB,WAAO,kBAAkB,QAAQ,CAAC,SAAS;AAEzE,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA;AAGF,QAAM,cAAc,CAAC,MAAO,cAAc,WAAW,WAAW,IAAI,mDAAC,yDAAD;AAAA,IAAwB,OAAO;AAAA;AACnG,QAAM,QAAQ,YAAY;AAC1B,QAAM,mBAAmB,yCAAmB,YAAY,OAAO;AAC/D,QAAM,iBAAiB,yCAAmB,YAAY,OAAO;AAE7D,QAAM,SAAS,OAAO,gBAAgB;AAEtC,SACE,mDAAC,WAAD;AAAA,IACE,KAAK,GAAG;AAAA,IACR,eAAa;AAAA,IACb,OAAO;AAAA,IACP;AAAA,KACI,QACC,UAAU,OAAO,QAClB,mBAEH,iBAAiB,YAAY;AAAA;AAKpC,WAAW,YAAY;AAAA,EACrB,QAAQ,0BAAU;AAAA,EAClB,aAAa,0BAAU;AAAA,EACvB,WAAW,0BAAU;AAAA,EACrB,YAAY,0BAAU;AAAA,EACtB,MAAM,0BAAU;AAAA;AAGlB,IAAO,qBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -61,11 +61,10 @@ __export(BodyHeaderScrollSyncPlugin_exports, {
|
|
|
61
61
|
var React = __toESM(require("react"));
|
|
62
62
|
var import_react = __toESM(require("react"));
|
|
63
63
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
64
|
-
var
|
|
65
|
-
var import_createInstancePlugin = require("@elliemae/ds-shared/createDataInstance/createInstancePlugin");
|
|
64
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
66
65
|
var import_getScrollbarSize = require("../../utilities/getScrollbarSize");
|
|
67
66
|
const SCROLLBAR_WIDTH = (0, import_getScrollbarSize.getScrollbarWidth)(2);
|
|
68
|
-
const HeaderSyncHoc = (Component) => (props) => /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
+
const HeaderSyncHoc = (Component) => (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_shared.ScrollSyncPane, null, ({ registerPane }) => /* @__PURE__ */ import_react.default.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
|
69
68
|
innerRef: (0, import_ds_utilities.mergeRefs)(props.innerRef, registerPane)
|
|
70
69
|
})));
|
|
71
70
|
const BodySyncHoc = (Component, notPaginated, grid) => (_a) => {
|
|
@@ -128,7 +127,7 @@ const BodySyncHoc = (Component, notPaginated, grid) => (_a) => {
|
|
|
128
127
|
window.removeEventListener("resize", repositionToolbarBasedOnBodyScrollPosition(-SCROLLBAR_WIDTH));
|
|
129
128
|
};
|
|
130
129
|
});
|
|
131
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
130
|
+
return /* @__PURE__ */ import_react.default.createElement(import_ds_shared.ScrollSyncPane, {
|
|
132
131
|
notPaginated
|
|
133
132
|
}, ({ registerPane }) => /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues({
|
|
134
133
|
ref: t,
|
|
@@ -154,7 +153,7 @@ const BodySyncHoc = (Component, notPaginated, grid) => (_a) => {
|
|
|
154
153
|
innerRef: (0, import_ds_utilities.mergeRefs)(innerRef, registerPane, t)
|
|
155
154
|
}, rest)));
|
|
156
155
|
};
|
|
157
|
-
const TableSyncHoc = (Component) => (props) => /* @__PURE__ */ import_react.default.createElement(
|
|
156
|
+
const TableSyncHoc = (Component) => (props) => /* @__PURE__ */ import_react.default.createElement(import_ds_shared.ScrollSync, {
|
|
158
157
|
proportional: false,
|
|
159
158
|
onScroll: (e) => {
|
|
160
159
|
e.target.style.setProperty("--toolbar-scroll", `${e.target.offsetWidth + e.target.scrollLeft - 15}px`);
|
|
@@ -171,7 +170,7 @@ const decorateRenderers = (renderers, grid) => {
|
|
|
171
170
|
renderers.body.wrapper = (0, import_react.useMemo)(() => BodySyncHoc(BodyWrapper, !paginated, grid), []);
|
|
172
171
|
return renderers;
|
|
173
172
|
};
|
|
174
|
-
const BodyHeaderScrollSyncPlugin = (0,
|
|
173
|
+
const BodyHeaderScrollSyncPlugin = (0, import_ds_shared.createInstancePlugin)("body-header-scroll-sync", {
|
|
175
174
|
decorateRenderers
|
|
176
175
|
});
|
|
177
176
|
module.exports = __toCommonJS(BodyHeaderScrollSyncPlugin_exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-shadow */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\n/* eslint-disable react-hooks/rules-of-hooks */\n/* eslint-disable no-param-reassign */\n/* eslint-disable react/display-name */\nimport React, { useMemo, useRef, useEffect } from 'react';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { ScrollSync, ScrollSyncPane
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADQvB,mBAAkD;AAClD,0BAA0B;AAC1B,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-shadow */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\n/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\n/* eslint-disable react-hooks/rules-of-hooks */\n/* eslint-disable no-param-reassign */\n/* eslint-disable react/display-name */\nimport React, { useMemo, useRef, useEffect } from 'react';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { ScrollSync, ScrollSyncPane, createInstancePlugin } from '@elliemae/ds-shared';\nimport { getScrollbarWidth } from '../../utilities/getScrollbarSize';\n\nconst SCROLLBAR_WIDTH = getScrollbarWidth(2);\n\nconst HeaderSyncHoc = (Component) => (props) =>\n (\n <ScrollSyncPane>\n {({ registerPane }) => <Component {...props} innerRef={mergeRefs(props.innerRef, registerPane)} />}\n </ScrollSyncPane>\n );\nconst BodySyncHoc =\n (Component, notPaginated, grid) =>\n ({\n children,\n classProps,\n columns,\n getContainer,\n helperClass,\n innerBodyRef,\n innerRef,\n isPlaceholderActive,\n listProps,\n lockAxis,\n noResultsPlaceholder,\n numRowsVisible,\n onSortEnd,\n onSortOver,\n onSortStart,\n rowKey,\n rowRenderer,\n rows,\n useDragHandle,\n className,\n listComponent,\n ...rest\n }) => {\n const t = useRef();\n const repositionToolbarBasedOnBodyScrollPosition = (SCROLLBAR_WIDTH) => () => {\n grid.refs.body.current.style.setProperty(\n '--toolbar-scroll',\n `${grid.refs.body.current.offsetWidth + grid.refs.body.current.scrollLeft - 15}px`,\n );\n grid.refs.body.current.style.setProperty(\n '--toolbar-scroll-paginated',\n `${grid.refs.body.current.offsetWidth + grid.refs.body.current.scrollLeft - 19}px`,\n );\n };\n useEffect(() => {\n setTimeout(repositionToolbarBasedOnBodyScrollPosition(-SCROLLBAR_WIDTH), 300);\n }, []);\n useEffect(() => {\n window.addEventListener('resize', repositionToolbarBasedOnBodyScrollPosition(-SCROLLBAR_WIDTH));\n return () => {\n window.removeEventListener('resize', repositionToolbarBasedOnBodyScrollPosition(-SCROLLBAR_WIDTH));\n };\n });\n return (\n <ScrollSyncPane notPaginated={notPaginated}>\n {({ registerPane }) => (\n <Component\n ref={t}\n classProps={classProps}\n className={className}\n listComponent={listComponent}\n columns={columns}\n getContainer={getContainer}\n helperClass={helperClass}\n innerBodyRef={innerBodyRef}\n // innerRef={innerRef}\n isPlaceholderActive={isPlaceholderActive}\n listProps={listProps}\n lockAxis={lockAxis}\n noResultsPlaceholder={noResultsPlaceholder}\n numRowsVisible={numRowsVisible}\n onSortEnd={onSortEnd}\n onSortOver={onSortOver}\n onSortStart={onSortStart}\n rowKey={rowKey}\n rowRenderer={rowRenderer}\n rows={rows}\n useDragHandle={useDragHandle}\n innerRef={mergeRefs(innerRef, registerPane, t)}\n {...rest}\n />\n )}\n </ScrollSyncPane>\n );\n };\n\nconst TableSyncHoc = (Component) => (props) =>\n (\n <ScrollSync\n proportional={false}\n onScroll={(e) => {\n e.target.style.setProperty('--toolbar-scroll', `${e.target.offsetWidth + e.target.scrollLeft - 15}px`);\n e.target.style.setProperty(\n '--toolbar-scroll-paginated',\n `${e.target.offsetWidth + e.target.scrollLeft - 19}px`,\n );\n }}\n >\n <Component {...props} />\n </ScrollSync>\n );\n\nconst decorateRenderers = (renderers, grid) => {\n const HeaderWrapper = renderers.header.wrapper;\n const BodyWrapper = renderers.body.wrapper;\n const Table = renderers.table;\n const { paginated } = grid.props;\n\n renderers.table = useMemo(() => TableSyncHoc(Table), []);\n renderers.header.wrapper = useMemo(() => HeaderSyncHoc(HeaderWrapper), []);\n renderers.body.wrapper = useMemo(() => BodySyncHoc(BodyWrapper, !paginated, grid), []);\n\n return renderers;\n};\n\nexport const BodyHeaderScrollSyncPlugin = createInstancePlugin('body-header-scroll-sync', {\n decorateRenderers,\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -50,7 +50,7 @@ var React = __toESM(require("react"));
|
|
|
50
50
|
var import_react = __toESM(require("react"));
|
|
51
51
|
var import_react_sortable_hoc = require("react-sortable-hoc");
|
|
52
52
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
53
|
-
var
|
|
53
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
54
54
|
var import_decorateGridWithDndColumns = require("./decorateGridWithDndColumns");
|
|
55
55
|
const keysToOmit = [
|
|
56
56
|
"axis",
|
|
@@ -159,7 +159,7 @@ const decorateRenderers = (renderers) => {
|
|
|
159
159
|
})
|
|
160
160
|
});
|
|
161
161
|
};
|
|
162
|
-
const DndColumnsPlugin = (0,
|
|
162
|
+
const DndColumnsPlugin = (0, import_ds_shared.createInstancePlugin)("dnd-columns", {
|
|
163
163
|
getHeaderRowProps,
|
|
164
164
|
decorateColumn,
|
|
165
165
|
decorateRenderers
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/plugins/column-dnd/DndColumnsPlugin.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/display-name */\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { SortableContainer, SortableElement } from 'react-sortable-hoc';\nimport { arrayMove, omit, mergeRefs } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkD;AAClD,gCAAmD;AACnD,0BAA2C;AAC3C,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/display-name */\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { SortableContainer, SortableElement } from 'react-sortable-hoc';\nimport { arrayMove, omit, mergeRefs } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { addDragAndDropToColumn } from './decorateGridWithDndColumns';\n\n// todo: remove once it's fixed in react-sortable-hoc library\nconst keysToOmit = [\n 'axis',\n 'contentWindow',\n 'disableAutoscroll',\n 'distance',\n 'getContainer',\n 'getHelperDimensions',\n 'helperClass',\n 'helperContainer',\n 'hideSortableGhost',\n 'keyboardSortingTransitionDuration',\n 'lockAxis',\n 'lockOffset',\n 'lockToContainerEdges',\n 'onSortEnd',\n 'onSortMove',\n 'onSortOver',\n 'onSortStart',\n 'pressDelay',\n 'pressThreshold',\n 'shouldCancelStart',\n 'transitionDuration',\n 'updateBeforeSortStart',\n 'useDragHandle',\n 'useWindowAsScrollContainer',\n];\n\nconst decorateColumn = (column, grid) => (column.isUserColumn ? addDragAndDropToColumn(grid, column) : column);\n\nconst getHeaderRowProps = (props, grid) => {\n const { onMoveColumnStart, onMoveColumnEnd, onMoveColumnOver } = grid.props;\n\n const headerRowRef = useRef();\n const columnDraggingOffset = useRef(0);\n const sortedColumns = useRef(grid.getInstance().decoratedColumns);\n const nodeRef = useRef();\n\n useEffect(() => {\n sortedColumns.current = grid.getInstance().decoratedColumns;\n });\n\n const onSortOver = (params) => {\n const { index, newIndex, oldIndex } = params;\n const oldColumn = sortedColumns.current[oldIndex];\n const newColumn = sortedColumns.current[newIndex];\n\n if (!newColumn.isUserColumn || !oldColumn.isUserColumn) return;\n\n const columnWidth = nodeRef.current.offsetWidth;\n const newColumnWidth = headerRowRef.current.childNodes.item(newColumn.index).offsetWidth;\n\n const forward = newIndex > oldIndex;\n\n // eslint-disable-next-line no-nested-ternary\n const columnTranslate = forward ? (newIndex > index ? columnWidth * -1 : 0) : newIndex < index ? columnWidth : 0;\n\n columnDraggingOffset.current += forward ? newColumnWidth : newColumnWidth * -1;\n\n newColumn.updateStyle({\n transitionDuration: '300ms',\n transform: `translate3d(${columnTranslate}px, 0, 0)`,\n });\n oldColumn.updateStyle({\n transitionDuration: '300ms',\n transform: `translate3d(${columnDraggingOffset.current}px, 0, 0)`,\n });\n\n sortedColumns.current = arrayMove(sortedColumns.current, oldIndex, newIndex);\n onMoveColumnOver(params);\n };\n\n const onSortStart = (params) => {\n const { node } = params;\n grid.disableEvents();\n nodeRef.current = node;\n onMoveColumnStart(params);\n };\n\n const onSortEnd = (params) => {\n const { oldIndex, newIndex } = params;\n grid.enableEvents();\n columnDraggingOffset.current = 0;\n sortedColumns.current = grid.decoratedColumns;\n grid.decoratedColumns.forEach((column) => {\n if (!column.updateStyle) return;\n column.updateStyle({\n transitionDuration: null,\n transform: null,\n });\n });\n\n const originalOldColumnIndex = grid.columns.findIndex(\n (column) => column.property === grid.decoratedColumns[oldIndex].property,\n );\n const originalNewColumnIndex = grid.columns.findIndex(\n (column) => column.property === grid.decoratedColumns[newIndex].property,\n );\n\n onMoveColumnEnd({\n newIndex: originalNewColumnIndex,\n oldIndex: originalOldColumnIndex,\n });\n };\n\n return {\n axis: 'x',\n helperClass: 'header-dnd-column',\n innerRef: mergeRefs(props.innerRef, headerRowRef),\n lockAxis: 'x',\n onSortEnd,\n onSortOver,\n onSortStart,\n useDragHandle: true,\n };\n};\n\nconst decorateRenderers = (renderers) => {\n const RowComponent = renderers.header.row;\n const CellComponent = renderers.header.cell;\n\n const Row = useMemo(() => SortableContainer((props) => <RowComponent {...omit(props, keysToOmit)} />), []);\n\n const Cell = useMemo(() => SortableElement(CellComponent), []);\n\n return {\n ...renderers,\n header: {\n ...renderers.header,\n row: Row,\n cell: Cell,\n },\n };\n};\n\nexport const DndColumnsPlugin = createInstancePlugin('dnd-columns', {\n getHeaderRowProps,\n decorateColumn,\n decorateRenderers,\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,14 +33,14 @@ var React = __toESM(require("react"));
|
|
|
33
33
|
var import_react = __toESM(require("react"));
|
|
34
34
|
var import_react_sortable_hoc = require("react-sortable-hoc");
|
|
35
35
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
36
|
-
var
|
|
36
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
37
37
|
const DragHandle = (0, import_react_sortable_hoc.SortableHandle)(() => /* @__PURE__ */ import_react.default.createElement(import_ds_icons.GripperVertical, {
|
|
38
38
|
className: "drag-handle"
|
|
39
39
|
}));
|
|
40
40
|
const DndHeaderFormatter = (value) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(DragHandle, null), value);
|
|
41
41
|
const addDragAndDropToColumn = (grid, column) => {
|
|
42
|
-
column = (0,
|
|
43
|
-
return (0,
|
|
42
|
+
column = (0, import_ds_shared.appendHeaderFormatter)(DndHeaderFormatter, column);
|
|
43
|
+
return (0, import_ds_shared.mergeClassNameToColumnHeader)("with-dnd-column", column);
|
|
44
44
|
};
|
|
45
45
|
module.exports = __toCommonJS(decorateGridWithDndColumns_exports);
|
|
46
46
|
//# sourceMappingURL=decorateGridWithDndColumns.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/plugins/column-dnd/decorateGridWithDndColumns.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { SortableHandle } from 'react-sortable-hoc';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,gCAA+B;AAC/B,sBAAgC;AAChC,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { SortableHandle } from 'react-sortable-hoc';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { appendHeaderFormatter, mergeClassNameToColumnHeader } from '@elliemae/ds-shared';\n\nconst DragHandle = SortableHandle(() => <GripperVertical className=\"drag-handle\" />);\n\nconst DndHeaderFormatter = (value) => (\n <>\n <DragHandle />\n {value}\n </>\n);\n\nconst addDragAndDropToColumn = (grid, column) => {\n column = appendHeaderFormatter(DndHeaderFormatter, column);\n return mergeClassNameToColumnHeader('with-dnd-column', column);\n};\n\nexport { addDragAndDropToColumn };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,gCAA+B;AAC/B,sBAAgC;AAChC,uBAAoE;AAEpE,MAAM,aAAa,8CAAe,MAAM,mDAAC,iCAAD;AAAA,EAAiB,WAAU;AAAA;AAEnE,MAAM,qBAAqB,CAAC,UAC1B,wFACE,mDAAC,YAAD,OACC;AAIL,MAAM,yBAAyB,CAAC,MAAM,WAAW;AAC/C,WAAS,4CAAsB,oBAAoB;AACnD,SAAO,mDAA6B,mBAAmB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -32,7 +32,7 @@ __export(ColumnSizingPlugin_exports, {
|
|
|
32
32
|
var React = __toESM(require("react"));
|
|
33
33
|
var import_react = require("react");
|
|
34
34
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
35
|
-
var
|
|
35
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
36
36
|
var import_useStylesheetHelpers = require("./useStylesheetHelpers");
|
|
37
37
|
var import_useColumnSizeService = require("./useColumnSizeService");
|
|
38
38
|
var import_getTableProps = require("./ext-points/getTableProps");
|
|
@@ -80,7 +80,7 @@ const decorateGrid = (grid) => {
|
|
|
80
80
|
updateRowWidth
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
|
-
const ColumnSizingPlugin = (0,
|
|
83
|
+
const ColumnSizingPlugin = (0, import_ds_shared.createInstancePlugin)("column-sizing", {
|
|
84
84
|
decorateGrid,
|
|
85
85
|
decorateColumn: import_decorateColumn.decorateColumn,
|
|
86
86
|
getRowProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/plugins/column-sizing/ColumnSizingPlugin.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-param-reassign */\n/* eslint-disable react-hooks/rules-of-hooks */\nimport { useRef } from 'react';\nimport { cx } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAuB;AACvB,0BAAmB;AACnB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-param-reassign */\n/* eslint-disable react-hooks/rules-of-hooks */\nimport { useRef } from 'react';\nimport { cx } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { useStylesheetHelpers } from './useStylesheetHelpers';\nimport { useColumnSizeService } from './useColumnSizeService';\nimport { getTableProps } from './ext-points/getTableProps';\nimport { decorateColumn } from './ext-points/decorateColumn';\n\nconst getHeaderRowProps = (rowProps, { rowsStylesheet }) => {\n rowProps.className = `${rowsStylesheet.getRowClassName()}-header`;\n return rowProps;\n};\n\nconst getRowProps = (rowProps, { rowsStylesheet }) => {\n rowProps.className = cx(rowProps.className, rowsStylesheet.getRowClassName());\n return rowProps;\n};\n\nconst decorateColumns = (columns, grid) => grid.columnsStylesheet.decorateColumns(columns, grid);\n\nconst decorateGrid = (grid) => {\n const isDragging = useRef(false);\n const tableRef = useRef();\n const resizedColumns = useRef({});\n const scrollbarWidth = useRef();\n const bodyWidth = useRef();\n const allColumnsHaveBeenFixed = useRef(false);\n const columnSizeService = useColumnSizeService(grid);\n const { columnsStylesheet, rowsStylesheet } = useStylesheetHelpers(grid);\n\n // row size side-effect\n const updateRowWidth = (width) => {\n const gridWidth = width || tableRef.current.offsetWidth;\n const columnsTotalSize = columnSizeService.computeColumnsTotalSize();\n\n if (columnsTotalSize > gridWidth + 5) {\n if (!allColumnsHaveBeenFixed.current && isDragging.current) {\n columnSizeService.setActualColumnsSizesFixed();\n allColumnsHaveBeenFixed.current = true;\n }\n rowsStylesheet.update(columnsTotalSize);\n } else {\n rowsStylesheet.update(undefined);\n }\n };\n\n return {\n isDragging,\n tableRef,\n bodyWidth,\n scrollbarWidth,\n columnSizeService,\n rowsStylesheet,\n columnsStylesheet,\n resizedColumns,\n updateRowWidth,\n };\n};\n\nexport const ColumnSizingPlugin = createInstancePlugin('column-sizing', {\n decorateGrid,\n decorateColumn,\n getRowProps,\n getHeaderRowProps,\n getTableProps,\n decorateColumns,\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAuB;AACvB,0BAAmB;AACnB,uBAAqC;AACrC,kCAAqC;AACrC,kCAAqC;AACrC,2BAA8B;AAC9B,4BAA+B;AAE/B,MAAM,oBAAoB,CAAC,UAAU,EAAE,qBAAqB;AAC1D,WAAS,YAAY,GAAG,eAAe;AACvC,SAAO;AAAA;AAGT,MAAM,cAAc,CAAC,UAAU,EAAE,qBAAqB;AACpD,WAAS,YAAY,4BAAG,SAAS,WAAW,eAAe;AAC3D,SAAO;AAAA;AAGT,MAAM,kBAAkB,CAAC,SAAS,SAAS,KAAK,kBAAkB,gBAAgB,SAAS;AAE3F,MAAM,eAAe,CAAC,SAAS;AAC7B,QAAM,aAAa,yBAAO;AAC1B,QAAM,WAAW;AACjB,QAAM,iBAAiB,yBAAO;AAC9B,QAAM,iBAAiB;AACvB,QAAM,YAAY;AAClB,QAAM,0BAA0B,yBAAO;AACvC,QAAM,oBAAoB,sDAAqB;AAC/C,QAAM,EAAE,mBAAmB,mBAAmB,sDAAqB;AAGnE,QAAM,iBAAiB,CAAC,UAAU;AAChC,UAAM,YAAY,SAAS,SAAS,QAAQ;AAC5C,UAAM,mBAAmB,kBAAkB;AAE3C,QAAI,mBAAmB,YAAY,GAAG;AACpC,UAAI,CAAC,wBAAwB,WAAW,WAAW,SAAS;AAC1D,0BAAkB;AAClB,gCAAwB,UAAU;AAAA;AAEpC,qBAAe,OAAO;AAAA,WACjB;AACL,qBAAe,OAAO;AAAA;AAAA;AAI1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAIG,MAAM,qBAAqB,2CAAqB,iBAAiB;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,10 +30,10 @@ __export(CustomRendererPlugin_exports, {
|
|
|
30
30
|
CustomRendererPlugin: () => CustomRendererPlugin
|
|
31
31
|
});
|
|
32
32
|
var React = __toESM(require("react"));
|
|
33
|
-
var
|
|
33
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
34
34
|
var import_addCustomRendererToCell = require("./addCustomRendererToCell");
|
|
35
35
|
const decorateColumn = (column, grid) => (0, import_addCustomRendererToCell.addCustomRendererToCell)(grid)(column);
|
|
36
|
-
const CustomRendererPlugin = (0,
|
|
36
|
+
const CustomRendererPlugin = (0, import_ds_shared.createInstancePlugin)("custom-renderer", {
|
|
37
37
|
decorateColumn
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(CustomRendererPlugin_exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/plugins/custom-cell-renderer/CustomRendererPlugin.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { createInstancePlugin } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["import { createInstancePlugin } from '@elliemae/ds-shared';\nimport { addCustomRendererToCell } from './addCustomRendererToCell';\n\n// todo: this probably needs to go to the core\n\nconst decorateColumn = (column, grid) => addCustomRendererToCell(grid)(column);\n\nexport const CustomRendererPlugin = createInstancePlugin('custom-renderer', {\n decorateColumn,\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAqC;AACrC,qCAAwC;AAIxC,MAAM,iBAAiB,CAAC,QAAQ,SAAS,4DAAwB,MAAM;AAEhE,MAAM,uBAAuB,2CAAqB,mBAAmB;AAAA,EAC1E;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -50,7 +50,7 @@ __export(addCustomRendererToCell_exports, {
|
|
|
50
50
|
});
|
|
51
51
|
var React = __toESM(require("react"));
|
|
52
52
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
53
|
-
var
|
|
53
|
+
var import_ds_shared = require("@elliemae/ds-shared");
|
|
54
54
|
var import_getRendererComponent = require("./getRendererComponent");
|
|
55
55
|
const getRenderer = (renderer, grid, column) => (value, metaData) => {
|
|
56
56
|
const {
|
|
@@ -81,7 +81,7 @@ const addCustomRendererToCell = (grid) => (column) => {
|
|
|
81
81
|
column.header.formatters.push(getRenderer(customHeaderRenderer, grid));
|
|
82
82
|
}
|
|
83
83
|
if ((0, import_ds_utilities.isFunction)(customRenderer)) {
|
|
84
|
-
column = (0,
|
|
84
|
+
column = (0, import_ds_shared.appendCellFormatter)(getRenderer(customRenderer, grid, column), column);
|
|
85
85
|
} else {
|
|
86
86
|
if (!customRenderer)
|
|
87
87
|
return column;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/plugins/custom-cell-renderer/addCustomRendererToCell.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\nimport { isFunction, get } from '@elliemae/ds-utilities';\nimport { appendCellFormatter } from '@elliemae/ds-shared
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAAgC;AAChC,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\nimport { isFunction, get } from '@elliemae/ds-utilities';\nimport { appendCellFormatter } from '@elliemae/ds-shared';\nimport { getRendererComponent } from './getRendererComponent';\n\nexport const getRenderer = (renderer, grid, column) => (value, metaData) => {\n const {\n props: { customHandlers, parentRowData },\n } = grid.getInstance();\n if (\n column &&\n column.formatExpandable &&\n value &&\n value.props &&\n value.props.children &&\n value.props.children.length === 2\n ) {\n return [\n value.props.children[0],\n renderer({\n value: value.props.children[1], // apply custom render only to the original value not the arrow\n metaData: { ...metaData, parentRowData },\n customHandlers,\n }),\n ];\n }\n return renderer({\n value,\n metaData: { ...metaData, parentRowData },\n customHandlers,\n });\n};\n\nconst addCustomRendererToCell = (grid) => (column) => {\n const { customRenderer } = column;\n const customHeaderRenderer = get(column, ['header', 'customRenderer']);\n if (!customRenderer && !customHeaderRenderer) return column;\n\n if (isFunction(customHeaderRenderer)) {\n column.header.formatters.push(getRenderer(customHeaderRenderer, grid));\n }\n\n if (isFunction(customRenderer)) {\n column = appendCellFormatter(getRenderer(customRenderer, grid, column), column);\n } else {\n if (!customRenderer) return column;\n column.cell.formatters.push((value, columnData) => getRendererComponent(grid, customRenderer, columnData));\n }\n\n return column;\n};\n\nexport { addCustomRendererToCell };\nexport default addCustomRendererToCell;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAAgC;AAChC,uBAAoC;AACpC,kCAAqC;AAE9B,MAAM,cAAc,CAAC,UAAU,MAAM,WAAW,CAAC,OAAO,aAAa;AAC1E,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB;AAAA,MACvB,KAAK;AACT,MACE,UACA,OAAO,oBACP,SACA,MAAM,SACN,MAAM,MAAM,YACZ,MAAM,MAAM,SAAS,WAAW,GAChC;AACA,WAAO;AAAA,MACL,MAAM,MAAM,SAAS;AAAA,MACrB,SAAS;AAAA,QACP,OAAO,MAAM,MAAM,SAAS;AAAA,QAC5B,UAAU,iCAAK,WAAL,EAAe;AAAA,QACzB;AAAA;AAAA;AAAA;AAIN,SAAO,SAAS;AAAA,IACd;AAAA,IACA,UAAU,iCAAK,WAAL,EAAe;AAAA,IACzB;AAAA;AAAA;AAIJ,MAAM,0BAA0B,CAAC,SAAS,CAAC,WAAW;AACpD,QAAM,EAAE,mBAAmB;AAC3B,QAAM,uBAAuB,6BAAI,QAAQ,CAAC,UAAU;AACpD,MAAI,CAAC,kBAAkB,CAAC;AAAsB,WAAO;AAErD,MAAI,oCAAW,uBAAuB;AACpC,WAAO,OAAO,WAAW,KAAK,YAAY,sBAAsB;AAAA;AAGlE,MAAI,oCAAW,iBAAiB;AAC9B,aAAS,0CAAoB,YAAY,gBAAgB,MAAM,SAAS;AAAA,SACnE;AACL,QAAI,CAAC;AAAgB,aAAO;AAC5B,WAAO,KAAK,WAAW,KAAK,CAAC,OAAO,eAAe,sDAAqB,MAAM,gBAAgB;AAAA;AAGhG,SAAO;AAAA;AAIT,IAAO,kCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -53,18 +53,18 @@ var import_ds_form = require("@elliemae/ds-form");
|
|
|
53
53
|
class ComboBox extends import_react.Component {
|
|
54
54
|
constructor(props) {
|
|
55
55
|
super(props);
|
|
56
|
+
this.handleChange = (value) => {
|
|
57
|
+
const { onValue } = this.props;
|
|
58
|
+
setTimeout(() => onValue(value), 1);
|
|
59
|
+
this.setState({ value });
|
|
60
|
+
};
|
|
61
|
+
this.handleBlur = () => {
|
|
62
|
+
const { onValue } = this.props;
|
|
63
|
+
const { value } = this.state;
|
|
64
|
+
onValue(value);
|
|
65
|
+
};
|
|
56
66
|
this.state = { value: props.value };
|
|
57
67
|
}
|
|
58
|
-
handleChange(value) {
|
|
59
|
-
const { onValue } = this.props;
|
|
60
|
-
setTimeout(() => onValue(value), 1);
|
|
61
|
-
this.setState({ value });
|
|
62
|
-
}
|
|
63
|
-
handleBlur() {
|
|
64
|
-
const { onValue } = this.props;
|
|
65
|
-
const { value } = this.state;
|
|
66
|
-
onValue(value);
|
|
67
|
-
}
|
|
68
68
|
render() {
|
|
69
69
|
const { value } = this.state;
|
|
70
70
|
return /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSComboBox, __spreadProps(__spreadValues({}, this.props), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/plugins/editable/EditableComponents/ComboBox.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { Component } from 'react';\nimport { DSComboBox } from '@elliemae/ds-form';\n\nclass ComboBox extends Component {\n static defaultProps = {\n onValue: () => null,\n };\n\n constructor(props) {\n super(props);\n this.state = { value: props.value };\n }\n\n handleChange(value) {\n const { onValue } = this.props;\n\n // some how this is executed before handleBlur, and handleBlur before the value is set\n // causing the value to be the same as the prevProp\n // todo: find a better solution to this\n setTimeout(() => onValue(value), 1);\n this.setState({ value });\n }\n\n handleBlur() {\n const { onValue } = this.props;\n const { value } = this.state;\n onValue(value);\n }\n\n render() {\n const { value } = this.state;\n return (\n <DSComboBox\n {...this.props}\n menuIsOpen\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onClick={(e) => e.stopPropagation()}\n value={value}\n />\n );\n }\n}\n\nexport { ComboBox };\nexport default ComboBox;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAiC;AACjC,qBAA2B;AAE3B,uBAAuB,uBAAU;AAAA,EAK/B,YAAY,OAAO;AACjB,UAAM;
|
|
4
|
+
"sourcesContent": ["import React, { Component } from 'react';\nimport { DSComboBox } from '@elliemae/ds-form';\n\nclass ComboBox extends Component {\n static defaultProps = {\n onValue: () => null,\n };\n\n constructor(props) {\n super(props);\n this.state = { value: props.value };\n }\n\n handleChange = (value) => {\n const { onValue } = this.props;\n\n // some how this is executed before handleBlur, and handleBlur before the value is set\n // causing the value to be the same as the prevProp\n // todo: find a better solution to this\n setTimeout(() => onValue(value), 1);\n this.setState({ value });\n }\n\n handleBlur = () => {\n const { onValue } = this.props;\n const { value } = this.state;\n onValue(value);\n }\n\n render() {\n const { value } = this.state;\n return (\n <DSComboBox\n {...this.props}\n menuIsOpen\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onClick={(e) => e.stopPropagation()}\n value={value}\n />\n );\n }\n}\n\nexport { ComboBox };\nexport default ComboBox;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAiC;AACjC,qBAA2B;AAE3B,uBAAuB,uBAAU;AAAA,EAK/B,YAAY,OAAO;AACjB,UAAM;AAIR,wBAAe,CAAC,UAAU;AACxB,YAAM,EAAE,YAAY,KAAK;AAKzB,iBAAW,MAAM,QAAQ,QAAQ;AACjC,WAAK,SAAS,EAAE;AAAA;AAGlB,sBAAa,MAAM;AACjB,YAAM,EAAE,YAAY,KAAK;AACzB,YAAM,EAAE,UAAU,KAAK;AACvB,cAAQ;AAAA;AAhBR,SAAK,QAAQ,EAAE,OAAO,MAAM;AAAA;AAAA,EAmB9B,SAAS;AACP,UAAM,EAAE,UAAU,KAAK;AACvB,WACE,mDAAC,2BAAD,iCACM,KAAK,QADX;AAAA,MAEE,YAAU;AAAA,MACV,QAAQ,KAAK;AAAA,MACb,UAAU,KAAK;AAAA,MACf,SAAS,CAAC,MAAM,EAAE;AAAA,MAClB;AAAA;AAAA;AAAA;AAlCC,AADT,SACS,eAAe;AAAA,EACpB,SAAS,MAAM;AAAA;AAwCnB,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|