@elliemae/ds-data-table 2.3.0-next.1 → 2.3.0-next.10

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.
@@ -7,11 +7,11 @@ require('core-js/modules/web.dom-collections.iterator.js');
7
7
  require('core-js/modules/esnext.async-iterator.reduce.js');
8
8
  require('core-js/modules/esnext.iterator.constructor.js');
9
9
  require('core-js/modules/esnext.iterator.reduce.js');
10
- var React = require('react');
11
- var dsForm = require('@elliemae/ds-form');
12
- require('@babel/runtime/helpers/defineProperty');
13
10
  require('core-js/modules/esnext.async-iterator.filter.js');
14
11
  require('core-js/modules/esnext.iterator.filter.js');
12
+ var React = require('react');
13
+ var dsControlledForm = require('@elliemae/ds-controlled-form');
14
+ require('@babel/runtime/helpers/defineProperty');
15
15
  require('core-js/modules/esnext.async-iterator.for-each.js');
16
16
  require('core-js/modules/esnext.iterator.for-each.js');
17
17
  require('@elliemae/ds-button');
@@ -26,6 +26,7 @@ require('core-js/modules/esnext.iterator.map.js');
26
26
  require('@elliemae/ds-icons');
27
27
  require('../../../styled.js');
28
28
  require('react/jsx-runtime');
29
+ require('@elliemae/ds-form');
29
30
  require('../../../parts/TableContent.js');
30
31
  require('@elliemae/ds-grid');
31
32
  require('@elliemae/ds-circular-progress-indicator');
@@ -61,6 +62,8 @@ const ComboboxEditableCell = props => {
61
62
  const cellValue = React.useMemo(() => cell.value, [cell.value]);
62
63
  const columnId = React.useMemo(() => cell.column.id, [cell.column.id]);
63
64
  const [value, setValue] = React.useState({
65
+ dsId: cellValue,
66
+ type: 'option',
64
67
  value: cellValue,
65
68
  label: cellValue
66
69
  });
@@ -71,6 +74,8 @@ const ComboboxEditableCell = props => {
71
74
 
72
75
  if (!uniqueValuesMap[currValue]) {
73
76
  optionsSoFar.push({
77
+ dsId: currValue,
78
+ type: 'option',
74
79
  value: currValue,
75
80
  label: currValue
76
81
  });
@@ -80,6 +85,10 @@ const ComboboxEditableCell = props => {
80
85
  return optionsSoFar;
81
86
  }, []);
82
87
  }, [flattenedData, columnId]);
