@elliemae/ds-datagrids 2.0.0-alpha.10 → 2.0.0-alpha.14
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/cjs/DSDataGrid.js +246 -243
- package/cjs/DataGridImpl.js +18 -9
- package/cjs/PaginatedDataGrid.js +5 -0
- package/cjs/blockNames.js +2 -2
- package/cjs/columns/IconColumn.js +19 -17
- package/cjs/columns/NumberColumn.js +2 -4
- package/cjs/components/BodyCell.js +20 -12
- package/cjs/components/BodyList.js +7 -0
- package/cjs/components/ColumnVisibilityMenuOption.js +12 -6
- package/cjs/components/ColumnsOptionsMenuSection.js +35 -28
- package/cjs/components/EmptyState.js +19 -17
- package/cjs/components/HeaderCell.js +15 -9
- package/cjs/components/List.js +5 -0
- package/cjs/components/ListItem.js +7 -0
- package/cjs/components/NoResults.js +5 -0
- package/cjs/components/RowsLoader.js +5 -4
- package/cjs/components/Table.js +5 -0
- package/cjs/components/TableBody.js +5 -0
- package/cjs/components/TableHeader.js +5 -0
- package/cjs/components/footer/addOptionalFooterComponents.js +5 -4
- package/cjs/components/header/PrimaryControls.js +20 -15
- package/cjs/components/header/addOptionalHeaderComponents.js +4 -3
- package/cjs/components/renderers/defaultClassedRenderers.js +35 -23
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +50 -39
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js +11 -7
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +2 -3
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +11 -9
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +13 -6
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +3 -3
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js +23 -17
- package/cjs/plugins/column-sizing/useColumnSizeService.js +13 -3
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js +69 -53
- package/cjs/plugins/column-sizing/utils.js +10 -6
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +9 -4
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +20 -21
- package/cjs/plugins/editable/EditableComponents/ComboBox.js +9 -6
- package/cjs/plugins/editable/EditableComponents/TextBox.js +22 -17
- package/cjs/plugins/editable/EditablePlugin.js +16 -15
- package/cjs/plugins/editable/decorateEditable.js +19 -11
- package/cjs/plugins/editable/getEditorComponent.js +45 -34
- package/cjs/plugins/expandable-grid/ExpandableColumn.js +60 -53
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js +38 -26
- package/cjs/plugins/expandable-grid/ExpandedRow.js +28 -18
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +18 -12
- package/cjs/plugins/expandable-grid/useExpandGridState.js +4 -8
- package/cjs/plugins/export-data/ExportDataPlugin.js +31 -17
- package/cjs/plugins/filterable/FilterablePlugin.js +7 -6
- package/cjs/plugins/filterable/addFilterToColumn.js +5 -0
- package/cjs/plugins/filterable/components/FilterableHeader.js +36 -27
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +41 -34
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +28 -23
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +122 -156
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +29 -20
- package/cjs/plugins/filterable/filterableFormatter.js +15 -10
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +16 -4
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +7 -4
- package/cjs/plugins/filterable/helper.js +17 -7
- package/cjs/plugins/filterable/useFilterableState.js +12 -5
- package/cjs/plugins/grouping-by/GroupingByPlugin.js +3 -1
- package/cjs/plugins/grouping-grid/GroupingPlugin.js +10 -1
- package/cjs/plugins/grouping-grid/walkStrategy.js +13 -9
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +8 -1
- package/cjs/plugins/pagination/PaginationPlugin.js +9 -2
- package/cjs/plugins/pagination/components/Pagination.js +10 -9
- package/cjs/plugins/pagination/components/Paginator.js +21 -20
- package/cjs/plugins/pagination/components/PerPageDropdown.js +20 -13
- package/cjs/plugins/pagination/helper.js +10 -7
- package/cjs/plugins/pagination/usePaginationState.js +8 -3
- package/cjs/plugins/resizable/ResizablePlugin.js +5 -4
- package/cjs/plugins/resizable/decorateResizable.js +14 -8
- package/cjs/plugins/resizable/useResizeHandle.js +21 -16
- package/cjs/plugins/resizable/utils.js +9 -6
- package/cjs/plugins/row-dnd/DndRowsPlugin.js +24 -16
- package/cjs/plugins/selectable/SelectablePlugin.js +11 -10
- package/cjs/plugins/selectable/addSelectableColumn.js +24 -16
- package/cjs/plugins/selectable/helper.js +12 -3
- package/cjs/plugins/selectable/selectableFormatter.js +80 -71
- package/cjs/plugins/selectable/useSelectableState.js +25 -11
- package/cjs/plugins/sortable/SortablePlugin.js +8 -7
- package/cjs/plugins/sortable/sortHeaderFormatter.js +14 -15
- package/cjs/plugins/sortable/sortTree.js +13 -3
- package/cjs/plugins/sortable/sorter.js +152 -134
- package/cjs/plugins/sortable/useSortableState.js +8 -0
- package/cjs/plugins/toolbar/RowRenderer.js +9 -3
- package/cjs/plugins/toolbar/ToolbarPlugin.js +1 -0
- package/cjs/plugins/toolbar/ToolbarTrigger.js +18 -13
- package/cjs/plugins/virtualization/AutoHeightList.js +10 -8
- package/cjs/plugins/virtualization/VirtualizationPlugin.js +32 -25
- package/cjs/plugins/virtualization/VirtualizedBody.js +20 -10
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js +8 -7
- package/cjs/renders/CellWithAddons.js +20 -18
- package/cjs/renders/styled.js +5 -16
- package/cjs/utilities/getPluginsFromProps.js +5 -1
- package/cjs/utilities/getScrollbarSize.js +2 -1
- package/cjs/utilities/normalizeData.js +7 -1
- package/esm/DSDataGrid.js +246 -243
- package/esm/DataGridImpl.js +18 -9
- package/esm/PaginatedDataGrid.js +5 -0
- package/esm/blockNames.js +2 -2
- package/esm/columns/IconColumn.js +19 -17
- package/esm/columns/NumberColumn.js +2 -4
- package/esm/components/BodyCell.js +20 -12
- package/esm/components/BodyList.js +7 -0
- package/esm/components/ColumnVisibilityMenuOption.js +12 -6
- package/esm/components/ColumnsOptionsMenuSection.js +35 -28
- package/esm/components/EmptyState.js +18 -15
- package/esm/components/HeaderCell.js +15 -9
- package/esm/components/List.js +5 -0
- package/esm/components/ListItem.js +7 -0
- package/esm/components/NoResults.js +5 -0
- package/esm/components/RowsLoader.js +5 -4
- package/esm/components/Table.js +5 -0
- package/esm/components/TableBody.js +5 -0
- package/esm/components/TableHeader.js +5 -0
- package/esm/components/footer/addOptionalFooterComponents.js +5 -4
- package/esm/components/header/PrimaryControls.js +20 -14
- package/esm/components/header/addOptionalHeaderComponents.js +4 -3
- package/esm/components/renderers/defaultClassedRenderers.js +35 -23
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +50 -39
- package/esm/plugins/column-dnd/DndColumnsPlugin.js +8 -4
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js +1 -1
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js +10 -8
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js +12 -5
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
- package/esm/plugins/column-sizing/ext-points/getTableProps.js +22 -15
- package/esm/plugins/column-sizing/useColumnSizeService.js +13 -3
- package/esm/plugins/column-sizing/useStylesheetHelpers.js +67 -51
- package/esm/plugins/column-sizing/utils.js +8 -4
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +6 -1
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js +15 -11
- package/esm/plugins/editable/EditableComponents/ComboBox.js +8 -4
- package/esm/plugins/editable/EditableComponents/TextBox.js +21 -15
- package/esm/plugins/editable/EditablePlugin.js +14 -12
- package/esm/plugins/editable/decorateEditable.js +18 -9
- package/esm/plugins/editable/getEditorComponent.js +49 -38
- package/esm/plugins/expandable-grid/ExpandableColumn.js +59 -50
- package/esm/plugins/expandable-grid/ExpandablePlugin.js +34 -20
- package/esm/plugins/expandable-grid/ExpandedRow.js +27 -17
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js +17 -11
- package/esm/plugins/expandable-grid/useExpandGridState.js +2 -2
- package/esm/plugins/export-data/ExportDataPlugin.js +30 -16
- package/esm/plugins/filterable/FilterablePlugin.js +5 -4
- package/esm/plugins/filterable/addFilterToColumn.js +5 -0
- package/esm/plugins/filterable/components/FilterableHeader.js +32 -22
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +41 -33
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +28 -22
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +121 -154
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +28 -18
- package/esm/plugins/filterable/filterableFormatter.js +15 -10
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +14 -2
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js +7 -4
- package/esm/plugins/filterable/helper.js +11 -1
- package/esm/plugins/filterable/useFilterableState.js +12 -5
- package/esm/plugins/grouping-by/GroupingByPlugin.js +3 -1
- package/esm/plugins/grouping-grid/GroupingPlugin.js +10 -1
- package/esm/plugins/grouping-grid/walkStrategy.js +13 -9
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +8 -1
- package/esm/plugins/pagination/PaginationPlugin.js +8 -1
- package/esm/plugins/pagination/components/Pagination.js +10 -9
- package/esm/plugins/pagination/components/Paginator.js +20 -19
- package/esm/plugins/pagination/components/PerPageDropdown.js +17 -9
- package/esm/plugins/pagination/helper.js +10 -7
- package/esm/plugins/pagination/usePaginationState.js +7 -1
- package/esm/plugins/resizable/ResizablePlugin.js +4 -3
- package/esm/plugins/resizable/decorateResizable.js +14 -8
- package/esm/plugins/resizable/useResizeHandle.js +21 -16
- package/esm/plugins/resizable/utils.js +7 -4
- package/esm/plugins/row-dnd/DndRowsPlugin.js +22 -13
- package/esm/plugins/selectable/SelectablePlugin.js +10 -9
- package/esm/plugins/selectable/addSelectableColumn.js +24 -16
- package/esm/plugins/selectable/helper.js +10 -1
- package/esm/plugins/selectable/selectableFormatter.js +79 -68
- package/esm/plugins/selectable/useSelectableState.js +20 -5
- package/esm/plugins/sortable/SortablePlugin.js +5 -4
- package/esm/plugins/sortable/sortHeaderFormatter.js +12 -11
- package/esm/plugins/sortable/sortTree.js +13 -3
- package/esm/plugins/sortable/sorter.js +152 -134
- package/esm/plugins/sortable/useSortableState.js +8 -0
- package/esm/plugins/toolbar/RowRenderer.js +8 -2
- package/esm/plugins/toolbar/ToolbarPlugin.js +1 -0
- package/esm/plugins/toolbar/ToolbarTrigger.js +17 -11
- package/esm/plugins/virtualization/AutoHeightList.js +6 -3
- package/esm/plugins/virtualization/VirtualizationPlugin.js +31 -24
- package/esm/plugins/virtualization/VirtualizedBody.js +16 -6
- package/esm/plugins/virtualization/VirtualizedBodyRow.js +8 -7
- package/esm/renders/CellWithAddons.js +15 -14
- package/esm/renders/styled.js +3 -15
- package/esm/utilities/getPluginsFromProps.js +5 -1
- package/esm/utilities/getScrollbarSize.js +2 -1
- package/esm/utilities/normalizeData.js +7 -1
- package/package.json +27 -18
- package/types/DSDataGrid.d.ts +744 -105
- package/types/components/BodyCell.d.ts +1 -1
- package/types/components/HeaderCell.d.ts +1 -1
- package/types/plugins/column-sizing/columnMeasurerTransformer.d.ts +1 -1
- package/types/plugins/column-sizing/ext-points/getTableProps.d.ts +1 -1
- package/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +1 -1
- package/types/plugins/expandable-grid/useExpandGridState.d.ts +4 -4
- package/types/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +1 -1
- package/types/plugins/filterable/helper.d.ts +15 -3
- package/types/plugins/pagination/components/Paginator.d.ts +1 -1
- package/types/plugins/pagination/components/PerPageDropdown.d.ts +1 -1
- package/types/plugins/sortable/sorter.d.ts +1 -1
- package/types/renders/styled.d.ts +3 -3
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
11
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
12
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
8
13
|
var React = require('react');
|
|
9
|
-
var
|
|
14
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
15
|
var ScrollSync = require('@elliemae/ds-shared/ScrollSync');
|
|
11
16
|
var createInstancePlugin = require('@elliemae/ds-shared/createDataInstance/createInstancePlugin');
|
|
12
17
|
var getScrollbarSize = require('../../utilities/getScrollbarSize.js');
|
|
@@ -26,13 +31,16 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
26
31
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
32
|
getScrollbarSize.getScrollbarWidth(2);
|
|
28
33
|
|
|
29
|
-
const HeaderSyncHoc = Component => props => /*#__PURE__*/_jsx__default["default"](ScrollSync.ScrollSyncPane, {}, void 0,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
+
const HeaderSyncHoc = Component => props => /*#__PURE__*/_jsx__default["default"](ScrollSync.ScrollSyncPane, {}, void 0, _ref => {
|
|
35
|
+
let {
|
|
36
|
+
registerPane
|
|
37
|
+
} = _ref;
|
|
38
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), {}, {
|
|
39
|
+
innerRef: dsUtilities.mergeRefs(props.innerRef, registerPane)
|
|
40
|
+
}));
|
|
41
|
+
});
|
|
34
42
|
|
|
35
|
-
const BodySyncHoc = (Component, notPaginated, grid) =>
|
|
43
|
+
const BodySyncHoc = (Component, notPaginated, grid) => _ref2 => {
|
|
36
44
|
let {
|
|
37
45
|
children,
|
|
38
46
|
classProps,
|
|
@@ -55,14 +63,14 @@ const BodySyncHoc = (Component, notPaginated, grid) => _ref => {
|
|
|
55
63
|
useDragHandle,
|
|
56
64
|
className,
|
|
57
65
|
listComponent
|
|
58
|
-
} =
|
|
59
|
-
rest = _objectWithoutProperties__default["default"](
|
|
66
|
+
} = _ref2,
|
|
67
|
+
rest = _objectWithoutProperties__default["default"](_ref2, _excluded);
|
|
60
68
|
|
|
61
69
|
const t = React.useRef();
|
|
62
70
|
|
|
63
71
|
const repositionToolbarBasedOnBodyScrollPosition = SCROLLBAR_WIDTH => () => {
|
|
64
|
-
grid.refs.body.current.style.setProperty('--toolbar-scroll',
|
|
65
|
-
grid.refs.body.current.style.setProperty('--toolbar-scroll-paginated',
|
|
72
|
+
grid.refs.body.current.style.setProperty('--toolbar-scroll', "".concat(grid.refs.body.current.offsetWidth + grid.refs.body.current.scrollLeft - 15, "px"));
|
|
73
|
+
grid.refs.body.current.style.setProperty('--toolbar-scroll-paginated', "".concat(grid.refs.body.current.offsetWidth + grid.refs.body.current.scrollLeft - 19, "px"));
|
|
66
74
|
};
|
|
67
75
|
|
|
68
76
|
React.useEffect(() => {
|
|
@@ -76,39 +84,42 @@ const BodySyncHoc = (Component, notPaginated, grid) => _ref => {
|
|
|
76
84
|
});
|
|
77
85
|
return /*#__PURE__*/_jsx__default["default"](ScrollSync.ScrollSyncPane, {
|
|
78
86
|
notPaginated: notPaginated
|
|
79
|
-
}, void 0,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
87
|
+
}, void 0, _ref3 => {
|
|
88
|
+
let {
|
|
89
|
+
registerPane
|
|
90
|
+
} = _ref3;
|
|
91
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({
|
|
92
|
+
ref: t,
|
|
93
|
+
classProps: classProps,
|
|
94
|
+
className: className,
|
|
95
|
+
listComponent: listComponent,
|
|
96
|
+
columns: columns,
|
|
97
|
+
getContainer: getContainer,
|
|
98
|
+
helperClass: helperClass,
|
|
99
|
+
innerBodyRef: innerBodyRef // innerRef={innerRef}
|
|
100
|
+
,
|
|
101
|
+
isPlaceholderActive: isPlaceholderActive,
|
|
102
|
+
listProps: listProps,
|
|
103
|
+
lockAxis: lockAxis,
|
|
104
|
+
noResultsPlaceholder: noResultsPlaceholder,
|
|
105
|
+
numRowsVisible: numRowsVisible,
|
|
106
|
+
onSortEnd: onSortEnd,
|
|
107
|
+
onSortOver: onSortOver,
|
|
108
|
+
onSortStart: onSortStart,
|
|
109
|
+
rowKey: rowKey,
|
|
110
|
+
rowRenderer: rowRenderer,
|
|
111
|
+
rows: rows,
|
|
112
|
+
useDragHandle: useDragHandle,
|
|
113
|
+
innerRef: dsUtilities.mergeRefs(innerRef, registerPane, t)
|
|
114
|
+
}, rest));
|
|
115
|
+
});
|
|
105
116
|
};
|
|
106
117
|
|
|
107
118
|
const TableSyncHoc = Component => props => /*#__PURE__*/_jsx__default["default"](ScrollSync.ScrollSync, {
|
|
108
119
|
proportional: false,
|
|
109
120
|
onScroll: e => {
|
|
110
|
-
e.target.style.setProperty('--toolbar-scroll',
|
|
111
|
-
e.target.style.setProperty('--toolbar-scroll-paginated',
|
|
121
|
+
e.target.style.setProperty('--toolbar-scroll', "".concat(e.target.offsetWidth + e.target.scrollLeft - 15, "px"));
|
|
122
|
+
e.target.style.setProperty('--toolbar-scroll-paginated', "".concat(e.target.offsetWidth + e.target.scrollLeft - 19, "px"));
|
|
112
123
|
}
|
|
113
124
|
}, void 0, /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread({}, props)));
|
|
114
125
|
|
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
11
|
var React = require('react');
|
|
7
12
|
var reactSortableHoc = require('react-sortable-hoc');
|
|
8
|
-
var
|
|
9
|
-
var system = require('@elliemae/ds-utilities/system');
|
|
13
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
14
|
var createInstancePlugin = require('@elliemae/ds-shared/createDataInstance/createInstancePlugin');
|
|
11
15
|
var decorateGridWithDndColumns = require('./decorateGridWithDndColumns.js');
|
|
12
16
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -54,13 +58,13 @@ const getHeaderRowProps = (props, grid) => {
|
|
|
54
58
|
columnDraggingOffset.current += forward ? newColumnWidth : newColumnWidth * -1;
|
|
55
59
|
newColumn.updateStyle({
|
|
56
60
|
transitionDuration: '300ms',
|
|
57
|
-
transform:
|
|
61
|
+
transform: "translate3d(".concat(columnTranslate, "px, 0, 0)")
|
|
58
62
|
});
|
|
59
63
|
oldColumn.updateStyle({
|
|
60
64
|
transitionDuration: '300ms',
|
|
61
|
-
transform:
|
|
65
|
+
transform: "translate3d(".concat(columnDraggingOffset.current, "px, 0, 0)")
|
|
62
66
|
});
|
|
63
|
-
sortedColumns.current =
|
|
67
|
+
sortedColumns.current = dsUtilities.arrayMove(sortedColumns.current, oldIndex, newIndex);
|
|
64
68
|
onMoveColumnOver(params);
|
|
65
69
|
};
|
|
66
70
|
|
|
@@ -99,7 +103,7 @@ const getHeaderRowProps = (props, grid) => {
|
|
|
99
103
|
return {
|
|
100
104
|
axis: 'x',
|
|
101
105
|
helperClass: 'header-dnd-column',
|
|
102
|
-
innerRef:
|
|
106
|
+
innerRef: dsUtilities.mergeRefs(props.innerRef, headerRowRef),
|
|
103
107
|
lockAxis: 'x',
|
|
104
108
|
onSortEnd,
|
|
105
109
|
onSortOver,
|
|
@@ -111,7 +115,7 @@ const getHeaderRowProps = (props, grid) => {
|
|
|
111
115
|
const decorateRenderers = renderers => {
|
|
112
116
|
const RowComponent = renderers.header.row;
|
|
113
117
|
const CellComponent = renderers.header.cell;
|
|
114
|
-
const Row = React.useMemo(() => reactSortableHoc.SortableContainer(props => /*#__PURE__*/jsxRuntime.jsx(RowComponent, _objectSpread({},
|
|
118
|
+
const Row = React.useMemo(() => reactSortableHoc.SortableContainer(props => /*#__PURE__*/jsxRuntime.jsx(RowComponent, _objectSpread({}, dsUtilities.omit(props, keysToOmit)))), []);
|
|
115
119
|
const Cell = React.useMemo(() => reactSortableHoc.SortableElement(CellComponent), []);
|
|
116
120
|
return _objectSpread(_objectSpread({}, renderers), {}, {
|
|
117
121
|
header: _objectSpread(_objectSpread({}, renderers.header), {}, {
|
|
@@ -5,17 +5,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
require('react');
|
|
7
7
|
var reactSortableHoc = require('react-sortable-hoc');
|
|
8
|
-
var
|
|
8
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
9
9
|
var initColumnDefinition = require('@elliemae/ds-shared/useDataGrid/initColumnDefinition');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
13
|
|
|
14
14
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
15
|
-
var GripperVertical__default = /*#__PURE__*/_interopDefaultLegacy(GripperVertical);
|
|
16
15
|
|
|
17
16
|
var _GripperVertical, _DragHandle;
|
|
18
|
-
const DragHandle = reactSortableHoc.SortableHandle(() => _GripperVertical || (_GripperVertical = /*#__PURE__*/_jsx__default["default"](
|
|
17
|
+
const DragHandle = reactSortableHoc.SortableHandle(() => _GripperVertical || (_GripperVertical = /*#__PURE__*/_jsx__default["default"](dsIcons.GripperVertical, {
|
|
19
18
|
className: "drag-handle"
|
|
20
19
|
})));
|
|
21
20
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
7
7
|
var createInstancePlugin = require('@elliemae/ds-shared/createDataInstance/createInstancePlugin');
|
|
8
8
|
var useStylesheetHelpers = require('./useStylesheetHelpers.js');
|
|
9
9
|
var useColumnSizeService = require('./useColumnSizeService.js');
|
|
@@ -16,17 +16,19 @@ var createInstancePlugin__default = /*#__PURE__*/_interopDefaultLegacy(createIns
|
|
|
16
16
|
|
|
17
17
|
/* eslint-disable no-param-reassign */
|
|
18
18
|
|
|
19
|
-
const getHeaderRowProps = (rowProps, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const getHeaderRowProps = (rowProps, _ref) => {
|
|
20
|
+
let {
|
|
21
|
+
rowsStylesheet
|
|
22
|
+
} = _ref;
|
|
23
|
+
rowProps.className = "".concat(rowsStylesheet.getRowClassName(), "-header");
|
|
23
24
|
return rowProps;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
const getRowProps = (rowProps, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const getRowProps = (rowProps, _ref2) => {
|
|
28
|
+
let {
|
|
29
|
+
rowsStylesheet
|
|
30
|
+
} = _ref2;
|
|
31
|
+
rowProps.className = dsUtilities.cx(rowProps.className, rowsStylesheet.getRowClassName());
|
|
30
32
|
return rowProps;
|
|
31
33
|
};
|
|
32
34
|
|
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
11
|
var React = require('react');
|
|
7
|
-
var
|
|
12
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
8
13
|
|
|
9
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
15
|
|
|
@@ -13,10 +18,12 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
13
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
19
|
|
|
15
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
16
|
-
const columnMeasurerTransformer = columnSizeService => (value, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
const columnMeasurerTransformer = columnSizeService => function (value, _ref) {
|
|
22
|
+
let {
|
|
23
|
+
column,
|
|
24
|
+
grid
|
|
25
|
+
} = _ref;
|
|
26
|
+
let props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
20
27
|
const {
|
|
21
28
|
registerColumn
|
|
22
29
|
} = columnSizeService;
|
|
@@ -60,7 +67,7 @@ const columnMeasurerTransformer = columnSizeService => (value, {
|
|
|
60
67
|
}
|
|
61
68
|
});
|
|
62
69
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
63
|
-
innerRef:
|
|
70
|
+
innerRef: dsUtilities.mergeRefs(cellRef, props.innerRef, registerColumn(column))
|
|
64
71
|
});
|
|
65
72
|
};
|
|
66
73
|
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
6
6
|
var columnMeasurerTransformer = require('../columnMeasurerTransformer.js');
|
|
7
7
|
|
|
8
8
|
function decorateColumn(column, grid, index) {
|
|
9
9
|
const transformsPath = ['header', 'transforms'];
|
|
10
|
-
const transforms =
|
|
10
|
+
const transforms = dsUtilities.get(column, transformsPath, []);
|
|
11
11
|
transforms.push(columnMeasurerTransformer.columnMeasurerTransformer(grid.columnSizeService));
|
|
12
12
|
column.index = index;
|
|
13
|
-
|
|
13
|
+
dsUtilities.set(column, transformsPath, transforms);
|
|
14
14
|
return column;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -3,33 +3,39 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
12
|
var React = require('react');
|
|
7
|
-
var
|
|
8
|
-
var system = require('@elliemae/ds-utilities/system');
|
|
13
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
9
14
|
var utils = require('../utils.js');
|
|
10
15
|
|
|
11
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
17
|
|
|
13
18
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
14
|
-
var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);
|
|
15
19
|
|
|
16
20
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
21
|
|
|
18
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
function getTableProps(tableProps, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
function getTableProps(tableProps, _ref) {
|
|
24
|
+
let {
|
|
25
|
+
refs,
|
|
26
|
+
tableRef,
|
|
27
|
+
bodyWidth,
|
|
28
|
+
scrollbarWidth,
|
|
29
|
+
isDragging,
|
|
30
|
+
columnSizeService,
|
|
31
|
+
updateRowWidth,
|
|
32
|
+
columns
|
|
33
|
+
} = _ref;
|
|
29
34
|
const [tableNode, tableRefCallback] = React.useState();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
dsUtilities.useResizeObserver(_ref2 => {
|
|
36
|
+
let {
|
|
37
|
+
width
|
|
38
|
+
} = _ref2;
|
|
33
39
|
if (!refs.header.current) return;
|
|
34
40
|
if (typeof scrollbarWidth.current !== 'number') scrollbarWidth.current = utils.getScrollbarSizeFromHeaderAndBody(refs);
|
|
35
41
|
if (typeof bodyWidth.current !== 'number') bodyWidth.current = refs.body.offsetWidth; // DataGrid: header with width 0 after redirect from details page (https://jira.elliemae.io/browse/PUI-2162)
|
|
@@ -50,7 +56,7 @@ function getTableProps(tableProps, {
|
|
|
50
56
|
if (typeof bodyWidth.current !== 'number') bodyWidth.current = refs.body.clientWidth;
|
|
51
57
|
}, [columns, tableNode]);
|
|
52
58
|
return _objectSpread(_objectSpread({}, tableProps), {}, {
|
|
53
|
-
innerRef:
|
|
59
|
+
innerRef: dsUtilities.mergeRefs(tableRefCallback, tableProps.innerRef, tableRef)
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
4
14
|
var React = require('react');
|
|
5
15
|
var utils = require('./utils.js');
|
|
6
16
|
|
|
@@ -47,7 +57,7 @@ function useColumnSizeService(instance) {
|
|
|
47
57
|
const columnsArray = Object.values(columns.current);
|
|
48
58
|
columnsArray.forEach(column => {
|
|
49
59
|
const columnOffsetWidth = column.node.offsetWidth;
|
|
50
|
-
column.updateBodyHeaderWidth(
|
|
60
|
+
column.updateBodyHeaderWidth("".concat(columnOffsetWidth, "px"), "".concat(columnOffsetWidth, "px"));
|
|
51
61
|
});
|
|
52
62
|
};
|
|
53
63
|
|
|
@@ -101,7 +111,7 @@ function useColumnSizeService(instance) {
|
|
|
101
111
|
|
|
102
112
|
if (percentValue) {
|
|
103
113
|
const pxs = gridWidth * percentValue / 100;
|
|
104
|
-
const pxWidths =
|
|
114
|
+
const pxWidths = "".concat(utils.getColumnWidthSize(pxs, minColumnWidth, column), "px");
|
|
105
115
|
column.updateBodyHeaderWidth(pxWidths, pxWidths);
|
|
106
116
|
columns.current[column.uuid].computedWidth = pxs;
|
|
107
117
|
|
|
@@ -114,7 +124,7 @@ function useColumnSizeService(instance) {
|
|
|
114
124
|
const percentWidth = columnFixWidth / gridWidth * 100;
|
|
115
125
|
const pxs = gridWidth * percentWidth / 100;
|
|
116
126
|
const actualWidthAfterChecks = utils.getColumnWidthSize(pxs, minColumnWidth, column);
|
|
117
|
-
column.updateBodyHeaderWidth(
|
|
127
|
+
column.updateBodyHeaderWidth("".concat(actualWidthAfterChecks, "px"), column.minWidth || minColumnWidth ? "".concat(column.minWidth || minColumnWidth, "px") : "".concat(pxs, "px"));
|
|
118
128
|
resizedColumns.current[column.uuid] = actualWidthAfterChecks;
|
|
119
129
|
columns.current[column.uuid].computedWidth = actualWidthAfterChecks;
|
|
120
130
|
}
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
8
|
var stylesheet = require('stylesheet-helpers');
|
|
6
9
|
var React = require('react');
|
|
7
|
-
var
|
|
10
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
8
11
|
var getColumnNameFromProperty = require('./getColumnNameFromProperty.js');
|
|
9
12
|
var getScrollbarSize = require('../../utilities/getScrollbarSize.js');
|
|
10
13
|
|
|
@@ -28,19 +31,19 @@ function _interopNamespace(e) {
|
|
|
28
31
|
|
|
29
32
|
var stylesheet__namespace = /*#__PURE__*/_interopNamespace(stylesheet);
|
|
30
33
|
|
|
31
|
-
/* eslint-disable no-param-reassign */
|
|
32
34
|
const SCROLLBAR_WIDTH = getScrollbarSize.getScrollbarWidth();
|
|
33
|
-
const RowStylesheetHelper =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const RowStylesheetHelper = _ref => {
|
|
36
|
+
let {
|
|
37
|
+
grid,
|
|
38
|
+
className
|
|
39
|
+
} = _ref;
|
|
37
40
|
const {
|
|
38
41
|
styleSheet,
|
|
39
42
|
styleSheetElement
|
|
40
43
|
} = stylesheet__namespace.create();
|
|
41
44
|
|
|
42
45
|
const update = width => {
|
|
43
|
-
const widths = typeof width === 'string' ? width :
|
|
46
|
+
const widths = typeof width === 'string' ? width : "".concat(width, "px");
|
|
44
47
|
stylesheet__namespace.updateProperties(window, styleSheet, className, width ? {
|
|
45
48
|
width: widths,
|
|
46
49
|
minWidth: widths,
|
|
@@ -53,8 +56,8 @@ const RowStylesheetHelper = ({
|
|
|
53
56
|
const {
|
|
54
57
|
hasScroll
|
|
55
58
|
} = grid.getState();
|
|
56
|
-
const headerWidth =
|
|
57
|
-
stylesheet__namespace.updateProperties(window, styleSheet,
|
|
59
|
+
const headerWidth = "".concat(width + (hasScroll ? SCROLLBAR_WIDTH : 0), "px");
|
|
60
|
+
stylesheet__namespace.updateProperties(window, styleSheet, "".concat(className, "-header"), width ? {
|
|
58
61
|
width: headerWidth,
|
|
59
62
|
minWidth: headerWidth,
|
|
60
63
|
maxWidth: headerWidth
|
|
@@ -76,58 +79,68 @@ const RowStylesheetHelper = ({
|
|
|
76
79
|
};
|
|
77
80
|
};
|
|
78
81
|
|
|
79
|
-
const getColumnClassName =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
const getColumnClassName = _ref2 => {
|
|
83
|
+
let {
|
|
84
|
+
globalId,
|
|
85
|
+
column,
|
|
86
|
+
isHeader = false,
|
|
87
|
+
getId
|
|
88
|
+
} = _ref2;
|
|
89
|
+
return "column-".concat(globalId, "-").concat(getId(column)).concat(isHeader ? '-header' : '');
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
function setWidth(_ref3) {
|
|
93
|
+
let {
|
|
94
|
+
styleSheet,
|
|
95
|
+
className,
|
|
96
|
+
width,
|
|
97
|
+
minWidth
|
|
98
|
+
} = _ref3;
|
|
92
99
|
let widths;
|
|
93
100
|
if (typeof width === 'string') widths = width;
|
|
94
|
-
if (typeof width === 'number') widths =
|
|
101
|
+
if (typeof width === 'number') widths = "".concat(width, "px");
|
|
95
102
|
let minWidths;
|
|
96
103
|
if (typeof minWidth === 'string') minWidths = minWidth;
|
|
97
|
-
if (typeof minWidth === 'number') minWidths =
|
|
104
|
+
if (typeof minWidth === 'number') minWidths = "".concat(minWidth, "px");
|
|
98
105
|
stylesheet__namespace.updateProperties(window, styleSheet, className, {
|
|
99
|
-
width:
|
|
100
|
-
minWidth:
|
|
106
|
+
width: "".concat(widths || minWidths),
|
|
107
|
+
minWidth: "".concat(widths || minWidths),
|
|
101
108
|
// minWidth: `${minWidths || widths}`,
|
|
102
|
-
maxWidth:
|
|
109
|
+
maxWidth: "".concat(widths || minWidths)
|
|
103
110
|
});
|
|
104
111
|
}
|
|
105
112
|
|
|
106
|
-
function updateStyle({
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
function updateStyle(_ref4) {
|
|
114
|
+
let {
|
|
115
|
+
styleSheet,
|
|
116
|
+
className,
|
|
117
|
+
style
|
|
118
|
+
} = _ref4;
|
|
111
119
|
stylesheet__namespace.updateProperties(window, styleSheet, className, style);
|
|
112
120
|
}
|
|
113
121
|
|
|
114
|
-
function columnSizesHelperImpl({
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
function columnSizesHelperImpl(_ref5) {
|
|
123
|
+
let {
|
|
124
|
+
globalId,
|
|
125
|
+
getId = _ref6 => {
|
|
126
|
+
let {
|
|
127
|
+
property
|
|
128
|
+
} = _ref6;
|
|
129
|
+
return getColumnNameFromProperty(property);
|
|
130
|
+
}
|
|
131
|
+
} = _ref5;
|
|
120
132
|
const {
|
|
121
133
|
styleSheetElement,
|
|
122
134
|
styleSheet
|
|
123
135
|
} = stylesheet__namespace.create();
|
|
124
136
|
|
|
125
|
-
const updateBodyHeaderWidth =
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
const updateBodyHeaderWidth = _ref7 => {
|
|
138
|
+
let {
|
|
139
|
+
className,
|
|
140
|
+
headerClassName,
|
|
141
|
+
width,
|
|
142
|
+
minWidth
|
|
143
|
+
} = _ref7;
|
|
131
144
|
setWidth({
|
|
132
145
|
styleSheet,
|
|
133
146
|
className,
|
|
@@ -156,9 +169,9 @@ function columnSizesHelperImpl({
|
|
|
156
169
|
getId,
|
|
157
170
|
column
|
|
158
171
|
});
|
|
159
|
-
const headerClassName =
|
|
160
|
-
|
|
161
|
-
|
|
172
|
+
const headerClassName = "".concat(cellClassName, "-header");
|
|
173
|
+
dsUtilities.set(column, 'header.props.className', headerClassName);
|
|
174
|
+
dsUtilities.set(column, 'cell.props.className', cellClassName);
|
|
162
175
|
|
|
163
176
|
column.updateBodyHeaderWidth = (width, minWidth) => {
|
|
164
177
|
updateBodyHeaderWidth({
|
|
@@ -211,11 +224,11 @@ function columnSizesHelperImpl({
|
|
|
211
224
|
},
|
|
212
225
|
|
|
213
226
|
getColumnHeaderClassName(column) {
|
|
214
|
-
return
|
|
227
|
+
return "".concat(getColumnClassName({
|
|
215
228
|
globalId,
|
|
216
229
|
getId,
|
|
217
230
|
column
|
|
218
|
-
})
|
|
231
|
+
}), "-header");
|
|
219
232
|
},
|
|
220
233
|
|
|
221
234
|
cleanup() {
|
|
@@ -234,11 +247,14 @@ function useStylesheetHelpers(grid) {
|
|
|
234
247
|
} = grid;
|
|
235
248
|
const [columnsStylesheet] = React.useState(() => columnSizesHelperImpl({
|
|
236
249
|
globalId: bindColumnsSizeTo || grid.uuid,
|
|
237
|
-
getId:
|
|
238
|
-
|
|
239
|
-
|
|
250
|
+
getId: _ref8 => {
|
|
251
|
+
let {
|
|
252
|
+
uuid
|
|
253
|
+
} = _ref8;
|
|
254
|
+
return getColumnNameFromProperty(uuid);
|
|
255
|
+
}
|
|
240
256
|
}));
|
|
241
|
-
const rowClassName =
|
|
257
|
+
const rowClassName = "row-".concat(bindRowSizeTo || grid.uuid);
|
|
242
258
|
const [rowsStylesheet] = React.useState(() => RowStylesheetHelper({
|
|
243
259
|
grid,
|
|
244
260
|
className: rowClassName
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
6
9
|
|
|
7
10
|
function getScrollbarSizeFromHeaderAndBody(refs) {
|
|
8
|
-
const innerBodyOffsetWidth =
|
|
9
|
-
const headerOffsetWidth =
|
|
11
|
+
const innerBodyOffsetWidth = dsUtilities.get(refs, ['innerBody', 'current', 'offsetWidth']);
|
|
12
|
+
const headerOffsetWidth = dsUtilities.get(refs, ['header', 'current', 'offsetWidth']);
|
|
10
13
|
return headerOffsetWidth - innerBodyOffsetWidth;
|
|
11
14
|
}
|
|
12
15
|
const isScrollbarVisible = element => element.scrollHeight > element.clientHeight;
|
|
@@ -25,9 +28,10 @@ const getColumnWidthSize = (width, minWidth, column) => {
|
|
|
25
28
|
};
|
|
26
29
|
const calculateMinWidthForWrappedText = columns => {
|
|
27
30
|
let longestWord = 0;
|
|
28
|
-
columns.forEach(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
columns.forEach(_ref => {
|
|
32
|
+
let {
|
|
33
|
+
label
|
|
34
|
+
} = _ref;
|
|
31
35
|
const localLongestWord = label.split(' ').sort((a, b) => b.length - a.length)[0].length;
|
|
32
36
|
if (localLongestWord > longestWord) longestWord = localLongestWord;
|
|
33
37
|
});
|