@elliemae/ds-datagrids 3.0.0-next.13 → 3.0.0-next.17
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/BodyCell.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect, useContext, useRef, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { FocusGridContext
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,WAAW,CAAC,EAAE,WAAW,WAAW,YAAY,UAAU,QAAQ,aAAa,UAAU,WAAW;AACxG,QAA2D,eAAnD,WA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,MAAM;AAAA,IACtB,UAAU,UAAU;AAAA,IACpB,MAAM,UAAU;AAAA,IAChB,OAAO,UAAU,MAAM;AAAA;AAAA,EAEzB,aAAa,UAAU;AAAA,EACvB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA;AAIlB,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
import * as React from "react";
|
|
18
18
|
import React2 from "react";
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
|
-
import { evaluateFormatters, evaluateTransforms } from "@elliemae/ds-shared
|
|
20
|
+
import { evaluateFormatters, evaluateTransforms } from "@elliemae/ds-shared";
|
|
21
21
|
import { DSTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
22
22
|
const HeaderCell = ({ column, columnIndex, component: Component, classProps, grid }) => {
|
|
23
23
|
const { property, header = {}, props = {} } = column;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/HeaderCell.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { evaluateFormatters, evaluateTransforms } from '@elliemae/ds-shared
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAEO,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,qCAAC,wBAAD;AAAA,IAAwB,OAAO;AAAA;AACnG,QAAM,QAAQ,YAAY;AAC1B,QAAM,mBAAmB,mBAAmB,YAAY,OAAO;AAC/D,QAAM,iBAAiB,mBAAmB,YAAY,OAAO;AAE7D,QAAM,SAAS,OAAO,gBAAgB;AAEtC,SACE,qCAAC,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,UAAU;AAAA,EAClB,aAAa,UAAU;AAAA,EACvB,WAAW,UAAU;AAAA,EACrB,YAAY,UAAU;AAAA,EACtB,MAAM,UAAU;AAAA;AAGlB,IAAO,qBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -32,8 +32,7 @@ var __objRest = (source, exclude) => {
|
|
|
32
32
|
import * as React from "react";
|
|
33
33
|
import React2, { useMemo, useRef, useEffect } from "react";
|
|
34
34
|
import { mergeRefs } from "@elliemae/ds-utilities";
|
|
35
|
-
import { ScrollSync, ScrollSyncPane } from "@elliemae/ds-shared
|
|
36
|
-
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
35
|
+
import { ScrollSync, ScrollSyncPane, createInstancePlugin } from "@elliemae/ds-shared";
|
|
37
36
|
import { getScrollbarWidth } from "../../utilities/getScrollbarSize";
|
|
38
37
|
const SCROLLBAR_WIDTH = getScrollbarWidth(2);
|
|
39
38
|
const HeaderSyncHoc = (Component) => (props) => /* @__PURE__ */ React2.createElement(ScrollSyncPane, null, ({ registerPane }) => /* @__PURE__ */ React2.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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;ACQA;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 BodyHeaderScrollSyncPlug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
|
}
|
|
@@ -21,7 +21,7 @@ import * as React from "react";
|
|
|
21
21
|
import React2, { useEffect, useMemo, useRef } from "react";
|
|
22
22
|
import { SortableContainer, SortableElement } from "react-sortable-hoc";
|
|
23
23
|
import { arrayMove, omit, mergeRefs } from "@elliemae/ds-utilities";
|
|
24
|
-
import { createInstancePlugin } from "@elliemae/ds-shared
|
|
24
|
+
import { createInstancePlugin } from "@elliemae/ds-shared";
|
|
25
25
|
import { addDragAndDropToColumn } from "./decorateGridWithDndColumns";
|
|
26
26
|
const keysToOmit = [
|
|
27
27
|
"axis",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/column-dnd/DndColumnsPlugin.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AAGA,MAAM,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAGF,MAAM,iBAAiB,CAAC,QAAQ,SAAU,OAAO,eAAe,uBAAuB,MAAM,UAAU;AAEvG,MAAM,oBAAoB,CAAC,OAAO,SAAS;AACzC,QAAM,EAAE,mBAAmB,iBAAiB,qBAAqB,KAAK;AAEtE,QAAM,e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ElE,UAAM,yBAAyB,KAAK,QAAQ,UAC1C,CAAC,WAAW,OAAO,aAAa,KAAK,iBAAiB,UAAU;AAGlE,oBAAgB;AAAA,MACd,UAAU;AAAA,MACV,UAAU;AAAA;AAAA;AAId,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU,UAAU,MAAM,UAAU;AAAA,IACpC,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA;AAAA;AAInB,MAAM,oBAAoB,CAAC,cAAc;AACvC,QAAM,eAAe,UAAU,OAAO;AACtC,QAAM,gBAAgB,UAAU,OAAO;AAEvC,QAAM,MAAM,QAAQ,MAAM,kBAAkB,CAAC,UAAU,qCAAC,cAAD,mBAAkB,KAAK,OAAO,gBAAkB;AAEvG,QAAM,OAAO,QAAQ,MAAM,gBAAgB,gBAAgB;AAE3D,SAAO,iCACF,YADE;AAAA,IAEL,QAAQ,iCACH,UAAU,SADP;AAAA,MAEN,KAAK;AAAA,MACL,MAAM;AAAA;AAAA;AAAA;AAKL,MAAM,mBAAmB,qBAAqB,eAAe;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,10 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import React2 from "react";
|
|
3
3
|
import { SortableHandle } from "react-sortable-hoc";
|
|
4
4
|
import { GripperVertical } from "@elliemae/ds-icons";
|
|
5
|
-
import {
|
|
6
|
-
appendHeaderFormatter,
|
|
7
|
-
mergeClassNameToColumnHeader
|
|
8
|
-
} from "@elliemae/ds-shared/useDataGrid/initColumnDefinition";
|
|
5
|
+
import { appendHeaderFormatter, mergeClassNameToColumnHeader } from "@elliemae/ds-shared";
|
|
9
6
|
const DragHandle = SortableHandle(() => /* @__PURE__ */ React2.createElement(GripperVertical, {
|
|
10
7
|
className: "drag-handle"
|
|
11
8
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/column-dnd/decorateGridWithDndColumns.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { SortableHandle } from 'react-sortable-hoc';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport {
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,aAAa,eAAe,MAAM,qCAAC,iBAAD;AAAA,EAAiB,WAAU;AAAA;AAEnE,MAAM,qBAAqB,CAAC,UAC1B,4DACE,qCAAC,YAAD,OACC;AAIL,MAAM,yBAAyB,CAAC,MAAM,WAAW;AAC/C,WAAS,sBAAsB,oBAAoB;AACnD,SAAO,6BAA6B,mBAAmB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useRef } from "react";
|
|
3
3
|
import { cx } from "@elliemae/ds-utilities";
|
|
4
|
-
import { createInstancePlugin } from "@elliemae/ds-shared
|
|
4
|
+
import { createInstancePlugin } from "@elliemae/ds-shared";
|
|
5
5
|
import { useStylesheetHelpers } from "./useStylesheetHelpers";
|
|
6
6
|
import { useColumnSizeService } from "./useColumnSizeService";
|
|
7
7
|
import { getTableProps } from "./ext-points/getTableProps";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/column-sizing/ColumnSizingPlugin.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
5
|
"mappings": "AAAA;ACEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,oBAAoB,CAAC,UAAU,EAAE,qBAAqB;AAC1D,WAAS,YAAY,GAAG,eAAe;AACvC,SAAO;AAAA;AAGT,MAAM,cAAc,CAAC,UAAU,EAAE,qBAAqB;AACpD,WAAS,YAAY,GAAG,SAAS,WAAW,eAAe;AAC3D,SAAO;AAAA;AAGT,MAAM,kBAAkB,CAAC,SAAS,SAAS,KAAK,kBAAkB,gBAAgB,SAAS;AAE3F,MAAM,eAAe,CAAC,SAAS;AAC7B,QAAM,aAAa,OAAO;AAC1B,QAAM,WAAW;AACjB,QAAM,iBAAiB,OAAO;AAC9B,QAAM,iBAAiB;AACvB,QAAM,YAAY;AAClB,QAAM,0BAA0B,OAAO;AACvC,QAAM,oBAAoB,qBAAqB;AAC/C,QAAM,EAAE,mBAAmB,mBAAmB,qBAAqB;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,qBAAqB,iBAAiB;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { createInstancePlugin } from "@elliemae/ds-shared
|
|
2
|
+
import { createInstancePlugin } from "@elliemae/ds-shared";
|
|
3
3
|
import { addCustomRendererToCell } from "./addCustomRendererToCell";
|
|
4
4
|
const decorateColumn = (column, grid) => addCustomRendererToCell(grid)(column);
|
|
5
5
|
const CustomRendererPlugin = createInstancePlugin("custom-renderer", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/custom-cell-renderer/CustomRendererPlugin.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createInstancePlugin } from '@elliemae/ds-shared
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
5
|
"mappings": "AAAA;ACAA;AACA;AAIA,MAAM,iBAAiB,CAAC,QAAQ,SAAS,wBAAwB,MAAM;AAEhE,MAAM,uBAAuB,qBAAqB,mBAAmB;AAAA,EAC1E;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import * as React from "react";
|
|
21
21
|
import { isFunction, get } from "@elliemae/ds-utilities";
|
|
22
|
-
import { appendCellFormatter } from "@elliemae/ds-shared
|
|
22
|
+
import { appendCellFormatter } from "@elliemae/ds-shared";
|
|
23
23
|
import { getRendererComponent } from "./getRendererComponent";
|
|
24
24
|
const getRenderer = (renderer, grid, column) => (value, metaData) => {
|
|
25
25
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/custom-cell-renderer/addCustomRendererToCell.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\nimport { isFunction, get } from '@elliemae/ds-utilities';\nimport { appendCellFormatter } from '@elliemae/ds-shared
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AAEO,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,IAAI,QAAQ,CAAC,UAAU;AACpD,MAAI,CAAC,kBAAkB,CAAC;AAAsB,WAAO;AAErD,MAAI,WAAW,uBAAuB;AACpC,WAAO,OAAO,WAAW,KAAK,YAAY,sBAAsB;AAAA;AAGlE,MAAI,WAAW,iBAAiB;AAC9B,aAAS,oBAAoB,YAAY,gBAAgB,MAAM,SAAS;AAAA,SACnE;AACL,QAAI,CAAC;AAAgB,aAAO;AAC5B,WAAO,KAAK,WAAW,KAAK,CAAC,OAAO,eAAe,qBAAqB,MAAM,gBAAgB;AAAA;AAGhG,SAAO;AAAA;AAIT,IAAO,kCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,18 +23,18 @@ import { DSComboBox } from "@elliemae/ds-form";
|
|
|
23
23
|
class ComboBox extends Component {
|
|
24
24
|
constructor(props) {
|
|
25
25
|
super(props);
|
|
26
|
+
this.handleChange = (value) => {
|
|
27
|
+
const { onValue } = this.props;
|
|
28
|
+
setTimeout(() => onValue(value), 1);
|
|
29
|
+
this.setState({ value });
|
|
30
|
+
};
|
|
31
|
+
this.handleBlur = () => {
|
|
32
|
+
const { onValue } = this.props;
|
|
33
|
+
const { value } = this.state;
|
|
34
|
+
onValue(value);
|
|
35
|
+
};
|
|
26
36
|
this.state = { value: props.value };
|
|
27
37
|
}
|
|
28
|
-
handleChange(value) {
|
|
29
|
-
const { onValue } = this.props;
|
|
30
|
-
setTimeout(() => onValue(value), 1);
|
|
31
|
-
this.setState({ value });
|
|
32
|
-
}
|
|
33
|
-
handleBlur() {
|
|
34
|
-
const { onValue } = this.props;
|
|
35
|
-
const { value } = this.state;
|
|
36
|
-
onValue(value);
|
|
37
|
-
}
|
|
38
38
|
render() {
|
|
39
39
|
const { value } = this.state;
|
|
40
40
|
return /* @__PURE__ */ React2.createElement(DSComboBox, __spreadProps(__spreadValues({}, this.props), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/editable/EditableComponents/ComboBox.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,uBAAuB,UAAU;AAAA,EAK/B,YAAY,OAAO;AACjB,UAAM;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,uBAAuB,UAAU;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,qCAAC,YAAD,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
|
}
|
|
@@ -23,6 +23,27 @@ import { DSTextBox } from "@elliemae/ds-form";
|
|
|
23
23
|
class TextBox extends Component {
|
|
24
24
|
constructor(props) {
|
|
25
25
|
super(props);
|
|
26
|
+
this.handleKeyUp = ({ key, target: { value } }) => {
|
|
27
|
+
const { onValue } = this.props;
|
|
28
|
+
if (key === "Enter") {
|
|
29
|
+
onValue(value);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
this.handleKeyDown = (e) => {
|
|
33
|
+
if (e.key === "Enter") {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
this.handleBlur = (e) => {
|
|
38
|
+
const { onValue } = this.props;
|
|
39
|
+
const {
|
|
40
|
+
target: { value }
|
|
41
|
+
} = e;
|
|
42
|
+
onValue(value);
|
|
43
|
+
};
|
|
44
|
+
this.handleChange = ({ target: { value } }) => {
|
|
45
|
+
this.setState({ value });
|
|
46
|
+
};
|
|
26
47
|
this.inputRef = React2.createRef();
|
|
27
48
|
this.state = { value: props.value };
|
|
28
49
|
}
|
|
@@ -33,27 +54,6 @@ class TextBox extends Component {
|
|
|
33
54
|
}
|
|
34
55
|
}, 50);
|
|
35
56
|
}
|
|
36
|
-
handleKeyUp({ key, target: { value } }) {
|
|
37
|
-
const { onValue } = this.props;
|
|
38
|
-
if (key === "Enter") {
|
|
39
|
-
onValue(value);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
handleKeyDown(e) {
|
|
43
|
-
if (e.key === "Enter") {
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
handleBlur(e) {
|
|
48
|
-
const { onValue } = this.props;
|
|
49
|
-
const {
|
|
50
|
-
target: { value }
|
|
51
|
-
} = e;
|
|
52
|
-
onValue(value);
|
|
53
|
-
}
|
|
54
|
-
handleChange({ target: { value } }) {
|
|
55
|
-
this.setState({ value });
|
|
56
|
-
}
|
|
57
57
|
render() {
|
|
58
58
|
const { value } = this.state;
|
|
59
59
|
return /* @__PURE__ */ React2.createElement(DSTextBox, __spreadProps(__spreadValues({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/editable/EditableComponents/TextBox.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable react/static-property-placement */\nimport React, { Component } from 'react';\nimport { DSTextBox } from '@elliemae/ds-form';\n\n// todo: redo with hooks\nclass TextBox extends Component {\n static defaultProps = {\n onValue: () => null,\n };\n\n constructor(props) {\n super(props);\n this.inputRef = React.createRef();\n this.state = { value: props.value };\n }\n\n componentDidMount() {\n setTimeout(() => {\n if (this.inputRef && this.inputRef.current) {\n this.inputRef.current.focus();\n }\n }, 50);\n }\n\n handleKeyUp({ key, target: { value } }) {\n const { onValue } = this.props;\n if (key === 'Enter') {\n onValue(value);\n }\n }\n\n handleKeyDown(e) {\n // PUI-2553 prevent form submit on `Enter` keypress\n if (e.key === 'Enter') {\n e.preventDefault();\n }\n }\n\n handleBlur(e) {\n const { onValue } = this.props;\n const {\n target: { value },\n } = e;\n onValue(value);\n }\n\n handleChange({ target: { value } }) {\n this.setState({ value });\n }\n\n render() {\n const { value } = this.state;\n return (\n <DSTextBox\n data-testid=\"ds-datagrids-editable-text-box\"\n {...this.props}\n innerRef={this.inputRef}\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onClick={(e) => e.stopPropagation()}\n onKeyUp={this.handleKeyUp}\n onKeyDown={this.handleKeyDown}\n value={value}\n />\n );\n }\n}\n\nexport { TextBox };\nexport default TextBox;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AAGA,sBAAsB,UAAU;AAAA,EAK9B,YAAY,OAAO;AACjB,UAAM;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable react/static-property-placement */\nimport React, { Component } from 'react';\nimport { DSTextBox } from '@elliemae/ds-form';\n\n// todo: redo with hooks\nclass TextBox extends Component {\n static defaultProps = {\n onValue: () => null,\n };\n\n constructor(props) {\n super(props);\n this.inputRef = React.createRef();\n this.state = { value: props.value };\n }\n\n componentDidMount() {\n setTimeout(() => {\n if (this.inputRef && this.inputRef.current) {\n this.inputRef.current.focus();\n }\n }, 50);\n }\n\n handleKeyUp = ({ key, target: { value } }) => {\n const { onValue } = this.props;\n if (key === 'Enter') {\n onValue(value);\n }\n }\n\n handleKeyDown = (e) => {\n // PUI-2553 prevent form submit on `Enter` keypress\n if (e.key === 'Enter') {\n e.preventDefault();\n }\n }\n\n handleBlur = (e) => {\n const { onValue } = this.props;\n const {\n target: { value },\n } = e;\n onValue(value);\n }\n\n handleChange = ({ target: { value } }) => {\n this.setState({ value });\n }\n\n render() {\n const { value } = this.state;\n return (\n <DSTextBox\n data-testid=\"ds-datagrids-editable-text-box\"\n {...this.props}\n innerRef={this.inputRef}\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onClick={(e) => e.stopPropagation()}\n onKeyUp={this.handleKeyUp}\n onKeyDown={this.handleKeyDown}\n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from "react";
|
|
2
2
|
import { useDerivedStateFromProps, toggleInObject } from "@elliemae/ds-utilities";
|
|
3
|
-
import { createInstancePlugin } from "@elliemae/ds-shared
|
|
3
|
+
import { createInstancePlugin } from "@elliemae/ds-shared";
|
|
4
4
|
import { addEditableToCell, makeEditableConfig } from "./decorateEditable";
|
|
5
5
|
const registerStateHook = (grid) => {
|
|
6
6
|
const { rowKey = "id", editingRows: editingRowsProp, onColumnRowEdited, onColumnRowEdit } = grid.props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/editable/EditablePlugin.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useDerivedStateFromProps, toggleInObject } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useDerivedStateFromProps, toggleInObject } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { addEditableToCell, makeEditableConfig } from './decorateEditable';\n\nconst registerStateHook = (grid) => {\n const { rowKey = 'id', editingRows: editingRowsProp, onColumnRowEdited, onColumnRowEdit } = grid.props;\n const [editingRows, setEditingRows] = useDerivedStateFromProps(editingRowsProp || {});\n\n const activateEdit = (editParams) => {\n const { shouldRefocus } = grid.getInstance();\n const { rowData, columnIndex } = editParams;\n shouldRefocus.current = { forced: true, value: false };\n setEditingRows((prevEditingRows) => {\n onColumnRowEdit(editParams);\n return toggleInObject(prevEditingRows, rowData[rowKey], columnIndex);\n });\n };\n\n const editValue = ({ value, rowData, property, rowIndex }) => {\n setEditingRows({});\n onColumnRowEdited({\n value,\n rowData,\n property,\n rowIndex,\n });\n };\n\n return {\n state: { editingRows },\n actions: {\n activateEdit,\n editValue,\n },\n };\n};\n\nconst decorateColumn = (column, grid) => {\n const {\n props: { isColumnEditable = (col) => col.editable, customHandlers },\n } = grid;\n\n const editableConfig = makeEditableConfig(grid);\n\n return isColumnEditable(column)\n ? addEditableToCell(\n {\n column,\n config: editableConfig,\n handlers: customHandlers,\n },\n grid,\n )\n : column;\n};\n\nexport const EditablePlugin = createInstancePlugin('editable', {\n registerStateHook,\n decorateColumn,\n registerHotKeys(grid) {\n return {\n key: 'enter',\n handler: ({ rowIndex, cellIndex }) => {\n const {\n composedRows,\n decoratedColumns,\n actions: { activateEdit },\n props: { isColumnEditable },\n } = grid.getInstance();\n\n if (!isColumnEditable(decoratedColumns[cellIndex])) return;\n\n const rows = composedRows.rows || composedRows;\n const row = rows[rowIndex];\n if (!row) return;\n\n activateEdit({\n rowData: row,\n columnIndex: cellIndex,\n });\n },\n options: {\n keydown: false,\n keyup: true,\n },\n };\n },\n});\n"],
|
|
5
5
|
"mappings": "AAAA;ACAA;AACA;AACA;AAEA,MAAM,oBAAoB,CAAC,SAAS;AAClC,QAAM,EAAE,SAAS,MAAM,aAAa,iBAAiB,mBAAmB,oBAAoB,KAAK;AACjG,QAAM,CAAC,aAAa,kBAAkB,yBAAyB,mBAAmB;AAElF,QAAM,eAAe,CAAC,eAAe;AACnC,UAAM,EAAE,kBAAkB,KAAK;AAC/B,UAAM,EAAE,SAAS,gBAAgB;AACjC,kBAAc,UAAU,EAAE,QAAQ,MAAM,OAAO;AAC/C,mBAAe,CAAC,oBAAoB;AAClC,sBAAgB;AAChB,aAAO,eAAe,iBAAiB,QAAQ,SAAS;AAAA;AAAA;AAI5D,QAAM,YAAY,CAAC,EAAE,OAAO,SAAS,UAAU,eAAe;AAC5D,mBAAe;AACf,sBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAIJ,SAAO;AAAA,IACL,OAAO,EAAE;AAAA,IACT,SAAS;AAAA,MACP;AAAA,MACA;AAAA;AAAA;AAAA;AAKN,MAAM,iBAAiB,CAAC,QAAQ,SAAS;AACvC,QAAM;AAAA,IACJ,OAAO,EAAE,mBAAmB,CAAC,QAAQ,IAAI,UAAU;AAAA,MACjD;AAEJ,QAAM,iBAAiB,mBAAmB;AAE1C,SAAO,iBAAiB,UACpB,kBACE;AAAA,IACE;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,KAEZ,QAEF;AAAA;AAGC,MAAM,iBAAiB,qBAAqB,YAAY;AAAA,EAC7D;AAAA,EACA;AAAA,EACA,gBAAgB,MAAM;AACpB,WAAO;AAAA,MACL,KAAK;AAAA,MACL,SAAS,CAAC,EAAE,UAAU,gBAAgB;AACpC,cAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA,SAAS,EAAE;AAAA,UACX,OAAO,EAAE;AAAA,YACP,KAAK;AAET,YAAI,CAAC,iBAAiB,iBAAiB;AAAa;AAEpD,cAAM,OAAO,aAAa,QAAQ;AAClC,cAAM,MAAM,KAAK;AACjB,YAAI,CAAC;AAAK;AAEV,qBAAa;AAAA,UACX,SAAS;AAAA,UACT,aAAa;AAAA;AAAA;AAAA,MAGjB,SAAS;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -31,7 +31,7 @@ import React2 from "react";
|
|
|
31
31
|
import * as edit from "react-edit";
|
|
32
32
|
import { EditPencil } from "@elliemae/ds-icons";
|
|
33
33
|
import { cx } from "@elliemae/ds-utilities";
|
|
34
|
-
import { appendCellFormatter } from "@elliemae/ds-shared
|
|
34
|
+
import { appendCellFormatter } from "@elliemae/ds-shared";
|
|
35
35
|
import { getEditorComponent } from "./getEditorComponent";
|
|
36
36
|
const makeEditableConfig = (grid) => edit.edit({
|
|
37
37
|
isEditing: (_a) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/editable/decorateEditable.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport * as edit from 'react-edit';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { cx } from '@elliemae/ds-utilities';\nimport { appendCellFormatter } from '@elliemae/ds-shared
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport * as edit from 'react-edit';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { cx } from '@elliemae/ds-utilities';\nimport { appendCellFormatter } from '@elliemae/ds-shared';\nimport { getEditorComponent } from './getEditorComponent';\n\nconst makeEditableConfig = (grid) =>\n edit.edit({\n isEditing: ({ columnIndex, rowData, column = {}, ...rest }) => {\n const {\n state: { editingRows },\n props: { rowKey },\n } = grid.getInstance();\n let isCustomEditing;\n\n if (typeof column.isEditing === 'function') {\n isCustomEditing = column.isEditing({\n columnIndex,\n rowData,\n column,\n ...rest,\n });\n }\n return editingRows[rowData[rowKey]] === columnIndex || column.alwaysEditing || isCustomEditing;\n },\n onActivate: () => null,\n onValue: (...args) => grid.getInstance().actions.editValue(...args),\n });\nconst addEditableToCell = ({ column, config, handlers }, grid) => {\n column.cell.transforms.push(config(getEditorComponent(column.customEditor, handlers)));\n column.cell.props.className = cx(\n column.cell.props.className,\n `editable${column.customEditor ? ' customEditor' : ''}`,\n );\n return appendCellFormatter(\n [\n (value, extraParams) => (\n <>\n <div\n onClick={(e) => {\n e.stopPropagation();\n grid.getInstance().actions.activateEdit(extraParams);\n }}\n onKeyUp={(e) => {\n e.stopPropagation();\n if (e.keyCode === 33) {\n grid.getInstance().actions.activateEdit(extraParams);\n }\n }}\n role=\"gridcell\"\n tabIndex={0}\n >\n {value}\n <EditPencil className=\"edit-pencil\" />\n <span className=\"edit-separator\"> </span>\n </div>\n </>\n ),\n ],\n column,\n );\n};\n\nexport { makeEditableConfig, addEditableToCell };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA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
|
|
35
35
|
import { VariableSizeList } from "react-window";
|
|
36
36
|
import { ArrowheadDown, ArrowheadRight } from "@elliemae/ds-icons";
|
|
37
37
|
import { DSButton } from "@elliemae/ds-button";
|
|
38
|
-
import { createInstancePlugin } from "@elliemae/ds-shared
|
|
39
|
-
import { appendCellFormatter } from "@elliemae/ds-shared/useDataGrid/initColumnDefinition";
|
|
38
|
+
import { createInstancePlugin, appendCellFormatter } from "@elliemae/ds-shared";
|
|
40
39
|
import { ExpandedRow } from "./ExpandedRow";
|
|
41
40
|
import { ExpandedRowExtra } from "./ExpandedRowExtra";
|
|
42
41
|
import { RowSizes } from "../../rowSizes";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandablePlugin.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { cx, isFunction } from '@elliemae/ds-utilities';\nimport { VariableSizeList } from 'react-window';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { createInstancePlugin
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { cx, isFunction } from '@elliemae/ds-utilities';\nimport { VariableSizeList } from 'react-window';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { createInstancePlugin, appendCellFormatter } from '@elliemae/ds-shared';\nimport { ExpandedRow } from './ExpandedRow';\nimport { ExpandedRowExtra } from './ExpandedRowExtra';\nimport { RowSizes } from '../../rowSizes';\nimport { useExpandGridState } from './useExpandGridState';\n\nconst getExpandedRowSizeBySubrows = ({ totalAmount, amountVisible, isShowingAll, size = 36 }) =>\n isShowingAll ? size * (totalAmount + 1) - 6 : size * (amountVisible + 1) + 32;\n\nconst ExpandedRows = {\n SingleColumn: ExpandedRow,\n Master: ExpandedRowExtra,\n};\n\nconst createExpandedRow = (type) => ExpandedRows[type] || ExpandedRows.Master;\n\nconst isExpandableSingleColumn = (columns) => columns.some((column) => column.expandableColumn);\n\nexport const ExpandablePlugin = createInstancePlugin('expandable', {\n registerStateHook: useExpandGridState,\n decorateGrid(grid) {\n const { decoratedColumns, columns } = grid.getInstance();\n const detailColumns = useMemo(\n () =>\n decoratedColumns\n .map((column) => ({\n ...column,\n customRenderer: column.detailCustomRenderer,\n }))\n .filter((col) => !col.expandableColumn),\n [columns],\n );\n return {\n detailColumns,\n };\n },\n\n decorateColumns(columns, grid) {\n if (isExpandableSingleColumn(columns)) return columns;\n // get first column from user\n const firstColumnIndex = columns.findIndex((column) => column.isUserColumn);\n const firstColumn = columns[firstColumnIndex];\n firstColumn.formatExpandable = true;\n\n return [\n ...columns.slice(0, firstColumnIndex),\n appendCellFormatter((value, { isExpanded, rowData }) => {\n const {\n actions: { toggleExpand },\n } = grid.getInstance();\n /*\n * should return only 2 elements ../custom-cell-renderer/addCustomRendererToCell.js\n * getRenderer it's checking that length to apply the custom render to value only\n */\n return (\n <>\n <DSButton\n buttonType=\"text\"\n className=\"expandable-arrow\"\n icon={isExpanded ? <ArrowheadDown /> : <ArrowheadRight />}\n onClick={(e) => {\n e.stopPropagation();\n toggleExpand(rowData);\n }}\n size=\"s\"\n />\n {value}\n </>\n );\n }, firstColumn),\n ...columns.slice(firstColumnIndex + 1),\n ];\n },\n\n getBodyProps(bodyProps, grid) {\n const {\n composedRows: rows,\n props: {\n rowKey,\n getChildrenRows,\n rowSize = 'normal',\n subrowSize = 'normal',\n getExpandedRowMinSize,\n getExpandedRowSize,\n expandableSubrowsVisible,\n },\n state: { expandedRows },\n } = grid.getInstance();\n const rowSizePx = RowSizes[rowSize];\n const subrowSizePx = RowSizes[subrowSize];\n const listRef = useRef();\n\n useEffect(() => {\n if (listRef.current) listRef.current.resetAfterIndex(0, true);\n });\n\n // implementation of expandable row single column with aggregation\n const getItemSize = (index) => {\n const rowData = rows[index];\n const key = rowData[rowKey];\n const children = getChildrenRows({ rowData });\n\n const expandedSize = getExpandedRowSize\n ? getExpandedRowSize(index, { rowData }) // https://jira.elliemae.io/browse/PUI-1659\n : getExpandedRowSizeBySubrows({\n totalAmount: children.length,\n amountVisible: children.length > expandableSubrowsVisible ? expandableSubrowsVisible : children.length,\n isShowingAll:\n children.length < expandableSubrowsVisible || (expandedRows[key] && expandedRows[key].showAllRows),\n size: subrowSizePx,\n });\n\n const expandedMinSize = isFunction(getExpandedRowMinSize) && getExpandedRowMinSize(index);\n\n // eslint-disable-next-line no-nested-ternary\n return expandedRows[key] ? (expandedMinSize > expandedSize ? expandedMinSize : expandedSize) : rowSizePx;\n };\n\n return {\n ...bodyProps,\n className: cx(bodyProps.className, 'expandable'),\n listComponent: VariableSizeList,\n listProps: { ref: listRef, itemSize: getItemSize },\n };\n },\n\n decorateRenderers(renderers, grid) {\n const Row = renderers.body.row;\n const Cell = renderers.body.cell;\n\n // eslint-disable-next-line react/display-name\n renderers.body.row = useMemo(() => {\n // todo: the expandable grid should be created from another specific grid component\n const expandedRowType = isExpandableSingleColumn(grid.decoratedColumns) ? 'SingleColumn' : 'Master';\n const ExpandedRowComponent = createExpandedRow(expandedRowType);\n // eslint-disable-next-line react/display-name\n return ({ isExpanded, ...rowProps }) => {\n if (isExpanded) {\n const {\n props: { detailColumns, getChildrenRows, renderRowDetails },\n composedRows,\n } = grid.getInstance();\n // https://jira.elliemae.io/browse/PUI-1667\n const rowData = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;\n return (\n <ExpandedRowComponent\n cellComponent={Cell}\n detailColumns={detailColumns}\n parentGrid={grid}\n renderRowDetails={renderRowDetails}\n rowComponent={Row}\n rowData={rowData}\n rowProps={{\n rowData,\n isExpanded,\n ...rowProps,\n }}\n rows={getChildrenRows({ rowData })}\n >\n {rowProps.children}\n </ExpandedRowComponent>\n );\n }\n return <Row {...rowProps} />;\n };\n }, []);\n\n return renderers;\n },\n\n getRowProps(rowProps, grid, { rowData }) {\n const {\n props: { rowKey },\n state: { expandedRows },\n } = grid.getInstance();\n const key = rowData[rowKey];\n const isExpanded = !!expandedRows[key];\n return {\n ...rowProps,\n className: cx(\n rowProps.className,\n Object.keys(expandedRows).length > 0 && 'expandable-row',\n isExpanded && 'expanded',\n ),\n isExpanded,\n showAllRows: expandedRows[key] && expandedRows[key].showAllRows,\n };\n },\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,8BAA8B,CAAC,EAAE,aAAa,eAAe,cAAc,OAAO,SACtF,eAAe,OAAQ,eAAc,KAAK,IAAI,OAAQ,iBAAgB,KAAK;AAE7E,MAAM,eAAe;AAAA,EACnB,cAAc;AAAA,EACd,QAAQ;AAAA;AAGV,MAAM,oBAAoB,CAAC,SAAS,aAAa,SAAS,aAAa;AAEvE,MAAM,2BAA2B,CAAC,YAAY,QAAQ,KAAK,CAAC,WAAW,OAAO;AAEvE,MAAM,mBAAmB,qBAAqB,cAAc;AAAA,EACjE,mBAAmB;AAAA,EACnB,aAAa,MAAM;AACjB,UAAM,EAAE,kBAAkB,YAAY,KAAK;AAC3C,UAAM,gBAAgB,QACpB,MACE,iBACG,IAAI,CAAC,WAAY,iCACb,SADa;AAAA,MAEhB,gBAAgB,OAAO;AAAA,QAExB,OAAO,CAAC,QAAQ,CAAC,IAAI,mBAC1B,CAAC;AAEH,WAAO;AAAA,MACL;AAAA;AAAA;AAAA,EAIJ,gBAAgB,SAAS,MAAM;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T,SAAS,WACT,OAAO,KAAK,cAAc,SAAS,KAAK,kBACxC,cAAc;AAAA,MAEhB;AAAA,MACA,aAAa,aAAa,QAAQ,aAAa,KAAK;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,8 +35,7 @@ import { DSSeparator } from "@elliemae/ds-separator";
|
|
|
35
35
|
import { DSButton } from "@elliemae/ds-button";
|
|
36
36
|
import styled from "styled-components";
|
|
37
37
|
import { get } from "@elliemae/ds-utilities";
|
|
38
|
-
import { deferComponentRender } from "@elliemae/ds-shared
|
|
39
|
-
import { useDataGrid } from "@elliemae/ds-shared/useDataGrid";
|
|
38
|
+
import { deferComponentRender, useDataGrid } from "@elliemae/ds-shared";
|
|
40
39
|
import { PaginationPlugin } from "../pagination";
|
|
41
40
|
import { BodyCell } from "../../components/BodyCell";
|
|
42
41
|
import { defaultRenderers } from "../../components/renderers";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandedRow.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport { DSSeparator } from '@elliemae/ds-separator';\nimport { DSButton } from '@elliemae/ds-button';\nimport styled from 'styled-components';\nimport { get } from '@elliemae/ds-utilities';\nimport { deferComponentRender
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport { DSSeparator } from '@elliemae/ds-separator';\nimport { DSButton } from '@elliemae/ds-button';\nimport styled from 'styled-components';\nimport { get } from '@elliemae/ds-utilities';\nimport { deferComponentRender, useDataGrid } from '@elliemae/ds-shared';\nimport { PaginationPlugin } from '../pagination';\nimport { BodyCell } from '../../components/BodyCell';\nimport { defaultRenderers } from '../../components/renderers';\nimport { TableBody } from '../../components/TableBody';\nimport { Table } from '../../components/Table';\nimport { ColumnSizingPlugin } from '../column-sizing';\n\nconst DetailGrid = deferComponentRender(({ parentGrid, parentRowData, rows }) => {\n const { instanceRef, ...parentProps } = parentGrid.props;\n const grid = useDataGrid({\n uuid: parentGrid.getInstance().uuid,\n ...parentProps,\n columns: parentGrid\n .getInstance()\n .decoratedColumns.filter((col) => !col.expandableColumn)\n .map((c) => ({ ...c, expandableColumn: false })),\n rows,\n plugins: [ColumnSizingPlugin, PaginationPlugin],\n renderers: defaultRenderers,\n bindColumnsSizeTo: parentGrid.uuid,\n numRowsVisible: 'all',\n paginated: true,\n pagination: {\n perPage: rows.length,\n conditionalPagination: true,\n },\n parentRowData,\n });\n\n return (\n <Table {...grid}>\n <TableBody />\n </Table>\n );\n}, null);\n\nconst DetailsWrapper = styled.span`\n flex: 1;\n width: ${(props) => props.width}px;\n`;\n\nconst DetailGridWrapper = styled.div`\n display: flex;\n height: calc(100% - ${(props) => (props.allRowsVisible ? 18 : 60)}px);\n width: ${(props) => props.expandableGridDetailWidth}px;\n margin: 12px 0;\n`;\n\nfunction ExpandedRow({\n parentGrid,\n detailColumns,\n rowData,\n rows,\n rowProps,\n cellComponent: CellComponent,\n rowComponent: RowComponent,\n}) {\n const {\n decoratedColumns,\n actions: { toggleShowAllRows },\n state: { expandedRows },\n props: {\n rowKey,\n showMoreRowsText = 'SHOW ALL ROWS',\n showLessRowsText = 'SHOW LESS ROWS',\n expandableSubrowsVisible,\n },\n columnSizeService: { expandableGridDetailWidth },\n } = parentGrid.getInstance();\n\n const { showAllRows, ...restRowProps } = rowProps;\n return (\n <RowComponent {...restRowProps}>\n <BodyCell\n column={decoratedColumns[0]}\n columnIndex={0}\n component={CellComponent}\n grid={parentGrid}\n rowProps={{ rowData, ...rowProps }}\n />\n <DetailsWrapper width={expandableGridDetailWidth}>\n <DetailGridWrapper\n allRowsVisible={rows.length < expandableSubrowsVisible || get(expandedRows, [rowKey, 'showAllRows'])}\n expandableGridDetailWidth={expandableGridDetailWidth}\n >\n <DSSeparator dashed orientation=\"vertical\" />\n <DetailGrid\n detailColumns={detailColumns}\n parentGrid={parentGrid.getInstance()}\n parentRowData={rowData}\n rows={showAllRows ? rows : (rows || []).slice(0, expandableSubrowsVisible)}\n />\n </DetailGridWrapper>\n {rows.length > expandableSubrowsVisible && (\n <DSButton\n buttonType=\"text\"\n labelText={showAllRows ? showLessRowsText : showMoreRowsText}\n onClick={(e) => {\n e.stopPropagation();\n toggleShowAllRows(rowData);\n }}\n style={{ marginBottom: '10px' }}\n />\n )}\n </DetailsWrapper>\n </RowComponent>\n );\n}\n\nexport { ExpandedRow };\nexport default ExpandedRow;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,aAAa,qBAAqB,CAAC,EAAE,YAAY,eAAe,WAAW;AAC/E,QAAwC,gBAAW,OAA3C,kBAAgC,IAAhB,wBAAgB,IAAhB,CAAhB;AACR,QAAM,OAAO,YAAY;AAAA,IACvB,MAAM,WAAW,cAAc;AAAA,KAC5B,cAFoB;AAAA,IAGvB,SAAS,WACN,cACA,iBAAiB,OAAO,CAAC,QAAQ,CAAC,IAAI,kBACtC,IAAI,CAAC,MAAO,iCAAK,IAAL,EAAQ,kBAAkB;AAAA,IACzC;AAAA,IACA,SAAS,CAAC,oBAAoB;AAAA,IAC9B,WAAW;AAAA,IACX,mBAAmB,WAAW;AAAA,IAC9B,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,YAAY;AAAA,MACV,SAAS,KAAK;AAAA,MACd,uBAAuB;AAAA;AAAA,IAEzB;AAAA;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,SAAS,CAAC,MAAM;AACd,QAAE;AACF,wBAAkB;AAAA;AAAA,IAEpB,OAAO,EAAE,cAAc;AAAA;AAAA;AASnC,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -16,7 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
};
|
|
17
17
|
import * as React from "react";
|
|
18
18
|
import { get } from "@elliemae/ds-utilities";
|
|
19
|
-
import { createInstancePlugin } from "@elliemae/ds-shared
|
|
19
|
+
import { createInstancePlugin } from "@elliemae/ds-shared";
|
|
20
20
|
const isVisible = (column) => {
|
|
21
21
|
if (typeof column === "undefined") {
|
|
22
22
|
return false;
|