@elliemae/ds-data-table 3.9.1-rc.8 → 3.9.1
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/DataTableSchema.js +1 -0
- package/dist/cjs/DataTableSchema.js.map +2 -2
- package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js +4 -6
- package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +2 -2
- package/dist/cjs/configs/useRowFlattenization.js +5 -2
- package/dist/cjs/configs/useRowFlattenization.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js +39 -57
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/index.js +6 -3
- package/dist/cjs/exported-related/RowRenderer/index.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js.map +1 -1
- package/dist/cjs/exported-related/RowRenderer/useRowStyle.js +3 -1
- package/dist/cjs/exported-related/RowRenderer/useRowStyle.js.map +2 -2
- package/dist/cjs/parts/DropIndicator.js +9 -7
- package/dist/cjs/parts/DropIndicator.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderCellGroup.js +2 -1
- package/dist/cjs/parts/Headers/HeaderCellGroup.js.map +2 -2
- package/dist/cjs/parts/HoC/DnDTreeContext.js +33 -0
- package/dist/cjs/parts/HoC/DnDTreeContext.js.map +7 -0
- package/dist/cjs/parts/HoC/SortableItemContext.js.map +1 -1
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +34 -26
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withDnDSortableRowContext.js +4 -3
- package/dist/cjs/parts/HoC/withDnDSortableRowContext.js.map +2 -2
- package/dist/cjs/parts/RowVariants/types.js.map +1 -1
- package/dist/cjs/parts/Rows.js +3 -2
- package/dist/cjs/parts/Rows.js.map +2 -2
- package/dist/cjs/styled.js +4 -4
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types/props.js.map +2 -2
- package/dist/esm/DataTableSchema.js +1 -0
- package/dist/esm/DataTableSchema.js.map +2 -2
- package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js +4 -6
- package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +2 -2
- package/dist/esm/configs/useRowFlattenization.js +5 -2
- package/dist/esm/configs/useRowFlattenization.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js +39 -57
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/index.js +6 -3
- package/dist/esm/exported-related/RowRenderer/index.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js.map +1 -1
- package/dist/esm/exported-related/RowRenderer/useRowStyle.js +3 -1
- package/dist/esm/exported-related/RowRenderer/useRowStyle.js.map +2 -2
- package/dist/esm/parts/DropIndicator.js +9 -7
- package/dist/esm/parts/DropIndicator.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderCellGroup.js +2 -1
- package/dist/esm/parts/Headers/HeaderCellGroup.js.map +2 -2
- package/dist/esm/parts/HoC/DnDTreeContext.js +7 -0
- package/dist/esm/parts/HoC/DnDTreeContext.js.map +7 -0
- package/dist/esm/parts/HoC/SortableItemContext.js.map +1 -1
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +34 -26
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/esm/parts/HoC/withDnDSortableRowContext.js +4 -3
- package/dist/esm/parts/HoC/withDnDSortableRowContext.js.map +2 -2
- package/dist/esm/parts/Rows.js +4 -3
- package/dist/esm/parts/Rows.js.map +2 -2
- package/dist/esm/styled.js +4 -4
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/types/props.js.map +2 -2
- package/package.json +18 -18
|
@@ -172,6 +172,7 @@ const DataTableSchema = {
|
|
|
172
172
|
maxDragAndDropLevel: import_ds_utilities.PropTypes.number.description("Which level is the maximum allowed to drop into"),
|
|
173
173
|
dragAndDropColumns: import_ds_utilities.PropTypes.bool.description("Whether to turn on the d&d feature for the columns"),
|
|
174
174
|
onColumnsReorder: import_ds_utilities.PropTypes.func.description("Function invoked when a column is reordered"),
|
|
175
|
+
getIsDropValid: import_ds_utilities.PropTypes.func.description("Function to determine if a drop is valid"),
|
|
175
176
|
textWrap: textWrappingType.description("Global wrapping rule"),
|
|
176
177
|
noResultsMessage: import_ds_utilities.PropTypes.string.description("Message to show when no more data is available"),
|
|
177
178
|
noResultsSecondaryMessage: import_ds_utilities.PropTypes.string.description("Secondary message to show when no more data is available"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DataTableSchema.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { WeakValidationMap } from 'react';\n\nconst outOfTheBoxFilterType = PropTypes.oneOf([\n 'ds-filter-select',\n 'ds-filter-multi-select',\n 'ds-filter-single-date',\n 'ds-filter-date-range',\n 'ds-filter-number-range',\n]);\n\nconst textWrappingType = PropTypes.oneOf(['wrap', 'wrap-all', 'truncate']);\n\nconst columnPropTypes = {\n Header: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.element]).description(\n 'Header name or component',\n ).isRequired,\n accessor: PropTypes.string.description('The entry of the data that this column will display'),\n id: PropTypes.string.description('The id of the column, will default to the Header or accessor if not present'),\n filter: outOfTheBoxFilterType.description('out-of-the-box filters'),\n Filter: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'The custom component to render as a filter',\n ),\n Cell: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('The custom cell renderer component'),\n editable: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.element]).description(\n 'The editable out-of-the-box or component to render',\n ),\n disableDnD: PropTypes.bool.description('Whereas this column should be draggable'),\n canResize: PropTypes.bool.description('Whereas this column should be resizable'),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Width of this column'),\n minWidth: PropTypes.number.description('Minimum width of this column, useful when resizing'),\n maxWidth: PropTypes.number.description('Maximum width of this column, useful when resizing'),\n canSort: PropTypes.bool.description('Whereas this column is sortable'),\n isSortedDesc: PropTypes.bool.description('Whereas this column is sorted descendingly'),\n required: PropTypes.bool.description('Whereas this column is required'),\n alwaysDisplayEditIcon: PropTypes.bool.description(\n 'Whereas to always show the edit icon on this column if it is editable',\n ),\n textWrap: textWrappingType.description('How to wrap the text in the column'),\n};\n\nconst columnsPropTypes = PropTypes.shape(columnPropTypes).description('Columns props');\n\nconst rowPropTypes = {\n tableRowDetails: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description('Component for row details'),\n dimsumHeaderValue: PropTypes.string.description('Header displayed on the header variant of the row'),\n};\n\nconst rowsPropTypes = PropTypes.shape(rowPropTypes).description('Rows props');\n\nexport const DataTableSchema = {\n columns: PropTypes.arrayOf(columnsPropTypes).description('Array of columns').isRequired,\n data: PropTypes.arrayOf(rowsPropTypes).description('Array of rows'),\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Height of the datatable component'),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Width of the datatable component'),\n renderRowActions: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]).description(\n 'The renderer to use for the action toolbar',\n ),\n isExpandable: PropTypes.bool.description('Whether the datatable is expandable').defaultValue(false),\n uniqueRowAccessor: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.func,\n ]).description(\n 'Column / Combination of columns / Function to call to produce a unique identifier for each row.' +\n ' This is necessary for the selectable and drag and drop features',\n ),\n disabledRows: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is disabled or not',\n ),\n expandedRows: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is expanded or not',\n ),\n onRowExpand: PropTypes.func.description('Function invoked when a row is (un)expanded'),\n cellRendererProps: PropTypes.object.description(\n 'Object with all the props you want the cells to have available when rendering',\n ),\n selectSingle: PropTypes.bool.description('Whether the selectable feature is single').defaultValue(false),\n selection: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is selected or not',\n ),\n onSelectionChange: PropTypes.func.description('Function invoked when a row is selected'),\n groupedRowsRenderHeader: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).description(\n 'String | Function to call which will display in the row headers',\n ),\n isResizeable: PropTypes.bool.description(\"Whether the datatable's columns are resizeable\"),\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n type: PropTypes.string,\n value: PropTypes.any,\n }),\n ).description('Array of filter keys and values'),\n withFilterBar: PropTypes.bool.description('Whether to display the filter bar'),\n filterBarProps: PropTypes.shape({\n filterBarAddonRenderer: PropTypes.func.description('Render filterbar right addon component'),\n customPillRenderer: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'If you specify custom filters, you will need to render their pills here',\n ),\n isDropdownMenuOpen: PropTypes.bool.description('Wether the DropdownMenu is Open or not.'),\n onDropdownMenuToggle: PropTypes.func.description('Callback to toggle the DropdownMenu.'),\n onClearAllFiltersClick: PropTypes.func.description('Callback for Clear Al Filters option.'),\n onDropdownMenuClickOutside: PropTypes.func.description('Callback triggered when clicking outside DropdownMenu.'),\n onDropdownMenuTriggerClick: PropTypes.func.description('Callback triggered when clicking DropdownMenu ellipsis.'),\n extraOptions: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n }),\n ).description('Any extra option you want in the dropdownmenu of the filter bar'),\n }).description('Props for the filter bar'),\n onFiltersChange: PropTypes.func.description('Function invoked when filters change'),\n pagination: PropTypes.oneOfType([\n PropTypes.oneOf([false]),\n PropTypes.shape({\n pageCount: PropTypes.number.description('How many pages are there'),\n pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),\n canPreviousPage: PropTypes.bool.description('Whether the previous button is disabled or not').defaultValue(true),\n canNextPage: PropTypes.bool.description('Whether the next button is disabled or not').defaultValue(true),\n pageSize: PropTypes.number.description('The current page size').defaultValue(10),\n showPerPageSelector: PropTypes.bool.description('Whether to show the page selector').defaultValue(true),\n perPageOptions: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.number,\n PropTypes.shape({\n dsId: PropTypes.string,\n value: PropTypes.number,\n label: PropTypes.string,\n type: PropTypes.oneOf(['single']),\n }),\n ]),\n )\n .description('The available options for page size')\n .defaultValue([10]),\n perPageStep: PropTypes.number.description('Step for the per page options').defaultValue(5),\n minPerPage: PropTypes.number.description('Step for the per page options').defaultValue(0),\n maxPerPage: PropTypes.number.description('Step for the per page options').defaultValue(100),\n onPageSizeChange: PropTypes.func\n .description('Function invoked when the page size changes')\n .defaultValue(() => null),\n onPreviousPage: PropTypes.func\n .description('Function invoked when the previous button is pressed')\n .defaultValue(() => null),\n onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),\n onNextPage: PropTypes.func.description('Function invoked when next button is pressed').defaultValue(() => null),\n pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),\n dataIsPage: PropTypes.bool.description('Whether to treat data as a page').defaultValue(false),\n pageDetailsTitle: PropTypes.string\n .description('The title of the details (usually a column of your dataset)')\n .defaultValue(''),\n }),\n ]).description('Object containing the data for the pagination'),\n colsLayoutStyle: PropTypes.oneOf(['auto', 'fixed']).description('Whether the datatable fills its container or not'),\n hiddenColumns: PropTypes.arrayOf(PropTypes.string).description('IDs of columns not to render'),\n dragAndDropRows: PropTypes.bool.description('Whether to turn on the d&d feature for the rows').defaultValue(false),\n onRowsReorder: PropTypes.func.description('Function invoked when a row is reordered'),\n maxDragAndDropLevel: PropTypes.number.description('Which level is the maximum allowed to drop into'),\n dragAndDropColumns: PropTypes.bool.description('Whether to turn on the d&d feature for the columns'),\n onColumnsReorder: PropTypes.func.description('Function invoked when a column is reordered'),\n textWrap: textWrappingType.description('Global wrapping rule'),\n noResultsMessage: PropTypes.string.description('Message to show when no more data is available'),\n noResultsSecondaryMessage: PropTypes.string.description('Secondary message to show when no more data is available'),\n noResultsButtonLabel: PropTypes.string.description('Label of the button when no more data is available'),\n noResultsPlaceholder: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'Custom content to show when dataset is empty',\n ),\n isLoading: PropTypes.bool.description('Whether to show a global loader in the datatable'),\n onColumnResize: PropTypes.func\n .description('Function invoked when a column is resized')\n .deprecated({ version: '4.x', message: 'Use onColumnSizeChange' }),\n onColumnSizeChange: PropTypes.func.description('Function invoked when a column is resized'),\n onRowClick: PropTypes.func.description('Function invoked when clicking a row'),\n onRowFocus: PropTypes.func.description('Function invoked when focusing a row'),\n onCellValueChange: PropTypes.func.description(\"Function invoked when an editable cell's content is changed\"),\n onColumnSortChange: PropTypes.func\n .description('Function invoked when a column is sorted')\n .deprecated({ version: '4.x', message: 'Use onColumnSort' }),\n onColumnSort: PropTypes.func.description('Function invoked when a column is sorted'),\n actionRef: PropTypes.object.description('Reference where all the exposed action callbacks will be exposed'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA0B;AAG1B,MAAM,wBAAwB,8BAAU,MAAM;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,mBAAmB,8BAAU,MAAM,CAAC,QAAQ,YAAY,UAAU,CAAC;AAEzE,MAAM,kBAAkB;AAAA,EACt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AU,KAAK,YAAY,0CAA0C;AAAA,EACnF,WAAW,8BAAU,OAAO,YAAY,kEAAkE;AAC5G;",
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { PropTypes } from '@elliemae/ds-utilities';\nimport { WeakValidationMap } from 'react';\n\nconst outOfTheBoxFilterType = PropTypes.oneOf([\n 'ds-filter-select',\n 'ds-filter-multi-select',\n 'ds-filter-single-date',\n 'ds-filter-date-range',\n 'ds-filter-number-range',\n]);\n\nconst textWrappingType = PropTypes.oneOf(['wrap', 'wrap-all', 'truncate']);\n\nconst columnPropTypes = {\n Header: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.element]).description(\n 'Header name or component',\n ).isRequired,\n accessor: PropTypes.string.description('The entry of the data that this column will display'),\n id: PropTypes.string.description('The id of the column, will default to the Header or accessor if not present'),\n filter: outOfTheBoxFilterType.description('out-of-the-box filters'),\n Filter: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'The custom component to render as a filter',\n ),\n Cell: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('The custom cell renderer component'),\n editable: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.element]).description(\n 'The editable out-of-the-box or component to render',\n ),\n disableDnD: PropTypes.bool.description('Whereas this column should be draggable'),\n canResize: PropTypes.bool.description('Whereas this column should be resizable'),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Width of this column'),\n minWidth: PropTypes.number.description('Minimum width of this column, useful when resizing'),\n maxWidth: PropTypes.number.description('Maximum width of this column, useful when resizing'),\n canSort: PropTypes.bool.description('Whereas this column is sortable'),\n isSortedDesc: PropTypes.bool.description('Whereas this column is sorted descendingly'),\n required: PropTypes.bool.description('Whereas this column is required'),\n alwaysDisplayEditIcon: PropTypes.bool.description(\n 'Whereas to always show the edit icon on this column if it is editable',\n ),\n textWrap: textWrappingType.description('How to wrap the text in the column'),\n};\n\nconst columnsPropTypes = PropTypes.shape(columnPropTypes).description('Columns props');\n\nconst rowPropTypes = {\n tableRowDetails: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description('Component for row details'),\n dimsumHeaderValue: PropTypes.string.description('Header displayed on the header variant of the row'),\n};\n\nconst rowsPropTypes = PropTypes.shape(rowPropTypes).description('Rows props');\n\nexport const DataTableSchema = {\n columns: PropTypes.arrayOf(columnsPropTypes).description('Array of columns').isRequired,\n data: PropTypes.arrayOf(rowsPropTypes).description('Array of rows'),\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Height of the datatable component'),\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Width of the datatable component'),\n renderRowActions: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]).description(\n 'The renderer to use for the action toolbar',\n ),\n isExpandable: PropTypes.bool.description('Whether the datatable is expandable').defaultValue(false),\n uniqueRowAccessor: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.func,\n ]).description(\n 'Column / Combination of columns / Function to call to produce a unique identifier for each row.' +\n ' This is necessary for the selectable and drag and drop features',\n ),\n disabledRows: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is disabled or not',\n ),\n expandedRows: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is expanded or not',\n ),\n onRowExpand: PropTypes.func.description('Function invoked when a row is (un)expanded'),\n cellRendererProps: PropTypes.object.description(\n 'Object with all the props you want the cells to have available when rendering',\n ),\n selectSingle: PropTypes.bool.description('Whether the selectable feature is single').defaultValue(false),\n selection: PropTypes.object.description(\n 'Object with the identifiers of the rows as keys, and booleans as values. Specifies if a row is selected or not',\n ),\n onSelectionChange: PropTypes.func.description('Function invoked when a row is selected'),\n groupedRowsRenderHeader: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).description(\n 'String | Function to call which will display in the row headers',\n ),\n isResizeable: PropTypes.bool.description(\"Whether the datatable's columns are resizeable\"),\n filters: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n type: PropTypes.string,\n value: PropTypes.any,\n }),\n ).description('Array of filter keys and values'),\n withFilterBar: PropTypes.bool.description('Whether to display the filter bar'),\n filterBarProps: PropTypes.shape({\n filterBarAddonRenderer: PropTypes.func.description('Render filterbar right addon component'),\n customPillRenderer: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'If you specify custom filters, you will need to render their pills here',\n ),\n isDropdownMenuOpen: PropTypes.bool.description('Wether the DropdownMenu is Open or not.'),\n onDropdownMenuToggle: PropTypes.func.description('Callback to toggle the DropdownMenu.'),\n onClearAllFiltersClick: PropTypes.func.description('Callback for Clear Al Filters option.'),\n onDropdownMenuClickOutside: PropTypes.func.description('Callback triggered when clicking outside DropdownMenu.'),\n onDropdownMenuTriggerClick: PropTypes.func.description('Callback triggered when clicking DropdownMenu ellipsis.'),\n extraOptions: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.string,\n id: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n }),\n ).description('Any extra option you want in the dropdownmenu of the filter bar'),\n }).description('Props for the filter bar'),\n onFiltersChange: PropTypes.func.description('Function invoked when filters change'),\n pagination: PropTypes.oneOfType([\n PropTypes.oneOf([false]),\n PropTypes.shape({\n pageCount: PropTypes.number.description('How many pages are there'),\n pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),\n canPreviousPage: PropTypes.bool.description('Whether the previous button is disabled or not').defaultValue(true),\n canNextPage: PropTypes.bool.description('Whether the next button is disabled or not').defaultValue(true),\n pageSize: PropTypes.number.description('The current page size').defaultValue(10),\n showPerPageSelector: PropTypes.bool.description('Whether to show the page selector').defaultValue(true),\n perPageOptions: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.number,\n PropTypes.shape({\n dsId: PropTypes.string,\n value: PropTypes.number,\n label: PropTypes.string,\n type: PropTypes.oneOf(['single']),\n }),\n ]),\n )\n .description('The available options for page size')\n .defaultValue([10]),\n perPageStep: PropTypes.number.description('Step for the per page options').defaultValue(5),\n minPerPage: PropTypes.number.description('Step for the per page options').defaultValue(0),\n maxPerPage: PropTypes.number.description('Step for the per page options').defaultValue(100),\n onPageSizeChange: PropTypes.func\n .description('Function invoked when the page size changes')\n .defaultValue(() => null),\n onPreviousPage: PropTypes.func\n .description('Function invoked when the previous button is pressed')\n .defaultValue(() => null),\n onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),\n onNextPage: PropTypes.func.description('Function invoked when next button is pressed').defaultValue(() => null),\n pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),\n dataIsPage: PropTypes.bool.description('Whether to treat data as a page').defaultValue(false),\n pageDetailsTitle: PropTypes.string\n .description('The title of the details (usually a column of your dataset)')\n .defaultValue(''),\n }),\n ]).description('Object containing the data for the pagination'),\n colsLayoutStyle: PropTypes.oneOf(['auto', 'fixed']).description('Whether the datatable fills its container or not'),\n hiddenColumns: PropTypes.arrayOf(PropTypes.string).description('IDs of columns not to render'),\n dragAndDropRows: PropTypes.bool.description('Whether to turn on the d&d feature for the rows').defaultValue(false),\n onRowsReorder: PropTypes.func.description('Function invoked when a row is reordered'),\n maxDragAndDropLevel: PropTypes.number.description('Which level is the maximum allowed to drop into'),\n dragAndDropColumns: PropTypes.bool.description('Whether to turn on the d&d feature for the columns'),\n onColumnsReorder: PropTypes.func.description('Function invoked when a column is reordered'),\n getIsDropValid: PropTypes.func.description('Function to determine if a drop is valid'),\n textWrap: textWrappingType.description('Global wrapping rule'),\n noResultsMessage: PropTypes.string.description('Message to show when no more data is available'),\n noResultsSecondaryMessage: PropTypes.string.description('Secondary message to show when no more data is available'),\n noResultsButtonLabel: PropTypes.string.description('Label of the button when no more data is available'),\n noResultsPlaceholder: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).description(\n 'Custom content to show when dataset is empty',\n ),\n isLoading: PropTypes.bool.description('Whether to show a global loader in the datatable'),\n onColumnResize: PropTypes.func\n .description('Function invoked when a column is resized')\n .deprecated({ version: '4.x', message: 'Use onColumnSizeChange' }),\n onColumnSizeChange: PropTypes.func.description('Function invoked when a column is resized'),\n onRowClick: PropTypes.func.description('Function invoked when clicking a row'),\n onRowFocus: PropTypes.func.description('Function invoked when focusing a row'),\n onCellValueChange: PropTypes.func.description(\"Function invoked when an editable cell's content is changed\"),\n onColumnSortChange: PropTypes.func\n .description('Function invoked when a column is sorted')\n .deprecated({ version: '4.x', message: 'Use onColumnSort' }),\n onColumnSort: PropTypes.func.description('Function invoked when a column is sorted'),\n actionRef: PropTypes.object.description('Reference where all the exposed action callbacks will be exposed'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA0B;AAG1B,MAAM,wBAAwB,8BAAU,MAAM;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,mBAAmB,8BAAU,MAAM,CAAC,QAAQ,YAAY,UAAU,CAAC;AAEzE,MAAM,kBAAkB;AAAA,EACtB,QAAQ,8BAAU,UAAU,CAAC,8BAAU,QAAQ,8BAAU,MAAM,8BAAU,OAAO,CAAC,EAAE;AAAA,IACjF;AAAA,EACF,EAAE;AAAA,EACF,UAAU,8BAAU,OAAO,YAAY,qDAAqD;AAAA,EAC5F,IAAI,8BAAU,OAAO,YAAY,6EAA6E;AAAA,EAC9G,QAAQ,sBAAsB,YAAY,wBAAwB;AAAA,EAClE,QAAQ,8BAAU,UAAU,CAAC,8BAAU,MAAM,8BAAU,OAAO,CAAC,EAAE;AAAA,IAC/D;AAAA,EACF;AAAA,EACA,MAAM,8BAAU,UAAU,CAAC,8BAAU,QAAQ,8BAAU,IAAI,CAAC,EAAE,YAAY,oCAAoC;AAAA,EAC9G,UAAU,8BAAU,UAAU,CAAC,8BAAU,QAAQ,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AC1F,gBAAgB,8BAAU,KAAK,YAAY,0CAA0C;AAAA,EACrF,UAAU,iBAAiB,YAAY,sBAAsB;AAAA,EAC7D,kBAAkB,8BAAU,OAAO,YAAY,gDAAgD;AAAA,EAC/F,2BAA2B,8BAAU,OAAO,YAAY,0DAA0D;AAAA,EAClH,sBAAsB,8BAAU,OAAO,YAAY,oDAAoD;AAAA,EACvG,sBAAsB,8BAAU,UAAU,CAAC,8BAAU,MAAM,8BAAU,OAAO,CAAC,EAAE;AAAA,IAC7E;AAAA,EACF;AAAA,EACA,WAAW,8BAAU,KAAK,YAAY,kDAAkD;AAAA,EACxF,gBAAgB,8BAAU,KACvB,YAAY,2CAA2C,EACvD,WAAW,EAAE,SAAS,OAAO,SAAS,yBAAyB,CAAC;AAAA,EACnE,oBAAoB,8BAAU,KAAK,YAAY,2CAA2C;AAAA,EAC1F,YAAY,8BAAU,KAAK,YAAY,sCAAsC;AAAA,EAC7E,YAAY,8BAAU,KAAK,YAAY,sCAAsC;AAAA,EAC7E,mBAAmB,8BAAU,KAAK,YAAY,6DAA6D;AAAA,EAC3G,oBAAoB,8BAAU,KAC3B,YAAY,0CAA0C,EACtD,WAAW,EAAE,SAAS,OAAO,SAAS,mBAAmB,CAAC;AAAA,EAC7D,cAAc,8BAAU,KAAK,YAAY,0CAA0C;AAAA,EACnF,WAAW,8BAAU,OAAO,YAAY,kEAAkE;AAC5G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -56,7 +56,7 @@ const multiSelectColumn = {
|
|
|
56
56
|
}, {});
|
|
57
57
|
}, [newGlobalStateAfterToggle, allDataFlattened, disabledRows]);
|
|
58
58
|
const onChangeHandler = (0, import_react.useCallback)(
|
|
59
|
-
(e) => {
|
|
59
|
+
(newState, e) => {
|
|
60
60
|
onSelectionChange(newSelection, "All", e);
|
|
61
61
|
},
|
|
62
62
|
[newSelection, onSelectionChange]
|
|
@@ -81,14 +81,13 @@ const multiSelectColumn = {
|
|
|
81
81
|
const { uid } = row;
|
|
82
82
|
const selectedState = selection?.[uid] ?? false;
|
|
83
83
|
const onChangeHandler = (0, import_react.useCallback)(
|
|
84
|
-
(e) => {
|
|
85
|
-
const newState = !selectedState;
|
|
84
|
+
(newState, e) => {
|
|
86
85
|
const newSelection = { ...selection, [uid]: newState };
|
|
87
86
|
if (!newState)
|
|
88
87
|
delete newSelection[uid];
|
|
89
88
|
onSelectionChange(newSelection, uid, e);
|
|
90
89
|
},
|
|
91
|
-
[onSelectionChange,
|
|
90
|
+
[onSelectionChange, selection, uid]
|
|
92
91
|
);
|
|
93
92
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
94
93
|
role: "presentation",
|
|
@@ -101,8 +100,7 @@ const multiSelectColumn = {
|
|
|
101
100
|
"aria-checked": selectedState,
|
|
102
101
|
"aria-disabled": false,
|
|
103
102
|
checked: selectedState,
|
|
104
|
-
|
|
105
|
-
onChange: (_, e) => e.stopPropagation(),
|
|
103
|
+
onChange: onChangeHandler,
|
|
106
104
|
disabled: disabledRows[row.uid],
|
|
107
105
|
innerRef: cell.ref,
|
|
108
106
|
tabIndex: isRowSelected ? 0 : -1,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo, useCallback } from 'react';\nimport { DSControlledCheckbox } from '@elliemae/ds-controlled-form';\nimport { TypescriptColumn, TypescriptSelection } from '../../../types/props';\nimport { DATA_TESTID } from '../../../configs/constants';\n\nconst stopThePropagation = (e: React.MouseEvent | React.KeyboardEvent) => e.stopPropagation();\n\nexport const multiSelectColumn: TypescriptColumn<HTMLInputElement> = {\n // Build our multiSelecter column\n id: 'multiSelecter', // Make sure it has an ID\n Header: ({ ctx }) => {\n const {\n tableProps: { onSelectionChange, selection, data, disabledRows },\n allDataFlattened,\n } = ctx;\n\n // We for sure have selection, so we just typecast it for TS reasons\n const dtSelection = selection ?? {};\n\n const selectionKeyCount = Object.keys(dtSelection).length;\n\n const currentGlobalState = useMemo(\n () => (selectionKeyCount > 0 && selectionKeyCount < data.length ? 'mixed' : selectionKeyCount > 0),\n [selectionKeyCount, data],\n );\n\n // global state toggling: false to true, mixed to true, true to false\n const newGlobalStateAfterToggle = useMemo(() => currentGlobalState !== true, [currentGlobalState]);\n\n const newSelection: TypescriptSelection = useMemo(() => {\n if (!newGlobalStateAfterToggle) return {};\n\n return allDataFlattened.reduce<TypescriptSelection>((newSelectionObject, datum) => {\n newSelectionObject[datum.uid] = !disabledRows[datum.uid];\n return newSelectionObject;\n }, {});\n }, [newGlobalStateAfterToggle, allDataFlattened, disabledRows]);\n\n const onChangeHandler = useCallback(\n (e: React.ChangeEvent) => {\n onSelectionChange(newSelection, 'All', e);\n },\n [newSelection, onSelectionChange],\n );\n\n const ariaControls = useMemo(\n () => allDataFlattened.map((datum) => `data-table-checkbox-${datum.uid}`).join(' '),\n [allDataFlattened],\n );\n\n return (\n <DSControlledCheckbox\n aria-controls={ariaControls}\n data-testid={DATA_TESTID.DATA_TABLE_GLOBAL_CHECKBOX}\n aria-label=\"Toggle all rows selected\"\n checked={currentGlobalState}\n onChange={onChangeHandler}\n style={{ cursor: 'pointer' }}\n />\n );\n },\n Cell: ({ cell, row, isRowSelected, ctx }) => {\n const {\n tableProps: { onSelectionChange, selection, disabledRows },\n } = ctx;\n const { uid } = row;\n const selectedState = selection?.[uid] ?? false;\n\n const onChangeHandler = useCallback(\n (e: React.ChangeEvent) => {\n const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAA4C;AAC5C,gCAAqC;AAErC,uBAA4B;AAE5B,MAAM,qBAAqB,CAAC,MAA8C,EAAE,gBAAgB;AAErF,MAAM,oBAAwD;AAAA,EAEnE,IAAI;AAAA,EACJ,QAAQ,CAAC,EAAE,IAAI,MAAM;AACnB,UAAM;AAAA,MACJ,YAAY,EAAE,mBAAmB,WAAW,MAAM,aAAa;AAAA,MAC/D;AAAA,IACF,IAAI;AAGJ,UAAM,cAAc,aAAa,CAAC;AAElC,UAAM,oBAAoB,OAAO,KAAK,WAAW,EAAE;AAEnD,UAAM,yBAAqB;AAAA,MACzB,MAAO,oBAAoB,KAAK,oBAAoB,KAAK,SAAS,UAAU,oBAAoB;AAAA,MAChG,CAAC,mBAAmB,IAAI;AAAA,IAC1B;AAGA,UAAM,gCAA4B,sBAAQ,MAAM,uBAAuB,MAAM,CAAC,kBAAkB,CAAC;AAEjG,UAAM,mBAAoC,sBAAQ,MAAM;AACtD,UAAI,CAAC;AAA2B,eAAO,CAAC;AAExC,aAAO,iBAAiB,OAA4B,CAAC,oBAAoB,UAAU;AACjF,2BAAmB,MAAM,OAAO,CAAC,aAAa,MAAM;AACpD,eAAO;AAAA,MACT,GAAG,CAAC,CAAC;AAAA,IACP,GAAG,CAAC,2BAA2B,kBAAkB,YAAY,CAAC;AAE9D,UAAM,sBAAkB;AAAA,MACtB,CAAC,MAAyB;
|
|
4
|
+
"sourcesContent": ["import React, { useMemo, useCallback } from 'react';\nimport { DSControlledCheckbox } from '@elliemae/ds-controlled-form';\nimport { TypescriptColumn, TypescriptSelection } from '../../../types/props';\nimport { DATA_TESTID } from '../../../configs/constants';\n\nconst stopThePropagation = (e: React.MouseEvent | React.KeyboardEvent) => e.stopPropagation();\n\nexport const multiSelectColumn: TypescriptColumn<HTMLInputElement> = {\n // Build our multiSelecter column\n id: 'multiSelecter', // Make sure it has an ID\n Header: ({ ctx }) => {\n const {\n tableProps: { onSelectionChange, selection, data, disabledRows },\n allDataFlattened,\n } = ctx;\n\n // We for sure have selection, so we just typecast it for TS reasons\n const dtSelection = selection ?? {};\n\n const selectionKeyCount = Object.keys(dtSelection).length;\n\n const currentGlobalState = useMemo(\n () => (selectionKeyCount > 0 && selectionKeyCount < data.length ? 'mixed' : selectionKeyCount > 0),\n [selectionKeyCount, data],\n );\n\n // global state toggling: false to true, mixed to true, true to false\n const newGlobalStateAfterToggle = useMemo(() => currentGlobalState !== true, [currentGlobalState]);\n\n const newSelection: TypescriptSelection = useMemo(() => {\n if (!newGlobalStateAfterToggle) return {};\n\n return allDataFlattened.reduce<TypescriptSelection>((newSelectionObject, datum) => {\n newSelectionObject[datum.uid] = !disabledRows[datum.uid];\n return newSelectionObject;\n }, {});\n }, [newGlobalStateAfterToggle, allDataFlattened, disabledRows]);\n\n const onChangeHandler = useCallback(\n (newState: boolean, e: React.ChangeEvent) => {\n onSelectionChange(newSelection, 'All', e);\n },\n [newSelection, onSelectionChange],\n );\n\n const ariaControls = useMemo(\n () => allDataFlattened.map((datum) => `data-table-checkbox-${datum.uid}`).join(' '),\n [allDataFlattened],\n );\n\n return (\n <DSControlledCheckbox\n aria-controls={ariaControls}\n data-testid={DATA_TESTID.DATA_TABLE_GLOBAL_CHECKBOX}\n aria-label=\"Toggle all rows selected\"\n checked={currentGlobalState}\n onChange={onChangeHandler}\n style={{ cursor: 'pointer' }}\n />\n );\n },\n Cell: ({ cell, row, isRowSelected, ctx }) => {\n const {\n tableProps: { onSelectionChange, selection, disabledRows },\n } = ctx;\n const { uid } = row;\n const selectedState = selection?.[uid] ?? false;\n\n const onChangeHandler = useCallback(\n (newState: boolean, e: React.ChangeEvent) => {\n const newSelection = { ...selection, [uid]: newState }; // we only want true and mixed values\n if (!newState) delete newSelection[uid]; // if newState is false, remove from the new selection\n onSelectionChange(newSelection, uid, e);\n },\n [onSelectionChange, selection, uid],\n );\n\n return (\n <div role=\"presentation\" onClick={stopThePropagation} onKeyDown={stopThePropagation}>\n <DSControlledCheckbox\n id={`data-table-checkbox-${uid}`}\n data-testid={DATA_TESTID.DATA_TABLE_CHECKBOX}\n aria-label=\"Toggle row selected\"\n aria-checked={selectedState}\n aria-disabled={false}\n checked={selectedState}\n onChange={onChangeHandler}\n disabled={disabledRows[row.uid]}\n innerRef={cell.ref}\n tabIndex={isRowSelected ? 0 : -1}\n style={{ cursor: 'pointer' }}\n />\n </div>\n );\n },\n textWrap: 'wrap',\n width: 32,\n padding: 7,\n canResize: false,\n isFocuseable: false,\n disableDnD: true,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAA4C;AAC5C,gCAAqC;AAErC,uBAA4B;AAE5B,MAAM,qBAAqB,CAAC,MAA8C,EAAE,gBAAgB;AAErF,MAAM,oBAAwD;AAAA,EAEnE,IAAI;AAAA,EACJ,QAAQ,CAAC,EAAE,IAAI,MAAM;AACnB,UAAM;AAAA,MACJ,YAAY,EAAE,mBAAmB,WAAW,MAAM,aAAa;AAAA,MAC/D;AAAA,IACF,IAAI;AAGJ,UAAM,cAAc,aAAa,CAAC;AAElC,UAAM,oBAAoB,OAAO,KAAK,WAAW,EAAE;AAEnD,UAAM,yBAAqB;AAAA,MACzB,MAAO,oBAAoB,KAAK,oBAAoB,KAAK,SAAS,UAAU,oBAAoB;AAAA,MAChG,CAAC,mBAAmB,IAAI;AAAA,IAC1B;AAGA,UAAM,gCAA4B,sBAAQ,MAAM,uBAAuB,MAAM,CAAC,kBAAkB,CAAC;AAEjG,UAAM,mBAAoC,sBAAQ,MAAM;AACtD,UAAI,CAAC;AAA2B,eAAO,CAAC;AAExC,aAAO,iBAAiB,OAA4B,CAAC,oBAAoB,UAAU;AACjF,2BAAmB,MAAM,OAAO,CAAC,aAAa,MAAM;AACpD,eAAO;AAAA,MACT,GAAG,CAAC,CAAC;AAAA,IACP,GAAG,CAAC,2BAA2B,kBAAkB,YAAY,CAAC;AAE9D,UAAM,sBAAkB;AAAA,MACtB,CAAC,UAAmB,MAAyB;AAC3C,0BAAkB,cAAc,OAAO,CAAC;AAAA,MAC1C;AAAA,MACA,C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AAAA,EACT,WAAW;AAAA,EACX,cAAc;AAAA,EACd,YAAY;AACd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -39,7 +39,7 @@ const trueReturner = new Proxy(
|
|
|
39
39
|
);
|
|
40
40
|
const flatten = (data, expandedRows, uniqueRowAccessor, maxDepth = 0) => {
|
|
41
41
|
const result = [];
|
|
42
|
-
const doit = (row, index = 0, parentId = null, parentIndex = null, depth = 0) => {
|
|
42
|
+
const doit = (row, index = 0, parent = null, parentId = null, parentIndex = null, depth = 0) => {
|
|
43
43
|
const id = (parentId !== null ? `${parentId}.` : "") + index.toString();
|
|
44
44
|
const uid = (0, import_getIdFromUniqueRowAccessor.getIdFromUniqueRowAccessor)(uniqueRowAccessor, {
|
|
45
45
|
id,
|
|
@@ -51,6 +51,7 @@ const flatten = (data, expandedRows, uniqueRowAccessor, maxDepth = 0) => {
|
|
|
51
51
|
uid,
|
|
52
52
|
index,
|
|
53
53
|
realIndex: result.length,
|
|
54
|
+
parent,
|
|
54
55
|
parentId,
|
|
55
56
|
parentIndex,
|
|
56
57
|
depth,
|
|
@@ -62,7 +63,9 @@ const flatten = (data, expandedRows, uniqueRowAccessor, maxDepth = 0) => {
|
|
|
62
63
|
};
|
|
63
64
|
result.push(rowToPush);
|
|
64
65
|
if (row?.subRows && expandedRows[uid] && depth <= maxDepth) {
|
|
65
|
-
row.subRows.forEach(
|
|
66
|
+
row.subRows.forEach(
|
|
67
|
+
(subRow, i) => doit(subRow, i, rowToPush, uid, rowToPush.realIndex, depth + 1)
|
|
68
|
+
);
|
|
66
69
|
}
|
|
67
70
|
};
|
|
68
71
|
data.forEach((row, i) => doit(row, i));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/configs/useRowFlattenization.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-params */\nimport { useMemo } from 'react';\nimport { getIdFromUniqueRowAccessor } from '../helpers/getIdFromUniqueRowAccessor';\nimport { InternalTypescriptRow, TypescriptProps, TypescriptRow, UniqueRowAccessorType } from '../types/props';\n\nconst emptyObject = {};\n\nconst trueReturner = new Proxy(\n {},\n {\n get: () => true,\n },\n);\n\nconst flatten = (\n data: TypescriptRow[],\n expandedRows: Record<string, boolean>,\n uniqueRowAccessor: UniqueRowAccessorType,\n maxDepth = 0,\n): InternalTypescriptRow[] => {\n const result: InternalTypescriptRow[] = [];\n const doit = (\n row: TypescriptRow,\n index = 0,\n parentId: string | null = null,\n parentIndex: number | null = null,\n depth = 0,\n ) => {\n const id = (parentId !== null ? `${parentId}.` : '') + index.toString();\n\n const uid = getIdFromUniqueRowAccessor(uniqueRowAccessor, {\n id,\n original: row ?? {},\n });\n\n const isExpanded = expandedRows[uid];\n\n const rowToPush: InternalTypescriptRow = {\n id,\n uid,\n index,\n realIndex: result.length,\n parentId,\n parentIndex,\n depth,\n isExpanded,\n subRows: row?.subRows ?? [],\n childrenCount: row?.subRows?.length ?? 0,\n original: row ?? {},\n cells: [],\n };\n\n result.push(rowToPush);\n\n // If we have subrows and we are expanded\n if (row?.subRows && expandedRows[uid] && depth <= maxDepth) {\n row.subRows.forEach((subRow: TypescriptRow, i: number)
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwB;AACxB,wCAA2C;AAG3C,MAAM,cAAc,CAAC;AAErB,MAAM,eAAe,IAAI;AAAA,EACvB,CAAC;AAAA,EACD;AAAA,IACE,KAAK,MAAM;AAAA,EACb;AACF;AAEA,MAAM,UAAU,CACd,MACA,cACA,mBACA,WAAW,MACiB;AAC5B,QAAM,SAAkC,CAAC;AACzC,QAAM,OAAO,CACX,KACA,QAAQ,GACR,WAA0B,MAC1B,cAA6B,MAC7B,QAAQ,MACL;AACH,UAAM,MAAM,aAAa,OAAO,GAAG,cAAc,MAAM,MAAM,SAAS;AAEtE,UAAM,UAAM,8DAA2B,mBAAmB;AAAA,MACxD;AAAA,MACA,UAAU,OAAO,CAAC;AAAA,IACpB,CAAC;AAED,UAAM,aAAa,aAAa;AAEhC,UAAM,YAAmC;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,OAAO;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,KAAK,WAAW,CAAC;AAAA,MAC1B,eAAe,KAAK,SAAS,UAAU;AAAA,MACvC,UAAU,OAAO,CAAC;AAAA,MAClB,OAAO,CAAC;AAAA,IACV;AAEA,WAAO,KAAK,SAAS;AAGrB,QAAI,KAAK,WAAW,aAAa,QAAQ,SAAS,UAAU;AAC1D,UAAI,QAAQ,QAAQ,CAAC,QAAuB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-params */\nimport { useMemo } from 'react';\nimport { getIdFromUniqueRowAccessor } from '../helpers/getIdFromUniqueRowAccessor';\nimport { InternalTypescriptRow, TypescriptProps, TypescriptRow, UniqueRowAccessorType } from '../types/props';\n\nconst emptyObject = {};\n\nconst trueReturner = new Proxy(\n {},\n {\n get: () => true,\n },\n);\n\nconst flatten = (\n data: TypescriptRow[],\n expandedRows: Record<string, boolean>,\n uniqueRowAccessor: UniqueRowAccessorType,\n maxDepth = 0,\n): InternalTypescriptRow[] => {\n const result: InternalTypescriptRow[] = [];\n const doit = (\n row: TypescriptRow,\n index = 0,\n parent: InternalTypescriptRow | null = null,\n parentId: string | null = null,\n parentIndex: number | null = null,\n depth = 0,\n ) => {\n const id = (parentId !== null ? `${parentId}.` : '') + index.toString();\n\n const uid = getIdFromUniqueRowAccessor(uniqueRowAccessor, {\n id,\n original: row ?? {},\n });\n\n const isExpanded = expandedRows[uid];\n\n const rowToPush: InternalTypescriptRow = {\n id,\n uid,\n index,\n realIndex: result.length,\n parent,\n parentId,\n parentIndex,\n depth,\n isExpanded,\n subRows: row?.subRows ?? [],\n childrenCount: row?.subRows?.length ?? 0,\n original: row ?? {},\n cells: [],\n };\n\n result.push(rowToPush);\n\n // If we have subrows and we are expanded\n if (row?.subRows && expandedRows[uid] && depth <= maxDepth) {\n row.subRows.forEach((subRow: TypescriptRow, i: number) =>\n doit(subRow, i, rowToPush, uid, rowToPush.realIndex, depth + 1),\n );\n }\n };\n\n data.forEach((row, i) => doit(row, i));\n return result;\n};\n\nexport const useRowFlattenization = (props: TypescriptProps): [InternalTypescriptRow[], InternalTypescriptRow[]] => {\n const { data } = props;\n\n const expandedRows = props.isExpandable ? props.expandedRows ?? emptyObject : emptyObject;\n\n const flattenedData = useMemo(\n () => flatten(data, expandedRows, props.uniqueRowAccessor),\n [data, expandedRows, props.uniqueRowAccessor],\n );\n\n const allDataFlattened = useMemo(\n () => flatten(data, trueReturner, props.uniqueRowAccessor, Infinity),\n [data, props.uniqueRowAccessor],\n );\n\n return [flattenedData, allDataFlattened];\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwB;AACxB,wCAA2C;AAG3C,MAAM,cAAc,CAAC;AAErB,MAAM,eAAe,IAAI;AAAA,EACvB,CAAC;AAAA,EACD;AAAA,IACE,KAAK,MAAM;AAAA,EACb;AACF;AAEA,MAAM,UAAU,CACd,MACA,cACA,mBACA,WAAW,MACiB;AAC5B,QAAM,SAAkC,CAAC;AACzC,QAAM,OAAO,CACX,KACA,QAAQ,GACR,SAAuC,MACvC,WAA0B,MAC1B,cAA6B,MAC7B,QAAQ,MACL;AACH,UAAM,MAAM,aAAa,OAAO,GAAG,cAAc,MAAM,MAAM,SAAS;AAEtE,UAAM,UAAM,8DAA2B,mBAAmB;AAAA,MACxD;AAAA,MACA,UAAU,OAAO,CAAC;AAAA,IACpB,CAAC;AAED,UAAM,aAAa,aAAa;AAEhC,UAAM,YAAmC;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,OAAO;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,KAAK,WAAW,CAAC;AAAA,MAC1B,eAAe,KAAK,SAAS,UAAU;AAAA,MACvC,UAAU,OAAO,CAAC;AAAA,MAClB,OAAO,CAAC;AAAA,IACV;AAEA,WAAO,KAAK,SAAS;AAGrB,QAAI,KAAK,WAAW,aAAa,QAAQ,SAAS,UAAU;AAC1D,UAAI,QAAQ;AAAA,QAAQ,CAAC,QAAuB,MAC1C,KAAK,QAAQ,GAAG,WAAW,KAAK,UAAU,WAAW,QAAQ,CAAC;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AAEA,OAAK,QAAQ,CAAC,KAAK,MAAM,KAAK,KAAK,CAAC,CAAC;AACrC,SAAO;AACT;AAEO,MAAM,uBAAuB,CAAC,UAA+E;AAClH,QAAM,EAAE,KAAK,IAAI;AAEjB,QAAM,eAAe,MAAM,eAAe,MAAM,gBAAgB,cAAc;AAE9E,QAAM,oBAAgB;AAAA,IACpB,MAAM,QAAQ,MAAM,cAAc,MAAM,iBAAiB;AAAA,IACzD,CAAC,MAAM,cAAc,MAAM,iBAAiB;AAAA,EAC9C;AAEA,QAAM,uBAAmB;AAAA,IACvB,MAAM,QAAQ,MAAM,cAAc,MAAM,mBAAmB,QAAQ;AAAA,IACnE,CAAC,MAAM,MAAM,iBAAiB;AAAA,EAChC;AAEA,SAAO,CAAC,eAAe,gBAAgB;AACzC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -58,6 +58,7 @@ const DefaultRowContentRenderer = (props) => {
|
|
|
58
58
|
isDragOverlay,
|
|
59
59
|
backgroundColor = "white",
|
|
60
60
|
dropIndicatorPosition,
|
|
61
|
+
isDropValid,
|
|
61
62
|
focusedRowId,
|
|
62
63
|
drilldownRowId,
|
|
63
64
|
compact
|
|
@@ -99,63 +100,44 @@ const DefaultRowContentRenderer = (props) => {
|
|
|
99
100
|
},
|
|
100
101
|
[disabledRows, row.uid]
|
|
101
102
|
);
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
})
|
|
103
|
+
const DetailsView = row.original.tableRowDetails;
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledCellContainer, {
|
|
107
|
+
ref: rowRef,
|
|
108
|
+
tabIndex: disabledRows[row.uid] ? -1 : 0,
|
|
109
|
+
role: "row",
|
|
110
|
+
"aria-rowindex": row.realIndex + 1,
|
|
111
|
+
"aria-label": ariaLabelMessage(row, selection?.[row.uid] === true),
|
|
112
|
+
"aria-selected": selection?.[row.uid] === true,
|
|
113
|
+
"aria-expanded": isExpandable ? expandedRows[row.uid] === true : void 0,
|
|
114
|
+
"aria-disabled": disabledRows[row.uid],
|
|
115
|
+
...gridTemplateColProps,
|
|
116
|
+
backgroundColor,
|
|
117
|
+
height: compact ? "24px" : "auto",
|
|
118
|
+
minHeight: compact ? "24px" : "36px",
|
|
119
|
+
isDropIndicatorPositionInside: dropIndicatorPosition === import_props.DropIndicatorPosition.Inside,
|
|
120
|
+
isDropValid,
|
|
121
|
+
shouldDisplayHover: !isDndActive && !isDragging && !isDragOverlay,
|
|
122
|
+
isDragOverlay,
|
|
123
|
+
isDragging,
|
|
124
|
+
selected: noSelectionColumn && selection?.[row.uid] === true,
|
|
125
|
+
disabled: disabledRows[row.uid],
|
|
126
|
+
"data-testid": import_constants.DATA_TESTID.DATA_TABLE_ROW_CONTENT,
|
|
127
|
+
onMouseDown: handleSelectDisableRow,
|
|
128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Cells.Cells, {
|
|
129
|
+
row,
|
|
130
|
+
isRowSelected: drilldownRowId === row.uid,
|
|
131
|
+
isDragOverlay
|
|
132
|
+
}, row.uid)
|
|
133
|
+
}, row.uid),
|
|
134
|
+
!isDragOverlay && isExpandable && row.isExpanded && DetailsView && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DetailsWrapper, {
|
|
135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DetailsView, {
|
|
136
|
+
row,
|
|
137
|
+
detailsIndent
|
|
138
138
|
})
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
row,
|
|
143
|
-
disabledRows,
|
|
144
|
-
selection,
|
|
145
|
-
isExpandable,
|
|
146
|
-
expandedRows,
|
|
147
|
-
gridTemplateColProps,
|
|
148
|
-
backgroundColor,
|
|
149
|
-
compact,
|
|
150
|
-
dropIndicatorPosition,
|
|
151
|
-
isDndActive,
|
|
152
|
-
isDragging,
|
|
153
|
-
isDragOverlay,
|
|
154
|
-
noSelectionColumn,
|
|
155
|
-
handleSelectDisableRow,
|
|
156
|
-
drilldownRowId,
|
|
157
|
-
detailsIndent
|
|
158
|
-
]);
|
|
159
|
-
return PureRowContent;
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
});
|
|
160
142
|
};
|
|
161
143
|
//# sourceMappingURL=DefaultRowContentRenderer.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/exported-related/RowRenderer/DefaultRowContentRenderer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useMemo, useCallback, useLayoutEffect, useRef } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { Cells } from '../../parts/Cells';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledCellContainer } from '../../styled';\nimport { DropIndicatorPosition, TypescriptRow } from '../../types/props';\n\nconst DetailsWrapper = (props) => (\n // This can be further customized\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-role=\"detail-view\"\n style={{\n borderTop: '1px solid #EBEDF0',\n borderBottom: '1px solid #EBEDF0',\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {props.children}\n </div>\n);\n\nconst ariaLabelMessage = (row: TypescriptRow, selected: boolean) =>\n `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ''}. ${\n selected ? 'Selected. ' : ''\n }To interact with the cells press enter`;\n\nexport const DefaultRowContentRenderer: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n ctx: {\n tableProps: { isExpandable, colsLayoutStyle, selection, noSelectionColumn, expandedRows, disabledRows },\n layoutHelpers: { gridLayout },\n visibleColumns,\n },\n draggableProps,\n isDragOverlay,\n backgroundColor = 'white',\n dropIndicatorPosition,\n focusedRowId,\n drilldownRowId,\n compact,\n } = props;\n\n const rowRef = useRef<HTMLDivElement>(null);\n const isDndActive = draggableProps && draggableProps.active;\n const isDragging = draggableProps && draggableProps.isDragging;\n\n useLayoutEffect(() => {\n if (row.uid === focusedRowId) {\n rowRef.current?.focus();\n }\n }, [focusedRowId, row.uid]);\n\n const gridTemplateColProps = useMemo(\n () => ({\n cols: isDragOverlay ? ['24px', 'auto'] : gridLayout,\n isExpandable,\n colLayoutStyle: colsLayoutStyle,\n }),\n [isDragOverlay, gridLayout, colsLayoutStyle, isExpandable],\n );\n\n const detailsIndent = useMemo(() => {\n let padding = 0;\n for (let i = 0; i < visibleColumns.length; i += 1) {\n if (INTERNAL_COLUMNS.includes(visibleColumns[i].id)) {\n padding += visibleColumns[i].width;\n } else {\n padding += row.depth * 32 + 15;\n break;\n }\n }\n return padding;\n }, [row.depth, visibleColumns]);\n\n const handleSelectDisableRow = useCallback(\n (e) => {\n if (disabledRows[row.uid]) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n [disabledRows, row.uid],\n );\n const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAEA,mBAAqE;AACrE,qBAAiC;AACjC,uBAA4B;AAC5B,mBAAsB;AAEtB,oBAAoC;AACpC,mBAAqD;AAErD,MAAM,iBAAiB,CAAC,UAGtB,4CAAC;AAAA,EACC,aAAU;AAAA,EACV,OAAO;AAAA,IACL,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AAAA,EACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,EAClC,WAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,EAEnC,gBAAM;AAAA,CACT;AAGF,MAAM,mBAAmB,CAAC,KAAoB,aAC5C,cAAc,IAAI,YAAY,IAAI,IAAI,gBAAgB,OAAO,yBAAyB,IAAI,cAAc,MAAM,OAC5G,WAAW,eAAe;AAGvB,MAAM,4BAAkE,CAAC,UAAU;AACxF,QAAM;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,MACH,YAAY,EAAE,cAAc,iBAAiB,WAAW,mBAAmB,cAAc,aAAa;AAAA,MACtG,eAAe,EAAE,WAAW;AAAA,MAC5B;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,aAAS,qBAAuB,IAAI;AAC1C,QAAM,cAAc,kBAAkB,eAAe;AACrD,QAAM,aAAa,kBAAkB,eAAe;AAEpD,oCAAgB,MAAM;AACpB,QAAI,IAAI,QAAQ,cAAc;AAC5B,aAAO,SAAS,MAAM;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC;AAE1B,QAAM,2BAAuB;AAAA,IAC3B,OAAO;AAAA,MACL,MAAM,gBAAgB,CAAC,QAAQ,MAAM,IAAI;AAAA,MACzC;AAAA,MACA,gBAAgB;AAAA,IAClB;AAAA,IACA,CAAC,eAAe,YAAY,iBAAiB,YAAY;AAAA,EAC3D;AAEA,QAAM,oBAAgB,sBAAQ,MAAM;AAClC,QAAI,UAAU;AACd,aAAS,IAAI,GAAG,IAAI,eAAe,QAAQ,KAAK,GAAG;AACjD,UAAI,gCAAiB,SAAS,eAAe,GAAG,EAAE,GAAG;AACnD,mBAAW,eAAe,GAAG;AAAA,MAC/B,OAAO;AACL,mBAAW,IAAI,QAAQ,KAAK;AAC5B;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,IAAI,OAAO,cAAc,CAAC;AAE9B,QAAM,6BAAyB;AAAA,IAC7B,CAAC,MAAM;AACL,UAAI,aAAa,IAAI,MAAM;AACzB,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAAA,MACpB;AAAA,IACF;AAAA,IACA,CAAC,cAAc,IAAI,GAAG;AAAA,EACxB;AACA,QAAM,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useMemo, useCallback, useLayoutEffect, useRef } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { Cells } from '../../parts/Cells';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledCellContainer } from '../../styled';\nimport { DropIndicatorPosition, TypescriptRow } from '../../types/props';\n\nconst DetailsWrapper = (props) => (\n // This can be further customized\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-role=\"detail-view\"\n style={{\n borderTop: '1px solid #EBEDF0',\n borderBottom: '1px solid #EBEDF0',\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {props.children}\n </div>\n);\n\nconst ariaLabelMessage = (row: TypescriptRow, selected: boolean) =>\n `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ''}. ${\n selected ? 'Selected. ' : ''\n }To interact with the cells press enter`;\n\nexport const DefaultRowContentRenderer: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n ctx: {\n tableProps: { isExpandable, colsLayoutStyle, selection, noSelectionColumn, expandedRows, disabledRows },\n layoutHelpers: { gridLayout },\n visibleColumns,\n },\n draggableProps,\n isDragOverlay,\n backgroundColor = 'white',\n dropIndicatorPosition,\n isDropValid,\n focusedRowId,\n drilldownRowId,\n compact,\n } = props;\n\n const rowRef = useRef<HTMLDivElement>(null);\n const isDndActive = draggableProps && draggableProps.active;\n const isDragging = draggableProps && draggableProps.isDragging;\n\n useLayoutEffect(() => {\n if (row.uid === focusedRowId) {\n rowRef.current?.focus();\n }\n }, [focusedRowId, row.uid]);\n\n const gridTemplateColProps = useMemo(\n () => ({\n cols: isDragOverlay ? ['24px', 'auto'] : gridLayout,\n isExpandable,\n colLayoutStyle: colsLayoutStyle,\n }),\n [isDragOverlay, gridLayout, colsLayoutStyle, isExpandable],\n );\n\n const detailsIndent = useMemo(() => {\n let padding = 0;\n for (let i = 0; i < visibleColumns.length; i += 1) {\n if (INTERNAL_COLUMNS.includes(visibleColumns[i].id)) {\n padding += visibleColumns[i].width;\n } else {\n padding += row.depth * 32 + 15;\n break;\n }\n }\n return padding;\n }, [row.depth, visibleColumns]);\n\n const handleSelectDisableRow = useCallback(\n (e) => {\n if (disabledRows[row.uid]) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n [disabledRows, row.uid],\n );\n const DetailsView = row.original.tableRowDetails;\n\n return (\n <>\n <StyledCellContainer\n ref={rowRef}\n key={row.uid}\n tabIndex={disabledRows[row.uid] ? -1 : 0}\n role=\"row\"\n aria-rowindex={row.realIndex + 1}\n aria-label={ariaLabelMessage(row, selection?.[row.uid] === true)}\n aria-selected={selection?.[row.uid] === true}\n aria-expanded={isExpandable ? expandedRows[row.uid] === true : undefined}\n aria-disabled={disabledRows[row.uid]}\n {...gridTemplateColProps}\n backgroundColor={backgroundColor}\n height={compact ? '24px' : 'auto'}\n minHeight={compact ? '24px' : '36px'}\n isDropIndicatorPositionInside={dropIndicatorPosition === DropIndicatorPosition.Inside}\n isDropValid={isDropValid}\n shouldDisplayHover={!isDndActive && !isDragging && !isDragOverlay}\n isDragOverlay={isDragOverlay}\n isDragging={isDragging}\n selected={noSelectionColumn && selection?.[row.uid] === true}\n disabled={disabledRows[row.uid]}\n data-testid={DATA_TESTID.DATA_TABLE_ROW_CONTENT}\n onMouseDown={handleSelectDisableRow}\n >\n <Cells row={row} isRowSelected={drilldownRowId === row.uid} isDragOverlay={isDragOverlay} key={row.uid} />\n </StyledCellContainer>\n {!isDragOverlay && isExpandable && row.isExpanded && DetailsView && (\n <DetailsWrapper>\n <DetailsView row={row} detailsIndent={detailsIndent} />\n </DetailsWrapper>\n )}\n </>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAEA,mBAAqE;AACrE,qBAAiC;AACjC,uBAA4B;AAC5B,mBAAsB;AAEtB,oBAAoC;AACpC,mBAAqD;AAErD,MAAM,iBAAiB,CAAC,UAGtB,4CAAC;AAAA,EACC,aAAU;AAAA,EACV,OAAO;AAAA,IACL,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AAAA,EACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,EAClC,WAAW,CAAC,MA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
|
76
76
|
totalColumnsWidth,
|
|
77
77
|
rowStyle,
|
|
78
78
|
shouldAppendDottedBorder,
|
|
79
|
-
dropIndicatorPosition
|
|
79
|
+
dropIndicatorPosition,
|
|
80
|
+
isDropValid
|
|
80
81
|
} = (0, import_useRowRendererProperties.useRowRendererProperties)({
|
|
81
82
|
row
|
|
82
83
|
});
|
|
@@ -94,7 +95,8 @@ const RowRenderer = (props) => {
|
|
|
94
95
|
focusedRowId,
|
|
95
96
|
drilldownRowId,
|
|
96
97
|
draggableProps,
|
|
97
|
-
dropIndicatorPosition
|
|
98
|
+
dropIndicatorPosition,
|
|
99
|
+
isDropValid
|
|
98
100
|
};
|
|
99
101
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledFullsizeGrid, {
|
|
100
102
|
"data-testid": import_constants.DATA_TESTID.DATA_TABLE_ROW,
|
|
@@ -118,10 +120,11 @@ const RowRenderer = (props) => {
|
|
|
118
120
|
...rowContentProps,
|
|
119
121
|
key: row.uid
|
|
120
122
|
}),
|
|
121
|
-
shouldAppendDottedBorder && magicDottedBorder,
|
|
123
|
+
shouldAppendDottedBorder && !isDragOverlay && magicDottedBorder,
|
|
122
124
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropIndicator.DropIndicator, {
|
|
123
125
|
vertical: false,
|
|
124
126
|
dropIndicatorPosition,
|
|
127
|
+
isDropValid,
|
|
125
128
|
isLast: row.index === flattenedData.length - 1 && draggableProps && draggableProps.isDragging
|
|
126
129
|
})
|
|
127
130
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/exported-related/RowRenderer/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledFullsizeGr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C;AAAA,IACC,eAAa,6BAAY;AAAA,IAEzB;AAAA,IACC,GAAG;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,IACP,SAAS;AAAA,IACT,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,mBAAiB,QAAQ,IAAI,SAAS,eAAe;AAAA,IACrD,wBAAsB,IAAI;AAAA,IAC1B,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IAEC;AAAA,iCACC,4CAAC;AAAA,QAA0B,GAAG;AAAA,OAAiB,IAE/C,gDAAC;AAAA,QAA2B,GAAG;AAAA,QAAiB,KAAK,IAAI;AAAA,OAAK;AAAA,MAE/D,4BAA4B;AAAA,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledFullsizeGrid } from '../../styled';\nimport { InternalTypescriptRow } from '../../types/props';\nimport { DefaultRowContentRenderer } from './DefaultRowContentRenderer';\nimport { useRowRendererHandlers } from './useRowRendererHandlers';\nimport { useRowRendererProperties } from './useRowRendererProperties';\nimport { DropIndicator } from '../../parts/DropIndicator';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport { DATA_TESTID } from '../../configs/constants';\n\ninterface RowRendererProps {\n row: InternalTypescriptRow;\n compact?: boolean;\n itemIndex: number;\n isDragOverlay: boolean;\n minHeight: string;\n height: string;\n rowsLayout?: (string | number)[];\n colsLayout?: (string | number)[];\n CustomRowContentRenderer?: React.ComponentType<RowVariantProps>;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n backgroundColor?: string;\n}\n\n// CSS don't let us modify the spacing between the dots, so one solution is to use SVG\nconst magicDottedBorder = (\n <svg width=\"100%\" height=\"1px\">\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"100%\"\n y2=\"0\"\n stroke=\"#B0B9C8FF\"\n strokeWidth=\"1.5\"\n strokeDasharray=\"0, 5\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\nconst RowRenderer: React.ComponentType<RowRendererProps> = (props) => {\n const {\n row,\n itemIndex,\n minHeight = '36px',\n height = 'auto',\n rowsLayout = [1],\n CustomRowContentRenderer,\n focusedRowId,\n drilldownRowId,\n isDragOverlay,\n } = props;\n\n const ctx = useContext(DataTableContext);\n const { draggableProps } = useContext(SortableItemContext);\n const { flattenedData } = ctx;\n\n // ===========================================================================\n // Properties for the row\n // ===========================================================================\n\n const {\n userDataProperties,\n colsLayoutStyle,\n totalColumnsWidth,\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n isDropValid,\n } = useRowRendererProperties({\n row,\n });\n\n // ===========================================================================\n // Handlers\n // ===========================================================================\n\n const { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus } = useRowRendererHandlers({\n row,\n itemIndex,\n items: flattenedData,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n });\n\n const rowContentProps: RowVariantProps = {\n ...props,\n ctx,\n focusedRowId,\n drilldownRowId,\n draggableProps,\n dropIndicatorPosition,\n isDropValid,\n };\n\n return (\n <StyledFullsizeGrid\n data-testid={DATA_TESTID.DATA_TABLE_ROW}\n key={row.uid}\n colsLayoutStyle={colsLayoutStyle}\n {...userDataProperties}\n totalColumnsWidth={totalColumnsWidth}\n style={rowStyle}\n onClick={handleItemClick}\n onKeyDown={handleKeyDown}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n data-expandable={Boolean(row.original.tableRowDetails)}\n data-is-row-expanded={row.isExpanded}\n rows={rowsLayout}\n minHeight={minHeight}\n height={height}\n >\n {CustomRowContentRenderer ? (\n <CustomRowContentRenderer {...rowContentProps} />\n ) : (\n <DefaultRowContentRenderer {...rowContentProps} key={row.uid} />\n )}\n {shouldAppendDottedBorder && !isDragOverlay && magicDottedBorder}\n <DropIndicator\n vertical={false}\n dropIndicatorPosition={dropIndicatorPosition}\n isDropValid={isDropValid}\n isLast={row.index === flattenedData.length - 1 && draggableProps && draggableProps.isDragging}\n />\n </StyledFullsizeGrid>\n );\n};\n\nexport { RowRenderer };\nexport default RowRenderer;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA;AACA,mBAAkC;AAClC,8BAAiC;AAEjC,oBAAmC;AAEnC,uCAA0C;AAC1C,oCAAuC;AACvC,sCAAyC;AACzC,2BAA8B;AAC9B,iCAAoC;AACpC,uBAA4B;AAkB5B,MAAM,oBACJ,4CAAC;AAAA,EAAI,OAAM;AAAA,EAAO,QAAO;AAAA,EACvB,sDAAC;AAAA,IACC,IAAG;AAAA,IACH,IAAG;AAAA,IACH,IAAG;AAAA,IACH,IAAG;AAAA,IACH,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,iBAAgB;AAAA,IAChB,kBAAiB;AAAA,IACjB,eAAc;AAAA,GAChB;AAAA,CACF;AAGF,MAAM,cAAqD,CAAC,UAAU;AACpE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,aAAa,CAAC,CAAC;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,UAAM,yBAAW,wCAAgB;AACvC,QAAM,EAAE,eAAe,QAAI,yBAAW,8CAAmB;AACzD,QAAM,EAAE,cAAc,IAAI;AAM1B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,0DAAyB;AAAA,IAC3B;AAAA,EACF,CAAC;AAMD,QAAM,EAAE,iBAAiB,eAAe,cAAc,cAAc,QAAI,sDAAuB;AAAA,IAC7F;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,kBAAmC;AAAA,IACvC,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SACE,6CAAC;AAAA,IACC,eAAa,6BAAY;AAAA,IAEzB;AAAA,IACC,GAAG;AAAA,IACJ;AAAA,IACA,OAAO;AAAA,IACP,SAAS;AAAA,IACT,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,mBAAiB,QAAQ,IAAI,SAAS,eAAe;AAAA,IACrD,wBAAsB,IAAI;AAAA,IAC1B,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IAEC;AAAA,iCACC,4CAAC;AAAA,QAA0B,GAAG;AAAA,OAAiB,IAE/C,gDAAC;AAAA,QAA2B,GAAG;AAAA,QAAiB,KAAK,IAAI;AAAA,OAAK;AAAA,MAE/D,4BAA4B,CAAC,iBAAiB;AAAA,MAC/C,4CAAC;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA,QAAQ,IAAI,UAAU,cAAc,SAAS,KAAK,kBAAkB,eAAe;AAAA,OACrF;AAAA;AAAA,KA1BK,IAAI,GA2BX;AAEJ;AAGA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/exported-related/RowRenderer/useRowRendererProperties.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useContext, useMemo } from 'react';\nimport { ColsLayoutStyle } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport {
|
|
4
|
+
"sourcesContent": ["import { useContext, useMemo } from 'react';\nimport { ColsLayoutStyle } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport { InternalTypescriptRow } from '../../types/props';\nimport { useRowStyle } from './useRowStyle';\n\nexport const useRowRendererProperties = ({\n row,\n}: {\n row: InternalTypescriptRow;\n}): {\n userDataProperties: Record<string, unknown>;\n colsLayoutStyle: ColsLayoutStyle;\n totalColumnsWidth: string | number | undefined;\n} & ReturnType<typeof useRowStyle> => {\n const {\n tableProps: { colsLayoutStyle },\n layoutHelpers: { totalColumnsWidth },\n } = useContext(DataTableContext);\n\n const userDataProperties = useMemo(\n () =>\n Object.keys(row.original).reduce((acc, cur) => {\n if (cur.startsWith('data-')) acc[cur] = row.original[cur];\n return acc;\n }, {}),\n [row],\n );\n\n const styleRelatedProps = useRowStyle(row);\n\n return {\n userDataProperties,\n colsLayoutStyle,\n totalColumnsWidth,\n ...styleRelatedProps,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AAEpC,8BAAiC;AAEjC,yBAA4B;AAErB,MAAM,2BAA2B,CAAC;AAAA,EACvC;AACF,MAMsC;AACpC,QAAM;AAAA,IACJ,YAAY,EAAE,gBAAgB;AAAA,IAC9B,eAAe,EAAE,kBAAkB;AAAA,EACrC,QAAI,yBAAW,wCAAgB;AAE/B,QAAM,yBAAqB;AAAA,IACzB,MACE,OAAO,KAAK,IAAI,QAAQ,EAAE,OAAO,CAAC,KAAK,QAAQ;AAC7C,UAAI,IAAI,WAAW,OAAO;AAAG,YAAI,OAAO,IAAI,SAAS;AACrD,aAAO;AAAA,IACT,GAAG,CAAC,CAAC;AAAA,IACP,CAAC,GAAG;AAAA,EACN;AAEA,QAAM,wBAAoB,gCAAY,GAAG;AAEzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -51,10 +51,12 @@ const useRowStyle = (row) => {
|
|
|
51
51
|
}, [row, flattenedData]);
|
|
52
52
|
const rowStyle = (0, import_react.useMemo)(() => ({ borderTop, borderBottom }), [borderTop, borderBottom]);
|
|
53
53
|
const dropIndicatorPosition = draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;
|
|
54
|
+
const isDropValid = draggableProps && draggableProps.isDropValid;
|
|
54
55
|
return {
|
|
55
56
|
rowStyle,
|
|
56
57
|
shouldAppendDottedBorder,
|
|
57
|
-
dropIndicatorPosition
|
|
58
|
+
dropIndicatorPosition,
|
|
59
|
+
isDropValid
|
|
58
60
|
};
|
|
59
61
|
};
|
|
60
62
|
//# sourceMappingURL=useRowStyle.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/exported-related/RowRenderer/useRowStyle.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useContext, useMemo } from 'react';\nimport DataTableContext from '../../DataTableContext';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,8BAA6B;AAC7B,iCAAoC;AAG7B,MAAM,cAAc,CACzB,
|
|
4
|
+
"sourcesContent": ["import { useContext, useMemo } from 'react';\nimport DataTableContext from '../../DataTableContext';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport { InternalTypescriptRow, DropIndicatorPosition } from '../../types/props';\n\nexport const useRowStyle = (\n row: InternalTypescriptRow,\n): {\n rowStyle: Record<string, unknown>;\n shouldAppendDottedBorder: boolean;\n dropIndicatorPosition: false | DropIndicatorPosition;\n isDropValid: boolean;\n} => {\n const { flattenedData } = useContext(DataTableContext);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n // ---------------------------------------------------------------------------\n // Border calculation\n // ---------------------------------------------------------------------------\n const [borderTop, borderBottom, shouldAppendDottedBorder]: [string, string, boolean] = useMemo(() => {\n if (row.original.dimsumHeaderValue) {\n return ['none', 'none', false];\n }\n if (row.isExpanded && row.original.subRows && row.depth === 0) {\n return ['1px solid #EBEDF0', 'none', true];\n }\n\n if (row.depth >= 1) {\n if (row.realIndex < flattenedData.length - 1 && flattenedData[row.realIndex + 1].depth === 0) {\n return ['none', '2px solid #EBEDF0', false];\n }\n return ['none', 'none', true];\n }\n\n return ['none', '1px solid #EBEDF0', false];\n }, [row, flattenedData]);\n\n const rowStyle = useMemo(() => ({ borderTop, borderBottom }), [borderTop, borderBottom]);\n\n const dropIndicatorPosition =\n draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;\n\n const isDropValid = draggableProps && draggableProps.isDropValid;\n\n return {\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n isDropValid,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,8BAA6B;AAC7B,iCAAoC;AAG7B,MAAM,cAAc,CACzB,QAMG;AACH,QAAM,EAAE,cAAc,QAAI,yBAAW,wBAAAA,OAAgB;AAErD,QAAM,EAAE,eAAe,QAAI,yBAAW,8CAAmB;AAKzD,QAAM,CAAC,WAAW,cAAc,wBAAwB,QAA+B,sBAAQ,MAAM;AACnG,QAAI,IAAI,SAAS,mBAAmB;AAClC,aAAO,CAAC,QAAQ,QAAQ,KAAK;AAAA,IAC/B;AACA,QAAI,IAAI,cAAc,IAAI,SAAS,WAAW,IAAI,UAAU,GAAG;AAC7D,aAAO,CAAC,qBAAqB,QAAQ,IAAI;AAAA,IAC3C;AAEA,QAAI,IAAI,SAAS,GAAG;AAClB,UAAI,IAAI,YAAY,cAAc,SAAS,KAAK,cAAc,IAAI,YAAY,GAAG,UAAU,GAAG;AAC5F,eAAO,CAAC,QAAQ,qBAAqB,KAAK;AAAA,MAC5C;AACA,aAAO,CAAC,QAAQ,QAAQ,IAAI;AAAA,IAC9B;AAEA,WAAO,CAAC,QAAQ,qBAAqB,KAAK;AAAA,EAC5C,GAAG,CAAC,KAAK,aAAa,CAAC;AAEvB,QAAM,eAAW,sBAAQ,OAAO,EAAE,WAAW,aAAa,IAAI,CAAC,WAAW,YAAY,CAAC;AAEvF,QAAM,wBACJ,kBAAkB,eAAe,mCAAmC,eAAe;AAErF,QAAM,cAAc,kBAAkB,eAAe;AAErD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["DataTableContext"]
|
|
7
7
|
}
|
|
@@ -60,10 +60,10 @@ const StyledIndicator = import_ds_system.styled.div`
|
|
|
60
60
|
box-sizing: border-box;
|
|
61
61
|
width: ${(props) => props.vertical ? "2px" : "100%"};
|
|
62
62
|
height: ${(props) => props.vertical ? "100%" : "2px"};
|
|
63
|
-
background-color: ${(
|
|
63
|
+
background-color: ${({ isDropValid, theme }) => isDropValid ? theme.colors.brand[600] : theme.colors.danger[900]};
|
|
64
64
|
z-index: ${import_zIndexInternalConfig.ZIndexDataTable.DROP_INDICATOR};
|
|
65
65
|
`;
|
|
66
|
-
const CircleIndicator = (style) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
|
66
|
+
const CircleIndicator = (style, isDropValid) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
|
67
67
|
height: "6",
|
|
68
68
|
width: "6",
|
|
69
69
|
style,
|
|
@@ -72,19 +72,21 @@ const CircleIndicator = (style) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
|
72
72
|
cy: "3",
|
|
73
73
|
r: "3",
|
|
74
74
|
strokeWidth: "0",
|
|
75
|
-
fill: "#1E79C2"
|
|
75
|
+
fill: isDropValid ? "#1E79C2" : "#C64252"
|
|
76
76
|
})
|
|
77
77
|
});
|
|
78
|
-
const DropIndicator = (
|
|
79
|
-
|
|
78
|
+
const DropIndicator = (props) => {
|
|
79
|
+
const { vertical, dropIndicatorPosition, isLast, isDropValid } = props;
|
|
80
|
+
if (dropIndicatorPosition === false || ![import_props.DropIndicatorPosition.After, import_props.DropIndicatorPosition.Before].includes(dropIndicatorPosition))
|
|
80
81
|
return null;
|
|
81
82
|
const safeDropIndicatorPosition = isLast ? import_props.DropIndicatorPosition.Before : dropIndicatorPosition;
|
|
82
83
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
83
84
|
children: [
|
|
84
|
-
CircleIndicator(getCircleStyles({
|
|
85
|
+
CircleIndicator(getCircleStyles({ ...props, dropIndicatorPosition: safeDropIndicatorPosition }), isDropValid),
|
|
85
86
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledIndicator, {
|
|
86
87
|
vertical,
|
|
87
|
-
dropIndicatorPosition: safeDropIndicatorPosition
|
|
88
|
+
dropIndicatorPosition: safeDropIndicatorPosition,
|
|
89
|
+
isDropValid
|
|
88
90
|
})
|
|
89
91
|
]
|
|
90
92
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/DropIndicator.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { ZIndexDataTable } from '../configs/zIndexInternalConfig';\nimport { DropIndicatorPosition } from '../types/props';\n\ninterface DropIndicatorProps {\n vertical: boolean;\n dropIndicatorPosition: DropIndicatorPosition;\n isLast?: boolean;\n}\n\nconst getPositionStyles = ({ dropIndicatorPosition, vertical }: DropIndicatorProps) => {\n if (vertical) {\n return `\n left: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n right: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n `;\n }\n return `\n top: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n bottom: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n `;\n};\n\nconst getCircleStyles = ({ dropIndicatorPosition, vertical }: DropIndicatorProps) => ({\n position: 'absolute',\n zIndex: ZIndexDataTable.DROP_INDICATOR,\n top: vertical || dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n bottom: vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n left: !vertical || dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n right: !vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n opacity: 1,\n});\n\nconst StyledIndicator = styled.div<DropIndicatorProps>`\n position: absolute;\n ${getPositionStyles}\n box-sizing: border-box;\n width: ${(props) => (props.vertical ? '2px' : '100%')};\n height: ${(props) => (props.vertical ? '100%' : '2px')};\n background-color: ${(
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,uBAAuB;AACvB,kCAAgC;AAChC,mBAAsC;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { ZIndexDataTable } from '../configs/zIndexInternalConfig';\nimport { DropIndicatorPosition } from '../types/props';\n\ninterface DropIndicatorProps {\n vertical: boolean;\n dropIndicatorPosition: false | DropIndicatorPosition;\n isDropValid: boolean;\n isLast?: boolean;\n}\n\nconst getPositionStyles = ({ dropIndicatorPosition, vertical }: DropIndicatorProps) => {\n if (vertical) {\n return `\n left: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n right: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n `;\n }\n return `\n top: ${dropIndicatorPosition === DropIndicatorPosition.Before ? '0' : 'unset'};\n bottom: ${dropIndicatorPosition === DropIndicatorPosition.After ? '0' : 'unset'};\n `;\n};\n\nconst getCircleStyles = ({ dropIndicatorPosition, vertical }: DropIndicatorProps) => ({\n position: 'absolute',\n zIndex: ZIndexDataTable.DROP_INDICATOR,\n top: vertical || dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n bottom: vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n left: !vertical || dropIndicatorPosition === DropIndicatorPosition.After ? 'unset' : '-2px',\n right: !vertical || dropIndicatorPosition === DropIndicatorPosition.Before ? 'unset' : '-2px',\n opacity: 1,\n});\n\nconst StyledIndicator = styled.div<DropIndicatorProps>`\n position: absolute;\n ${getPositionStyles}\n box-sizing: border-box;\n width: ${(props) => (props.vertical ? '2px' : '100%')};\n height: ${(props) => (props.vertical ? '100%' : '2px')};\n background-color: ${({ isDropValid, theme }) => (isDropValid ? theme.colors.brand[600] : theme.colors.danger[900])};\n z-index: ${ZIndexDataTable.DROP_INDICATOR};\n`;\n\nconst CircleIndicator = (style: Record<string, unknown>, isDropValid: boolean) => (\n <svg height=\"6\" width=\"6\" style={style}>\n <circle cx=\"3\" cy=\"3\" r=\"3\" strokeWidth=\"0\" fill={isDropValid ? '#1E79C2' : '#C64252'} />\n </svg>\n);\n\nconst DropIndicator: React.ComponentType<DropIndicatorProps> = (props) => {\n const { vertical, dropIndicatorPosition, isLast, isDropValid } = props;\n if (\n dropIndicatorPosition === false ||\n ![DropIndicatorPosition.After, DropIndicatorPosition.Before].includes(dropIndicatorPosition)\n )\n return null;\n\n const safeDropIndicatorPosition = isLast ? DropIndicatorPosition.Before : dropIndicatorPosition;\n\n return (\n <>\n {CircleIndicator(getCircleStyles({ ...props, dropIndicatorPosition: safeDropIndicatorPosition }), isDropValid)}\n <StyledIndicator\n vertical={vertical}\n dropIndicatorPosition={safeDropIndicatorPosition}\n isDropValid={isDropValid}\n />\n </>\n );\n};\n\nexport { DropIndicator };\nexport default DropIndicator;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";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M,cAAc,YAAY;AAAA,GAAW;AAAA,CACzF;AAGF,MAAM,gBAAyD,CAAC,UAAU;AACxE,QAAM,EAAE,UAAU,uBAAuB,QAAQ,YAAY,IAAI;AACjE,MACE,0BAA0B,SAC1B,CAAC,CAAC,mCAAsB,OAAO,mCAAsB,MAAM,EAAE,SAAS,qBAAqB;AAE3F,WAAO;AAET,QAAM,4BAA4B,SAAS,mCAAsB,SAAS;AAE1E,SACE;AAAA,IACG;AAAA,sBAAgB,gBAAgB,EAAE,GAAG,OAAO,uBAAuB,0BAA0B,CAAC,GAAG,WAAW;AAAA,MAC7G,4CAAC;AAAA,QACC;AAAA,QACA,uBAAuB;AAAA,QACvB;AAAA,OACF;AAAA;AAAA,GACF;AAEJ;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -100,7 +100,8 @@ const HeaderCellGroupComp = ({
|
|
|
100
100
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropIndicator.DropIndicator, {
|
|
101
101
|
vertical: true,
|
|
102
102
|
dropIndicatorPosition,
|
|
103
|
-
isLast: isLast && isDragging
|
|
103
|
+
isLast: isLast && isDragging,
|
|
104
|
+
isDropValid: true
|
|
104
105
|
})
|
|
105
106
|
]
|
|
106
107
|
});
|