@elliemae/ds-datagrids 2.0.0-next.1 → 2.0.0-next.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.
Files changed (204) hide show
  1. package/cjs/DSDataGrid.js +246 -243
  2. package/cjs/DataGridImpl.js +18 -9
  3. package/cjs/PaginatedDataGrid.js +5 -0
  4. package/cjs/blockNames.js +2 -2
  5. package/cjs/columns/IconColumn.js +19 -17
  6. package/cjs/columns/NumberColumn.js +2 -4
  7. package/cjs/components/BodyCell.js +20 -12
  8. package/cjs/components/BodyList.js +7 -0
  9. package/cjs/components/ColumnVisibilityMenuOption.js +12 -6
  10. package/cjs/components/ColumnsOptionsMenuSection.js +35 -28
  11. package/cjs/components/EmptyState.js +19 -17
  12. package/cjs/components/HeaderCell.js +15 -9
  13. package/cjs/components/List.js +5 -0
  14. package/cjs/components/ListItem.js +7 -0
  15. package/cjs/components/NoResults.js +5 -0
  16. package/cjs/components/RowsLoader.js +5 -4
  17. package/cjs/components/Table.js +5 -0
  18. package/cjs/components/TableBody.js +5 -0
  19. package/cjs/components/TableHeader.js +5 -0
  20. package/cjs/components/footer/addOptionalFooterComponents.js +5 -4
  21. package/cjs/components/header/PrimaryControls.js +20 -15
  22. package/cjs/components/header/addOptionalHeaderComponents.js +4 -3
  23. package/cjs/components/renderers/defaultClassedRenderers.js +35 -23
  24. package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +50 -39
  25. package/cjs/plugins/column-dnd/DndColumnsPlugin.js +11 -7
  26. package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +2 -3
  27. package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +11 -9
  28. package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +13 -6
  29. package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +3 -3
  30. package/cjs/plugins/column-sizing/ext-points/getTableProps.js +23 -17
  31. package/cjs/plugins/column-sizing/useColumnSizeService.js +13 -3
  32. package/cjs/plugins/column-sizing/useStylesheetHelpers.js +69 -53
  33. package/cjs/plugins/column-sizing/utils.js +10 -6
  34. package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +9 -4
  35. package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +20 -21
  36. package/cjs/plugins/editable/EditableComponents/ComboBox.js +7 -3
  37. package/cjs/plugins/editable/EditableComponents/TextBox.js +20 -14
  38. package/cjs/plugins/editable/EditablePlugin.js +16 -15
  39. package/cjs/plugins/editable/decorateEditable.js +19 -11
  40. package/cjs/plugins/editable/getEditorComponent.js +45 -34
  41. package/cjs/plugins/expandable-grid/ExpandableColumn.js +60 -53
  42. package/cjs/plugins/expandable-grid/ExpandablePlugin.js +38 -26
  43. package/cjs/plugins/expandable-grid/ExpandedRow.js +28 -18
  44. package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +18 -12
  45. package/cjs/plugins/expandable-grid/useExpandGridState.js +4 -8
  46. package/cjs/plugins/export-data/ExportDataPlugin.js +31 -17
  47. package/cjs/plugins/filterable/FilterablePlugin.js +7 -6
  48. package/cjs/plugins/filterable/addFilterToColumn.js +5 -0
  49. package/cjs/plugins/filterable/components/FilterableHeader.js +36 -27
  50. package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +41 -34
  51. package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +27 -22
  52. package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +122 -156
  53. package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +29 -20
  54. package/cjs/plugins/filterable/filterableFormatter.js +15 -10
  55. package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +16 -4
  56. package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +7 -4
  57. package/cjs/plugins/filterable/helper.js +17 -7
  58. package/cjs/plugins/filterable/useFilterableState.js +12 -5
  59. package/cjs/plugins/grouping-by/GroupingByPlugin.js +3 -1
  60. package/cjs/plugins/grouping-grid/GroupingPlugin.js +10 -1
  61. package/cjs/plugins/grouping-grid/walkStrategy.js +13 -9
  62. package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +8 -1
  63. package/cjs/plugins/pagination/PaginationPlugin.js +9 -2
  64. package/cjs/plugins/pagination/components/Pagination.js +10 -9
  65. package/cjs/plugins/pagination/components/Paginator.js +8 -7
  66. package/cjs/plugins/pagination/components/PerPageDropdown.js +20 -13
  67. package/cjs/plugins/pagination/helper.js +10 -7
  68. package/cjs/plugins/pagination/usePaginationState.js +8 -3
  69. package/cjs/plugins/resizable/ResizablePlugin.js +5 -4
  70. package/cjs/plugins/resizable/decorateResizable.js +14 -8
  71. package/cjs/plugins/resizable/useResizeHandle.js +21 -16
  72. package/cjs/plugins/resizable/utils.js +9 -6
  73. package/cjs/plugins/row-dnd/DndRowsPlugin.js +24 -16
  74. package/cjs/plugins/selectable/SelectablePlugin.js +11 -10
  75. package/cjs/plugins/selectable/addSelectableColumn.js +24 -16
  76. package/cjs/plugins/selectable/helper.js +12 -3
  77. package/cjs/plugins/selectable/selectableFormatter.js +80 -71
  78. package/cjs/plugins/selectable/useSelectableState.js +25 -11
  79. package/cjs/plugins/sortable/SortablePlugin.js +8 -7
  80. package/cjs/plugins/sortable/sortHeaderFormatter.js +14 -15
  81. package/cjs/plugins/sortable/sortTree.js +13 -3
  82. package/cjs/plugins/sortable/sorter.js +152 -134
  83. package/cjs/plugins/sortable/useSortableState.js +8 -0
  84. package/cjs/plugins/toolbar/RowRenderer.js +9 -3
  85. package/cjs/plugins/toolbar/ToolbarPlugin.js +1 -0
  86. package/cjs/plugins/toolbar/ToolbarTrigger.js +18 -13
  87. package/cjs/plugins/virtualization/AutoHeightList.js +10 -8
  88. package/cjs/plugins/virtualization/VirtualizationPlugin.js +32 -25
  89. package/cjs/plugins/virtualization/VirtualizedBody.js +20 -10
  90. package/cjs/plugins/virtualization/VirtualizedBodyRow.js +8 -7
  91. package/cjs/renders/CellWithAddons.js +20 -18
  92. package/cjs/renders/styled.js +5 -16
  93. package/cjs/utilities/getPluginsFromProps.js +5 -1
  94. package/cjs/utilities/getScrollbarSize.js +2 -1
  95. package/cjs/utilities/normalizeData.js +7 -1
  96. package/esm/DSDataGrid.js +246 -243
  97. package/esm/DataGridImpl.js +18 -9
  98. package/esm/PaginatedDataGrid.js +5 -0
  99. package/esm/blockNames.js +2 -2
  100. package/esm/columns/IconColumn.js +19 -17
  101. package/esm/columns/NumberColumn.js +2 -4
  102. package/esm/components/BodyCell.js +20 -12
  103. package/esm/components/BodyList.js +7 -0
  104. package/esm/components/ColumnVisibilityMenuOption.js +12 -6
  105. package/esm/components/ColumnsOptionsMenuSection.js +35 -28
  106. package/esm/components/EmptyState.js +18 -15
  107. package/esm/components/HeaderCell.js +15 -9
  108. package/esm/components/List.js +5 -0
  109. package/esm/components/ListItem.js +7 -0
  110. package/esm/components/NoResults.js +5 -0
  111. package/esm/components/RowsLoader.js +5 -4
  112. package/esm/components/Table.js +5 -0
  113. package/esm/components/TableBody.js +5 -0
  114. package/esm/components/TableHeader.js +5 -0
  115. package/esm/components/footer/addOptionalFooterComponents.js +5 -4
  116. package/esm/components/header/PrimaryControls.js +20 -14
  117. package/esm/components/header/addOptionalHeaderComponents.js +4 -3
  118. package/esm/components/renderers/defaultClassedRenderers.js +35 -23
  119. package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +50 -39
  120. package/esm/plugins/column-dnd/DndColumnsPlugin.js +8 -4
  121. package/esm/plugins/column-dnd/decorateGridWithDndColumns.js +1 -1
  122. package/esm/plugins/column-sizing/ColumnSizingPlugin.js +10 -8
  123. package/esm/plugins/column-sizing/columnMeasurerTransformer.js +12 -5
  124. package/esm/plugins/column-sizing/ext-points/decorateColumn.js +1 -1
  125. package/esm/plugins/column-sizing/ext-points/getTableProps.js +22 -15
  126. package/esm/plugins/column-sizing/useColumnSizeService.js +13 -3
  127. package/esm/plugins/column-sizing/useStylesheetHelpers.js +67 -51
  128. package/esm/plugins/column-sizing/utils.js +8 -4
  129. package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +6 -1
  130. package/esm/plugins/custom-cell-renderer/getRendererComponent.js +15 -11
  131. package/esm/plugins/editable/EditableComponents/ComboBox.js +6 -1
  132. package/esm/plugins/editable/EditableComponents/TextBox.js +19 -12
  133. package/esm/plugins/editable/EditablePlugin.js +14 -12
  134. package/esm/plugins/editable/decorateEditable.js +18 -9
  135. package/esm/plugins/editable/getEditorComponent.js +49 -38
  136. package/esm/plugins/expandable-grid/ExpandableColumn.js +59 -50
  137. package/esm/plugins/expandable-grid/ExpandablePlugin.js +34 -20
  138. package/esm/plugins/expandable-grid/ExpandedRow.js +27 -17
  139. package/esm/plugins/expandable-grid/ExpandedRowExtra.js +17 -11
  140. package/esm/plugins/expandable-grid/useExpandGridState.js +2 -2
  141. package/esm/plugins/export-data/ExportDataPlugin.js +30 -16
  142. package/esm/plugins/filterable/FilterablePlugin.js +5 -4
  143. package/esm/plugins/filterable/addFilterToColumn.js +5 -0
  144. package/esm/plugins/filterable/components/FilterableHeader.js +32 -22
  145. package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +41 -33
  146. package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +27 -21
  147. package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +121 -154
  148. package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +28 -18
  149. package/esm/plugins/filterable/filterableFormatter.js +15 -10
  150. package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +14 -2
  151. package/esm/plugins/filterable/filtering-helper/strategiesOperators.js +7 -4
  152. package/esm/plugins/filterable/helper.js +11 -1
  153. package/esm/plugins/filterable/useFilterableState.js +12 -5
  154. package/esm/plugins/grouping-by/GroupingByPlugin.js +3 -1
  155. package/esm/plugins/grouping-grid/GroupingPlugin.js +10 -1
  156. package/esm/plugins/grouping-grid/walkStrategy.js +13 -9
  157. package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +8 -1
  158. package/esm/plugins/pagination/PaginationPlugin.js +8 -1
  159. package/esm/plugins/pagination/components/Pagination.js +10 -9
  160. package/esm/plugins/pagination/components/Paginator.js +8 -7
  161. package/esm/plugins/pagination/components/PerPageDropdown.js +17 -9
  162. package/esm/plugins/pagination/helper.js +10 -7
  163. package/esm/plugins/pagination/usePaginationState.js +7 -1
  164. package/esm/plugins/resizable/ResizablePlugin.js +4 -3
  165. package/esm/plugins/resizable/decorateResizable.js +14 -8
  166. package/esm/plugins/resizable/useResizeHandle.js +21 -16
  167. package/esm/plugins/resizable/utils.js +7 -4
  168. package/esm/plugins/row-dnd/DndRowsPlugin.js +22 -13
  169. package/esm/plugins/selectable/SelectablePlugin.js +10 -9
  170. package/esm/plugins/selectable/addSelectableColumn.js +24 -16
  171. package/esm/plugins/selectable/helper.js +10 -1
  172. package/esm/plugins/selectable/selectableFormatter.js +79 -68
  173. package/esm/plugins/selectable/useSelectableState.js +20 -5
  174. package/esm/plugins/sortable/SortablePlugin.js +5 -4
  175. package/esm/plugins/sortable/sortHeaderFormatter.js +12 -11
  176. package/esm/plugins/sortable/sortTree.js +13 -3
  177. package/esm/plugins/sortable/sorter.js +152 -134
  178. package/esm/plugins/sortable/useSortableState.js +8 -0
  179. package/esm/plugins/toolbar/RowRenderer.js +8 -2
  180. package/esm/plugins/toolbar/ToolbarPlugin.js +1 -0
  181. package/esm/plugins/toolbar/ToolbarTrigger.js +17 -11
  182. package/esm/plugins/virtualization/AutoHeightList.js +6 -3
  183. package/esm/plugins/virtualization/VirtualizationPlugin.js +31 -24
  184. package/esm/plugins/virtualization/VirtualizedBody.js +16 -6
  185. package/esm/plugins/virtualization/VirtualizedBodyRow.js +8 -7
  186. package/esm/renders/CellWithAddons.js +15 -14
  187. package/esm/renders/styled.js +3 -15
  188. package/esm/utilities/getPluginsFromProps.js +5 -1
  189. package/esm/utilities/getScrollbarSize.js +2 -1
  190. package/esm/utilities/normalizeData.js +7 -1
  191. package/package.json +19 -18
  192. package/types/components/BodyCell.d.ts +1 -1
  193. package/types/components/HeaderCell.d.ts +1 -1
  194. package/types/plugins/column-sizing/columnMeasurerTransformer.d.ts +1 -1
  195. package/types/plugins/column-sizing/ext-points/getTableProps.d.ts +1 -1
  196. package/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +1 -1
  197. package/types/plugins/expandable-grid/useExpandGridState.d.ts +4 -4
  198. package/types/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.d.ts +1 -1
  199. package/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +1 -1
  200. package/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +1 -1
  201. package/types/plugins/filterable/helper.d.ts +15 -3
  202. package/types/plugins/pagination/components/PerPageDropdown.d.ts +1 -1
  203. package/cjs/package.json +0 -7
  204. package/esm/package.json +0 -7
