@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
|
@@ -3,7 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.some.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.some.js');
|
|
11
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
|
+
require('core-js/modules/esnext.async-iterator.find.js');
|
|
15
|
+
require('core-js/modules/esnext.iterator.find.js');
|
|
16
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
17
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
18
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
7
19
|
var moment = require('moment');
|
|
8
20
|
|
|
9
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -13,145 +25,151 @@ var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
|
13
25
|
|
|
14
26
|
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; }
|
|
15
27
|
|
|
16
|
-
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[
|
|
17
|
-
const sorter = ({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (realColumn.type === 'DateTime') {
|
|
63
|
-
return moment__default['default'](resolvedValue);
|
|
64
|
-
}
|
|
28
|
+
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; }
|
|
29
|
+
const sorter = function () {
|
|
30
|
+
let {
|
|
31
|
+
columns,
|
|
32
|
+
sortingColumns,
|
|
33
|
+
sort,
|
|
34
|
+
emptyLast
|
|
35
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
36
|
+
return data => {
|
|
37
|
+
if (!columns) {
|
|
38
|
+
throw new Error('sort.sorter - Missing "columns" argument!');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!sort) {
|
|
42
|
+
throw new Error('sort.sorter - Missing "sort" argument!');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!sortingColumns) {
|
|
46
|
+
return data;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const columnIndexList = new Array(sortingColumns.length);
|
|
50
|
+
const orderList = new Array(sortingColumns.length);
|
|
51
|
+
let actualSortFunction = sort;
|
|
52
|
+
|
|
53
|
+
if (emptyLast) {
|
|
54
|
+
actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {
|
|
55
|
+
const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);
|
|
56
|
+
const keys = Object.keys(sortingColumns);
|
|
57
|
+
const withData = sortedData.filter(r => keys.some(key => !!r[key]));
|
|
58
|
+
const withoutData = sortedData.filter(r => keys.some(key => !r[key]));
|
|
59
|
+
return [...withData, ...withoutData];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Object.keys(sortingColumns).forEach(sortingColumnKey => {
|
|
64
|
+
const realColumn = columns.find(column => column.property === sortingColumnKey);
|
|
65
|
+
if (!realColumn) return;
|
|
66
|
+
|
|
67
|
+
const columnSorter = realColumn.sort || function resolveValue(row) {
|
|
68
|
+
const {
|
|
69
|
+
property,
|
|
70
|
+
sortBy
|
|
71
|
+
} = realColumn;
|
|
72
|
+
const value = row[sortBy || property]; // Pick resolved value by convention
|
|
65
73
|
|
|
66
|
-
|
|
67
|
-
};
|
|
74
|
+
const resolvedValue = dsUtilities.get(row, "_".concat(property), value);
|
|
68
75
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
if (realColumn.type === 'DateTime') {
|
|
77
|
+
return moment__default["default"](resolvedValue);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return typeof resolvedValue === 'string' ? resolvedValue.toLowerCase() : resolvedValue;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const sortingColumn = sortingColumns[sortingColumnKey];
|
|
84
|
+
columnIndexList[sortingColumn.position] = columnSorter;
|
|
85
|
+
orderList[sortingColumn.position] = sortingColumn.direction;
|
|
86
|
+
});
|
|
87
|
+
return actualSortFunction(data, columnIndexList, orderList);
|
|
88
|
+
};
|
|
74
89
|
};
|
|
75
|
-
const sorterGroups = ({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const orderList = new Array(sortingColumns.length);
|
|
95
|
-
let actualSortFunction = sort;
|
|
96
|
-
|
|
97
|
-
if (emptyLast) {
|
|
98
|
-
actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {
|
|
99
|
-
const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);
|
|
100
|
-
const keys = Object.keys(sortingColumns);
|
|
101
|
-
const withData = sortedData.filter(r => keys.some(key => !!r[key]));
|
|
102
|
-
const withoutData = sortedData.filter(r => keys.some(key => !r[key]));
|
|
103
|
-
return [...withData, ...withoutData];
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
Object.keys(sortingColumns).forEach(sortingColumnKey => {
|
|
108
|
-
const realColumn = columns.find(column => column.property === sortingColumnKey);
|
|
109
|
-
if (!realColumn) return;
|
|
110
|
-
|
|
111
|
-
const columnSorter = realColumn.sort || function resolveValue(row) {
|
|
112
|
-
const {
|
|
113
|
-
property,
|
|
114
|
-
sortBy
|
|
115
|
-
} = realColumn;
|
|
116
|
-
const value = row[sortBy || property]; // Pick resolved value by convention
|
|
117
|
-
|
|
118
|
-
const resolvedValue = utils.get(row, `_${property}`, value);
|
|
119
|
-
|
|
120
|
-
if (realColumn.type === 'DateTime') {
|
|
121
|
-
return moment__default['default'](resolvedValue);
|
|
122
|
-
}
|
|
90
|
+
const sorterGroups = function () {
|
|
91
|
+
let {
|
|
92
|
+
columns,
|
|
93
|
+
sortingColumns,
|
|
94
|
+
sort,
|
|
95
|
+
emptyLast
|
|
96
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
97
|
+
return (data, rowsData) => {
|
|
98
|
+
if (!columns) {
|
|
99
|
+
throw new Error('sort.sorter - Missing "columns" argument!');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!sort) {
|
|
103
|
+
throw new Error('sort.sorter - Missing "sort" argument!');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (!sortingColumns) {
|
|
107
|
+
return data;
|
|
108
|
+
}
|
|
123
109
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
rowsData.forEach(group => {
|
|
137
|
-
groups[group.id] = {
|
|
138
|
-
children: actualSortFunction(group.children.map(c => _objectSpread({
|
|
139
|
-
parentNode: preserveData[c.id].parentNode,
|
|
140
|
-
data: c
|
|
141
|
-
}, c)), columnIndexList, orderList) // sort internally
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
});
|
|
145
|
-
const sorted = actualSortFunction(data.map(r => _objectSpread(_objectSpread({}, r.data), r)), columnIndexList, orderList); // sort global
|
|
146
|
-
|
|
147
|
-
let ssortGlobal = [];
|
|
148
|
-
sorted.filter(s => !s.isGroup).forEach(sr => {
|
|
149
|
-
if (groups[sr.parentNode.id]) {
|
|
150
|
-
ssortGlobal = [...ssortGlobal, preserveData[sr.parentNode.id], ...groups[sr.parentNode.id].children];
|
|
151
|
-
delete groups[sr.parentNode.id];
|
|
110
|
+
const columnIndexList = new Array(sortingColumns.length);
|
|
111
|
+
const orderList = new Array(sortingColumns.length);
|
|
112
|
+
let actualSortFunction = sort;
|
|
113
|
+
|
|
114
|
+
if (emptyLast) {
|
|
115
|
+
actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {
|
|
116
|
+
const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);
|
|
117
|
+
const keys = Object.keys(sortingColumns);
|
|
118
|
+
const withData = sortedData.filter(r => keys.some(key => !!r[key]));
|
|
119
|
+
const withoutData = sortedData.filter(r => keys.some(key => !r[key]));
|
|
120
|
+
return [...withData, ...withoutData];
|
|
121
|
+
};
|
|
152
122
|
}
|
|
153
|
-
|
|
154
|
-
|
|
123
|
+
|
|
124
|
+
Object.keys(sortingColumns).forEach(sortingColumnKey => {
|
|
125
|
+
const realColumn = columns.find(column => column.property === sortingColumnKey);
|
|
126
|
+
if (!realColumn) return;
|
|
127
|
+
|
|
128
|
+
const columnSorter = realColumn.sort || function resolveValue(row) {
|
|
129
|
+
const {
|
|
130
|
+
property,
|
|
131
|
+
sortBy
|
|
132
|
+
} = realColumn;
|
|
133
|
+
const value = row[sortBy || property]; // Pick resolved value by convention
|
|
134
|
+
|
|
135
|
+
const resolvedValue = dsUtilities.get(row, "_".concat(property), value);
|
|
136
|
+
|
|
137
|
+
if (realColumn.type === 'DateTime') {
|
|
138
|
+
return moment__default["default"](resolvedValue);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return typeof resolvedValue === 'string' ? resolvedValue.toLowerCase() : resolvedValue;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const sortingColumn = sortingColumns[sortingColumnKey];
|
|
145
|
+
columnIndexList[sortingColumn.position] = columnSorter;
|
|
146
|
+
orderList[sortingColumn.position] = sortingColumn.direction;
|
|
147
|
+
});
|
|
148
|
+
const groups = {};
|
|
149
|
+
const preserveData = {};
|
|
150
|
+
data.forEach(c => {
|
|
151
|
+
preserveData[c.id] = _objectSpread({}, c);
|
|
152
|
+
});
|
|
153
|
+
rowsData.forEach(group => {
|
|
154
|
+
groups[group.id] = {
|
|
155
|
+
children: actualSortFunction(group.children.map(c => _objectSpread({
|
|
156
|
+
parentNode: preserveData[c.id].parentNode,
|
|
157
|
+
data: c
|
|
158
|
+
}, c)), columnIndexList, orderList) // sort internally
|
|
159
|
+
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
const sorted = actualSortFunction(data.map(r => _objectSpread(_objectSpread({}, r.data), r)), columnIndexList, orderList); // sort global
|
|
163
|
+
|
|
164
|
+
let ssortGlobal = [];
|
|
165
|
+
sorted.filter(s => !s.isGroup).forEach(sr => {
|
|
166
|
+
if (groups[sr.parentNode.id]) {
|
|
167
|
+
ssortGlobal = [...ssortGlobal, preserveData[sr.parentNode.id], ...groups[sr.parentNode.id].children];
|
|
168
|
+
delete groups[sr.parentNode.id];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
return ssortGlobal;
|
|
172
|
+
};
|
|
155
173
|
};
|
|
156
174
|
|
|
157
175
|
exports.sorter = sorter;
|
|
@@ -3,6 +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/web.dom-collections.iterator.js');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.find.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.find.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.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
14
|
var sortabular = require('sortabular/dist/index.js');
|
|
7
15
|
var useDerivedStateFromProps = require('@elliemae/ds-utilities/hooks/useDerivedStateFromProps');
|
|
8
16
|
var checkIfSortable = require('./checkIfSortable.js');
|
|
@@ -18,14 +26,12 @@ function _interopNamespace(e) {
|
|
|
18
26
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
27
|
Object.defineProperty(n, k, d.get ? d : {
|
|
20
28
|
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return e[k];
|
|
23
|
-
}
|
|
29
|
+
get: function () { return e[k]; }
|
|
24
30
|
});
|
|
25
31
|
}
|
|
26
32
|
});
|
|
27
33
|
}
|
|
28
|
-
n[
|
|
34
|
+
n["default"] = e;
|
|
29
35
|
return Object.freeze(n);
|
|
30
36
|
}
|
|
31
37
|
|
|
@@ -35,14 +41,14 @@ var useDerivedStateFromProps__default = /*#__PURE__*/_interopDefaultLegacy(useDe
|
|
|
35
41
|
|
|
36
42
|
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; }
|
|
37
43
|
|
|
38
|
-
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[
|
|
44
|
+
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; }
|
|
39
45
|
function useSortableState(grid) {
|
|
40
46
|
const {
|
|
41
47
|
onSort,
|
|
42
48
|
sortingColumns: sortingColumnsProp,
|
|
43
49
|
pagination
|
|
44
50
|
} = grid.props;
|
|
45
|
-
const [sortingColumns, setSortingColumns] = useDerivedStateFromProps__default[
|
|
51
|
+
const [sortingColumns, setSortingColumns] = useDerivedStateFromProps__default["default"](sortingColumnsProp);
|
|
46
52
|
|
|
47
53
|
const handleSort = selectedColumn => {
|
|
48
54
|
// support for pagination
|
|
@@ -4,9 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
13
|
var React = require('react');
|
|
8
14
|
var lodash = require('lodash');
|
|
9
|
-
var
|
|
15
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
16
|
var ToolbarTrigger = require('./ToolbarTrigger.js');
|
|
11
17
|
var rowSizes = require('../../rowSizes.js');
|
|
12
18
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -18,7 +24,7 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
18
24
|
|
|
19
25
|
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
26
|
|
|
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[
|
|
27
|
+
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
28
|
const RowRenderer = (Row, grid) => {
|
|
23
29
|
const Wrapped = props => {
|
|
24
30
|
const ref = React.useRef();
|
|
@@ -54,12 +60,12 @@ const RowRenderer = (Row, grid) => {
|
|
|
54
60
|
setHasVerticalScrollBar(false);
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
setRowStyle(
|
|
63
|
+
setRowStyle(dsUtilities.omit(style || {
|
|
58
64
|
height: !wrapText ? rowSizes.RowSizes[gridInstance.props.rowSize] : 'auto',
|
|
59
65
|
position: 'relative'
|
|
60
66
|
}, [shouldOmit]));
|
|
61
67
|
}, [style, isRowDragging]);
|
|
62
|
-
return /*#__PURE__*/_jsx__default[
|
|
68
|
+
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
63
69
|
className: "row-renderer-fixed-height",
|
|
64
70
|
style: {
|
|
65
71
|
height: !wrapText ? rowSizes.RowSizes[gridInstance.props.rowSize] : 'auto',
|
|
@@ -70,10 +76,10 @@ const RowRenderer = (Row, grid) => {
|
|
|
70
76
|
ref: ref
|
|
71
77
|
}, props), {}, {
|
|
72
78
|
style: rowStyle
|
|
73
|
-
})), lodash.isEmpty(rowData) && !rowData.index && !rowData.rowIndex ? null : /*#__PURE__*/_jsx__default[
|
|
74
|
-
className:
|
|
79
|
+
})), lodash.isEmpty(rowData) && !rowData.index && !rowData.rowIndex ? null : /*#__PURE__*/_jsx__default["default"]("div", {
|
|
80
|
+
className: "toolbar-trigger-container ".concat(style ? 'move' : 'stay'),
|
|
75
81
|
style: _objectSpread({}, popStyle)
|
|
76
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
82
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](ToolbarTrigger.ToolbarTrigger, {
|
|
77
83
|
grid: grid,
|
|
78
84
|
rowData: {
|
|
79
85
|
rowData,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
7
|
require('react');
|
|
7
8
|
var createInstancePlugin = require('@elliemae/ds-shared/createDataInstance/createInstancePlugin');
|
|
8
9
|
var initColumnDefinition = require('@elliemae/ds-shared/useDataGrid/initColumnDefinition');
|
|
@@ -17,7 +18,7 @@ var createInstancePlugin__default = /*#__PURE__*/_interopDefaultLegacy(createIns
|
|
|
17
18
|
const decorateColumns = columns => {
|
|
18
19
|
const lastColumn = columns[columns.length - 1];
|
|
19
20
|
return [...columns.slice(0, -1), initColumnDefinition.appendCellFormatter([value => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
20
|
-
children: [value, /*#__PURE__*/_jsx__default[
|
|
21
|
+
children: [value, /*#__PURE__*/_jsx__default["default"]("div", {
|
|
21
22
|
style: {
|
|
22
23
|
width: 34,
|
|
23
24
|
maxWidth: 34,
|
|
@@ -33,7 +34,7 @@ const decorateRenderers = (renderers, grid) => {
|
|
|
33
34
|
return renderers;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
|
-
const ToolbarPlugin = createInstancePlugin__default[
|
|
37
|
+
const ToolbarPlugin = createInstancePlugin__default["default"]('toolbar', {
|
|
37
38
|
decorateRenderers,
|
|
38
39
|
decorateColumns
|
|
39
40
|
});
|
|
@@ -4,10 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
13
|
var React = require('react');
|
|
8
14
|
var styled = require('styled-components');
|
|
9
|
-
var DSButton = require('@elliemae/ds-
|
|
10
|
-
var
|
|
15
|
+
var DSButton = require('@elliemae/ds-button');
|
|
16
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
11
17
|
|
|
12
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
19
|
|
|
@@ -15,30 +21,29 @@ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
|
15
21
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
22
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
17
23
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
18
|
-
var MoreOptionsVert__default = /*#__PURE__*/_interopDefaultLegacy(MoreOptionsVert);
|
|
19
24
|
|
|
20
25
|
var _MoreOptionsVert;
|
|
21
26
|
|
|
22
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; }
|
|
23
28
|
|
|
24
|
-
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[
|
|
25
|
-
const ToolbarBtns = /*#__PURE__*/styled__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 ToolbarBtns = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
26
31
|
componentId: "sc-pm75g5-0"
|
|
27
32
|
})(["& > .em-ds-toolbar{box-shadow:none;}"]);
|
|
28
|
-
const ToolbarWrapper = /*#__PURE__*/styled__default[
|
|
33
|
+
const ToolbarWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
29
34
|
componentId: "sc-pm75g5-1"
|
|
30
|
-
})(["display:flex;align-items:center;height:", ";margin-left:-4px;margin-right:", ";padding-right:4px;pointer-events:all;background:white;", " &:hover{box-shadow:-1px 0px 1px 0px rgba(0,0,0,0.2),1px 0px 2px 0px rgba(0,0,0,0.2);& > .toolbar-trigger{border:none;}}"], props => props.rowSize === 'normal' ? '36px' : '28px', props => props.hasScrollBar ? '0' : '-10px', props => props.showShadow ?
|
|
31
|
-
|
|
32
|
-
const ToolbarPosition = /*#__PURE__*/styled__default['default'].div.withConfig({
|
|
35
|
+
})(["display:flex;align-items:center;height:", ";margin-left:-4px;margin-right:", ";padding-right:4px;pointer-events:all;background:white;", " &:hover{box-shadow:-1px 0px 1px 0px rgba(0,0,0,0.2),1px 0px 2px 0px rgba(0,0,0,0.2);& > .toolbar-trigger{border:none;}}"], props => props.rowSize === 'normal' ? '36px' : '28px', props => props.hasScrollBar ? '0' : '-10px', props => props.showShadow ? "box-shadow: -1px 0px 1px 0px rgba(0, 0, 0, 0.2),\n 1px 0px 2px 0px rgba(0, 0, 0, 0.2);" : '');
|
|
36
|
+
const ToolbarPosition = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
33
37
|
componentId: "sc-pm75g5-2"
|
|
34
|
-
})(["position:absolute;z-index:10;display:flex;justify-content:flex-end;align-items:center;width:0;pointer-events:none;top:0;height:", ";margin-top:", ";"], props => props.rowRef.current ?
|
|
38
|
+
})(["position:absolute;z-index:10;display:flex;justify-content:flex-end;align-items:center;width:0;pointer-events:none;top:0;height:", ";margin-top:", ";"], props => props.rowRef.current ? "".concat(props.rowRef.current.offsetHeight, "px") : '36px', props => props.rowSize === 'normal' ? '0' : '0'); // eslint-disable-next-line react/prop-types
|
|
35
39
|
|
|
36
|
-
const ToolbarTrigger =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const ToolbarTrigger = _ref => {
|
|
41
|
+
let {
|
|
42
|
+
grid,
|
|
43
|
+
rowData,
|
|
44
|
+
hasScrollBar,
|
|
45
|
+
rowRef
|
|
46
|
+
} = _ref;
|
|
42
47
|
const {
|
|
43
48
|
props: {
|
|
44
49
|
renderToolbar,
|
|
@@ -56,20 +61,20 @@ const ToolbarTrigger = ({
|
|
|
56
61
|
})) : null;
|
|
57
62
|
/* eslint-enable indent */
|
|
58
63
|
|
|
59
|
-
return /*#__PURE__*/_jsx__default[
|
|
64
|
+
return /*#__PURE__*/_jsx__default["default"](ToolbarPosition, {
|
|
60
65
|
rowSize: rowSize,
|
|
61
66
|
rowRef: rowRef
|
|
62
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
67
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](ToolbarWrapper, {
|
|
63
68
|
onMouseEnter: () => setShow(true),
|
|
64
69
|
onMouseLeave: () => setShow(false),
|
|
65
70
|
showShadow: show,
|
|
66
71
|
rowSize: rowSize,
|
|
67
72
|
hasScrollBar: hasScrollBar
|
|
68
|
-
}, void 0, show && /*#__PURE__*/_jsx__default[
|
|
73
|
+
}, void 0, show && /*#__PURE__*/_jsx__default["default"](ToolbarBtns, {}, void 0, toolbar), /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
69
74
|
buttonType: "text",
|
|
70
75
|
className: "toolbar-trigger",
|
|
71
76
|
"data-testid": "toolbar-trigger",
|
|
72
|
-
icon: _MoreOptionsVert || (_MoreOptionsVert = /*#__PURE__*/_jsx__default[
|
|
77
|
+
icon: _MoreOptionsVert || (_MoreOptionsVert = /*#__PURE__*/_jsx__default["default"](dsIcons.MoreOptionsVert, {})) // eslint-disable-next-line react/prop-types
|
|
73
78
|
,
|
|
74
79
|
index: rowData.index,
|
|
75
80
|
onClick: () => setShow(true),
|
|
@@ -78,4 +83,4 @@ const ToolbarTrigger = ({
|
|
|
78
83
|
};
|
|
79
84
|
|
|
80
85
|
exports.ToolbarTrigger = ToolbarTrigger;
|
|
81
|
-
exports[
|
|
86
|
+
exports["default"] = ToolbarTrigger;
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
3
8
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
9
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
10
|
var React = require('react');
|
|
6
11
|
var reactWindow = require('react-window');
|
|
7
|
-
var
|
|
8
|
-
var system = require('@elliemae/ds-utilities/system');
|
|
9
|
-
var useWindowScrollerList = require('@elliemae/ds-utilities/hooks/useWindowScrollerList');
|
|
12
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
10
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
14
|
|
|
12
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
16
|
|
|
14
17
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
18
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
16
|
-
var useWindowScrollerList__default = /*#__PURE__*/_interopDefaultLegacy(useWindowScrollerList);
|
|
17
19
|
|
|
18
20
|
const _excluded = ["itemCount", "className", "innerRef", "itemData", "itemKey", "itemSize", "outerRef", "component"];
|
|
19
21
|
|
|
20
22
|
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; }
|
|
21
23
|
|
|
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[
|
|
24
|
+
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; }
|
|
23
25
|
const AutoHeightList = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
24
26
|
let {
|
|
25
27
|
itemCount,
|
|
@@ -31,24 +33,24 @@ const AutoHeightList = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
31
33
|
outerRef,
|
|
32
34
|
component: ListComponent = reactWindow.FixedSizeList
|
|
33
35
|
} = _ref,
|
|
34
|
-
otherProps = _objectWithoutProperties__default[
|
|
36
|
+
otherProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
35
37
|
|
|
36
38
|
const listRef = React.useRef();
|
|
37
39
|
const outerListRef = React.useRef();
|
|
38
|
-
|
|
40
|
+
dsUtilities.useWindowScrollerList({
|
|
39
41
|
listInstance: listRef,
|
|
40
42
|
outerListRef
|
|
41
43
|
});
|
|
42
44
|
return /*#__PURE__*/jsxRuntime.jsx(ListComponent, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
43
|
-
ref:
|
|
44
|
-
className:
|
|
45
|
+
ref: dsUtilities.mergeRefs(ref, listRef),
|
|
46
|
+
className: dsUtilities.cx(className, 'window-scroller-override'),
|
|
45
47
|
height: window.innerHeight,
|
|
46
48
|
innerRef: innerRef,
|
|
47
49
|
itemCount: itemCount,
|
|
48
50
|
itemData: itemData,
|
|
49
51
|
itemKey: itemKey,
|
|
50
52
|
itemSize: itemSize,
|
|
51
|
-
outerRef:
|
|
53
|
+
outerRef: dsUtilities.mergeRefs(outerListRef, outerRef),
|
|
52
54
|
overscanCount: 10,
|
|
53
55
|
useIsScrolling: true
|
|
54
56
|
}));
|