@elliemae/ds-datagrids 2.0.0-alpha.1 → 2.0.0-alpha.13
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 +247 -244
- package/cjs/DataGridImpl.js +22 -13
- package/cjs/PaginatedDataGrid.js +11 -6
- package/cjs/blockNames.js +2 -2
- package/cjs/columns/IconColumn.js +23 -21
- package/cjs/columns/NumberColumn.js +2 -4
- package/cjs/components/BodyCell.js +23 -15
- package/cjs/components/BodyList.js +11 -4
- package/cjs/components/ColumnVisibilityMenuOption.js +12 -6
- package/cjs/components/ColumnsOptionsMenuSection.js +35 -28
- package/cjs/components/EmptyState.js +23 -21
- package/cjs/components/HeaderCell.js +17 -11
- package/cjs/components/List.js +6 -1
- package/cjs/components/ListItem.js +8 -1
- package/cjs/components/NoResults.js +8 -3
- package/cjs/components/RowsLoader.js +6 -5
- package/cjs/components/Table.js +9 -4
- package/cjs/components/TableBody.js +8 -3
- package/cjs/components/TableHeader.js +6 -1
- package/cjs/components/footer/addOptionalFooterComponents.js +6 -5
- package/cjs/components/header/PrimaryControls.js +20 -15
- package/cjs/components/header/addOptionalHeaderComponents.js +5 -4
- package/cjs/components/renderers/defaultClassedRenderers.js +35 -23
- package/cjs/components/renderers/renderRowsLoader.js +1 -1
- package/cjs/components/tableContext.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +54 -43
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js +13 -9
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +3 -4
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +12 -10
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +14 -7
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +3 -3
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js +24 -18
- package/cjs/plugins/column-sizing/useColumnSizeService.js +14 -4
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js +70 -56
- package/cjs/plugins/column-sizing/utils.js +10 -6
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +2 -2
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +11 -6
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +24 -25
- package/cjs/plugins/editable/EditableComponents/ComboBox.js +10 -7
- package/cjs/plugins/editable/EditableComponents/TextBox.js +24 -19
- package/cjs/plugins/editable/EditablePlugin.js +17 -16
- package/cjs/plugins/editable/decorateEditable.js +25 -19
- package/cjs/plugins/editable/getEditorComponent.js +46 -35
- package/cjs/plugins/expandable-grid/ExpandableColumn.js +66 -59
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js +42 -30
- package/cjs/plugins/expandable-grid/ExpandedRow.js +41 -31
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +22 -16
- package/cjs/plugins/expandable-grid/useExpandGridState.js +4 -8
- package/cjs/plugins/export-data/ExportDataPlugin.js +34 -19
- package/cjs/plugins/filterable/FilterablePlugin.js +9 -8
- package/cjs/plugins/filterable/addFilterToColumn.js +6 -1
- package/cjs/plugins/filterable/components/FilterableHeader.js +39 -30
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +52 -45
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +38 -33
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +127 -161
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +38 -29
- package/cjs/plugins/filterable/filterableFormatter.js +16 -11
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +18 -6
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +11 -8
- package/cjs/plugins/filterable/helper.js +18 -8
- package/cjs/plugins/filterable/useFilterableState.js +13 -6
- package/cjs/plugins/grouping-by/GroupingByPlugin.js +4 -2
- package/cjs/plugins/grouping-grid/GroupingPlugin.js +14 -5
- package/cjs/plugins/grouping-grid/walkStrategy.js +13 -9
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +11 -4
- package/cjs/plugins/pagination/PaginationPlugin.js +17 -10
- package/cjs/plugins/pagination/components/Pagination.js +12 -11
- package/cjs/plugins/pagination/components/Paginator.js +23 -22
- package/cjs/plugins/pagination/components/PerPageDropdown.js +24 -17
- package/cjs/plugins/pagination/helper.js +11 -8
- package/cjs/plugins/pagination/usePaginationState.js +9 -4
- package/cjs/plugins/resizable/ResizablePlugin.js +6 -5
- package/cjs/plugins/resizable/decorateResizable.js +16 -10
- package/cjs/plugins/resizable/useResizeHandle.js +21 -16
- package/cjs/plugins/resizable/utils.js +9 -6
- package/cjs/plugins/row-dnd/DndRowsPlugin.js +27 -19
- package/cjs/plugins/selectable/SelectablePlugin.js +13 -12
- package/cjs/plugins/selectable/addSelectableColumn.js +25 -17
- package/cjs/plugins/selectable/helper.js +13 -4
- package/cjs/plugins/selectable/selectableFormatter.js +83 -74
- package/cjs/plugins/selectable/useSelectableState.js +26 -12
- package/cjs/plugins/sortable/SortablePlugin.js +11 -12
- package/cjs/plugins/sortable/checkIfSortable.js +1 -1
- package/cjs/plugins/sortable/sortHeaderFormatter.js +17 -18
- package/cjs/plugins/sortable/sortTree.js +16 -8
- package/cjs/plugins/sortable/sorter.js +153 -135
- package/cjs/plugins/sortable/useSortableState.js +12 -6
- package/cjs/plugins/toolbar/RowRenderer.js +13 -7
- package/cjs/plugins/toolbar/ToolbarPlugin.js +3 -2
- package/cjs/plugins/toolbar/ToolbarTrigger.js +26 -21
- package/cjs/plugins/virtualization/AutoHeightList.js +12 -10
- package/cjs/plugins/virtualization/VirtualizationPlugin.js +35 -28
- package/cjs/plugins/virtualization/VirtualizedBody.js +23 -13
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js +8 -7
- package/cjs/renders/CellWithAddons.js +23 -21
- package/cjs/renders/styled.js +7 -18
- package/cjs/utilities/getPluginsFromProps.js +5 -1
- package/cjs/utilities/getScrollbarSize.js +2 -1
- package/cjs/utilities/normalizeData.js +8 -2
- 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 +31 -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,13 +2,17 @@
|
|
|
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 _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
11
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
12
|
var React = require('react');
|
|
8
13
|
var lodash = require('lodash');
|
|
9
14
|
var FocusGridManager = require('@elliemae/ds-shared/FocusGroup/FocusGrid');
|
|
10
|
-
var
|
|
11
|
-
var system = require('@elliemae/ds-utilities/system');
|
|
15
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
12
16
|
var createInstancePlugin = require('@elliemae/ds-shared/createDataInstance/createInstancePlugin');
|
|
13
17
|
var VirtualizedBody = require('./VirtualizedBody.js');
|
|
14
18
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -22,8 +26,8 @@ var createInstancePlugin__default = /*#__PURE__*/_interopDefaultLegacy(createIns
|
|
|
22
26
|
|
|
23
27
|
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; }
|
|
24
28
|
|
|
25
|
-
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[
|
|
26
|
-
const VirtualizationPlugin = createInstancePlugin__default[
|
|
29
|
+
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; }
|
|
30
|
+
const VirtualizationPlugin = createInstancePlugin__default["default"]('virtualization', {
|
|
27
31
|
decorateRenderers(renderers, grid) {
|
|
28
32
|
const BodyWrapper = renderers.body.wrapper; // eslint-disable-next-line react/display-name
|
|
29
33
|
|
|
@@ -52,33 +56,36 @@ const VirtualizationPlugin = createInstancePlugin__default['default']('virtualiz
|
|
|
52
56
|
const listRef = React.useRef();
|
|
53
57
|
|
|
54
58
|
const nextListProps = _objectSpread(_objectSpread({}, listProps), {}, {
|
|
55
|
-
ref:
|
|
59
|
+
ref: dsUtilities.mergeRefs(listRef, listProps.ref)
|
|
56
60
|
});
|
|
57
61
|
|
|
58
|
-
return /*#__PURE__*/_jsx__default[
|
|
62
|
+
return /*#__PURE__*/_jsx__default["default"](FocusGridManager__default["default"], {
|
|
59
63
|
hotKeys: hotKeys,
|
|
60
|
-
keyBindings:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
64
|
+
keyBindings: _ref => {
|
|
65
|
+
let {
|
|
66
|
+
defaultBindings
|
|
67
|
+
} = _ref;
|
|
68
|
+
return _objectSpread(_objectSpread({}, defaultBindings), {}, {
|
|
69
|
+
// todo: this is kind of hacky, since it's virtualized and there's
|
|
70
|
+
// the possibility that the firsts or lasts rows aren't rendered
|
|
71
|
+
Home: dsUtilities.runAll(e => {
|
|
72
|
+
if (e.ctrlKey) {
|
|
73
|
+
listRef.current.scrollToItem(0);
|
|
74
|
+
setTimeout(() => defaultBindings.Home(e), 10);
|
|
75
|
+
} else {
|
|
76
|
+
defaultBindings.Home(e);
|
|
77
|
+
}
|
|
78
|
+
}),
|
|
79
|
+
End: dsUtilities.runAll(e => {
|
|
80
|
+
if (e.ctrlKey) {
|
|
81
|
+
listRef.current.scrollToItem(rows.length - 1);
|
|
82
|
+
setTimeout(() => defaultBindings.End(e), 10);
|
|
83
|
+
} else {
|
|
84
|
+
defaultBindings.End(e);
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
},
|
|
82
89
|
shouldRefocus: false
|
|
83
90
|
}, void 0, /*#__PURE__*/jsxRuntime.jsx(VirtualizedBody, _objectSpread(_objectSpread({}, props), {}, {
|
|
84
91
|
autoScrollToId: autoScrollToId,
|
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
13
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
14
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
15
|
var React = require('react');
|
|
6
|
-
var
|
|
7
|
-
var utils = require('@elliemae/ds-utilities/utils');
|
|
16
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
8
17
|
var NoResults = require('../../components/NoResults.js');
|
|
9
18
|
var VirtualizedBodyRow = require('./VirtualizedBodyRow.js');
|
|
10
19
|
var rowSizes = require('../../rowSizes.js');
|
|
@@ -18,7 +27,7 @@ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
|
18
27
|
|
|
19
28
|
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; }
|
|
20
29
|
|
|
21
|
-
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[
|
|
30
|
+
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; }
|
|
22
31
|
const wrapperSafari = {};
|
|
23
32
|
const wrapperGeneric = {
|
|
24
33
|
overflowY: 'auto',
|
|
@@ -97,9 +106,10 @@ const VirtualizedBody = props => {
|
|
|
97
106
|
React.useEffect(() => {
|
|
98
107
|
autoScrollTo(visibleHeight);
|
|
99
108
|
}, [autoScrollToId, visibleHeight]);
|
|
100
|
-
const handler = React.useCallback(
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
const handler = React.useCallback(dsUtilities.debounce(_ref => {
|
|
110
|
+
let {
|
|
111
|
+
target
|
|
112
|
+
} = _ref;
|
|
103
113
|
// Update coordinates
|
|
104
114
|
setScrollTop(target.scrollTop || 0);
|
|
105
115
|
}, 100), [setScrollTop]);
|
|
@@ -144,7 +154,7 @@ const VirtualizedBody = props => {
|
|
|
144
154
|
if (virtualizedBodyRef) {
|
|
145
155
|
const parsedVisibleHeight = parseFloat(window.getComputedStyle(virtualizedBodyRef, null).getPropertyValue('height')); // eslint-disable-next-line no-restricted-globals
|
|
146
156
|
|
|
147
|
-
if (!
|
|
157
|
+
if (!dsUtilities.isNaN(parsedVisibleHeight)) {
|
|
148
158
|
setVisibleHeight(parsedVisibleHeight);
|
|
149
159
|
autoScrollTo(parsedVisibleHeight);
|
|
150
160
|
}
|
|
@@ -201,7 +211,7 @@ const VirtualizedBody = props => {
|
|
|
201
211
|
return rowStyleCache.current[index];
|
|
202
212
|
};
|
|
203
213
|
|
|
204
|
-
const generateRenderedRows = () => rows.slice(renderedIndexes[0], renderedIndexes[1] + 1).map((_, index) => /*#__PURE__*/_jsx__default[
|
|
214
|
+
const generateRenderedRows = () => rows.slice(renderedIndexes[0], renderedIndexes[1] + 1).map((_, index) => /*#__PURE__*/_jsx__default["default"](VirtualizedBodyRow, {
|
|
205
215
|
data: {
|
|
206
216
|
rows,
|
|
207
217
|
columns,
|
|
@@ -234,23 +244,23 @@ const VirtualizedBody = props => {
|
|
|
234
244
|
setVirtualizedBodyRef(elem.parentElement); // eslint-disable-next-line no-param-reassign
|
|
235
245
|
|
|
236
246
|
elem.parentElement.scrollTop = scrollTop;
|
|
237
|
-
|
|
247
|
+
dsUtilities.mergeRefs(listProps.outerRef)(elem.parentElement);
|
|
238
248
|
} else {
|
|
239
249
|
setVirtualizedBodyRef(elem);
|
|
240
|
-
|
|
250
|
+
dsUtilities.mergeRefs(listProps.outerRef)(elem);
|
|
241
251
|
}
|
|
242
252
|
}
|
|
243
253
|
},
|
|
244
254
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
245
255
|
"data-testid": "virtualized-body",
|
|
246
|
-
className:
|
|
256
|
+
className: "virtualized-body".concat(hasScrollBar ? ' with-scrollbar' : ''),
|
|
247
257
|
style: bodyStyle,
|
|
248
258
|
ref: r => {
|
|
249
|
-
|
|
259
|
+
dsUtilities.mergeRefs(innerBody)(r);
|
|
250
260
|
},
|
|
251
261
|
children: generateRenderedRows()
|
|
252
262
|
})
|
|
253
|
-
}) : /*#__PURE__*/_jsx__default[
|
|
263
|
+
}) : /*#__PURE__*/_jsx__default["default"](NoResults, {
|
|
254
264
|
innerRef: innerRef,
|
|
255
265
|
rowRenderer: rowRenderer
|
|
256
266
|
}, void 0, noResultsPlaceholder)
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function VirtualizedBodyRow({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
function VirtualizedBodyRow(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
data,
|
|
6
|
+
index,
|
|
7
|
+
style,
|
|
8
|
+
key,
|
|
9
|
+
isScrolling
|
|
10
|
+
} = _ref;
|
|
10
11
|
const {
|
|
11
12
|
rows,
|
|
12
13
|
renderer: {
|
|
@@ -5,54 +5,56 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
require('react');
|
|
7
7
|
var lodash = require('lodash');
|
|
8
|
-
var Grid = require('@elliemae/ds-
|
|
9
|
-
var DSTruncatedTooltipText = require('@elliemae/ds-
|
|
8
|
+
var Grid = require('@elliemae/ds-grid');
|
|
9
|
+
var DSTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
10
10
|
var styled = require('./styled.js');
|
|
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 Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
|
|
15
16
|
var DSTruncatedTooltipText__default = /*#__PURE__*/_interopDefaultLegacy(DSTruncatedTooltipText);
|
|
16
17
|
|
|
17
|
-
const CellWithAddons =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
const CellWithAddons = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
leftAddon,
|
|
21
|
+
keepLeftPadding,
|
|
22
|
+
rightAddon,
|
|
23
|
+
badgeAddon,
|
|
24
|
+
highLight,
|
|
25
|
+
isEdit,
|
|
26
|
+
editComponent,
|
|
27
|
+
value,
|
|
28
|
+
neutralText,
|
|
29
|
+
metaData
|
|
30
|
+
} = _ref;
|
|
29
31
|
const hasLeftAddon = !!leftAddon || keepLeftPadding;
|
|
30
32
|
const hasRightAddon = !!rightAddon && !isEdit;
|
|
31
33
|
const cols = [1];
|
|
32
34
|
const shouldBeGray = neutralText || lodash.get(metaData, 'rowData.customRowProps.neutralText');
|
|
33
35
|
if (hasLeftAddon) cols.unshift('auto');
|
|
34
36
|
if (hasRightAddon) cols.push('auto');
|
|
35
|
-
return /*#__PURE__*/_jsx__default[
|
|
37
|
+
return /*#__PURE__*/_jsx__default["default"](styled.CellWrapper, {
|
|
36
38
|
noPadding: hasLeftAddon || badgeAddon || highLight || hasRightAddon,
|
|
37
39
|
hasLeftAddon: hasLeftAddon,
|
|
38
40
|
hasRightAddon: hasRightAddon,
|
|
39
41
|
badgeAddon: badgeAddon,
|
|
40
42
|
highLight: highLight
|
|
41
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
43
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](Grid__default["default"], {
|
|
42
44
|
height: "100%",
|
|
43
45
|
cols: cols
|
|
44
|
-
}, void 0, hasLeftAddon && /*#__PURE__*/_jsx__default[
|
|
46
|
+
}, void 0, hasLeftAddon && /*#__PURE__*/_jsx__default["default"](Grid__default["default"], {
|
|
45
47
|
alignItems: "center",
|
|
46
48
|
pl: "xxs",
|
|
47
49
|
pr: "xxs",
|
|
48
50
|
width: keepLeftPadding ? '32px' : undefined
|
|
49
|
-
}, void 0, hasLeftAddon && leftAddon), /*#__PURE__*/_jsx__default[
|
|
51
|
+
}, void 0, hasLeftAddon && leftAddon), /*#__PURE__*/_jsx__default["default"](Grid__default["default"], {
|
|
50
52
|
alignItems: "center"
|
|
51
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
53
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](styled.ValueWrapper, {
|
|
52
54
|
grayText: shouldBeGray
|
|
53
|
-
}, void 0, isEdit ? editComponent : /*#__PURE__*/_jsx__default[
|
|
55
|
+
}, void 0, isEdit ? editComponent : /*#__PURE__*/_jsx__default["default"](DSTruncatedTooltipText__default["default"], {
|
|
54
56
|
value: value
|
|
55
|
-
}))), hasRightAddon && /*#__PURE__*/_jsx__default[
|
|
57
|
+
}))), hasRightAddon && /*#__PURE__*/_jsx__default["default"](Grid__default["default"], {
|
|
56
58
|
alignItems: "center",
|
|
57
59
|
pl: "xxs"
|
|
58
60
|
}, void 0, rightAddon)));
|
package/cjs/renders/styled.js
CHANGED
|
@@ -3,33 +3,22 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var styled = require('styled-components');
|
|
6
|
-
var Grid = require('@elliemae/ds-
|
|
6
|
+
var Grid = require('@elliemae/ds-grid');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
9
|
|
|
10
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
|
+
var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
|
|
11
12
|
|
|
12
13
|
const m = '0.61538rem';
|
|
13
14
|
const m2 = '1.23076rem';
|
|
14
|
-
const CellWrapper = /*#__PURE__*/styled__default[
|
|
15
|
+
const CellWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
15
16
|
componentId: "sc-1n8exyf-0"
|
|
16
|
-
})(["max-height:36px;height:100%;width:", ";margin-left:", ";margin-right:", ";padding-left:", ";padding-right:", ";", ";", ""], props => props.noPadding ?
|
|
17
|
-
|
|
18
|
-
&::before {
|
|
19
|
-
display: block;
|
|
20
|
-
content: '';
|
|
21
|
-
position: absolute;
|
|
22
|
-
top: 0;
|
|
23
|
-
left:0;
|
|
24
|
-
border-style: solid;
|
|
25
|
-
border-width: ${props.theme.space.xxs} ${props.theme.space.xxs} ${props.theme.space.xxs} 0;
|
|
26
|
-
border-color: ${props.theme.colors.brand['600']} transparent transparent ${props.theme.colors.brand['600']};
|
|
27
|
-
}
|
|
28
|
-
` : '');
|
|
29
|
-
const ValueWrapper = /*#__PURE__*/styled__default['default'].div.withConfig({
|
|
17
|
+
})(["max-height:36px;height:100%;width:", ";margin-left:", ";margin-right:", ";padding-left:", ";padding-right:", ";", ";", ""], props => props.noPadding ? "calc(100% + ".concat(m2, ")") : '100%', props => props.noPadding ? "-".concat(m) : '0', props => props.noPadding ? "-".concat(m) : '0', props => !props.hasLeftAddon && (props.badgeAddon || props.highLight || props.hasRightAddon) ? m : '0', props => !props.hasRightAddon && (props.badgeAddon || props.highLight || props.hasLeftAddon) ? m : '0', props => props.highLight ? "background: ".concat(props.theme.colors.brand['200']) : '', props => props.badgeAddon ? "\n position: relative; \n &::before {\n display: block;\n content: '';\n position: absolute;\n top: 0;\n left:0;\n border-style: solid;\n border-width: ".concat(props.theme.space.xxs, " ").concat(props.theme.space.xxs, " ").concat(props.theme.space.xxs, " 0;\n border-color: ").concat(props.theme.colors.brand['600'], " transparent transparent ").concat(props.theme.colors.brand['600'], ";\n }\n ") : '');
|
|
18
|
+
const ValueWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
30
19
|
componentId: "sc-1n8exyf-1"
|
|
31
|
-
})(["display:flex;align-items:center;overflow:hidden;& > span{display:inline-flex;align-items:center;}", ""], props => props.grayText ?
|
|
32
|
-
const CellContainer = /*#__PURE__*/styled__default[
|
|
20
|
+
})(["display:flex;align-items:center;overflow:hidden;& > span{display:inline-flex;align-items:center;}", ""], props => props.grayText ? "color: ".concat(props.theme.colors.neutral['500'], ";") : '');
|
|
21
|
+
const CellContainer = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
33
22
|
componentId: "sc-1n8exyf-2"
|
|
34
23
|
})(["padding-left:", ";padding-right:", ";position:relative;"], m, m);
|
|
35
24
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
3
6
|
var DndRowsPlugin = require('../plugins/row-dnd/DndRowsPlugin.js');
|
|
4
7
|
var DndColumnsPlugin = require('../plugins/column-dnd/DndColumnsPlugin.js');
|
|
5
8
|
var InfiniteScrollPlugin = require('../plugins/infinite-scrolling/InfiniteScrollPlugin.js');
|
|
@@ -29,7 +32,8 @@ const mapPropToPlugin = {
|
|
|
29
32
|
groupedRows: GroupingPlugin.GroupingPlugin,
|
|
30
33
|
dragAndDropRows: DndRowsPlugin.DndRowsPlugin
|
|
31
34
|
};
|
|
32
|
-
function getPluginsFromProps(props
|
|
35
|
+
function getPluginsFromProps(props) {
|
|
36
|
+
let omit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
33
37
|
const plugins = [];
|
|
34
38
|
Object.keys(mapPropToPlugin).forEach(key => {
|
|
35
39
|
if (props[key] && !omit[key]) plugins.push(mapPropToPlugin[key]);
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function getScrollbarWidth(
|
|
5
|
+
function getScrollbarWidth() {
|
|
6
|
+
let compensatePixels = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
6
7
|
// Creating invisible container
|
|
7
8
|
const outer = document.createElement('div');
|
|
8
9
|
outer.style.visibility = 'hidden';
|
|
@@ -3,7 +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.map.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
11
|
require('core-js/modules/es.string.replace.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
7
14
|
|
|
8
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
16
|
|
|
@@ -11,8 +18,7 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
11
18
|
|
|
12
19
|
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; }
|
|
13
20
|
|
|
14
|
-
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[
|
|
15
|
-
|
|
21
|
+
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
22
|
const normalizeRows = rows => rows.map(row => {
|
|
17
23
|
Object.keys(row).forEach(key => row[normalizeText(key)] = row[key]);
|
|
18
24
|
return row;
|