@@ -1,3 +1,8 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
8
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
@@ -16,48 +21,54 @@ const components = {
16
21
  DSTextBox: TextBox
17
22
  };
18
23
 
19
- const getEditorComponent = (editorComponent = {}, handlers) => ({
20
- value,
21
- onValue,
22
- extraParameters
23
- }) => {
24
- if (typeof editorComponent === 'function') {
25
- return editorComponent(_objectSpread({
24
+ const getEditorComponent = function () {
25
+ let editorComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26
+ let handlers = arguments.length > 1 ? arguments[1] : undefined;
27
+ return _ref => {
28
+ let {
26
29
  value,
27
30
  onValue,
28
- customHandlers: handlers
29
- }, extraParameters));
30
- }
31
-
32
- const {
33
- type = 'DSTextBox'
34
- } = editorComponent,
35
- restEditorProps = _objectWithoutProperties(editorComponent, _excluded);
36
-
37
- const Component = components[type];
38
-
39
- if (type === 'DSComboBox') {
40
- var _restEditorProps$opti;
41
-
42
- // TODO: remove this whole condition when combobox v3 is out and fully working without "maxOptions" parameter
43
- const maxOptions = (restEditorProps === null || restEditorProps === void 0 ? void 0 : (_restEditorProps$opti = restEditorProps.options) === null || _restEditorProps$opti === void 0 ? void 0 : _restEditorProps$opti.length) || 100;
44
- return /*#__PURE__*/_jsx("div", {
45
- style: {
46
- zIndex: 0
47
- }
48
- }, void 0, /*#__PURE__*/jsx(Component, _objectSpread({
31
+ extraParameters
32
+ } = _ref;
33
+
34
+ if (typeof editorComponent === 'function') {
35
+ return editorComponent(_objectSpread({
36
+ value,
37
+ onValue,
38
+ customHandlers: handlers
39
+ }, extraParameters));
40
+ }
41
+
42
+ const {
43
+ type = 'DSTextBox'
44
+ } = editorComponent,
45
+ restEditorProps = _objectWithoutProperties(editorComponent, _excluded);
46
+
47
+ const Component = components[type];
48
+
49
+ if (type === 'DSComboBox') {
50
+ var _restEditorProps$opti;
51
+
52
+ // TODO: remove this whole condition when combobox v3 is out and fully working without "maxOptions" parameter
53
+ const maxOptions = (restEditorProps === null || restEditorProps === void 0 ? void 0 : (_restEditorProps$opti = restEditorProps.options) === null || _restEditorProps$opti === void 0 ? void 0 : _restEditorProps$opti.length) || 100;
54
+ return /*#__PURE__*/_jsx("div", {
55
+ style: {
56
+ zIndex: 0
57
+ }
58
+ }, void 0, /*#__PURE__*/jsx(Component, _objectSpread({
59
+ autoFocus: true,
60
+ onValue: onValue,
61
+ value: value,
62
+ maxOptions: maxOptions
63
+ }, restEditorProps)));
64
+ }
65
+
66
+ return /*#__PURE__*/jsx(Component, _objectSpread({
49
67
  autoFocus: true,
50
68
  onValue: onValue,
51
- value: value,
52
- maxOptions: maxOptions
53
- }, restEditorProps)));
54
- }
55
-
56
- return /*#__PURE__*/jsx(Component, _objectSpread({
57
- autoFocus: true,
58
- onValue: onValue,
59
- value: value
60
- }, restEditorProps));
69
+ value: value
70
+ }, restEditorProps));
71
+ };
61
72
  };
62
73
 
63
74
  export { getEditorComponent as default };
@@ -1,12 +1,16 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
8
  import _jsx from '@babel/runtime/helpers/esm/jsx';
4
9
  import { useRef } from 'react';
5
- import ArrowheadDown from '@elliemae/ds-icons/ArrowheadDown';
6
- import ArrowheadRight from '@elliemae/ds-icons/ArrowheadRight';
10
+ import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';
7
11
  import { aggregatedClasses } from '@elliemae/ds-classnames';
8
- import DSButton from '@elliemae/ds-basic/Button';
9
- import DSTruncatedTooltipText from '@elliemae/ds-basic/TruncatedTooltipText';
12
+ import DSButton from '@elliemae/ds-button';
13
+ import DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';
10
14
  import { dataGridBlockName } from '../../blockNames.js';
11
15
  import { RowSizes } from '../../rowSizes.js';
12
16
  import { jsxs } from 'react/jsx-runtime';
@@ -18,24 +22,25 @@ var _ArrowheadDown, _ArrowheadRight;
18
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; }
19
23
 