88
+
89
+ const filterOptions = newFilter => uniqueOptions.filter(option => option.type === 'separator' || option.label.toLowerCase().includes(newFilter.toLowerCase()));
90
+
91
+ const [currentOptions, setCurrentOptions] = React.useState(uniqueOptions);
83
92
  const handleOnBlur = React.useCallback(() => {
84
93
  const property = columnId;
85
94
  onCellValueChange({
@@ -87,15 +96,17 @@ const ComboboxEditableCell = props => {
87
96
  property,
88
97
  rowIndex: cell.row.index
89
98
  });
90
- }, [columnId, onCellValueChange, value === null || value === void 0 ? void 0 : value.value, cell.row.index]);
99
+ }, [columnId, onCellValueChange, value === null || value === void 0 ? void 0 : value.value, cell]);
91
100
  return /*#__PURE__*/_jsx__default["default"](EditableCell.EditableCell, {
92
101
  StandardRender: DefaultCellRender,
93
- EditableRenderer: /*#__PURE__*/_jsx__default["default"](dsForm.ComboBoxFreeSolo, {
94
- value: value,
102
+ EditableRenderer: /*#__PURE__*/_jsx__default["default"](dsControlledForm.DSComboBox, {
103
+ selectedValues: value,
95
104
  autoFocus: true,
105
+ withoutPortal: false,
96
106
  onBlur: handleOnBlur,
97
107
  onChange: setValue,
98
- options: uniqueOptions
108
+ onFilter: newFilter => setCurrentOptions(filterOptions(newFilter)),
109
+ options: currentOptions
99
110
  }),
100
111
  cell: cell,
101
112
  isRowSelected: isRowSelected
@@ -141,7 +141,7 @@ const FilterPopover = _ref2 => {
141
141
  innerRef.current = _ref;
142
142
  },
143
143
  tabIndex: reduxHeader !== null && reduxHeader !== void 0 && reduxHeader.withTabStops ? 0 : -1
144
- })), /*#__PURE__*/_jsx__default["default"](dsPopperjs.DSPopperJS, {
144
+ })), referenceElement && /*#__PURE__*/_jsx__default["default"](dsPopperjs.DSPopperJS, {
145
145
  referenceElement: referenceElement,
146
146
  showPopover: isMenuOpen,
147
147
  closeContextMenu: handleClickOutsideMenu,
@@ -3,10 +3,10 @@ import 'core-js/modules/web.dom-collections.iterator.js';
3
3
  import 'core-js/modules/esnext.async-iterator.reduce.js';
4
4
  import 'core-js/modules/esnext.iterator.constructor.js';
5
5
  import 'core-js/modules/esnext.iterator.reduce.js';
6
- import { useContext, useMemo, useState, useCallback } from 'react';
7
- import { ComboBoxFreeSolo } from '@elliemae/ds-form';
8
6
  import 'core-js/modules/esnext.async-iterator.filter.js';
9
7
  import 'core-js/modules/esnext.iterator.filter.js';
8
+ import { useContext, useMemo, useState, useCallback } from 'react';
9
+ import { DSComboBox } from '@elliemae/ds-controlled-form';
10
10
  import 'core-js/modules/esnext.async-iterator.for-each.js';
11
11
  import 'core-js/modules/esnext.iterator.for-each.js';
12
12
  import '@babel/runtime/helpers/esm/defineProperty';
@@ -22,6 +22,7 @@ import 'core-js/modules/esnext.iterator.map.js';
22
22
  import '@elliemae/ds-icons';
23
23
  import '../../../styled.js';
24
24
  import 'react/jsx-runtime';
25
+ import '@elliemae/ds-form';
25
26
  import '../../../parts/TableContent.js';
26
27
  import '@elliemae/ds-grid';
27
28
  import '@elliemae/ds-circular-progress-indicator';
@@ -53,6 +54,8 @@ const ComboboxEditableCell = props => {
53
54
  const cellValue = useMemo(() => cell.value, [cell.value]);
54
55
  const columnId = useMemo(() => cell.column.id, [cell.column.id]);
55
56
  const [value, setValue] = useState({
57
+ dsId: cellValue,
58
+ type: 'option',
56
59
  value: cellValue,
57
60
  label: cellValue
58
61
  });
@@ -63,6 +66,8 @@ const ComboboxEditableCell = props => {
63
66
 
64
67
  if (!uniqueValuesMap[currValue]) {
65
68
  optionsSoFar.push({
69
+ dsId: currValue,
70
+ type: 'option',
66
71
  value: currValue,
67
72
  label: currValue
68
73
  });
@@ -72,6 +77,10 @@ const ComboboxEditableCell = props => {
72
77
  return optionsSoFar;
73
78
  }, []);
74
79
  }, [flattenedData, columnId]);
80
+
81
+ const filterOptions = newFilter => uniqueOptions.filter(option => option.type === 'separator' || option.label.toLowerCase().includes(newFilter.toLowerCase()));
82
+
83
+ const [currentOptions, setCurrentOptions] = useState(uniqueOptions);
75
84
  const handleOnBlur = useCallback(() => {
76
85
  const property = columnId;
77
86
  onCellValueChange({
@@ -79,15 +88,17 @@ const ComboboxEditableCell = props => {
79
88
  property,
80
89
  rowIndex: cell.row.index
81
90
  });
82
- }, [columnId, onCellValueChange, value === null || value === void 0 ? void 0 : value.value, cell.row.index]);
91
+ }, [columnId, onCellValueChange, value === null || value === void 0 ? void 0 : value.value, cell]);
83
92
  return /*#__PURE__*/_jsx(EditableCell, {
84
93
  StandardRender: DefaultCellRender,
85
- EditableRenderer: /*#__PURE__*/_jsx(ComboBoxFreeSolo, {
86
- value: value,
94
+ EditableRenderer: /*#__PURE__*/_jsx(DSComboBox, {
95
+ selectedValues: value,
87
96
  autoFocus: true,
97
+ withoutPortal: false,
88
98
  onBlur: handleOnBlur,
89
99
  onChange: setValue,
90
- options: uniqueOptions
100
+ onFilter: newFilter => setCurrentOptions(filterOptions(newFilter)),
101
+ options: currentOptions
91
102
  }),
92
103
  cell: cell,
93
104
  isRowSelected: isRowSelected
@@ -130,7 +130,7 @@ const FilterPopover = _ref2 => {
130
130
  innerRef.current = _ref;
131
131
  },
132
132
  tabIndex: reduxHeader !== null && reduxHeader !== void 0 && reduxHeader.withTabStops ? 0 : -1
133
- })), /*#__PURE__*/_jsx(DSPopperJS, {
133
+ })), referenceElement && /*#__PURE__*/_jsx(DSPopperJS, {
134
134
  referenceElement: referenceElement,
135
135
  showPopover: isMenuOpen,
136
136
  closeContextMenu: handleClickOutsideMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-data-table",
3
- "version": "2.3.0-next.1",
3
+ "version": "2.3.0-next.10",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Data Table",
6
6
  "module": "./esm/index.js",
@@ -570,23 +570,23 @@
570
570
  "dependencies": {
571
571
  "@dnd-kit/core": "~4.0.1",
572
572
  "@dnd-kit/sortable": "~5.0.0",
573
- "@elliemae/ds-button": "2.3.0-next.1",
574
- "@elliemae/ds-circular-progress-indicator": "2.3.0-next.1",
575
- "@elliemae/ds-controlled-form": "2.3.0-next.1",
576
- "@elliemae/ds-drag-and-drop": "2.3.0-next.1",
577
- "@elliemae/ds-dropdownmenu": "2.3.0-next.1",
578
- "@elliemae/ds-form": "2.3.0-next.1",
579
- "@elliemae/ds-form-layout-blocks": "2.3.0-next.1",
580
- "@elliemae/ds-grid": "2.3.0-next.1",
581
- "@elliemae/ds-icons": "2.3.0-next.1",
582
- "@elliemae/ds-indeterminate-progress-indicator": "2.3.0-next.1",
583
- "@elliemae/ds-pagination": "2.3.0-next.1",
584
- "@elliemae/ds-pills": "2.3.0-next.1",
585
- "@elliemae/ds-popperjs": "2.3.0-next.1",
586
- "@elliemae/ds-system": "2.3.0-next.1",
587
- "@elliemae/ds-toolbar": "2.3.0-next.1",
588
- "@elliemae/ds-truncated-tooltip-text": "2.3.0-next.1",
589
- "@elliemae/ds-utilities": "2.3.0-next.1",
573
+ "@elliemae/ds-button": "2.3.0-next.10",
574
+ "@elliemae/ds-circular-progress-indicator": "2.3.0-next.10",
575
+ "@elliemae/ds-controlled-form": "2.3.0-next.10",
576
+ "@elliemae/ds-drag-and-drop": "2.3.0-next.10",
577
+ "@elliemae/ds-dropdownmenu": "2.3.0-next.10",
578
+ "@elliemae/ds-form": "2.3.0-next.10",
579
+ "@elliemae/ds-form-layout-blocks": "2.3.0-next.10",
580
+ "@elliemae/ds-grid": "2.3.0-next.10",
581
+ "@elliemae/ds-icons": "2.3.0-next.10",
582
+ "@elliemae/ds-indeterminate-progress-indicator": "2.3.0-next.10",
583
+ "@elliemae/ds-pagination": "2.3.0-next.10",
584
+ "@elliemae/ds-pills": "2.3.0-next.10",
585
+ "@elliemae/ds-popperjs": "2.3.0-next.10",
586
+ "@elliemae/ds-system": "2.3.0-next.10",
587
+ "@elliemae/ds-toolbar": "2.3.0-next.10",
588
+ "@elliemae/ds-truncated-tooltip-text": "2.3.0-next.10",
589
+ "@elliemae/ds-utilities": "2.3.0-next.10",
590
590
  "@reduxjs/toolkit": "~1.6.2",
591
591
  "csstype": "~3.0.9",
592
592
  "moment": "~2.29.1",
@@ -0,0 +1,12 @@
1
+ export declare const headersSlice: import("@reduxjs/toolkit").Slice<{}, {
2
+ patchHeaderFilterButtonAndMenuAction(state: import("immer/dist/internal").WritableDraft<{}>, action: {
3
+ payload: any;
4
+ type: string;
5
+ }): void;
6
+ patchUpdateOneHeaderAction(state: import("immer/dist/internal").WritableDraft<{}>, action: {
7
+ payload: any;
8
+ type: string;
9
+ }): void;
10
+ }, "headers">;
11
+ export declare const patchHeaderFilterButtonAndMenuAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, patchUpdateOneHeaderAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
12
+ export declare const reducer: import("redux").Reducer<{}, import("redux").AnyAction>;
@@ -0,0 +1,216 @@
1
+ export declare const rowsSlice: import("@reduxjs/toolkit").Slice<{
2
+ isDraggingRow: boolean;
3
+ isKeyboardDraggingRow: boolean;
4
+ relativeRowMouseCord: {
5
+ isBefore: boolean;
6
+ isAfter: boolean;
7
+ isValid: boolean;
8
+ hoveredRowIndex: null;
9
+ x: null;
10
+ y: null;
11
+ relativeElementDOMRect: null;
12
+ relativeElementIndex: null;
13
+ };
14
+ draggedRowId: null;
15
+ hoverRowId: null;
16
+ activeRowId: null;
17
+ selectedRowId: null;
18
+ focusedRowId: null;
19
+ }, {
20
+ setRowsIsDraggingAction(state: import("immer/dist/internal").WritableDraft<{
21
+ isDraggingRow: boolean;
22
+ isKeyboardDraggingRow: boolean;
23
+ relativeRowMouseCord: {
24
+ isBefore: boolean;
25
+ isAfter: boolean;
26
+ isValid: boolean;
27
+ hoveredRowIndex: null;
28
+ x: null;
29
+ y: null;
30
+ relativeElementDOMRect: null;
31
+ relativeElementIndex: null;
32
+ };
33
+ draggedRowId: null;
34
+ hoverRowId: null;
35
+ activeRowId: null;
36
+ selectedRowId: null;
37
+ focusedRowId: null;
38
+ }>, action: {
39
+ payload: any;
40
+ type: string;
41
+ }): void;
42
+ setRowIsKeyboardDraggingAction(state: import("immer/dist/internal").WritableDraft<{
43
+ isDraggingRow: boolean;
44
+ isKeyboardDraggingRow: boolean;
45
+ relativeRowMouseCord: {
46
+ isBefore: boolean;
47
+ isAfter: boolean;
48
+ isValid: boolean;
49
+ hoveredRowIndex: null;
50
+ x: null;
51
+ y: null;
52
+ relativeElementDOMRect: null;
53
+ relativeElementIndex: null;
54
+ };
55
+ draggedRowId: null;
56
+ hoverRowId: null;
57
+ activeRowId: null;
58
+ selectedRowId: null;
59
+ focusedRowId: null;
60
+ }>, action: {
61
+ payload: any;
62
+ type: string;
63
+ }): void;
64
+ setRowRelativeMouseCoordAction(state: import("immer/dist/internal").WritableDraft<{
65
+ isDraggingRow: boolean;
66
+ isKeyboardDraggingRow: boolean;
67
+ relativeRowMouseCord: {
68
+ isBefore: boolean;
69
+ isAfter: boolean;
70
+ isValid: boolean;
71
+ hoveredRowIndex: null;
72
+ x: null;
73
+ y: null;
74
+ relativeElementDOMRect: null;
75
+ relativeElementIndex: null;
76
+ };
77
+ draggedRowId: null;
78
+ hoverRowId: null;
79
+ activeRowId: null;
80
+ selectedRowId: null;
81
+ focusedRowId: null;
82
+ }>, action: {
83
+ payload: any;
84
+ type: string;
85
+ }): void;
86
+ setRowDraggedRowIdAction(state: import("immer/dist/internal").WritableDraft<{
87
+ isDraggingRow: boolean;
88
+ isKeyboardDraggingRow: boolean;
89
+ relativeRowMouseCord: {
90
+ isBefore: boolean;
91
+ isAfter: boolean;
92
+ isValid: boolean;
93
+ hoveredRowIndex: null;
94
+ x: null;
95
+ y: null;
96
+ relativeElementDOMRect: null;
97
+ relativeElementIndex: null;
98
+ };
99
+ draggedRowId: null;
100
+ hoverRowId: null;
101
+ activeRowId: null;
102
+ selectedRowId: null;
103
+ focusedRowId: null;
104
+ }>, action: {
105
+ payload: any;
106
+ type: string;
107
+ }): void;
108
+ setRowHoverRowIdAction(state: import("immer/dist/internal").WritableDraft<{
109
+ isDraggingRow: boolean;
110
+ isKeyboardDraggingRow: boolean;
111
+ relativeRowMouseCord: {
112
+ isBefore: boolean;
113
+ isAfter: boolean;
114
+ isValid: boolean;
115
+ hoveredRowIndex: null;
116
+ x: null;
117
+ y: null;
118
+ relativeElementDOMRect: null;
119
+ relativeElementIndex: null;
120
+ };
121
+ draggedRowId: null;
122
+ hoverRowId: null;
123
+ activeRowId: null;
124
+ selectedRowId: null;
125
+ focusedRowId: null;
126
+ }>, action: {
127
+ payload: any;
128
+ type: string;
129
+ }): void;
130
+ setRowSelectedRowIdAction(state: import("immer/dist/internal").WritableDraft<{
131
+ isDraggingRow: boolean;
132
+ isKeyboardDraggingRow: boolean;
133
+ relativeRowMouseCord: {
134
+ isBefore: boolean;
135
+ isAfter: boolean;
136
+ isValid: boolean;
137
+ hoveredRowIndex: null;
138
+ x: null;
139
+ y: null;
140
+ relativeElementDOMRect: null;
141
+ relativeElementIndex: null;
142
+ };
143
+ draggedRowId: null;
144
+ hoverRowId: null;
145
+ activeRowId: null;
146
+ selectedRowId: null;
147
+ focusedRowId: null;
148
+ }>, action: {
149
+ payload: any;
150
+ type: string;
151
+ }): void;
152
+ setRowFocusedRowIdAction(state: import("immer/dist/internal").WritableDraft<{
153
+ isDraggingRow: boolean;
154
+ isKeyboardDraggingRow: boolean;
155
+ relativeRowMouseCord: {
156
+ isBefore: boolean;
157
+ isAfter: boolean;
158
+ isValid: boolean;
159
+ hoveredRowIndex: null;
160
+ x: null;
161
+ y: null;
162
+ relativeElementDOMRect: null;
163
+ relativeElementIndex: null;
164
+ };
165
+ draggedRowId: null;
166
+ hoverRowId: null;
167
+ activeRowId: null;
168
+ selectedRowId: null;
169
+ focusedRowId: null;
170
+ }>, action: {
171
+ payload: any;
172
+ type: string;
173
+ }): void;
174
+ setRowDnDActiveRowIdAction(state: import("immer/dist/internal").WritableDraft<{
175
+ isDraggingRow: boolean;
176
+ isKeyboardDraggingRow: boolean;
177
+ relativeRowMouseCord: {
178
+ isBefore: boolean;
179
+ isAfter: boolean;
180
+ isValid: boolean;
181
+ hoveredRowIndex: null;
182
+ x: null;
183
+ y: null;
184
+ relativeElementDOMRect: null;
185
+ relativeElementIndex: null;
186
+ };
187
+ draggedRowId: null;
188
+ hoverRowId: null;
189
+ activeRowId: null;
190
+ selectedRowId: null;
191
+ focusedRowId: null;
192
+ }>, action: {
193
+ payload: any;
194
+ type: string;
195
+ }): void;
196
+ }, "rows">;
197
+ export declare const setRowsIsDraggingAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setRowIsKeyboardDraggingAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setRowDraggedRowIdAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setRowHoverRowIdAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setRowSelectedRowIdAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setRowFocusedRowIdAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setRowRelativeMouseCoordAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setRowDnDActiveRowIdAction: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
198
+ export declare const reducer: import("redux").Reducer<{
199
+ isDraggingRow: boolean;
200
+ isKeyboardDraggingRow: boolean;
201
+ relativeRowMouseCord: {
202
+ isBefore: boolean;
203
+ isAfter: boolean;
204
+ isValid: boolean;
205
+ hoveredRowIndex: null;
206
+ x: null;
207
+ y: null;
208
+ relativeElementDOMRect: null;
209
+ relativeElementIndex: null;
210
+ };
211
+ draggedRowId: null;
212
+ hoverRowId: null;
213
+ activeRowId: null;
214
+ selectedRowId: null;
215
+ focusedRowId: null;
216
+ }, import("redux").AnyAction>;