@elliemae/ds-data-table 2.4.3-rc.6 → 2.4.3-rc.9
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/DataTable.js +10 -1
- package/cjs/addons/Editables/ComboboxEditableCell/ComboboxEditableCell.js +1 -1
- package/cjs/addons/Editables/DateEditableCell/DateEditableCell.js +1 -1
- package/cjs/addons/Editables/TextEditableCell/TextEditableCell.js +1 -1
- package/cjs/addons/Filters/Components/SelectFilter/MultiSelectFilter.js +1 -1
- package/cjs/addons/Filters/Components/SelectFilter/SingleSelectFilter.js +1 -1
- package/cjs/exported-related/FilterPopover.js +29 -27
- package/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js +8 -1
- package/cjs/exported-related/RowRenderer/useRowRendererHandlers.js +25 -7
- package/cjs/parts/Cells/Cell.js +3 -2
- package/cjs/parts/FilterBar/FiltersBar.js +1 -1
- package/cjs/parts/Filters/index.js +1 -1
- package/cjs/parts/Row.js +17 -1
- package/cjs/parts/RowVariants/index.js +1 -1
- package/cjs/parts/TableContent.js +1 -1
- package/cjs/styled.js +22 -18
- package/esm/DataTable.js +10 -1
- package/esm/addons/Editables/ComboboxEditableCell/ComboboxEditableCell.js +1 -1
- package/esm/addons/Editables/DateEditableCell/DateEditableCell.js +1 -1
- package/esm/addons/Editables/TextEditableCell/TextEditableCell.js +1 -1
- package/esm/addons/Filters/Components/SelectFilter/MultiSelectFilter.js +1 -1
- package/esm/addons/Filters/Components/SelectFilter/SingleSelectFilter.js +1 -1
- package/esm/exported-related/FilterPopover.js +30 -28
- package/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js +9 -2
- package/esm/exported-related/RowRenderer/useRowRendererHandlers.js +25 -7
- package/esm/parts/Cells/Cell.js +3 -2
- package/esm/parts/FilterBar/FiltersBar.js +1 -1
- package/esm/parts/Filters/index.js +1 -1
- package/esm/parts/Row.js +17 -1
- package/esm/parts/RowVariants/index.js +1 -1
- package/esm/parts/TableContent.js +2 -2
- package/esm/styled.js +22 -19
- package/package.json +19 -19
- package/types/styled.d.ts +2 -1
package/cjs/DataTable.js
CHANGED
|
@@ -21,6 +21,7 @@ var useDatatableConfig = require('./configs/useDatatableConfig.js');
|
|
|
21
21
|
require('./configs/useRowFlattenization.js');
|
|
22
22
|
var FiltersBar = require('./parts/FilterBar/FiltersBar.js');
|
|
23
23
|
var DataTableSchema = require('./DataTableSchema.js');
|
|
24
|
+
var styled = require('./styled.js');
|
|
24
25
|
var jsxRuntime = require('react/jsx-runtime');
|
|
25
26
|
|
|
26
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -41,13 +42,21 @@ const DataTable = props => {
|
|
|
41
42
|
const tableWrapperRef = React.useRef();
|
|
42
43
|
const tableContentWrapperRef = React.useRef();
|
|
43
44
|
const ctx = useDatatableConfig.useDatatableConfig(props);
|
|
45
|
+
const {
|
|
46
|
+
tableProps: {
|
|
47
|
+
height,
|
|
48
|
+
width
|
|
49
|
+
}
|
|
50
|
+
} = ctx;
|
|
44
51
|
return /*#__PURE__*/_jsx__default["default"](reactRedux.Provider, {
|
|
45
52
|
store: reduxStore
|
|
46
53
|
}, void 0, /*#__PURE__*/_jsx__default["default"](DataTableContext["default"].Provider, {
|
|
47
54
|
value: ctx
|
|
48
|
-
}, void 0, /*#__PURE__*/jsxRuntime.jsxs(
|
|
55
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsxs(styled.StyledDataTableWrapper, {
|
|
49
56
|
ref: tableWrapperRef,
|
|
50
57
|
"data-testid": constants.DATA_TESTID.DATA_TABLE_WRAPPER,
|
|
58
|
+
height: height,
|
|
59
|
+
width: width,
|
|
51
60
|
children: [withFilterBar ? _FiltersBar || (_FiltersBar = /*#__PURE__*/_jsx__default["default"](FiltersBar.FiltersBar, {})) : null, /*#__PURE__*/jsxRuntime.jsx(TableContent, {
|
|
52
61
|
ref: tableContentWrapperRef
|
|
53
62
|
})]
|
|
@@ -18,7 +18,6 @@ require('@elliemae/ds-popperjs');
|
|
|
18
18
|
require('styled-components');
|
|
19
19
|
require('../../../redux/reducers/index.js');
|
|
20
20
|
require('../../../configs/constants.js');
|
|
21
|
-
require('react/jsx-runtime');
|
|
22
21
|
var EditableCell = require('../../../exported-related/EditableCell.js');
|
|
23
22
|
require('@elliemae/ds-icons');
|
|
24
23
|
require('@elliemae/ds-utilities');
|
|
@@ -27,6 +26,7 @@ require('../../../configs/useRowFlattenization.js');
|
|
|
27
26
|
require('core-js/modules/esnext.async-iterator.map.js');
|
|
28
27
|
require('core-js/modules/esnext.iterator.map.js');
|
|
29
28
|
require('../../../styled.js');
|
|
29
|
+
require('react/jsx-runtime');
|
|
30
30
|
require('@elliemae/ds-form');
|
|
31
31
|
require('../../../parts/TableContent.js');
|
|
32
32
|
require('@elliemae/ds-grid');
|
|
@@ -15,7 +15,6 @@ require('@elliemae/ds-popperjs');
|
|
|
15
15
|
require('styled-components');
|
|
16
16
|
require('../../../redux/reducers/index.js');
|
|
17
17
|
require('../../../configs/constants.js');
|
|
18
|
-
require('react/jsx-runtime');
|
|
19
18
|
var EditableCell = require('../../../exported-related/EditableCell.js');
|
|
20
19
|
require('@elliemae/ds-icons');
|
|
21
20
|
require('@elliemae/ds-utilities');
|
|
@@ -26,6 +25,7 @@ require('../../../configs/useRowFlattenization.js');
|
|
|
26
25
|
require('core-js/modules/esnext.async-iterator.map.js');
|
|
27
26
|
require('core-js/modules/esnext.iterator.map.js');
|
|
28
27
|
require('../../../styled.js');
|
|
28
|
+
require('react/jsx-runtime');
|
|
29
29
|
require('@elliemae/ds-form');
|
|
30
30
|
require('../../../parts/TableContent.js');
|
|
31
31
|
require('@elliemae/ds-grid');
|
|
@@ -15,7 +15,6 @@ require('@elliemae/ds-button');
|
|
|
15
15
|
require('@elliemae/ds-popperjs');
|
|
16
16
|
require('../../../redux/reducers/index.js');
|
|
17
17
|
require('../../../configs/constants.js');
|
|
18
|
-
require('react/jsx-runtime');
|
|
19
18
|
var EditableCell = require('../../../exported-related/EditableCell.js');
|
|
20
19
|
require('@elliemae/ds-icons');
|
|
21
20
|
require('@elliemae/ds-utilities');
|
|
@@ -26,6 +25,7 @@ require('../../../configs/useRowFlattenization.js');
|
|
|
26
25
|
require('core-js/modules/esnext.async-iterator.map.js');
|
|
27
26
|
require('core-js/modules/esnext.iterator.map.js');
|
|
28
27
|
require('../../../styled.js');
|
|
28
|
+
require('react/jsx-runtime');
|
|
29
29
|
require('@elliemae/ds-form');
|
|
30
30
|
require('../../../parts/TableContent.js');
|
|
31
31
|
require('@elliemae/ds-grid');
|
|
@@ -16,9 +16,9 @@ require('@elliemae/ds-popperjs');
|
|
|
16
16
|
require('styled-components');
|
|
17
17
|
require('../../../../redux/reducers/index.js');
|
|
18
18
|
var constants = require('../../../../configs/constants.js');
|
|
19
|
-
require('react/jsx-runtime');
|
|
20
19
|
require('../../../../styled.js');
|
|
21
20
|
require('../../../../DataTableContext.js');
|
|
21
|
+
require('react/jsx-runtime');
|
|
22
22
|
require('@elliemae/ds-icons');
|
|
23
23
|
require('@elliemae/ds-utilities');
|
|
24
24
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
@@ -16,9 +16,9 @@ require('@elliemae/ds-popperjs');
|
|
|
16
16
|
require('styled-components');
|
|
17
17
|
require('../../../../redux/reducers/index.js');
|
|
18
18
|
var constants = require('../../../../configs/constants.js');
|
|
19
|
-
require('react/jsx-runtime');
|
|
20
19
|
require('../../../../styled.js');
|
|
21
20
|
require('../../../../DataTableContext.js');
|
|
21
|
+
require('react/jsx-runtime');
|
|
22
22
|
require('@elliemae/ds-icons');
|
|
23
23
|
require('@elliemae/ds-utilities');
|
|
24
24
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
@@ -15,7 +15,6 @@ var dsPopperjs = require('@elliemae/ds-popperjs');
|
|
|
15
15
|
var styled = require('styled-components');
|
|
16
16
|
require('../redux/reducers/index.js');
|
|
17
17
|
var constants = require('../configs/constants.js');
|
|
18
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
19
18
|
var useDispatchHeadersActions = require('../redux/reducers/headersReducers/useDispatchHeadersActions.js');
|
|
20
19
|
|
|
21
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -36,7 +35,22 @@ const Button = /*#__PURE__*/styled__default["default"](DSButton.DSButton).withCo
|
|
|
36
35
|
const PopperContent = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
37
36
|
componentId: "sc-16i88ut-2"
|
|
38
37
|
})(["background-color:#fff;"]);
|
|
39
|
-
|
|
38
|
+
|
|
39
|
+
const ButtonTrap = _ref2 => {
|
|
40
|
+
let {
|
|
41
|
+
cb
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return /*#__PURE__*/_jsx__default["default"]("span", {
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
tabIndex: 0,
|
|
46
|
+
onFocus: e => {
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
cb();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const FilterPopover = _ref3 => {
|
|
40
54
|
let {
|
|
41
55
|
column,
|
|
42
56
|
columnId,
|
|
@@ -48,7 +62,7 @@ const FilterPopover = _ref2 => {
|
|
|
48
62
|
innerRef,
|
|
49
63
|
ariaLabel,
|
|
50
64
|
customStyles
|
|
51
|
-
} =
|
|
65
|
+
} = _ref3;
|
|
52
66
|
const {
|
|
53
67
|
hideFilterButton,
|
|
54
68
|
hideFilterMenu
|
|
@@ -56,7 +70,6 @@ const FilterPopover = _ref2 => {
|
|
|
56
70
|
hideFilterButton: true,
|
|
57
71
|
hideFilterMenu: true
|
|
58
72
|
};
|
|
59
|
-
const popperRef = React.useRef(null);
|
|
60
73
|
const {
|
|
61
74
|
patchHeaderFilterButtonAndMenu,
|
|
62
75
|
patchHeader
|
|
@@ -87,6 +100,13 @@ const FilterPopover = _ref2 => {
|
|
|
87
100
|
};
|
|
88
101
|
|
|
89
102
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
103
|
+
const buttonTrapCallback = React.useCallback(() => {
|
|
104
|
+
patchHeader(columnId, {
|
|
105
|
+
hideFilterMenu: true,
|
|
106
|
+
hideFilterButton: false
|
|
107
|
+
});
|
|
108
|
+
referenceElement?.focus();
|
|
109
|
+
}, [columnId, patchHeader, referenceElement]);
|
|
90
110
|
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
91
111
|
// This is here to prevent propagation, and not trigger the sort functionality
|
|
92
112
|
onClick: e => e.stopPropagation(),
|
|
@@ -109,11 +129,6 @@ const FilterPopover = _ref2 => {
|
|
|
109
129
|
},
|
|
110
130
|
style: {
|
|
111
131
|
display: 'flex'
|
|
112
|
-
},
|
|
113
|
-
onBlur: e => {
|
|
114
|
-
if (e.target !== referenceElement && !popperRef.current?.contains(e.relatedTarget)) {
|
|
115
|
-
referenceElement?.focus();
|
|
116
|
-
}
|
|
117
132
|
}
|
|
118
133
|
}, void 0, /*#__PURE__*/_jsx__default["default"](FilterButton, {
|
|
119
134
|
hide: !isIconVisible,
|
|
@@ -145,24 +160,11 @@ const FilterPopover = _ref2 => {
|
|
|
145
160
|
minWidth: column.ref?.current?.offsetWidth ?? '0px'
|
|
146
161
|
}),
|
|
147
162
|
placementOrderPreference: ['bottom-end']
|
|
148
|
-
}, void 0, /*#__PURE__*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
patchHeader(columnId, {
|
|
154
|
-
hideFilterMenu: true,
|
|
155
|
-
hideFilterButton: false
|
|
156
|
-
});
|
|
157
|
-
e.preventDefault();
|
|
158
|
-
referenceElement.focus();
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
ref: popperRef,
|
|
164
|
-
children: menuContent
|
|
165
|
-
})));
|
|
163
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](PopperContent, {}, void 0, /*#__PURE__*/_jsx__default["default"](ButtonTrap, {
|
|
164
|
+
cb: buttonTrapCallback
|
|
165
|
+
}), menuContent, /*#__PURE__*/_jsx__default["default"](ButtonTrap, {
|
|
166
|
+
cb: buttonTrapCallback
|
|
167
|
+
}))));
|
|
166
168
|
};
|
|
167
169
|
|
|
168
170
|
exports.FilterPopover = FilterPopover;
|
|
@@ -100,12 +100,18 @@ const DefaultRowContentRenderer = props => {
|
|
|
100
100
|
|
|
101
101
|
return padding;
|
|
102
102
|
}, [row.depth, visibleColumns]);
|
|
103
|
+
const handleSelectDisableRow = React.useCallback(e => {
|
|
104
|
+
if (disabledRows[row.uid]) {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
e.stopPropagation();
|
|
107
|
+
}
|
|
108
|
+
}, [disabledRows, row.uid]);
|
|
103
109
|
const PureRowContent = React.useMemo(() => {
|
|
104
110
|
const DetailsView = row.original.tableRowDetails;
|
|
105
111
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
106
112
|
children: [/*#__PURE__*/jsxRuntime.jsx(styled.StyledCellContainer, _objectSpread(_objectSpread({
|
|
107
113
|
ref: rowRef,
|
|
108
|
-
tabIndex: 0,
|
|
114
|
+
tabIndex: disabledRows[row.uid] ? -1 : 0,
|
|
109
115
|
role: "row",
|
|
110
116
|
"aria-rowindex": row.realIndex + 1,
|
|
111
117
|
"aria-label": ariaLabelMessage(row, selection?.[row.uid] === true),
|
|
@@ -124,6 +130,7 @@ const DefaultRowContentRenderer = props => {
|
|
|
124
130
|
selected: noSelectionColumn && selection?.[row.uid] === true,
|
|
125
131
|
disabled: disabledRows[row.uid],
|
|
126
132
|
"data-testid": constants.DATA_TESTID.DATA_TABLE_ROW_CONTENT,
|
|
133
|
+
onMouseDown: handleSelectDisableRow,
|
|
127
134
|
children: /*#__PURE__*/_jsx__default["default"](index$1, {
|
|
128
135
|
row: row,
|
|
129
136
|
isRowSelected: selectedRowId === row.uid,
|
|
@@ -48,12 +48,26 @@ const useRowRendererHandlers = _ref => {
|
|
|
48
48
|
const {
|
|
49
49
|
tableProps: {
|
|
50
50
|
onRowClick,
|
|
51
|
-
onRowFocus
|
|
51
|
+
onRowFocus,
|
|
52
|
+
disabledRows
|
|
52
53
|
},
|
|
53
54
|
virtualListHelpers: {
|
|
54
55
|
scrollToIndex
|
|
55
56
|
}
|
|
56
57
|
} = React.useContext(DataTableContext["default"]);
|
|
58
|
+
|
|
59
|
+
const isOptionFocuseable = opt => !disabledRows[opt.id];
|
|
60
|
+
|
|
61
|
+
const findInCircularList = function (list, from, criteria) {
|
|
62
|
+
let step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
63
|
+
|
|
64
|
+
for (let i = (from + step + list.length) % list.length; i !== from && from > -1; i = (i + step + list.length) % list.length) {
|
|
65
|
+
if (criteria(list[i])) return i;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return from; // return same item
|
|
69
|
+
};
|
|
70
|
+
|
|
57
71
|
const {
|
|
58
72
|
setSelectedRowId,
|
|
59
73
|
setFocusedRowId
|
|
@@ -64,6 +78,7 @@ const useRowRendererHandlers = _ref => {
|
|
|
64
78
|
uid
|
|
65
79
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : row;
|
|
66
80
|
// setSelectedRowId(null);
|
|
81
|
+
if (disabledRows[uid]) return;
|
|
67
82
|
onRowClick(original, e, uid);
|
|
68
83
|
onRowFocus({
|
|
69
84
|
itemIndex,
|
|
@@ -75,7 +90,7 @@ const useRowRendererHandlers = _ref => {
|
|
|
75
90
|
},
|
|
76
91
|
original
|
|
77
92
|
}, e);
|
|
78
|
-
}, [row, onRowClick, onRowFocus, itemIndex, scrollToIndex]);
|
|
93
|
+
}, [row, disabledRows, onRowClick, onRowFocus, itemIndex, scrollToIndex]);
|
|
79
94
|
const isActive = draggableProps && draggableProps.active;
|
|
80
95
|
const handleKeyDown = React.useCallback(e => {
|
|
81
96
|
if (isDragOverlay || isActive) {
|
|
@@ -102,24 +117,27 @@ const useRowRendererHandlers = _ref => {
|
|
|
102
117
|
|
|
103
118
|
if (e.code === 'ArrowDown') {
|
|
104
119
|
e.preventDefault();
|
|
105
|
-
|
|
120
|
+
e.stopPropagation();
|
|
121
|
+
const next = findInCircularList(items, itemIndex, isOptionFocuseable);
|
|
122
|
+
setFocusedRowId(items[next].uid);
|
|
106
123
|
}
|
|
107
124
|
|
|
108
125
|
if (e.code === 'ArrowUp') {
|
|
109
126
|
e.preventDefault();
|
|
110
|
-
|
|
127
|
+
const prev = findInCircularList(items, itemIndex, isOptionFocuseable, -1);
|
|
128
|
+
setFocusedRowId(items[prev].uid);
|
|
111
129
|
}
|
|
112
|
-
}, [isDragOverlay, isActive, selectedRowId, row, setSelectedRowId, handleItemClick, itemIndex,
|
|
130
|
+
}, [isDragOverlay, isActive, selectedRowId, row, setSelectedRowId, handleItemClick, items, itemIndex, isOptionFocuseable, setFocusedRowId]);
|
|
113
131
|
const handleOnBlur = React.useCallback(e => {
|
|
114
132
|
if (e.relatedTarget?.getAttribute('data-testid') === 'data-table-row-content') {
|
|
115
133
|
setSelectedRowId(null);
|
|
116
134
|
}
|
|
117
135
|
}, [setSelectedRowId]);
|
|
118
136
|
const handleOnFocus = React.useCallback(e => {
|
|
119
|
-
if (e.target && e.target.getAttribute('data-testid') === constants.DATA_TESTID.DATA_TABLE_ROW_CONTENT) {
|
|
137
|
+
if (!disabledRows[row.uid] && e.target && e.target.getAttribute('data-testid') === constants.DATA_TESTID.DATA_TABLE_ROW_CONTENT) {
|
|
120
138
|
setFocusedRowId(row.uid);
|
|
121
139
|
}
|
|
122
|
-
}, [row.uid, setFocusedRowId]);
|
|
140
|
+
}, [row.uid, setFocusedRowId, disabledRows]);
|
|
123
141
|
return {
|
|
124
142
|
handleItemClick,
|
|
125
143
|
handleKeyDown,
|
package/cjs/parts/Cells/Cell.js
CHANGED
|
@@ -71,7 +71,8 @@ const Cell = _ref2 => {
|
|
|
71
71
|
const ctx = React.useContext(DataTableContext["default"]);
|
|
72
72
|
const {
|
|
73
73
|
tableProps: {
|
|
74
|
-
cellRendererProps
|
|
74
|
+
cellRendererProps,
|
|
75
|
+
disabledRows
|
|
75
76
|
}
|
|
76
77
|
} = ctx;
|
|
77
78
|
const {
|
|
@@ -120,7 +121,7 @@ const Cell = _ref2 => {
|
|
|
120
121
|
return null;
|
|
121
122
|
}, [DefaultCellContentJSX, cellProps, column]);
|
|
122
123
|
return /*#__PURE__*/jsxRuntime.jsx(PureStandardCell, _objectSpread(_objectSpread({}, cellProps), {}, {
|
|
123
|
-
children: column.editable ? EditableContentJSX : DefaultCellContentJSX
|
|
124
|
+
children: column.editable && !disabledRows[row.id] ? EditableContentJSX : DefaultCellContentJSX
|
|
124
125
|
}));
|
|
125
126
|
};
|
|
126
127
|
|
|
@@ -20,9 +20,9 @@ require('@elliemae/ds-popperjs');
|
|
|
20
20
|
require('styled-components');
|
|
21
21
|
require('../../redux/reducers/index.js');
|
|
22
22
|
var constants = require('../../configs/constants.js');
|
|
23
|
-
require('react/jsx-runtime');
|
|
24
23
|
require('../../styled.js');
|
|
25
24
|
var DataTableContext = require('../../DataTableContext.js');
|
|
25
|
+
require('react/jsx-runtime');
|
|
26
26
|
require('@elliemae/ds-utilities');
|
|
27
27
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
28
28
|
require('core-js/modules/esnext.iterator.reduce.js');
|
|
@@ -25,9 +25,9 @@ require('@elliemae/ds-popperjs');
|
|
|
25
25
|
require('styled-components');
|
|
26
26
|
require('../../redux/reducers/index.js');
|
|
27
27
|
require('../../configs/constants.js');
|
|
28
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
29
28
|
require('../../styled.js');
|
|
30
29
|
require('../../DataTableContext.js');
|
|
30
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
31
31
|
require('@elliemae/ds-icons');
|
|
32
32
|
require('@elliemae/ds-utilities');
|
|
33
33
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
package/cjs/parts/Row.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var reactRedux = require('react-redux');
|
|
8
|
+
var dsSystem = require('@elliemae/ds-system');
|
|
8
9
|
var DataTableContext = require('../DataTableContext.js');
|
|
9
10
|
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
10
11
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
@@ -29,6 +30,15 @@ const setItemRefs = (measureRef, draggableRef, ref) => {
|
|
|
29
30
|
refsHelpers.setMultipleRefs(...refsToSet)(ref);
|
|
30
31
|
};
|
|
31
32
|
|
|
33
|
+
const StyledRow = dsSystem.styled('div')`
|
|
34
|
+
cursor: ${_ref => {
|
|
35
|
+
let {
|
|
36
|
+
disabled
|
|
37
|
+
} = _ref;
|
|
38
|
+
return disabled ? 'not-allowed' : 'normal';
|
|
39
|
+
}};
|
|
40
|
+
`;
|
|
41
|
+
|
|
32
42
|
const RowComp = props => {
|
|
33
43
|
const {
|
|
34
44
|
row,
|
|
@@ -39,11 +49,17 @@ const RowComp = props => {
|
|
|
39
49
|
selectedRowId
|
|
40
50
|
} = props;
|
|
41
51
|
const ctx = React.useContext(DataTableContext["default"]);
|
|
52
|
+
const {
|
|
53
|
+
tableProps: {
|
|
54
|
+
disabledRows
|
|
55
|
+
}
|
|
56
|
+
} = ctx;
|
|
42
57
|
const {
|
|
43
58
|
draggableProps
|
|
44
59
|
} = React.useContext(SortableItemContext.SortableItemContext);
|
|
45
60
|
const draggableRef = draggableProps && draggableProps.setNodeRef;
|
|
46
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
61
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledRow, {
|
|
62
|
+
disabled: disabledRows[row.id],
|
|
47
63
|
style: !isDragOverlay ? itemWrapperStyle : {},
|
|
48
64
|
ref: ref => setItemRefs(measureRef, draggableRef, ref),
|
|
49
65
|
children: /*#__PURE__*/_jsx__default["default"](index.RowVariantMapItem, {
|
|
@@ -16,9 +16,9 @@ require('@elliemae/ds-popperjs');
|
|
|
16
16
|
require('styled-components');
|
|
17
17
|
require('../../redux/reducers/index.js');
|
|
18
18
|
require('../../configs/constants.js');
|
|
19
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
20
19
|
require('../../styled.js');
|
|
21
20
|
require('../../DataTableContext.js');
|
|
21
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
22
22
|
require('@elliemae/ds-icons');
|
|
23
23
|
require('@elliemae/ds-utilities');
|
|
24
24
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
@@ -64,7 +64,7 @@ const TableContentComponent = props => {
|
|
|
64
64
|
visibleColumns
|
|
65
65
|
} = React.useContext(DataTableContext["default"]);
|
|
66
66
|
const [shiftKeyPressed, setShiftKeyPressed] = React.useState(false);
|
|
67
|
-
const PureTableContent = React.useMemo(() => /*#__PURE__*/jsxRuntime.jsxs(styled.
|
|
67
|
+
const PureTableContent = React.useMemo(() => /*#__PURE__*/jsxRuntime.jsxs(styled.StyledDataTableContentWrapper, {
|
|
68
68
|
"data-testid": constants.DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER,
|
|
69
69
|
height: height,
|
|
70
70
|
width: width,
|
package/cjs/styled.js
CHANGED
|
@@ -63,14 +63,17 @@ const StyledFocusWithin = /*#__PURE__*/styled__default["default"](Grid__default[
|
|
|
63
63
|
})([":focus-within{", "}"], props => props.hideFocus ? '' : styledFocusCss(props));
|
|
64
64
|
const StyledDataTableWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
65
65
|
componentId: "sc-38sgfo-1"
|
|
66
|
-
})(["width:", ";height:", ";
|
|
66
|
+
})(["width:", ";height:", ";"], props => sizeToCss.sizeToCss(props.width ?? ' 100%'), props => sizeToCss.sizeToCss(props.height ?? ' 100%'));
|
|
67
|
+
const StyledDataTableContentWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
68
|
+
componentId: "sc-38sgfo-2"
|
|
69
|
+
})(["user-select:", ";width:100%;height:100%;"], _ref2 => {
|
|
67
70
|
let {
|
|
68
71
|
noSelectionAllowed
|
|
69
72
|
} = _ref2;
|
|
70
73
|
return noSelectionAllowed ? 'none' : 'auto';
|
|
71
74
|
});
|
|
72
75
|
const StyledTableWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
73
|
-
componentId: "sc-38sgfo-
|
|
76
|
+
componentId: "sc-38sgfo-3"
|
|
74
77
|
})(["display:inline-block;border-spacing:0;z-index:0;position:relative;", ""], _ref3 => {
|
|
75
78
|
let {
|
|
76
79
|
width = '100%',
|
|
@@ -82,7 +85,7 @@ const StyledTableWrapper = /*#__PURE__*/styled__default["default"].div.withConfi
|
|
|
82
85
|
`;
|
|
83
86
|
});
|
|
84
87
|
const StyledTableContentWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
85
|
-
componentId: "sc-38sgfo-
|
|
88
|
+
componentId: "sc-38sgfo-4"
|
|
86
89
|
})(["position:relative;", ""], _ref4 => {
|
|
87
90
|
let {
|
|
88
91
|
height = 'auto'
|
|
@@ -92,7 +95,7 @@ const StyledTableContentWrapper = /*#__PURE__*/styled__default["default"].div.wi
|
|
|
92
95
|
`;
|
|
93
96
|
});
|
|
94
97
|
const StyledVirtualListWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
95
|
-
componentId: "sc-38sgfo-
|
|
98
|
+
componentId: "sc-38sgfo-5"
|
|
96
99
|
})(["overflow:auto;", ""], _ref5 => {
|
|
97
100
|
let {
|
|
98
101
|
height = 'auto',
|
|
@@ -123,17 +126,17 @@ const getGridTemplateColumnsStyle = _ref6 => {
|
|
|
123
126
|
};
|
|
124
127
|
|
|
125
128
|
const StyledHeadWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
126
|
-
componentId: "sc-38sgfo-
|
|
129
|
+
componentId: "sc-38sgfo-6"
|
|
127
130
|
})(["position:relative;position:sticky;top:0;z-index:4;background:white;width:", ";"], props => props.colsLayoutStyle === constants.ColsLayoutStyle.Fixed ? sizeToCss.sizeToCss(props.totalColumnsWidth) : '100%');
|
|
128
131
|
const StyledHeadTr = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
129
|
-
componentId: "sc-38sgfo-
|
|
132
|
+
componentId: "sc-38sgfo-7"
|
|
130
133
|
})(["", ";", ";border-right:1px solid ", ";border-bottom:1px solid ", ";grid-auto-flow:column;"], props => props.colsLayoutStyle === constants.ColsLayoutStyle.Auto ? 'width:100%' : '', props => getGridTemplateColumnsStyle({
|
|
131
134
|
cols: props.cols,
|
|
132
135
|
isExpandable: props.isExpandable,
|
|
133
136
|
colsLayoutStyle: props.colsLayoutStyle
|
|
134
137
|
}), props => props.theme.colors.neutral['080'], props => props.theme.colors.neutral['080']);
|
|
135
138
|
const StyledHeadTh = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
136
|
-
componentId: "sc-38sgfo-
|
|
139
|
+
componentId: "sc-38sgfo-8"
|
|
137
140
|
})(["min-height:24px;line-height:normal;font-weight:600;text-transform:uppercase;font-size:0.923rem;text-align:left;", " color:#353c46;min-height:1.84615rem;position:sticky;z-index:", ";display:flex;justify-content:space-between;box-sizing:border-box;outline:none;", ":focus{&:after{display:block;content:' ';position:absolute;top:0;left:0;right:0;bottom:0;border:2px solid ", ";pointer-events:none;z-index:", ";}}"], cellPadding.columnPadding, zIndexInternalConfig.ZIndexDataTable.HEADER_ROW, props => props.isDraggingActive ? '' : `:hover {
|
|
138
141
|
&:after {
|
|
139
142
|
display: block;
|
|
@@ -150,10 +153,10 @@ const StyledHeadTh = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
|
150
153
|
cursor: pointer;
|
|
151
154
|
}`, props => props.theme.colors.brand[700], zIndexInternalConfig.ZIndexDataTable.FOCUS_BORDER);
|
|
152
155
|
const StyledHeaderRightIconsWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
153
|
-
componentId: "sc-38sgfo-
|
|
156
|
+
componentId: "sc-38sgfo-9"
|
|
154
157
|
})(["height:100%;display:flex;align-items:center;max-height:24px;"]);
|
|
155
158
|
const StyledResizer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
156
|
-
componentId: "sc-38sgfo-
|
|
159
|
+
componentId: "sc-38sgfo-10"
|
|
157
160
|
})(["display:inline-block;background:", ";width:4px;height:100%;position:absolute;right:0;top:0;z-index:1;touch-action:none;cursor:col-resize;"], _ref7 => {
|
|
158
161
|
let {
|
|
159
162
|
isResizing,
|
|
@@ -163,19 +166,19 @@ const StyledResizer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
|
163
166
|
}); // CELL ***********************************************************************/
|
|
164
167
|
|
|
165
168
|
const StyledActionCell = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
166
|
-
componentId: "sc-38sgfo-
|
|
169
|
+
componentId: "sc-38sgfo-11"
|
|
167
170
|
})(["position:relative;position:sticky;display:inline-block;right:0;background:white;"]);
|
|
168
171
|
const StyledCell = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
169
|
-
componentId: "sc-38sgfo-
|
|
172
|
+
componentId: "sc-38sgfo-12"
|
|
170
173
|
})(["", " display:flex;align-items:center;width:100%;position:relative;"], cellPadding.cellPadding);
|
|
171
174
|
const StyledCellContent = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
172
|
-
componentId: "sc-38sgfo-
|
|
175
|
+
componentId: "sc-38sgfo-13"
|
|
173
176
|
})(["display:grid;justify-self:flex-end;flex:1 1 auto;width:100%;height:100%;align-items:center;"]);
|
|
174
177
|
const StyledPencilIcon = /*#__PURE__*/styled__default["default"](dsIcons.EditPencil).withConfig({
|
|
175
|
-
componentId: "sc-38sgfo-
|
|
178
|
+
componentId: "sc-38sgfo-14"
|
|
176
179
|
})([""]);
|
|
177
180
|
const StyledEditableContainer = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
178
|
-
componentId: "sc-38sgfo-
|
|
181
|
+
componentId: "sc-38sgfo-15"
|
|
179
182
|
})(["width:100%;height:100%;align-items:center;& ", "{display:", ";}&:hover{", "{display:block;}}&:focus{", " ", "{display:block;}}outline:none;"], StyledPencilIcon, _ref8 => {
|
|
180
183
|
let {
|
|
181
184
|
shouldDisplayEditIcon
|
|
@@ -184,10 +187,10 @@ const StyledEditableContainer = /*#__PURE__*/styled__default["default"](Grid__de
|
|
|
184
187
|
}, StyledPencilIcon, styledFocusCss, StyledPencilIcon); // ROW ************************************************************************/
|
|
185
188
|
|
|
186
189
|
const StyledFullsizeGrid = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
187
|
-
componentId: "sc-38sgfo-
|
|
190
|
+
componentId: "sc-38sgfo-16"
|
|
188
191
|
})(["position:relative;z-index:", ";min-height:", ";height:", ";"], zIndexInternalConfig.ZIndexDataTable.ROW, props => props.minHeight || '36px', props => props.height || 'auto');
|
|
189
192
|
const GroupHeaderContainer = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
190
|
-
componentId: "sc-38sgfo-
|
|
193
|
+
componentId: "sc-38sgfo-17"
|
|
191
194
|
})(["position:relative;background-color:", ";align-items:center;padding:0 ", ";border-top:1px solid ", ";grid-template-columns:min-content 1fr;"], _ref9 => {
|
|
192
195
|
let {
|
|
193
196
|
theme
|
|
@@ -200,10 +203,10 @@ const GroupHeaderContainer = /*#__PURE__*/styled__default["default"](Grid__defau
|
|
|
200
203
|
return theme.colors.brand[300];
|
|
201
204
|
});
|
|
202
205
|
const GroupHeaderTitle = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
203
|
-
componentId: "sc-38sgfo-
|
|
206
|
+
componentId: "sc-38sgfo-18"
|
|
204
207
|
})(["font-weight:", ";font-size:12px;color:", ";"], props => props.theme.fontWeights.semibold, props => props.theme.colors.neutral[700]);
|
|
205
208
|
const StyledCellContainer = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
206
|
-
componentId: "sc-38sgfo-
|
|
209
|
+
componentId: "sc-38sgfo-19"
|
|
207
210
|
})(["position:relative;z-index:2;min-height:", ";height:", ";width:", ";", ";", ";background-color:", ";outline:none;:focus{", "}", " ", " box-shadow:0 2px 4px 0 ", ";opacity:", ";", " color:", ";"], props => props.minHeight || '36px', props => props.height || 'auto', props => props.colLayoutStyle === constants.ColsLayoutStyle.Fixed ? sizeToCss.sizeToCss(props.totalColumnsWidth) : '100%', props => props.isDragOverlay ? 'width: fit-content;' : '', props => getGridTemplateColumnsStyle({
|
|
208
211
|
cols: props.cols,
|
|
209
212
|
colsLayoutStyle: props.colLayoutStyle,
|
|
@@ -243,6 +246,7 @@ exports.StyledActionCell = StyledActionCell;
|
|
|
243
246
|
exports.StyledCell = StyledCell;
|
|
244
247
|
exports.StyledCellContainer = StyledCellContainer;
|
|
245
248
|
exports.StyledCellContent = StyledCellContent;
|
|
249
|
+
exports.StyledDataTableContentWrapper = StyledDataTableContentWrapper;
|
|
246
250
|
exports.StyledDataTableWrapper = StyledDataTableWrapper;
|
|
247
251
|
exports.StyledEditableContainer = StyledEditableContainer;
|
|
248
252
|
exports.StyledFocusWithin = StyledFocusWithin;
|
package/esm/DataTable.js
CHANGED
|
@@ -17,6 +17,7 @@ import { useDatatableConfig } from './configs/useDatatableConfig.js';
|
|
|
17
17
|
import './configs/useRowFlattenization.js';
|
|
18
18
|
import { FiltersBar } from './parts/FilterBar/FiltersBar.js';
|
|
19
19
|
import { DataTableSchema } from './DataTableSchema.js';
|
|
20
|
+
import { StyledDataTableWrapper } from './styled.js';
|
|
20
21
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
21
22
|
|
|
22
23
|
var _FiltersBar;
|
|
@@ -32,13 +33,21 @@ const DataTable = props => {
|
|
|
32
33
|
const tableWrapperRef = useRef();
|
|
33
34
|
const tableContentWrapperRef = useRef();
|
|
34
35
|
const ctx = useDatatableConfig(props);
|
|
36
|
+
const {
|
|
37
|
+
tableProps: {
|
|
38
|
+
height,
|
|
39
|
+
width
|
|
40
|
+
}
|
|
41
|
+
} = ctx;
|
|
35
42
|
return /*#__PURE__*/_jsx(Provider, {
|
|
36
43
|
store: reduxStore
|
|
37
44
|
}, void 0, /*#__PURE__*/_jsx(DataTableContext.Provider, {
|
|
38
45
|
value: ctx
|
|
39
|
-
}, void 0, /*#__PURE__*/jsxs(
|
|
46
|
+
}, void 0, /*#__PURE__*/jsxs(StyledDataTableWrapper, {
|
|
40
47
|
ref: tableWrapperRef,
|
|
41
48
|
"data-testid": DATA_TESTID.DATA_TABLE_WRAPPER,
|
|
49
|
+
height: height,
|
|
50
|
+
width: width,
|
|
42
51
|
children: [withFilterBar ? _FiltersBar || (_FiltersBar = /*#__PURE__*/_jsx(FiltersBar, {})) : null, /*#__PURE__*/jsx(TableContent, {
|
|
43
52
|
ref: tableContentWrapperRef
|
|
44
53
|
})]
|
|
@@ -14,7 +14,6 @@ import '@elliemae/ds-popperjs';
|
|
|
14
14
|
import 'styled-components';
|
|
15
15
|
import '../../../redux/reducers/index.js';
|
|
16
16
|
import '../../../configs/constants.js';
|
|
17
|
-
import 'react/jsx-runtime';
|
|
18
17
|
import { EditableCell } from '../../../exported-related/EditableCell.js';
|
|
19
18
|
import '@elliemae/ds-icons';
|
|
20
19
|
import '@elliemae/ds-utilities';
|
|
@@ -23,6 +22,7 @@ import '../../../configs/useRowFlattenization.js';
|
|
|
23
22
|
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
24
23
|
import 'core-js/modules/esnext.iterator.map.js';
|
|
25
24
|
import '../../../styled.js';
|
|
25
|
+
import 'react/jsx-runtime';
|
|
26
26
|
import '@elliemae/ds-form';
|
|
27
27
|
import '../../../parts/TableContent.js';
|
|
28
28
|
import '@elliemae/ds-grid';
|
|
@@ -11,7 +11,6 @@ import '@elliemae/ds-popperjs';
|
|
|
11
11
|
import 'styled-components';
|
|
12
12
|
import '../../../redux/reducers/index.js';
|
|
13
13
|
import '../../../configs/constants.js';
|
|
14
|
-
import 'react/jsx-runtime';
|
|
15
14
|
import { EditableCell } from '../../../exported-related/EditableCell.js';
|
|
16
15
|
import '@elliemae/ds-icons';
|
|
17
16
|
import '@elliemae/ds-utilities';
|
|
@@ -22,6 +21,7 @@ import '../../../configs/useRowFlattenization.js';
|
|
|
22
21
|
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
23
22
|
import 'core-js/modules/esnext.iterator.map.js';
|
|
24
23
|
import '../../../styled.js';
|
|
24
|
+
import 'react/jsx-runtime';
|
|
25
25
|
import '@elliemae/ds-form';
|
|
26
26
|
import '../../../parts/TableContent.js';
|
|
27
27
|
import '@elliemae/ds-grid';
|
|
@@ -11,7 +11,6 @@ import '@elliemae/ds-button';
|
|
|
11
11
|
import '@elliemae/ds-popperjs';
|
|
12
12
|
import '../../../redux/reducers/index.js';
|
|
13
13
|
import '../../../configs/constants.js';
|
|
14
|
-
import 'react/jsx-runtime';
|
|
15
14
|
import { EditableCell } from '../../../exported-related/EditableCell.js';
|
|
16
15
|
import '@elliemae/ds-icons';
|
|
17
16
|
import '@elliemae/ds-utilities';
|
|
@@ -22,6 +21,7 @@ import '../../../configs/useRowFlattenization.js';
|
|
|
22
21
|
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
23
22
|
import 'core-js/modules/esnext.iterator.map.js';
|
|
24
23
|
import '../../../styled.js';
|
|
24
|
+
import 'react/jsx-runtime';
|
|
25
25
|
import '@elliemae/ds-form';
|
|
26
26
|
import '../../../parts/TableContent.js';
|
|
27
27
|
import '@elliemae/ds-grid';
|
|
@@ -12,9 +12,9 @@ import '@elliemae/ds-popperjs';
|
|
|
12
12
|
import 'styled-components';
|
|
13
13
|
import '../../../../redux/reducers/index.js';
|
|
14
14
|
import { DATA_TESTID } from '../../../../configs/constants.js';
|
|
15
|
-
import 'react/jsx-runtime';
|
|
16
15
|
import '../../../../styled.js';
|
|
17
16
|
import '../../../../DataTableContext.js';
|
|
17
|
+
import 'react/jsx-runtime';
|
|
18
18
|
import '@elliemae/ds-icons';
|
|
19
19
|
import '@elliemae/ds-utilities';
|
|
20
20
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
@@ -12,9 +12,9 @@ import '@elliemae/ds-popperjs';
|
|
|
12
12
|
import 'styled-components';
|
|
13
13
|
import '../../../../redux/reducers/index.js';
|
|
14
14
|
import { DATA_TESTID } from '../../../../configs/constants.js';
|
|
15
|
-
import 'react/jsx-runtime';
|
|
16
15
|
import '../../../../styled.js';
|
|
17
16
|
import '../../../../DataTableContext.js';
|
|
17
|
+
import 'react/jsx-runtime';
|
|
18
18
|
import '@elliemae/ds-icons';
|
|
19
19
|
import '@elliemae/ds-utilities';
|
|
20
20
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
@@ -5,13 +5,12 @@ import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
|
5
5
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
-
import {
|
|
8
|
+
import { useEffect, useState, useCallback } from 'react';
|
|
9
9
|
import { DSButton } from '@elliemae/ds-button';
|
|
10
10
|
import { DSPopperJS } from '@elliemae/ds-popperjs';
|
|
11
11
|
import styled from 'styled-components';
|
|
12
12
|
import '../redux/reducers/index.js';
|
|
13
13
|
import { DATA_TESTID } from '../configs/constants.js';
|
|
14
|
-
import { jsx } from 'react/jsx-runtime';
|
|
15
14
|
import { useDispatchHeadersActions } from '../redux/reducers/headersReducers/useDispatchHeadersActions.js';
|
|
16
15
|
|
|
17
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -26,7 +25,22 @@ const Button = /*#__PURE__*/styled(DSButton).withConfig({
|
|
|
26
25
|
const PopperContent = /*#__PURE__*/styled.div.withConfig({
|
|
27
26
|
componentId: "sc-16i88ut-2"
|
|
28
27
|
})(["background-color:#fff;"]);
|
|
29
|
-
|
|
28
|
+
|
|
29
|
+
const ButtonTrap = _ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
cb
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return /*#__PURE__*/_jsx("span", {
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
tabIndex: 0,
|
|
36
|
+
onFocus: e => {
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
cb();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const FilterPopover = _ref3 => {
|
|
30
44
|
let {
|
|
31
45
|
column,
|
|
32
46
|
columnId,
|
|
@@ -38,7 +52,7 @@ const FilterPopover = _ref2 => {
|
|
|
38
52
|
innerRef,
|
|
39
53
|
ariaLabel,
|
|
40
54
|
customStyles
|
|
41
|
-
} =
|
|
55
|
+
} = _ref3;
|
|
42
56
|
const {
|
|
43
57
|
hideFilterButton,
|
|
44
58
|
hideFilterMenu
|
|
@@ -46,7 +60,6 @@ const FilterPopover = _ref2 => {
|
|
|
46
60
|
hideFilterButton: true,
|
|
47
61
|
hideFilterMenu: true
|
|
48
62
|
};
|
|
49
|
-
const popperRef = useRef(null);
|
|
50
63
|
const {
|
|
51
64
|
patchHeaderFilterButtonAndMenu,
|
|
52
65
|
patchHeader
|
|
@@ -77,6 +90,13 @@ const FilterPopover = _ref2 => {
|
|
|
77
90
|
};
|
|
78
91
|
|
|
79
92
|
const [referenceElement, setReferenceElement] = useState(null);
|
|
93
|
+
const buttonTrapCallback = useCallback(() => {
|
|
94
|
+
patchHeader(columnId, {
|
|
95
|
+
hideFilterMenu: true,
|
|
96
|
+
hideFilterButton: false
|
|
97
|
+
});
|
|
98
|
+
referenceElement?.focus();
|
|
99
|
+
}, [columnId, patchHeader, referenceElement]);
|
|
80
100
|
return /*#__PURE__*/_jsx("div", {
|
|
81
101
|
// This is here to prevent propagation, and not trigger the sort functionality
|
|
82
102
|
onClick: e => e.stopPropagation(),
|
|
@@ -99,11 +119,6 @@ const FilterPopover = _ref2 => {
|
|
|
99
119
|
},
|
|
100
120
|
style: {
|
|
101
121
|
display: 'flex'
|
|
102
|
-
},
|
|
103
|
-
onBlur: e => {
|
|
104
|
-
if (e.target !== referenceElement && !popperRef.current?.contains(e.relatedTarget)) {
|
|
105
|
-
referenceElement?.focus();
|
|
106
|
-
}
|
|
107
122
|
}
|
|
108
123
|
}, void 0, /*#__PURE__*/_jsx(FilterButton, {
|
|
109
124
|
hide: !isIconVisible,
|
|
@@ -135,24 +150,11 @@ const FilterPopover = _ref2 => {
|
|
|
135
150
|
minWidth: column.ref?.current?.offsetWidth ?? '0px'
|
|
136
151
|
}),
|
|
137
152
|
placementOrderPreference: ['bottom-end']
|
|
138
|
-
}, void 0, /*#__PURE__*/
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
patchHeader(columnId, {
|
|
144
|
-
hideFilterMenu: true,
|
|
145
|
-
hideFilterButton: false
|
|
146
|
-
});
|
|
147
|
-
e.preventDefault();
|
|
148
|
-
referenceElement.focus();
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
ref: popperRef,
|
|
154
|
-
children: menuContent
|
|
155
|
-
})));
|
|
153
|
+
}, void 0, /*#__PURE__*/_jsx(PopperContent, {}, void 0, /*#__PURE__*/_jsx(ButtonTrap, {
|
|
154
|
+
cb: buttonTrapCallback
|
|
155
|
+
}), menuContent, /*#__PURE__*/_jsx(ButtonTrap, {
|
|
156
|
+
cb: buttonTrapCallback
|
|
157
|
+
}))));
|
|
156
158
|
};
|
|
157
159
|
|
|
158
160
|
export { FilterPopover };
|
|
@@ -5,7 +5,7 @@ import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
|
5
5
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
-
import { useRef, useLayoutEffect, useMemo } from 'react';
|
|
8
|
+
import { useRef, useLayoutEffect, useMemo, useCallback } from 'react';
|
|
9
9
|
import { INTERNAL_COLUMNS } from '../../addons/Columns/index.js';
|
|
10
10
|
import { DATA_TESTID } from '../../configs/constants.js';
|
|
11
11
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
@@ -91,12 +91,18 @@ const DefaultRowContentRenderer = props => {
|
|
|
91
91
|
|
|
92
92
|
return padding;
|
|
93
93
|
}, [row.depth, visibleColumns]);
|
|
94
|
+
const handleSelectDisableRow = useCallback(e => {
|
|
95
|
+
if (disabledRows[row.uid]) {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
}
|
|
99
|
+
}, [disabledRows, row.uid]);
|
|
94
100
|
const PureRowContent = useMemo(() => {
|
|
95
101
|
const DetailsView = row.original.tableRowDetails;
|
|
96
102
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
97
103
|
children: [/*#__PURE__*/jsx(StyledCellContainer, _objectSpread(_objectSpread({
|
|
98
104
|
ref: rowRef,
|
|
99
|
-
tabIndex: 0,
|
|
105
|
+
tabIndex: disabledRows[row.uid] ? -1 : 0,
|
|
100
106
|
role: "row",
|
|
101
107
|
"aria-rowindex": row.realIndex + 1,
|
|
102
108
|
"aria-label": ariaLabelMessage(row, selection?.[row.uid] === true),
|
|
@@ -115,6 +121,7 @@ const DefaultRowContentRenderer = props => {
|
|
|
115
121
|
selected: noSelectionColumn && selection?.[row.uid] === true,
|
|
116
122
|
disabled: disabledRows[row.uid],
|
|
117
123
|
"data-testid": DATA_TESTID.DATA_TABLE_ROW_CONTENT,
|
|
124
|
+
onMouseDown: handleSelectDisableRow,
|
|
118
125
|
children: /*#__PURE__*/_jsx(Cells, {
|
|
119
126
|
row: row,
|
|
120
127
|
isRowSelected: selectedRowId === row.uid,
|
|
@@ -44,12 +44,26 @@ const useRowRendererHandlers = _ref => {
|
|
|
44
44
|
const {
|
|
45
45
|
tableProps: {
|
|
46
46
|
onRowClick,
|
|
47
|
-
onRowFocus
|
|
47
|
+
onRowFocus,
|
|
48
|
+
disabledRows
|
|
48
49
|
},
|
|
49
50
|
virtualListHelpers: {
|
|
50
51
|
scrollToIndex
|
|
51
52
|
}
|
|
52
53
|
} = useContext(DataTableContext);
|
|
54
|
+
|
|
55
|
+
const isOptionFocuseable = opt => !disabledRows[opt.id];
|
|
56
|
+
|
|
57
|
+
const findInCircularList = function (list, from, criteria) {
|
|
58
|
+
let step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
59
|
+
|
|
60
|
+
for (let i = (from + step + list.length) % list.length; i !== from && from > -1; i = (i + step + list.length) % list.length) {
|
|
61
|
+
if (criteria(list[i])) return i;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return from; // return same item
|
|
65
|
+
};
|
|
66
|
+
|
|
53
67
|
const {
|
|
54
68
|
setSelectedRowId,
|
|
55
69
|
setFocusedRowId
|
|
@@ -60,6 +74,7 @@ const useRowRendererHandlers = _ref => {
|
|
|
60
74
|
uid
|
|
61
75
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : row;
|
|
62
76
|
// setSelectedRowId(null);
|
|
77
|
+
if (disabledRows[uid]) return;
|
|
63
78
|
onRowClick(original, e, uid);
|
|
64
79
|
onRowFocus({
|
|
65
80
|
itemIndex,
|
|
@@ -71,7 +86,7 @@ const useRowRendererHandlers = _ref => {
|
|
|
71
86
|
},
|
|
72
87
|
original
|
|
73
88
|
}, e);
|
|
74
|
-
}, [row, onRowClick, onRowFocus, itemIndex, scrollToIndex]);
|
|
89
|
+
}, [row, disabledRows, onRowClick, onRowFocus, itemIndex, scrollToIndex]);
|
|
75
90
|
const isActive = draggableProps && draggableProps.active;
|
|
76
91
|
const handleKeyDown = useCallback(e => {
|
|
77
92
|
if (isDragOverlay || isActive) {
|
|
@@ -98,24 +113,27 @@ const useRowRendererHandlers = _ref => {
|
|
|
98
113
|
|
|
99
114
|
if (e.code === 'ArrowDown') {
|
|
100
115
|
e.preventDefault();
|
|
101
|
-
|
|
116
|
+
e.stopPropagation();
|
|
117
|
+
const next = findInCircularList(items, itemIndex, isOptionFocuseable);
|
|
118
|
+
setFocusedRowId(items[next].uid);
|
|
102
119
|
}
|
|
103
120
|
|
|
104
121
|
if (e.code === 'ArrowUp') {
|
|
105
122
|
e.preventDefault();
|
|
106
|
-
|
|
123
|
+
const prev = findInCircularList(items, itemIndex, isOptionFocuseable, -1);
|
|
124
|
+
setFocusedRowId(items[prev].uid);
|
|
107
125
|
}
|
|
108
|
-
}, [isDragOverlay, isActive, selectedRowId, row, setSelectedRowId, handleItemClick, itemIndex,
|
|
126
|
+
}, [isDragOverlay, isActive, selectedRowId, row, setSelectedRowId, handleItemClick, items, itemIndex, isOptionFocuseable, setFocusedRowId]);
|
|
109
127
|
const handleOnBlur = useCallback(e => {
|
|
110
128
|
if (e.relatedTarget?.getAttribute('data-testid') === 'data-table-row-content') {
|
|
111
129
|
setSelectedRowId(null);
|
|
112
130
|
}
|
|
113
131
|
}, [setSelectedRowId]);
|
|
114
132
|
const handleOnFocus = useCallback(e => {
|
|
115
|
-
if (e.target && e.target.getAttribute('data-testid') === DATA_TESTID.DATA_TABLE_ROW_CONTENT) {
|
|
133
|
+
if (!disabledRows[row.uid] && e.target && e.target.getAttribute('data-testid') === DATA_TESTID.DATA_TABLE_ROW_CONTENT) {
|
|
116
134
|
setFocusedRowId(row.uid);
|
|
117
135
|
}
|
|
118
|
-
}, [row.uid, setFocusedRowId]);
|
|
136
|
+
}, [row.uid, setFocusedRowId, disabledRows]);
|
|
119
137
|
return {
|
|
120
138
|
handleItemClick,
|
|
121
139
|
handleKeyDown,
|
package/esm/parts/Cells/Cell.js
CHANGED
|
@@ -63,7 +63,8 @@ const Cell = _ref2 => {
|
|
|
63
63
|
const ctx = useContext(DataTableContext);
|
|
64
64
|
const {
|
|
65
65
|
tableProps: {
|
|
66
|
-
cellRendererProps
|
|
66
|
+
cellRendererProps,
|
|
67
|
+
disabledRows
|
|
67
68
|
}
|
|
68
69
|
} = ctx;
|
|
69
70
|
const {
|
|
@@ -112,7 +113,7 @@ const Cell = _ref2 => {
|
|
|
112
113
|
return null;
|
|
113
114
|
}, [DefaultCellContentJSX, cellProps, column]);
|
|
114
115
|
return /*#__PURE__*/jsx(PureStandardCell, _objectSpread(_objectSpread({}, cellProps), {}, {
|
|
115
|
-
children: column.editable ? EditableContentJSX : DefaultCellContentJSX
|
|
116
|
+
children: column.editable && !disabledRows[row.id] ? EditableContentJSX : DefaultCellContentJSX
|
|
116
117
|
}));
|
|
117
118
|
};
|
|
118
119
|
|
|
@@ -16,9 +16,9 @@ import '@elliemae/ds-popperjs';
|
|
|
16
16
|
import 'styled-components';
|
|
17
17
|
import '../../redux/reducers/index.js';
|
|
18
18
|
import { DATA_TESTID } from '../../configs/constants.js';
|
|
19
|
-
import 'react/jsx-runtime';
|
|
20
19
|
import '../../styled.js';
|
|
21
20
|
import DataTableContext from '../../DataTableContext.js';
|
|
21
|
+
import 'react/jsx-runtime';
|
|
22
22
|
import '@elliemae/ds-utilities';
|
|
23
23
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
24
24
|
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
@@ -21,9 +21,9 @@ import '@elliemae/ds-popperjs';
|
|
|
21
21
|
import 'styled-components';
|
|
22
22
|
import '../../redux/reducers/index.js';
|
|
23
23
|
import '../../configs/constants.js';
|
|
24
|
-
import { jsx } from 'react/jsx-runtime';
|
|
25
24
|
import '../../styled.js';
|
|
26
25
|
import '../../DataTableContext.js';
|
|
26
|
+
import { jsx } from 'react/jsx-runtime';
|
|
27
27
|
import '@elliemae/ds-icons';
|
|
28
28
|
import '@elliemae/ds-utilities';
|
|
29
29
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
package/esm/parts/Row.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { connect } from 'react-redux';
|
|
4
|
+
import { styled } from '@elliemae/ds-system';
|
|
4
5
|
import DataTableContext from '../DataTableContext.js';
|
|
5
6
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
6
7
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
@@ -21,6 +22,15 @@ const setItemRefs = (measureRef, draggableRef, ref) => {
|
|
|
21
22
|
setMultipleRefs(...refsToSet)(ref);
|
|
22
23
|
};
|
|
23
24
|
|
|
25
|
+
const StyledRow = styled('div')`
|
|
26
|
+
cursor: ${_ref => {
|
|
27
|
+
let {
|
|
28
|
+
disabled
|
|
29
|
+
} = _ref;
|
|
30
|
+
return disabled ? 'not-allowed' : 'normal';
|
|
31
|
+
}};
|
|
32
|
+
`;
|
|
33
|
+
|
|
24
34
|
const RowComp = props => {
|
|
25
35
|
const {
|
|
26
36
|
row,
|
|
@@ -31,11 +41,17 @@ const RowComp = props => {
|
|
|
31
41
|
selectedRowId
|
|
32
42
|
} = props;
|
|
33
43
|
const ctx = useContext(DataTableContext);
|
|
44
|
+
const {
|
|
45
|
+
tableProps: {
|
|
46
|
+
disabledRows
|
|
47
|
+
}
|
|
48
|
+
} = ctx;
|
|
34
49
|
const {
|
|
35
50
|
draggableProps
|
|
36
51
|
} = useContext(SortableItemContext);
|
|
37
52
|
const draggableRef = draggableProps && draggableProps.setNodeRef;
|
|
38
|
-
return /*#__PURE__*/jsx(
|
|
53
|
+
return /*#__PURE__*/jsx(StyledRow, {
|
|
54
|
+
disabled: disabledRows[row.id],
|
|
39
55
|
style: !isDragOverlay ? itemWrapperStyle : {},
|
|
40
56
|
ref: ref => setItemRefs(measureRef, draggableRef, ref),
|
|
41
57
|
children: /*#__PURE__*/_jsx(RowVariantMapItem, {
|
|
@@ -12,9 +12,9 @@ import '@elliemae/ds-popperjs';
|
|
|
12
12
|
import 'styled-components';
|
|
13
13
|
import '../../redux/reducers/index.js';
|
|
14
14
|
import '../../configs/constants.js';
|
|
15
|
-
import { jsx } from 'react/jsx-runtime';
|
|
16
15
|
import '../../styled.js';
|
|
17
16
|
import '../../DataTableContext.js';
|
|
17
|
+
import { jsx } from 'react/jsx-runtime';
|
|
18
18
|
import '@elliemae/ds-icons';
|
|
19
19
|
import '@elliemae/ds-utilities';
|
|
20
20
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
@@ -7,7 +7,7 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
|
7
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
8
|
import React, { useContext, useState, useMemo } from 'react';
|
|
9
9
|
import { connect } from 'react-redux';
|
|
10
|
-
import {
|
|
10
|
+
import { StyledDataTableContentWrapper, StyledTableWrapper } from '../styled.js';
|
|
11
11
|
import DataTableContext from '../DataTableContext.js';
|
|
12
12
|
import { Pagination } from '../addons/Pagination/Pagination.js';
|
|
13
13
|
import VirtualRowsList from './VirtualRowsList.js';
|
|
@@ -56,7 +56,7 @@ const TableContentComponent = props => {
|
|
|
56
56
|
visibleColumns
|
|
57
57
|
} = useContext(DataTableContext);
|
|
58
58
|
const [shiftKeyPressed, setShiftKeyPressed] = useState(false);
|
|
59
|
-
const PureTableContent = useMemo(() => /*#__PURE__*/jsxs(
|
|
59
|
+
const PureTableContent = useMemo(() => /*#__PURE__*/jsxs(StyledDataTableContentWrapper, {
|
|
60
60
|
"data-testid": DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER,
|
|
61
61
|
height: height,
|
|
62
62
|
width: width,
|
package/esm/styled.js
CHANGED
|
@@ -54,14 +54,17 @@ const StyledFocusWithin = /*#__PURE__*/styled(Grid).withConfig({
|
|
|
54
54
|
})([":focus-within{", "}"], props => props.hideFocus ? '' : styledFocusCss(props));
|
|
55
55
|
const StyledDataTableWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
56
56
|
componentId: "sc-38sgfo-1"
|
|
57
|
-
})(["width:", ";height:", ";
|
|
57
|
+
})(["width:", ";height:", ";"], props => sizeToCss(props.width ?? ' 100%'), props => sizeToCss(props.height ?? ' 100%'));
|
|
58
|
+
const StyledDataTableContentWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
59
|
+
componentId: "sc-38sgfo-2"
|
|
60
|
+
})(["user-select:", ";width:100%;height:100%;"], _ref2 => {
|
|
58
61
|
let {
|
|
59
62
|
noSelectionAllowed
|
|
60
63
|
} = _ref2;
|
|
61
64
|
return noSelectionAllowed ? 'none' : 'auto';
|
|
62
65
|
});
|
|
63
66
|
const StyledTableWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
64
|
-
componentId: "sc-38sgfo-
|
|
67
|
+
componentId: "sc-38sgfo-3"
|
|
65
68
|
})(["display:inline-block;border-spacing:0;z-index:0;position:relative;", ""], _ref3 => {
|
|
66
69
|
let {
|
|
67
70
|
width = '100%',
|
|
@@ -73,7 +76,7 @@ const StyledTableWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
73
76
|
`;
|
|
74
77
|
});
|
|
75
78
|
const StyledTableContentWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
76
|
-
componentId: "sc-38sgfo-
|
|
79
|
+
componentId: "sc-38sgfo-4"
|
|
77
80
|
})(["position:relative;", ""], _ref4 => {
|
|
78
81
|
let {
|
|
79
82
|
height = 'auto'
|
|
@@ -83,7 +86,7 @@ const StyledTableContentWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
83
86
|
`;
|
|
84
87
|
});
|
|
85
88
|
const StyledVirtualListWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
86
|
-
componentId: "sc-38sgfo-
|
|
89
|
+
componentId: "sc-38sgfo-5"
|
|
87
90
|
})(["overflow:auto;", ""], _ref5 => {
|
|
88
91
|
let {
|
|
89
92
|
height = 'auto',
|
|
@@ -114,17 +117,17 @@ const getGridTemplateColumnsStyle = _ref6 => {
|
|
|
114
117
|
};
|
|
115
118
|
|
|
116
119
|
const StyledHeadWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
117
|
-
componentId: "sc-38sgfo-
|
|
120
|
+
componentId: "sc-38sgfo-6"
|
|
118
121
|
})(["position:relative;position:sticky;top:0;z-index:4;background:white;width:", ";"], props => props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%');
|
|
119
122
|
const StyledHeadTr = /*#__PURE__*/styled(Grid).withConfig({
|
|
120
|
-
componentId: "sc-38sgfo-
|
|
123
|
+
componentId: "sc-38sgfo-7"
|
|
121
124
|
})(["", ";", ";border-right:1px solid ", ";border-bottom:1px solid ", ";grid-auto-flow:column;"], props => props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '', props => getGridTemplateColumnsStyle({
|
|
122
125
|
cols: props.cols,
|
|
123
126
|
isExpandable: props.isExpandable,
|
|
124
127
|
colsLayoutStyle: props.colsLayoutStyle
|
|
125
128
|
}), props => props.theme.colors.neutral['080'], props => props.theme.colors.neutral['080']);
|
|
126
129
|
const StyledHeadTh = /*#__PURE__*/styled.div.withConfig({
|
|
127
|
-
componentId: "sc-38sgfo-
|
|
130
|
+
componentId: "sc-38sgfo-8"
|
|
128
131
|
})(["min-height:24px;line-height:normal;font-weight:600;text-transform:uppercase;font-size:0.923rem;text-align:left;", " color:#353c46;min-height:1.84615rem;position:sticky;z-index:", ";display:flex;justify-content:space-between;box-sizing:border-box;outline:none;", ":focus{&:after{display:block;content:' ';position:absolute;top:0;left:0;right:0;bottom:0;border:2px solid ", ";pointer-events:none;z-index:", ";}}"], columnPadding, ZIndexDataTable.HEADER_ROW, props => props.isDraggingActive ? '' : `:hover {
|
|
129
132
|
&:after {
|
|
130
133
|
display: block;
|
|
@@ -141,10 +144,10 @@ const StyledHeadTh = /*#__PURE__*/styled.div.withConfig({
|
|
|
141
144
|
cursor: pointer;
|
|
142
145
|
}`, props => props.theme.colors.brand[700], ZIndexDataTable.FOCUS_BORDER);
|
|
143
146
|
const StyledHeaderRightIconsWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
144
|
-
componentId: "sc-38sgfo-
|
|
147
|
+
componentId: "sc-38sgfo-9"
|
|
145
148
|
})(["height:100%;display:flex;align-items:center;max-height:24px;"]);
|
|
146
149
|
const StyledResizer = /*#__PURE__*/styled.div.withConfig({
|
|
147
|
-
componentId: "sc-38sgfo-
|
|
150
|
+
componentId: "sc-38sgfo-10"
|
|
148
151
|
})(["display:inline-block;background:", ";width:4px;height:100%;position:absolute;right:0;top:0;z-index:1;touch-action:none;cursor:col-resize;"], _ref7 => {
|
|
149
152
|
let {
|
|
150
153
|
isResizing,
|
|
@@ -154,19 +157,19 @@ const StyledResizer = /*#__PURE__*/styled.div.withConfig({
|
|
|
154
157
|
}); // CELL ***********************************************************************/
|
|
155
158
|
|
|
156
159
|
const StyledActionCell = /*#__PURE__*/styled.div.withConfig({
|
|
157
|
-
componentId: "sc-38sgfo-
|
|
160
|
+
componentId: "sc-38sgfo-11"
|
|
158
161
|
})(["position:relative;position:sticky;display:inline-block;right:0;background:white;"]);
|
|
159
162
|
const StyledCell = /*#__PURE__*/styled.div.withConfig({
|
|
160
|
-
componentId: "sc-38sgfo-
|
|
163
|
+
componentId: "sc-38sgfo-12"
|
|
161
164
|
})(["", " display:flex;align-items:center;width:100%;position:relative;"], cellPadding);
|
|
162
165
|
const StyledCellContent = /*#__PURE__*/styled.div.withConfig({
|
|
163
|
-
componentId: "sc-38sgfo-
|
|
166
|
+
componentId: "sc-38sgfo-13"
|
|
164
167
|
})(["display:grid;justify-self:flex-end;flex:1 1 auto;width:100%;height:100%;align-items:center;"]);
|
|
165
168
|
const StyledPencilIcon = /*#__PURE__*/styled(EditPencil).withConfig({
|
|
166
|
-
componentId: "sc-38sgfo-
|
|
169
|
+
componentId: "sc-38sgfo-14"
|
|
167
170
|
})([""]);
|
|
168
171
|
const StyledEditableContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
169
|
-
componentId: "sc-38sgfo-
|
|
172
|
+
componentId: "sc-38sgfo-15"
|
|
170
173
|
})(["width:100%;height:100%;align-items:center;& ", "{display:", ";}&:hover{", "{display:block;}}&:focus{", " ", "{display:block;}}outline:none;"], StyledPencilIcon, _ref8 => {
|
|
171
174
|
let {
|
|
172
175
|
shouldDisplayEditIcon
|
|
@@ -175,10 +178,10 @@ const StyledEditableContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
|
175
178
|
}, StyledPencilIcon, styledFocusCss, StyledPencilIcon); // ROW ************************************************************************/
|
|
176
179
|
|
|
177
180
|
const StyledFullsizeGrid = /*#__PURE__*/styled(Grid).withConfig({
|
|
178
|
-
componentId: "sc-38sgfo-
|
|
181
|
+
componentId: "sc-38sgfo-16"
|
|
179
182
|
})(["position:relative;z-index:", ";min-height:", ";height:", ";"], ZIndexDataTable.ROW, props => props.minHeight || '36px', props => props.height || 'auto');
|
|
180
183
|
const GroupHeaderContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
181
|
-
componentId: "sc-38sgfo-
|
|
184
|
+
componentId: "sc-38sgfo-17"
|
|
182
185
|
})(["position:relative;background-color:", ";align-items:center;padding:0 ", ";border-top:1px solid ", ";grid-template-columns:min-content 1fr;"], _ref9 => {
|
|
183
186
|
let {
|
|
184
187
|
theme
|
|
@@ -191,10 +194,10 @@ const GroupHeaderContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
|
191
194
|
return theme.colors.brand[300];
|
|
192
195
|
});
|
|
193
196
|
const GroupHeaderTitle = /*#__PURE__*/styled.span.withConfig({
|
|
194
|
-
componentId: "sc-38sgfo-
|
|
197
|
+
componentId: "sc-38sgfo-18"
|
|
195
198
|
})(["font-weight:", ";font-size:12px;color:", ";"], props => props.theme.fontWeights.semibold, props => props.theme.colors.neutral[700]);
|
|
196
199
|
const StyledCellContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
197
|
-
componentId: "sc-38sgfo-
|
|
200
|
+
componentId: "sc-38sgfo-19"
|
|
198
201
|
})(["position:relative;z-index:2;min-height:", ";height:", ";width:", ";", ";", ";background-color:", ";outline:none;:focus{", "}", " ", " box-shadow:0 2px 4px 0 ", ";opacity:", ";", " color:", ";"], props => props.minHeight || '36px', props => props.height || 'auto', props => props.colLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%', props => props.isDragOverlay ? 'width: fit-content;' : '', props => getGridTemplateColumnsStyle({
|
|
199
202
|
cols: props.cols,
|
|
200
203
|
colsLayoutStyle: props.colLayoutStyle,
|
|
@@ -228,4 +231,4 @@ const StyledCellContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
|
228
231
|
border: 1px solid ${props.theme.colors.brand[500]};
|
|
229
232
|
`, props => props.disabled ? props.theme.colors.neutral['500'] : '#333333');
|
|
230
233
|
|
|
231
|
-
export { GroupHeaderContainer, GroupHeaderTitle, StyledActionCell, StyledCell, StyledCellContainer, StyledCellContent, StyledDataTableWrapper, StyledEditableContainer, StyledFocusWithin, StyledFullsizeGrid, StyledHeadTh, StyledHeadTr, StyledHeadWrapper, StyledHeaderRightIconsWrapper, StyledPencilIcon, StyledResizer, StyledTableContentWrapper, StyledTableWrapper, StyledVirtualListWrapper };
|
|
234
|
+
export { GroupHeaderContainer, GroupHeaderTitle, StyledActionCell, StyledCell, StyledCellContainer, StyledCellContent, StyledDataTableContentWrapper, StyledDataTableWrapper, StyledEditableContainer, StyledFocusWithin, StyledFullsizeGrid, StyledHeadTh, StyledHeadTr, StyledHeadWrapper, StyledHeaderRightIconsWrapper, StyledPencilIcon, StyledResizer, StyledTableContentWrapper, StyledTableWrapper, StyledVirtualListWrapper };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-data-table",
|
|
3
|
-
"version": "2.4.3-rc.
|
|
3
|
+
"version": "2.4.3-rc.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Data Table",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -570,24 +570,24 @@
|
|
|
570
570
|
"dependencies": {
|
|
571
571
|
"@dnd-kit/core": "~4.0.1",
|
|
572
572
|
"@dnd-kit/sortable": "~5.0.0",
|
|
573
|
-
"@elliemae/ds-button": "2.4.3-rc.
|
|
574
|
-
"@elliemae/ds-circular-progress-indicator": "2.4.3-rc.
|
|
575
|
-
"@elliemae/ds-controlled-form": "2.4.3-rc.
|
|
576
|
-
"@elliemae/ds-drag-and-drop": "2.4.3-rc.
|
|
577
|
-
"@elliemae/ds-dropdownmenu": "2.4.3-rc.
|
|
578
|
-
"@elliemae/ds-form": "2.4.3-rc.
|
|
579
|
-
"@elliemae/ds-form-layout-blocks": "2.4.3-rc.
|
|
580
|
-
"@elliemae/ds-grid": "2.4.3-rc.
|
|
581
|
-
"@elliemae/ds-icons": "2.4.3-rc.
|
|
582
|
-
"@elliemae/ds-indeterminate-progress-indicator": "2.4.3-rc.
|
|
583
|
-
"@elliemae/ds-pagination": "2.4.3-rc.
|
|
584
|
-
"@elliemae/ds-pills": "2.4.3-rc.
|
|
585
|
-
"@elliemae/ds-popperjs": "2.4.3-rc.
|
|
586
|
-
"@elliemae/ds-props-helpers": "2.4.3-rc.
|
|
587
|
-
"@elliemae/ds-system": "2.4.3-rc.
|
|
588
|
-
"@elliemae/ds-toolbar": "2.4.3-rc.
|
|
589
|
-
"@elliemae/ds-truncated-tooltip-text": "2.4.3-rc.
|
|
590
|
-
"@elliemae/ds-utilities": "2.4.3-rc.
|
|
573
|
+
"@elliemae/ds-button": "2.4.3-rc.9",
|
|
574
|
+
"@elliemae/ds-circular-progress-indicator": "2.4.3-rc.9",
|
|
575
|
+
"@elliemae/ds-controlled-form": "2.4.3-rc.9",
|
|
576
|
+
"@elliemae/ds-drag-and-drop": "2.4.3-rc.9",
|
|
577
|
+
"@elliemae/ds-dropdownmenu": "2.4.3-rc.9",
|
|
578
|
+
"@elliemae/ds-form": "2.4.3-rc.9",
|
|
579
|
+
"@elliemae/ds-form-layout-blocks": "2.4.3-rc.9",
|
|
580
|
+
"@elliemae/ds-grid": "2.4.3-rc.9",
|
|
581
|
+
"@elliemae/ds-icons": "2.4.3-rc.9",
|
|
582
|
+
"@elliemae/ds-indeterminate-progress-indicator": "2.4.3-rc.9",
|
|
583
|
+
"@elliemae/ds-pagination": "2.4.3-rc.9",
|
|
584
|
+
"@elliemae/ds-pills": "2.4.3-rc.9",
|
|
585
|
+
"@elliemae/ds-popperjs": "2.4.3-rc.9",
|
|
586
|
+
"@elliemae/ds-props-helpers": "2.4.3-rc.9",
|
|
587
|
+
"@elliemae/ds-system": "2.4.3-rc.9",
|
|
588
|
+
"@elliemae/ds-toolbar": "2.4.3-rc.9",
|
|
589
|
+
"@elliemae/ds-truncated-tooltip-text": "2.4.3-rc.9",
|
|
590
|
+
"@elliemae/ds-utilities": "2.4.3-rc.9",
|
|
591
591
|
"@reduxjs/toolkit": "~1.6.2",
|
|
592
592
|
"csstype": "~3.0.9",
|
|
593
593
|
"moment": "~2.29.1",
|
package/types/styled.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ interface WidthAndHeight {
|
|
|
4
4
|
height?: string | number;
|
|
5
5
|
}
|
|
6
6
|
export declare const StyledFocusWithin: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/types/react-desc-prop-types").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
-
export declare const StyledDataTableWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, WidthAndHeight
|
|
7
|
+
export declare const StyledDataTableWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, WidthAndHeight, never>;
|
|
8
|
+
export declare const StyledDataTableContentWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, WidthAndHeight & {
|
|
8
9
|
noSelectionAllowed: boolean;
|
|
9
10
|
}, never>;
|
|
10
11
|
export declare const StyledTableWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, WidthAndHeight, never>;
|