20
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(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; }
21
- const blockName = `${dataGridBlockName}-expandable-column`; // todo: clean this when we move to css-js
25
+ const blockName = "".concat(dataGridBlockName, "-expandable-column"); // todo: clean this when we move to css-js
22
26
 
23
27
  const ExpandableColumnWrapper = aggregatedClasses('div')(blockName);
24
28
  const LabelDescriptionWrapper = aggregatedClasses('div')(blockName, 'label-description-wrapper');
25
29
  const Label = aggregatedClasses('span')(blockName, 'label');
26
30
  const Description = aggregatedClasses('span')(blockName, 'description');
27
31
  const ExtraColumnData = aggregatedClasses('div')(blockName, 'extra-column-data');
28
- const ExpandableMasterWrapper = aggregatedClasses('div')(`${blockName}-master-wrapper`);
29
- const ExpandableDetailsWrapper = aggregatedClasses('div')(`${blockName}-details-wrapper`);
32
+ const ExpandableMasterWrapper = aggregatedClasses('div')("".concat(blockName, "-master-wrapper"));
33
+ const ExpandableDetailsWrapper = aggregatedClasses('div')("".concat(blockName, "-details-wrapper"));
30
34
 
31
- function ExpandableColumnCell({
32
- label,
33
- description,
34
- isExpanded,
35
- expandableDetails,
36
- extraData,
37
- onToggleExpand
38
- }) {
35
+ function ExpandableColumnCell(_ref) {
36
+ let {
37
+ label,
38
+ description,
39
+ isExpanded,
40
+ expandableDetails,
41
+ extraData,
42
+ onToggleExpand
43
+ } = _ref;
39
44
  const ref = useRef();
40
45
  return /*#__PURE__*/jsxs(ExpandableColumnWrapper, {
41
46
  ref: ref,
@@ -64,44 +69,48 @@ function ExpandableColumnCell({
64
69
  });
65
70
  }
66
71
 
67
- const expandableColumnRenderer = ({
68
- renderRowLabel,
69
- renderRowDescription,
70
- renderExtraData
71
- }) => (value, {
72
- rowData,
73
- isExpanded
74
- }, grid) => {
75
- const {
76
- props: {
77
- renderExpandedDetails
78
- },
79
- actions: {
80
- toggleExpand
81
- }
82
- } = grid.getInstance();
83
- const expandableDetails = renderExpandedDetails({
84
- rowData
85
- });
86
- return /*#__PURE__*/_jsx(ExpandableColumnCell, {
87
- description: renderRowDescription({
88
- rowData
89
- }),
90
- expandableDetails: expandableDetails,
91
- extraData: renderExtraData({
92
- rowData
93
- }),
94
- isExpanded: isExpanded,
95
- label: renderRowLabel({
72
+ const expandableColumnRenderer = _ref2 => {
73
+ let {
74
+ renderRowLabel,
75
+ renderRowDescription,
76
+ renderExtraData
77
+ } = _ref2;
78
+ return (value, _ref3, grid) => {
79
+ let {
80
+ rowData,
81
+ isExpanded
82
+ } = _ref3;
83
+ const {
84
+ props: {
85
+ renderExpandedDetails
86
+ },
87
+ actions: {
88
+ toggleExpand
89
+ }
90
+ } = grid.getInstance();
91
+ const expandableDetails = renderExpandedDetails({
96
92
  rowData
97
- }),
98
- onToggleExpand: () => toggleExpand(rowData)
99
- });
93
+ });
94
+ return /*#__PURE__*/_jsx(ExpandableColumnCell, {
95
+ description: renderRowDescription({
96
+ rowData
97
+ }),
98
+ expandableDetails: expandableDetails,
99
+ extraData: renderExtraData({
100
+ rowData
101
+ }),
102
+ isExpanded: isExpanded,
103
+ label: renderRowLabel({
104
+ rowData
105
+ }),
106
+ onToggleExpand: () => toggleExpand(rowData)
107
+ });
108
+ };
100
109
  };
101
110
 
102
111
  const noop = () => null;
103
112
 
104
- function createExpandableColumn(_ref) {
113
+ function createExpandableColumn(_ref4) {
105
114
  let {
106
115
  property,
107
116
  label,
@@ -113,8 +122,8 @@ function createExpandableColumn(_ref) {
113
122
  sortable,
114
123
  searchable,
115
124
  customRenderer
116
- } = _ref,
117
- rest = _objectWithoutProperties(_ref, _excluded);
125
+ } = _ref4,
126
+ rest = _objectWithoutProperties(_ref4, _excluded);
118
127
 
119
128
  return _objectSpread(_objectSpread({}, rest), {}, {
120
129
  label,
@@ -1,12 +1,21 @@
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
3
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
2
4
  import _jsx from '@babel/runtime/helpers/esm/jsx';
3
5
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
6
+ import 'core-js/modules/esnext.async-iterator.some.js';
7
+ import 'core-js/modules/esnext.iterator.constructor.js';
8
+ import 'core-js/modules/esnext.iterator.some.js';
9
+ import 'core-js/modules/esnext.async-iterator.filter.js';
10
+ import 'core-js/modules/esnext.iterator.filter.js';
11
+ import 'core-js/modules/esnext.async-iterator.map.js';
12
+ import 'core-js/modules/esnext.iterator.map.js';
13
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
14
  import { useMemo, useRef, useEffect } from 'react';
5
- import { cx, isFunction } from '@elliemae/ds-utilities/utils';
15
+ import { cx, isFunction } from '@elliemae/ds-utilities';
6
16
  import { VariableSizeList } from 'react-window';
7
- import ArrowheadDown from '@elliemae/ds-icons/ArrowheadDown';
8
- import ArrowheadRight from '@elliemae/ds-icons/ArrowheadRight';
9
- import DSButton from '@elliemae/ds-basic/Button';
17
+ import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';
18
+ import DSButton from '@elliemae/ds-button';
10
19
  import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
11
20
  import { appendCellFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';
12
21
  import ExpandedRow from './ExpandedRow.js';
@@ -23,12 +32,15 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
23
32
 
24
33
  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(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; }
25
34
 
26
- const getExpandedRowSizeBySubrows = ({
27
- totalAmount,
28
- amountVisible,
29
- isShowingAll,
30
- size = 36
31
- }) => isShowingAll ? size * (totalAmount + 1) - 6 : size * (amountVisible + 1) + 32;
35
+ const getExpandedRowSizeBySubrows = _ref => {
36
+ let {
37
+ totalAmount,
38
+ amountVisible,
39
+ isShowingAll,
40
+ size = 36
41
+ } = _ref;
42
+ return isShowingAll ? size * (totalAmount + 1) - 6 : size * (amountVisible + 1) + 32;
43
+ };
32
44
 
33
45
  const ExpandedRows = {
34
46
  SingleColumn: ExpandedRow,
@@ -61,10 +73,11 @@ const ExpandablePlugin = createInstancePlugin('expandable', {
61
73
  const firstColumnIndex = columns.findIndex(column => column.isUserColumn);
62
74
  const firstColumn = columns[firstColumnIndex];
63
75
  firstColumn.formatExpandable = true;
64
- return [...columns.slice(0, firstColumnIndex), appendCellFormatter((value, {
65
- isExpanded,
66
- rowData
67
- }) => {
76
+ return [...columns.slice(0, firstColumnIndex), appendCellFormatter((value, _ref2) => {
77
+ let {
78
+ isExpanded,
79
+ rowData
80
+ } = _ref2;
68
81
  const {
69
82
  actions: {
70
83
  toggleExpand
@@ -152,11 +165,11 @@ const ExpandablePlugin = createInstancePlugin('expandable', {
152
165
  const expandedRowType = isExpandableSingleColumn(grid.decoratedColumns) ? 'SingleColumn' : 'Master';
153
166
  const ExpandedRowComponent = createExpandedRow(expandedRowType); // eslint-disable-next-line react/display-name
154
167
 
155
- return _ref => {
168
+ return _ref3 => {
156
169
  let {
157
170
  isExpanded
158
- } = _ref,
159
- rowProps = _objectWithoutProperties(_ref, _excluded);
171
+ } = _ref3,
172
+ rowProps = _objectWithoutProperties(_ref3, _excluded);
160
173
 
161
174
  if (isExpanded) {
162
175
  const {
@@ -192,9 +205,10 @@ const ExpandablePlugin = createInstancePlugin('expandable', {
192
205
  return renderers;
193
206
  },
194
207
 
195
- getRowProps(rowProps, grid, {
196
- rowData
197
- }) {
208
+ getRowProps(rowProps, grid, _ref4) {
209
+ let {
210
+ rowData
211
+ } = _ref4;
198
212
  const {
199
213
  props: {
200
214
  rowKey
@@ -1,11 +1,18 @@
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
3
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
4
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
5
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
6
+ import 'core-js/modules/esnext.async-iterator.map.js';
7
+ import 'core-js/modules/esnext.iterator.map.js';
8
+ import 'core-js/modules/esnext.async-iterator.filter.js';
9
+ import 'core-js/modules/esnext.iterator.constructor.js';
10
+ import 'core-js/modules/esnext.iterator.filter.js';
4
11
  import 'react';
5
- import DSSeparator from '@elliemae/ds-basic/Separator';
6
- import DSButton from '@elliemae/ds-basic/Button';
12
+ import DSSeparator from '@elliemae/ds-separator';
13
+ import DSButton from '@elliemae/ds-button';
7
14
  import styled from 'styled-components';
8
- import { get } from '@elliemae/ds-utilities/utils';
15
+ import { get } from '@elliemae/ds-utilities';
9
16
  import deferComponentRender from '@elliemae/ds-shared/defer-render-hoc';
10
17
  import useDataGrid from '@elliemae/ds-shared/useDataGrid';
11
18
  import { PaginationPlugin } from '../pagination/PaginationPlugin.js';
@@ -24,11 +31,13 @@ const _excluded = ["instanceRef"],
24
31
  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; }
25
32
 
26
33
  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(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
- const DetailGrid = deferComponentRender(({
28
- parentGrid,
29
- parentRowData,
30
- rows
31
- }) => {
34
+ const DetailGrid = deferComponentRender(_ref => {
35
+ let {
36
+ parentGrid,
37
+ parentRowData,
38
+ rows
39
+ } = _ref;
40
+
32
41
  const _parentGrid$props = parentGrid.props,
33
42
  parentProps = _objectWithoutProperties(_parentGrid$props, _excluded);
34
43
 
@@ -61,15 +70,16 @@ const DetailGridWrapper = /*#__PURE__*/styled.div.withConfig({
61
70
  componentId: "sc-1goa4zy-1"
62
71
  })(["display:flex;height:calc(100% - ", "px);width:", "px;margin:12px 0;"], props => props.allRowsVisible ? 18 : 60, props => props.expandableGridDetailWidth);
63
72
 
64
- function ExpandedRow({
65
- parentGrid,
66
- detailColumns,
67
- rowData,
68
- rows,
69
- rowProps,
70
- cellComponent: CellComponent,
71
- rowComponent: RowComponent
72
- }) {
73
+ function ExpandedRow(_ref2) {
74
+ let {
75
+ parentGrid,
76
+ detailColumns,
77
+ rowData,
78
+ rows,
79
+ rowProps,
80
+ cellComponent: CellComponent,
81
+ rowComponent: RowComponent
82
+ } = _ref2;
73
83
  const {
74
84
  decoratedColumns,
75
85
  actions: {
@@ -1,8 +1,13 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import _jsx from '@babel/runtime/helpers/esm/jsx';
3
8
  import 'react';
4
- import { cx } from '@elliemae/ds-utilities/utils';
5
- import DSSeparator from '@elliemae/ds-basic/Separator';
9
+ import { cx } from '@elliemae/ds-utilities';
10
+ import DSSeparator from '@elliemae/ds-separator';
6
11
  import { aggregatedClasses } from '@elliemae/ds-classnames';
7
12
  import { dataGridBlockName } from '../../blockNames.js';
8
13
  import { jsxs } from 'react/jsx-runtime';
@@ -12,18 +17,19 @@ var _DSSeparator;
12
17
  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
18
 
14
19
  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(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; }
15
- const blockName = `${dataGridBlockName}-expanded-row`;
16
- const DetailsWrapper = aggregatedClasses('div')(`${blockName}-details-wrapper`, null, () => ({
20
+ const blockName = "".concat(dataGridBlockName, "-expanded-row");
21
+ const DetailsWrapper = aggregatedClasses('div')("".concat(blockName, "-details-wrapper"), null, () => ({
17
22
  'ie-flex-basis-auto': true
18
23
  }));
19
24
 
20
- function ExpandedRowExtra({
21
- children,
22
- rowData,
23
- rowProps,
24
- rowComponent: RowComponent,
25
- renderRowDetails = () => null
26
- }) {
25
+ function ExpandedRowExtra(_ref) {
26
+ let {
27
+ children,
28
+ rowData,
29
+ rowProps,
30
+ rowComponent: RowComponent,
31
+ renderRowDetails = () => null
32
+ } = _ref;
27
33
  return /*#__PURE__*/jsxs(RowComponent, _objectSpread(_objectSpread({}, rowProps), {}, {
28
34
  className: cx(rowProps.className, 'expanded-detail-row'),
29
35
  children: [/*#__PURE__*/_jsx(RowComponent, {
@@ -1,5 +1,5 @@
1
- import { isFunction } from '@elliemae/ds-utilities/utils';
2
- import useExpandState from '@elliemae/ds-utilities/hooks/useExpandState';
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+ import { useExpandState, isFunction } from '@elliemae/ds-utilities';
3
3
  import { useState } from 'react';
4
4
 
5
5
  const useExpandGridState = grid => {
@@ -1,8 +1,18 @@
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
3
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
+ import 'core-js/modules/esnext.async-iterator.reduce.js';
5
+ import 'core-js/modules/esnext.iterator.constructor.js';
6
+ import 'core-js/modules/esnext.iterator.reduce.js';
7
+ import 'core-js/modules/web.dom-collections.iterator.js';
8
+ import 'core-js/modules/esnext.async-iterator.map.js';
9
+ import 'core-js/modules/esnext.iterator.map.js';
10
+ import 'core-js/modules/esnext.async-iterator.filter.js';
11
+ import 'core-js/modules/esnext.iterator.filter.js';
2
12
  import 'core-js/modules/es.string.replace.js';
3
13
  import 'core-js/modules/web.url.js';
4
14
  import 'core-js/modules/web.url-search-params.js';
5
- import { get } from '@elliemae/ds-utilities/utils';
15
+ import { get } from '@elliemae/ds-utilities';
6
16
  import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
7
17
 
8
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; }
@@ -20,12 +30,12 @@ const isVisible = column => {
20
30
  const getColumnValue = (row, property) => get(row, property);
21
31
  const getVisibleRowData = (row, columns) => columns.reduce((result, column) => {
22
32
  const columnProperty = column.property;
23
- return isVisible(column) ? [...result, getColumnValue(row, `_${columnProperty}`) || getColumnValue(row, columnProperty)] : result;
33
+ return isVisible(column) ? [...result, getColumnValue(row, "_".concat(columnProperty)) || getColumnValue(row, columnProperty)] : result;
24
34
  }, []);
25
35
 
26
36
  const defaultOptions = uuid => ({
27
37
  sheetName: 'SheetName',
28
- fileName: `datagrid-${uuid}`,
38
+ fileName: "datagrid-".concat(uuid),
29
39
  type: 'csv',
30
40
  onlySelection: false,
31
41
  excludedColumns: undefined
@@ -41,18 +51,20 @@ const getCellValue = cell => {
41
51
  const getExportedData = (rows, columns, range) => {
42
52
  const rowsRanged = range ? rows.slice(...range) : rows;
43
53
  const dataToExport = rowsRanged.map(row => getVisibleRowData(row, columns));
44
- const columnsContent = columns.filter(c => isVisible(c)).reduce((acc, curr, idx) => `${acc}${idx === 0 ? '' : ','}${curr.label}`, '');
45
- const rowsContent = dataToExport.map(e => e.map(r => `"${String(getCellValue(r)).replace(/"/g, '""')}"`).join(',')).join('\r\n');
46
- const csvContent = `${columnsContent}\r\n${rowsContent}`;
54
+ const columnsContent = columns.filter(c => isVisible(c)).reduce((acc, curr, idx) => "".concat(acc).concat(idx === 0 ? '' : ',').concat(curr.label), '');
55
+ const rowsContent = dataToExport.map(e => e.map(r => "\"".concat(String(getCellValue(r)).replace(/"/g, '""'), "\"")).join(',')).join('\r\n');
56
+ const csvContent = "".concat(columnsContent, "\r\n").concat(rowsContent);
47
57
  return csvContent;
48
58
  }; // eslint-disable-next-line max-statements
49
59
 
50
- const exportTo = (rows, columns, {
51
- range,
52
- fileName,
53
- type,
54
- excludedColumns
55
- }) => {
60
+ const exportTo = (rows, columns, _ref) => {
61
+ let {
62
+ range,
63
+ fileName,
64
+ type,
65
+ excludedColumns
66
+ } = _ref;
67
+
56
68
  if (excludedColumns) {
57
69
  // eslint-disable-next-line no-param-reassign
58
70
  columns = columns.filter(col => !excludedColumns.includes(col.property));
@@ -65,7 +77,7 @@ const exportTo = (rows, columns, {
65
77
 
66
78
  if (navigator.msSaveBlob) {
67
79
  // IE 10+
68
- navigator.msSaveBlob(blob, `${fileName}.${type}`);
80
+ navigator.msSaveBlob(blob, "".concat(fileName, ".").concat(type));
69
81
  } else {
70
82
  const link = document.createElement('a');
71
83
 
@@ -74,7 +86,7 @@ const exportTo = (rows, columns, {
74
86
  // Browsers that support HTML5 download attribute
75
87
  const url = URL.createObjectURL(blob);
76
88
  link.setAttribute('href', url);
77
- link.setAttribute('download', `${fileName}.${type}`);
89
+ link.setAttribute('download', "".concat(fileName, ".").concat(type));
78
90
  link.style.visibility = 'hidden';
79
91
  document.body.appendChild(link);
80
92
  link.click();
@@ -86,7 +98,8 @@ const exportTo = (rows, columns, {
86
98
  const ExportDataPlugin = createInstancePlugin('export-data', {
87
99
  decorateGrid(instance) {
88
100
  return {
89
- exportRows(opts = {}) {
101
+ exportRows() {
102
+ let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
90
103
  const {
91
104
  composedRows: rows,
92
105
  columns,
@@ -110,7 +123,8 @@ const ExportDataPlugin = createInstancePlugin('export-data', {
110
123
  exportTo(currentRows, columns, options);
111
124
  },
112
125
 
113
- exportVisibleRows(opts = {}) {
126
+ exportVisibleRows() {
127
+ let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
114
128
  const {
115
129
  composedRows: rows,
116
130
  columns,
@@ -1,4 +1,4 @@
1
- import { get, isFunction } from '@elliemae/ds-utilities/utils';
1
+ import { get, isFunction } from '@elliemae/ds-utilities';
2
2
  import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
3
3
  import { addFilterToColumn } from './addFilterToColumn.js';
4
4
  import filterRowsByQuery, { filterRowsByQueryGroup } from './filtering-helper/filterRowsByQuery.js';
@@ -54,9 +54,10 @@ const FilterablePlugin = createInstancePlugin('filterable', {
54
54
  registerHotKeys(grid) {
55
55
  return {
56
56
  key: 'ctrl+f',
57
- handler: ({
58
- cellIndex
59
- }) => {
57
+ handler: _ref => {
58
+ let {
59
+ cellIndex
60
+ } = _ref;
60
61
  const {
61
62
  decoratedColumns
62
63
  } = grid.getInstance();
@@ -1,3 +1,8 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import { createRef } from 'react';
3
8
  import { mergeClassNameToColumnHeader } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';